aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2010-07-23 19:37:40 +0000
committerH.J. Lu <hongjiu.lu@intel.com>2010-07-23 19:37:40 +0000
commite59b0ef2e7a1fb44791d473ee416aeb01fcb169c (patch)
tree437dca120093cc7b1f6debf6f6b31779526c7192
parentf25b023a0d9de6a6c1e1965d93ba6028cb03fc7d (diff)
parent92ac755201aad4366eaff2b75b3239637bee3590 (diff)
Merged with trunk at revision 162480.ifunc
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ifunc@162483 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog24
-rw-r--r--MAINTAINERS5
-rw-r--r--Makefile.in1
-rw-r--r--Makefile.tpl1
-rw-r--r--config/ChangeLog4
-rw-r--r--config/gc++filt.m426
-rw-r--r--contrib/ChangeLog17
-rwxr-xr-xcontrib/check_GNU_style.sh117
-rwxr-xr-xcontrib/compare-debug6
-rw-r--r--contrib/make_sunver.pl280
-rw-r--r--fixincludes/ChangeLog7
-rw-r--r--fixincludes/fixincl.x54
-rw-r--r--fixincludes/inclhack.def20
-rw-r--r--fixincludes/tests/base/pthread.h14
-rw-r--r--gcc/ChangeLog3905
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in421
-rw-r--r--gcc/ada/ChangeLog50
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in2
-rw-r--r--gcc/ada/gcc-interface/decl.c96
-rw-r--r--gcc/ada/gcc-interface/misc.c56
-rw-r--r--gcc/ada/gcc-interface/targtyps.c1
-rw-r--r--gcc/ada/gcc-interface/trans.c46
-rw-r--r--gcc/ada/gcc-interface/utils.c145
-rw-r--r--gcc/ada/gcc-interface/utils2.c8
-rw-r--r--gcc/alias.c199
-rw-r--r--gcc/attribs.c16
-rw-r--r--gcc/auto-inc-dec.c10
-rw-r--r--gcc/bb-reorder.c15
-rw-r--r--gcc/bb-reorder.h37
-rw-r--r--gcc/bt-load.c2
-rw-r--r--gcc/builtins.c472
-rw-r--r--gcc/builtins.def1
-rw-r--r--gcc/builtins.h49
-rw-r--r--gcc/c-decl.c82
-rw-r--r--gcc/c-family/ChangeLog37
-rw-r--r--gcc/c-family/c-common.c46
-rw-r--r--gcc/c-family/c-common.h8
-rw-r--r--gcc/c-family/c-format.c2
-rw-r--r--gcc/c-family/c-semantics.c4
-rw-r--r--gcc/c-parser.c9
-rw-r--r--gcc/c-tree.h1
-rw-r--r--gcc/c-typeck.c56
-rw-r--r--gcc/caller-save.c40
-rw-r--r--gcc/calls.c10
-rw-r--r--gcc/cfg.c1
-rw-r--r--gcc/cfganal.c1
-rw-r--r--gcc/cfgbuild.c1
-rw-r--r--gcc/cfgcleanup.c1
-rw-r--r--gcc/cfgexpand.c129
-rw-r--r--gcc/cfghooks.c2
-rw-r--r--gcc/cfgloop.c2
-rw-r--r--gcc/cfgloop.h40
-rw-r--r--gcc/cfgloopanal.c40
-rw-r--r--gcc/cgraph.c141
-rw-r--r--gcc/cgraph.h11
-rw-r--r--gcc/cgraphbuild.c20
-rw-r--r--gcc/cgraphunit.c94
-rw-r--r--gcc/combine.c3
-rw-r--r--gcc/common.opt8
-rw-r--r--gcc/config.gcc28
-rw-r--r--gcc/config.in16
-rw-r--r--gcc/config/alpha/alpha.c15
-rw-r--r--gcc/config/arc/arc.c1
-rw-r--r--gcc/config/arm/arm-modes.def8
-rw-r--r--gcc/config/arm/arm-protos.h5
-rw-r--r--gcc/config/arm/arm.c602
-rw-r--r--gcc/config/arm/arm.h14
-rw-r--r--gcc/config/arm/arm.md1171
-rw-r--r--gcc/config/arm/arm_neon.h108
-rw-r--r--gcc/config/arm/constraints.md19
-rw-r--r--gcc/config/arm/cortex-a8.md15
-rw-r--r--gcc/config/arm/linux-eabi.h1
-rw-r--r--gcc/config/arm/neon.md799
-rw-r--r--gcc/config/arm/neon.ml39
-rw-r--r--gcc/config/arm/pe.c1
-rw-r--r--gcc/config/arm/predicates.md39
-rw-r--r--gcc/config/arm/thumb2.md63
-rw-r--r--gcc/config/arm/vec-common.md16
-rw-r--r--gcc/config/arm/vfp.md2
-rw-r--r--gcc/config/avr/avr.c1
-rw-r--r--gcc/config/bfin/bfin.c1
-rw-r--r--gcc/config/cris/cris.c1
-rw-r--r--gcc/config/crx/crx.c1
-rw-r--r--gcc/config/darwin-c.c1
-rw-r--r--gcc/config/darwin.c19
-rw-r--r--gcc/config/darwin.h21
-rw-r--r--gcc/config/darwin9.h24
-rw-r--r--gcc/config/elfos.h2
-rw-r--r--gcc/config/fr30/fr30.c1
-rw-r--r--gcc/config/frv/frv.c10
-rw-r--r--gcc/config/h8300/h8300.c5
-rw-r--r--gcc/config/host-darwin.c1
-rw-r--r--gcc/config/host-solaris.c69
-rw-r--r--gcc/config/i386/cpuid.h4
-rw-r--r--gcc/config/i386/cygming-crtbegin.c4
-rw-r--r--gcc/config/i386/cygming-crtend.c4
-rw-r--r--gcc/config/i386/cygming.h5
-rw-r--r--gcc/config/i386/cygwin.h2
-rw-r--r--gcc/config/i386/darwin.h8
-rw-r--r--gcc/config/i386/freebsd.h3
-rw-r--r--gcc/config/i386/i386-builtin-types.def6
-rw-r--r--gcc/config/i386/i386-c.c6
-rw-r--r--gcc/config/i386/i386-protos.h8
-rw-r--r--gcc/config/i386/i386.c1732
-rw-r--r--gcc/config/i386/i386.h27
-rw-r--r--gcc/config/i386/i386.md517
-rw-r--r--gcc/config/i386/i386.opt12
-rw-r--r--gcc/config/i386/immintrin.h144
-rw-r--r--gcc/config/i386/linux.h3
-rw-r--r--gcc/config/i386/linux64.h3
-rw-r--r--gcc/config/i386/mingw32.h2
-rw-r--r--gcc/config/i386/netware.c1
-rw-r--r--gcc/config/i386/nwld.c1
-rw-r--r--gcc/config/i386/sol2-10.h4
-rw-r--r--gcc/config/i386/sol2-unwind.h113
-rw-r--r--gcc/config/i386/sol2.h7
-rw-r--r--gcc/config/i386/sse.md78
-rw-r--r--gcc/config/i386/vx-common.h6
-rw-r--r--gcc/config/i386/winnt-cxx.c15
-rw-r--r--gcc/config/i386/winnt-stubs.c1
-rw-r--r--gcc/config/i386/winnt.c3
-rw-r--r--gcc/config/ia64/ia64-c.c1
-rw-r--r--gcc/config/ia64/ia64-protos.h1
-rw-r--r--gcc/config/ia64/ia64.c55
-rw-r--r--gcc/config/ia64/ia64.h15
-rw-r--r--gcc/config/ia64/t-ia645
-rw-r--r--gcc/config/iq2000/iq2000.c9
-rw-r--r--gcc/config/linux-android.h6
-rw-r--r--gcc/config/linux.h2
-rw-r--r--gcc/config/lm32/lm32.c1
-rw-r--r--gcc/config/m32c/m32c-pragma.c1
-rw-r--r--gcc/config/m32c/m32c.c11
-rw-r--r--gcc/config/m32r/m32r.c1
-rw-r--r--gcc/config/m68hc11/m68hc11.c1
-rw-r--r--gcc/config/m68k/m68k.c5
-rw-r--r--gcc/config/mcore/mcore.c1
-rw-r--r--gcc/config/mep/mep-pragma.c1
-rw-r--r--gcc/config/mep/mep.c19
-rw-r--r--gcc/config/mips/mips.c74
-rw-r--r--gcc/config/mips/mips.h4
-rw-r--r--gcc/config/mips/mips16.S4
-rw-r--r--gcc/config/mmix/mmix.c1
-rw-r--r--gcc/config/mn10300/mn10300.c1
-rw-r--r--gcc/config/moxie/moxie.c1
-rw-r--r--gcc/config/netbsd-aout.h2
-rw-r--r--gcc/config/openbsd.h2
-rw-r--r--gcc/config/pa/pa.c22
-rw-r--r--gcc/config/pa/pa.h9
-rw-r--r--gcc/config/pa/pa.md77
-rw-r--r--gcc/config/pa/predicates.md58
-rw-r--r--gcc/config/pa/som.h2
-rw-r--r--gcc/config/pdp11/pdp11.c1
-rw-r--r--gcc/config/picochip/picochip.c1
-rw-r--r--gcc/config/picochip/picochip.md2
-rw-r--r--gcc/config/rs6000/darwin.h5
-rw-r--r--gcc/config/rs6000/e500crtres64gprctr.asm52
-rw-r--r--gcc/config/rs6000/e500crtsav64gprctr.asm34
-rw-r--r--gcc/config/rs6000/e500crtsavg64gprctr.asm34
-rw-r--r--gcc/config/rs6000/rs6000-c.c1
-rw-r--r--gcc/config/rs6000/rs6000-protos.h3
-rw-r--r--gcc/config/rs6000/rs6000.c353
-rw-r--r--gcc/config/rs6000/rs6000.h11
-rw-r--r--gcc/config/rs6000/rs6000.md32
-rw-r--r--gcc/config/rs6000/rs6000.opt4
-rw-r--r--gcc/config/rs6000/sysv4.h2
-rw-r--r--gcc/config/rx/rx.c12
-rw-r--r--gcc/config/s390/s390.c26
-rw-r--r--gcc/config/score/score.c1
-rw-r--r--gcc/config/score/score3.c1
-rw-r--r--gcc/config/score/score7.c1
-rw-r--r--gcc/config/sh/sh.c44
-rw-r--r--gcc/config/sh/sh.md13
-rw-r--r--gcc/config/sh/symbian-base.c1
-rw-r--r--gcc/config/sh/symbian-c.c1
-rw-r--r--gcc/config/sh/symbian-cxx.c5
-rw-r--r--gcc/config/sol2.c1
-rw-r--r--gcc/config/sol2.h11
-rw-r--r--gcc/config/sparc/linux.h3
-rw-r--r--gcc/config/sparc/linux64.h3
-rw-r--r--gcc/config/sparc/sol2.h3
-rw-r--r--gcc/config/sparc/sparc-protos.h1
-rw-r--r--gcc/config/sparc/sparc.c167
-rw-r--r--gcc/config/sparc/sparc.md10
-rw-r--r--gcc/config/spu/spu-c.c3
-rw-r--r--gcc/config/spu/spu.c87
-rw-r--r--gcc/config/spu/spu.h4
-rw-r--r--gcc/config/stormy16/stormy16.c7
-rw-r--r--gcc/config/v850/v850-c.c1
-rw-r--r--gcc/config/v850/v850.c1
-rw-r--r--gcc/config/vax/vax.c1
-rw-r--r--gcc/config/vxworks.c21
-rw-r--r--gcc/config/xtensa/xtensa.c13
-rwxr-xr-xgcc/configure228
-rw-r--r--gcc/configure.ac153
-rw-r--r--gcc/convert.c13
-rw-r--r--gcc/coverage.c34
-rw-r--r--gcc/cp/ChangeLog259
-rw-r--r--gcc/cp/call.c48
-rw-r--r--gcc/cp/class.c207
-rw-r--r--gcc/cp/cp-gimplify.c14
-rw-r--r--gcc/cp/cp-tree.h49
-rw-r--r--gcc/cp/cvt.c319
-rw-r--r--gcc/cp/decl.c62
-rw-r--r--gcc/cp/decl2.c20
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/cp/init.c136
-rw-r--r--gcc/cp/mangle.c27
-rw-r--r--gcc/cp/method.c269
-rw-r--r--gcc/cp/name-lookup.c50
-rw-r--r--gcc/cp/optimize.c29
-rw-r--r--gcc/cp/parser.c20
-rw-r--r--gcc/cp/pt.c203
-rw-r--r--gcc/cp/ptree.c9
-rw-r--r--gcc/cp/rtti.c6
-rw-r--r--gcc/cp/search.c4
-rw-r--r--gcc/cp/semantics.c29
-rw-r--r--gcc/cp/tree.c29
-rw-r--r--gcc/cp/typeck.c133
-rw-r--r--gcc/cp/typeck2.c11
-rw-r--r--gcc/cse.c1
-rw-r--r--gcc/cselib.c1
-rw-r--r--gcc/dbgcnt.c1
-rw-r--r--gcc/dbxout.c13
-rw-r--r--gcc/ddg.c3
-rw-r--r--gcc/defaults.h26
-rw-r--r--gcc/df-problems.c128
-rw-r--r--gcc/doc/arm-neon-intrinsics.texi54
-rw-r--r--gcc/doc/extend.texi35
-rw-r--r--gcc/doc/generic.texi14
-rw-r--r--gcc/doc/gimple.texi88
-rw-r--r--gcc/doc/install.texi58
-rw-r--r--gcc/doc/invoke.texi65
-rw-r--r--gcc/doc/rtl.texi80
-rw-r--r--gcc/doc/sourcebuild.texi30
-rw-r--r--gcc/doc/tm.texi71
-rw-r--r--gcc/doc/tm.texi.in67
-rw-r--r--gcc/dominance.c1
-rw-r--r--gcc/double-int.c76
-rw-r--r--gcc/double-int.h4
-rw-r--r--gcc/dwarf2out.c156
-rw-r--r--gcc/emit-rtl.c118
-rw-r--r--gcc/explow.c20
-rw-r--r--gcc/expmed.c211
-rw-r--r--gcc/expmed.h200
-rw-r--r--gcc/expr.c324
-rw-r--r--gcc/expr.h5
-rw-r--r--gcc/final.c10
-rw-r--r--gcc/fixed-value.c13
-rw-r--r--gcc/flags.h59
-rw-r--r--gcc/fold-const.c63
-rw-r--r--gcc/fortran/ChangeLog469
-rw-r--r--gcc/fortran/arith.c2
-rw-r--r--gcc/fortran/array.c33
-rw-r--r--gcc/fortran/check.c49
-rw-r--r--gcc/fortran/class.c359
-rw-r--r--gcc/fortran/config-lang.in2
-rw-r--r--gcc/fortran/convert.c2
-rw-r--r--gcc/fortran/decl.c25
-rw-r--r--gcc/fortran/dependency.c84
-rw-r--r--gcc/fortran/dependency.h3
-rw-r--r--gcc/fortran/expr.c29
-rw-r--r--gcc/fortran/f95-lang.c6
-rw-r--r--gcc/fortran/gfc-internals.texi27
-rw-r--r--gcc/fortran/gfortran.h21
-rw-r--r--gcc/fortran/interface.c31
-rw-r--r--gcc/fortran/intrinsic.c11
-rw-r--r--gcc/fortran/intrinsic.h3
-rw-r--r--gcc/fortran/intrinsic.texi134
-rw-r--r--gcc/fortran/io.c8
-rw-r--r--gcc/fortran/iresolve.c31
-rw-r--r--gcc/fortran/match.c65
-rw-r--r--gcc/fortran/module.c220
-rw-r--r--gcc/fortran/options.c2
-rw-r--r--gcc/fortran/parse.c2
-rw-r--r--gcc/fortran/primary.c6
-rw-r--r--gcc/fortran/resolve.c160
-rw-r--r--gcc/fortran/symbol.c32
-rw-r--r--gcc/fortran/trans-array.c631
-rw-r--r--gcc/fortran/trans-array.h8
-rw-r--r--gcc/fortran/trans-common.c6
-rw-r--r--gcc/fortran/trans-const.c2
-rw-r--r--gcc/fortran/trans-decl.c1012
-rw-r--r--gcc/fortran/trans-expr.c209
-rw-r--r--gcc/fortran/trans-intrinsic.c105
-rw-r--r--gcc/fortran/trans-io.c213
-rw-r--r--gcc/fortran/trans-openmp.c2
-rw-r--r--gcc/fortran/trans-stmt.c244
-rw-r--r--gcc/fortran/trans-types.c163
-rw-r--r--gcc/fortran/trans-types.h2
-rw-r--r--gcc/fortran/trans.c102
-rw-r--r--gcc/fortran/trans.h46
-rw-r--r--gcc/function.c138
-rw-r--r--gcc/function.h15
-rw-r--r--gcc/fwprop.c1
-rw-r--r--gcc/gcse.c17
-rw-r--r--gcc/gcse.h43
-rw-r--r--gcc/genattrtab.c3
-rw-r--r--gcc/genautomata.c21
-rw-r--r--gcc/genconditions.c1
-rw-r--r--gcc/genemit.c1
-rw-r--r--gcc/genenums.c1
-rw-r--r--gcc/genextract.c1
-rw-r--r--gcc/gengtype.c125
-rw-r--r--gcc/genopinit.c431
-rw-r--r--gcc/genoutput.c1
-rw-r--r--gcc/genpeep.c1
-rw-r--r--gcc/genpreds.c1
-rw-r--r--gcc/genrecog.c1
-rw-r--r--gcc/ggc-common.c1
-rw-r--r--gcc/ggc-page.c3
-rw-r--r--gcc/ggc-zone.c1
-rw-r--r--gcc/gimple-fold.c504
-rw-r--r--gcc/gimple-low.c8
-rw-r--r--gcc/gimple-pretty-print.c8
-rw-r--r--gcc/gimple.c522
-rw-r--r--gcc/gimple.h20
-rw-r--r--gcc/gimplify.c181
-rw-r--r--gcc/graph.c2
-rw-r--r--gcc/haifa-sched.c2
-rw-r--r--gcc/hard-reg-set.h157
-rw-r--r--gcc/ifcvt.c3
-rw-r--r--gcc/implicit-zee.c166
-rw-r--r--gcc/integrate.c9
-rw-r--r--gcc/ipa-cp.c9
-rw-r--r--gcc/ipa-inline.c128
-rw-r--r--gcc/ipa-prop.c22
-rw-r--r--gcc/ipa-prop.h10
-rw-r--r--gcc/ipa-pure-const.c21
-rw-r--r--gcc/ipa-split.c321
-rw-r--r--gcc/ipa-struct-reorg.c44
-rw-r--r--gcc/ipa-type-escape.c13
-rw-r--r--gcc/ipa.c89
-rw-r--r--gcc/ira-build.c808
-rw-r--r--gcc/ira-color.c573
-rw-r--r--gcc/ira-conflicts.c459
-rw-r--r--gcc/ira-costs.c43
-rw-r--r--gcc/ira-emit.c138
-rw-r--r--gcc/ira-int.h553
-rw-r--r--gcc/ira-lives.c390
-rw-r--r--gcc/ira.c265
-rw-r--r--gcc/ira.h110
-rw-r--r--gcc/java/ChangeLog46
-rw-r--r--gcc/java/boehm.c5
-rw-r--r--gcc/java/builtins.c12
-rw-r--r--gcc/java/class.c204
-rw-r--r--gcc/java/constants.c52
-rw-r--r--gcc/java/decl.c37
-rw-r--r--gcc/java/except.c1
-rw-r--r--gcc/java/expr.c13
-rw-r--r--gcc/java/java-tree.h6
-rw-r--r--gcc/java/jcf-parse.c3
-rw-r--r--gcc/java/mangle.c1
-rw-r--r--gcc/java/mangle_name.c1
-rw-r--r--gcc/java/resource.c1
-rw-r--r--gcc/java/typeck.c9
-rw-r--r--gcc/java/verify-glue.c3
-rw-r--r--gcc/langhooks.c2
-rw-r--r--gcc/libfuncs.h33
-rw-r--r--gcc/libgcc2.c4
-rw-r--r--gcc/lists.c1
-rw-r--r--gcc/loop-doloop.c5
-rw-r--r--gcc/loop-invariant.c23
-rw-r--r--gcc/loop-iv.c1
-rw-r--r--gcc/lower-subreg.c11
-rw-r--r--gcc/lto-cgraph.c49
-rw-r--r--gcc/lto-opts.c5
-rw-r--r--gcc/lto-section-in.c10
-rw-r--r--gcc/lto-section-out.c2
-rw-r--r--gcc/lto-streamer-in.c163
-rw-r--r--gcc/lto-streamer-out.c291
-rw-r--r--gcc/lto-streamer.c70
-rw-r--r--gcc/lto-streamer.h11
-rw-r--r--gcc/lto-symtab.c145
-rw-r--r--gcc/lto/ChangeLog57
-rw-r--r--gcc/lto/lto-coff.c26
-rw-r--r--gcc/lto/lto-elf.c59
-rw-r--r--gcc/lto/lto-lang.c1
-rw-r--r--gcc/lto/lto-macho.c25
-rw-r--r--gcc/lto/lto.c364
-rw-r--r--gcc/lto/lto.h1
-rw-r--r--gcc/main.c1
-rw-r--r--gcc/matrix-reorg.c80
-rw-r--r--gcc/mode-switching.c4
-rw-r--r--gcc/modulo-sched.c1
-rw-r--r--gcc/objc/ChangeLog68
-rw-r--r--gcc/objc/objc-act.c798
-rw-r--r--gcc/omp-low.c229
-rw-r--r--gcc/optabs.c398
-rw-r--r--gcc/optabs.h273
-rw-r--r--gcc/params.c1
-rw-r--r--gcc/passes.c2
-rw-r--r--gcc/plugin.c1
-rw-r--r--gcc/postreload-gcse.c1
-rw-r--r--gcc/postreload.c1118
-rw-r--r--gcc/predict.c28
-rw-r--r--gcc/pretty-print.h2
-rw-r--r--gcc/profile.c1
-rw-r--r--gcc/real.c1
-rw-r--r--gcc/recog.c3
-rw-r--r--gcc/regcprop.c10
-rw-r--r--gcc/reginfo.c155
-rw-r--r--gcc/regmove.c1
-rw-r--r--gcc/regs.h94
-rw-r--r--gcc/reload.c32
-rw-r--r--gcc/reload.h64
-rw-r--r--gcc/reload1.c32
-rw-r--r--gcc/reorg.c1
-rw-r--r--gcc/resource.c1
-rw-r--r--gcc/rtl.c2
-rw-r--r--gcc/rtl.h63
-rw-r--r--gcc/rtlanal.c1
-rw-r--r--gcc/sched-deps.c1
-rw-r--r--gcc/sched-ebb.c1
-rw-r--r--gcc/sched-rgn.c1
-rw-r--r--gcc/sdbout.c1
-rw-r--r--gcc/sel-sched-dump.c1
-rw-r--r--gcc/sel-sched-ir.c1
-rw-r--r--gcc/simplify-rtx.c1
-rw-r--r--gcc/stmt.c10
-rw-r--r--gcc/stor-layout.c24
-rw-r--r--gcc/store-motion.c1
-rw-r--r--gcc/system.h2
-rw-r--r--gcc/target-globals.c88
-rw-r--r--gcc/target-globals.h80
-rw-r--r--gcc/target.def15
-rw-r--r--gcc/target.h1
-rw-r--r--gcc/targhooks.c23
-rw-r--r--gcc/targhooks.h3
-rw-r--r--gcc/testsuite/ChangeLog1382
-rw-r--r--gcc/testsuite/c-c++-common/Wunused-var-12.c25
-rw-r--r--gcc/testsuite/c-c++-common/guality/pr43141.c (renamed from gcc/testsuite/gcc.dg/guality/pr43141.c)0
-rw-r--r--gcc/testsuite/c-c++-common/pr44832.c160
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-add.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mixed-add.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mixed-div.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mixed-mul.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mixed-sub.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mul-minus-one.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mul-one.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-mul.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/complex-sign-sub.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/pr42834.c23
-rw-r--r--gcc/testsuite/c-c++-common/uninit-17.c4
-rw-r--r--gcc/testsuite/g++.dg/abi/covariant1.C13
-rw-r--r--gcc/testsuite/g++.dg/abi/covariant6.C34
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle44.C19
-rw-r--r--gcc/testsuite/g++.dg/abi/noreturn1.C14
-rw-r--r--gcc/testsuite/g++.dg/abi/noreturn2.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype23.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit6.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit7.C37
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit8.C34
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist41.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr04.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae2.C39
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/union1.C34
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/union2.C34
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/union3.C69
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/const2b.C1
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C13
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C37
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C41
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C2
-rw-r--r--gcc/testsuite/g++.dg/dg.exp3
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-17.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/pretty3.C19
-rw-r--r--gcc/testsuite/g++.dg/ext/vector14.C3
-rw-r--r--gcc/testsuite/g++.dg/gomp/sections-4.C2
-rw-r--r--gcc/testsuite/g++.dg/guality/guality.exp53
-rw-r--r--gcc/testsuite/g++.dg/guality/guality.h1
-rw-r--r--gcc/testsuite/g++.dg/guality/redeclaration1.C26
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant17.C43
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant7.C20
-rw-r--r--gcc/testsuite/g++.dg/lto/20100721-1_0.C9
-rw-r--r--gcc/testsuite/g++.dg/lto/20100722-1_0.C5
-rw-r--r--gcc/testsuite/g++.dg/opt/nrv16.C16
-rw-r--r--gcc/testsuite/g++.dg/other/i386-1.C14
-rw-r--r--gcc/testsuite/g++.dg/other/i386-2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/i386-3.C2
-rw-r--r--gcc/testsuite/g++.dg/other/mmintrin.C1
-rw-r--r--gcc/testsuite/g++.dg/other/pr25632.C6
-rw-r--r--gcc/testsuite/g++.dg/other/pr40446.C13
-rw-r--r--gcc/testsuite/g++.dg/parse/error28.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/template25.C14
-rw-r--r--gcc/testsuite/g++.dg/plugin/attribute_plugin.c3
-rw-r--r--gcc/testsuite/g++.dg/plugin/dumb_plugin.c1
-rw-r--r--gcc/testsuite/g++.dg/plugin/pragma_plugin.c1
-rw-r--r--gcc/testsuite/g++.dg/plugin/selfassign.c34
-rw-r--r--gcc/testsuite/g++.dg/template/crash100.C24
-rw-r--r--gcc/testsuite/g++.dg/template/crash101.C12
-rw-r--r--gcc/testsuite/g++.dg/template/dtor7.C2
-rw-r--r--gcc/testsuite/g++.dg/template/partial8.C4
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem17.C2
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem22.C29
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae19.C44
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae20.C45
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae21.C40
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae22.C39
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae23.C23
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae24.C26
-rw-r--r--gcc/testsuite/g++.dg/template/warn1.C4
-rw-r--r--gcc/testsuite/g++.dg/tls/static-1.C1
-rw-r--r--gcc/testsuite/g++.dg/tls/static-1a.cc1
-rw-r--r--gcc/testsuite/g++.dg/torture/20100702-1.C37
-rw-r--r--gcc/testsuite/g++.dg/torture/pr36745.C1
-rw-r--r--gcc/testsuite/g++.dg/torture/pr36960.C22
-rw-r--r--gcc/testsuite/g++.dg/torture/pr44809.C6
-rw-r--r--gcc/testsuite/g++.dg/torture/pr44813.C60
-rw-r--r--gcc/testsuite/g++.dg/torture/pr44826.C44
-rw-r--r--gcc/testsuite/g++.dg/torture/pr44900.C76
-rw-r--r--gcc/testsuite/g++.dg/torture/pr44915.C13
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/copyprop-1.C4
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr19952.C2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr31146.C2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr33604.C12
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr44706.C46
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr44914.C20
-rw-r--r--gcc/testsuite/g++.dg/vect/pr44861.cc34
-rw-r--r--gcc/testsuite/g++.dg/vect/vect.exp5
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-7.C37
-rw-r--r--gcc/testsuite/g++.dg/warn/noeffect2.C6
-rw-r--r--gcc/testsuite/g++.dg/warn/volatile1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/anon2.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/misc6.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20100609-1.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44707.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44784.c47
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44788.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44831.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44891.c26
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44941.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44946.c27
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44988.c13
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr45047.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20100316-1.c24
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20100416-1.c40
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20100708-1.c29
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr40657.c23
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr44468.c60
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr44683.x6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr44828.c19
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr44852.c22
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr44942.c70
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr45017.c22
-rw-r--r--gcc/testsuite/gcc.dg/Wtrampolines.c57
-rw-r--r--gcc/testsuite/gcc.dg/attr-weak-hidden-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c9
-rw-r--r--gcc/testsuite/gcc.dg/compat/pr38736_main.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/union-m128-1_main.c14
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-1a_main.c14
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-1b_main.c14
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-2a_main.c14
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-2b_main.c14
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c1
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c19
-rw-r--r--gcc/testsuite/gcc.dg/float-range-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/float-range-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/float-range-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/fold-overflow-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/format/ms_unnamed-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/format/unnamed-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/gomp/sections-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr40281.c1
-rw-r--r--gcc/testsuite/gcc.dg/guality/asm-1.c25
-rw-r--r--gcc/testsuite/gcc.dg/guality/guality.exp1
-rw-r--r--gcc/testsuite/gcc.dg/guality/guality.h28
-rw-r--r--gcc/testsuite/gcc.dg/guality/nrv-1.c29
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr45003-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr45003-2.c31
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr45003-3.c31
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c1
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pure-const-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090210_0.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090313_0.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100518_0.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100709-1_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100709-1_1.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-1_0.c22
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-1_1.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-2_0.c23
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-2_1.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-3_0.c24
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-3_1.c17
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100720-4_0.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100722-1_0.c6
-rw-r--r--gcc/testsuite/gcc.dg/plugin/ggcplug.c1
-rw-r--r--gcc/testsuite/gcc.dg/plugin/selfassign.c34
-rw-r--r--gcc/testsuite/gcc.dg/pr32370.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr34856.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr36584.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr36902.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr36997.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr37544.c17
-rw-r--r--gcc/testsuite/gcc.dg/pr40550.c17
-rw-r--r--gcc/testsuite/gcc.dg/pr42427.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr43058.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr44290-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr44290-2.c24
-rw-r--r--gcc/testsuite/gcc.dg/pr44838.c33
-rw-r--r--gcc/testsuite/gcc.dg/pr44971.c27
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_global_array.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_global_var.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_local_array.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_local_var.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c2
-rw-r--r--gcc/testsuite/gcc.dg/tls/emutls-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/tls/opt-11.c1
-rw-r--r--gcc/testsuite/gcc.dg/tls/opt-12.c1
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr24428-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr24428.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr16104-1.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771.h12
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr36891.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44695.c15
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44806.c90
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44977.c41
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/push-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c13
-rw-r--r--gcc/testsuite/gcc.dg/transparent-union-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/transparent-union-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/stringop-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldaddr-2.c13
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldaddr-3.c28
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c44
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c37
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21463.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp50.c36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp51.c58
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp52.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp53.c24
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c51
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c50
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr35821-altivec.c24
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr35821-spu.c22
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-perm-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-perm-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-perm-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-perm-4.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/tree-vect.h5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-109.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-42.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-56.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-60.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-93.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-96.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c21
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-peel-1.c51
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-peel-2.c52
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-peel-3.c55
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-peel-4.c47
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-6.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp9
-rw-r--r--gcc/testsuite/gcc.dg/volatile2.c7
-rw-r--r--gcc/testsuite/gcc.target/arm/interrupt-1.c23
-rw-r--r--gcc/testsuite/gcc.target/arm/interrupt-2.c26
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vadds64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vaddu64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vands64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vandu64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vbics64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vbicu64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vdupQ_lanes64.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vdupQ_laneu64.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vdupQ_ns64.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vdupQ_nu64.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vdup_ns64.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vdup_nu64.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-veors64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-veoru64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vget_lanes64.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vget_laneu64.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vmla-1.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vmls-1.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vmovQ_ns64.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vmovQ_nu64.c23
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vmov_ns64.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vmov_nu64.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vorns64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vornu64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vorrs64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vorru64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vset_lanes64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vset_laneu64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vsubs64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vsubu64.c21
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vadds64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vaddu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vands64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vandu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vbics64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vbicu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vdupQ_ns64.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vdupQ_nu64.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vdup_ns64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vdup_nu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/veors64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/veoru64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vget_lanes64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vget_laneu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vmovQ_ns64.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vmovQ_nu64.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vmov_ns64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vmov_nu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vorns64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vornu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vorrs64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vorru64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vset_lanes64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vset_laneu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vsubs64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/neon/vsubu64.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/pr39839.c24
-rw-r--r--gcc/testsuite/gcc.target/arm/pr40657-1.c13
-rw-r--r--gcc/testsuite/gcc.target/arm/pr40657-2.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/pr42172-1.c19
-rw-r--r--gcc/testsuite/gcc.target/arm/pr42235.c11
-rw-r--r--gcc/testsuite/gcc.target/arm/pr42505.c23
-rw-r--r--gcc/testsuite/gcc.target/arm/pr42835.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/pr43698.c38
-rw-r--r--gcc/testsuite/gcc.target/arm/pr44788.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/20020523.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/aes-avx-check.h3
-rw-r--r--gcc/testsuite/gcc.target/i386/all_one_m128i.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-check.h2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-cmpsd-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-cmpss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/brokensqrt.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/f16c-check.h30
-rw-r--r--gcc/testsuite/gcc.target/i386/fastcall-sseregparm.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/fpcvt-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/fpcvt-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/fpcvt-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-9.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/i386.exp3
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-12.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-6.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-7.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-8.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp14
-rw-r--r--gcc/testsuite/gcc.target/i386/ms_hook_prologue.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/opt-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/opt-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ordcmp-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pclmul-avx-check.h3
-rw-r--r--gcc/testsuite/gcc.target/i386/pr13685.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr17692.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr18614-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr22152.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr23570.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr23575.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr24306.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr26449-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr26600.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr27790.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr28839.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr30970.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32065-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32280.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32661.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32708-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32961.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr33329.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr35714.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr35767-5.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36222-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36992-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37101.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37275.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37434-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37434-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37434-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37434-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39162.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39315-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39315-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39315-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39315-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39315-check.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39496.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr40957.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr42542-3a.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr44942.c44
-rw-r--r--gcc/testsuite/gcc.target/i386/push-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/quad-sse.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/rdfsbase-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/rdfsbase-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/rdgsbase-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/rdgsbase-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/rdrand-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/rdrand-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/rdrand-3.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/reload-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-12.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-13.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-14.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-15.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-19.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-20.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-23.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-7.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-9.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-addps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-addss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-andnps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-andps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-check.h5
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cmpss-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-comiss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-comiss-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-comiss-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-comiss-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-comiss-5.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-comiss-6.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-copysignf-vec.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-divps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-divss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-maxps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-maxss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-minps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-minss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movaps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movaps-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movhlps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movhps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movhps-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movlhps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movmskps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movntps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movss-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movss-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movups-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-movups-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-mulps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-mulss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-orps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-os-support.h55
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-rcpps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-recip-vec.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-recip.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-set-ps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-subps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-subss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-vect-types.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-xorps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-check.h3
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-cmpsd-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-unpack-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-check.h4
-rw-r--r--gcc/testsuite/gcc.target/i386/ssefn-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssefn-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssefp-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssefp-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sseregparm-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sseregparm-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sseregparm-5.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sseregparm-6.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sseregparm-7.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssetype-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssetype-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssetype-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssetype-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/ssetype-5.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/unordcmp-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vcvtph2ps-1.c28
-rw-r--r--gcc/testsuite/gcc.target/i386/vcvtph2ps-2.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/vcvtph2ps-3.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/vcvtps2ph-1.c32
-rw-r--r--gcc/testsuite/gcc.target/i386/vcvtps2ph-2.c36
-rw-r--r--gcc/testsuite/gcc.target/i386/vcvtps2ph-3.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-5.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-6.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize6.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize7.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize8.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v2df.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v2di.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v4sf-1.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v4sf-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v4si-1.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/vperm-v4si-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/wrfsbase-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/wrfsbase-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/wrgsbase-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/wrgsbase-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/xorps-sse2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/xorps.c1
-rw-r--r--gcc/testsuite/gcc.target/m68k/pr45015.c26
-rw-r--r--gcc/testsuite/gcc.target/mips/cache-1.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/mips.exp16
-rw-r--r--gcc/testsuite/gcc.target/mips/mips16-attributes-4.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-volatile.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/block-move-1.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/block-move-2.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-3.c2
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s28
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/asm-support.S28
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S28
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h2
-rw-r--r--gcc/testsuite/gfortran.dg/aliasing_dummy_5.f9055
-rw-r--r--gcc/testsuite/gfortran.dg/array_memcpy_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/array_memcpy_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_15.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/c_sizeof_1.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/char4_iunit_1.f0332
-rw-r--r--gcc/testsuite/gfortran.dg/char4_iunit_2.f0347
-rw-r--r--gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/class_24.f0322
-rw-r--r--gcc/testsuite/gfortran.dg/class_defined_operator_1.f03102
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_10.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/dim_range_1.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f037
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f0310
-rw-r--r--gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f037
-rw-r--r--gcc/testsuite/gfortran.dg/endfile_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/exit_1.f0850
-rw-r--r--gcc/testsuite/gfortran.dg/exit_2.f0831
-rw-r--r--gcc/testsuite/gfortran.dg/ftell_3.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr44847.f9086
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr42185.f902
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_20.f902
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_24.f902
-rw-r--r--gcc/testsuite/gfortran.dg/intent_out_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/ltrans-7.f902
-rw-r--r--gcc/testsuite/gfortran.dg/minmaxloc_4.f906
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_36.f902
-rw-r--r--gcc/testsuite/gfortran.dg/parameter_array_init_6.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/pr44882.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/runtime_warning_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/select_char_2.f9045
-rw-r--r--gcc/testsuite/gfortran.dg/select_char_3.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/storage_size_1.f0831
-rw-r--r--gcc/testsuite/gfortran.dg/storage_size_2.f0827
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_16.f0335
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_generic_6.f0369
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_generic_7.f0328
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_generic_8.f0329
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_generic_9.f0363
-rw-r--r--gcc/testsuite/gfortran.dg/use_iso_c_binding.f904
-rw-r--r--gcc/testsuite/gfortran.dg/use_rename_6.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect.exp5
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/compile/pr40421.f9015
-rw-r--r--gcc/testsuite/gnat.dg/aggr15.adb18
-rw-r--r--gcc/testsuite/gnat.dg/aggr15.ads15
-rw-r--r--gcc/testsuite/gnat.dg/atomic3.adb24
-rw-r--r--gcc/testsuite/gnat.dg/cond_expr1.adb7
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization7.adb1
-rw-r--r--gcc/testsuite/gnat.dg/modular3.adb32
-rw-r--r--gcc/testsuite/gnat.dg/modular3_pkg.ads11
-rw-r--r--gcc/testsuite/gnat.dg/noreturn1.adb2
-rw-r--r--gcc/testsuite/gnat.dg/specs/small_alignment.ads2
-rw-r--r--gcc/testsuite/gnat.dg/sse_nolib.adb1
-rw-r--r--gcc/testsuite/gnat.dg/unchecked_convert5b.adb22
-rw-r--r--gcc/testsuite/gnat.dg/unchecked_convert6.adb22
-rw-r--r--gcc/testsuite/gnat.dg/unchecked_convert6b.adb22
-rw-r--r--gcc/testsuite/lib/fortran-torture.exp3
-rw-r--r--gcc/testsuite/lib/objc-torture.exp33
-rw-r--r--gcc/testsuite/lib/plugin-support.exp2
-rw-r--r--gcc/testsuite/lib/scanasm.exp37
-rw-r--r--gcc/testsuite/lib/target-supports-dg.exp8
-rw-r--r--gcc/testsuite/lib/target-supports.exp153
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm24
-rw-r--r--gcc/testsuite/obj-c++.dg/encode-2.mm8
-rw-r--r--gcc/testsuite/obj-c++.dg/encode-3.mm4
-rw-r--r--gcc/testsuite/obj-c++.dg/lto/lto.exp84
-rw-r--r--gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm43
-rw-r--r--gcc/testsuite/obj-c++.dg/tls/static-1.mm1
-rw-r--r--gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm1
-rw-r--r--gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm3
-rw-r--r--gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm1
-rw-r--r--gcc/testsuite/objc-obj-c++-shared/Object1.h151
-rw-r--r--gcc/testsuite/objc-obj-c++-shared/next-abi.h9
-rw-r--r--gcc/testsuite/objc.dg/image-info.m1
-rw-r--r--gcc/testsuite/objc.dg/lto/lto.exp84
-rw-r--r--gcc/testsuite/objc.dg/lto/trivial-1_0.m37
-rw-r--r--gcc/testsuite/objc.dg/symtab-1.m7
-rw-r--r--gcc/testsuite/objc.dg/torture/tls/thr-init-2.m1
-rw-r--r--gcc/testsuite/objc.dg/torture/tls/thr-init-3.m1
-rw-r--r--gcc/testsuite/objc.dg/torture/tls/thr-init.m1
-rw-r--r--gcc/testsuite/objc/execute/forward-1.m5
-rw-r--r--gcc/timevar.def11
-rw-r--r--gcc/toplev.c19
-rw-r--r--gcc/toplev.h1
-rw-r--r--gcc/tree-affine.c28
-rw-r--r--gcc/tree-cfg.c182
-rw-r--r--gcc/tree-cfgcleanup.c1
-rw-r--r--gcc/tree-complex.c6
-rw-r--r--gcc/tree-data-ref.c55
-rw-r--r--gcc/tree-dfa.c127
-rw-r--r--gcc/tree-dump.c9
-rw-r--r--gcc/tree-dump.h1
-rw-r--r--gcc/tree-eh.c9
-rw-r--r--gcc/tree-flow-inline.h10
-rw-r--r--gcc/tree-flow.h7
-rw-r--r--gcc/tree-if-conv.c98
-rw-r--r--gcc/tree-inline.c392
-rw-r--r--gcc/tree-inline.h2
-rw-r--r--gcc/tree-into-ssa.c8
-rw-r--r--gcc/tree-loop-distribution.c2
-rw-r--r--gcc/tree-mudflap.c25
-rw-r--r--gcc/tree-nested.c76
-rw-r--r--gcc/tree-nomudflap.c1
-rw-r--r--gcc/tree-nrv.c3
-rw-r--r--gcc/tree-object-size.c56
-rw-r--r--gcc/tree-optimize.c60
-rw-r--r--gcc/tree-outof-ssa.c1
-rw-r--r--gcc/tree-parloops.c13
-rw-r--r--gcc/tree-pass.h1
-rw-r--r--gcc/tree-phinodes.c1
-rw-r--r--gcc/tree-predcom.c15
-rw-r--r--gcc/tree-pretty-print.c97
-rw-r--r--gcc/tree-profile.c16
-rw-r--r--gcc/tree-scalar-evolution.c18
-rw-r--r--gcc/tree-sra.c225
-rw-r--r--gcc/tree-ssa-address.c37
-rw-r--r--gcc/tree-ssa-alias.c276
-rw-r--r--gcc/tree-ssa-alias.h2
-rw-r--r--gcc/tree-ssa-ccp.c178
-rw-r--r--gcc/tree-ssa-coalesce.c1
-rw-r--r--gcc/tree-ssa-dce.c3
-rw-r--r--gcc/tree-ssa-dom.c14
-rw-r--r--gcc/tree-ssa-forwprop.c332
-rw-r--r--gcc/tree-ssa-live.c178
-rw-r--r--gcc/tree-ssa-loop-im.c16
-rw-r--r--gcc/tree-ssa-loop-ivopts.c209
-rw-r--r--gcc/tree-ssa-loop-niter.c10
-rw-r--r--gcc/tree-ssa-loop-prefetch.c227
-rw-r--r--gcc/tree-ssa-loop.c1
-rw-r--r--gcc/tree-ssa-math-opts.c197
-rw-r--r--gcc/tree-ssa-operands.c40
-rw-r--r--gcc/tree-ssa-phiopt.c21
-rw-r--r--gcc/tree-ssa-phiprop.c43
-rw-r--r--gcc/tree-ssa-pre.c120
-rw-r--r--gcc/tree-ssa-propagate.c15
-rw-r--r--gcc/tree-ssa-propagate.h1
-rw-r--r--gcc/tree-ssa-reassoc.c2
-rw-r--r--gcc/tree-ssa-sccvn.c448
-rw-r--r--gcc/tree-ssa-sccvn.h4
-rw-r--r--gcc/tree-ssa-sink.c5
-rw-r--r--gcc/tree-ssa-structalias.c69
-rw-r--r--gcc/tree-ssa-ter.c18
-rw-r--r--gcc/tree-ssa-uninit.c57
-rw-r--r--gcc/tree-ssa.c385
-rw-r--r--gcc/tree-stdarg.c4
-rw-r--r--gcc/tree-tailcall.c8
-rw-r--r--gcc/tree-vect-data-refs.c546
-rw-r--r--gcc/tree-vect-generic.c7
-rw-r--r--gcc/tree-vect-loop-manip.c20
-rw-r--r--gcc/tree-vect-loop.c202
-rw-r--r--gcc/tree-vect-patterns.c4
-rw-r--r--gcc/tree-vect-slp.c9
-rw-r--r--gcc/tree-vect-stmts.c292
-rw-r--r--gcc/tree-vectorizer.h30
-rw-r--r--gcc/tree-vrp.c333
-rw-r--r--gcc/tree.c264
-rw-r--r--gcc/tree.def16
-rw-r--r--gcc/tree.h48
-rw-r--r--gcc/var-tracking.c79
-rw-r--r--gcc/varasm.c51
-rw-r--r--gcc/vec.c2
-rw-r--r--gcc/vec.h100
-rw-r--r--gcc/web.c1
-rw-r--r--gcc/xcoffout.c1
-rw-r--r--include/ChangeLog5
-rw-r--r--include/floatformat.h2
-rw-r--r--libffi/ChangeLog10
-rw-r--r--libffi/Makefile.am1
-rw-r--r--libffi/Makefile.in1
-rw-r--r--libffi/src/x86/sysv.S3
-rw-r--r--libgcc/ChangeLog7
-rw-r--r--libgcc/config.host2
-rw-r--r--libgcc/config/rs6000/t-ppccomm4
-rw-r--r--libgfortran/ChangeLog111
-rw-r--r--libgfortran/Makefile.am18
-rw-r--r--libgfortran/Makefile.in16
-rw-r--r--libgfortran/config/fpu-387.h47
-rwxr-xr-xlibgfortran/configure75
-rw-r--r--libgfortran/configure.ac25
-rw-r--r--libgfortran/io/file_pos.c9
-rw-r--r--libgfortran/io/io.h5
-rw-r--r--libgfortran/io/list_read.c3
-rw-r--r--libgfortran/io/read.c68
-rw-r--r--libgfortran/io/transfer.c269
-rw-r--r--libgfortran/io/unit.c16
-rw-r--r--libgfortran/io/unix.c122
-rw-r--r--libgfortran/io/unix.h9
-rw-r--r--libgfortran/io/write.c252
-rw-r--r--libgfortran/io/write_float.def255
-rw-r--r--libgomp/ChangeLog29
-rw-r--r--libgomp/Makefile.am26
-rw-r--r--libgomp/Makefile.in21
-rw-r--r--libgomp/acinclude.m459
-rw-r--r--libgomp/config.h.in4
-rwxr-xr-xlibgomp/configure106
-rw-r--r--libgomp/configure.tgt5
-rw-r--r--libgomp/libgomp.h3
-rw-r--r--libgomp/libgomp.map21
-rw-r--r--libiberty/ChangeLog9
-rw-r--r--libiberty/floatformat.c18
-rw-r--r--libiberty/make-temp-file.c7
-rw-r--r--libjava/ChangeLog53
-rw-r--r--libjava/Makefile.am93
-rw-r--r--libjava/Makefile.in164
-rwxr-xr-xlibjava/configure89
-rw-r--r--libjava/configure.ac38
-rw-r--r--libjava/configure.host3
-rw-r--r--libjava/include/solaris-signal.h (renamed from libjava/include/sparc-signal.h)0
-rw-r--r--libjava/libgcj.ver10
-rw-r--r--libssp/ChangeLog22
-rw-r--r--libssp/Makefile.am17
-rw-r--r--libssp/Makefile.in15
-rw-r--r--libssp/config.h.in3
-rwxr-xr-xlibssp/configure89
-rw-r--r--libssp/configure.ac39
-rw-r--r--libssp/memmove-chk.c4
-rw-r--r--libssp/ssp.map21
-rw-r--r--libstdc++-v3/ChangeLog206
-rw-r--r--libstdc++-v3/Makefile.in2
-rw-r--r--libstdc++-v3/acinclude.m463
-rw-r--r--libstdc++-v3/config.h.in7
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver4
-rwxr-xr-xlibstdc++-v3/configure169
-rw-r--r--libstdc++-v3/configure.host6
-rw-r--r--libstdc++-v3/doc/Makefile.am144
-rw-r--r--libstdc++-v3/doc/Makefile.in156
-rw-r--r--libstdc++-v3/doc/doxygen/doxygroups.cc9
-rw-r--r--libstdc++-v3/doc/doxygen/user.cfg.in709
-rw-r--r--libstdc++-v3/doc/html/api.html2
-rw-r--r--libstdc++-v3/doc/html/faq.html2
-rw-r--r--libstdc++-v3/doc/html/manual/abi.html75
-rw-r--r--libstdc++-v3/doc/html/manual/algorithms.html2
-rw-r--r--libstdc++-v3/doc/html/manual/api.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_contributing.html2
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_free.html2
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gpl.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_porting.html2
-rw-r--r--libstdc++-v3/doc/html/manual/atomics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/backwards.html48
-rw-r--r--libstdc++-v3/doc/html/manual/bitmap_allocator.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03pr01.html2
-rw-r--r--libstdc++-v3/doc/html/manual/concurrency.html2
-rw-r--r--libstdc++-v3/doc/html/manual/configure.html4
-rw-r--r--libstdc++-v3/doc/html/manual/containers.html2
-rw-r--r--libstdc++-v3/doc/html/manual/diagnostics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/documentation_style.html6
-rw-r--r--libstdc++-v3/doc/html/manual/extensions.html2
-rw-r--r--libstdc++-v3/doc/html/manual/facets.html54
-rw-r--r--libstdc++-v3/doc/html/manual/intro.html2
-rw-r--r--libstdc++-v3/doc/html/manual/io.html2
-rw-r--r--libstdc++-v3/doc/html/manual/iterators.html2
-rw-r--r--libstdc++-v3/doc/html/manual/localization.html16
-rw-r--r--libstdc++-v3/doc/html/manual/memory.html84
-rw-r--r--libstdc++-v3/doc/html/manual/numerics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode.html4
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode.html2
-rw-r--r--libstdc++-v3/doc/html/manual/spine.html4
-rw-r--r--libstdc++-v3/doc/html/manual/status.html12
-rw-r--r--libstdc++-v3/doc/html/manual/strings.html2
-rw-r--r--libstdc++-v3/doc/html/manual/support.html2
-rw-r--r--libstdc++-v3/doc/html/manual/test.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using_exceptions.html16
-rw-r--r--libstdc++-v3/doc/html/manual/using_headers.html12
-rw-r--r--libstdc++-v3/doc/html/manual/utilities.html2
-rw-r--r--libstdc++-v3/doc/xml/api.xml45
-rw-r--r--libstdc++-v3/doc/xml/authors.xml137
-rw-r--r--libstdc++-v3/doc/xml/book.txml31
-rw-r--r--libstdc++-v3/doc/xml/chapter.txml43
-rw-r--r--libstdc++-v3/doc/xml/class.txml70
-rw-r--r--libstdc++-v3/doc/xml/faq.xml408
-rw-r--r--libstdc++-v3/doc/xml/gnu/fdl-1.2.xml36
-rw-r--r--libstdc++-v3/doc/xml/gnu/fdl-1.3.xml146
-rw-r--r--libstdc++-v3/doc/xml/gnu/gpl-2.0.xml100
-rw-r--r--libstdc++-v3/doc/xml/gnu/gpl-3.0.xml201
-rw-r--r--libstdc++-v3/doc/xml/manual/abi.xml316
-rw-r--r--libstdc++-v3/doc/xml/manual/algorithms.xml44
-rw-r--r--libstdc++-v3/doc/xml/manual/allocator.xml167
-rw-r--r--libstdc++-v3/doc/xml/manual/appendix_contributing.xml386
-rw-r--r--libstdc++-v3/doc/xml/manual/appendix_free.xml32
-rw-r--r--libstdc++-v3/doc/xml/manual/appendix_porting.xml44
-rw-r--r--libstdc++-v3/doc/xml/manual/atomics.xml26
-rw-r--r--libstdc++-v3/doc/xml/manual/auto_ptr.xml17
-rw-r--r--libstdc++-v3/doc/xml/manual/backwards_compatibility.xml260
-rw-r--r--libstdc++-v3/doc/xml/manual/bitmap_allocator.xml110
-rw-r--r--libstdc++-v3/doc/xml/manual/build_hacking.xml57
-rw-r--r--libstdc++-v3/doc/xml/manual/codecvt.xml169
-rw-r--r--libstdc++-v3/doc/xml/manual/concurrency.xml26
-rw-r--r--libstdc++-v3/doc/xml/manual/concurrency_extensions.xml60
-rw-r--r--libstdc++-v3/doc/xml/manual/configure.xml55
-rw-r--r--libstdc++-v3/doc/xml/manual/containers.xml113
-rw-r--r--libstdc++-v3/doc/xml/manual/ctype.xml94
-rw-r--r--libstdc++-v3/doc/xml/manual/debug.xml83
-rw-r--r--libstdc++-v3/doc/xml/manual/debug_mode.xml166
-rw-r--r--libstdc++-v3/doc/xml/manual/diagnostics.xml50
-rw-r--r--libstdc++-v3/doc/xml/manual/evolution.xml101
-rw-r--r--libstdc++-v3/doc/xml/manual/extensions.xml142
-rw-r--r--libstdc++-v3/doc/xml/manual/internals.xml47
-rw-r--r--libstdc++-v3/doc/xml/manual/intro.xml310
-rw-r--r--libstdc++-v3/doc/xml/manual/io.xml158
-rw-r--r--libstdc++-v3/doc/xml/manual/iterators.xml48
-rw-r--r--libstdc++-v3/doc/xml/manual/locale.xml99
-rw-r--r--libstdc++-v3/doc/xml/manual/localization.xml40
-rw-r--r--libstdc++-v3/doc/xml/manual/messages.xml132
-rw-r--r--libstdc++-v3/doc/xml/manual/mt_allocator.xml69
-rw-r--r--libstdc++-v3/doc/xml/manual/numerics.xml60
-rw-r--r--libstdc++-v3/doc/xml/manual/parallel_mode.xml160
-rw-r--r--libstdc++-v3/doc/xml/manual/prerequisites.xml21
-rw-r--r--libstdc++-v3/doc/xml/manual/profile_mode.xml521
-rw-r--r--libstdc++-v3/doc/xml/manual/shared_ptr.xml156
-rw-r--r--libstdc++-v3/doc/xml/manual/spine.xml84
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxx1998.xml389
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxx200x.xml887
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxxtr1.xml574
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml82
-rw-r--r--libstdc++-v3/doc/xml/manual/strings.xml101
-rw-r--r--libstdc++-v3/doc/xml/manual/support.xml87
-rw-r--r--libstdc++-v3/doc/xml/manual/test.xml124
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml399
-rw-r--r--libstdc++-v3/doc/xml/manual/using_exceptions.xml177
-rw-r--r--libstdc++-v3/doc/xml/manual/utilities.xml49
-rw-r--r--libstdc++-v3/doc/xml/spine.xml150
-rw-r--r--libstdc++-v3/include/Makefile.in2
-rw-r--r--libstdc++-v3/include/bits/algorithmfwd.h10
-rw-r--r--libstdc++-v3/include/bits/move.h2
-rw-r--r--libstdc++-v3/include/bits/random.h8
-rw-r--r--libstdc++-v3/include/bits/regex.h2
-rw-r--r--libstdc++-v3/include/bits/regex_compiler.h2
-rw-r--r--libstdc++-v3/include/bits/regex_constants.h2
-rw-r--r--libstdc++-v3/include/bits/regex_error.h2
-rw-r--r--libstdc++-v3/include/bits/regex_grep_matcher.h2
-rw-r--r--libstdc++-v3/include/bits/regex_grep_matcher.tcc2
-rw-r--r--libstdc++-v3/include/bits/regex_nfa.tcc2
-rw-r--r--libstdc++-v3/include/bits/stl_heap.h2
-rw-r--r--libstdc++-v3/include/std/type_traits20
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in2
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h33
-rw-r--r--libstdc++-v3/po/Makefile.in2
-rw-r--r--libstdc++-v3/python/Makefile.in2
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py5
-rw-r--r--libstdc++-v3/src/Makefile.am26
-rw-r--r--libstdc++-v3/src/Makefile.in25
-rw-r--r--libstdc++-v3/src/atomic.cc5
-rw-r--r--libstdc++-v3/src/compatibility.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/Makefile.am8
-rw-r--r--libstdc++-v3/testsuite/Makefile.in9
-rw-r--r--lto-plugin/ChangeLog28
-rw-r--r--lto-plugin/Makefile.am6
-rw-r--r--lto-plugin/Makefile.in5
-rw-r--r--lto-plugin/lto-plugin.c129
1360 files changed, 43667 insertions, 20055 deletions
diff --git a/ChangeLog b/ChangeLog
index 44d4510ee28..d7718163dcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2010-07-22 Andi Kleen <ak@linux.intel.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2010-07-22 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2010-07-17 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/44862
+ * Makefile.tpl (POSTSTAGE1_CXX_EXPORT):
+ Provide -B option to allow for link spec %s substitutions for
+ libstdc++.a on darwin.
+ * Makefile.in: Regenerate.
+
+2010-07-10 Mikael Morin <mikael@gcc.gnu.org>
+
+ * MAINTAINERS (Reviewers): Update my e-mail address
+
2010-06-10 Alexandre Oliva <aoliva@redhat.com>
* Makefile.def (configure-gcc): Depend on all-libelf.
diff --git a/MAINTAINERS b/MAINTAINERS
index c01d6a3cadb..451a107dc57 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -259,7 +259,7 @@ Fortran Steven G. Kargl sgk@troutmask.apl.washington.edu
Fortran Thomas König tkoenig@gcc.gnu.org
Fortran Daniel Kraft d@domob.eu
Fortran Toon Moene toon@moene.org
-Fortran Mikael Morin mikael.morin@tele2.fr
+Fortran Mikael Morin mikael.morin@sfr.fr
Fortran Brooks Moses brooks.moses@codesourcery.com
Fortran Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Fortran Paul Thomas pault@gcc.gnu.org
@@ -376,6 +376,7 @@ Tim Josling tej@melbpc.org.au
Victor Kaplansky victork@il.ibm.com
Brendan Kehoe brendan@zen.org
Matthias Klose doko@debian.org
+Andi Kleen andi@firstfloor.org
Jeff Knaggs jknaggs@redhat.com
Michael Koch konqueror@gmx.de
Matt Kraai kraai@ftbfs.org
@@ -466,6 +467,7 @@ Mike Stump mikestump@comcast.net
Jeff Sturm jsturm@gcc.gnu.org
Gabriele Svelto gabriele.svelto@st.com
Sriraman Tallam tmsriram@google.com
+Chung-Lin Tang cltang@codesourcery.com
Samuel Tardieu sam@rfc1149.net
Kresten Krab Thorup krab@gcc.gnu.org
Caroline Tice ctice@apple.com
@@ -485,6 +487,7 @@ Kevin Williams kevin.williams@inria.fr
Carlo Wood carlo@alinoe.com
Le-Chun Wu lcwu@google.com
Canqun Yang canqun@nudt.edu.cn
+Jeffrey Yasskin jyasskin@google.com
Joey Ye joey.ye@intel.com
Kenneth Zadeck zadeck@naturalbridge.com
Shujing Zhao pearly.zhao@oracle.com
diff --git a/Makefile.in b/Makefile.in
index 22a77d261aa..3268a302b6c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -235,6 +235,7 @@ POSTSTAGE1_CXX_EXPORT = \
POSTSTAGE1_CXX_EXPORT = \
CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
+ -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-I$$s/libstdc++-v3/libsupc++ \
diff --git a/Makefile.tpl b/Makefile.tpl
index 98b526c5a48..1f0419c430e 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -238,6 +238,7 @@ POSTSTAGE1_CXX_EXPORT = \
POSTSTAGE1_CXX_EXPORT = \
CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
+ -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-I$$s/libstdc++-v3/libsupc++ \
diff --git a/config/ChangeLog b/config/ChangeLog
index 9d18d75f2a7..41c66e91d15 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gc++filt.m4: New file.
+
2010-06-20 Alexandre Oliva <aoliva@redhat.com>
* bootstrap-lto.mk: New.
diff --git a/config/gc++filt.m4 b/config/gc++filt.m4
new file mode 100644
index 00000000000..defa206131a
--- /dev/null
+++ b/config/gc++filt.m4
@@ -0,0 +1,26 @@
+# gc++filt.m4 serial 1 -*- Autoconf -*-
+# Find an instance of GNU c++filt on PATH.
+
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Rainer Orth.
+
+# GCC_PROG_GNU_CXXFILT
+# --------------------
+# Check for GNU c++filt.
+# FIXME: Maybe need TARGET variant, though c++filt should be target
+# independent.
+AC_DEFUN([GCC_PROG_GNU_CXXFILT],
+ [AC_ARG_VAR([CXXFILT], [Location of GNU c++filt. Defaults to the first
+ GNU version of `c++filt', `gc++filt' on PATH.])
+ AC_CACHE_CHECK([for GNU c++filt], [ac_cv_path_CXXFILT],
+ [AC_PATH_PROGS_FEATURE_CHECK([CXXFILT], [c++filt gc++filt],
+ [_AC_PATH_PROG_FLAVOR_GNU([$ac_path_CXXFILT],
+ [ac_cv_path_CXXFILT=$ac_path_CXXFILT && ac_path_CXXFILT_found=:])])])
+ CXXFILT=$ac_cv_path_CXXFILT
+])
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 12271531ddf..5175d512d52 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,20 @@
+2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * make_sunver.pl: Remove extra whitespace in regexp.
+
+2010-07-02 Sebastian Pop <sebastian.pop@amd.com>
+
+ * check_GNU_style.sh: New.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * make_sunver.pl: New file.
+
+2010-07-02 Iain Sandoe <iains@gcc.gnu.org>
+
+ * compare-debug (Darwin): Remove '-x' flag from ld-based object
+ stripping. Add a comment as to why we do it this way.
+
2010-06-20 Alexandre Oliva <aoliva@redhat.com>
* compare-debug: Drop LTO sections.
diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
new file mode 100755
index 00000000000..6396417fab7
--- /dev/null
+++ b/contrib/check_GNU_style.sh
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+# Checks some of the GNU style formatting rules in a set of patches.
+# Copyright (C) 2010 Free Software Foundation, Inc.
+# Contributed by Sebastian Pop <sebastian.pop@amd.com>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+usage() {
+ cat <<EOF
+check_GNU_style.sh [patch]...
+
+ Checks the patches for some of the GNU style formatting problems.
+ Please note that these checks are not always accurate, and
+ complete. The reference documentation of the GNU Coding Standards
+ can be found here: http://www.gnu.org/prep/standards_toc.html
+ and there are also some additional coding conventions for GCC:
+ http://gcc.gnu.org/codingconventions.html
+
+EOF
+ exit 1
+}
+
+test $# -eq 0 && usage
+
+tmp=check_GNU_style.tmp
+
+# Grep
+g (){
+ msg="$1"
+ arg="$2"
+ shift 2
+ grep -nH '^+' $* \
+ | grep -v ':+++' \
+ | egrep --color=always -- "$arg" \
+ > $tmp && printf "\n$msg\n"
+ cat $tmp
+}
+
+# And Grep
+ag (){
+ msg="$1"
+ arg1="$2"
+ arg2="$3"
+ shift 3
+ grep -nH '^+' $* \
+ | grep -v ':+++' \
+ | egrep --color=always -- "$arg1" \
+ | egrep --color=always -- "$arg2" \
+ > $tmp && printf "\n$msg\n"
+ cat $tmp
+}
+
+# reVerse Grep
+vg (){
+ msg="$1"
+ varg="$2"
+ arg="$3"
+ shift 3
+ grep -nH '^+' $* \
+ | grep -v ':+++' \
+ | egrep -v -- "$varg" \
+ | egrep --color=always -- "$arg" \
+ > $tmp && printf "\n$msg\n"
+ cat $tmp
+}
+
+col (){
+ msg="$1"
+ shift 1
+ grep -nH '^+' $* \
+ | grep -v ':+++' \
+ | cut -f 2 -d '+' \
+ | awk '{ if (length ($0) > 80) print $0 }' \
+ > $tmp && printf "\n$msg\n"
+ cat $tmp
+}
+
+col 'Lines should not exceed 80 characters.' $*
+
+g 'Trailing whitespace.' \
+ '[[:space:]]$' $*
+
+g 'Space before dot.' \
+ '[[:alnum:]][[:blank:]]+\.' $*
+
+g 'Dot, space, space, new sentence.' \
+ '[[:alnum:]]\.([[:blank:]]|[[:blank:]]{3,})[[:alnum:]]' $*
+
+g 'Dot, space, space, end of comment.' \
+ '[[:alnum:]]\.([[:blank:]]{0,1}|[[:blank:]]{3,})\*/' $*
+
+g 'Sentences should end with a dot. Dot, space, space, end of the comment.' \
+ '[[:alnum:]][[:blank:]]*\*/' $*
+
+vg 'There should be exactly one space between function name and parentheses.' \
+ '\#define' '[[:alnum:]]([^[:blank:]]|[[:blank:]]{2,})\(' $*
+
+g 'There should be no space before closing parentheses.' \
+ '[[:graph:]][[:blank:]]+\)' $*
+
+ag 'Braces should be on a separate line.' \
+ '\{' 'if[[:blank:]]\(|while[[:blank:]]\(|switch[[:blank:]]\(' $*
+
+
diff --git a/contrib/compare-debug b/contrib/compare-debug
index 820721cd971..ea68b437db0 100755
--- a/contrib/compare-debug
+++ b/contrib/compare-debug
@@ -59,8 +59,10 @@ trap 'rm -f "$1.$suf1" "$2.$suf2"' 0 1 2 15
case `uname -s` in
Darwin)
- ld -S -x -r -no_uuid "$1" -o "$1.$suf1"
- ld -S -x -r -no_uuid "$2" -o "$2.$suf2"
+ # The strip command on darwin does not remove all debug info.
+ # Fortunately, we can use ld to do it instead.
+ ld -S -r -no_uuid "$1" -o "$1.$suf1"
+ ld -S -r -no_uuid "$2" -o "$2.$suf2"
;;
*)
cp "$1" "$1.$suf1"
diff --git a/contrib/make_sunver.pl b/contrib/make_sunver.pl
new file mode 100644
index 00000000000..d0875781dc6
--- /dev/null
+++ b/contrib/make_sunver.pl
@@ -0,0 +1,280 @@
+#!/usr/bin/perl -w
+
+# make_sunver.pl
+#
+# This script takes at least two arguments, a GNU style version script and
+# a list of object and archive files, and generates a corresponding Sun
+# style version script as follows:
+#
+# Each glob pattern, C++ mangled pattern or literal in the input script is
+# matched against all global symbols in the input objects, emitting those
+# that matched (or nothing if no match was found).
+# A comment with the original pattern and its type is left in the output
+# file to make it easy to understand the matches.
+#
+# It expects a 'nm' with the POSIX '-P' option, but everyone has one of
+# those, right?
+# It depends on the GNU version of c++filt, since it must understand the
+# GNU mangling style.
+
+use File::Glob ':glob';
+use FileHandle;
+use IPC::Open2;
+
+# Input version script, GNU style.
+my $symvers = shift;
+
+##########
+# Get all the symbols from the library, match them, and add them to a hash.
+
+my %sym_hash = ();
+
+# List of objects and archives to process.
+my @OBJECTS = ();
+
+# List of shared objects to omit from processing.
+my @SHAREDOBJS = ();
+
+# Filter out those input archives that have corresponding shared objects to
+# avoid adding all symbols matched in the archive to the output map.
+foreach $file (@ARGV) {
+ if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
+ printf STDERR "omitted $file -> $so\n";
+ push (@SHAREDOBJS, $so);
+ } else {
+ push (@OBJECTS, $file);
+ }
+}
+
+# The nm command to use.
+my $nm = $ENV{'NM_FOR_TARGET'} || "nm";
+
+# Process each symbol.
+open NM,$nm.' -P '.(join ' ',@OBJECTS).'|' or die $!;
+while (<NM>) {
+ my $i;
+ chomp;
+
+ # nm prints out stuff at the start, ignore it.
+ next if (/^$/);
+ next if (/:$/);
+ # Ignore register (SPARC only), undefined and local symbols. The
+ # symbol name is optional; Sun nm emits none for local or .bss symbols.
+ next if (/^([^ ]+)?[ \t]+[RUa-z][ \t]+/);
+ # Ignore objects without symbol table. Message goes to stdout with Sun
+ # nm, while GNU nm emits the corresponding message to stderr.
+ next if (/.* - No symbol table data/);
+
+ # $sym is the name of the symbol.
+ die "unknown nm output $_" if (! /^([^ ]+)[ \t]+[A-Z][ \t]+/);
+ my $sym = $1;
+
+ # Remember symbol.
+ $sym_hash{$sym}++;
+}
+close NM or die "nm error";
+
+##########
+# The various types of glob patterns.
+#
+# A glob pattern that is to be applied to the demangled name: 'cxx'.
+# A glob patterns that applies directly to the name in the .o files: 'glob'.
+# This pattern is ignored; used for local variables (usually just '*'): 'ign'.
+
+# The type of the current pattern.
+my $glob = 'glob';
+
+# We're currently inside `extern "C++"', which Sun ld doesn't understand.
+my $in_extern = 0;
+
+# We're currently inside a conditional section: just skip it.
+my $in_ifdef = 0;
+
+# The c++filt command to use. This *must* be GNU c++filt; the Sun Studio
+# c++filt doesn't handle the GNU mangling style.
+my $cxxfilt = $ENV{'CXXFILT'} || "c++filt";
+
+# The current version name.
+my $current_version = "";
+
+# Was there any attempt to match a symbol to this version?
+my $matches_attempted;
+
+# The number of versions which matched this symbol.
+my $matched_symbols;
+
+open F,$symvers or die $!;
+
+# Print information about generating this file
+print "# This file was generated by make_sunver.pl. DO NOT EDIT!\n";
+print "# It was generated by:\n";
+printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV);
+printf "# Omitted archives with corresponding shared libraries: %s\n",
+ (join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0;
+print "#\n\n";
+
+while (<F>) {
+ # End of skipped section.
+ if (/^[ \t]*\#endif/) {
+ $in_ifdef = 0;
+ next;
+ }
+
+ # Just skip a conditional section.
+ if ($in_ifdef) { next; }
+
+ # Lines of the form '};'
+ if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) {
+ $glob = 'glob';
+ if ($in_extern) {
+ $in_extern--;
+ print "$1##$2";
+ } else {
+ print;
+ }
+ next;
+ }
+
+ # Lines of the form '} SOME_VERSION_NAME_1.0;'
+ if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
+ $glob = 'glob';
+ # We tried to match symbols agains this version, but none matched.
+ # Emit dummy hidden symbol to avoid marking this version WEAK.
+ if ($matches_attempted && $matched_symbols == 0) {
+ print " hidden:\n";
+ print " .force_WEAK_off_$current_version = DATA S0x0 V0x0;\n";
+ }
+ print; next;
+ }
+
+ # Special comments that look like C preprocessor conditionals.
+ # Just skip the contents for now.
+ # FIXME: Allow passing in conditionals from the command line to really
+ # control the skipping.
+ if (/^[ \t]*\#ifdef/) {
+ $in_ifdef = 1;
+ next;
+ }
+
+ # Comment and blank lines
+ if (/^[ \t]*\#/) { print; next; }
+ if (/^[ \t]*$/) { print; next; }
+
+ # Lines of the form '{'
+ if (/^([ \t]*){$/) {
+ if ($in_extern) {
+ print "$1##{\n";
+ } else {
+ print;
+ }
+ next;
+ }
+
+ # Lines of the form 'SOME_VERSION_NAME_1.1 {'
+ if (/^([A-Z0-9_.]+)[ \t]+{$/) {
+ # Record version name.
+ $current_version = $1;
+ # Reset match attempts, #matched symbols for this version.
+ $matches_attempted = 0;
+ $matched_symbols = 0;
+ print;
+ next;
+ }
+
+ # Ignore 'global:'
+ if (/^[ \t]*global:$/) { print; next; }
+
+ # After 'local:', globs should be ignored, they won't be exported.
+ if (/^[ \t]*local:$/) {
+ $glob = 'ign';
+ print;
+ next;
+ }
+
+ # After 'extern "C++"', globs are C++ patterns
+ if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) {
+ $in_extern++;
+ $glob = 'cxx';
+ # Need to comment, Sun ld cannot handle this.
+ print "$1##$2\n"; next;
+ }
+
+ # Chomp newline now we're done with passing through the input file.
+ chomp;
+
+ # Catch globs. Note that '{}' is not allowed in globs by this script,
+ # so only '*' and '[]' are available.
+ if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) {
+ my $ws = $1;
+ my $ptn = $2;
+ # Turn the glob into a regex by replacing '*' with '.*'.
+ # Keep $ptn so we can still print the original form.
+ ($pattern = $ptn) =~ s/\*/\.\*/g;
+
+ if ($glob eq 'ign') {
+ # We're in a local: * section; just continue.
+ print "$_\n";
+ next;
+ }
+
+ # Print the glob commented for human readers.
+ print "$ws##$ptn ($glob)\n";
+ # We tried to match a symbol to this version.
+ $matches_attempted++;
+
+ if ($glob eq 'glob') {
+ my %ptn_syms = ();
+
+ # Match ptn against symbols in %sym_hash.
+ foreach my $sym (keys %sym_hash) {
+ # Maybe it matches one of the patterns based on the symbol in
+ # the .o file.
+ $ptn_syms{$sym}++ if ($sym =~ /^$pattern$/);
+ }
+
+ foreach my $sym (sort keys(%ptn_syms)) {
+ $matched_symbols++;
+ print "$ws$sym;\n";
+ }
+ } elsif ($glob eq 'cxx') {
+ my %dem_syms = ();
+
+ # Verify that we're actually using GNU c++filt. Other versions
+ # most likely cannot handle GNU style symbol mangling.
+ my $cxxout = `$cxxfilt --version 2>&1`;
+ $cxxout =~ m/GNU/ or die "$0 requires GNU c++filt to function";
+
+ # Talk to c++filt through a pair of file descriptors.
+ # Need to start a fresh instance per pattern, otherwise the
+ # process grows to 500+ MB.
+ my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!;
+
+ # Match ptn against symbols in %sym_hash.
+ foreach my $sym (keys %sym_hash) {
+ # No? Well, maybe its demangled form matches one of those
+ # patterns.
+ printf FILTOUT "%s\n",$sym;
+ my $dem = <FILTIN>;
+ chomp $dem;
+ $dem_syms{$sym}++ if ($dem =~ /^$pattern$/);
+ }
+
+ close FILTOUT or die "c++filt error";
+ close FILTIN or die "c++filt error";
+ # Need to wait for the c++filt process to avoid lots of zombies.
+ waitpid $pid, 0;
+
+ foreach my $sym (sort keys(%dem_syms)) {
+ $matched_symbols++;
+ print "$ws$sym;\n";
+ }
+ } else {
+ # No? Well, then ignore it.
+ }
+ next;
+ }
+ # Important sanity check. This script can't handle lots of formats
+ # that GNU ld can, so be sure to error out if one is seen!
+ die "strange line `$_'";
+}
+close F;
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 11c4e695ea1..942df122fc4 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * inclhack.def (solaris_cond_init): New fix.
+ * fixincl.x: Regenerate.
+ * tests/base/pthread.h [SOLARIS_COND_INIT_CHECK]: New test.
+ [SOLARIS_MUTEX_INIT_2_CHECK]: Adapt.
+
2010-06-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* inclhack.def (solaris__restrict, solaris_complex_cxx): New fixes
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 88ad8434020..f1552cc1741 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Friday May 7, 2010 at 02:41:29 PM MEST
+ * It has been AutoGen-ed Sunday June 27, 2010 at 12:52:26 PM MEST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Fri May 7 14:41:29 MEST 2010
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Jun 27 12:52:26 MEST 2010
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 207 fixup descriptions.
+ * This file contains 208 fixup descriptions.
*
* See README for more information.
*
@@ -6229,6 +6229,44 @@ extern \"C\" {\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Cond_Init fix
+ */
+tSCC zSolaris_Cond_InitName[] =
+ "solaris_cond_init";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Cond_InitList[] =
+ "pthread.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Cond_InitMachs[] = {
+ "*-*-solaris2.8",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Cond_InitSelect0[] =
+ "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+
+#define SOLARIS_COND_INIT_TEST_CT 1
+static tTestDesc aSolaris_Cond_InitTests[] = {
+ { TT_EGREP, zSolaris_Cond_InitSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Cond_Init
+ */
+static const char* apzSolaris_Cond_InitPatch[] = {
+ "format",
+ "%1, 0x4356%2",
+ "^(#define[ \t]+PTHREAD_COND_INITIALIZER[ \t]+\\{.*0)(\\},[ \t]*0\\}.*)$",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Solaris_Math_1 fix
*/
tSCC zSolaris_Math_1Name[] =
@@ -8432,9 +8470,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 246
+#define REGEX_COUNT 247
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 207
+#define FIX_COUNT 208
/*
* Enumerate the fixes
@@ -8593,6 +8631,7 @@ typedef enum {
SOLARIS___RESTRICT_FIXIDX,
SOLARIS_COMPLEX_FIXIDX,
SOLARIS_COMPLEX_CXX_FIXIDX,
+ SOLARIS_COND_INIT_FIXIDX,
SOLARIS_MATH_1_FIXIDX,
SOLARIS_MATH_2_FIXIDX,
SOLARIS_MATH_3_FIXIDX,
@@ -9415,6 +9454,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SOLARIS_COMPLEX_CXX_TEST_CT, FD_MACH_ONLY,
aSolaris_Complex_CxxTests, apzSolaris_Complex_CxxPatch, 0 },
+ { zSolaris_Cond_InitName, zSolaris_Cond_InitList,
+ apzSolaris_Cond_InitMachs,
+ SOLARIS_COND_INIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Cond_InitTests, apzSolaris_Cond_InitPatch, 0 },
+
{ zSolaris_Math_1Name, zSolaris_Math_1List,
apzSolaris_Math_1Machs,
SOLARIS_MATH_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 16f36a1e74a..362dc7054c9 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -3307,6 +3307,26 @@ fix = {
/*
+ * Solaris 8 PTHREAD_COND_INITIALIZER lacks the __pthread_cond_magic field.
+ * COND_MAGIC is only defined in <synch.h> and pollutes the namespace, so
+ * use the value literally instead.
+ */
+fix = {
+ hackname = solaris_cond_init;
+ select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+ files = pthread.h;
+ mach = '*-*-solaris2.8';
+ c_fix = format;
+ c_fix_arg = "%1, 0x4356%2";
+ c_fix_arg = "^(#define[ \t]+PTHREAD_COND_INITIALIZER[ \t]+"
+ "\\{.*0)(\\},[ \t]*0\\}.*)$";
+ test_text =
+ '#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"'"\n"
+ '#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* = DEFAULTCV */';
+};
+
+
+/*
* Sun Solaris 10 defines several C99 math macros in terms of
* builtins specific to the Studio compiler, in particular not
* compatible with the GNU compiler.
diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h
index 069a22bb48b..f08aee40bb6 100644
--- a/fixincludes/tests/base/pthread.h
+++ b/fixincludes/tests/base/pthread.h
@@ -101,6 +101,16 @@ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
#endif /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
+#if defined( SOLARIS_COND_INIT_CHECK )
+#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, 0} /* = DEFAULTCV */
+#else
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, {0}} /* = DEFAULTCV */
+#endif
+#endif /* SOLARIS_COND_INIT_CHECK */
+
+
#if defined( SOLARIS_MUTEX_INIT_2_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
@@ -109,9 +119,9 @@ extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, {0}}
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
-#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* DEFAULTCV */
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, 0} /* DEFAULTCV */
#else
-#define PTHREAD_COND_INITIALIZER {{{0}, 0}, {0}} /* DEFAULTCV */
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, {0}} /* DEFAULTCV */
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index af1148791b9..0a566ff5432 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,3779 @@
+2010-07-23 Kai Tietz <kai.tietz@onevision.com>
+
+ PR target/41943
+ * Makefile.in (USER_H_INC_NEXT_PRE,
+ USER_H_INC_NEXT_POST): New.
+ (stmp-int-hdrs): Prefix/postfix headers by include_next.
+ * config.gcc (user_headers_inc_next_pre): New.
+ (user_headers_inc_next_post): Likewise.
+ (*-w64-mingw*): Use for float.h post-fixing, and for
+ stddef.h/stdarg.h pre-fixing by include_next.
+ * configure.ac (user_headers_inc_next_post): New.
+ (user_headers_inc_next_pre): New.
+ * configure: Regenerated.
+
+2010-07-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Don't disable TLS on Solaris 8/9 by default
+ Set tga_func for Solaris 2/x86 resp. SPARC.
+ Remove duplicate parts of sparc*-sun-solaris2.* TLS check.
+ (LIB_THREAD_LDFLAGS_SPEC): Define.
+ (LIB_TLS_SPEC): Define.
+ Check for required Sun ld version.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * config/sol2.h (LIB_SPEC): Use LIB_THREAD_LDFLAGS_SPEC with
+ -pthread, -threads, LIB_TLS_SPEC with -pthread.
+ * doc/install.texi (Specific, *-*-solaris2*): Document use of
+ alternate thread libraries on Solaris 8.
+ Document TLS patch requirements.
+ * doc/sourcebuild.texi (Add Options): Sort alphabetically.
+ Document tls.
+
+ PR target/18788
+ * config/sol2.h (LIB_SPEC): Link with thread libraries even with
+ -shared.
+
+2010-07-23 Jakub Jelinek <jakub@redhat.com>
+
+ * tree.h (struct tree_base): Add nameless_flag bitfield.
+ (TYPE_NAMELESS, DECL_NAMELESS): Define.
+ * omp-low.c (create_omp_child_function, scan_omp_parallel,
+ scan_omp_task, lower_omp_taskreg): Set DECL_NAMELESS and/or
+ DECL_ARTIFICIAL where needed.
+ * dwarf2out.c (dwarf2_name): Return NULL if DECL_NAMELESS.
+ (type_tag): Return NULL if TYPE_NAMELESS or if TYPE_DECL
+ has DECL_NAMELESS set.
+
+2010-07-23 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44915
+ * ipa-cp.c (cgraph_gate_cp): Also check that optimize is true.
+ * ipa-inline.c (cgraph_mark_inline_edge): Likewise.
+ (analyze_function): Likewise.
+
+2010-07-23 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44914
+ * tree-sra.c (sra_modify_function_body): Return true if CFG was
+ changed, add purging dead eh edges.
+ (ipa_sra_modify_function_body): Return true if CFG was changed,
+ simplify purging dead eh edges.
+ (modify_function): Return true if CFG was changed.
+ (perform_intra_sra): Add TODO_cleanup_cfg to the return value if CFG
+ was changed.
+ (ipa_early_sra): Likewise.
+
+2010-07-23 Jie Zhang <jie@codesourcery.com>
+
+ PR target/44290
+ * attribs.c (decl_attributes): Insert "noinline" and "noclone"
+ if "naked".
+ * tree-sra.c (ipa_sra_preliminary_function_checks): Return
+ false if ! tree_versionable_function_p.
+
+2010-07-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ * builtins.def (BUILT_IN_ARGS_INFO): Remove.
+ * ipa-pure-const.c (special_builtlin_state): Remove
+ BUILT_IN_ARGS_INFO case.
+ * tree-stdarg.c (execute_optimize_stdarg): Likewise.
+ * builtins.c (expand_builtin): Likewise.
+ (expand_builtin_args_info): Remove.
+ * doc/tm.texi (__builtin_args_info): Remove.
+ (__builtin_next_arg): Adjust to not refer to __builtin_args_info.
+ * doc/tm.text.in: Likewise.
+
+2010-07-23 Richard Guenther <rguenther@suse.de>
+
+ * lto-symtab.c (lto_symtab_merge): Use gtc_mode enum
+ values.
+ (lto_symtab_merge_decls_2): Likewise.
+ * tree-ssa.c (useless_type_conversion_p): Likewise.
+ * lto-streamer-in.c (input_gimple_stmt): Likewise.
+ * gimple.c (gtc_visited2, gtc_ob2): Remove.
+ (struct type_pair_d): Make same_p an array indexed by mode.
+ Update comment.
+ (lookup_type_pair): Update initialization.
+ (struct sccs): Adjust same_p type.
+ (gimple_types_compatible_p_1, gtc_visit, gimple_types_compatible_p):
+ Adjust.
+ (print_gimple_types_stats): Likewise.
+ * gimple.h (enum gtc_mode): New.
+ (gimple_types_compatible_p): Adjust prototype.
+
+2010-07-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * dwarf2out.c (dwarf2out_frame_debug): Check for queued saves
+ again after processing insn.
+
+2010-07-23 Jie Zhang <jie@codesourcery.com>
+
+ * tree-sra.c (ipa_sra_preliminary_function_checks): Dump
+ proper words when !tree_versionable_function_p.
+
+2010-07-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/45037
+ * tree-ssa-loop-ivopts.c (copy_ref_info): Handle NULL base.
+
+2010-07-23 Jie Zhang <jie@codesourcery.com>
+
+ * doc/extend.texi: Remove IP2K from the description of naked
+ attribute. Add MCORE instead.
+
+2010-07-10 Andi Kleen <ak@linux.intel.com>
+
+ PR lto/44992
+ * lto-opts.c (lto_write_options): Add NULL file_data argument to
+ lto_get_section_name.
+ * lto-section-out.c (lto_destroy_simple_output_block): Likewise.
+ * lto-streamer-out.c (produce_asm): Likewise.
+ (copy_function): Likewise.
+ (produce_symtab): Likewise.
+ (produce_asm_for_decls): Likewise.
+ * lto-streamer.c (lto_get_section_name): Add file_data argument.
+ Rewrite to add random postfix to LTO sections.
+ * lto-streamer.h (lto_file_decl_data): Add next, id, resolutions.
+ (lto_get_section_name): Add file_data argument to prototype.
+
+2010-07-10 Andi Kleen <ak@linux.intel.com>
+
+ * lto-section-in.c (lto_section_name): Synchronize names
+ with lto_get_section_name.
+
+2010-07-10 Andi Kleen <ak@linux.intel.com>
+
+ * lto-opts.c (lto_read_file_options): Check for missing section.
+
+2010-07-22 Bernd Schmidt <bernds@codesourcery.com>
+
+ * ira.c (check_allocation): Correctly handle the case where an allocno
+ with two objects was allocated to a single reg.
+
+2010-07-22 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * tree-ssa-math-opts.c (is_widening_mult_rhs_p): New function.
+ (is_widening_mult_p): Likewise.
+ (convert_to_widen): Use them.
+ (convert_plusminus_to_widen): Likewise. Handle fixed-point types as
+ well as integer ones.
+
+2010-07-22 Steven Bosscher <steven@gcc.gnu.org>
+
+ * alias.c (true_dependence_1): New function, merged version of
+ true_dependence and canon_true_dependence.
+ (true_dependence): Simplify.
+ (canon_true_dependence): Simplify.
+
+2010-07-22 Richard Henderson <rth@redhat.com>
+
+ PR target/45027
+ * config/i386/i386.c (setup_incoming_varargs_64): Force the use
+ of V4SFmode for the SSE saves; increase stack alignment if needed.
+ (ix86_gimplify_va_arg): Don't increase stack alignment here.
+
+2010-07-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/45028
+ * recgprop.c (copyprop_hardreg_forward_1): If changed is true,
+ call cprop_find_used_regs again via note_uses.
+
+2010-07-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * alias.c (get_alias_set): Fix formatting issues.
+
+2010-07-22 Steve Ellcey <sje@cup.hp.com>
+
+ PR middle-end/44878
+ * stmt.c (expand_value_return): Call promote_function_mode with
+ a for_return argument of 2 when returning by reference.
+
+2010-07-22 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/45024
+ * dwarf2out.c (scope_die_for): Don't fall back to the compilation
+ unit DIE if we can find the scope DIE.
+
+2010-07-22 Bernd Schmidt <bernds@codesourcery.com>
+
+ * ira-build.c (ira_create_object): New arg SUBWORD; all callers
+ changed. Initialize OBJECT_SUBWORD.
+ (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS.
+ (ira_create_allocno_objects): Renamed from ira_create_allocno_object;
+ all callers changed.
+ (merge_hard_reg_conflicts): Iterate over allocno subobjects.
+ (finish_allocno): Likewise.
+ (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise.
+ (remove_low_level_allocnos): Likewise.
+ (update_bad_spill_attribute): Likewise.
+ (setup_min_max_allocno_live_range_point): Likewise.
+ (sort_conflict_id_map): Likewise.
+ (ira_flattening): Likewise. Use ior_hard_reg_conflicts.
+ (ior_hard_reg_conflicts): New function.
+ (ior_allocate_object_conflicts): Renamed first argument to OBJ.
+ (compress_conflict_vecs): Iterate over objects, not allocnos.
+ (ira_add_live_range_to_object): New function.
+ (object_range_compare_func): Renamed from allocno_range_compare_func.
+ All callers changed.
+ (setup_min_max_conflict_allocno_ids): For allocnos with multiple
+ subobjects, widen the min/max range of the lowest-order object to
+ potentially include all other such low-order objects.
+ * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects.
+ (check_allocation): Likewise. Use more fine-grained tests for register
+ conflicts.
+ * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over
+ allocno subobjects.
+ (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained
+ choices about which bits to set in each set. Don't use
+ ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts
+ using the multiple sets we computed.
+ (push_allocno_to_stack): Iterate over allocno subobjects.
+ (all_conflicting_hard_regs_coalesced): New static function.
+ (setup_allocno_available_regs_num): Use it.
+ (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno
+ subobjects.
+ (coalesced_allocno_conflict): Test subobject 0 in each allocno.
+ (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM
+ by ALLOCNO_NUM_OBJECTS.
+ (calculate_spill_cost): Likewise.
+ (color_pass): Express if statement in a more normal way.
+ (ira_reassign_conflict_allocnos): Iterate over allocno subobjects.
+ (slot_coalesced_allocno_live_ranges_intersect_p): Likewise.
+ (setup_slot_coalesced_allocno_live_ranges): Likewise.
+ (allocno_reload_assign): Likewise.
+ (ira_reassign_pseudos): Likewise.
+ (fast_allocation): Likewise.
+ * ira-conflicts.c (build_conflict_bit_table): Likewise.
+ (print_allocno_conflicts): Likewise.
+ (ira_build_conflicts): Likewise.
+ (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All
+ callers changed. Test subword 0 of each allocno for conflicts.
+ (build_object_conflicts): Renamed from build_allocno_conflicts. All
+ callers changed. Iterate over allocno subobjects.
+ * ira-emit.c (modify_move_list): Iterate over allocno subobjects.
+ * ira-int.h (struct ira_allocno): New member: num_objects.
+ Rename object to objects and change it into an array.
+ (ALLOCNO_OBJECT): Add new argument N.
+ (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros.
+ (ira_create_allocno_objects): Renamed from ira_create_allocno_object.
+ (ior_hard_reg_conflicts): Declare.
+ (ira_add_live_range_to_object): Declare.
+ (ira_allocno_object_iterator): New.
+ (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New.
+ (FOR_EACH_ALLOCNO_OBJECT): New macro.
+ * ira-lives.c (objects_live): Renamed from allocnos_live; all
+ uses changed.
+ (allocnos_processed): New sparseset.
+ (make_object_born): Renamed from make_allocno_born; take an
+ ira_object_t argument. All callers changed.
+ (make_object_dead): Renamed from make_allocno_dead; take an
+ ira_object_t argument. All callers changed.
+ (update_allocno_pressure_excess_length): Take an ira_obejct_t argument.
+ All callers changed.
+ (mark_pseudo_regno_live): Iterate over allocno subobjects.
+ (mark_pseudo_regno_dead): Likewise.
+ (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New
+ functions.
+ (mark_ref_live): Detect subword accesses and call
+ mark_pseudo_regno_subword_live as appropriate.
+ (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead.
+ (process_bb_nodes_live): Deal with object-related updates first; set
+ and test bits in allocnos_processed to avoid computing allocno
+ statistics more than once.
+ (create_start_finish_chains): Iterate over objects, not allocnos.
+ (print_object_live_ranges): New function.
+ (print_allocno_live_ranges): Use it.
+ (ira_create_allocno_live_ranges): Allocate and free allocnos_processed
+ and objects_live.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/42451
+ * gimple.c (gtc_next_dfs_num): New global.
+ (struct sccs): Make value a union, add integer same_p member.
+ (gtc_visit): New function.
+ (gimple_types_compatible_p_1): New function, split out from ...
+ (gimple_types_compatible_p): ... here. Start a DFS walk here.
+ (iterative_hash_gimple_type): Adjust for sccs change.
+
+2010-07-22 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44891
+ * tree-sra.c: Include gimple-pretty-print.h.
+ (replace_uses_with_default_def_ssa_name): Renamed to
+ get_repl_default_def_ssa_name, return the new SSA name instead of
+ replacing the old one.
+ (sra_modify_assign): Dump a message when removing a load, if the LHS
+ is an SSA_NAME, do not do any propagation, just set the RHS to a
+ default definition SSA NAME, type convert if necessary.
+ * Makefile.in (tree-sra.o): Add gimple-pretty-print.h to dependencies.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/45017
+ * tree-ssa-sccvn.c (vn_reference_eq): Make sure we honor
+ TYPE_PRECISION of integral types in addition to size.
+
+2010-07-22 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * config/rs6000/sysv4.h (CHOOSE_DYNAMIC_LINKER): Default to GLIBC
+ when no C library is specified.
+
+2010-07-22 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.h (struct ipa_node_params): Updated comment.
+ (struct ipa_edge_args): Likewise.
+ * Makefile.in (ipa-prop.o): Remove bogus $(GIMPLE_FOLD_H) dependency.
+
+2010-07-22 Martin Jambor <mjambor@suse.cz>
+
+ * cgraphunit.c (verify_edge_count_and_frequency): New function.
+ (verify_cgraph_node): Verify frequencies of indirect edges.
+ * tree-inline.c (tree_function_versioning): Update frequencies of
+ indirect edges.
+
+2010-07-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ PR target/43698
+ * config/arm/arm.md: Split arm_rev into *arm_rev
+ and *thumb1_rev. Set *arm_rev to be predicable.
+
+2010-07-22 Iain Sandoe <iains@gcc.gnu.org>
+
+ * config/darwin.h (LINK_COMMAND_SPEC): Split into...
+ (LINK_COMMAND_SPEC_A): New.
+ (DSYMUTIL): New.
+ (DSYMUTIL_SPEC): New.
+ * config/darwin9.h (LINK_COMMAND_SPEC): Remove.
+ (DSYMUTIL_SPEC): Update for darwin >= 9 requirements.
+
+2010-07-22 Iain Sandoe <iains@gcc.gnu.org>
+
+ * calls.c (load_register_parameters): Move check for zero
+ sized items so that only the call to
+ mem_overlaps_already_clobbered_arg_p () is protected.
+
+2010-07-22 Jan Hubicka <jh@suse.cz>
+
+ * ipa-pure-const.c (varying_state): Break out from ...
+ (get_function_state): ... here; always return varying_state
+ when state would be NULL otherwise.
+ (remove_node_data): Do not free varying state.
+
+2010-07-22 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR bootstrap/44970
+ PR middle-end/45009
+ * postreload.c: Include "target.h".
+ (reload_combine_closest_single_use): Don't take DEBUG_INSNs
+ into account.
+ (fixup_debug_insns): Don't copy the rtx.
+ (reload_combine_recognize_const_pattern): DEBUG_INSNs can't
+ have uses. Don't copy when replacing. Call fixup_debug_insns
+ in the case where we merged one add with another.
+ (reload_combine_recognize_pattern): Fail if there aren't any
+ uses. Try harder to determine whether we're picking a valid
+ index register. Don't set store_ruid for an insn we're going
+ to scan in the next iteration.
+ (reload_combine): Remove unused code.
+ (reload_combine_note_use): When updating use information for
+ an old insn, ignore a use that occurs after store_ruid.
+ * Makefile.in (postreload.o): Update dependencies.
+
+ * function.c (record_hard_reg_sets): Restrict the previous change
+ to cases where the incoming nominal mode is the same as the
+ incoming promoted mode and everything happens in MODE_INT.
+
+2010-07-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45015
+ * var-tracking.c (adjust_mems): Ignore ASM_OPERANDS with non-zero
+ ASM_OPERANDS_OUTPUT_IDX.
+ (adjust_insn): For inline asm with multiple sets ensure first
+ ASM_OPERANDS vectors are used by all following ASM_OPERANDS in
+ the insn.
+
+2010-07-21 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (setup_incoming_varargs_64): Emit a simple
+ comparison for avoiding xmm register saves. Emit the xmm register
+ saves explicitly.
+ * config/i386/i386.md (UNSPEC_SSE_PROLOGUE_SAVE): Remove.
+ (UNSPEC_SSE_PROLOGUE_SAVE_LOW): Remove.
+ (sse_prologue_save, sse_prologue_save_insn1, sse_prologue_save_insn):
+ Remove patterns and the associated splitters.
+
+2010-07-21 Changpeng Fang <changpeng.fang@amd.com>
+
+ * tree-ssa-loop-prefetch.c (analyze_ref): Strip off the real
+ and imagine parts of a complex, so that they can have the same
+ base and fall into the same group.
+
+2010-07-21 Richard Guenther <rguenther@suse.de>
+
+ PR lto/45018
+ * tree.c (find_decls_types_r): Do not follow TREE_CHAIN
+ of TYPE_DECLs. Do not follow TYPE_NEXT_VARIANT,
+ TYPE_NEXT_PTR_TO, nor TYPE_NEXT_REF_TO or TYPE_CANONICAL.
+
+2010-07-21 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44900
+ * tree-sra.c (load_assign_lhs_subreplacements): Updated comments.
+ (sra_modify_assign): Move gsi to the next statmenent unconditionally.
+
+2010-07-21 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR middle-end/44738
+ * tree-ssa.c (warn_uninit): Avoid emitting an unnecessary message.
+
+2010-07-21 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/45013
+ * tree-ssa.c (useless_type_conversion_p): Dispatch to
+ gimple_types_compatible_p only when in lto.
+ * gimple.c (gimple_types_compatible_p): Use canonical types
+ to speed up comparison.
+
+2010-07-21 Richard Guenther <rguenther@suse.de>
+
+ * tree-flow.h (referenced_var): Move define ...
+ * tree-flow-inline.h (referenced_var): ... here as an inline
+ function. Assert here ...
+ * tree-dfa.c (referenced_var_lookup): ... instead of here.
+ * tree-ssa.c (maybe_optimize_var): Check if the variable
+ is in referenced vars.
+ (execute_update_addresses_taken): Remove old broken check.
+ * gimple-pretty-print.c (pp_points_to_solution): Use
+ referenced_var_lookup.
+ * tree-into-ssa.c (dump_decl_set): Likewise.
+
+2010-07-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45003
+ * var-tracking.c (reverse_op): Also handle {SIGN,ZERO}_EXTEND of
+ a MEM.
+ * dwarf2out.c (loc_descriptor): Don't handle SIGN_EXTEND nor
+ ZERO_EXTEND here.
+
+2010-07-20 Richard Henderson <rth@redhat.com>
+
+ * vxworks.c (vxworks_emutls_var_fields): Pass locus to build_decls.
+
+2010-07-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * config/arm/arm.md (thumb1_addsi3): Add alternative and split for
+ computing the sum of the stack pointer and a large constant.
+ * config/arm/constraints.md (M): Remove superfluous parentheses.
+ (Pc): New constraint.
+
+2010-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45006
+ * cfgexpand.c (expand_debug_expr): Only look at TYPE_UNSIGNED of
+ operand's type if exp is tcc_unary class tree.
+
+2010-07-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/rs6000/rs6000.md (abs<mode>2_isel, nabs<mode>2_isel):
+ Reverse sense of if_then_else condition.
+
+2010-07-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/rs6000/rs6000.opt (mblock-move-inline-limit): New option.
+ * config/rs6000/rs6000.c (rs6000_override_options): Set
+ rs6000_block_move_inline_limit appropriately.
+ (expand_block_move): Use rs6000_block_move_inline_limit.
+ * doc/invoke.texi (mblock-move-inline-limit): Document.
+
+2010-07-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * postreload.c (fixup_debug_insns): Remove arg REGNO. New args
+ FROM and TO. All callers changed. Don't look for tracked uses,
+ just scan the RTL for DEBUG_INSNs and substitute.
+ (reload_combine_recognize_pattern): Call fixup_debug_insns.
+ (reload_combine): Ignore DEBUG_INSNs.
+
+2010-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ * var-tracking.c (vt_expand_loc, vt_expand_loc_dummy): Bump maximum
+ depth to 8 from 5.
+
+ PR debug/45003
+ * cfgexpand.c (expand_debug_expr) <case NOP_EXPR>: Use ZERO_EXTEND
+ or SIGN_EXTEND depending on TYPE_UNSIGNED of the operand's type
+ instead of the result's type.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44977
+ * tree-ssa-dom.c (propagate_rhs_into_lhs): Do not create invalid
+ SSA form.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ * lto-symtab.c (lto_symtab_merge): Use gimple_types_compatible_p.
+ (lto_symtab_merge_decls_2): Likewise.
+ * gimple.h (gimple_types_compatible_p): Declare.
+ * gimple.c (gimple_queue_type_fixup): Remove.
+ (gimple_fixup_complete_and_incomplete_subtype_p): Likewise.
+ (gimple_compatible_complete_and_incomplete_type_p): New function.
+ (gimple_types_compatible_p): Adjust.
+ (gimple_register_type): Remove type fixup code.
+ (print_gimple_types_stats): Adjust.
+ (free_gimple_type_tables): Likewise.
+ * lto-streamer-in.c (input_gimple_stmt): Use gimple_types_compatible_p.
+ * tree-ssa.c (useless_type_conversion_p): Likewise.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44971
+ PR middle-end/44988
+ * tree-ssa.c (maybe_optimize_var): New function split out from ...
+ (execute_update_addresses_taken): ... here.
+ (non_rewritable_mem_ref_base): Likewise.
+ (execute_update_addresses_taken): Do not iterate over all referenced
+ vars but just all local decls and parms.
+ Properly check call and asm arguments and rewrite call arguments.
+
+2010-07-20 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * config.gcc (LIBC_GLIBC, LIBC_UCLIBC, LIBC_BIONIC): Move constants
+ to top level.
+ * config/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): Move Android-specific
+ definitions ...
+ * config/linux-android.h (ANDROID_TARGET_OS_CPP_BUILTINS): ... here.
+ New macro.
+ * config/arm/linux-eabi.h (TARGET_OS_CPP_BUILTINS): Use it.
+
+2010-07-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gengtype.c (start_root_entry): New function, split out from
+ write_root. Check whether V is null and raise an error if so.
+ (write_field_root): Check for V being null. Don't raise an error here;
+ set V to null instead.
+ (write_root): Update comment above function. Use start_root_entry.
+
+2010-07-19 Xinliang David Li <davidxl@google.com>
+
+ PR testsuite/44932
+ * tree-ssa-uninit.c (collect_phi_def_edges): Fix bug collecting
+ def edges.
+ (find_uninit_use): Add dump.
+ (is_use_properly_guarded): Ditto.
+ (warn_uninitialized_phi): Ditto.
+ (execute_late_warn_uninitialized): Ditto.
+
+2010-07-19 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44941
+ * expr.c (emit_block_move_hints): Move zero size check first.
+ Move asserts to more useful places.
+ * calls.c (load_register_parameters): Check for zero size.
+
+2010-07-19 Richard Henderson <rth@redhat.com>
+
+ * tree-optimize.c (execute_all_early_local_passes): New. Change
+ cgraph_state here ...
+ (execute_early_local_optimizations): ... not here. Remove.
+ (pass_early_local_passes, pass_all_early_optimizations): Update.
+
+2010-07-19 Bernd Schmidt <bernds@codesourcery.com>
+
+ * postreload.c (reload_combine_closest_single_use): Ignore the
+ number of uses for DEBUG_INSNs.
+ (fixup_debug_insns): New static function.
+ (reload_combine_recognize_const_pattern): Use it. Don't let the
+ main loop be affected by DEBUG_INSNs.
+ Really disallow moving adds past a jump insn.
+ (reload_combine_recognize_pattern): Don't update use_ruid here.
+ (reload_combine_note_use): Do it here.
+ (reload_combine): Use control_flow_insn_p rather than JUMP_P.
+
+2010-07-19 Bingfeng Mei <bmei@broadcom.com>
+
+ * ddg.c (create_ddg): Exclude nodes of debug_insn in counting nodes
+ of a loop.
+ * loop-doloop.c (doloop_condition_get): Skip possible debug_insn.
+
+2010-07-19 Iain Sandoe <iains@gcc.gnu.org>
+
+ * config/i386/darwin.h: Define darwin_emit_branch_islands.
+ (TARGET_MACHO_BRANCH_ISLANDS): New.
+ (FUNCTION_PROFILER): Use TARGET_MACHO_BRANCH_ISLANDS.
+ * config/i386/i386.h (TARGET_MACHO_BRANCH_ISLANDS): Define a
+ default value.
+ * config/i386/i386.c (output_pic_addr_const): Do not emit
+ branch islands unless TARGET_MACHO_BRANCH_ISLANDS is set.
+ (x86_output_mi_thunk): Adjust symbol creation.
+ * config/rs6000/darwin.h: Define darwin_emit_branch_islands.
+ Remove out of date comment.
+ * config/rs6000/rs6000.c (print_operand): Adjust symbol.
+ (DARWIN_LINKER_GENERATES_ISLANDS): Remove.
+ (DARWIN_GENERATE_ISLANDS): Ditto.
+ (output_call): Do not emit branch islands unless
+ darwin_emit_branch_islands is set.
+ * config/darwin.c: Declare darwin_emit_branch_islands.
+ (machopic_indirect_data_reference): Do not emit unless
+ darwin_emit_branch_islands is set.
+ (darwin_override_options): Set darwin_emit_branch_islands
+ where it is needed.
+ * config/darwin9.h (DARWIN_LINKER_GENERATES_ISLANDS): Remove.
+
+2010-07-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/sourcebuild.texi (Effective-Target Keywords): Document
+ sse_runtime, sse2_runtime.
+
+2010-07-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.c (mips16_build_call_stub): Zero-extend the
+ low half of a single-register SCmode return value before ORing
+ it with the high half.
+ * config/mips/mips16.S (MERGE_GPRf): Likewise.
+
+2010-07-17 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/44805
+ * config/pa/pa.h (CONSTANT_ALIGNMENT): Align strings to BITS_PER_WORD
+ on all targets.
+
+2010-07-17 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/42235
+ * postreload.c (reload_cse_move2add): Return bool, true if anything.
+ changed. All callers changed.
+ (move2add_use_add2_insn): Likewise.
+ (move2add_use_add3_insn): Likewise.
+ (reload_cse_regs): If reload_cse_move2add changed anything, rerun
+ reload_combine.
+ (RELOAD_COMBINE_MAX_USES): Bump to 16.
+ (last_jump_ruid): New static variable.
+ (struct reg_use): New members CONTAINING_MEM and RUID.
+ (reg_state): New members ALL_OFFSETS_MATCH and REAL_STORE_RUID.
+ (reload_combine_split_one_ruid, reload_combine_split_ruids,
+ reload_combine_purge_insn_uses, reload_combine_closest_single_use
+ reload_combine_purge_reg_uses_after_ruid,
+ reload_combine_recognize_const_pattern): New static functions.
+ (reload_combine_recognize_pattern): Verify that ALL_OFFSETS_MATCH
+ is true for our reg and that we have available index regs.
+ (reload_combine_note_use): New args RUID and CONTAINING_MEM. All
+ callers changed. Use them to initialize fields in struct reg_use.
+ (reload_combine): Initialize last_jump_ruid. Be careful when to
+ take PREV_INSN of the scanned insn. Update REAL_STORE_RUID fields.
+ Call reload_combine_recognize_const_pattern.
+ (reload_combine_note_store): Update REAL_STORE_RUID field.
+
+2010-07-16 Jason Merrill <jason@redhat.com>
+
+ * Makefile.in (opts-common.o): Depend on options.h.
+
+2010-07-16 Nathan Froyd <froydnj@codesourcery.com>
+
+ * tree.c (build_common_builtin_nodes): Use build_function_type_list
+ instead of build_function_type.
+ * tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Likewise.
+ * cgraphunit.c (cgraph_build_static_cdtor): Likewise.
+
+2010-07-16 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_sISEL): Let rs6000_emit_int_cmove
+ do all the work.
+ (rs6000_emit_int_cmove): Use function pointers for insn generation.
+ Don't force values into registers unnecessarily.
+ (output_isel): Assert that we're not given conditions we can't handle.
+ Delete corresponding code.
+ * config/rs6000/rs6000.md (isel_signed_<mode>): Use
+ scc_comparison_operator constraint. Permit 0 for the consequent
+ operand. Permit any GPR for the alternative operand.
+ (isel_unsigned_<mode>): Likewise.
+
+2010-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/44942
+ * config/i386/i386-protos.h (ix86_function_arg_boundary): Change second
+ argument to const_tree.
+ * config/i386/i386.c (function_arg_advance): If padding needs to be
+ inserted before argument, increment cum->words by number of padding
+ words as well.
+ (contains_aligned_value_p): Change argument to const_tree.
+ (ix86_function_arg_boundary): Change second argument to const_tree.
+
+2010-07-16 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/42235
+ * function.c (record_hard_reg_sets): New static function.
+ (assign_parm_setup_reg): If an optab for extending exists and the
+ generated code clobbbers no hard regs, emit the insn directly and
+ create a REG_EQUIV note.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * c-decl.c (detect_field_duplicates): Use DECL_CHAIN insted of
+ TREE_CHAIN.
+ * c-typeck.c (push_init_level): Likewise.
+ (process_init_element): Likewise.
+
+2010-07-15 Anatoly Sokolov <aesok@post.ru>
+
+ * tree.h (enum tree_index): Add TI_INTEGER_THREE.
+ (integer_three_node): Add.
+ * tree.c (build_common_tree_nodes_2): Use integer_type_node insead of
+ NULL_TREE in build_int_cst calls. Initialize the integer_three_node.
+ * builtins.c (expand_builtin_prefetch): Use common tree nodes instead
+ of call build_int_cst.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Ditto.
+ * tree-ssa-loop-ivopts.c (idx_find_step): Ditto.
+ (find_interesting_uses_address): Ditto.
+ * tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Ditto.
+ * tree-eh.c (lower_eh_constructs_2): Ditto.
+ * tree-vect-loop.c (get_initial_def_for_induction): Ditto.
+ * c-typeck.c (really_start_incremental_init, push_init_level): Ditto.
+ * expmed.c (expand_divmod): Ditto.
+ * tree-mudflap.c (mx_register_decls): Ditto.
+ * varasm.c (array_size_for_constructor): Ditto.
+ * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Ditto.
+ * c-parser.c (c_parser_postfix_expression): Ditto.
+
+2010-07-15 Bernd Schmidt <bernds@codesourcery.com>
+
+ * postreload.c (last_label_ruid, first_index_reg, last_index_reg):
+ New static variables.
+ (reload_combine_recognize_pattern): New static function, broken out
+ of reload_combine.
+ (reload_combine): Use it. Only initialize first_index_reg and
+ last_index_reg once.
+
+2010-07-15 Richard Henderson <rth@redhat.com>
+
+ * cgraphunit.c (cgraph_build_static_cdtor): Clear current_function_decl
+ when done.
+
+2010-07-15 Jan Hubicka <jh@suse.cz>
+
+ * lto-symtab.c (lto_symtab_resolve_symbols): Remove hack handling
+ comdats for broken gold.
+ (lto_sy mtab_merge_decls_1): Set used_from_object_file correctly.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * tree.h (TREE_RTL_OPERAND_CHECK): Delete.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * tree.h (DECL_CHAIN): Define.
+ * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
+ * c-decl.c: Likewise.
+ * c-parser.c: Likewise.
+ * c-typeck.c: Likewise.
+ * cfgexpand.c: Likewise.
+ * cgraph.c: Likewise.
+ * cgraphunit.c: Likewise.
+ * combine.c: Likewise.
+ * config/alpha/alpha.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/i386/i386.c: Likewise.
+ * config/i386/winnt-cxx.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/iq2000/iq2000.c: Likewise.
+ * config/mep/mep.c: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/pa/som.h: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sh/symbian-cxx.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/spu/spu.c: Likewise.
+ * config/stormy16/stormy16.c: Likewise.
+ * config/vxworks.c: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+ * coverage.c: Likewise.
+ * dbxout.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * emit-rtl.c: Likewise.
+ * expr.c: Likewise.
+ * function.c: Likewise.
+ * gimple-low.c: Likewise.
+ * gimple-pretty-print.c: Likewise.
+ * gimplify.c: Likewise.
+ * integrate.c: Likewise.
+ * ipa-inline.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * ipa-split.c: Likewise.
+ * ipa-struct-reorg.c: Likewise.
+ * ipa-type-escape.c: Likewise.
+ * langhooks.c: Likewise.
+ * lto-cgraph.c: Likewise.
+ * omp-low.c: Likewise.
+ * stor-layout.c: Likewise.
+ * tree-cfg.c: Likewise.
+ * tree-complex.c: Likewise.
+ * tree-dfa.c: Likewise.
+ * tree-dump.c: Likewise.
+ * tree-inline.c: Likewise.
+ * tree-mudflap.c: Likewise.
+ * tree-nested.c: Likewise.
+ * tree-object-size.c: Likewise.
+ * tree-pretty-print.c: Likewise.
+ * tree-sra.c: Likewise.
+ * tree-ssa-live.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-ssa-math-opts.c: Likewise.
+ * tree-ssa-reassoc.c: Likewise.
+ * tree-ssa-sccvn.c: Likewise.
+ * tree-ssa-structalias.c: Likewise.
+ * tree-tailcall.c: Likewise.
+ * tree-vrp.c: Likewise.
+ * tree.c: Likewise.
+ * var-tracking.c: Likewise.
+ * varasm.c: Likewise.
+
+2010-07-15 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR target/44877
+ * config/spu/spu.c (spu_expand_builtin_1): Allow references
+ (as well as pointers) as argument to mask_for_load builtins.
+
+2010-07-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44946
+ * tree-ssa-structalias.c (get_constraint_for_component_ref): Deal
+ with accessing only padding properly.
+
+2010-07-15 Jan Hubicka <jh@suse.cz>
+
+ * ipa.c (function_and_variable_visibility): Variables marked as used
+ should not be localized.
+
+2010-07-15 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c: Include lto-streamer.h
+ (change_decl_assembler_name): Work when assembler name hash is at place.
+ (cgraph_make_decl_local): When localizing COMDAT symbol at WPA stage,
+ be sure to rename it to avoid name clash.
+ * ipa.c (cgraph_externally_visible_p, function_and_variable_visibility):
+ Localize hidden symbols only when locally defined.
+
+2010-07-15 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.h (SHIFT_COUNT_TRUNCATED): Expand comment.
+
+2010-07-15 Magnus Granberg <zorry@gentoo.org>
+ Kevin F. Quinn <kevquinn@gentoo.org>
+
+ * builtins.c (expand_builtin_init_trampoline): Warn for -Wtrampolines.
+ * common.opt: Add -Wtrampolines.
+ * doc/invoke.texi: Add -Wtrampolines.
+
+2010-07-15 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/cortex-a8.md (cortex_a8_load_store_2): Reserve
+ cortex_a8_issue_ls.
+
+2010-07-15 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * config/i386/cygwin.h (LIBGCJ_SONAME): Update.
+ * config/i386/mingw32.h (LIBGCJ_SONAME): Likewise.
+
+2010-07-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (reg_names): Remove prototype.
+ (call_used_regs): Likewise.
+
+2010-07-14 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * config/i386/cygming-crtend.c (__FRAME_END__): Replace attribute
+ "unused" with attribute "used".
+ (__JCR_END__): Likewise.
+ * config/i386/cygming-crtbegin.c (__EH_FRAME_BEGIN__): Add missing
+ "used" attribute.
+ (__JCR_LIST__): Replace attribute "unused" with attribute "used".
+
+2010-07-14 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-in.c (maybe_fixup_handled_component): Remove.
+ (maybe_fixup_decls): Likewise.
+ (input_gimple_stmt): Do not fixup anything.
+ * lto-streamer-out.c (output_gimple_stmt): Make sure all
+ non-automatic variable uses are wrapped inside a MEM_REF.
+
+2010-07-14 Richard Henderson <rth@redhat.com>
+
+ * passes.c (rest_of_decl_compilation): Do not call assemble_variable
+ for functions.
+ * varasm.c (assemble_variable): Remove early exit for functions;
+ assert that we're given a variable.
+
+2010-07-14 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/cortex-a8.md (cortex_a8_alu): Don't use
+ cortex_a8_default when neon_type is not none.
+
+2010-07-14 Bernd Schmidt <bernds@codesourcery.com>
+
+ * lower-subreg.c (subreg_context): New static bitmap.
+ (decompose_multiword_subregs): Allocate and free it.
+ (find_decomposable_subregs): Set a bit in it for a register that
+ occurs in a subreg that changes mode but not size.
+ (can_decompose_p): Test it instead of non_decomposable_context.
+
+2010-07-14 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44824
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Use
+ is_gimple_mem_ref_addr.
+ (tree_ssa_forward_propagate_single_use_vars): Do not propagate
+ non-decl_address_invariant_p addresses.
+
+2010-07-14 Bernd Schmidt <bernds@codesourcery.com>
+
+ * reload.c (find_reloads): Revert code to penalize small register
+ classes that was brought in with the IRA merge.
+
+2010-07-14 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (fold_const_aggregate_ref): Handle MEM_REF
+ as base of ARRAY_REFs.
+
+2010-07-14 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44930
+ * tree-pretty-print.c (do_niy): Do not print a newline.
+
+2010-07-14 Bernd Schmidt <bernds@codesourcery.com>
+
+ * ira-int.h (struct ira_object): New.
+ (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it.
+ (struct ira_allocno): Remove members min, max,
+ conflict_allocno_array, conflict_id, conflict_allocno_array_size,
+ conflict_allocnos_num and conflict_vec_p. Add new member object.
+ (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P,
+ OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE,
+ OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS,
+ OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from
+ ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P,
+ ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE,
+ ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS)
+ ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on
+ an ira_object_t rather than ira_allocno_t. All uses changed.
+ (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now
+ contains a vector of ira_object_t; all uses changed.
+ (ira_objects_num): Declare variable.
+ (ira_create_allocno_object): Declare function.
+ (ira_conflict_vector_profitable_p): Adjust prototype.
+ (ira_allocate_conflict_vec): Renamed from
+ ira_allocate_allocno_conflict_vec; first arg now ira_object_t.
+ (ira_allocate_object_conflicts): Renamed from
+ ira_allocate_allocno_conflicts; first arg now ira_object_t.
+ (struct ira_object_iterator): New.
+ (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New.
+ (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p
+ to conflict_vec_p. All uses changed.
+ (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond):
+ Changed to take into account that conflicts are now tracked for
+ objects.
+ * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P.
+ Args changed to accept ira_object_t. All uses changed.
+ (allocnos_conflict_p): New static function.
+ (collected_conflict_objects): Renamed from collected_allocno_objects;
+ now a vector of ira_object_t. All uses changed.
+ (build_conflict_bit_table): Changed to take into account that
+ conflicts are now tracked for objects.
+ (process_regs_for_copy, propagate_copies, build_allocno_conflicts)
+ (print_allocno_conflicts, ira_build_conflicts): Likewise.
+ * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num)
+ setup_allocno_left_conflicts_size, allocno_reload_assign,
+ fast_allocation): Likewise.
+ * ira-lives.c (make_hard_regno_born, make_allocno_born)
+ process_single_reg_class_operands, process_bb_node_lives): Likewise.
+ * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list):
+ Likewise.
+ * ira-build.c (ira_objects_num): New variable.
+ (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now
+ contains a vector of ira_object_t; all uses changed.
+ (ira_object_id_map_vec): Corresponding change.
+ (object_pool): New static variable.
+ (initiate_allocnos): Initialize it.
+ (finish_allocnos): Free it.
+ (ira_create_object, ira_create_allocno_object, create_allocno_objects):
+ New functions.
+ (ira_create_allocno): Don't set members that were removed.
+ (ira_set_allocno_cover_class): Don't change conflict hard regs.
+ (merge_hard_reg_conflicts): Changed to take into account that
+ conflicts are now tracked for objects.
+ (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec,
+ allocate_conflict_bit_vec, ira_allocate_object_conflicts,
+ compress_conflict_vecs, remove_low_level_allocnos, ira_flattening,
+ setup_min_max_allocno_live_range_point, allocno_range_compare_func,
+ setup_min_max_conflict_allocno_ids, ): Likewise.
+ (add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed
+ to ira_object_t; all callers changed.
+ (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed
+ to ira_object_t, all callers changed.
+ (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed
+ to ira_object_t, all callers changed.
+ (conflict_check, curr_conflict_check_tick): Renamed from
+ allocno_conflict_check and curr_allocno_conflict_check_tick; all uses
+ changed.
+ (compress_conflict_vec): Renamed from compress_allocno_conflict_vec,
+ arg changed to ira_object_t, all callers changed.
+ (create_cap_allocno): Call ira_create_allocno_object.
+ (finish_allocno): Free the corresponding object.
+ (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all
+ callers changed. Adjusted for dealing with objects.
+ (ira_build): Call create_allocno_objects after ira_costs. Adjusted for
+ dealing with objects.
+ * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects.
+
+ * ira-int.h (struct live_range): Rename allocno member to object
+ and change type to ira_object_t.
+ (struct ira_object): New member live_ranges.
+ (struct ira_allocno): Remove member live_ranges.
+ (ALLOCNO_LIVE_RANGES): Remove.
+ (OBJECT_LIVE_RANGES): New macro.
+ (ira_create_live_range, ira_copy_live_range_list,
+ ira_merge_live_range_list, ira_live_ranges_intersect_p,
+ ira_finish_live_range, ira_finish_live_range_list): Adjust declarations.
+ * ira-build.c (ira_create_object): Initialize live ranges here.
+ (ira_create_allocno): Not here.
+ (ira_create_live_range): Rename from ira_create_allocno_live_range, arg
+ changed to ira_object_t, all callers changed.
+ (copy_live_range): Rename from copy_allocno_live_range, all callers
+ changed.
+ (ira_copy_live_range_list): Rename from
+ ira_copy_allocno_live_range_list, all callers changed.
+ (ira_merge_live_ranges): Rename from ira_merge_allocno_live_range_list,
+ all callers changed.
+ (ira_live_ranges_intersect_p): Rename from
+ ira_allocno_live_ranges_intersect_p, all callers changed.
+ (ira_finish_live_range): Rename from ira_finish_allocno_live_range, all
+ callers changed.
+ (ira_finish_live_range_list): Rename from
+ ira_finish_allocno_live_range_list, all callers changed.
+ (change_object_in_range_list): Rename from change_allocno_in_range_list,
+ last arg changed to ira_object_t, all callers changed.
+ (finish_allocno): Changed to expect live ranges in the allocno's object.
+ (move_allocno_live_ranges, copy_allocno_live_ranges,
+ update_bad_spill_attribute, setup_min_max_allocno_live_range_point,
+ ira_flattening, ira_build): Likewise.
+ * ira-color.c (allocnos_have_intersected_live_ranges_p,
+ slot_coalesced_allocno_live_ranges_intersect,
+ setup_slot_coalesced_allocno_live_ranges, fast_allocation): Likewise.
+ * ira-conflicts.c (build_conflict_bit_table): Likewise.
+ * ira-emit.c (add_range_and_copies_from_move_list): Likewise.
+ * ira-lives.c (make_allocno_born, update_allocno_pressure_excess_length,
+ make_allocno_dead, create_start_finish_chains,
+ remove_some_program_points_and_update_live_ranges,
+ ira_debug_live_range_list): Likewise.
+
+ * ira-int.h (ira_object_conflict_iterator): Rename from
+ ira_allocno_conflict_iterator.
+ (ira_object_conflict_iter_init): Rename from
+ ira_allocno_conflict_iter_init, second arg changed to
+ * ira.c (check_allocation): Use FOR_EACH_OBJECT_CONFLICT rather than
+ FOR_EACH_ALLOCNO_CONFLICT.
+ * ira-color.c (assign_hard_reg, push_allocno_to_stack)
+ setup_allocno_left_conflicts_size, coalesced_allocno_conflict_p,
+ ira_reassign_conflict_allocnos, ira_reassign_pseudos): Likewise.
+ * ira-conflicts.c (print_allocno_conflicts): Likewise.
+
+2010-07-13 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR other/44874
+ * tree-dump.c (dump_options): Add enumerate_locals entry.
+ Add TDF_NOID exclusion to all entry.
+ * tree-dump.h (dump_enumerated_decls): Declare.
+ * tree-pretty-print.c (dump_generic_node): For TDF_NOID,
+ Don't display type uid.
+ (print_declaration): Don't crash on TREE_TYPE (t) == 0.
+ * tree-pass.h (TDF_ENUMERATE_LOCALS): Define.
+ * tree-ssa-live.c: Include gimple.h.
+ (numbered_tree_d): New struct.
+ (numbered_tree): New typedef.
+ (DEF_VEC_O (numbered_tree): New.
+ (DEF_VEC_ALLOC_O (numbered_tree, heap)): Likewise.
+ (compare_decls_by_uid, dump_enumerated_decls_push): New functions.
+ (dump_enumerated_decls): Likewise.
+ * tree-optimize.c (execute_cleanup_cfg_post_optimizing): If comparing
+ debug info and flag_dump_final_insns, call dump_enumerated_decls.
+ * tree-cfg.c (dump_function_to_file): Call dump_enumerated_decls.
+ * Makefile.in (tree-ssa-live.o): Depend on $(GIMPLE_H).
+
+2010-07-13 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expmed.h (MAX_BITS_PER_WORD): Move to...
+ * defaults.h (MAX_BITS_PER_WORD): ...here.
+
+2010-07-13 DJ Delorie <dj@redhat.com>
+
+ * config/h8300/h8300.c (h8300_init_once): Default to
+ -fstrict_volatile_bitfields.
+
+ * config/sh/sh.c (sh_override_options): Default to
+ -fstrict_volatile_bitfields.
+
+ * config/rx/rx.c (rx_option_override): New.
+
+ * config/m32c/m32c.c (m32c_override_options): Default to
+ -fstrict_volatile_bitfields.
+
+2010-07-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * tree.h (build_function_call_expr): Delete.
+ (build_call_expr_loc_array): New function.
+ (build_call_expr_loc_vec): New function.
+ * tree-flow.h (struct omp_region): Change type of ws_args field
+ to a VEC.
+ * builtins.c (build_function_call_expr): Delete.
+ (build_call_expr_loc_array): New function.
+ (build_call_expr_loc): Call it. Use XALLOCAVEC.
+ (build_call_expr): Likewise.
+ (build_call_expr_loc_vec): New function.
+ * cgraphunit.c (build_cdtor): Call build_call_expr instead of
+ build_function_call_expr.
+ * expr.c (emutls_var_address): Likewise.
+ * varasm.c (emutls_common_1): Likewise.
+ * omp-low.c (expand_omp_atomic_mutex): Likewise.
+ (expand_omp_taskreg): Adjust for new type of region->ws_args.
+ (get_ws_args_for): Return a VEC instead of a tree.
+ (expand_parallel_call): Call build_call_expr_loc_vec instead of
+ build_function_call_expr.
+ * stor-layout.c (self_referential_size): Likewise.
+
+2010-07-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR testsuite/44701
+ * recog.c (constrain_operands): Allow side-effects in memory
+ operands if either < or > constraint is used, rather than if
+ both < and > is used.
+
+2010-07-13 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44911
+ * tree-pretty-print.c (dump_generic_node): Use TDF_SLIM for
+ MEM_REF pointer type dumping. Avoid recursing for TYPE_DECLs
+ without name.
+
+2010-07-13 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/44761
+ * mode-switching.c (optimize_mode_switching): Add ATTRIBUTE_UNUSED
+ to variable emited.
+ * config/sh/sh.c (sh_expand_epilogue): Remove unused variable.
+ * config/sh/sh.md (symGOT_load): Likewise.
+ (symDTPOFF2reg): Likewise.
+ (symTPOFF2reg): Likewise.
+
+2010-07-13 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * expmed.c (MAX_BITS_PER_WORD): Moved to expmed.h.
+ * expmed.h (MAX_BITS_PER_WORD): Moved from expmed.c.
+
+2010-07-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/i386/sol2-unwind.h (x86_64_fallback_frame_state): Correct
+ explanation.
+ Find ucontext_t * on Solaris 11.
+ (x86_fallback_frame_state): Handle Solaris 9 multi-threaded pattern.
+ Handle new Solaris 11 __sighndlr patterns.
+
+2010-07-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/44901
+ * vec.h (VEC_block_remove): Fix comment.
+ * tree-ssa-live.c (remove_unused_locals): Don't use
+ VEC_unordered_remove on local_decls, instead replace a single
+ vector element in each iteration if at least one element had
+ to be removed and VEC_truncate at the end.
+ * omp-low.c (expand_omp_taskreg): Likewise.
+
+2010-07-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * c-decl.c (finish_function): Fix typo in comment.
+
+2010-07-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/44921
+ * postreload.c (move2add_use_add3_insn): Silence gcc warning
+ on min_regno.
+
+2010-07-12 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-vrp.c (simplify_bit_ops_using_ranges): New function.
+ (simplify_stmt_using_ranges): Use it.
+
+2010-07-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.h (struct spu_builtin_description): Remove FNDECL
+ member. Do not mark as GTY(()).
+ * config/spu/spu.c (spu_builtins): Remove FNDECL initializer elements.
+ (spu_builtin_decls): New static variable.
+ (spu_builtin_decl): Use it instead of spu_builtins[].fndecl.
+ (spu_init_builtins): Likewise.
+ (spu_builtin_mul_widen_even): Likewise.
+ (spu_builtin_mul_widen_odd): Likewise.
+ (spu_builtin_mask_for_load): Likewise.
+ (spu_builtin_vec_perm): Likewise.
+ * config/spu/spu-c.c: Include "target.h".
+ (spu_resolve_overloaded_builtin): Call targetm.builtin_decl instead
+ of using spu_builtins[].fndecl.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.c (mips_override_options): Make -mflip-mips16
+ imply -minterlink-mips16.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.h (mips16_globals): Declare.
+ (SWITCHABLE_TARGET): Define.
+ * config/mips/mips.c: Include target-globals.h.
+ (mips16_globals): New variable.
+ (mips_set_mips16_mode): Use save_target_globals and
+ restore_target_globals instead of target_reinit.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * reginfo.c (init_reg_sets): Don't zero globals here. Update comment
+ to say that the function can be called more than once.
+ * target-globals.c (save_target_globals): Call init_reg_sets.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (bb-reorder.o, target-globals.o): Depend on bb-reorder.h
+ * bb-reorder.h: New file.
+ * bb-reorder.c (default_target_bb_reorder): New variable.
+ (this_target_bb_reorder): New conditional variable.
+ (uncond_jump_length): Redefine as a macro.
+ * target-globals.h (this_target_bb_reorder): Declare.
+ (target_globals): Add a bb_reorder field.
+ (restore_target_globals): Copy the bb_reorder field to
+ this_target_bb-reorder.
+ * target-globals.c: Include bb-reorder.h.
+ (default_target_globals): Initialize the bb_reorder field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (gcse.o, target-globals.o): Depend on gcse.h..
+ * gcse.h: New file.
+ * gcse.c: Include gcse.h.
+ (default_target_gcse): New variable.
+ (this_target_gcse): New conditional variable.
+ (can_copy): Redefine as a macro.
+ (can_copy_init_p): New macro.
+ (can_copy_p): Remove can_copy_init_p.
+ * target-globals.h (this_target_gcse): Declare.
+ (target_globals): Add a gcse field.
+ (restore_target_globals): Copy the gcse field to this_target_gcse.
+ * target-globals.c: Include gcse.h.
+ (default_target_globals): Initialize the gcse field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * ira-int.h (target_ira_int): Add x_ira_prohibited_mode_move_regs
+ and x_ira_prohibited_mode_move_regs_initialized_p.
+ (ira_prohibited_mode_move_regs): Redefine as a macro.
+ * ira.c (ira_prohibited_mode_move_regs): Delete.
+ (ira_prohibited_mode_move_regs_initialized_p): Redefine as a macro.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * reload.h (target_reload): Add x_cached_reg_save_code and
+ x_cached_reg_restore_code.
+ * caller-save.c (cached_reg_save_code, cached_reg_restore_code):
+ Redefine as macros.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on builtins.h.
+ * builtins.h: New file.
+ * builtins.c: Include builtins.h.
+ (default_target_builtins): New variable.
+ (this_target_builtins): New conditional variable.
+ (apply_args_mode, apply_result_mode): Redefine as macros.
+ * target-globals.h (this_target_builtins): Declare.
+ (target_globals): Add a builtins field.
+ (restore_target_globals): Copy the builtins field to
+ this_target_builtins.
+ * target-globals.c: Include builtins.h.
+ (default_target_globals): Initialize the builtins field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * expmed.h (alg_code, mult_cost, MULT_COST_LESS, CHEAPER_MULT_COST)
+ (algorithm, alg_hash_entry, NUM_ALG_HASH_ENTRIES, alg_hash): Moved
+ from expmed.c.
+ (target_expmed): Add x_alg_hash and x_alg_hash_used_p.
+ (alg_hash, alg_hash_used_p): New macros.
+ * expmed.c (init_expmed): Clear alg_hash if reinitializing.
+ (alg_code, mult_cost, MULT_COST_LESS, CHEAPER_MULT_COST, algorithm)
+ (alg_hash_entry, NUM_ALG_HASH_ENTRIES, alg_hash): Moved to expmed.h.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * ira-int.h (target_ira_int): Add x_max_struct_costs_size, x_init_cost,
+ x_temp_costs, x_op_costs, x_this_op_costs and x_cost_classes.
+ * ira-costs.c (max_struct_costs_size, init_cost, temp_costs, op_costs)
+ (this_op_costs, costs_classes): Redefine as macros.
+ (record_reg_classes): Don't take op_costs as a parameter.
+ (record_operand_costs): Likewise. Update calls to record_reg_classes.
+ (scan_one_insn): Update call to record_operand_costs.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H).
+ * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete.
+ (target_ira_int): New structure.
+ (default_target_ira_int): Declare.
+ (this_target_ira_int): Declare as a variable or define as a macro.
+ (ira_reg_mode_hard_regset, ira_register_move_cost)
+ (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p)
+ (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index)
+ (prohibited_class_mode_regs, ira_important_classes_num)
+ (ira_important_classes, ira_reg_class_intersect)
+ (ira_reg_classes_intersect_p, ira_reg_class_super_classes)
+ (ira_reg_class_union): Redefine as macros.
+ * ira.h (target_ira): New structure.
+ (default_target_ira): Declare.
+ (this_target_ira): Declare as a variable or define as a macro.
+ (ira_available_class_regs, ira_hard_regno_cover_class)
+ (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate)
+ (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs)
+ (ira_class_hard_regs_num): Redefine as macros.
+ * ira.c (default_target_ira, default_target_ira_int): New variables.
+ (this_target_ira, this_target_ira_int): New conditional variables.
+ (ira_reg_mode_hard_regset, ira_memory_move_cost)
+ (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost)
+ (ira_class_subset_p): Delete.
+ (no_unit_alloc_regs): Redefine as a macro.
+ (ira_class_hard_regs, ira_non_ordered_class_hard_regs)
+ (ira_class_hard_regs_num, ira_class_hard_reg_index)
+ (ira_available_class_regs): Delete.
+ (alloc_reg_class_subclasses): Redefine as a macro.
+ (ira_reg_class_cover_size, ira_reg_class_cover)
+ (ira_important_classes_num, ira_important_classes)
+ (ira_important_class_nums, ira_class_translate): Delete.
+ (cover_class_order): Document the variable's lifetime.
+ (reorder_important_classes): Don't set ira_important_class_nums.
+ (ira_reg_class_intersect, ira_reg_classes_intersect_p)
+ (ira_reg_class_super_classes, ira_reg_class_union)
+ (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs):
+ Delete.
+ (setup_reg_class_nregs): Don't set ira_max_regs.
+ (prohibited_class_mode_regs): Delete.
+ * target-globals.h (this_target_ira, this_target_ira_int): Declare.
+ (target_globals): Add ira and ira_int fields.
+ (restore_target_globals): Copy the ira field to this_target_ira
+ and the ira_int field to this_target_ira_int.
+ * target-globals.c: Include ira-int.h.
+ (default_target_globals): Initialize the ira and ira_int fields.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on $(CFGLOOP_H).
+ * cfgloop.h (target_cfgloop): New structure.
+ (default_target_cfgloop): Declare.
+ (this_target_cfgloop): Declare as a variable or define as a macro.
+ (target_avail_regs, target_clobbered_regs, target_res_regs)
+ (target_reg_cost, target_spill_cost): Redefine as macros.
+ * cfgloopanal.c (default_target_cfgloop): New variable.
+ (this_target_cfgloop): New conditional variable.
+ (target_avail_regs, target_clobbered_regs, target_res_regs)
+ (target_reg_cost, target_spill_cost): Delete.
+ * target-globals.h (this_target_cfgloop): Declare.
+ (target_globals): Add a cfgloop field.
+ (restore_target_globals): Copy the cfgloop field to
+ this_target_cfgloop.
+ * target-globals.c: Include cfgloop.h.
+ (default_target_globals): Initialize the cfgloop field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * regs.h (target_regs): Add x_direct_load, x_direct_store and
+ x_float_extend_from_mem.
+ (direct_load, direct_store, float_extend_from_mem): New macros.
+ * expr.c (direct_load, direct_store, float_extend_from_mem): Delete.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (LIBFUNCS_H): Add $(HASHTAB_H).
+ (target-globals.o): Depend on $(LIBFUNCS_H).
+ * libfuncs.h: Include hashtab.h.
+ (libfunc_entry): Moved from optabs.c.
+ (target_libfuncs): New structure.
+ (default_target_libfuncs): Declare.
+ (this_target_libfuncs): Declare as a variable or define as a macro.
+ (libfunc_table): Redefine as a macro.
+ * optabs.c (default_target_libfuncs): New variable.
+ (this_target_libfuncs): New conditional variable.
+ (libfunc_table): Delete.
+ (libfunc_entry): Moved to optabs.h.
+ (libfunc_hash): Redefine as a macro.
+ (hash_libfunc, eq_libfunc): Fix comments.
+ (init_optabs): Use libfunc_hash to detect cases where the function
+ has already been called. Clear the hash table instead of
+ recreating it.
+ * target-globals.h (this_target_libfuncs): Declare.
+ (target_globals): Add a libfuncs field.
+ (restore_target_globals): Copy the libfuncs field to
+ this_target_libfuncs.
+ * target-globals.c: Include libfuncs.h.
+ (default_target_globals): Initialize the libfuncs field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (LIBFUNCS_H): New variable. Use instead of libfuncs.h
+ in all dependency lists.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on $(EXPR_H) and $(OPTABS_H).
+ * optabs.h (target_optabs): New structure.
+ (default_target_optabs): Declare.
+ (this_target_optabs): Declare as a variable or define as a macro.
+ (optab_table, convert_optab_table, direct_optab_table): Redefine
+ as macros.
+ * optabs.c (default_target_optabs): New variable.
+ (this_target_optabs): New conditional variable.
+ (optab_table, convert_optab_table, direct_optab_table): Delete.
+ * target-globals.h (this_target_optabs): Declare.
+ (target_globals): Add a optabs field.
+ (restore_target_globals): Copy the optabs field to
+ this_target_optabs.
+ * target-globals.c: Include expr.h and optabs.h.
+ (default_target_globals): Initialize the optabs field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * flags.h (target_flagstate): Add x_flag_excess_precision.
+ (flag_excess_precision): Redefine as a macro.
+ * toplev.c (flag_excess_precision): Delete.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * defaults.h (MAX_MOVE_MAX, MIN_UNITS_PER_WORD): Define if not defined.
+ * libgcc2.c (MIN_UNITS_PER_WORD): Delete.
+ * hard-reg-set.h (target_hard_regs): Add x_no_caller_save_reg_set.
+ (no_caller_save_reg_set): Redefine as a macro.
+ * reload.h (target_reload): Add x_caller_save_initialized_p and
+ x_regno_save_mode.
+ (caller_save_initialized_p): Redefine as a macro.
+ * caller-save.c (caller_save_initialized_p, no_caller_save_reg_set)
+ (MAX_MOVE_MAX, MIN_UNITS_PER_WORD): Delete.
+ (regno_save_mode): Redefine as a macro.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (expmed.o, target-globals.o): Depend on expmed.h.
+ * expmed.h: New file.
+ * expmed.c (default_target_costs): New variable.
+ (this_target_costs): New conditional variable.
+ (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, neg_cost)
+ (shift_cost, shiftadd_cost, shiftsub0_cost, shiftsub1_cost, mul_cost)
+ (sdiv_cost, udiv_cost, mul_widen_cost, mul_highpart_cost): Delete.
+ * target-globals.h (this_target_expmed): Declare.
+ (target_globals): Add a expmed field.
+ (restore_target_globals): Copy the expmed field to
+ this_target_expmed.
+ * target-globals.c: Include expmed.h.
+ (default_target_globals): Initialize the expmed field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on reload.h.
+ * reload.h (target_reload): New structure.
+ (default_target_reload): Declare.
+ (this_target_reload): Declare as a variable or define as a macro.
+ (indirect_symref_ok, double_reg_address_ok): Redefine as macros.
+ * reload1.c (default_target_reload): New variable
+ (this_target_reload): New conditional variable.
+ (indirect_symref_ok, double_reg_address_ok): Delete.
+ (spill_indirect_levels): Redefine as a macro.
+ * target-globals.h (this_target_reload): Declare.
+ (target_globals): Add a reload field.
+ (restore_target_globals): Copy the reload field to
+ this_target_reload.
+ * target-globals.c: Include hard-reg-set.h.
+ (default_target_globals): Initialize the reload field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtl.h (target_rtl): Add x_static_reg_base_value.
+ * alias.c (static_reg_base_value): Redefine as a macro.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (reginfo.o): Don't depend on $(GGC_H) or gt-reginfo.h.
+ (GTFILES): Remove reginfo.c.
+ * rtl.h (target_rtl): Add x_top_of_stack.
+ (top_of_stack): New macro.
+ * reginfo.c: Don't include ggc.h or gt-reginfo.h.
+ (top_of_stack): Delete.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * regs.h (target_regs): Add x_hard_regs_of_mode,
+ x_contains_reg_of_mode, x_move_cost, x_may_move_in_cost,
+ x_may_move_out_cost and x_last_mode_for_init_move_cost.
+ (have_regs_of_mode, contains_reg_of_mode, move_cost)
+ (may_move_in_cost, may_move_out_cost): Redefine as macros.
+ * reginfo.c (have_regs_of_mode, contains_reg_of_mode, move_cost)
+ (may_move_in_cost, may_move_out_cost): Delete.
+ (last_mode_for_init_move_cost): Redefine as a macro.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * hard-reg-set.h (target_hard_regs): New structure.
+ (default_target_hard_regs): Declare.
+ (this_target_hard_regs): Declare as a variable or define as a macro.
+ (fixed_regs, fixed_reg_set, call_used_regs, call_really_used_regs)
+ (call_used_reg_set, call_fixed_reg_set, regs_invalidated_by_call)
+ (reg_alloc_order, inv_reg_alloc_order, reg_class_contents)
+ (reg_class_size, reg_class_subclasses, reg_class_subunion)
+ (reg_class_superunion, reg_names): Redefine as macros.
+ * reginfo.c (fixed_regs, fixed_reg_set, call_used_regs)
+ (call_used_reg_set, call_really_used_regs, call_fixed_reg_set)
+ (regs_invalidated_by_call, reg_alloc_order, inv_reg_alloc_order)
+ (reg_class_contents, reg_class_size, reg_class_subclasses)
+ (reg_class_subunion, reg_class_superunion, reg_names): Delete.
+ (default_target_hard_regs): New variable
+ (this_target_hard_regs, initial_call_really_used_regs)
+ (initial_reg_alloc_order): New conditional variables.
+ (initial_reg_names): New variable.
+ (init_reg_sets): Assert that initial_call_really_used_regs,
+ initial_reg_alloc_order and initial_reg_names
+ are all the same size as their variable counterparts. Use them to
+ initialize those counterparts.
+ * target-globals.h (this_target_hard_regs): Declare.
+ (target_globals): Add a hard_regs field.
+ (restore_target_globals): Copy the hard_regs field to
+ this_target_hard_regs.
+ * target-globals.c: Include hard-reg-set.h.
+ (default_target_globals): Initialize the hard_regs field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on $(RTL_H).
+ * rtl.h (target_rtl): New structure.
+ (default_target_rtl): Declare.
+ (this_target_rtl): Declare as a variable or define as a macro.
+ (global_rtl, pic_offset_table_rtx, return_address_pointer_rtx):
+ Redefine as macros.
+ * emit-rtl.c (default_target_rtl): New variable.
+ (this_target_rtl): New conditional variable.
+ (global_rtl, static_regno_reg_rtx, pic_offset_table_rtx)
+ (return_address_pointer_rtx): Delete.
+ (initial_regno_reg_rtx): New macro.
+ (init_emit): Use initial_regno_reg_rtx instead of static_regno_reg_rtx.
+ (init_emit_regs): Likewise.
+ * target-globals.h (this_target_rtl): Declare.
+ (target_globals): Add a rtl field.
+ (restore_target_globals): Copy the rtl field to this_target_rtl.
+ * target-globals.c: Include rtl.h.
+ (default_target_globals): Initialize the rtl field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.in (target-globals.o): Depend on $(REGS_H).
+ * regs.h (target_reg_modes): New structure.
+ (default_target_reg_modes): Declare.
+ (this_target_reg_modes): Declare as a variable or define as a macro.
+ (hard_regno_nregs, reg_raw_mode): Redefine as macros.
+ * reginfo.c (default_target_reg_modes): New variable.
+ (this_target_reg_modes): New conditional variable.
+ (hard_regno_nregs, reg_raw_mode): Delete.
+ * target-globals.h (this_target_regs): Declare.
+ (target_globals): Add a regs field.
+ (restore_target_globals): Copy the regs field to this_target_regs.
+ * target-globals.c: Include regs.h.
+ (default_target_globals): Initialize the regs field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * doc/tm.texi.in (SWITCHABLE_TARGET): Document.
+ * doc/tm.texi: Regenerate.
+ * Makefile.in (OBJS-common): Add target-globals.o.
+ (gtype-desc.o): Depend on $(IPA_PROP_H), $(LTO_STREAMER_H)
+ and target-globals.h.
+ (target-globals.o): New rule.
+ (GTFILES): Include $(srcdir)/target-globals.h.
+ * defaults.h (SWITCHABLE_TARGET): Define.
+ * gengtype.c (open_base_files): Add target-globals.h to the
+ list of includes.
+ * target-globals.h: New file.
+ * target-globals.c: Likewise.
+
+ * Makefile.in (target-globals.o): Depend on $(FLAGS_H).
+ * flags.h (target_flag_state): New structure.
+ (default_target_flag_state): Declare.
+ (this_target_flag_state): Declare as a variable or define as a macro.
+ (align_loops_log): Redefine as a macro.
+ (align_loops_max_skip, align_jumps_log): Likewise.
+ (align_jumps_max_skip, align_labels_log): Likewise.
+ (align_labels_max_skip, align_functions_log): Likewise.
+ * toplev.c (default_target_flag_state): New variable.
+ (this_target_flag_state): New conditional variable.
+ (align_loops_log): Delete.
+ (align_loops_max_skip, align_jumps_log): Likewise.
+ (align_jumps_max_skip, align_labels_log): Likewise.
+ (align_labels_max_skip, align_functions_log): Likewise.
+ * target-globals.h (this_target_flag_state): Declare.
+ (target_globals): Add a flag_state field.
+ (restore_target_globals): Copy the flag_state field to
+ this_target_flag_state.
+ * target-globals.c: Include flags.h.
+ (default_target_globals): Initialize the flag_state field.
+ (save_target_globals): Likewise.
+
+2010-07-12 Jie Zhang <jie@codesourcery.com>
+
+ * postreload.c (reg_symbol_ref[]): New.
+ (move2add_use_add2_insn): New.
+ (move2add_use_add3_insn): New.
+ (reload_cse_move2add): Handle SYMBOL + OFFSET case.
+ (move2add_note_store): Likewise.
+
+2010-07-12 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR rtl-optimization/44752
+ * genautomata.c (main): Don't emit an empty file even if there
+ is no automaton.
+
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/i386/i386.c (ix86_sol10_return_in_memory): Rename to
+ ix86_solaris_return_in_memory.
+ * config/i386-protos.h: Reflect this.
+ * config/i386/vx-common.h (SUBTARGET_RETURN_IN_MEMORY): Likewise.
+ * config/i386/sol2-10.h (SUBTARGET_RETURN_IN_MEMORY): Likewise.
+ Move ...
+ * config/i386/sol2.h (SUBTARGET_RETURN_IN_MEMORY): ... here.
+
+2010-07-12 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/arm.c (arm_get_frame_offsets): Don't use r3 to
+ align the stack when it's going to be saved.
+
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR pch/14940
+ * config/host-solaris.c (mmap_fixed): New function.
+ (sol_gt_pch_get_address): Use it.
+ (sol_gt_pch_use_address): Likewise.
+
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config.gcc (i[34567]86-*-solaris2*): Default with_arch_32 to
+ pentiumpro on Solaris 8 and 9/x86.
+ * doc/install.texi (Specific, i?86-*-solaris2.[89]): Recommend GNU as.
+ Document SSE/SSE2 support.
+ * doc/sourcebuild.texi (Effective-Target Keywords): Document sse.
+
+2010-07-12 Andi Kleen <ak@linux.intel.com>
+
+ * lto-symtab.c (lto_symtab_merge_decls_1): Use fatal_error
+ instead of gcc_assert to print better error message for multiple
+ prevailing defs.
+
+2010-07-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_asm_output_function_label): Change format
+ string placeholder from 0x%x to %#x.
+ (ix86_code_end): Use putc to output '\n'.
+ (ix86_print_operand) <case ';'>: Use putc to output ';'.
+
+2010-07-11 Kai Tietz <kai.tietz@onevision.com>
+
+ * config/i386/winnt.c (i386_pe_file_end): Quote symbol name
+ in directive -export.
+
+2010-07-10 Anatoly Sokolov <aesok@post.ru>
+
+ * reginfo.h (reg_classes_intersect_p): Change arguments type to
+ reg_class_t.
+ * rtl.h (reg_classes_intersect_p): Adjust prototype.
+
+ * config/rs6000/rs6000.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST):
+ Remove macros.
+ * config/rs6000/rs6000-protos.h (rs6000_register_move_cost,
+ rs6000_memory_move_cost): Remove
+ * config/rs6000/rs6000.c (TARGET_REGISTER_MOVE_COST,
+ TARGET_MEMORY_MOVE_COST): Define.
+ (rs6000_register_move_cost): Make static. Change arguments type from
+ enum reg_class to reg_class_t. Adjust rs6000_memory_move_cost calls.
+ (rs6000_memory_move_cost): Make static. Change arguments type from
+ 'enum reg_class' to reg_class_t.
+
+2010-07-10 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR middle-end/42505
+ * tree-inline.c (estimate_num_insns): Refactor builtin complexity
+ lookup code into....
+ * builtins.c (is_simple_builtin, is_inexpensive_builtin): ...these
+ new functions.
+ * tree.h (is_simple_builtin, is_inexpensive_builtin): Declare.
+ * cfgloopanal.c (target_clobbered_regs): Define.
+ (init_set_costs): Initialize target_clobbered_regs.
+ (estimate_reg_pressure_cost): Add call_p argument. When true,
+ adjust the number of available registers to exclude the
+ call-clobbered registers.
+ * cfgloop.h (target_clobbered_regs): Declare.
+ (estimate_reg_pressure_cost): Adjust declaration.
+ * tree-ssa-loop-ivopts.c (struct ivopts_data): Add body_includes_call.
+ (ivopts_global_cost_for_size): Pass it to estimate_reg_pressure_cost.
+ (determine_set_costs): Dump target_clobbered_regs.
+ (loop_body_includes_call): New function.
+ (tree_ssa_iv_optimize_loop): Use it to initialize new field.
+ * loop-invariant.c (gain_for_invariant): Adjust arguments to pass
+ call_p flag through.
+ (best_gain_for_invariant): Likewise.
+ (find_invariants_to_move): Likewise.
+ (move_single_loop_invariants): Likewise, using already-computed
+ has_call field.
+
+2010-07-10 Richard Guenther <rguenther@suse.de>
+ Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR debug/44832
+ * tree-ssa-live.c (mark_all_vars_used_1): Set TREE_USED for LABEL_DECL.
+ (remove_unused_scope_block_p): Don't drop TREE_USED LABEL_DECLs
+ unless they have DECL_IGNORED_P set.
+
+2010-07-10 Richard Guenther <rguenther@suse.de>
+
+ PR lto/44889
+ * gimple.c (gimple_fixup_complete_and_incomplete_subtype_p): New
+ helper function.
+ (gimple_types_compatible_p): Similar to pointed-to
+ types allow and merge a mix of complete and incomplete aggregate.
+ Use gimple_fixup_complete_and_incomplete_subtype_p for that.
+ (iterative_hash_gimple_type): Adjust for that.
+
+2010-07-10 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * tree.h (DECL_REPLACEABLE_P): Strengthen check for weak symbols.
+
+2010-07-10 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR objc/44140
+ * config/darwin.c (output_objc_section_asm_op): Save and restore
+ section when outputting ObjC section list.
+
+2010-07-09 Jan Hubicka <jh@suse.cz>
+
+ * lto-streamer-out.c (produce_symtab): Do not write alias
+ cgraph/varpool nodes.
+
+2010-07-09 Jan Hubicka <jh@suse.cz>
+
+ * tree-inline.c (declare_return_variable): Fix ICE while
+ inlining DECL_BY_VALUE function not in SSA form
+
+2010-07-09 Changpeng Fang <changpeng.fang@amd.com>
+
+ PR tree-optimization/44576
+ * tree-ssa-loop-prefetch.c (trip_count_to_ahead_ratio_too_small_p):
+ New. Pull out from is_loop_prefetching_profitable to implement
+ the trip count to ahead ratio heuristic.
+ (mem_ref_count_reasonable_p): New. Pull out from
+ is_loop_prefetching_profitable to implement the instruction to
+ memory reference ratio heuristic. Also consider not reasonable if
+ the memory reference count is above a threshold (to avoid
+ explosive compilation time.
+ (insn_to_prefetch_ratio_too_small_p): New. Pull out from
+ is_loop_prefetching_profitable to implement the instruction to
+ prefetch ratio heuristic.
+ (is_loop_prefetching_profitable): Removed.
+ (loop_prefetch_arrays): Distribute the cost analysis across the
+ function to allow early exit of the prefetch analysis.
+ is_loop_prefetching_profitable is splitted into three functions,
+ with each one called as early as possible.
+ (PREFETCH_MAX_MEM_REFS_PER_LOOP): New. Threshold above which the
+ number of memory references in a loop is considered too many.
+
+2010-07-09 Bernd Schmidt <bernds@codesourcery.com>
+
+ * reload.c (find_reloads): Don't clear badop if we have a winreg
+ alternative, but not win, and the class only has fixed regs.
+ * hard-reg-set.h (class_only_fixed_regs): Declare.
+ * reginfo.c (class_only_fixed_regs): New array.
+ (init_reg_sets_1): Initialize it.
+ * config/arm/arm.md (arm_addsi3, thumb1_addsi3, arm_subsi3_insn): Don't
+ discourage alternatives using the stack pointer.
+
+ * config/arm/arm.md (addsi3_cbranch): Switch alternatives 0 and 1.
+
+ * config/arm/arm.md (Thumb-1 ldrsb peephole): New.
+
+ * config/arm/arm.md (cbranchqi4): Fix array size.
+ (addsi3_cbranch): Also andle alternative 2 like alternative 3 when
+ calculating length.
+
+2010-07-09 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (struct type_fixup_s): New struct and VEC type.
+ (gimple_register_type_fixups): New static global.
+ (gimple_queue_type_fixup): New function.
+ (gimple_types_compatible_p): Queue type fixups instead of
+ applying them here.
+ (gimple_register_type): Apply queued fixups for the
+ canonical type. Empty the type fixup queue.
+
+2010-07-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * configure.ac (gcc_cv_as_ix86_rep_lock_prefix): Fix test.
+ * configure: Regenerate.
+ * config.in: Ditto.
+
+2010-07-09 Jakub Jelinek <jakub@redhat.com>
+ Denys Vlasenko <dvlasenk@redhat.com>
+ Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ PR tree-optimization/28632
+ * tree-vrp.c (zero_nonzero_bits_from_vr): New function.
+ (extract_range_from_binary_expr): Further optimize
+ BIT_AND_EXPR and BIT_IOR_EXPR.
+
+2010-07-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ * tree-if-conv.c (fold_or_predicates): New.
+ (add_to_predicate_list): Call it.
+
+2010-07-09 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44890
+ * tree-ssa-address.c (create_mem_ref_raw): Only build a MEM_REF
+ if base is a pointer.
+ * tree-cfg.c (verify_expr): Update MEM_REF checking.
+
+2010-07-08 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/44877
+ * config/rs6000/rs6000.c (rs6000_expand_builtin): Use
+ POINTER_TYPE_P instead of checking only for POINTER_TYPE for the
+ builtin mask for load/store builtins.
+
+2010-07-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * configure.ac (gcc_cv_as_ix86_rep_lock_prefix): Also check
+ for "lock addl".
+ * configure: Regenerate.
+ * config/i386/i386.c (ix86_print_operand) <case ';'>:
+ Remove TARGET_MACHO.
+
+2010-07-09 Peter Bergner <bergner@vnet.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Fix setting of
+ default ISA flags.
+ * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add -mvsx.
+
+2010-07-09 Tom de Vries <tjvries@xs4all.nl>
+
+ * tree.c (type_hash_if_marked_p): Removed non-ggc_marked_p clause.
+
+2010-07-09 Hariharan Sandanagobalane <hariharan@picochip.com>
+
+ * config/picochip/picochip.md (commsTestPort): Emit more
+ efficient sequence for tstport instruction.
+
+2010-07-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_veclib_handler): Make static.
+
+2010-07-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44852
+ * tree-ssa-alias.c: Include toplev.h for exact_log2.
+ (indirect_ref_may_alias_decl_p): Properly handle negative offsets
+ in MEM_REF.
+ (indirect_refs_may_alias_p): Likewise.
+ * Makefile.in (tree-ssa-alias.o): Add $(TOPLEV_H).
+
+2010-07-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44882
+ * tree-vect-stmts.c (vectorizable_store): Do not assert alias
+ sets do conflict.
+ (vectorizable_load): Likewise.
+
+2010-07-09 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/40657
+ * config/arm/arm.c (thumb1_extra_regs_pushed): New arg FOR_PROLOGUE.
+ All callers changed.
+ Handle the case when we're called for the epilogue.
+ (thumb_unexpanded_epilogue): Use it.
+ (thumb1_expand_epilogue): Likewise.
+
+2010-07-09 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-vrp.c (extract_range_from_binary_expr) <BIT_AND_EXPR>: If
+ both ranges are range_int_cst_p with non-negative minimum,
+ try harder to derive smaller range.
+
+2010-07-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * genrecog.c: Include diagnostic-core.h before toplev.h.
+ * genoutput.c: Likewise.
+ * genextract.c: Likewise.
+ * genautomata.c: Likewise.
+ * genemit.c: Likewise.
+ * genpeep.c: Likewise.
+ * genattrtab.c: Likewise.
+ * genconditions.c: Likewise.
+ * genpreds.c: Likewise.
+
+2010-07-08 Andi Kleen <ak@linux.intel.com>
+
+ * lto-section-in.c (lto_section_name): Add missing comma.
+
+2010-07-08 Anatoly Sokolov <aesok@post.ru>
+
+ * config/ia64/ia64.h (OVERRIDE_OPTIONS): Remove macros.
+ * config/ia64/ia64-protos.h (ia64_override_options): Remove.
+ * config/ia64/ia64.c (TARGET_OPTION_OVERRIDE): Define.
+ (ia64_override_options): Rename to...
+ (ia64_option_override): ... this one. Make static.
+
+2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/44843
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Do not rely on the
+ pointed-to type of the offset in a MEM_REF to compute the alignment.
+
+2010-07-08 Kai Tietz <kai.tietz@onevision.com>
+
+ * final.c (final_scan_insn): Replace
+ TARGET_UNWIND_INFO macro check by unwind_emit
+ hook NULL check.
+ * targhooks.c (default_unwind_emit): Removed.
+ * targhooks.h (default_unwind_emit): Likewise.
+ * target.def (unwind_emit): Set default value to NULL.
+
+ * config/i386/i386-protos.h (ix86_asm_output_function_label):
+ New prototype.
+ * config/i386/i386.c (ix86_function_ms_hook_prologue): Check
+ for NULL fntype argument and allow 64-bit targets.
+ (ix86_asm_output_function_label): New function.
+ (ix86_expand_prologue): Handle 64-bit ms hook prologue.
+ (ix86_handle_fndecl_attribute): Likewise.
+ * doc/extend.texi (ms_hook_prologue): Adjust documentation.
+ * doc/doc/tm.texi: Regenerated.
+ * doc/doc/doc/tm.texi.in (ASM_OUTPUT_FUNCTION_LABEL): New.
+ (ASM_DECLARE_FUNCTION_NAME): Adjust documentation.
+ * defaults.h (ASM_OUTPUT_FUNCTION_LABEL): New macro.
+ * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use
+ ASM_OUTPUT_FUNCTION_LABEL instead of ASM_OUTPUT_LABEL.
+ * config/elfos.h: Likewise.
+ * config/i386/cygming.h: Likewise.
+ * config/netbsd-aout.h: Likewise.
+ * config/openbsd.h: Likewise.
+ * config/i386/i386.h (ASM_OUTPUT_FUNCTION_LABEL): Override
+ by ix86_asm_output_function_label function call.
+ * varasm.c (assemble_start_function): Use
+ ASM_OUTPUT_FUNCTION_LABEL instead of ASM_OUTPUT_LABEL.
+
+2010-07-08 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_will_be_removed_from_program_if_no_direct_calls):
+ New function.
+ * cgraph.h (cgraph_will_be_removed_from_program_if_no_direct_calls):
+ Declare.
+ * ipa-cp.c (ipcp_estimate_growth): Use it.
+ * ipa-inline.c (cgraph_estimate_growth, cgraph_decide_inlining):
+ Likewise.
+
+2010-07-08 Jan Hubicka <jh@suse.cz>
+
+ * tree-inline.c (declare_return_variable): Allocate annotation for new
+ temporary.
+
+2010-07-08 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/44710
+ * tree-if-conv.c (parse_predicate): New.
+ (add_to_predicate_list): Call it, call maybe_fold_or_comparisons.
+ Make sure that the predicates are either SSA_NAMEs or gimple_condexpr.
+
+2010-07-08 Sebastian Pop <sebastian.pop@amd.com>
+
+ * common.opt (ftree-loop-if-convert): New flag.
+ * doc/invoke.texi (ftree-loop-if-convert): Documented.
+ * tree-if-conv.c (gate_tree_if_conversion): Enable if-conversion
+ when flag_tree_loop_if_convert is set.
+
+2010-07-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c: Use short syntax for function calls
+ through function pointers.
+ * config/i386/i386.md: Ditto.
+
+2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Fix formatting issues.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address): Fix
+ stmt check for POINTER_PLUS_EXPRs, fix the pointer assignment.
+
+2010-07-08 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (mem_loc_descriptor): Use DW_OP_const[48]u
+ instead of DW_OP_addr for DW_OP_GNU_push_tls_address operand.
+ (loc_list_from_tree): Likewise.
+ (output_loc_operands): Handle outputting DW_OP_const[48]u
+ with loc->dtprel set.
+ (resolve_addr_in_expr): Handle loc->dtprel like DW_OP_addr.
+
+2010-07-08 Jan Hubicka <jh@suse.cz>
+
+ * ipa.c: Include pointer-set.h
+ (cgraph_externally_visible_p): New attribute ALIASED;
+ when in LTO, hidden symbols are local unless they are aliased.
+ (function_and_variable_visibility): Compute aliased nodes;
+ handle LTO and hidden symbol on functions and vars.
+ * cgraph.c (cgraph_make_decl_local): Clear NAMED_SECTION
+ for COMDAT symbols; handle COMDAT_GROUPS also at vars.
+
+2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/i386/cygming.h (STACK_CHECK_STATIC_BUILTIN): Define to 1.
+ * config/i386/freebsd.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
+ * config/i386/linux.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
+ * config/i386/linux64.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
+ * config/i386/sol2.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
+ * config/i386/i386.c (ix86_gen_adjust_stack_and_probe): New variable.
+ (ix86_gen_probe_stack_range): Likewise.
+ (override_options): Set them.
+ (ix86_target_stack_probe): New function.
+ (ix86_compute_frame_layout): Force use of push instructions to
+ save registers if stack checking with probes is enabled.
+ (get_scratch_register_on_entry): New function.
+ (release_scratch_register_on_entry): Likewise.
+ (ix86_adjust_stack_and_probe): Likewise.
+ (output_adjust_stack_and_probe): Likewise.
+ (ix86_emit_probe_stack_range): Likewise.
+ (output_probe_stack_range): Likewise.
+ (ix86_expand_prologue): Emit stack checking code if static built-in
+ stack checking is enabled.
+ Test ix86_target_stack_probe instead of TARGET_STACK_PROBE.
+ * config/i386/i386-protos.h (ix86_target_stack_probe): Declare.
+ (output_adjust_stack_and_probe): Likewise.
+ (output_probe_stack_range): Likewise.
+ * config/i386/i386.md (UNSPECV_PROBE_STACK_RANGE): New constant.
+ (allocate_stack_worker_32): Test ix86_target_stack_probe instead of
+ TARGET_STACK_PROBE.
+ (allocate_stack_worker_64): Likewise.
+ (allocate_stack): Likewise.
+ (adjust_stack_and_probe): New insn.
+ (probe_stack_range): Likewise.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44831
+ * tree-ssa-phiprop.c (phiprop_insert_phi): Properly build
+ a MEM_REF preserving TBAA info of the original dereference.
+ Dereference the original pointer if the address is not invariant.
+ (propagate_with_phi): Fixup type checks wrt MEM_REFs. Require
+ at least one invariant address that we are going to dereference.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44861
+ * tree-vect-stmts.c (vectorizable_store): Preserve TBAA
+ information when building MEM_REFs.
+ (vectorizable_load): Likewise.
+ * tree-vect-data-refs.c (vect_setup_realignment): Likewise.
+
+2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/sol2-c.c: Do not include diagnostic-core.h.
+
+2010-07-08 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ PR bootstrap/44768
+ * cfgexpand.c (estimated_stack_frame_size): Make self-contained
+ with respect to current_function_decl. Pass decl of the function.
+ * tree-inline.h (estimated_stack_frame_size): Adjust prototype.
+ * ipa-inline.c (compute_inline_parameters): Pass decl to
+ estimated_stack_frame_size.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address):
+ New function.
+ (valueize_refs): Call it.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ PR rtl-optimization/44838
+ * tree-ssa-alias.c (indirect_refs_may_alias_p): When not in
+ SSA form do not use pointer equivalence.
+
+2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * dwarf2out.c (AT_linkage_name): Delete.
+ (add_linkage_attr): New function.
+ (add_linkage_name): Call it to emit the linkage attribute.
+ (dwarf2out_finish): Likewise.
+ (move_linkage_attr): Explicitly accept both attribute variants.
+
+2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * toplev.h: Do not include diagnostic-core.h.
+ Include diagnostic-core.h in every file that includes toplev.h.
+ * c-tree.h: Do not include toplev.h.
+ * pretty-print.h: Update comment.
+ * Makefile.in: Update dependencies.
+ * alias.c: Include diagnostic-core.h in every file that includes
+ toplev.h.
+ * attribs.c: Likewise.
+ * auto-inc-dec.c: Likewise.
+ * bb-reorder.c: Likewise.
+ * bt-load.c: Likewise.
+ * caller-save.c: Likewise.
+ * calls.c: Likewise.
+ * cfg.c: Likewise.
+ * cfganal.c: Likewise.
+ * cfgbuild.c: Likewise.
+ * cfgcleanup.c: Likewise.
+ * cfghooks.c: Likewise.
+ * cfgloop.c: Likewise.
+ * combine.c: Likewise.
+ * config/alpha/alpha.c: Likewise.
+ * config/arc/arc.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/arm/pe.c: Likewise.
+ * config/avr/avr.c: Likewise.
+ * config/bfin/bfin.c: Likewise.
+ * config/cris/cris.c: Likewise.
+ * config/crx/crx.c: Likewise.
+ * config/darwin-c.c: Likewise.
+ * config/darwin.c: Likewise.
+ * config/fr30/fr30.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/h8300/h8300.c: Likewise.
+ * config/host-darwin.c: Likewise.
+ * config/i386/i386.c: Likewise.
+ * config/i386/netware.c: Likewise.
+ * config/i386/nwld.c: Likewise.
+ * config/i386/winnt-cxx.c: Likewise.
+ * config/i386/winnt-stubs.c: Likewise.
+ * config/i386/winnt.c: Likewise.
+ * config/ia64/ia64-c.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/iq2000/iq2000.c: Likewise.
+ * config/lm32/lm32.c: Likewise.
+ * config/m32c/m32c-pragma.c: Likewise.
+ * config/m32c/m32c.c: Likewise.
+ * config/m32r/m32r.c: Likewise.
+ * config/m68hc11/m68hc11.c: Likewise.
+ * config/m68k/m68k.c: Likewise.
+ * config/mcore/mcore.c: Likewise.
+ * config/mep/mep-pragma.c: Likewise.
+ * config/mep/mep.c: Likewise.
+ * config/mmix/mmix.c: Likewise.
+ * config/mn10300/mn10300.c: Likewise.
+ * config/moxie/moxie.c: Likewise.
+ * config/pa/pa.c: Likewise.
+ * config/pdp11/pdp11.c: Likewise.
+ * config/picochip/picochip.c: Likewise.
+ * config/rs6000/rs6000-c.c: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/rx/rx.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/score/score.c: Likewise.
+ * config/score/score3.c: Likewise.
+ * config/score/score7.c: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sh/symbian-base.c: Likewise.
+ * config/sh/symbian-c.c: Likewise.
+ * config/sh/symbian-cxx.c: Likewise.
+ * config/sol2-c.c: Likewise.
+ * config/sol2.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/spu/spu.c: Likewise.
+ * config/stormy16/stormy16.c: Likewise.
+ * config/v850/v850-c.c: Likewise.
+ * config/v850/v850.c: Likewise.
+ * config/vax/vax.c: Likewise.
+ * config/vxworks.c: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+ * convert.c: Likewise.
+ * cse.c: Likewise.
+ * cselib.c: Likewise.
+ * dbgcnt.c: Likewise.
+ * dbxout.c: Likewise.
+ * ddg.c: Likewise.
+ * dominance.c: Likewise.
+ * emit-rtl.c: Likewise.
+ * explow.c: Likewise.
+ * expmed.c: Likewise.
+ * fixed-value.c: Likewise.
+ * fold-const.c: Likewise.
+ * fwprop.c: Likewise.
+ * gcse.c: Likewise.
+ * ggc-common.c: Likewise.
+ * ggc-page.c: Likewise.
+ * ggc-zone.c: Likewise.
+ * gimple-low.c: Likewise.
+ * gimplify.c: Likewise.
+ * graph.c: Likewise.
+ * haifa-sched.c: Likewise.
+ * ifcvt.c: Likewise.
+ * implicit-zee.c: Likewise.
+ * integrate.c: Likewise.
+ * ira-build.c: Likewise.
+ * ira-color.c: Likewise.
+ * ira-conflicts.c: Likewise.
+ * ira-costs.c: Likewise.
+ * ira-lives.c: Likewise.
+ * ira.c: Likewise.
+ * lists.c: Likewise.
+ * loop-doloop.c: Likewise.
+ * loop-iv.c: Likewise.
+ * lto-opts.c: Likewise.
+ * lto-symtab.c: Likewise.
+ * main.c: Likewise.
+ * modulo-sched.c: Likewise.
+ * optabs.c: Likewise.
+ * params.c: Likewise.
+ * plugin.c: Likewise.
+ * postreload-gcse.c: Likewise.
+ * postreload.c: Likewise.
+ * predict.c: Likewise.
+ * profile.c: Likewise.
+ * real.c: Likewise.
+ * regcprop.c: Likewise.
+ * reginfo.c: Likewise.
+ * regmove.c: Likewise.
+ * reorg.c: Likewise.
+ * resource.c: Likewise.
+ * rtl.c: Likewise.
+ * rtlanal.c: Likewise.
+ * sched-deps.c: Likewise.
+ * sched-ebb.c: Likewise.
+ * sched-rgn.c: Likewise.
+ * sdbout.c: Likewise.
+ * sel-sched-dump.c: Likewise.
+ * sel-sched-ir.c: Likewise.
+ * simplify-rtx.c: Likewise.
+ * stmt.c: Likewise.
+ * stor-layout.c: Likewise.
+ * store-motion.c: Likewise.
+ * targhooks.c: Likewise.
+ * tree-cfg.c: Likewise.
+ * tree-cfgcleanup.c: Likewise.
+ * tree-dump.c: Likewise.
+ * tree-eh.c: Likewise.
+ * tree-inline.c: Likewise.
+ * tree-nomudflap.c: Likewise.
+ * tree-object-size.c: Likewise.
+ * tree-optimize.c: Likewise.
+ * tree-outof-ssa.c: Likewise.
+ * tree-phinodes.c: Likewise.
+ * tree-profile.c: Likewise.
+ * tree-ssa-ccp.c: Likewise.
+ * tree-ssa-coalesce.c: Likewise.
+ * tree-ssa-live.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-ssa-loop-prefetch.c: Likewise.
+ * tree-ssa-loop.c: Likewise.
+ * tree-ssa-structalias.c: Likewise.
+ * tree-ssa-uninit.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * tree-vect-data-refs.c: Likewise.
+ * tree-vect-loop-manip.c: Likewise.
+ * tree-vect-loop.c: Likewise.
+ * tree-vect-patterns.c: Likewise.
+ * tree-vect-stmts.c: Likewise.
+ * tree-vrp.c: Likewise.
+ * varasm.c: Likewise.
+ * vec.c: Likewise.
+ * web.c: Likewise.
+ * xcoffout.c: Likewise.
+
+2010-07-07 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gengtype.c (write_field_root): New function.
+ (write_root): Use it.
+
+2010-07-07 Wei Guozhi <carrot@google.com>
+
+ * config/arm/thumb2.md (peephole2 to convert zero_extract/compare
+ of lowest bits to lshift/compare): Add a missing line.
+
+2010-07-07 Wei Guozhi <carrot@google.com>
+
+ * config/arm/thumb2.md (peephole2 to convert zero_extract/compare
+ of lowest bits to lshift/compare): New.
+
+2010-07-07 Tom Tromey <tromey@redhat.com>
+
+ * doc/tm.texi: Update.
+ * doc/tm.texi.in (SDB and DWARF) <TARGET_WANT_DEBUG_PUB_SECTIONS>:
+ Add @hook.
+ * target.def (want_debug_pub_sections): New hook.
+ * config/darwin.h (TARGET_WANT_DEBUG_PUB_SECTIONS): Define.
+ * dwarf2out.c (add_pubname_string): Check
+ targetm.want_debug_pub_sections.
+ (add_pubname): Likewise.
+ (add_pubtype): Likewise.
+
+2010-07-07 Jie Zhang <jie@codesourcery.com>
+
+ * genautomata.c (output_automata_list_min_issue_delay_code):
+ Correctly decompress min_issue_delay.
+
+2010-07-07 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR rtl-optimization/44404
+ * auto-inc-dec.c (find_inc): Avoid calling count_occurrences if
+ possible, use reg_overlap_mentioned_p instead.
+
+2010-07-07 Duncan Sands <baldrick@free.fr>
+
+ PR middle-end/41355
+ * tree.c (build_function_type_skip_args): Copy the original type using
+ build_distinct_type_copy rather than copy_node.
+
+2010-07-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/44850
+ * config/i386/i386.c (ix86_function_ms_hook_prologue): Revert
+ revision 161876.
+ (ix86_expand_prologue): Likewise.
+ (ix86_handle_fndecl_attribute): Likewise.
+ (ix86_asm_declare_function_name): Likewise.
+ * config/i386/i386.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
+ * config/i386/cygming.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
+ (SUBTARGET_ASM_DECLARE_FUNCTION_NAME): Likewise.
+ * config/i386/i386-protos.h (ix86_asm_declare_function_name): Likewise.
+ * doc/extend.texi: Likewise.
+
+2010-07-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/44844
+ * config/i386/i386.md (rdrand<mode>): Changed to expand to
+ retry if the carry flag isn't valid.
+ (rdrand<mode>_1): New.
+
+2010-07-07 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44790
+ * expr.c (expand_expr_real_1): Go the POINTER_PLUS_EXPR path
+ for expanding the constant offset for MEM_REFs.
+
+2010-07-07 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-propagate.h (valid_gimple_call_p): Remove.
+ * tree-ssa-propagate.c (valid_gimple_call_p): Make static. Fix.
+ * gimple.h (is_gimple_operand): Remove.
+ * gimple.c (is_gimple_operand): Likewise.
+ (walk_gimple_op): Fix wi->val_only setting for calls.
+ * tree-cfg.c (verify_gimple_call): Fix argument validation.
+ * tree-profile.c (tree_gen_ic_func_profiler): Do not create
+ invalid gimple calls.
+
+2010-07-06 Jan Hubicka <jh@suse.cz>
+
+ * lto-cgraph.c (output_cgraph): Add missing declaration.
+
+2010-07-06 Jan Hubicka <jh@suse.cz>
+
+ * lto-cgraph.c (output_cgraph): Output toplevel asms only into first
+ partition.
+
+2010-07-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/gimple.texi (GIMPLE_DEBUG): Document.
+ * doc/rtl.texi (Debug Information): New node.
+ (NOTE_INSN_VAR_LOCATION): Document.
+ (debug_insn): Likewise.
+ * doc/generic.texi (DEBUG_EXPR_DECL): Document.
+
+2010-07-07 Jan Hubicka <jh@suse.cz>
+
+ With parts by Richard Guenther.
+
+ PR middle-end/44813
+ * tree-ssa-uninit.c (ssa_undefined_value_p): Result decl is defined
+ for functions passed by reference.
+ * tree.c (needs_to_live_in_memory): RESULT_DECL don't need to live
+ in memory when passed by reference.
+ * tree-ssa-ccp.c (get_default_value): Only VAR_DECL is undefined at
+ beggining.
+ * ipa-split.c (split_function): Cleanup way return value is passed;
+ handle SSA DECL_BY_REFERENCE retvals.
+ * tree-ssa.c (verify_def): Verify that RESULT_DECL is read only when
+ DECL_BY_REFERENCE is set.
+ * tree-ssa-structalias.c (get_constraint_for_ssa_var, get_fi_for_callee,
+ find_what_p_points_to): Handle RESULT_DECL.
+ * tree-inline.c (declare_return_variable): Get new entry_block argument;
+ when passing by reference ensure that RESULT_DECL is gimple_val.
+ (remap_gimple_op_r): Remap RESULT_DECL ssa name.
+ (remap_gimple_stmt): Handle SSA DECL_BY_REFERENCE returns.
+
+2010-07-07 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR rtl-optimization/44787
+ * config/arm/arm.md (arith_shiftsi): Allow stack pointer in operand 2.
+ * config/arm/thumb2.md (thumb2_arith_shiftsi): Likewise.
+
+2010-07-06 Jan Hubicka <jh@suse.cz>
+
+ * lto-symtab.c (lto_cgraph_replace_node): Handle aliases.
+ (lto_symtab_resolve_can_prevail_p): Also alias of cgraph node
+ with body can prevail.
+ (lto_symtab_resolve_symbols): Use cgraph_get_node_or_alias.
+ (lto_symtab_merge_cgraph_nodes_1): Do not remove nodes from aliases.
+ * cgraph.c (cgraph_get_node_or_alias): New function.
+ * cgraph.h (cgraph_get_node_or_alias): Declare.
+
+2010-07-06 Kai Tietz <kai.tietz@onevision.com>
+
+ * config/i386/i386.c (ix86_function_ms_hook_prologue): Enable x64
+ support.
+ (ix86_expand_prologue): Likewise.
+ (ix86_handle_fndecl_attribute): Likewise.
+ (ix86_asm_declare_function_name): New function for
+ ASM_DECLARE_FUNCTION_NAME.
+ * config/i386/i386.h (ASM_DECLARE_FUNCTION_NAME): New macro.
+ * config/i386/cygming.h (ASM_DECLARE_FUNCTION_NAME): Removed.
+ (SUBTARGET_ASM_DECLARE_FUNCTION_NAME): New macro.
+ * config/i386/i386-protos.h (ix86_asm_declare_function_name): New.
+ * doc/extend.texi: Adjust documentation about ms_hook_prologue
+ attribute.
+
+2010-07-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (immediate_operand): New mode attribute.
+
+ (pro_epilogue_adjust_stack_<mode>_1): Macroize insn from
+ pro_epilogue_adjust_stack and pro_epilogue_adjust_stack_rex64
+ using P mode iterator.
+ (pro_epilogue_adjust_stack_di_2): Rename from
+ pro_epilogue_adjust_stack_rex64_2.
+
+ * config/i386/i386.c (pro_epilogue_adjust_stack): Update for rename.
+
+2010-07-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (insv): Call gen_movdi_insv1 or gen_movsi_insv1
+ through gen_mov_insv_1 function pointer.
+ (fmod<mode>3): Call gen_truncxf<mode>2_i387_noop_unspec or
+ gen_truncxf<mode>2 through gen_truncxf function pointer.
+ (remainder<mode>3): Ditto.
+ (cmpstrnsi): Rename cmp_insn function pointer to gen_cmp.
+ (allocate_stack): Call gen_allocate_stack_worker_64 or
+ gen_allocate_stack_worker_32 through gen_allocate_stack_worker
+ function pointer.
+ (probe_stack): Call gen_iordi3 or gen_iorsi3 through gen_ior3
+ function pointer.
+
+2010-07-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*add<mode>3_cconly_overflow): Use <g>
+ operand constraint instead of <r><i>m.
+
+2010-07-06 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44828
+ * convert.c (convert_to_integer): Watch out for overflowing
+ MULT_EXPR as well.
+
+2010-07-05 Jan Hubicka <jh@suse.cz>
+
+ * lto-streamer.c (write_symbol_vec): Rename to ...
+ (write_symbol) ... this one; write only symbol given and when
+ present in cache. Sanity check that what is defined is present
+ in cgraph/varpool with body/finalized decl.
+ (write_symbols_of_kind): Remove.
+ (produce_symtab): Take outputblock and sets; use cgraph/varpool/alias
+ pairs to produce symtab.
+ (produce_asm_for_decls): Update call of produce_symtab; don't do so
+ when doing WPA streaming.
+
+2010-07-05 Jan Hubicka <jh@suse.cz>
+
+ * gimple-fold.c (gimple_fold_obj_type_ref_known_binfo): Check that
+ function is still available to fold into.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro.
+ * function.h (struct_function): Change type of local_decls field
+ to a VEC.
+ (add_local_decl): New function.
+ (FOR_EACH_LOCAL_DECL): New macro.
+ * cfgexpand.c (init_vars_expansion): Adjust for new type of
+ cfun->local_decls.
+ (estimated_stack_frame_size): Likewise.
+ (expand_used_vars): Likewise.
+ * cgraphbuild.c (build_cgraph_edges): Likewise.
+ * function.c (instantiate_decls_1): Likewise.
+ * ipa-struct-reorg.c (build_data_structure): Likewise.
+ * ipa-type-escape.c (analyze_function): Likewise.
+ * lto-streamer-in.c (input_function): Likewise.
+ * lto-streamer-out.c (output_function): Likewise.
+ * tree-ssa-live.c (remove_unused_locals): Likewise.
+ * tree.c (free_lang_data_in_decl): Likewise.
+ (find_decls_types_in_node): Likewise.
+ * omp-low.c (remove_exit_barrier): Likewise.
+ (expand_omp_taskreg): Likewise.
+ (list2chain): Rename to...
+ (vec2chain): ...this. Adjust.
+ * cgraphunit.c (assemble_thunk): Call add_local_decl.
+ * tree-cfg.c (replace_by_duplicate_decl): Likewise.
+ * gimple-low.c (record_vars_into): Likewise.
+ * tree-inline.c (remap_decls): Likewise.
+ (declare_return_variable): Likewise.
+ (declare_inline_vars): Likewise.
+ (copy_forbidden): Adjust for new type of cfun->local_decls.
+ (add_local_variables): New function.
+ (expand_call_inline): Call it.
+ (tree_function_versioning): Likewise.
+
+2010-07-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ AVX Programming Reference (June, 2010)
+ * config/i386/cpuid.h (bit_F16C): New.
+ (bit_RDRND): Likewise.
+ (bit_FSGSBASE): Likewise.
+
+ * config/i386/i386-builtin-types.def: Add
+ "DEF_FUNCTION_TYPE (UINT16)", function types for
+ float16 <-> float conversions and
+ "DEF_FUNCTION_TYPE (VOID, UINT64)".
+
+ * config/i386/i386-c.c (ix86_target_macros_internal): Support
+ OPTION_MASK_ISA_FSGSBASE, OPTION_MASK_ISA_RDRND and
+ OPTION_MASK_ISA_F16C.
+
+ * config/i386/i386.c (OPTION_MASK_ISA_FSGSBASE_SET): New.
+ (OPTION_MASK_ISA_RDRND_SET): Likewise.
+ (OPTION_MASK_ISA_F16C_SET): Likewise.
+ (OPTION_MASK_ISA_FSGSBASE_UNSET): Likewise.
+ (OPTION_MASK_ISA_RDRND_UNSET): Likewise.
+ (OPTION_MASK_ISA_F16C_UNSET): Likewise.
+ (OPTION_MASK_ISA_AVX_UNSET): Add OPTION_MASK_ISA_F16C_UNSET.
+ (ix86_handle_option): Handle OPT_mfsgsbase, OPT_mrdrnd and OPT_mf16c.
+ (ix86_target_string): Support -mfsgsbase, -mrdrnd and -mf16c.
+ (pta_flags): Add PTA_FSGSBASE, PTA_RDRND and PTA_F16C.
+ (override_options): Handle them.
+ (ix86_valid_target_attribute_inner_p): Handle fsgsbase, rdrnd and f16c.
+ (ix86_builtins): Add IX86_BUILTIN_RDFSBASE32,
+ IX86_BUILTIN_RDFSBASE64, IX86_BUILTIN_RDGSBASE32,
+ IX86_BUILTIN_RDGSBASE64, IX86_BUILTIN_WRFSBASE32,
+ IX86_BUILTIN_WRFSBASE64, IX86_BUILTIN_WRGSBASE32,
+ IX86_BUILTIN_WRGSBASE64, IX86_BUILTIN_RDRAND16,
+ IX86_BUILTIN_RDRAND32, IX86_BUILTIN_RDRAND64,
+ IX86_BUILTIN_CVTPH2PS, IX86_BUILTIN_CVTPH2PS256,
+ IX86_BUILTIN_CVTPS2PH and IX86_BUILTIN_CVTPS2PH256.
+ (bdesc_args): Likewise.
+ (ix86_expand_args_builtin): Handle V8SF_FTYPE_V8HI,
+ V4SF_FTYPE_V8HI, V8HI_FTYPE_V8SF_INT and V8HI_FTYPE_V4SF_INT.
+ (ix86_expand_special_args_builtin): Handle VOID_FTYPE_UINT64,
+ VOID_FTYPE_UNSIGNED, UNSIGNED_FTYPE_VOID and UINT16_FTYPE_VOID.
+ Handle non-memory store.
+
+ * config/i386/i386.h (TARGET_FSGSBASE): New.
+ (TARGET_RDRND): Likewise.
+ (TARGET_F12C): Likewise.
+
+ * config/i386/i386.md (UNSPEC_VCVTPH2PS): New.
+ (UNSPEC_VCVTPS2PH): Likewise.
+ (UNSPECV_RDFSBASE): Likewise.
+ (UNSPECV_RDGSBASE): Likewise.
+ (UNSPECV_WRFSBASE): Likewise.
+ (UNSPECV_WRGSBASE): Likewise.
+ (UNSPECV_RDRAND): Likewise.
+ (rdfsbase<mode>): Likewise.
+ (rdgsbase<mode>): Likewise.
+ (wrfsbase<mode>): Likewise.
+ (wrgsbase<mode>): Likewise.
+ (rdrand<mode>): Likewise.
+
+ * config/i386/i386.opt: Add -mfsgsbase, -mrdrnd and -mf16c.
+
+ * config/i386/immintrin.h (_rdrand_u16): New.
+ (_rdrand_u32): Likewise.
+ (_readfsbase_u32): Likewise.
+ (_readfsbase_u64): Likewise.
+ (_readgsbase_u32): Likewise.
+ (_readgsbase_u64): Likewise.
+ (_writefsbase_u32): Likewise.
+ (_writefsbase_u64): Likewise.
+ (_writegsbase_u32): Likewise.
+ (_writegsbase_u64): Likewise.
+ (_rdrand_u64): Likewise.
+ (_cvtsh_ss): Likewise.
+ (_mm_cvtph_ps): Likewise.
+ (_mm256_cvtph_ps): Likewise.
+ (_cvtss_sh): Likewise.
+ (_mm_cvtps_ph): Likewise.
+ (_mm256_cvtps_ph): Likewise.
+
+ * config/i386/sse.md (vcvtph2ps): New.
+ (*vcvtph2ps_load): Likewise.
+ (vcvtph2ps256): Likewise.
+ (vcvtps2ph): Likewise.
+ (*vcvtps2ph): Likewise.
+ (*vcvtps2ph_store): Likewise.
+ (vcvtps2ph256): Likewise.
+
+ * doc/extend.texi: Document FSGSBASE and RDRND built-in functions.
+
+ * doc/invoke.texi: Document -mfsgsbase, -mrdrnd and -mf16c.
+
+2010-07-05 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR bootstrap/44512
+ * genenums.c (main): Output include of insn-constants.h
+ * Makefile.in (insn-enums.o): Depend on insn-constants.h.
+
+2010-07-05 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_gen_allocate_stack_worker): New.
+ (override_options): Initialize it.
+ (ix86_expand_prologue): Use it.
+
+2010-07-05 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-nrv.c (tree_nrv): Set DECL_VALUE_EXPR on found to result.
+
+2010-07-05 Anatoly Sokolov <aesok@post.ru>
+
+ * double-int.h (fit_double_type): Remove declaration.
+ * double-int.c (fit_double_type): Remove function.
+ * tree.h (int_fits_type_p): Adjust prototype.
+ * tree.c (int_fits_type_p): Return bool. Use double_int_fits_to_tree_p
+ instead of fit_double_type.
+ (build_int_cst_type): Use double_int_to_tree and shwi_to_double_int
+ instead of fit_double_type and build_int_cst_wide.
+ * builtins.c (): Use double_int_fits_to_tree_p and double_int_to_tree
+ instead of fit_double_type and build_int_cst_wide.
+ (fold_builtin_object_size): Use double_int_fits_to_tree_p instead
+ of fit_double_type.
+
+2010-07-05 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.h (cgraph_node, cgraph_varpool_node): Update docmentation of
+ in_other_partition.
+ * lto-cgraph.c (referenced_from_other_partition_p,
+ reachable_from_other_partition_p): Use in_other_partition flags.
+ (output_node, output_varpool_node): COMDAT nodes always have private
+ copies and thus are never used from other partition.
+
+2010-07-05 Anatoly Sokolov <aesok@post.ru>
+
+ * config/ia64/ia64.h (MEMORY_MOVE_COST): Remove macro.
+ * config/ia64/t-ia64 (ia64.o): Depend on reload.h.
+ * config/ia64/ia64.c Include reload.h.
+ (ia64_memory_move_cost): New function.
+ (TARGET_MEMORY_MOVE_COST): Define.
+ (ia64_register_move_cost): Replace MEMORY_MOVE_COST with
+ memory_move_cost.
+
+2010-07-05 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR middle-end/42505
+ * tree-ssa-loop-ivopts.c (determine_set_costs): Delete obsolete
+ comments about cost model.
+ (try_add_cand_for): Add second strategy for choosing initial set
+ based on original IVs, controlled by ORIGINALP argument.
+ (get_initial_solution): Add ORIGINALP argument.
+ (find_optimal_iv_set_1): New function, split from find_optimal_iv_set.
+ (find_optimal_iv_set): Try two different strategies for choosing
+ the IV set, and return the one with lower cost.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Copy alias info.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (reference_alias_ptr_type): New function.
+ * tree.h (reference_alias_ptr_type): Declare.
+ * tree-ssa-loop-ivopts.c (copy_ref_info): Restructure to
+ allow non-TARGET_MEM_REF new refs.
+ (rewrite_use_address): Pass old alias pointer type to create_mem_ref.
+ * tree-ssa-address.c (create_mem_ref_raw): Get alias pointer type.
+ Build a MEM_REF instead of a TARGET_MEM_REF if possible.
+ (create_mem_ref): Get alias pointer type. Adjust calls to
+ create_mem_ref_raw.
+ (maybe_fold_tmr): Likewise.
+ * tree-flow.h (create_mem_ref): Adjust prototype.
+
+2010-07-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44808
+ * gimplify.c (gimplify_modify_expr): Only SET_DECL_DEBUG_EXPR if
+ *from_p is VAR_DECL.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * tree.h (build_call_list): Remove.
+ * tree.c (build_call_list): Remove.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ * double-int.h (double_int_sub): Declare.
+ * double-int.c (double_int_sub): New function.
+ * dwarf2out.c (field_byte_offset): Use it.
+ * fixed-value.c (do_fixed_add): Likewise.
+ (do_fixed_multiply): Likewise.
+ (do_fixed_divide): Likewise.
+ * tree-predcom.c (add_ref_to_chain): Likewise.
+ (determine_roots_comp): Likewise.
+ * tree-ssa-loop-niter.c (derive_constant_upper_bound_ops): Likewise.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * vec.h (VEC_splice, VEC_safe_splice): New macros. Add function
+ implementations.
+
+2010-07-05 Bernd Schmidt <bernds@codesourcery.com>
+
+ * config/arm/arm.c (get_arm_condition_code): Remove CC_NOTBmode case.
+ * arm-modes.def (CC_NOTB): Don't define.
+ * config/arm/arm.md (arm_adddi3): Generate canonical RTL.
+ (adddi_sesidi_di, adddi_zesidi_di): Likewise.
+ (LTUGEU): New code_iterator.
+ (cnb, optab): New corresponding code_attrs.
+ (addsi3_carryin_<optab>): Renamed from addsi3_carryin. Change pattern
+ to canonical form. Operands 1 and 2 are commutative. Parametrize
+ using LTUGEU.
+ (addsi3_carryin_shift_<optab>): Likewise.
+ (addsi3_carryin_alt2_<optab>): Renamed from addsi3_carryin_alt2.
+ Operands 1 and 2 are commutative. Parametrize using LTUGEU.
+ (addsi3_carryin_alt1, addsi3_carryin_alt3): Remove.
+ (subsi3_compare): Renamed from subsi3_compare0_c.
+ Change CC_NOTB to CC.
+ (arm_subsi3_insn): Allow constants for operand 0.
+ (compare_scc peephole for eq case): New.
+ (compare_scc splitters): Change CC_NOTB to CC.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-loop-im.c (for_each_index): Do not handle
+ ALIGN_INDIRECT_REF.
+ (gen_lsm_tmp_name): Likewise.
+ * tree-dump.c (dequeue_and_dump): Likewise.
+ * tree-pretty-print.c (dump_generic_node): Likewise.
+ (op_code_prio): Likewise.
+ (op_symbol_code): Likewise.
+ * tree.c (staticp): Likewise.
+ (build1_stat): Likewise.
+ * tree.h (INDIRECT_REF_P): Likewise.
+ * fold-const.c (maybe_lvalue_p): Likewise.
+ (operand_equal_p): Likewise.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
+ (ao_ref_init_from_vn_reference): Likewise.
+ * tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
+ (find_interesting_uses_address): Likewise.
+ * dwarf2out.c (loc_list_from_tree): Likewise.
+ * gimplify.c (gimplify_expr): Likewise.
+ * tree-eh.c (tree_could_trap_p): Likewise.
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
+ * cfgexpand.c (expand_debug_expr): Likewise.
+ * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
+ * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
+ * tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
+ * config/rs6000/rs6000 (rs6000_check_sdmode): Likewise.
+ * tree-ssa-operands.c (get_expr_operands): Likewise.
+ * expr.c (safe_from_p): Likewise.
+ (expand_expr_real_1): Likewise. TER BIT_AND_EXPRs into MEM_REFs.
+ * tree-vect-data-refs.c (vect_setup_realignment): Build
+ BIT_AND_EXPR and MEM_REF instead of ALIGN_INDIRECT_REF.
+ * tree-vect-stmts.c (vectorizable_load): Likewise.
+ * tree.def (ALIGN_INDIRECT_REF): Remove.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44784
+ * tree-ssa-pre.c (bitmap_find_leader): Fix dominance check
+ for inserted stmts.
+ (find_or_generate_expression): Fix SCCVN insertion check.
+
+2010-07-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/rs6000/e500crtsavg64gprctr.asm: Correct done label name.
+ * config/rs6000/e500crtsav64gprctr.asm: Likewise.
+ * config/rs6000/e500crtres64gprctr.asm: Likewise. Add FUNC_END
+ directives.
+
+2010-07-05 Ira Rosen <irar@il.ibm.com>
+
+ * tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Skip
+ statements that are not vectorized.
+ * tree-vect-stmts.c (vect_get_load_cost): Update the value stored
+ in INSIDE_COST.
+
+2010-07-05 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR bootstrap/44820
+ * config/arm/arm.c (arm_attr_length_move_neon): Delete regno.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ * tree-cfg.c (verify_gimple_return): Handle DECL_BY_REFERENCE
+ RESULT_DECLs properly.
+
+2010-07-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/44695
+ * config/i386/i386.md (extract_code): Removed.
+ (<u>divmodqi4): Likewise.
+ (divmodqi4): New.
+ (udivmodqi4): Likewise.
+ (divmodhiqi3): Change div/mod to HImode and extend operand 2 to HImode.
+ (udivmodhiqi3): Likewise.
+
+2010-07-04 Jan Hubicka <jh@suse.cz>
+
+ * lto-cgraph.c (input_edge): Do not care about resolution decisions.
+
+2010-07-04 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (init_cgraph): Only initialize dump file if it
+ is not already initialized.
+
+2010-07-04 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab)
+ (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab)
+ (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab)
+ (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab)
+ (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab)
+ (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab)
+ (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab)
+ (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab)
+ (sync_new_nand_optab): Redefine as macros.
+ (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release):
+ Delete.
+ (direct_optab_index): New enum.
+ (direct_optab_d): New structure.
+ (direct_optab): New typedef.
+ (direct_optab_table): Declare.
+ (direct_optab_handler, set_direct_optab_handler): New functions.
+ (sync_compare_and_swap_optab, sync_lock_test_and_set_optab)
+ (sync_lock_release_optab): New macros.
+ * optabs.c (direct_optab_table): New variable.
+ (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete.
+ (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab,
+ cmpstr_optab and cmpstrn_optab.
+ (emit_conditional_move): Likewise for movcc_optab.
+ (can_conditionally_move_p): Likewise for movcc_gen_code.
+ (init_insn_codes): Clear direct_optab_table.
+ (init_optabs): Don't initialize the new "direct optabs" here.
+ (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and
+ vcond_gen_code.
+ (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab.
+ (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab.
+ (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab.
+ (expand_sync_operation): Likewise other sync_*_optabs.
+ (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap
+ to sync_compare_and_swap_optab.
+ (expand_sync_lock_test_and_set): Use direct_optab_handler for
+ sync_lock_test_and_set and sync_compare_and_swap, adding "_optab"
+ to the names of both.
+ * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for
+ cmpstr_optab and cmpstrn_optab.
+ (expand_builtin_lock_release): Likewise sync_lock_release.
+ * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab)
+ (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab)
+ (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab)
+ (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab)
+ (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab)
+ (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab)
+ (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap)
+ (sync_lock_test_and_set, sync_lock_release): Delete.
+ (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab.
+ (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab.
+ * genopinit.c (optabs): Use set_direct_optab_handler for the new
+ macro optabs.
+ * omp-low.c (expand_omp_atomic_fetch_op): Update the type of
+ the "optab" local variable. Use direct_optab_handler for optab and
+ sync_compare_and_swap_optab.
+ * reload1.c (reload_in_optab, reload_out_optab): Delete.
+ * targhooks.c (default_secondary_reload): Use direct_optab_handler for
+ reload_in_optab and reload_out_optab.
+ * config/alpha/alpha.c (alpha_secondary_reload): Likewise.
+ * config/frv/frv.c (frv_alloc_temp_reg): Likewise.
+ * config/pa/pa.c (pa_secondary_reload): Likewise.
+ * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler
+ for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab.
+ (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise.
+ (VMSupportsCS8_builtin): Likewise.
+
+2010-07-04 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * optabs.h (optab_handlers): Change type of insn_code to int.
+ (optab_handler, set_optab_handler, convert_optab_handler)
+ (set_convert_optab_handler): Treat the insn_code field as "insn_code -
+ CODE_FOR_nothing".
+ * optabs.c (optab_table, convert_optab_table): Always zero-initialize.
+ (init_insn_codes): Zero both the above arrays.
+ (init_optabs): Never call init_insn_codes first time around.
+
+2010-07-04 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * optabs.h (optab_handler, convert_optab_handler): Turn into
+ inline functions that return an insn code.
+ (set_optab_handler, set_convert_optab_handler): New functions.
+ * builtins.c: Replace optab_handler(X)->insn_code with
+ optab_handler or set_optab_handler thoughout. Likewise
+ convert_optab_handler(X)->insn_code with convert_optab_handler
+ and set_convert_optab_handler.
+ * expmed.c, expr.c, genopinit.c, ifcvt.c, optabs.c, reload.c,
+ reload1.c, stmt.c, targhooks.c, tree-ssa-loop-prefetch.c,
+ tree-ssa-math-opts.c, tree-vect-data-refs.c, tree-vect-generic.c,
+ tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c,
+ tree-vect-stmts.c, config/m32c/m32c.c, config/rs6000/rs6000.c,
+ config/spu/spu.c: Likewise.
+
+2010-07-04 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/44531
+ * config.gcc (sh*-*-*): Use regular expressions instead of
+ the 'i' modifier for sed substitutions.
+
+2010-07-04 Jeremie Salvucci <jeremie.salvucci@free.fr>
+
+ * gimple.c (gimple_body): Comments added.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44809
+ * gimplify.c (gimplify_expr): Properly build a MEM_REF instead
+ of an INDIRECT_REF.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44479
+ * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Avoid
+ extra SSA name copy statements which preserves points-to
+ information.
+ * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
+ Copy points-to information for all pointers. Properly handle
+ MEM_REFs.
+ (vect_create_data_ref_ptr): Likewise. Avoid extra SSA name
+ copy statements.
+ * Makefile.in (tree-ssa-loop-ivopts.o): Add tree-ssa-propagate.h
+ dependency.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44785
+ * tree-inline.c (initialize_inlined_parameters): Do not
+ re-use pointer-map slot over remap_type call.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-sccvn.c (vn_reference_lookup_3): Fix last commit.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44656
+ * tree-ssa-sccvn.c (vn_reference_lookup_3): Try disambiguation
+ again after value-replacing in the defintions lhs.
+
+2010-07-04 Ira Rosen <irar@il.ibm.com>
+ Revital Eres <eres@il.ibm.com>
+
+ * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST):
+ Document new arguments.
+ * doc/tm.texi: Regenerate.
+ * targhooks.c (default_builtin_vectorization_cost): Add new arguments.
+ Handle unaligned store.
+ * targhooks.h (default_builtin_vectorization_cost): Add new arguments.
+ * target.def (builtin_vectorization_cost): Add new arguments.
+ * target.h (enum vect_cost_for_stmt): Add unaligned_store.
+ * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number
+ of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT.
+ (vect_vfa_segment_size): Fix indentation.
+ * tree-vectorizer.h (struct _vect_peel_info): New.
+ (struct _vect_peel_extended_info): New.
+ (struct _loop_vec_info): Add new field for peeling hash table and a
+ macro for its access.
+ (VECT_MAX_COST): Define.
+ (vect_get_load_cost): Declare.
+ (vect_get_store_cost, vect_get_known_peeling_cost,
+ vect_get_single_scalar_iteraion_cost): Likewise.
+ (vect_supportable_dr_alignment): Add new argument.
+ * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table
+ field.
+ (destroy_loop_vec_info): Free peeling hash table.
+ (vect_analyze_loop_form): Update call to builtin_vectorization_cost.
+ (vect_analyze_loop): Move vect_enhance_data_refs_alignment before
+ vect_analyze_slp. Fix indentation.
+ (vect_get_single_scalar_iteraion_cost): New function.
+ (vect_get_known_peeling_cost): Likewise.
+ (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel.
+ Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per
+ statement. Move outside cost calculation inside unknown peeling case.
+ Call vect_get_known_peeling_cost for known amount of peeling.
+ * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data
+ reference to the print message of forced alignment.
+ (vect_verify_datarefs_alignment): Update call to
+ vect_supportable_dr_alignment.
+ (vect_get_data_access_cost): New function.
+ (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert,
+ vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost,
+ vect_peeling_hash_choose_best_peeling): Likewise.
+ (vect_enhance_data_refs_alignment): Fix documentation. Use hash table
+ to store all the accesses in the loop and find best possible access to
+ align using peeling for known alignment case. For unknown alignment
+ check if stores are preferred or if peeling is worthy.
+ (vect_find_same_alignment_drs): Analyze pairs of loads too.
+ (vect_supportable_dr_alignment): Add new argument and check aligned
+ accesses according to it.
+ * tree-vect-stmts.c (vect_get_stmt_cost): New function.
+ (cost_for_stmt): Call vect_get_stmt_cost.
+ (vect_model_simple_cost): Likewise.
+ (vect_model_store_cost): Call vect_get_stmt_cost. Call
+ vect_get_store_cost to calculate the cost of the statement.
+ (vect_get_store_cost): New function.
+ (vect_model_load_cost): Call vect_get_stmt_cost. Call
+ vect_get_load_cost to calculate the cost of the statement.
+ (vect_get_load_cost): New function.
+ (vectorizable_store): Update call to vect_supportable_dr_alignment.
+ (vectorizable_load): Likewise.
+ * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments.
+ * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new
+ arguments. Handle unaligned store.
+ * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New.
+ (rs6000_builtin_support_vector_misalignment): Return true for word and
+ double word alignments for VSX.
+ * tree-vect-slp.c (vect_build_slp_tree): Update calls to
+ vect_supportable_dr_alignment and builtin_vectorization_cost.
+
+2010-07-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/44597
+ * config/pa/predicates.md (prefetch_cc_operand): Remove.
+ (prefetch_nocc_operand): Likewise.
+ * config/pa/pa.md (prefetch): Revise expander to use prefetch_20.
+ (prefetch_20): New insn.
+ (prefetch_cc): Remove.
+ (prefetch_nocc): Likewise.
+
+2010-07-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * expr.c (vector_mode_valid_p): Move to c-common.c.
+ * expr.h (vector_mode_valid_p): Do not declare here.
+ * system.h: Poison GCC_EXPR_H in front-ends.
+ * Makefile.in: Update dependencies.
+
+2010-07-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/44705
+ * config/pa/pa.h (GO_IF_LEGITIMATE_ADDRESS): Reject LABEL_REF.
+
+2010-07-03 Jan Hubicka <jh@suse.cz>
+
+ * timevar.def (TV_OUT_OF_SSA, TV_VAR_EXPAND, TV_POST_EXPAND,
+ TV_VAR_TRACKING_DATAFLOW, TV_VAR_TRACKING_EMIT): New timevars.
+ * cfgexpand.c (gimple_expand_cfg): Use new timevars.
+ * var-tracking.c (vt_find_locations, variable_tracking_main_1):
+ Likewise.
+
+ * lto-stramer-out.c (pass_ipa_lto_gimple_out, pass_ipa_lto_finish_out):
+ Update timevars.V
+ * timevar.def (TV_IPA_LTO_GIMPLE_IO, TV_IPA_LTO_DECL_IO): Remove.
+ (TV_IPA_LTO_GIMPLE_IN, TV_IPA_LTO_GIMPLE_OUT, TV_IPA_LTO_DECL_IN,
+ TV_IPA_LTO_DECL_OUT): New.
+ * lto.c (read_cgraph_and_symbols, materialize_cgraph): Update timevars.
+
+2010-07-03 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (update_edge_key): Break out from ...
+ update_callers_keys): ... here;
+ (update_callee_keys): Update only the edges from caller to callee.
+ (update_all_calle_keys): Do what update_calle_keys did.
+ (decide_inlining_of_small_functions): Avoid recomputing of all
+ callees when badness increase.
+
+2010-07-03 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/arm.c (arm_attr_length_move_neon): New.
+ * config/arm/arm-protos.h (arm_attr_length_move_neon): Declare.
+ * config/arm/neon.md (define_mode_attr V_slen): Remove.
+ (neon_mov<mode> for VSTRUCT): Use arm_attr_length_move_neon
+ to compute length attribute.
+
+2010-07-03 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/vfp.md (*push_multi_vfp): Use vfp_register_operand
+ as predicate for operand 1 and remove its constraint.
+ * config/arm/predicates.md (vfp_register_operand): New.
+ * config/arm/arm.md (*push_multi): Remove the constraint of operand 1.
+ (*push_fp_multi): Likewise.
+
+2010-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimplify.c (mostly_copy_tree_r): Deal with BIND_EXPR.
+
+2010-07-03 Jan Hubicka <jh@suse.cz>
+
+ * config/i386/i386.c (override_options): Revert accidental commit.
+
+2010-07-02 Le-Chun Wu <lcwu@google.com>
+
+ PR c++/44128
+ * doc/invoke.texi: Update documentation of -Wshadow.
+
+2010-07-02 Daniel Jacobowitz <dan@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/arm/arm.c (arm_canonicalize_comparison): Canonicalize DImode
+ comparisons. Adjust to take both operands.
+ (arm_select_cc_mode): Handle DImode comparisons.
+ (arm_gen_compare_reg): Generate a scratch register for DImode
+ comparisons which require one. Use xor for Thumb equality checks.
+ (arm_const_double_by_immediates): New.
+ (arm_print_operand): Allow 'Q' and 'R' for constants.
+ (get_arm_condition_code): Handle new CC_CZmode and CC_NCVmode.
+ * config/arm/arm.h (CANONICALIZE_COMPARISON): Always use
+ arm_canonicalize_comparison.
+ * config/arm/arm-modes.def: Add CC_CZmode and CC_NCVmode.
+ * config/arm/arm-protos.h (arm_canonicalize_comparison): Update
+ prototype.
+ (arm_const_double_by_immediates): Declare.
+ * config/arm/constraints.md (Di): New constraint.
+ * config/arm/predicates.md (arm_immediate_di_operand)
+ (arm_di_operand, cmpdi_operand): New.
+ * config/arm/arm.md (cbranchdi4): Handle non-Cirrus also.
+ (*arm_cmpdi_insn, *arm_cmpdi_unsigned)
+ (*arm_cmpdi_zero, *thumb_cmpdi_zero): New insns.
+ (cstoredi4): Handle non-Cirrus also.
+
+2010-07-02 Julian Brown <julian@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ PR target/43703
+ * config/arm/vec-common.md (add<mode>3, sub<mode>3, smin<mode>3)
+ (smax<mode>3): Disable for NEON float modes when
+ flag_unsafe_math_optimizations is false.
+ * config/arm/neon.md (*add<mode>3_neon, *sub<mode>3_neon)
+ (*mul<mode>3_neon)
+ (mul<mode>3add<mode>_neon, mul<mode>3neg<mode>add<mode>_neon)
+ (reduc_splus_<mode>, reduc_smin_<mode>, reduc_smax_<mode>): Disable
+ for NEON float modes when flag_unsafe_math_optimizations is false.
+ (quad_halves_<code>v4sf): Only enable if
+ flag_unsafe_math_optimizations is true.
+ * doc/invoke.texi (ARM Options): Add note about floating point
+ vectorization requiring -funsafe-math-optimizations.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+
+ * config/arm/neon.md (UNSPEC_VABA): Delete.
+ (UNSPEC_VABAL): Delete.
+ (UNSPEC_VABS): Delete.
+ (UNSPEC_VMUL_N): Delete.
+ (adddi3_neon): New.
+ (subdi3_neon): New.
+ (mul<mode>3add<mode>_neon): Make the pattern named.
+ (mul<mode>3neg<mode>add<mode>_neon): Likewise.
+ (neon_vadd<mode>): Replace with define_expand, and move the remaining
+ unspec parts...
+ (neon_vadd<mode>_unspec): ...to this.
+ (neon_vmla<mode>, neon_vmla<mode>_unspec): Likewise.
+ (neon_vlms<mode>, neon_vmls<mode>_unspec): Likewise.
+ (neon_vsub<mode>, neon_vsub<mode>_unspec): Likewise.
+ (neon_vaba<mode>): Rewrite in terms of vabd.
+ (neon_vabal<mode>): Rewrite in terms of vabdl.
+ (neon_vabs<mode>): Rewrite without unspec.
+ * config/arm/arm.md (*arm_adddi3): Disable for TARGET_NEON.
+ (*arm_subdi3): Likewise.
+ * config/arm/neon.ml (Vadd, Vsub): Split out 64-bit variants and add
+ No_op attribute to disable assembly output checks.
+ * config/arm/arm_neon.h: Regenerated.
+ * doc/arm-neon-intrinsics.texi: Regenerated.
+
+2010-07-02 Jan Hubicka <jh@suse.cz>
+
+ * ipa-split.c (split_function): For aggregate values, set the return
+ slot optimization bit. When passing DECL_BY_REFERENCE, produce
+ *<retval> = fncall.part ().
+ (execute_split_functions): Do not care about DECL_BY_REFERENCE.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/arm/neon.md (UNSPEC_VAND): Delete.
+ (UNSPEC_VBIC): Delete.
+ (UNSPEC_VCLZ): Delete.
+ (UNSPEC_VCNT): Delete.
+ (UNSPEC_VEOR): Delete.
+ (UNSPEC_VORN): Delete.
+ (UNSPEC_VORR): Delete.
+ (iordi3_neon): Rewrite RTL without unspec. Add alternatives to handle
+ core registers too.
+ (anddi3_neon): Likewise.
+ (orndi3_neon): Likewise.
+ (bicdi3_neon): Likewise.
+ (xordi3_neon): Likewise.
+ (neon_vclz<mode>): Rewrite as define_expand and clz<mode>2 to get
+ rid of unspec and handle unused operand.
+ (neon_vcnt<mode>): Similarly, with popcount<mode>2.
+ * config/arm/predicates.md (imm_for_neon_logic_operand):
+ Require TARGET_NEON.
+ (imm_for_neon_inv_logic_operand): Likewise.
+ * config/arm/arm.md (define_split for logical_binary_operator):
+ Disable for NEON registers.
+ (anddi3): Add new define_expand, and rename the insn. Disable
+ this insn for NEON, where anddi3_neon now applies.
+ (*anddi_notdi_di): Disable for TARGET_NEON, where bicdi3_neon applies.
+ (iordi3): As for anddi3.
+ (xordi3): Likewise.
+ * config/arm/neon.ml (Vand): Split DImode variants and mark them
+ as No_op to disable testing for exact instruction match.
+ (Vorr): Likewise.
+ (Veor): Likewise.
+ (Vbic): Likewise.
+ (Vorn): Likewise.
+ * config/arm/arm_neon.h: Regenerated.
+ * doc/arm-neon-intrinsics.texi: Regenerated.
+
+2010-07-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.h (emit_stack_probe): Declare.
+ * explow.c (emit_stack_probe): Make global.
+ (anti_adjust_stack_and_probe): Fix comments.
+ * config/sparc/linux.h (STACK_CHECK_STATIC_BUILTIN): Define to 1.
+ * config/sparc/linux64.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
+ * config/sparc/sol2.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
+ * config/sparc/sparc.c: Include except.h.
+ (sparc_emit_probe_stack_range): New function.
+ (output_probe_stack_range): Likewise.
+ (sparc_expand_prologue): Invoke sparc_emit_probe_stack_range if static
+ built-in stack checking is enabled.
+ * config/sparc/sparc-protos.h (output_probe_stack_range): Declare.
+ * config/sparc/sparc.md (UNSPECV_PROBE_STACK_RANGE): New constant.
+ (probe_stack_range): New insn.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ PR target/43958
+ * config/pa/pa.c (hppa_gimplify_va_arg_expr): Use pointer arithmetic
+ for argument alignment.
+
+2010-07-02 Jan Hubicka <jh@suse.cz>
+
+ * ipa-split.c (verify_non_ssa_vars): Break out from ...; perform DFS
+ walk backwards from entry_bb to check only those basic block of header
+ that might lead to execution of split part.
+ (consider_split) ... here.
+ (find_return_bb): Allow assignment in return BB.
+ (find_retval): New.
+ (split_function): Fix name of cloned function; take care of updating
+ return value in return_bb containing move.
+
+2010-07-02 Andreas Schwab <schwab@linux-m68k.org>
+
+ PR target/44771
+ * config/m68k/m68k.c (m68k_expand_prologue): Remove set but not
+ used variable insn.
+
+2010-07-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * implicit-zee.c (combine_reaching_defs): Fix long lines.
+ (is_set_with_extension_DI): Delete.
+ (struct zero_extend_info): New structure.
+ (add_removable_zero_extend): New function.
+ (find_removable_zero_extends): Use note_stores to find SETs.
+ (find_and_remove_ze): Fix long line, remove superfluous parentheses.
+
+2010-07-02 Changpeng Fang <changpeng.fang@amd.com>
+
+ * tree-ssa-loop-prefetch.c (compute_miss_rate): Rename to
+ is_miss_rate_acceptable. Pull total_positions computation
+ out of the loops. Early return if miss_positions exceeds
+ the acceptable threshold.
+ * tree-ssa-loop-prefetch.c (prune_ref_by_group_reuse): Call
+ is_miss_rate_acceptable after renaming of compute_miss_rate.
+
+2010-07-02 Changpeng Fang <changpeng.fang@amd.com>
+
+ PR middle-end/44576
+ * tree-ssa-loop-prefetch.c (compute_miss_rate): Return 1000 (out
+ of 1000) for miss rate if the address diference is greater than or
+ equal to the cache line size (the two reference will never hit the
+ same cache line).
+
+2010-07-02 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/42835
+ * config/arm/arm-modes.def (CC_NOTB): New mode.
+ * config/arm/arm.c (get_arm_condition_code): Handle it.
+ * config/arm/thumb2.md (thumb2_compare_scc): Delete pattern.
+ * config/arm/arm.md (subsi3_compare0_c): New pattern.
+ (compare_scc): Now a define_and_split. Add a number of extra
+ splitters before it.
+
+ PR target/42172
+ * config/arm/arm.c (thumb1_rtx_costs): Improve support for SIGN_EXTEND
+ and ZERO_EXTEND.
+ (arm_rtx_costs_1): Likewise.
+ (arm_size_rtx_costs): Use arm_rtx_costs_1 for these codes.
+ * config/arm/arm.md (is_arch6): New attribute.
+ (zero_extendhisi2, zero_extendqisi2, extendhisi2,
+ extendqisi2): Tighten the code somewhat, avoiding invalid
+ RTL to occur in the expander patterns.
+ (thumb1_zero_extendhisi2): Merge with thumb1_zero_extendhisi2_v6.
+ (thumb1_zero_extendhisi2_v6): Delete.
+ (thumb1_extendhisi2): Merge with thumb1_extendhisi2_v6.
+ (thumb1_extendhisi2_v6): Delete.
+ (thumb1_extendqisi2): Merge with thumb1_extendhisi2_v6.
+ (thumb1_extendqisi2_v6): Delete.
+ (zero_extendhisi2 for register input splitter): New.
+ (zero_extendqisi2 for register input splitter): New.
+ (thumb1_extendhisi2 for register input splitter): New.
+ (extendhisi2 for register input splitter): New.
+ (extendqisi2 for register input splitter): New.
+ (TARGET_THUMB1 extendqisi2 for memory input splitter): New.
+ (arm_zero_extendhisi2): Allow nonimmediate_operand for operand 1,
+ and add support for a register alternative requiring a split.
+ (thumb1_zero_extendqisi2): Likewise.
+ (arm_zero_extendqisi2): Likewise.
+ (arm_extendhisi2): Likewise.
+ (arm_extendqisi2): Likewise.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/arm/arm.c (neon_vdup_constant): Expand into canonical RTL
+ instead of an unspec.
+ (neon_expand_vector_init): Likewise.
+ * config/arm/neon.md (UNSPEC_VCOMBINE): Delete.
+ (UNSPEC_VDUP_LANE): Delete.
+ (UNSPEC VDUP_N): Delete.
+ (UNSPEC_VGET_HIGH): Delete.
+ (UNSPEC_VGET_LANE): Delete.
+ (UNSPEC_VGET_LOW): Delete.
+ (UNSPEC_VMVN): Delete.
+ (UNSPEC_VSET_LANE): Delete.
+ (V_double_vector_mode): New.
+ (vec_set<mode>_internal): Make code emitted match that for the
+ corresponding intrinsics.
+ (vec_setv2di_internal): Likewise.
+ (neon_vget_lanedi): Rewrite to expand into emit_move_insn.
+ (neon_vget_lanev2di): Rewrite to expand into vec_extractv2di.
+ (neon_vset_lane<mode>): Combine double and quad patterns and
+ expand into vec_set<mode>_internal instead of UNSPEC_VSET_LANE.
+ (neon_vset_lanedi): Rewrite to expand into emit_move_insn.
+ (neon_vdup_n<mode>): Rewrite RTL without unspec.
+ (neon_vdup_ndi): Rewrite as define_expand and use emit_move_insn.
+ (neon_vdup_nv2di): Rewrite RTL without unspec and merge with
+ with neon_vdup_lanev2di, adjusting the pattern from the latter
+ to be predicable for consistency.
+ (neon_vdup_lane<mode>_internal): New.
+ (neon_vdup_lane<mode>): Turn into a define_expand and rewrite
+ to avoid using an unspec.
+ (neon_vdup_lanedi): Rewrite RTL pattern to avoid unspec.
+ (neon_vdup_lanev2di): Turn into a define_expand.
+ (neon_vcombine): Rewrite pattern to eliminate UNPSEC_VCOMBINE.
+ (neon_vget_high<mode>): Replace with....
+ (neon_vget_highv16qi): New pattern using canonical RTL.
+ (neon_vget_highv8hi): Likewise.
+ (neon_vget_highv4si): Likewise.
+ (neon_vget_highv4sf): Likewise.
+ (neon_vget_highv2di): Likewise.
+ (neon_vget_low<mode>): Replace with....
+ (neon_vget_lowv16qi): New pattern using canonical RTL.
+ (neon_vget_lowv8hi): Likewise.
+ (neon_vget_lowv4si): Likewise.
+ (neon_vget_lowv4sf): Likewise.
+ (neon_vget_lowv2di): Likewise.
+
+ * config/arm/neon.ml (Vget_lane): Add No_op attribute to suppress
+ test for this emitting vmov.
+ (Vset_lane): Likewise.
+ (Vdup_n): Likewise.
+ (Vmov_n): Likewise.
+
+ * doc/arm-neon-intrinsics.texi: Regenerated.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/arm/neon.md (vec_extractv2di): Correct error in register
+ numbering to reconcile with neon_vget_lanev2di.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (pt_solution_set_var): New function.
+ * tree-ssa-alias.h (pt_solution_set_var): Declare.
+ * tree-ssa-loop-ivopts.c (copy_ref_info): Also copy or create
+ points-to information.
+
+2010-07-02 Christian Borntraeger <borntraeger@de.ibm.com>
+
+ * config/s390/s390.c (override_options): Adopt prefetching
+ at -O3 to handle flag_prefetch_loop_arrays as a tristate.
+
+2010-07-02 Jan Hubicka <jh@suse.cz>
+
+ * df-problems.c (df_kill_notes): Do not collect dead notes.
+ (df_set_note): Just call add_reg_note.
+ (df_set_unused_notes_for_mw, df_set_dead_notes_for_mw,
+ df_create_unused_note): Do not deal with lists of old notes.
+ (df_note_bb_compute): Likewise.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (find_func_aliases): Handle
+ pointer alignment via BIT_AND_EXPR.
+ * tree-vrp.c (extract_range_from_binary_expr): Likewise.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ * tree-data-ref.c (initialize_data_dependence_relation): Handle
+ mismatching number of dimensions properly.
+
+2010-07-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR target/44707
+ * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Recognize
+ (lo_sum (high ...) ...) patterns generated by earlier passes.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/install.texi (Prerequisites): Document Perl requirement on
+ Solaris 2.
+ (Specific, *-*-solaris2*): Document GNU c++filt requirement.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44777
+ * tree-cfg.c (gimple_block_ends_with_call_p): Handle empty BBs.
+
+2010-07-02 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/44706
+ * predict.c (predict_paths_for_bb): Handle case when control dependence
+ BB has only abnormal edges.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44748
+ * tree-ssa-ccp.c (fold_const_aggregate_ref): Properly handle
+ the embedded conversion in MEM_REFs.
+
+2010-07-01 López-Ibáñez <manu@gcc.gnu.org>
+
+ * reload.c: Include toplev.h.
+ * recog.c: Likewise.
+ * Makefile.in: Adjust dependencies.
+
+2010-07-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/44694
+ * dwarf2out.c (reg_loc_descriptor): For eliminated arg_pointer_rtx
+ or frame_pointer_rtx use DW_OP_fbreg offset DW_OP_stack_value.
+
+2010-07-01 Richard Guenther <rguenther@suse.de>
+
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Use unsigned
+ types for offsets.
+
+2010-07-01 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR target/44732
+ * config/ia64/ia64.c (ia64_register_move_cost): Remove stray '{'.
+ Fix argument types.
+
+2010-07-01 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/44727
+ * config/i386/i386.md (peephole2 for arithmetic ops with memory):
+ Make sure operand 0 dies.
+
+2010-07-01 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/42834
+ PR middle-end/44468
+ * doc/gimple.texi (is_gimple_mem_ref_addr): Document.
+ * doc/generic.texi (References to storage): Document MEM_REF.
+ * tree-pretty-print.c (dump_generic_node): Handle MEM_REF.
+ (print_call_name): Likewise.
+ * tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF.
+ (build_simple_mem_ref_loc): New function.
+ (mem_ref_offset): Likewise.
+ * tree.h (build_simple_mem_ref_loc): Declare.
+ (build_simple_mem_ref): Define.
+ (mem_ref_offset): Declare.
+ * fold-const.c: Include tree-flow.h.
+ (operand_equal_p): Handle MEM_REF.
+ (build_fold_addr_expr_with_type_loc): Likewise.
+ (fold_comparison): Likewise.
+ (fold_unary_loc): Fold
+ VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>.
+ (fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2],
+ fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2].
+ * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF.
+ (ptr_deref_may_alias_ref_p_1): Likewise.
+ (ao_ref_base_alias_set): Properly differentiate base object for
+ offset and TBAA.
+ (ao_ref_init_from_ptr_and_size): Use MEM_REF.
+ (indirect_ref_may_alias_decl_p): Handle MEM_REFs properly.
+ (indirect_refs_may_alias_p): Likewise.
+ (refs_may_alias_p_1): Likewise. Remove pointer SSA name def
+ chasing code.
+ (ref_maybe_used_by_call_p_1): Handle MEM_REF.
+ (call_may_clobber_ref_p_1): Likewise.
+ * dwarf2out.c (loc_list_from_tree): Handle MEM_REF.
+ * expr.c (expand_assignment): Handle MEM_REF.
+ (store_expr): Handle MEM_REFs from STRING_CSTs.
+ (store_field): If expanding a MEM_REF of a non-addressable
+ decl use bitfield operations.
+ (get_inner_reference): Handle MEM_REF.
+ (expand_expr_addr_expr_1): Likewise.
+ (expand_expr_real_1): Likewise.
+ * tree-eh.c (tree_could_trap_p): Handle MEM_REF.
+ * alias.c (ao_ref_from_mem): Handle MEM_REF.
+ (get_alias_set): Likewise. Properly handle VIEW_CONVERT_EXPRs.
+ * tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF.
+ (dr_analyze_indices): Likewise.
+ (dr_analyze_alias): Likewise.
+ (object_address_invariant_in_loop_p): Likewise.
+ * gimplify.c (mark_addressable): Handle MEM_REF.
+ (gimplify_cond_expr): Build MEM_REFs.
+ (gimplify_modify_expr_to_memcpy): Likewise.
+ (gimplify_init_ctor_preeval_1): Handle MEM_REF.
+ (gimple_fold_indirect_ref): Adjust.
+ (gimplify_expr): Handle MEM_REF. Gimplify INDIRECT_REF to MEM_REF.
+ * tree.def (MEM_REF): New tree code.
+ * tree-dfa.c: Include toplev.h.
+ (get_ref_base_and_extent): Handle MEM_REF.
+ (get_addr_base_and_unit_offset): New function.
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF.
+ * gimple-fold.c (may_propagate_address_into_dereference): Handle
+ MEM_REF.
+ (maybe_fold_offset_to_array_ref): Allow possibly out-of bounds
+ accesses if the array has just one dimension. Remove always true
+ parameter. Do not require type compatibility here.
+ (maybe_fold_offset_to_component_ref): Remove.
+ (maybe_fold_stmt_indirect): Remove.
+ (maybe_fold_reference): Remove INDIRECT_REF handling.
+ Fold back to non-MEM_REF.
+ (maybe_fold_offset_to_address): Simplify. Deal with type
+ mismatches here.
+ (maybe_fold_reference): Likewise.
+ (maybe_fold_stmt_addition): Likewise. Also handle
+ &ARRAY + I in addition to &ARRAY[0] + I.
+ (fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs.
+ (gimple_get_relevant_ref_binfo): Handle MEM_REF.
+ * cfgexpand.c (expand_debug_expr): Handle MEM_REF.
+ * tree-ssa.c (useless_type_conversion_p): Make most pointer
+ conversions useless.
+ (warn_uninitialized_var): Handle MEM_REF.
+ (maybe_rewrite_mem_ref_base): New function.
+ (execute_update_addresses_taken): Implement re-writing of MEM_REFs
+ to SSA form.
+ * tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove
+ INDIRECT_REF handling.
+ (copy_tree_body_r): Handle MEM_REF.
+ * gimple.c (is_gimple_addressable): Adjust.
+ (is_gimple_address): Likewise.
+ (is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with
+ invariant base are invariant.
+ (is_gimple_min_lval): Adjust.
+ (is_gimple_mem_ref_addr): New function.
+ (get_base_address): Handle MEM_REF.
+ (count_ptr_derefs): Likewise.
+ (get_base_loadstore): Likewise.
+ * gimple.h (is_gimple_mem_ref_addr): Declare.
+ (gimple_call_fndecl): Handle invariant MEM_REF addresses.
+ * tree-cfg.c (verify_address): New function, split out from ...
+ (verify_expr): ... here. Use for verifying ADDR_EXPRs and
+ the address operand of MEM_REFs. Verify MEM_REFs. Reject
+ INDIRECT_REFs.
+ (verify_types_in_gimple_min_lval): Handle MEM_REF. Disallow
+ INDIRECT_REF. Allow conversions.
+ (verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of
+ a register does not change its size.
+ (verify_types_in_gimple_reference): Verify MEM_REF.
+ (verify_gimple_assign_single): Disallow INDIRECT_REF.
+ Handle MEM_REF.
+ * tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable):
+ New.
+ (mark_address_taken): Handle MEM_REF.
+ (get_indirect_ref_operands): Pass through opf_not_non_addressable.
+ (get_asm_expr_operands): Pass opf_not_non_addressable.
+ (get_expr_operands): Handle opf_[not_]non_addressable.
+ Handle MEM_REF. Remove INDIRECT_REF handling.
+ * tree-vrp.c (check_array_ref): Handle MEM_REF.
+ (search_for_addr_array): Likewise.
+ (check_array_bounds): Likewise.
+ (vrp_stmt_computes_nonzero): Adjust for MEM_REF.
+ * tree-ssa-loop-im.c (for_each_index): Handle MEM_REF.
+ (ref_always_accessed_p): Likewise.
+ (gen_lsm_tmp_name): Likewise. Handle ADDR_EXPR.
+ * tree-complex.c (extract_component): Do not handle INDIRECT_REF.
+ Handle MEM_REF.
+ * cgraphbuild.c (mark_load): Properly check for NULL result
+ from get_base_address.
+ (mark_store): Likewise.
+ * tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF.
+ * tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF
+ handling for MEM_REF.
+ * tree-scalar-evolution.c (follow_ssa_edge_expr): Handle
+ &MEM[ptr + CST] similar to POINTER_PLUS_EXPR.
+ * builtins.c (stabilize_va_list_loc): Use the function ABI
+ valist type if we couldn't canonicalize the argument type.
+ Always dereference with the canonical va-list type.
+ (maybe_emit_free_warning): Handle MEM_REF.
+ (fold_builtin_memory_op): Simplify and handle MEM_REFs in folding
+ memmove to memcpy.
+ * builtins.c (fold_builtin_memory_op): Use ref-all types
+ for all memcpy foldings.
+ * omp-low.c (build_receiver_ref): Adjust for MEM_REF.
+ (build_outer_var_ref): Likewise.
+ (scan_omp_1_op): Likewise.
+ (lower_rec_input_clauses): Likewise.
+ (lower_lastprivate_clauses): Likewise.
+ (lower_reduction_clauses): Likewise.
+ (lower_copyprivate_clauses): Likewise.
+ (expand_omp_atomic_pipeline): Likewise.
+ (expand_omp_atomic_mutex): Likewise.
+ (create_task_copyfn): Likewise.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF.
+ Remove old union trick. Initialize constant offsets.
+ (ao_ref_init_from_vn_reference): Likewise. Do not handle
+ INDIRECT_REF. Init base_alias_set properly.
+ (vn_reference_lookup_3): Replace INDIRECT_REF handling with MEM_REF.
+ (vn_reference_fold_indirect): Adjust for MEM_REFs.
+ (valueize_refs): Fold MEM_REFs. Re-evaluate constant offset
+ for ARRAY_REFs.
+ (may_insert): Remove.
+ (visit_reference_op_load): Do not test may_insert.
+ (run_scc_vn): Remove parameter, do not fiddle with may_insert.
+ * tree-ssa-sccvn.h (struct vn_reference_op_struct): Add
+ a field to store the constant offset this op applies.
+ (run_scc_vn): Adjust prototype.
+ * cgraphunit.c (thunk_adjust): Adjust for MEM_REF.
+ * tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with
+ MEM_REF. Propagate &foo + CST as &MEM[&foo, CST]. Do not
+ bother about volatile qualifiers on pointers.
+ (fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF.
+ * tree-ssa-loop-ivopts.c
+ * tree-ssa-loop-ivopts.c (determine_base_object): Adjust for MEM_REF.
+ (strip_offset_1): Likewise.
+ (find_interesting_uses_address): Replace INDIRECT_REF handling with
+ MEM_REF handling.
+ (get_computation_cost_at): Likewise.
+ * ipa-pure-const.c (check_op): Handle MEM_REF.
+ * tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF.
+ * tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF
+ and constants.
+ * ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF.
+ * tree-parloops.c (take_address_of): Adjust for MEM_REF.
+ (eliminate_local_variables_1): Likewise.
+ (create_call_for_reduction_1): Likewise.
+ (create_loads_for_reductions): Likewise.
+ (create_loads_and_stores_for_name): Likewise.
+ * matrix-reorg.c (may_flatten_matrices_1): Sanitize.
+ (ssa_accessed_in_tree): Handle MEM_REF.
+ (ssa_accessed_in_assign_rhs): Likewise.
+ (update_type_size): Likewise.
+ (analyze_accesses_for_call_stmt): Likewise.
+ (analyze_accesses_for_assign_stmt): Likewise.
+ (transform_access_sites): Likewise.
+ (transform_allocation_sites): Likewise.
+ * tree-affine.c (tree_to_aff_combination): Handle MEM_REF.
+ * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do
+ not handle INDIRECT_REF.
+ * tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF.
+ (cond_store_replacement): Likewise.
+ * tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle
+ MEM_REF, no not handle INDIRECT_REFs.
+ (insert_into_preds_of_block): Properly initialize avail.
+ (phi_translate_1): Fold MEM_REFs. Re-evaluate constant offset
+ for ARRAY_REFs. Properly handle reference lookups that
+ require a bit re-interpretation.
+ (can_PRE_operation): Do not handle INDIRECT_REF. Handle MEM_REF.
+ * tree-sra.c (build_access_from_expr_1): Handle MEM_REF.
+ (build_ref_for_offset_1): Remove.
+ (build_ref_for_offset): Build MEM_REFs.
+ (gate_intra_sra): Disable for now.
+ (sra_ipa_modify_expr): Handle MEM_REF.
+ (ipa_early_sra_gate): Disable for now.
+ * tree-sra.c (create_access): Swap INDIRECT_REF handling for
+ MEM_REF handling.
+ (disqualify_base_of_expr): Likewise.
+ (ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for
+ MEM_REF handling.
+ (sra_ipa_modify_expr): Remove INDIRECT_REF handling.
+ Use mem_ref_offset. Remove bogus folding.
+ (build_access_from_expr_1): Properly handle MEM_REF for non IPA-SRA.
+ (make_fancy_name_1): Add support for MEM_REF.
+ * tree-predcom.c (ref_at_iteration): Handle MEM_REFs.
+ * tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF.
+ * ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF.
+ (compute_complex_ancestor_jump_func): Likewise.
+ (ipa_analyze_virtual_call_uses): Likewise.
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace
+ INDIRECT_REF folding with more generalized MEM_REF folding.
+ (tree_ssa_forward_propagate_single_use_vars): Adjust accordingly.
+ (forward_propagate_addr_into_variable_array_index): Also handle
+ &ARRAY + I in addition to &ARRAY[0] + I.
+ * tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF.
+ * tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that
+ creates assignments with overlap.
+ * tree-nested.c (get_static_chain): Adjust for MEM_REF.
+ (get_frame_field): Likewise.
+ (get_nonlocal_debug_decl): Likewise.
+ (convert_nonlocal_reference_op): Likewise.
+ (struct nesting_info): Add mem_refs pointer-set.
+ (create_nesting_tree): Allocate it.
+ (convert_local_reference_op): Insert to be folded mem-refs.
+ (fold_mem_refs): New function.
+ (finalize_nesting_tree_1): Perform defered folding of mem-refs
+ (free_nesting_tree): Free the pointer-set.
+ * tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF.
+ (vectorizable_load): Likewise.
+ * tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF.
+ (propagate_with_phi): Likewise.
+ * tree-object-size.c (addr_object_size): Handle MEM_REFs
+ instead of INDIRECT_REFs.
+ (compute_object_offset): Handle MEM_REF.
+ (plus_stmt_object_size): Handle MEM_REF.
+ (collect_object_sizes_for): Dispatch to plus_stmt_object_size
+ for &MEM_REF.
+ * tree-flow.h (get_addr_base_and_unit_offset): Declare.
+ (symbol_marked_for_renaming): Likewise.
+ * Makefile.in (tree-dfa.o): Add $(TOPLEV_H).
+ (fold-const.o): Add $(TREE_FLOW_H).
+ * tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF.
+ (find_func_clobbers): Likewise.
+ * ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF.
+ (decompose_access): Likewise.
+ (replace_field_acc): Likewise.
+ (replace_field_access_stmt): Likewise.
+ (insert_new_var_in_stmt): Likewise.
+ (get_stmt_accesses): Likewise.
+ (reorg_structs_drive): Disable.
+ * config/i386/i386.c (ix86_va_start): Adjust for MEM_REF.
+ (ix86_canonical_va_list_type): Likewise.
+
2010-06-30 Joern Rennecke <joern.rennecke@embecosm.com>
PR other/44566
@@ -105,8 +3881,7 @@
* toplev.h (_fatal_insn_not_found, _fatal_insn): Move declarations
to rtl.h.
(error_for_asm, warning_for_asm): Move declarations to rtl-error.h.
- * rtl.h (_fatal_insn_not_found, _fatal_insn): Move declarations
- here.
+ * rtl.h (_fatal_insn_not_found, _fatal_insn): Move declarations here.
* rtl-error.h: New.
* regrename.c: Do not include toplev.h. Include rtl-error.h.
* rtl-error.c: Likewise.
@@ -189,15 +3964,13 @@
(flags_needed_for_conditional): New function.
(flags_from_mode): New function.
(rx_compare_redundant): New function - scans backwards through
- insn list to find out if condition flags are already set
- correctly.
+ insn list to find out if condition flags are already set correctly.
(TARGET_CC_MODES_COMPATIBLE): Define.
* config/rx/rx-protos.h (rx_compare_redundant): Prototype.
* config/rx/rx.h (BRANCH_COST): Define.
(REGISTER_MOVE_COST): Define.
- * config/rx/predicates (rx_source_operand): Allow all constant
- types.
+ * config/rx/predicates (rx_source_operand): Allow all constant types.
* config/rx/rx.md (addsi3): Add alternative for swapped operands.
(tstsi4): New pattern.
* config/rx/rx.c (rx_memory_move_cost): Define.
@@ -387,8 +4160,8 @@
* predict.h (rebuild_frequencies): Declare.
* tree-inline.c (copy_cfg_body): Compute properly count & frequency of
entry block and edge reaching new_entry.
- (tree_function_versioning): When doing partial cloning, rebuild frequencies
- when done.
+ (tree_function_versioning): When doing partial cloning, rebuild
+ frequencies when done.
* passes.c (execute_function_todo): Use rebild_frequencies.
2010-06-29 Richard Guenther <rguenther@suse.de>
@@ -574,8 +4347,8 @@
2010-06-28 Jan Hubicka <jh@suse.cz>
PR tree-optimization/44357
- * ipa-inline.c (add_new_edges_to_heap): Do not add edges to uninlinable
- functions.
+ * ipa-inline.c (add_new_edges_to_heap): Do not add edges to
+ uninlinable functions.
2010-06-28 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
@@ -587,7 +4360,7 @@
* config/rs6000/rs6000.md (cpu): Add titan. Include "titan.md".
* config/rs6000/titan.md: New file.
* doc/invoke.texi (RS/6000 and PowerPC Options): Document -mcpu=titan.
-
+
2010-06-28 Nathan Froyd <froydnj@codesourcery.com>
* tree-browser.c (TB_history_stack): Convert to a VEC.
@@ -621,22 +4394,22 @@
2010-06-28 Bingfeng Mei <bmei@broadcom.com>
- * cgraph.h (struct varpool_node): new used_from_object_file flag.
- (struct cgraph_local_info): new used_from_object_file flag.
- * cgraph.c (dump_cgraph_node): dump used_from_object_file flag.
- (cgraph_clone_node): initialize used_from_object_file.
- (cgraph_create_virtual_clone): initialize used_from_object_file.
- * lto-symbtab.c (lto_symtab_merge_decls_1): Set
- used_from_object_file flags for symbols of LDPR_PREVAILING_DEF
- when compiling with -fwhole-program.
- (lto_symtab_resolve_symbols) Use LDPR_PREVAILING_DEF_IRONLY for
+ * cgraph.h (struct varpool_node): new used_from_object_file flag.
+ (struct cgraph_local_info): new used_from_object_file flag.
+ * cgraph.c (dump_cgraph_node): dump used_from_object_file flag.
+ (cgraph_clone_node): initialize used_from_object_file.
+ (cgraph_create_virtual_clone): initialize used_from_object_file.
+ * lto-symbtab.c (lto_symtab_merge_decls_1): Set
+ used_from_object_file flags for symbols of LDPR_PREVAILING_DEF
+ when compiling with -fwhole-program.
+ (lto_symtab_resolve_symbols) Use LDPR_PREVAILING_DEF_IRONLY for
internal resolver.
- * ipa.c (function_and_variable_visibility): Set externally_visible
- flag of varpool_node if used_from_object_file flag is set.
- (cgraph_externally_visible_p): check used_from_object_file flag.
- * doc/invoke.texi (-fwhole-program option): Change description of
- externally_visible attribute accordingly.
- * doc/extend.texi (externally_visible): Ditto.
+ * ipa.c (function_and_variable_visibility): Set externally_visible
+ flag of varpool_node if used_from_object_file flag is set.
+ (cgraph_externally_visible_p): check used_from_object_file flag.
+ * doc/invoke.texi (-fwhole-program option): Change description of
+ externally_visible attribute accordingly.
+ * doc/extend.texi (externally_visible): Ditto.
2010-06-27 Jan Hubicka <jh@suse.cz>
@@ -661,7 +4434,7 @@
* targhooks.h (default_register_move_cost): Declare function.
* defaults.h (REGISTER_MOVE_COST): Delete.
* ira-int.h (ira_register_move_cost): Update comment.
- * ira.c: (ira_register_move_cost): Update comment.
+ * ira.c (ira_register_move_cost): Update comment.
* reload.h (register_move_cost): Declare.
* reginfo.c (register_move_cost): New function.
(move_cost): Update comment.
@@ -748,8 +4521,7 @@
(visit_bb): Handle PHIs correctly.
* tree-inline.c (copy_phis_for_bb): Be able to copy
PHI from entry edge.
- (copy_cfg_body): Produce edge from entry BB before copying
- PHIs.
+ (copy_cfg_body): Produce edge from entry BB before copying PHIs.
2010-06-26 Richard Guenther <rguenther@suse.de>
@@ -952,8 +4724,7 @@
* config/pa/pa.h (MODIFY_TARGET_NAME): Remove.
* doc/tm.texi (MODIFY_TARGET_NAME): Don't document.
- * gcc.c (enum add_del, struct modify_target, modify_target):
- Remove.
+ * gcc.c (enum add_del, struct modify_target, modify_target): Remove.
(process_command): Remove code conditional on MODIFY_TARGET_NAME.
* system.h (MODIFY_TARGET_NAME): Poison.
@@ -1177,10 +4948,10 @@
2010-06-23 Basile Starynkevitch <basile@starynkevitch.net>
- * coretypes.h: (gimple_seq_node_d, gimple_seq_node)
+ * coretypes.h (gimple_seq_node_d, gimple_seq_node)
(const_gimple_seq_node): Removed typedefs.
- * gimple.h: (gimple_seq_node_d, gimple_seq_node)
+ * gimple.h (gimple_seq_node_d, gimple_seq_node)
(const_gimple_seq_node): Added typedefs moved from coretypes.h.
2010-06-23 H.J. Lu <hongjiu.lu@intel.com>
@@ -1382,8 +5153,6 @@
(enable_warning_as_error): Likewise.
* diagnostic-core.h (DK_POP): Add after "real" diagnostics, for
use in the history chain.
- * c-family/c-pragma.c (handle_pragma_diagnostic): Add push/pop,
- allow these pragmas anywhere.
* doc/extend.texi: Document pragma GCC diagnostic changes.
2010-06-21 Jakub Jelinek <jakub@redhat.com>
@@ -2118,10 +5887,6 @@
PR bootstrap/44509
* c-config-lang.in (gtfiles): Add c-family/c-cppbuiltin.c.
- * c-family/c-cppbuiltin.c: Include gt-c-family-c-cppbuiltin.h.
- (lazy_hex_fp_values, lazy_hex_fp_value_count): Add GTY(()) markers.
- (lazy_hex_fp_value, builtin_define_with_hex_fp_value): Use
- ggc_strdup instead of xstrdup.
2010-06-14 Ira Rosen <irar@il.ibm.com>
@@ -2313,10 +6078,6 @@
2010-06-10 Jakub Jelinek <jakub@redhat.com>
- * c-family/c-cppbuiltin.c: Include cpp-id-data.h.
- (lazy_hex_fp_values, lazy_hex_fp_value_count): New variables.
- (lazy_hex_fp_value): New function.
- (builtin_define_with_hex_fp_value): Provide definitions lazily.
* Makefile.in (c-family/c-cppbuiltin.o): Depend on $(CPP_ID_DATA_H).
2010-06-11 Sebastian Pop <sebastian.pop@amd.com>
@@ -3879,7 +7640,7 @@
* reginfo.c (memory_move_cost): New function.
(memory_move_secondary_cost): Change type of 'in' argument to bool.
* ira.h (ira_memory_move_cost): Update comment.
- * ira.c: (ira_memory_move_cost): Update comment.
+ * ira.c (ira_memory_move_cost): Update comment.
(setup_class_subset_and_memory_move_costs): Replace MEMORY_MOVE_COST
with memory_move_cost.
* postreload.c (reload_cse_simplify_set): (Ditto.).
@@ -4659,7 +8420,7 @@
* sel-sched.c: Include emit-rtl.h.
* sel-sched-ir.c: Include emit-rtl.h.
* ira-build.c: Include emit-rtl.h.
- * emit-rtl.c: (first_insn, last_insn): Remove defines.
+ * emit-rtl.c (first_insn, last_insn): Remove defines.
(get_insns, set_first_insn, get_last_insn, set_last_insn, get_max_uid):
Move to emit-rtl.h.
(set_new_first_and_last_insn, get_last_insn_anywhere,
@@ -5567,7 +9328,7 @@
* sched-int.h: Likewise.
* sched-rgn.c: Likewise.
-2010-05-27 Jon Beniston <jon@beniston.com>
+2010-05-27 Jon Beniston <jon@beniston.com>
PR 43726
* config/lm32/lm32.h: Remove definition of
@@ -6020,7 +9781,7 @@
* Makefile.in (EXCEPT_H): Fix typo.
-2010-05-25 Vladimir Makarov <vmakarov@redhat.com>
+2010-05-25 Vladimir Makarov <vmakarov@redhat.com>
* ira-build.c (update_conflict_hard_reg_costs): New.
(ira_build): Call update_conflict_hard_reg_costs.
@@ -6616,7 +10377,7 @@
(*arm_return): New name for ARM return insn.
* config/arm/thumb2.md (*thumb2_return): New insn pattern.
-2010-05-19 Joel Sherrill <joel.sherrill@oarcorp.com>
+2010-05-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* config.gcc (sparc64-*-rtems*): New target.
@@ -6697,7 +10458,7 @@
goto_locus of outgoing edge, or gimple_location of any of the
labels differs.
-2009-09-14 Vladimir Makarov <vmakarov@redhat.com>
+2009-09-14 Vladimir Makarov <vmakarov@redhat.com>
* ira.c (ira_non_ordered_class_hard_regs): Define.
(setup_class_hard_regs): Initialize ira_non_ordered_class_hard_regs.
@@ -8237,7 +11998,7 @@
* doc/standards.texi (Standards): Link to unversioned
cxx0x_status.html page.
-2010-05-07 Iain Sandoe <iains@gcc.gnu.org>
+2010-05-07 Iain Sandoe <iains@gcc.gnu.org>
PR target/43708
* config/darwin-c.c (darwin_pragma_unused): Set DECL_READ_P
@@ -8262,7 +12023,7 @@
* tree-ssa-loop-prefetch.c (is_loop_prefetching_profitable): Dump
a diagnostic info when the insn-to-mem ratio is too small.
-2010-05-07 Richard Guenther <rguenther@suse.de>
+2010-05-07 Richard Guenther <rguenther@suse.de>
* gcc.c (LINK_COMMAND_SPEC): Provide a resolution file to
the linker plugin.
@@ -8752,7 +12513,7 @@
in a temporary instead of invoking the macro multiple times.
(track_expr_p): Likewise.
-2010-05-04 Neil Vachharajani <nvachhar@google.com>
+2010-05-04 Neil Vachharajani <nvachhar@google.com>
* doc/invoke.texi (-Wcoverage-mismatch): Updated documentation as
per new semantics.
@@ -8874,7 +12635,7 @@
* c.opt (-fstrict-enums): New.
* doc/invoke.texi (C++ Dialect Options): Document -fstrict-enums.
-2010-05-03 David Ung <davidu@mips.com>
+2010-05-03 David Ung <davidu@mips.com>
James E. Wilson <wilson@codesourcery.com>
* config/mips/mips.c (mips_output_division): If GENERATE_DIVIDE_TRAPS,
@@ -9248,7 +13009,7 @@
2010-04-29 Bernd Schmidt <bernds@codesourcery.com>
- From Dominique d'Humieres <dominiq@lps.ens.fr>
+ From Dominique d'Humieres <dominiq@lps.ens.fr>
PR bootstrap/43858
* ifcvt.c (dead_or_predicable): Use df_simulate_find_defs to compute
test_set.
@@ -9536,7 +13297,7 @@
* tree-inline.c (copy_bind_expr): Also copy bind expr vars value-exprs.
2010-04-27 Manuel López-Ibáñez <manu@gcc.gnu.org>
- Jan Hubicka <hubicka@ucw.cz>
+ Jan Hubicka <hubicka@ucw.cz>
* doc/invoke.texi (-Wsuggest-attribute=const,
-Wsuggest-attribute=pure): Document.
@@ -9698,7 +13459,7 @@
bits for artificial defs at the top of the block.
* fwprop.c (single_def_use_enter_block): Don't call it.
-2010-04-26 Jack Howarth <howarth@bromo.med.uc.edu>
+2010-04-26 Jack Howarth <howarth@bromo.med.uc.edu>
PR 43715
* gcc/configure.ac: Use "$gcc_cv_nm -g" on darwin
@@ -12245,11 +16006,11 @@
* Makefile.in ($(out_object_file)): Depend on
gt-$(basename $(notdir $(out_file))).h.
-2010-04-01 Ralf Corsépius <ralf.corsepius@rtems.org>
+2010-04-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* config.gcc (lm32-*-rtems*): Add t-lm32.
-2010-04-01 Joel Sherrill <joel.sherrill@oarcorp.com>
+2010-04-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* config.gcc: Add lm32-*-rtems*.
* config/lm32/rtems.h: New file.
@@ -12304,8 +16065,8 @@
PR middle-end/43602
Revert
- 2010-03-30 Seongbae Park <seongbae.park@gmail.com>
- Jack Howarth <howarth@bromo.med.uc.edu>
+ 2010-03-30 Seongbae Park <seongbae.park@gmail.com>
+ Jack Howarth <howarth@bromo.med.uc.edu>
* tree-profile.c (tree_init_ic_make_global_vars): Make static
variables TLS.
@@ -12595,8 +16356,8 @@
* config/s390/s390.c (s390_emit_prologue): Omit issuing a dynamic
stack check if the mask would be zero.
-2010-03-30 Seongbae Park <seongbae.park@gmail.com>
- Jack Howarth <howarth@bromo.med.uc.edu>
+2010-03-30 Seongbae Park <seongbae.park@gmail.com>
+ Jack Howarth <howarth@bromo.med.uc.edu>
* tree-profile.c (tree_init_ic_make_global_vars): Make static
variables TLS.
@@ -12939,7 +16700,7 @@
instead of callq.
2010-03-22 Janis Johnson <janis187@us.ibm.com>
- Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* doc/sourcebuild.texi (Test Directives): Split into six
subsections, with most of the current text in new subsections
@@ -13094,8 +16855,8 @@
(sparc_file_end): Emit a hidden comdat symbol for the PIC
thunk if possible. Output CFI information as needed.
-2010-03-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
- Jack Howarth <howarth@bromo.med.uc.edu>
+2010-03-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ Jack Howarth <howarth@bromo.med.uc.edu>
PR target/36399
* config/i386/i386.h: Fix ABI on darwin x86-32.
@@ -13238,7 +16999,7 @@
* graphite-sese-to-poly.c (split_reduction_stmt): Skip debug
statements before splitting block.
-2010-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+2010-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* doc/sourcebuild.texi (Testsuites): Fix markup.
Use pathnames relative to gcc/testsuite.
@@ -13850,7 +17611,7 @@
* tree-vect-loop.c (vect_transform_loop): Kill out-of-loop debug
uses of relevant DEFs that are dead outside the loop too.
-2010-03-06 Alexandre Oliva <aoliva@redhat.com>
+2010-03-06 Alexandre Oliva <aoliva@redhat.com>
* var-tracking.c (dataflow_set_merge): Swap src and src2.
Reverted:
@@ -14632,7 +18393,7 @@
* config/spu/spu-c.c (spu_resolve_overloaded_builtin): Call
lang_hooks.types_compatible_p instead of comptypes.
-2010-02-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
+2010-02-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config/arm/lib1funcs.asm (__prefer_thumb__): New define.
(udivsi3, aeabi_uidivmod, divsi3, aeabi_idivmod): Use Thumb-1 variant
@@ -14731,8 +18492,8 @@
flag_var_tracking_assignments.
* Makefile.in (var-tracking.o): Adjust dependencies.
-2010-02-16 Jack Howarth <howarth@bromo.med.uc.edu>
- Jakub Jelinek <jakub@redhat.com>
+2010-02-16 Jack Howarth <howarth@bromo.med.uc.edu>
+ Jakub Jelinek <jakub@redhat.com>
PR target/42854
* config/darwin.h (ASM_WEAKEN_DECL): Don't check weak attribute
@@ -14831,7 +18592,7 @@
2010-02-12 Dave Korn <dave.korn.cygwin@gmail.com>
Jack Howarth <howarth@bromo.med.uc.edu>
- Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+ Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
PR target/42982
Partial revert of unintended change in fix for PR41605.
@@ -16254,7 +20015,7 @@
(maybe_tidy_empty_bb): Delete prototype.
(purge_empty_blocks): Declare.
-2010-01-14 Andrey Belevantsev <abel@ispras.ru>
+2010-01-14 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/42249
* sel-sched.c (try_replace_dest_reg): When chosen register
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 61f7b0dc386..f9329d51ca4 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20100630
+20100723
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a4214cb87df..d66b905633e 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -366,6 +366,9 @@ USER_H = $(srcdir)/ginclude/float.h \
$(srcdir)/ginclude/stdfix.h \
$(EXTRA_HEADERS)
+USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
+USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
+
UNWIND_H = $(srcdir)/unwind-generic.h
# The GCC to use for compiling crt*.o.
@@ -969,6 +972,7 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h $(CONFIG_H) $(SYSTEM_H) \
$(HASHTAB_H)
PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
PLUGIN_VERSION_H = plugin-version.h configargs.h
+LIBFUNCS_H = libfuncs.h $(HASHTAB_H)
#
# Now figure out from those variables how to compile and link.
@@ -1337,6 +1341,7 @@ OBJS-common = \
stor-layout.o \
store-motion.o \
stringpool.o \
+ target-globals.o \
targhooks.o \
timevar.o \
toplev.o \
@@ -1999,11 +2004,12 @@ c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
c-decl.o : c-decl.c c-lang.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) \
- output.h debug.h $(TOPLEV_H) intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \
- opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \
- $(EXCEPT_H) $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \
- $(DIAGNOSTIC_CORE_H) $(INPUT_H) langhooks.h tree-mudflap.h \
- pointer-set.h tree-iterator.h $(PLUGIN_H) c-family/c-ada-spec.h
+ output.h debug.h $(TOPLEV_H) intl.h $(TM_P_H) $(TREE_INLINE_H) \
+ $(TIMEVAR_H) opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) \
+ $(HASHTAB_H) $(LIBFUNCS_H) $(EXCEPT_H) $(LANGHOOKS_DEF_H) \
+ $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) $(DIAGNOSTIC_CORE_H) \
+ $(INPUT_H) langhooks.h tree-mudflap.h pointer-set.h tree-iterator.h \
+ $(PLUGIN_H) c-family/c-ada-spec.h
c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(FLAGS_H) $(DIAGNOSTIC_H) $(TM_P_H)
@@ -2032,7 +2038,7 @@ c-typeck.o : c-typeck.c c-lang.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
-graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(FLAGS_H) output.h \
+graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) output.h \
$(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) \
$(CONFIG_H) $(EMIT_RTL_H)
@@ -2072,12 +2078,12 @@ lto-wrapper.o: lto-wrapper.c $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h \
c-family/c-common.o : c-family/c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) \
$(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) $(TOPLEV_H) output.h $(C_PRAGMA_H) \
- $(GGC_H) $(EXPR_H) builtin-types.def builtin-attrs.def \
- $(DIAGNOSTIC_H) langhooks.h $(RTL_H) \
+ $(GGC_H) builtin-types.def builtin-attrs.def \
+ $(DIAGNOSTIC_H) langhooks.h \
$(TARGET_H) tree-iterator.h langhooks.h tree-mudflap.h \
intl.h opts.h $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \
$(BUILTINS_DEF) $(CGRAPH_H) $(BASIC_BLOCK_H) $(TARGET_DEF_H) \
- libfuncs.h \
+ $(LIBFUNCS_H) \
gt-c-family-c-common.h
c-family/c-cppbuiltin.o : c-family/c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) \
@@ -2154,7 +2160,7 @@ c-family/stub-objc.o : c-family/stub-objc.c $(CONFIG_H) $(SYSTEM_H) \
# Files used by all variants of C and some other languages.
attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FLAGS_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \
+ $(FLAGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h $(GGC_H) $(TM_P_H) \
$(TARGET_H) langhooks.h $(CPPLIB_H) $(PLUGIN_H)
incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
@@ -2247,20 +2253,21 @@ gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(HASHTAB_H) $(SPLAY_TREE_H) $(OBSTACK_H) $(BITMAP_H) \
$(INPUT_H) $(TREE_H) $(RTL_H) $(FUNCTION_H) insn-config.h $(EXPR_H) \
hard-reg-set.h $(BASIC_BLOCK_H) cselib.h $(INSN_ADDR_H) $(OPTABS_H) \
- libfuncs.h debug.h $(GGC_H) $(CGRAPH_H) $(TREE_FLOW_H) reload.h \
+ $(LIBFUNCS_H) debug.h $(GGC_H) $(CGRAPH_H) $(TREE_FLOW_H) reload.h \
$(CPP_ID_DATA_H) tree-chrec.h $(CFGLAYOUT_H) $(EXCEPT_H) output.h \
- $(CFGLOOP_H) $(TARGET_H)
+ $(CFGLOOP_H) $(TARGET_H) $(IPA_PROP_H) $(LTO_STREAMER_H) \
+ target-globals.h
ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(GGC_H) $(HASHTAB_H) $(TOPLEV_H) $(PARAMS_H) hosthooks.h \
+ $(GGC_H) $(HASHTAB_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(PARAMS_H) hosthooks.h \
$(HOSTHOOKS_DEF_H) $(VEC_H) $(PLUGIN_H) $(GGC_INTERNAL_H) $(TIMEVAR_H)
ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
- $(FLAGS_H) $(TOPLEV_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) \
+ $(FLAGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) \
$(TREE_FLOW_H) $(PLUGIN_H) $(GGC_INTERNAL_H)
ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(FLAGS_H) $(TOPLEV_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \
+ $(TREE_H) $(FLAGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \
$(PARAMS_H) $(BITMAP_H) $(PLUGIN_H) $(GGC_INTERNAL_H)
ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \
@@ -2270,38 +2277,38 @@ stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(GGC_H) $(GGC_INTERNAL_H) gt-stringpool.h $(CPPLIB_H) $(SYMTAB_H)
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FLAGS_H) convert.h $(TOPLEV_H) langhooks.h
+ $(FLAGS_H) convert.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) langhooks.h
double-int.o: double-int.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
# lto-compress.o needs $(ZLIBINC) added to the include flags.
lto-compress.o: lto-compress.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_H) langhooks.h $(LTO_HEADER_H) $(LTO_SECTION_H) \
- lto-compress.h $(DIAGNOSTIC_CORE_H) $(TOPLEV_H)
+ lto-compress.h $(DIAGNOSTIC_CORE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(ZLIBINC) $< $(OUTPUT_OPTION)
lto-cgraph.o: lto-cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
+ $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
$(HASHTAB_H) langhooks.h $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_CORE_H) \
$(EXCEPT_H) $(TIMEVAR_H) output.h pointer-set.h $(LTO_STREAMER_H) $(GCOV_IO_H)
lto-streamer-in.o: lto-streamer-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
+ $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
$(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) $(CGRAPH_H) \
- $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_H) libfuncs.h $(EXCEPT_H) debug.h \
+ $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_H) $(LIBFUNCS_H) $(EXCEPT_H) debug.h \
$(TIMEVAR_H) output.h $(IPA_UTILS_H) $(LTO_STREAMER_H) toplev.h
lto-streamer-out.o : lto-streamer-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
+ $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
$(HASHTAB_H) $(BASIC_BLOCK_H) tree-iterator.h \
$(TREE_FLOW_H) $(TREE_PASS_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) \
- $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(LTO_STREAMER_H) $(TOPLEV_H)
+ $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(LTO_STREAMER_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
lto-section-in.o: lto-section-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \
$(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) \
$(GGC_H) $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(TIMEVAR_H) output.h \
$(LTO_STREAMER_H) lto-compress.h
lto-section-out.o : lto-section-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(PARAMS_H) input.h \
+ $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_H) $(EXPR_H) $(PARAMS_H) input.h \
$(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) \
$(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(EXCEPT_H) pointer-set.h \
$(BITMAP_H) langhooks.h $(LTO_STREAMER_H) lto-compress.h
@@ -2310,17 +2317,17 @@ lto-symtab.o: lto-symtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(LTO_STREAMER_H) $(LINKER_PLUGIN_API_H) gt-lto-symtab.h
lto-opts.o: lto-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
$(HASHTAB_H) $(GGC_H) $(BITMAP_H) $(FLAGS_H) opts.h options.h \
- $(TARGET_H) $(TOPLEV_H) $(LTO_STREAMER_H)
+ $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(LTO_STREAMER_H)
lto-streamer.o: lto-streamer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(GIMPLE_H) $(BITMAP_H) $(LTO_STREAMER_H) $(FLAGS_H) \
- $(TREE_FLOW_H) $(DIAGNOSTIC_CORE_H) $(LTO_SYMTAB_H) $(TOPLEV_H)
+ $(TREE_FLOW_H) $(DIAGNOSTIC_CORE_H) $(LTO_SYMTAB_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(TOPLEV_H) $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
+ $(TREE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
langhooks.h $(TARGET_H) $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
intl.h $(GIMPLE_H) $(CGRAPH_H) output.h tree-diagnostic.h
tree.o: tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
all-tree.def $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \
- $(TOPLEV_H) $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) \
langhooks.h gt-tree.h $(TREE_INLINE_H) tree-iterator.h \
$(BASIC_BLOCK_H) $(TREE_FLOW_H) $(OBSTACK_H) pointer-set.h \
tree-pass.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) $(CGRAPH_H) $(TIMEVAR_H) \
@@ -2341,7 +2348,7 @@ print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H
stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) output.h $(RTL_H) \
$(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
- $(TOPLEV_H) $(CGRAPH_H) $(TREE_INLINE_H) $(TREE_DUMP_H) $(GIMPLE_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(CGRAPH_H) $(TREE_INLINE_H) $(TREE_DUMP_H) $(GIMPLE_H)
tree-ssa-structalias.o: tree-ssa-structalias.c \
$(SYSTEM_H) $(CONFIG_H) coretypes.h $(TM_H) $(GGC_H) $(OBSTACK_H) $(BITMAP_H) \
$(FLAGS_H) $(TM_P_H) $(BASIC_BLOCK_H) output.h \
@@ -2442,13 +2449,13 @@ tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_PASS_H)
tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
- gt-tree-phinodes.h $(RTL_H) $(TOPLEV_H) $(GIMPLE_H)
+ gt-tree-phinodes.h $(RTL_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GIMPLE_H)
domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) domwalk.h sbitmap.h
tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
$(TREE_SSA_LIVE_H) $(BITMAP_H) $(TOPLEV_H) debug.h $(FLAGS_H) \
- tree-pretty-print.h gimple-pretty-print.h
+ tree-pretty-print.h gimple-pretty-print.h $(GIMPLE_H)
tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) \
$(TREE_PASS_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) \
@@ -2483,7 +2490,7 @@ tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \
$(DIAGNOSTIC_H) $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) $(EXCEPT_H) langhooks.h $(CFGLOOP_H) $(TREE_PASS_H) \
- $(CFGLAYOUT_H) $(BASIC_BLOCK_H) $(HASHTAB_H) $(TOPLEV_H) \
+ $(CFGLAYOUT_H) $(BASIC_BLOCK_H) $(HASHTAB_H) \
tree-ssa-propagate.h $(SCEV_H)
tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(FUNCTION_H) $(TM_H) coretypes.h \
@@ -2510,7 +2517,7 @@ tree-dfa.o : tree-dfa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_INLINE_H) $(HASHTAB_H) pointer-set.h $(FLAGS_H) $(FUNCTION_H) \
$(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h $(TREE_DUMP_H) \
$(TREE_PASS_H) $(PARAMS_H) $(CGRAPH_H) $(BASIC_BLOCK_H) $(GIMPLE_H) \
- tree-pretty-print.h
+ tree-pretty-print.h $(TOPLEV_H)
tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
$(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) $(TREE_PASS_H) $(TOPLEV_H) \
@@ -2519,11 +2526,11 @@ tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_H) $(FLAGS_H) $(FUNCTION_H) $(EXCEPT_H) langhooks.h \
$(GGC_H) $(TREE_PASS_H) coretypes.h $(TIMEVAR_H) pointer-set.h \
- $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h $(TOPLEV_H)
+ $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
tree-ssa-loop.o : tree-ssa-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) output.h \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TREE_PASS_H) $(TIMEVAR_H) \
- $(CFGLOOP_H) $(FLAGS_H) $(TREE_INLINE_H) $(SCEV_H) $(TOPLEV_H) $(TREE_VECTORIZER_H)
+ $(CFGLOOP_H) $(FLAGS_H) $(TREE_INLINE_H) $(SCEV_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_VECTORIZER_H)
tree-ssa-loop-unswitch.o : tree-ssa-loop-unswitch.c $(TREE_FLOW_H) \
$(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
$(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
@@ -2538,7 +2545,7 @@ tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \
$(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- $(TOPLEV_H) $(FLAGS_H) $(TREE_PASS_H) $(TREE_DATA_REF_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(TREE_PASS_H) $(TREE_DATA_REF_H) \
$(BASIC_BLOCK_H) $(GGC_H) intl.h tree-pretty-print.h gimple-pretty-print.h
tree-ssa-loop-ivcanon.o : tree-ssa-loop-ivcanon.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \
@@ -2554,7 +2561,7 @@ tree-ssa-loop-prefetch.o: tree-ssa-loop-prefetch.c $(TREE_FLOW_H) $(CONFIG_H) \
output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
$(TREE_PASS_H) $(RECOG_H) insn-config.h $(HASHTAB_H) \
$(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) \
- $(TOPLEV_H) langhooks.h $(TREE_INLINE_H) $(TREE_DATA_REF_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) langhooks.h $(TREE_INLINE_H) $(TREE_DATA_REF_H) \
$(OPTABS_H) tree-pretty-print.h
tree-predcom.o: tree-predcom.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) \
$(CFGLOOP_H) $(TREE_FLOW_H) $(GGC_H) $(TREE_DATA_REF_H) \
@@ -2566,7 +2573,7 @@ tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \
$(TREE_PASS_H) $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \
$(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) \
tree-affine.h pointer-set.h $(TARGET_H) tree-pretty-print.h \
- gimple-pretty-print.h
+ gimple-pretty-print.h tree-ssa-propagate.h
tree-affine.o : tree-affine.c tree-affine.h $(CONFIG_H) pointer-set.h \
$(SYSTEM_H) $(TREE_H) $(GIMPLE_H) \
output.h $(DIAGNOSTIC_H) coretypes.h $(TREE_DUMP_H) $(FLAGS_H) \
@@ -2592,7 +2599,7 @@ tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_DUMP_H) $(TREE_PASS_H) $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(GIMPLE_H) $(VEC_H) \
$(IPA_TYPE_ESCAPE_H) vecprim.h pointer-set.h alloc-pool.h \
- tree-pretty-print.h
+ tree-pretty-print.h $(TOPLEV_H)
tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_PASS_H) $(FLAGS_H) \
@@ -2602,7 +2609,7 @@ tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(GGC_H) output.h \
$(DIAGNOSTIC_H) $(BASIC_BLOCK_H) $(FLAGS_H) $(TIMEVAR_H) $(TM_H) \
- coretypes.h $(TREE_DUMP_H) $(TOPLEV_H) $(FUNCTION_H) langhooks.h \
+ coretypes.h $(TREE_DUMP_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FUNCTION_H) langhooks.h \
$(FLAGS_H) $(CGRAPH_H) $(PLUGIN_H) \
$(TREE_INLINE_H) tree-mudflap.h $(GGC_H) graph.h $(CGRAPH_H) \
$(TREE_PASS_H) $(CFGLOOP_H) $(EXCEPT_H) $(REGSET_H)
@@ -2611,7 +2618,7 @@ gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GIMPLE_H) \
$(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(EXCEPT_H) $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \
- $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) $(TOPLEV_H) $(OPTABS_H) \
+ $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(OPTABS_H) \
$(SPLAY_TREE_H) $(VEC_H) tree-iterator.h tree-pass.h tree-pretty-print.h
gimple-iterator.o : gimple-iterator.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_H) $(GIMPLE_H) $(TREE_FLOW_H) value-prof.h
@@ -2624,10 +2631,10 @@ gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(EXCEPT_H) $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) $(TREE_PASS_H) \
- $(HASHTAB_H) $(TOPLEV_H) tree-iterator.h
+ $(HASHTAB_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) tree-iterator.h
omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_CORE_H) \
- $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(TOPLEV_H) \
+ $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_PASS_H) $(GGC_H) $(EXCEPT_H) $(SPLAY_TREE_H) $(OPTABS_H) \
$(CFGLOOP_H) tree-iterator.h gt-omp-low.h
tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \
@@ -2649,12 +2656,12 @@ tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_DATA_REF_H) $(TREE_PASS_H) langhooks.h tree-pretty-print.h \
gimple-pretty-print.h
sese.o: sese.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
+ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) tree-chrec.h \
$(TREE_DATA_REF_H) tree-scalar-evolution.h tree-pass.h domwalk.h value-prof.h \
pointer-set.h $(GIMPLE_H) sese.h tree-pretty-print.h
graphite.o: graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
+ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(PREDICT_H) $(TREE_DATA_REF_H) tree-pass.h graphite.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h \
@@ -2663,12 +2670,12 @@ graphite.o: graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
graphite-blocking.o: graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) output.h $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
- $(TOPLEV_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(GIMPLE_H) $(TREE_DATA_REF_H) tree-pass.h domwalk.h value-prof.h \
graphite.h graphite-poly.h graphite-ppl.h
graphite-clast-to-gimple.o: graphite-clast-to-gimple.c $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) langhooks.h \
- $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
+ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h domwalk.h graphite.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h \
@@ -2677,17 +2684,17 @@ graphite-clast-to-gimple.o: graphite-clast-to-gimple.c $(CONFIG_H) \
graphite-dependences.o: graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
- $(TOPLEV_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(GIMPLE_H) $(TREE_DATA_REF_H) tree-pass.h domwalk.h \
graphite.h graphite-poly.h graphite-ppl.h graphite-dependences.h
graphite-interchange.o: graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) output.h $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
- $(TOPLEV_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(GIMPLE_H) $(TREE_DATA_REF_H) tree-pass.h domwalk.h value-prof.h \
graphite.h graphite-poly.h graphite-ppl.h
graphite-poly.o: graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
+ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h domwalk.h graphite.h graphite-dependences.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h output.h graphite-poly.h \
@@ -2695,14 +2702,14 @@ graphite-poly.o: graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
graphite-ppl.o: graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) graphite-ppl.h
graphite-scop-detection.o: graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \
- $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
+ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h domwalk.h graphite.h $(TM_H) \
value-prof.h graphite-ppl.h sese.h pointer-set.h coretypes.h \
graphite-scop-detection.h graphite-poly.h
graphite-sese-to-poly.o: graphite-sese-to-poly.c $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) \
- $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
+ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h domwalk.h graphite.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h \
@@ -2711,17 +2718,17 @@ graphite-sese-to-poly.o: graphite-sese-to-poly.c $(CONFIG_H) \
tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
$(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) $(EXPR_H) $(RECOG_H) $(OPTABS_H) \
- $(TOPLEV_H) $(SCEV_H) $(TREE_VECTORIZER_H) tree-pretty-print.h \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(SCEV_H) $(TREE_VECTORIZER_H) tree-pretty-print.h \
gimple-pretty-print.h $(TARGET_H)
tree-vect-loop-manip.o: tree-vect-loop-manip.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
- $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) $(EXPR_H) $(TOPLEV_H) \
+ $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) $(EXPR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(SCEV_H) $(TREE_VECTORIZER_H) langhooks.h tree-pretty-print.h \
gimple-pretty-print.h
tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(EXPR_H) $(OPTABS_H) $(PARAMS_H) \
- $(TREE_DATA_REF_H) $(TREE_VECTORIZER_H) $(RECOG_H) $(TOPLEV_H) \
+ $(TREE_DATA_REF_H) $(TREE_VECTORIZER_H) $(RECOG_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
gimple-pretty-print.h
tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
@@ -2731,12 +2738,12 @@ tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) \
tree-vect-stmts.o: tree-vect-stmts.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) \
- $(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TOPLEV_H) $(TREE_VECTORIZER_H) \
+ $(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_VECTORIZER_H) \
langhooks.h tree-pretty-print.h gimple-pretty-print.h
tree-vect-data-refs.o: tree-vect-data-refs.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \
- $(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) $(TOPLEV_H) \
+ $(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
tree-pretty-print.h gimple-pretty-print.h
tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
@@ -2760,11 +2767,11 @@ tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FUNCTION_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_PASS_H) \
tree-stdarg.h $(TARGET_H) langhooks.h gimple-pretty-print.h
tree-object-size.o: tree-object-size.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(TREE_H) $(TOPLEV_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
+ $(TM_H) $(TREE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
$(TREE_PASS_H) tree-ssa-propagate.h tree-pretty-print.h \
gimple-pretty-print.h
gimple.o : gimple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
- $(GGC_H) $(GIMPLE_H) $(TOPLEV_H) $(DIAGNOSTIC_H) gt-gimple.h \
+ $(GGC_H) $(GIMPLE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(DIAGNOSTIC_H) gt-gimple.h \
$(TREE_FLOW_H) value-prof.h $(FLAGS_H) $(DEMANGLE_H) \
$(TARGET_H) $(ALIAS_H)
gimple-pretty-print.o : gimple-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
@@ -2775,11 +2782,11 @@ tree-mudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \
$(GIMPLE_H) $(DIAGNOSTIC_H) $(DEMANGLE_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \
$(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_PASS_H) $(CGRAPH_H) $(GGC_H) \
gt-tree-mudflap.h $(BASIC_BLOCK_H) $(FLAGS_H) $(FUNCTION_H) \
- $(TM_P_H) $(TREE_FLOW_H) $(TOPLEV_H) $(GIMPLE_H) tree-iterator.h
+ $(TM_P_H) $(TREE_FLOW_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GIMPLE_H) tree-iterator.h
tree-nomudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \
$(C_TREE_H) $(C_COMMON_H) $(GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \
output.h langhooks.h tree-mudflap.h $(TM_H) coretypes.h \
- $(GGC_H) gt-tree-mudflap.h $(TREE_PASS_H) $(TOPLEV_H)
+ $(GGC_H) gt-tree-mudflap.h $(TREE_PASS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) $(TREE_FLOW_H) \
$(TM_H) coretypes.h tree-iterator.h $(SCEV_H) langhooks.h \
@@ -2787,20 +2794,20 @@ tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
tree-diagnostic.o : tree-diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_H) $(DIAGNOSTIC_H) tree-diagnostic.h langhooks.h $(LANGHOOKS_DEF_H)
fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(FLAGS_H) $(TOPLEV_H) $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
+ $(TREE_H) $(FLAGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
$(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h $(TARGET_H) \
- $(GIMPLE_H) realmpfr.h
+ $(GIMPLE_H) realmpfr.h $(TREE_FLOW_H)
diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
version.h $(INPUT_H) intl.h $(DIAGNOSTIC_H) diagnostic.def
-opts.o : opts.c opts.h options.h $(TOPLEV_H) $(CONFIG_H) $(SYSTEM_H) \
+opts.o : opts.c opts.h options.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(EXPR_H) $(RTL_H) \
output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \
$(FLAGS_H) $(PARAMS_H) $(TREE_PASS_H) $(DBGCNT_H) debug.h \
$(PLUGIN_H) $(EXCEPT_H) $(LTO_STREAMER_H) opts-diagnostic.h
-opts-common.o : opts-common.c opts.h $(CONFIG_H) $(SYSTEM_H) \
+opts-common.o : opts-common.c opts.h options.h $(CONFIG_H) $(SYSTEM_H) \
coretypes.h intl.h
targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
- $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
+ $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h \
$(OPTABS_H) $(RECOG_H) reload.h hard-reg-set.h
@@ -2842,9 +2849,9 @@ passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(PLUGIN_H)
plugin.o : plugin.c $(PLUGIN_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TOPLEV_H) $(TREE_H) $(TREE_PASS_H) intl.h $(PLUGIN_VERSION_H) $(GGC_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_H) $(TREE_PASS_H) intl.h $(PLUGIN_VERSION_H) $(GGC_H)
-main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H)
+main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
hosthooks.h $(HOSTHOOKS_DEF_H)
@@ -2854,25 +2861,25 @@ rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(CONFIG_H)
rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(GGC_H) $(BCONFIG_H) insn-notes.def reg-notes.def $(TOPLEV_H)
+ $(GGC_H) $(BCONFIG_H) insn-notes.def reg-notes.def $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(FLAGS_H) \
$(BCONFIG_H) $(DIAGNOSTIC_H) cselib.h $(TREE_PASS_H) tree-pretty-print.h
-rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) \
+rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) \
$(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) $(TREE_H) \
$(DF_H) $(EMIT_RTL_H)
varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \
- output.h $(TOPLEV_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
+ output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
$(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \
$(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h \
tree-iterator.h
function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(TREE_H) $(CFGLAYOUT_H) $(GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \
- $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
+ $(OPTABS_H) $(LIBFUNCS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
output.h $(EXCEPT_H) $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \
gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \
$(TREE_PASS_H) $(DF_H) $(TIMEVAR_H) vecprim.h
@@ -2880,20 +2887,21 @@ statistics.o : statistics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_PASS_H) $(TREE_DUMP_H) $(HASHTAB_H) statistics.h $(TM_H) $(FUNCTION_H)
stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) insn-config.h hard-reg-set.h $(EXPR_H) \
- libfuncs.h $(EXCEPT_H) $(RECOG_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \
- langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) $(GIMPLE_H) $(MACHMODE_H) \
- $(REGS_H) alloc-pool.h $(PRETTY_PRINT_H) $(BITMAP_H)
+ $(LIBFUNCS_H) $(EXCEPT_H) $(RECOG_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
+ output.h $(GGC_H) $(TM_P_H) langhooks.h $(PREDICT_H) $(OPTABS_H) \
+ $(TARGET_H) $(GIMPLE_H) $(MACHMODE_H) $(REGS_H) alloc-pool.h \
+ $(PRETTY_PRINT_H) $(BITMAP_H)
except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(FLAGS_H) $(EXCEPT_H) $(FUNCTION_H) $(EXPR_H) libfuncs.h \
+ $(TREE_H) $(FLAGS_H) $(EXCEPT_H) $(FUNCTION_H) $(EXPR_H) $(LIBFUNCS_H) \
langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
- dwarf2asm.h dwarf2out.h $(TOPLEV_H) $(HASHTAB_H) intl.h $(GGC_H) \
+ dwarf2asm.h dwarf2out.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(HASHTAB_H) intl.h $(GGC_H) \
gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) $(DWARF2_H) \
$(TARGET_H) $(TM_P_H) $(TREE_PASS_H) $(TIMEVAR_H) $(TREE_FLOW_H) \
tree-pretty-print.h sbitmap.h
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \
- libfuncs.h $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \
- typeclass.h hard-reg-set.h $(TOPLEV_H) hard-reg-set.h $(EXCEPT_H) \
+ $(LIBFUNCS_H) $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \
+ typeclass.h hard-reg-set.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) hard-reg-set.h $(EXCEPT_H) \
reload.h langhooks.h intl.h $(TM_P_H) $(TARGET_H) \
tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \
$(TREE_PASS_H) $(DF_H) $(DIAGNOSTIC_H) vecprim.h $(SSAEXPAND_H)
@@ -2903,82 +2911,84 @@ dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_
builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \
$(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \
- hard-reg-set.h $(TOPLEV_H) hard-reg-set.h $(EXCEPT_H) $(TM_P_H) $(PREDICT_H) \
- libfuncs.h langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h realmpfr.h \
- $(BUILTINS_DEF) $(MACHMODE_H) $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) \
- value-prof.h
+ hard-reg-set.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) hard-reg-set.h $(EXCEPT_H) \
+ $(TM_P_H) $(PREDICT_H) $(LIBFUNCS_H) langhooks.h $(BASIC_BLOCK_H) \
+ tree-mudflap.h realmpfr.h $(BUILTINS_DEF) $(MACHMODE_H) \
+ $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) value-prof.h
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \
- libfuncs.h $(REGS_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \
- $(CGRAPH_H) $(EXCEPT_H) sbitmap.h $(DBGCNT_H) $(TREE_FLOW_H)
+ $(LIBFUNCS_H) $(REGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h \
+ $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) $(CGRAPH_H) $(EXCEPT_H) sbitmap.h \
+ $(DBGCNT_H) $(TREE_FLOW_H)
expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
- $(TOPLEV_H) $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H) \
+ expmed.h
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
- $(TOPLEV_H) $(EXCEPT_H) $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
$(TARGET_H) output.h
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \
- $(RECOG_H) reload.h $(TOPLEV_H) $(GGC_H) $(TM_P_H) $(EXCEPT_H) \
- gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) $(FUNCTION_H)
+ $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(LIBFUNCS_H) \
+ $(RECOG_H) reload.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TM_P_H) \
+ $(EXCEPT_H) gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) $(FUNCTION_H)
dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) $(FUNCTION_H) \
langhooks.h insn-config.h reload.h $(GSTAB_H) xcoffout.h output.h dbxout.h \
- $(TOPLEV_H) $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h
debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \
$(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \
- output.h $(TOPLEV_H) $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \
+ output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \
gt-sdbout.h reload.h
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) version.h $(RTL_H) $(DWARF2_H) debug.h $(FLAGS_H) insn-config.h \
output.h $(DIAGNOSTIC_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \
- libfuncs.h $(TOPLEV_H) dwarf2out.h reload.h $(GGC_H) $(EXCEPT_H) dwarf2asm.h \
- $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \
- $(MD5_H) $(INPUT_H) $(FUNCTION_H) $(GIMPLE_H) $(TREE_PASS_H) \
- $(TREE_FLOW_H) tree-pretty-print.h
+ $(LIBFUNCS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) dwarf2out.h reload.h \
+ $(GGC_H) $(EXCEPT_H) dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) \
+ gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) $(MD5_H) $(INPUT_H) $(FUNCTION_H) \
+ $(GIMPLE_H) $(TREE_PASS_H) $(TREE_FLOW_H) tree-pretty-print.h
dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \
gt-dwarf2asm.h $(DWARF2_H) $(SPLAY_TREE_H) $(TARGET_H)
vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \
$(FLAGS_H) $(RTL_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H)
xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) $(TOPLEV_H) output.h dbxout.h \
+ $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h dbxout.h \
$(GGC_H) $(TARGET_H) debug.h $(GSTAB_H) xcoff.h
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) \
- $(GGC_H) $(EXPR_H) hard-reg-set.h $(BITMAP_H) $(TOPLEV_H) $(BASIC_BLOCK_H) \
+ $(GGC_H) $(EXPR_H) hard-reg-set.h $(BITMAP_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) \
$(HASHTAB_H) $(TM_P_H) debug.h langhooks.h $(TREE_PASS_H) gt-emit-rtl.h \
$(DF_H) $(PARAMS_H) $(TARGET_H)
real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(TOPLEV_H) $(TM_P_H) $(REAL_H) dfp.h realmpfr.h
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(REAL_H) dfp.h realmpfr.h
realmpfr.o : realmpfr.c realmpfr.h $(CONFIG_H) $(SYSTEM_H) $(REAL_H)
dfp.o : dfp.c dfp.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(TOPLEV_H) $(TM_P_H) $(REAL_H) $(DECNUM_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(REAL_H) $(DECNUM_H)
fixed-value.o: fixed-value.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(REAL_H) $(TOPLEV_H)
+ $(TREE_H) $(REAL_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h \
$(EXPR_H) $(REGS_H) intl.h $(FUNCTION_H) output.h $(RECOG_H) \
- $(EXCEPT_H) $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \
+ $(EXCEPT_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \
gt-integrate.h $(GGC_H) $(TREE_PASS_H) $(DF_H)
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) \
$(EXCEPT_H) $(FUNCTION_H) $(BASIC_BLOCK_H) $(TREE_PASS_H) \
- $(DIAGNOSTIC_CORE_H) $(TOPLEV_H) $(INSN_ATTR_H) $(TM_P_H) reload.h \
+ $(DIAGNOSTIC_CORE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(INSN_ATTR_H) $(TM_P_H) reload.h \
$(PREDICT_H) $(TIMEVAR_H) $(TARGET_H)
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(RECOG_H) $(EXPR_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) \
+ $(RECOG_H) $(EXPR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) \
$(TREE_H) $(TARGET_H)
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- langhooks.h $(TOPLEV_H) $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
+ langhooks.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \
$(TREE_INLINE_H) $(TREE_DUMP_H) $(TREE_FLOW_H) cif-code.def \
value-prof.h $(EXCEPT_H) $(IPA_UTILS_H) $(DIAGNOSTIC_CORE_H)
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) langhooks.h $(TREE_INLINE_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
+ $(TREE_H) langhooks.h $(TREE_INLINE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(GGC_H) \
$(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(GIMPLE_H) \
$(TREE_FLOW_H) $(TREE_PASS_H) debug.h $(DIAGNOSTIC_H) \
$(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) $(IPA_PROP_H) \
@@ -2992,11 +3002,11 @@ varpool.o : varpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TIMEVAR_H) debug.h $(TARGET_H) output.h $(GIMPLE_H) \
$(TREE_FLOW_H) gt-varpool.h
ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) \
- $(TREE_PASS_H) $(TIMEVAR_H) $(GIMPLE_H) $(GGC_H)
+ $(TREE_PASS_H) $(TIMEVAR_H) $(GIMPLE_H) $(GGC_H) pointer-set.h
ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TM_H) $(TREE_PASS_H) $(FLAGS_H) $(TREE_H) \
- $(TREE_INLINE_H) $(GIMPLE_H) $(GIMPLE_FOLD_H) $(TIMEVAR_H) \
+ $(TREE_INLINE_H) $(GIMPLE_H) $(TIMEVAR_H) \
tree-pretty-print.h gimple-pretty-print.h $(LTO_STREAMER_H)
ipa-ref.o : ipa-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(TREE_H) $(TARGET_H) \
@@ -3011,7 +3021,7 @@ ipa-split.o : ipa-split.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_INLINE_H) $(FIBHEAP_H) $(PARAMS_H)
matrix-reorg.o : matrix-reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(RTL_H) $(TREE_INLINE_H) $(TREE_FLOW_H) \
- tree-flow-inline.h langhooks.h $(HASHTAB_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
+ tree-flow-inline.h langhooks.h $(HASHTAB_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(GGC_H) \
debug.h $(TARGET_H) $(CGRAPH_H) $(DIAGNOSTIC_CORE_H) $(TIMEVAR_H) \
$(PARAMS_H) $(FIBHEAP_H) intl.h $(FUNCTION_H) $(BASIC_BLOCK_H) \
$(CFGLOOP_H) tree-iterator.h $(TREE_PASS_H) opts.h $(TREE_DATA_REF_H) \
@@ -3029,7 +3039,7 @@ ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(SPLAY_TREE_H) \
$(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) $(TREE_PASS_H) \
- $(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(LTO_STREAMER_H) $(TOPLEV_H)
+ $(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(LTO_STREAMER_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(TARGET_H) \
@@ -3043,7 +3053,7 @@ ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
$(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H) tree-pretty-print.h
ipa-struct-reorg.o: ipa-struct-reorg.c ipa-struct-reorg.h $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(GIMPLE_H) tree-inline.h \
- $(TREE_FLOW_H) langhooks.h pointer-set.h $(HASHTAB_H) $(TOPLEV_H) \
+ $(TREE_FLOW_H) langhooks.h pointer-set.h $(HASHTAB_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(FLAGS_H) debug.h $(TARGET_H) $(CGRAPH_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(PARAMS_H) $(FIBHEAP_H) intl.h $(FUNCTION_H) $(BASIC_BLOCK_H) tree-iterator.h \
$(TREE_PASS_H) opts.h $(IPA_TYPE_ESCAPE_H) $(TREE_DUMP_H) \
@@ -3051,16 +3061,16 @@ ipa-struct-reorg.o: ipa-struct-reorg.c ipa-struct-reorg.h $(CONFIG_H) $(SYSTEM_H
coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
- $(FUNCTION_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(GGC_H) langhooks.h $(COVERAGE_H) \
+ $(FUNCTION_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(GGC_H) langhooks.h $(COVERAGE_H) \
$(HASHTAB_H) tree-iterator.h $(CGRAPH_H) $(TREE_PASS_H) gcov-io.c $(TM_P_H) \
$(DIAGNOSTIC_CORE_H) intl.h gt-coverage.h
cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) \
- $(EMIT_RTL_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(TREE_PASS_H) \
+ $(EMIT_RTL_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h $(FUNCTION_H) $(TREE_PASS_H) \
cselib.h gt-cselib.h $(GGC_H) $(TM_P_H) $(PARAMS_H) alloc-pool.h \
$(HASHTAB_H) $(TARGET_H) $(BITMAP_H)
cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
- hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) $(TOPLEV_H) \
+ hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \
$(EXCEPT_H) $(TARGET_H) $(PARAMS_H) rtlhooks-def.h $(TREE_PASS_H) \
$(DF_H) $(DBGCNT_H)
@@ -3074,31 +3084,31 @@ dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_PASS_H) alloc-pool.h $(ALIAS_H) dse.h $(OPTABS_H) $(TARGET_H) \
$(BITMAP_H)
fwprop.o : fwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TOPLEV_H) insn-config.h $(RECOG_H) $(FLAGS_H) $(OBSTACK_H) $(BASIC_BLOCK_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) insn-config.h $(RECOG_H) $(FLAGS_H) $(OBSTACK_H) $(BASIC_BLOCK_H) \
output.h $(DF_H) alloc-pool.h $(TIMEVAR_H) $(TREE_PASS_H) $(TARGET_H) \
$(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) domwalk.h
web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
+ hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
insn-config.h $(RECOG_H) $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) $(TREE_PASS_H)
implicit-zee.o : implicit-zee.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h \
$(DF_H) $(TIMEVAR_H) tree-pass.h $(RECOG_H) $(EXPR_H) \
- $(REGS_H) $(TREE_H) $(TM_P_H) insn-config.h $(INSN_ATTR_H) $(TOPLEV_H) \
+ $(REGS_H) $(TREE_H) $(TM_P_H) insn-config.h $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TARGET_H) $(OPTABS_H) insn-codes.h rtlhooks-def.h $(PARAMS_H) $(CGRAPH_H)
gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(GGC_H) \
- $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
+ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TM_P_H) $(PARAMS_H) cselib.h $(EXCEPT_H) gt-gcse.h $(TREE_H) $(TIMEVAR_H) \
intl.h $(OBSTACK_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H) $(TARGET_H) \
- $(DF_H)
+ $(DF_H) gcse.h
store-motion.o : store-motion.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(GGC_H) \
- $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
+ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TM_P_H) $(EXCEPT_H) $(TREE_H) $(TIMEVAR_H) \
intl.h $(OBSTACK_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \
coretypes.h $(TM_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) $(DF_H) \
- $(FUNCTION_H) $(TOPLEV_H) $(INSN_ATTR_H) $(EXCEPT_H) $(PARAMS_H) $(TM_P_H)
+ $(FUNCTION_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(INSN_ATTR_H) $(EXCEPT_H) $(PARAMS_H) $(TM_P_H)
lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(RECOG_H) \
$(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) output.h sbitmap.h
@@ -3119,13 +3129,13 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h \
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) $(BASIC_BLOCK_H) $(TREE_PASS_H) langhooks.h \
- tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(TOPLEV_H) \
+ tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(DBGCNT_H) tree-pretty-print.h gimple-pretty-print.h
tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \
$(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) $(IPA_PROP_H) \
$(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) \
$(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h $(DBGCNT_H) \
- $(TREE_INLINE_H)
+ $(TREE_INLINE_H) gimple-pretty-print.h
tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
$(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \
@@ -3162,42 +3172,42 @@ var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h $(FLAGS_H) \
$(BASIC_BLOCK_H) output.h sbitmap.h alloc-pool.h $(FIBHEAP_H) $(HASHTAB_H) \
$(REGS_H) $(EXPR_H) $(TIMEVAR_H) $(TREE_PASS_H) $(TREE_FLOW_H) \
- cselib.h $(TARGET_H) $(TOPLEV_H) $(PARAMS_H) $(DIAGNOSTIC_H) pointer-set.h \
+ cselib.h $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(PARAMS_H) $(DIAGNOSTIC_H) pointer-set.h \
$(RECOG_H) tree-pretty-print.h
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) $(FUNCTION_H) $(BASIC_BLOCK_H) \
- $(TOPLEV_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \
$(CFGLOOP_H) $(TIMEVAR_H) $(TREE_PASS_H) profile.h
mcf.o : mcf.c profile.h $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h \
$(BASIC_BLOCK_H) output.h langhooks.h $(GCOV_IO_H) $(TREE_H)
tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(FLAGS_H) $(REGS_H) $(EXPR_H) $(FUNCTION_H) \
- $(BASIC_BLOCK_H) $(TOPLEV_H) $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \
+ $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \
$(TREE_PASS_H) $(TREE_FLOW_H) $(TIMEVAR_H) gt-tree-profile.h $(CGRAPH_H)
value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \
$(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
$(TREE_H) $(COVERAGE_H) $(RTL_H) $(GCOV_IO_H) $(TREE_FLOW_H) \
- tree-flow-inline.h $(TIMEVAR_H) $(TREE_PASS_H) $(TOPLEV_H) pointer-set.h \
+ tree-flow-inline.h $(TIMEVAR_H) $(TREE_PASS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) pointer-set.h \
tree-pretty-print.h gimple-pretty-print.h
loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) \
- $(TOPLEV_H) $(CFGLOOP_H) output.h $(PARAMS_H) $(TARGET_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(CFGLOOP_H) output.h $(PARAMS_H) $(TARGET_H)
alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H)
auto-inc-dec.o : auto-inc-dec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) insn-config.h \
- $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) $(EXCEPT_H) $(TOPLEV_H) $(RECOG_H) \
+ $(REGS_H) $(FLAGS_H) output.h $(FUNCTION_H) $(EXCEPT_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) \
$(EXPR_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H) $(TARGET_H)
cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \
- $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(FUNCTION_H) $(EXCEPT_H) $(GGC_H) \
+ $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FUNCTION_H) $(EXCEPT_H) $(GGC_H) \
$(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) alloc-pool.h \
$(HASHTAB_H) $(DF_H) $(CFGLOOP_H) $(TREE_FLOW_H) $(TREE_PASS_H)
cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TOPLEV_H) $(CFGLOOP_H)
+ $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(CFGLOOP_H)
cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) $(EXCEPT_H) langhooks.h $(TREE_PASS_H) $(RTL_H) \
- $(DIAGNOSTIC_H) $(TOPLEV_H) $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) \
+ $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) \
value-prof.h $(TREE_INLINE_H) $(TARGET_H) $(SSAEXPAND_H) \
tree-pretty-print.h gimple-pretty-print.h $(BITMAP_H) sbitmap.h $(INSN_ATTR_H)
cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
@@ -3208,18 +3218,18 @@ cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(TREE_PASS_H) $(DF_H) $(GGC_H)
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(TM_P_H) \
- $(TIMEVAR_H) $(OBSTACK_H) $(TOPLEV_H) vecprim.h sbitmap.h $(BITMAP_H)
+ $(TIMEVAR_H) $(OBSTACK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) vecprim.h sbitmap.h $(BITMAP_H)
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) \
+ $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(FUNCTION_H) $(EXCEPT_H) $(TIMEVAR_H) $(TREE_H) $(EXPR_H) sbitmap.h
cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \
- $(TOPLEV_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \
$(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) $(TREE_PASS_H) $(CFGLOOP_H) $(EXPR_H) \
$(DF_H) $(DBGCNT_H) dce.h
cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \
- $(OBSTACK_H) $(TOPLEV_H) $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \
+ $(OBSTACK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \
$(GGC_H)
cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \
@@ -3228,7 +3238,7 @@ graphds.o : graphds.c graphds.h $(CONFIG_H) $(SYSTEM_H) $(BITMAP_H) $(OBSTACK_H)
coretypes.h $(VEC_H) vecprim.h
loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) \
- output.h intl.h $(TOPLEV_H) $(DF_H) $(HASHTAB_H)
+ output.h intl.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(DF_H) $(HASHTAB_H)
loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) \
coretypes.h $(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) \
@@ -3248,28 +3258,28 @@ loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) \
$(OBSTACK_H)
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) $(TOPLEV_H) \
+ hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TIMEVAR_H) graphds.h vecprim.h pointer-set.h $(BITMAP_H)
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
et-forest.h alloc-pool.h $(BASIC_BLOCK_H)
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(FUNCTION_H) insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
rtlhooks-def.h $(BASIC_BLOCK_H) $(RECOG_H) hard-reg-set.h \
- $(TOPLEV_H) $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \
insn-codes.h $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H) vecprim.h $(CGRAPH_H)
reginfo.o : reginfo.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) addresses.h $(REGS_H) insn-config.h \
- $(RECOG_H) reload.h $(TOPLEV_H) $(FUNCTION_H) output.h $(GGC_H) \
- $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) gt-reginfo.h $(HASHTAB_H) \
+ hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) addresses.h $(REGS_H) \
+ insn-config.h $(RECOG_H) reload.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
+ $(FUNCTION_H) output.h $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) $(HASHTAB_H) \
$(TARGET_H) $(TREE_PASS_H) $(DF_H) ira.h
bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(GGC_H) gt-bitmap.h $(BITMAP_H) $(OBSTACK_H) $(HASHTAB_H)
vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(VEC_H) $(GGC_H) \
- $(TOPLEV_H) $(HASHTAB_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(HASHTAB_H)
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(FLAGS_H) output.h $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \
hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) real.h \
- addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(DF_H) ira.h
+ addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(DF_H) ira.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) $(TM_P_H) \
@@ -3280,28 +3290,28 @@ rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \
hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \
- $(FUNCTION_H) $(TOPLEV_H) cselib.h $(TM_P_H) $(EXCEPT_H) $(TREE_H) $(MACHMODE_H) \
- $(OBSTACK_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
+ $(FUNCTION_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) cselib.h $(TM_P_H) $(EXCEPT_H) $(TREE_H) $(MACHMODE_H) \
+ $(OBSTACK_H) $(TARGET_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) \
+ $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TM_P_H) $(EXCEPT_H) $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \
$(PARAMS_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DBGCNT_H)
caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(FUNCTION_H) \
- addresses.h $(RECOG_H) reload.h $(EXPR_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) \
+ addresses.h $(RECOG_H) reload.h $(EXPR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(DF_H) \
output.h gt-caller-save.h $(GGC_H)
bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(EXCEPT_H) \
$(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h $(EXPR_H) \
$(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) $(TREE_PASS_H) \
- $(TOPLEV_H) $(DF_H) vecprim.h $(RECOG_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(DF_H) vecprim.h $(RECOG_H)
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \
$(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \
- $(EXPR_H) $(TOPLEV_H) $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \
+ $(EXPR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \
$(TIMEVAR_H) $(TARGET_H) $(TREE_PASS_H)
alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) $(TOPLEV_H) output.h \
+ $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h \
$(ALIAS_H) $(EMIT_RTL_H) $(GGC_H) $(FUNCTION_H) cselib.h $(TREE_H) $(TM_P_H) \
langhooks.h $(TARGET_H) gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) \
$(SPLAY_TREE_H) $(IPA_TYPE_ESCAPE_H) $(DF_H) $(TREE_PASS_H) \
@@ -3314,19 +3324,19 @@ init-regs.o : init-regs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(BASIC_BLOCK_H) $(FLAGS_H) $(DF_H)
ira-build.o: ira-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
- insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) \
+ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) \
$(PARAMS_H) $(DF_H) sparseset.h $(IRA_INT_H) output.h reload.h
ira-costs.o: ira-costs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
hard-reg-set.h $(RTL_H) $(EXPR_H) $(TM_P_H) $(FLAGS_H) $(BASIC_BLOCK_H) \
- $(REGS_H) addresses.h insn-config.h $(RECOG_H) $(TOPLEV_H) $(TARGET_H) \
+ $(REGS_H) addresses.h insn-config.h $(RECOG_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TARGET_H) \
$(PARAMS_H) $(IRA_INT_H) reload.h
ira-conflicts.o: ira-conflicts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
- insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
+ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(PARAMS_H) \
$(DF_H) sparseset.h addresses.h $(IRA_INT_H)
ira-color.o: ira-color.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
- $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) reload.h $(PARAMS_H) \
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) reload.h $(PARAMS_H) \
$(DF_H) $(SPLAY_TREE_H) $(IRA_INT_H)
ira-emit.o: ira-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(REGS_H) $(RTL_H) $(TM_P_H) $(TARGET_H) $(FLAGS_H) hard-reg-set.h \
@@ -3334,48 +3344,48 @@ ira-emit.o: ira-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_PASS_H) output.h reload.h $(DF_H) $(IRA_INT_H)
ira-lives.o: ira-lives.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TARGET_H) $(RTL_H) $(REGS_H) $(EXCEPT_H) hard-reg-set.h $(FLAGS_H) \
- insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
+ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(PARAMS_H) \
$(DF_H) sparseset.h $(IRA_INT_H)
ira.o: ira.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(REGS_H) $(RTL_H) $(TM_P_H) $(TARGET_H) $(FLAGS_H) $(OBSTACK_H) \
$(BITMAP_H) hard-reg-set.h $(BASIC_BLOCK_H) \
$(EXPR_H) $(RECOG_H) $(PARAMS_H) $(TIMEVAR_H) $(TREE_PASS_H) output.h \
- $(EXCEPT_H) reload.h $(TOPLEV_H) $(INTEGRATE_H) $(DF_H) $(GGC_H) $(IRA_INT_H)
+ $(EXCEPT_H) reload.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(INTEGRATE_H) $(DF_H) $(GGC_H) $(IRA_INT_H)
regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H)\
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
- $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(EXCEPT_H) ira.h reload.h
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(EXCEPT_H) ira.h reload.h
combine-stack-adj.o : combine-stack-adj.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) insn-config.h $(TIMEVAR_H) $(TREE_PASS_H) \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
- $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) $(EXCEPT_H) reload.h
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(DF_H) $(EXCEPT_H) reload.h
ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \
- $(TOPLEV_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) \
$(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(BITMAP_H) \
hard-reg-set.h sbitmap.h $(TM_H)
modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TARGET_H) $(TOPLEV_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
+ coretypes.h $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) \
$(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(PARAMS_H) \
cfghooks.h $(GCOV_IO_H) hard-reg-set.h $(TM_H) $(TIMEVAR_H) $(TREE_PASS_H) \
$(DF_H) $(DBGCNT_H)
haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \
- $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) $(TARGET_H) output.h \
+ $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) $(TARGET_H) output.h \
$(PARAMS_H) $(DBGCNT_H) $(CFGLOOP_H) ira.h $(EMIT_RTL_H)
sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) cselib.h \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) cselib.h \
ira.h $(PARAMS_H) $(TM_P_H) ira.h $(TARGET_H)
sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
$(TM_P_H) sel-sched.h $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) $(TREE_PASS_H) \
$(DBGCNT_H)
sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) \
$(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) output.h
sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) \
@@ -3388,20 +3398,20 @@ sel-sched.o : sel-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H) sel-sched.h $(DBGCNT_H) $(EMIT_RTL_H)
sel-sched-dump.o : sel-sched-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
$(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) $(TREE_PASS_H) \
$(SEL_SCHED_DUMP_H) $(GGC_H) $(TREE_H) $(LANGHOOKS_DEF_H) $(SEL_SCHED_IR_H) \
output.h $(BASIC_BLOCK_H) cselib.h
sel-sched-ir.o : sel-sched-ir.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
- $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
+ $(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
$(TM_P_H) $(TARGET_H) $(TIMEVAR_H) $(TREE_PASS_H) $(SCHED_INT_H) $(GGC_H) \
$(TREE_H) langhooks.h rtlhooks-def.h $(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H) \
$(EMIT_RTL_H)
final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \
insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \
- $(EXCEPT_H) debug.h xcoffout.h $(TOPLEV_H) reload.h dwarf2out.h \
+ $(EXCEPT_H) debug.h xcoffout.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) reload.h dwarf2out.h \
$(TREE_PASS_H) $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) \
$(CFGLAYOUT_H) dbxout.h $(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) \
$(DF_H) vecprim.h $(GGC_H) $(CFGLOOP_H) $(PARAMS_H) $(TREE_FLOW_H)
@@ -3409,7 +3419,7 @@ recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) output.h reload.h \
addresses.h $(TM_P_H) $(TIMEVAR_H) $(TREE_PASS_H) hard-reg-set.h \
- $(DF_H) $(DBGCNT_H) $(TARGET_H)
+ $(DF_H) $(DBGCNT_H) $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_ERROR_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
insn-config.h reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \
@@ -3418,16 +3428,17 @@ reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \
- hard-reg-set.h output.h $(TOPLEV_H) $(RECOG_H) $(FUNCTION_H) $(EXCEPT_H) \
+ hard-reg-set.h output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(FUNCTION_H) $(EXCEPT_H) \
$(TM_P_H) $(PREDICT_H) sreal.h $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) \
$(COVERAGE_H) $(SCEV_H) $(GGC_H) predict.def $(TIMEVAR_H) $(TREE_DUMP_H) \
$(TREE_FLOW_H) $(TREE_PASS_H) $(EXPR_H) pointer-set.h
-lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) \
+lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(RTL_H) $(GGC_H) gt-lists.h
bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(TIMEVAR_H) output.h $(CFGLAYOUT_H) $(FIBHEAP_H) \
$(TARGET_H) $(FUNCTION_H) $(TM_P_H) $(OBSTACK_H) $(EXPR_H) $(REGS_H) \
- $(PARAMS_H) $(TOPLEV_H) $(TREE_PASS_H) $(DF_H)
+ $(PARAMS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TREE_PASS_H) $(DF_H) \
+ bb-reorder.h
tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) \
$(FLAGS_H) $(TIMEVAR_H) $(PARAMS_H) $(COVERAGE_H) $(FIBHEAP_H) \
@@ -3438,17 +3449,17 @@ cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) $(TREE_PASS_H) vecprim.h \
$(DF_H) $(EMIT_RTL_H)
timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TIMEVAR_H) $(FLAGS_H) intl.h $(TOPLEV_H) $(RTL_H) timevar.def
+ $(TIMEVAR_H) $(FLAGS_H) intl.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RTL_H) timevar.def
regcprop.o : regcprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \
output.h $(RECOG_H) $(FUNCTION_H) $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) \
- addresses.h reload.h $(TOPLEV_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H)
+ addresses.h reload.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H)
regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_ERROR_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \
output.h $(RECOG_H) $(FUNCTION_H) $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) \
addresses.h reload.h $(TIMEVAR_H) $(TREE_PASS_H) $(DF_H)
ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(REGS_H) $(TOPLEV_H) $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \
+ $(REGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \
$(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h $(EXCEPT_H) $(TM_P_H) \
$(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) \
$(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
@@ -3462,24 +3473,28 @@ lambda-code.o: lambda-code.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
$(CFGLOOP_H) $(TREE_DATA_REF_H) $(EXPR_H) coretypes.h $(TARGET_H) \
$(TREE_PASS_H) $(VEC_H) vecprim.h $(OBSTACK_H) pointer-set.h
params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) \
- $(TOPLEV_H)
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H)
hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H)
errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(BCONFIG_H)
-dbgcnt.o: dbgcnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TOPLEV_H) $(DBGCNT_H) \
+dbgcnt.o: dbgcnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(DBGCNT_H) \
$(TM_H) $(RTL_H) output.h
lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(MACHMODE_H) $(TM_H) $(RTL_H) $(TM_P_H) $(TIMEVAR_H) $(FLAGS_H) \
insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) $(OBSTACK_H) $(BITMAP_H) \
$(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H)
+target-globals.o : target-globals.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) insn-config.h $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h \
+ $(FLAGS_H) $(REGS_H) $(RTL_H) reload.h expmed.h $(EXPR_H) $(OPTABS_H) \
+ $(LIBFUNCS_H) $(CFGLOOP_H) $(IRA_INT_H) builtins.h gcse.h bb-reorder.h
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
- output.h $(INSN_ATTR_H) $(SYSTEM_H) $(TOPLEV_H) $(TARGET_H) libfuncs.h \
- $(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \
- langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h $(GIMPLE_H) $(DF_H) \
- cselib.h
+ output.h $(INSN_ATTR_H) $(SYSTEM_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
+ $(TARGET_H) $(LIBFUNCS_H) $(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) \
+ $(TM_P_H) $(EXPR_H) langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) \
+ tm-constrs.h $(GIMPLE_H) $(DF_H) cselib.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
$(out_file) $(OUTPUT_OPTION)
@@ -3533,18 +3548,18 @@ s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext)
# Header dependencies for generated source files.
insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) output.h $(INSN_ATTR_H) \
- insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H)
+ insn-config.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H)
insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) output.h $(INSN_ATTR_H) \
- insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H) $(EMIT_RTL_H)
+ insn-config.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H) $(EMIT_RTL_H)
insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TM_P_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) \
dfp.h $(FLAGS_H) output.h insn-config.h hard-reg-set.h $(RECOG_H) \
- $(RESOURCE_H) reload.h $(TOPLEV_H) $(REGS_H) tm-constrs.h $(GGC_H) \
+ $(RESOURCE_H) reload.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(REGS_H) tm-constrs.h $(GGC_H) \
$(BASIC_BLOCK_H) $(INTEGRATE_H)
-insn-enums.o : insn-enums.c $(CONFIG_H) $(SYSTEM_H)
+insn-enums.o : insn-enums.c $(CONFIG_H) $(SYSTEM_H) insn-constants.h
insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TM_H) $(RTL_H) $(TOPLEV_H) insn-config.h $(RECOG_H)
+ $(TM_H) $(RTL_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) insn-config.h $(RECOG_H)
insn-modes.o : insn-modes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(MACHMODE_H)
insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -3553,18 +3568,18 @@ insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(GGC_H) $(REGS_H) conditions.h \
hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h \
- $(RECOG_H) $(FUNCTION_H) $(TOPLEV_H) $(FLAGS_H) insn-codes.h $(TM_P_H)\
+ $(RECOG_H) $(FUNCTION_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) insn-codes.h $(TM_P_H)\
$(TARGET_H) tm-constrs.h
insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
insn-config.h $(RTL_H) $(TM_P_H) $(REGS_H) output.h \
- $(RECOG_H) $(EXCEPT_H) $(FUNCTION_H) $(TOPLEV_H) $(FLAGS_H) tm-constrs.h
+ $(RECOG_H) $(EXCEPT_H) $(FUNCTION_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(FLAGS_H) tm-constrs.h
insn-preds.o : insn-preds.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) insn-config.h $(RECOG_H) output.h \
$(FLAGS_H) $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) \
- $(TOPLEV_H) reload.h $(REGS_H) tm-constrs.h
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) reload.h $(REGS_H) tm-constrs.h
insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) insn-config.h $(RECOG_H) output.h $(FLAGS_H) \
- $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) $(TOPLEV_H) \
+ $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
reload.h $(REGS_H) tm-constrs.h
# For each of the files generated by running a generator program over
@@ -3725,7 +3740,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/expr.h \
$(srcdir)/function.c $(srcdir)/except.c \
$(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
- $(srcdir)/profile.c $(srcdir)/reginfo.c $(srcdir)/mcf.c \
+ $(srcdir)/profile.c $(srcdir)/mcf.c \
$(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/cfglayout.h \
$(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
@@ -3750,6 +3765,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-ssa-alias.h \
$(srcdir)/ipa-prop.h \
$(srcdir)/lto-streamer.h \
+ $(srcdir)/target-globals.h \
@all_gtfiles@
# Compute the list of GT header files from the corresponding C sources,
@@ -3821,11 +3837,11 @@ build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
$(RTL_H) $(GGC_H) errors.h
build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(VEC_H) \
- $(GGC_H) $(TOPLEV_H)
+ $(GGC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) insn-constants.h \
$(filter-out insn-flags.h, $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(REGS_H) \
- $(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) $(TOPLEV_H) reload.h \
+ $(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) reload.h \
$(EXCEPT_H) tm-constrs.h)
# This pulls in tm-pred.h which contains inline functions wrapping up
# predicates from the back-end so those functions must be discarded.
@@ -3878,7 +3894,7 @@ build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
- coretypes.h $(GTM_H) errors.h gensupport.h $(TOPLEV_H)
+ coretypes.h $(GTM_H) errors.h gensupport.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h $(OBSTACK_H)
build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
@@ -4001,6 +4017,21 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H) fixinc_list
chmod a+r include/$$realfile; \
fi; \
done
+ for file in .. $(USER_H_INC_NEXT_PRE); do \
+ if [ X$$file != X.. ]; then \
+ mv include/$$file include/x_$$file; \
+ echo "#include_next <$$file>" >include/$$file; \
+ cat include/x_$$file >>include/$$file; \
+ rm -f include/x_$$file; \
+ chmod a+r include/$$file; \
+ fi; \
+ done
+ for file in .. $(USER_H_INC_NEXT_POST); do \
+ if [ X$$file != X.. ]; then \
+ echo "#include_next <$$file>" >>include/$$file; \
+ chmod a+r include/$$file; \
+ fi; \
+ done
rm -f include/unwind.h
cp $(UNWIND_H) include/unwind.h
chmod a+r include/unwind.h
@@ -4446,7 +4477,7 @@ installdirs:
$(mkinstalldirs) $(DESTDIR)$(man7dir)
PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TOPLEV_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_PASS_H) $(GCC_PLUGIN_H) \
+ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_PASS_H) $(GCC_PLUGIN_H) \
$(GGC_H) $(TREE_DUMP_H) $(PRETTY_PRINT_H) opts.h $(PARAMS_H) plugin.def \
$(tm_file_list) $(tm_include_list) $(tm_p_file_list) $(tm_p_include_list) \
$(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 98680a8ab03..f631f84bd8b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,51 @@
+2010-07-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/44892
+ * gcc-interface/utils.c (convert): Fix thinko in test.
+ (unchecked_convert): When converting from a scalar type to a type with
+ a different size, pad to have the same size on both sides.
+
+2010-07-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (gnat_types_compatible_p): Don't require strict
+ equality for the component type of array types.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
+ * gcc-interface/trans.c: Likewise.
+ * gcc-interface/utils.c: Likewise.
+ * gcc-interface/utils2.c: Likewise.
+
+2010-07-13 Laurent GUERBY <laurent@guerby.net>
+
+ PR bootstrap/44458
+ * gcc-interface/targtyps.c: Include tm_p.h.
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2010-07-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (gnat_gimplify_expr) <ADDR_EXPR>: Deal with
+ CALL_EXPR.
+
+2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * gcc-interface/utils.c: Include diagnostic-core.h in every file
+ that includes toplev.h.
+
+2010-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>:
+ Branch to common code handling the alignment of discrete types.
+ <E_Signed_Integer_Type>: Likewise.
+ <E_Modular_Integer_Type>: Likewise.
+
+2010-07-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/misc.c (gnat_handle_option): Do not populate gnat_argv.
+ (gnat_handle_option): Allocate only one element for gnat_argv.
+ (gnat_init): Do not populate gnat_argv.
+
2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc-interface/trans.c: Do not include tree-flow.h.
@@ -3090,7 +3138,7 @@
* gnat-style.texi: Ditto.
* gnat_ugn.texi: Ditto.
-2010-06-12 Kai Tietz
+2010-06-12 Kai Tietz <kai.tietz@onevision.com>
PR ada/43731
* gcc-interface/Makefile.in: Add rules for multilib x86/x64
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 8db581098dc..9a32b608ea5 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1253,7 +1253,7 @@ ada/misc.o : ada/gcc-interface/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
ada/targtyps.o : ada/gcc-interface/targtyps.c $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TM_H) $(TREE_H) ada/gcc-interface/ada.h \
+ coretypes.h $(TM_H) $(TM_P_H) $(TREE_H) ada/gcc-interface/ada.h \
ada/types.h ada/atree.h ada/elists.h ada/namet.h ada/nlists.h \
ada/snames.h ada/stringt.h ada/uintp.h ada/urealp.h ada/fe.h ada/sinfo.h \
ada/einfo.h $(ADA_TREE_H) ada/gcc-interface/gigi.h
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6952060259d..54d02225e01 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1049,7 +1049,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
: TYPE_FIELDS (gnu_type);
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 1);
tree t = build_template (TREE_TYPE (template_field),
- TREE_TYPE (TREE_CHAIN (template_field)),
+ TREE_TYPE (DECL_CHAIN (template_field)),
NULL_TREE);
CONSTRUCTOR_APPEND_ELT (v, template_field, t);
gnu_expr = gnat_build_constructor (gnu_type, v);
@@ -1207,7 +1207,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& TYPE_CONTAINS_TEMPLATE_P (gnu_alloc_type))
{
gnu_alloc_type
- = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_alloc_type)));
+ = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_alloc_type)));
if (TREE_CODE (gnu_expr) == CONSTRUCTOR
&& 1 == VEC_length (constructor_elt,
@@ -1217,7 +1217,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_expr
= build_component_ref
(gnu_expr, NULL_TREE,
- TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))),
+ DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))),
false);
}
@@ -1496,7 +1496,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Note that the bounds are updated at the end of this function
to avoid an infinite recursion since they refer to the type. */
}
- break;
+ goto discrete_type;
case E_Signed_Integer_Type:
case E_Ordinary_Fixed_Point_Type:
@@ -1504,7 +1504,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* For integer types, just make a signed type the appropriate number
of bits. */
gnu_type = make_signed_type (esize);
- break;
+ goto discrete_type;
case E_Modular_Integer_Type:
{
@@ -1543,7 +1543,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_type = gnu_subtype;
}
}
- break;
+ goto discrete_type;
case E_Signed_Integer_Subtype:
case E_Enumeration_Subtype:
@@ -1632,6 +1632,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnat_to_gnu_type
(Original_Array_Type (gnat_entity)));
+ discrete_type:
+
/* We have to handle clauses that under-align the type specially. */
if ((Present (Alignment_Clause (gnat_entity))
|| (Is_Packed_Array_Type (gnat_entity)
@@ -1685,9 +1687,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY);
- /* Don't notify the field as "addressable", since we won't be taking
- it's address and it would prevent create_field_decl from making a
- bitfield. */
+ /* Don't declare the field as addressable since we won't be taking
+ its address and this would prevent create_field_decl from making
+ a bitfield. */
gnu_field
= create_field_decl (get_identifier ("OBJECT"), gnu_field_type,
gnu_type, NULL_TREE, bitsize_zero_node, 1, 0);
@@ -1736,9 +1738,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
TYPE_ALIGN (gnu_type) = align;
relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY);
- /* Don't notify the field as "addressable", since we won't be taking
- it's address and it would prevent create_field_decl from making a
- bitfield. */
+ /* Don't declare the field as addressable since we won't be taking
+ its address and this would prevent create_field_decl from making
+ a bitfield. */
gnu_field
= create_field_decl (get_identifier ("F"), gnu_field_type,
gnu_type, NULL_TREE, bitsize_zero_node, 1, 0);
@@ -1894,7 +1896,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
fields once we build them. */
tem = build3 (COMPONENT_REF, gnu_ptr_template,
build0 (PLACEHOLDER_EXPR, gnu_fat_type),
- TREE_CHAIN (TYPE_FIELDS (gnu_fat_type)), NULL_TREE);
+ DECL_CHAIN (TYPE_FIELDS (gnu_fat_type)), NULL_TREE);
gnu_template_reference
= build_unary_op (INDIRECT_REF, gnu_template_type, tem);
TREE_READONLY (gnu_template_reference) = 1;
@@ -2433,7 +2435,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_field = create_field_decl (gnu_index_name, gnu_index,
gnu_bound_rec, NULL_TREE,
NULL_TREE, 0, 0);
- TREE_CHAIN (gnu_field) = gnu_field_list;
+ DECL_CHAIN (gnu_field) = gnu_field_list;
gnu_field_list = gnu_field;
}
@@ -2903,7 +2905,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (!is_unchecked_union)
{
- TREE_CHAIN (gnu_field) = gnu_field_list;
+ DECL_CHAIN (gnu_field) = gnu_field_list;
gnu_field_list = gnu_field;
}
}
@@ -2948,8 +2950,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
for (gnu_field = TYPE_FIELDS (gnu_type),
gnu_std_field = TYPE_FIELDS (except_type_node);
gnu_field;
- gnu_field = TREE_CHAIN (gnu_field),
- gnu_std_field = TREE_CHAIN (gnu_std_field))
+ gnu_field = DECL_CHAIN (gnu_field),
+ gnu_std_field = DECL_CHAIN (gnu_std_field))
SET_DECL_ORIGINAL_FIELD_TO_FIELD (gnu_field, gnu_std_field);
gcc_assert (!gnu_std_field);
}
@@ -3205,7 +3207,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Put it in one of the new variants directly. */
if (gnu_cont_type != gnu_type)
{
- TREE_CHAIN (gnu_field) = TYPE_FIELDS (gnu_cont_type);
+ DECL_CHAIN (gnu_field) = TYPE_FIELDS (gnu_cont_type);
TYPE_FIELDS (gnu_cont_type) = gnu_field;
}
@@ -3229,7 +3231,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
the other fields. */
else
{
- TREE_CHAIN (gnu_field) = gnu_field_list;
+ DECL_CHAIN (gnu_field) = gnu_field_list;
gnu_field_list = gnu_field;
if (!gnu_last)
gnu_last = gnu_field;
@@ -3246,7 +3248,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
= create_variant_part_from (gnu_variant_part,
gnu_variant_list, gnu_type,
gnu_pos_list, gnu_subst_list);
- TREE_CHAIN (new_variant_part) = gnu_field_list;
+ DECL_CHAIN (new_variant_part) = gnu_field_list;
gnu_field_list = new_variant_part;
}
@@ -3518,7 +3520,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
= create_field_decl (get_identifier ("P_ARRAY"),
gnu_ptr_array, gnu_type,
NULL_TREE, NULL_TREE, 0, 0);
- TREE_CHAIN (fields)
+ DECL_CHAIN (fields)
= create_field_decl (get_identifier ("P_BOUNDS"),
gnu_ptr_template, gnu_type,
NULL_TREE, NULL_TREE, 0, 0);
@@ -4139,7 +4141,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
0, 0);
Sloc_to_locus (Sloc (gnat_param),
&DECL_SOURCE_LOCATION (gnu_field));
- TREE_CHAIN (gnu_field) = gnu_field_list;
+ DECL_CHAIN (gnu_field) = gnu_field_list;
gnu_field_list = gnu_field;
gnu_cico_list
= tree_cons (gnu_field, gnu_param, gnu_cico_list);
@@ -6138,7 +6140,7 @@ make_packable_type (tree type, bool in_record)
/* Now copy the fields, keeping the position and size as we don't want
to change the layout by propagating the packedness downwards. */
for (old_field = TYPE_FIELDS (type); old_field;
- old_field = TREE_CHAIN (old_field))
+ old_field = DECL_CHAIN (old_field))
{
tree new_field_type = TREE_TYPE (old_field);
tree new_field, new_size;
@@ -6153,7 +6155,7 @@ make_packable_type (tree type, bool in_record)
/* However, for the last field in a not already packed record type
that is of an aggregate type, we need to use the RM size in the
packable version of the record type, see finish_record_type. */
- if (!TREE_CHAIN (old_field)
+ if (!DECL_CHAIN (old_field)
&& !TYPE_PACKED (type)
&& (TREE_CODE (new_field_type) == RECORD_TYPE
|| TREE_CODE (new_field_type) == UNION_TYPE
@@ -6176,7 +6178,7 @@ make_packable_type (tree type, bool in_record)
if (TREE_CODE (new_type) == QUAL_UNION_TYPE)
DECL_QUALIFIER (new_field) = DECL_QUALIFIER (old_field);
- TREE_CHAIN (new_field) = field_list;
+ DECL_CHAIN (new_field) = field_list;
field_list = new_field;
}
@@ -6829,7 +6831,7 @@ is_variable_size (tree type)
&& TREE_CODE (type) != QUAL_UNION_TYPE)
return false;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (is_variable_size (TREE_TYPE (field)))
return true;
@@ -6927,14 +6929,14 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
fields except for the _Tag or _Parent field. */
else if (gnat_name == Name_uController && gnu_last)
{
- TREE_CHAIN (gnu_field) = TREE_CHAIN (gnu_last);
- TREE_CHAIN (gnu_last) = gnu_field;
+ DECL_CHAIN (gnu_field) = DECL_CHAIN (gnu_last);
+ DECL_CHAIN (gnu_last) = gnu_field;
}
/* If this is a regular field, put it after the other fields. */
else
{
- TREE_CHAIN (gnu_field) = gnu_field_list;
+ DECL_CHAIN (gnu_field) = gnu_field_list;
gnu_field_list = gnu_field;
if (!gnu_last)
gnu_last = gnu_field;
@@ -7033,7 +7035,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
use this field directly to match the layout of C unions. */
if (unchecked_union
&& TYPE_FIELDS (gnu_variant_type)
- && !TREE_CHAIN (TYPE_FIELDS (gnu_variant_type)))
+ && !DECL_CHAIN (TYPE_FIELDS (gnu_variant_type)))
gnu_field = TYPE_FIELDS (gnu_variant_type);
else
{
@@ -7065,7 +7067,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
DECL_QUALIFIER (gnu_field) = gnu_qual;
}
- TREE_CHAIN (gnu_field) = gnu_variant_list;
+ DECL_CHAIN (gnu_field) = gnu_variant_list;
gnu_variant_list = gnu_field;
}
@@ -7109,7 +7111,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
union_field_packed, 0);
DECL_INTERNAL_P (gnu_union_field) = 1;
- TREE_CHAIN (gnu_union_field) = gnu_field_list;
+ DECL_CHAIN (gnu_union_field) = gnu_field_list;
gnu_field_list = gnu_union_field;
}
}
@@ -7124,16 +7126,16 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
gnu_last = NULL_TREE;
for (gnu_field = gnu_field_list; gnu_field; gnu_field = gnu_next)
{
- gnu_next = TREE_CHAIN (gnu_field);
+ gnu_next = DECL_CHAIN (gnu_field);
if (DECL_FIELD_OFFSET (gnu_field))
{
if (!gnu_last)
gnu_field_list = gnu_next;
else
- TREE_CHAIN (gnu_last) = gnu_next;
+ DECL_CHAIN (gnu_last) = gnu_next;
- TREE_CHAIN (gnu_field) = gnu_our_rep_list;
+ DECL_CHAIN (gnu_field) = gnu_our_rep_list;
gnu_our_rep_list = gnu_field;
}
else
@@ -7157,7 +7159,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
for (gnu_field = gnu_our_rep_list, i = 0;
gnu_field;
- gnu_field = TREE_CHAIN (gnu_field), i++)
+ gnu_field = DECL_CHAIN (gnu_field), i++)
gnu_arr[i] = gnu_field;
qsort (gnu_arr, len, sizeof (tree), compare_field_bitpos);
@@ -7167,7 +7169,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
gnu_our_rep_list = NULL_TREE;
for (i = len - 1; i >= 0; i--)
{
- TREE_CHAIN (gnu_arr[i]) = gnu_our_rep_list;
+ DECL_CHAIN (gnu_arr[i]) = gnu_our_rep_list;
gnu_our_rep_list = gnu_arr[i];
DECL_CONTEXT (gnu_arr[i]) = gnu_rep_type;
}
@@ -7351,7 +7353,7 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
{
if (TREE_CODE (gnu_type) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (gnu_type))
- size = TYPE_SIZE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))));
+ size = TYPE_SIZE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type))));
else if (!size)
size = TYPE_SIZE (gnu_type);
@@ -7467,7 +7469,7 @@ build_position_list (tree gnu_type, bool do_not_flatten_variant, tree gnu_pos,
for (gnu_field = TYPE_FIELDS (gnu_type);
gnu_field;
- gnu_field = TREE_CHAIN (gnu_field))
+ gnu_field = DECL_CHAIN (gnu_field))
{
tree gnu_our_bitpos = size_binop (PLUS_EXPR, gnu_bitpos,
DECL_FIELD_BIT_OFFSET (gnu_field));
@@ -7553,7 +7555,7 @@ build_variant_list (tree qual_union_type, tree subst_list, tree gnu_list)
for (gnu_field = TYPE_FIELDS (qual_union_type);
gnu_field;
- gnu_field = TREE_CHAIN (gnu_field))
+ gnu_field = DECL_CHAIN (gnu_field))
{
tree t, qual = DECL_QUALIFIER (gnu_field);
@@ -8290,7 +8292,7 @@ get_variant_part (tree record_type)
tree field;
/* The variant part is the only internal field that is a qualified union. */
- for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field))
if (DECL_INTERNAL_P (field)
&& TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE)
return field;
@@ -8361,7 +8363,7 @@ create_variant_part_from (tree old_variant_part, tree variant_list,
tree new_variant_subpart
= create_variant_part_from (old_variant_subpart, variant_list,
new_variant, pos_list, subst_list);
- TREE_CHAIN (new_variant_subpart) = field_list;
+ DECL_CHAIN (new_variant_subpart) = field_list;
field_list = new_variant_subpart;
}
@@ -8378,7 +8380,7 @@ create_variant_part_from (tree old_variant_part, tree variant_list,
pos_list, subst_list);
DECL_QUALIFIER (new_field) = TREE_VEC_ELT (TREE_VALUE (t), 1);
DECL_INTERNAL_P (new_field) = 1;
- TREE_CHAIN (new_field) = union_field_list;
+ DECL_CHAIN (new_field) = union_field_list;
union_field_list = new_field;
}
@@ -8399,7 +8401,7 @@ create_variant_part_from (tree old_variant_part, tree variant_list,
statically selected while outer ones are not; in this case, the list
of fields of the inner variant is not flattened and we end up with a
qualified union with a single member. Drop the useless container. */
- if (!TREE_CHAIN (union_field_list))
+ if (!DECL_CHAIN (union_field_list))
{
DECL_CONTEXT (union_field_list) = record_type;
DECL_FIELD_OFFSET (union_field_list)
@@ -8564,7 +8566,7 @@ substitute_in_type (tree t, tree f, tree r)
nt = copy_type (t);
TYPE_FIELDS (nt) = NULL_TREE;
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
{
tree new_field = copy_node (field), new_n;
@@ -8596,7 +8598,7 @@ substitute_in_type (tree t, tree f, tree r)
DECL_CONTEXT (new_field) = nt;
SET_DECL_ORIGINAL_FIELD_TO_FIELD (new_field, field);
- TREE_CHAIN (new_field) = TYPE_FIELDS (nt);
+ DECL_CHAIN (new_field) = TYPE_FIELDS (nt);
TYPE_FIELDS (nt) = new_field;
}
@@ -8630,7 +8632,7 @@ rm_size (tree gnu_type)
&& TYPE_CONTAINS_TEMPLATE_P (gnu_type))
return
size_binop (PLUS_EXPR,
- rm_size (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)))),
+ rm_size (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)))),
DECL_SIZE (TYPE_FIELDS (gnu_type)));
/* For record types, we store the size explicitly. */
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 4033173d782..8444e4f714c 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -191,7 +191,6 @@ gnat_handle_option (size_t scode, const char *arg, int value,
{
const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
- char *q;
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
@@ -201,20 +200,11 @@ gnat_handle_option (size_t scode, const char *arg, int value,
switch (code)
{
- case OPT_I:
- q = XNEWVEC (char, sizeof("-I") + strlen (arg));
- strcpy (q, "-I");
- strcat (q, arg);
- gnat_argv[gnat_argc] = q;
- gnat_argc++;
- break;
-
case OPT_Wall:
warn_unused = value;
warn_uninitialized = value;
break;
- /* These are used in the GCC Makefile. */
case OPT_Wmissing_prototypes:
case OPT_Wstrict_prototypes:
case OPT_Wwrite_strings:
@@ -223,15 +213,7 @@ gnat_handle_option (size_t scode, const char *arg, int value,
case OPT_Wold_style_definition:
case OPT_Wmissing_format_attribute:
case OPT_Woverlength_strings:
- break;
-
- /* This is handled by the front-end. */
- case OPT_nostdinc:
- break;
-
- case OPT_nostdlib:
- gnat_argv[gnat_argc] = xstrdup ("-nostdlib");
- gnat_argc++;
+ /* These are used in the GCC Makefile. */
break;
case OPT_feliminate_unused_debug_types:
@@ -242,9 +224,8 @@ gnat_handle_option (size_t scode, const char *arg, int value,
flag_eliminate_unused_debug_types = -value;
break;
- case OPT_fRTS_:
- gnat_argv[gnat_argc] = xstrdup ("-fRTS");
- gnat_argc++;
+ case OPT_gdwarfplus:
+ gnat_dwarf_extensions = 1;
break;
case OPT_gant:
@@ -253,22 +234,12 @@ gnat_handle_option (size_t scode, const char *arg, int value,
/* ... fall through ... */
case OPT_gnat:
- /* Recopy the switches without the 'gnat' prefix. */
- gnat_argv[gnat_argc] = XNEWVEC (char, strlen (arg) + 2);
- gnat_argv[gnat_argc][0] = '-';
- strcpy (gnat_argv[gnat_argc] + 1, arg);
- gnat_argc++;
- break;
-
case OPT_gnatO:
- gnat_argv[gnat_argc] = xstrdup ("-O");
- gnat_argc++;
- gnat_argv[gnat_argc] = xstrdup (arg);
- gnat_argc++;
- break;
-
- case OPT_gdwarfplus:
- gnat_dwarf_extensions = 1;
+ case OPT_fRTS_:
+ case OPT_I:
+ case OPT_nostdinc:
+ case OPT_nostdlib:
+ /* These are handled by the front-end. */
break;
default:
@@ -283,8 +254,7 @@ gnat_handle_option (size_t scode, const char *arg, int value,
static unsigned int
gnat_init_options (unsigned int argc, const char **argv)
{
- /* Initialize gnat_argv with save_argv size. */
- gnat_argv = (char **) xmalloc ((argc + 1) * sizeof (argv[0]));
+ gnat_argv = (char **) xmalloc (sizeof (argv[0]));
gnat_argv[0] = xstrdup (argv[0]); /* name of the command */
gnat_argc = 1;
@@ -423,14 +393,6 @@ gnat_init (void)
/* Show that REFERENCE_TYPEs are internal and should be Pmode. */
internal_reference_types ();
- /* Add the input filename as the last argument. */
- if (main_input_filename)
- {
- gnat_argv[gnat_argc] = xstrdup (main_input_filename);
- gnat_argc++;
- gnat_argv[gnat_argc] = NULL;
- }
-
/* Register our internal error function. */
global_dc->internal_error = &internal_error_function;
diff --git a/gcc/ada/gcc-interface/targtyps.c b/gcc/ada/gcc-interface/targtyps.c
index 632862e0700..58c155fdb45 100644
--- a/gcc/ada/gcc-interface/targtyps.c
+++ b/gcc/ada/gcc-interface/targtyps.c
@@ -30,6 +30,7 @@
#include "coretypes.h"
#include "tree.h"
#include "tm.h"
+#include "tm_p.h"
#include "ada.h"
#include "types.h"
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 46848f230f7..4bf89477d0d 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -5988,33 +5988,31 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
case ADDR_EXPR:
op = TREE_OPERAND (expr, 0);
- if (TREE_CODE (op) == CONSTRUCTOR)
+ /* If we are taking the address of a constant CONSTRUCTOR, make sure it
+ is put into static memory. We know that it's going to be read-only
+ given the semantics we have and it must be in static memory when the
+ reference is in an elaboration procedure. */
+ if (TREE_CODE (op) == CONSTRUCTOR && TREE_CONSTANT (op))
{
- /* If we are taking the address of a constant CONSTRUCTOR, make sure
- it is put into static memory. We know it's going to be read-only
- given the semantics we have and it must be in static memory when
- the reference is in an elaboration procedure. */
- if (TREE_CONSTANT (op))
- {
- tree addr = build_fold_addr_expr (tree_output_constant_def (op));
- *expr_p = fold_convert (TREE_TYPE (expr), addr);
- }
-
- /* Otherwise explicitly create the local temporary. That's required
- if the type is passed by reference. */
- else
- {
- tree mod, new_var = create_tmp_var_raw (TREE_TYPE (op), "C");
- TREE_ADDRESSABLE (new_var) = 1;
- gimple_add_tmp_var (new_var);
+ tree addr = build_fold_addr_expr (tree_output_constant_def (op));
+ *expr_p = fold_convert (TREE_TYPE (expr), addr);
+ return GS_ALL_DONE;
+ }
- mod = build2 (INIT_EXPR, TREE_TYPE (new_var), new_var, op);
- gimplify_and_add (mod, pre_p);
+ /* Otherwise, if we are taking the address of a non-constant CONSTRUCTOR
+ or of a call, explicitly create the local temporary. That's required
+ if the type is passed by reference. */
+ if (TREE_CODE (op) == CONSTRUCTOR || TREE_CODE (op) == CALL_EXPR)
+ {
+ tree mod, new_var = create_tmp_var_raw (TREE_TYPE (op), "C");
+ TREE_ADDRESSABLE (new_var) = 1;
+ gimple_add_tmp_var (new_var);
- TREE_OPERAND (expr, 0) = new_var;
- recompute_tree_invariant_for_addr_expr (expr);
- }
+ mod = build2 (INIT_EXPR, TREE_TYPE (new_var), new_var, op);
+ gimplify_and_add (mod, pre_p);
+ TREE_OPERAND (expr, 0) = new_var;
+ recompute_tree_invariant_for_addr_expr (expr);
return GS_ALL_DONE;
}
@@ -7364,7 +7362,7 @@ extract_values (tree values, tree record_type)
tree field, tem;
VEC(constructor_elt,gc) *v = NULL;
- for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field))
{
tree value = 0;
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index c5d612da91b..541f7bb3f91 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -30,6 +30,7 @@
#include "tree.h"
#include "flags.h"
#include "toplev.h"
+#include "diagnostic-core.h"
#include "output.h"
#include "ggc.h"
#include "debug.h"
@@ -460,7 +461,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
}
else
{
- TREE_CHAIN (decl) = BLOCK_VARS (current_binding_level->block);
+ DECL_CHAIN (decl) = BLOCK_VARS (current_binding_level->block);
BLOCK_VARS (current_binding_level->block) = decl;
}
}
@@ -588,7 +589,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
if (code == QUAL_UNION_TYPE)
field_list = nreverse (field_list);
- for (field = field_list; field; field = TREE_CHAIN (field))
+ for (field = field_list; field; field = DECL_CHAIN (field))
{
tree type = TREE_TYPE (field);
tree pos = bit_position (field);
@@ -740,7 +741,7 @@ rest_of_record_type_compilation (tree record_type)
enum tree_code code = TREE_CODE (record_type);
bool var_size = false;
- for (field = field_list; field; field = TREE_CHAIN (field))
+ for (field = field_list; field; field = DECL_CHAIN (field))
{
/* We need to make an XVE/XVU record if any field has variable size,
whether or not the record does. For example, if we have a union,
@@ -794,7 +795,7 @@ rest_of_record_type_compilation (tree record_type)
/* Now scan all the fields, replacing each field with a new
field corresponding to the new encoding. */
for (old_field = TYPE_FIELDS (record_type); old_field;
- old_field = TREE_CHAIN (old_field))
+ old_field = DECL_CHAIN (old_field))
{
tree field_type = TREE_TYPE (old_field);
tree field_name = DECL_NAME (old_field);
@@ -910,7 +911,7 @@ rest_of_record_type_compilation (tree record_type)
new_field
= create_field_decl (field_name, field_type, new_record_type,
DECL_SIZE (old_field), pos, 0, 0);
- TREE_CHAIN (new_field) = TYPE_FIELDS (new_record_type);
+ DECL_CHAIN (new_field) = TYPE_FIELDS (new_record_type);
TYPE_FIELDS (new_record_type) = new_field;
/* If old_field is a QUAL_UNION_TYPE, take its size as being
@@ -1078,7 +1079,7 @@ create_subprog_type (tree return_type, tree param_decl_list, tree cico_list,
tree param_type_list = NULL_TREE;
tree t, type;
- for (t = param_decl_list; t; t = TREE_CHAIN (t))
+ for (t = param_decl_list; t; t = DECL_CHAIN (t))
param_type_list = tree_cons (NULL_TREE, TREE_TYPE (t), param_type_list);
/* The list of the function parameter types has to be terminated by the void
@@ -1415,7 +1416,7 @@ aggregate_type_contains_array_p (tree type)
case QUAL_UNION_TYPE:
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (AGGREGATE_TYPE_P (TREE_TYPE (field))
&& aggregate_type_contains_array_p (TREE_TYPE (field)))
return true;
@@ -1859,7 +1860,7 @@ begin_subprog_body (tree subprog_decl)
gnat_pushlevel ();
for (param_decl = DECL_ARGUMENTS (subprog_decl); param_decl;
- param_decl = TREE_CHAIN (param_decl))
+ param_decl = DECL_CHAIN (param_decl))
DECL_CONTEXT (param_decl) = subprog_decl;
make_decl_rtl (subprog_decl);
@@ -2079,17 +2080,17 @@ gnat_types_compatible_p (tree t1, tree 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. */
+ /* Array types are also compatible if they are constrained and have the same
+ domain and compatible component types. */
if (code == ARRAY_TYPE
- && TREE_TYPE (t1) == TREE_TYPE (t2)
&& (TYPE_DOMAIN (t1) == TYPE_DOMAIN (t2)
|| (TYPE_DOMAIN (t1)
&& TYPE_DOMAIN (t2)
&& tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (t1)),
TYPE_MIN_VALUE (TYPE_DOMAIN (t2)))
&& tree_int_cst_equal (TYPE_MAX_VALUE (TYPE_DOMAIN (t1)),
- TYPE_MAX_VALUE (TYPE_DOMAIN (t2))))))
+ TYPE_MAX_VALUE (TYPE_DOMAIN (t2)))))
+ && gnat_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))
return 1;
/* Padding record types are also compatible if they pad the same
@@ -2245,7 +2246,7 @@ build_template (tree template_type, tree array_type, tree expr)
(bound_list
? (bound_list = TREE_CHAIN (bound_list))
: (array_type = TREE_TYPE (array_type))),
- field = TREE_CHAIN (TREE_CHAIN (field)))
+ field = DECL_CHAIN (DECL_CHAIN (field)))
{
tree bounds, min, max;
@@ -2264,7 +2265,7 @@ build_template (tree template_type, tree array_type, tree expr)
gcc_unreachable ();
min = convert (TREE_TYPE (field), TYPE_MIN_VALUE (bounds));
- max = convert (TREE_TYPE (TREE_CHAIN (field)), TYPE_MAX_VALUE (bounds));
+ max = convert (TREE_TYPE (DECL_CHAIN (field)), TYPE_MAX_VALUE (bounds));
/* If either MIN or MAX involve a PLACEHOLDER_EXPR, we must
substitute it from OBJECT. */
@@ -2272,7 +2273,7 @@ build_template (tree template_type, tree array_type, tree expr)
max = SUBSTITUTE_PLACEHOLDER_IN_EXPR (max, expr);
CONSTRUCTOR_APPEND_ELT (template_elts, field, min);
- CONSTRUCTOR_APPEND_ELT (template_elts, TREE_CHAIN (field), max);
+ CONSTRUCTOR_APPEND_ELT (template_elts, DECL_CHAIN (field), max);
}
return gnat_build_constructor (template_type, template_elts);
@@ -2928,9 +2929,9 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
/* The CLASS field is the 3rd field in the descriptor. */
- tree klass = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+ tree klass = DECL_CHAIN (DECL_CHAIN (TYPE_FIELDS (desc_type)));
/* The POINTER field is the 6th field in the descriptor. */
- tree pointer = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (klass)));
+ tree pointer = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (klass)));
/* Retrieve the value of the POINTER field. */
tree gnu_expr64
@@ -2961,7 +2962,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
case 15: /* Class SB */
/* Build {1, LENGTH} template; LENGTH64 is the 5th field. */
v = VEC_alloc (constructor_elt, gc, 2);
- t = TREE_CHAIN (TREE_CHAIN (klass));
+ t = DECL_CHAIN (DECL_CHAIN (klass));
t = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
CONSTRUCTOR_APPEND_ELT (v, min_field,
convert (TREE_TYPE (min_field),
@@ -2989,7 +2990,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
t = TREE_CHAIN (t);
ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
ufield = convert
- (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (template_type))), ufield);
+ (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
/* Build the template in the form of a constructor. */
v = VEC_alloc (constructor_elt, gc, 2);
@@ -3008,7 +3009,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
case 4: /* Class A */
/* The AFLAGS field is the 3rd field after the pointer in the
descriptor. */
- t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (pointer)));
+ t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (pointer)));
aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* The DIMCT field is the next field in the descriptor after
aflags. */
@@ -3029,7 +3030,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
u));
/* There is already a template in the descriptor and it is located
in block 3. The fields are 64bits so they must be repacked. */
- t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN
+ t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN
(t)))));
lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
@@ -3037,12 +3038,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
t = TREE_CHAIN (t);
ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
ufield = convert
- (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (template_type))), ufield);
+ (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
/* Build the template in the form of a constructor. */
v = VEC_alloc (constructor_elt, gc, 2);
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (template_type), lfield);
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (template_type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (template_type)),
ufield);
template_tree = gnat_build_constructor (template_type, v);
template_tree = build3 (COND_EXPR, template_type, u,
@@ -3063,7 +3064,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Build the fat pointer in the form of a constructor. */
v = VEC_alloc (constructor_elt, gc, 2);
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (gnu_type), gnu_expr64);
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (gnu_type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (gnu_type)),
template_addr);
return gnat_build_constructor (gnu_type, v);
}
@@ -3082,9 +3083,9 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
/* The CLASS field is the 3rd field in the descriptor. */
- tree klass = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+ tree klass = DECL_CHAIN (DECL_CHAIN (TYPE_FIELDS (desc_type)));
/* The POINTER field is the 4th field in the descriptor. */
- tree pointer = TREE_CHAIN (klass);
+ tree pointer = DECL_CHAIN (klass);
/* Retrieve the value of the POINTER field. */
tree gnu_expr32
@@ -3146,7 +3147,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
case 4: /* Class A */
/* The AFLAGS field is the 7th field in the descriptor. */
- t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (pointer)));
+ t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (pointer)));
aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* The DIMCT field is the 8th field in the descriptor. */
t = TREE_CHAIN (t);
@@ -3166,7 +3167,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
u));
/* There is already a template in the descriptor and it is
located at the start of block 3 (12th field). */
- t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (t))));
+ t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (t))));
template_tree
= build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
template_tree = build3 (COND_EXPR, TREE_TYPE (t), u,
@@ -3187,7 +3188,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Build the fat pointer in the form of a constructor. */
v = VEC_alloc (constructor_elt, gc, 2);
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (gnu_type), gnu_expr32);
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (gnu_type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (gnu_type)),
template_addr);
return gnat_build_constructor (gnu_type, v);
@@ -3210,7 +3211,7 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type,
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
tree mbo = TYPE_FIELDS (desc_type);
const char *mbostr = IDENTIFIER_POINTER (DECL_NAME (mbo));
- tree mbmo = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (mbo)));
+ tree mbmo = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (mbo)));
tree is64bit, gnu_expr32, gnu_expr64;
/* If the field name is not MBO, it must be 32-bit and no alternate.
@@ -3320,7 +3321,7 @@ build_unc_object_type (tree template_type, tree object_type, tree name,
TYPE_NAME (type) = name;
TYPE_CONTAINS_TEMPLATE_P (type) = 1;
- TREE_CHAIN (template_field) = array_field;
+ DECL_CHAIN (template_field) = array_field;
finish_record_type (type, template_field, 0, true);
/* Declare it now since it will never be declared otherwise. This is
@@ -3342,7 +3343,7 @@ build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type,
template_type
= (TYPE_IS_FAT_POINTER_P (thin_fat_ptr_type)
- ? TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (thin_fat_ptr_type))))
+ ? TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (thin_fat_ptr_type))))
: TREE_TYPE (TYPE_FIELDS (TREE_TYPE (thin_fat_ptr_type))));
return
@@ -3361,7 +3362,7 @@ shift_unc_components_for_thin_pointers (tree type)
that COMPONENT_REFs on (*thin_ptr) designate the proper location. */
tree bounds_field = TYPE_FIELDS (type);
- tree array_field = TREE_CHAIN (TYPE_FIELDS (type));
+ tree array_field = DECL_CHAIN (TYPE_FIELDS (type));
DECL_FIELD_OFFSET (bounds_field)
= size_binop (MINUS_EXPR, size_zero_node, byte_position (array_field));
@@ -3480,12 +3481,12 @@ update_pointer_to (tree old_type, tree new_type)
return;
array_field = TYPE_FIELDS (ptr);
- bounds_field = TREE_CHAIN (array_field);
+ bounds_field = DECL_CHAIN (array_field);
/* Make pointers to the dummy template point to the real template. */
update_pointer_to
(TREE_TYPE (TREE_TYPE (bounds_field)),
- TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (new_ptr)))));
+ TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (new_ptr)))));
/* The references to the template bounds present in the array type use
the bounds field of NEW_PTR through a PLACEHOLDER_EXPR. Since we
@@ -3500,7 +3501,7 @@ update_pointer_to (tree old_type, tree new_type)
update_pointer_to
(TREE_TYPE (TREE_TYPE (array_field)),
substitute_in_type (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (new_ptr))),
- TREE_CHAIN (TYPE_FIELDS (new_ptr)), new_ref));
+ DECL_CHAIN (TYPE_FIELDS (new_ptr)), new_ref));
/* Merge PTR in NEW_PTR. */
DECL_FIELD_CONTEXT (array_field) = new_ptr;
@@ -3531,7 +3532,7 @@ update_pointer_to (tree old_type, tree new_type)
points to. Update all pointers from the old record into the new
one, update the type of the array field, and recompute the size. */
update_pointer_to (TYPE_OBJECT_RECORD_TYPE (old_type), new_obj_rec);
- TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (new_obj_rec)))
+ TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (new_obj_rec)))
= TREE_TYPE (TREE_TYPE (array_field));
/* The size recomputation needs to account for alignment constraints, so
@@ -3539,7 +3540,7 @@ update_pointer_to (tree old_type, tree new_type)
what they would be in a regular record, so we shift them back to what
we want them to be for a thin pointer designated type afterwards. */
DECL_SIZE (TYPE_FIELDS (new_obj_rec)) = NULL_TREE;
- DECL_SIZE (TREE_CHAIN (TYPE_FIELDS (new_obj_rec))) = NULL_TREE;
+ DECL_SIZE (DECL_CHAIN (TYPE_FIELDS (new_obj_rec))) = NULL_TREE;
TYPE_SIZE (new_obj_rec) = NULL_TREE;
layout_type (new_obj_rec);
shift_unc_components_for_thin_pointers (new_obj_rec);
@@ -3555,7 +3556,7 @@ update_pointer_to (tree old_type, tree new_type)
static tree
convert_to_fat_pointer (tree type, tree expr)
{
- tree template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type))));
+ tree template_type = TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type))));
tree p_array_type = TREE_TYPE (TYPE_FIELDS (type));
tree etype = TREE_TYPE (expr);
tree template_tree;
@@ -3567,7 +3568,7 @@ convert_to_fat_pointer (tree type, tree expr)
{
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type),
convert (p_array_type, expr));
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)),
convert (build_pointer_type (template_type),
expr));
return gnat_build_constructor (type, v);
@@ -3587,7 +3588,7 @@ convert_to_fat_pointer (tree type, tree expr)
template_tree = build_component_ref (expr, NULL_TREE, fields, false);
expr = build_unary_op (ADDR_EXPR, NULL_TREE,
build_component_ref (expr, NULL_TREE,
- TREE_CHAIN (fields), false));
+ DECL_CHAIN (fields), false));
}
/* Otherwise, build the constructor for the template. */
@@ -3608,7 +3609,7 @@ convert_to_fat_pointer (tree type, tree expr)
will only refer to the provided TEMPLATE_TYPE in this case. */
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type),
convert (p_array_type, expr));
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)),
build_unary_op (ADDR_EXPR, NULL_TREE,
template_tree));
return gnat_build_constructor (type, v);
@@ -3701,9 +3702,10 @@ convert (tree type, tree expr)
if (ecode == RECORD_TYPE
&& CONTAINS_PLACEHOLDER_P (DECL_SIZE (TYPE_FIELDS (type))))
{
- if (TREE_CONSTANT (TYPE_SIZE (etype)))
+ if (TREE_CODE (TYPE_SIZE (etype)) == INTEGER_CST)
expr = convert (maybe_pad_type (etype, TYPE_SIZE (type), 0, Empty,
- false, false, false, true), expr);
+ false, false, false, true),
+ expr);
return unchecked_convert (type, expr, false);
}
@@ -3774,7 +3776,7 @@ convert (tree type, tree expr)
type and then build the template. */
if (code == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (type))
{
- tree obj_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type)));
+ tree obj_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type)));
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 2);
/* If the source already has a template, get a reference to the
@@ -3785,7 +3787,7 @@ convert (tree type, tree expr)
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type),
build_template (TREE_TYPE (TYPE_FIELDS (type)),
obj_type, NULL_TREE));
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)),
convert (obj_type, expr));
return gnat_build_constructor (type, v);
}
@@ -3881,8 +3883,8 @@ convert (tree type, tree expr)
&& !initializer_constant_valid_for_bitfield_p (value))
clear_constant = true;
- efield = TREE_CHAIN (efield);
- field = TREE_CHAIN (field);
+ efield = DECL_CHAIN (efield);
+ field = DECL_CHAIN (field);
}
/* If we have been able to match and convert all the input fields
@@ -4263,14 +4265,14 @@ maybe_unconstrained_array (tree exp)
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new_exp)))
return
build_component_ref (new_exp, NULL_TREE,
- TREE_CHAIN
+ DECL_CHAIN
(TYPE_FIELDS (TREE_TYPE (new_exp))),
false);
}
else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp)))
return
build_component_ref (exp, NULL_TREE,
- TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (exp))),
+ DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (exp))),
false);
break;
@@ -4352,6 +4354,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
tree etype = TREE_TYPE (expr);
enum tree_code ecode = TREE_CODE (etype);
enum tree_code code = TREE_CODE (type);
+ int c;
/* If the expression is already of the right type, we are done. */
if (etype == type)
@@ -4392,7 +4395,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
/* If we are converting to an integral type whose precision is not equal
to its size, first unchecked convert to a record that contains an
object of the output type. Then extract the field. */
- else if (INTEGRAL_TYPE_P (type) && TYPE_RM_SIZE (type)
+ else if (INTEGRAL_TYPE_P (type)
+ && TYPE_RM_SIZE (type)
&& 0 != compare_tree_int (TYPE_RM_SIZE (type),
GET_MODE_BITSIZE (TYPE_MODE (type))))
{
@@ -4409,9 +4413,10 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
/* Similarly if we are converting from an integral type whose precision
is not equal to its size. */
- else if (INTEGRAL_TYPE_P (etype) && TYPE_RM_SIZE (etype)
- && 0 != compare_tree_int (TYPE_RM_SIZE (etype),
- GET_MODE_BITSIZE (TYPE_MODE (etype))))
+ else if (INTEGRAL_TYPE_P (etype)
+ && TYPE_RM_SIZE (etype)
+ && 0 != compare_tree_int (TYPE_RM_SIZE (etype),
+ GET_MODE_BITSIZE (TYPE_MODE (etype))))
{
tree rec_type = make_node (RECORD_TYPE);
tree field = create_field_decl (get_identifier ("OBJ"), etype, rec_type,
@@ -4426,6 +4431,38 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
expr = unchecked_convert (type, expr, notrunc_p);
}
+ /* If we are converting from a scalar type to a type with a different size,
+ we need to pad to have the same size on both sides.
+
+ ??? We cannot do it unconditionally because unchecked conversions are
+ used liberally by the front-end to implement polymorphism, e.g. in:
+
+ S191s : constant ada__tags__addr_ptr := ada__tags__addr_ptr!(S190s);
+ return p___size__4 (p__object!(S191s.all));
+
+ so we skip all expressions that are references. */
+ else if (!REFERENCE_CLASS_P (expr)
+ && !AGGREGATE_TYPE_P (etype)
+ && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+ && (c = tree_int_cst_compare (TYPE_SIZE (etype), TYPE_SIZE (type))))
+ {
+ if (c < 0)
+ {
+ expr = convert (maybe_pad_type (etype, TYPE_SIZE (type), 0, Empty,
+ false, false, false, true),
+ expr);
+ expr = unchecked_convert (type, expr, notrunc_p);
+ }
+ else
+ {
+ tree rec_type = maybe_pad_type (type, TYPE_SIZE (etype), 0, Empty,
+ false, false, false, true);
+ expr = unchecked_convert (rec_type, expr, notrunc_p);
+ expr = build_component_ref (expr, NULL_TREE, TYPE_FIELDS (rec_type),
+ false);
+ }
+ }
+
/* 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. */
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index ab3814ec4e0..bd78686e240 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -1612,7 +1612,7 @@ build_simple_component_ref (tree record_variable, tree component,
/* First loop thru normal components. */
for (new_field = TYPE_FIELDS (record_type); new_field;
- new_field = TREE_CHAIN (new_field))
+ new_field = DECL_CHAIN (new_field))
if (SAME_FIELD_P (field, new_field))
break;
@@ -1622,7 +1622,7 @@ build_simple_component_ref (tree record_variable, tree component,
_Parent field. */
if (!new_field)
for (new_field = TYPE_FIELDS (record_type); new_field;
- new_field = TREE_CHAIN (new_field))
+ new_field = DECL_CHAIN (new_field))
if (DECL_INTERNAL_P (new_field))
{
tree field_ref
@@ -1996,7 +1996,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (storage_type),
build_template (template_type, type, init));
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (storage_type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (storage_type)),
init);
return convert
@@ -2088,7 +2088,7 @@ fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
expr = maybe_unconstrained_array (expr);
gnat_mark_addressable (expr);
- for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field))
{
tree conexpr = convert (TREE_TYPE (field),
SUBSTITUTE_PLACEHOLDER_IN_EXPR
diff --git a/gcc/alias.c b/gcc/alias.c
index 08c38bf6616..dd846f3c996 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "flags.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "cselib.h"
#include "splay-tree.h"
@@ -211,9 +212,8 @@ static rtx *new_reg_base_value;
array. */
static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value;
-/* Static hunks of RTL used by the aliasing code; these are initialized
- once per function to avoid unnecessary RTL allocations. */
-static GTY (()) rtx static_reg_base_value[FIRST_PSEUDO_REGISTER];
+#define static_reg_base_value \
+ (this_target_rtl->x_static_reg_base_value)
#define REG_BASE_VALUE(X) \
(REGNO (X) < VEC_length (rtx, reg_base_value) \
@@ -279,7 +279,8 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
/* If this is a pointer dereference of a non-SSA_NAME punt.
??? We could replace it with a pointer to anything. */
- if (INDIRECT_REF_P (base)
+ if ((INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
&& TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME)
return false;
@@ -293,10 +294,7 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
void *namep;
namep = pointer_map_contains (cfun->gimple_df->decls_to_pointers, base);
if (namep)
- {
- ref->base_alias_set = get_alias_set (base);
- ref->base = build1 (INDIRECT_REF, TREE_TYPE (base), *(tree *)namep);
- }
+ ref->base = build_simple_mem_ref (*(tree *)namep);
}
ref->ref_alias_set = MEM_ALIAS_SET (mem);
@@ -648,8 +646,8 @@ get_alias_set (tree t)
{
tree inner;
- /* Remove any nops, then give the language a chance to do
- something with this tree before we look at it. */
+ /* Give the language a chance to do something with this tree
+ before we look at it. */
STRIP_NOPS (t);
set = lang_hooks.get_alias_set (t);
if (set != -1)
@@ -659,21 +657,41 @@ get_alias_set (tree t)
if (TREE_CODE (t) == TARGET_MEM_REF)
t = TMR_ORIGINAL (t);
- /* First see if the actual object referenced is an INDIRECT_REF from a
- restrict-qualified pointer or a "void *". */
+ /* Get the base object of the reference. */
inner = t;
while (handled_component_p (inner))
{
+ /* If there is a VIEW_CONVERT_EXPR in the chain we cannot use
+ the type of any component references that wrap it to
+ determine the alias-set. */
+ if (TREE_CODE (inner) == VIEW_CONVERT_EXPR)
+ t = TREE_OPERAND (inner, 0);
inner = TREE_OPERAND (inner, 0);
- STRIP_NOPS (inner);
}
+ /* Handle pointer dereferences here, they can override the
+ alias-set. */
if (INDIRECT_REF_P (inner))
{
set = get_deref_alias_set_1 (TREE_OPERAND (inner, 0));
if (set != -1)
return set;
}
+ else if (TREE_CODE (inner) == MEM_REF)
+ {
+ set = get_deref_alias_set_1 (TREE_OPERAND (inner, 1));
+ if (set != -1)
+ return set;
+ }
+
+ /* If the innermost reference is a MEM_REF that has a
+ conversion embedded treat it like a VIEW_CONVERT_EXPR above,
+ using the memory access type for determining the alias-set. */
+ if (TREE_CODE (inner) == MEM_REF
+ && TYPE_MAIN_VARIANT (TREE_TYPE (inner))
+ != TYPE_MAIN_VARIANT
+ (TREE_TYPE (TREE_TYPE (TREE_OPERAND (inner, 1)))))
+ return get_deref_alias_set (TREE_OPERAND (inner, 1));
/* Otherwise, pick up the outermost object that we could have a pointer
to, processing conversions as above. */
@@ -710,10 +728,13 @@ get_alias_set (tree t)
return set;
return 0;
}
+
t = TYPE_CANONICAL (t);
+
/* Canonical types shouldn't form a tree nor should the canonical
type require structural equality checks. */
- gcc_checking_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t);
+ gcc_checking_assert (TYPE_CANONICAL (t) == t
+ && !TYPE_STRUCTURAL_EQUALITY_P (t));
/* If this is a type with a known alias set, return it. */
if (TYPE_ALIAS_SET_KNOWN_P (t))
@@ -739,8 +760,7 @@ get_alias_set (tree t)
/* There are no objects of FUNCTION_TYPE, so there's no point in
using up an alias set for them. (There are, of course, pointers
and references to functions, but that's different.) */
- else if (TREE_CODE (t) == FUNCTION_TYPE
- || TREE_CODE (t) == METHOD_TYPE)
+ else if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE)
set = 0;
/* Unless the language specifies otherwise, let vector types alias
@@ -758,18 +778,17 @@ get_alias_set (tree t)
integer(kind=4)[4] the same alias set or not.
Just be pragmatic here and make sure the array and its element
type get the same alias set assigned. */
- else if (TREE_CODE (t) == ARRAY_TYPE
- && !TYPE_NONALIASED_COMPONENT (t))
+ else if (TREE_CODE (t) == ARRAY_TYPE && !TYPE_NONALIASED_COMPONENT (t))
set = get_alias_set (TREE_TYPE (t));
+ /* Otherwise make a new alias set for this type. */
else
- /* Otherwise make a new alias set for this type. */
set = new_alias_set ();
TYPE_ALIAS_SET (t) = set;
- /* If this is an aggregate type, we must record any component aliasing
- information. */
+ /* If this is an aggregate type or a complex type, we must record any
+ component aliasing information. */
if (AGGREGATE_TYPE_P (t) || TREE_CODE (t) == COMPLEX_TYPE)
record_component_aliases (t);
@@ -885,7 +904,7 @@ record_component_aliases (tree type)
record_alias_subset (superset,
get_alias_set (BINFO_TYPE (base_binfo)));
}
- for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field != 0; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL && !DECL_NONADDRESSABLE_P (field))
record_alias_subset (superset, get_alias_set (TREE_TYPE (field)));
break;
@@ -2299,16 +2318,30 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y)
return sizex >= 0 && offsety >= offsetx + sizex;
}
-/* True dependence: X is read after store in MEM takes place. */
+/* Helper for true_dependence and canon_true_dependence.
+ Checks for true dependence: X is read after store in MEM takes place.
-int
-true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
- bool (*varies) (const_rtx, bool))
+ VARIES is the function that should be used as rtx_varies function.
+
+ If MEM_CANONICALIZED is FALSE, then X_ADDR and MEM_ADDR should be
+ NULL_RTX, and the canonical addresses of MEM and X are both computed
+ here. If MEM_CANONICALIZED, then MEM must be already canonicalized.
+
+ If X_ADDR is non-NULL, it is used in preference of XEXP (x, 0).
+
+ Returns 1 if there is a true dependence, 0 otherwise. */
+
+static int
+true_dependence_1 (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
+ const_rtx x, rtx x_addr, bool (*varies) (const_rtx, bool),
+ bool mem_canonicalized)
{
- rtx x_addr, mem_addr;
rtx base;
int ret;
+ gcc_checking_assert (mem_canonicalized ? (mem_addr != NULL_RTX)
+ : (mem_addr == NULL_RTX && x_addr == NULL_RTX));
+
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
@@ -2334,11 +2367,16 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
return 1;
- if (mem_mode == VOIDmode)
- mem_mode = GET_MODE (mem);
+ if (! mem_addr)
+ {
+ mem_addr = XEXP (mem, 0);
+ if (mem_mode == VOIDmode)
+ mem_mode = GET_MODE (mem);
+ }
+
+ if (! x_addr)
+ x_addr = XEXP (x, 0);
- x_addr = XEXP (x, 0);
- mem_addr = XEXP (mem, 0);
if (!((GET_CODE (x_addr) == VALUE
&& GET_CODE (mem_addr) != VALUE
&& reg_mentioned_p (x_addr, mem_addr))
@@ -2347,7 +2385,8 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
&& reg_mentioned_p (mem_addr, x_addr))))
{
x_addr = get_addr (x_addr);
- mem_addr = get_addr (mem_addr);
+ if (!mem_canonicalized)
+ mem_addr = get_addr (mem_addr);
}
base = find_base_term (x_addr);
@@ -2360,7 +2399,8 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
return 0;
x_addr = canon_rtx (x_addr);
- mem_addr = canon_rtx (mem_addr);
+ if (!mem_canonicalized)
+ mem_addr = canon_rtx (mem_addr);
if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
SIZE_FOR_MODE (x), x_addr, 0)) != -1)
@@ -2376,11 +2416,11 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
return 1;
/* We cannot use aliases_everything_p to test MEM, since we must look
- at MEM_MODE, rather than GET_MODE (MEM). */
+ at MEM_ADDR, rather than XEXP (mem, 0). */
if (mem_mode == QImode || GET_CODE (mem_addr) == AND)
return 1;
- /* In true_dependence we also allow BLKmode to alias anything. Why
+ /* ??? In true_dependence we also allow BLKmode to alias anything. Why
don't we do this in anti_dependence and output_dependence? */
if (mem_mode == BLKmode || GET_MODE (x) == BLKmode)
return 1;
@@ -2391,87 +2431,30 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
return rtx_refs_may_alias_p (x, mem, true);
}
+/* True dependence: X is read after store in MEM takes place. */
+
+int
+true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
+ bool (*varies) (const_rtx, bool))
+{
+ return true_dependence_1 (mem, mem_mode, NULL_RTX,
+ x, NULL_RTX, varies,
+ /*mem_canonicalized=*/false);
+}
+
/* Canonical true dependence: X is read after store in MEM takes place.
Variant of true_dependence which assumes MEM has already been
canonicalized (hence we no longer do that here).
- The mem_addr argument has been added, since true_dependence computed
- this value prior to canonicalizing.
- If x_addr is non-NULL, it is used in preference of XEXP (x, 0). */
+ The mem_addr argument has been added, since true_dependence_1 computed
+ this value prior to canonicalizing. */
int
canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
const_rtx x, rtx x_addr, bool (*varies) (const_rtx, bool))
{
- int ret;
-
- if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
- return 1;
-
- /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
- This is used in epilogue deallocation functions. */
- if (GET_MODE (x) == BLKmode && GET_CODE (XEXP (x, 0)) == SCRATCH)
- return 1;
- if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
- return 1;
- if (MEM_ALIAS_SET (x) == ALIAS_SET_MEMORY_BARRIER
- || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER)
- return 1;
-
- /* Read-only memory is by definition never modified, and therefore can't
- conflict with anything. We don't expect to find read-only set on MEM,
- but stupid user tricks can produce them, so don't die. */
- if (MEM_READONLY_P (x))
- return 0;
-
- /* If we have MEMs refering to different address spaces (which can
- potentially overlap), we cannot easily tell from the addresses
- whether the references overlap. */
- if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
- return 1;
-
- if (! x_addr)
- {
- x_addr = XEXP (x, 0);
- if (!((GET_CODE (x_addr) == VALUE
- && GET_CODE (mem_addr) != VALUE
- && reg_mentioned_p (x_addr, mem_addr))
- || (GET_CODE (x_addr) != VALUE
- && GET_CODE (mem_addr) == VALUE
- && reg_mentioned_p (mem_addr, x_addr))))
- x_addr = get_addr (x_addr);
- }
-
- if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
- return 0;
-
- x_addr = canon_rtx (x_addr);
- if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
- SIZE_FOR_MODE (x), x_addr, 0)) != -1)
- return ret;
-
- if (DIFFERENT_ALIAS_SETS_P (x, mem))
- return 0;
-
- if (nonoverlapping_memrefs_p (x, mem))
- return 0;
-
- if (aliases_everything_p (x))
- return 1;
-
- /* We cannot use aliases_everything_p to test MEM, since we must look
- at MEM_MODE, rather than GET_MODE (MEM). */
- if (mem_mode == QImode || GET_CODE (mem_addr) == AND)
- return 1;
-
- /* In true_dependence we also allow BLKmode to alias anything. Why
- don't we do this in anti_dependence and output_dependence? */
- if (mem_mode == BLKmode || GET_MODE (x) == BLKmode)
- return 1;
-
- if (fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, varies))
- return 0;
-
- return rtx_refs_may_alias_p (x, mem, true);
+ return true_dependence_1 (mem, mem_mode, mem_addr,
+ x, x_addr, varies,
+ /*mem_canonicalized=*/true);
}
/* Returns nonzero if a write to X might alias a previous read from
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 57f367d581e..d8daa6f5ed6 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -25,8 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "flags.h"
-#include "toplev.h"
-#include "output.h"
+#include "diagnostic-core.h"
#include "ggc.h"
#include "tm_p.h"
#include "cpplib.h"
@@ -277,6 +276,19 @@ decl_attributes (tree *node, tree attributes, int flags)
TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr));
}
+ /* A "naked" function attribute implies "noinline" and "noclone" for
+ those targets that support it. */
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ && lookup_attribute_spec (get_identifier ("naked"))
+ && lookup_attribute ("naked", attributes) != NULL)
+ {
+ if (lookup_attribute ("noinline", attributes) == NULL)
+ attributes = tree_cons (get_identifier ("noinline"), NULL, attributes);
+
+ if (lookup_attribute ("noclone", attributes) == NULL)
+ attributes = tree_cons (get_identifier ("noclone"), NULL, attributes);
+ }
+
targetm.insert_attributes (*node, &attributes);
for (a = attributes; a; a = TREE_CHAIN (a))
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 94dffc95eb2..04c91a246a8 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "function.h"
#include "except.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "expr.h"
@@ -1068,14 +1069,7 @@ find_inc (bool first_try)
/* For the post_add to work, the result_reg of the inc must not be
used in the mem insn since this will become the new index
register. */
- if (count_occurrences (PATTERN (mem_insn.insn), inc_insn.reg_res, 1) == 0
- && reg_overlap_mentioned_p (inc_insn.reg_res, PATTERN (mem_insn.insn)))
- {
- debug_rtx (mem_insn.insn);
- debug_rtx (inc_insn.reg_res);
- gcc_unreachable ();
- }
- if (count_occurrences (PATTERN (mem_insn.insn), inc_insn.reg_res, 1) != 0)
+ if (reg_overlap_mentioned_p (inc_insn.reg_res, PATTERN (mem_insn.insn)))
{
if (dump_file)
fprintf (dump_file, "base reg replacement failure.\n");
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 5f7230f9bcf..2bf0b853165 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -82,9 +82,11 @@
#include "obstack.h"
#include "expr.h"
#include "params.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
+#include "toplev.h" /* user_defined_section_attribute */
#include "tree-pass.h"
#include "df.h"
+#include "bb-reorder.h"
/* The number of rounds. In most cases there will only be 4 rounds, but
when partitioning hot and cold basic blocks into separate sections of
@@ -100,6 +102,14 @@
#endif
+struct target_bb_reorder default_target_bb_reorder;
+#if SWITCHABLE_TARGET
+struct target_bb_reorder *this_target_bb_reorder = &default_target_bb_reorder;
+#endif
+
+#define uncond_jump_length \
+ (this_target_bb_reorder->x_uncond_jump_length)
+
/* Branch thresholds in thousandths (per mille) of the REG_BR_PROB_BASE. */
static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0};
@@ -110,9 +120,6 @@ static int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0};
block the edge destination is not duplicated while connecting traces. */
#define DUPLICATION_THRESHOLD 100
-/* Length of unconditional jump instruction. */
-static int uncond_jump_length;
-
/* Structure to hold needed information for each basic block. */
typedef struct bbro_basic_block_data_def
{
diff --git a/gcc/bb-reorder.h b/gcc/bb-reorder.h
new file mode 100644
index 00000000000..0b5ed254826
--- /dev/null
+++ b/gcc/bb-reorder.h
@@ -0,0 +1,37 @@
+/* Basic block reordering routines for the GNU compiler.
+ Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_BB_REORDER
+#define GCC_BB_REORDER
+
+/* Target-specific globals. */
+struct target_bb_reorder {
+ /* Length of unconditional jump instruction. */
+ int x_uncond_jump_length;
+};
+
+extern GTY(()) struct target_bb_reorder default_target_bb_reorder;
+#if SWITCHABLE_TARGET
+extern struct target_bb_reorder *this_target_bb_reorder;
+#else
+#define this_target_bb_reorder (&default_target_bb_reorder)
+#endif
+
+#endif
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index abb033fc096..f65b85213c2 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "except.h"
#include "tm_p.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "tree-pass.h"
#include "recog.h"
#include "df.h"
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 8a3f4486e66..9b6fb1033b1 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "value-prof.h"
#include "diagnostic-core.h"
+#include "builtins.h"
#ifndef SLOW_UNALIGNED_ACCESS
#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
@@ -60,6 +61,11 @@ along with GCC; see the file COPYING3. If not see
#endif
static tree do_mpc_arg1 (tree, tree, int (*)(mpc_ptr, mpc_srcptr, mpc_rnd_t));
+struct target_builtins default_target_builtins;
+#if SWITCHABLE_TARGET
+struct target_builtins *this_target_builtins = &default_target_builtins;
+#endif
+
/* Define the names of the builtin function types and codes. */
const char *const built_in_class_names[4]
= {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"};
@@ -105,7 +111,6 @@ static rtx expand_builtin_sincos (tree);
static rtx expand_builtin_cexpi (tree, rtx, rtx);
static rtx expand_builtin_int_roundingfn (tree, rtx);
static rtx expand_builtin_int_roundingfn_2 (tree, rtx);
-static rtx expand_builtin_args_info (tree);
static rtx expand_builtin_next_arg (void);
static rtx expand_builtin_va_start (tree);
static rtx expand_builtin_va_end (tree);
@@ -1056,7 +1061,7 @@ expand_builtin_prefetch (tree exp)
if (nargs > 2)
arg2 = CALL_EXPR_ARG (exp, 2);
else
- arg2 = build_int_cst (NULL_TREE, 3);
+ arg2 = integer_three_node;
/* Argument 0 is an address. */
op0 = expand_expr (arg0, NULL_RTX, Pmode, EXPAND_NORMAL);
@@ -1249,19 +1254,10 @@ get_memory_rtx (tree exp, tree len)
/* Built-in functions to perform an untyped call and return. */
-/* For each register that may be used for calling a function, this
- gives a mode used to copy the register's value. VOIDmode indicates
- the register is not used for calling a function. If the machine
- has register windows, this gives only the outbound registers.
- INCOMING_REGNO gives the corresponding inbound register. */
-static enum machine_mode apply_args_mode[FIRST_PSEUDO_REGISTER];
-
-/* For each register that may be used for returning values, this gives
- a mode used to copy the register's value. VOIDmode indicates the
- register is not used for returning values. If the machine has
- register windows, this gives only the outbound registers.
- INCOMING_REGNO gives the corresponding inbound register. */
-static enum machine_mode apply_result_mode[FIRST_PSEUDO_REGISTER];
+#define apply_args_mode \
+ (this_target_builtins->x_apply_args_mode)
+#define apply_result_mode \
+ (this_target_builtins->x_apply_result_mode)
/* Return the size required for the block returned by __builtin_apply_args,
and initialize apply_args_mode. */
@@ -1994,7 +1990,7 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
errno_set = false;
/* Before working hard, check whether the instruction is available. */
- if (optab_handler (builtin_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode) != CODE_FOR_nothing)
{
target = gen_reg_rtx (mode);
@@ -2096,7 +2092,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
mode = TYPE_MODE (TREE_TYPE (exp));
/* Before working hard, check whether the instruction is available. */
- if (optab_handler (builtin_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode) == CODE_FOR_nothing)
return NULL_RTX;
target = gen_reg_rtx (mode);
@@ -2173,7 +2169,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget)
/* Check if sincos insn is available, otherwise fallback
to sin or cos insn. */
- if (optab_handler (builtin_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode) == CODE_FOR_nothing)
switch (DECL_FUNCTION_CODE (fndecl))
{
CASE_FLT_FN (BUILT_IN_SIN):
@@ -2185,7 +2181,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget)
}
/* Before working hard, check whether the instruction is available. */
- if (optab_handler (builtin_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (builtin_optab, mode) != CODE_FOR_nothing)
{
target = gen_reg_rtx (mode);
@@ -2282,7 +2278,7 @@ interclass_mathfn_icode (tree arg, tree fndecl)
mode = TYPE_MODE (TREE_TYPE (arg));
if (builtin_optab)
- return optab_handler (builtin_optab, mode)->insn_code;
+ return optab_handler (builtin_optab, mode);
return CODE_FOR_nothing;
}
@@ -2370,7 +2366,7 @@ expand_builtin_sincos (tree exp)
mode = TYPE_MODE (TREE_TYPE (arg));
/* Check if sincos insn is available, otherwise emit the call. */
- if (optab_handler (sincos_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (sincos_optab, mode) == CODE_FOR_nothing)
return NULL_RTX;
target1 = gen_reg_rtx (mode);
@@ -2417,7 +2413,7 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
/* Try expanding via a sincos optab, fall back to emitting a libcall
to sincos or cexp. We are sure we have sincos or cexp because cexpi
is only generated from sincos, cexp or if we have either of them. */
- if (optab_handler (sincos_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (sincos_optab, mode) != CODE_FOR_nothing)
{
op1 = gen_reg_rtx (mode);
op2 = gen_reg_rtx (mode);
@@ -3080,8 +3076,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
smaller than pow (x, 1.5) if sqrt will not be expanded
as a call. */
|| (n == 3
- && (optab_handler (sqrt_optab, mode)->insn_code
- != CODE_FOR_nothing))))
+ && optab_handler (sqrt_optab, mode) != CODE_FOR_nothing)))
{
tree call_expr = build_call_nofold_loc (EXPR_LOCATION (exp), fn, 1,
narg0);
@@ -3272,7 +3267,7 @@ expand_builtin_strlen (tree exp, rtx target,
/* Bail out if we can't compute strlen in the right mode. */
while (insn_mode != VOIDmode)
{
- icode = optab_handler (strlen_optab, insn_mode)->insn_code;
+ icode = optab_handler (strlen_optab, insn_mode);
if (icode != CODE_FOR_nothing)
break;
@@ -4110,8 +4105,8 @@ expand_builtin_strcmp (tree exp, ATTRIBUTE_UNUSED rtx target)
return NULL_RTX;
#if defined HAVE_cmpstrsi || defined HAVE_cmpstrnsi
- if (cmpstr_optab[SImode] != CODE_FOR_nothing
- || cmpstrn_optab[SImode] != CODE_FOR_nothing)
+ if (direct_optab_handler (cmpstr_optab, SImode) != CODE_FOR_nothing
+ || direct_optab_handler (cmpstrn_optab, SImode) != CODE_FOR_nothing)
{
rtx arg1_rtx, arg2_rtx;
rtx result, insn = NULL_RTX;
@@ -4402,38 +4397,6 @@ expand_builtin_saveregs (void)
return val;
}
-/* __builtin_args_info (N) returns word N of the arg space info
- for the current function. The number and meanings of words
- is controlled by the definition of CUMULATIVE_ARGS. */
-
-static rtx
-expand_builtin_args_info (tree exp)
-{
- int nwords = sizeof (CUMULATIVE_ARGS) / sizeof (int);
- int *word_ptr = (int *) &crtl->args.info;
-
- gcc_assert (sizeof (CUMULATIVE_ARGS) % sizeof (int) == 0);
-
- if (call_expr_nargs (exp) != 0)
- {
- if (!host_integerp (CALL_EXPR_ARG (exp, 0), 0))
- error ("argument of %<__builtin_args_info%> must be constant");
- else
- {
- HOST_WIDE_INT wordnum = tree_low_cst (CALL_EXPR_ARG (exp, 0), 0);
-
- if (wordnum < 0 || wordnum >= nwords)
- error ("argument of %<__builtin_args_info%> out of range");
- else
- return GEN_INT (word_ptr[wordnum]);
- }
- }
- else
- error ("missing argument in %<__builtin_args_info%>");
-
- return const0_rtx;
-}
-
/* Expand a call to __builtin_next_arg. */
static rtx
@@ -4455,7 +4418,10 @@ stabilize_va_list_loc (location_t loc, tree valist, int needs_lvalue)
{
tree vatype = targetm.canonical_va_list_type (TREE_TYPE (valist));
- gcc_assert (vatype != NULL_TREE);
+ /* The current way of determining the type of valist is completely
+ bogus. We should have the information on the va builtin instead. */
+ if (!vatype)
+ vatype = targetm.fn_abi_va_list (cfun->decl);
if (TREE_CODE (vatype) == ARRAY_TYPE)
{
@@ -4474,21 +4440,21 @@ stabilize_va_list_loc (location_t loc, tree valist, int needs_lvalue)
}
else
{
- tree pt;
+ tree pt = build_pointer_type (vatype);
if (! needs_lvalue)
{
if (! TREE_SIDE_EFFECTS (valist))
return valist;
- pt = build_pointer_type (vatype);
valist = fold_build1_loc (loc, ADDR_EXPR, pt, valist);
TREE_SIDE_EFFECTS (valist) = 1;
}
if (TREE_SIDE_EFFECTS (valist))
valist = save_expr (valist);
- valist = build_fold_indirect_ref_loc (loc, valist);
+ valist = fold_build2_loc (loc, MEM_REF,
+ vatype, valist, build_int_cst (pt, 0));
}
return valist;
@@ -5251,6 +5217,10 @@ expand_builtin_init_trampoline (tree exp)
targetm.calls.trampoline_init (m_tramp, t_func, r_chain);
trampolines_created = 1;
+
+ warning_at (DECL_SOURCE_LOCATION (t_func), OPT_Wtrampolines,
+ "trampoline generated for nested function %qD", t_func);
+
return const0_rtx;
}
@@ -5305,7 +5275,7 @@ expand_builtin_signbit (tree exp, rtx target)
/* Check if the back end provides an insn that handles signbit for the
argument's mode. */
- icode = signbit_optab->handlers [(int) fmode].insn_code;
+ icode = optab_handler (signbit_optab, fmode);
if (icode != CODE_FOR_nothing)
{
rtx last = get_last_insn ();
@@ -5675,7 +5645,7 @@ expand_builtin_lock_release (enum machine_mode mode, tree exp)
mem = get_builtin_sync_mem (CALL_EXPR_ARG (exp, 0), mode);
/* If there is an explicit operation in the md file, use it. */
- icode = sync_lock_release[mode];
+ icode = direct_optab_handler (sync_lock_release_optab, mode);
if (icode != CODE_FOR_nothing)
{
if (!insn_data[icode].operand[1].predicate (val, mode))
@@ -5922,9 +5892,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_SAVEREGS:
return expand_builtin_saveregs ();
- case BUILT_IN_ARGS_INFO:
- return expand_builtin_args_info (exp);
-
case BUILT_IN_VA_ARG_PACK:
/* All valid uses of __builtin_va_arg_pack () are removed during
inlining. */
@@ -7624,8 +7591,7 @@ fold_builtin_int_roundingfn (location_t loc, tree fndecl, tree arg)
{
tree itype = TREE_TYPE (TREE_TYPE (fndecl));
tree ftype = TREE_TYPE (arg);
- unsigned HOST_WIDE_INT lo2;
- HOST_WIDE_INT hi, lo;
+ double_int val;
REAL_VALUE_TYPE r;
switch (DECL_FUNCTION_CODE (fndecl))
@@ -7649,9 +7615,9 @@ fold_builtin_int_roundingfn (location_t loc, tree fndecl, tree arg)
gcc_unreachable ();
}
- REAL_VALUE_TO_INT (&lo, &hi, r);
- if (!fit_double_type (lo, hi, &lo2, &hi, itype))
- return build_int_cst_wide (itype, lo2, hi);
+ real_to_integer2 ((HOST_WIDE_INT *)&val.low, &val.high, &r);
+ if (double_int_fits_to_tree_p (itype, val))
+ return double_int_to_tree (itype, val);
}
}
@@ -8346,6 +8312,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
{
tree srctype, desttype;
int src_align, dest_align;
+ tree off0;
if (endp == 3)
{
@@ -8371,37 +8338,26 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
}
/* If *src and *dest can't overlap, optimize into memcpy as well. */
- srcvar = build_fold_indirect_ref_loc (loc, src);
- destvar = build_fold_indirect_ref_loc (loc, dest);
- if (srcvar
- && !TREE_THIS_VOLATILE (srcvar)
- && destvar
- && !TREE_THIS_VOLATILE (destvar))
+ if (TREE_CODE (src) == ADDR_EXPR
+ && TREE_CODE (dest) == ADDR_EXPR)
{
tree src_base, dest_base, fn;
HOST_WIDE_INT src_offset = 0, dest_offset = 0;
HOST_WIDE_INT size = -1;
HOST_WIDE_INT maxsize = -1;
- src_base = srcvar;
- if (handled_component_p (src_base))
- src_base = get_ref_base_and_extent (src_base, &src_offset,
- &size, &maxsize);
- dest_base = destvar;
- if (handled_component_p (dest_base))
- dest_base = get_ref_base_and_extent (dest_base, &dest_offset,
- &size, &maxsize);
+ srcvar = TREE_OPERAND (src, 0);
+ src_base = get_ref_base_and_extent (srcvar, &src_offset,
+ &size, &maxsize);
+ destvar = TREE_OPERAND (dest, 0);
+ dest_base = get_ref_base_and_extent (destvar, &dest_offset,
+ &size, &maxsize);
if (host_integerp (len, 1))
- {
- maxsize = tree_low_cst (len, 1);
- if (maxsize
- > INTTYPE_MAXIMUM (HOST_WIDE_INT) / BITS_PER_UNIT)
- maxsize = -1;
- else
- maxsize *= BITS_PER_UNIT;
- }
+ maxsize = tree_low_cst (len, 1);
else
maxsize = -1;
+ src_offset /= BITS_PER_UNIT;
+ dest_offset /= BITS_PER_UNIT;
if (SSA_VAR_P (src_base)
&& SSA_VAR_P (dest_base))
{
@@ -8410,13 +8366,25 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
dest_offset, maxsize))
return NULL_TREE;
}
- else if (TREE_CODE (src_base) == INDIRECT_REF
- && TREE_CODE (dest_base) == INDIRECT_REF)
+ else if (TREE_CODE (src_base) == MEM_REF
+ && TREE_CODE (dest_base) == MEM_REF)
{
+ double_int off;
if (! operand_equal_p (TREE_OPERAND (src_base, 0),
- TREE_OPERAND (dest_base, 0), 0)
- || ranges_overlap_p (src_offset, maxsize,
- dest_offset, maxsize))
+ TREE_OPERAND (dest_base, 0), 0))
+ return NULL_TREE;
+ off = double_int_add (mem_ref_offset (src_base),
+ shwi_to_double_int (src_offset));
+ if (!double_int_fits_in_shwi_p (off))
+ return NULL_TREE;
+ src_offset = off.low;
+ off = double_int_add (mem_ref_offset (dest_base),
+ shwi_to_double_int (dest_offset));
+ if (!double_int_fits_in_shwi_p (off))
+ return NULL_TREE;
+ dest_offset = off.low;
+ if (ranges_overlap_p (src_offset, maxsize,
+ dest_offset, maxsize))
return NULL_TREE;
}
else
@@ -8472,12 +8440,12 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
dest = build1 (NOP_EXPR, build_pointer_type (desttype), dest);
}
if (!srctype || !desttype
+ || TREE_ADDRESSABLE (srctype)
+ || TREE_ADDRESSABLE (desttype)
|| !TYPE_SIZE_UNIT (srctype)
|| !TYPE_SIZE_UNIT (desttype)
|| TREE_CODE (TYPE_SIZE_UNIT (srctype)) != INTEGER_CST
- || TREE_CODE (TYPE_SIZE_UNIT (desttype)) != INTEGER_CST
- || TYPE_VOLATILE (srctype)
- || TYPE_VOLATILE (desttype))
+ || TREE_CODE (TYPE_SIZE_UNIT (desttype)) != INTEGER_CST)
return NULL_TREE;
src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT);
@@ -8489,97 +8457,44 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
if (!ignore)
dest = builtin_save_expr (dest);
- srcvar = NULL_TREE;
- if (tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len))
- {
- srcvar = build_fold_indirect_ref_loc (loc, src);
- if (TREE_THIS_VOLATILE (srcvar))
- return NULL_TREE;
- else if (!tree_int_cst_equal (tree_expr_size (srcvar), len))
- srcvar = NULL_TREE;
- /* With memcpy, it is possible to bypass aliasing rules, so without
- this check i.e. execute/20060930-2.c would be misoptimized,
- because it use conflicting alias set to hold argument for the
- memcpy call. This check is probably unnecessary with
- -fno-strict-aliasing. Similarly for destvar. See also
- PR29286. */
- else if (!var_decl_component_p (srcvar))
- srcvar = NULL_TREE;
- }
-
- destvar = NULL_TREE;
- if (tree_int_cst_equal (TYPE_SIZE_UNIT (desttype), len))
- {
- destvar = build_fold_indirect_ref_loc (loc, dest);
- if (TREE_THIS_VOLATILE (destvar))
- return NULL_TREE;
- else if (!tree_int_cst_equal (tree_expr_size (destvar), len))
- destvar = NULL_TREE;
- else if (!var_decl_component_p (destvar))
- destvar = NULL_TREE;
- }
+ /* Build accesses at offset zero with a ref-all character type. */
+ off0 = build_int_cst (build_pointer_type_for_mode (char_type_node,
+ ptr_mode, true), 0);
+
+ destvar = dest;
+ STRIP_NOPS (destvar);
+ if (TREE_CODE (destvar) == ADDR_EXPR
+ && var_decl_component_p (TREE_OPERAND (destvar, 0))
+ && tree_int_cst_equal (TYPE_SIZE_UNIT (desttype), len))
+ destvar = fold_build2 (MEM_REF, desttype, destvar, off0);
+ else
+ destvar = NULL_TREE;
+
+ srcvar = src;
+ STRIP_NOPS (srcvar);
+ if (TREE_CODE (srcvar) == ADDR_EXPR
+ && var_decl_component_p (TREE_OPERAND (srcvar, 0))
+ && tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len))
+ srcvar = fold_build2 (MEM_REF, destvar ? desttype : srctype,
+ srcvar, off0);
+ else
+ srcvar = NULL_TREE;
if (srcvar == NULL_TREE && destvar == NULL_TREE)
return NULL_TREE;
if (srcvar == NULL_TREE)
{
- tree srcptype;
- if (TREE_ADDRESSABLE (TREE_TYPE (destvar)))
- return NULL_TREE;
-
- srctype = build_qualified_type (desttype, 0);
- if (src_align < (int) TYPE_ALIGN (srctype))
- {
- if (AGGREGATE_TYPE_P (srctype)
- || SLOW_UNALIGNED_ACCESS (TYPE_MODE (srctype), src_align))
- return NULL_TREE;
-
- srctype = build_variant_type_copy (srctype);
- TYPE_ALIGN (srctype) = src_align;
- TYPE_USER_ALIGN (srctype) = 1;
- TYPE_PACKED (srctype) = 1;
- }
- srcptype = build_pointer_type_for_mode (srctype, ptr_mode, true);
- src = fold_convert_loc (loc, srcptype, src);
- srcvar = build_fold_indirect_ref_loc (loc, src);
+ STRIP_NOPS (src);
+ srcvar = fold_build2 (MEM_REF, desttype, src, off0);
}
else if (destvar == NULL_TREE)
{
- tree destptype;
- if (TREE_ADDRESSABLE (TREE_TYPE (srcvar)))
- return NULL_TREE;
-
- desttype = build_qualified_type (srctype, 0);
- if (dest_align < (int) TYPE_ALIGN (desttype))
- {
- if (AGGREGATE_TYPE_P (desttype)
- || SLOW_UNALIGNED_ACCESS (TYPE_MODE (desttype), dest_align))
- return NULL_TREE;
+ STRIP_NOPS (dest);
+ destvar = fold_build2 (MEM_REF, srctype, dest, off0);
+ }
- desttype = build_variant_type_copy (desttype);
- TYPE_ALIGN (desttype) = dest_align;
- TYPE_USER_ALIGN (desttype) = 1;
- TYPE_PACKED (desttype) = 1;
- }
- destptype = build_pointer_type_for_mode (desttype, ptr_mode, true);
- dest = fold_convert_loc (loc, destptype, dest);
- destvar = build_fold_indirect_ref_loc (loc, dest);
- }
-
- if (srctype == desttype
- || (gimple_in_ssa_p (cfun)
- && useless_type_conversion_p (desttype, srctype)))
- expr = srcvar;
- else if ((INTEGRAL_TYPE_P (TREE_TYPE (srcvar))
- || POINTER_TYPE_P (TREE_TYPE (srcvar)))
- && (INTEGRAL_TYPE_P (TREE_TYPE (destvar))
- || POINTER_TYPE_P (TREE_TYPE (destvar))))
- expr = fold_convert_loc (loc, TREE_TYPE (destvar), srcvar);
- else
- expr = fold_build1_loc (loc, VIEW_CONVERT_EXPR,
- TREE_TYPE (destvar), srcvar);
- expr = build2 (MODIFY_EXPR, TREE_TYPE (destvar), destvar, expr);
+ expr = build2 (MODIFY_EXPR, TREE_TYPE (destvar), destvar, srcvar);
}
if (ignore)
@@ -10726,23 +10641,31 @@ fold_call_expr (location_t loc, tree exp, bool ignore)
}
/* Conveniently construct a function call expression. FNDECL names the
- function to be called and ARGLIST is a TREE_LIST of arguments. */
+ function to be called and N arguments are passed in the array
+ ARGARRAY. */
tree
-build_function_call_expr (location_t loc, tree fndecl, tree arglist)
+build_call_expr_loc_array (location_t loc, tree fndecl, int n, tree *argarray)
{
tree fntype = TREE_TYPE (fndecl);
tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
- int n = list_length (arglist);
- tree *argarray = (tree *) alloca (n * sizeof (tree));
- int i;
-
- for (i = 0; i < n; i++, arglist = TREE_CHAIN (arglist))
- argarray[i] = TREE_VALUE (arglist);
+
return fold_builtin_call_array (loc, TREE_TYPE (fntype), fn, n, argarray);
}
/* Conveniently construct a function call expression. FNDECL names the
+ function to be called and the arguments are passed in the vector
+ VEC. */
+
+tree
+build_call_expr_loc_vec (location_t loc, tree fndecl, VEC(tree,gc) *vec)
+{
+ return build_call_expr_loc_array (loc, fndecl, VEC_length (tree, vec),
+ VEC_address (tree, vec));
+}
+
+
+/* Conveniently construct a function call expression. FNDECL names the
function to be called, N is the number of arguments, and the "..."
parameters are the argument expressions. */
@@ -10750,16 +10673,14 @@ tree
build_call_expr_loc (location_t loc, tree fndecl, int n, ...)
{
va_list ap;
- tree fntype = TREE_TYPE (fndecl);
- tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
- tree *argarray = (tree *) alloca (n * sizeof (tree));
+ tree *argarray = XALLOCAVEC (tree, n);
int i;
va_start (ap, n);
for (i = 0; i < n; i++)
argarray[i] = va_arg (ap, tree);
va_end (ap);
- return fold_builtin_call_array (loc, TREE_TYPE (fntype), fn, n, argarray);
+ return build_call_expr_loc_array (loc, fndecl, n, argarray);
}
/* Like build_call_expr_loc (UNKNOWN_LOCATION, ...). Duplicated because
@@ -10769,17 +10690,14 @@ tree
build_call_expr (tree fndecl, int n, ...)
{
va_list ap;
- tree fntype = TREE_TYPE (fndecl);
- tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
- tree *argarray = (tree *) alloca (n * sizeof (tree));
+ tree *argarray = XALLOCAVEC (tree, n);
int i;
va_start (ap, n);
for (i = 0; i < n; i++)
argarray[i] = va_arg (ap, tree);
va_end (ap);
- return fold_builtin_call_array (UNKNOWN_LOCATION, TREE_TYPE (fntype),
- fn, n, argarray);
+ return build_call_expr_loc_array (UNKNOWN_LOCATION, fndecl, n, argarray);
}
/* Construct a CALL_EXPR with type TYPE with FN as the function expression.
@@ -12068,7 +11986,7 @@ maybe_emit_free_warning (tree exp)
return;
arg = get_base_address (TREE_OPERAND (arg, 0));
- if (arg == NULL || INDIRECT_REF_P (arg))
+ if (arg == NULL || INDIRECT_REF_P (arg) || TREE_CODE (arg) == MEM_REF)
return;
if (SSA_VAR_P (arg))
@@ -12085,7 +12003,7 @@ maybe_emit_free_warning (tree exp)
tree
fold_builtin_object_size (tree ptr, tree ost)
{
- tree ret = NULL_TREE;
+ unsigned HOST_WIDE_INT bytes;
int object_size_type;
if (!validate_arg (ptr, POINTER_TYPE)
@@ -12108,31 +12026,25 @@ fold_builtin_object_size (tree ptr, tree ost)
return build_int_cst_type (size_type_node, object_size_type < 2 ? -1 : 0);
if (TREE_CODE (ptr) == ADDR_EXPR)
- ret = build_int_cstu (size_type_node,
- compute_builtin_object_size (ptr, object_size_type));
-
+ {
+ bytes = compute_builtin_object_size (ptr, object_size_type);
+ if (double_int_fits_to_tree_p (size_type_node,
+ uhwi_to_double_int (bytes)))
+ return build_int_cstu (size_type_node, bytes);
+ }
else if (TREE_CODE (ptr) == SSA_NAME)
{
- unsigned HOST_WIDE_INT bytes;
-
/* If object size is not known yet, delay folding until
later. Maybe subsequent passes will help determining
it. */
bytes = compute_builtin_object_size (ptr, object_size_type);
- if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2
- ? -1 : 0))
- ret = build_int_cstu (size_type_node, bytes);
- }
-
- if (ret)
- {
- unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (ret);
- HOST_WIDE_INT high = TREE_INT_CST_HIGH (ret);
- if (fit_double_type (low, high, &low, &high, TREE_TYPE (ret)))
- ret = NULL_TREE;
+ if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2 ? -1 : 0)
+ && double_int_fits_to_tree_p (size_type_node,
+ uhwi_to_double_int (bytes)))
+ return build_int_cstu (size_type_node, bytes);
}
- return ret;
+ return NULL_TREE;
}
/* Fold a call to the __mem{cpy,pcpy,move,set}_chk builtin.
@@ -13809,3 +13721,123 @@ set_builtin_user_assembler_name (tree decl, const char *asmspec)
break;
}
}
+
+/* Return true if DECL is a builtin that expands to a constant or similarly
+ simple code. */
+bool
+is_simple_builtin (tree decl)
+{
+ if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (decl))
+ {
+ /* Builtins that expand to constants. */
+ case BUILT_IN_CONSTANT_P:
+ case BUILT_IN_EXPECT:
+ case BUILT_IN_OBJECT_SIZE:
+ case BUILT_IN_UNREACHABLE:
+ /* Simple register moves or loads from stack. */
+ case BUILT_IN_RETURN_ADDRESS:
+ case BUILT_IN_EXTRACT_RETURN_ADDR:
+ case BUILT_IN_FROB_RETURN_ADDR:
+ case BUILT_IN_RETURN:
+ case BUILT_IN_AGGREGATE_INCOMING_ADDRESS:
+ case BUILT_IN_FRAME_ADDRESS:
+ case BUILT_IN_VA_END:
+ case BUILT_IN_STACK_SAVE:
+ case BUILT_IN_STACK_RESTORE:
+ /* Exception state returns or moves registers around. */
+ case BUILT_IN_EH_FILTER:
+ case BUILT_IN_EH_POINTER:
+ case BUILT_IN_EH_COPY_VALUES:
+ return true;
+
+ default:
+ return false;
+ }
+
+ return false;
+}
+
+/* Return true if DECL is a builtin that is not expensive, i.e., they are
+ most probably expanded inline into reasonably simple code. This is a
+ superset of is_simple_builtin. */
+bool
+is_inexpensive_builtin (tree decl)
+{
+ if (!decl)
+ return false;
+ else if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_MD)
+ return true;
+ else if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (decl))
+ {
+ case BUILT_IN_ABS:
+ case BUILT_IN_ALLOCA:
+ case BUILT_IN_BSWAP32:
+ case BUILT_IN_BSWAP64:
+ case BUILT_IN_CLZ:
+ case BUILT_IN_CLZIMAX:
+ case BUILT_IN_CLZL:
+ case BUILT_IN_CLZLL:
+ case BUILT_IN_CTZ:
+ case BUILT_IN_CTZIMAX:
+ case BUILT_IN_CTZL:
+ case BUILT_IN_CTZLL:
+ case BUILT_IN_FFS:
+ case BUILT_IN_FFSIMAX:
+ case BUILT_IN_FFSL:
+ case BUILT_IN_FFSLL:
+ case BUILT_IN_IMAXABS:
+ case BUILT_IN_FINITE:
+ case BUILT_IN_FINITEF:
+ case BUILT_IN_FINITEL:
+ case BUILT_IN_FINITED32:
+ case BUILT_IN_FINITED64:
+ case BUILT_IN_FINITED128:
+ case BUILT_IN_FPCLASSIFY:
+ case BUILT_IN_ISFINITE:
+ case BUILT_IN_ISINF_SIGN:
+ case BUILT_IN_ISINF:
+ case BUILT_IN_ISINFF:
+ case BUILT_IN_ISINFL:
+ case BUILT_IN_ISINFD32:
+ case BUILT_IN_ISINFD64:
+ case BUILT_IN_ISINFD128:
+ case BUILT_IN_ISNAN:
+ case BUILT_IN_ISNANF:
+ case BUILT_IN_ISNANL:
+ case BUILT_IN_ISNAND32:
+ case BUILT_IN_ISNAND64:
+ case BUILT_IN_ISNAND128:
+ case BUILT_IN_ISNORMAL:
+ case BUILT_IN_ISGREATER:
+ case BUILT_IN_ISGREATEREQUAL:
+ case BUILT_IN_ISLESS:
+ case BUILT_IN_ISLESSEQUAL:
+ case BUILT_IN_ISLESSGREATER:
+ case BUILT_IN_ISUNORDERED:
+ case BUILT_IN_VA_ARG_PACK:
+ case BUILT_IN_VA_ARG_PACK_LEN:
+ case BUILT_IN_VA_COPY:
+ case BUILT_IN_TRAP:
+ case BUILT_IN_SAVEREGS:
+ case BUILT_IN_POPCOUNTL:
+ case BUILT_IN_POPCOUNTLL:
+ case BUILT_IN_POPCOUNTIMAX:
+ case BUILT_IN_POPCOUNT:
+ case BUILT_IN_PARITYL:
+ case BUILT_IN_PARITYLL:
+ case BUILT_IN_PARITYIMAX:
+ case BUILT_IN_PARITY:
+ case BUILT_IN_LABS:
+ case BUILT_IN_LLABS:
+ case BUILT_IN_PREFETCH:
+ return true;
+
+ default:
+ return is_simple_builtin (decl);
+ }
+
+ return false;
+}
+
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 4e4eb3edc03..ab0d018cb28 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -606,7 +606,6 @@ DEF_GCC_BUILTIN (BUILT_IN_AGGREGATE_INCOMING_ADDRESS, "aggregate_incoming
DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, "alloca", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL)
-DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_CLEAR_CACHE, "__clear_cache", BT_FN_VOID_PTR_PTR, ATTR_NOTHROW_LIST)
diff --git a/gcc/builtins.h b/gcc/builtins.h
new file mode 100644
index 00000000000..a7d14581e99
--- /dev/null
+++ b/gcc/builtins.h
@@ -0,0 +1,49 @@
+/* Expand builtin functions.
+ Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_BUILTINS_H
+#define GCC_BUILTINS_H
+
+/* Target-dependent globals. */
+struct target_builtins {
+ /* For each register that may be used for calling a function, this
+ gives a mode used to copy the register's value. VOIDmode indicates
+ the register is not used for calling a function. If the machine
+ has register windows, this gives only the outbound registers.
+ INCOMING_REGNO gives the corresponding inbound register. */
+ enum machine_mode x_apply_args_mode[FIRST_PSEUDO_REGISTER];
+
+ /* For each register that may be used for returning values, this gives
+ a mode used to copy the register's value. VOIDmode indicates the
+ register is not used for returning values. If the machine has
+ register windows, this gives only the outbound registers.
+ INCOMING_REGNO gives the corresponding inbound register. */
+ enum machine_mode x_apply_result_mode[FIRST_PSEUDO_REGISTER];
+};
+
+extern GTY(()) struct target_builtins default_target_builtins;
+#if SWITCHABLE_TARGET
+extern struct target_builtins *this_target_builtins;
+#else
+#define this_target_builtins (&default_target_builtins)
+#endif
+
+#endif
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index dafe1dffbfd..f95a79e0aa5 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1076,7 +1076,7 @@ pop_scope (void)
{
tree file_decl = build_decl (UNKNOWN_LOCATION,
TRANSLATION_UNIT_DECL, 0, 0);
- TREE_CHAIN (file_decl) = all_translation_units;
+ DECL_CHAIN (file_decl) = all_translation_units;
all_translation_units = file_decl;
context = file_decl;
}
@@ -1100,7 +1100,7 @@ pop_scope (void)
warn_for_unused_label (p);
/* Labels go in BLOCK_VARS. */
- TREE_CHAIN (p) = BLOCK_VARS (block);
+ DECL_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;
gcc_assert (I_LABEL_BINDING (b->id) == b);
I_LABEL_BINDING (b->id) = b->shadowed;
@@ -1188,7 +1188,7 @@ pop_scope (void)
binding in the home scope. */
if (!b->nested)
{
- TREE_CHAIN (p) = BLOCK_VARS (block);
+ DECL_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;
}
else if (VAR_OR_FUNCTION_DECL_P (p))
@@ -1211,7 +1211,7 @@ pop_scope (void)
}
if (b->locus != UNKNOWN_LOCATION)
DECL_SOURCE_LOCATION (extp) = b->locus;
- TREE_CHAIN (extp) = BLOCK_VARS (block);
+ DECL_CHAIN (extp) = BLOCK_VARS (block);
BLOCK_VARS (block) = extp;
}
/* If this is the file scope, and we are processing more
@@ -1293,7 +1293,7 @@ push_file_scope (void)
start_fname_decls ();
- for (decl = visible_builtins; decl; decl = TREE_CHAIN (decl))
+ for (decl = visible_builtins; decl; decl = DECL_CHAIN (decl))
bind (DECL_NAME (decl), decl, file_scope,
/*invisible=*/false, /*nested=*/true, DECL_SOURCE_LOCATION (decl));
}
@@ -2400,7 +2400,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl);
DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
DECL_ARGUMENTS (newdecl) = copy_list (DECL_ARGUMENTS (olddecl));
- for (t = DECL_ARGUMENTS (newdecl); t ; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (newdecl); t ; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = newdecl;
/* See if we've got a function to instantiate from. */
@@ -3584,7 +3584,7 @@ c_builtin_function (tree decl)
needing to be explicitly declared. See push_file_scope. */
if (name[0] == '_' && (name[1] == '_' || ISUPPER (name[1])))
{
- TREE_CHAIN (decl) = visible_builtins;
+ DECL_CHAIN (decl) = visible_builtins;
visible_builtins = decl;
}
@@ -3610,7 +3610,7 @@ c_builtin_function_ext_scope (tree decl)
needing to be explicitly declared. See push_file_scope. */
if (name[0] == '_' && (name[1] == '_' || ISUPPER (name[1])))
{
- TREE_CHAIN (decl) = visible_builtins;
+ DECL_CHAIN (decl) = visible_builtins;
visible_builtins = decl;
}
@@ -4078,7 +4078,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
if (ce->kind == cdk_function)
{
tree args = ce->u.arg_info->parms;
- for (; args; args = TREE_CHAIN (args))
+ for (; args; args = DECL_CHAIN (args))
{
tree type = TREE_TYPE (args);
if (type && INTEGRAL_TYPE_P (type)
@@ -4591,8 +4591,8 @@ flexible_array_type_p (tree type)
x = TYPE_FIELDS (type);
if (x == NULL_TREE)
return false;
- while (TREE_CHAIN (x) != NULL_TREE)
- x = TREE_CHAIN (x);
+ while (DECL_CHAIN (x) != NULL_TREE)
+ x = DECL_CHAIN (x);
if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE
&& TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE
&& TYPE_DOMAIN (TREE_TYPE (x)) != NULL_TREE
@@ -4600,7 +4600,7 @@ flexible_array_type_p (tree type)
return true;
return false;
case UNION_TYPE:
- for (x = TYPE_FIELDS (type); x != NULL_TREE; x = TREE_CHAIN (x))
+ for (x = TYPE_FIELDS (type); x != NULL_TREE; x = DECL_CHAIN (x))
{
if (flexible_array_type_p (TREE_TYPE (x)))
return true;
@@ -6142,7 +6142,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
for (parm = arg_info->parms, typelt = arg_types, parmno = 1;
parm;
- parm = TREE_CHAIN (parm), typelt = TREE_CHAIN (typelt), parmno++)
+ parm = DECL_CHAIN (parm), typelt = TREE_CHAIN (typelt), parmno++)
{
type = TREE_VALUE (typelt);
if (type == error_mark_node)
@@ -6289,7 +6289,7 @@ get_parm_info (bool ellipsis)
else
{
/* Valid parameter, add it to the list. */
- TREE_CHAIN (decl) = parms;
+ DECL_CHAIN (decl) = parms;
parms = decl;
/* Since there is a prototype, args are passed in their
@@ -6353,7 +6353,7 @@ get_parm_info (bool ellipsis)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
? b->nested
: !b->nested);
- TREE_CHAIN (decl) = others;
+ DECL_CHAIN (decl) = others;
others = decl;
/* fall through */
@@ -6676,7 +6676,7 @@ detect_field_duplicates_hash (tree fieldlist, htab_t htab)
tree x, y;
void **slot;
- for (x = fieldlist; x ; x = TREE_CHAIN (x))
+ for (x = fieldlist; x ; x = DECL_CHAIN (x))
if ((y = DECL_NAME (x)) != 0)
{
slot = htab_find_slot (htab, y, INSERT);
@@ -6705,7 +6705,7 @@ detect_field_duplicates (tree fieldlist)
This is trivially true if there are zero or one fields. */
if (!fieldlist)
return;
- x = TREE_CHAIN (fieldlist);
+ x = DECL_CHAIN (fieldlist);
if (!x)
return;
do {
@@ -6714,7 +6714,7 @@ detect_field_duplicates (tree fieldlist)
&& (TREE_CODE (TREE_TYPE (x)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (x)) == UNION_TYPE))
timeout = 0;
- x = TREE_CHAIN (x);
+ x = DECL_CHAIN (x);
} while (timeout > 0 && x);
/* If there were "few" fields and no anonymous structures or unions,
@@ -6722,7 +6722,7 @@ detect_field_duplicates (tree fieldlist)
the nested traversal thing. */
if (timeout > 0)
{
- for (x = TREE_CHAIN (fieldlist); x ; x = TREE_CHAIN (x))
+ for (x = DECL_CHAIN (fieldlist); x; x = DECL_CHAIN (x))
if (DECL_NAME (x))
{
for (y = fieldlist; y != x; y = TREE_CHAIN (y))
@@ -6777,7 +6777,7 @@ warn_cxx_compat_finish_struct (tree fieldlist)
++ix)
pointer_set_insert (tset, DECL_NAME (x));
- for (x = fieldlist; x != NULL_TREE; x = TREE_CHAIN (x))
+ for (x = fieldlist; x != NULL_TREE; x = DECL_CHAIN (x))
{
if (pointer_set_contains (tset, DECL_NAME (x)))
{
@@ -6826,7 +6826,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
if (pedantic)
{
- for (x = fieldlist; x; x = TREE_CHAIN (x))
+ for (x = fieldlist; x; x = DECL_CHAIN (x))
{
if (DECL_NAME (x) != 0)
break;
@@ -6863,7 +6863,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
until now.) */
saw_named_field = 0;
- for (x = fieldlist; x; x = TREE_CHAIN (x))
+ for (x = fieldlist; x; x = DECL_CHAIN (x))
{
if (TREE_TYPE (x) == error_mark_node)
continue;
@@ -6918,7 +6918,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
"flexible array member in union");
TREE_TYPE (x) = error_mark_node;
}
- else if (TREE_CHAIN (x) != NULL_TREE)
+ else if (DECL_CHAIN (x) != NULL_TREE)
{
error_at (DECL_SOURCE_LOCATION (x),
"flexible array member not at end of struct");
@@ -6971,7 +6971,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
DECL_INITIAL (*fieldlistp) = 0;
}
else
- fieldlistp = &TREE_CHAIN (*fieldlistp);
+ fieldlistp = &DECL_CHAIN (*fieldlistp);
}
/* Now we have the truly final field list.
@@ -6985,7 +6985,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
{
int len = 0;
- for (x = fieldlist; x; x = TREE_CHAIN (x))
+ for (x = fieldlist; x; x = DECL_CHAIN (x))
{
if (len > 15 || DECL_NAME (x) == NULL)
break;
@@ -7011,7 +7011,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
len = 0;
space->s = space2;
field_array = &space2->elts[0];
- for (x = fieldlist; x; x = TREE_CHAIN (x))
+ for (x = fieldlist; x; x = DECL_CHAIN (x))
{
field_array[len++] = x;
@@ -7683,7 +7683,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
/* Now make all the parameter declarations visible in the function body.
We can bypass most of the grunt work of pushdecl. */
- for (decl = arg_info->parms; decl; decl = TREE_CHAIN (decl))
+ for (decl = arg_info->parms; decl; decl = DECL_CHAIN (decl))
{
DECL_CONTEXT (decl) = current_function_decl;
if (DECL_NAME (decl))
@@ -7707,7 +7707,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
DECL_ARGUMENTS (fndecl) = arg_info->parms;
/* Now make all the ancillary declarations visible, likewise. */
- for (decl = arg_info->others; decl; decl = TREE_CHAIN (decl))
+ for (decl = arg_info->others; decl; decl = DECL_CHAIN (decl))
{
DECL_CONTEXT (decl) = current_function_decl;
if (DECL_NAME (decl))
@@ -7859,10 +7859,10 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
for (parm = TREE_CHAIN (parm); parm; parm = TREE_CHAIN (parm))
if (TREE_PURPOSE (parm))
{
- TREE_CHAIN (last) = TREE_PURPOSE (parm);
+ DECL_CHAIN (last) = TREE_PURPOSE (parm);
last = TREE_PURPOSE (parm);
}
- TREE_CHAIN (last) = 0;
+ DECL_CHAIN (last) = 0;
}
pointer_set_destroy (seen_args);
@@ -7878,7 +7878,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
type = current_function_prototype_arg_types;
parm || (type && TREE_VALUE (type) != error_mark_node
&& (TYPE_MAIN_VARIANT (TREE_VALUE (type)) != void_type_node));
- parm = TREE_CHAIN (parm), type = TREE_CHAIN (type))
+ parm = DECL_CHAIN (parm), type = TREE_CHAIN (type))
{
if (parm == 0 || type == 0
|| TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
@@ -7969,7 +7969,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
{
tree actual = 0, last = 0, type;
- for (parm = DECL_ARGUMENTS (fndecl); parm; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
{
type = tree_cons (NULL_TREE, DECL_ARG_TYPE (parm), NULL_TREE);
if (last)
@@ -8076,7 +8076,7 @@ store_parm_decls (void)
/* Finish up a function declaration and compile that function
- all the way to assembler language output. The free the storage
+ all the way to assembler language output. Then free the storage
for the function definition.
This is called after parsing the body of the function definition. */
@@ -8090,7 +8090,7 @@ finish_function (void)
&& targetm.calls.promote_prototypes (TREE_TYPE (fndecl)))
{
tree args = DECL_ARGUMENTS (fndecl);
- for (; args; args = TREE_CHAIN (args))
+ for (; args; args = DECL_CHAIN (args))
{
tree type = TREE_TYPE (args);
if (INTEGRAL_TYPE_P (type)
@@ -8157,7 +8157,7 @@ finish_function (void)
for (decl = DECL_ARGUMENTS (fndecl);
decl;
- decl = TREE_CHAIN (decl))
+ decl = DECL_CHAIN (decl))
if (TREE_USED (decl)
&& TREE_CODE (decl) == PARM_DECL
&& !DECL_READ_P (decl)
@@ -9593,7 +9593,7 @@ c_write_global_declarations_1 (tree globals, bool ext_scope)
bool reconsider;
/* Process the decls in the order they were written. */
- for (decl = globals; decl; decl = TREE_CHAIN (decl))
+ for (decl = globals; decl; decl = DECL_CHAIN (decl))
{
/* Check for used but undefined static functions using the C
standard's definition of "used", and set TREE_NO_WARNING so
@@ -9629,12 +9629,12 @@ c_write_global_declarations_1 (tree globals, bool ext_scope)
do
{
reconsider = false;
- for (decl = globals; decl; decl = TREE_CHAIN (decl))
+ for (decl = globals; decl; decl = DECL_CHAIN (decl))
reconsider |= wrapup_global_declaration_2 (decl);
}
while (reconsider);
- for (decl = globals; decl; decl = TREE_CHAIN (decl))
+ for (decl = globals; decl; decl = DECL_CHAIN (decl))
check_global_declaration_1 (decl);
}
@@ -9646,7 +9646,7 @@ c_write_global_declarations_2 (tree globals)
{
tree decl;
- for (decl = globals; decl ; decl = TREE_CHAIN (decl))
+ for (decl = globals; decl ; decl = DECL_CHAIN (decl))
debug_hooks->global_decl (decl);
}
@@ -9730,7 +9730,7 @@ c_write_global_declarations (void)
/* Process all file scopes in this compilation, and the external_scope,
through wrapup_global_declarations and check_global_declarations. */
- for (t = all_translation_units; t; t = TREE_CHAIN (t))
+ for (t = all_translation_units; t; t = DECL_CHAIN (t))
c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t)), false);
c_write_global_declarations_1 (BLOCK_VARS (ext_block), true);
@@ -9743,7 +9743,7 @@ c_write_global_declarations (void)
if (!seen_error ())
{
timevar_push (TV_SYMOUT);
- for (t = all_translation_units; t; t = TREE_CHAIN (t))
+ for (t = all_translation_units; t; t = DECL_CHAIN (t))
c_write_global_declarations_2 (BLOCK_VARS (DECL_INITIAL (t)));
c_write_global_declarations_2 (BLOCK_VARS (ext_block));
timevar_pop (TV_SYMOUT);
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 4047ca54176..b1d118fe6a1 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,40 @@
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
+ * c-format.c: Likewise.
+
+2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * c-common.h: Include diagnostic-core.h. Error if already
+ included.
+ * c-semantics.c: Do not define GCC_DIAG_STYLE here.
+
+2010-07-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * c-family/c-common.c (IN_GCC_FRONTEND): Do not undef.
+ Do not include expr.h
+ (vector_mode_valid_p): Move here.
+
+2010-06-21 DJ Delorie <dj@redhat.com>
+
+ * c-pragma.c (handle_pragma_diagnostic): Add push/pop,
+ allow these pragmas anywhere.
+
+2010-06-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/44509
+ * c-cppbuiltin.c: Include gt-c-family-c-cppbuiltin.h.
+ (lazy_hex_fp_values, lazy_hex_fp_value_count): Add GTY(()) markers.
+ (lazy_hex_fp_value, builtin_define_with_hex_fp_value): Use
+ ggc_strdup instead of xstrdup.
+
+2010-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ * c-cppbuiltin.c: Include cpp-id-data.h.
+ (lazy_hex_fp_values, lazy_hex_fp_value_count): New variables.
+ (lazy_hex_fp_value): New function.
+ (builtin_define_with_hex_fp_value): Provide definitions lazily.
+
2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-gimplify.c: Do not include tree-flow.h
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index aaaa2727c4f..3614d0e8e9e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -19,10 +19,6 @@ 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/>. */
-/* FIXME: Still need to include rtl.h here (via expr.h) in a front-end file.
- Pretend this is a back-end file. */
-#undef IN_GCC_FRONTEND
-
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -50,8 +46,6 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "libfuncs.h"
-#include "expr.h" /* For vector_mode_valid_p */
-
cpp_reader *parse_in; /* Declared in c-pragma.h. */
/* The following symbols are subsumed in the c_global_trees array, and
@@ -4031,7 +4025,7 @@ c_type_hash (const void *p)
default:
gcc_unreachable ();
}
- for (; t2; t2 = TREE_CHAIN (t2))
+ for (; t2; t2 = DECL_CHAIN (t2))
i++;
/* We might have a VLA here. */
if (TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST)
@@ -6252,6 +6246,40 @@ handle_destructor_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
+/* Nonzero if the mode is a valid vector mode for this architecture.
+ This returns nonzero even if there is no hardware support for the
+ vector mode, but we can emulate with narrower modes. */
+
+static int
+vector_mode_valid_p (enum machine_mode mode)
+{
+ enum mode_class mclass = GET_MODE_CLASS (mode);
+ enum machine_mode innermode;
+
+ /* Doh! What's going on? */
+ if (mclass != MODE_VECTOR_INT
+ && mclass != MODE_VECTOR_FLOAT
+ && mclass != MODE_VECTOR_FRACT
+ && mclass != MODE_VECTOR_UFRACT
+ && mclass != MODE_VECTOR_ACCUM
+ && mclass != MODE_VECTOR_UACCUM)
+ return 0;
+
+ /* Hardware support. Woo hoo! */
+ if (targetm.vector_mode_supported_p (mode))
+ return 1;
+
+ innermode = GET_MODE_INNER (mode);
+
+ /* We should probably return 1 if requesting V4DI and we have no DI,
+ but we have V2DI, but this is probably very unlikely. */
+
+ /* If we have support for the inner mode, we can safely emulate it.
+ We may not have V2DI, but me can emulate with a pair of DIs. */
+ return targetm.scalar_mode_supported_p (innermode);
+}
+
+
/* Handle a "mode" attribute; arguments as in
struct attribute_spec.handler. */
@@ -8391,8 +8419,8 @@ fold_offsetof_1 (tree expr, tree stop_ref)
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (v, 0)))
== RECORD_TYPE)
{
- tree fld_chain = TREE_CHAIN (TREE_OPERAND (v, 1));
- for (; fld_chain; fld_chain = TREE_CHAIN (fld_chain))
+ tree fld_chain = DECL_CHAIN (TREE_OPERAND (v, 1));
+ for (; fld_chain; fld_chain = DECL_CHAIN (fld_chain))
if (TREE_CODE (fld_chain) == FIELD_DECL)
break;
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 5784746e90a..78cf4fdb2b5 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -28,9 +28,15 @@ along with GCC; see the file COPYING3. If not see
/* In order for the format checking to accept the C frontend
diagnostic framework extensions, you must include this file before
- toplev.h, not after. The C front end formats are a subset of those
+ diagnostic-core.h, not after. The C front end formats are a subset of those
for C++, so they are the appropriate set to use in common code;
cp-tree.h overrides this for C++. */
+#if defined(GCC_DIAGNOSTIC_CORE_H)
+#error \
+In order for the format checking to accept the C front end diagnostic \
+framework extensions, you must include this file before diagnostic-core.h \
+never after.
+#endif
#ifndef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_cdiag__
#endif
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 2c73ead370c..e7fd2295d52 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -911,7 +911,7 @@ check_function_format (tree attrs, int nargs, tree *argarray)
tree args;
for (args = DECL_ARGUMENTS (current_function_decl);
args != 0;
- args = TREE_CHAIN (args))
+ args = DECL_CHAIN (args))
{
if (TREE_CODE (TREE_TYPE (args)) == POINTER_TYPE
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (args)))
diff --git a/gcc/c-family/c-semantics.c b/gcc/c-family/c-semantics.c
index 683655f77c0..0eccd5189e4 100644
--- a/gcc/c-family/c-semantics.c
+++ b/gcc/c-family/c-semantics.c
@@ -27,10 +27,6 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "splay-tree.h"
#include "c-common.h"
-/* In order for the format checking to accept the C frontend
- diagnostic framework extensions, you must define this token before
- including toplev.h. */
-#define GCC_DIAG_STYLE __gcc_cdiag__
#include "toplev.h"
#include "flags.h"
#include "output.h"
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 0493524a1b2..306d46ba65f 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -2229,7 +2229,7 @@ c_parser_struct_declaration (c_parser *parser)
declarator, specs, width, &all_prefix_attrs);
decl_attributes (&d, chainon (postfix_attrs,
all_prefix_attrs), 0);
- TREE_CHAIN (d) = decls;
+ DECL_CHAIN (d) = decls;
decls = d;
if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE))
all_prefix_attrs = chainon (c_parser_attributes (parser),
@@ -5847,9 +5847,8 @@ c_parser_postfix_expression (c_parser *parser)
e1 = TYPE_MAIN_VARIANT (groktypename (t1, NULL, NULL));
e2 = TYPE_MAIN_VARIANT (groktypename (t2, NULL, NULL));
- expr.value = comptypes (e1, e2)
- ? build_int_cst (NULL_TREE, 1)
- : build_int_cst (NULL_TREE, 0);
+ expr.value
+ = comptypes (e1, e2) ? integer_one_node : integer_zero_node;
}
break;
case RID_AT_SELECTOR:
@@ -6431,7 +6430,7 @@ c_parser_objc_class_instance_variables (c_parser *parser)
/* Comma-separated instance variables are chained together in
reverse order; add them one by one. */
tree ivar = nreverse (decls);
- for (; ivar; ivar = TREE_CHAIN (ivar))
+ for (; ivar; ivar = DECL_CHAIN (ivar))
objc_add_instance_variable (copy_node (ivar));
}
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index a607ecdeda6..984b5975f8d 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#define GCC_C_TREE_H
#include "c-family/c-common.h"
-#include "toplev.h"
#include "diagnostic.h"
/* struct lang_identifier is private to c-decl.c, but langhooks.c needs to
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 57f3faaee03..e69c877f243 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -555,7 +555,7 @@ composite_type (tree t1, tree t2)
&& TREE_CODE (mv2) != ARRAY_TYPE)
mv2 = TYPE_MAIN_VARIANT (mv2);
for (memb = TYPE_FIELDS (TREE_VALUE (p1));
- memb; memb = TREE_CHAIN (memb))
+ memb; memb = DECL_CHAIN (memb))
{
tree mv3 = TREE_TYPE (memb);
if (mv3 && mv3 != error_mark_node
@@ -580,7 +580,7 @@ composite_type (tree t1, tree t2)
&& TREE_CODE (mv1) != ARRAY_TYPE)
mv1 = TYPE_MAIN_VARIANT (mv1);
for (memb = TYPE_FIELDS (TREE_VALUE (p2));
- memb; memb = TREE_CHAIN (memb))
+ memb; memb = DECL_CHAIN (memb))
{
tree mv3 = TREE_TYPE (memb);
if (mv3 && mv3 != error_mark_node
@@ -1434,7 +1434,7 @@ tagged_types_tu_compatible_p (const_tree t1, const_tree t2,
/* Speed up the common case where the fields are in the same order. */
for (s1 = TYPE_FIELDS (t1), s2 = TYPE_FIELDS (t2); s1 && s2;
- s1 = TREE_CHAIN (s1), s2 = TREE_CHAIN (s2))
+ s1 = DECL_CHAIN (s1), s2 = DECL_CHAIN (s2))
{
int result;
@@ -1467,11 +1467,11 @@ tagged_types_tu_compatible_p (const_tree t1, const_tree t2,
return tu->val;
}
- for (s1 = TYPE_FIELDS (t1); s1; s1 = TREE_CHAIN (s1))
+ for (s1 = TYPE_FIELDS (t1); s1; s1 = DECL_CHAIN (s1))
{
bool ok = false;
- for (s2 = TYPE_FIELDS (t2); s2; s2 = TREE_CHAIN (s2))
+ for (s2 = TYPE_FIELDS (t2); s2; s2 = DECL_CHAIN (s2))
if (DECL_NAME (s1) == DECL_NAME (s2))
{
int result;
@@ -1514,7 +1514,7 @@ tagged_types_tu_compatible_p (const_tree t1, const_tree t2,
for (s1 = TYPE_FIELDS (t1), s2 = TYPE_FIELDS (t2);
s1 && s2;
- s1 = TREE_CHAIN (s1), s2 = TREE_CHAIN (s2))
+ s1 = DECL_CHAIN (s1), s2 = DECL_CHAIN (s2))
{
int result;
if (TREE_CODE (s1) != TREE_CODE (s2)
@@ -1684,7 +1684,7 @@ type_lists_compatible_p (const_tree args1, const_tree args2,
{
tree memb;
for (memb = TYPE_FIELDS (a1);
- memb; memb = TREE_CHAIN (memb))
+ memb; memb = DECL_CHAIN (memb))
{
tree mv3 = TREE_TYPE (memb);
if (mv3 && mv3 != error_mark_node
@@ -1706,7 +1706,7 @@ type_lists_compatible_p (const_tree args1, const_tree args2,
{
tree memb;
for (memb = TYPE_FIELDS (a2);
- memb; memb = TREE_CHAIN (memb))
+ memb; memb = DECL_CHAIN (memb))
{
tree mv3 = TREE_TYPE (memb);
if (mv3 && mv3 != error_mark_node
@@ -2081,7 +2081,7 @@ lookup_field (tree type, tree component)
}
else
{
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (DECL_NAME (field) == NULL_TREE
&& (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE
@@ -4560,7 +4560,7 @@ build_c_cast (location_t loc, tree type, tree expr)
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_TYPE (field) != error_mark_node
&& comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (field)),
TYPE_MAIN_VARIANT (TREE_TYPE (value))))
@@ -5192,7 +5192,7 @@ convert_for_assignment (location_t location, tree type, tree rhs,
{
tree memb, marginal_memb = NULL_TREE;
- for (memb = TYPE_FIELDS (type); memb ; memb = TREE_CHAIN (memb))
+ for (memb = TYPE_FIELDS (type); memb ; memb = DECL_CHAIN (memb))
{
tree memb_type = TREE_TYPE (memb);
@@ -6483,7 +6483,7 @@ really_start_incremental_init (tree type)
/* Skip any nameless bit fields at the beginning. */
while (constructor_fields != 0 && DECL_C_BIT_FIELD (constructor_fields)
&& DECL_NAME (constructor_fields) == 0)
- constructor_fields = TREE_CHAIN (constructor_fields);
+ constructor_fields = DECL_CHAIN (constructor_fields);
constructor_unfilled_fields = constructor_fields;
constructor_bit_index = bitsize_zero_node;
@@ -6498,14 +6498,14 @@ really_start_incremental_init (tree type)
/* Detect non-empty initializations of zero-length arrays. */
if (constructor_max_index == NULL_TREE
&& TYPE_SIZE (constructor_type))
- constructor_max_index = build_int_cst (NULL_TREE, -1);
+ constructor_max_index = integer_minus_one_node;
/* constructor_max_index needs to be an INTEGER_CST. Attempts
to initialize VLAs will cause a proper error; avoid tree
checking errors as well by setting a safe value. */
if (constructor_max_index
&& TREE_CODE (constructor_max_index) != INTEGER_CST)
- constructor_max_index = build_int_cst (NULL_TREE, -1);
+ constructor_max_index = integer_minus_one_node;
constructor_index
= convert (bitsizetype,
@@ -6683,7 +6683,7 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
/* Skip any nameless bit fields at the beginning. */
while (constructor_fields != 0 && DECL_C_BIT_FIELD (constructor_fields)
&& DECL_NAME (constructor_fields) == 0)
- constructor_fields = TREE_CHAIN (constructor_fields);
+ constructor_fields = DECL_CHAIN (constructor_fields);
constructor_unfilled_fields = constructor_fields;
constructor_bit_index = bitsize_zero_node;
@@ -6706,14 +6706,14 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
/* Detect non-empty initializations of zero-length arrays. */
if (constructor_max_index == NULL_TREE
&& TYPE_SIZE (constructor_type))
- constructor_max_index = build_int_cst (NULL_TREE, -1);
+ constructor_max_index = integer_minus_one_node;
/* constructor_max_index needs to be an INTEGER_CST. Attempts
to initialize VLAs will cause a proper error; avoid tree
checking errors as well by setting a safe value. */
if (constructor_max_index
&& TREE_CODE (constructor_max_index) != INTEGER_CST)
- constructor_max_index = build_int_cst (NULL_TREE, -1);
+ constructor_max_index = integer_minus_one_node;
constructor_index
= convert (bitsizetype,
@@ -6802,7 +6802,7 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
/* We have already issued an error message for the existence
of a flexible array member not at the end of the structure.
Discard the initializer so that we do not die later. */
- if (TREE_CHAIN (constructor_fields) != NULL_TREE)
+ if (DECL_CHAIN (constructor_fields) != NULL_TREE)
constructor_type = NULL_TREE;
}
}
@@ -6817,7 +6817,7 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
while (constructor_unfilled_fields
&& (!DECL_SIZE (constructor_unfilled_fields)
|| integer_zerop (DECL_SIZE (constructor_unfilled_fields))))
- constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields);
+ constructor_unfilled_fields = DECL_CHAIN (constructor_unfilled_fields);
/* Do not warn if this level of the initializer uses member
designators; it is likely to be deliberate. */
@@ -7650,7 +7650,7 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
|| (COMPLETE_TYPE_P (TREE_TYPE (field))
&& integer_zerop (TYPE_SIZE (TREE_TYPE (field)))
&& (TREE_CODE (constructor_type) == ARRAY_TYPE
- || TREE_CHAIN (field)))))
+ || DECL_CHAIN (field)))))
return;
if (semantic_type)
@@ -7738,14 +7738,14 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
else if (TREE_CODE (constructor_type) == RECORD_TYPE)
{
constructor_unfilled_fields
- = TREE_CHAIN (constructor_unfilled_fields);
+ = DECL_CHAIN (constructor_unfilled_fields);
/* Skip any nameless bit fields. */
while (constructor_unfilled_fields != 0
&& DECL_C_BIT_FIELD (constructor_unfilled_fields)
&& DECL_NAME (constructor_unfilled_fields) == 0)
constructor_unfilled_fields =
- TREE_CHAIN (constructor_unfilled_fields);
+ DECL_CHAIN (constructor_unfilled_fields);
}
else if (TREE_CODE (constructor_type) == UNION_TYPE)
constructor_unfilled_fields = 0;
@@ -8014,7 +8014,7 @@ process_init_element (struct c_expr value, bool implicit,
if (fieldcode == ARRAY_TYPE
&& !require_constant_value
&& TYPE_SIZE (fieldtype) == NULL_TREE
- && TREE_CHAIN (constructor_fields) == NULL_TREE)
+ && DECL_CHAIN (constructor_fields) == NULL_TREE)
{
error_init ("non-static initialization of a flexible array member");
break;
@@ -8062,22 +8062,22 @@ process_init_element (struct c_expr value, bool implicit,
it isn't now, so update. */
if (constructor_unfilled_fields == constructor_fields)
{
- constructor_unfilled_fields = TREE_CHAIN (constructor_fields);
+ constructor_unfilled_fields = DECL_CHAIN (constructor_fields);
/* Skip any nameless bit fields. */
while (constructor_unfilled_fields != 0
&& DECL_C_BIT_FIELD (constructor_unfilled_fields)
&& DECL_NAME (constructor_unfilled_fields) == 0)
constructor_unfilled_fields =
- TREE_CHAIN (constructor_unfilled_fields);
+ DECL_CHAIN (constructor_unfilled_fields);
}
}
- constructor_fields = TREE_CHAIN (constructor_fields);
+ constructor_fields = DECL_CHAIN (constructor_fields);
/* Skip any nameless bit fields at the beginning. */
while (constructor_fields != 0
&& DECL_C_BIT_FIELD (constructor_fields)
&& DECL_NAME (constructor_fields) == 0)
- constructor_fields = TREE_CHAIN (constructor_fields);
+ constructor_fields = DECL_CHAIN (constructor_fields);
}
else if (TREE_CODE (constructor_type) == UNION_TYPE)
{
@@ -8144,7 +8144,7 @@ process_init_element (struct c_expr value, bool implicit,
directly output as a constructor. */
{
constructor_bit_index = DECL_SIZE (constructor_fields);
- constructor_unfilled_fields = TREE_CHAIN (constructor_fields);
+ constructor_unfilled_fields = DECL_CHAIN (constructor_fields);
}
constructor_fields = 0;
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 78b508cc535..d95e66c34c1 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -34,36 +34,21 @@ along with GCC; see the file COPYING3. If not see
#include "reload.h"
#include "function.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "addresses.h"
#include "output.h"
#include "ggc.h"
-/* True if caller-save has been initialized. */
-bool caller_save_initialized_p;
-
-/* Call used hard registers which can not be saved because there is no
- insn for this. */
-HARD_REG_SET no_caller_save_reg_set;
-
-#ifndef MAX_MOVE_MAX
-#define MAX_MOVE_MAX MOVE_MAX
-#endif
-
-#ifndef MIN_UNITS_PER_WORD
-#define MIN_UNITS_PER_WORD UNITS_PER_WORD
-#endif
-
#define MOVE_MAX_WORDS (MOVE_MAX / UNITS_PER_WORD)
-/* Modes for each hard register that we can save. The smallest mode is wide
- enough to save the entire contents of the register. When saving the
- register because it is live we first try to save in multi-register modes.
- If that is not possible the save is done one register at a time. */
-
-static enum machine_mode
- regno_save_mode[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
+#define regno_save_mode \
+ (this_target_reload->x_regno_save_mode)
+#define cached_reg_save_code \
+ (this_target_reload->x_cached_reg_save_code)
+#define cached_reg_restore_code \
+ (this_target_reload->x_cached_reg_restore_code)
/* For each hard register, a place on the stack where it can be saved,
if needed. */
@@ -77,17 +62,6 @@ static int save_slots_num;
/* Allocated slots so far. */
static rtx save_slots[FIRST_PSEUDO_REGISTER];
-/* We will only make a register eligible for caller-save if it can be
- saved in its widest mode with a simple SET insn as long as the memory
- address is valid. We record the INSN_CODE is those insns here since
- when we emit them, the addresses might not be valid, so they might not
- be recognized. */
-
-static int
- cached_reg_save_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
-static int
- cached_reg_restore_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
-
/* Set of hard regs currently residing in save area (during insn scan). */
static HARD_REG_SET hard_regs_saved;
diff --git a/gcc/calls.c b/gcc/calls.c
index 3b06ad397de..cd0d9c593f3 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -32,7 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "libfuncs.h"
#include "function.h"
#include "regs.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "output.h"
#include "tm_p.h"
#include "timevar.h"
@@ -1672,10 +1672,12 @@ load_register_parameters (struct arg_data *args, int num_actuals,
{
rtx mem = validize_mem (args[i].value);
- /* Check for overlap with already clobbered argument area. */
+ /* Check for overlap with already clobbered argument area,
+ providing that this has non-zero size. */
if (is_sibcall
- && mem_overlaps_already_clobbered_arg_p (XEXP (args[i].value, 0),
- size))
+ && (size == 0
+ || mem_overlaps_already_clobbered_arg_p
+ (XEXP (args[i].value, 0), size)))
*sibcall_failure = 1;
/* Handle a BLKmode that needs shifting. */
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 563582ff296..127f08c75df 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "function.h"
#include "except.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "obstack.h"
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 65fe337ab01..b4cc86c1283 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "insn-config.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "vec.h"
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index c53450ca553..59932b2f729 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "except.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "timevar.h"
#include "sbitmap.h"
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 7139e3a7bce..9ded1e6215b 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "insn-config.h"
#include "flags.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "cselib.h"
#include "params.h"
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 0d8026e75a1..fef31905bd5 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -344,7 +344,7 @@ aggregate_contains_union_type (tree type)
if (TREE_CODE (type) != RECORD_TYPE)
return false;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
if (aggregate_contains_union_type (TREE_TYPE (field)))
return true;
@@ -1019,7 +1019,7 @@ expand_used_vars_for_block (tree block, bool toplevel)
old_sv_num = toplevel ? 0 : stack_vars_num;
/* Expand all variables at this level. */
- for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
+ for (t = BLOCK_VARS (block); t ; t = DECL_CHAIN (t))
if (TREE_USED (t))
expand_one_var (t, toplevel, true);
@@ -1051,7 +1051,7 @@ clear_tree_used (tree block)
{
tree t;
- for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
+ for (t = BLOCK_VARS (block); t ; t = DECL_CHAIN (t))
/* if (!TREE_STATIC (t) && !DECL_EXTERNAL (t)) */
TREE_USED (t) = 0;
@@ -1210,7 +1210,7 @@ account_used_vars_for_block (tree block, bool toplevel)
HOST_WIDE_INT size = 0;
/* Expand all variables at this level. */
- for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
+ for (t = BLOCK_VARS (block); t ; t = DECL_CHAIN (t))
if (TREE_USED (t))
size += expand_one_var (t, toplevel, false);
@@ -1226,9 +1226,10 @@ static void
init_vars_expansion (void)
{
tree t;
+ unsigned ix;
/* Set TREE_USED on all variables in the local_decls. */
- for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
- TREE_USED (TREE_VALUE (t)) = 1;
+ FOR_EACH_LOCAL_DECL (cfun, ix, t)
+ TREE_USED (t) = 1;
/* Clear TREE_USED on all variables associated with a block scope. */
clear_tree_used (DECL_INITIAL (current_function_decl));
@@ -1251,8 +1252,8 @@ fini_vars_expansion (void)
stack_vars_alloc = stack_vars_num = 0;
}
-/* Make a fair guess for the size of the stack frame of the current
- function. This doesn't have to be exact, the result is only used
+/* Make a fair guess for the size of the stack frame of the decl
+ passed. This doesn't have to be exact, the result is only used
in the inline heuristics. So we don't want to run the full stack
var packing algorithm (which is quadratic in the number of stack
vars). Instead, we calculate the total size of all stack vars.
@@ -1260,18 +1261,20 @@ fini_vars_expansion (void)
vars doesn't happen very often. */
HOST_WIDE_INT
-estimated_stack_frame_size (void)
+estimated_stack_frame_size (tree decl)
{
HOST_WIDE_INT size = 0;
size_t i;
- tree t, outer_block = DECL_INITIAL (current_function_decl);
+ tree var, outer_block = DECL_INITIAL (current_function_decl);
+ unsigned ix;
+ tree old_cur_fun_decl = current_function_decl;
+ current_function_decl = decl;
+ push_cfun (DECL_STRUCT_FUNCTION (decl));
init_vars_expansion ();
- for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
+ FOR_EACH_LOCAL_DECL (cfun, ix, var)
{
- tree var = TREE_VALUE (t);
-
if (TREE_USED (var))
size += expand_one_var (var, true, false);
TREE_USED (var) = 1;
@@ -1287,7 +1290,8 @@ estimated_stack_frame_size (void)
size += account_stack_vars ();
fini_vars_expansion ();
}
-
+ pop_cfun ();
+ current_function_decl = old_cur_fun_decl;
return size;
}
@@ -1296,9 +1300,10 @@ estimated_stack_frame_size (void)
static void
expand_used_vars (void)
{
- tree t, next, outer_block = DECL_INITIAL (current_function_decl);
- tree maybe_local_decls = NULL_TREE;
+ tree var, outer_block = DECL_INITIAL (current_function_decl);
+ VEC(tree,heap) *maybe_local_decls = NULL;
unsigned i;
+ unsigned len;
/* Compute the phase of the stack frame for this function. */
{
@@ -1333,15 +1338,12 @@ expand_used_vars (void)
/* At this point all variables on the local_decls with TREE_USED
set are not associated with any block scope. Lay them out. */
- t = cfun->local_decls;
- cfun->local_decls = NULL_TREE;
- for (; t; t = next)
+
+ len = VEC_length (tree, cfun->local_decls);
+ FOR_EACH_LOCAL_DECL (cfun, i, var)
{
- tree var = TREE_VALUE (t);
bool expand_now = false;
- next = TREE_CHAIN (t);
-
/* Expanded above already. */
if (is_gimple_reg (var))
{
@@ -1377,25 +1379,29 @@ expand_used_vars (void)
/* Keep artificial non-ignored vars in cfun->local_decls
chain until instantiate_decls. */
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
- {
- TREE_CHAIN (t) = cfun->local_decls;
- cfun->local_decls = t;
- continue;
- }
+ add_local_decl (cfun, var);
else if (rtl == NULL_RTX)
- {
- /* If rtl isn't set yet, which can happen e.g. with
- -fstack-protector, retry before returning from this
- function. */
- TREE_CHAIN (t) = maybe_local_decls;
- maybe_local_decls = t;
- continue;
- }
+ /* If rtl isn't set yet, which can happen e.g. with
+ -fstack-protector, retry before returning from this
+ function. */
+ VEC_safe_push (tree, heap, maybe_local_decls, var);
}
-
- ggc_free (t);
}
+ /* We duplicated some of the decls in CFUN->LOCAL_DECLS.
+
+ +-----------------+-----------------+
+ | ...processed... | ...duplicates...|
+ +-----------------+-----------------+
+ ^
+ +-- LEN points here.
+
+ We just want the duplicates, as those are the artificial
+ non-ignored vars that we want to keep until instantiate_decls.
+ Move them down and truncate the array. */
+ if (!VEC_empty (tree, cfun->local_decls))
+ VEC_block_remove (tree, cfun->local_decls, 0, len);
+
/* At this point, all variables within the block tree with TREE_USED
set are actually used by the optimized function. Lay them out. */
expand_used_vars_for_block (outer_block, true);
@@ -1452,24 +1458,16 @@ expand_used_vars (void)
/* If there were any artificial non-ignored vars without rtl
found earlier, see if deferred stack allocation hasn't assigned
rtl to them. */
- for (t = maybe_local_decls; t; t = next)
+ FOR_EACH_VEC_ELT_REVERSE (tree, maybe_local_decls, i, var)
{
- tree var = TREE_VALUE (t);
rtx rtl = DECL_RTL_IF_SET (var);
- next = TREE_CHAIN (t);
-
/* Keep artificial non-ignored vars in cfun->local_decls
chain until instantiate_decls. */
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
- {
- TREE_CHAIN (t) = cfun->local_decls;
- cfun->local_decls = t;
- continue;
- }
-
- ggc_free (t);
+ add_local_decl (cfun, var);
}
+ VEC_free (tree, heap, maybe_local_decls);
/* If the target requires that FRAME_OFFSET be aligned, do it. */
if (STACK_ALIGNMENT_NEEDED)
@@ -2239,7 +2237,6 @@ expand_debug_expr (tree exp)
enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
addr_space_t as;
- enum machine_mode address_mode;
switch (TREE_CODE_CLASS (TREE_CODE (exp)))
{
@@ -2430,7 +2427,9 @@ expand_debug_expr (tree exp)
op0 = simplify_gen_subreg (mode, op0, inner_mode,
subreg_lowpart_offset (mode,
inner_mode));
- else if (unsignedp)
+ else if (TREE_CODE_CLASS (TREE_CODE (exp)) == tcc_unary
+ ? TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))
+ : unsignedp)
op0 = gen_rtx_ZERO_EXTEND (mode, op0);
else
op0 = gen_rtx_SIGN_EXTEND (mode, op0);
@@ -2438,29 +2437,21 @@ expand_debug_expr (tree exp)
return op0;
}
+ case MEM_REF:
+ /* ??? FIXME. */
+ if (!integer_zerop (TREE_OPERAND (exp, 1)))
+ return NULL;
+ /* Fallthru. */
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
if (!op0)
return NULL;
if (POINTER_TYPE_P (TREE_TYPE (exp)))
- {
- as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
- address_mode = targetm.addr_space.address_mode (as);
- }
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
else
- {
- as = ADDR_SPACE_GENERIC;
- address_mode = Pmode;
- }
-
- if (TREE_CODE (exp) == ALIGN_INDIRECT_REF)
- {
- int align = TYPE_ALIGN_UNIT (TREE_TYPE (exp));
- op0 = gen_rtx_AND (address_mode, op0, GEN_INT (-align));
- }
+ as = ADDR_SPACE_GENERIC;
op0 = gen_rtx_MEM (mode, op0);
@@ -3759,7 +3750,9 @@ gimple_expand_cfg (void)
edge e;
unsigned i;
+ timevar_push (TV_OUT_OF_SSA);
rewrite_out_of_ssa (&SA);
+ timevar_pop (TV_OUT_OF_SSA);
SA.partition_to_pseudo = (rtx *)xcalloc (SA.map->num_partitions,
sizeof (rtx));
@@ -3802,7 +3795,9 @@ gimple_expand_cfg (void)
/* Expand the variables recorded during gimple lowering. */
+ timevar_push (TV_VAR_EXPAND);
expand_used_vars ();
+ timevar_pop (TV_VAR_EXPAND);
/* Honor stack protection warnings. */
if (warn_stack_protect)
@@ -3882,8 +3877,11 @@ gimple_expand_cfg (void)
expand_debug_locations ();
execute_free_datastructures ();
+ timevar_push (TV_OUT_OF_SSA);
finish_out_of_ssa (&SA);
+ timevar_pop (TV_OUT_OF_SSA);
+ timevar_push (TV_POST_EXPAND);
/* We are no longer in SSA form. */
cfun->gimple_df->in_ssa_p = false;
@@ -3993,6 +3991,7 @@ gimple_expand_cfg (void)
the common parent easily. */
set_block_levels (DECL_INITIAL (cfun->decl), 0);
default_rtl_profile ();
+ timevar_pop (TV_POST_EXPAND);
return 0;
}
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index c3d51fd9e36..3532b460851 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "tree-flow.h"
#include "timevar.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "cfgloop.h"
/* A pointer to one of the hooks containers. */
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index c0d9a4cacc2..370c68d63fe 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -27,8 +27,8 @@ along with GCC; see the file COPYING3. If not see
#include "obstack.h"
#include "function.h"
#include "basic-block.h"
-#include "toplev.h"
#include "cfgloop.h"
+#include "diagnostic-core.h"
#include "flags.h"
#include "tree.h"
#include "tree-flow.h"
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 3821ee66c79..535e256050d 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -625,15 +625,45 @@ fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
}
/* The properties of the target. */
+struct target_cfgloop {
+ /* Number of available registers. */
+ unsigned x_target_avail_regs;
-extern unsigned target_avail_regs;
-extern unsigned target_res_regs;
-extern unsigned target_reg_cost [2];
-extern unsigned target_spill_cost [2];
+ /* Number of available registers that are call-clobbered. */
+ unsigned x_target_clobbered_regs;
+
+ /* Number of registers reserved for temporary expressions. */
+ unsigned x_target_res_regs;
+
+ /* The cost for register when there still is some reserve, but we are
+ approaching the number of available registers. */
+ unsigned x_target_reg_cost[2];
+
+ /* The cost for register when we need to spill. */
+ unsigned x_target_spill_cost[2];
+};
+
+extern struct target_cfgloop default_target_cfgloop;
+#if SWITCHABLE_TARGET
+extern struct target_cfgloop *this_target_cfgloop;
+#else
+#define this_target_cfgloop (&default_target_cfgloop)
+#endif
+
+#define target_avail_regs \
+ (this_target_cfgloop->x_target_avail_regs)
+#define target_clobbered_regs \
+ (this_target_cfgloop->x_target_clobbered_regs)
+#define target_res_regs \
+ (this_target_cfgloop->x_target_res_regs)
+#define target_reg_cost \
+ (this_target_cfgloop->x_target_reg_cost)
+#define target_spill_cost \
+ (this_target_cfgloop->x_target_spill_cost)
/* Register pressure estimation for induction variable optimizations & loop
invariant motion. */
-extern unsigned estimate_reg_pressure_cost (unsigned, unsigned, bool);
+extern unsigned estimate_reg_pressure_cost (unsigned, unsigned, bool, bool);
extern void init_set_costs (void);
/* Loop optimizer initialization. */
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index 129ec25a331..48a44d2a3f0 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -32,6 +32,11 @@ along with GCC; see the file COPYING3. If not see
#include "graphds.h"
#include "params.h"
+struct target_cfgloop default_target_cfgloop;
+#if SWITCHABLE_TARGET
+struct target_cfgloop *this_target_cfgloop = &default_target_cfgloop;
+#endif
+
/* Checks whether BB is executed exactly once in each LOOP iteration. */
bool
@@ -317,17 +322,6 @@ seq_cost (const_rtx seq, bool speed)
return cost;
}
-/* The properties of the target. */
-
-unsigned target_avail_regs; /* Number of available registers. */
-unsigned target_res_regs; /* Number of registers reserved for temporary
- expressions. */
-unsigned target_reg_cost[2]; /* The cost for register when there still
- is some reserve, but we are approaching
- the number of available registers. */
-unsigned target_spill_cost[2]; /* The cost for register when we need
- to spill. */
-
/* Initialize the constants for computing set costs. */
void
@@ -342,10 +336,15 @@ init_set_costs (void)
unsigned i;
target_avail_regs = 0;
+ target_clobbered_regs = 0;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i)
&& !fixed_regs[i])
- target_avail_regs++;
+ {
+ target_avail_regs++;
+ if (call_used_regs[i])
+ target_clobbered_regs++;
+ }
target_res_regs = 3;
@@ -379,20 +378,29 @@ init_set_costs (void)
/* Estimates cost of increased register pressure caused by making N_NEW new
registers live around the loop. N_OLD is the number of registers live
- around the loop. */
+ around the loop. If CALL_P is true, also take into account that
+ call-used registers may be clobbered in the loop body, reducing the
+ number of available registers before we spill. */
unsigned
-estimate_reg_pressure_cost (unsigned n_new, unsigned n_old, bool speed)
+estimate_reg_pressure_cost (unsigned n_new, unsigned n_old, bool speed,
+ bool call_p)
{
unsigned cost;
unsigned regs_needed = n_new + n_old;
+ unsigned available_regs = target_avail_regs;
+
+ /* If there is a call in the loop body, the call-clobbered registers
+ are not available for loop invariants. */
+ if (call_p)
+ available_regs = available_regs - target_clobbered_regs;
/* If we have enough registers, we should use them and not restrict
the transformations unnecessarily. */
- if (regs_needed + target_res_regs <= target_avail_regs)
+ if (regs_needed + target_res_regs <= available_regs)
return 0;
- if (regs_needed <= target_avail_regs)
+ if (regs_needed <= available_regs)
/* If we are close to running out of registers, try to preserve
them. */
cost = target_reg_cost [speed] * n_new;
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index aaa50b607d2..63fed497b47 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -97,6 +97,7 @@ The callgraph:
#include "diagnostic-core.h"
#include "rtl.h"
#include "ipa-utils.h"
+#include "lto-streamer.h"
static void cgraph_node_remove_callers (struct cgraph_node *node);
static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
@@ -604,6 +605,29 @@ cgraph_add_thunk (tree alias, tree decl, bool this_adjusting,
is assigned. */
struct cgraph_node *
+cgraph_get_node_or_alias (tree decl)
+{
+ struct cgraph_node key, *node = NULL, **slot;
+
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+
+ if (!cgraph_hash)
+ return NULL;
+
+ key.decl = decl;
+
+ slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, &key,
+ NO_INSERT);
+
+ if (slot && *slot)
+ node = *slot;
+ return node;
+}
+
+/* Returns the cgraph node assigned to DECL or NULL if no cgraph node
+ is assigned. */
+
+struct cgraph_node *
cgraph_get_node (tree decl)
{
struct cgraph_node key, *node = NULL, **slot;
@@ -1952,20 +1976,43 @@ debug_cgraph (void)
void
change_decl_assembler_name (tree decl, tree name)
{
- gcc_assert (!assembler_name_hash);
+ struct cgraph_node *node;
+ void **slot;
if (!DECL_ASSEMBLER_NAME_SET_P (decl))
+ SET_DECL_ASSEMBLER_NAME (decl, name);
+ else
{
- SET_DECL_ASSEMBLER_NAME (decl, name);
- return;
- }
- if (name == DECL_ASSEMBLER_NAME (decl))
- return;
+ if (name == DECL_ASSEMBLER_NAME (decl))
+ return;
- if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
- && DECL_RTL_SET_P (decl))
- warning (0, "%D renamed after being referenced in assembly", decl);
+ if (assembler_name_hash
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && (node = cgraph_get_node_or_alias (decl)) != NULL)
+ {
+ tree old_name = DECL_ASSEMBLER_NAME (decl);
+ slot = htab_find_slot_with_hash (assembler_name_hash, old_name,
+ decl_assembler_name_hash (old_name),
+ NO_INSERT);
+ /* Inline clones are not hashed. */
+ if (slot && *slot == node)
+ htab_clear_slot (assembler_name_hash, slot);
+ }
+ if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
+ && DECL_RTL_SET_P (decl))
+ warning (0, "%D renamed after being referenced in assembly", decl);
- SET_DECL_ASSEMBLER_NAME (decl, name);
+ SET_DECL_ASSEMBLER_NAME (decl, name);
+ }
+ if (assembler_name_hash
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && (node = cgraph_get_node_or_alias (decl)) != NULL)
+ {
+ slot = htab_find_slot_with_hash (assembler_name_hash, name,
+ decl_assembler_name_hash (name),
+ INSERT);
+ gcc_assert (!*slot);
+ *slot = node;
+ }
}
/* Add a top-level asm statement to the list. */
@@ -2255,7 +2302,7 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
struct cgraph_node *orig_node;
for (orig_node = old_node; orig_node->clone_of; orig_node = orig_node->clone_of)
;
- for (arg = DECL_ARGUMENTS (orig_node->decl); arg; arg = TREE_CHAIN (arg), oldi++)
+ for (arg = DECL_ARGUMENTS (orig_node->decl); arg; arg = DECL_CHAIN (arg), oldi++)
{
if (bitmap_bit_p (old_node->clone.combined_args_to_skip, oldi))
{
@@ -2432,15 +2479,50 @@ cgraph_make_decl_local (tree decl)
if (TREE_CODE (decl) == VAR_DECL)
DECL_COMMON (decl) = 0;
- else if (TREE_CODE (decl) == FUNCTION_DECL)
+ else gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+
+ if (DECL_COMDAT (decl))
{
+ /* It is possible that we are linking against library defining same COMDAT
+ function. To avoid conflict we need to rename our local name of the
+ function just in the case WHOPR partitioning decide to make it hidden
+ to avoid cross partition references. */
+ if (flag_wpa)
+ {
+ const char *old_name;
+
+ old_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ struct cgraph_node *node = cgraph_get_node_or_alias (decl);
+ change_decl_assembler_name (decl,
+ clone_function_name (decl, "local"));
+ if (node->local.lto_file_data)
+ lto_record_renamed_decl (node->local.lto_file_data,
+ old_name,
+ IDENTIFIER_POINTER
+ (DECL_ASSEMBLER_NAME (decl)));
+ }
+ else if (TREE_CODE (decl) == VAR_DECL)
+ {
+ struct varpool_node *vnode = varpool_get_node (decl);
+ /* change_decl_assembler_name will warn here on vtables because
+ C++ frontend still sets TREE_SYMBOL_REFERENCED on them. */
+ SET_DECL_ASSEMBLER_NAME (decl,
+ clone_function_name (decl, "local"));
+ if (vnode->lto_file_data)
+ lto_record_renamed_decl (vnode->lto_file_data,
+ old_name,
+ IDENTIFIER_POINTER
+ (DECL_ASSEMBLER_NAME (decl)));
+ }
+ }
+ DECL_SECTION_NAME (decl) = 0;
DECL_COMDAT (decl) = 0;
- DECL_COMDAT_GROUP (decl) = 0;
- DECL_WEAK (decl) = 0;
- DECL_EXTERNAL (decl) = 0;
}
- else
- gcc_unreachable ();
+ DECL_COMDAT_GROUP (decl) = 0;
+ DECL_WEAK (decl) = 0;
+ DECL_EXTERNAL (decl) = 0;
TREE_PUBLIC (decl) = 0;
if (!DECL_RTL_SET_P (decl))
return;
@@ -2627,4 +2709,29 @@ cgraph_edge_cannot_lead_to_return (struct cgraph_edge *e)
return cgraph_node_cannot_return (e->callee);
}
+/* Return true when function NODE can be excpected to be removed
+ from program when direct calls in this compilation unit are removed.
+
+ As a special case COMDAT functions are
+ cgraph_can_remove_if_no_direct_calls_p while the are not
+ cgraph_only_called_directly_p (it is possible they are called from other
+ unit)
+
+ This function behaves as cgraph_only_called_directly_p because eliminating
+ all uses of COMDAT function does not make it neccesarily disappear from
+ the program unless we are compiling whole program or we do LTO. In this
+ case we know we win since dynamic linking will not really discard the
+ linkonce section. */
+
+bool
+cgraph_will_be_removed_from_program_if_no_direct_calls (struct cgraph_node *node)
+{
+ if (node->local.used_from_object_file)
+ return false;
+ if (!in_lto_p && !flag_whole_program)
+ return cgraph_only_called_directly_p (node);
+ else
+ return cgraph_can_remove_if_no_direct_calls_p (node);
+}
+
#include "gt-cgraph.h"
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index ef556b9cd7f..2dcdf2f22f3 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -286,7 +286,9 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node {
/* Set once the function has been instantiated and its callee
lists created. */
unsigned analyzed : 1;
- /* Set when function is available in the other LTRANS partition. */
+ /* Set when function is available in the other LTRANS partition.
+ During WPA output it is used to mark nodes that are present in
+ multiple partitions. */
unsigned in_other_partition : 1;
/* Set when function is scheduled to be processed by local passes. */
unsigned process : 1;
@@ -497,7 +499,9 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) varpool_node {
unsigned alias : 1;
/* Set when variable is used from other LTRANS partition. */
unsigned used_from_other_partition : 1;
- /* Set when variable is available in the other LTRANS partition. */
+ /* Set when variable is available in the other LTRANS partition.
+ During WPA output it is used to mark nodes that are present in
+ multiple partitions. */
unsigned in_other_partition : 1;
};
@@ -556,6 +560,7 @@ struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *, gimple, int,
gcov_type, int, int);
struct cgraph_node * cgraph_get_node (tree);
+struct cgraph_node * cgraph_get_node_or_alias (tree);
struct cgraph_node *cgraph_node (tree);
bool cgraph_same_body_alias (tree, tree);
void cgraph_add_thunk (tree, tree, bool, HOST_WIDE_INT, HOST_WIDE_INT, tree, tree);
@@ -659,6 +664,8 @@ void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
void cgraph_materialize_all_clones (void);
gimple cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *);
bool cgraph_propagate_frequency (struct cgraph_node *node);
+bool cgraph_will_be_removed_from_program_if_no_direct_calls
+ (struct cgraph_node *node);
/* In cgraphbuild.c */
unsigned int rebuild_cgraph_edges (void);
void cgraph_rebuild_references (void);
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index c63b5afc81c..3bd42e34039 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -275,7 +275,7 @@ mark_load (gimple stmt ATTRIBUTE_UNUSED, tree t,
void *data ATTRIBUTE_UNUSED)
{
t = get_base_address (t);
- if (TREE_CODE (t) == VAR_DECL
+ if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
struct varpool_node *vnode = varpool_node (t);
@@ -300,7 +300,7 @@ mark_store (gimple stmt ATTRIBUTE_UNUSED, tree t,
void *data ATTRIBUTE_UNUSED)
{
t = get_base_address (t);
- if (TREE_CODE (t) == VAR_DECL
+ if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
struct varpool_node *vnode = varpool_node (t);
@@ -328,7 +328,8 @@ build_cgraph_edges (void)
struct cgraph_node *node = cgraph_node (current_function_decl);
struct pointer_set_t *visited_nodes = pointer_set_create ();
gimple_stmt_iterator gsi;
- tree step;
+ tree decl;
+ unsigned ix;
/* Create the callgraph edges and record the nodes referenced by the function.
body. */
@@ -378,15 +379,10 @@ build_cgraph_edges (void)
}
/* Look for initializers of constant variables and private statics. */
- for (step = cfun->local_decls;
- step;
- step = TREE_CHAIN (step))
- {
- tree decl = TREE_VALUE (step);
- if (TREE_CODE (decl) == VAR_DECL
- && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
- varpool_finalize_decl (decl);
- }
+ FOR_EACH_LOCAL_DECL (cfun, ix, decl)
+ if (TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
+ varpool_finalize_decl (decl);
record_eh_tables (node, cfun);
pointer_set_destroy (visited_nodes);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 0adf146410d..e306b226115 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -210,15 +210,15 @@ build_cdtor (bool ctor_p, tree *cdtors, size_t len)
do
{
priority_type p;
+ tree call;
fn = cdtors[i];
p = ctor_p ? DECL_INIT_PRIORITY (fn) : DECL_FINI_PRIORITY (fn);
if (!body)
priority = p;
else if (p != priority)
break;
- append_to_statement_list (build_function_call_expr (UNKNOWN_LOCATION,
- fn, 0),
- &body);
+ call = build_call_expr (fn, 0);
+ append_to_statement_list (call, &body);
++i;
}
while (i < len);
@@ -586,6 +586,42 @@ clone_of_p (struct cgraph_node *node, struct cgraph_node *node2)
}
#endif
+/* Verify edge E count and frequency. */
+
+static bool
+verify_edge_count_and_frequency (struct cgraph_edge *e)
+{
+ bool error_found = false;
+ if (e->count < 0)
+ {
+ error ("caller edge count is negative");
+ error_found = true;
+ }
+ if (e->frequency < 0)
+ {
+ error ("caller edge frequency is negative");
+ error_found = true;
+ }
+ if (e->frequency > CGRAPH_FREQ_MAX)
+ {
+ error ("caller edge frequency is too large");
+ error_found = true;
+ }
+ if (gimple_has_body_p (e->caller->decl)
+ && !e->caller->global.inlined_to
+ && (e->frequency
+ != compute_call_stmt_bb_frequency (e->caller->decl,
+ gimple_bb (e->call_stmt))))
+ {
+ error ("caller edge frequency %i does not match BB freqency %i",
+ e->frequency,
+ compute_call_stmt_bb_frequency (e->caller->decl,
+ gimple_bb (e->call_stmt)));
+ error_found = true;
+ }
+ return error_found;
+}
+
/* Verify cgraph nodes of given cgraph node. */
DEBUG_FUNCTION void
verify_cgraph_node (struct cgraph_node *node)
@@ -651,33 +687,8 @@ verify_cgraph_node (struct cgraph_node *node)
}
for (e = node->callers; e; e = e->next_caller)
{
- if (e->count < 0)
- {
- error ("caller edge count is negative");
- error_found = true;
- }
- if (e->frequency < 0)
- {
- error ("caller edge frequency is negative");
- error_found = true;
- }
- if (e->frequency > CGRAPH_FREQ_MAX)
- {
- error ("caller edge frequency is too large");
- error_found = true;
- }
- if (gimple_has_body_p (e->caller->decl)
- && !e->caller->global.inlined_to
- && (e->frequency
- != compute_call_stmt_bb_frequency (e->caller->decl,
- gimple_bb (e->call_stmt))))
- {
- error ("caller edge frequency %i does not match BB freqency %i",
- e->frequency,
- compute_call_stmt_bb_frequency (e->caller->decl,
- gimple_bb (e->call_stmt)));
- error_found = true;
- }
+ if (verify_edge_count_and_frequency (e))
+ error_found = true;
if (!e->inline_failed)
{
if (node->global.inlined_to
@@ -700,6 +711,9 @@ verify_cgraph_node (struct cgraph_node *node)
error_found = true;
}
}
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ if (verify_edge_count_and_frequency (e))
+ error_found = true;
if (!node->callers && node->global.inlined_to)
{
error ("inlined_to pointer is set but no predecessors found");
@@ -1380,8 +1394,7 @@ thunk_adjust (gimple_stmt_iterator * bsi,
vtabletmp2 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp)),
"vtableaddr");
stmt = gimple_build_assign (vtabletmp2,
- build1 (INDIRECT_REF,
- TREE_TYPE (vtabletmp2), vtabletmp));
+ build_simple_mem_ref (vtabletmp));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
@@ -1400,9 +1413,7 @@ thunk_adjust (gimple_stmt_iterator * bsi,
vtabletmp3 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp2)),
"vcalloffset");
stmt = gimple_build_assign (vtabletmp3,
- build1 (INDIRECT_REF,
- TREE_TYPE (vtabletmp3),
- vtabletmp2));
+ build_simple_mem_ref (vtabletmp2));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
@@ -1539,14 +1550,14 @@ assemble_thunk (struct cgraph_node *node)
if (!is_gimple_reg_type (restype))
{
restmp = resdecl;
- cfun->local_decls = tree_cons (NULL_TREE, restmp, cfun->local_decls);
+ add_local_decl (cfun, restmp);
BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
}
else
restmp = create_tmp_var_raw (restype, "retval");
}
- for (arg = a; arg; arg = TREE_CHAIN (arg))
+ for (arg = a; arg; arg = DECL_CHAIN (arg))
nargs++;
vargs = VEC_alloc (tree, heap, nargs);
if (this_adjusting)
@@ -1556,7 +1567,7 @@ assemble_thunk (struct cgraph_node *node)
virtual_offset));
else
VEC_quick_push (tree, vargs, a);
- for (i = 1, arg = TREE_CHAIN (a); i < nargs; i++, arg = TREE_CHAIN (arg))
+ for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg))
VEC_quick_push (tree, vargs, arg);
call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
VEC_free (tree, heap, vargs);
@@ -2036,7 +2047,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
name = get_file_function_name (which_buf);
decl = build_decl (input_location, FUNCTION_DECL, name,
- build_function_type (void_type_node, void_list_node));
+ build_function_type_list (void_type_node, NULL_TREE));
current_function_decl = decl;
resdecl = build_decl (input_location,
@@ -2083,13 +2094,16 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
cgraph_add_new_function (decl, false);
cgraph_mark_needed_node (cgraph_node (decl));
+
set_cfun (NULL);
+ current_function_decl = NULL;
}
void
init_cgraph (void)
{
- cgraph_dump_file = dump_begin (TDI_cgraph, NULL);
+ if (!cgraph_dump_file)
+ cgraph_dump_file = dump_begin (TDI_cgraph, NULL);
}
/* The edges representing the callers of the NEW_VERSION node were
diff --git a/gcc/combine.c b/gcc/combine.c
index d3305cb4abe..0a1e787cbb7 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -92,6 +92,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "insn-attr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "target.h"
#include "optabs.h"
@@ -1340,7 +1341,7 @@ setup_incoming_promotions (rtx first)
bool strictly_local = false;
for (arg = DECL_ARGUMENTS (current_function_decl); arg;
- arg = TREE_CHAIN (arg))
+ arg = DECL_CHAIN (arg))
{
rtx x, reg = DECL_INCOMING_RTL (arg);
int uns1, uns3;
diff --git a/gcc/common.opt b/gcc/common.opt
index 6ca787a4b5f..41a9838f481 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -212,6 +212,10 @@ Wsystem-headers
Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers
+Wtrampolines
+Common Var(warn_trampolines) Warning
+Warn whenever a trampoline is generated
+
Wtype-limits
Common Var(warn_type_limits) Init(-1) Warning
Warn if a comparison is always true or always false due to the limited range of the data type
@@ -653,6 +657,10 @@ fif-conversion2
Common Report Var(flag_if_conversion2) Optimization
Perform conversion of conditional jumps to conditional execution
+ftree-loop-if-convert
+Common Report Var(flag_tree_loop_if_convert) Init(-1) Optimization
+Convert conditional jumps in innermost loops to branchless equivalents
+
; -finhibit-size-directive inhibits output of .size for ELF.
; This is used only for compiling crtstuff.c,
; and it may be extended to other effects
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 6dc074d8a88..eef0942c532 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -101,6 +101,12 @@
# extra_headers List of used header files from the directory
# config/${cpu_type}.
#
+# user_headers_inc_next_pre
+# List of header file names of internal gcc header
+# files, which should be prefixed by an include_next.
+# user_headers_inc_next_post
+# List of header file names of internal gcc header
+# files, which should be postfixed by an include_next.
# use_gcc_tgmath If set, add tgmath.h to the list of used header
# files.
#
@@ -171,6 +177,8 @@
out_file=
tmake_file=
extra_headers=
+user_headers_inc_next_pre=
+user_headers_inc_next_post=
use_gcc_tgmath=yes
use_gcc_stdint=none
extra_passes=
@@ -405,6 +413,9 @@ case ${target} in
;;
esac
+# Common C libraries.
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+
# Common parts for widely ported systems.
case ${target} in
*-*-darwin*)
@@ -508,8 +519,6 @@ case ${target} in
*-*-gnu*)
tmake_file="$tmake_file t-gnu";;
esac
- # Common C libraries.
- tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
# glibc / uclibc / bionic switch.
# uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
case $target in
@@ -1253,13 +1262,10 @@ i[34567]86-*-solaris2*)
# Set default arch_32 to pentium4, tune_32 to generic like the other
# i386 targets, although config.guess defaults to i386-pc-solaris2*.
case ${target} in
- *-*-solaris2.8*)
- if test x$gas = xyes; then
- with_arch_32=${with_arch_32:-pentium4}
- else
- # Solaris 8/x86 as cannot handle sse2.
- with_arch_32=${with_arch_32:-pentiumpro}
- fi
+ *-*-solaris2.[89]*)
+ # Solaris 8 and 9/x86 cannot execute SSE/SSE2 instructions by
+ # default.
+ with_arch_32=${with_arch_32:-pentiumpro}
;;
*)
with_arch_32=${with_arch_32:-pentium4}
@@ -1381,6 +1387,8 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
# This makes the logic if mingw's or the w64 feature set has to be used
case ${target} in
*-w64-*)
+ user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
+ user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h"
tm_file="${tm_file} i386/mingw-w64.h"
if test x$enable_targets = xall; then
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
@@ -2335,7 +2343,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
- sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^sh/m/i' -e 's/ sh/ m/gi' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
+ sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
for sh_multilib in ${sh_multilibs}; do
case ${sh_multilib} in
m1 | m2 | m2e | m3 | m3e | \
diff --git a/gcc/config.in b/gcc/config.in
index 35d406d1872..c451c5378e0 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -315,7 +315,7 @@
#endif
-/* Define true if the assembler supports 'rep <insn>, lock <insn>'. */
+/* Define if the assembler supports 'rep <insn>, lock <insn>'. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_IX86_REP_LOCK_PREFIX
#endif
@@ -449,7 +449,7 @@
#endif
-/* Define if your assembler supports thread-local storage. */
+/* Define if your assembler and linker support thread-local storage. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_TLS
#endif
@@ -1537,6 +1537,18 @@
#endif
+/* Define to the linker flags to use for -pthread. */
+#ifndef USED_FOR_TARGET
+#undef LIB_THREAD_LDFLAGS_SPEC
+#endif
+
+
+/* Define to the library containing __tls_get_addr/___tls_get_addr. */
+#ifndef USED_FOR_TARGET
+#undef LIB_TLS_SPEC
+#endif
+
+
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 7345be4791b..336c107be51 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see
#include "obstack.h"
#include "except.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "integrate.h"
@@ -1584,10 +1585,10 @@ alpha_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
if (in_p)
{
if (!aligned_memory_operand (x, mode))
- sri->icode = reload_in_optab[mode];
+ sri->icode = direct_optab_handler (reload_in_optab, mode);
}
else
- sri->icode = reload_out_optab[mode];
+ sri->icode = direct_optab_handler (reload_out_optab, mode);
return NO_REGS;
}
}
@@ -5943,13 +5944,13 @@ alpha_build_builtin_va_list (void)
FIELD_DECL, get_identifier ("__offset"),
integer_type_node);
DECL_FIELD_CONTEXT (ofs) = record;
- TREE_CHAIN (ofs) = space;
+ DECL_CHAIN (ofs) = space;
base = build_decl (BUILTINS_LOCATION,
FIELD_DECL, get_identifier ("__base"),
ptr_type_node);
DECL_FIELD_CONTEXT (base) = record;
- TREE_CHAIN (base) = ofs;
+ DECL_CHAIN (base) = ofs;
TYPE_FIELDS (record) = base;
layout_type (record);
@@ -6025,7 +6026,7 @@ alpha_stdarg_optimize_hook (struct stdarg_info *si, const_gimple stmt)
rhs = gimple_assign_rhs1 (stmt);
while (handled_component_p (rhs))
rhs = TREE_OPERAND (rhs, 0);
- if (TREE_CODE (rhs) != INDIRECT_REF
+ if (TREE_CODE (rhs) != MEM_REF
|| TREE_CODE (TREE_OPERAND (rhs, 0)) != SSA_NAME)
return false;
@@ -6303,7 +6304,7 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
else
{
base_field = TYPE_FIELDS (TREE_TYPE (valist));
- offset_field = TREE_CHAIN (base_field);
+ offset_field = DECL_CHAIN (base_field);
base_field = build3 (COMPONENT_REF, TREE_TYPE (base_field),
valist, base_field, NULL_TREE);
@@ -6407,7 +6408,7 @@ alpha_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
base_field = TYPE_FIELDS (va_list_type_node);
- offset_field = TREE_CHAIN (base_field);
+ offset_field = DECL_CHAIN (base_field);
base_field = build3 (COMPONENT_REF, TREE_TYPE (base_field),
valist, base_field, NULL_TREE);
offset_field = build3 (COMPONENT_REF, TREE_TYPE (offset_field),
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 901698ea6b1..72800cac3a5 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "expr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "df.h"
#include "tm_p.h"
diff --git a/gcc/config/arm/arm-modes.def b/gcc/config/arm/arm-modes.def
index 813ce8ec142..db6cc92dd28 100644
--- a/gcc/config/arm/arm-modes.def
+++ b/gcc/config/arm/arm-modes.def
@@ -34,11 +34,19 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE)
CCFPmode should be used with floating equalities.
CC_NOOVmode should be used with SImode integer equalities.
CC_Zmode should be used if only the Z flag is set correctly
+ CC_Cmode should be used if only the C flag is set correctly, after an
+ addition.
CC_Nmode should be used if only the N (sign) flag is set correctly
+ CC_CZmode should be used if only the C and Z flags are correct
+ (used for DImode unsigned comparisons).
+ CC_NCVmode should be used if only the N, C, and V flags are correct
+ (used for DImode signed comparisons).
CCmode should be used otherwise. */
CC_MODE (CC_NOOV);
CC_MODE (CC_Z);
+CC_MODE (CC_CZ);
+CC_MODE (CC_NCV);
CC_MODE (CC_SWP);
CC_MODE (CCFP);
CC_MODE (CCFPE);
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 61dcf07d8ef..11e2e288ce9 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -50,8 +50,7 @@ extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
extern int const_ok_for_arm (HOST_WIDE_INT);
extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx,
HOST_WIDE_INT, rtx, rtx, int);
-extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode,
- rtx *);
+extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, rtx *, rtx *);
extern int legitimate_pic_operand_p (rtx);
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
extern rtx legitimize_tls_address (rtx, rtx);
@@ -117,6 +116,7 @@ extern void arm_reload_in_hi (rtx *);
extern void arm_reload_out_hi (rtx *);
extern int arm_const_double_inline_cost (rtx);
extern bool arm_const_double_by_parts (rtx);
+extern bool arm_const_double_by_immediates (rtx);
extern const char *fp_immediate_constant (rtx);
extern void arm_emit_call_insn (rtx, rtx);
extern const char *output_call (rtx *);
@@ -131,6 +131,7 @@ extern const char *output_move_double (rtx *);
extern const char *output_move_quad (rtx *);
extern const char *output_move_vfp (rtx *operands);
extern const char *output_move_neon (rtx *operands);
+extern int arm_attr_length_move_neon (rtx);
extern const char *output_add_immediate (rtx *);
extern const char *arithmetic_instr (rtx, int);
extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 9cb272c323e..7b01afb3136 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -40,6 +40,7 @@
#include "function.h"
#include "expr.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "cgraph.h"
@@ -3183,13 +3184,82 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
immediate value easier to load. */
enum rtx_code
-arm_canonicalize_comparison (enum rtx_code code, enum machine_mode mode,
- rtx * op1)
+arm_canonicalize_comparison (enum rtx_code code, rtx *op0, rtx *op1)
{
- unsigned HOST_WIDE_INT i = INTVAL (*op1);
- unsigned HOST_WIDE_INT maxval;
+ enum machine_mode mode;
+ unsigned HOST_WIDE_INT i, maxval;
+
+ mode = GET_MODE (*op0);
+ if (mode == VOIDmode)
+ mode = GET_MODE (*op1);
+
maxval = (((unsigned HOST_WIDE_INT) 1) << (GET_MODE_BITSIZE(mode) - 1)) - 1;
+ /* For DImode, we have GE/LT/GEU/LTU comparisons. In ARM mode
+ we can also use cmp/cmpeq for GTU/LEU. GT/LE must be either
+ reversed or (for constant OP1) adjusted to GE/LT. Similarly
+ for GTU/LEU in Thumb mode. */
+ if (mode == DImode)
+ {
+ rtx tem;
+
+ /* To keep things simple, always use the Cirrus cfcmp64 if it is
+ available. */
+ if (TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK)
+ return code;
+
+ if (code == GT || code == LE
+ || (!TARGET_ARM && (code == GTU || code == LEU)))
+ {
+ /* Missing comparison. First try to use an available
+ comparison. */
+ if (GET_CODE (*op1) == CONST_INT)
+ {
+ i = INTVAL (*op1);
+ switch (code)
+ {
+ case GT:
+ case LE:
+ if (i != maxval
+ && arm_const_double_by_immediates (GEN_INT (i + 1)))
+ {
+ *op1 = GEN_INT (i + 1);
+ return code == GT ? GE : LT;
+ }
+ break;
+ case GTU:
+ case LEU:
+ if (i != ~((unsigned HOST_WIDE_INT) 0)
+ && arm_const_double_by_immediates (GEN_INT (i + 1)))
+ {
+ *op1 = GEN_INT (i + 1);
+ return code == GTU ? GEU : LTU;
+ }
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+
+ /* If that did not work, reverse the condition. */
+ tem = *op0;
+ *op0 = *op1;
+ *op1 = tem;
+ return swap_condition (code);
+ }
+
+ return code;
+ }
+
+ /* Comparisons smaller than DImode. Only adjust comparisons against
+ an out-of-range constant. */
+ if (GET_CODE (*op1) != CONST_INT
+ || const_ok_for_arm (INTVAL (*op1))
+ || const_ok_for_arm (- INTVAL (*op1)))
+ return code;
+
+ i = INTVAL (*op1);
+
switch (code)
{
case EQ:
@@ -3466,7 +3536,7 @@ arm_return_in_memory (const_tree type, const_tree fntype)
have been created by C++. */
for (field = TYPE_FIELDS (type);
field && TREE_CODE (field) != FIELD_DECL;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
continue;
if (field == NULL)
@@ -3485,9 +3555,9 @@ arm_return_in_memory (const_tree type, const_tree fntype)
/* Now check the remaining fields, if any. Only bitfields are allowed,
since they are not addressable. */
- for (field = TREE_CHAIN (field);
+ for (field = DECL_CHAIN (field);
field;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -3507,7 +3577,7 @@ arm_return_in_memory (const_tree type, const_tree fntype)
integral, or can be returned in an integer register. */
for (field = TYPE_FIELDS (type);
field;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -3767,7 +3837,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
if (!COMPLETE_TYPE_P(type))
return -1;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -3799,7 +3869,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
if (!COMPLETE_TYPE_P(type))
return -1;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -6214,6 +6284,7 @@ static inline int
thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
{
enum machine_mode mode = GET_MODE (x);
+ int total;
switch (code)
{
@@ -6312,24 +6383,20 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
return 14;
return 2;
+ case SIGN_EXTEND:
case ZERO_EXTEND:
- /* XXX still guessing. */
- switch (GET_MODE (XEXP (x, 0)))
- {
- case QImode:
- return (1 + (mode == DImode ? 4 : 0)
- + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+ total = mode == DImode ? COSTS_N_INSNS (1) : 0;
+ total += thumb1_rtx_costs (XEXP (x, 0), GET_CODE (XEXP (x, 0)), code);
- case HImode:
- return (4 + (mode == DImode ? 4 : 0)
- + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+ if (mode == SImode)
+ return total;
- case SImode:
- return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+ if (arm_arch6)
+ return total + COSTS_N_INSNS (1);
- default:
- return 99;
- }
+ /* Assume a two-shift sequence. Increase the cost slightly so
+ we prefer actual shifts over an extend operation. */
+ return total + 1 + COSTS_N_INSNS (2);
default:
return 99;
@@ -6798,44 +6865,39 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
return false;
case SIGN_EXTEND:
- if (GET_MODE_CLASS (mode) == MODE_INT)
- {
- *total = 0;
- if (mode == DImode)
- *total += COSTS_N_INSNS (1);
-
- if (GET_MODE (XEXP (x, 0)) != SImode)
- {
- if (arm_arch6)
- {
- if (GET_CODE (XEXP (x, 0)) != MEM)
- *total += COSTS_N_INSNS (1);
- }
- else if (!arm_arch4 || GET_CODE (XEXP (x, 0)) != MEM)
- *total += COSTS_N_INSNS (2);
- }
-
- return false;
- }
-
- /* Fall through */
case ZERO_EXTEND:
*total = 0;
if (GET_MODE_CLASS (mode) == MODE_INT)
{
+ rtx op = XEXP (x, 0);
+ enum machine_mode opmode = GET_MODE (op);
+
if (mode == DImode)
*total += COSTS_N_INSNS (1);
- if (GET_MODE (XEXP (x, 0)) != SImode)
+ if (opmode != SImode)
{
- if (arm_arch6)
+ if (MEM_P (op))
{
- if (GET_CODE (XEXP (x, 0)) != MEM)
- *total += COSTS_N_INSNS (1);
+ /* If !arm_arch4, we use one of the extendhisi2_mem
+ or movhi_bytes patterns for HImode. For a QImode
+ sign extension, we first zero-extend from memory
+ and then perform a shift sequence. */
+ if (!arm_arch4 && (opmode != QImode || code == SIGN_EXTEND))
+ *total += COSTS_N_INSNS (2);
}
- else if (!arm_arch4 || GET_CODE (XEXP (x, 0)) != MEM)
- *total += COSTS_N_INSNS (GET_MODE (XEXP (x, 0)) == QImode ?
- 1 : 2);
+ else if (arm_arch6)
+ *total += COSTS_N_INSNS (1);
+
+ /* We don't have the necessary insn, so we need to perform some
+ other operation. */
+ else if (TARGET_ARM && code == ZERO_EXTEND && mode == QImode)
+ /* An and with constant 255. */
+ *total += COSTS_N_INSNS (1);
+ else
+ /* A shift sequence. Increase costs slightly to avoid
+ combining two shifts into an extend operation. */
+ *total += COSTS_N_INSNS (2) + 1;
}
return false;
@@ -7191,41 +7253,8 @@ arm_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code,
return false;
case SIGN_EXTEND:
- *total = 0;
- if (GET_MODE_SIZE (GET_MODE (XEXP (x, 0))) < 4)
- {
- if (!(arm_arch4 && MEM_P (XEXP (x, 0))))
- *total += COSTS_N_INSNS (arm_arch6 ? 1 : 2);
- }
- if (mode == DImode)
- *total += COSTS_N_INSNS (1);
- return false;
-
case ZERO_EXTEND:
- *total = 0;
- if (!(arm_arch4 && MEM_P (XEXP (x, 0))))
- {
- switch (GET_MODE (XEXP (x, 0)))
- {
- case QImode:
- *total += COSTS_N_INSNS (1);
- break;
-
- case HImode:
- *total += COSTS_N_INSNS (arm_arch6 ? 1 : 2);
-
- case SImode:
- break;
-
- default:
- *total += COSTS_N_INSNS (2);
- }
- }
-
- if (mode == DImode)
- *total += COSTS_N_INSNS (1);
-
- return false;
+ return arm_rtx_costs_1 (x, outer_code, total, 0);
case CONST_INT:
if (const_ok_for_arm (INTVAL (x)))
@@ -8250,8 +8279,7 @@ neon_vdup_constant (rtx vals)
load. */
x = copy_to_mode_reg (inner_mode, XVECEXP (vals, 0, 0));
- return gen_rtx_UNSPEC (mode, gen_rtvec (1, x),
- UNSPEC_VDUP_N);
+ return gen_rtx_VEC_DUPLICATE (mode, x);
}
/* Generate code to load VALS, which is a PARALLEL containing only
@@ -8347,8 +8375,7 @@ neon_expand_vector_init (rtx target, rtx vals)
{
x = copy_to_mode_reg (inner_mode, XVECEXP (vals, 0, 0));
emit_insn (gen_rtx_SET (VOIDmode, target,
- gen_rtx_UNSPEC (mode, gen_rtvec (1, x),
- UNSPEC_VDUP_N)));
+ gen_rtx_VEC_DUPLICATE (mode, x)));
return;
}
@@ -8357,7 +8384,7 @@ neon_expand_vector_init (rtx target, rtx vals)
if (n_var == 1)
{
rtx copy = copy_rtx (vals);
- rtvec ops;
+ rtx index = GEN_INT (one_var);
/* Load constant part of vector, substitute neighboring value for
varying element. */
@@ -8366,9 +8393,38 @@ neon_expand_vector_init (rtx target, rtx vals)
/* Insert variable. */
x = copy_to_mode_reg (inner_mode, XVECEXP (vals, 0, one_var));
- ops = gen_rtvec (3, x, target, GEN_INT (one_var));
- emit_insn (gen_rtx_SET (VOIDmode, target,
- gen_rtx_UNSPEC (mode, ops, UNSPEC_VSET_LANE)));
+ switch (mode)
+ {
+ case V8QImode:
+ emit_insn (gen_neon_vset_lanev8qi (target, x, target, index));
+ break;
+ case V16QImode:
+ emit_insn (gen_neon_vset_lanev16qi (target, x, target, index));
+ break;
+ case V4HImode:
+ emit_insn (gen_neon_vset_lanev4hi (target, x, target, index));
+ break;
+ case V8HImode:
+ emit_insn (gen_neon_vset_lanev8hi (target, x, target, index));
+ break;
+ case V2SImode:
+ emit_insn (gen_neon_vset_lanev2si (target, x, target, index));
+ break;
+ case V4SImode:
+ emit_insn (gen_neon_vset_lanev4si (target, x, target, index));
+ break;
+ case V2SFmode:
+ emit_insn (gen_neon_vset_lanev2sf (target, x, target, index));
+ break;
+ case V4SFmode:
+ emit_insn (gen_neon_vset_lanev4sf (target, x, target, index));
+ break;
+ case V2DImode:
+ emit_insn (gen_neon_vset_lanev2di (target, x, target, index));
+ break;
+ default:
+ gcc_unreachable ();
+ }
return;
}
@@ -10028,6 +10084,55 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
&& (rtx_equal_p (XEXP (x, 0), y) || rtx_equal_p (XEXP (x, 1), y)))
return CC_Cmode;
+ if (GET_MODE (x) == DImode || GET_MODE (y) == DImode)
+ {
+ /* To keep things simple, always use the Cirrus cfcmp64 if it is
+ available. */
+ if (TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK)
+ return CCmode;
+
+ switch (op)
+ {
+ case EQ:
+ case NE:
+ /* A DImode comparison against zero can be implemented by
+ or'ing the two halves together. */
+ if (y == const0_rtx)
+ return CC_Zmode;
+
+ /* We can do an equality test in three Thumb instructions. */
+ if (!TARGET_ARM)
+ return CC_Zmode;
+
+ /* FALLTHROUGH */
+
+ case LTU:
+ case LEU:
+ case GTU:
+ case GEU:
+ /* DImode unsigned comparisons can be implemented by cmp +
+ cmpeq without a scratch register. Not worth doing in
+ Thumb-2. */
+ if (TARGET_ARM)
+ return CC_CZmode;
+
+ /* FALLTHROUGH */
+
+ case LT:
+ case LE:
+ case GT:
+ case GE:
+ /* DImode signed and unsigned comparisons can be implemented
+ by cmp + sbcs with a scratch register, but that does not
+ set the Z flag - we must reverse GT/LE/GTU/LEU. */
+ gcc_assert (op != EQ && op != NE);
+ return CC_NCVmode;
+
+ default:
+ gcc_unreachable ();
+ }
+ }
+
return CCmode;
}
@@ -10037,10 +10142,39 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
rtx
arm_gen_compare_reg (enum rtx_code code, rtx x, rtx y)
{
- enum machine_mode mode = SELECT_CC_MODE (code, x, y);
- rtx cc_reg = gen_rtx_REG (mode, CC_REGNUM);
+ enum machine_mode mode;
+ rtx cc_reg;
+ int dimode_comparison = GET_MODE (x) == DImode || GET_MODE (y) == DImode;
+
+ /* We might have X as a constant, Y as a register because of the predicates
+ used for cmpdi. If so, force X to a register here. */
+ if (dimode_comparison && !REG_P (x))
+ x = force_reg (DImode, x);
- emit_set_insn (cc_reg, gen_rtx_COMPARE (mode, x, y));
+ mode = SELECT_CC_MODE (code, x, y);
+ cc_reg = gen_rtx_REG (mode, CC_REGNUM);
+
+ if (dimode_comparison
+ && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)
+ && mode != CC_CZmode)
+ {
+ rtx clobber, set;
+
+ /* To compare two non-zero values for equality, XOR them and
+ then compare against zero. Not used for ARM mode; there
+ CC_CZmode is cheaper. */
+ if (mode == CC_Zmode && y != const0_rtx)
+ {
+ x = expand_binop (DImode, xor_optab, x, y, NULL_RTX, 0, OPTAB_WIDEN);
+ y = const0_rtx;
+ }
+ /* A scratch register is required. */
+ clobber = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (SImode));
+ set = gen_rtx_SET (VOIDmode, cc_reg, gen_rtx_COMPARE (mode, x, y));
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set, clobber)));
+ }
+ else
+ emit_set_insn (cc_reg, gen_rtx_COMPARE (mode, x, y));
return cc_reg;
}
@@ -11369,6 +11503,34 @@ arm_const_double_by_parts (rtx val)
return false;
}
+/* Return true if it is possible to inline both the high and low parts
+ of a 64-bit constant into 32-bit data processing instructions. */
+bool
+arm_const_double_by_immediates (rtx val)
+{
+ enum machine_mode mode = GET_MODE (val);
+ rtx part;
+
+ if (mode == VOIDmode)
+ mode = DImode;
+
+ part = gen_highpart_mode (SImode, mode, val);
+
+ gcc_assert (GET_CODE (part) == CONST_INT);
+
+ if (!const_ok_for_arm (INTVAL (part)))
+ return false;
+
+ part = gen_lowpart (SImode, val);
+
+ gcc_assert (GET_CODE (part) == CONST_INT);
+
+ if (!const_ok_for_arm (INTVAL (part)))
+ return false;
+
+ return true;
+}
+
/* Scan INSN and note any of its operands that need fixing.
If DO_PUSHES is false we do not actually push any of the fixups
needed. The function returns TRUE if any fixups were needed/pushed.
@@ -12698,6 +12860,56 @@ output_move_neon (rtx *operands)
return "";
}
+/* Compute and return the length of neon_mov<mode>, where <mode> is
+ one of VSTRUCT modes: EI, OI, CI or XI. */
+int
+arm_attr_length_move_neon (rtx insn)
+{
+ rtx reg, mem, addr;
+ int load;
+ enum machine_mode mode;
+
+ extract_insn_cached (insn);
+
+ if (REG_P (recog_data.operand[0]) && REG_P (recog_data.operand[1]))
+ {
+ mode = GET_MODE (recog_data.operand[0]);
+ switch (mode)
+ {
+ case EImode:
+ case OImode:
+ return 8;
+ case CImode:
+ return 12;
+ case XImode:
+ return 16;
+ default:
+ gcc_unreachable ();
+ }
+ }
+
+ load = REG_P (recog_data.operand[0]);
+ reg = recog_data.operand[!load];
+ mem = recog_data.operand[load];
+
+ gcc_assert (MEM_P (mem));
+
+ mode = GET_MODE (reg);
+ addr = XEXP (mem, 0);
+
+ /* Strip off const from addresses like (const (plus (...))). */
+ if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == PLUS)
+ addr = XEXP (addr, 0);
+
+ if (GET_CODE (addr) == LABEL_REF || GET_CODE (addr) == PLUS)
+ {
+ int insns = HARD_REGNO_NREGS (REGNO (reg), mode) / 2;
+ return insns * 4;
+ }
+ else
+ return 4;
+}
+
/* Output an ADD r, s, #n where n may be too big for one instruction.
If adding zero to one register, output nothing. */
const char *
@@ -14479,7 +14691,8 @@ arm_get_frame_offsets (void)
generates better code on Thumb-2 by avoiding the need to
use 32-bit push/pop instructions. */
if (!crtl->tail_call_emit
- && arm_size_return_regs () <= 12)
+ && arm_size_return_regs () <= 12
+ && (offsets->saved_regs_mask & (1 << 3)) == 0)
{
reg = 3;
}
@@ -15270,8 +15483,18 @@ arm_print_operand (FILE *stream, rtx x, int code)
the value being loaded is big-wordian or little-wordian. The
order of the two register loads can matter however, if the address
of the memory location is actually held in one of the registers
- being overwritten by the load. */
+ being overwritten by the load.
+
+ The 'Q' and 'R' constraints are also available for 64-bit
+ constants. */
case 'Q':
+ if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
+ {
+ rtx part = gen_lowpart (SImode, x);
+ fprintf (stream, "#" HOST_WIDE_INT_PRINT_DEC, INTVAL (part));
+ return;
+ }
+
if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM)
{
output_operand_lossage ("invalid operand for code '%c'", code);
@@ -15282,6 +15505,18 @@ arm_print_operand (FILE *stream, rtx x, int code)
return;
case 'R':
+ if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
+ {
+ enum machine_mode mode = GET_MODE (x);
+ rtx part;
+
+ if (mode == VOIDmode)
+ mode = DImode;
+ part = gen_highpart_mode (SImode, mode, x);
+ fprintf (stream, "#" HOST_WIDE_INT_PRINT_DEC, INTVAL (part));
+ return;
+ }
+
if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM)
{
output_operand_lossage ("invalid operand for code '%c'", code);
@@ -16102,11 +16337,33 @@ get_arm_condition_code (rtx comparison)
case CC_Cmode:
switch (comp_code)
- {
- case LTU: return ARM_CS;
- case GEU: return ARM_CC;
- default: gcc_unreachable ();
- }
+ {
+ case LTU: return ARM_CS;
+ case GEU: return ARM_CC;
+ default: gcc_unreachable ();
+ }
+
+ case CC_CZmode:
+ switch (comp_code)
+ {
+ case NE: return ARM_NE;
+ case EQ: return ARM_EQ;
+ case GEU: return ARM_CS;
+ case GTU: return ARM_HI;
+ case LEU: return ARM_LS;
+ case LTU: return ARM_CC;
+ default: gcc_unreachable ();
+ }
+
+ case CC_NCVmode:
+ switch (comp_code)
+ {
+ case GE: return ARM_GE;
+ case LT: return ARM_LT;
+ case GEU: return ARM_CS;
+ case LTU: return ARM_CC;
+ default: gcc_unreachable ();
+ }
case CCmode:
switch (comp_code)
@@ -19309,6 +19566,81 @@ is_called_in_ARM_mode (tree func)
#endif
}
+/* Given the stack offsets and register mask in OFFSETS, decide how
+ many additional registers to push instead of subtracting a constant
+ from SP. For epilogues the principle is the same except we use pop.
+ FOR_PROLOGUE indicates which we're generating. */
+static int
+thumb1_extra_regs_pushed (arm_stack_offsets *offsets, bool for_prologue)
+{
+ HOST_WIDE_INT amount;
+ unsigned long live_regs_mask = offsets->saved_regs_mask;
+ /* Extract a mask of the ones we can give to the Thumb's push/pop
+ instruction. */
+ unsigned long l_mask = live_regs_mask & (for_prologue ? 0x40ff : 0xff);
+ /* Then count how many other high registers will need to be pushed. */
+ unsigned long high_regs_pushed = bit_count (live_regs_mask & 0x0f00);
+ int n_free, reg_base;
+
+ if (!for_prologue && frame_pointer_needed)
+ amount = offsets->locals_base - offsets->saved_regs;
+ else
+ amount = offsets->outgoing_args - offsets->saved_regs;
+
+ /* If the stack frame size is 512 exactly, we can save one load
+ instruction, which should make this a win even when optimizing
+ for speed. */
+ if (!optimize_size && amount != 512)
+ return 0;
+
+ /* Can't do this if there are high registers to push. */
+ if (high_regs_pushed != 0)
+ return 0;
+
+ /* Shouldn't do it in the prologue if no registers would normally
+ be pushed at all. In the epilogue, also allow it if we'll have
+ a pop insn for the PC. */
+ if (l_mask == 0
+ && (for_prologue
+ || TARGET_BACKTRACE
+ || (live_regs_mask & 1 << LR_REGNUM) == 0
+ || TARGET_INTERWORK
+ || crtl->args.pretend_args_size != 0))
+ return 0;
+
+ /* Don't do this if thumb_expand_prologue wants to emit instructions
+ between the push and the stack frame allocation. */
+ if (for_prologue
+ && ((flag_pic && arm_pic_register != INVALID_REGNUM)
+ || (!frame_pointer_needed && CALLER_INTERWORKING_SLOT_SIZE > 0)))
+ return 0;
+
+ reg_base = 0;
+ n_free = 0;
+ if (!for_prologue)
+ {
+ reg_base = arm_size_return_regs () / UNITS_PER_WORD;
+ live_regs_mask >>= reg_base;
+ }
+
+ while (reg_base + n_free < 8 && !(live_regs_mask & 1)
+ && (for_prologue || call_used_regs[reg_base + n_free]))
+ {
+ live_regs_mask >>= 1;
+ n_free++;
+ }
+
+ if (n_free == 0)
+ return 0;
+ gcc_assert (amount / 4 * 4 == amount);
+
+ if (amount >= 512 && (amount - n_free * 4) < 512)
+ return (amount - 508) / 4;
+ if (amount <= n_free * 4)
+ return amount / 4;
+ return 0;
+}
+
/* The bits which aren't usefully expanded as rtl. */
const char *
thumb_unexpanded_epilogue (void)
@@ -19317,6 +19649,7 @@ thumb_unexpanded_epilogue (void)
int regno;
unsigned long live_regs_mask = 0;
int high_regs_pushed = 0;
+ int extra_pop;
int had_to_push_lr;
int size;
@@ -19336,6 +19669,13 @@ thumb_unexpanded_epilogue (void)
the register is used to hold a return value. */
size = arm_size_return_regs ();
+ extra_pop = thumb1_extra_regs_pushed (offsets, false);
+ if (extra_pop > 0)
+ {
+ unsigned long extra_mask = (1 << extra_pop) - 1;
+ live_regs_mask |= extra_mask << (size / UNITS_PER_WORD);
+ }
+
/* The prolog may have pushed some high registers to use as
work registers. e.g. the testsuite file:
gcc/testsuite/gcc/gcc.c-torture/execute/complex-2.c
@@ -19419,7 +19759,9 @@ thumb_unexpanded_epilogue (void)
live_regs_mask);
/* We have either just popped the return address into the
- PC or it is was kept in LR for the entire function. */
+ PC or it is was kept in LR for the entire function.
+ Note that thumb_pushpop has already called thumb_exit if the
+ PC was in the list. */
if (!had_to_push_lr)
thumb_exit (asm_out_file, LR_REGNUM);
}
@@ -19565,51 +19907,6 @@ thumb_compute_initial_elimination_offset (unsigned int from, unsigned int to)
}
}
-/* Given the stack offsets and register mask in OFFSETS, decide
- how many additional registers to push instead of subtracting
- a constant from SP. */
-static int
-thumb1_extra_regs_pushed (arm_stack_offsets *offsets)
-{
- HOST_WIDE_INT amount = offsets->outgoing_args - offsets->saved_regs;
- unsigned long live_regs_mask = offsets->saved_regs_mask;
- /* Extract a mask of the ones we can give to the Thumb's push instruction. */
- unsigned long l_mask = live_regs_mask & 0x40ff;
- /* Then count how many other high registers will need to be pushed. */
- unsigned long high_regs_pushed = bit_count (live_regs_mask & 0x0f00);
- int n_free;
-
- /* If the stack frame size is 512 exactly, we can save one load
- instruction, which should make this a win even when optimizing
- for speed. */
- if (!optimize_size && amount != 512)
- return 0;
-
- /* Can't do this if there are high registers to push, or if we
- are not going to do a push at all. */
- if (high_regs_pushed != 0 || l_mask == 0)
- return 0;
-
- /* Don't do this if thumb1_expand_prologue wants to emit instructions
- between the push and the stack frame allocation. */
- if ((flag_pic && arm_pic_register != INVALID_REGNUM)
- || (!frame_pointer_needed && CALLER_INTERWORKING_SLOT_SIZE > 0))
- return 0;
-
- for (n_free = 0; n_free < 8 && !(live_regs_mask & 1); live_regs_mask >>= 1)
- n_free++;
-
- if (n_free == 0)
- return 0;
- gcc_assert (amount / 4 * 4 == amount);
-
- if (amount >= 512 && (amount - n_free * 4) < 512)
- return (amount - 508) / 4;
- if (amount <= n_free * 4)
- return amount / 4;
- return 0;
-}
-
/* Generate the rest of a function's prologue. */
void
thumb1_expand_prologue (void)
@@ -19646,7 +19943,7 @@ thumb1_expand_prologue (void)
stack_pointer_rtx);
amount = offsets->outgoing_args - offsets->saved_regs;
- amount -= 4 * thumb1_extra_regs_pushed (offsets);
+ amount -= 4 * thumb1_extra_regs_pushed (offsets, true);
if (amount)
{
if (amount < 512)
@@ -19731,6 +20028,7 @@ thumb1_expand_epilogue (void)
emit_insn (gen_movsi (stack_pointer_rtx, hard_frame_pointer_rtx));
amount = offsets->locals_base - offsets->saved_regs;
}
+ amount -= 4 * thumb1_extra_regs_pushed (offsets, false);
gcc_assert (amount >= 0);
if (amount)
@@ -19953,7 +20251,7 @@ thumb1_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
|| (high_regs_pushed == 0 && l_mask))
{
unsigned long mask = l_mask;
- mask |= (1 << thumb1_extra_regs_pushed (offsets)) - 1;
+ mask |= (1 << thumb1_extra_regs_pushed (offsets, true)) - 1;
thumb_pushpop (f, mask, 1, &cfa_offset, mask);
}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index fcd1ef3d2eb..cad50a85af4 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2244,19 +2244,7 @@ extern int making_const_table;
: reverse_condition (code))
#define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \
- do \
- { \
- if (GET_CODE (OP1) == CONST_INT \
- && ! (const_ok_for_arm (INTVAL (OP1)) \
- || (const_ok_for_arm (- INTVAL (OP1))))) \
- { \
- rtx const_op = OP1; \
- CODE = arm_canonicalize_comparison ((CODE), GET_MODE (OP0), \
- &const_op); \
- OP1 = const_op; \
- } \
- } \
- while (0)
+ (CODE) = arm_canonicalize_comparison (CODE, &(OP0), &(OP1))
/* The arm5 clz instruction returns 32. */
#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 725d505ab5c..33b6931de14 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -148,6 +148,9 @@
; patterns that share the same RTL in both ARM and Thumb code.
(define_attr "is_thumb" "no,yes" (const (symbol_ref "thumb_code")))
+; IS_ARCH6 is set to 'yes' when we are generating code form ARMv6.
+(define_attr "is_arch6" "no,yes" (const (symbol_ref "arm_arch6")))
+
;; Operand number of an input operand that is shifted. Zero if the
;; given instruction does not shift one of its input operands.
(define_attr "shift" "" (const_int 0))
@@ -492,15 +495,16 @@
(plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0")
(match_operand:DI 2 "s_register_operand" "r, 0")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_32BIT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
+ "TARGET_32BIT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK) && !TARGET_NEON"
"#"
- "TARGET_32BIT && reload_completed"
+ "TARGET_32BIT && reload_completed
+ && ! (TARGET_NEON && IS_VFP_REGNUM (REGNO (operands[0])))"
[(parallel [(set (reg:CC_C CC_REGNUM)
(compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
(match_dup 1)))
(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))])
- (set (match_dup 3) (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (plus:SI (match_dup 4) (match_dup 5))))]
+ (set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
"
{
operands[3] = gen_highpart (SImode, operands[0]);
@@ -527,10 +531,10 @@
(compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
(match_dup 1)))
(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))])
- (set (match_dup 3) (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (plus:SI (ashiftrt:SI (match_dup 2)
+ (set (match_dup 3) (plus:SI (plus:SI (ashiftrt:SI (match_dup 2)
(const_int 31))
- (match_dup 4))))]
+ (match_dup 4))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
"
{
operands[3] = gen_highpart (SImode, operands[0]);
@@ -556,8 +560,8 @@
(compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
(match_dup 1)))
(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))])
- (set (match_dup 3) (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (plus:SI (match_dup 4) (const_int 0))))]
+ (set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (const_int 0))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
"
{
operands[3] = gen_highpart (SImode, operands[0]);
@@ -606,9 +610,9 @@
;; (plus (reg rN) (reg sp)) into (reg rN). In this case reload will
;; put the duplicated register first, and not try the commutative version.
(define_insn_and_split "*arm_addsi3"
- [(set (match_operand:SI 0 "s_register_operand" "=r, !k, r,r, !k,r")
- (plus:SI (match_operand:SI 1 "s_register_operand" "%rk,!k, r,rk,!k,rk")
- (match_operand:SI 2 "reg_or_int_operand" "rI, rI,!k,L, L,?n")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r, k,r,r, k,r")
+ (plus:SI (match_operand:SI 1 "s_register_operand" "%rk,k,r,rk,k,rk")
+ (match_operand:SI 2 "reg_or_int_operand" "rI,rI,k,L, L,?n")))]
"TARGET_32BIT"
"@
add%?\\t%0, %1, %2
@@ -633,14 +637,10 @@
(set_attr "predicable" "yes")]
)
-;; Register group 'k' is a single register group containing only the stack
-;; register. Trying to reload it will always fail catastrophically,
-;; so never allow those alternatives to match if reloading is needed.
-
(define_insn_and_split "*thumb1_addsi3"
- [(set (match_operand:SI 0 "register_operand" "=l,l,l,*rk,*hk,l,!k,l,l")
- (plus:SI (match_operand:SI 1 "register_operand" "%0,0,l,*0,*0,!k,!k,0,l")
- (match_operand:SI 2 "nonmemory_operand" "I,J,lL,*hk,*rk,!M,!O,Pa,Pb")))]
+ [(set (match_operand:SI 0 "register_operand" "=l,l,l,*rk,*hk,l,k,l,l,l")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0,l,*0,*0,k,k,0,l,k")
+ (match_operand:SI 2 "nonmemory_operand" "I,J,lL,*hk,*rk,M,O,Pa,Pb,Pc")))]
"TARGET_THUMB1"
"*
static const char * const asms[] =
@@ -653,6 +653,7 @@
\"add\\t%0, %1, %2\",
\"add\\t%0, %1, %2\",
\"#\",
+ \"#\",
\"#\"
};
if ((which_alternative == 2 || which_alternative == 6)
@@ -662,21 +663,27 @@
return asms[which_alternative];
"
"&& reload_completed && CONST_INT_P (operands[2])
- && operands[1] != stack_pointer_rtx
- && (INTVAL (operands[2]) > 255 || INTVAL (operands[2]) < -255)"
+ && ((operands[1] != stack_pointer_rtx
+ && (INTVAL (operands[2]) > 255 || INTVAL (operands[2]) < -255))
+ || (operands[1] == stack_pointer_rtx
+ && INTVAL (operands[2]) > 1020))"
[(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))]
{
HOST_WIDE_INT offset = INTVAL (operands[2]);
- if (offset > 255)
- offset = 255;
- else if (offset < -255)
- offset = -255;
-
+ if (operands[1] == stack_pointer_rtx)
+ offset -= 1020;
+ else
+ {
+ if (offset > 255)
+ offset = 255;
+ else if (offset < -255)
+ offset = -255;
+ }
operands[3] = GEN_INT (offset);
operands[2] = GEN_INT (INTVAL (operands[2]) - offset);
}
- [(set_attr "length" "2,2,2,2,2,2,2,4,4")]
+ [(set_attr "length" "2,2,2,2,2,2,2,4,4,4")]
)
;; Reloading and elimination of the frame pointer can
@@ -845,60 +852,44 @@
[(set_attr "conds" "set")]
)
-(define_insn "*addsi3_carryin"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (plus:SI (match_operand:SI 1 "s_register_operand" "r")
- (match_operand:SI 2 "arm_rhs_operand" "rI"))))]
- "TARGET_32BIT"
- "adc%?\\t%0, %1, %2"
- [(set_attr "conds" "use")]
-)
+(define_code_iterator LTUGEU [ltu geu])
+(define_code_attr cnb [(ltu "CC_C") (geu "CC")])
+(define_code_attr optab [(ltu "ltu") (geu "geu")])
-(define_insn "*addsi3_carryin_shift"
+(define_insn "*addsi3_carryin_<optab>"
[(set (match_operand:SI 0 "s_register_operand" "=r")
- (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (plus:SI
- (match_operator:SI 2 "shift_operator"
- [(match_operand:SI 3 "s_register_operand" "r")
- (match_operand:SI 4 "reg_or_int_operand" "rM")])
- (match_operand:SI 1 "s_register_operand" "r"))))]
- "TARGET_32BIT"
- "adc%?\\t%0, %1, %3%S2"
- [(set_attr "conds" "use")
- (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
- (const_string "alu_shift")
- (const_string "alu_shift_reg")))]
-)
-
-(define_insn "*addsi3_carryin_alt1"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (plus:SI (plus:SI (match_operand:SI 1 "s_register_operand" "r")
+ (plus:SI (plus:SI (match_operand:SI 1 "s_register_operand" "%r")
(match_operand:SI 2 "arm_rhs_operand" "rI"))
- (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ (LTUGEU:SI (reg:<cnb> CC_REGNUM) (const_int 0))))]
"TARGET_32BIT"
"adc%?\\t%0, %1, %2"
[(set_attr "conds" "use")]
)
-(define_insn "*addsi3_carryin_alt2"
+(define_insn "*addsi3_carryin_alt2_<optab>"
[(set (match_operand:SI 0 "s_register_operand" "=r")
- (plus:SI (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (match_operand:SI 1 "s_register_operand" "r"))
+ (plus:SI (plus:SI (LTUGEU:SI (reg:<cnb> CC_REGNUM) (const_int 0))
+ (match_operand:SI 1 "s_register_operand" "%r"))
(match_operand:SI 2 "arm_rhs_operand" "rI")))]
"TARGET_32BIT"
"adc%?\\t%0, %1, %2"
[(set_attr "conds" "use")]
)
-(define_insn "*addsi3_carryin_alt3"
+(define_insn "*addsi3_carryin_shift_<optab>"
[(set (match_operand:SI 0 "s_register_operand" "=r")
- (plus:SI (plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
- (match_operand:SI 2 "arm_rhs_operand" "rI"))
- (match_operand:SI 1 "s_register_operand" "r")))]
+ (plus:SI (plus:SI
+ (match_operator:SI 2 "shift_operator"
+ [(match_operand:SI 3 "s_register_operand" "r")
+ (match_operand:SI 4 "reg_or_int_operand" "rM")])
+ (match_operand:SI 1 "s_register_operand" "r"))
+ (LTUGEU:SI (reg:<cnb> CC_REGNUM) (const_int 0))))]
"TARGET_32BIT"
- "adc%?\\t%0, %1, %2"
- [(set_attr "conds" "use")]
+ "adc%?\\t%0, %1, %3%S2"
+ [(set_attr "conds" "use")
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_expand "incscc"
@@ -991,7 +982,7 @@
(minus:DI (match_operand:DI 1 "s_register_operand" "0,r,0")
(match_operand:DI 2 "s_register_operand" "r,0,0")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_32BIT"
+ "TARGET_32BIT && !TARGET_NEON"
"subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
[(set_attr "conds" "clob")
(set_attr "length" "8")]
@@ -1100,24 +1091,27 @@
; ??? Check Thumb-2 split length
(define_insn_and_split "*arm_subsi3_insn"
- [(set (match_operand:SI 0 "s_register_operand" "=r,rk,r")
- (minus:SI (match_operand:SI 1 "reg_or_int_operand" "rI,!k,?n")
- (match_operand:SI 2 "s_register_operand" "r, r, r")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r,rk,r,r")
+ (minus:SI (match_operand:SI 1 "reg_or_int_operand" "rI,r,k,?n,r")
+ (match_operand:SI 2 "reg_or_int_operand" "r,rI,r, r,?n")))]
"TARGET_32BIT"
"@
rsb%?\\t%0, %2, %1
sub%?\\t%0, %1, %2
+ sub%?\\t%0, %1, %2
+ #
#"
- "TARGET_32BIT
- && GET_CODE (operands[1]) == CONST_INT
- && !const_ok_for_arm (INTVAL (operands[1]))"
+ "&& ((GET_CODE (operands[1]) == CONST_INT
+ && !const_ok_for_arm (INTVAL (operands[1])))
+ || (GET_CODE (operands[2]) == CONST_INT
+ && !const_ok_for_arm (INTVAL (operands[2]))))"
[(clobber (const_int 0))]
"
arm_split_constant (MINUS, SImode, curr_insn,
INTVAL (operands[1]), operands[0], operands[2], 0);
DONE;
"
- [(set_attr "length" "4,4,16")
+ [(set_attr "length" "4,4,4,16,16")
(set_attr "predicable" "yes")]
)
@@ -1149,6 +1143,19 @@
[(set_attr "conds" "set")]
)
+(define_insn "*subsi3_compare"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "arm_rhs_operand" "r,I")
+ (match_operand:SI 2 "arm_rhs_operand" "rI,r")))
+ (set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (minus:SI (match_dup 1) (match_dup 2)))]
+ "TARGET_32BIT"
+ "@
+ sub%.\\t%0, %1, %2
+ rsb%.\\t%0, %2, %1"
+ [(set_attr "conds" "set")]
+)
+
(define_expand "decscc"
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
(minus:SI (match_operand:SI 1 "s_register_operand" "0,?r")
@@ -1794,6 +1801,7 @@
[(match_operand:DI 1 "s_register_operand" "")
(match_operand:DI 2 "s_register_operand" "")]))]
"TARGET_32BIT && reload_completed
+ && ! (TARGET_NEON && IS_VFP_REGNUM (REGNO (operands[0])))
&& ! IS_IWMMXT_REGNUM (REGNO (operands[0]))"
[(set (match_dup 0) (match_op_dup:SI 6 [(match_dup 1) (match_dup 2)]))
(set (match_dup 3) (match_op_dup:SI 6 [(match_dup 4) (match_dup 5)]))]
@@ -1867,11 +1875,19 @@
}"
)
-(define_insn "anddi3"
+(define_expand "anddi3"
+ [(set (match_operand:DI 0 "s_register_operand" "")
+ (and:DI (match_operand:DI 1 "s_register_operand" "")
+ (match_operand:DI 2 "neon_inv_logic_op2" "")))]
+ "TARGET_32BIT"
+ ""
+)
+
+(define_insn "*anddi3_insn"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(and:DI (match_operand:DI 1 "s_register_operand" "%0,r")
(match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_32BIT && ! TARGET_IWMMXT"
+ "TARGET_32BIT && !TARGET_IWMMXT && !TARGET_NEON"
"#"
[(set_attr "length" "8")]
)
@@ -2471,7 +2487,9 @@
(match_operand:DI 2 "s_register_operand" "r,0")))]
"TARGET_32BIT"
"#"
- "TARGET_32BIT && reload_completed && ! IS_IWMMXT_REGNUM (REGNO (operands[0]))"
+ "TARGET_32BIT && reload_completed
+ && ! (TARGET_NEON && IS_VFP_REGNUM (REGNO (operands[0])))
+ && ! IS_IWMMXT_REGNUM (REGNO (operands[0]))"
[(set (match_dup 0) (and:SI (not:SI (match_dup 1)) (match_dup 2)))
(set (match_dup 3) (and:SI (not:SI (match_dup 4)) (match_dup 5)))]
"
@@ -2595,11 +2613,19 @@
[(set_attr "conds" "set")]
)
-(define_insn "iordi3"
+(define_expand "iordi3"
+ [(set (match_operand:DI 0 "s_register_operand" "")
+ (ior:DI (match_operand:DI 1 "s_register_operand" "")
+ (match_operand:DI 2 "neon_logic_op2" "")))]
+ "TARGET_32BIT"
+ ""
+)
+
+(define_insn "*iordi3_insn"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(ior:DI (match_operand:DI 1 "s_register_operand" "%0,r")
(match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_32BIT && ! TARGET_IWMMXT"
+ "TARGET_32BIT && !TARGET_IWMMXT && !TARGET_NEON"
"#"
[(set_attr "length" "8")
(set_attr "predicable" "yes")]
@@ -2725,11 +2751,19 @@
[(set_attr "conds" "set")]
)
-(define_insn "xordi3"
+(define_expand "xordi3"
+ [(set (match_operand:DI 0 "s_register_operand" "")
+ (xor:DI (match_operand:DI 1 "s_register_operand" "")
+ (match_operand:DI 2 "s_register_operand" "")))]
+ "TARGET_32BIT"
+ ""
+)
+
+(define_insn "*xordi3_insn"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(xor:DI (match_operand:DI 1 "s_register_operand" "%0,r")
(match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_32BIT && !TARGET_IWMMXT"
+ "TARGET_32BIT && !TARGET_IWMMXT && !TARGET_NEON"
"#"
[(set_attr "length" "8")
(set_attr "predicable" "yes")]
@@ -3974,93 +4008,46 @@
)
(define_expand "zero_extendhisi2"
- [(set (match_dup 2)
- (ashift:SI (match_operand:HI 1 "nonimmediate_operand" "")
- (const_int 16)))
- (set (match_operand:SI 0 "s_register_operand" "")
- (lshiftrt:SI (match_dup 2) (const_int 16)))]
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
"TARGET_EITHER"
- "
- {
- if ((TARGET_THUMB1 || arm_arch4) && GET_CODE (operands[1]) == MEM)
- {
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_ZERO_EXTEND (SImode, operands[1])));
- DONE;
- }
-
- if (TARGET_ARM && GET_CODE (operands[1]) == MEM)
- {
- emit_insn (gen_movhi_bytes (operands[0], operands[1]));
- DONE;
- }
-
- if (!s_register_operand (operands[1], HImode))
- operands[1] = copy_to_mode_reg (HImode, operands[1]);
-
- if (arm_arch6)
- {
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_ZERO_EXTEND (SImode, operands[1])));
- DONE;
- }
-
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
- }"
-)
-
-(define_insn "*thumb1_zero_extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "=l")
- (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
- "TARGET_THUMB1 && !arm_arch6"
- "*
- rtx mem = XEXP (operands[1], 0);
-
- if (GET_CODE (mem) == CONST)
- mem = XEXP (mem, 0);
-
- if (GET_CODE (mem) == LABEL_REF)
- return \"ldr\\t%0, %1\";
-
- if (GET_CODE (mem) == PLUS)
+{
+ if (TARGET_ARM && !arm_arch4 && MEM_P (operands[1]))
{
- rtx a = XEXP (mem, 0);
- rtx b = XEXP (mem, 1);
-
- /* This can happen due to bugs in reload. */
- if (GET_CODE (a) == REG && REGNO (a) == SP_REGNUM)
- {
- rtx ops[2];
- ops[0] = operands[0];
- ops[1] = a;
-
- output_asm_insn (\"mov %0, %1\", ops);
-
- XEXP (mem, 0) = operands[0];
- }
-
- else if ( GET_CODE (a) == LABEL_REF
- && GET_CODE (b) == CONST_INT)
- return \"ldr\\t%0, %1\";
+ emit_insn (gen_movhi_bytes (operands[0], operands[1]));
+ DONE;
}
-
- return \"ldrh\\t%0, %1\";
- "
- [(set_attr "length" "4")
- (set_attr "type" "load_byte")
- (set_attr "pool_range" "60")]
-)
+ if (!arm_arch6 && !MEM_P (operands[1]))
+ {
+ rtx t = gen_lowpart (SImode, operands[1]);
+ rtx tmp = gen_reg_rtx (SImode);
+ emit_insn (gen_ashlsi3 (tmp, t, GEN_INT (16)));
+ emit_insn (gen_lshrsi3 (operands[0], tmp, GEN_INT (16)));
+ DONE;
+ }
+})
-(define_insn "*thumb1_zero_extendhisi2_v6"
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (zero_extend:SI (match_operand:HI 1 "register_operand" "l,m")))]
+ "!TARGET_THUMB2 && !arm_arch6"
+ [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 16)))
+ (set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 16)))]
+{
+ operands[2] = gen_lowpart (SImode, operands[1]);
+})
+
+(define_insn "*thumb1_zero_extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=l,l")
(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))]
- "TARGET_THUMB1 && arm_arch6"
+ "TARGET_THUMB1"
"*
rtx mem;
- if (which_alternative == 0)
+ if (which_alternative == 0 && arm_arch6)
return \"uxth\\t%0, %1\";
+ if (which_alternative == 0)
+ return \"#\";
mem = XEXP (operands[1], 0);
@@ -4094,20 +4081,25 @@
return \"ldrh\\t%0, %1\";
"
- [(set_attr "length" "2,4")
+ [(set_attr_alternative "length"
+ [(if_then_else (eq_attr "is_arch6" "yes")
+ (const_int 2) (const_int 4))
+ (const_int 4)])
(set_attr "type" "alu_shift,load_byte")
(set_attr "pool_range" "*,60")]
)
(define_insn "*arm_zero_extendhisi2"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
"TARGET_ARM && arm_arch4 && !arm_arch6"
- "ldr%(h%)\\t%0, %1"
- [(set_attr "type" "load_byte")
+ "@
+ #
+ ldr%(h%)\\t%0, %1"
+ [(set_attr "type" "alu_shift,load_byte")
(set_attr "predicable" "yes")
- (set_attr "pool_range" "256")
- (set_attr "neg_pool_range" "244")]
+ (set_attr "pool_range" "*,256")
+ (set_attr "neg_pool_range" "*,244")]
)
(define_insn "*arm_zero_extendhisi2_v6"
@@ -4137,50 +4129,49 @@
[(set (match_operand:SI 0 "s_register_operand" "")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
"TARGET_EITHER"
- "
- if (!arm_arch6 && GET_CODE (operands[1]) != MEM)
+{
+ if (TARGET_ARM && !arm_arch6 && GET_CODE (operands[1]) != MEM)
{
- if (TARGET_ARM)
- {
- emit_insn (gen_andsi3 (operands[0],
- gen_lowpart (SImode, operands[1]),
- GEN_INT (255)));
- }
- else /* TARGET_THUMB */
- {
- rtx temp = gen_reg_rtx (SImode);
- rtx ops[3];
-
- operands[1] = copy_to_mode_reg (QImode, operands[1]);
- operands[1] = gen_lowpart (SImode, operands[1]);
-
- ops[0] = temp;
- ops[1] = operands[1];
- ops[2] = GEN_INT (24);
-
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_ASHIFT (SImode, ops[1], ops[2])));
-
- ops[0] = operands[0];
- ops[1] = temp;
- ops[2] = GEN_INT (24);
+ emit_insn (gen_andsi3 (operands[0],
+ gen_lowpart (SImode, operands[1]),
+ GEN_INT (255)));
+ DONE;
+ }
+ if (!arm_arch6 && !MEM_P (operands[1]))
+ {
+ rtx t = gen_lowpart (SImode, operands[1]);
+ rtx tmp = gen_reg_rtx (SImode);
+ emit_insn (gen_ashlsi3 (tmp, t, GEN_INT (24)));
+ emit_insn (gen_lshrsi3 (operands[0], tmp, GEN_INT (24)));
+ DONE;
+ }
+})
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_LSHIFTRT (SImode, ops[1], ops[2])));
- }
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
+ "!arm_arch6"
+ [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 24)))
+ (set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 24)))]
+{
+ operands[2] = simplify_gen_subreg (SImode, operands[1], QImode, 0);
+ if (TARGET_ARM)
+ {
+ emit_insn (gen_andsi3 (operands[0], operands[2], GEN_INT (255)));
DONE;
}
- "
-)
+})
(define_insn "*thumb1_zero_extendqisi2"
- [(set (match_operand:SI 0 "register_operand" "=l")
- (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
+ [(set (match_operand:SI 0 "register_operand" "=l,l")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,m")))]
"TARGET_THUMB1 && !arm_arch6"
- "ldrb\\t%0, %1"
- [(set_attr "length" "2")
- (set_attr "type" "load_byte")
- (set_attr "pool_range" "32")]
+ "@
+ #
+ ldrb\\t%0, %1"
+ [(set_attr "length" "4,2")
+ (set_attr "type" "alu_shift,load_byte")
+ (set_attr "pool_range" "*,32")]
)
(define_insn "*thumb1_zero_extendqisi2_v6"
@@ -4196,14 +4187,17 @@
)
(define_insn "*arm_zero_extendqisi2"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
"TARGET_ARM && !arm_arch6"
- "ldr%(b%)\\t%0, %1\\t%@ zero_extendqisi2"
- [(set_attr "type" "load_byte")
+ "@
+ #
+ ldr%(b%)\\t%0, %1\\t%@ zero_extendqisi2"
+ [(set_attr "length" "8,4")
+ (set_attr "type" "alu_shift,load_byte")
(set_attr "predicable" "yes")
- (set_attr "pool_range" "4096")
- (set_attr "neg_pool_range" "4084")]
+ (set_attr "pool_range" "*,4096")
+ (set_attr "neg_pool_range" "*,4084")]
)
(define_insn "*arm_zero_extendqisi2_v6"
@@ -4282,108 +4276,42 @@
)
(define_expand "extendhisi2"
- [(set (match_dup 2)
- (ashift:SI (match_operand:HI 1 "nonimmediate_operand" "")
- (const_int 16)))
- (set (match_operand:SI 0 "s_register_operand" "")
- (ashiftrt:SI (match_dup 2)
- (const_int 16)))]
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
"TARGET_EITHER"
- "
- {
- if (GET_CODE (operands[1]) == MEM)
- {
- if (TARGET_THUMB1)
- {
- emit_insn (gen_thumb1_extendhisi2 (operands[0], operands[1]));
- DONE;
- }
- else if (arm_arch4)
- {
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_SIGN_EXTEND (SImode, operands[1])));
- DONE;
- }
- }
-
- if (TARGET_ARM && GET_CODE (operands[1]) == MEM)
- {
- emit_insn (gen_extendhisi2_mem (operands[0], operands[1]));
- DONE;
- }
-
- if (!s_register_operand (operands[1], HImode))
- operands[1] = copy_to_mode_reg (HImode, operands[1]);
-
- if (arm_arch6)
- {
- if (TARGET_THUMB1)
- emit_insn (gen_thumb1_extendhisi2 (operands[0], operands[1]));
- else
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_SIGN_EXTEND (SImode, operands[1])));
-
- DONE;
- }
-
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
- }"
-)
-
-(define_insn "thumb1_extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "=l")
- (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))
- (clobber (match_scratch:SI 2 "=&l"))]
- "TARGET_THUMB1 && !arm_arch6"
- "*
- {
- rtx ops[4];
- rtx mem = XEXP (operands[1], 0);
-
- /* This code used to try to use 'V', and fix the address only if it was
- offsettable, but this fails for e.g. REG+48 because 48 is outside the
- range of QImode offsets, and offsettable_address_p does a QImode
- address check. */
-
- if (GET_CODE (mem) == CONST)
- mem = XEXP (mem, 0);
-
- if (GET_CODE (mem) == LABEL_REF)
- return \"ldr\\t%0, %1\";
-
- if (GET_CODE (mem) == PLUS)
- {
- rtx a = XEXP (mem, 0);
- rtx b = XEXP (mem, 1);
-
- if (GET_CODE (a) == LABEL_REF
- && GET_CODE (b) == CONST_INT)
- return \"ldr\\t%0, %1\";
-
- if (GET_CODE (b) == REG)
- return \"ldrsh\\t%0, %1\";
-
- ops[1] = a;
- ops[2] = b;
- }
- else
- {
- ops[1] = mem;
- ops[2] = const0_rtx;
- }
+{
+ if (TARGET_THUMB1)
+ {
+ emit_insn (gen_thumb1_extendhisi2 (operands[0], operands[1]));
+ DONE;
+ }
+ if (MEM_P (operands[1]) && TARGET_ARM && !arm_arch4)
+ {
+ emit_insn (gen_extendhisi2_mem (operands[0], operands[1]));
+ DONE;
+ }
- gcc_assert (GET_CODE (ops[1]) == REG);
+ if (!arm_arch6 && !MEM_P (operands[1]))
+ {
+ rtx t = gen_lowpart (SImode, operands[1]);
+ rtx tmp = gen_reg_rtx (SImode);
+ emit_insn (gen_ashlsi3 (tmp, t, GEN_INT (16)));
+ emit_insn (gen_ashrsi3 (operands[0], tmp, GEN_INT (16)));
+ DONE;
+ }
+})
- ops[0] = operands[0];
- ops[3] = operands[2];
- output_asm_insn (\"mov\\t%3, %2\;ldrsh\\t%0, [%1, %3]\", ops);
- return \"\";
- }"
- [(set_attr "length" "4")
- (set_attr "type" "load_byte")
- (set_attr "pool_range" "1020")]
-)
+(define_split
+ [(parallel
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extend:SI (match_operand:HI 1 "register_operand" "")))
+ (clobber (match_scratch:SI 2 ""))])]
+ "!arm_arch6"
+ [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 16)))
+ (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 16)))]
+{
+ operands[2] = simplify_gen_subreg (SImode, operands[1], HImode, 0);
+})
;; We used to have an early-clobber on the scratch register here.
;; However, there's a bug somewhere in reload which means that this
@@ -4392,16 +4320,18 @@
;; we try to verify the operands. Fortunately, we don't really need
;; the early-clobber: we can always use operand 0 if operand 2
;; overlaps the address.
-(define_insn "*thumb1_extendhisi2_insn_v6"
+(define_insn "thumb1_extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=l,l")
(sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))
(clobber (match_scratch:SI 2 "=X,l"))]
- "TARGET_THUMB1 && arm_arch6"
+ "TARGET_THUMB1"
"*
{
rtx ops[4];
rtx mem;
+ if (which_alternative == 0 && !arm_arch6)
+ return \"#\";
if (which_alternative == 0)
return \"sxth\\t%0, %1\";
@@ -4449,7 +4379,10 @@
output_asm_insn (\"mov\\t%3, %2\;ldrsh\\t%0, [%1, %3]\", ops);
return \"\";
}"
- [(set_attr "length" "2,4")
+ [(set_attr_alternative "length"
+ [(if_then_else (eq_attr "is_arch6" "yes")
+ (const_int 2) (const_int 4))
+ (const_int 4)])
(set_attr "type" "alu_shift,load_byte")
(set_attr "pool_range" "*,1020")]
)
@@ -4490,15 +4423,28 @@
}"
)
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
+ "!arm_arch6"
+ [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 16)))
+ (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 16)))]
+{
+ operands[2] = simplify_gen_subreg (SImode, operands[1], HImode, 0);
+})
+
(define_insn "*arm_extendhisi2"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
"TARGET_ARM && arm_arch4 && !arm_arch6"
- "ldr%(sh%)\\t%0, %1"
- [(set_attr "type" "load_byte")
+ "@
+ #
+ ldr%(sh%)\\t%0, %1"
+ [(set_attr "length" "8,4")
+ (set_attr "type" "alu_shift,load_byte")
(set_attr "predicable" "yes")
- (set_attr "pool_range" "256")
- (set_attr "neg_pool_range" "244")]
+ (set_attr "pool_range" "*,256")
+ (set_attr "neg_pool_range" "*,244")]
)
;; ??? Check Thumb-2 pool range
@@ -4560,46 +4506,45 @@
)
(define_expand "extendqisi2"
- [(set (match_dup 2)
- (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
- (const_int 24)))
- (set (match_operand:SI 0 "s_register_operand" "")
- (ashiftrt:SI (match_dup 2)
- (const_int 24)))]
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (sign_extend:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")))]
"TARGET_EITHER"
- "
- {
- if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM)
- {
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_SIGN_EXTEND (SImode, operands[1])));
- DONE;
- }
-
- if (!s_register_operand (operands[1], QImode))
- operands[1] = copy_to_mode_reg (QImode, operands[1]);
+{
+ if (!arm_arch4 && MEM_P (operands[1]))
+ operands[1] = copy_to_mode_reg (QImode, operands[1]);
- if (arm_arch6)
- {
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_SIGN_EXTEND (SImode, operands[1])));
- DONE;
- }
+ if (!arm_arch6 && !MEM_P (operands[1]))
+ {
+ rtx t = gen_lowpart (SImode, operands[1]);
+ rtx tmp = gen_reg_rtx (SImode);
+ emit_insn (gen_ashlsi3 (tmp, t, GEN_INT (24)));
+ emit_insn (gen_ashrsi3 (operands[0], tmp, GEN_INT (24)));
+ DONE;
+ }
+})
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
- }"
-)
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
+ "!arm_arch6"
+ [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 24)))
+ (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))]
+{
+ operands[2] = simplify_gen_subreg (SImode, operands[1], QImode, 0);
+})
(define_insn "*arm_extendqisi"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (sign_extend:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
"TARGET_ARM && arm_arch4 && !arm_arch6"
- "ldr%(sb%)\\t%0, %1"
- [(set_attr "type" "load_byte")
+ "@
+ #
+ ldr%(sb%)\\t%0, %1"
+ [(set_attr "length" "8,4")
+ (set_attr "type" "alu_shift,load_byte")
(set_attr "predicable" "yes")
- (set_attr "pool_range" "256")
- (set_attr "neg_pool_range" "244")]
+ (set_attr "pool_range" "*,256")
+ (set_attr "neg_pool_range" "*,244")]
)
(define_insn "*arm_extendqisi_v6"
@@ -4627,162 +4572,103 @@
(set_attr "predicable" "yes")]
)
-(define_insn "*thumb1_extendqisi2"
- [(set (match_operand:SI 0 "register_operand" "=l,l")
- (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))]
- "TARGET_THUMB1 && !arm_arch6"
- "*
- {
- rtx ops[3];
- rtx mem = XEXP (operands[1], 0);
-
- if (GET_CODE (mem) == CONST)
- mem = XEXP (mem, 0);
-
- if (GET_CODE (mem) == LABEL_REF)
- return \"ldr\\t%0, %1\";
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extend:SI (match_operand:QI 1 "memory_operand" "")))]
+ "TARGET_THUMB1 && reload_completed"
+ [(set (match_dup 0) (match_dup 2))
+ (set (match_dup 0) (sign_extend:SI (match_dup 3)))]
+{
+ rtx addr = XEXP (operands[1], 0);
- if (GET_CODE (mem) == PLUS
- && GET_CODE (XEXP (mem, 0)) == LABEL_REF)
- return \"ldr\\t%0, %1\";
-
- if (which_alternative == 0)
- return \"ldrsb\\t%0, %1\";
-
- ops[0] = operands[0];
-
- if (GET_CODE (mem) == PLUS)
- {
- rtx a = XEXP (mem, 0);
- rtx b = XEXP (mem, 1);
-
- ops[1] = a;
- ops[2] = b;
+ if (GET_CODE (addr) == CONST)
+ addr = XEXP (addr, 0);
- if (GET_CODE (a) == REG)
- {
- if (GET_CODE (b) == REG)
- output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops);
- else if (REGNO (a) == REGNO (ops[0]))
- {
- output_asm_insn (\"ldrb\\t%0, [%1, %2]\", ops);
- output_asm_insn (\"lsl\\t%0, %0, #24\", ops);
- output_asm_insn (\"asr\\t%0, %0, #24\", ops);
- }
- else
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
- }
- else
- {
- gcc_assert (GET_CODE (b) == REG);
- if (REGNO (b) == REGNO (ops[0]))
- {
- output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops);
- output_asm_insn (\"lsl\\t%0, %0, #24\", ops);
- output_asm_insn (\"asr\\t%0, %0, #24\", ops);
- }
- else
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
- }
- }
- else if (GET_CODE (mem) == REG && REGNO (ops[0]) == REGNO (mem))
- {
- output_asm_insn (\"ldrb\\t%0, [%0, #0]\", ops);
- output_asm_insn (\"lsl\\t%0, %0, #24\", ops);
- output_asm_insn (\"asr\\t%0, %0, #24\", ops);
- }
- else
- {
- ops[1] = mem;
- ops[2] = const0_rtx;
-
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
- }
- return \"\";
- }"
- [(set_attr "length" "2,6")
- (set_attr "type" "load_byte,load_byte")
- (set_attr "pool_range" "32,32")]
-)
+ if (GET_CODE (addr) == PLUS
+ && REG_P (XEXP (addr, 0)) && REG_P (XEXP (addr, 1)))
+ /* No split necessary. */
+ FAIL;
+
+ if (GET_CODE (addr) == PLUS
+ && !REG_P (XEXP (addr, 0)) && !REG_P (XEXP (addr, 1)))
+ FAIL;
+
+ if (reg_overlap_mentioned_p (operands[0], addr))
+ {
+ rtx t = gen_lowpart (QImode, operands[0]);
+ emit_move_insn (t, operands[1]);
+ emit_insn (gen_thumb1_extendqisi2 (operands[0], t));
+ DONE;
+ }
+
+ if (REG_P (addr))
+ {
+ addr = gen_rtx_PLUS (Pmode, addr, operands[0]);
+ operands[2] = const0_rtx;
+ }
+ else if (GET_CODE (addr) != PLUS)
+ FAIL;
+ else if (REG_P (XEXP (addr, 0)))
+ {
+ operands[2] = XEXP (addr, 1);
+ addr = gen_rtx_PLUS (Pmode, XEXP (addr, 0), operands[0]);
+ }
+ else
+ {
+ operands[2] = XEXP (addr, 0);
+ addr = gen_rtx_PLUS (Pmode, XEXP (addr, 1), operands[0]);
+ }
-(define_insn "*thumb1_extendqisi2_v6"
+ operands[3] = change_address (operands[1], QImode, addr);
+})
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_dup 0) (match_operand 1 "const_int_operand")))
+ (set (match_operand:SI 2 "register_operand" "") (const_int 0))
+ (set (match_operand:SI 3 "register_operand" "")
+ (sign_extend:SI (match_operand:QI 4 "memory_operand" "")))]
+ "TARGET_THUMB1
+ && GET_CODE (XEXP (operands[4], 0)) == PLUS
+ && rtx_equal_p (operands[0], XEXP (XEXP (operands[4], 0), 0))
+ && rtx_equal_p (operands[2], XEXP (XEXP (operands[4], 0), 1))
+ && (peep2_reg_dead_p (3, operands[0])
+ || rtx_equal_p (operands[0], operands[3]))
+ && (peep2_reg_dead_p (3, operands[2])
+ || rtx_equal_p (operands[2], operands[3]))"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 3) (sign_extend:SI (match_dup 4)))]
+{
+ rtx addr = gen_rtx_PLUS (Pmode, operands[0], operands[2]);
+ operands[4] = change_address (operands[4], QImode, addr);
+})
+
+(define_insn "thumb1_extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=l,l,l")
(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,V,m")))]
- "TARGET_THUMB1 && arm_arch6"
- "*
- {
- rtx ops[3];
- rtx mem;
-
- if (which_alternative == 0)
- return \"sxtb\\t%0, %1\";
+ "TARGET_THUMB1"
+{
+ rtx addr;
- mem = XEXP (operands[1], 0);
-
- if (GET_CODE (mem) == CONST)
- mem = XEXP (mem, 0);
-
- if (GET_CODE (mem) == LABEL_REF)
- return \"ldr\\t%0, %1\";
+ if (which_alternative == 0 && arm_arch6)
+ return "sxtb\\t%0, %1";
+ if (which_alternative == 0)
+ return "#";
- if (GET_CODE (mem) == PLUS
- && GET_CODE (XEXP (mem, 0)) == LABEL_REF)
- return \"ldr\\t%0, %1\";
-
- if (which_alternative == 0)
- return \"ldrsb\\t%0, %1\";
+ addr = XEXP (operands[1], 0);
+ if (GET_CODE (addr) == PLUS
+ && REG_P (XEXP (addr, 0)) && REG_P (XEXP (addr, 1)))
+ return "ldrsb\\t%0, %1";
- ops[0] = operands[0];
-
- if (GET_CODE (mem) == PLUS)
- {
- rtx a = XEXP (mem, 0);
- rtx b = XEXP (mem, 1);
-
- ops[1] = a;
- ops[2] = b;
-
- if (GET_CODE (a) == REG)
- {
- if (GET_CODE (b) == REG)
- output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops);
- else if (REGNO (a) == REGNO (ops[0]))
- {
- output_asm_insn (\"ldrb\\t%0, [%1, %2]\", ops);
- output_asm_insn (\"sxtb\\t%0, %0\", ops);
- }
- else
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
- }
- else
- {
- gcc_assert (GET_CODE (b) == REG);
- if (REGNO (b) == REGNO (ops[0]))
- {
- output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops);
- output_asm_insn (\"sxtb\\t%0, %0\", ops);
- }
- else
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
- }
- }
- else if (GET_CODE (mem) == REG && REGNO (ops[0]) == REGNO (mem))
- {
- output_asm_insn (\"ldrb\\t%0, [%0, #0]\", ops);
- output_asm_insn (\"sxtb\\t%0, %0\", ops);
- }
- else
- {
- ops[1] = mem;
- ops[2] = const0_rtx;
-
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
- }
- return \"\";
- }"
- [(set_attr "length" "2,2,4")
- (set_attr "type" "alu_shift,load_byte,load_byte")
- (set_attr "pool_range" "*,32,32")]
+ return "#";
+}
+ [(set_attr_alternative "length"
+ [(if_then_else (eq_attr "is_arch6" "yes")
+ (const_int 2) (const_int 4))
+ (const_int 2)
+ (if_then_else (eq_attr "is_arch6" "yes")
+ (const_int 4) (const_int 6))])
+ (set_attr "type" "alu_shift,load_byte,load_byte")]
)
(define_expand "extendsfdf2"
@@ -6683,7 +6569,7 @@
(pc)))]
"TARGET_THUMB1"
{
- rtx xops[3];
+ rtx xops[4];
xops[1] = gen_reg_rtx (SImode);
emit_insn (gen_zero_extendqisi2 (xops[1], operands[1]));
xops[2] = GEN_INT (127);
@@ -6718,17 +6604,45 @@
operands[3])); DONE;"
)
-;; this uses the Cirrus DI compare instruction
(define_expand "cbranchdi4"
[(set (pc) (if_then_else
(match_operator 0 "arm_comparison_operator"
- [(match_operand:DI 1 "cirrus_fp_register" "")
- (match_operand:DI 2 "cirrus_fp_register" "")])
+ [(match_operand:DI 1 "cmpdi_operand" "")
+ (match_operand:DI 2 "cmpdi_operand" "")])
(label_ref (match_operand 3 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
- "emit_jump_insn (gen_cbranch_cc (operands[0], operands[1], operands[2],
- operands[3])); DONE;"
+ "TARGET_32BIT"
+ "{
+ rtx swap = NULL_RTX;
+ enum rtx_code code = GET_CODE (operands[0]);
+
+ /* We should not have two constants. */
+ gcc_assert (GET_MODE (operands[1]) == DImode
+ || GET_MODE (operands[2]) == DImode);
+
+ /* Flip unimplemented DImode comparisons to a form that
+ arm_gen_compare_reg can handle. */
+ switch (code)
+ {
+ case GT:
+ swap = gen_rtx_LT (VOIDmode, operands[2], operands[1]); break;
+ case LE:
+ swap = gen_rtx_GE (VOIDmode, operands[2], operands[1]); break;
+ case GTU:
+ swap = gen_rtx_LTU (VOIDmode, operands[2], operands[1]); break;
+ case LEU:
+ swap = gen_rtx_GEU (VOIDmode, operands[2], operands[1]); break;
+ default:
+ break;
+ }
+ if (swap)
+ emit_jump_insn (gen_cbranch_cc (swap, operands[2], operands[1],
+ operands[3]));
+ else
+ emit_jump_insn (gen_cbranch_cc (operands[0], operands[1], operands[2],
+ operands[3]));
+ DONE;
+ }"
)
(define_insn "cbranchsi4_insn"
@@ -7569,8 +7483,8 @@
(if_then_else
(match_operator 4 "arm_comparison_operator"
[(plus:SI
- (match_operand:SI 2 "s_register_operand" "%l,0,*l,1,1,1")
- (match_operand:SI 3 "reg_or_int_operand" "lL,IJ,*l,lIJ,lIJ,lIJ"))
+ (match_operand:SI 2 "s_register_operand" "%0,l,*l,1,1,1")
+ (match_operand:SI 3 "reg_or_int_operand" "IJ,lL,*l,lIJ,lIJ,lIJ"))
(const_int 0)])
(label_ref (match_operand 5 "" ""))
(pc)))
@@ -7602,7 +7516,7 @@
else if (which_alternative >= 4)
output_asm_insn (\"str\\t%1, %0\", operands);
- switch (get_attr_length (insn) - ((which_alternative >= 3) ? 2 : 0))
+ switch (get_attr_length (insn) - ((which_alternative >= 2) ? 2 : 0))
{
case 4:
return \"b%d4\\t%l5\";
@@ -7616,7 +7530,7 @@
[(set (attr "far_jump")
(if_then_else
(ior (and (lt (symbol_ref ("which_alternative"))
- (const_int 3))
+ (const_int 2))
(eq_attr "length" "8"))
(eq_attr "length" "10"))
(const_string "yes")
@@ -7624,7 +7538,7 @@
(set (attr "length")
(if_then_else
(lt (symbol_ref ("which_alternative"))
- (const_int 3))
+ (const_int 2))
(if_then_else
(and (ge (minus (match_dup 5) (pc)) (const_int -250))
(le (minus (match_dup 5) (pc)) (const_int 256)))
@@ -7892,6 +7806,52 @@
(const_string "alu_shift_reg")))]
)
+;; DImode comparisons. The generic code generates branches that
+;; if-conversion can not reduce to a conditional compare, so we do
+;; that directly.
+
+(define_insn "*arm_cmpdi_insn"
+ [(set (reg:CC_NCV CC_REGNUM)
+ (compare:CC_NCV (match_operand:DI 0 "s_register_operand" "r")
+ (match_operand:DI 1 "arm_di_operand" "rDi")))
+ (clobber (match_scratch:SI 2 "=r"))]
+ "TARGET_32BIT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
+ "cmp\\t%Q0, %Q1\;sbcs\\t%2, %R0, %R1"
+ [(set_attr "conds" "set")
+ (set_attr "length" "8")]
+)
+
+(define_insn "*arm_cmpdi_unsigned"
+ [(set (reg:CC_CZ CC_REGNUM)
+ (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
+ (match_operand:DI 1 "arm_di_operand" "rDi")))]
+ "TARGET_ARM"
+ "cmp%?\\t%R0, %R1\;cmpeq\\t%Q0, %Q1"
+ [(set_attr "conds" "set")
+ (set_attr "length" "8")]
+)
+
+(define_insn "*arm_cmpdi_zero"
+ [(set (reg:CC_Z CC_REGNUM)
+ (compare:CC_Z (match_operand:DI 0 "s_register_operand" "r")
+ (const_int 0)))
+ (clobber (match_scratch:SI 1 "=r"))]
+ "TARGET_32BIT"
+ "orr%.\\t%1, %Q0, %R0"
+ [(set_attr "conds" "set")]
+)
+
+(define_insn "*thumb_cmpdi_zero"
+ [(set (reg:CC_Z CC_REGNUM)
+ (compare:CC_Z (match_operand:DI 0 "s_register_operand" "l")
+ (const_int 0)))
+ (clobber (match_scratch:SI 1 "=l"))]
+ "TARGET_THUMB1"
+ "orr\\t%1, %Q0, %R0"
+ [(set_attr "conds" "set")
+ (set_attr "length" "2")]
+)
+
;; Cirrus SF compare instruction
(define_insn "*cirrus_cmpsf"
[(set (reg:CCFP CC_REGNUM)
@@ -8195,18 +8155,45 @@
operands[2], operands[3])); DONE;"
)
-;; this uses the Cirrus DI compare instruction
(define_expand "cstoredi4"
[(set (match_operand:SI 0 "s_register_operand" "")
(match_operator:SI 1 "arm_comparison_operator"
- [(match_operand:DI 2 "cirrus_fp_register" "")
- (match_operand:DI 3 "cirrus_fp_register" "")]))]
- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
- "emit_insn (gen_cstore_cc (operands[0], operands[1],
- operands[2], operands[3])); DONE;"
+ [(match_operand:DI 2 "cmpdi_operand" "")
+ (match_operand:DI 3 "cmpdi_operand" "")]))]
+ "TARGET_32BIT"
+ "{
+ rtx swap = NULL_RTX;
+ enum rtx_code code = GET_CODE (operands[1]);
+
+ /* We should not have two constants. */
+ gcc_assert (GET_MODE (operands[2]) == DImode
+ || GET_MODE (operands[3]) == DImode);
+
+ /* Flip unimplemented DImode comparisons to a form that
+ arm_gen_compare_reg can handle. */
+ switch (code)
+ {
+ case GT:
+ swap = gen_rtx_LT (VOIDmode, operands[3], operands[2]); break;
+ case LE:
+ swap = gen_rtx_GE (VOIDmode, operands[3], operands[2]); break;
+ case GTU:
+ swap = gen_rtx_LTU (VOIDmode, operands[3], operands[2]); break;
+ case LEU:
+ swap = gen_rtx_GEU (VOIDmode, operands[3], operands[2]); break;
+ default:
+ break;
+ }
+ if (swap)
+ emit_insn (gen_cstore_cc (operands[0], swap, operands[3],
+ operands[2]));
+ else
+ emit_insn (gen_cstore_cc (operands[0], operands[1], operands[2],
+ operands[3]));
+ DONE;
+ }"
)
-
(define_expand "cstoresi_eq0_thumb1"
[(parallel
[(set (match_operand:SI 0 "s_register_operand" "")
@@ -9159,7 +9146,7 @@
[(match_operator:SI 3 "shift_operator"
[(match_operand:SI 4 "s_register_operand" "r")
(match_operand:SI 5 "reg_or_int_operand" "rI")])
- (match_operand:SI 2 "s_register_operand" "r")]))]
+ (match_operand:SI 2 "s_register_operand" "rk")]))]
"TARGET_ARM"
"%i1%?\\t%0, %2, %4%S3"
[(set_attr "predicable" "yes")
@@ -9304,41 +9291,117 @@
(set_attr "length" "4,8")]
)
-(define_insn "*compare_scc"
+; A series of splitters for the compare_scc pattern below. Note that
+; order is important.
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (lt:SI (match_operand:SI 1 "s_register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT && reload_completed"
+ [(set (match_dup 0) (lshiftrt:SI (match_dup 1) (const_int 31)))])
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ge:SI (match_operand:SI 1 "s_register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT && reload_completed"
+ [(set (match_dup 0) (not:SI (match_dup 1)))
+ (set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 31)))])
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (eq:SI (match_operand:SI 1 "s_register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT && reload_completed"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (const_int 1) (match_dup 1)))
+ (set (match_dup 0)
+ (minus:SI (const_int 1) (match_dup 1)))])
+ (cond_exec (ltu:CC (reg:CC CC_REGNUM) (const_int 0))
+ (set (match_dup 0) (const_int 0)))])
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ne:SI (match_operand:SI 1 "s_register_operand" "")
+ (match_operand:SI 2 "const_int_operand" "")))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT && reload_completed"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))])
+ (cond_exec (ne:CC (reg:CC CC_REGNUM) (const_int 0))
+ (set (match_dup 0) (const_int 1)))]
+{
+ operands[3] = GEN_INT (-INTVAL (operands[2]));
+})
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ne:SI (match_operand:SI 1 "s_register_operand" "")
+ (match_operand:SI 2 "arm_add_operand" "")))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT && reload_completed"
+ [(parallel
+ [(set (reg:CC_NOOV CC_REGNUM)
+ (compare:CC_NOOV (minus:SI (match_dup 1) (match_dup 2))
+ (const_int 0)))
+ (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
+ (cond_exec (ne:CC_NOOV (reg:CC_NOOV CC_REGNUM) (const_int 0))
+ (set (match_dup 0) (const_int 1)))])
+
+(define_insn_and_split "*compare_scc"
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
(match_operator:SI 1 "arm_comparison_operator"
[(match_operand:SI 2 "s_register_operand" "r,r")
(match_operand:SI 3 "arm_add_operand" "rI,L")]))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM"
- "*
- if (operands[3] == const0_rtx)
- {
- if (GET_CODE (operands[1]) == LT)
- return \"mov\\t%0, %2, lsr #31\";
+ "TARGET_32BIT"
+ "#"
+ "&& reload_completed"
+ [(set (reg:CC CC_REGNUM) (compare:CC (match_dup 2) (match_dup 3)))
+ (cond_exec (match_dup 4) (set (match_dup 0) (const_int 0)))
+ (cond_exec (match_dup 5) (set (match_dup 0) (const_int 1)))]
+{
+ rtx tmp1;
+ enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[1]),
+ operands[2], operands[3]);
+ enum rtx_code rc = GET_CODE (operands[1]);
- if (GET_CODE (operands[1]) == GE)
- return \"mvn\\t%0, %2\;mov\\t%0, %0, lsr #31\";
+ tmp1 = gen_rtx_REG (mode, CC_REGNUM);
- if (GET_CODE (operands[1]) == EQ)
- return \"rsbs\\t%0, %2, #1\;movcc\\t%0, #0\";
- }
+ operands[5] = gen_rtx_fmt_ee (rc, VOIDmode, tmp1, const0_rtx);
+ if (mode == CCFPmode || mode == CCFPEmode)
+ rc = reverse_condition_maybe_unordered (rc);
+ else
+ rc = reverse_condition (rc);
+ operands[4] = gen_rtx_fmt_ee (rc, VOIDmode, tmp1, const0_rtx);
+})
- if (GET_CODE (operands[1]) == NE)
- {
- if (which_alternative == 1)
- return \"adds\\t%0, %2, #%n3\;movne\\t%0, #1\";
- return \"subs\\t%0, %2, %3\;movne\\t%0, #1\";
- }
- if (which_alternative == 1)
- output_asm_insn (\"cmn\\t%2, #%n3\", operands);
- else
- output_asm_insn (\"cmp\\t%2, %3\", operands);
- return \"mov%D1\\t%0, #0\;mov%d1\\t%0, #1\";
- "
- [(set_attr "conds" "clob")
- (set_attr "length" "12")]
-)
+;; Attempt to improve the sequence generated by the compare_scc splitters
+;; not to use conditional execution.
+(define_peephole2
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "arm_rhs_operand" "")))
+ (cond_exec (ne (reg:CC CC_REGNUM) (const_int 0))
+ (set (match_operand:SI 0 "register_operand" "") (const_int 0)))
+ (cond_exec (eq (reg:CC CC_REGNUM) (const_int 0))
+ (set (match_dup 0) (const_int 1)))
+ (match_scratch:SI 3 "r")]
+ "TARGET_32BIT"
+ [(set (match_dup 3) (minus:SI (match_dup 1) (match_dup 2)))
+ (parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (const_int 0) (match_dup 3)))
+ (set (match_dup 0) (minus:SI (const_int 0) (match_dup 3)))])
+ (set (match_dup 0)
+ (plus:SI (plus:SI (match_dup 0) (match_dup 3))
+ (geu:SI (reg:CC CC_REGNUM) (const_int 0))))])
(define_insn "*cond_move"
[(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
@@ -10871,7 +10934,7 @@
(define_insn "*push_multi"
[(match_parallel 2 "multi_register_push"
[(set (match_operand:BLK 0 "memory_operand" "=m")
- (unspec:BLK [(match_operand:SI 1 "s_register_operand" "r")]
+ (unspec:BLK [(match_operand:SI 1 "s_register_operand" "")]
UNSPEC_PUSH_MULT))])]
"TARGET_32BIT"
"*
@@ -10924,7 +10987,7 @@
(define_insn "*push_fp_multi"
[(match_parallel 2 "multi_register_push"
[(set (match_operand:BLK 0 "memory_operand" "=m")
- (unspec:BLK [(match_operand:XF 1 "f_register_operand" "f")]
+ (unspec:BLK [(match_operand:XF 1 "f_register_operand" "")]
UNSPEC_PUSH_MULT))])]
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FPA"
"*
@@ -11242,15 +11305,21 @@
(set_attr "length" "4")]
)
-(define_insn "arm_rev"
+(define_insn "*arm_rev"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(bswap:SI (match_operand:SI 1 "s_register_operand" "r")))]
- "TARGET_EITHER && arm_arch6"
- "rev\t%0, %1"
- [(set (attr "length")
- (if_then_else (eq_attr "is_thumb" "yes")
- (const_int 2)
- (const_int 4)))]
+ "TARGET_32BIT && arm_arch6"
+ "rev%?\t%0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "length" "4")]
+)
+
+(define_insn "*thumb1_rev"
+ [(set (match_operand:SI 0 "s_register_operand" "=l")
+ (bswap:SI (match_operand:SI 1 "s_register_operand" "l")))]
+ "TARGET_THUMB1 && arm_arch6"
+ "rev\t%0, %1"
+ [(set_attr "length" "2")]
)
(define_expand "arm_legacy_rev"
diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index ccfc7426077..9cba0a90a0f 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -414,12 +414,6 @@ vadd_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_vaddv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vadd_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_vadddi (__a, __b, 1);
-}
-
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vadd_f32 (float32x2_t __a, float32x2_t __b)
{
@@ -444,6 +438,12 @@ vadd_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_vaddv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vadd_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_vadddi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
vadd_u64 (uint64x1_t __a, uint64x1_t __b)
{
@@ -1368,12 +1368,6 @@ vsub_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_vsubv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vsub_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_vsubdi (__a, __b, 1);
-}
-
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vsub_f32 (float32x2_t __a, float32x2_t __b)
{
@@ -1398,6 +1392,12 @@ vsub_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_vsubv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vsub_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_vsubdi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
vsub_u64 (uint64x1_t __a, uint64x1_t __b)
{
@@ -5808,12 +5808,6 @@ vget_low_s32 (int32x4_t __a)
return (int32x2_t)__builtin_neon_vget_lowv4si (__a);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vget_low_s64 (int64x2_t __a)
-{
- return (int64x1_t)__builtin_neon_vget_lowv2di (__a);
-}
-
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vget_low_f32 (float32x4_t __a)
{
@@ -5838,12 +5832,6 @@ vget_low_u32 (uint32x4_t __a)
return (uint32x2_t)__builtin_neon_vget_lowv4si ((int32x4_t) __a);
}
-__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
-vget_low_u64 (uint64x2_t __a)
-{
- return (uint64x1_t)__builtin_neon_vget_lowv2di ((int64x2_t) __a);
-}
-
__extension__ static __inline poly8x8_t __attribute__ ((__always_inline__))
vget_low_p8 (poly8x16_t __a)
{
@@ -5856,6 +5844,18 @@ vget_low_p16 (poly16x8_t __a)
return (poly16x4_t)__builtin_neon_vget_lowv8hi ((int16x8_t) __a);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vget_low_s64 (int64x2_t __a)
+{
+ return (int64x1_t)__builtin_neon_vget_lowv2di (__a);
+}
+
+__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
+vget_low_u64 (uint64x2_t __a)
+{
+ return (uint64x1_t)__builtin_neon_vget_lowv2di ((int64x2_t) __a);
+}
+
__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
vcvt_s32_f32 (float32x2_t __a)
{
@@ -10386,12 +10386,6 @@ vand_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_vandv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vand_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_vanddi (__a, __b, 1);
-}
-
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
vand_u8 (uint8x8_t __a, uint8x8_t __b)
{
@@ -10410,6 +10404,12 @@ vand_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_vandv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vand_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_vanddi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
vand_u64 (uint64x1_t __a, uint64x1_t __b)
{
@@ -10482,12 +10482,6 @@ vorr_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_vorrv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vorr_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_vorrdi (__a, __b, 1);
-}
-
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
vorr_u8 (uint8x8_t __a, uint8x8_t __b)
{
@@ -10506,6 +10500,12 @@ vorr_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_vorrv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vorr_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_vorrdi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
vorr_u64 (uint64x1_t __a, uint64x1_t __b)
{
@@ -10578,12 +10578,6 @@ veor_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_veorv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-veor_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_veordi (__a, __b, 1);
-}
-
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
veor_u8 (uint8x8_t __a, uint8x8_t __b)
{
@@ -10602,6 +10596,12 @@ veor_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_veorv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+veor_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_veordi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
veor_u64 (uint64x1_t __a, uint64x1_t __b)
{
@@ -10674,12 +10674,6 @@ vbic_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_vbicv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vbic_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_vbicdi (__a, __b, 1);
-}
-
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
vbic_u8 (uint8x8_t __a, uint8x8_t __b)
{
@@ -10698,6 +10692,12 @@ vbic_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_vbicv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vbic_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_vbicdi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
vbic_u64 (uint64x1_t __a, uint64x1_t __b)
{
@@ -10770,12 +10770,6 @@ vorn_s32 (int32x2_t __a, int32x2_t __b)
return (int32x2_t)__builtin_neon_vornv2si (__a, __b, 1);
}
-__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
-vorn_s64 (int64x1_t __a, int64x1_t __b)
-{
- return (int64x1_t)__builtin_neon_vorndi (__a, __b, 1);
-}
-
__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
vorn_u8 (uint8x8_t __a, uint8x8_t __b)
{
@@ -10794,6 +10788,12 @@ vorn_u32 (uint32x2_t __a, uint32x2_t __b)
return (uint32x2_t)__builtin_neon_vornv2si ((int32x2_t) __a, (int32x2_t) __b, 0);
}
+__extension__ static __inline int64x1_t __attribute__ ((__always_inline__))
+vorn_s64 (int64x1_t __a, int64x1_t __b)
+{
+ return (int64x1_t)__builtin_neon_vorndi (__a, __b, 1);
+}
+
__extension__ static __inline uint64x1_t __attribute__ ((__always_inline__))
vorn_u64 (uint64x1_t __a, uint64x1_t __b)
{
diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md
index 6d6c77d4b66..ee6b6256b32 100644
--- a/gcc/config/arm/constraints.md
+++ b/gcc/config/arm/constraints.md
@@ -29,8 +29,8 @@
;; in Thumb-1 state: I, J, K, L, M, N, O
;; The following multi-letter normal constraints have been used:
-;; in ARM/Thumb-2 state: Da, Db, Dc, Dn, Dl, DL, Dv, Dy
-;; in Thumb-1 state: Pa, Pb
+;; in ARM/Thumb-2 state: Da, Db, Dc, Dn, Dl, DL, Dv, Dy, Di
+;; in Thumb-1 state: Pa, Pb, Pc
;; in Thumb-2 state: Ps, Pt, Pu, Pv, Pw, Px
;; The following memory constraints have been used:
@@ -122,7 +122,7 @@
(and (match_code "const_int")
(match_test "TARGET_32BIT ? ((ival >= 0 && ival <= 32)
|| ((ival & (ival - 1)) == 0))
- : ((ival >= 0 && ival <= 1020) && ((ival & 3) == 0))")))
+ : ival >= 0 && ival <= 1020 && (ival & 3) == 0")))
(define_constraint "N"
"Thumb-1 state a constant in the range 0-31."
@@ -148,6 +148,12 @@
(match_test "TARGET_THUMB1 && ival >= -262 && ival <= 262
&& (ival > 255 || ival < -255)")))
+(define_constraint "Pc"
+ "@internal In Thumb-1 state a constant that is in the range 1021 to 1275"
+ (and (match_code "const_int")
+ (match_test "TARGET_THUMB1
+ && ival > 1020 && ival <= 1275")))
+
(define_constraint "Ps"
"@internal In Thumb-2 state a constant in the range -255 to +255"
(and (match_code "const_int")
@@ -211,6 +217,13 @@
(match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 4
&& !(optimize_size || arm_ld_sched)")))
+(define_constraint "Di"
+ "@internal
+ In ARM/Thumb-2 state a const_int or const_double where both the high
+ and low SImode words can be generated as immediates in 32-bit instructions."
+ (and (match_code "const_double,const_int")
+ (match_test "TARGET_32BIT && arm_const_double_by_immediates (op)")))
+
(define_constraint "Dn"
"@internal
In ARM/Thumb-2 state a const_vector which can be loaded with a Neon vmov
diff --git a/gcc/config/arm/cortex-a8.md b/gcc/config/arm/cortex-a8.md
index e982e048809..8ac754ebc28 100644
--- a/gcc/config/arm/cortex-a8.md
+++ b/gcc/config/arm/cortex-a8.md
@@ -47,17 +47,15 @@
"(cortex_a8_alu0+cortex_a8_issue_ls)|\
(cortex_a8_alu1+cortex_a8_issue_ls)")
-;; ...and in the case of two micro-ops. We don't need to reserve
-;; cortex_a8_issue_ls here because dual issue is altogether forbidden
+;; ...and in the case of two micro-ops. Dual issue is altogether forbidden
;; during the issue cycle of the first micro-op. (Instead of modelling
;; a separate issue unit, we instead reserve alu0 and alu1 to
;; prevent any other instructions from being issued upon that first cycle.)
;; Even though the load/store pipeline is usually available in either
-;; ALU pipe, multi-cycle instructions always issue in pipeline 0. This
-;; reservation is therefore the same as cortex_a8_multiply_2 below.
+;; ALU pipe, multi-cycle instructions always issue in pipeline 0.
(define_reservation "cortex_a8_load_store_2"
- "cortex_a8_alu0+cortex_a8_alu1,\
- cortex_a8_alu0")
+ "cortex_a8_alu0+cortex_a8_alu1+cortex_a8_issue_ls,\
+ cortex_a8_alu0+cortex_a8_issue_ls")
;; The flow of a single-cycle multiplication.
(define_reservation "cortex_a8_multiply"
@@ -87,8 +85,9 @@
;; (source read in E2 and destination available at the end of that cycle).
(define_insn_reservation "cortex_a8_alu" 2
(and (eq_attr "tune" "cortexa8")
- (ior (and (eq_attr "type" "alu")
- (not (eq_attr "insn" "mov,mvn")))
+ (ior (and (and (eq_attr "type" "alu")
+ (eq_attr "neon_type" "none"))
+ (not (eq_attr "insn" "mov,mvn")))
(eq_attr "insn" "clz")))
"cortex_a8_default")
diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
index e69035e590d..1c034bc0496 100644
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -27,6 +27,7 @@
{ \
TARGET_BPABI_CPP_BUILTINS(); \
LINUX_TARGET_OS_CPP_BUILTINS(); \
+ ANDROID_TARGET_OS_CPP_BUILTINS(); \
} \
while (false)
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 43b3805c7ba..15f347c9607 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -22,17 +22,12 @@
(define_constants
[(UNSPEC_ASHIFT_SIGNED 65)
(UNSPEC_ASHIFT_UNSIGNED 66)
- (UNSPEC_VABA 67)
- (UNSPEC_VABAL 68)
(UNSPEC_VABD 69)
(UNSPEC_VABDL 70)
- (UNSPEC_VABS 71)
(UNSPEC_VADD 72)
(UNSPEC_VADDHN 73)
(UNSPEC_VADDL 74)
(UNSPEC_VADDW 75)
- (UNSPEC_VAND 76)
- (UNSPEC_VBIC 77)
(UNSPEC_VBSL 78)
(UNSPEC_VCAGE 79)
(UNSPEC_VCAGT 80)
@@ -40,18 +35,9 @@
(UNSPEC_VCGE 82)
(UNSPEC_VCGT 83)
(UNSPEC_VCLS 84)
- (UNSPEC_VCLZ 85)
- (UNSPEC_VCNT 86)
- (UNSPEC_VCOMBINE 87)
(UNSPEC_VCVT 88)
(UNSPEC_VCVT_N 89)
- (UNSPEC_VDUP_LANE 90)
- (UNSPEC_VDUP_N 91)
- (UNSPEC_VEOR 92)
(UNSPEC_VEXT 93)
- (UNSPEC_VGET_HIGH 94)
- (UNSPEC_VGET_LANE 95)
- (UNSPEC_VGET_LOW 96)
(UNSPEC_VHADD 97)
(UNSPEC_VHSUB 98)
(UNSPEC_VLD1 99)
@@ -86,10 +72,6 @@
(UNSPEC_VMULL 128)
(UNSPEC_VMUL_LANE 129)
(UNSPEC_VMULL_LANE 130)
- (UNSPEC_VMUL_N 131)
- (UNSPEC_VMVN 132)
- (UNSPEC_VORN 133)
- (UNSPEC_VORR 134)
(UNSPEC_VPADAL 135)
(UNSPEC_VPADD 136)
(UNSPEC_VPADDL 137)
@@ -125,7 +107,6 @@
(UNSPEC_VREV64 167)
(UNSPEC_VRSQRTE 168)
(UNSPEC_VRSQRTS 169)
- (UNSPEC_VSET_LANE 170)
(UNSPEC_VSHL 171)
(UNSPEC_VSHLL_N 172)
(UNSPEC_VSHL_N 173)
@@ -185,9 +166,6 @@
;; Opaque structure types wider than TImode.
(define_mode_iterator VSTRUCT [EI OI CI XI])
-;; Number of instructions needed to load/store struct elements. FIXME!
-(define_mode_attr V_slen [(EI "2") (OI "2") (CI "3") (XI "4")])
-
;; Opaque structure types used in table lookups (except vtbl1/vtbx1).
(define_mode_iterator VTAB [TI EI OI])
@@ -335,6 +313,14 @@
(V4HI "V2SI") (V8HI "V4SI")
(V2SI "DI") (V4SI "V2DI")])
+;; Double-sized modes with the same element size.
+;; Used for neon_vdup_lane, where the second operand is double-sized
+;; even when the first one is quad.
+(define_mode_attr V_double_vector_mode [(V16QI "V8QI") (V8HI "V4HI")
+ (V4SI "V2SI") (V4SF "V2SF")
+ (V8QI "V8QI") (V4HI "V4HI")
+ (V2SI "V2SI") (V2SF "V2SF")])
+
;; Mode of result of comparison operations (and bit-select operand 1).
(define_mode_attr V_cmp_result [(V8QI "V8QI") (V16QI "V16QI")
(V4HI "V4HI") (V8HI "V8HI")
@@ -587,7 +573,7 @@
}
}
[(set_attr "neon_type" "neon_int_1,neon_stm_2,neon_ldm_2")
- (set_attr "length" "<V_slen>,<V_slen>,<V_slen>")])
+ (set (attr "length") (symbol_ref "arm_attr_length_move_neon (insn)"))])
(define_split
[(set (match_operand:EI 0 "s_register_operand" "")
@@ -688,7 +674,7 @@
elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
operands[2] = GEN_INT (elt);
- return "vmov%?.<V_uf_sclr>\t%P0[%c2], %1";
+ return "vmov%?.<V_sz_elem>\t%P0[%c2], %1";
}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_mcr")])
@@ -714,7 +700,7 @@
operands[0] = gen_rtx_REG (<V_HALF>mode, regno + hi);
operands[2] = GEN_INT (elt);
- return "vmov%?.<V_uf_sclr>\t%P0[%c2], %1";
+ return "vmov%?.<V_sz_elem>\t%P0[%c2], %1";
}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_mcr")]
@@ -734,7 +720,7 @@
operands[0] = gen_rtx_REG (DImode, regno);
- return "vmov%?.64\t%P0, %Q1, %R1";
+ return "vmov%?\t%P0, %Q1, %R1";
}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_mcr_2_mcrr")]
@@ -802,11 +788,11 @@
(parallel [(match_operand:SI 2 "immediate_operand" "i")])))]
"TARGET_NEON"
{
- int regno = REGNO (operands[1]) + INTVAL (operands[2]);
+ int regno = REGNO (operands[1]) + 2 * INTVAL (operands[2]);
operands[1] = gen_rtx_REG (DImode, regno);
- return "vmov%?.64\t%Q0, %R0, %P1";
+ return "vmov%?\t%Q0, %R0, %P1 @ v2di";
}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_int_1")]
@@ -823,17 +809,14 @@
;; Doubleword and quadword arithmetic.
-;; NOTE: vadd/vsub and some other instructions also support 64-bit integer
-;; element size, which we could potentially use for "long long" operations. We
-;; don't want to do this at present though, because moving values from the
-;; vector unit to the ARM core is currently slow and 64-bit addition (etc.) is
-;; easy to do with ARM instructions anyway.
+;; NOTE: some other instructions also support 64-bit integer
+;; element size, which we could potentially use for "long long" operations.
(define_insn "*add<mode>3_neon"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(plus:VDQ (match_operand:VDQ 1 "s_register_operand" "w")
(match_operand:VDQ 2 "s_register_operand" "w")))]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
"vadd.<V_if_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
[(set (attr "neon_type")
(if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
@@ -843,11 +826,31 @@
(const_string "neon_int_1")))]
)
+(define_insn "adddi3_neon"
+ [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r")
+ (plus:DI (match_operand:DI 1 "s_register_operand" "%w,0,0")
+ (match_operand:DI 2 "s_register_operand" "w,r,0")))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_NEON"
+{
+ switch (which_alternative)
+ {
+ case 0: return "vadd.i64\t%P0, %P1, %P2";
+ case 1: return "#";
+ case 2: return "#";
+ default: gcc_unreachable ();
+ }
+}
+ [(set_attr "neon_type" "neon_int_1,*,*")
+ (set_attr "conds" "*,clob,clob")
+ (set_attr "length" "*,8,8")]
+)
+
(define_insn "*sub<mode>3_neon"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(minus:VDQ (match_operand:VDQ 1 "s_register_operand" "w")
(match_operand:VDQ 2 "s_register_operand" "w")))]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
"vsub.<V_if_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
[(set (attr "neon_type")
(if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
@@ -857,11 +860,32 @@
(const_string "neon_int_2")))]
)
+(define_insn "subdi3_neon"
+ [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r,?&r")
+ (minus:DI (match_operand:DI 1 "s_register_operand" "w,0,r,0")
+ (match_operand:DI 2 "s_register_operand" "w,r,0,0")))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_NEON"
+{
+ switch (which_alternative)
+ {
+ case 0: return "vsub.i64\t%P0, %P1, %P2";
+ case 1: /* fall through */
+ case 2: /* fall through */
+ case 3: return "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2";
+ default: gcc_unreachable ();
+ }
+}
+ [(set_attr "neon_type" "neon_int_2,*,*,*")
+ (set_attr "conds" "*,clob,clob,clob")
+ (set_attr "length" "*,8,8,8")]
+)
+
(define_insn "*mul<mode>3_neon"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(mult:VDQ (match_operand:VDQ 1 "s_register_operand" "w")
(match_operand:VDQ 2 "s_register_operand" "w")))]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
"vmul.<V_if_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
[(set (attr "neon_type")
(if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
@@ -878,12 +902,12 @@
(const_string "neon_mul_qqq_8_16_32_ddd_32")))))]
)
-(define_insn "*mul<mode>3add<mode>_neon"
+(define_insn "mul<mode>3add<mode>_neon"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(plus:VDQ (mult:VDQ (match_operand:VDQ 2 "s_register_operand" "w")
(match_operand:VDQ 3 "s_register_operand" "w"))
(match_operand:VDQ 1 "s_register_operand" "0")))]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
"vmla.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
[(set (attr "neon_type")
(if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
@@ -900,12 +924,12 @@
(const_string "neon_mla_qqq_32_qqd_32_scalar")))))]
)
-(define_insn "*mul<mode>3neg<mode>add<mode>_neon"
+(define_insn "mul<mode>3neg<mode>add<mode>_neon"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(minus:VDQ (match_operand:VDQ 1 "s_register_operand" "0")
(mult:VDQ (match_operand:VDQ 2 "s_register_operand" "w")
(match_operand:VDQ 3 "s_register_operand" "w"))))]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
"vmls.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
[(set (attr "neon_type")
(if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0))
@@ -940,10 +964,9 @@
)
(define_insn "iordi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w,w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w,0")
- (match_operand:DI 2 "neon_logic_op2" "w,Dl")]
- UNSPEC_VORR))]
+ [(set (match_operand:DI 0 "s_register_operand" "=w,w,?&r,?&r")
+ (ior:DI (match_operand:DI 1 "s_register_operand" "%w,0,0,r")
+ (match_operand:DI 2 "neon_logic_op2" "w,Dl,r,r")))]
"TARGET_NEON"
{
switch (which_alternative)
@@ -951,10 +974,13 @@
case 0: return "vorr\t%P0, %P1, %P2";
case 1: return neon_output_logic_immediate ("vorr", &operands[2],
DImode, 0, VALID_NEON_QREG_MODE (DImode));
+ case 2: return "#";
+ case 3: return "#";
default: gcc_unreachable ();
}
}
- [(set_attr "neon_type" "neon_int_1")]
+ [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*")
+ (set_attr "length" "*,*,8,8")]
)
;; The concrete forms of the Neon immediate-logic instructions are vbic and
@@ -980,10 +1006,9 @@
)
(define_insn "anddi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w,w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w,0")
- (match_operand:DI 2 "neon_inv_logic_op2" "w,DL")]
- UNSPEC_VAND))]
+ [(set (match_operand:DI 0 "s_register_operand" "=w,w,?&r,?&r")
+ (and:DI (match_operand:DI 1 "s_register_operand" "%w,0,0,r")
+ (match_operand:DI 2 "neon_inv_logic_op2" "w,DL,r,r")))]
"TARGET_NEON"
{
switch (which_alternative)
@@ -991,10 +1016,13 @@
case 0: return "vand\t%P0, %P1, %P2";
case 1: return neon_output_logic_immediate ("vand", &operands[2],
DImode, 1, VALID_NEON_QREG_MODE (DImode));
+ case 2: return "#";
+ case 3: return "#";
default: gcc_unreachable ();
}
}
- [(set_attr "neon_type" "neon_int_1")]
+ [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*")
+ (set_attr "length" "*,*,8,8")]
)
(define_insn "orn<mode>3_neon"
@@ -1007,13 +1035,16 @@
)
(define_insn "orndi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w")
- (match_operand:DI 2 "s_register_operand" "w")]
- UNSPEC_VORN))]
+ [(set (match_operand:DI 0 "s_register_operand" "=w,?=&r,?&r")
+ (ior:DI (match_operand:DI 1 "s_register_operand" "w,r,0")
+ (not:DI (match_operand:DI 2 "s_register_operand" "w,0,r"))))]
"TARGET_NEON"
- "vorn\t%P0, %P1, %P2"
- [(set_attr "neon_type" "neon_int_1")]
+ "@
+ vorn\t%P0, %P1, %P2
+ #
+ #"
+ [(set_attr "neon_type" "neon_int_1,*,*")
+ (set_attr "length" "*,8,8")]
)
(define_insn "bic<mode>3_neon"
@@ -1025,14 +1056,18 @@
[(set_attr "neon_type" "neon_int_1")]
)
+;; Compare to *anddi_notdi_di.
(define_insn "bicdi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w")
- (match_operand:DI 2 "s_register_operand" "w")]
- UNSPEC_VBIC))]
+ [(set (match_operand:DI 0 "s_register_operand" "=w,?=&r,?&r")
+ (and:DI (not:DI (match_operand:DI 2 "s_register_operand" "w,r,0"))
+ (match_operand:DI 1 "s_register_operand" "w,0,r")))]
"TARGET_NEON"
- "vbic\t%P0, %P1, %P2"
- [(set_attr "neon_type" "neon_int_1")]
+ "@
+ vbic\t%P0, %P1, %P2
+ #
+ #"
+ [(set_attr "neon_type" "neon_int_1,*,*")
+ (set_attr "length" "*,8,8")]
)
(define_insn "xor<mode>3"
@@ -1045,13 +1080,16 @@
)
(define_insn "xordi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w")
- (match_operand:DI 2 "s_register_operand" "w")]
- UNSPEC_VEOR))]
+ [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r")
+ (xor:DI (match_operand:DI 1 "s_register_operand" "%w,0,r")
+ (match_operand:DI 2 "s_register_operand" "w,r,r")))]
"TARGET_NEON"
- "veor\t%P0, %P1, %P2"
- [(set_attr "neon_type" "neon_int_1")]
+ "@
+ veor\t%P0, %P1, %P2
+ #
+ #"
+ [(set_attr "neon_type" "neon_int_1,*,*")
+ (set_attr "length" "*,8,8")]
)
(define_insn "one_cmpl<mode>2"
@@ -1320,7 +1358,7 @@
(parallel [(const_int 0) (const_int 1)]))
(vec_select:V2SF (match_dup 1)
(parallel [(const_int 2) (const_int 3)]))))]
- "TARGET_NEON"
+ "TARGET_NEON && flag_unsafe_math_optimizations"
"<VQH_mnem>.f32\t%P0, %e1, %f1"
[(set_attr "vqh_mnem" "<VQH_mnem>")
(set (attr "neon_type")
@@ -1455,7 +1493,7 @@
(define_expand "reduc_splus_<mode>"
[(match_operand:VD 0 "s_register_operand" "")
(match_operand:VD 1 "s_register_operand" "")]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
{
neon_pairwise_reduce (operands[0], operands[1], <MODE>mode,
&gen_neon_vpadd_internal<mode>);
@@ -1465,7 +1503,7 @@
(define_expand "reduc_splus_<mode>"
[(match_operand:VQ 0 "s_register_operand" "")
(match_operand:VQ 1 "s_register_operand" "")]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
{
rtx step1 = gen_reg_rtx (<V_HALF>mode);
rtx res_d = gen_reg_rtx (<V_HALF>mode);
@@ -1500,7 +1538,7 @@
(define_expand "reduc_smin_<mode>"
[(match_operand:VD 0 "s_register_operand" "")
(match_operand:VD 1 "s_register_operand" "")]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
{
neon_pairwise_reduce (operands[0], operands[1], <MODE>mode,
&gen_neon_vpsmin<mode>);
@@ -1510,7 +1548,7 @@
(define_expand "reduc_smin_<mode>"
[(match_operand:VQ 0 "s_register_operand" "")
(match_operand:VQ 1 "s_register_operand" "")]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
{
rtx step1 = gen_reg_rtx (<V_HALF>mode);
rtx res_d = gen_reg_rtx (<V_HALF>mode);
@@ -1525,7 +1563,7 @@
(define_expand "reduc_smax_<mode>"
[(match_operand:VD 0 "s_register_operand" "")
(match_operand:VD 1 "s_register_operand" "")]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
{
neon_pairwise_reduce (operands[0], operands[1], <MODE>mode,
&gen_neon_vpsmax<mode>);
@@ -1535,7 +1573,7 @@
(define_expand "reduc_smax_<mode>"
[(match_operand:VQ 0 "s_register_operand" "")
(match_operand:VQ 1 "s_register_operand" "")]
- "TARGET_NEON"
+ "TARGET_NEON && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
{
rtx step1 = gen_reg_rtx (<V_HALF>mode);
rtx res_d = gen_reg_rtx (<V_HALF>mode);
@@ -1711,11 +1749,37 @@
; good for plain vadd, vaddq.
-(define_insn "neon_vadd<mode>"
+(define_expand "neon_vadd<mode>"
+ [(match_operand:VDQX 0 "s_register_operand" "=w")
+ (match_operand:VDQX 1 "s_register_operand" "w")
+ (match_operand:VDQX 2 "s_register_operand" "w")
+ (match_operand:SI 3 "immediate_operand" "i")]
+ "TARGET_NEON"
+{
+ if (!<Is_float_mode> || flag_unsafe_math_optimizations)
+ emit_insn (gen_add<mode>3 (operands[0], operands[1], operands[2]));
+ else
+ emit_insn (gen_neon_vadd<mode>_unspec (operands[0], operands[1],
+ operands[2]));
+ DONE;
+})
+
+; Note that NEON operations don't support the full IEEE 754 standard: in
+; particular, denormal values are flushed to zero. This means that GCC cannot
+; use those instructions for autovectorization, etc. unless
+; -funsafe-math-optimizations is in effect (in which case flush-to-zero
+; behaviour is permissible). Intrinsic operations (provided by the arm_neon.h
+; header) must work in either case: if -funsafe-math-optimizations is given,
+; intrinsics expand to "canonical" RTL where possible, otherwise intrinsics
+; expand to unspecs (which may potentially limit the extent to which they might
+; be optimized by generic code).
+
+; Used for intrinsics when flag_unsafe_math_optimizations is false.
+
+(define_insn "neon_vadd<mode>_unspec"
[(set (match_operand:VDQX 0 "s_register_operand" "=w")
(unspec:VDQX [(match_operand:VDQX 1 "s_register_operand" "w")
- (match_operand:VDQX 2 "s_register_operand" "w")
- (match_operand:SI 3 "immediate_operand" "i")]
+ (match_operand:VDQX 2 "s_register_operand" "w")]
UNSPEC_VADD))]
"TARGET_NEON"
"vadd.<V_if_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
@@ -1788,6 +1852,8 @@
[(set_attr "neon_type" "neon_int_4")]
)
+;; We cannot replace this unspec with mul<mode>3 because of the odd
+;; polynomial multiplication case that can specified by operand 3.
(define_insn "neon_vmul<mode>"
[(set (match_operand:VDQW 0 "s_register_operand" "=w")
(unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "w")
@@ -1811,13 +1877,31 @@
(const_string "neon_mul_qqq_8_16_32_ddd_32")))))]
)
-(define_insn "neon_vmla<mode>"
- [(set (match_operand:VDQW 0 "s_register_operand" "=w")
- (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0")
- (match_operand:VDQW 2 "s_register_operand" "w")
- (match_operand:VDQW 3 "s_register_operand" "w")
- (match_operand:SI 4 "immediate_operand" "i")]
- UNSPEC_VMLA))]
+(define_expand "neon_vmla<mode>"
+ [(match_operand:VDQW 0 "s_register_operand" "=w")
+ (match_operand:VDQW 1 "s_register_operand" "0")
+ (match_operand:VDQW 2 "s_register_operand" "w")
+ (match_operand:VDQW 3 "s_register_operand" "w")
+ (match_operand:SI 4 "immediate_operand" "i")]
+ "TARGET_NEON"
+{
+ if (!<Is_float_mode> || flag_unsafe_math_optimizations)
+ emit_insn (gen_mul<mode>3add<mode>_neon (operands[0], operands[1],
+ operands[2], operands[3]));
+ else
+ emit_insn (gen_neon_vmla<mode>_unspec (operands[0], operands[1],
+ operands[2], operands[3]));
+ DONE;
+})
+
+; Used for intrinsics when flag_unsafe_math_optimizations is false.
+
+(define_insn "neon_vmla<mode>_unspec"
+ [(set (match_operand:VDQ 0 "s_register_operand" "=w")
+ (unspec:VDQ [(match_operand:VDQ 1 "s_register_operand" "0")
+ (match_operand:VDQ 2 "s_register_operand" "w")
+ (match_operand:VDQ 3 "s_register_operand" "w")]
+ UNSPEC_VMLA))]
"TARGET_NEON"
"vmla.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
[(set (attr "neon_type")
@@ -1850,13 +1934,31 @@
(const_string "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long")))]
)
-(define_insn "neon_vmls<mode>"
- [(set (match_operand:VDQW 0 "s_register_operand" "=w")
- (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0")
- (match_operand:VDQW 2 "s_register_operand" "w")
- (match_operand:VDQW 3 "s_register_operand" "w")
- (match_operand:SI 4 "immediate_operand" "i")]
- UNSPEC_VMLS))]
+(define_expand "neon_vmls<mode>"
+ [(match_operand:VDQW 0 "s_register_operand" "=w")
+ (match_operand:VDQW 1 "s_register_operand" "0")
+ (match_operand:VDQW 2 "s_register_operand" "w")
+ (match_operand:VDQW 3 "s_register_operand" "w")
+ (match_operand:SI 4 "immediate_operand" "i")]
+ "TARGET_NEON"
+{
+ if (!<Is_float_mode> || flag_unsafe_math_optimizations)
+ emit_insn (gen_mul<mode>3neg<mode>add<mode>_neon (operands[0],
+ operands[1], operands[2], operands[3]));
+ else
+ emit_insn (gen_neon_vmls<mode>_unspec (operands[0], operands[1],
+ operands[2], operands[3]));
+ DONE;
+})
+
+; Used for intrinsics when flag_unsafe_math_optimizations is false.
+
+(define_insn "neon_vmls<mode>_unspec"
+ [(set (match_operand:VDQ 0 "s_register_operand" "=w")
+ (unspec:VDQ [(match_operand:VDQ 1 "s_register_operand" "0")
+ (match_operand:VDQ 2 "s_register_operand" "w")
+ (match_operand:VDQ 3 "s_register_operand" "w")]
+ UNSPEC_VMLS))]
"TARGET_NEON"
"vmls.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
[(set (attr "neon_type")
@@ -1966,11 +2068,27 @@
(const_string "neon_mul_qdd_64_32_long_qqd_16_ddd_32_scalar_64_32_long_scalar")))]
)
-(define_insn "neon_vsub<mode>"
+(define_expand "neon_vsub<mode>"
+ [(match_operand:VDQX 0 "s_register_operand" "=w")
+ (match_operand:VDQX 1 "s_register_operand" "w")
+ (match_operand:VDQX 2 "s_register_operand" "w")
+ (match_operand:SI 3 "immediate_operand" "i")]
+ "TARGET_NEON"
+{
+ if (!<Is_float_mode> || flag_unsafe_math_optimizations)
+ emit_insn (gen_sub<mode>3 (operands[0], operands[1], operands[2]));
+ else
+ emit_insn (gen_neon_vsub<mode>_unspec (operands[0], operands[1],
+ operands[2]));
+ DONE;
+})
+
+; Used for intrinsics when flag_unsafe_math_optimizations is false.
+
+(define_insn "neon_vsub<mode>_unspec"
[(set (match_operand:VDQX 0 "s_register_operand" "=w")
(unspec:VDQX [(match_operand:VDQX 1 "s_register_operand" "w")
- (match_operand:VDQX 2 "s_register_operand" "w")
- (match_operand:SI 3 "immediate_operand" "i")]
+ (match_operand:VDQX 2 "s_register_operand" "w")]
UNSPEC_VSUB))]
"TARGET_NEON"
"vsub.<V_if_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
@@ -2153,11 +2271,11 @@
(define_insn "neon_vaba<mode>"
[(set (match_operand:VDQIW 0 "s_register_operand" "=w")
- (unspec:VDQIW [(match_operand:VDQIW 1 "s_register_operand" "0")
- (match_operand:VDQIW 2 "s_register_operand" "w")
- (match_operand:VDQIW 3 "s_register_operand" "w")
- (match_operand:SI 4 "immediate_operand" "i")]
- UNSPEC_VABA))]
+ (plus:VDQIW (match_operand:VDQIW 1 "s_register_operand" "0")
+ (unspec:VDQIW [(match_operand:VDQIW 2 "s_register_operand" "w")
+ (match_operand:VDQIW 3 "s_register_operand" "w")
+ (match_operand:SI 4 "immediate_operand" "i")]
+ UNSPEC_VABD)))]
"TARGET_NEON"
"vaba.%T4%#<V_sz_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3"
[(set (attr "neon_type")
@@ -2167,11 +2285,11 @@
(define_insn "neon_vabal<mode>"
[(set (match_operand:<V_widen> 0 "s_register_operand" "=w")
- (unspec:<V_widen> [(match_operand:<V_widen> 1 "s_register_operand" "0")
- (match_operand:VW 2 "s_register_operand" "w")
- (match_operand:VW 3 "s_register_operand" "w")
- (match_operand:SI 4 "immediate_operand" "i")]
- UNSPEC_VABAL))]
+ (plus:<V_widen> (match_operand:<V_widen> 1 "s_register_operand" "0")
+ (unspec:<V_widen> [(match_operand:VW 2 "s_register_operand" "w")
+ (match_operand:VW 3 "s_register_operand" "w")
+ (match_operand:SI 4 "immediate_operand" "i")]
+ UNSPEC_VABDL)))]
"TARGET_NEON"
"vabal.%T4%#<V_sz_elem>\t%q0, %P2, %P3"
[(set_attr "neon_type" "neon_vaba")]
@@ -2302,22 +2420,15 @@
(const_string "neon_fp_vrecps_vrsqrts_qqq")))]
)
-(define_insn "neon_vabs<mode>"
- [(set (match_operand:VDQW 0 "s_register_operand" "=w")
- (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VABS))]
+(define_expand "neon_vabs<mode>"
+ [(match_operand:VDQW 0 "s_register_operand" "")
+ (match_operand:VDQW 1 "s_register_operand" "")
+ (match_operand:SI 2 "immediate_operand" "")]
"TARGET_NEON"
- "vabs.<V_s_elem>\t%<V_reg>0, %<V_reg>1"
- [(set (attr "neon_type")
- (if_then_else (ior (ne (symbol_ref "<Is_float_mode>") (const_int 0))
- (ne (symbol_ref "<Is_float_mode>") (const_int 0)))
- (if_then_else
- (ne (symbol_ref "<Is_d_reg>") (const_int 0))
- (const_string "neon_fp_vadd_ddd_vabs_dd")
- (const_string "neon_fp_vadd_qqq_vabs_qq"))
- (const_string "neon_vqneg_vqabs")))]
-)
+{
+ emit_insn (gen_abs<mode>2 (operands[0], operands[1]));
+ DONE;
+})
(define_insn "neon_vqabs<mode>"
[(set (match_operand:VDQIW 0 "s_register_operand" "=w")
@@ -2359,26 +2470,42 @@
[(set_attr "neon_type" "neon_int_1")]
)
-(define_insn "neon_vclz<mode>"
+(define_insn "clz<mode>2"
[(set (match_operand:VDQIW 0 "s_register_operand" "=w")
- (unspec:VDQIW [(match_operand:VDQIW 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VCLZ))]
+ (clz:VDQIW (match_operand:VDQIW 1 "s_register_operand" "w")))]
"TARGET_NEON"
"vclz.<V_if_elem>\t%<V_reg>0, %<V_reg>1"
[(set_attr "neon_type" "neon_int_1")]
)
-(define_insn "neon_vcnt<mode>"
+(define_expand "neon_vclz<mode>"
+ [(match_operand:VDQIW 0 "s_register_operand" "")
+ (match_operand:VDQIW 1 "s_register_operand" "")
+ (match_operand:SI 2 "immediate_operand" "")]
+ "TARGET_NEON"
+{
+ emit_insn (gen_clz<mode>2 (operands[0], operands[1]));
+ DONE;
+})
+
+(define_insn "popcount<mode>2"
[(set (match_operand:VE 0 "s_register_operand" "=w")
- (unspec:VE [(match_operand:VE 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VCNT))]
+ (popcount:VE (match_operand:VE 1 "s_register_operand" "w")))]
"TARGET_NEON"
"vcnt.<V_sz_elem>\t%<V_reg>0, %<V_reg>1"
[(set_attr "neon_type" "neon_int_1")]
)
+(define_expand "neon_vcnt<mode>"
+ [(match_operand:VE 0 "s_register_operand" "=w")
+ (match_operand:VE 1 "s_register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")]
+ "TARGET_NEON"
+{
+ emit_insn (gen_popcount<mode>2 (operands[0], operands[1]));
+ DONE;
+})
+
(define_insn "neon_vrecpe<mode>"
[(set (match_operand:V32 0 "s_register_operand" "=w")
(unspec:V32 [(match_operand:V32 1 "s_register_operand" "w")
@@ -2555,126 +2682,65 @@
; Operand 3 (info word) is ignored because it does nothing useful with 64-bit
; elements.
-(define_insn "neon_vget_lanedi"
- [(set (match_operand:DI 0 "s_register_operand" "=r")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")
- (match_operand:SI 3 "immediate_operand" "i")]
- UNSPEC_VGET_LANE))]
+(define_expand "neon_vget_lanedi"
+ [(match_operand:DI 0 "s_register_operand" "=r")
+ (match_operand:DI 1 "s_register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")
+ (match_operand:SI 3 "immediate_operand" "i")]
"TARGET_NEON"
{
neon_lane_bounds (operands[2], 0, 1);
- return "vmov%?\t%Q0, %R0, %P1 @ di";
-}
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
-)
+ emit_move_insn (operands[0], operands[1]);
+ DONE;
+})
-(define_insn "neon_vget_lanev2di"
- [(set (match_operand:DI 0 "s_register_operand" "=r")
- (unspec:DI [(match_operand:V2DI 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")
- (match_operand:SI 3 "immediate_operand" "i")]
- UNSPEC_VGET_LANE))]
+(define_expand "neon_vget_lanev2di"
+ [(match_operand:DI 0 "s_register_operand" "=r")
+ (match_operand:V2DI 1 "s_register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")
+ (match_operand:SI 3 "immediate_operand" "i")]
"TARGET_NEON"
{
- rtx ops[2];
- unsigned int regno = REGNO (operands[1]);
- unsigned int elt = INTVAL (operands[2]);
-
neon_lane_bounds (operands[2], 0, 2);
+ emit_insn (gen_vec_extractv2di (operands[0], operands[1], operands[2]));
+ DONE;
+})
- ops[0] = operands[0];
- ops[1] = gen_rtx_REG (DImode, regno + 2 * elt);
- output_asm_insn ("vmov%?\t%Q0, %R0, %P1 @ v2di", ops);
-
- return "";
-}
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vset_lane<mode>"
- [(set (match_operand:VD 0 "s_register_operand" "=w")
- (unspec:VD [(match_operand:<V_elem> 1 "s_register_operand" "r")
- (match_operand:VD 2 "s_register_operand" "0")
- (match_operand:SI 3 "immediate_operand" "i")]
- UNSPEC_VSET_LANE))]
- "TARGET_NEON"
-{
- neon_lane_bounds (operands[3], 0, GET_MODE_NUNITS (<MODE>mode));
- return "vmov%?.<V_sz_elem>\t%P0[%c3], %1";
-}
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
-)
-
-; See neon_vget_lanedi comment for reasons operands 2 & 3 are ignored.
-
-(define_insn "neon_vset_lanedi"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "r")
- (match_operand:DI 2 "s_register_operand" "0")
- (match_operand:SI 3 "immediate_operand" "i")]
- UNSPEC_VSET_LANE))]
- "TARGET_NEON"
-{
- neon_lane_bounds (operands[3], 0, 1);
- return "vmov%?\t%P0, %Q1, %R1 @ di";
-}
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vset_lane<mode>"
- [(set (match_operand:VQ 0 "s_register_operand" "=w")
- (unspec:VQ [(match_operand:<V_elem> 1 "s_register_operand" "r")
- (match_operand:VQ 2 "s_register_operand" "0")
- (match_operand:SI 3 "immediate_operand" "i")]
- UNSPEC_VSET_LANE))]
+(define_expand "neon_vset_lane<mode>"
+ [(match_operand:VDQ 0 "s_register_operand" "=w")
+ (match_operand:<V_elem> 1 "s_register_operand" "r")
+ (match_operand:VDQ 2 "s_register_operand" "0")
+ (match_operand:SI 3 "immediate_operand" "i")]
"TARGET_NEON"
{
- rtx ops[4];
- unsigned int regno = REGNO (operands[0]);
- unsigned int halfelts = GET_MODE_NUNITS (<MODE>mode) / 2;
unsigned int elt = INTVAL (operands[3]);
+ neon_lane_bounds (operands[3], 0, GET_MODE_NUNITS (<MODE>mode));
- neon_lane_bounds (operands[3], 0, halfelts * 2);
+ if (BYTES_BIG_ENDIAN)
+ {
+ unsigned int reg_nelts
+ = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
+ elt ^= reg_nelts - 1;
+ }
- ops[0] = gen_rtx_REG (<V_HALF>mode, regno + 2 * (elt / halfelts));
- ops[1] = operands[1];
- ops[2] = GEN_INT (elt % halfelts);
- output_asm_insn ("vmov%?.<V_sz_elem>\t%P0[%c2], %1", ops);
+ emit_insn (gen_vec_set<mode>_internal (operands[0], operands[1],
+ GEN_INT (1 << elt), operands[2]));
+ DONE;
+})
- return "";
-}
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
-)
+; See neon_vget_lanedi comment for reasons operands 2 & 3 are ignored.
-(define_insn "neon_vset_lanev2di"
- [(set (match_operand:V2DI 0 "s_register_operand" "=w")
- (unspec:V2DI [(match_operand:DI 1 "s_register_operand" "r")
- (match_operand:V2DI 2 "s_register_operand" "0")
- (match_operand:SI 3 "immediate_operand" "i")]
- UNSPEC_VSET_LANE))]
+(define_expand "neon_vset_lanedi"
+ [(match_operand:DI 0 "s_register_operand" "=w")
+ (match_operand:DI 1 "s_register_operand" "r")
+ (match_operand:DI 2 "s_register_operand" "0")
+ (match_operand:SI 3 "immediate_operand" "i")]
"TARGET_NEON"
{
- rtx ops[2];
- unsigned int regno = REGNO (operands[0]);
- unsigned int elt = INTVAL (operands[3]);
-
- neon_lane_bounds (operands[3], 0, 2);
-
- ops[0] = gen_rtx_REG (DImode, regno + 2 * elt);
- ops[1] = operands[1];
- output_asm_insn ("vmov%?\t%P0, %Q1, %R1 @ v2di", ops);
-
- return "";
-}
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
-)
+ neon_lane_bounds (operands[3], 0, 1);
+ emit_move_insn (operands[0], operands[1]);
+ DONE;
+})
(define_expand "neon_vcreate<mode>"
[(match_operand:VDX 0 "s_register_operand" "")
@@ -2688,8 +2754,7 @@
(define_insn "neon_vdup_n<mode>"
[(set (match_operand:VX 0 "s_register_operand" "=w")
- (unspec:VX [(match_operand:<V_elem> 1 "s_register_operand" "r")]
- UNSPEC_VDUP_N))]
+ (vec_duplicate:VX (match_operand:<V_elem> 1 "s_register_operand" "r")))]
"TARGET_NEON"
"vdup%?.<V_sz_elem>\t%<V_reg>0, %1"
;; Assume this schedules like vmov.
@@ -2699,8 +2764,7 @@
(define_insn "neon_vdup_n<mode>"
[(set (match_operand:V32 0 "s_register_operand" "=w,w")
- (unspec:V32 [(match_operand:<V_elem> 1 "s_register_operand" "r,t")]
- UNSPEC_VDUP_N))]
+ (vec_duplicate:V32 (match_operand:<V_elem> 1 "s_register_operand" "r,t")))]
"TARGET_NEON"
"@
vdup%?.<V_sz_elem>\t%<V_reg>0, %1
@@ -2710,61 +2774,76 @@
(set_attr "neon_type" "neon_bp_simple")]
)
-(define_insn "neon_vdup_ndi"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "r")]
- UNSPEC_VDUP_N))]
+(define_expand "neon_vdup_ndi"
+ [(match_operand:DI 0 "s_register_operand" "=w")
+ (match_operand:DI 1 "s_register_operand" "r")]
"TARGET_NEON"
- "vmov%?\t%P0, %Q1, %R1"
- [(set_attr "predicable" "yes")
- (set_attr "neon_type" "neon_bp_simple")]
+{
+ emit_move_insn (operands[0], operands[1]);
+ DONE;
+}
)
(define_insn "neon_vdup_nv2di"
- [(set (match_operand:V2DI 0 "s_register_operand" "=w")
- (unspec:V2DI [(match_operand:DI 1 "s_register_operand" "r")]
- UNSPEC_VDUP_N))]
+ [(set (match_operand:V2DI 0 "s_register_operand" "=w,w")
+ (vec_duplicate:V2DI (match_operand:DI 1 "s_register_operand" "r,w")))]
"TARGET_NEON"
- "vmov%?\t%e0, %Q1, %R1\;vmov%?\t%f0, %Q1, %R1"
+ "@
+ vmov%?\t%e0, %Q1, %R1\;vmov%?\t%f0, %Q1, %R1
+ vmov%?\t%e0, %P1\;vmov%?\t%f0, %P1"
[(set_attr "predicable" "yes")
(set_attr "length" "8")
(set_attr "neon_type" "neon_bp_simple")]
)
-(define_insn "neon_vdup_lane<mode>"
- [(set (match_operand:VD 0 "s_register_operand" "=w")
- (unspec:VD [(match_operand:VD 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VDUP_LANE))]
+(define_insn "neon_vdup_lane<mode>_internal"
+ [(set (match_operand:VDQW 0 "s_register_operand" "=w")
+ (vec_duplicate:VDQW
+ (vec_select:<V_elem>
+ (match_operand:<V_double_vector_mode> 1 "s_register_operand" "w")
+ (parallel [(match_operand:SI 2 "immediate_operand" "i")]))))]
"TARGET_NEON"
{
- neon_lane_bounds (operands[2], 0, GET_MODE_NUNITS (<MODE>mode));
- return "vdup.<V_sz_elem>\t%P0, %P1[%c2]";
+ if (BYTES_BIG_ENDIAN)
+ {
+ int elt = INTVAL (operands[2]);
+ elt = GET_MODE_NUNITS (<V_double_vector_mode>mode) - 1 - elt;
+ operands[2] = GEN_INT (elt);
+ }
+ if (<Is_d_reg>)
+ return "vdup.<V_sz_elem>\t%P0, %P1[%c2]";
+ else
+ return "vdup.<V_sz_elem>\t%q0, %P1[%c2]";
}
;; Assume this schedules like vmov.
[(set_attr "neon_type" "neon_bp_simple")]
)
-(define_insn "neon_vdup_lane<mode>"
- [(set (match_operand:VQ 0 "s_register_operand" "=w")
- (unspec:VQ [(match_operand:<V_HALF> 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VDUP_LANE))]
+(define_expand "neon_vdup_lane<mode>"
+ [(match_operand:VDQW 0 "s_register_operand" "=w")
+ (match_operand:<V_double_vector_mode> 1 "s_register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")]
"TARGET_NEON"
{
- neon_lane_bounds (operands[2], 0, GET_MODE_NUNITS (<V_HALF>mode));
- return "vdup.<V_sz_elem>\t%q0, %P1[%c2]";
-}
- ;; Assume this schedules like vmov.
- [(set_attr "neon_type" "neon_bp_simple")]
-)
+ neon_lane_bounds (operands[2], 0, GET_MODE_NUNITS (<V_double_vector_mode>mode));
+ if (BYTES_BIG_ENDIAN)
+ {
+ unsigned int elt = INTVAL (operands[2]);
+ unsigned int reg_nelts
+ = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<V_double_vector_mode>mode));
+ elt ^= reg_nelts - 1;
+ operands[2] = GEN_INT (elt);
+ }
+ emit_insn (gen_neon_vdup_lane<mode>_internal (operands[0], operands[1],
+ operands[2]));
+ DONE;
+})
; Scalar index is ignored, since only zero is valid here.
(define_expand "neon_vdup_lanedi"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (unspec:DI [(match_operand:DI 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VDUP_LANE))]
+ [(match_operand:DI 0 "s_register_operand" "=w")
+ (match_operand:DI 1 "s_register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")]
"TARGET_NEON"
{
neon_lane_bounds (operands[2], 0, 1);
@@ -2772,20 +2851,17 @@
DONE;
})
-; Likewise.
-(define_insn "neon_vdup_lanev2di"
- [(set (match_operand:V2DI 0 "s_register_operand" "=w")
- (unspec:V2DI [(match_operand:DI 1 "s_register_operand" "w")
- (match_operand:SI 2 "immediate_operand" "i")]
- UNSPEC_VDUP_LANE))]
+; Likewise for v2di, as the DImode second operand has only a single element.
+(define_expand "neon_vdup_lanev2di"
+ [(match_operand:V2DI 0 "s_register_operand" "=w")
+ (match_operand:DI 1 "s_register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")]
"TARGET_NEON"
{
neon_lane_bounds (operands[2], 0, 1);
- return "vmov\t%e0, %P1\;vmov\t%f0, %P1";
-}
- [(set_attr "length" "8")
- (set_attr "neon_type" "neon_bp_simple")]
-)
+ emit_insn (gen_neon_vdup_nv2di (operands[0], operands[1]));
+ DONE;
+})
;; In this insn, operand 1 should be low, and operand 2 the high part of the
;; dest vector.
@@ -2796,9 +2872,8 @@
(define_insn "neon_vcombine<mode>"
[(set (match_operand:<V_DOUBLE> 0 "s_register_operand" "=w")
- (unspec:<V_DOUBLE> [(match_operand:VDX 1 "s_register_operand" "w")
- (match_operand:VDX 2 "s_register_operand" "w")]
- UNSPEC_VCOMBINE))]
+ (vec_concat:<V_DOUBLE> (match_operand:VDX 1 "s_register_operand" "w")
+ (match_operand:VDX 2 "s_register_operand" "w")))]
"TARGET_NEON"
{
int dest = REGNO (operands[0]);
@@ -2838,10 +2913,31 @@
(set_attr "neon_type" "neon_bp_simple")]
)
-(define_insn "neon_vget_high<mode>"
- [(set (match_operand:<V_HALF> 0 "s_register_operand" "=w")
- (unspec:<V_HALF> [(match_operand:VQX 1 "s_register_operand" "w")]
- UNSPEC_VGET_HIGH))]
+(define_insn "neon_vget_highv16qi"
+ [(set (match_operand:V8QI 0 "s_register_operand" "=w")
+ (vec_select:V8QI (match_operand:V16QI 1 "s_register_operand" "w")
+ (parallel [(const_int 8) (const_int 9)
+ (const_int 10) (const_int 11)
+ (const_int 12) (const_int 13)
+ (const_int 14) (const_int 15)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src + 2)
+ return "vmov\t%P0, %f1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_highv8hi"
+ [(set (match_operand:V4HI 0 "s_register_operand" "=w")
+ (vec_select:V4HI (match_operand:V8HI 1 "s_register_operand" "w")
+ (parallel [(const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)])))]
"TARGET_NEON"
{
int dest = REGNO (operands[0]);
@@ -2855,10 +2951,133 @@
[(set_attr "neon_type" "neon_bp_simple")]
)
-(define_insn "neon_vget_low<mode>"
- [(set (match_operand:<V_HALF> 0 "s_register_operand" "=w")
- (unspec:<V_HALF> [(match_operand:VQX 1 "s_register_operand" "w")]
- UNSPEC_VGET_LOW))]
+(define_insn "neon_vget_highv4si"
+ [(set (match_operand:V2SI 0 "s_register_operand" "=w")
+ (vec_select:V2SI (match_operand:V4SI 1 "s_register_operand" "w")
+ (parallel [(const_int 2) (const_int 3)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src + 2)
+ return "vmov\t%P0, %f1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_highv4sf"
+ [(set (match_operand:V2SF 0 "s_register_operand" "=w")
+ (vec_select:V2SF (match_operand:V4SF 1 "s_register_operand" "w")
+ (parallel [(const_int 2) (const_int 3)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src + 2)
+ return "vmov\t%P0, %f1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_highv2di"
+ [(set (match_operand:DI 0 "s_register_operand" "=w")
+ (vec_select:DI (match_operand:V2DI 1 "s_register_operand" "w")
+ (parallel [(const_int 1)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src + 2)
+ return "vmov\t%P0, %f1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_lowv16qi"
+ [(set (match_operand:V8QI 0 "s_register_operand" "=w")
+ (vec_select:V8QI (match_operand:V16QI 1 "s_register_operand" "w")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)
+ (const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src)
+ return "vmov\t%P0, %e1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_lowv8hi"
+ [(set (match_operand:V4HI 0 "s_register_operand" "=w")
+ (vec_select:V4HI (match_operand:V8HI 1 "s_register_operand" "w")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src)
+ return "vmov\t%P0, %e1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_lowv4si"
+ [(set (match_operand:V2SI 0 "s_register_operand" "=w")
+ (vec_select:V2SI (match_operand:V4SI 1 "s_register_operand" "w")
+ (parallel [(const_int 0) (const_int 1)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src)
+ return "vmov\t%P0, %e1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_lowv4sf"
+ [(set (match_operand:V2SF 0 "s_register_operand" "=w")
+ (vec_select:V2SF (match_operand:V4SF 1 "s_register_operand" "w")
+ (parallel [(const_int 0) (const_int 1)])))]
+ "TARGET_NEON"
+{
+ int dest = REGNO (operands[0]);
+ int src = REGNO (operands[1]);
+
+ if (dest != src)
+ return "vmov\t%P0, %e1";
+ else
+ return "";
+}
+ [(set_attr "neon_type" "neon_bp_simple")]
+)
+
+(define_insn "neon_vget_lowv2di"
+ [(set (match_operand:DI 0 "s_register_operand" "=w")
+ (vec_select:DI (match_operand:V2DI 1 "s_register_operand" "w")
+ (parallel [(const_int 0)])))]
"TARGET_NEON"
{
int dest = REGNO (operands[0]);
diff --git a/gcc/config/arm/neon.ml b/gcc/config/arm/neon.ml
index f77f05cc825..b5b9cab7309 100644
--- a/gcc/config/arm/neon.ml
+++ b/gcc/config/arm/neon.ml
@@ -709,7 +709,8 @@ let pf_su_8_64 = P8 :: P16 :: F32 :: su_8_64
let ops =
[
(* Addition. *)
- Vadd, [], All (3, Dreg), "vadd", sign_invar_2, F32 :: su_8_64;
+ Vadd, [], All (3, Dreg), "vadd", sign_invar_2, F32 :: su_8_32;
+ Vadd, [No_op], All (3, Dreg), "vadd", sign_invar_2, [S64; U64];
Vadd, [], All (3, Qreg), "vaddQ", sign_invar_2, F32 :: su_8_64;
Vadd, [], Long, "vaddl", elts_same_2, su_8_32;
Vadd, [], Wide, "vaddw", elts_same_2, su_8_32;
@@ -758,7 +759,8 @@ let ops =
Vmls, [Saturating; Doubling], Long, "vqdmlsl", elts_same_io, [S16; S32];
(* Subtraction. *)
- Vsub, [], All (3, Dreg), "vsub", sign_invar_2, F32 :: su_8_64;
+ Vsub, [], All (3, Dreg), "vsub", sign_invar_2, F32 :: su_8_32;
+ Vsub, [No_op], All (3, Dreg), "vsub", sign_invar_2, [S64; U64];
Vsub, [], All (3, Qreg), "vsubQ", sign_invar_2, F32 :: su_8_64;
Vsub, [], Long, "vsubl", elts_same_2, su_8_32;
Vsub, [], Wide, "vsubw", elts_same_2, su_8_32;
@@ -967,7 +969,8 @@ let ops =
Use_operands [| Corereg; Dreg; Immed |],
"vget_lane", get_lane, pf_su_8_32;
Vget_lane,
- [InfoWord;
+ [No_op;
+ InfoWord;
Disassembles_as [Use_operands [| Corereg; Corereg; Dreg |]];
Instruction_name ["vmov"]; Const_valuator (fun _ -> 0)],
Use_operands [| Corereg; Dreg; Immed |],
@@ -989,7 +992,8 @@ let ops =
Instruction_name ["vmov"]],
Use_operands [| Dreg; Corereg; Dreg; Immed |], "vset_lane",
set_lane, pf_su_8_32;
- Vset_lane, [Disassembles_as [Use_operands [| Dreg; Corereg; Corereg |]];
+ Vset_lane, [No_op;
+ Disassembles_as [Use_operands [| Dreg; Corereg; Corereg |]];
Instruction_name ["vmov"]; Const_valuator (fun _ -> 0)],
Use_operands [| Dreg; Corereg; Dreg; Immed |], "vset_lane",
set_lane_notype, [S64; U64];
@@ -1017,7 +1021,8 @@ let ops =
Use_operands [| Dreg; Corereg |], "vdup_n", bits_1,
pf_su_8_32;
Vdup_n,
- [Instruction_name ["vmov"];
+ [No_op;
+ Instruction_name ["vmov"];
Disassembles_as [Use_operands [| Dreg; Corereg; Corereg |]]],
Use_operands [| Dreg; Corereg |], "vdup_n", notype_1,
[S64; U64];
@@ -1028,7 +1033,8 @@ let ops =
Use_operands [| Qreg; Corereg |], "vdupQ_n", bits_1,
pf_su_8_32;
Vdup_n,
- [Instruction_name ["vmov"];
+ [No_op;
+ Instruction_name ["vmov"];
Disassembles_as [Use_operands [| Dreg; Corereg; Corereg |];
Use_operands [| Dreg; Corereg; Corereg |]]],
Use_operands [| Qreg; Corereg |], "vdupQ_n", notype_1,
@@ -1043,7 +1049,8 @@ let ops =
Use_operands [| Dreg; Corereg |],
"vmov_n", bits_1, pf_su_8_32;
Vmov_n,
- [Builtin_name "vdup_n";
+ [No_op;
+ Builtin_name "vdup_n";
Instruction_name ["vmov"];
Disassembles_as [Use_operands [| Dreg; Corereg; Corereg |]]],
Use_operands [| Dreg; Corereg |],
@@ -1056,7 +1063,8 @@ let ops =
Use_operands [| Qreg; Corereg |],
"vmovQ_n", bits_1, pf_su_8_32;
Vmov_n,
- [Builtin_name "vdupQ_n";
+ [No_op;
+ Builtin_name "vdupQ_n";
Instruction_name ["vmov"];
Disassembles_as [Use_operands [| Dreg; Corereg; Corereg |];
Use_operands [| Dreg; Corereg; Corereg |]]],
@@ -1613,23 +1621,28 @@ let ops =
store_3, [P16; F32; U16; U32; S16; S32];
(* Logical operations. And. *)
- Vand, [], All (3, Dreg), "vand", notype_2, su_8_64;
+ Vand, [], All (3, Dreg), "vand", notype_2, su_8_32;
+ Vand, [No_op], All (3, Dreg), "vand", notype_2, [S64; U64];
Vand, [], All (3, Qreg), "vandQ", notype_2, su_8_64;
(* Or. *)
- Vorr, [], All (3, Dreg), "vorr", notype_2, su_8_64;
+ Vorr, [], All (3, Dreg), "vorr", notype_2, su_8_32;
+ Vorr, [No_op], All (3, Dreg), "vorr", notype_2, [S64; U64];
Vorr, [], All (3, Qreg), "vorrQ", notype_2, su_8_64;
(* Eor. *)
- Veor, [], All (3, Dreg), "veor", notype_2, su_8_64;
+ Veor, [], All (3, Dreg), "veor", notype_2, su_8_32;
+ Veor, [No_op], All (3, Dreg), "veor", notype_2, [S64; U64];
Veor, [], All (3, Qreg), "veorQ", notype_2, su_8_64;
(* Bic (And-not). *)
- Vbic, [], All (3, Dreg), "vbic", notype_2, su_8_64;
+ Vbic, [], All (3, Dreg), "vbic", notype_2, su_8_32;
+ Vbic, [No_op], All (3, Dreg), "vbic", notype_2, [S64; U64];
Vbic, [], All (3, Qreg), "vbicQ", notype_2, su_8_64;
(* Or-not. *)
- Vorn, [], All (3, Dreg), "vorn", notype_2, su_8_64;
+ Vorn, [], All (3, Dreg), "vorn", notype_2, su_8_32;
+ Vorn, [No_op], All (3, Dreg), "vorn", notype_2, [S64; U64];
Vorn, [], All (3, Qreg), "vornQ", notype_2, su_8_64;
]
diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c
index 365648c607c..5a3aa376afe 100644
--- a/gcc/config/arm/pe.c
+++ b/gcc/config/arm/pe.c
@@ -28,6 +28,7 @@
#include "flags.h"
#include "tree.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
index a60da9a3271..f53c54fa110 100644
--- a/gcc/config/arm/predicates.md
+++ b/gcc/config/arm/predicates.md
@@ -73,6 +73,21 @@
|| REGNO_REG_CLASS (REGNO (op)) == FPA_REGS));
})
+(define_predicate "vfp_register_operand"
+ (match_code "reg,subreg")
+{
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ /* We don't consider registers whose class is NO_REGS
+ to be a register operand. */
+ return (GET_CODE (op) == REG
+ && (REGNO (op) >= FIRST_PSEUDO_REGISTER
+ || REGNO_REG_CLASS (REGNO (op)) == VFP_LO_REGS
+ || (TARGET_VFPD32
+ && REGNO_REG_CLASS (REGNO (op)) == VFP_REGS)));
+})
+
(define_special_predicate "subreg_lowpart_operator"
(and (match_code "subreg")
(match_test "subreg_lowpart_p (op)")))
@@ -86,6 +101,12 @@
(and (match_code "const_int")
(match_test "const_ok_for_arm (INTVAL (op))")))
+;; A constant value which fits into two instructions, each taking
+;; an arithmetic constant operand for one of the words.
+(define_predicate "arm_immediate_di_operand"
+ (and (match_code "const_int,const_double")
+ (match_test "arm_const_double_by_immediates (op)")))
+
(define_predicate "arm_neg_immediate_operand"
(and (match_code "const_int")
(match_test "const_ok_for_arm (-INTVAL (op))")))
@@ -119,6 +140,10 @@
(ior (match_operand 0 "arm_rhs_operand")
(match_operand 0 "arm_not_immediate_operand")))
+(define_predicate "arm_di_operand"
+ (ior (match_operand 0 "s_register_operand")
+ (match_operand 0 "arm_immediate_di_operand")))
+
;; True if the operand is a memory reference which contains an
;; offsettable address.
(define_predicate "offsettable_memory_operand"
@@ -506,13 +531,15 @@
(define_predicate "imm_for_neon_logic_operand"
(match_code "const_vector")
{
- return neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL);
+ return (TARGET_NEON
+ && neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL));
})
(define_predicate "imm_for_neon_inv_logic_operand"
(match_code "const_vector")
{
- return neon_immediate_valid_for_logic (op, mode, 1, NULL, NULL);
+ return (TARGET_NEON
+ && neon_immediate_valid_for_logic (op, mode, 1, NULL, NULL));
})
(define_predicate "neon_logic_op2"
@@ -527,4 +554,12 @@
(define_predicate "neon_lane_number"
(and (match_code "const_int")
(match_test "INTVAL (op) >= 0 && INTVAL (op) <= 7")))
+;; Predicates for named expanders that overlap multiple ISAs.
+
+(define_predicate "cmpdi_operand"
+ (if_then_else (match_test "TARGET_HARD_FLOAT && TARGET_MAVERICK")
+ (and (match_test "TARGET_ARM")
+ (match_operand 0 "cirrus_fp_register"))
+ (and (match_test "TARGET_32BIT")
+ (match_operand 0 "arm_di_operand"))))
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 398518329e2..55bb41ff697 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -467,7 +467,7 @@
[(match_operator:SI 3 "shift_operator"
[(match_operand:SI 4 "s_register_operand" "r")
(match_operand:SI 5 "const_int_operand" "M")])
- (match_operand:SI 2 "s_register_operand" "r")]))]
+ (match_operand:SI 2 "s_register_operand" "rk")]))]
"TARGET_THUMB2"
"%i1%?\\t%0, %2, %4%S3"
[(set_attr "predicable" "yes")
@@ -599,42 +599,6 @@
(set_attr "length" "6,10")]
)
-(define_insn "*thumb2_compare_scc"
- [(set (match_operand:SI 0 "s_register_operand" "=r,r")
- (match_operator:SI 1 "arm_comparison_operator"
- [(match_operand:SI 2 "s_register_operand" "r,r")
- (match_operand:SI 3 "arm_add_operand" "rI,L")]))
- (clobber (reg:CC CC_REGNUM))]
- "TARGET_THUMB2"
- "*
- if (operands[3] == const0_rtx)
- {
- if (GET_CODE (operands[1]) == LT)
- return \"lsr\\t%0, %2, #31\";
-
- if (GET_CODE (operands[1]) == GE)
- return \"mvn\\t%0, %2\;lsr\\t%0, %0, #31\";
-
- if (GET_CODE (operands[1]) == EQ)
- return \"rsbs\\t%0, %2, #1\;it\\tcc\;movcc\\t%0, #0\";
- }
-
- if (GET_CODE (operands[1]) == NE)
- {
- if (which_alternative == 1)
- return \"adds\\t%0, %2, #%n3\;it\\tne\;movne\\t%0, #1\";
- return \"subs\\t%0, %2, %3\;it\\tne\;movne\\t%0, #1\";
- }
- if (which_alternative == 1)
- output_asm_insn (\"cmn\\t%2, #%n3\", operands);
- else
- output_asm_insn (\"cmp\\t%2, %3\", operands);
- return \"ite\\t%D1\;mov%D1\\t%0, #0\;mov%d1\\t%0, #1\";
- "
- [(set_attr "conds" "clob")
- (set_attr "length" "14")]
-)
-
(define_insn "*thumb2_cond_move"
[(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
(if_then_else:SI (match_operator 3 "equality_operator"
@@ -1537,3 +1501,28 @@
VOIDmode, operands[0], const0_rtx);
")
+(define_peephole2
+ [(set (match_operand:CC_NOOV 0 "cc_register" "")
+ (compare:CC_NOOV (zero_extract:SI
+ (match_operand:SI 1 "low_register_operand" "")
+ (match_operand:SI 2 "const_int_operand" "")
+ (const_int 0))
+ (const_int 0)))
+ (match_scratch:SI 3 "l")
+ (set (pc)
+ (if_then_else (match_operator:CC_NOOV 4 "equality_operator"
+ [(match_dup 0) (const_int 0)])
+ (match_operand 5 "" "")
+ (match_operand 6 "" "")))]
+ "TARGET_THUMB2
+ && (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32)"
+ [(parallel [(set (match_dup 0)
+ (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2))
+ (const_int 0)))
+ (clobber (match_dup 3))])
+ (set (pc)
+ (if_then_else (match_op_dup 4 [(match_dup 0) (const_int 0)])
+ (match_dup 5) (match_dup 6)))]
+ "
+ operands[2] = GEN_INT (32 - INTVAL (operands[2]));
+ ")
diff --git a/gcc/config/arm/vec-common.md b/gcc/config/arm/vec-common.md
index d33fdf99d70..b724a580cc3 100644
--- a/gcc/config/arm/vec-common.md
+++ b/gcc/config/arm/vec-common.md
@@ -57,7 +57,8 @@
[(set (match_operand:VALL 0 "s_register_operand" "")
(plus:VALL (match_operand:VALL 1 "s_register_operand" "")
(match_operand:VALL 2 "s_register_operand" "")))]
- "TARGET_NEON
+ "(TARGET_NEON && ((<MODE>mode != V2SFmode && <MODE>mode != V4SFmode)
+ || flag_unsafe_math_optimizations))
|| (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
{
})
@@ -66,7 +67,8 @@
[(set (match_operand:VALL 0 "s_register_operand" "")
(minus:VALL (match_operand:VALL 1 "s_register_operand" "")
(match_operand:VALL 2 "s_register_operand" "")))]
- "TARGET_NEON
+ "(TARGET_NEON && ((<MODE>mode != V2SFmode && <MODE>mode != V4SFmode)
+ || flag_unsafe_math_optimizations))
|| (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
{
})
@@ -75,7 +77,9 @@
[(set (match_operand:VALLW 0 "s_register_operand" "")
(mult:VALLW (match_operand:VALLW 1 "s_register_operand" "")
(match_operand:VALLW 2 "s_register_operand" "")))]
- "TARGET_NEON || (<MODE>mode == V4HImode && TARGET_REALLY_IWMMXT)"
+ "(TARGET_NEON && ((<MODE>mode != V2SFmode && <MODE>mode != V4SFmode)
+ || flag_unsafe_math_optimizations))
+ || (<MODE>mode == V4HImode && TARGET_REALLY_IWMMXT)"
{
})
@@ -83,7 +87,8 @@
[(set (match_operand:VALLW 0 "s_register_operand" "")
(smin:VALLW (match_operand:VALLW 1 "s_register_operand" "")
(match_operand:VALLW 2 "s_register_operand" "")))]
- "TARGET_NEON
+ "(TARGET_NEON && ((<MODE>mode != V2SFmode && <MODE>mode != V4SFmode)
+ || flag_unsafe_math_optimizations))
|| (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
{
})
@@ -101,7 +106,8 @@
[(set (match_operand:VALLW 0 "s_register_operand" "")
(smax:VALLW (match_operand:VALLW 1 "s_register_operand" "")
(match_operand:VALLW 2 "s_register_operand" "")))]
- "TARGET_NEON
+ "(TARGET_NEON && ((<MODE>mode != V2SFmode && <MODE>mode != V4SFmode)
+ || flag_unsafe_math_optimizations))
|| (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (<MODE>mode))"
{
})
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
index 02d527b79c5..26fd11826df 100644
--- a/gcc/config/arm/vfp.md
+++ b/gcc/config/arm/vfp.md
@@ -1132,7 +1132,7 @@
(define_insn "*push_multi_vfp"
[(match_parallel 2 "multi_register_push"
[(set (match_operand:BLK 0 "memory_operand" "=m")
- (unspec:BLK [(match_operand:DF 1 "s_register_operand" "w")]
+ (unspec:BLK [(match_operand:DF 1 "vfp_register_operand" "")]
UNSPEC_PUSH_MULT))])]
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"* return vfp_output_fstmd (operands);"
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 531a4128bf3..87393f2ae94 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -34,6 +34,7 @@
#include "tree.h"
#include "output.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "obstack.h"
#include "function.h"
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 1232ecc7378..23bd1796160 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -40,6 +40,7 @@
#include "target.h"
#include "target-def.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "optabs.h"
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 05736c76165..ce6b568df03 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "except.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "reload.h"
diff --git a/gcc/config/crx/crx.c b/gcc/config/crx/crx.c
index 3b5794242c5..e8b750c95a3 100644
--- a/gcc/config/crx/crx.c
+++ b/gcc/config/crx/crx.c
@@ -43,6 +43,7 @@
#include "recog.h"
#include "expr.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "basic-block.h"
#include "df.h"
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index 6221ab3be1b..141971195b2 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "incpath.h"
#include "c-family/c-common.h"
#include "c-family/c-pragma.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "flags.h"
#include "tm_p.h"
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 5801e431dfd..59c603fb4a2 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "target.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "hashtab.h"
#include "df.h"
@@ -78,6 +79,12 @@ along with GCC; see the file COPYING3. If not see
of MACHO_SYMBOL_STATIC for the code that handles @code{static}
symbol indirection. */
+/* For darwin >= 9 (OSX 10.5) the linker is capable of making the necessary
+ branch islands and we no longer need to emit darwin stubs.
+ However, if we are generating code for earlier systems (or for use in the
+ kernel) the stubs might still be required, and this will be set true. */
+int darwin_emit_branch_islands = false;
+
/* Section names. */
section * darwin_sections[NUM_DARWIN_SECTIONS];
@@ -98,6 +105,7 @@ output_objc_section_asm_op (const void *directive)
section is requested. */
if (! been_here)
{
+ section *saved_in_section = in_section;
static const enum darwin_section_enum tomark[] =
{
/* written, cold -> hot */
@@ -128,6 +136,7 @@ output_objc_section_asm_op (const void *directive)
been_here = true;
for (i = 0; i < ARRAY_SIZE (tomark); i++)
switch_to_section (darwin_sections[tomark[i]]);
+ switch_to_section (saved_in_section);
}
output_section_asm_op (directive);
}
@@ -622,6 +631,9 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
rtx
machopic_indirect_call_target (rtx target)
{
+ if (! darwin_emit_branch_islands)
+ return target;
+
if (GET_CODE (target) != MEM)
return target;
@@ -1885,12 +1897,19 @@ darwin_override_options (void)
flag_exceptions = 0;
/* No -fnon-call-exceptions data in kexts. */
flag_non_call_exceptions = 0;
+ /* We still need to emit branch islands for kernel context. */
+ darwin_emit_branch_islands = true;
}
if (flag_var_tracking
&& strverscmp (darwin_macosx_version_min, "10.5") >= 0
&& debug_info_level >= DINFO_LEVEL_NORMAL
&& debug_hooks->var_location != do_nothing_debug_hooks.var_location)
flag_var_tracking_uninit = 1;
+
+ /* It is assumed that branch island stubs are needed for earlier systems. */
+ if (darwin_macosx_version_min
+ && strverscmp (darwin_macosx_version_min, "10.5") < 0)
+ darwin_emit_branch_islands = true;
}
/* Add $LDBL128 suffix to long double builtins. */
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index a1e805c6d5b..066d0922d75 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -266,8 +266,9 @@ extern GTY(()) int darwin_ms_struct;
instead of LINK_COMMAND_SPEC. The command spec is better for
specifying the handling of options understood by generic Unix
linkers, and for positional arguments like libraries. */
-#define LINK_COMMAND_SPEC "\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+
+#define LINK_COMMAND_SPEC_A \
+ "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker) %l %X %{d} %{s} %{t} %{Z} %{u*} \
%{A} %{e*} %{m} %{r} %{x} \
%{o*}%{!o:-o a.out} \
@@ -277,10 +278,16 @@ extern GTY(()) int darwin_ms_struct;
%{fopenmp|ftree-parallelize-loops=*: \
%{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
%{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
- %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n"
+
+#define DSYMUTIL "dsymutil"
+
+#define DSYMUTIL_SPEC \
+ "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
- %{gdwarf-2:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+ %{gdwarf-2:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+
+#define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC
#ifdef TARGET_SYSTEM_ROOT
#define LINK_SYSROOT_SPEC \
@@ -471,6 +478,8 @@ extern GTY(()) int darwin_ms_struct;
#define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug"
#define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug"
+#define TARGET_WANT_DEBUG_PUB_SECTIONS true
+
/* When generating stabs debugging, use N_BINCL entries. */
#define DBX_USE_BINCL
@@ -649,7 +658,7 @@ extern GTY(()) int darwin_ms_struct;
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL)) \
(* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \
- ASM_OUTPUT_LABEL (FILE, xname); \
+ ASM_OUTPUT_FUNCTION_LABEL (FILE, xname, DECL); \
} while (0)
#undef TARGET_ASM_DECLARE_CONSTANT_NAME
diff --git a/gcc/config/darwin9.h b/gcc/config/darwin9.h
index 7a073742cb6..c9f33ea739b 100644
--- a/gcc/config/darwin9.h
+++ b/gcc/config/darwin9.h
@@ -24,29 +24,15 @@ along with GCC; see the file COPYING3. If not see
#define DARWIN_PREFER_DWARF
/* Since DWARF2 is default, conditions for running dsymutil are different. */
-#undef LINK_COMMAND_SPEC
-#define LINK_COMMAND_SPEC "\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
- %(linker) %l %X %{d} %{s} %{t} %{Z} \
- %{A} %{e*} %{m} %{r} %{x} \
- %{o*}%{!o:-o a.out} \
- %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
- %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
- %{flto} %{fwhopr} \
- %{fopenmp|ftree-parallelize-loops=*: \
- %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
- %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
- %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
- %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
- %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
+#undef DSYMUTIL_SPEC
+#define DSYMUTIL_SPEC \
+ "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+ %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s: \
+ %{g*:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
/* libSystem contains unwind information for signal frames. */
#define DARWIN_LIBSYSTEM_HAS_UNWIND
-/* The linker can generate branch islands. */
-#define DARWIN_LINKER_GENERATES_ISLANDS 1
-
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
do { \
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 3c84b858783..243d1e17635 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -286,7 +286,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
else \
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
- ASM_OUTPUT_LABEL (FILE, NAME); \
+ ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
} \
while (0)
#endif
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index c880f21546c..f417f91dfd2 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -39,6 +39,7 @@
#include "obstack.h"
#include "except.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "target.h"
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 9454bd25e7b..10768fb81c5 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "except.h"
#include "function.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "basic-block.h"
#include "tm_p.h"
@@ -1181,7 +1182,7 @@ frv_stack_info (void)
/* Find the last argument, and see if it is __builtin_va_alist. */
for (cur_arg = DECL_ARGUMENTS (fndecl); cur_arg != (tree)0; cur_arg = next_arg)
{
- next_arg = TREE_CHAIN (cur_arg);
+ next_arg = DECL_CHAIN (cur_arg);
if (next_arg == (tree)0)
{
if (DECL_NAME (cur_arg)
@@ -6510,8 +6511,9 @@ frv_secondary_reload (bool in_p, rtx x, reg_class_t reload_class_i,
if (rclass != NO_REGS)
{
- enum insn_code icode = (in_p ? reload_in_optab[(int) reload_mode]
- : reload_out_optab[(int) reload_mode]);
+ enum insn_code icode
+ = direct_optab_handler (in_p ? reload_in_optab : reload_out_optab,
+ reload_mode);
if (icode == 0)
{
/* This happens when then the reload_[in|out]_optabs have
@@ -6632,7 +6634,7 @@ frv_adjust_field_align (tree field, int computed)
tree prev = NULL_TREE;
tree cur;
- for (cur = TYPE_FIELDS (parent); cur && cur != field; cur = TREE_CHAIN (cur))
+ for (cur = TYPE_FIELDS (parent); cur && cur != field; cur = DECL_CHAIN (cur))
{
if (TREE_CODE (cur) != FIELD_DECL)
continue;
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 5773fb15b51..bba5e793f93 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "function.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "c-family/c-pragma.h" /* ??? */
#include "tm_p.h"
@@ -402,6 +403,10 @@ h8300_init_once (void)
restore er6 though, so bump up the cost. */
h8300_move_ratio = 6;
}
+
+ /* This target defaults to strict volatile bitfields. */
+ if (flag_strict_volatile_bitfields < 0)
+ flag_strict_volatile_bitfields = 1;
}
/* Implement REG_CLASS_FROM_LETTER.
diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c
index 3f1c449c0c5..6c94140a891 100644
--- a/gcc/config/host-darwin.c
+++ b/gcc/config/host-darwin.c
@@ -21,6 +21,7 @@
#include "system.h"
#include "coretypes.h"
#include <sys/mman.h>
+#include "diagnostic-core.h"
#include "toplev.h"
#include "config/host-darwin.h"
diff --git a/gcc/config/host-solaris.c b/gcc/config/host-solaris.c
index 1d51a8d2127..835832b9c21 100644
--- a/gcc/config/host-solaris.c
+++ b/gcc/config/host-solaris.c
@@ -30,6 +30,41 @@
#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
#define HOST_HOOKS_GT_PCH_USE_ADDRESS sol_gt_pch_use_address
+/* Before Solaris 11, the mmap ADDR parameter is mostly ignored without
+ MAP_FIXED set. Before we give up, search the desired address space with
+ mincore to see if the space is really free. */
+
+static void *
+mmap_fixed (void *addr, size_t len, int prot, int flags, int fd, off_t off)
+{
+ void *base;
+
+ base = mmap ((caddr_t) addr, len, prot, flags, fd, off);
+
+ if (base != addr)
+ {
+ size_t page_size = getpagesize();
+ char one_byte;
+ size_t i;
+
+ if (base != (void *) MAP_FAILED)
+ munmap ((caddr_t) base, len);
+
+ errno = 0;
+ for (i = 0; i < len; i += page_size)
+ if (mincore ((char *)addr + i, page_size, (char *) &one_byte) == -1
+ && errno == ENOMEM)
+ continue; /* The page is not mapped. */
+ else
+ break;
+
+ if (i >= len)
+ base = mmap ((caddr_t) addr, len, prot, flags | MAP_FIXED, fd, off);
+ }
+
+ return base;
+}
+
/* For various ports, try to guess a fixed spot in the vm space
that's probably free. Based on McDougall, Mauro, Solaris Internals, 2nd
ed., p.460-461, fig. 9-3, 9-4, 9-5. */
@@ -55,8 +90,8 @@ sol_gt_pch_get_address (size_t size, int fd)
{
void *addr;
- addr = mmap ((caddr_t) TRY_EMPTY_VM_SPACE, size, PROT_READ | PROT_WRITE,
- MAP_PRIVATE, fd, 0);
+ addr = mmap_fixed ((caddr_t) TRY_EMPTY_VM_SPACE, size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
/* If we failed the map, that means there's *no* free space. */
if (addr == (void *) MAP_FAILED)
@@ -81,34 +116,8 @@ sol_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
if (size == 0)
return -1;
- addr = mmap ((caddr_t) base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
- fd, offset);
-
- /* Solaris isn't good about honoring the mmap START parameter
- without MAP_FIXED set. Before we give up, search the desired
- address space with mincore to see if the space is really free. */
- if (addr != base)
- {
- size_t page_size = getpagesize();
- char one_byte;
- size_t i;
-
- if (addr != (void *) MAP_FAILED)
- munmap ((caddr_t) addr, size);
-
- errno = 0;
- for (i = 0; i < size; i += page_size)
- if (mincore ((char *)base + i, page_size, (char *) &one_byte) == -1
- && errno == ENOMEM)
- continue; /* The page is not mapped. */
- else
- break;
-
- if (i >= size)
- addr = mmap ((caddr_t) base, size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
- fd, offset);
- }
+ addr = mmap_fixed ((caddr_t) base, size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset);
return addr == base ? 1 : -1;
}
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index a9d90a68412..11c2f1e2662 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -35,6 +35,8 @@
#define bit_XSAVE (1 << 26)
#define bit_OSXSAVE (1 << 27)
#define bit_AVX (1 << 28)
+#define bit_F16C (1 << 29)
+#define bit_RDRND (1 << 30)
/* %edx */
#define bit_CMPXCHG8B (1 << 8)
@@ -58,6 +60,8 @@
#define bit_3DNOWP (1 << 30)
#define bit_3DNOW (1 << 31)
+/* Extended Features (%eax == 7) */
+#define bit_FSGSBASE (1 << 0)
#if defined(__i386__) && defined(__PIC__)
/* %ebx may be the PIC register. */
diff --git a/gcc/config/i386/cygming-crtbegin.c b/gcc/config/i386/cygming-crtbegin.c
index 367a4bbff51..73043ad0dcd 100644
--- a/gcc/config/i386/cygming-crtbegin.c
+++ b/gcc/config/i386/cygming-crtbegin.c
@@ -64,7 +64,7 @@ extern void _Jv_RegisterClasses (const void *) TARGET_ATTRIBUTE_WEAK;
register/deregister it with the exception handling library code. */
#if DWARF2_UNWIND_INFO
static EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
- __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
+ __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4)))
= { };
static struct object obj;
@@ -72,7 +72,7 @@ static struct object obj;
#if TARGET_USE_JCR_SECTION
static void *__JCR_LIST__[]
- __attribute__ ((unused, section(JCR_SECTION_NAME), aligned(4)))
+ __attribute__ ((used, section(JCR_SECTION_NAME), aligned(4)))
= { };
#endif
diff --git a/gcc/config/i386/cygming-crtend.c b/gcc/config/i386/cygming-crtend.c
index 8c853bfa732..068f4b63613 100644
--- a/gcc/config/i386/cygming-crtend.c
+++ b/gcc/config/i386/cygming-crtend.c
@@ -47,7 +47,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
this would be the 'length' field in a real FDE. */
static EH_FRAME_SECTION_CONST int __FRAME_END__[]
- __attribute__ ((unused, section(EH_FRAME_SECTION_NAME),
+ __attribute__ ((used, section(EH_FRAME_SECTION_NAME),
aligned(4)))
= { 0 };
#endif
@@ -55,7 +55,7 @@ static EH_FRAME_SECTION_CONST int __FRAME_END__[]
#if TARGET_USE_JCR_SECTION
/* Null terminate the .jcr section array. */
static void *__JCR_END__[1]
- __attribute__ ((unused, section(JCR_SECTION_NAME),
+ __attribute__ ((used, section(JCR_SECTION_NAME),
aligned(sizeof(void *))))
= { 0 };
#endif
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index f2b70afa447..1587af472cc 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -276,7 +276,7 @@ do { \
i386_pe_maybe_record_exported_symbol (DECL, NAME, 0); \
if (write_symbols != SDB_DEBUG) \
i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \
- ASM_OUTPUT_LABEL (FILE, NAME); \
+ ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
} \
while (0)
@@ -429,6 +429,9 @@ do { \
#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition
#define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
#undef TREE
#ifndef BUFSIZ
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index c365f6603cd..8a637e80ae5 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -301,5 +301,5 @@ while (0)
#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"
+#define LIBGCJ_SONAME "cyggcj" /*LIBGCC_EH_EXTN*/ "-12.dll"
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index d26ef2d422d..7917f2fc18f 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -60,6 +60,12 @@ along with GCC; see the file COPYING3. If not see
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
+/* Generate branch islands stubs if this is true. */
+extern int darwin_emit_branch_islands;
+
+#undef TARGET_MACHO_BRANCH_ISLANDS
+#define TARGET_MACHO_BRANCH_ISLANDS darwin_emit_branch_islands
+
#undef MAX_BITS_PER_WORD
#define MAX_BITS_PER_WORD 64
@@ -225,7 +231,7 @@ along with GCC; see the file COPYING3. If not see
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
- if (MACHOPIC_INDIRECT && !TARGET_64BIT) \
+ if (TARGET_MACHO_BRANCH_ISLANDS && MACHOPIC_INDIRECT && !TARGET_64BIT) \
{ \
const char *name = machopic_mcount_stub_name (); \
fprintf (FILE, "\tcall %s\n", name+1); /* skip '&' */ \
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
index 69f5e0f304c..c616a205d2c 100644
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -138,3 +138,6 @@ along with GCC; see the file COPYING3. If not see
compiler get the contents of <float.h> and std::numeric_limits correct. */
#undef TARGET_96_ROUND_53_LONG_DOUBLE
#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
+
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def
index 10310e233cb..09dd9ebca11 100644
--- a/gcc/config/i386/i386-builtin-types.def
+++ b/gcc/config/i386/i386-builtin-types.def
@@ -128,6 +128,7 @@ DEF_POINTER_TYPE (PCV8SF, V8SF, CONST)
DEF_FUNCTION_TYPE (FLOAT128)
DEF_FUNCTION_TYPE (UINT64)
DEF_FUNCTION_TYPE (UNSIGNED)
+DEF_FUNCTION_TYPE (UINT16)
DEF_FUNCTION_TYPE (VOID)
DEF_FUNCTION_TYPE (PVOID)
@@ -179,6 +180,7 @@ DEF_FUNCTION_TYPE (V4SF, V4DF)
DEF_FUNCTION_TYPE (V4SF, V4SF)
DEF_FUNCTION_TYPE (V4SF, V4SI)
DEF_FUNCTION_TYPE (V4SF, V8SF)
+DEF_FUNCTION_TYPE (V4SF, V8HI)
DEF_FUNCTION_TYPE (V4SI, V16QI)
DEF_FUNCTION_TYPE (V4SI, V2DF)
DEF_FUNCTION_TYPE (V4SI, V4DF)
@@ -194,10 +196,12 @@ DEF_FUNCTION_TYPE (V8SF, PCV4SF)
DEF_FUNCTION_TYPE (V8SF, V4SF)
DEF_FUNCTION_TYPE (V8SF, V8SF)
DEF_FUNCTION_TYPE (V8SF, V8SI)
+DEF_FUNCTION_TYPE (V8SF, V8HI)
DEF_FUNCTION_TYPE (V8SI, V4SI)
DEF_FUNCTION_TYPE (V8SI, V8SF)
DEF_FUNCTION_TYPE (VOID, PCVOID)
DEF_FUNCTION_TYPE (VOID, PVOID)
+DEF_FUNCTION_TYPE (VOID, UINT64)
DEF_FUNCTION_TYPE (VOID, UNSIGNED)
DEF_FUNCTION_TYPE (DI, V2DI, INT)
@@ -282,6 +286,8 @@ DEF_FUNCTION_TYPE (V8HI, V4SI, V4SI)
DEF_FUNCTION_TYPE (V8HI, V8HI, INT)
DEF_FUNCTION_TYPE (V8HI, V8HI, SI)
DEF_FUNCTION_TYPE (V8HI, V8HI, V8HI)
+DEF_FUNCTION_TYPE (V8HI, V8SF, INT)
+DEF_FUNCTION_TYPE (V8HI, V4SF, INT)
DEF_FUNCTION_TYPE (V8QI, V4HI, V4HI)
DEF_FUNCTION_TYPE (V8QI, V8QI, V8QI)
DEF_FUNCTION_TYPE (V8SF, PCV8SF, V8SF)
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index 1b89a0b428f..c03c8515bc3 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -246,6 +246,12 @@ ix86_target_macros_internal (int isa_flag,
def_or_undef (parse_in, "__ABM__");
if (isa_flag & OPTION_MASK_ISA_POPCNT)
def_or_undef (parse_in, "__POPCNT__");
+ if (isa_flag & OPTION_MASK_ISA_FSGSBASE)
+ def_or_undef (parse_in, "__FSGSBASE__");
+ if (isa_flag & OPTION_MASK_ISA_RDRND)
+ def_or_undef (parse_in, "__RDRND__");
+ if (isa_flag & OPTION_MASK_ISA_F16C)
+ def_or_undef (parse_in, "__F16C__");
if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE))
def_or_undef (parse_in, "__SSE_MATH__");
if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2))
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 4a0e3062212..23938b882c6 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -24,6 +24,7 @@ extern void override_options (bool);
extern void optimization_options (int, int);
extern void ix86_conditional_register_usage (void);
+extern bool ix86_target_stack_probe (void);
extern int ix86_can_use_return_insn_p (void);
extern void ix86_setup_frame_addresses (void);
@@ -71,6 +72,8 @@ extern const char *output_387_binary_op (rtx, rtx*);
extern const char *output_387_reg_move (rtx, rtx*);
extern const char *output_fix_trunc (rtx, rtx*, int);
extern const char *output_fp_compare (rtx, rtx*, int, int);
+extern const char *output_adjust_stack_and_probe (rtx);
+extern const char *output_probe_stack_range (rtx, rtx);
extern void ix86_expand_clear (rtx);
extern void ix86_expand_move (enum machine_mode, rtx[]);
@@ -136,8 +139,9 @@ extern enum machine_mode ix86_fp_compare_mode (enum rtx_code);
extern rtx ix86_libcall_value (enum machine_mode);
extern bool ix86_function_arg_regno_p (int);
-extern int ix86_function_arg_boundary (enum machine_mode, tree);
-extern bool ix86_sol10_return_in_memory (const_tree,const_tree);
+extern void ix86_asm_output_function_label (FILE *, const char *, tree);
+extern int ix86_function_arg_boundary (enum machine_mode, const_tree);
+extern bool ix86_solaris_return_in_memory (const_tree, const_tree);
extern rtx ix86_force_to_memory (enum machine_mode, rtx);
extern void ix86_free_from_memory (enum machine_mode);
extern enum calling_abi ix86_cfun_abi (void);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4f5afbec0a1..596a6db22ad 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "expr.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "basic-block.h"
#include "ggc.h"
@@ -82,21 +83,21 @@ struct processor_costs ix86_size_cost = {/* costs for tuning for size */
COSTS_N_BYTES (2), /* variable shift costs */
COSTS_N_BYTES (3), /* constant shift costs */
{COSTS_N_BYTES (3), /* cost of starting multiply for QI */
- COSTS_N_BYTES (3), /* HI */
- COSTS_N_BYTES (3), /* SI */
- COSTS_N_BYTES (3), /* DI */
- COSTS_N_BYTES (5)}, /* other */
+ COSTS_N_BYTES (3), /* HI */
+ COSTS_N_BYTES (3), /* SI */
+ COSTS_N_BYTES (3), /* DI */
+ COSTS_N_BYTES (5)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_BYTES (3), /* cost of a divide/mod for QI */
- COSTS_N_BYTES (3), /* HI */
- COSTS_N_BYTES (3), /* SI */
- COSTS_N_BYTES (3), /* DI */
- COSTS_N_BYTES (5)}, /* other */
+ COSTS_N_BYTES (3), /* HI */
+ COSTS_N_BYTES (3), /* SI */
+ COSTS_N_BYTES (3), /* DI */
+ COSTS_N_BYTES (5)}, /* other */
COSTS_N_BYTES (3), /* cost of movsx */
COSTS_N_BYTES (3), /* cost of movzx */
0, /* "large" insn */
2, /* MOVE_RATIO */
- 2, /* cost for loading QImode using movzbl */
+ 2, /* cost for loading QImode using movzbl */
{2, 2, 2}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -132,17 +133,17 @@ struct processor_costs ix86_size_cost = {/* costs for tuning for size */
{rep_prefix_1_byte, {{-1, rep_prefix_1_byte}}}},
{{rep_prefix_1_byte, {{-1, rep_prefix_1_byte}}},
{rep_prefix_1_byte, {{-1, rep_prefix_1_byte}}}},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 1, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 1, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 1, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 1, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
/* Processor costs (relative to an add) */
@@ -153,21 +154,21 @@ struct processor_costs i386_cost = { /* 386 specific costs */
COSTS_N_INSNS (3), /* variable shift costs */
COSTS_N_INSNS (2), /* constant shift costs */
{COSTS_N_INSNS (6), /* cost of starting multiply for QI */
- COSTS_N_INSNS (6), /* HI */
- COSTS_N_INSNS (6), /* SI */
- COSTS_N_INSNS (6), /* DI */
- COSTS_N_INSNS (6)}, /* other */
+ COSTS_N_INSNS (6), /* HI */
+ COSTS_N_INSNS (6), /* SI */
+ COSTS_N_INSNS (6), /* DI */
+ COSTS_N_INSNS (6)}, /* other */
COSTS_N_INSNS (1), /* cost of multiply per each bit set */
{COSTS_N_INSNS (23), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (23), /* HI */
- COSTS_N_INSNS (23), /* SI */
- COSTS_N_INSNS (23), /* DI */
- COSTS_N_INSNS (23)}, /* other */
+ COSTS_N_INSNS (23), /* HI */
+ COSTS_N_INSNS (23), /* SI */
+ COSTS_N_INSNS (23), /* DI */
+ COSTS_N_INSNS (23)}, /* other */
COSTS_N_INSNS (3), /* cost of movsx */
COSTS_N_INSNS (2), /* cost of movzx */
15, /* "large" insn */
3, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{2, 4, 2}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -203,17 +204,17 @@ struct processor_costs i386_cost = { /* 386 specific costs */
DUMMY_STRINGOP_ALGS},
{{rep_prefix_1_byte, {{-1, rep_prefix_1_byte}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -223,21 +224,21 @@ struct processor_costs i486_cost = { /* 486 specific costs */
COSTS_N_INSNS (3), /* variable shift costs */
COSTS_N_INSNS (2), /* constant shift costs */
{COSTS_N_INSNS (12), /* cost of starting multiply for QI */
- COSTS_N_INSNS (12), /* HI */
- COSTS_N_INSNS (12), /* SI */
- COSTS_N_INSNS (12), /* DI */
- COSTS_N_INSNS (12)}, /* other */
+ COSTS_N_INSNS (12), /* HI */
+ COSTS_N_INSNS (12), /* SI */
+ COSTS_N_INSNS (12), /* DI */
+ COSTS_N_INSNS (12)}, /* other */
1, /* cost of multiply per each bit set */
{COSTS_N_INSNS (40), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (40), /* HI */
- COSTS_N_INSNS (40), /* SI */
- COSTS_N_INSNS (40), /* DI */
- COSTS_N_INSNS (40)}, /* other */
+ COSTS_N_INSNS (40), /* HI */
+ COSTS_N_INSNS (40), /* SI */
+ COSTS_N_INSNS (40), /* DI */
+ COSTS_N_INSNS (40)}, /* other */
COSTS_N_INSNS (3), /* cost of movsx */
COSTS_N_INSNS (2), /* cost of movzx */
15, /* "large" insn */
3, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{2, 4, 2}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -275,17 +276,17 @@ struct processor_costs i486_cost = { /* 486 specific costs */
DUMMY_STRINGOP_ALGS},
{{rep_prefix_4_byte, {{-1, rep_prefix_4_byte}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -295,21 +296,21 @@ struct processor_costs pentium_cost = {
COSTS_N_INSNS (4), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (11), /* cost of starting multiply for QI */
- COSTS_N_INSNS (11), /* HI */
- COSTS_N_INSNS (11), /* SI */
- COSTS_N_INSNS (11), /* DI */
- COSTS_N_INSNS (11)}, /* other */
+ COSTS_N_INSNS (11), /* HI */
+ COSTS_N_INSNS (11), /* SI */
+ COSTS_N_INSNS (11), /* DI */
+ COSTS_N_INSNS (11)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (25), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (25), /* HI */
- COSTS_N_INSNS (25), /* SI */
- COSTS_N_INSNS (25), /* DI */
- COSTS_N_INSNS (25)}, /* other */
+ COSTS_N_INSNS (25), /* HI */
+ COSTS_N_INSNS (25), /* SI */
+ COSTS_N_INSNS (25), /* DI */
+ COSTS_N_INSNS (25)}, /* other */
COSTS_N_INSNS (3), /* cost of movsx */
COSTS_N_INSNS (2), /* cost of movzx */
8, /* "large" insn */
6, /* MOVE_RATIO */
- 6, /* cost for loading QImode using movzbl */
+ 6, /* cost for loading QImode using movzbl */
{2, 4, 2}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -345,17 +346,17 @@ struct processor_costs pentium_cost = {
DUMMY_STRINGOP_ALGS},
{{libcall, {{-1, rep_prefix_4_byte}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -365,21 +366,21 @@ struct processor_costs pentiumpro_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (4), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (4), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (4)}, /* other */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (4), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (4)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (17), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (17), /* HI */
- COSTS_N_INSNS (17), /* SI */
- COSTS_N_INSNS (17), /* DI */
- COSTS_N_INSNS (17)}, /* other */
+ COSTS_N_INSNS (17), /* HI */
+ COSTS_N_INSNS (17), /* SI */
+ COSTS_N_INSNS (17), /* DI */
+ COSTS_N_INSNS (17)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
6, /* MOVE_RATIO */
- 2, /* cost for loading QImode using movzbl */
+ 2, /* cost for loading QImode using movzbl */
{4, 4, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -411,28 +412,28 @@ struct processor_costs pentiumpro_cost = {
COSTS_N_INSNS (2), /* cost of FABS instruction. */
COSTS_N_INSNS (2), /* cost of FCHS instruction. */
COSTS_N_INSNS (56), /* cost of FSQRT instruction. */
- /* PentiumPro has optimized rep instructions for blocks aligned by 8 bytes (we ensure
- the alignment). For small blocks inline loop is still a noticeable win, for bigger
- blocks either rep movsl or rep movsb is way to go. Rep movsb has apparently
- more expensive startup time in CPU, but after 4K the difference is down in the noise.
- */
+ /* PentiumPro has optimized rep instructions for blocks aligned by 8 bytes
+ (we ensure the alignment). For small blocks inline loop is still a
+ noticeable win, for bigger blocks either rep movsl or rep movsb is
+ way to go. Rep movsb has apparently more expensive startup time in CPU,
+ but after 4K the difference is down in the noise. */
{{rep_prefix_4_byte, {{128, loop}, {1024, unrolled_loop},
{8192, rep_prefix_4_byte}, {-1, rep_prefix_1_byte}}},
DUMMY_STRINGOP_ALGS},
{{rep_prefix_4_byte, {{1024, unrolled_loop},
- {8192, rep_prefix_4_byte}, {-1, libcall}}},
+ {8192, rep_prefix_4_byte}, {-1, libcall}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -442,21 +443,21 @@ struct processor_costs geode_cost = {
COSTS_N_INSNS (2), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (7), /* SI */
- COSTS_N_INSNS (7), /* DI */
- COSTS_N_INSNS (7)}, /* other */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (7), /* SI */
+ COSTS_N_INSNS (7), /* DI */
+ COSTS_N_INSNS (7)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (15), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (23), /* HI */
- COSTS_N_INSNS (39), /* SI */
- COSTS_N_INSNS (39), /* DI */
- COSTS_N_INSNS (39)}, /* other */
+ COSTS_N_INSNS (23), /* HI */
+ COSTS_N_INSNS (39), /* SI */
+ COSTS_N_INSNS (39), /* DI */
+ COSTS_N_INSNS (39)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
4, /* MOVE_RATIO */
- 1, /* cost for loading QImode using movzbl */
+ 1, /* cost for loading QImode using movzbl */
{1, 1, 1}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -493,17 +494,17 @@ struct processor_costs geode_cost = {
DUMMY_STRINGOP_ALGS},
{{libcall, {{256, rep_prefix_4_byte}, {-1, libcall}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -513,21 +514,21 @@ struct processor_costs k6_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (3), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (3), /* DI */
- COSTS_N_INSNS (3)}, /* other */
+ COSTS_N_INSNS (3), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (3), /* DI */
+ COSTS_N_INSNS (3)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (18), /* HI */
- COSTS_N_INSNS (18), /* SI */
- COSTS_N_INSNS (18), /* DI */
- COSTS_N_INSNS (18)}, /* other */
+ COSTS_N_INSNS (18), /* HI */
+ COSTS_N_INSNS (18), /* SI */
+ COSTS_N_INSNS (18), /* DI */
+ COSTS_N_INSNS (18)}, /* other */
COSTS_N_INSNS (2), /* cost of movsx */
COSTS_N_INSNS (2), /* cost of movzx */
8, /* "large" insn */
4, /* MOVE_RATIO */
- 3, /* cost for loading QImode using movzbl */
+ 3, /* cost for loading QImode using movzbl */
{4, 5, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -566,17 +567,17 @@ struct processor_costs k6_cost = {
DUMMY_STRINGOP_ALGS},
{{libcall, {{256, rep_prefix_4_byte}, {-1, libcall}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -586,21 +587,21 @@ struct processor_costs athlon_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (5), /* cost of starting multiply for QI */
- COSTS_N_INSNS (5), /* HI */
- COSTS_N_INSNS (5), /* SI */
- COSTS_N_INSNS (5), /* DI */
- COSTS_N_INSNS (5)}, /* other */
+ COSTS_N_INSNS (5), /* HI */
+ COSTS_N_INSNS (5), /* SI */
+ COSTS_N_INSNS (5), /* DI */
+ COSTS_N_INSNS (5)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (26), /* HI */
- COSTS_N_INSNS (42), /* SI */
- COSTS_N_INSNS (74), /* DI */
- COSTS_N_INSNS (74)}, /* other */
+ COSTS_N_INSNS (26), /* HI */
+ COSTS_N_INSNS (42), /* SI */
+ COSTS_N_INSNS (74), /* DI */
+ COSTS_N_INSNS (74)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
9, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{3, 4, 3}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -639,17 +640,17 @@ struct processor_costs athlon_cost = {
DUMMY_STRINGOP_ALGS},
{{libcall, {{2048, rep_prefix_4_byte}, {-1, libcall}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -659,21 +660,21 @@ struct processor_costs k8_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (5)}, /* other */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (5)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (26), /* HI */
- COSTS_N_INSNS (42), /* SI */
- COSTS_N_INSNS (74), /* DI */
- COSTS_N_INSNS (74)}, /* other */
+ COSTS_N_INSNS (26), /* HI */
+ COSTS_N_INSNS (42), /* SI */
+ COSTS_N_INSNS (74), /* DI */
+ COSTS_N_INSNS (74)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
9, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{3, 4, 3}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -710,48 +711,48 @@ struct processor_costs k8_cost = {
COSTS_N_INSNS (2), /* cost of FABS instruction. */
COSTS_N_INSNS (2), /* cost of FCHS instruction. */
COSTS_N_INSNS (35), /* cost of FSQRT instruction. */
- /* K8 has optimized REP instruction for medium sized blocks, but for very small
- blocks it is better to use loop. For large blocks, libcall can do
- nontemporary accesses and beat inline considerably. */
+ /* K8 has optimized REP instruction for medium sized blocks, but for very
+ small blocks it is better to use loop. For large blocks, libcall can
+ do nontemporary accesses and beat inline considerably. */
{{libcall, {{6, loop}, {14, unrolled_loop}, {-1, rep_prefix_4_byte}}},
{libcall, {{16, loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
{{libcall, {{8, loop}, {24, unrolled_loop},
{2048, rep_prefix_4_byte}, {-1, libcall}}},
{libcall, {{48, unrolled_loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 4, /* scalar_stmt_cost. */
- 2, /* scalar load_cost. */
- 2, /* scalar_store_cost. */
- 5, /* vec_stmt_cost. */
- 0, /* vec_to_scalar_cost. */
- 2, /* scalar_to_vec_cost. */
- 2, /* vec_align_load_cost. */
- 3, /* vec_unalign_load_cost. */
- 3, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 2, /* cond_not_taken_branch_cost. */
+ 4, /* scalar_stmt_cost. */
+ 2, /* scalar load_cost. */
+ 2, /* scalar_store_cost. */
+ 5, /* vec_stmt_cost. */
+ 0, /* vec_to_scalar_cost. */
+ 2, /* scalar_to_vec_cost. */
+ 2, /* vec_align_load_cost. */
+ 3, /* vec_unalign_load_cost. */
+ 3, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 2, /* cond_not_taken_branch_cost. */
};
struct processor_costs amdfam10_cost = {
- COSTS_N_INSNS (1), /* cost of an add instruction */
- COSTS_N_INSNS (2), /* cost of a lea instruction */
- COSTS_N_INSNS (1), /* variable shift costs */
- COSTS_N_INSNS (1), /* constant shift costs */
- {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (5)}, /* other */
- 0, /* cost of multiply per each bit set */
- {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (35), /* HI */
- COSTS_N_INSNS (51), /* SI */
- COSTS_N_INSNS (83), /* DI */
- COSTS_N_INSNS (83)}, /* other */
+ COSTS_N_INSNS (1), /* cost of an add instruction */
+ COSTS_N_INSNS (2), /* cost of a lea instruction */
+ COSTS_N_INSNS (1), /* variable shift costs */
+ COSTS_N_INSNS (1), /* constant shift costs */
+ {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (5)}, /* other */
+ 0, /* cost of multiply per each bit set */
+ {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */
+ COSTS_N_INSNS (35), /* HI */
+ COSTS_N_INSNS (51), /* SI */
+ COSTS_N_INSNS (83), /* DI */
+ COSTS_N_INSNS (83)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
9, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{3, 4, 3}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -772,14 +773,14 @@ struct processor_costs amdfam10_cost = {
{4, 4, 5}, /* cost of storing SSE registers
in SImode, DImode and TImode */
3, /* MMX or SSE register to integer */
- /* On K8
- MOVD reg64, xmmreg Double FSTORE 4
- MOVD reg32, xmmreg Double FSTORE 4
- On AMDFAM10
- MOVD reg64, xmmreg Double FADD 3
- 1/1 1/1
- MOVD reg32, xmmreg Double FADD 3
- 1/1 1/1 */
+ /* On K8:
+ MOVD reg64, xmmreg Double FSTORE 4
+ MOVD reg32, xmmreg Double FSTORE 4
+ On AMDFAM10:
+ MOVD reg64, xmmreg Double FADD 3
+ 1/1 1/1
+ MOVD reg32, xmmreg Double FADD 3
+ 1/1 1/1 */
64, /* size of l1 cache. */
512, /* size of l2 cache. */
64, /* size of prefetch block */
@@ -805,40 +806,40 @@ struct processor_costs amdfam10_cost = {
{{libcall, {{8, loop}, {24, unrolled_loop},
{2048, rep_prefix_4_byte}, {-1, libcall}}},
{libcall, {{48, unrolled_loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 4, /* scalar_stmt_cost. */
- 2, /* scalar load_cost. */
- 2, /* scalar_store_cost. */
- 6, /* vec_stmt_cost. */
- 0, /* vec_to_scalar_cost. */
- 2, /* scalar_to_vec_cost. */
- 2, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 2, /* vec_store_cost. */
- 2, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 4, /* scalar_stmt_cost. */
+ 2, /* scalar load_cost. */
+ 2, /* scalar_store_cost. */
+ 6, /* vec_stmt_cost. */
+ 0, /* vec_to_scalar_cost. */
+ 2, /* scalar_to_vec_cost. */
+ 2, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 2, /* vec_store_cost. */
+ 2, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
struct processor_costs bdver1_cost = {
- COSTS_N_INSNS (1), /* cost of an add instruction */
- COSTS_N_INSNS (2), /* cost of a lea instruction */
- COSTS_N_INSNS (1), /* variable shift costs */
- COSTS_N_INSNS (1), /* constant shift costs */
- {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (5)}, /* other */
- 0, /* cost of multiply per each bit set */
- {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (35), /* HI */
- COSTS_N_INSNS (51), /* SI */
- COSTS_N_INSNS (83), /* DI */
- COSTS_N_INSNS (83)}, /* other */
+ COSTS_N_INSNS (1), /* cost of an add instruction */
+ COSTS_N_INSNS (2), /* cost of a lea instruction */
+ COSTS_N_INSNS (1), /* variable shift costs */
+ COSTS_N_INSNS (1), /* constant shift costs */
+ {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (5)}, /* other */
+ 0, /* cost of multiply per each bit set */
+ {COSTS_N_INSNS (19), /* cost of a divide/mod for QI */
+ COSTS_N_INSNS (35), /* HI */
+ COSTS_N_INSNS (51), /* SI */
+ COSTS_N_INSNS (83), /* DI */
+ COSTS_N_INSNS (83)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
9, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{3, 4, 3}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -859,14 +860,14 @@ struct processor_costs bdver1_cost = {
{4, 4, 5}, /* cost of storing SSE registers
in SImode, DImode and TImode */
3, /* MMX or SSE register to integer */
- /* On K8
- MOVD reg64, xmmreg Double FSTORE 4
- MOVD reg32, xmmreg Double FSTORE 4
- On AMDFAM10
- MOVD reg64, xmmreg Double FADD 3
- 1/1 1/1
- MOVD reg32, xmmreg Double FADD 3
- 1/1 1/1 */
+ /* On K8:
+ MOVD reg64, xmmreg Double FSTORE 4
+ MOVD reg32, xmmreg Double FSTORE 4
+ On AMDFAM10:
+ MOVD reg64, xmmreg Double FADD 3
+ 1/1 1/1
+ MOVD reg32, xmmreg Double FADD 3
+ 1/1 1/1 */
64, /* size of l1 cache. */
1024, /* size of l2 cache. */
64, /* size of prefetch block */
@@ -885,24 +886,24 @@ struct processor_costs bdver1_cost = {
COSTS_N_INSNS (35), /* cost of FSQRT instruction. */
/* BDVER1 has optimized REP instruction for medium sized blocks, but for
- very small blocks it is better to use loop. For large blocks, libcall can
- do nontemporary accesses and beat inline considerably. */
+ very small blocks it is better to use loop. For large blocks, libcall
+ can do nontemporary accesses and beat inline considerably. */
{{libcall, {{6, loop}, {14, unrolled_loop}, {-1, rep_prefix_4_byte}}},
{libcall, {{16, loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
{{libcall, {{8, loop}, {24, unrolled_loop},
{2048, rep_prefix_4_byte}, {-1, libcall}}},
{libcall, {{48, unrolled_loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 4, /* scalar_stmt_cost. */
- 2, /* scalar load_cost. */
- 2, /* scalar_store_cost. */
- 6, /* vec_stmt_cost. */
- 0, /* vec_to_scalar_cost. */
- 2, /* scalar_to_vec_cost. */
- 2, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 2, /* vec_store_cost. */
- 2, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 4, /* scalar_stmt_cost. */
+ 2, /* scalar load_cost. */
+ 2, /* scalar_store_cost. */
+ 6, /* vec_stmt_cost. */
+ 0, /* vec_to_scalar_cost. */
+ 2, /* scalar_to_vec_cost. */
+ 2, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 2, /* vec_store_cost. */
+ 2, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -912,21 +913,21 @@ struct processor_costs pentium4_cost = {
COSTS_N_INSNS (4), /* variable shift costs */
COSTS_N_INSNS (4), /* constant shift costs */
{COSTS_N_INSNS (15), /* cost of starting multiply for QI */
- COSTS_N_INSNS (15), /* HI */
- COSTS_N_INSNS (15), /* SI */
- COSTS_N_INSNS (15), /* DI */
- COSTS_N_INSNS (15)}, /* other */
+ COSTS_N_INSNS (15), /* HI */
+ COSTS_N_INSNS (15), /* SI */
+ COSTS_N_INSNS (15), /* DI */
+ COSTS_N_INSNS (15)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (56), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (56), /* HI */
- COSTS_N_INSNS (56), /* SI */
- COSTS_N_INSNS (56), /* DI */
- COSTS_N_INSNS (56)}, /* other */
+ COSTS_N_INSNS (56), /* HI */
+ COSTS_N_INSNS (56), /* SI */
+ COSTS_N_INSNS (56), /* DI */
+ COSTS_N_INSNS (56)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
16, /* "large" insn */
6, /* MOVE_RATIO */
- 2, /* cost for loading QImode using movzbl */
+ 2, /* cost for loading QImode using movzbl */
{4, 5, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -963,17 +964,17 @@ struct processor_costs pentium4_cost = {
{{libcall, {{6, loop_1_byte}, {48, loop}, {20480, rep_prefix_4_byte},
{-1, libcall}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -983,21 +984,21 @@ struct processor_costs nocona_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (10), /* cost of starting multiply for QI */
- COSTS_N_INSNS (10), /* HI */
- COSTS_N_INSNS (10), /* SI */
- COSTS_N_INSNS (10), /* DI */
- COSTS_N_INSNS (10)}, /* other */
+ COSTS_N_INSNS (10), /* HI */
+ COSTS_N_INSNS (10), /* SI */
+ COSTS_N_INSNS (10), /* DI */
+ COSTS_N_INSNS (10)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (66), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (66), /* HI */
- COSTS_N_INSNS (66), /* SI */
- COSTS_N_INSNS (66), /* DI */
- COSTS_N_INSNS (66)}, /* other */
+ COSTS_N_INSNS (66), /* HI */
+ COSTS_N_INSNS (66), /* SI */
+ COSTS_N_INSNS (66), /* DI */
+ COSTS_N_INSNS (66)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
16, /* "large" insn */
17, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{4, 4, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -1036,17 +1037,17 @@ struct processor_costs nocona_cost = {
{-1, libcall}}},
{libcall, {{24, loop}, {64, unrolled_loop},
{8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -1056,21 +1057,21 @@ struct processor_costs core2_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (3), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (3), /* DI */
- COSTS_N_INSNS (3)}, /* other */
+ COSTS_N_INSNS (3), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (3), /* DI */
+ COSTS_N_INSNS (3)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (22), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (22), /* HI */
- COSTS_N_INSNS (22), /* SI */
- COSTS_N_INSNS (22), /* DI */
- COSTS_N_INSNS (22)}, /* other */
+ COSTS_N_INSNS (22), /* HI */
+ COSTS_N_INSNS (22), /* SI */
+ COSTS_N_INSNS (22), /* DI */
+ COSTS_N_INSNS (22)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
16, /* MOVE_RATIO */
- 2, /* cost for loading QImode using movzbl */
+ 2, /* cost for loading QImode using movzbl */
{6, 6, 6}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -1109,17 +1110,17 @@ struct processor_costs core2_cost = {
{2048, rep_prefix_4_byte}, {-1, libcall}}},
{libcall, {{24, loop}, {32, unrolled_loop},
{8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
static const
@@ -1129,21 +1130,21 @@ struct processor_costs atom_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (2)}, /* other */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (2)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (26), /* HI */
- COSTS_N_INSNS (42), /* SI */
- COSTS_N_INSNS (74), /* DI */
- COSTS_N_INSNS (74)}, /* other */
+ COSTS_N_INSNS (26), /* HI */
+ COSTS_N_INSNS (42), /* SI */
+ COSTS_N_INSNS (74), /* DI */
+ COSTS_N_INSNS (74)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
17, /* MOVE_RATIO */
- 2, /* cost for loading QImode using movzbl */
+ 2, /* cost for loading QImode using movzbl */
{4, 4, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -1177,22 +1178,22 @@ struct processor_costs atom_cost = {
COSTS_N_INSNS (40), /* cost of FSQRT instruction. */
{{libcall, {{11, loop}, {-1, rep_prefix_4_byte}}},
{libcall, {{32, loop}, {64, rep_prefix_4_byte},
- {8192, rep_prefix_8_byte}, {-1, libcall}}}},
+ {8192, rep_prefix_8_byte}, {-1, libcall}}}},
{{libcall, {{8, loop}, {15, unrolled_loop},
- {2048, rep_prefix_4_byte}, {-1, libcall}}},
+ {2048, rep_prefix_4_byte}, {-1, libcall}}},
{libcall, {{24, loop}, {32, unrolled_loop},
- {8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ {8192, rep_prefix_8_byte}, {-1, libcall}}}},
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
/* Generic64 should produce code tuned for Nocona and K8. */
@@ -1207,21 +1208,21 @@ struct processor_costs generic64_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (2)}, /* other */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (2)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (26), /* HI */
- COSTS_N_INSNS (42), /* SI */
- COSTS_N_INSNS (74), /* DI */
- COSTS_N_INSNS (74)}, /* other */
+ COSTS_N_INSNS (26), /* HI */
+ COSTS_N_INSNS (42), /* SI */
+ COSTS_N_INSNS (74), /* DI */
+ COSTS_N_INSNS (74)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
17, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{4, 4, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -1246,8 +1247,8 @@ struct processor_costs generic64_cost = {
512, /* size of l2 cache. */
64, /* size of prefetch block */
6, /* number of parallel prefetches */
- /* Benchmarks shows large regressions on K8 sixtrack benchmark when this value
- is increased to perhaps more appropriate value of 5. */
+ /* Benchmarks shows large regressions on K8 sixtrack benchmark when this
+ value is increased to perhaps more appropriate value of 5. */
3, /* Branch cost */
COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */
COSTS_N_INSNS (8), /* cost of FMUL instruction. */
@@ -1259,20 +1260,21 @@ struct processor_costs generic64_cost = {
{libcall, {{32, loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
{DUMMY_STRINGOP_ALGS,
{libcall, {{32, loop}, {8192, rep_prefix_8_byte}, {-1, libcall}}}},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
-/* Generic32 should produce code tuned for Athlon, PPro, Pentium4, Nocona and K8. */
+/* Generic32 should produce code tuned for PPro, Pentium4, Nocona,
+ Athlon and K8. */
static const
struct processor_costs generic32_cost = {
COSTS_N_INSNS (1), /* cost of an add instruction */
@@ -1280,21 +1282,21 @@ struct processor_costs generic32_cost = {
COSTS_N_INSNS (1), /* variable shift costs */
COSTS_N_INSNS (1), /* constant shift costs */
{COSTS_N_INSNS (3), /* cost of starting multiply for QI */
- COSTS_N_INSNS (4), /* HI */
- COSTS_N_INSNS (3), /* SI */
- COSTS_N_INSNS (4), /* DI */
- COSTS_N_INSNS (2)}, /* other */
+ COSTS_N_INSNS (4), /* HI */
+ COSTS_N_INSNS (3), /* SI */
+ COSTS_N_INSNS (4), /* DI */
+ COSTS_N_INSNS (2)}, /* other */
0, /* cost of multiply per each bit set */
{COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
- COSTS_N_INSNS (26), /* HI */
- COSTS_N_INSNS (42), /* SI */
- COSTS_N_INSNS (74), /* DI */
- COSTS_N_INSNS (74)}, /* other */
+ COSTS_N_INSNS (26), /* HI */
+ COSTS_N_INSNS (42), /* SI */
+ COSTS_N_INSNS (74), /* DI */
+ COSTS_N_INSNS (74)}, /* other */
COSTS_N_INSNS (1), /* cost of movsx */
COSTS_N_INSNS (1), /* cost of movzx */
8, /* "large" insn */
17, /* MOVE_RATIO */
- 4, /* cost for loading QImode using movzbl */
+ 4, /* cost for loading QImode using movzbl */
{4, 4, 4}, /* cost of loading integer registers
in QImode, HImode and SImode.
Relative to reg-reg move (2). */
@@ -1330,17 +1332,17 @@ struct processor_costs generic32_cost = {
DUMMY_STRINGOP_ALGS},
{{libcall, {{32, loop}, {8192, rep_prefix_4_byte}, {-1, libcall}}},
DUMMY_STRINGOP_ALGS},
- 1, /* scalar_stmt_cost. */
- 1, /* scalar load_cost. */
- 1, /* scalar_store_cost. */
- 1, /* vec_stmt_cost. */
- 1, /* vec_to_scalar_cost. */
- 1, /* scalar_to_vec_cost. */
- 1, /* vec_align_load_cost. */
- 2, /* vec_unalign_load_cost. */
- 1, /* vec_store_cost. */
- 3, /* cond_taken_branch_cost. */
- 1, /* cond_not_taken_branch_cost. */
+ 1, /* scalar_stmt_cost. */
+ 1, /* scalar load_cost. */
+ 1, /* scalar_store_cost. */
+ 1, /* vec_stmt_cost. */
+ 1, /* vec_to_scalar_cost. */
+ 1, /* scalar_to_vec_cost. */
+ 1, /* vec_align_load_cost. */
+ 2, /* vec_unalign_load_cost. */
+ 1, /* vec_store_cost. */
+ 3, /* cond_taken_branch_cost. */
+ 1, /* cond_not_taken_branch_cost. */
};
const struct processor_costs *ix86_cost = &pentium_cost;
@@ -1906,6 +1908,9 @@ static rtx (*ix86_gen_sub3_carry) (rtx, rtx, rtx, rtx, rtx);
static rtx (*ix86_gen_one_cmpl2) (rtx, rtx);
static rtx (*ix86_gen_monitor) (rtx, rtx, rtx);
static rtx (*ix86_gen_andsp) (rtx, rtx, rtx);
+static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx);
+static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx);
+static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx);
/* Preferred alignment for stack boundary in bits. */
unsigned int ix86_preferred_stack_boundary;
@@ -2080,6 +2085,11 @@ static int ix86_isa_flags_explicit;
#define OPTION_MASK_ISA_MOVBE_SET OPTION_MASK_ISA_MOVBE
#define OPTION_MASK_ISA_CRC32_SET OPTION_MASK_ISA_CRC32
+#define OPTION_MASK_ISA_FSGSBASE_SET OPTION_MASK_ISA_FSGSBASE
+#define OPTION_MASK_ISA_RDRND_SET OPTION_MASK_ISA_RDRND
+#define OPTION_MASK_ISA_F16C_SET \
+ (OPTION_MASK_ISA_F16C | OPTION_MASK_ISA_AVX_SET)
+
/* Define a set of ISAs which aren't available when a given ISA is
disabled. MMX and SSE ISAs are handled separately. */
@@ -2105,7 +2115,7 @@ static int ix86_isa_flags_explicit;
(OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_AVX_UNSET )
#define OPTION_MASK_ISA_AVX_UNSET \
(OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \
- | OPTION_MASK_ISA_FMA4_UNSET)
+ | OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET)
#define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
/* SSE4 includes both SSE4.1 and SSE4.2. -mno-sse4 should the same
@@ -2129,8 +2139,13 @@ static int ix86_isa_flags_explicit;
#define OPTION_MASK_ISA_MOVBE_UNSET OPTION_MASK_ISA_MOVBE
#define OPTION_MASK_ISA_CRC32_UNSET OPTION_MASK_ISA_CRC32
+#define OPTION_MASK_ISA_FSGSBASE_UNSET OPTION_MASK_ISA_FSGSBASE
+#define OPTION_MASK_ISA_RDRND_UNSET OPTION_MASK_ISA_RDRND
+#define OPTION_MASK_ISA_F16C_UNSET OPTION_MASK_ISA_F16C
+
/* Vectorization library interface and handlers. */
-tree (*ix86_veclib_handler)(enum built_in_function, tree, tree) = NULL;
+static tree (*ix86_veclib_handler) (enum built_in_function, tree, tree);
+
static tree ix86_veclibabi_svml (enum built_in_function, tree, tree);
static tree ix86_veclibabi_acml (enum built_in_function, tree, tree);
@@ -2498,6 +2513,45 @@ ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
}
return true;
+ case OPT_mfsgsbase:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_FSGSBASE_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_FSGSBASE_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_UNSET;
+ }
+ return true;
+
+ case OPT_mrdrnd:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_RDRND_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_RDRND_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_UNSET;
+ }
+ return true;
+
+ case OPT_mf16c:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_F16C_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_F16C_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_UNSET;
+ }
+ return true;
+
default:
return true;
}
@@ -2541,6 +2595,9 @@ ix86_target_string (int isa, int flags, const char *arch, const char *tune,
{ "-mcrc32", OPTION_MASK_ISA_CRC32 },
{ "-maes", OPTION_MASK_ISA_AES },
{ "-mpclmul", OPTION_MASK_ISA_PCLMUL },
+ { "-mfsgsbase", OPTION_MASK_ISA_FSGSBASE },
+ { "-mrdrnd", OPTION_MASK_ISA_RDRND },
+ { "-mf16c", OPTION_MASK_ISA_F16C },
};
/* Flag options. */
@@ -2778,7 +2835,10 @@ override_options (bool main_args_p)
PTA_MOVBE = 1 << 20,
PTA_FMA4 = 1 << 21,
PTA_XOP = 1 << 22,
- PTA_LWP = 1 << 23
+ PTA_LWP = 1 << 23,
+ PTA_FSGSBASE = 1 << 24,
+ PTA_RDRND = 1 << 25,
+ PTA_F16C = 1 << 26
};
static struct pta
@@ -3154,6 +3214,15 @@ override_options (bool main_args_p)
if (processor_alias_table[i].flags & PTA_PCLMUL
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_PCLMUL))
ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL;
+ if (processor_alias_table[i].flags & PTA_FSGSBASE
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_FSGSBASE))
+ ix86_isa_flags |= OPTION_MASK_ISA_FSGSBASE;
+ if (processor_alias_table[i].flags & PTA_RDRND
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_RDRND))
+ ix86_isa_flags |= OPTION_MASK_ISA_RDRND;
+ if (processor_alias_table[i].flags & PTA_F16C
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_F16C))
+ ix86_isa_flags |= OPTION_MASK_ISA_F16C;
if (processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE))
x86_prefetch_sse = true;
@@ -3577,6 +3646,9 @@ override_options (bool main_args_p)
ix86_gen_one_cmpl2 = gen_one_cmpldi2;
ix86_gen_monitor = gen_sse3_monitor64;
ix86_gen_andsp = gen_anddi3;
+ ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_64;
+ ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi;
+ ix86_gen_probe_stack_range = gen_probe_stack_rangedi;
}
else
{
@@ -3588,6 +3660,9 @@ override_options (bool main_args_p)
ix86_gen_one_cmpl2 = gen_one_cmplsi2;
ix86_gen_monitor = gen_sse3_monitor;
ix86_gen_andsp = gen_andsi3;
+ ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_32;
+ ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi;
+ ix86_gen_probe_stack_range = gen_probe_stack_rangesi;
}
#ifdef USE_IX86_CLD
@@ -3826,6 +3901,9 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[])
IX86_ATTR_ISA ("fma4", OPT_mfma4),
IX86_ATTR_ISA ("xop", OPT_mxop),
IX86_ATTR_ISA ("lwp", OPT_mlwp),
+ IX86_ATTR_ISA ("fsgsbase", OPT_mfsgsbase),
+ IX86_ATTR_ISA ("rdrnd", OPT_mrdrnd),
+ IX86_ATTR_ISA ("f16c", OPT_mf16c),
/* string options */
IX86_ATTR_STR ("arch=", IX86_FUNCTION_SPECIFIC_ARCH),
@@ -4444,6 +4522,20 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED)
SUBTARGET_OPTIMIZATION_OPTIONS;
#endif
}
+
+/* Decide whether we must probe the stack before any space allocation
+ on this target. It's essentially TARGET_STACK_PROBE except when
+ -fstack-check causes the stack to be already probed differently. */
+
+bool
+ix86_target_stack_probe (void)
+{
+ /* Do not probe the stack twice if static stack checking is enabled. */
+ if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK)
+ return false;
+
+ return TARGET_STACK_PROBE;
+}
/* Decide whether we can make a sibling call to a function. DECL is the
declaration of the function being targeted by the call and EXP is the
@@ -5009,18 +5101,15 @@ ix86_function_type_abi (const_tree fntype)
static bool
ix86_function_ms_hook_prologue (const_tree fntype)
{
- if (!TARGET_64BIT)
+ if (fntype && lookup_attribute ("ms_hook_prologue", DECL_ATTRIBUTES (fntype)))
{
- if (lookup_attribute ("ms_hook_prologue", DECL_ATTRIBUTES (fntype)))
- {
- if (decl_function_context (fntype) != NULL_TREE)
- {
- error_at (DECL_SOURCE_LOCATION (fntype),
- "ms_hook_prologue is not compatible with nested function");
- }
+ if (decl_function_context (fntype) != NULL_TREE)
+ {
+ error_at (DECL_SOURCE_LOCATION (fntype),
+ "ms_hook_prologue is not compatible with nested function");
+ }
- return true;
- }
+ return true;
}
return false;
}
@@ -5043,6 +5132,40 @@ ix86_cfun_abi (void)
return cfun->machine->call_abi;
}
+/* Write the extra assembler code needed to declare a function properly. */
+
+void
+ix86_asm_output_function_label (FILE *asm_out_file, const char *fname,
+ tree decl)
+{
+ bool is_ms_hook = ix86_function_ms_hook_prologue (decl);
+
+ if (is_ms_hook)
+ {
+ int i, filler_count = (TARGET_64BIT ? 32 : 16);
+ unsigned int filler_cc = 0xcccccccc;
+
+ for (i = 0; i < filler_count; i += 4)
+ fprintf (asm_out_file, ASM_LONG " %#x\n", filler_cc);
+ }
+
+ ASM_OUTPUT_LABEL (asm_out_file, fname);
+
+ /* Output magic byte marker, if hot-patch attribute is set.
+ For x86 case frame-pointer prologue will be emitted in
+ expand_prologue. */
+ if (is_ms_hook)
+ {
+ if (TARGET_64BIT)
+ /* leaq [%rsp + 0], %rsp */
+ asm_fprintf (asm_out_file, ASM_BYTE
+ "0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n");
+ else
+ /* movl.s %edi, %edi. */
+ asm_fprintf (asm_out_file, ASM_BYTE "0x8b, 0xff\n");
+ }
+}
+
/* regclass.c */
extern void init_regs (void);
@@ -5352,7 +5475,7 @@ classify_argument (enum machine_mode mode, const_tree type,
{
case RECORD_TYPE:
/* And now merge the fields of structure. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)
{
@@ -5440,7 +5563,7 @@ classify_argument (enum machine_mode mode, const_tree type,
case QUAL_UNION_TYPE:
/* Unions are similar to RECORD_TYPE but offset is always 0.
*/
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)
{
@@ -6034,9 +6157,8 @@ function_arg_advance_64 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (!named && VALID_AVX256_REG_MODE (mode))
return;
- if (!examine_argument (mode, type, 0, &int_nregs, &sse_nregs))
- cum->words += words;
- else if (sse_nregs <= cum->sse_nregs && int_nregs <= cum->nregs)
+ if (examine_argument (mode, type, 0, &int_nregs, &sse_nregs)
+ && sse_nregs <= cum->sse_nregs && int_nregs <= cum->nregs)
{
cum->nregs -= int_nregs;
cum->sse_nregs -= sse_nregs;
@@ -6044,7 +6166,11 @@ function_arg_advance_64 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
cum->sse_regno += sse_nregs;
}
else
- cum->words += words;
+ {
+ int align = ix86_function_arg_boundary (mode, type) / BITS_PER_WORD;
+ cum->words = (cum->words + align - 1) & ~(align - 1);
+ cum->words += words;
+ }
}
static void
@@ -6385,7 +6511,7 @@ ix86_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
/* Return true when TYPE should be 128bit aligned for 32bit argument passing
ABI. */
static bool
-contains_aligned_value_p (tree type)
+contains_aligned_value_p (const_tree type)
{
enum machine_mode mode = TYPE_MODE (type);
if (((TARGET_SSE && SSE_REG_MODE_P (mode))
@@ -6409,7 +6535,7 @@ contains_aligned_value_p (tree type)
tree field;
/* Walk all the structure fields. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL
&& contains_aligned_value_p (TREE_TYPE (field)))
@@ -6435,7 +6561,7 @@ contains_aligned_value_p (tree type)
specified mode and type. */
int
-ix86_function_arg_boundary (enum machine_mode mode, tree type)
+ix86_function_arg_boundary (enum machine_mode mode, const_tree type)
{
int align;
if (type)
@@ -6750,12 +6876,12 @@ ix86_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
}
/* Return false iff TYPE is returned in memory. This version is used
- on Solaris 10. It is similar to the generic ix86_return_in_memory,
+ on Solaris 2. It is similar to the generic ix86_return_in_memory,
but differs notably in that when MMX is available, 8-byte vectors
are returned in memory, rather than in MMX registers. */
bool
-ix86_sol10_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
+ix86_solaris_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
int size;
enum machine_mode mode = type_natural_mode (type, NULL);
@@ -6847,7 +6973,7 @@ ix86_build_builtin_va_list_abi (enum calling_abi abi)
if (!TARGET_64BIT || abi == MS_ABI)
return build_pointer_type (char_type_node);
- record = (*lang_hooks.types.make_type) (RECORD_TYPE);
+ record = lang_hooks.types.make_type (RECORD_TYPE);
type_decl = build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("__va_list_tag"), record);
@@ -6875,9 +7001,9 @@ ix86_build_builtin_va_list_abi (enum calling_abi abi)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_gpr;
- TREE_CHAIN (f_gpr) = f_fpr;
- TREE_CHAIN (f_fpr) = f_ovf;
- TREE_CHAIN (f_ovf) = f_sav;
+ DECL_CHAIN (f_gpr) = f_fpr;
+ DECL_CHAIN (f_fpr) = f_ovf;
+ DECL_CHAIN (f_ovf) = f_sav;
layout_type (record);
@@ -6936,11 +7062,8 @@ static void
setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
{
rtx save_area, mem;
- rtx label;
- rtx tmp_reg;
- rtx nsse_reg;
alias_set_type set;
- int i;
+ int i, max;
/* GPR size of varargs save area. */
if (cfun->va_list_gpr_size)
@@ -6950,7 +7073,7 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
/* FPR size of varargs save area. We don't need it if we don't pass
anything in SSE registers. */
- if (cum->sse_nregs && cfun->va_list_fpr_size)
+ if (TARGET_SSE && cfun->va_list_fpr_size)
ix86_varargs_fpr_size = X86_64_SSE_REGPARM_MAX * 16;
else
ix86_varargs_fpr_size = 0;
@@ -6961,10 +7084,11 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
save_area = frame_pointer_rtx;
set = get_varargs_alias_set ();
- for (i = cum->regno;
- i < X86_64_REGPARM_MAX
- && i < cum->regno + cfun->va_list_gpr_size / UNITS_PER_WORD;
- i++)
+ max = cum->regno + cfun->va_list_gpr_size / UNITS_PER_WORD;
+ if (max > X86_64_REGPARM_MAX)
+ max = X86_64_REGPARM_MAX;
+
+ for (i = cum->regno; i < max; i++)
{
mem = gen_rtx_MEM (Pmode,
plus_constant (save_area, i * UNITS_PER_WORD));
@@ -6976,33 +7100,42 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
if (ix86_varargs_fpr_size)
{
+ enum machine_mode smode;
+ rtx label, test;
+
/* Now emit code to save SSE registers. The AX parameter contains number
- of SSE parameter registers used to call this function. We use
- sse_prologue_save insn template that produces computed jump across
- SSE saves. We need some preparation work to get this working. */
+ of SSE parameter registers used to call this function, though all we
+ actually check here is the zero/non-zero status. */
label = gen_label_rtx ();
+ test = gen_rtx_EQ (VOIDmode, gen_rtx_REG (QImode, AX_REG), const0_rtx);
+ emit_jump_insn (gen_cbranchqi4 (test, XEXP (test, 0), XEXP (test, 1),
+ label));
- nsse_reg = gen_reg_rtx (Pmode);
- emit_insn (gen_zero_extendqidi2 (nsse_reg, gen_rtx_REG (QImode, AX_REG)));
-
- /* Compute address of memory block we save into. We always use pointer
- pointing 127 bytes after first byte to store - this is needed to keep
- instruction size limited by 4 bytes (5 bytes for AVX) with one
- byte displacement. */
- tmp_reg = gen_reg_rtx (Pmode);
- emit_insn (gen_rtx_SET (VOIDmode, tmp_reg,
- plus_constant (save_area,
- ix86_varargs_gpr_size + 127)));
- mem = gen_rtx_MEM (BLKmode, plus_constant (tmp_reg, -127));
- MEM_NOTRAP_P (mem) = 1;
- set_mem_alias_set (mem, set);
- set_mem_align (mem, 64);
+ /* ??? If !TARGET_SSE_TYPELESS_STORES, would we perform better if
+ we used movdqa (i.e. TImode) instead? Perhaps even better would
+ be if we could determine the real mode of the data, via a hook
+ into pass_stdarg. Ignore all that for now. */
+ smode = V4SFmode;
+ if (crtl->stack_alignment_needed < GET_MODE_ALIGNMENT (smode))
+ crtl->stack_alignment_needed = GET_MODE_ALIGNMENT (smode);
+
+ max = cum->sse_regno + cfun->va_list_fpr_size / 16;
+ if (max > X86_64_SSE_REGPARM_MAX)
+ max = X86_64_SSE_REGPARM_MAX;
+
+ for (i = cum->sse_regno; i < max; ++i)
+ {
+ mem = plus_constant (save_area, i * 16 + ix86_varargs_gpr_size);
+ mem = gen_rtx_MEM (smode, mem);
+ MEM_NOTRAP_P (mem) = 1;
+ set_mem_alias_set (mem, set);
+ set_mem_align (mem, GET_MODE_ALIGNMENT (smode));
- /* And finally do the dirty job! */
- emit_insn (gen_sse_prologue_save (mem, nsse_reg,
- GEN_INT (cum->sse_regno), label,
- gen_reg_rtx (Pmode)));
+ emit_move_insn (mem, gen_rtx_REG (smode, SSE_REGNO (i)));
+ }
+
+ emit_label (label);
}
}
@@ -7089,15 +7222,21 @@ ix86_va_start (tree valist, rtx nextarg)
}
f_gpr = TYPE_FIELDS (TREE_TYPE (sysv_va_list_type_node));
- f_fpr = TREE_CHAIN (f_gpr);
- f_ovf = TREE_CHAIN (f_fpr);
- f_sav = TREE_CHAIN (f_ovf);
-
- valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist);
- gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
- fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE);
- ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
- sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
+ f_fpr = DECL_CHAIN (f_gpr);
+ f_ovf = DECL_CHAIN (f_fpr);
+ f_sav = DECL_CHAIN (f_ovf);
+
+ valist = build_simple_mem_ref (valist);
+ TREE_TYPE (valist) = TREE_TYPE (sysv_va_list_type_node);
+ /* The following should be folded into the MEM_REF offset. */
+ gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), unshare_expr (valist),
+ f_gpr, NULL_TREE);
+ fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), unshare_expr (valist),
+ f_fpr, NULL_TREE);
+ ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), unshare_expr (valist),
+ f_ovf, NULL_TREE);
+ sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), unshare_expr (valist),
+ f_sav, NULL_TREE);
/* Count number of gp and fp argument registers used. */
words = crtl->args.info.words;
@@ -7170,9 +7309,9 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
f_gpr = TYPE_FIELDS (TREE_TYPE (sysv_va_list_type_node));
- f_fpr = TREE_CHAIN (f_gpr);
- f_ovf = TREE_CHAIN (f_fpr);
- f_sav = TREE_CHAIN (f_ovf);
+ f_fpr = DECL_CHAIN (f_gpr);
+ f_ovf = DECL_CHAIN (f_fpr);
+ f_sav = DECL_CHAIN (f_ovf);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr),
build_va_arg_indirect_ref (valist), f_gpr, NULL_TREE);
@@ -7411,8 +7550,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
arg_boundary = MAX_SUPPORTED_STACK_ALIGNMENT;
/* Care for on-stack alignment if needed. */
- if (arg_boundary <= 64
- || integer_zerop (TYPE_SIZE (type)))
+ if (arg_boundary <= 64 || size == 0)
t = ovf;
else
{
@@ -7423,9 +7561,8 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
size_int (-align));
t = fold_convert (TREE_TYPE (ovf), t);
- if (crtl->stack_alignment_needed < arg_boundary)
- crtl->stack_alignment_needed = arg_boundary;
}
+
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
gimplify_assign (addr, t, pre_p);
@@ -7820,7 +7957,7 @@ ix86_code_end (void)
assemble_name (asm_out_file, name);
fputs ("\n\t.private_extern\t", asm_out_file);
assemble_name (asm_out_file, name);
- fputs ("\n", asm_out_file);
+ putc ('\n', asm_out_file);
ASM_OUTPUT_LABEL (asm_out_file, name);
DECL_WEAK (decl) = 1;
}
@@ -7830,10 +7967,10 @@ ix86_code_end (void)
{
DECL_COMDAT_GROUP (decl) = DECL_ASSEMBLER_NAME (decl);
- (*targetm.asm_out.unique_section) (decl, 0);
+ targetm.asm_out.unique_section (decl, 0);
switch_to_section (get_named_section (decl, NULL, 0));
- (*targetm.asm_out.globalize_label) (asm_out_file, name);
+ targetm.asm_out.globalize_label (asm_out_file, name);
fputs ("\t.hidden\t", asm_out_file);
assemble_name (asm_out_file, name);
putc ('\n', asm_out_file);
@@ -7924,8 +8061,8 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED)
ASM_OUTPUT_LABEL (asm_out_file, MACHOPIC_FUNCTION_BASE_NAME);
#endif
- (*targetm.asm_out.internal_label) (asm_out_file, "L",
- CODE_LABEL_NUMBER (XEXP (xops[2], 0)));
+ targetm.asm_out.internal_label (asm_out_file, "L",
+ CODE_LABEL_NUMBER (XEXP (xops[2], 0)));
if (flag_pic)
{
@@ -8223,6 +8360,11 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
else
frame->save_regs_using_mov = false;
+ /* If static stack checking is enabled and done with probes, the registers
+ need to be saved before allocating the frame. */
+ if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK)
+ frame->save_regs_using_mov = false;
+
/* Skip return address. */
offset = UNITS_PER_WORD;
@@ -8434,9 +8576,9 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset,
rtx insn;
if (! TARGET_64BIT)
- insn = emit_insn (gen_pro_epilogue_adjust_stack_1 (dest, src, offset));
+ insn = emit_insn (gen_pro_epilogue_adjust_stack_si_1 (dest, src, offset));
else if (x86_64_immediate_operand (offset, DImode))
- insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64 (dest, src, offset));
+ insn = emit_insn (gen_pro_epilogue_adjust_stack_di_1 (dest, src, offset));
else
{
rtx tmp;
@@ -8453,8 +8595,8 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset,
insn = emit_insn (gen_rtx_SET (DImode, tmp, offset));
if (style < 0)
RTX_FRAME_RELATED_P (insn) = 1;
- insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64_2 (dest, src, tmp,
- offset));
+ insn = emit_insn (gen_pro_epilogue_adjust_stack_di_2 (dest, src, tmp,
+ offset));
}
if (style >= 0)
@@ -8632,6 +8774,377 @@ ix86_internal_arg_pointer (void)
return virtual_incoming_args_rtx;
}
+struct scratch_reg {
+ rtx reg;
+ bool saved;
+};
+
+/* Return a short-lived scratch register for use on function entry.
+ In 32-bit mode, it is valid only after the registers are saved
+ in the prologue. This register must be released by means of
+ release_scratch_register_on_entry once it is dead. */
+
+static void
+get_scratch_register_on_entry (struct scratch_reg *sr)
+{
+ int regno;
+
+ sr->saved = false;
+
+ if (TARGET_64BIT)
+ {
+ /* We always use R11 in 64-bit mode. */
+ regno = R11_REG;
+ }
+ else
+ {
+ tree decl = current_function_decl, fntype = TREE_TYPE (decl);
+ bool fastcall_p
+ = lookup_attribute ("fastcall", TYPE_ATTRIBUTES (fntype)) != NULL_TREE;
+ bool static_chain_p = DECL_STATIC_CHAIN (decl);
+ int regparm = ix86_function_regparm (fntype, decl);
+ int drap_regno
+ = crtl->drap_reg ? REGNO (crtl->drap_reg) : INVALID_REGNUM;
+
+ /* 'fastcall' sets regparm to 2, uses ecx/edx for arguments and eax
+ for the static chain register. */
+ if ((regparm < 1 || (fastcall_p && !static_chain_p))
+ && drap_regno != AX_REG)
+ regno = AX_REG;
+ else if (regparm < 2 && drap_regno != DX_REG)
+ regno = DX_REG;
+ /* ecx is the static chain register. */
+ else if (regparm < 3 && !fastcall_p && !static_chain_p
+ && drap_regno != CX_REG)
+ regno = CX_REG;
+ else if (ix86_save_reg (BX_REG, true))
+ regno = BX_REG;
+ /* esi is the static chain register. */
+ else if (!(regparm == 3 && static_chain_p)
+ && ix86_save_reg (SI_REG, true))
+ regno = SI_REG;
+ else if (ix86_save_reg (DI_REG, true))
+ regno = DI_REG;
+ else
+ {
+ regno = (drap_regno == AX_REG ? DX_REG : AX_REG);
+ sr->saved = true;
+ }
+ }
+
+ sr->reg = gen_rtx_REG (Pmode, regno);
+ if (sr->saved)
+ {
+ rtx insn = emit_insn (gen_push (sr->reg));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+}
+
+/* Release a scratch register obtained from the preceding function. */
+
+static void
+release_scratch_register_on_entry (struct scratch_reg *sr)
+{
+ if (sr->saved)
+ {
+ rtx x, insn = emit_insn (ix86_gen_pop1 (sr->reg));
+
+ /* The RTX_FRAME_RELATED_P mechanism doesn't know about pop. */
+ RTX_FRAME_RELATED_P (insn) = 1;
+ x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (UNITS_PER_WORD));
+ x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x);
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, x);
+ }
+}
+
+#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
+
+/* Emit code to adjust the stack pointer by SIZE bytes while probing it. */
+
+static void
+ix86_adjust_stack_and_probe (HOST_WIDE_INT size)
+{
+ /* We skip the probe for the first interval + a small dope of 4 words and
+ probe that many bytes past the specified size to maintain a protection
+ area at the botton of the stack. */
+ const int dope = 4 * UNITS_PER_WORD;
+ rtx size_rtx = GEN_INT (size);
+
+ /* See if we have a constant small number of probes to generate. If so,
+ that's the easy case. The run-time loop is made up of 11 insns in the
+ generic case while the compile-time loop is made up of 3+2*(n-1) insns
+ for n # of intervals. */
+ if (size <= 5 * PROBE_INTERVAL)
+ {
+ HOST_WIDE_INT i, adjust;
+ bool first_probe = true;
+
+ /* Adjust SP and probe at PROBE_INTERVAL + N * PROBE_INTERVAL for
+ values of N from 1 until it exceeds SIZE. If only one probe is
+ needed, this will not generate any code. Then adjust and probe
+ to PROBE_INTERVAL + SIZE. */
+ for (i = PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
+ {
+ if (first_probe)
+ {
+ adjust = 2 * PROBE_INTERVAL + dope;
+ first_probe = false;
+ }
+ else
+ adjust = PROBE_INTERVAL;
+
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx, -adjust)));
+ emit_stack_probe (stack_pointer_rtx);
+ }
+
+ if (first_probe)
+ adjust = size + PROBE_INTERVAL + dope;
+ else
+ adjust = size + PROBE_INTERVAL - i;
+
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx, -adjust)));
+ emit_stack_probe (stack_pointer_rtx);
+
+ /* Adjust back to account for the additional first interval. */
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ PROBE_INTERVAL + dope)));
+ }
+
+ /* Otherwise, do the same as above, but in a loop. Note that we must be
+ extra careful with variables wrapping around because we might be at
+ the very top (or the very bottom) of the address space and we have
+ to be able to handle this case properly; in particular, we use an
+ equality test for the loop condition. */
+ else
+ {
+ HOST_WIDE_INT rounded_size;
+ struct scratch_reg sr;
+
+ get_scratch_register_on_entry (&sr);
+
+
+ /* Step 1: round SIZE to the previous multiple of the interval. */
+
+ rounded_size = size & -PROBE_INTERVAL;
+
+
+ /* Step 2: compute initial and final value of the loop counter. */
+
+ /* SP = SP_0 + PROBE_INTERVAL. */
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ - (PROBE_INTERVAL + dope))));
+
+ /* LAST_ADDR = SP_0 + PROBE_INTERVAL + ROUNDED_SIZE. */
+ emit_move_insn (sr.reg, GEN_INT (-rounded_size));
+ emit_insn (gen_rtx_SET (VOIDmode, sr.reg,
+ gen_rtx_PLUS (Pmode, sr.reg,
+ stack_pointer_rtx)));
+
+
+ /* Step 3: the loop
+
+ while (SP != LAST_ADDR)
+ {
+ SP = SP + PROBE_INTERVAL
+ probe at SP
+ }
+
+ adjusts SP and probes to PROBE_INTERVAL + N * PROBE_INTERVAL for
+ values of N from 1 until it is equal to ROUNDED_SIZE. */
+
+ emit_insn (ix86_gen_adjust_stack_and_probe (sr.reg, sr.reg, size_rtx));
+
+
+ /* Step 4: adjust SP and probe at PROBE_INTERVAL + SIZE if we cannot
+ assert at compile-time that SIZE is equal to ROUNDED_SIZE. */
+
+ if (size != rounded_size)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ rounded_size - size)));
+ emit_stack_probe (stack_pointer_rtx);
+ }
+
+ /* Adjust back to account for the additional first interval. */
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ PROBE_INTERVAL + dope)));
+
+ release_scratch_register_on_entry (&sr);
+ }
+
+ gcc_assert (ix86_cfa_state->reg != stack_pointer_rtx);
+
+ /* Make sure nothing is scheduled before we are done. */
+ emit_insn (gen_blockage ());
+}
+
+/* Adjust the stack pointer up to REG while probing it. */
+
+const char *
+output_adjust_stack_and_probe (rtx reg)
+{
+ static int labelno = 0;
+ char loop_lab[32], end_lab[32];
+ rtx xops[2];
+
+ ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno);
+ ASM_GENERATE_INTERNAL_LABEL (end_lab, "LPSRE", labelno++);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab);
+
+ /* Jump to END_LAB if SP == LAST_ADDR. */
+ xops[0] = stack_pointer_rtx;
+ xops[1] = reg;
+ output_asm_insn ("cmp%z0\t{%1, %0|%0, %1}", xops);
+ fputs ("\tje\t", asm_out_file);
+ assemble_name_raw (asm_out_file, end_lab);
+ fputc ('\n', asm_out_file);
+
+ /* SP = SP + PROBE_INTERVAL. */
+ xops[1] = GEN_INT (PROBE_INTERVAL);
+ output_asm_insn ("sub%z0\t{%1, %0|%0, %1}", xops);
+
+ /* Probe at SP. */
+ xops[1] = const0_rtx;
+ output_asm_insn ("or%z0\t{%1, (%0)|DWORD PTR [%0], %1}", xops);
+
+ fprintf (asm_out_file, "\tjmp\t");
+ assemble_name_raw (asm_out_file, loop_lab);
+ fputc ('\n', asm_out_file);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, end_lab);
+
+ return "";
+}
+
+/* Emit code to probe a range of stack addresses from FIRST to FIRST+SIZE,
+ inclusive. These are offsets from the current stack pointer. */
+
+static void
+ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
+{
+ /* See if we have a constant small number of probes to generate. If so,
+ that's the easy case. The run-time loop is made up of 7 insns in the
+ generic case while the compile-time loop is made up of n insns for n #
+ of intervals. */
+ if (size <= 7 * PROBE_INTERVAL)
+ {
+ HOST_WIDE_INT i;
+
+ /* Probe at FIRST + N * PROBE_INTERVAL for values of N from 1 until
+ it exceeds SIZE. If only one probe is needed, this will not
+ generate any code. Then probe at FIRST + SIZE. */
+ for (i = PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
+ emit_stack_probe (plus_constant (stack_pointer_rtx, -(first + i)));
+
+ emit_stack_probe (plus_constant (stack_pointer_rtx, -(first + size)));
+ }
+
+ /* Otherwise, do the same as above, but in a loop. Note that we must be
+ extra careful with variables wrapping around because we might be at
+ the very top (or the very bottom) of the address space and we have
+ to be able to handle this case properly; in particular, we use an
+ equality test for the loop condition. */
+ else
+ {
+ HOST_WIDE_INT rounded_size, last;
+ struct scratch_reg sr;
+
+ get_scratch_register_on_entry (&sr);
+
+
+ /* Step 1: round SIZE to the previous multiple of the interval. */
+
+ rounded_size = size & -PROBE_INTERVAL;
+
+
+ /* Step 2: compute initial and final value of the loop counter. */
+
+ /* TEST_OFFSET = FIRST. */
+ emit_move_insn (sr.reg, GEN_INT (-first));
+
+ /* LAST_OFFSET = FIRST + ROUNDED_SIZE. */
+ last = first + rounded_size;
+
+
+ /* Step 3: the loop
+
+ while (TEST_ADDR != LAST_ADDR)
+ {
+ TEST_ADDR = TEST_ADDR + PROBE_INTERVAL
+ probe at TEST_ADDR
+ }
+
+ probes at FIRST + N * PROBE_INTERVAL for values of N from 1
+ until it is equal to ROUNDED_SIZE. */
+
+ emit_insn (ix86_gen_probe_stack_range (sr.reg, sr.reg, GEN_INT (-last)));
+
+
+ /* Step 4: probe at FIRST + SIZE if we cannot assert at compile-time
+ that SIZE is equal to ROUNDED_SIZE. */
+
+ if (size != rounded_size)
+ emit_stack_probe (plus_constant (gen_rtx_PLUS (Pmode,
+ stack_pointer_rtx,
+ sr.reg),
+ rounded_size - size));
+
+ release_scratch_register_on_entry (&sr);
+ }
+
+ /* Make sure nothing is scheduled before we are done. */
+ emit_insn (gen_blockage ());
+}
+
+/* Probe a range of stack addresses from REG to END, inclusive. These are
+ offsets from the current stack pointer. */
+
+const char *
+output_probe_stack_range (rtx reg, rtx end)
+{
+ static int labelno = 0;
+ char loop_lab[32], end_lab[32];
+ rtx xops[3];
+
+ ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno);
+ ASM_GENERATE_INTERNAL_LABEL (end_lab, "LPSRE", labelno++);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab);
+
+ /* Jump to END_LAB if TEST_ADDR == LAST_ADDR. */
+ xops[0] = reg;
+ xops[1] = end;
+ output_asm_insn ("cmp%z0\t{%1, %0|%0, %1}", xops);
+ fputs ("\tje\t", asm_out_file);
+ assemble_name_raw (asm_out_file, end_lab);
+ fputc ('\n', asm_out_file);
+
+ /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */
+ xops[1] = GEN_INT (PROBE_INTERVAL);
+ output_asm_insn ("sub%z0\t{%1, %0|%0, %1}", xops);
+
+ /* Probe at TEST_ADDR. */
+ xops[0] = stack_pointer_rtx;
+ xops[1] = reg;
+ xops[2] = const0_rtx;
+ output_asm_insn ("or%z0\t{%2, (%0,%1)|DWORD PTR [%0+%1], %2}", xops);
+
+ fprintf (asm_out_file, "\tjmp\t");
+ assemble_name_raw (asm_out_file, loop_lab);
+ fputc ('\n', asm_out_file);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, end_lab);
+
+ return "";
+}
+
/* Finalize stack_realign_needed flag, which will guide prologue/epilogue
to be generated in correct form. */
static void
@@ -8682,12 +9195,12 @@ ix86_expand_prologue (void)
ix86_compute_frame_layout (&frame);
- if (ix86_function_ms_hook_prologue (current_function_decl))
+ if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl))
{
rtx push, mov;
/* Make sure the function starts with
- 8b ff movl.s %edi,%edi
+ 8b ff movl.s %edi,%edi (emited by ix86_asm_output_function_label)
55 push %ebp
8b ec movl.s %esp,%ebp
@@ -8695,8 +9208,6 @@ ix86_expand_prologue (void)
functions in Microsoft Windows XP Service Pack 2 and newer.
Wine uses this to enable Windows apps to hook the Win32 API
functions provided by Wine. */
- insn = emit_insn (gen_vswapmov (gen_rtx_REG (SImode, DI_REG),
- gen_rtx_REG (SImode, DI_REG)));
push = emit_insn (gen_push (hard_frame_pointer_rtx));
mov = emit_insn (gen_vswapmov (hard_frame_pointer_rtx,
stack_pointer_rtx));
@@ -8719,7 +9230,7 @@ ix86_expand_prologue (void)
the base pointer again, align the stack, and later regenerate
the frame pointer setup. The frame pointer generated by the
hook prologue is not aligned, so it can't be used. */
- insn = emit_insn ((*ix86_gen_pop1) (hard_frame_pointer_rtx));
+ insn = emit_insn (ix86_gen_pop1 (hard_frame_pointer_rtx));
}
/* The first insn of a function that accepts its static chain on the
@@ -8774,9 +9285,9 @@ ix86_expand_prologue (void)
ix86_cfa_state->reg = crtl->drap_reg;
/* Align the stack. */
- insn = emit_insn ((*ix86_gen_andsp) (stack_pointer_rtx,
- stack_pointer_rtx,
- GEN_INT (-align_bytes)));
+ insn = emit_insn (ix86_gen_andsp (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-align_bytes)));
RTX_FRAME_RELATED_P (insn) = 1;
/* Replicate the return address on the stack so that return
@@ -8811,9 +9322,9 @@ ix86_expand_prologue (void)
gcc_assert (align_bytes > MIN_STACK_BOUNDARY / BITS_PER_UNIT);
/* Align the stack. */
- insn = emit_insn ((*ix86_gen_andsp) (stack_pointer_rtx,
- stack_pointer_rtx,
- GEN_INT (-align_bytes)));
+ insn = emit_insn (ix86_gen_andsp (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-align_bytes)));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -8824,6 +9335,32 @@ ix86_expand_prologue (void)
else
allocate += frame.nregs * UNITS_PER_WORD;
+ /* The stack has already been decremented by the instruction calling us
+ so we need to probe unconditionally to preserve the protection area. */
+ if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK)
+ {
+ /* We expect the registers to be saved when probes are used. */
+ gcc_assert (!frame.save_regs_using_mov);
+
+ if (STACK_CHECK_MOVING_SP)
+ {
+ ix86_adjust_stack_and_probe (allocate);
+ allocate = 0;
+ }
+ else
+ {
+ HOST_WIDE_INT size = allocate;
+
+ if (TARGET_64BIT && size >= (HOST_WIDE_INT) 0x80000000)
+ size = 0x80000000 - STACK_CHECK_PROTECT - 1;
+
+ if (TARGET_STACK_PROBE)
+ ix86_emit_probe_stack_range (0, size + STACK_CHECK_PROTECT);
+ else
+ ix86_emit_probe_stack_range (STACK_CHECK_PROTECT, size);
+ }
+ }
+
/* When using red zone we may start register saving before allocating
the stack frame saving one cycle of the prologue. However I will
avoid doing this if I am going to have to probe the stack since
@@ -8839,7 +9376,7 @@ ix86_expand_prologue (void)
if (allocate == 0)
;
- else if (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT)
+ else if (!ix86_target_stack_probe () || allocate < CHECK_STACK_LIMIT)
pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
GEN_INT (-allocate), -1,
ix86_cfa_state->reg == stack_pointer_rtx);
@@ -8862,11 +9399,7 @@ ix86_expand_prologue (void)
emit_move_insn (eax, GEN_INT (allocate));
- if (TARGET_64BIT)
- insn = gen_allocate_stack_worker_64 (eax, eax);
- else
- insn = gen_allocate_stack_worker_32 (eax, eax);
- insn = emit_insn (insn);
+ insn = emit_insn (ix86_gen_allocate_stack_worker (eax, eax));
if (ix86_cfa_state->reg == stack_pointer_rtx)
{
@@ -10985,7 +11518,7 @@ output_pic_addr_const (FILE *file, rtx x, int code)
break;
case SYMBOL_REF:
- if (! TARGET_MACHO || TARGET_64BIT)
+ if (TARGET_64BIT || ! TARGET_MACHO_BRANCH_ISLANDS)
output_addr_const (file, x);
else
{
@@ -12127,8 +12660,8 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
case ';':
-#if TARGET_MACHO || !HAVE_AS_IX86_REP_LOCK_PREFIX
- fputs (";", file);
+#ifndef HAVE_AS_IX86_REP_LOCK_PREFIX
+ putc (';', file);
#endif
return;
@@ -19291,7 +19824,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
QImode, 1, end_0_label);
/* Increment the address. */
- emit_insn ((*ix86_gen_add3) (out, out, const1_rtx));
+ emit_insn (ix86_gen_add3 (out, out, const1_rtx));
/* Not needed with an alignment of 2 */
if (align != 2)
@@ -19301,7 +19834,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
emit_cmp_and_jump_insns (mem, const0_rtx, EQ, NULL, QImode, 1,
end_0_label);
- emit_insn ((*ix86_gen_add3) (out, out, const1_rtx));
+ emit_insn (ix86_gen_add3 (out, out, const1_rtx));
emit_label (align_3_label);
}
@@ -19309,7 +19842,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
emit_cmp_and_jump_insns (mem, const0_rtx, EQ, NULL, QImode, 1,
end_0_label);
- emit_insn ((*ix86_gen_add3) (out, out, const1_rtx));
+ emit_insn (ix86_gen_add3 (out, out, const1_rtx));
}
/* Generate loop to check 4 bytes at a time. It is not a good idea to
@@ -19319,7 +19852,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
mem = change_address (src, SImode, out);
emit_move_insn (scratch, mem);
- emit_insn ((*ix86_gen_add3) (out, out, GEN_INT (4)));
+ emit_insn (ix86_gen_add3 (out, out, GEN_INT (4)));
/* This formula yields a nonzero result iff one of the bytes is zero.
This saves three branches inside loop and many cycles. */
@@ -19374,7 +19907,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
/* Not in the first two. Move two bytes forward. */
emit_insn (gen_lshrsi3 (tmpreg, tmpreg, GEN_INT (16)));
- emit_insn ((*ix86_gen_add3) (out, out, const2_rtx));
+ emit_insn (ix86_gen_add3 (out, out, const2_rtx));
emit_label (end_2_label);
@@ -19385,7 +19918,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
emit_insn (gen_addqi3_cc (tmpreg, tmpreg, tmpreg));
tmp = gen_rtx_REG (CCmode, FLAGS_REG);
cmp = gen_rtx_LTU (VOIDmode, tmp, const0_rtx);
- emit_insn ((*ix86_gen_sub3_carry) (out, out, GEN_INT (3), tmp, cmp));
+ emit_insn (ix86_gen_sub3_carry (out, out, GEN_INT (3), tmp, cmp));
emit_label (end_0_label);
}
@@ -19427,7 +19960,7 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align)
/* strlensi_unroll_1 returns the address of the zero at the end of
the string, like memchr(), so compute the length by subtracting
the start address. */
- emit_insn ((*ix86_gen_sub3) (out, out, addr));
+ emit_insn (ix86_gen_sub3 (out, out, addr));
}
else
{
@@ -19450,8 +19983,8 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align)
unspec = gen_rtx_UNSPEC (Pmode, gen_rtvec (4, src, eoschar, align,
scratch4), UNSPEC_SCAS);
emit_insn (gen_strlenqi_1 (scratch1, scratch3, unspec));
- emit_insn ((*ix86_gen_one_cmpl2) (scratch2, scratch1));
- emit_insn ((*ix86_gen_add3) (out, scratch2, constm1_rtx));
+ emit_insn (ix86_gen_one_cmpl2 (scratch2, scratch1));
+ emit_insn (ix86_gen_add3 (out, scratch2, constm1_rtx));
}
return 1;
}
@@ -21623,6 +22156,27 @@ enum ix86_builtins
IX86_BUILTIN_CLZS,
+ /* FSGSBASE instructions. */
+ IX86_BUILTIN_RDFSBASE32,
+ IX86_BUILTIN_RDFSBASE64,
+ IX86_BUILTIN_RDGSBASE32,
+ IX86_BUILTIN_RDGSBASE64,
+ IX86_BUILTIN_WRFSBASE32,
+ IX86_BUILTIN_WRFSBASE64,
+ IX86_BUILTIN_WRGSBASE32,
+ IX86_BUILTIN_WRGSBASE64,
+
+ /* RDRND instructions. */
+ IX86_BUILTIN_RDRAND16,
+ IX86_BUILTIN_RDRAND32,
+ IX86_BUILTIN_RDRAND64,
+
+ /* F16C instructions. */
+ IX86_BUILTIN_CVTPH2PS,
+ IX86_BUILTIN_CVTPH2PS256,
+ IX86_BUILTIN_CVTPS2PH,
+ IX86_BUILTIN_CVTPS2PH256,
+
IX86_BUILTIN_MAX
};
@@ -21897,6 +22451,20 @@ static const struct builtin_description bdesc_special_args[] =
{ OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinssi3, "__builtin_ia32_lwpins32", IX86_BUILTIN_LWPINS32, UNKNOWN, (int) UCHAR_FTYPE_UINT_UINT_UINT },
{ OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinsdi3, "__builtin_ia32_lwpins64", IX86_BUILTIN_LWPINS64, UNKNOWN, (int) UCHAR_FTYPE_UINT64_UINT_UINT },
+ /* FSGSBASE */
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_rdfsbasesi, "__builtin_ia32_rdfsbase32", IX86_BUILTIN_RDFSBASE32, UNKNOWN, (int) UNSIGNED_FTYPE_VOID },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_rdfsbasedi, "__builtin_ia32_rdfsbase64", IX86_BUILTIN_RDFSBASE64, UNKNOWN, (int) UINT64_FTYPE_VOID },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_rdgsbasesi, "__builtin_ia32_rdgsbase32", IX86_BUILTIN_RDGSBASE32, UNKNOWN, (int) UNSIGNED_FTYPE_VOID },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_rdgsbasedi, "__builtin_ia32_rdgsbase64", IX86_BUILTIN_RDGSBASE64, UNKNOWN, (int) UINT64_FTYPE_VOID },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_wrfsbasesi, "__builtin_ia32_wrfsbase32", IX86_BUILTIN_WRFSBASE32, UNKNOWN, (int) VOID_FTYPE_UNSIGNED },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_wrfsbasedi, "__builtin_ia32_wrfsbase64", IX86_BUILTIN_WRFSBASE64, UNKNOWN, (int) VOID_FTYPE_UINT64 },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_wrgsbasesi, "__builtin_ia32_wrgsbase32", IX86_BUILTIN_WRGSBASE32, UNKNOWN, (int) VOID_FTYPE_UNSIGNED },
+ { OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_wrgsbasedi, "__builtin_ia32_wrgsbase64", IX86_BUILTIN_WRGSBASE64, UNKNOWN, (int) VOID_FTYPE_UINT64 },
+
+ /* RDRND */
+ { OPTION_MASK_ISA_RDRND, CODE_FOR_rdrandhi, "__builtin_ia32_rdrand16", IX86_BUILTIN_RDRAND16, UNKNOWN, (int) UINT16_FTYPE_VOID },
+ { OPTION_MASK_ISA_RDRND, CODE_FOR_rdrandsi, "__builtin_ia32_rdrand32", IX86_BUILTIN_RDRAND32, UNKNOWN, (int) UNSIGNED_FTYPE_VOID },
+ { OPTION_MASK_ISA_RDRND | OPTION_MASK_ISA_64BIT, CODE_FOR_rdranddi, "__builtin_ia32_rdrand64", IX86_BUILTIN_RDRAND64, UNKNOWN, (int) UINT64_FTYPE_VOID },
};
/* Builtins with variable number of arguments. */
@@ -22523,6 +23091,12 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_movmskps256, "__builtin_ia32_movmskps256", IX86_BUILTIN_MOVMSKPS256, UNKNOWN, (int) INT_FTYPE_V8SF },
{ OPTION_MASK_ISA_ABM, CODE_FOR_clzhi2_abm, "__builtin_clzs", IX86_BUILTIN_CLZS, UNKNOWN, (int) UINT16_FTYPE_UINT16 },
+
+ /* F16C */
+ { OPTION_MASK_ISA_F16C, CODE_FOR_vcvtph2ps, "__builtin_ia32_vcvtph2ps", IX86_BUILTIN_CVTPH2PS, UNKNOWN, (int) V4SF_FTYPE_V8HI },
+ { OPTION_MASK_ISA_F16C, CODE_FOR_vcvtph2ps256, "__builtin_ia32_vcvtph2ps256", IX86_BUILTIN_CVTPH2PS256, UNKNOWN, (int) V8SF_FTYPE_V8HI },
+ { OPTION_MASK_ISA_F16C, CODE_FOR_vcvtps2ph, "__builtin_ia32_vcvtps2ph", IX86_BUILTIN_CVTPS2PH, UNKNOWN, (int) V8HI_FTYPE_V4SF_INT },
+ { OPTION_MASK_ISA_F16C, CODE_FOR_vcvtps2ph256, "__builtin_ia32_vcvtps2ph256", IX86_BUILTIN_CVTPS2PH256, UNKNOWN, (int) V8HI_FTYPE_V8SF_INT },
};
/* FMA4 and XOP. */
@@ -23022,13 +23596,13 @@ ix86_init_builtin_types (void)
TYPE_PRECISION (float80_type_node) = 80;
layout_type (float80_type_node);
}
- (*lang_hooks.types.register_builtin_type) (float80_type_node, "__float80");
+ lang_hooks.types.register_builtin_type (float80_type_node, "__float80");
/* The __float128 type. */
float128_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (float128_type_node) = 128;
layout_type (float128_type_node);
- (*lang_hooks.types.register_builtin_type) (float128_type_node, "__float128");
+ lang_hooks.types.register_builtin_type (float128_type_node, "__float128");
/* This macro is built by i386-builtin-types.awk. */
DEFINE_BUILTIN_PRIMITIVE_TYPES;
@@ -23110,7 +23684,7 @@ ix86_expand_binop_builtin (enum insn_code icode, tree exp, rtx target)
if (optimize || !target
|| GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ || !insn_data[icode].operand[0].predicate (target, tmode))
target = gen_reg_rtx (tmode);
if (GET_MODE (op1) == SImode && mode1 == TImode)
@@ -23120,9 +23694,9 @@ ix86_expand_binop_builtin (enum insn_code icode, tree exp, rtx target)
op1 = gen_lowpart (TImode, x);
}
- if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
+ if (!insn_data[icode].operand[1].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
- if (!(*insn_data[icode].operand[2].predicate) (op1, mode1))
+ if (!insn_data[icode].operand[2].predicate (op1, mode1))
op1 = copy_to_mode_reg (mode1, op1);
pat = GEN_FCN (icode) (target, op0, op1);
@@ -23240,7 +23814,7 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target,
if (optimize || !target
|| GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ || !insn_data[icode].operand[0].predicate (target, tmode))
target = gen_reg_rtx (tmode);
gcc_assert (nargs <= 4);
@@ -23273,7 +23847,7 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target,
gcc_assert (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode);
if (optimize
- || ! (*insn_data[icode].operand[i+adjust+1].predicate) (op, mode)
+ || !insn_data[icode].operand[i+adjust+1].predicate (op, mode)
|| num_memory > 1)
op = force_reg (mode, op);
}
@@ -23338,18 +23912,18 @@ ix86_expand_unop_vec_merge_builtin (enum insn_code icode, tree exp,
if (optimize || !target
|| GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ || !insn_data[icode].operand[0].predicate (target, tmode))
target = gen_reg_rtx (tmode);
if (VECTOR_MODE_P (mode0))
op0 = safe_vector_operand (op0, mode0);
if ((optimize && !register_operand (op0, mode0))
- || ! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+ || !insn_data[icode].operand[1].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
op1 = op0;
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode0))
+ if (!insn_data[icode].operand[2].predicate (op1, mode0))
op1 = copy_to_mode_reg (mode0, op1);
pat = GEN_FCN (icode) (target, op0, op1);
@@ -23393,14 +23967,14 @@ ix86_expand_sse_compare (const struct builtin_description *d,
if (optimize || !target
|| GET_MODE (target) != tmode
- || ! (*insn_data[d->icode].operand[0].predicate) (target, tmode))
+ || !insn_data[d->icode].operand[0].predicate (target, tmode))
target = gen_reg_rtx (tmode);
if ((optimize && !register_operand (op0, mode0))
- || ! (*insn_data[d->icode].operand[1].predicate) (op0, mode0))
+ || !insn_data[d->icode].operand[1].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
if ((optimize && !register_operand (op1, mode1))
- || ! (*insn_data[d->icode].operand[2].predicate) (op1, mode1))
+ || !insn_data[d->icode].operand[2].predicate (op1, mode1))
op1 = copy_to_mode_reg (mode1, op1);
op2 = gen_rtx_fmt_ee (comparison, mode0, op0, op1);
@@ -23445,10 +24019,10 @@ ix86_expand_sse_comi (const struct builtin_description *d, tree exp,
target = gen_rtx_SUBREG (QImode, target, 0);
if ((optimize && !register_operand (op0, mode0))
- || !(*insn_data[d->icode].operand[0].predicate) (op0, mode0))
+ || !insn_data[d->icode].operand[0].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
if ((optimize && !register_operand (op1, mode1))
- || !(*insn_data[d->icode].operand[1].predicate) (op1, mode1))
+ || !insn_data[d->icode].operand[1].predicate (op1, mode1))
op1 = copy_to_mode_reg (mode1, op1);
pat = GEN_FCN (d->icode) (op0, op1);
@@ -23489,10 +24063,10 @@ ix86_expand_sse_ptest (const struct builtin_description *d, tree exp,
target = gen_rtx_SUBREG (QImode, target, 0);
if ((optimize && !register_operand (op0, mode0))
- || !(*insn_data[d->icode].operand[0].predicate) (op0, mode0))
+ || !insn_data[d->icode].operand[0].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
if ((optimize && !register_operand (op1, mode1))
- || !(*insn_data[d->icode].operand[1].predicate) (op1, mode1))
+ || !insn_data[d->icode].operand[1].predicate (op1, mode1))
op1 = copy_to_mode_reg (mode1, op1);
pat = GEN_FCN (d->icode) (op0, op1);
@@ -23541,17 +24115,17 @@ ix86_expand_sse_pcmpestr (const struct builtin_description *d,
if (VECTOR_MODE_P (modev4))
op2 = safe_vector_operand (op2, modev4);
- if (! (*insn_data[d->icode].operand[2].predicate) (op0, modev2))
+ if (!insn_data[d->icode].operand[2].predicate (op0, modev2))
op0 = copy_to_mode_reg (modev2, op0);
- if (! (*insn_data[d->icode].operand[3].predicate) (op1, modei3))
+ if (!insn_data[d->icode].operand[3].predicate (op1, modei3))
op1 = copy_to_mode_reg (modei3, op1);
if ((optimize && !register_operand (op2, modev4))
- || !(*insn_data[d->icode].operand[4].predicate) (op2, modev4))
+ || !insn_data[d->icode].operand[4].predicate (op2, modev4))
op2 = copy_to_mode_reg (modev4, op2);
- if (! (*insn_data[d->icode].operand[5].predicate) (op3, modei5))
+ if (!insn_data[d->icode].operand[5].predicate (op3, modei5))
op3 = copy_to_mode_reg (modei5, op3);
- if (! (*insn_data[d->icode].operand[6].predicate) (op4, modeimm))
+ if (!insn_data[d->icode].operand[6].predicate (op4, modeimm))
{
error ("the fifth argument must be a 8-bit immediate");
return const0_rtx;
@@ -23561,7 +24135,7 @@ ix86_expand_sse_pcmpestr (const struct builtin_description *d,
{
if (optimize || !target
|| GET_MODE (target) != tmode0
- || ! (*insn_data[d->icode].operand[0].predicate) (target, tmode0))
+ || !insn_data[d->icode].operand[0].predicate (target, tmode0))
target = gen_reg_rtx (tmode0);
scratch1 = gen_reg_rtx (tmode1);
@@ -23572,7 +24146,7 @@ ix86_expand_sse_pcmpestr (const struct builtin_description *d,
{
if (optimize || !target
|| GET_MODE (target) != tmode1
- || ! (*insn_data[d->icode].operand[1].predicate) (target, tmode1))
+ || !insn_data[d->icode].operand[1].predicate (target, tmode1))
target = gen_reg_rtx (tmode1);
scratch0 = gen_reg_rtx (tmode0);
@@ -23640,13 +24214,13 @@ ix86_expand_sse_pcmpistr (const struct builtin_description *d,
if (VECTOR_MODE_P (modev3))
op1 = safe_vector_operand (op1, modev3);
- if (! (*insn_data[d->icode].operand[2].predicate) (op0, modev2))
+ if (!insn_data[d->icode].operand[2].predicate (op0, modev2))
op0 = copy_to_mode_reg (modev2, op0);
if ((optimize && !register_operand (op1, modev3))
- || !(*insn_data[d->icode].operand[3].predicate) (op1, modev3))
+ || !insn_data[d->icode].operand[3].predicate (op1, modev3))
op1 = copy_to_mode_reg (modev3, op1);
- if (! (*insn_data[d->icode].operand[4].predicate) (op2, modeimm))
+ if (!insn_data[d->icode].operand[4].predicate (op2, modeimm))
{
error ("the third argument must be a 8-bit immediate");
return const0_rtx;
@@ -23656,7 +24230,7 @@ ix86_expand_sse_pcmpistr (const struct builtin_description *d,
{
if (optimize || !target
|| GET_MODE (target) != tmode0
- || ! (*insn_data[d->icode].operand[0].predicate) (target, tmode0))
+ || !insn_data[d->icode].operand[0].predicate (target, tmode0))
target = gen_reg_rtx (tmode0);
scratch1 = gen_reg_rtx (tmode1);
@@ -23667,7 +24241,7 @@ ix86_expand_sse_pcmpistr (const struct builtin_description *d,
{
if (optimize || !target
|| GET_MODE (target) != tmode1
- || ! (*insn_data[d->icode].operand[1].predicate) (target, tmode1))
+ || !insn_data[d->icode].operand[1].predicate (target, tmode1))
target = gen_reg_rtx (tmode1);
scratch0 = gen_reg_rtx (tmode0);
@@ -23763,6 +24337,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V8SF_FTYPE_V8SF:
case V8SF_FTYPE_V8SI:
case V8SF_FTYPE_V4SF:
+ case V8SF_FTYPE_V8HI:
case V4SI_FTYPE_V4SI:
case V4SI_FTYPE_V16QI:
case V4SI_FTYPE_V4SF:
@@ -23779,6 +24354,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V4SF_FTYPE_V4SI:
case V4SF_FTYPE_V8SF:
case V4SF_FTYPE_V4DF:
+ case V4SF_FTYPE_V8HI:
case V4SF_FTYPE_V2DF:
case V2DI_FTYPE_V2DI:
case V2DI_FTYPE_V16QI:
@@ -23881,6 +24457,8 @@ ix86_expand_args_builtin (const struct builtin_description *d,
nargs_constant = 1;
break;
case V8HI_FTYPE_V8HI_INT:
+ case V8HI_FTYPE_V8SF_INT:
+ case V8HI_FTYPE_V4SF_INT:
case V8SF_FTYPE_V8SF_INT:
case V4SI_FTYPE_V4SI_INT:
case V4SI_FTYPE_V8SI_INT:
@@ -23958,7 +24536,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
if (optimize
|| target == 0
|| GET_MODE (target) != tmode
- || ! (*insn_p->operand[0].predicate) (target, tmode))
+ || !insn_p->operand[0].predicate (target, tmode))
target = gen_reg_rtx (tmode);
real_target = target;
}
@@ -23973,7 +24551,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
tree arg = CALL_EXPR_ARG (exp, i);
rtx op = expand_normal (arg);
enum machine_mode mode = insn_p->operand[i + 1].mode;
- bool match = (*insn_p->operand[i + 1].predicate) (op, mode);
+ bool match = insn_p->operand[i + 1].predicate (op, mode);
if (last_arg_count && (i + 1) == nargs)
{
@@ -23983,7 +24561,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
if (!match)
{
op = simplify_gen_subreg (SImode, op, GET_MODE (op), 0);
- if (!(*insn_p->operand[i + 1].predicate) (op, mode))
+ if (!insn_p->operand[i + 1].predicate (op, mode))
op = copy_to_reg (op);
}
}
@@ -24128,7 +24706,16 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
case VOID_FTYPE_VOID:
emit_insn (GEN_FCN (icode) (target));
return 0;
+ case VOID_FTYPE_UINT64:
+ case VOID_FTYPE_UNSIGNED:
+ nargs = 0;
+ klass = store;
+ memory = 0;
+ break;
+ break;
case UINT64_FTYPE_VOID:
+ case UNSIGNED_FTYPE_VOID:
+ case UINT16_FTYPE_VOID:
nargs = 0;
klass = load;
memory = 0;
@@ -24207,7 +24794,10 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
arg = CALL_EXPR_ARG (exp, 0);
op = expand_normal (arg);
gcc_assert (target == 0);
- target = gen_rtx_MEM (tmode, copy_to_mode_reg (Pmode, op));
+ if (memory)
+ target = gen_rtx_MEM (tmode, copy_to_mode_reg (Pmode, op));
+ else
+ target = force_reg (tmode, op);
arg_adjust = 1;
}
else
@@ -24216,7 +24806,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
if (optimize
|| target == 0
|| GET_MODE (target) != tmode
- || ! (*insn_p->operand[0].predicate) (target, tmode))
+ || !insn_p->operand[0].predicate (target, tmode))
target = gen_reg_rtx (tmode);
}
@@ -24227,7 +24817,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
arg = CALL_EXPR_ARG (exp, i + arg_adjust);
op = expand_normal (arg);
- match = (*insn_p->operand[i + 1].predicate) (op, mode);
+ match = insn_p->operand[i + 1].predicate (op, mode);
if (last_arg_constant && (i + 1) == nargs)
{
@@ -24477,11 +25067,11 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op0 = force_reg (Pmode, op0);
op0 = gen_rtx_MEM (mode1, op0);
- if (! (*insn_data[icode].operand[0].predicate) (op0, mode0))
+ if (!insn_data[icode].operand[0].predicate (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
- if (! (*insn_data[icode].operand[1].predicate) (op1, mode1))
+ if (!insn_data[icode].operand[1].predicate (op1, mode1))
op1 = copy_to_mode_reg (mode1, op1);
- if (! (*insn_data[icode].operand[2].predicate) (op2, mode2))
+ if (!insn_data[icode].operand[2].predicate (op2, mode2))
op2 = copy_to_mode_reg (mode2, op2);
pat = GEN_FCN (icode) (op0, op1, op2);
if (! pat)
@@ -24505,7 +25095,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
arg0 = CALL_EXPR_ARG (exp, 0);
op0 = expand_normal (arg0);
icode = CODE_FOR_sse2_clflush;
- if (! (*insn_data[icode].operand[0].predicate) (op0, Pmode))
+ if (!insn_data[icode].operand[0].predicate (op0, Pmode))
op0 = copy_to_mode_reg (Pmode, op0);
emit_insn (gen_sse2_clflush (op0));
@@ -24524,7 +25114,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
op1 = copy_to_mode_reg (SImode, op1);
if (!REG_P (op2))
op2 = copy_to_mode_reg (SImode, op2);
- emit_insn ((*ix86_gen_monitor) (op0, op1, op2));
+ emit_insn (ix86_gen_monitor (op0, op1, op2));
return 0;
case IX86_BUILTIN_MWAIT:
@@ -24598,7 +25188,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
arg0 = CALL_EXPR_ARG (exp, 0);
op0 = expand_normal (arg0);
icode = CODE_FOR_lwp_llwpcb;
- if (! (*insn_data[icode].operand[0].predicate) (op0, Pmode))
+ if (!insn_data[icode].operand[0].predicate (op0, Pmode))
op0 = copy_to_mode_reg (Pmode, op0);
emit_insn (gen_lwp_llwpcb (op0));
return 0;
@@ -24606,7 +25196,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
case IX86_BUILTIN_SLWPCB:
icode = CODE_FOR_lwp_slwpcb;
if (!target
- || ! (*insn_data[icode].operand[0].predicate) (target, Pmode))
+ || !insn_data[icode].operand[0].predicate (target, Pmode))
target = gen_reg_rtx (Pmode);
emit_insn (gen_lwp_slwpcb (target));
return target;
@@ -24727,8 +25317,8 @@ ix86_builtin_vectorized_function (tree fndecl, tree type_out,
/* Dispatch to a handler for a vectorization library. */
if (ix86_veclib_handler)
- return (*ix86_veclib_handler) ((enum built_in_function) fn, type_out,
- type_in);
+ return ix86_veclib_handler ((enum built_in_function) fn, type_out,
+ type_in);
return NULL_TREE;
}
@@ -26235,7 +26825,7 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub)
gcc_assert (!TARGET_64BIT);
/* Lose our funky encoding stuff so it doesn't contaminate the stub. */
- symb = (*targetm.strip_name_encoding) (symb);
+ symb = targetm.strip_name_encoding (symb);
length = strlen (stub);
binder_name = XALLOCAVEC (char, length + 32);
@@ -26425,15 +27015,9 @@ ix86_handle_fndecl_attribute (tree *node, tree name,
return NULL_TREE;
}
- if (TARGET_64BIT)
- {
- warning (OPT_Wattributes, "%qE attribute only available for 32-bit",
- name);
- return NULL_TREE;
- }
-
#ifndef HAVE_AS_IX86_SWAP
- sorry ("ms_hook_prologue attribute needs assembler swap suffix support");
+ if (!TARGET_64BIT)
+ sorry ("ms_hook_prologue attribute needs assembler swap suffix support");
#endif
return NULL_TREE;
@@ -26520,7 +27104,7 @@ x86_can_output_mi_thunk (const_tree thunk ATTRIBUTE_UNUSED,
return false;
/* Need a free register for GOT references. */
- if (flag_pic && !(*targetm.binds_local_p) (function))
+ if (flag_pic && !targetm.binds_local_p (function))
return false;
/* Otherwise ok. */
@@ -26630,7 +27214,7 @@ x86_output_mi_thunk (FILE *file,
xops[0] = XEXP (DECL_RTL (function), 0);
if (TARGET_64BIT)
{
- if (!flag_pic || (*targetm.binds_local_p) (function))
+ if (!flag_pic || targetm.binds_local_p (function))
output_asm_insn ("jmp\t%P0", xops);
/* All thunks should be in the same object as their target,
and thus binds_local_p should be true. */
@@ -26647,17 +27231,18 @@ x86_output_mi_thunk (FILE *file,
}
else
{
- if (!flag_pic || (*targetm.binds_local_p) (function))
+ if (!flag_pic || targetm.binds_local_p (function))
output_asm_insn ("jmp\t%P0", xops);
else
#if TARGET_MACHO
if (TARGET_MACHO)
{
rtx sym_ref = XEXP (DECL_RTL (function), 0);
- tmp = (gen_rtx_SYMBOL_REF
+ if (TARGET_MACHO_BRANCH_ISLANDS)
+ sym_ref = (gen_rtx_SYMBOL_REF
(Pmode,
machopic_indirection_name (sym_ref, /*stub_p=*/true)));
- tmp = gen_rtx_MEM (QImode, tmp);
+ tmp = gen_rtx_MEM (QImode, sym_ref);
xops[0] = tmp;
output_asm_insn ("jmp\t%0", xops);
}
@@ -27701,10 +28286,10 @@ ix86_expand_vector_init_interleave (enum machine_mode mode,
emit_move_insn (op0, gen_lowpart (mode, op1));
/* Load even elements into the second positon. */
- emit_insn ((*gen_load_even) (op0,
- force_reg (inner_mode,
- ops [i + i + 1]),
- const1_rtx));
+ emit_insn (gen_load_even (op0,
+ force_reg (inner_mode,
+ ops [i + i + 1]),
+ const1_rtx));
/* Cast vector to FIRST_IMODE vector. */
ops[i] = gen_reg_rtx (first_imode);
@@ -27715,7 +28300,7 @@ ix86_expand_vector_init_interleave (enum machine_mode mode,
for (i = j = 0; i < n; i += 2, j++)
{
op0 = gen_reg_rtx (first_imode);
- emit_insn ((*gen_interleave_first_low) (op0, ops[i], ops[i + 1]));
+ emit_insn (gen_interleave_first_low (op0, ops[i], ops[i + 1]));
/* Cast FIRST_IMODE vector to SECOND_IMODE vector. */
ops[j] = gen_reg_rtx (second_imode);
@@ -27729,8 +28314,8 @@ ix86_expand_vector_init_interleave (enum machine_mode mode,
for (i = j = 0; i < n / 2; i += 2, j++)
{
op0 = gen_reg_rtx (second_imode);
- emit_insn ((*gen_interleave_second_low) (op0, ops[i],
- ops[i + 1]));
+ emit_insn (gen_interleave_second_low (op0, ops[i],
+ ops[i + 1]));
/* Cast the SECOND_IMODE vector to the THIRD_IMODE
vector. */
@@ -27743,8 +28328,8 @@ ix86_expand_vector_init_interleave (enum machine_mode mode,
case V2DImode:
op0 = gen_reg_rtx (second_imode);
- emit_insn ((*gen_interleave_second_low) (op0, ops[0],
- ops[1]));
+ emit_insn (gen_interleave_second_low (op0, ops[0],
+ ops[1]));
/* Cast the SECOND_IMODE vector back to a vector on original
mode. */
@@ -28175,13 +28760,13 @@ half:
/* Extract the half. */
tmp = gen_reg_rtx (half_mode);
- emit_insn ((*gen_extract[j][i]) (tmp, target));
+ emit_insn (gen_extract[j][i] (tmp, target));
/* Put val in tmp at elt. */
ix86_expand_vector_set (false, tmp, val, elt);
/* Put it back. */
- emit_insn ((*gen_insert[j][i]) (target, target, tmp));
+ emit_insn (gen_insert[j][i] (target, target, tmp));
return;
default:
@@ -29370,7 +29955,9 @@ static const struct attribute_spec ix86_attribute_table[] =
/* Implement targetm.vectorize.builtin_vectorization_cost. */
static int
-ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost)
+ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
+ tree vectype ATTRIBUTE_UNUSED,
+ int misalign ATTRIBUTE_UNUSED)
{
switch (type_of_cost)
{
@@ -29399,6 +29986,7 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost)
return ix86_cost->scalar_to_vec_cost;
case unaligned_load:
+ case unaligned_store:
return ix86_cost->vec_unalign_load_cost;
case cond_branch_taken:
@@ -30619,10 +31207,12 @@ ix86_canonical_va_list_type (tree type)
tree wtype, htype;
/* Resolve references and pointers to va_list type. */
- if (INDIRECT_REF_P (type))
+ if (TREE_CODE (type) == MEM_REF)
type = TREE_TYPE (type);
else if (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE(type)))
type = TREE_TYPE (type);
+ else if (POINTER_TYPE_P (type) && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
if (TARGET_64BIT)
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index afe05f9f6db..e153920a5c1 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -66,6 +66,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define TARGET_AES OPTION_ISA_AES
#define TARGET_PCLMUL OPTION_ISA_PCLMUL
#define TARGET_CMPXCHG16B OPTION_ISA_CX16
+#define TARGET_FSGSBASE OPTION_ISA_FSGSBASE
+#define TARGET_RDRND OPTION_ISA_RDRND
+#define TARGET_F16C OPTION_ISA_F16C
/* SSE4.1 defines round instructions */
@@ -474,7 +477,13 @@ extern tree x86_mfence;
redefines this to 1. */
#define TARGET_MACHO 0
-/* Likewise, for the Windows 64-bit ABI. */
+/* Branch island 'stubs' are emitted for earlier versions of darwin.
+ This provides a default (over-ridden in darwin.h.) */
+#ifndef TARGET_MACHO_BRANCH_ISLANDS
+#define TARGET_MACHO_BRANCH_ISLANDS 0
+#endif
+
+/* For the Windows 64-bit ABI. */
#define TARGET_64BIT_MS_ABI (TARGET_64BIT && ix86_cfun_abi () == MS_ABI)
/* Available call abi. */
@@ -1812,10 +1821,11 @@ typedef struct ix86_args {
#define CLEAR_RATIO(speed) ((speed) ? MIN (6, ix86_cost->move_ratio) : 2)
-/* Define if shifts truncate the shift count
- which implies one can omit a sign-extension or zero-extension
- of a shift count. */
-/* On i386, shifts do truncate the count. But bit opcodes don't. */
+/* Define if shifts truncate the shift count which implies one can
+ omit a sign-extension or zero-extension of a shift count.
+
+ On i386, shifts do truncate the count. But bit test instructions
+ take the modulo of the bit offset operand. */
/* #define SHIFT_COUNT_TRUNCATED */
@@ -2079,6 +2089,13 @@ do { \
}
#endif
+/* Write the extra assembler code needed to declare a function
+ properly. */
+
+#undef ASM_OUTPUT_FUNCTION_LABEL
+#define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \
+ ix86_asm_output_function_label (FILE, NAME, DECL)
+
/* Under some conditions we need jump tables in the text section,
because the assembler cannot handle label differences between
sections. This is the case for x86_64 on Mach-O for example. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e361fd707ab..6616da2e729 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -79,13 +79,11 @@
;; Prologue support
UNSPEC_STACK_ALLOC
UNSPEC_SET_GOT
- UNSPEC_SSE_PROLOGUE_SAVE
UNSPEC_REG_SAVE
UNSPEC_DEF_CFA
UNSPEC_SET_RIP
UNSPEC_SET_GOT_OFFSET
UNSPEC_MEMORY_BLOCKAGE
- UNSPEC_SSE_PROLOGUE_SAVE_LOW
;; TLS support
UNSPEC_TP
@@ -226,11 +224,14 @@
UNSPEC_MASKSTORE
UNSPEC_CAST
UNSPEC_VTESTP
+ UNSPEC_VCVTPH2PS
+ UNSPEC_VCVTPS2PH
])
(define_c_enum "unspecv" [
UNSPECV_BLOCKAGE
UNSPECV_STACK_PROBE
+ UNSPECV_PROBE_STACK_RANGE
UNSPECV_EMMS
UNSPECV_LDMXCSR
UNSPECV_STMXCSR
@@ -254,6 +255,11 @@
UNSPECV_SLWP_INTRINSIC
UNSPECV_LWPVAL_INTRINSIC
UNSPECV_LWPINS_INTRINSIC
+ UNSPECV_RDFSBASE
+ UNSPECV_RDGSBASE
+ UNSPECV_WRFSBASE
+ UNSPECV_WRGSBASE
+ UNSPECV_RDRAND
])
;; Constants to represent pcomtrue/pcomfalse variants
@@ -760,8 +766,6 @@
;; Used in signed and unsigned divisions.
(define_code_iterator any_div [div udiv])
-(define_code_attr extract_code
- [(div "SIGN_EXTRACT") (udiv "ZERO_EXTRACT")])
;; Instruction prefix for signed and unsigned operations.
(define_code_attr sgnprefix [(sign_extend "i") (zero_extend "")
@@ -855,6 +859,13 @@
(SI "general_operand")
(DI "x86_64_szext_general_operand")])
+;; Immediate operand predicate for integer modes.
+(define_mode_attr immediate_operand
+ [(QI "immediate_operand")
+ (HI "immediate_operand")
+ (SI "immediate_operand")
+ (DI "x86_64_immediate_operand")])
+
;; Operand predicate for shifts.
(define_mode_attr shift_operand
[(QI "nonimmediate_operand")
@@ -6899,7 +6910,7 @@
(compare:CCC
(plus:SWI
(match_operand:SWI 1 "nonimmediate_operand" "%0")
- (match_operand:SWI 2 "<general_operand>" "<r><i>m"))
+ (match_operand:SWI 2 "<general_operand>" "<g>"))
(match_dup 1)))
(clobber (match_scratch:SWI 0 "=<r>"))]
"ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
@@ -7308,9 +7319,9 @@
;; Divmod instructions.
-(define_expand "<u>divmodqi4"
+(define_expand "divmodqi4"
[(parallel [(set (match_operand:QI 0 "register_operand" "")
- (any_div:QI
+ (div:QI
(match_operand:QI 1 "register_operand" "")
(match_operand:QI 2 "nonimmediate_operand" "")))
(set (match_operand:QI 3 "register_operand" "")
@@ -7326,36 +7337,58 @@
/* Extend operands[1] to HImode. Generate 8bit divide. Result is
in AX. */
- if (<extract_code> == SIGN_EXTRACT)
- {
- emit_insn (gen_extendqihi2 (tmp1, operands[1]));
- emit_insn (gen_divmodhiqi3 (tmp0, tmp1, operands[2]));
+ emit_insn (gen_extendqihi2 (tmp1, operands[1]));
+ emit_insn (gen_divmodhiqi3 (tmp0, tmp1, operands[2]));
- div = gen_rtx_DIV (QImode, operands[1], operands[2]);
- mod = gen_rtx_MOD (QImode, operands[1], operands[2]);
+ /* Extract remainder from AH. */
+ tmp1 = gen_rtx_SIGN_EXTRACT (QImode, tmp0, GEN_INT (8), GEN_INT (8));
+ insn = emit_move_insn (operands[3], tmp1);
- tmp1 = gen_rtx_<extract_code> (QImode, tmp0,
- GEN_INT (8), GEN_INT (8));
- }
- else
- {
- emit_insn (gen_zero_extendqihi2 (tmp1, operands[1]));
- emit_insn (gen_udivmodhiqi3 (tmp0, tmp1, operands[2]));
+ mod = gen_rtx_MOD (QImode, operands[1], operands[2]);
+ set_unique_reg_note (insn, REG_EQUAL, mod);
+
+ /* Extract quotient from AL. */
+ insn = emit_move_insn (operands[0], gen_lowpart (QImode, tmp0));
- div = gen_rtx_UDIV (QImode, operands[1], operands[2]);
- mod = gen_rtx_UMOD (QImode, operands[1], operands[2]);
+ div = gen_rtx_DIV (QImode, operands[1], operands[2]);
+ set_unique_reg_note (insn, REG_EQUAL, div);
- tmp1 = gen_rtx_<extract_code> (SImode, tmp0,
- GEN_INT (8), GEN_INT (8));
- tmp1 = simplify_gen_subreg (QImode, tmp1, SImode, 0);
- }
+ DONE;
+})
+
+(define_expand "udivmodqi4"
+ [(parallel [(set (match_operand:QI 0 "register_operand" "")
+ (udiv:QI
+ (match_operand:QI 1 "register_operand" "")
+ (match_operand:QI 2 "nonimmediate_operand" "")))
+ (set (match_operand:QI 3 "register_operand" "")
+ (umod:QI (match_dup 1) (match_dup 2)))
+ (clobber (reg:CC FLAGS_REG))])]
+ "TARGET_QIMODE_MATH"
+{
+ rtx div, mod, insn;
+ rtx tmp0, tmp1;
+
+ tmp0 = gen_reg_rtx (HImode);
+ tmp1 = gen_reg_rtx (HImode);
+
+ /* Extend operands[1] to HImode. Generate 8bit divide. Result is
+ in AX. */
+ emit_insn (gen_zero_extendqihi2 (tmp1, operands[1]));
+ emit_insn (gen_udivmodhiqi3 (tmp0, tmp1, operands[2]));
/* Extract remainder from AH. */
+ tmp1 = gen_rtx_ZERO_EXTRACT (SImode, tmp0, GEN_INT (8), GEN_INT (8));
+ tmp1 = simplify_gen_subreg (QImode, tmp1, SImode, 0);
insn = emit_move_insn (operands[3], tmp1);
+
+ mod = gen_rtx_UMOD (QImode, operands[1], operands[2]);
set_unique_reg_note (insn, REG_EQUAL, mod);
/* Extract quotient from AL. */
insn = emit_move_insn (operands[0], gen_lowpart (QImode, tmp0));
+
+ div = gen_rtx_UDIV (QImode, operands[1], operands[2]);
set_unique_reg_note (insn, REG_EQUAL, div);
DONE;
@@ -7364,15 +7397,22 @@
;; Divide AX by r/m8, with result stored in
;; AL <- Quotient
;; AH <- Remainder
+;; Change div/mod to HImode and extend the second argument to HImode
+;; so that mode of div/mod matches with mode of arguments. Otherwise
+;; combine may fail.
(define_insn "divmodhiqi3"
[(set (match_operand:HI 0 "register_operand" "=a")
(ior:HI
(ashift:HI
(zero_extend:HI
- (mod:QI (match_operand:HI 1 "register_operand" "0")
- (match_operand:QI 2 "nonimmediate_operand" "qm")))
+ (truncate:QI
+ (mod:HI (match_operand:HI 1 "register_operand" "0")
+ (sign_extend:HI
+ (match_operand:QI 2 "nonimmediate_operand" "qm")))))
(const_int 8))
- (zero_extend:HI (div:QI (match_dup 1) (match_dup 2)))))
+ (zero_extend:HI
+ (truncate:QI
+ (div:HI (match_dup 1) (sign_extend:HI (match_dup 2)))))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_QIMODE_MATH"
"idiv{b}\t%2"
@@ -7384,10 +7424,14 @@
(ior:HI
(ashift:HI
(zero_extend:HI
- (umod:QI (match_operand:HI 1 "register_operand" "0")
- (match_operand:QI 2 "nonimmediate_operand" "qm")))
+ (truncate:QI
+ (mod:HI (match_operand:HI 1 "register_operand" "0")
+ (zero_extend:HI
+ (match_operand:QI 2 "nonimmediate_operand" "qm")))))
(const_int 8))
- (zero_extend:HI (udiv:QI (match_dup 1) (match_dup 2)))))
+ (zero_extend:HI
+ (truncate:QI
+ (div:HI (match_dup 1) (zero_extend:HI (match_dup 2)))))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_QIMODE_MATH"
"div{b}\t%2"
@@ -10301,6 +10345,8 @@
(match_operand 3 "register_operand" ""))]
""
{
+ rtx (*gen_mov_insv_1) (rtx, rtx);
+
/* Handle insertions to %ah et al. */
if (INTVAL (operands[1]) != 8 || INTVAL (operands[2]) != 8)
FAIL;
@@ -10310,11 +10356,10 @@
if (! ext_register_operand (operands[0], VOIDmode))
FAIL;
- if (TARGET_64BIT)
- emit_insn (gen_movdi_insv_1 (operands[0], operands[3]));
- else
- emit_insn (gen_movsi_insv_1 (operands[0], operands[3]));
+ gen_mov_insv_1 = (TARGET_64BIT
+ ? gen_movdi_insv_1 : gen_movsi_insv_1);
+ emit_insn (gen_mov_insv_1 (operands[0], operands[3]));
DONE;
})
@@ -13001,6 +13046,8 @@
(use (match_operand:MODEF 2 "general_operand" ""))]
"TARGET_USE_FANCY_MATH_387"
{
+ rtx (*gen_truncxf) (rtx, rtx);
+
rtx label = gen_label_rtx ();
rtx op1 = gen_reg_rtx (XFmode);
@@ -13017,10 +13064,11 @@
/* Truncate the result properly for strict SSE math. */
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& !TARGET_MIX_SSE_I387)
- emit_insn (gen_truncxf<mode>2 (operands[0], op1));
+ gen_truncxf = gen_truncxf<mode>2;
else
- emit_insn (gen_truncxf<mode>2_i387_noop_unspec (operands[0], op1));
+ gen_truncxf = gen_truncxf<mode>2_i387_noop_unspec;
+ emit_insn (gen_truncxf (operands[0], op1));
DONE;
})
@@ -13069,6 +13117,8 @@
(use (match_operand:MODEF 2 "general_operand" ""))]
"TARGET_USE_FANCY_MATH_387"
{
+ rtx (*gen_truncxf) (rtx, rtx);
+
rtx label = gen_label_rtx ();
rtx op1 = gen_reg_rtx (XFmode);
@@ -13086,10 +13136,11 @@
/* Truncate the result properly for strict SSE math. */
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& !TARGET_MIX_SSE_I387)
- emit_insn (gen_truncxf<mode>2 (operands[0], op1));
+ gen_truncxf = gen_truncxf<mode>2;
else
- emit_insn (gen_truncxf<mode>2_i387_noop_unspec (operands[0], op1));
+ gen_truncxf = gen_truncxf<mode>2_i387_noop_unspec;
+ emit_insn (gen_truncxf (operands[0], op1));
DONE;
})
@@ -15695,13 +15746,12 @@
}
else
{
- rtx (*cmp_insn)(rtx, rtx);
+ rtx (*gen_cmp) (rtx, rtx);
- if (TARGET_64BIT)
- cmp_insn = gen_cmpdi_1;
- else
- cmp_insn = gen_cmpsi_1;
- emit_insn (cmp_insn (countreg, countreg));
+ gen_cmp = (TARGET_64BIT
+ ? gen_cmpdi_1 : gen_cmpsi_1);
+
+ emit_insn (gen_cmp (countreg, countreg));
emit_insn (gen_cmpstrnqi_1 (addr1, addr2, countreg, align,
operands[1], operands[2]));
}
@@ -16315,79 +16365,37 @@
;; [(set (mem (plus (reg ebp) (const_int -160000))) (const_int 0))]
;;
;; in proper program order.
-(define_insn "pro_epilogue_adjust_stack_1"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (plus:SI (match_operand:SI 1 "register_operand" "0,r")
- (match_operand:SI 2 "immediate_operand" "i,i")))
- (clobber (reg:CC FLAGS_REG))
- (clobber (mem:BLK (scratch)))]
- "!TARGET_64BIT"
-{
- switch (get_attr_type (insn))
- {
- case TYPE_IMOV:
- return "mov{l}\t{%1, %0|%0, %1}";
-
- case TYPE_ALU:
- gcc_assert (rtx_equal_p (operands[0], operands[1]));
- if (x86_maybe_negate_const_int (&operands[2], SImode))
- return "sub{l}\t{%2, %0|%0, %2}";
- return "add{l}\t{%2, %0|%0, %2}";
-
- default:
- operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
- return "lea{l}\t{%a2, %0|%0, %a2}";
- }
-}
- [(set (attr "type")
- (cond [(and (eq_attr "alternative" "0")
- (eq (symbol_ref "TARGET_OPT_AGU") (const_int 0)))
- (const_string "alu")
- (match_operand:SI 2 "const0_operand" "")
- (const_string "imov")
- ]
- (const_string "lea")))
- (set (attr "length_immediate")
- (cond [(eq_attr "type" "imov")
- (const_string "0")
- (and (eq_attr "type" "alu")
- (match_operand 2 "const128_operand" ""))
- (const_string "1")
- ]
- (const_string "*")))
- (set_attr "mode" "SI")])
-
-(define_insn "pro_epilogue_adjust_stack_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r,r")
- (plus:DI (match_operand:DI 1 "register_operand" "0,r")
- (match_operand:DI 2 "x86_64_immediate_operand" "e,e")))
+(define_insn "pro_epilogue_adjust_stack_<mode>_1"
+ [(set (match_operand:P 0 "register_operand" "=r,r")
+ (plus:P (match_operand:P 1 "register_operand" "0,r")
+ (match_operand:P 2 "<immediate_operand>" "<i>,<i>")))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))]
- "TARGET_64BIT"
+ ""
{
switch (get_attr_type (insn))
{
case TYPE_IMOV:
- return "mov{q}\t{%1, %0|%0, %1}";
+ return "mov{<imodesuffix>}\t{%1, %0|%0, %1}";
case TYPE_ALU:
gcc_assert (rtx_equal_p (operands[0], operands[1]));
- if (x86_maybe_negate_const_int (&operands[2], DImode))
- return "sub{q}\t{%2, %0|%0, %2}";
+ if (x86_maybe_negate_const_int (&operands[2], <MODE>mode))
+ return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
- return "add{q}\t{%2, %0|%0, %2}";
+ return "add{<imodesuffix>}\t{%2, %0|%0, %2}";
default:
operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
- return "lea{q}\t{%a2, %0|%0, %a2}";
+ return "lea{<imodesuffix>}\t{%a2, %0|%0, %a2}";
}
}
[(set (attr "type")
(cond [(and (eq_attr "alternative" "0")
- (eq (symbol_ref "TARGET_OPT_AGU") (const_int 0)))
+ (eq (symbol_ref "TARGET_OPT_AGU") (const_int 0)))
(const_string "alu")
- (match_operand:DI 2 "const0_operand" "")
+ (match_operand:<MODE> 2 "const0_operand" "")
(const_string "imov")
]
(const_string "lea")))
@@ -16399,9 +16407,9 @@
(const_string "1")
]
(const_string "*")))
- (set_attr "mode" "DI")])
+ (set_attr "mode" "<MODE>")])
-(define_insn "pro_epilogue_adjust_stack_rex64_2"
+(define_insn "pro_epilogue_adjust_stack_di_2"
[(set (match_operand:DI 0 "register_operand" "=r,r")
(plus:DI (match_operand:DI 1 "register_operand" "0,r")
(match_operand:DI 3 "immediate_operand" "i,i")))
@@ -16432,7 +16440,7 @@
UNSPECV_STACK_PROBE))
(set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 1)))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && TARGET_STACK_PROBE"
+ "!TARGET_64BIT && ix86_target_stack_probe ()"
"call\t___chkstk"
[(set_attr "type" "multi")
(set_attr "length" "5")])
@@ -16445,7 +16453,7 @@
(clobber (reg:DI R10_REG))
(clobber (reg:DI R11_REG))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && TARGET_STACK_PROBE"
+ "TARGET_64BIT && ix86_target_stack_probe ()"
"call\t___chkstk"
[(set_attr "type" "multi")
(set_attr "length" "5")])
@@ -16453,7 +16461,7 @@
(define_expand "allocate_stack"
[(match_operand 0 "register_operand" "")
(match_operand 1 "general_operand" "")]
- "TARGET_STACK_PROBE"
+ "ix86_target_stack_probe ()"
{
rtx x;
@@ -16471,12 +16479,15 @@
}
else
{
- x = copy_to_mode_reg (Pmode, operands[1]);
+ rtx (*gen_allocate_stack_worker) (rtx, rtx);
+
if (TARGET_64BIT)
- x = gen_allocate_stack_worker_64 (x, x);
+ gen_allocate_stack_worker = gen_allocate_stack_worker_64;
else
- x = gen_allocate_stack_worker_32 (x, x);
- emit_insn (x);
+ gen_allocate_stack_worker = gen_allocate_stack_worker_32;
+
+ x = copy_to_mode_reg (Pmode, operands[1]);
+ emit_insn (gen_allocate_stack_worker (x, x));
}
emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
@@ -16488,13 +16499,37 @@
[(match_operand 0 "memory_operand" "")]
""
{
- if (GET_MODE (operands[0]) == DImode)
- emit_insn (gen_iordi3 (operands[0], operands[0], const0_rtx));
- else
- emit_insn (gen_iorsi3 (operands[0], operands[0], const0_rtx));
+ rtx (*gen_ior3) (rtx, rtx, rtx);
+
+ gen_ior3 = (GET_MODE (operands[0]) == DImode
+ ? gen_iordi3 : gen_iorsi3);
+
+ emit_insn (gen_ior3 (operands[0], operands[0], const0_rtx));
DONE;
})
+(define_insn "adjust_stack_and_probe<mode>"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec_volatile:P [(match_operand:P 1 "register_operand" "0")]
+ UNSPECV_PROBE_STACK_RANGE))
+ (set (reg:P SP_REG)
+ (minus:P (reg:P SP_REG) (match_operand:P 2 "const_int_operand" "n")))
+ (clobber (reg:CC FLAGS_REG))
+ (clobber (mem:BLK (scratch)))]
+ ""
+ "* return output_adjust_stack_and_probe (operands[0]);"
+ [(set_attr "type" "multi")])
+
+(define_insn "probe_stack_range<mode>"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec_volatile:P [(match_operand:P 1 "register_operand" "0")
+ (match_operand:P 2 "const_int_operand" "n")]
+ UNSPECV_PROBE_STACK_RANGE))
+ (clobber (reg:CC FLAGS_REG))]
+ ""
+ "* return output_probe_stack_range (operands[0], operands[2]);"
+ [(set_attr "type" "multi")])
+
(define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))]
"!TARGET_64BIT && flag_pic"
@@ -17403,7 +17438,7 @@
[(set (match_dup 0)
(plus:SI (mult:SI (match_dup 1) (match_dup 2))
(match_dup 1)))]
- { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); })
+ "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")
(define_peephole2
[(parallel
@@ -17419,7 +17454,7 @@
(set (match_dup 0)
(plus:SI (mult:SI (match_dup 0) (match_dup 2))
(match_dup 0)))]
- { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); })
+ "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")
(define_peephole2
[(parallel
@@ -17434,7 +17469,7 @@
[(set (match_dup 0)
(plus:DI (mult:DI (match_dup 1) (match_dup 2))
(match_dup 1)))]
- { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); })
+ "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")
(define_peephole2
[(parallel
@@ -17451,7 +17486,7 @@
(set (match_dup 0)
(plus:DI (mult:DI (match_dup 0) (match_dup 2))
(match_dup 0)))]
- { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); })
+ "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")
;; Imul $32bit_imm, mem, reg is vector decoded, while
;; imul $32bit_imm, reg, reg is direct decoded.
@@ -17466,7 +17501,7 @@
[(set (match_dup 3) (match_dup 1))
(parallel [(set (match_dup 0) (mult:DI (match_dup 3) (match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
-"")
+ "")
(define_peephole2
[(match_scratch:SI 3 "r")
@@ -17479,7 +17514,7 @@
[(set (match_dup 3) (match_dup 1))
(parallel [(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]
-"")
+ "")
(define_peephole2
[(match_scratch:SI 3 "r")
@@ -17491,9 +17526,10 @@
"TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p ()
&& !satisfies_constraint_K (operands[2])"
[(set (match_dup 3) (match_dup 1))
- (parallel [(set (match_dup 0) (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2))))
+ (parallel [(set (match_dup 0)
+ (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2))))
(clobber (reg:CC FLAGS_REG))])]
-"")
+ "")
;; imul $8/16bit_imm, regmem, reg is vector decoded.
;; Convert it into imul reg, reg
@@ -17575,6 +17611,8 @@
|| GET_MODE (operands[0]) == HImode))
|| GET_MODE (operands[0]) == SImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == DImode))
+ && (rtx_equal_p (operands[0], operands[3])
+ || peep2_reg_dead_p (2, operands[0]))
/* We reorder load and the shift. */
&& !reg_overlap_mentioned_p (operands[0], operands[4])"
[(set (match_dup 5) (match_dup 4))
@@ -17785,178 +17823,6 @@
{ return ASM_SHORT "0x0b0f"; }
[(set_attr "length" "2")])
-(define_expand "sse_prologue_save"
- [(parallel [(set (match_operand:BLK 0 "" "")
- (unspec:BLK [(reg:DI XMM0_REG)
- (reg:DI XMM1_REG)
- (reg:DI XMM2_REG)
- (reg:DI XMM3_REG)
- (reg:DI XMM4_REG)
- (reg:DI XMM5_REG)
- (reg:DI XMM6_REG)
- (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE))
- (clobber (reg:CC FLAGS_REG))
- (clobber (match_operand:DI 1 "register_operand" ""))
- (use (match_operand:DI 2 "immediate_operand" ""))
- (use (label_ref:DI (match_operand 3 "" "")))
- (clobber (match_operand:DI 4 "register_operand" ""))
- (use (match_dup 1))])]
- "TARGET_64BIT"
- "")
-
-;; Pre-reload version of prologue save. Until after prologue generation we don't know
-;; what the size of save instruction will be.
-;; Operand 0+operand 6 is the memory save area
-;; Operand 1 is number of registers to save (will get overwritten to operand 5)
-;; Operand 2 is number of non-vaargs SSE arguments
-;; Operand 3 is label starting the save block
-;; Operand 4 is used for temporary computation of jump address
-(define_insn "*sse_prologue_save_insn1"
- [(set (mem:BLK (plus:DI (match_operand:DI 0 "register_operand" "R")
- (match_operand:DI 6 "const_int_operand" "n")))
- (unspec:BLK [(reg:DI XMM0_REG)
- (reg:DI XMM1_REG)
- (reg:DI XMM2_REG)
- (reg:DI XMM3_REG)
- (reg:DI XMM4_REG)
- (reg:DI XMM5_REG)
- (reg:DI XMM6_REG)
- (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE))
- (clobber (reg:CC FLAGS_REG))
- (clobber (match_operand:DI 1 "register_operand" "=r"))
- (use (match_operand:DI 2 "const_int_operand" "i"))
- (use (label_ref:DI (match_operand 3 "" "X")))
- (clobber (match_operand:DI 4 "register_operand" "=&r"))
- (use (match_operand:DI 5 "register_operand" "1"))]
- "TARGET_64BIT
- && INTVAL (operands[6]) + X86_64_SSE_REGPARM_MAX * 16 - 16 < 128
- && INTVAL (operands[6]) + INTVAL (operands[2]) * 16 >= -128"
- "#"
- [(set_attr "type" "other")
- (set_attr "memory" "store")
- (set_attr "mode" "DI")])
-
-;; We know size of save instruction; expand the computation of jump address
-;; in the jumptable.
-(define_split
- [(parallel [(set (match_operand:BLK 0 "" "")
- (unspec:BLK [(reg:DI XMM0_REG)
- (reg:DI XMM1_REG)
- (reg:DI XMM2_REG)
- (reg:DI XMM3_REG)
- (reg:DI XMM4_REG)
- (reg:DI XMM5_REG)
- (reg:DI XMM6_REG)
- (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE))
- (clobber (reg:CC FLAGS_REG))
- (clobber (match_operand:DI 1 "register_operand" ""))
- (use (match_operand:DI 2 "const_int_operand" ""))
- (use (match_operand 3 "" ""))
- (clobber (match_operand:DI 4 "register_operand" ""))
- (use (match_operand:DI 5 "register_operand" ""))])]
- "reload_completed"
- [(parallel [(set (match_dup 0)
- (unspec:BLK [(reg:DI XMM0_REG)
- (reg:DI XMM1_REG)
- (reg:DI XMM2_REG)
- (reg:DI XMM3_REG)
- (reg:DI XMM4_REG)
- (reg:DI XMM5_REG)
- (reg:DI XMM6_REG)
- (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE_LOW))
- (use (match_dup 1))
- (use (match_dup 2))
- (use (match_dup 3))
- (use (match_dup 5))])]
-{
- /* Movaps is 4 bytes, AVX and movsd is 5 bytes. */
- int size = 4 + (TARGET_AVX || crtl->stack_alignment_needed < 128);
-
- /* Compute address to jump to:
- label - eax*size + nnamed_sse_arguments*size. */
- if (size == 5)
- emit_insn (gen_rtx_SET (VOIDmode, operands[4],
- gen_rtx_PLUS
- (Pmode,
- gen_rtx_MULT (Pmode, operands[1],
- GEN_INT (4)),
- operands[1])));
- else if (size == 4)
- emit_insn (gen_rtx_SET (VOIDmode, operands[4],
- gen_rtx_MULT (Pmode, operands[1],
- GEN_INT (4))));
- else
- gcc_unreachable ();
- if (INTVAL (operands[2]))
- emit_move_insn
- (operands[1],
- gen_rtx_CONST (DImode,
- gen_rtx_PLUS (DImode,
- operands[3],
- GEN_INT (INTVAL (operands[2])
- * size))));
- else
- emit_move_insn (operands[1], operands[3]);
- emit_insn (gen_subdi3 (operands[1], operands[1], operands[4]));
- operands[5] = GEN_INT (size);
-})
-
-(define_insn "sse_prologue_save_insn"
- [(set (mem:BLK (plus:DI (match_operand:DI 0 "register_operand" "R")
- (match_operand:DI 4 "const_int_operand" "n")))
- (unspec:BLK [(reg:DI XMM0_REG)
- (reg:DI XMM1_REG)
- (reg:DI XMM2_REG)
- (reg:DI XMM3_REG)
- (reg:DI XMM4_REG)
- (reg:DI XMM5_REG)
- (reg:DI XMM6_REG)
- (reg:DI XMM7_REG)] UNSPEC_SSE_PROLOGUE_SAVE_LOW))
- (use (match_operand:DI 1 "register_operand" "r"))
- (use (match_operand:DI 2 "const_int_operand" "i"))
- (use (label_ref:DI (match_operand 3 "" "X")))
- (use (match_operand:DI 5 "const_int_operand" "i"))]
- "TARGET_64BIT
- && INTVAL (operands[4]) + X86_64_SSE_REGPARM_MAX * 16 - 16 < 128
- && INTVAL (operands[4]) + INTVAL (operands[2]) * 16 >= -128"
-{
- int i;
- operands[0] = gen_rtx_MEM (Pmode,
- gen_rtx_PLUS (Pmode, operands[0], operands[4]));
- /* VEX instruction with a REX prefix will #UD. */
- if (TARGET_AVX && GET_CODE (XEXP (operands[0], 0)) != PLUS)
- gcc_unreachable ();
-
- output_asm_insn ("jmp\t%A1", operands);
- for (i = X86_64_SSE_REGPARM_MAX - 1; i >= INTVAL (operands[2]); i--)
- {
- operands[4] = adjust_address (operands[0], DImode, i*16);
- operands[5] = gen_rtx_REG (TImode, SSE_REGNO (i));
- PUT_MODE (operands[4], TImode);
- if (GET_CODE (XEXP (operands[0], 0)) != PLUS)
- output_asm_insn ("rex", operands);
- if (crtl->stack_alignment_needed < 128)
- output_asm_insn ("%vmovsd\t{%5, %4|%4, %5}", operands);
- else
- output_asm_insn ("%vmovaps\t{%5, %4|%4, %5}", operands);
- }
- (*targetm.asm_out.internal_label) (asm_out_file, "L",
- CODE_LABEL_NUMBER (operands[3]));
- return "";
-}
- [(set_attr "type" "other")
- (set_attr "length_immediate" "0")
- (set_attr "length_address" "0")
- ;; 2 bytes for jump and opernds[4] bytes for each save.
- (set (attr "length")
- (plus (const_int 2)
- (mult (symbol_ref ("INTVAL (operands[5])"))
- (symbol_ref ("X86_64_SSE_REGPARM_MAX - INTVAL (operands[2])")))))
- (set_attr "memory" "store")
- (set_attr "modrm" "0")
- (set_attr "prefix" "maybe_vex")
- (set_attr "mode" "DI")])
-
(define_expand "prefetch"
[(prefetch (match_operand 0 "address_operand" "")
(match_operand:SI 1 "const_int_operand" "")
@@ -18444,6 +18310,71 @@
(set (attr "length")
(symbol_ref "ix86_attr_length_address_default (insn) + 9"))])
+(define_insn "rdfsbase<mode>"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (unspec_volatile:SWI48 [(const_int 0)] UNSPECV_RDFSBASE))]
+ "TARGET_64BIT && TARGET_FSGSBASE"
+ "rdfsbase %0"
+ [(set_attr "type" "other")
+ (set_attr "prefix_extra" "2")])
+
+(define_insn "rdgsbase<mode>"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (unspec_volatile:SWI48 [(const_int 0)] UNSPECV_RDGSBASE))]
+ "TARGET_64BIT && TARGET_FSGSBASE"
+ "rdgsbase %0"
+ [(set_attr "type" "other")
+ (set_attr "prefix_extra" "2")])
+
+(define_insn "wrfsbase<mode>"
+ [(unspec_volatile [(match_operand:SWI48 0 "register_operand" "r")]
+ UNSPECV_WRFSBASE)]
+ "TARGET_64BIT && TARGET_FSGSBASE"
+ "wrfsbase %0"
+ [(set_attr "type" "other")
+ (set_attr "prefix_extra" "2")])
+
+(define_insn "wrgsbase<mode>"
+ [(unspec_volatile [(match_operand:SWI48 0 "register_operand" "r")]
+ UNSPECV_WRGSBASE)]
+ "TARGET_64BIT && TARGET_FSGSBASE"
+ "wrgsbase %0"
+ [(set_attr "type" "other")
+ (set_attr "prefix_extra" "2")])
+
+(define_expand "rdrand<mode>"
+ [(set (match_operand:SWI248 0 "register_operand" "=r")
+ (unspec_volatile:SWI248 [(const_int 0)] UNSPECV_RDRAND))]
+ "TARGET_RDRND"
+{
+ rtx retry_label, insn, ccc;
+
+ retry_label = gen_label_rtx ();
+
+ emit_label (retry_label);
+
+ /* Generate rdrand. */
+ emit_insn (gen_rdrand<mode>_1 (operands[0]));
+
+ /* Retry if the carry flag isn't valid. */
+ ccc = gen_rtx_REG (CCCmode, FLAGS_REG);
+ ccc = gen_rtx_EQ (VOIDmode, ccc, const0_rtx);
+ ccc = gen_rtx_IF_THEN_ELSE (VOIDmode, ccc, pc_rtx,
+ gen_rtx_LABEL_REF (VOIDmode, retry_label));
+ insn = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, ccc));
+ JUMP_LABEL (insn) = retry_label;
+
+ DONE;
+})
+
+(define_insn "rdrand<mode>_1"
+ [(set (match_operand:SWI248 0 "register_operand" "=r")
+ (unspec_volatile:SWI248 [(const_int 0)] UNSPECV_RDRAND))]
+ "TARGET_RDRND"
+ "rdrand %0"
+ [(set_attr "type" "other")
+ (set_attr "prefix_extra" "1")])
+
(include "mmx.md")
(include "sse.md")
(include "sync.md")
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 0afdd1197f6..f264c42a45d 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -363,3 +363,15 @@ Support PCLMUL built-in functions and code generation
msse2avx
Target Report Var(ix86_sse2avx)
Encode SSE instructions with VEX prefix
+
+mfsgsbase
+Target Report Mask(ISA_FSGSBASE) Var(ix86_isa_flags) VarExists Save
+Support FSGSBASE built-in functions and code generation
+
+mrdrnd
+Target Report Mask(ISA_RDRND) Var(ix86_isa_flags) VarExists Save
+Support RDRND built-in functions and code generation
+
+mf16c
+Target Report Mask(ISA_F16C) Var(ix86_isa_flags) VarExists Save
+Support F16C built-in functions and code generation
diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h
index 7a2b9b9c63e..3e69060700a 100644
--- a/gcc/config/i386/immintrin.h
+++ b/gcc/config/i386/immintrin.h
@@ -56,4 +56,148 @@
#include <avxintrin.h>
#endif
+#ifdef __RDRND__
+extern __inline unsigned short
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_rdrand_u16 (void)
+{
+ return __builtin_ia32_rdrand16 ();
+}
+
+extern __inline unsigned int
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_rdrand_u32 (void)
+{
+ return __builtin_ia32_rdrand32 ();
+}
+#endif /* __RDRND__ */
+
+#ifdef __x86_64__
+#ifdef __FSGSBASE__
+extern __inline unsigned int
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_readfsbase_u32 (void)
+{
+ return __builtin_ia32_rdfsbase32 ();
+}
+
+extern __inline unsigned long long
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_readfsbase_u64 (void)
+{
+ return __builtin_ia32_rdfsbase64 ();
+}
+
+extern __inline unsigned int
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_readgsbase_u32 (void)
+{
+ return __builtin_ia32_rdgsbase32 ();
+}
+
+extern __inline unsigned long long
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_readgsbase_u64 (void)
+{
+ return __builtin_ia32_rdgsbase64 ();
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_writefsbase_u32 (unsigned int __B)
+{
+ __builtin_ia32_wrfsbase32 (__B);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_writefsbase_u64 (unsigned long long __B)
+{
+ __builtin_ia32_wrfsbase64 (__B);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_writegsbase_u32 (unsigned int __B)
+{
+ __builtin_ia32_wrgsbase32 (__B);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_writegsbase_u64 (unsigned long long __B)
+{
+ __builtin_ia32_wrgsbase64 (__B);
+}
+#endif /* __FSGSBASE__ */
+
+#ifdef __RDRND__
+extern __inline unsigned long long
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_rdrand_u64 (void)
+{
+ return __builtin_ia32_rdrand64 ();
+}
+#endif /* __RDRND__ */
+#endif /* __x86_64__ */
+
+#ifdef __F16C__
+extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_cvtsh_ss (unsigned short __S)
+{
+ __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
+ __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
+ return __builtin_ia32_vec_ext_v4sf (__A, 0);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtph_ps (__m128i __A)
+{
+ return (__m128) __builtin_ia32_vcvtph2ps ((__v8hi) __A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtph_ps (__m128i __A)
+{
+ return (__m256) __builtin_ia32_vcvtph2ps256 ((__v8hi) __A);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_cvtss_sh (float __F, const int __I)
+{
+ __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 };
+ __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I);
+ return (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_ph (__m128 __A, const int __I)
+{
+ return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_cvtps_ph (__m256 __A, const int __I)
+{
+ return (__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf) __A, __I);
+}
+#else
+#define _cvtss_sh(__F, __I) \
+ (__extension__ \
+ ({ \
+ __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 }; \
+ __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I); \
+ (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0); \
+ }))
+
+#define _mm_cvtps_ph(A, I) \
+ ((__m128i) __builtin_ia32_vcvtps2ph ((__v4sf)(__m128) A, (int) (I)))
+
+#define _mm256_cvtps_ph(A, I) \
+ ((__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf)(__m256) A, (int) (I)))
+#endif
+
+#endif /* __F16C__ */
+
#endif /* _IMMINTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 2a31880e6d6..81dfd1e2509 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -209,6 +209,9 @@ along with GCC; see the file COPYING3. If not see
/* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
/* This macro may be overridden in i386/k*bsd-gnu.h. */
#define REG_NAME(reg) reg
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 867de59a5ec..33b4dc9cd8f 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -112,6 +112,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
/* This macro may be overridden in i386/k*bsd-gnu.h. */
#define REG_NAME(reg) reg
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index e08ea1cd90c..264abf1b148 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -245,5 +245,5 @@ __enable_execute_stack (void *addr) \
#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 "libgcj" /*LIBGCC_EH_EXTN*/ "-11.dll"
+#define LIBGCJ_SONAME "libgcj" /*LIBGCC_EH_EXTN*/ "-12.dll"
diff --git a/gcc/config/i386/netware.c b/gcc/config/i386/netware.c
index fa9ffbbeac1..555571adb44 100644
--- a/gcc/config/i386/netware.c
+++ b/gcc/config/i386/netware.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "flags.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "langhooks.h"
#include "ggc.h"
diff --git a/gcc/config/i386/nwld.c b/gcc/config/i386/nwld.c
index 9ae2aad3d35..ac0da7c3f00 100644
--- a/gcc/config/i386/nwld.c
+++ b/gcc/config/i386/nwld.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "flags.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
void
diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h
index d57ed7f9d69..c7fdec9a1a3 100644
--- a/gcc/config/i386/sol2-10.h
+++ b/gcc/config/i386/sol2-10.h
@@ -145,7 +145,3 @@ along with GCC; see the file COPYING3. If not see
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
-
-#undef SUBTARGET_RETURN_IN_MEMORY
-#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
- ix86_sol10_return_in_memory (TYPE, FNTYPE)
diff --git a/gcc/config/i386/sol2-unwind.h b/gcc/config/i386/sol2-unwind.h
index 41ffb03b6cd..d93b60c781c 100644
--- a/gcc/config/i386/sol2-unwind.h
+++ b/gcc/config/i386/sol2-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for AMD x86-64 and x86.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
state data appropriately. See unwind-dw2.c for the structs. */
#include <ucontext.h>
+#include <sys/frame.h>
#ifdef __x86_64__
@@ -39,7 +40,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
mcontext_t *mctx;
long new_cfa;
- if (/* Solaris 2.10
+ if (/* Solaris 10+
------------
<__sighndlr+0>: push %rbp
<__sighndlr+1>: mov %rsp,%rbp
@@ -47,15 +48,41 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
<__sighndlr+6>: leaveq <--- PC
<__sighndlr+7>: retq */
*(unsigned long *)(pc - 6) == 0xc3c9d1ffe5894855)
- /* We need to move up four frames (the kernel frame, the signal frame,
- the call_user_handler frame and the __sighndlr frame). Two of them
- have the minimum stack frame size (kernel and __sighndlr frames),
- the signal frame has a stack frame size of 32 and there is another
- with a stack frame size of 112 bytes (the call_user_handler frame).
- The ucontext_t structure is after this offset. */
+
+ /* We need to move up three frames:
+
+ <signal handler> <-- context->cfa
+ __sighndlr
+ call_user_handler
+ sigacthandler
+ <kernel>
+
+ context->cfa points into the frame after the saved frame pointer and
+ saved pc (struct frame).
+
+ The ucontext_t structure is in the kernel frame after the signal
+ number and a siginfo_t *. Since the frame sizes vary even within
+ Solaris 10 updates, we need to walk the stack to get there. */
{
- int off = 16 + 16 + 32 + 112;
- mctx = &((ucontext_t *) (context->cfa + off))->uc_mcontext;
+ struct frame *fp = (struct frame *) context->cfa - 1;
+ struct handler_args {
+ int signo;
+ siginfo_t *sip;
+ ucontext_t ucontext;
+ } *handler_args;
+ ucontext_t *ucp;
+
+ /* Next frame: __sighndlr frame pointer. */
+ fp = (struct frame *) fp->fr_savfp;
+ /* call_user_handler frame pointer. */
+ fp = (struct frame *) fp->fr_savfp;
+ /* sigacthandler frame pointer. */
+ fp = (struct frame *) fp->fr_savfp;
+
+ /* The argument area precedes the struct frame. */
+ handler_args = (struct handler_args *) (fp + 1);
+ ucp = &handler_args->ucontext;
+ mctx = &ucp->uc_mcontext;
}
else
return _URC_END_OF_STACK;
@@ -117,8 +144,8 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
mcontext_t *mctx;
long new_cfa;
- if (/* Solaris 2.8 - single thread
- -------------------------
+ if (/* Solaris 8 - single-threaded
+ ----------------------------
<sigacthandler+17>: mov 0x10(%ebp),%esi
<sigacthandler+20>: push %esi
<sigacthandler+21>: pushl 0xc(%ebp)
@@ -135,7 +162,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
&& *(unsigned long *)(pc - 4) == 0x8814ff00
&& *(unsigned long *)(pc - 0) == 0x560cc483)
- || /* Solaris 2.8 - multi thread
+ || /* Solaris 8 - multi-threaded
---------------------------
<__sighndlr+0>: push %ebp
<__sighndlr+1>: mov %esp,%ebp
@@ -149,8 +176,26 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
&& *(unsigned long *)(pc - 7) == 0x0875ff0c
&& *(unsigned long *)(pc - 3) == 0xc91455ff)
- || /* Solaris 2.10
- ------------
+ || /* Solaris 9 - single-threaded
+ ----------------------------
+ <sigacthandler+16>: mov 0x244(%ebx),%ecx
+ <sigacthandler+22>: mov 0x8(%ebp),%eax
+ <sigacthandler+25>: mov (%ecx,%eax,4),%ecx
+ <sigacthandler+28>: pushl 0x10(%ebp)
+ <sigacthandler+31>: pushl 0xc(%ebp)
+ <sigacthandler+34>: push %eax
+ <sigacthandler+35>: call *%ecx
+ <sigacthandler+37>: add $0xc,%esp <--- PC
+ <sigacthandler+40>: pushl 0x10(%ebp) */
+ (*(unsigned long *)(pc - 21) == 0x2448b8b
+ && *(unsigned long *)(pc - 17) == 0x458b0000
+ && *(unsigned long *)(pc - 13) == 0x810c8b08
+ && *(unsigned long *)(pc - 9) == 0xff1075ff
+ && *(unsigned long *)(pc - 5) == 0xff500c75
+ && *(unsigned long *)(pc - 1) == 0xcc483d1)
+
+ || /* Solaris 9 - multi-threaded, Solaris 10
+ ---------------------------------------
<__sighndlr+0>: push %ebp
<__sighndlr+1>: mov %esp,%ebp
<__sighndlr+3>: pushl 0x10(%ebp)
@@ -164,7 +209,43 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
&& *(unsigned long *)(pc - 11) == 0x75ff1075
&& *(unsigned long *)(pc - 7) == 0x0875ff0c
&& *(unsigned long *)(pc - 3) == 0x831455ff
- && *(unsigned long *)(pc + 1) == 0xc3c90cc4))
+ && *(unsigned long *)(pc + 1) == 0xc3c90cc4)
+
+ || /* Solaris 11 before snv_125
+ --------------------------
+ <__sighndlr+0> push %ebp
+ <__sighndlr+1> mov %esp,%ebp
+ <__sighndlr+4> pushl 0x10(%ebp)
+ <__sighndlr+6> pushl 0xc(%ebp)
+ <__sighndlr+9> pushl 0x8(%ebp)
+ <__sighndlr+12> call *0x14(%ebp)
+ <__sighndlr+15> add $0xc,%esp
+ <__sighndlr+18> leave <--- PC
+ <__sighndlr+19> ret */
+ (*(unsigned long *)(pc - 18) == 0xffec8b55
+ && *(unsigned long *)(pc - 14) == 0x7fff107f
+ && *(unsigned long *)(pc - 10) == 0x0875ff0c
+ && *(unsigned long *)(pc - 6) == 0x83145fff
+ && *(unsigned long *)(pc - 1) == 0xc3c90cc4)
+
+ || /* Solaris 11 since snv_125
+ -------------------------
+ <__sighndlr+0> push %ebp
+ <__sighndlr+1> mov %esp,%ebp
+ <__sighndlr+3> and $0xfffffff0,%esp
+ <__sighndlr+6> sub $0x4,%esp
+ <__sighndlr+9> pushl 0x10(%ebp)
+ <__sighndlr+12> pushl 0xc(%ebp)
+ <__sighndlr+15> pushl 0x8(%ebp)
+ <__sighndlr+18> call *0x14(%ebp)
+ <__sighndlr+21> leave <--- PC
+ <__sighndlr+22> ret */
+ (*(unsigned long *)(pc - 21) == 0x83ec8b55
+ && *(unsigned long *)(pc - 17) == 0xec83f0e4
+ && *(unsigned long *)(pc - 13) == 0x1075ff04
+ && *(unsigned long *)(pc - 9) == 0xff0c75ff
+ && *(unsigned long *)(pc - 5) == 0x55ff0875
+ && (*(unsigned long *)(pc - 1) & 0x00ffffff) == 0x00c3c914))
{
struct handler_args {
int signo;
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 11eaa15dd80..57f75ea5092 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -140,6 +140,10 @@ along with GCC; see the file COPYING3. If not see
/* Register the Solaris-specific #pragma directives. */
#define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
+#undef SUBTARGET_RETURN_IN_MEMORY
+#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
+ ix86_solaris_return_in_memory (TYPE, FNTYPE)
+
/* Output a simple call for .init/.fini. */
#define ASM_OUTPUT_CALL(FILE, FN) \
do \
@@ -154,6 +158,9 @@ along with GCC; see the file COPYING3. If not see
#undef X86_FILE_START_VERSION_DIRECTIVE
#define X86_FILE_START_VERSION_DIRECTIVE false
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
/* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
sections, so don't use them. */
#ifndef TARGET_GNU_LD
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index f5e716f2149..5ac0da875b6 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -12322,3 +12322,81 @@
(set_attr "length_immediate" "1,*")
(set_attr "prefix" "vex")
(set_attr "mode" "<avxvecmode>")])
+
+(define_insn "vcvtph2ps"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_select:V4SF
+ (unspec:V8SF [(match_operand:V8HI 1 "register_operand" "x")]
+ UNSPEC_VCVTPH2PS)
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 1) (const_int 2)])))]
+ "TARGET_F16C"
+ "vcvtph2ps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "*vcvtph2ps_load"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF [(match_operand:V4HI 1 "memory_operand" "m")]
+ UNSPEC_VCVTPH2PS))]
+ "TARGET_F16C"
+ "vcvtph2ps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vcvtph2ps256"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (unspec:V8SF [(match_operand:V8HI 1 "nonimmediate_operand" "xm")]
+ UNSPEC_VCVTPH2PS))]
+ "TARGET_F16C"
+ "vcvtph2ps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_expand "vcvtps2ph"
+ [(set (match_operand:V8HI 0 "register_operand" "")
+ (vec_concat:V8HI
+ (unspec:V4HI [(match_operand:V4SF 1 "register_operand" "")
+ (match_operand:SI 2 "immediate_operand" "")]
+ UNSPEC_VCVTPS2PH)
+ (match_dup 3)))]
+ "TARGET_F16C"
+ "operands[3] = CONST0_RTX (V4HImode);")
+
+(define_insn "*vcvtps2ph"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (unspec:V4HI [(match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:SI 2 "immediate_operand" "N")]
+ UNSPEC_VCVTPS2PH)
+ (match_operand:V4HI 3 "const0_operand" "")))]
+ "TARGET_F16C"
+ "vcvtps2ph\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "*vcvtps2ph_store"
+ [(set (match_operand:V4HI 0 "memory_operand" "=m")
+ (unspec:V4HI [(match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:SI 2 "immediate_operand" "N")]
+ UNSPEC_VCVTPS2PH))]
+ "TARGET_F16C"
+ "vcvtps2ph\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "vcvtps2ph256"
+ [(set (match_operand:V8HI 0 "nonimmediate_operand" "=xm")
+ (unspec:V8HI [(match_operand:V8SF 1 "register_operand" "x")
+ (match_operand:SI 2 "immediate_operand" "N")]
+ UNSPEC_VCVTPS2PH))]
+ "TARGET_F16C"
+ "vcvtps2ph\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
diff --git a/gcc/config/i386/vx-common.h b/gcc/config/i386/vx-common.h
index b4bea845fcd..cc7ea75ce40 100644
--- a/gcc/config/i386/vx-common.h
+++ b/gcc/config/i386/vx-common.h
@@ -1,5 +1,5 @@
/* IA32 VxWorks and VxWorks AE target definitions.
- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-/* VxWorks uses the same ABI as Solaris 10. */
+/* VxWorks uses the same ABI as Solaris 2. */
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
- ix86_sol10_return_in_memory (TYPE, FNTYPE)
+ ix86_solaris_return_in_memory (TYPE, FNTYPE)
diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c
index 9ae7ceda8a2..9191c08a676 100644
--- a/gcc/config/i386/winnt-cxx.c
+++ b/gcc/config/i386/winnt-cxx.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "cp/cp-tree.h" /* This is why we're a separate module. */
#include "flags.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "hashtab.h"
@@ -98,12 +99,12 @@ i386_pe_adjust_class_at_definition (tree t)
if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (t)) != NULL_TREE)
{
/* Check static VAR_DECL's. */
- for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
+ for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllexport (member);
/* Check FUNCTION_DECL's. */
- for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member))
+ for (member = TYPE_METHODS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == FUNCTION_DECL)
{
tree thunk;
@@ -115,7 +116,7 @@ i386_pe_adjust_class_at_definition (tree t)
maybe_add_dllexport (thunk);
}
/* Check vtables */
- for (member = CLASSTYPE_VTABLES (t); member; member = TREE_CHAIN (member))
+ for (member = CLASSTYPE_VTABLES (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllexport (member);
}
@@ -131,12 +132,12 @@ i386_pe_adjust_class_at_definition (tree t)
definition. */
/* Check static VAR_DECL's. */
- for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member))
+ for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllimport (member);
/* Check FUNCTION_DECL's. */
- for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member))
+ for (member = TYPE_METHODS (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == FUNCTION_DECL)
{
tree thunk;
@@ -144,12 +145,12 @@ i386_pe_adjust_class_at_definition (tree t)
/* Also add the attribute to its thunks. */
for (thunk = DECL_THUNKS (member); thunk;
- thunk = TREE_CHAIN (thunk))
+ thunk = DECL_CHAIN (thunk))
maybe_add_dllimport (thunk);
}
/* Check vtables */
- for (member = CLASSTYPE_VTABLES (t); member; member = TREE_CHAIN (member))
+ for (member = CLASSTYPE_VTABLES (t); member; member = DECL_CHAIN (member))
if (TREE_CODE (member) == VAR_DECL)
maybe_add_dllimport (member);
diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c
index a9c7cd7398f..f075e9626dc 100644
--- a/gcc/config/i386/winnt-stubs.c
+++ b/gcc/config/i386/winnt-stubs.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "flags.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "hashtab.h"
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index c20a2ae89fc..60a8b79d64a 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "flags.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "hashtab.h"
#include "langhooks.h"
@@ -722,7 +723,7 @@ i386_pe_file_end (void)
drectve_section ();
for (q = export_head; q != NULL; q = q->next)
{
- fprintf (asm_out_file, "\t.ascii \" -export:%s%s\"\n",
+ fprintf (asm_out_file, "\t.ascii \" -export:\\\"%s\\\"%s\"\n",
default_strip_name_encoding (q->name),
(q->is_data ? ",data" : ""));
}
diff --git a/gcc/config/ia64/ia64-c.c b/gcc/config/ia64/ia64-c.c
index 7a0bdd7a3cd..61a2b727a4a 100644
--- a/gcc/config/ia64/ia64-c.c
+++ b/gcc/config/ia64/ia64-c.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "cpplib.h"
#include "c-family/c-common.h"
#include "c-family/c-pragma.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index a5914b1a5ac..0a5af40f489 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -86,7 +86,6 @@ extern int ia64_epilogue_uses (int);
extern int ia64_eh_uses (int);
extern void emit_safe_across_calls (void);
extern void ia64_init_builtins (void);
-extern void ia64_override_options (void);
extern int ia64_dbx_register_number (int);
extern rtx ia64_return_addr_rtx (HOST_WIDE_INT, rtx);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 0b6df619244..475f3d9b587 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "basic-block.h"
#include "libfuncs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "sched-int.h"
#include "timevar.h"
@@ -59,6 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "tm-constrs.h"
#include "sel-sched.h"
+#include "reload.h"
/* This is used for communication between ASM_OUTPUT_LABEL and
ASM_OUTPUT_LABELREF. */
@@ -199,6 +201,7 @@ static rtx gen_movdi_x (rtx, rtx, rtx);
static rtx gen_fr_spill_x (rtx, rtx, rtx);
static rtx gen_fr_restore_x (rtx, rtx, rtx);
+static void ia64_option_override (void);
static bool ia64_can_eliminate (const int, const int);
static enum machine_mode hfa_element_mode (const_tree, bool);
static void ia64_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
@@ -210,8 +213,10 @@ static bool ia64_return_in_memory (const_tree, const_tree);
static rtx ia64_function_value (const_tree, const_tree, bool);
static rtx ia64_libcall_value (enum machine_mode, const_rtx);
static bool ia64_function_value_regno_p (const unsigned int);
-static int ia64_register_move_cost (enum machine_mode, enum reg_class,
- enum reg_class);
+static int ia64_register_move_cost (enum machine_mode, reg_class_t,
+ reg_class_t);
+static int ia64_memory_move_cost (enum machine_mode mode, reg_class_t,
+ bool);
static bool ia64_rtx_costs (rtx, int, int, int *, bool);
static int ia64_unspec_may_trap_p (const_rtx, unsigned);
static void fix_range (const char *);
@@ -350,6 +355,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER ia64_assemble_integer
+#undef TARGET_OPTION_OVERRIDE
+#define TARGET_OPTION_OVERRIDE ia64_option_override
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
#undef TARGET_ASM_FUNCTION_END_PROLOGUE
@@ -458,6 +466,8 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST ia64_register_move_cost
+#undef TARGET_MEMORY_MOVE_COST
+#define TARGET_MEMORY_MOVE_COST ia64_memory_move_cost
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -4150,7 +4160,7 @@ hfa_element_mode (const_tree type, bool nested)
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
- for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
{
if (TREE_CODE (t) != FIELD_DECL)
continue;
@@ -5207,12 +5217,12 @@ ia64_rtx_costs (rtx x, int code, int outer_code, int *total,
one in class TO, using MODE. */
static int
-ia64_register_move_cost (enum machine_mode mode, enum reg_class from_i,
- enum reg_class to_i)
+ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
+ reg_class_t to_i)
{
enum reg_class from = (enum reg_class) from_i;
enum reg_class to = (enum reg_class) to_i;
-{
+
/* ADDL_REGS is the same as GR_REGS for movement purposes. */
if (to == ADDL_REGS)
to = GR_REGS;
@@ -5229,12 +5239,12 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from_i,
/* Moving from FR<->GR in XFmode must be more expensive than 2,
so that we get secondary memory reloads. Between FR_REGS,
- we have to make this at least as expensive as MEMORY_MOVE_COST
+ we have to make this at least as expensive as memory_move_cost
to avoid spectacularly poor register class preferencing. */
if (mode == XFmode || mode == RFmode)
{
if (to != GR_REGS || from != GR_REGS)
- return MEMORY_MOVE_COST (mode, to, 0);
+ return memory_move_cost (mode, to, false);
else
return 3;
}
@@ -5247,20 +5257,20 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from_i,
return 3;
/* Moving between PR and anything but GR is impossible. */
if (from != GR_REGS)
- return MEMORY_MOVE_COST (mode, to, 0);
+ return memory_move_cost (mode, to, false);
break;
case BR_REGS:
/* Moving between BR and anything but GR is impossible. */
if (from != GR_REGS && from != GR_AND_BR_REGS)
- return MEMORY_MOVE_COST (mode, to, 0);
+ return memory_move_cost (mode, to, false);
break;
case AR_I_REGS:
case AR_M_REGS:
/* Moving between AR and anything but GR is impossible. */
if (from != GR_REGS)
- return MEMORY_MOVE_COST (mode, to, 0);
+ return memory_move_cost (mode, to, false);
break;
case GR_REGS:
@@ -5278,6 +5288,23 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from_i,
return 2;
}
+/* Calculate the cost of moving data of MODE from a register to or from
+ memory. */
+
+static int
+ia64_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ reg_class_t rclass,
+ bool in ATTRIBUTE_UNUSED)
+{
+ if (rclass == GENERAL_REGS
+ || rclass == FR_REGS
+ || rclass == FP_REGS
+ || rclass == GR_AND_FR_REGS)
+ return 4;
+ else
+ return 10;
+}
+
/* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on RCLASS
to use when copying X into that class. */
@@ -5541,10 +5568,10 @@ ia64_handle_option (size_t code, const char *arg, int value)
}
}
-/* Implement OVERRIDE_OPTIONS. */
+/* Implement TARGET_OPTION_OVERRIDE. */
-void
-ia64_override_options (void)
+static void
+ia64_option_override (void)
{
if (TARGET_AUTO_PIC)
target_flags |= MASK_CONST_GP;
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index d3821f6c6f4..047a0436182 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1,6 +1,6 @@
/* Definitions of target machine GNU compiler. IA-64 version.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009 Free Software Foundation, Inc.
+ 2009, 2010 Free Software Foundation, Inc.
Contributed by James E. Wilson <wilson@cygnus.com> and
David Mosberger <davidm@hpl.hp.com>.
@@ -116,13 +116,6 @@ enum processor_type
extern enum processor_type ia64_tune;
-/* Sometimes certain combinations of command options do not make sense on a
- particular target machine. You can define a macro `OVERRIDE_OPTIONS' to
- take account of this. This macro, if defined, is executed once just after
- all the command options have been parsed. */
-
-#define OVERRIDE_OPTIONS ia64_override_options ()
-
/* 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 determined and before the remainder of the
@@ -1304,12 +1297,6 @@ do { \
/* Describing Relative Costs of Operations */
-/* A C expression for the cost of moving data of mode M between a
- register and memory. */
-#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
- ((CLASS) == GENERAL_REGS || (CLASS) == FR_REGS || (CLASS) == FP_REGS \
- || (CLASS) == GR_AND_FR_REGS ? 4 : 10)
-
/* A C expression for the cost of a branch instruction. A value of 1 is the
default; other values are interpreted relative to that. Used by the
if-conversion code as max instruction count. */
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index 212bef7cfab..d11a0047fb8 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -1,4 +1,5 @@
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+# 2010
# Free Software Foundation, Inc.
#
# This file is part of GCC.
@@ -53,4 +54,4 @@ ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
# genattrtab generates very long string literals.
insn-attrtab.o-warn = -Wno-error
-ia64.o: debug.h $(PARAMS_H) sel-sched.h
+ia64.o: debug.h $(PARAMS_H) sel-sched.h reload.h
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 559d88433fa..71642099120 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "libfuncs.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "reload.h"
#include "ggc.h"
@@ -1273,7 +1274,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type,
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
@@ -1310,7 +1311,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type,
{
rtx reg;
- for (; field; field = TREE_CHAIN (field))
+ for (; field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& int_bit_position (field) >= bitpos)
break;
@@ -1900,7 +1901,7 @@ iq2000_expand_prologue (void)
PARM_DECL, NULL_TREE, type);
DECL_ARG_TYPE (function_result_decl) = type;
- TREE_CHAIN (function_result_decl) = fnargs;
+ DECL_CHAIN (function_result_decl) = fnargs;
fnargs = function_result_decl;
}
@@ -1929,7 +1930,7 @@ iq2000_expand_prologue (void)
entry_parm = FUNCTION_ARG (args_so_far, passed_mode, passed_type, 1);
FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1);
- next_arg = TREE_CHAIN (cur_arg);
+ next_arg = DECL_CHAIN (cur_arg);
if (entry_parm && store_args_on_stack)
{
diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
index a43bab5b035..94c52748fdb 100644
--- a/gcc/config/linux-android.h
+++ b/gcc/config/linux-android.h
@@ -20,6 +20,12 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define ANDROID_TARGET_OS_CPP_BUILTINS() \
+ do { \
+ if (OPTION_ANDROID) \
+ builtin_define ("__ANDROID__"); \
+ } while (0)
+
#if ANDROID_DEFAULT
# define NOANDROID "mno-android"
#else
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 241e65668f0..e283a9a3305 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -96,8 +96,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
builtin_assert ("system=linux"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
- if (OPTION_ANDROID) \
- builtin_define ("__ANDROID__"); \
} while (0)
#if defined(HAVE_LD_EH_FRAME_HDR)
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index 4288ed285d9..a40df6f0655 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -40,6 +40,7 @@
#include "reload.h"
#include "tm_p.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "optabs.h"
#include "libfuncs.h"
diff --git a/gcc/config/m32c/m32c-pragma.c b/gcc/config/m32c/m32c-pragma.c
index b57615265a2..b25c06350e4 100644
--- a/gcc/config/m32c/m32c-pragma.c
+++ b/gcc/config/m32c/m32c-pragma.c
@@ -24,6 +24,7 @@
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "c-family/c-pragma.h"
#include "cpplib.h"
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 443325f8dd9..7ffd146b2df 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -34,6 +34,7 @@
#include "flags.h"
#include "recog.h"
#include "reload.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "obstack.h"
#include "tree.h"
@@ -430,6 +431,10 @@ m32c_override_options (void)
if (TARGET_A24)
flag_ivopts = 0;
+
+ /* This target defaults to strict volatile bitfields. */
+ if (flag_strict_volatile_bitfields < 0)
+ flag_strict_volatile_bitfields = 1;
}
/* Defining data structures for per-function information */
@@ -1789,9 +1794,9 @@ m32c_init_libfuncs (void)
the right modes are found. */
if (TARGET_A24)
{
- optab_handler (cstore_optab, QImode)->insn_code = CODE_FOR_cstoreqi4_24;
- optab_handler (cstore_optab, HImode)->insn_code = CODE_FOR_cstorehi4_24;
- optab_handler (cstore_optab, PSImode)->insn_code = CODE_FOR_cstorepsi4_24;
+ set_optab_handler (cstore_optab, QImode, CODE_FOR_cstoreqi4_24);
+ set_optab_handler (cstore_optab, HImode, CODE_FOR_cstorehi4_24);
+ set_optab_handler (cstore_optab, PSImode, CODE_FOR_cstorepsi4_24);
}
}
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index a700ec9a581..3895138233c 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -34,6 +34,7 @@
#include "expr.h"
#include "function.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "integrate.h"
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index ad63ee8153d..2056375b6a6 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -51,6 +51,7 @@ Note:
#include "recog.h"
#include "expr.h"
#include "libfuncs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "basic-block.h"
#include "function.h"
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 253d621d074..566b8d2de1f 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "insn-attr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "expr.h"
#include "reload.h"
@@ -1042,7 +1043,7 @@ void
m68k_expand_prologue (void)
{
HOST_WIDE_INT fsize_with_regs;
- rtx limit, src, dest, insn;
+ rtx limit, src, dest;
m68k_compute_frame_layout ();
@@ -1185,7 +1186,7 @@ m68k_expand_prologue (void)
if (!TARGET_SEP_DATA
&& crtl->uses_pic_offset_table)
- insn = emit_insn (gen_load_got (pic_offset_table_rtx));
+ emit_insn (gen_load_got (pic_offset_table_rtx));
}
/* Return true if a simple (return) instruction is sufficient for this
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 6bb4e6476fb..68886934ff7 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -40,6 +40,7 @@
#include "recog.h"
#include "function.h"
#include "ggc.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "target.h"
#include "target-def.h"
diff --git a/gcc/config/mep/mep-pragma.c b/gcc/config/mep/mep-pragma.c
index 1d79a3bd19f..ac704496d5b 100644
--- a/gcc/config/mep/mep-pragma.c
+++ b/gcc/config/mep/mep-pragma.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "rtl.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "c-family/c-pragma.h"
#include "cpplib.h"
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 9e23e45f8bb..1d83d8d76e2 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "reload.h"
#include "tm_p.h"
#include "ggc.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "integrate.h"
#include "target.h"
@@ -3610,9 +3611,9 @@ mep_build_builtin_va_list (void)
DECL_FIELD_CONTEXT (f_next_stack) = record;
TYPE_FIELDS (record) = f_next_gp;
- TREE_CHAIN (f_next_gp) = f_next_gp_limit;
- TREE_CHAIN (f_next_gp_limit) = f_next_cop;
- TREE_CHAIN (f_next_cop) = f_next_stack;
+ DECL_CHAIN (f_next_gp) = f_next_gp_limit;
+ DECL_CHAIN (f_next_gp_limit) = f_next_cop;
+ DECL_CHAIN (f_next_cop) = f_next_stack;
layout_type (record);
@@ -3630,9 +3631,9 @@ mep_expand_va_start (tree valist, rtx nextarg)
ns = cfun->machine->arg_regs_to_save;
f_next_gp = TYPE_FIELDS (va_list_type_node);
- f_next_gp_limit = TREE_CHAIN (f_next_gp);
- f_next_cop = TREE_CHAIN (f_next_gp_limit);
- f_next_stack = TREE_CHAIN (f_next_cop);
+ f_next_gp_limit = DECL_CHAIN (f_next_gp);
+ f_next_cop = DECL_CHAIN (f_next_gp_limit);
+ f_next_stack = DECL_CHAIN (f_next_cop);
next_gp = build3 (COMPONENT_REF, TREE_TYPE (f_next_gp), valist, f_next_gp,
NULL_TREE);
@@ -3696,9 +3697,9 @@ mep_gimplify_va_arg_expr (tree valist, tree type,
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
f_next_gp = TYPE_FIELDS (va_list_type_node);
- f_next_gp_limit = TREE_CHAIN (f_next_gp);
- f_next_cop = TREE_CHAIN (f_next_gp_limit);
- f_next_stack = TREE_CHAIN (f_next_cop);
+ f_next_gp_limit = DECL_CHAIN (f_next_gp);
+ f_next_cop = DECL_CHAIN (f_next_gp_limit);
+ f_next_stack = DECL_CHAIN (f_next_cop);
next_gp = build3 (COMPONENT_REF, TREE_TYPE (f_next_gp), valist, f_next_gp,
NULL_TREE);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ccdfbbc3fd1..c2162973393 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "bitmap.h"
#include "diagnostic.h"
+#include "target-globals.h"
/* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF. */
#define UNSPEC_ADDRESS_P(X) \
@@ -568,6 +569,9 @@ static const char *mips_lo_relocs[NUM_SYMBOL_TYPES];
/* Likewise for HIGHs. */
static const char *mips_hi_relocs[NUM_SYMBOL_TYPES];
+/* Target state for MIPS16. */
+struct target_globals *mips16_globals;
+
/* Index R is the smallest register class that contains register R. */
const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = {
LEA_REGS, LEA_REGS, M16_REGS, V1_REG,
@@ -4853,7 +4857,7 @@ mips_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree field;
/* First check to see if there is any such field. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
@@ -4880,7 +4884,7 @@ mips_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
{
rtx reg;
- for (; field; field = TREE_CHAIN (field))
+ for (; field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& int_bit_position (field) >= bitpos)
break;
@@ -5118,7 +5122,7 @@ mips_fpr_return_fields (const_tree valtype, tree *fields)
return 0;
i = 0;
- for (field = TYPE_FIELDS (valtype); field != 0; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (valtype); field != 0; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -5440,11 +5444,11 @@ mips_build_builtin_va_list (void)
DECL_FIELD_CONTEXT (f_res) = record;
TYPE_FIELDS (record) = f_ovfl;
- TREE_CHAIN (f_ovfl) = f_gtop;
- TREE_CHAIN (f_gtop) = f_ftop;
- TREE_CHAIN (f_ftop) = f_goff;
- TREE_CHAIN (f_goff) = f_foff;
- TREE_CHAIN (f_foff) = f_res;
+ DECL_CHAIN (f_ovfl) = f_gtop;
+ DECL_CHAIN (f_gtop) = f_ftop;
+ DECL_CHAIN (f_ftop) = f_goff;
+ DECL_CHAIN (f_goff) = f_foff;
+ DECL_CHAIN (f_foff) = f_res;
layout_type (record);
return record;
@@ -5479,10 +5483,10 @@ mips_va_start (tree valist, rtx nextarg)
= (MAX_ARGS_IN_REGISTERS - cum->num_fprs) * UNITS_PER_FPREG;
f_ovfl = TYPE_FIELDS (va_list_type_node);
- f_gtop = TREE_CHAIN (f_ovfl);
- f_ftop = TREE_CHAIN (f_gtop);
- f_goff = TREE_CHAIN (f_ftop);
- f_foff = TREE_CHAIN (f_goff);
+ f_gtop = DECL_CHAIN (f_ovfl);
+ f_ftop = DECL_CHAIN (f_gtop);
+ f_goff = DECL_CHAIN (f_ftop);
+ f_foff = DECL_CHAIN (f_goff);
ovfl = build3 (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl,
NULL_TREE);
@@ -5564,10 +5568,10 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
tree t, u;
f_ovfl = TYPE_FIELDS (va_list_type_node);
- f_gtop = TREE_CHAIN (f_ovfl);
- f_ftop = TREE_CHAIN (f_gtop);
- f_goff = TREE_CHAIN (f_ftop);
- f_foff = TREE_CHAIN (f_goff);
+ f_gtop = DECL_CHAIN (f_ovfl);
+ f_ftop = DECL_CHAIN (f_gtop);
+ f_goff = DECL_CHAIN (f_ftop);
+ f_foff = DECL_CHAIN (f_goff);
/* Let:
@@ -6314,19 +6318,28 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
switch (GET_MODE (retval))
{
case SCmode:
- mips_output_32bit_xfer ('f', GP_RETURN + 1,
- FP_REG_FIRST + MAX_FPRS_PER_FMT);
- /* Fall though. */
- case SFmode:
- mips_output_32bit_xfer ('f', GP_RETURN, FP_REG_FIRST);
+ mips_output_32bit_xfer ('f', GP_RETURN + TARGET_BIG_ENDIAN,
+ TARGET_BIG_ENDIAN
+ ? FP_REG_FIRST + MAX_FPRS_PER_FMT
+ : FP_REG_FIRST);
+ mips_output_32bit_xfer ('f', GP_RETURN + TARGET_LITTLE_ENDIAN,
+ TARGET_LITTLE_ENDIAN
+ ? FP_REG_FIRST + MAX_FPRS_PER_FMT
+ : FP_REG_FIRST);
if (GET_MODE (retval) == SCmode && TARGET_64BIT)
{
/* On 64-bit targets, complex floats are returned in
a single GPR, such that "sd" on a suitably-aligned
target would store the value correctly. */
fprintf (asm_out_file, "\tdsll\t%s,%s,32\n",
+ reg_names[GP_RETURN + TARGET_BIG_ENDIAN],
+ reg_names[GP_RETURN + TARGET_BIG_ENDIAN]);
+ fprintf (asm_out_file, "\tdsll\t%s,%s,32\n",
reg_names[GP_RETURN + TARGET_LITTLE_ENDIAN],
reg_names[GP_RETURN + TARGET_LITTLE_ENDIAN]);
+ fprintf (asm_out_file, "\tdsrl\t%s,%s,32\n",
+ reg_names[GP_RETURN + TARGET_BIG_ENDIAN],
+ reg_names[GP_RETURN + TARGET_BIG_ENDIAN]);
fprintf (asm_out_file, "\tor\t%s,%s,%s\n",
reg_names[GP_RETURN],
reg_names[GP_RETURN],
@@ -6334,6 +6347,10 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
}
break;
+ case SFmode:
+ mips_output_32bit_xfer ('f', GP_RETURN, FP_REG_FIRST);
+ break;
+
case DCmode:
mips_output_64bit_xfer ('f', GP_RETURN + (8 / UNITS_PER_WORD),
FP_REG_FIRST + MAX_FPRS_PER_FMT);
@@ -15200,9 +15217,15 @@ mips_set_mips16_mode (int mips16_p)
/* (Re)initialize MIPS target internals for new ISA. */
mips_init_relocs ();
- if (was_mips16_p >= 0 || was_mips16_pch_p >= 0)
- /* Reinitialize target-dependent state. */
- target_reinit ();
+ if (mips16_p)
+ {
+ if (!mips16_globals)
+ mips16_globals = save_target_globals ();
+ else
+ restore_target_globals (mips16_globals);
+ }
+ else
+ restore_target_globals (&default_target_globals);
was_mips16_p = mips16_p;
was_mips16_pch_p = mips16_p;
@@ -15436,6 +15459,9 @@ mips_override_options (void)
target_flags_explicit |= MASK_SOFT_FLOAT_ABI;
}
+ if (TARGET_FLIP_MIPS16)
+ TARGET_INTERLINK_MIPS16 = 1;
+
/* Set the small data limit. */
mips_small_data_threshold = (g_switch_set
? g_switch_value
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index ea79eba2550..a75cd578c21 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3025,6 +3025,7 @@ extern const struct mips_cpu_info *mips_tune_info;
extern const struct mips_rtx_cost_data *mips_cost;
extern bool mips_base_mips16;
extern enum mips_code_readable_setting mips_code_readable;
+extern GTY(()) struct target_globals *mips16_globals;
#endif
/* Enable querying of DFA units. */
@@ -3059,3 +3060,6 @@ extern enum mips_code_readable_setting mips_code_readable;
support this feature. */
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr)
+
+/* For switching between MIPS16 and non-MIPS16 modes. */
+#define SWITCHABLE_TARGET 1
diff --git a/gcc/config/mips/mips16.S b/gcc/config/mips/mips16.S
index bab7b7942b5..b9550add026 100644
--- a/gcc/config/mips/mips16.S
+++ b/gcc/config/mips/mips16.S
@@ -61,9 +61,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
and so that its low 32 bits contain LOW_FPR. */
#define MERGE_GPRf(GPR, HIGH_FPR, LOW_FPR) \
.set noat; \
- mfc1 GPR, HIGH_FPR; \
mfc1 $1, LOW_FPR; \
+ mfc1 GPR, HIGH_FPR; \
+ dsll $1, $1, 32; \
dsll GPR, GPR, 32; \
+ dsrl $1, $1, 32; \
or GPR, GPR, $1; \
.set at
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 4b35e06df4f..109a46a51fc 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "function.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "ggc.h"
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 79bdd7685ea..1243a33a416 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "function.h"
#include "obstack.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "target.h"
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index 1ce7107daff..512582e3273 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -33,6 +33,7 @@
#include "flags.h"
#include "recog.h"
#include "reload.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "obstack.h"
#include "tree.h"
diff --git a/gcc/config/netbsd-aout.h b/gcc/config/netbsd-aout.h
index 99e8c3a9c49..914212b877f 100644
--- a/gcc/config/netbsd-aout.h
+++ b/gcc/config/netbsd-aout.h
@@ -141,7 +141,7 @@ along with GCC; see the file COPYING3. If not see
{ \
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
- ASM_OUTPUT_LABEL(FILE, NAME); \
+ ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
} \
while (0)
diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
index 59728c377d6..30e1c252c5a 100644
--- a/gcc/config/openbsd.h
+++ b/gcc/config/openbsd.h
@@ -216,7 +216,7 @@ while (0)
do { \
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
- ASM_OUTPUT_LABEL(FILE, NAME); \
+ ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
} while (0)
#endif
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 2640f05e1bc..96acecb351c 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "reload.h"
#include "integrate.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "recog.h"
@@ -5767,7 +5768,9 @@ pa_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
/* Request a secondary reload with a general scratch register
for everthing else. ??? Could symbolic operands be handled
directly when generating non-pic PA 2.0 code? */
- sri->icode = in_p ? reload_in_optab[mode] : reload_out_optab[mode];
+ sri->icode = (in_p
+ ? direct_optab_handler (reload_in_optab, mode)
+ : direct_optab_handler (reload_out_optab, mode));
return NO_REGS;
}
@@ -5775,7 +5778,9 @@ pa_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
and anything other than a general register. */
if (rclass == SHIFT_REGS && (regno <= 0 || regno >= 32))
{
- sri->icode = in_p ? reload_in_optab[mode] : reload_out_optab[mode];
+ sri->icode = (in_p
+ ? direct_optab_handler (reload_in_optab, mode)
+ : direct_optab_handler (reload_out_optab, mode));
return NO_REGS;
}
@@ -5785,7 +5790,9 @@ pa_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
&& (REGNO_REG_CLASS (regno) == SHIFT_REGS
&& FP_REG_CLASS_P (rclass)))
{
- sri->icode = in_p ? reload_in_optab[mode] : reload_out_optab[mode];
+ sri->icode = (in_p
+ ? direct_optab_handler (reload_in_optab, mode)
+ : direct_optab_handler (reload_out_optab, mode));
return NO_REGS;
}
@@ -6040,11 +6047,10 @@ hppa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
u = fold_build1 (NEGATE_EXPR, sizetype, u);
t = build2 (POINTER_PLUS_EXPR, valist_type, valist, u);
- /* Copied from va-pa.h, but we probably don't need to align to
- word size, since we generate and preserve that invariant. */
- u = size_int (size > 4 ? -8 : -4);
- t = fold_convert (sizetype, t);
- t = build2 (BIT_AND_EXPR, sizetype, t, u);
+ /* Align to 4 or 8 byte boundary depending on argument size. */
+
+ u = build_int_cst (TREE_TYPE (t), (HOST_WIDE_INT)(size > 4 ? -8 : -4));
+ t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, u);
t = fold_convert (valist_type, t);
t = build2 (MODIFY_EXPR, valist_type, valist, t);
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 4eae700b077..73116c5383e 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -316,8 +316,9 @@ typedef struct GTY(()) machine_function
#define BIGGEST_ALIGNMENT (2 * BITS_PER_WORD)
/* Get around hp-ux assembler bug, and make strcpy of constants fast. */
-#define CONSTANT_ALIGNMENT(CODE, TYPEALIGN) \
- ((TYPEALIGN) < 32 ? 32 : (TYPEALIGN))
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
+ (TREE_CODE (EXP) == STRING_CST \
+ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
/* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \
@@ -1142,9 +1143,7 @@ extern int may_call_alloca;
|| ((MODE) != SFmode \
&& (MODE) != DFmode))) \
goto ADDR; \
- else if (GET_CODE (X) == LABEL_REF \
- || (GET_CODE (X) == CONST_INT \
- && INT_5_BITS (X))) \
+ else if (GET_CODE (X) == CONST_INT && INT_5_BITS (X)) \
goto ADDR; \
/* Needed for -fPIC */ \
else if (GET_CODE (X) == LO_SUM \
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index c189ca2d6ce..cfe843d40f1 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -9544,90 +9544,39 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(match_operand 2 "const_int_operand" "")]
"TARGET_PA_20"
{
- int locality = INTVAL (operands[2]);
-
- gcc_assert (locality >= 0 && locality <= 3);
-
- /* Change operand[0] to a MEM as we don't have the infrastructure
- to output all the supported address modes for ldw/ldd when we use
- the address directly. However, we do have it for MEMs. */
- operands[0] = gen_rtx_MEM (QImode, operands[0]);
-
- /* If the address isn't valid for the prefetch, replace it. */
- if (locality)
- {
- if (!prefetch_nocc_operand (operands[0], QImode))
- operands[0]
- = replace_equiv_address (operands[0],
- copy_to_mode_reg (Pmode,
- XEXP (operands[0], 0)));
- emit_insn (gen_prefetch_nocc (operands[0], operands[1], operands[2]));
- }
- else
- {
- if (!prefetch_cc_operand (operands[0], QImode))
- operands[0]
- = replace_equiv_address (operands[0],
- copy_to_mode_reg (Pmode,
- XEXP (operands[0], 0)));
- emit_insn (gen_prefetch_cc (operands[0], operands[1], operands[2]));
- }
+ operands[0] = copy_addr_to_reg (operands[0]);
+ emit_insn (gen_prefetch_20 (operands[0], operands[1], operands[2]));
DONE;
})
-(define_insn "prefetch_cc"
- [(prefetch (match_operand:QI 0 "prefetch_cc_operand" "RW")
+(define_insn "prefetch_20"
+ [(prefetch (match_operand 0 "pmode_register_operand" "r")
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
- "TARGET_PA_20 && operands[2] == const0_rtx"
+ "TARGET_PA_20"
{
- /* The SL cache-control completor indicates good spatial locality but
+ /* The SL cache-control completer indicates good spatial locality but
poor temporal locality. The ldw instruction with a target of general
register 0 prefetches a cache line for a read. The ldd instruction
prefetches a cache line for a write. */
- static const char * const instr[2] = {
- "ldw%M0,sl %0,%%r0",
- "ldd%M0,sl %0,%%r0"
- };
- int read_or_write = INTVAL (operands[1]);
-
- gcc_assert (read_or_write >= 0 && read_or_write <= 1);
-
- return instr [read_or_write];
-}
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
-(define_insn "prefetch_nocc"
- [(prefetch (match_operand:QI 0 "prefetch_nocc_operand" "A,RQ")
- (match_operand:SI 1 "const_int_operand" "n,n")
- (match_operand:SI 2 "const_int_operand" "n,n"))]
- "TARGET_PA_20 && operands[2] != const0_rtx"
-{
- /* The ldw instruction with a target of general register 0 prefetches
- a cache line for a read. The ldd instruction prefetches a cache line
- for a write. */
static const char * const instr[2][2] = {
{
- "ldw RT'%A0,%%r0",
- "ldd RT'%A0,%%r0",
+ "ldw,sl 0(%0),%%r0",
+ "ldd,sl 0(%0),%%r0"
},
{
- "ldw%M0 %0,%%r0",
- "ldd%M0 %0,%%r0",
+ "ldw 0(%0),%%r0",
+ "ldd 0(%0),%%r0"
}
};
- int read_or_write = INTVAL (operands[1]);
+ int read_or_write = INTVAL (operands[1]) == 0 ? 0 : 1;
+ int locality = INTVAL (operands[2]) == 0 ? 0 : 1;
- gcc_assert (which_alternative == 0 || which_alternative == 1);
- gcc_assert (read_or_write >= 0 && read_or_write <= 1);
-
- return instr [which_alternative][read_or_write];
+ return instr [locality][read_or_write];
}
[(set_attr "type" "load")
(set_attr "length" "4")])
-
;; TLS Support
(define_insn "tgd_load"
[(set (match_operand:SI 0 "register_operand" "=r")
diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md
index 0f0a42488b9..959dbdd009d 100644
--- a/gcc/config/pa/predicates.md
+++ b/gcc/config/pa/predicates.md
@@ -240,64 +240,6 @@
return memory_address_p (mode, XEXP (op, 0));
})
-;; Accept anything that can be used as the source operand for a
-;; prefetch instruction with a cache-control completer.
-
-(define_predicate "prefetch_cc_operand"
- (match_code "mem")
-{
- if (GET_CODE (op) != MEM)
- return 0;
-
- op = XEXP (op, 0);
-
- /* We must reject virtual registers as we don't allow REG+D. */
- if (op == virtual_incoming_args_rtx
- || op == virtual_stack_vars_rtx
- || op == virtual_stack_dynamic_rtx
- || op == virtual_outgoing_args_rtx
- || op == virtual_cfa_rtx)
- return 0;
-
- if (!REG_P (op) && !IS_INDEX_ADDR_P (op))
- return 0;
-
- /* Until problems with management of the REG_POINTER flag are resolved,
- we need to delay creating prefetch insns with unscaled indexed addresses
- until CSE is not expected. */
- if (!TARGET_NO_SPACE_REGS
- && !cse_not_expected
- && GET_CODE (op) == PLUS
- && REG_P (XEXP (op, 0)))
- return 0;
-
- return memory_address_p (mode, op);
-})
-
-;; Accept anything that can be used as the source operand for a
-;; prefetch instruction with no cache-control completer.
-
-(define_predicate "prefetch_nocc_operand"
- (match_code "mem")
-{
- if (GET_CODE (op) != MEM)
- return 0;
-
- op = XEXP (op, 0);
-
- /* Until problems with management of the REG_POINTER flag are resolved,
- we need to delay creating prefetch insns with unscaled indexed addresses
- until CSE is not expected. */
- if (!TARGET_NO_SPACE_REGS
- && !cse_not_expected
- && GET_CODE (op) == PLUS
- && REG_P (XEXP (op, 0))
- && REG_P (XEXP (op, 1)))
- return 0;
-
- return memory_address_p (mode, op);
-})
-
;; Accept REG and any CONST_INT that can be moved in one instruction
;; into a general register.
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 5d1c054a3eb..8be8deffe32 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -118,7 +118,7 @@ do { \
fputs (",PRIV_LEV=3", FILE); \
} \
for (parm = DECL_ARGUMENTS (DECL), i = 0; parm && i < 4; \
- parm = TREE_CHAIN (parm)) \
+ parm = DECL_CHAIN (parm)) \
{ \
if (TYPE_MODE (DECL_ARG_TYPE (parm)) == SFmode \
&& ! TARGET_SOFT_FLOAT) \
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 15e8a545f09..186fbede3bd 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "tree.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "target.h"
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index 2e8dbb92355..bb302f27e31 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not, see
#include "output.h"
#include "basic-block.h"
#include "integrate.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "hashtab.h"
diff --git a/gcc/config/picochip/picochip.md b/gcc/config/picochip/picochip.md
index 66323dda0c7..3a12a3d0a3d 100644
--- a/gcc/config/picochip/picochip.md
+++ b/gcc/config/picochip/picochip.md
@@ -2372,7 +2372,7 @@
UNSPEC_TESTPORT))
(clobber (reg:CC CC_REGNUM))]
""
- "// %0 := TestPort(%1)\;TSTPORT %1\;COPYSW.0 %0\;AND.0 %0,8,%0"
+ "// %0 := TestPort(%1)\;COPY.1 0,%0 \\\ TSTPORT %1\;COPYEQ 1,%0"
[(set_attr "length" "9")])
; Entry point for array tstport (the actual port index is computed as the
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 98d44cfbde5..810563e0ed0 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -65,6 +65,9 @@
} \
while (0)
+/* Generate branch islands stubs if this is true. */
+extern int darwin_emit_branch_islands;
+
#define SUBTARGET_OVERRIDE_OPTIONS darwin_rs6000_override_options ()
#define C_COMMON_OVERRIDE_OPTIONS do { \
@@ -385,8 +388,6 @@
#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
(!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
-/* XXX: Darwin supports neither .quad, or .llong, but it also doesn't
- support 64 bit PowerPC either, so this just keeps things happy. */
#define DOUBLE_INT_ASM_OP "\t.quad\t"
/* For binary compatibility with 2.95; Darwin C APIs use bool from
diff --git a/gcc/config/rs6000/e500crtres64gprctr.asm b/gcc/config/rs6000/e500crtres64gprctr.asm
index e4b016bdbca..345a46da6b2 100644
--- a/gcc/config/rs6000/e500crtres64gprctr.asm
+++ b/gcc/config/rs6000/e500crtres64gprctr.asm
@@ -33,40 +33,58 @@
registers to be restored is passed in CTR, called by the compiler. */
HIDDEN_FUNC(_rest64gpr_ctr_14) evldd 14,0(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_15) evldd 15,8(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_16) evldd 16,16(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_17) evldd 17,24(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_18) evldd 18,32(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_19) evldd 19,40(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_20) evldd 20,48(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_21) evldd 21,56(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_22) evldd 22,64(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_23) evldd 23,72(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_24) evldd 24,80(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_25) evldd 25,88(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_26) evldd 26,96(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_27) evldd 27,104(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_28) evldd 28,112(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_29) evldd 29,120(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_30) evldd 30,128(11)
- bdz _rest64_gpr_ctr_done
+ bdz _rest64gpr_ctr_done
HIDDEN_FUNC(_rest64gpr_ctr_31) evldd 31,136(11)
_rest64gpr_ctr_done: blr
+FUNC_END(_rest64gpr_ctr_31)
+FUNC_END(_rest64gpr_ctr_30)
+FUNC_END(_rest64gpr_ctr_29)
+FUNC_END(_rest64gpr_ctr_28)
+FUNC_END(_rest64gpr_ctr_27)
+FUNC_END(_rest64gpr_ctr_26)
+FUNC_END(_rest64gpr_ctr_25)
+FUNC_END(_rest64gpr_ctr_24)
+FUNC_END(_rest64gpr_ctr_23)
+FUNC_END(_rest64gpr_ctr_22)
+FUNC_END(_rest64gpr_ctr_21)
+FUNC_END(_rest64gpr_ctr_20)
+FUNC_END(_rest64gpr_ctr_19)
+FUNC_END(_rest64gpr_ctr_18)
+FUNC_END(_rest64gpr_ctr_17)
+FUNC_END(_rest64gpr_ctr_16)
+FUNC_END(_rest64gpr_ctr_15)
+FUNC_END(_rest64gpr_ctr_14)
#endif
diff --git a/gcc/config/rs6000/e500crtsav64gprctr.asm b/gcc/config/rs6000/e500crtsav64gprctr.asm
index b555984e128..fe9313e323f 100644
--- a/gcc/config/rs6000/e500crtsav64gprctr.asm
+++ b/gcc/config/rs6000/e500crtsav64gprctr.asm
@@ -34,39 +34,39 @@
/* "Bare" versions that return to their caller. */
HIDDEN_FUNC(_save64gpr_ctr_14) evstdd 14,0(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_15) evstdd 15,8(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_16) evstdd 16,16(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_17) evstdd 17,24(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_18) evstdd 18,32(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_19) evstdd 19,40(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_20) evstdd 20,48(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_21) evstdd 21,56(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_22) evstdd 22,64(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_23) evstdd 23,72(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_24) evstdd 24,80(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_25) evstdd 25,88(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_26) evstdd 26,96(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_27) evstdd 27,104(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_28) evstdd 28,112(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_29) evstdd 29,120(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_30) evstdd 30,128(11)
- bdz _save64_gpr_ctr_done
+ bdz _save64gpr_ctr_done
HIDDEN_FUNC(_save64gpr_ctr_31) evstdd 31,136(11)
_save64gpr_ctr_done: blr
FUNC_END(_save64gpr_ctr_31)
diff --git a/gcc/config/rs6000/e500crtsavg64gprctr.asm b/gcc/config/rs6000/e500crtsavg64gprctr.asm
index b663f642bf0..26248471509 100644
--- a/gcc/config/rs6000/e500crtsavg64gprctr.asm
+++ b/gcc/config/rs6000/e500crtsavg64gprctr.asm
@@ -33,39 +33,39 @@
/* "GOT" versions that load the address of the GOT into lr before returning. */
HIDDEN_FUNC(_save64gpr_ctr_14_g) evstdd 14,0(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_15_g) evstdd 15,8(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_16_g) evstdd 16,16(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_17_g) evstdd 17,24(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_18_g) evstdd 18,32(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_19_g) evstdd 19,40(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_20_g) evstdd 20,48(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_21_g) evstdd 21,56(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_22_g) evstdd 22,64(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_23_g) evstdd 23,72(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_24_g) evstdd 24,80(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_25_g) evstdd 25,88(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_26_g) evstdd 26,96(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_27_g) evstdd 27,104(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_28_g) evstdd 28,112(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_29_g) evstdd 29,120(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_30_g) evstdd 30,128(11)
- bdz _save64_gpr_ctr_g_done
+ bdz _save64gpr_ctr_g_done
HIDDEN_FUNC(_save64gpr_ctr_31_g) evstdd 31,136(11)
_save64gpr_ctr_g_done: b _GLOBAL_OFFSET_TABLE_-4
FUNC_END(_save64gpr_ctr_31_g)
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 20f594a33e9..ae36d7aa7c0 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -29,6 +29,7 @@
#include "tree.h"
#include "c-family/c-common.h"
#include "c-family/c-pragma.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "target.h"
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 9e978bdae89..02377f298e5 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -170,9 +170,6 @@ extern unsigned int rs6000_dbx_register_number (unsigned int);
extern void rs6000_emit_epilogue (int);
extern void rs6000_emit_eh_reg_restore (rtx, rtx);
extern const char * output_isel (rtx *);
-extern int rs6000_register_move_cost (enum machine_mode,
- enum reg_class, enum reg_class);
-extern int rs6000_memory_move_cost (enum machine_mode, enum reg_class, int);
extern bool rs6000_tls_referenced_p (rtx);
extern void rs6000_conditional_register_usage (void);
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 70ff5e0f292..130d1ac9be2 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -41,6 +41,7 @@
#include "output.h"
#include "basic-block.h"
#include "integrate.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "hashtab.h"
@@ -1030,6 +1031,9 @@ static void rs6000_xcoff_file_start (void);
static void rs6000_xcoff_file_end (void);
#endif
static int rs6000_variable_issue (FILE *, int, rtx, int);
+static int rs6000_register_move_cost (enum machine_mode,
+ reg_class_t, reg_class_t);
+static int rs6000_memory_move_cost (enum machine_mode, reg_class_t, bool);
static bool rs6000_rtx_costs (rtx, int, int, int *, bool);
static bool rs6000_debug_rtx_costs (rtx, int, int, int *, bool);
static int rs6000_debug_address_cost (rtx, bool);
@@ -1075,6 +1079,8 @@ static bool rs6000_builtin_support_vector_misalignment (enum
machine_mode,
const_tree,
int, bool);
+static int rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt,
+ tree, int);
static void def_builtin (int, const char *, tree, int);
static bool rs6000_vector_alignment_reachable (const_tree, bool);
@@ -1467,6 +1473,9 @@ static const struct attribute_spec rs6000_attribute_table[] =
rs6000_builtin_support_vector_misalignment
#undef TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE
#define TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE rs6000_vector_alignment_reachable
+#undef TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST
+#define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST \
+ rs6000_builtin_vectorization_cost
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS rs6000_init_builtins
@@ -1502,6 +1511,10 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_INVALID_WITHIN_DOLOOP
#define TARGET_INVALID_WITHIN_DOLOOP rs6000_invalid_within_doloop
+#undef TARGET_REGISTER_MOVE_COST
+#define TARGET_REGISTER_MOVE_COST rs6000_register_move_cost
+#undef TARGET_MEMORY_MOVE_COST
+#define TARGET_MEMORY_MOVE_COST rs6000_memory_move_cost
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS rs6000_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -2677,11 +2690,23 @@ rs6000_override_options (const char *default_cpu)
/* For the newer switches (vsx, dfp, etc.) set some of the older options,
unless the user explicitly used the -mno-<option> to disable the code. */
if (TARGET_VSX)
- target_flags |= (ISA_2_6_MASKS & (target_flags_explicit & ~ISA_2_6_MASKS));
+ target_flags |= (ISA_2_6_MASKS & ~target_flags_explicit);
else if (TARGET_DFP)
- target_flags |= (ISA_2_5_MASKS & (target_flags_explicit & ~ISA_2_5_MASKS));
+ target_flags |= (ISA_2_5_MASKS & ~target_flags_explicit);
else if (TARGET_ALTIVEC)
- target_flags |= (MASK_PPC_GFXOPT & (target_flags_explicit & ~MASK_PPC_GFXOPT));
+ target_flags |= (MASK_PPC_GFXOPT & ~target_flags_explicit);
+
+ /* E500mc does "better" if we inline more aggressively. Respect the
+ user's opinion, though. */
+ if (rs6000_block_move_inline_limit == 0
+ && (rs6000_cpu == PROCESSOR_PPCE500MC
+ || rs6000_cpu == PROCESSOR_PPCE500MC64))
+ rs6000_block_move_inline_limit = 128;
+
+ /* store_one_arg depends on expand_block_move to handle at least the
+ size of reg_parm_stack_space. */
+ if (rs6000_block_move_inline_limit < (TARGET_POWERPC64 ? 64 : 32))
+ rs6000_block_move_inline_limit = (TARGET_POWERPC64 ? 64 : 32);
/* Set debug flags */
if (rs6000_debug_name)
@@ -3327,18 +3352,24 @@ rs6000_builtin_support_vector_misalignment (enum machine_mode mode,
if (TARGET_VSX)
{
/* Return if movmisalign pattern is not supported for this mode. */
- if (optab_handler (movmisalign_optab, mode)->insn_code ==
- CODE_FOR_nothing)
+ if (optab_handler (movmisalign_optab, mode) == CODE_FOR_nothing)
return false;
if (misalignment == -1)
{
- /* misalignment factor is unknown at compile time but we know
+ /* Misalignment factor is unknown at compile time but we know
it's word aligned. */
if (rs6000_vector_alignment_reachable (type, is_packed))
- return true;
+ {
+ int element_size = TREE_INT_CST_LOW (TYPE_SIZE (type));
+
+ if (element_size == 64 || element_size == 32)
+ return true;
+ }
+
return false;
}
+
/* VSX supports word-aligned vector. */
if (misalignment % 4 == 0)
return true;
@@ -3404,6 +3435,106 @@ rs6000_builtin_vec_perm (tree type, tree *mask_element_type)
return d;
}
+
+/* Implement targetm.vectorize.builtin_vectorization_cost. */
+static int
+rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
+ tree vectype, int misalign)
+{
+ unsigned elements;
+
+ switch (type_of_cost)
+ {
+ case scalar_stmt:
+ case scalar_load:
+ case scalar_store:
+ case vector_stmt:
+ case vector_load:
+ case vector_store:
+ case vec_to_scalar:
+ case scalar_to_vec:
+ case cond_branch_not_taken:
+ case vec_perm:
+ return 1;
+
+ case cond_branch_taken:
+ return 3;
+
+ case unaligned_load:
+ if (TARGET_VSX && TARGET_ALLOW_MOVMISALIGN)
+ {
+ elements = TYPE_VECTOR_SUBPARTS (vectype);
+ if (elements == 2)
+ /* Double word aligned. */
+ return 2;
+
+ if (elements == 4)
+ {
+ switch (misalign)
+ {
+ case 8:
+ /* Double word aligned. */
+ return 2;
+
+ case -1:
+ /* Unknown misalignment. */
+ case 4:
+ case 12:
+ /* Word aligned. */
+ return 22;
+
+ default:
+ gcc_unreachable ();
+ }
+ }
+ }
+
+ if (TARGET_ALTIVEC)
+ /* Misaligned loads are not supported. */
+ gcc_unreachable ();
+
+ return 2;
+
+ case unaligned_store:
+ if (TARGET_VSX && TARGET_ALLOW_MOVMISALIGN)
+ {
+ elements = TYPE_VECTOR_SUBPARTS (vectype);
+ if (elements == 2)
+ /* Double word aligned. */
+ return 2;
+
+ if (elements == 4)
+ {
+ switch (misalign)
+ {
+ case 8:
+ /* Double word aligned. */
+ return 2;
+
+ case -1:
+ /* Unknown misalignment. */
+ case 4:
+ case 12:
+ /* Word aligned. */
+ return 23;
+
+ default:
+ gcc_unreachable ();
+ }
+ }
+ }
+
+ if (TARGET_ALTIVEC)
+ /* Misaligned stores are not supported. */
+ gcc_unreachable ();
+
+ return 2;
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
/* Handle generic options of the form -mfoo=yes/no.
NAME is the option name.
VALUE is the option value.
@@ -4974,7 +5105,7 @@ rs6000_special_round_type_align (tree type, unsigned int computed,
/* Skip all non field decls */
while (field != NULL && TREE_CODE (field) != FIELD_DECL)
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
if (field != NULL && field != type)
{
@@ -5006,7 +5137,7 @@ darwin_rs6000_special_round_type_align (tree type, unsigned int computed,
tree field = TYPE_FIELDS (type);
/* Skip all non field decls */
while (field != NULL && TREE_CODE (field) != FIELD_DECL)
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
if (! field)
break;
/* A packed field does not contribute any extra alignment. */
@@ -5934,6 +6065,17 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
return x;
}
+ /* Likewise for (lo_sum (high ...) ...) output we have generated. */
+ if (GET_CODE (x) == LO_SUM
+ && GET_CODE (XEXP (x, 0)) == HIGH)
+ {
+ push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL,
+ BASE_REG_CLASS, Pmode, VOIDmode, 0, 0,
+ opnum, (enum reload_type)type);
+ *win = 1;
+ return x;
+ }
+
#if TARGET_MACHO
if (DEFAULT_ABI == ABI_DARWIN && flag_pic
&& GET_CODE (x) == LO_SUM
@@ -7444,7 +7586,7 @@ rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *cum,
{
tree f;
- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (type); f ; f = DECL_CHAIN (f))
if (TREE_CODE (f) == FIELD_DECL)
{
HOST_WIDE_INT bitpos = startbitpos;
@@ -7844,7 +7986,7 @@ rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *cum, const_tree type,
{
tree f;
- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (type); f ; f = DECL_CHAIN (f))
if (TREE_CODE (f) == FIELD_DECL)
{
HOST_WIDE_INT bitpos = startbitpos;
@@ -8671,10 +8813,10 @@ rs6000_build_builtin_va_list (void)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_gpr;
- TREE_CHAIN (f_gpr) = f_fpr;
- TREE_CHAIN (f_fpr) = f_res;
- TREE_CHAIN (f_res) = f_ovf;
- TREE_CHAIN (f_ovf) = f_sav;
+ DECL_CHAIN (f_gpr) = f_fpr;
+ DECL_CHAIN (f_fpr) = f_res;
+ DECL_CHAIN (f_res) = f_ovf;
+ DECL_CHAIN (f_ovf) = f_sav;
layout_type (record);
@@ -8699,10 +8841,10 @@ rs6000_va_start (tree valist, rtx nextarg)
}
f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
- f_fpr = TREE_CHAIN (f_gpr);
- f_res = TREE_CHAIN (f_fpr);
- f_ovf = TREE_CHAIN (f_res);
- f_sav = TREE_CHAIN (f_ovf);
+ f_fpr = DECL_CHAIN (f_gpr);
+ f_res = DECL_CHAIN (f_fpr);
+ f_ovf = DECL_CHAIN (f_res);
+ f_sav = DECL_CHAIN (f_ovf);
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
@@ -8820,10 +8962,10 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
}
f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
- f_fpr = TREE_CHAIN (f_gpr);
- f_res = TREE_CHAIN (f_fpr);
- f_ovf = TREE_CHAIN (f_res);
- f_sav = TREE_CHAIN (f_ovf);
+ f_fpr = DECL_CHAIN (f_gpr);
+ f_res = DECL_CHAIN (f_fpr);
+ f_ovf = DECL_CHAIN (f_res);
+ f_sav = DECL_CHAIN (f_ovf);
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
@@ -11400,7 +11542,7 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
gcc_assert (TARGET_ALTIVEC);
arg = CALL_EXPR_ARG (exp, 0);
- gcc_assert (TREE_CODE (TREE_TYPE (arg)) == POINTER_TYPE);
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg)));
op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL);
addr = memory_address (mode, op);
if (fcode == ALTIVEC_BUILTIN_MASK_FOR_STORE)
@@ -13078,9 +13220,7 @@ expand_block_move (rtx operands[])
if (bytes <= 0)
return 1;
- /* store_one_arg depends on expand_block_move to handle at least the size of
- reg_parm_stack_space. */
- if (bytes > (TARGET_POWERPC64 ? 64 : 32))
+ if (bytes > rs6000_block_move_inline_limit)
return 0;
for (offset = 0; bytes > 0; offset += move_bytes, bytes -= move_bytes)
@@ -13682,8 +13822,7 @@ rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case RESULT_DECL:
case SSA_NAME:
case REAL_CST:
- case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
+ case MEM_REF:
case MISALIGNED_INDIRECT_REF:
case VIEW_CONVERT_EXPR:
if (TYPE_MODE (TREE_TYPE (*tp)) == SDmode)
@@ -14163,7 +14302,7 @@ rs6000_alloc_sdmode_stack_slot (void)
}
/* Check for any SDmode parameters of the function. */
- for (t = DECL_ARGUMENTS (cfun->decl); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (cfun->decl); t; t = DECL_CHAIN (t))
{
if (TREE_TYPE (t) == error_mark_node)
continue;
@@ -15263,7 +15402,8 @@ print_operand (FILE *file, rtx x, int code)
{
const char *name = XSTR (x, 0);
#if TARGET_MACHO
- if (MACHOPIC_INDIRECT
+ if (darwin_emit_branch_islands
+ && MACHOPIC_INDIRECT
&& machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION)
name = machopic_indirection_name (x, /*stub_p=*/true);
#endif
@@ -15868,53 +16008,12 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode)
}
-/* Emit the RTL for an sCOND pattern. */
+/* Emit the RTL for an sISEL pattern. */
void
-rs6000_emit_sISEL (enum machine_mode mode, rtx operands[])
+rs6000_emit_sISEL (enum machine_mode mode ATTRIBUTE_UNUSED, rtx operands[])
{
- rtx condition_rtx;
- enum machine_mode op_mode;
- enum rtx_code cond_code;
- rtx result = operands[0];
-
- condition_rtx = rs6000_generate_compare (operands[1], mode);
- cond_code = GET_CODE (condition_rtx);
-
- op_mode = GET_MODE (XEXP (operands[1], 0));
- if (op_mode == VOIDmode)
- op_mode = GET_MODE (XEXP (operands[1], 1));
-
- if (TARGET_POWERPC64 && GET_MODE (result) == DImode)
- {
- PUT_MODE (condition_rtx, DImode);
- if (cond_code == GEU || cond_code == GTU || cond_code == LEU
- || cond_code == LTU)
- emit_insn (gen_isel_unsigned_di (result, condition_rtx,
- force_reg (DImode, const1_rtx),
- force_reg (DImode, const0_rtx),
- XEXP (condition_rtx, 0)));
- else
- emit_insn (gen_isel_signed_di (result, condition_rtx,
- force_reg (DImode, const1_rtx),
- force_reg (DImode, const0_rtx),
- XEXP (condition_rtx, 0)));
- }
- else
- {
- PUT_MODE (condition_rtx, SImode);
- if (cond_code == GEU || cond_code == GTU || cond_code == LEU
- || cond_code == LTU)
- emit_insn (gen_isel_unsigned_si (result, condition_rtx,
- force_reg (SImode, const1_rtx),
- force_reg (SImode, const0_rtx),
- XEXP (condition_rtx, 0)));
- else
- emit_insn (gen_isel_signed_si (result, condition_rtx,
- force_reg (SImode, const1_rtx),
- force_reg (SImode, const0_rtx),
- XEXP (condition_rtx, 0)));
- }
+ rs6000_emit_int_cmove (operands[0], operands[1], const1_rtx, const0_rtx);
}
void
@@ -16232,7 +16331,7 @@ rs6000_emit_vector_compare (enum rtx_code rcode,
if (rev_code == UNKNOWN)
return NULL_RTX;
- nor_code = optab_handler (one_cmpl_optab, (int)dmode)->insn_code;
+ nor_code = optab_handler (one_cmpl_optab, dmode);
if (nor_code == CODE_FOR_nothing)
return NULL_RTX;
@@ -16277,7 +16376,7 @@ rs6000_emit_vector_compare (enum rtx_code rcode,
gcc_unreachable ();
}
- ior_code = optab_handler (ior_optab, (int)dmode)->insn_code;
+ ior_code = optab_handler (ior_optab, dmode);
if (ior_code == CODE_FOR_nothing)
return NULL_RTX;
@@ -16581,6 +16680,9 @@ rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
{
rtx condition_rtx, cr;
enum machine_mode mode = GET_MODE (dest);
+ enum rtx_code cond_code;
+ rtx (*isel_func) (rtx, rtx, rtx, rtx, rtx);
+ bool signedp;
if (mode != SImode && (!TARGET_POWERPC64 || mode != DImode))
return 0;
@@ -16589,27 +16691,37 @@ rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
compare, it just looks at the CRx bits set by a previous compare
instruction. */
condition_rtx = rs6000_generate_compare (op, mode);
+ cond_code = GET_CODE (condition_rtx);
cr = XEXP (condition_rtx, 0);
+ signedp = GET_MODE (cr) == CCmode;
- if (mode == SImode)
- {
- if (GET_MODE (cr) == CCmode)
- emit_insn (gen_isel_signed_si (dest, condition_rtx,
- true_cond, false_cond, cr));
- else
- emit_insn (gen_isel_unsigned_si (dest, condition_rtx,
- true_cond, false_cond, cr));
- }
- else
+ isel_func = (mode == SImode
+ ? (signedp ? gen_isel_signed_si : gen_isel_unsigned_si)
+ : (signedp ? gen_isel_signed_di : gen_isel_unsigned_di));
+
+ switch (cond_code)
{
- if (GET_MODE (cr) == CCmode)
- emit_insn (gen_isel_signed_di (dest, condition_rtx,
- true_cond, false_cond, cr));
- else
- emit_insn (gen_isel_unsigned_di (dest, condition_rtx,
- true_cond, false_cond, cr));
+ case LT: case GT: case LTU: case GTU: case EQ:
+ /* isel handles these directly. */
+ break;
+
+ default:
+ /* We need to swap the sense of the comparison. */
+ {
+ rtx t = true_cond;
+ true_cond = false_cond;
+ false_cond = t;
+ PUT_CODE (condition_rtx, reverse_condition (cond_code));
+ }
+ break;
}
+ false_cond = force_reg (mode, false_cond);
+ if (true_cond != const0_rtx)
+ true_cond = force_reg (mode, true_cond);
+
+ emit_insn (isel_func (dest, condition_rtx, true_cond, false_cond, cr));
+
return 1;
}
@@ -16619,13 +16731,10 @@ output_isel (rtx *operands)
enum rtx_code code;
code = GET_CODE (operands[1]);
- if (code == GE || code == GEU || code == LE || code == LEU || code == NE)
- {
- PUT_CODE (operands[1], reverse_condition (code));
- return "isel %0,%3,%2,%j1";
- }
- else
- return "isel %0,%2,%3,%j1";
+
+ gcc_assert (!(code == GE || code == GEU || code == LE || code == LEU || code == NE));
+
+ return "isel %0,%2,%3,%j1";
}
void
@@ -20873,7 +20982,7 @@ rs6000_output_function_epilogue (FILE *file,
int next_parm_info_bit = 31;
for (decl = DECL_ARGUMENTS (current_function_decl);
- decl; decl = TREE_CHAIN (decl))
+ decl; decl = DECL_CHAIN (decl))
{
rtx parameter = DECL_INCOMING_RTL (decl);
enum machine_mode mode = GET_MODE (parameter);
@@ -24384,14 +24493,6 @@ get_prev_label (tree function_name)
return 0;
}
-#ifndef DARWIN_LINKER_GENERATES_ISLANDS
-#define DARWIN_LINKER_GENERATES_ISLANDS 0
-#endif
-
-/* KEXTs still need branch islands. */
-#define DARWIN_GENERATE_ISLANDS (!DARWIN_LINKER_GENERATES_ISLANDS \
- || flag_mkernel || flag_apple_kext)
-
/* INSN is either a function call or a millicode call. It may have an
unconditional jump in its delay slot.
@@ -24402,7 +24503,7 @@ output_call (rtx insn, rtx *operands, int dest_operand_number,
int cookie_operand_number)
{
static char buf[256];
- if (DARWIN_GENERATE_ISLANDS
+ if (darwin_emit_branch_islands
&& GET_CODE (operands[dest_operand_number]) == SYMBOL_REF
&& (INTVAL (operands[cookie_operand_number]) & CALL_LONG))
{
@@ -25451,9 +25552,9 @@ rs6000_debug_address_cost (rtx x, bool speed)
/* A C expression returning the cost of moving data from a register of class
CLASS1 to one of CLASS2. */
-int
+static int
rs6000_register_move_cost (enum machine_mode mode,
- enum reg_class from, enum reg_class to)
+ reg_class_t from, reg_class_t to)
{
int ret;
@@ -25465,8 +25566,8 @@ rs6000_register_move_cost (enum machine_mode mode,
from = to;
if (from == FLOAT_REGS || from == ALTIVEC_REGS || from == VSX_REGS)
- ret = (rs6000_memory_move_cost (mode, from, 0)
- + rs6000_memory_move_cost (mode, GENERAL_REGS, 0));
+ ret = (rs6000_memory_move_cost (mode, from, false)
+ + rs6000_memory_move_cost (mode, GENERAL_REGS, false));
/* It's more expensive to move CR_REGS than CR0_REGS because of the
shift. */
@@ -25511,9 +25612,9 @@ rs6000_register_move_cost (enum machine_mode mode,
/* A C expressions returning the cost of moving data of MODE from a register to
or from memory. */
-int
-rs6000_memory_move_cost (enum machine_mode mode, enum reg_class rclass,
- int in ATTRIBUTE_UNUSED)
+static int
+rs6000_memory_move_cost (enum machine_mode mode, reg_class_t rclass,
+ bool in ATTRIBUTE_UNUSED)
{
int ret;
@@ -25630,8 +25731,8 @@ rs6000_emit_madd (rtx dst, rtx m1, rtx m2, rtx a)
{
/* For the simple ops, use the generator function, rather than assuming
that the RTL is standard. */
- enum insn_code mcode = optab_handler (smul_optab, mode)->insn_code;
- enum insn_code acode = optab_handler (add_optab, mode)->insn_code;
+ enum insn_code mcode = optab_handler (smul_optab, mode);
+ enum insn_code acode = optab_handler (add_optab, mode);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (mcode);
gen_2arg_fn_t gen_add = (gen_2arg_fn_t) GEN_FCN (acode);
rtx mreg = gen_reg_rtx (mode);
@@ -25663,8 +25764,8 @@ rs6000_emit_msub (rtx dst, rtx m1, rtx m2, rtx a)
{
/* For the simple ops, use the generator function, rather than assuming
that the RTL is standard. */
- enum insn_code mcode = optab_handler (smul_optab, mode)->insn_code;
- enum insn_code scode = optab_handler (add_optab, mode)->insn_code;
+ enum insn_code mcode = optab_handler (smul_optab, mode);
+ enum insn_code scode = optab_handler (add_optab, mode);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (mcode);
gen_2arg_fn_t gen_sub = (gen_2arg_fn_t) GEN_FCN (scode);
rtx mreg = gen_reg_rtx (mode);
@@ -25699,8 +25800,8 @@ rs6000_emit_nmsub (rtx dst, rtx m1, rtx m2, rtx a)
{
/* For the simple ops, use the generator function, rather than assuming
that the RTL is standard. */
- enum insn_code mcode = optab_handler (smul_optab, mode)->insn_code;
- enum insn_code scode = optab_handler (sub_optab, mode)->insn_code;
+ enum insn_code mcode = optab_handler (smul_optab, mode);
+ enum insn_code scode = optab_handler (sub_optab, mode);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (mcode);
gen_2arg_fn_t gen_sub = (gen_2arg_fn_t) GEN_FCN (scode);
rtx mreg = gen_reg_rtx (mode);
@@ -25734,7 +25835,7 @@ rs6000_emit_swdiv_high_precision (rtx dst, rtx n, rtx d)
{
enum machine_mode mode = GET_MODE (dst);
rtx x0, e0, e1, y1, u0, v0;
- enum insn_code code = optab_handler (smul_optab, mode)->insn_code;
+ enum insn_code code = optab_handler (smul_optab, mode);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
rtx one = rs6000_load_constant_and_splat (mode, dconst1);
@@ -25772,7 +25873,7 @@ rs6000_emit_swdiv_low_precision (rtx dst, rtx n, rtx d)
{
enum machine_mode mode = GET_MODE (dst);
rtx x0, e0, e1, e2, y1, y2, y3, u0, v0, one;
- enum insn_code code = optab_handler (smul_optab, mode)->insn_code;
+ enum insn_code code = optab_handler (smul_optab, mode);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
gcc_assert (code != CODE_FOR_nothing);
@@ -25843,7 +25944,7 @@ rs6000_emit_swrsqrt (rtx dst, rtx src)
REAL_VALUE_TYPE dconst3_2;
int i;
rtx halfthree;
- enum insn_code code = optab_handler (smul_optab, mode)->insn_code;
+ enum insn_code code = optab_handler (smul_optab, mode);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
gcc_assert (code != CODE_FOR_nothing);
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 2ee3da18284..ab0784572d5 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -160,6 +160,7 @@
%{mcpu=e500mc: -me500mc} \
%{mcpu=e500mc64: -me500mc64} \
%{maltivec: -maltivec} \
+%{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: %(asm_cpu_power7)}} \
-many"
#define CPP_DEFAULT_SPEC ""
@@ -1172,16 +1173,6 @@ extern unsigned rs6000_pointer_size;
#define HARD_REGNO_RENAME_OK(SRC, DST) \
(! ALTIVEC_REGNO_P (DST) || df_regs_ever_live_p (DST))
-/* A C expression returning the cost of moving data from a register of class
- CLASS1 to one of CLASS2. */
-
-#define REGISTER_MOVE_COST rs6000_register_move_cost
-
-/* A C expressions returning the cost of moving data of MODE from a register to
- or from memory. */
-
-#define MEMORY_MOVE_COST rs6000_memory_move_cost
-
/* Specify the cost of a branch insn; roughly the number of extra insns that
should be added to avoid a branch.
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 02602a1f661..21287c9e298 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -2105,10 +2105,10 @@
(compare:CC (match_dup 1)
(const_int 0)))
(set (match_dup 0)
- (if_then_else:GPR (ge (match_dup 3)
+ (if_then_else:GPR (lt (match_dup 3)
(const_int 0))
- (match_dup 1)
- (match_dup 2)))]
+ (match_dup 2)
+ (match_dup 1)))]
"")
(define_insn_and_split "nabs<mode>2_isel"
@@ -2124,10 +2124,10 @@
(compare:CC (match_dup 1)
(const_int 0)))
(set (match_dup 0)
- (if_then_else:GPR (ge (match_dup 3)
+ (if_then_else:GPR (lt (match_dup 3)
(const_int 0))
- (match_dup 2)
- (match_dup 1)))]
+ (match_dup 1)
+ (match_dup 2)))]
"")
(define_insn_and_split "abssi2_nopower"
@@ -6091,13 +6091,13 @@
;; change the mode underneath our feet and then gets confused trying
;; to reload the value.
(define_insn "isel_signed_<mode>"
- [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
+ [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
(if_then_else:GPR
- (match_operator 1 "comparison_operator"
- [(match_operand:CC 4 "cc_reg_operand" "y")
+ (match_operator 1 "scc_comparison_operator"
+ [(match_operand:CC 4 "cc_reg_operand" "y,y")
(const_int 0)])
- (match_operand:GPR 2 "gpc_reg_operand" "b")
- (match_operand:GPR 3 "gpc_reg_operand" "b")))]
+ (match_operand:GPR 2 "reg_or_cint_operand" "O,b")
+ (match_operand:GPR 3 "gpc_reg_operand" "r,r")))]
"TARGET_ISEL<sel>"
"*
{ return output_isel (operands); }"
@@ -6105,13 +6105,13 @@
(set_attr "length" "4")])
(define_insn "isel_unsigned_<mode>"
- [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
+ [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
(if_then_else:GPR
- (match_operator 1 "comparison_operator"
- [(match_operand:CCUNS 4 "cc_reg_operand" "y")
+ (match_operator 1 "scc_comparison_operator"
+ [(match_operand:CCUNS 4 "cc_reg_operand" "y,y")
(const_int 0)])
- (match_operand:GPR 2 "gpc_reg_operand" "b")
- (match_operand:GPR 3 "gpc_reg_operand" "b")))]
+ (match_operand:GPR 2 "reg_or_cint_operand" "O,b")
+ (match_operand:GPR 3 "gpc_reg_operand" "r,r")))]
"TARGET_ISEL<sel>"
"*
{ return output_isel (operands); }"
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index e70172a19a6..30f9b3988c0 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -245,6 +245,10 @@ mvrsave=
Target RejectNegative Joined
-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
+mblock-move-inline-limit=
+Target Report Var(rs6000_block_move_inline_limit) Init(0) RejectNegative Joined UInteger
+Specify how many bytes should be moved inline before calling out to memcpy/memmove
+
misel
Target Report Mask(ISEL)
Generate isel instructions
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 2e6fbc7cbd2..1007941f94c 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -905,7 +905,7 @@ SVR4_ASM_SPEC \
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
#if DEFAULT_LIBC == LIBC_UCLIBC
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
-#elif DEFAULT_LIBC == LIBC_GLIBC
+#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
#else
#error "Unsupported DEFAULT_LIBC"
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index 2219efe8559..c81ef4c1771 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -40,6 +40,7 @@
#include "optabs.h"
#include "libfuncs.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "reload.h"
#include "df.h"
@@ -2189,6 +2190,14 @@ rx_set_optimization_options (void)
}
}
+static void
+rx_option_override (void)
+{
+ /* This target defaults to strict volatile bitfields. */
+ if (flag_strict_volatile_bitfields < 0)
+ flag_strict_volatile_bitfields = 1;
+}
+
static bool
rx_allocate_stack_slots_for_args (void)
@@ -2777,6 +2786,9 @@ rx_memory_move_cost (enum machine_mode mode, enum reg_class regclass, bool in)
#undef TARGET_MEMORY_MOVE_COST
#define TARGET_MEMORY_MOVE_COST rx_memory_move_cost
+#undef TARGET_OPTION_OVERRIDE
+#define TARGET_OPTION_OVERRIDE rx_option_override
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* #include "gt-rx.h" */
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 7ff8cb870cd..56cbac2022c 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "expr.h"
#include "reload.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "basic-block.h"
#include "integrate.h"
@@ -1675,8 +1676,9 @@ override_options (void)
set_param_value ("simultaneous-prefetches", 6);
/* This cannot reside in optimization_options since HAVE_prefetch
- requires the arch flags to be evaluated already. */
- if (HAVE_prefetch && optimize >= 3)
+ requires the arch flags to be evaluated already. Since prefetching
+ is beneficial on s390, we enable it if available. */
+ if (flag_prefetch_loop_arrays < 0 && HAVE_prefetch && optimize >= 3)
flag_prefetch_loop_arrays = 1;
}
@@ -8281,7 +8283,7 @@ s390_function_arg_float (enum machine_mode mode, tree type)
{
tree field, single = NULL_TREE;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -8589,9 +8591,9 @@ s390_build_builtin_va_list (void)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_gpr;
- TREE_CHAIN (f_gpr) = f_fpr;
- TREE_CHAIN (f_fpr) = f_ovf;
- TREE_CHAIN (f_ovf) = f_sav;
+ DECL_CHAIN (f_gpr) = f_fpr;
+ DECL_CHAIN (f_fpr) = f_ovf;
+ DECL_CHAIN (f_ovf) = f_sav;
layout_type (record);
@@ -8621,9 +8623,9 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
tree gpr, fpr, ovf, sav, t;
f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
- f_fpr = TREE_CHAIN (f_gpr);
- f_ovf = TREE_CHAIN (f_fpr);
- f_sav = TREE_CHAIN (f_ovf);
+ f_fpr = DECL_CHAIN (f_gpr);
+ f_ovf = DECL_CHAIN (f_fpr);
+ f_sav = DECL_CHAIN (f_ovf);
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
@@ -8719,9 +8721,9 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
tree lab_false, lab_over, addr;
f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
- f_fpr = TREE_CHAIN (f_gpr);
- f_ovf = TREE_CHAIN (f_fpr);
- f_sav = TREE_CHAIN (f_ovf);
+ f_fpr = DECL_CHAIN (f_gpr);
+ f_ovf = DECL_CHAIN (f_fpr);
+ f_sav = DECL_CHAIN (f_ovf);
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
diff --git a/gcc/config/score/score.c b/gcc/config/score/score.c
index 33e15ee330f..3bddc041ffe 100644
--- a/gcc/config/score/score.c
+++ b/gcc/config/score/score.c
@@ -29,6 +29,7 @@
#include "conditions.h"
#include "insn-attr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "tree.h"
diff --git a/gcc/config/score/score3.c b/gcc/config/score/score3.c
index 3e20f16dc33..cf334312fdf 100644
--- a/gcc/config/score/score3.c
+++ b/gcc/config/score/score3.c
@@ -29,6 +29,7 @@
#include "conditions.h"
#include "insn-attr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "tree.h"
diff --git a/gcc/config/score/score7.c b/gcc/config/score/score7.c
index 464d97cee22..d3cd1c518f6 100644
--- a/gcc/config/score/score7.c
+++ b/gcc/config/score/score7.c
@@ -29,6 +29,7 @@
#include "conditions.h"
#include "insn-attr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "tree.h"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index c488ef4958b..8ace99c732c 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "output.h"
#include "insn-attr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "integrate.h"
@@ -972,6 +973,10 @@ sh_override_options (void)
if (sh_fixed_range_str)
sh_fix_range (sh_fixed_range_str);
+
+ /* This target defaults to strict volatile bitfields. */
+ if (flag_strict_volatile_bitfields < 0)
+ flag_strict_volatile_bitfields = 1;
}
/* Print the operand address in x to the stream. */
@@ -6860,13 +6865,12 @@ sh_expand_prologue (void)
for (i = 0; i < NPARM_REGS(SImode); i++)
{
int rn = NPARM_REGS(SImode) + FIRST_PARM_REG - i - 1;
- rtx insn;
if (i >= (NPARM_REGS(SImode)
- crtl->args.info.arg_count[(int) SH_ARG_INT]
))
break;
- insn = push (rn);
+ push (rn);
}
}
}
@@ -7231,7 +7235,7 @@ sh_expand_epilogue (bool sibcall_p)
{
enum machine_mode mode = (enum machine_mode) entry->mode;
int reg = entry->reg;
- rtx reg_rtx, mem_rtx, post_inc = NULL_RTX, insn;
+ rtx reg_rtx, mem_rtx, post_inc = NULL_RTX;
offset = offset_base + entry->offset;
reg_rtx = gen_rtx_REG (mode, reg);
@@ -7304,7 +7308,7 @@ sh_expand_epilogue (bool sibcall_p)
if ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
&& mem_rtx != post_inc)
{
- insn = emit_move_insn (r0, mem_rtx);
+ emit_move_insn (r0, mem_rtx);
mem_rtx = r0;
}
else if (TARGET_REGISTER_P (reg))
@@ -7313,13 +7317,13 @@ sh_expand_epilogue (bool sibcall_p)
/* Give the scheduler a bit of freedom by using up to
MAX_TEMPS registers in a round-robin fashion. */
- insn = emit_move_insn (tmp_reg, mem_rtx);
+ emit_move_insn (tmp_reg, mem_rtx);
mem_rtx = tmp_reg;
if (*++tmp_pnt < 0)
tmp_pnt = schedule.temps;
}
- insn = emit_move_insn (reg_rtx, mem_rtx);
+ emit_move_insn (reg_rtx, mem_rtx);
}
gcc_assert (entry->offset + offset_base == d + d_rounding);
@@ -7690,10 +7694,10 @@ sh_build_builtin_va_list (void)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_next_o;
- TREE_CHAIN (f_next_o) = f_next_o_limit;
- TREE_CHAIN (f_next_o_limit) = f_next_fp;
- TREE_CHAIN (f_next_fp) = f_next_fp_limit;
- TREE_CHAIN (f_next_fp_limit) = f_next_stack;
+ DECL_CHAIN (f_next_o) = f_next_o_limit;
+ DECL_CHAIN (f_next_o_limit) = f_next_fp;
+ DECL_CHAIN (f_next_fp) = f_next_fp_limit;
+ DECL_CHAIN (f_next_fp_limit) = f_next_stack;
layout_type (record);
@@ -7725,10 +7729,10 @@ sh_va_start (tree valist, rtx nextarg)
}
f_next_o = TYPE_FIELDS (va_list_type_node);
- f_next_o_limit = TREE_CHAIN (f_next_o);
- f_next_fp = TREE_CHAIN (f_next_o_limit);
- f_next_fp_limit = TREE_CHAIN (f_next_fp);
- f_next_stack = TREE_CHAIN (f_next_fp_limit);
+ f_next_o_limit = DECL_CHAIN (f_next_o);
+ f_next_fp = DECL_CHAIN (f_next_o_limit);
+ f_next_fp_limit = DECL_CHAIN (f_next_fp);
+ f_next_stack = DECL_CHAIN (f_next_fp_limit);
next_o = build3 (COMPONENT_REF, TREE_TYPE (f_next_o), valist, f_next_o,
NULL_TREE);
@@ -7787,7 +7791,7 @@ find_sole_member (tree type)
{
tree field, member = NULL_TREE;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -7830,10 +7834,10 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
tree member;
f_next_o = TYPE_FIELDS (va_list_type_node);
- f_next_o_limit = TREE_CHAIN (f_next_o);
- f_next_fp = TREE_CHAIN (f_next_o_limit);
- f_next_fp_limit = TREE_CHAIN (f_next_fp);
- f_next_stack = TREE_CHAIN (f_next_fp_limit);
+ f_next_o_limit = DECL_CHAIN (f_next_o);
+ f_next_fp = DECL_CHAIN (f_next_o_limit);
+ f_next_fp_limit = DECL_CHAIN (f_next_fp);
+ f_next_stack = DECL_CHAIN (f_next_fp_limit);
next_o = build3 (COMPONENT_REF, TREE_TYPE (f_next_o), valist, f_next_o,
NULL_TREE);
@@ -7886,7 +7890,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
lab_false = create_artificial_label (UNKNOWN_LOCATION);
lab_over = create_artificial_label (UNKNOWN_LOCATION);
- valist = build1 (INDIRECT_REF, ptr_type_node, addr);
+ valist = build_simple_mem_ref (addr);
if (pass_as_float)
{
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 485c038775e..495e15105d2 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -8469,7 +8469,7 @@ label:
""
"
{
- rtx insn, mem;
+ rtx mem;
operands[2] = !can_create_pseudo_p () ? operands[0] : gen_reg_rtx (Pmode);
operands[3] = !can_create_pseudo_p () ? operands[0] : gen_reg_rtx (Pmode);
@@ -8518,7 +8518,7 @@ label:
mem = gen_rtx_MEM (Pmode, operands[3]);
MEM_NOTRAP_P (mem) = 1;
/* ??? Should we have a special alias set for the GOT? */
- insn = emit_move_insn (operands[0], mem);
+ emit_move_insn (operands[0], mem);
DONE;
}")
@@ -8685,7 +8685,7 @@ mov.l\\t1f,r4\\n\\
""
"
{
- rtx dtpoffsym, insn;
+ rtx dtpoffsym;
rtx t = (!can_create_pseudo_p ()
? operands[0]
: gen_reg_rtx (GET_MODE (operands[0])));
@@ -8693,8 +8693,7 @@ mov.l\\t1f,r4\\n\\
dtpoffsym = gen_sym2DTPOFF (operands[1]);
PUT_MODE (dtpoffsym, Pmode);
emit_move_insn (t, dtpoffsym);
- insn = emit_move_insn (operands[0],
- gen_rtx_PLUS (Pmode, t, operands[2]));
+ emit_move_insn (operands[0], gen_rtx_PLUS (Pmode, t, operands[2]));
DONE;
}")
@@ -8736,11 +8735,11 @@ mov.l\\t1f,r0\\n\\
""
"
{
- rtx tpoffsym, insn;
+ rtx tpoffsym;
tpoffsym = gen_sym2TPOFF (operands[1]);
PUT_MODE (tpoffsym, Pmode);
- insn = emit_move_insn (operands[0], tpoffsym);
+ emit_move_insn (operands[0], tpoffsym);
DONE;
}")
diff --git a/gcc/config/sh/symbian-base.c b/gcc/config/sh/symbian-base.c
index 624c6fc7a0a..03c58344cfd 100644
--- a/gcc/config/sh/symbian-base.c
+++ b/gcc/config/sh/symbian-base.c
@@ -30,6 +30,7 @@
#include "tree.h"
#include "expr.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "sh-symbian.h"
diff --git a/gcc/config/sh/symbian-c.c b/gcc/config/sh/symbian-c.c
index 4fda0aee990..32a11664367 100644
--- a/gcc/config/sh/symbian-c.c
+++ b/gcc/config/sh/symbian-c.c
@@ -29,6 +29,7 @@
#include "tree.h"
#include "expr.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "sh-symbian.h"
diff --git a/gcc/config/sh/symbian-cxx.c b/gcc/config/sh/symbian-cxx.c
index 0a457653520..5f1ef93ca6e 100644
--- a/gcc/config/sh/symbian-cxx.c
+++ b/gcc/config/sh/symbian-cxx.c
@@ -30,6 +30,7 @@
#include "expr.h"
#include "tm_p.h"
#include "cp/cp-tree.h" /* We need access to the OVL_... macros. */
+#include "diagnostic-core.h"
#include "toplev.h"
#include "sh-symbian.h"
@@ -629,7 +630,7 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args,
sh_symbian_add_attribute (function, attr);
/* Propagate the attribute to any function thunks as well. */
- for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk))
+ for (thunk = DECL_THUNKS (function); thunk; thunk = DECL_CHAIN (thunk))
if (TREE_CODE (thunk) == FUNCTION_DECL)
sh_symbian_add_attribute (thunk, attr);
}
@@ -638,7 +639,7 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args,
if (TREE_CODE (node) == FUNCTION_DECL && DECL_VIRTUAL_P (node))
{
/* Propagate the attribute to any thunks of this function. */
- for (thunk = DECL_THUNKS (node); thunk; thunk = TREE_CHAIN (thunk))
+ for (thunk = DECL_THUNKS (node); thunk; thunk = DECL_CHAIN (thunk))
if (TREE_CODE (thunk) == FUNCTION_DECL)
sh_symbian_add_attribute (thunk, attr);
}
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
index 7c5f647e3e8..6cb220211c5 100644
--- a/gcc/config/sol2.c
+++ b/gcc/config/sol2.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 7b7ce2bfbab..805b32fe89c 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -124,11 +124,12 @@ along with GCC; see the file COPYING3. If not see
#undef LIB_SPEC
#define LIB_SPEC \
"%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
- %{!shared:\
- %{!symbolic:\
- %{pthreads|pthread:-lpthread} \
- %{!pthreads:%{!pthread:%{threads:-lthread}}} \
- %{p|pg:-ldl} -lc}}"
+ %{!symbolic:\
+ %{pthreads|pthread:" \
+ LIB_THREAD_LDFLAGS_SPEC " -lpthread " LIB_TLS_SPEC "} \
+ %{!pthreads:%{!pthread:%{threads:" \
+ LIB_THREAD_LDFLAGS_SPEC " -lthread}}} \
+ %{p|pg:-ldl} -lc}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index b12c881ebed..530a6ae7065 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -161,6 +161,9 @@ do { \
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
#define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
/* Linux currently uses RMO in uniprocessor mode, which is equivalent to
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index c2e78d726de..369c13c8e3c 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -287,6 +287,9 @@ do { \
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
#define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
/* Linux currently uses RMO in uniprocessor mode, which is equivalent to
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index a341bcfd30b..26c9ac7d396 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -188,4 +188,7 @@ along with GCC; see the file COPYING3. If not see
#define PUSHSECTION_FORMAT "\t.pushsection\t\"%s\"\n"
#endif
+/* Static stack checking is supported by means of probes. */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
#define MD_UNWIND_SUPPORT "config/sparc/sol2-unwind.h"
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index cc51280596c..35c99b967ba 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -75,6 +75,7 @@ extern const char *output_return (rtx);
extern const char *output_sibcall (rtx, rtx);
extern const char *output_v8plus_shift (rtx *, rtx, const char *);
extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx);
+extern const char *output_probe_stack_range (rtx, rtx);
extern bool emit_scc_insn (rtx []);
extern void emit_conditional_branch_insn (rtx []);
extern void print_operand (FILE *, rtx, int);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 412f27c3066..d4769554033 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -37,9 +37,11 @@ along with GCC; see the file COPYING3. If not see
#include "insn-attr.h"
#include "flags.h"
#include "function.h"
+#include "except.h"
#include "expr.h"
#include "optabs.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "tm_p.h"
@@ -4005,6 +4007,160 @@ sparc_output_scratch_registers (FILE *file ATTRIBUTE_UNUSED)
#endif
}
+#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
+
+#if PROBE_INTERVAL > 4096
+#error Cannot use indexed addressing mode for stack probing
+#endif
+
+/* Emit code to probe a range of stack addresses from FIRST to FIRST+SIZE,
+ inclusive. These are offsets from the current stack pointer.
+
+ Note that we don't use the REG+REG addressing mode for the probes because
+ of the stack bias in 64-bit mode. And it doesn't really buy us anything
+ so the advantages of having a single code win here. */
+
+static void
+sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
+{
+ rtx g1 = gen_rtx_REG (Pmode, 1);
+
+ /* See if we have a constant small number of probes to generate. If so,
+ that's the easy case. */
+ if (size <= PROBE_INTERVAL)
+ {
+ emit_move_insn (g1, GEN_INT (first));
+ emit_insn (gen_rtx_SET (VOIDmode, g1,
+ gen_rtx_MINUS (Pmode, stack_pointer_rtx, g1)));
+ emit_stack_probe (plus_constant (g1, -size));
+ }
+
+ /* The run-time loop is made up of 10 insns in the generic case while the
+ compile-time loop is made up of 4+2*(n-2) insns for n # of intervals. */
+ else if (size <= 5 * PROBE_INTERVAL)
+ {
+ HOST_WIDE_INT i;
+
+ emit_move_insn (g1, GEN_INT (first + PROBE_INTERVAL));
+ emit_insn (gen_rtx_SET (VOIDmode, g1,
+ gen_rtx_MINUS (Pmode, stack_pointer_rtx, g1)));
+ emit_stack_probe (g1);
+
+ /* Probe at FIRST + N * PROBE_INTERVAL for values of N from 2 until
+ it exceeds SIZE. If only two probes are needed, this will not
+ generate any code. Then probe at FIRST + SIZE. */
+ for (i = 2 * PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, g1,
+ plus_constant (g1, -PROBE_INTERVAL)));
+ emit_stack_probe (g1);
+ }
+
+ emit_stack_probe (plus_constant (g1, (i - PROBE_INTERVAL) - size));
+ }
+
+ /* Otherwise, do the same as above, but in a loop. Note that we must be
+ extra careful with variables wrapping around because we might be at
+ the very top (or the very bottom) of the address space and we have
+ to be able to handle this case properly; in particular, we use an
+ equality test for the loop condition. */
+ else
+ {
+ HOST_WIDE_INT rounded_size;
+ rtx g4 = gen_rtx_REG (Pmode, 4);
+
+ emit_move_insn (g1, GEN_INT (first));
+
+
+ /* Step 1: round SIZE to the previous multiple of the interval. */
+
+ rounded_size = size & -PROBE_INTERVAL;
+ emit_move_insn (g4, GEN_INT (rounded_size));
+
+
+ /* Step 2: compute initial and final value of the loop counter. */
+
+ /* TEST_ADDR = SP + FIRST. */
+ emit_insn (gen_rtx_SET (VOIDmode, g1,
+ gen_rtx_MINUS (Pmode, stack_pointer_rtx, g1)));
+
+ /* LAST_ADDR = SP + FIRST + ROUNDED_SIZE. */
+ emit_insn (gen_rtx_SET (VOIDmode, g4, gen_rtx_MINUS (Pmode, g1, g4)));
+
+
+ /* Step 3: the loop
+
+ while (TEST_ADDR != LAST_ADDR)
+ {
+ TEST_ADDR = TEST_ADDR + PROBE_INTERVAL
+ probe at TEST_ADDR
+ }
+
+ probes at FIRST + N * PROBE_INTERVAL for values of N from 1
+ until it is equal to ROUNDED_SIZE. */
+
+ if (TARGET_64BIT)
+ emit_insn (gen_probe_stack_rangedi (g1, g1, g4));
+ else
+ emit_insn (gen_probe_stack_rangesi (g1, g1, g4));
+
+
+ /* Step 4: probe at FIRST + SIZE if we cannot assert at compile-time
+ that SIZE is equal to ROUNDED_SIZE. */
+
+ if (size != rounded_size)
+ emit_stack_probe (plus_constant (g4, rounded_size - size));
+ }
+
+ /* Make sure nothing is scheduled before we are done. */
+ emit_insn (gen_blockage ());
+}
+
+/* Probe a range of stack addresses from REG1 to REG2 inclusive. These are
+ absolute addresses. */
+
+const char *
+output_probe_stack_range (rtx reg1, rtx reg2)
+{
+ static int labelno = 0;
+ char loop_lab[32], end_lab[32];
+ rtx xops[2];
+
+ ASM_GENERATE_INTERNAL_LABEL (loop_lab, "LPSRL", labelno);
+ ASM_GENERATE_INTERNAL_LABEL (end_lab, "LPSRE", labelno++);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab);
+
+ /* Jump to END_LAB if TEST_ADDR == LAST_ADDR. */
+ xops[0] = reg1;
+ xops[1] = reg2;
+ output_asm_insn ("cmp\t%0, %1", xops);
+ if (TARGET_ARCH64)
+ fputs ("\tbe,pn\t%xcc,", asm_out_file);
+ else
+ fputs ("\tbe\t", asm_out_file);
+ assemble_name_raw (asm_out_file, end_lab);
+ fputc ('\n', asm_out_file);
+
+ /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */
+ xops[1] = GEN_INT (-PROBE_INTERVAL);
+ output_asm_insn (" add\t%0, %1, %0", xops);
+
+ /* Probe at TEST_ADDR and branch. */
+ if (TARGET_ARCH64)
+ fputs ("\tba,pt\t%xcc,", asm_out_file);
+ else
+ fputs ("\tba\t", asm_out_file);
+ assemble_name_raw (asm_out_file, loop_lab);
+ fputc ('\n', asm_out_file);
+ xops[1] = GEN_INT (SPARC_STACK_BIAS);
+ output_asm_insn (" st\t%%g0, [%0+%1]", xops);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, end_lab);
+
+ return "";
+}
+
/* Save/restore call-saved registers from LOW to HIGH at BASE+OFFSET
as needed. LOW should be double-word aligned for 32-bit registers.
Return the new OFFSET. */
@@ -4193,6 +4349,9 @@ sparc_expand_prologue (void)
/* Advertise that the data calculated just above are now valid. */
sparc_prologue_data_valid_p = true;
+ if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && actual_fsize)
+ sparc_emit_probe_stack_range (STACK_CHECK_PROTECT, actual_fsize);
+
if (sparc_leaf_function_p)
{
frame_base_reg = stack_pointer_rtx;
@@ -4714,7 +4873,7 @@ scan_record_type (tree type, int *intregs_p, int *fpregs_p, int *packed_p)
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)
{
@@ -4934,7 +5093,7 @@ function_arg_record_value_1 (const_tree type, HOST_WIDE_INT startbitpos,
}
/* Compute how many registers we need. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)
{
@@ -5073,7 +5232,7 @@ function_arg_record_value_2 (const_tree type, HOST_WIDE_INT startbitpos,
tree field;
if (! packed_p)
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL && DECL_PACKED (field))
{
@@ -5082,7 +5241,7 @@ function_arg_record_value_2 (const_tree type, HOST_WIDE_INT startbitpos,
}
}
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)
{
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 7eb8ece783a..301a63c2693 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -75,6 +75,7 @@
(UNSPECV_CAS 8)
(UNSPECV_SWAP 9)
(UNSPECV_LDSTUB 10)
+ (UNSPECV_PROBE_STACK_RANGE 11)
])
@@ -6340,6 +6341,15 @@
= adjust_address (operands[0], GET_MODE (operands[0]), SPARC_STACK_BIAS);
})
+(define_insn "probe_stack_range<P:mode>"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec_volatile:P [(match_operand:P 1 "register_operand" "0")
+ (match_operand:P 2 "register_operand" "r")]
+ UNSPECV_PROBE_STACK_RANGE))]
+ ""
+ "* return output_probe_stack_range (operands[0], operands[2]);"
+ [(set_attr "type" "multi")])
+
;; Prepare to return any type including a structure value.
(define_expand "untyped_return"
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index ce5f92d94db..1f22cd6fb7c 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -24,6 +24,7 @@
#include "c-family/c-pragma.h"
#include "tm_p.h"
#include "langhooks.h"
+#include "target.h"
/* Keep the vector keywords handy for fast comparisons. */
@@ -111,7 +112,7 @@ spu_resolve_overloaded_builtin (location_t loc, tree fndecl, void *passed_args)
for (new_fcode = fcode + 1; spu_builtins[new_fcode].type == B_INTERNAL;
new_fcode++)
{
- tree decl = spu_builtins[new_fcode].fndecl;
+ tree decl = targetm.builtin_decl (new_fcode, true);
tree params = TYPE_ARG_TYPES (TREE_TYPE (decl));
tree param;
bool all_scalar;
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 8ae4e605362..689b50048ff 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -35,6 +35,7 @@
#include "output.h"
#include "basic-block.h"
#include "integrate.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "hashtab.h"
@@ -209,7 +210,7 @@ static rtx spu_addr_space_legitimize_address (rtx, rtx, enum machine_mode,
static tree spu_builtin_mul_widen_even (tree);
static tree spu_builtin_mul_widen_odd (tree);
static tree spu_builtin_mask_for_load (void);
-static int spu_builtin_vectorization_cost (enum vect_cost_for_stmt);
+static int spu_builtin_vectorization_cost (enum vect_cost_for_stmt, tree, int);
static bool spu_vector_alignment_reachable (const_tree, bool);
static tree spu_builtin_vec_perm (tree, tree *);
static enum machine_mode spu_addr_space_pointer_mode (addr_space_t);
@@ -224,8 +225,6 @@ static void spu_unique_section (tree, int);
static rtx spu_expand_load (rtx, rtx, rtx, int);
static void spu_trampoline_init (rtx, tree, rtx);
-extern const char *reg_names[];
-
/* Which instruction set architecture to use. */
int spu_arch;
/* Which cpu are we tuning for. */
@@ -1139,7 +1138,7 @@ spu_emit_branch_or_set (int is_set, rtx cmp, rtx operands[])
if (eq_rtx == 0)
abort ();
emit_insn (eq_rtx);
- ior_code = ior_optab->handlers[(int)comp_mode].insn_code;
+ ior_code = optab_handler (ior_optab, comp_mode);
gcc_assert (ior_code != CODE_FOR_nothing);
emit_insn (GEN_FCN (ior_code)
(compare_result, compare_result, eq_result));
@@ -1696,8 +1695,6 @@ print_operand (FILE * file, rtx x, int code)
gcc_unreachable ();
}
-extern char call_used_regs[];
-
/* For PIC mode we've reserved PIC_OFFSET_TABLE_REGNUM, which is a
caller saved register. For leaf functions it is more efficient to
use a volatile register because we won't need to save and restore the
@@ -4079,7 +4076,7 @@ spu_build_builtin_va_list (void)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_args;
- TREE_CHAIN (f_args) = f_skip;
+ DECL_CHAIN (f_args) = f_skip;
/* We know this is being padded and we want it too. It is an internal
type so hide the warnings from the user. */
@@ -4114,7 +4111,7 @@ spu_va_start (tree valist, rtx nextarg)
tree args, skip, t;
f_args = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
- f_skip = TREE_CHAIN (f_args);
+ f_skip = DECL_CHAIN (f_args);
valist = build_va_arg_indirect_ref (valist);
args =
@@ -4169,9 +4166,9 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p,
bool pass_by_reference_p;
f_args = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
- f_skip = TREE_CHAIN (f_args);
+ f_skip = DECL_CHAIN (f_args);
- valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist);
+ valist = build_simple_mem_ref (valist);
args =
build3 (COMPONENT_REF, TREE_TYPE (f_args), valist, f_args, NULL_TREE);
skip =
@@ -4588,7 +4585,8 @@ spu_expand_mov (rtx * ops, enum machine_mode mode)
if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (imode))
{
- enum insn_code icode = convert_optab_handler (trunc_optab, mode, imode)->insn_code;
+ enum insn_code icode = convert_optab_handler (trunc_optab,
+ mode, imode);
emit_insn (GEN_FCN (icode) (ops[0], from));
}
else
@@ -5616,12 +5614,14 @@ extern GTY(()) struct spu_builtin_description spu_builtins[NUM_SPU_BUILTINS];
struct spu_builtin_description spu_builtins[] = {
#define DEF_BUILTIN(fcode, icode, name, type, params) \
- {fcode, icode, name, type, params, NULL_TREE},
+ {fcode, icode, name, type, params},
#include "spu-builtins.def"
#undef DEF_BUILTIN
};
-/* Returns the rs6000 builtin decl for CODE. */
+static GTY(()) tree spu_builtin_decls[NUM_SPU_BUILTINS];
+
+/* Returns the spu builtin decl for CODE. */
static tree
spu_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
@@ -5629,7 +5629,7 @@ spu_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
if (code >= NUM_SPU_BUILTINS)
return error_mark_node;
- return spu_builtins[code].fndecl;
+ return spu_builtin_decls[code];
}
@@ -5707,14 +5707,14 @@ spu_init_builtins (void)
p = build_function_type (spu_builtin_types[d->parm[0]], p);
sprintf (name, "__builtin_%s", d->name);
- d->fndecl =
+ spu_builtin_decls[i] =
add_builtin_function (name, p, END_BUILTINS + i, BUILT_IN_MD,
NULL, NULL_TREE);
if (d->fcode == SPU_MASK_FOR_LOAD)
- TREE_READONLY (d->fndecl) = 1;
+ TREE_READONLY (spu_builtin_decls[i]) = 1;
/* These builtins don't throw. */
- TREE_NOTHROW (d->fndecl) = 1;
+ TREE_NOTHROW (spu_builtin_decls[i]) = 1;
}
}
@@ -6251,7 +6251,7 @@ spu_emit_vector_compare (enum rtx_code rcode,
{
enum insn_code nor_code;
rtx eq_rtx = spu_emit_vector_compare (EQ, op0, op1, dest_mode);
- nor_code = optab_handler (one_cmpl_optab, (int)dest_mode)->insn_code;
+ nor_code = optab_handler (one_cmpl_optab, dest_mode);
gcc_assert (nor_code != CODE_FOR_nothing);
emit_insn (GEN_FCN (nor_code) (mask, eq_rtx));
if (dmode != dest_mode)
@@ -6286,7 +6286,7 @@ spu_emit_vector_compare (enum rtx_code rcode,
c_rtx = spu_emit_vector_compare (new_code, op0, op1, dest_mode);
eq_rtx = spu_emit_vector_compare (EQ, op0, op1, dest_mode);
- ior_code = optab_handler (ior_optab, (int)dest_mode)->insn_code;
+ ior_code = optab_handler (ior_optab, dest_mode);
gcc_assert (ior_code != CODE_FOR_nothing);
emit_insn (GEN_FCN (ior_code) (mask, c_rtx, eq_rtx));
if (dmode != dest_mode)
@@ -6514,7 +6514,7 @@ spu_expand_builtin_1 (struct spu_builtin_description *d,
/* get addr */
arg = CALL_EXPR_ARG (exp, 0);
- gcc_assert (TREE_CODE (TREE_TYPE (arg)) == POINTER_TYPE);
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg)));
op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL);
addr = memory_address (mode, op);
@@ -6657,9 +6657,9 @@ spu_builtin_mul_widen_even (tree type)
{
case V8HImode:
if (TYPE_UNSIGNED (type))
- return spu_builtins[SPU_MULE_0].fndecl;
+ return spu_builtin_decls[SPU_MULE_0];
else
- return spu_builtins[SPU_MULE_1].fndecl;
+ return spu_builtin_decls[SPU_MULE_1];
break;
default:
return NULL_TREE;
@@ -6674,9 +6674,9 @@ spu_builtin_mul_widen_odd (tree type)
{
case V8HImode:
if (TYPE_UNSIGNED (type))
- return spu_builtins[SPU_MULO_1].fndecl;
+ return spu_builtin_decls[SPU_MULO_1];
else
- return spu_builtins[SPU_MULO_0].fndecl;
+ return spu_builtin_decls[SPU_MULO_0];
break;
default:
return NULL_TREE;
@@ -6687,14 +6687,14 @@ spu_builtin_mul_widen_odd (tree type)
static tree
spu_builtin_mask_for_load (void)
{
- struct spu_builtin_description *d = &spu_builtins[SPU_MASK_FOR_LOAD];
- gcc_assert (d);
- return d->fndecl;
+ return spu_builtin_decls[SPU_MASK_FOR_LOAD];
}
/* Implement targetm.vectorize.builtin_vectorization_cost. */
static int
-spu_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost)
+spu_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
+ tree vectype ATTRIBUTE_UNUSED,
+ int misalign ATTRIBUTE_UNUSED)
{
switch (type_of_cost)
{
@@ -6744,54 +6744,43 @@ spu_vector_alignment_reachable (const_tree type ATTRIBUTE_UNUSED, bool is_packed
tree
spu_builtin_vec_perm (tree type, tree *mask_element_type)
{
- struct spu_builtin_description *d;
-
*mask_element_type = unsigned_char_type_node;
switch (TYPE_MODE (type))
{
case V16QImode:
if (TYPE_UNSIGNED (type))
- d = &spu_builtins[SPU_SHUFFLE_0];
+ return spu_builtin_decls[SPU_SHUFFLE_0];
else
- d = &spu_builtins[SPU_SHUFFLE_1];
- break;
+ return spu_builtin_decls[SPU_SHUFFLE_1];
case V8HImode:
if (TYPE_UNSIGNED (type))
- d = &spu_builtins[SPU_SHUFFLE_2];
+ return spu_builtin_decls[SPU_SHUFFLE_2];
else
- d = &spu_builtins[SPU_SHUFFLE_3];
- break;
+ return spu_builtin_decls[SPU_SHUFFLE_3];
case V4SImode:
if (TYPE_UNSIGNED (type))
- d = &spu_builtins[SPU_SHUFFLE_4];
+ return spu_builtin_decls[SPU_SHUFFLE_4];
else
- d = &spu_builtins[SPU_SHUFFLE_5];
- break;
+ return spu_builtin_decls[SPU_SHUFFLE_5];
case V2DImode:
if (TYPE_UNSIGNED (type))
- d = &spu_builtins[SPU_SHUFFLE_6];
+ return spu_builtin_decls[SPU_SHUFFLE_6];
else
- d = &spu_builtins[SPU_SHUFFLE_7];
- break;
+ return spu_builtin_decls[SPU_SHUFFLE_7];
case V4SFmode:
- d = &spu_builtins[SPU_SHUFFLE_8];
- break;
+ return spu_builtin_decls[SPU_SHUFFLE_8];
case V2DFmode:
- d = &spu_builtins[SPU_SHUFFLE_9];
- break;
+ return spu_builtin_decls[SPU_SHUFFLE_9];
default:
return NULL_TREE;
}
-
- gcc_assert (d);
- return d->fndecl;
}
/* Return the appropriate mode for a named address pointer. */
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index d3880418c2f..1184227bf01 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -570,7 +570,7 @@ enum spu_builtin_type
B_INTERNAL
};
-struct GTY(()) spu_builtin_description
+struct spu_builtin_description
{
int fcode;
int icode;
@@ -580,8 +580,6 @@ struct GTY(()) spu_builtin_description
/* The first element of parm is always the return type. The rest
are a zero terminated list of parameters. */
int parm[5];
-
- tree fndecl;
};
extern struct spu_builtin_description spu_builtins[];
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 30fe9a534b0..bdfd07d0c4c 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -33,6 +33,7 @@
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "obstack.h"
#include "tree.h"
@@ -1316,7 +1317,7 @@ xstormy16_build_builtin_va_list (void)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_1;
- TREE_CHAIN (f_1) = f_2;
+ DECL_CHAIN (f_1) = f_2;
layout_type (record);
@@ -1339,7 +1340,7 @@ xstormy16_expand_builtin_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
error ("cannot use va_start in interrupt function");
f_base = TYPE_FIELDS (va_list_type_node);
- f_count = TREE_CHAIN (f_base);
+ f_count = DECL_CHAIN (f_base);
base = build3 (COMPONENT_REF, TREE_TYPE (f_base), valist, f_base, NULL_TREE);
count = build3 (COMPONENT_REF, TREE_TYPE (f_count), valist, f_count,
@@ -1376,7 +1377,7 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
tree size_tree;
f_base = TYPE_FIELDS (va_list_type_node);
- f_count = TREE_CHAIN (f_base);
+ f_count = DECL_CHAIN (f_base);
base = build3 (COMPONENT_REF, TREE_TYPE (f_base), valist, f_base, NULL_TREE);
count = build3 (COMPONENT_REF, TREE_TYPE (f_count), valist, f_count,
diff --git a/gcc/config/v850/v850-c.c b/gcc/config/v850/v850-c.c
index c3c3815492e..263bc4d1539 100644
--- a/gcc/config/v850/v850-c.c
+++ b/gcc/config/v850/v850-c.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "cpplib.h"
#include "tree.h"
#include "c-family/c-pragma.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "tm_p.h"
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 28b4c87a2e4..2cf0ad2f646 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -35,6 +35,7 @@
#include "recog.h"
#include "expr.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "integrate.h"
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index b3dfcb1e079..f7f1a715f0b 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "flags.h"
#include "debug.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm-preds.h"
#include "tm-constrs.h"
diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
index 941eb39de7f..2b1525a3180 100644
--- a/gcc/config/vxworks.c
+++ b/gcc/config/vxworks.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "target.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "tm.h"
@@ -69,21 +70,21 @@ vxworks_emutls_var_fields (tree type, tree *name)
*name = get_identifier ("__tls_var");
- field = build_decl (FIELD_DECL, get_identifier ("size"),
- unsigned_type_node);
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL,
+ get_identifier ("size"), unsigned_type_node);
DECL_CONTEXT (field) = type;
next_field = field;
- field = build_decl (FIELD_DECL, get_identifier ("module_id"),
- unsigned_type_node);
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL,
+ get_identifier ("module_id"), unsigned_type_node);
DECL_CONTEXT (field) = type;
- TREE_CHAIN (field) = next_field;
+ DECL_CHAIN (field) = next_field;
next_field = field;
- field = build_decl (FIELD_DECL, get_identifier ("offset"),
- unsigned_type_node);
+ field = build_decl (BUILTINS_LOCATION, FIELD_DECL,
+ get_identifier ("offset"), unsigned_type_node);
DECL_CONTEXT (field) = type;
- TREE_CHAIN (field) = next_field;
+ DECL_CHAIN (field) = next_field;
return field;
}
@@ -107,12 +108,12 @@ vxworks_emutls_var_init (tree var, tree decl, tree tmpl_addr)
elt->value = fold_convert (TREE_TYPE (field), tmpl_addr);
elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
elt->index = field;
elt->value = build_int_cst (TREE_TYPE (field), 0);
elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
elt->index = field;
elt->value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 5d891cde044..610a2723cd2 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "reload.h"
#include "tm_p.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "optabs.h"
#include "libfuncs.h"
@@ -2684,8 +2685,8 @@ xtensa_build_builtin_va_list (void)
TREE_CHAIN (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_stk;
- TREE_CHAIN (f_stk) = f_reg;
- TREE_CHAIN (f_reg) = f_ndx;
+ DECL_CHAIN (f_stk) = f_reg;
+ DECL_CHAIN (f_reg) = f_ndx;
layout_type (record);
return record;
@@ -2739,8 +2740,8 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
arg_words = crtl->args.info.arg_words;
f_stk = TYPE_FIELDS (va_list_type_node);
- f_reg = TREE_CHAIN (f_stk);
- f_ndx = TREE_CHAIN (f_reg);
+ f_reg = DECL_CHAIN (f_stk);
+ f_ndx = DECL_CHAIN (f_reg);
stk = build3 (COMPONENT_REF, TREE_TYPE (f_stk), valist, f_stk, NULL_TREE);
reg = build3 (COMPONENT_REF, TREE_TYPE (f_reg), unshare_expr (valist),
@@ -2809,8 +2810,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
}
f_stk = TYPE_FIELDS (va_list_type_node);
- f_reg = TREE_CHAIN (f_stk);
- f_ndx = TREE_CHAIN (f_reg);
+ f_reg = DECL_CHAIN (f_stk);
+ f_ndx = DECL_CHAIN (f_reg);
stk = build3 (COMPONENT_REF, TREE_TYPE (f_stk), valist,
f_stk, NULL_TREE);
diff --git a/gcc/configure b/gcc/configure
index d1dcf891b8d..aa61cd6589c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -646,6 +646,8 @@ extra_passes
extra_parts
extra_objs
extra_headers_list
+user_headers_inc_next_post
+user_headers_inc_next_pre
extra_gcc_objs
TM_MULTILIB_EXCEPTIONS_CONFIG
TM_MULTILIB_CONFIG
@@ -17107,7 +17109,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17110 "configure"
+#line 17112 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17213,7 +17215,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17216 "configure"
+#line 17218 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -22108,17 +22110,9 @@ foo: .long 25
;;
i[34567]86-*-*)
case "$target" in
- i[34567]86-*-solaris2.[89]*)
- # TLS was introduced in the Solaris 9 4/04 release but
- # we do not enable it by default on Solaris 9 either.
- if test "x$enable_tls" = xyes ; then
- on_solaris=yes
- else
- enable_tls=no;
- fi
- ;;
i[34567]86-*-solaris2.*)
on_solaris=yes
+ tga_func=___tls_get_addr
;;
*)
on_solaris=no
@@ -22333,17 +22327,9 @@ foo: .long 25
;;
sparc*-*-*)
case "$target" in
- sparc*-sun-solaris2.[89]*)
- # TLS was introduced in the Solaris 9 4/04 release but
- # we do not enable it by default on Solaris 9 either.
- if test "x$enable_tls" = xyes ; then
- on_solaris=yes
- else
- enable_tls=no;
- fi
- ;;
sparc*-sun-solaris2.*)
on_solaris=yes
+ tga_func=__tls_get_addr
;;
*)
on_solaris=no
@@ -22351,32 +22337,17 @@ foo: .long 25
esac
if test x$on_solaris = xyes && test x$gas_flag = xno; then
conftest_s='
- .section ".tdata",#alloc,#write,#tls
-foo: .long 25
- .text
- sethi %tgd_hi22(foo), %o0
- add %o0, %tgd_lo10(foo), %o1
- add %l7, %o1, %o0, %tgd_add(foo)
- call __tls_get_addr, %tgd_call(foo)
- sethi %tldm_hi22(foo), %l1
- add %l1, %tldm_lo10(foo), %l2
- add %l7, %l2, %o0, %tldm_add(foo)
- call __tls_get_addr, %tldm_call(foo)
- sethi %tldo_hix22(foo), %l3
- xor %l3, %tldo_lox10(foo), %l4
- add %o0, %l4, %l5, %tldo_add(foo)
- sethi %tie_hi22(foo), %o3
- add %o3, %tie_lo10(foo), %o3
- ld [%l7 + %o3], %o2, %tie_ld(foo)
- add %g7, %o2, %o4, %tie_add(foo)
- sethi %tle_hix22(foo), %l1
- xor %l1, %tle_lox10(foo), %o5
- ld [%g7 + %o5], %o1'
+ .section ".tdata",#alloc,#write,#tls'
tls_first_major=0
tls_first_minor=0
else
conftest_s='
- .section ".tdata","awT",@progbits
+ .section ".tdata","awT",@progbits'
+ tls_first_major=2
+ tls_first_minor=14
+ tls_as_opt="-32 --fatal-warnings"
+ fi
+ conftest_s="$conftest_s
foo: .long 25
.text
sethi %tgd_hi22(foo), %o0
@@ -22396,11 +22367,7 @@ foo: .long 25
add %g7, %o2, %o4, %tie_add(foo)
sethi %tle_hix22(foo), %l1
xor %l1, %tle_lox10(foo), %o5
- ld [%g7 + %o5], %o1'
- tls_first_major=2
- tls_first_minor=14
- tls_as_opt="-32 --fatal-warnings"
- fi
+ ld [%g7 + %o5], %o1"
;;
xtensa*-*-*)
conftest_s='
@@ -22455,6 +22422,163 @@ if test $gcc_cv_as_tls = yes; then
set_have_as_tls=yes
fi
fi
+case "$target" in
+ # TLS was introduced in the Solaris 9 FCS release and backported to
+ # Solaris 8 patches. Support for GNU-style TLS on x86 was only
+ # introduced in Solaris 9 4/04, replacing the earlier Sun style that Sun
+ # ld and GCC don't support any longer.
+ *-*-solaris2.*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker and ld.so.1 TLS support" >&5
+$as_echo_n "checking linker and ld.so.1 TLS support... " >&6; }
+ ld_tls_support=no
+ # Check ld and ld.so.1 TLS support.
+ if echo "$ld_ver" | grep GNU > /dev/null; then
+ # Assume all interesting versions of GNU ld have TLS support.
+ # FIXME: still need ld.so.1 support, i.e. ld version checks below.
+ ld_tls_support=yes
+ else
+ case "$target" in
+ # Solaris 8/x86 ld has GNU style TLS support since version 1.280.
+ i?86-*-solaris2.8)
+ min_tls_ld_vers_minor=280
+ ;;
+ # Solaris 8/SPARC ld has TLS support since version 1.272.
+ sparc*-*-solaris2.8)
+ min_tls_ld_vers_minor=272
+ ;;
+ # Solaris 9/x86 ld has GNU style TLS support since version 1.374.
+ i?86-*-solaris2.9)
+ min_tls_ld_vers_minor=374
+ ;;
+ # Solaris 9/SPARC and Solaris 10+ ld have TLS support since FCS.
+ sparc*-*-solaris2.9 | *-*-solaris2.1[0-9]*)
+ min_tls_ld_vers_minor=343
+ ;;
+ esac
+ if test "$ls_vers_major" -gt 1 || \
+ test "$ld_vers_minor" -ge "$min_tls_ld_vers_minor"; then
+ ld_tls_support=yes
+ else
+ set_have_as_tls=no
+ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_tls_support" >&5
+$as_echo "$ld_tls_support" >&6; }
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ LIBS=
+ LDFLAGS=
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking alternate thread library" >&5
+$as_echo_n "checking alternate thread library... " >&6; }
+ case "$target" in
+ # TLS support was backported to Solaris 8 patches, but only lives in
+ # the alternate thread library which became the default in Solaris 9.
+ # We want to always use that, irrespective of TLS support.
+ *-*-solaris2.8)
+ # Take multilib subdir into account. There's no spec to handle
+ # this. The 64 symlink exists since Solaris 8.
+ lwp_dir=/usr/lib/lwp
+ lwp_spec="-L$lwp_dir%{m64:/64} -R$lwp_dir%{m64:/64}"
+ LDFLAGS="-L$lwp_dir -R$lwp_dir"
+ ;;
+ *-*-solaris2*)
+ lwp_dir="none"
+ lwp_spec=""
+ ;;
+ esac
+ # Always define LIB_THREAD_LDFLAGS_SPEC, even without TLS support.
+
+cat >>confdefs.h <<_ACEOF
+#define LIB_THREAD_LDFLAGS_SPEC "$lwp_spec"
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lwp_dir" >&5
+$as_echo "$lwp_dir" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking library containing $tga_func" >&5
+$as_echo_n "checking library containing $tga_func... " >&6; }
+ # Before Solaris 10, __tls_get_addr (SPARC/x64) resp. ___tls_get_addr
+ # (32-bit x86) only lived in libthread, so check for that. Keep
+ # set_have_as_tls if found, disable if not.
+ as_ac_Search=`$as_echo "ac_cv_search_$tga_func" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing $tga_func" >&5
+$as_echo_n "checking for library containing $tga_func... " >&6; }
+if { as_var=$as_ac_Search; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+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 $tga_func ();
+int
+main ()
+{
+return $tga_func ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' thread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Search=\$ac_res"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if { as_var=$as_ac_Search; eval "test \"\${$as_var+set}\" = set"; }; then :
+ break
+fi
+done
+if { as_var=$as_ac_Search; eval "test \"\${$as_var+set}\" = set"; }; then :
+
+else
+ eval "$as_ac_Search=no"
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+eval ac_res=\$$as_ac_Search
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+eval ac_res=\$$as_ac_Search
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ set_have_as_tls=no
+fi
+
+ # Clear LIBS if we cannot support TLS.
+ if test $set_have_as_tls = no; then
+ LIBS=
+ fi
+ # Always define LIB_TLS_SPEC, even without TLS support.
+
+cat >>confdefs.h <<_ACEOF
+#define LIB_TLS_SPEC "$LIBS"
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBS" >&5
+$as_echo "$LIBS" >&6; }
+
+ LIBS="$save_LIBS"
+ LDFLAGS="$save_LDFLAGS"
+ ;;
+esac
if test $set_have_as_tls = yes ; then
$as_echo "#define HAVE_AS_TLS 1" >>confdefs.h
@@ -23337,6 +23461,7 @@ else
gcc_cv_as_ix86_rep_lock_prefix=no
if test x$gcc_cv_as != x; then
echo 'rep movsl
+ lock addl %edi, (%eax,%esi)
lock orl $0, (%esp)' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -23355,12 +23480,11 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_rep_lock_prefix" >&5
$as_echo "$gcc_cv_as_ix86_rep_lock_prefix" >&6; }
+if test $gcc_cv_as_ix86_rep_lock_prefix = yes; then
+$as_echo "#define HAVE_AS_IX86_REP_LOCK_PREFIX 1" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define HAVE_AS_IX86_REP_LOCK_PREFIX `if test $gcc_cv_as_ix86_rep_lock_prefix = yes; then echo 1; else echo 0; fi`
-_ACEOF
-
+fi
;;
@@ -25451,6 +25575,8 @@ fi
+
+
# Echo link setup.
if test x${build} = x${host} ; then
if test x${host} = x${target} ; then
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 9b3a75d95eb..24d38aa73c3 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2687,17 +2687,9 @@ foo: .long 25
;;
i[34567]86-*-*)
case "$target" in
- i[34567]86-*-solaris2.[89]*)
- # TLS was introduced in the Solaris 9 4/04 release but
- # we do not enable it by default on Solaris 9 either.
- if test "x$enable_tls" = xyes ; then
- on_solaris=yes
- else
- enable_tls=no;
- fi
- ;;
i[34567]86-*-solaris2.*)
on_solaris=yes
+ tga_func=___tls_get_addr
;;
*)
on_solaris=no
@@ -2913,17 +2905,9 @@ foo: .long 25
;;
sparc*-*-*)
case "$target" in
- sparc*-sun-solaris2.[89]*)
- # TLS was introduced in the Solaris 9 4/04 release but
- # we do not enable it by default on Solaris 9 either.
- if test "x$enable_tls" = xyes ; then
- on_solaris=yes
- else
- enable_tls=no;
- fi
- ;;
sparc*-sun-solaris2.*)
on_solaris=yes
+ tga_func=__tls_get_addr
;;
*)
on_solaris=no
@@ -2931,32 +2915,17 @@ foo: .long 25
esac
if test x$on_solaris = xyes && test x$gas_flag = xno; then
conftest_s='
- .section ".tdata",#alloc,#write,#tls
-foo: .long 25
- .text
- sethi %tgd_hi22(foo), %o0
- add %o0, %tgd_lo10(foo), %o1
- add %l7, %o1, %o0, %tgd_add(foo)
- call __tls_get_addr, %tgd_call(foo)
- sethi %tldm_hi22(foo), %l1
- add %l1, %tldm_lo10(foo), %l2
- add %l7, %l2, %o0, %tldm_add(foo)
- call __tls_get_addr, %tldm_call(foo)
- sethi %tldo_hix22(foo), %l3
- xor %l3, %tldo_lox10(foo), %l4
- add %o0, %l4, %l5, %tldo_add(foo)
- sethi %tie_hi22(foo), %o3
- add %o3, %tie_lo10(foo), %o3
- ld [%l7 + %o3], %o2, %tie_ld(foo)
- add %g7, %o2, %o4, %tie_add(foo)
- sethi %tle_hix22(foo), %l1
- xor %l1, %tle_lox10(foo), %o5
- ld [%g7 + %o5], %o1'
+ .section ".tdata",#alloc,#write,#tls'
tls_first_major=0
tls_first_minor=0
else
conftest_s='
- .section ".tdata","awT",@progbits
+ .section ".tdata","awT",@progbits'
+ tls_first_major=2
+ tls_first_minor=14
+ tls_as_opt="-32 --fatal-warnings"
+ fi
+ conftest_s="$conftest_s
foo: .long 25
.text
sethi %tgd_hi22(foo), %o0
@@ -2976,11 +2945,7 @@ foo: .long 25
add %g7, %o2, %o4, %tie_add(foo)
sethi %tle_hix22(foo), %l1
xor %l1, %tle_lox10(foo), %o5
- ld [%g7 + %o5], %o1'
- tls_first_major=2
- tls_first_minor=14
- tls_as_opt="-32 --fatal-warnings"
- fi
+ ld [%g7 + %o5], %o1"
;;
xtensa*-*-*)
conftest_s='
@@ -3007,9 +2972,95 @@ else
[$tls_first_major,$tls_first_minor,0], [$tls_as_opt], [$conftest_s],,
[set_have_as_tls=yes])
fi
+case "$target" in
+ # TLS was introduced in the Solaris 9 FCS release and backported to
+ # Solaris 8 patches. Support for GNU-style TLS on x86 was only
+ # introduced in Solaris 9 4/04, replacing the earlier Sun style that Sun
+ # ld and GCC don't support any longer.
+ *-*-solaris2.*)
+ AC_MSG_CHECKING(linker and ld.so.1 TLS support)
+ ld_tls_support=no
+ # Check ld and ld.so.1 TLS support.
+ if echo "$ld_ver" | grep GNU > /dev/null; then
+ # Assume all interesting versions of GNU ld have TLS support.
+ # FIXME: still need ld.so.1 support, i.e. ld version checks below.
+ ld_tls_support=yes
+ else
+ case "$target" in
+ # Solaris 8/x86 ld has GNU style TLS support since version 1.280.
+ i?86-*-solaris2.8)
+ min_tls_ld_vers_minor=280
+ ;;
+ # Solaris 8/SPARC ld has TLS support since version 1.272.
+ sparc*-*-solaris2.8)
+ min_tls_ld_vers_minor=272
+ ;;
+ # Solaris 9/x86 ld has GNU style TLS support since version 1.374.
+ i?86-*-solaris2.9)
+ min_tls_ld_vers_minor=374
+ ;;
+ # Solaris 9/SPARC and Solaris 10+ ld have TLS support since FCS.
+ sparc*-*-solaris2.9 | *-*-solaris2.1[[0-9]]*)
+ min_tls_ld_vers_minor=343
+ ;;
+ esac
+ if test "$ls_vers_major" -gt 1 || \
+ test "$ld_vers_minor" -ge "$min_tls_ld_vers_minor"; then
+ ld_tls_support=yes
+ else
+ set_have_as_tls=no
+ fi
+ fi
+ AC_MSG_RESULT($ld_tls_support)
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ LIBS=
+ LDFLAGS=
+
+ AC_MSG_CHECKING(alternate thread library)
+ case "$target" in
+ # TLS support was backported to Solaris 8 patches, but only lives in
+ # the alternate thread library which became the default in Solaris 9.
+ # We want to always use that, irrespective of TLS support.
+ *-*-solaris2.8)
+ # Take multilib subdir into account. There's no spec to handle
+ # this. The 64 symlink exists since Solaris 8.
+ lwp_dir=/usr/lib/lwp
+ lwp_spec="-L$lwp_dir%{m64:/64} -R$lwp_dir%{m64:/64}"
+ LDFLAGS="-L$lwp_dir -R$lwp_dir"
+ ;;
+ *-*-solaris2*)
+ lwp_dir="none"
+ lwp_spec=""
+ ;;
+ esac
+ # Always define LIB_THREAD_LDFLAGS_SPEC, even without TLS support.
+ AC_DEFINE_UNQUOTED(LIB_THREAD_LDFLAGS_SPEC, "$lwp_spec",
+ [Define to the linker flags to use for -pthread.])
+ AC_MSG_RESULT($lwp_dir)
+
+ AC_MSG_CHECKING(library containing $tga_func)
+ # Before Solaris 10, __tls_get_addr (SPARC/x64) resp. ___tls_get_addr
+ # (32-bit x86) only lived in libthread, so check for that. Keep
+ # set_have_as_tls if found, disable if not.
+ AC_SEARCH_LIBS([$tga_func], [thread],, [set_have_as_tls=no])
+ # Clear LIBS if we cannot support TLS.
+ if test $set_have_as_tls = no; then
+ LIBS=
+ fi
+ # Always define LIB_TLS_SPEC, even without TLS support.
+ AC_DEFINE_UNQUOTED(LIB_TLS_SPEC, "$LIBS",
+ [Define to the library containing __tls_get_addr/___tls_get_addr.])
+ AC_MSG_RESULT($LIBS)
+
+ LIBS="$save_LIBS"
+ LDFLAGS="$save_LDFLAGS"
+ ;;
+esac
if test $set_have_as_tls = yes ; then
AC_DEFINE(HAVE_AS_TLS, 1,
- [Define if your assembler supports thread-local storage.])
+ [Define if your assembler and linker support thread-local storage.])
fi
# Target-specific assembler checks.
@@ -3327,10 +3378,10 @@ foo: nop
gcc_GAS_CHECK_FEATURE([rep and lock prefix],
gcc_cv_as_ix86_rep_lock_prefix,,,
[rep movsl
- lock orl $0, (%esp)])
- AC_DEFINE_UNQUOTED(HAVE_AS_IX86_REP_LOCK_PREFIX,
- [`if test $gcc_cv_as_ix86_rep_lock_prefix = yes; then echo 1; else echo 0; fi`],
- [Define true if the assembler supports 'rep <insn>, lock <insn>'.])
+ lock addl %edi, (%eax,%esi)
+ lock orl $0, (%esp)],,
+ [AC_DEFINE(HAVE_AS_IX86_REP_LOCK_PREFIX, 1,
+ [Define if the assembler supports 'rep <insn>, lock <insn>'.])])
;;
@@ -4499,6 +4550,8 @@ AC_SUBST(TM_ENDIAN_CONFIG)
AC_SUBST(TM_MULTILIB_CONFIG)
AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG)
AC_SUBST(extra_gcc_objs)
+AC_SUBST(user_headers_inc_next_pre)
+AC_SUBST(user_headers_inc_next_post)
AC_SUBST(extra_headers_list)
AC_SUBST(extra_objs)
AC_SUBST(extra_parts)
diff --git a/gcc/convert.c b/gcc/convert.c
index f54b6d9adfe..48f3f944c71 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "flags.h"
#include "convert.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "langhooks.h"
@@ -768,13 +769,19 @@ convert_to_integer (tree type, tree expr)
|| ex_form == LSHIFT_EXPR
/* If we have !flag_wrapv, and either ARG0 or
ARG1 is of a signed type, we have to do
- PLUS_EXPR or MINUS_EXPR in an unsigned
- type. Otherwise, we would introduce
+ PLUS_EXPR, MINUS_EXPR or MULT_EXPR in an unsigned
+ type in case the operation in outprec precision
+ could overflow. Otherwise, we would introduce
signed-overflow undefinedness. */
|| ((!TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg0))
|| !TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg1)))
+ && ((TYPE_PRECISION (TREE_TYPE (arg0)) * 2u
+ > outprec)
+ || (TYPE_PRECISION (TREE_TYPE (arg1)) * 2u
+ > outprec))
&& (ex_form == PLUS_EXPR
- || ex_form == MINUS_EXPR)))
+ || ex_form == MINUS_EXPR
+ || ex_form == MULT_EXPR)))
typex = unsigned_type_for (typex);
else
typex = signed_type_for (typex);
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 9b8a6900e6b..20aaa1074ce 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -648,7 +648,7 @@ build_fn_info_type (unsigned int counters)
/* checksum */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
array_type = build_int_cst (NULL_TREE, counters - 1);
@@ -658,7 +658,7 @@ build_fn_info_type (unsigned int counters)
/* counters */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, array_type);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
finish_builtin_struct (type, "__gcov_fn_info", fields, NULL_TREE);
@@ -682,13 +682,13 @@ build_fn_info_value (const struct function_list *function, tree type)
CONSTRUCTOR_APPEND_ELT (v1, fields,
build_int_cstu (get_gcov_unsigned_t (),
function->ident));
- fields = TREE_CHAIN (fields);
+ fields = DECL_CHAIN (fields);
/* checksum */
CONSTRUCTOR_APPEND_ELT (v1, fields,
build_int_cstu (get_gcov_unsigned_t (),
function->checksum));
- fields = TREE_CHAIN (fields);
+ fields = DECL_CHAIN (fields);
/* counters */
for (ix = 0; ix != GCOV_COUNTERS; ix++)
@@ -716,13 +716,13 @@ build_ctr_info_type (void)
/* counters */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
/* values */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, gcov_ptr_type);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
/* merge */
@@ -733,7 +733,7 @@ build_ctr_info_type (void)
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE,
build_pointer_type (gcov_merge_fn_type));
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
finish_builtin_struct (type, "__gcov_ctr_info", fields, NULL_TREE);
@@ -756,7 +756,7 @@ build_ctr_info_value (unsigned int counter, tree type)
CONSTRUCTOR_APPEND_ELT (v, fields,
build_int_cstu (get_gcov_unsigned_t (),
prg_n_ctrs[counter]));
- fields = TREE_CHAIN (fields);
+ fields = DECL_CHAIN (fields);
if (prg_n_ctrs[counter])
{
@@ -779,7 +779,7 @@ build_ctr_info_value (unsigned int counter, tree type)
}
else
CONSTRUCTOR_APPEND_ELT (v, fields, null_pointer_node);
- fields = TREE_CHAIN (fields);
+ fields = DECL_CHAIN (fields);
fn = build_decl (BUILTINS_LOCATION,
FUNCTION_DECL,
@@ -826,7 +826,7 @@ build_gcov_info (void)
/* Version ident */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field,
build_int_cstu (TREE_TYPE (field), GCOV_VERSION));
@@ -834,14 +834,14 @@ build_gcov_info (void)
/* next -- NULL */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, build_pointer_type (const_type));
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field, null_pointer_node);
/* stamp */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field,
build_int_cstu (TREE_TYPE (field), local_tick));
@@ -851,7 +851,7 @@ build_gcov_info (void)
TYPE_QUAL_CONST));
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, string_type);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
da_file_name_len = strlen (da_file_name);
filename_string = build_string (da_file_name_len + 1, da_file_name);
@@ -885,7 +885,7 @@ build_gcov_info (void)
/* number of functions */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field,
build_int_cstu (get_gcov_unsigned_t (), n_fns));
@@ -893,14 +893,14 @@ build_gcov_info (void)
/* fn_info table */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, fn_info_ptr_type);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field, fn_info_value);
/* counter_mask */
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ());
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field,
build_int_cstu (get_gcov_unsigned_t (),
@@ -920,7 +920,7 @@ build_gcov_info (void)
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, ctr_info_ary_type);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
CONSTRUCTOR_APPEND_ELT (v1, field, ctr_info_value);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f72e7a6b97f..b7b08bbb526 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,261 @@
+2010-07-21 Jason Merrill <jason@redhat.com>
+
+ * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
+
+ * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
+ to cp_finish_decl.
+
+2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
+
+ PR c++/44641
+ * pt.c (instantiate_class_template): Propagate the template's
+ location to its instance.
+
+2010-07-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/44967
+ * pt.c (tsubst_copy_and_build): Rework last change.
+
+ PR c++/44967
+ * pt.c (tsubst_copy_and_build): Handle partial substitution of
+ CALL_EXPR.
+
+2010-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/44996
+ * semantics.c (finish_decltype_type): Correct decltype
+ of parenthesized rvalue reference variable.
+
+ PR c++/44969
+ * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
+ * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
+
+2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44969
+ * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
+ parameter.
+ * cp-tree.h: Adjust declaration.
+ * init.c (perform_member_init): Adjust caller.
+ * decl.c (grok_reference_init, cp_finish_decl): Likewise.
+ * typeck2.c (store_init_value): Likewise.
+ (build_functional_cast): Pass complain argument to
+ build_x_compound_expr_from_list.
+
+2010-07-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/32505
+ * pt.c (process_partial_specialization): Diagnose partial
+ specialization after instantiation.
+ (most_specialized_class): Add complain parm.
+
+ * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * init.c (build_new_1): Use cp_build_function_call_nary instead of
+ cp_build_function_call.
+
+2010-07-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/44909
+ * call.c (add_function_candidate): If we're working on an implicit
+ declaration, don't consider candidates that won't match.
+ * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
+ * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
+
+ Revert:
+ * cp-tree.h (struct lang_type_class): Add has_user_opeq.
+ (TYPE_HAS_USER_OPEQ): New.
+ * decl.c (grok_special_member_properties): Set it.
+ * class.c (add_implicitly_declared_members): Don't lazily declare
+ constructors/operator= if a base or member has a user-declared one.
+ (check_bases_and_members, check_bases): Adjust.
+ (check_field_decls, check_field_decl): Adjust.
+
+2010-07-15 Anatoly Sokolov <aesok@post.ru>
+
+ * decl.c (integer_three_node): Remove.
+ (cxx_init_decl_processing): Do not initialize the integer_three_node.
+ * cp-tree.h (integer_three_node): Remove.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
+ * call.c: Likewise.
+ * class.c: Likewise.
+ * cp-gimplify.c: Likewise.
+ * decl.c: Likewise.
+ * decl2.c: Likewise.
+ * init.c: Likewise.
+ * mangle.c: Likewise.
+ * name-lookup.c: Likewise.
+ * optimize.c: Likewise.
+ * parser.c: Likewise.
+ * pt.c: Likewise.
+ * rtti.c: Likewise.
+ * search.c: Likewise.
+ * semantics.c: Likewise.
+ * typeck.c: Likewise.
+ * typeck2.c: Likewise.
+
+2010-07-14 Jason Merrill <jason@redhat.com>
+
+ * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
+ (build_field_list): Cache field type.
+
+ Implement C++0x unrestricted unions (N2544)
+ * class.c (check_field_decl): Loosen union handling in C++0x.
+ * method.c (walk_field_subobs): Split out from...
+ (synthesized_method_walk): ...here. Set msg before loops.
+ (process_subob_fn): Check for triviality in union members.
+ * init.c (sort_mem_initializers): Splice out uninitialized
+ anonymous unions and union members.
+ (push_base_cleanups): Don't automatically destroy anonymous unions
+ and union members.
+
+2010-07-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/44909
+ * cp-tree.h (struct lang_type_class): Add has_user_opeq.
+ (TYPE_HAS_USER_OPEQ): New.
+ * decl.c (grok_special_member_properties): Set it.
+ * class.c (add_implicitly_declared_members): Don't lazily declare
+ constructors/operator= if a base or member has a user-declared one.
+ (check_bases_and_members, check_bases): Adjust.
+ (check_field_decls, check_field_decl): Adjust.
+ * method.c (synthesized_method_walk): Initialize check_vdtor.
+
+ PR c++/44540
+ * mangle.c (write_type): Canonicalize.
+ (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
+ (write_CV_qualifiers_for_type): Ignore them in abi>=5.
+
+2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44908
+ * call.c (convert_like_real): Adjust convert_ptrmem call, pass
+ complain argument.
+ * typeck.c (get_delta_difference): Update prototype, add a
+ tsubst_flags_t parameter; update get_delta_difference_1 calls and
+ add checks for error_mark_node.
+ (get_delta_difference_1): Update prototype, add a tsubst_flags_t
+ parameter; update lookup_base call.
+ (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
+ parameter; update get_delta_difference call and add check for
+ error_mark_node.
+ (convert_ptrmem): Update prototype, add a tsubst_flags_t
+ parameter; update get_delta_difference call and add check for
+ error_mark_node; update build_ptrmemfunc call.
+ (build_static_cast_1): Adjust convert_ptrmem call.
+ (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
+ (cp_build_unary_op): Adjust build_ptrmemfunc call.
+ * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
+ and build_ptrmemfunc calls.
+ * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
+
+2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44907
+ * call.c (build_temp): Add tsubst_flags_t complain parameter;
+ adjust build_special_member_call call, pass complain.
+ (convert_like_real): Adjust build_temp call, pass complain.
+
+2010-07-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/43120
+ * cp-tree.h (BV_LOST_PRIMARY): New macro.
+ * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
+ Set BV_LOST_PRIMARY.
+ (build_vtbl_initializer): Check BV_LOST_PRIMARY.
+
+2010-07-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/43120
+ * class.c (update_vtable_entry_for_fn): Fix handling of dummy
+ virtual bases for covariant thunks.
+
+2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * cp-tree.h: Do not include toplev.h.
+
+2010-07-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/44703
+ * call.c (is_std_init_list): Look through typedefs.
+
+ PR c++/44778
+ * init.c (build_offset_ref): If scope isn't dependent,
+ don't exit early. Look at TYPE_MAIN_VARIANT.
+ * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
+
+ * error.c (dump_function_decl): Don't crash on null DECL_NAME.
+
+2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * cp-tree.h (impl_conv_void): New type.
+ (convert_to_void): Adjust prototype.
+ * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
+ diagnostic for easy translation. Change caller.
+ * typeck.c: Update call to convert_to_void.
+ * semantics.c: Likewise.
+ * init.c: Likewise.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * decl.c (cp_finish_decl): Call add_local_decl.
+ * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
+
+2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
+ throughout.
+
+2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR c++/22138
+ * parser.c (cp_parser_primary_expression): Error if local template is
+ declared.
+
+2010-07-02 Le-Chun Wu <lcwu@google.com>
+
+ PR/44128
+ * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
+ (variable or type) shadows another type.
+
+2010-07-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44780
+ * typeck.c (convert_for_assignment): When converting a convertible
+ vector type or objc++ types, call mark_rvalue_use.
+ * typeck2.c (build_m_component_ref): Use return values from
+ mark_rvalue_use or mark_lvalue_use.
+ * class.c (build_base_path): Likewise.
+ * call.c (build_conditional_expr): Likewise.
+
+2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44039
+ * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
+ returns NULL_TREE.
+
+2010-07-01 Richard Guenther <rguenther@suse.de>
+
+ * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
+ predicate we are looking for, allow non-gimplified
+ INDIRECT_REFs.
+
+2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44628
+ * typeck.c (cp_build_unary_op): Early return error_mark_node when
+ arg is NULL_TREE too.
+ * call.c (convert_class_to_reference): Return error_mark_node when
+ expr is NULL_TREE.
+
2010-06-30 Michael Matz <matz@suse.de>
- * repo.c ((finish_repo): Fix typo.
+ * repo.c (finish_repo): Fix typo.
2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
@@ -17,7 +272,7 @@
* tree.c: Include gimple.h. Do not include tree-flow.h
* decl.c: Do not include tree-flow.h
* Make-lang.in: Adjust dependencies.
-
+
2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (incomplete_var): Declare. Declare VECs containing them.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index cca35c5e1fb..e7d87a0e3c6 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -204,7 +204,7 @@ static void add_candidates (tree, tree, const VEC(tree,gc) *, tree, tree, bool,
tree, tree, int, struct z_candidate **);
static conversion *merge_conversion_sequences (conversion *, conversion *);
static bool magic_varargs_p (tree);
-static tree build_temp (tree, tree, int, diagnostic_t *);
+static tree build_temp (tree, tree, int, diagnostic_t *, tsubst_flags_t);
/* Returns nonzero iff the destructor name specified in NAME matches BASETYPE.
NAME can take many forms... */
@@ -641,7 +641,7 @@ build_aggr_conv (tree type, tree ctor, int flags)
tree field = next_initializable_field (TYPE_FIELDS (type));
tree empty_ctor = NULL_TREE;
- for (; field; field = next_initializable_field (TREE_CHAIN (field)))
+ for (; field; field = next_initializable_field (DECL_CHAIN (field)))
{
if (i < CONSTRUCTOR_NELTS (ctor))
{
@@ -1045,6 +1045,9 @@ convert_class_to_reference (tree reference_type, tree s, tree expr, int flags)
struct z_candidate *cand;
bool any_viable_p;
+ if (!expr)
+ return NULL;
+
conversions = lookup_conversions (s, /*lookup_template_convs_p=*/true);
if (!conversions)
return NULL;
@@ -1598,6 +1601,27 @@ add_function_candidate (struct z_candidate **candidates,
else if (!sufficient_parms_p (parmnode))
viable = 0;
+ /* Kludge: When looking for a function from a subobject while generating
+ an implicit copy/move constructor/operator=, don't consider anything
+ that takes (a reference to) a different type. See c++/44909. */
+ else if (flags & LOOKUP_SPECULATIVE)
+ {
+ if (DECL_CONSTRUCTOR_P (fn))
+ i = 1;
+ else if (DECL_ASSIGNMENT_OPERATOR_P (fn)
+ && DECL_OVERLOADED_OPERATOR_P (fn) == NOP_EXPR)
+ i = 2;
+ else
+ i = 0;
+ if (i && len == i)
+ {
+ parmnode = chain_index (i-1, parmlist);
+ if (!(same_type_ignoring_top_level_qualifiers_p
+ (non_reference (TREE_VALUE (parmnode)), ctype)))
+ viable = 0;
+ }
+ }
+
if (! viable)
goto out;
@@ -3863,8 +3887,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
&& same_type_p (arg2_type, arg3_type))
{
result_type = arg2_type;
- mark_lvalue_use (arg2);
- mark_lvalue_use (arg3);
+ arg2 = mark_lvalue_use (arg2);
+ arg3 = mark_lvalue_use (arg3);
goto valid_operands;
}
@@ -4853,7 +4877,7 @@ enforce_access (tree basetype_path, tree decl, tree diag_decl)
static tree
build_temp (tree expr, tree type, int flags,
- diagnostic_t *diagnostic_kind)
+ diagnostic_t *diagnostic_kind, tsubst_flags_t complain)
{
int savew, savee;
VEC(tree,gc) *args;
@@ -4861,7 +4885,7 @@ build_temp (tree expr, tree type, int flags,
savew = warningcount, savee = errorcount;
args = make_tree_vector_single (expr);
expr = build_special_member_call (NULL_TREE, complete_ctor_identifier,
- &args, type, flags, tf_warning_or_error);
+ &args, type, flags, complain);
release_tree_vector (args);
if (warningcount > savew)
*diagnostic_kind = DK_WARNING;
@@ -5134,7 +5158,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
conversion (i.e. the second step of copy-initialization), so
don't allow any more. */
flags |= LOOKUP_NO_CONVERSION;
- expr = build_temp (expr, totype, flags, &diag_kind);
+ expr = build_temp (expr, totype, flags, &diag_kind, complain);
if (diag_kind && fn)
{
if ((complain & tf_error))
@@ -5248,7 +5272,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
case ck_pmem:
return convert_ptrmem (totype, expr, /*allow_inverse_p=*/false,
- c_cast_p);
+ c_cast_p, complain);
default:
break;
@@ -6097,7 +6121,7 @@ build_java_interface_fn_ref (tree fn, tree instance)
/* Determine the itable index of FN. */
i = 1;
- for (method = TYPE_METHODS (iface); method; method = TREE_CHAIN (method))
+ for (method = TYPE_METHODS (iface); method; method = DECL_CHAIN (method))
{
if (!DECL_VIRTUAL_P (method))
continue;
@@ -6229,7 +6253,7 @@ build_special_member_call (tree instance, tree name, VEC(tree,gc) **args,
/* If the current function is a complete object constructor
or destructor, then we fetch the VTT directly.
Otherwise, we look it up using the VTT we were given. */
- vtt = TREE_CHAIN (CLASSTYPE_VTABLES (current_class_type));
+ vtt = DECL_CHAIN (CLASSTYPE_VTABLES (current_class_type));
vtt = decay_conversion (vtt);
vtt = build3 (COND_EXPR, TREE_TYPE (vtt),
build2 (EQ_EXPR, boolean_type_node,
@@ -7955,6 +7979,10 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
bool
is_std_init_list (tree type)
{
+ /* Look through typedefs. */
+ if (!TYPE_P (type))
+ return false;
+ type = TYPE_MAIN_VARIANT (type);
return (CLASS_TYPE_P (type)
&& CP_TYPE_CONTEXT (type) == std_node
&& strcmp (TYPE_NAME_STRING (type), "initializer_list") == 0);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 3f87303be93..6597111955e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -284,7 +284,7 @@ build_base_path (enum tree_code code,
/* This must happen before the call to save_expr. */
expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error);
else
- mark_rvalue_use (expr);
+ expr = mark_rvalue_use (expr);
offset = BINFO_OFFSET (binfo);
fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
@@ -469,7 +469,7 @@ build_simple_base_path (tree expr, tree binfo)
expr = build_simple_base_path (expr, d_binfo);
for (field = TYPE_FIELDS (BINFO_TYPE (d_binfo));
- field; field = TREE_CHAIN (field))
+ field; field = DECL_CHAIN (field))
/* Is this the base field created by build_base_field? */
if (TREE_CODE (field) == FIELD_DECL
&& DECL_FIELD_IS_BASE (field)
@@ -1260,7 +1260,7 @@ check_bases (tree t,
seen_non_virtual_nearly_empty_base_p = 0;
if (!CLASSTYPE_NON_STD_LAYOUT (t))
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
break;
@@ -1345,7 +1345,7 @@ check_bases (tree t,
members, or has no base classes with non-static data
members */
for (basefield = TYPE_FIELDS (basetype); basefield;
- basefield = TREE_CHAIN (basefield))
+ basefield = DECL_CHAIN (basefield))
if (TREE_CODE (basefield) == FIELD_DECL)
{
if (field)
@@ -1603,7 +1603,7 @@ maybe_warn_about_overly_private_class (tree t)
functions are private. (Since there are no friends or
non-private statics, we can't ever call any of the private member
functions.) */
- for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
+ for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn))
/* We're not interested in compiler-generated methods; they don't
provide any way to call private members. */
if (!DECL_ARTIFICIAL (fn))
@@ -1808,7 +1808,7 @@ finish_struct_methods (tree t)
/* Clear DECL_IN_AGGR_P for all functions. */
for (fn_fields = TYPE_METHODS (t); fn_fields;
- fn_fields = TREE_CHAIN (fn_fields))
+ fn_fields = DECL_CHAIN (fn_fields))
DECL_IN_AGGR_P (fn_fields) = 0;
/* Issue warnings about private constructors and such. If there are
@@ -2058,8 +2058,9 @@ get_vcall_index (tree fn, tree type)
}
/* Update an entry in the vtable for BINFO, which is in the hierarchy
- dominated by T. FN has been overridden in BINFO; VIRTUALS points to the
- corresponding position in the BINFO_VIRTUALS list. */
+ dominated by T. FN is the old function; VIRTUALS points to the
+ corresponding position in the new BINFO_VIRTUALS list. IX is the index
+ of that entry in the list. */
static void
update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
@@ -2204,6 +2205,40 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
gcc_assert (DECL_INVALID_OVERRIDER_P (overrider_target) ||
!DECL_THUNK_P (fn));
+ /* If we need a covariant thunk, then we may need to adjust first_defn.
+ The ABI specifies that the thunks emitted with a function are
+ determined by which bases the function overrides, so we need to be
+ sure that we're using a thunk for some overridden base; even if we
+ know that the necessary this adjustment is zero, there may not be an
+ appropriate zero-this-adjusment thunk for us to use since thunks for
+ overriding virtual bases always use the vcall offset.
+
+ Furthermore, just choosing any base that overrides this function isn't
+ quite right, as this slot won't be used for calls through a type that
+ puts a covariant thunk here. Calling the function through such a type
+ will use a different slot, and that slot is the one that determines
+ the thunk emitted for that base.
+
+ So, keep looking until we find the base that we're really overriding
+ in this slot: the nearest primary base that doesn't use a covariant
+ thunk in this slot. */
+ if (overrider_target != overrider_fn)
+ {
+ if (BINFO_TYPE (b) == DECL_CONTEXT (overrider_target))
+ /* We already know that the overrider needs a covariant thunk. */
+ b = get_primary_binfo (b);
+ for (; ; b = get_primary_binfo (b))
+ {
+ tree main_binfo = TYPE_BINFO (BINFO_TYPE (b));
+ tree bv = chain_index (ix, BINFO_VIRTUALS (main_binfo));
+ if (BINFO_LOST_PRIMARY_P (b))
+ lost = true;
+ if (!DECL_THUNK_P (TREE_VALUE (bv)))
+ break;
+ }
+ first_defn = b;
+ }
+
/* Assume that we will produce a thunk that convert all the way to
the final overrider, and not to an intermediate virtual base. */
virtual_base = NULL_TREE;
@@ -2228,36 +2263,6 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
}
}
- if (overrider_fn != overrider_target && !virtual_base)
- {
- /* The ABI specifies that a covariant thunk includes a mangling
- for a this pointer adjustment. This-adjusting thunks that
- override a function from a virtual base have a vcall
- adjustment. When the virtual base in question is a primary
- virtual base, we know the adjustments are zero, (and in the
- non-covariant case, we would not use the thunk).
- Unfortunately we didn't notice this could happen, when
- designing the ABI and so never mandated that such a covariant
- thunk should be emitted. Because we must use the ABI mandated
- name, we must continue searching from the binfo where we
- found the most recent definition of the function, towards the
- primary binfo which first introduced the function into the
- vtable. If that enters a virtual base, we must use a vcall
- this-adjusting thunk. Bleah! */
- tree probe = first_defn;
-
- while ((probe = get_primary_binfo (probe))
- && (unsigned) list_length (BINFO_VIRTUALS (probe)) > ix)
- if (BINFO_VIRTUAL_P (probe))
- virtual_base = probe;
-
- if (virtual_base)
- /* Even if we find a virtual base, the correct delta is
- between the overrider and the binfo we're building a vtable
- for. */
- goto virtual_covariant;
- }
-
/* Compute the constant adjustment to the `this' pointer. The
`this' pointer, when this function is called, will point at BINFO
(or one of its primary bases, which are at the same offset). */
@@ -2277,7 +2282,6 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
/* The `this' pointer needs to be adjusted from pointing to
BINFO to pointing at the base where the final overrider
appears. */
- virtual_covariant:
delta = size_diffop_loc (input_location,
convert (ssizetype,
BINFO_OFFSET (TREE_VALUE (overrider))),
@@ -2290,6 +2294,9 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
= get_vcall_index (overrider_target, BINFO_TYPE (virtual_base));
else
BV_VCALL_INDEX (*virtuals) = NULL_TREE;
+
+ if (lost)
+ BV_LOST_PRIMARY (*virtuals) = true;
}
/* Called from modify_all_vtables via dfs_walk. */
@@ -2532,7 +2539,7 @@ finish_struct_anon (tree t)
{
tree field;
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
{
if (TREE_STATIC (field))
continue;
@@ -2544,7 +2551,7 @@ finish_struct_anon (tree t)
{
bool is_union = TREE_CODE (TREE_TYPE (field)) == UNION_TYPE;
tree elt = TYPE_FIELDS (TREE_TYPE (field));
- for (; elt; elt = TREE_CHAIN (elt))
+ for (; elt; elt = DECL_CHAIN (elt))
{
/* We're generally only interested in entities the user
declared, but we also find nested classes by noticing
@@ -2715,7 +2722,7 @@ count_fields (tree fields)
{
tree x;
int n_fields = 0;
- for (x = fields; x; x = TREE_CHAIN (x))
+ for (x = fields; x; x = DECL_CHAIN (x))
{
if (TREE_CODE (x) == FIELD_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (x)))
n_fields += count_fields (TYPE_FIELDS (TREE_TYPE (x)));
@@ -2732,7 +2739,7 @@ static int
add_fields_to_record_type (tree fields, struct sorted_fields_type *field_vec, int idx)
{
tree x;
- for (x = fields; x; x = TREE_CHAIN (x))
+ for (x = fields; x; x = DECL_CHAIN (x))
{
if (TREE_CODE (x) == FIELD_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (x)))
idx = add_fields_to_record_type (TYPE_FIELDS (TREE_TYPE (x)), field_vec, idx);
@@ -2827,9 +2834,9 @@ check_field_decl (tree field,
{
tree type = strip_array_types (TREE_TYPE (field));
- /* An anonymous union cannot contain any fields which would change
+ /* In C++98 an anonymous union cannot contain any fields which would change
the settings of CANT_HAVE_CONST_CTOR and friends. */
- if (ANON_UNION_TYPE_P (type))
+ if (ANON_UNION_TYPE_P (type) && cxx_dialect < cxx0x)
;
/* And, we don't set TYPE_HAS_CONST_COPY_CTOR, etc., for anonymous
structs. So, we recurse through their fields here. */
@@ -2837,7 +2844,7 @@ check_field_decl (tree field,
{
tree fields;
- for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
+ for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields))
if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field))
check_field_decl (fields, t, cant_have_const_ctor,
no_const_asn_ref, any_default_members);
@@ -2850,8 +2857,10 @@ check_field_decl (tree field,
make it through without complaint. */
abstract_virtuals_error (field, type);
- if (TREE_CODE (t) == UNION_TYPE)
+ if (TREE_CODE (t) == UNION_TYPE && cxx_dialect < cxx0x)
{
+ static bool warned;
+ int oldcount = errorcount;
if (TYPE_NEEDS_CONSTRUCTING (type))
error ("member %q+#D with constructor not allowed in union",
field);
@@ -2860,8 +2869,12 @@ check_field_decl (tree field,
if (TYPE_HAS_COMPLEX_COPY_ASSIGN (type))
error ("member %q+#D with copy assignment operator not allowed in union",
field);
- /* Don't bother diagnosing move assop now; C++0x has more
- flexible unions. */
+ if (!warned && errorcount > oldcount)
+ {
+ inform (DECL_SOURCE_LOCATION (field), "unrestricted unions "
+ "only available with -std=c++0x or -std=gnu++0x");
+ warned = true;
+ }
}
else
{
@@ -2948,12 +2961,12 @@ check_field_decls (tree t, tree *access_decls,
tree type = TREE_TYPE (x);
int this_field_access;
- next = &TREE_CHAIN (x);
+ next = &DECL_CHAIN (x);
if (TREE_CODE (x) == USING_DECL)
{
/* Prune the access declaration from the list of fields. */
- *field = TREE_CHAIN (x);
+ *field = DECL_CHAIN (x);
/* Save the access declarations for our caller. */
*access_decls = tree_cons (NULL_TREE, x, *access_decls);
@@ -3386,7 +3399,7 @@ walk_subobject_offsets (tree type,
}
/* Iterate through the fields of TYPE. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL && !DECL_ARTIFICIAL (field))
{
tree field_offset;
@@ -3735,9 +3748,9 @@ build_base_field (record_layout_info rli, tree binfo,
objects of the same type at the same address. */
layout_nonempty_base_or_field (rli, decl, binfo, offsets);
/* Add the new FIELD_DECL to the list of fields for T. */
- TREE_CHAIN (decl) = *next_field;
+ DECL_CHAIN (decl) = *next_field;
*next_field = decl;
- next_field = &TREE_CHAIN (decl);
+ next_field = &DECL_CHAIN (decl);
}
}
else
@@ -3849,7 +3862,7 @@ check_methods (tree t)
{
tree x;
- for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
+ for (x = TYPE_METHODS (t); x; x = DECL_CHAIN (x))
{
check_for_override (x, t);
if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x))
@@ -3888,8 +3901,8 @@ build_clone (tree fn, tree name)
/* Remember where this function came from. */
DECL_ABSTRACT_ORIGIN (clone) = fn;
/* Make it easy to find the CLONE given the FN. */
- TREE_CHAIN (clone) = TREE_CHAIN (fn);
- TREE_CHAIN (fn) = clone;
+ DECL_CHAIN (clone) = DECL_CHAIN (fn);
+ DECL_CHAIN (fn) = clone;
/* If this is a template, do the rest on the DECL_TEMPLATE_RESULT. */
if (TREE_CODE (clone) == TEMPLATE_DECL)
@@ -3953,8 +3966,8 @@ build_clone (tree fn, tree name)
/* Remove the in-charge parameter. */
if (DECL_HAS_IN_CHARGE_PARM_P (clone))
{
- TREE_CHAIN (DECL_ARGUMENTS (clone))
- = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone)));
+ DECL_CHAIN (DECL_ARGUMENTS (clone))
+ = DECL_CHAIN (DECL_CHAIN (DECL_ARGUMENTS (clone)));
DECL_HAS_IN_CHARGE_PARM_P (clone) = 0;
}
/* And the VTT parm, in a complete [cd]tor. */
@@ -3964,13 +3977,13 @@ build_clone (tree fn, tree name)
DECL_HAS_VTT_PARM_P (clone) = 1;
else
{
- TREE_CHAIN (DECL_ARGUMENTS (clone))
- = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone)));
+ DECL_CHAIN (DECL_ARGUMENTS (clone))
+ = DECL_CHAIN (DECL_CHAIN (DECL_ARGUMENTS (clone)));
DECL_HAS_VTT_PARM_P (clone) = 0;
}
}
- for (parms = DECL_ARGUMENTS (clone); parms; parms = TREE_CHAIN (parms))
+ for (parms = DECL_ARGUMENTS (clone); parms; parms = DECL_CHAIN (parms))
{
DECL_CONTEXT (parms) = clone;
cxx_dup_lang_specific_decl (parms);
@@ -4033,8 +4046,8 @@ clone_function_decl (tree fn, int update_method_vec_p)
tree clone;
/* Avoid inappropriate cloning. */
- if (TREE_CHAIN (fn)
- && DECL_CLONED_FUNCTION_P (TREE_CHAIN (fn)))
+ if (DECL_CHAIN (fn)
+ && DECL_CLONED_FUNCTION_P (DECL_CHAIN (fn)))
return;
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn))
@@ -4091,8 +4104,8 @@ adjust_clone_args (tree decl)
{
tree clone;
- for (clone = TREE_CHAIN (decl); clone && DECL_CLONED_FUNCTION_P (clone);
- clone = TREE_CHAIN (clone))
+ for (clone = DECL_CHAIN (decl); clone && DECL_CLONED_FUNCTION_P (clone);
+ clone = DECL_CHAIN (clone))
{
tree orig_clone_parms = TYPE_ARG_TYPES (TREE_TYPE (clone));
tree orig_decl_parms = TYPE_ARG_TYPES (TREE_TYPE (decl));
@@ -4363,9 +4376,9 @@ remove_zero_width_bit_fields (tree t)
check_bitfield_decl eventually sets DECL_SIZE (*fieldsp)
to that width. */
&& integer_zerop (DECL_SIZE (*fieldsp)))
- *fieldsp = TREE_CHAIN (*fieldsp);
+ *fieldsp = DECL_CHAIN (*fieldsp);
else
- fieldsp = &TREE_CHAIN (*fieldsp);
+ fieldsp = &DECL_CHAIN (*fieldsp);
}
}
@@ -4519,7 +4532,7 @@ check_bases_and_members (tree t)
{
tree field;
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
{
tree type;
@@ -4545,7 +4558,7 @@ check_bases_and_members (tree t)
/* Check defaulted declarations here so we have cant_have_const_ctor
and don't need to worry about clones. */
- for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
+ for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn))
if (DECL_DEFAULTED_IN_CLASS_P (fn))
{
int copy = copy_fn_p (fn);
@@ -4611,7 +4624,7 @@ create_vtable_ptr (tree t, tree* virtuals_p)
tree fn;
/* Collect the virtual functions declared in T. */
- for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
+ for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn))
if (DECL_VINDEX (fn) && !DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn)
&& TREE_CODE (DECL_VINDEX (fn)) != INTEGER_CST)
{
@@ -4746,7 +4759,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets)
bases will go after the last extant field to date. */
next_field = &TYPE_FIELDS (t);
while (*next_field)
- next_field = &TREE_CHAIN (*next_field);
+ next_field = &DECL_CHAIN (*next_field);
/* Go through the virtual bases, allocating space for each virtual
base that is not already a primary base class. These are
@@ -4987,9 +5000,9 @@ layout_class_type (tree t, tree *virtuals_p)
/* The vptr is always the first thing in the class. */
if (vptr)
{
- TREE_CHAIN (vptr) = TYPE_FIELDS (t);
+ DECL_CHAIN (vptr) = TYPE_FIELDS (t);
TYPE_FIELDS (t) = vptr;
- next_field = &TREE_CHAIN (vptr);
+ next_field = &DECL_CHAIN (vptr);
place_field (rli, vptr);
}
else
@@ -5001,7 +5014,7 @@ layout_class_type (tree t, tree *virtuals_p)
build_base_fields (rli, empty_base_offsets, next_field);
/* Layout the non-static data members. */
- for (field = non_static_data_members; field; field = TREE_CHAIN (field))
+ for (field = non_static_data_members; field; field = DECL_CHAIN (field))
{
tree type;
tree padding;
@@ -5282,7 +5295,7 @@ layout_class_type (tree t, tree *virtuals_p)
/* Copy the fields from T. */
next_field = &TYPE_FIELDS (base_t);
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
*next_field = build_decl (input_location,
@@ -5295,7 +5308,7 @@ layout_class_type (tree t, tree *virtuals_p)
= DECL_FIELD_BIT_OFFSET (field);
DECL_SIZE (*next_field) = DECL_SIZE (field);
DECL_MODE (*next_field) = DECL_MODE (field);
- next_field = &TREE_CHAIN (*next_field);
+ next_field = &DECL_CHAIN (*next_field);
}
/* Record the base version of the type. */
@@ -5342,7 +5355,7 @@ layout_class_type (tree t, tree *virtuals_p)
warn_about_ambiguous_bases (t);
/* Now that we're done with layout, give the base fields the real types. */
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
if (DECL_ARTIFICIAL (field) && IS_FAKE_BASE_TYPE (TREE_TYPE (field)))
TREE_TYPE (field) = TYPE_CONTEXT (TREE_TYPE (field));
@@ -5374,7 +5387,7 @@ determine_key_method (tree type)
key function may not be inline; those targets should not call
this function until the end of the translation unit. */
for (method = TYPE_METHODS (type); method != NULL_TREE;
- method = TREE_CHAIN (method))
+ method = DECL_CHAIN (method))
if (DECL_VINDEX (method) != NULL_TREE
&& ! DECL_DECLARED_INLINE_P (method)
&& ! DECL_PURE_VIRTUAL_P (method))
@@ -5498,7 +5511,7 @@ finish_struct_1 (tree t)
/* Complete the rtl for any static member objects of the type we're
working on. */
- for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x))
+ for (x = TYPE_FIELDS (t); x; x = DECL_CHAIN (x))
if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
&& TREE_TYPE (x) != error_mark_node
&& same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (x)), t))
@@ -5595,13 +5608,13 @@ unreverse_member_declarations (tree t)
x && TREE_CODE (x) != TYPE_DECL;
x = next)
{
- next = TREE_CHAIN (x);
- TREE_CHAIN (x) = prev;
+ next = DECL_CHAIN (x);
+ DECL_CHAIN (x) = prev;
prev = x;
}
if (prev)
{
- TREE_CHAIN (TYPE_FIELDS (t)) = x;
+ DECL_CHAIN (TYPE_FIELDS (t)) = x;
if (prev)
TYPE_FIELDS (t) = prev;
}
@@ -5638,7 +5651,7 @@ finish_struct (tree t, tree attributes)
CLASSTYPE_PURE_VIRTUALS contains the list of the inline friends
(see CLASSTYPE_INLINE_FRIENDS) so we need to clear it. */
CLASSTYPE_PURE_VIRTUALS (t) = NULL;
- for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
+ for (x = TYPE_METHODS (t); x; x = DECL_CHAIN (x))
if (DECL_PURE_VIRTUAL_P (x))
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
complete_vars (t);
@@ -6749,7 +6762,7 @@ is_really_empty_class (tree type)
BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
if (!is_really_empty_class (BINFO_TYPE (base_binfo)))
return false;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& !DECL_ARTIFICIAL (field)
&& !is_really_empty_class (TREE_TYPE (field)))
@@ -7202,8 +7215,8 @@ build_vtt (tree t)
vtt = build_vtable (t, mangle_vtt_for_type (t), type);
initialize_artificial_var (vtt, inits);
/* Add the VTT to the vtables list. */
- TREE_CHAIN (vtt) = TREE_CHAIN (CLASSTYPE_VTABLES (t));
- TREE_CHAIN (CLASSTYPE_VTABLES (t)) = vtt;
+ DECL_CHAIN (vtt) = DECL_CHAIN (CLASSTYPE_VTABLES (t));
+ DECL_CHAIN (CLASSTYPE_VTABLES (t)) = vtt;
dump_vtt (t, vtt);
}
@@ -7656,7 +7669,7 @@ build_vtbl_initializer (tree binfo,
int* non_fn_entries_p,
VEC(constructor_elt,gc) **inits)
{
- tree v, b;
+ tree v;
vtbl_init_data vid;
unsigned ix, jx;
tree vbinfo;
@@ -7770,20 +7783,8 @@ build_vtbl_initializer (tree binfo,
zero out unused slots in ctor vtables, rather than filling them
with erroneous values (though harmless, apart from relocation
costs). */
- for (b = binfo; ; b = get_primary_binfo (b))
- {
- /* We found a defn before a lost primary; go ahead as normal. */
- if (look_for_overrides_here (BINFO_TYPE (b), fn_original))
- break;
-
- /* The nearest definition is from a lost primary; clear the
- slot. */
- if (BINFO_LOST_PRIMARY_P (b))
- {
- init = size_zero_node;
- break;
- }
- }
+ if (BV_LOST_PRIMARY (v))
+ init = size_zero_node;
if (! init)
{
@@ -8045,7 +8046,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid)
order. G++ 3.2 used the order in the vtable. */
for (orig_fn = TYPE_METHODS (BINFO_TYPE (binfo));
orig_fn;
- orig_fn = TREE_CHAIN (orig_fn))
+ orig_fn = DECL_CHAIN (orig_fn))
if (DECL_VINDEX (orig_fn))
add_vcall_offset (orig_fn, binfo, vid);
}
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index fb7daeb3e81..abd5bf37b6e 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -51,7 +51,7 @@ static tree
begin_bc_block (enum bc_t bc)
{
tree label = create_artificial_label (input_location);
- TREE_CHAIN (label) = bc_label[bc];
+ DECL_CHAIN (label) = bc_label[bc];
bc_label[bc] = label;
return label;
}
@@ -73,8 +73,8 @@ finish_bc_block (enum bc_t bc, tree label, gimple_seq body)
gimple_seq_add_stmt (&body, gimple_build_label (label));
}
- bc_label[bc] = TREE_CHAIN (label);
- TREE_CHAIN (label) = NULL_TREE;
+ bc_label[bc] = DECL_CHAIN (label);
+ DECL_CHAIN (label) = NULL_TREE;
return body;
}
@@ -575,7 +575,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
TREE_OPERAND (*expr_p, 1) = build1 (VIEW_CONVERT_EXPR,
TREE_TYPE (op0), op1);
- else if ((rhs_predicate_for (op0)) (op1)
+ else if ((is_gimple_lvalue (op1) || INDIRECT_REF_P (op1))
&& !(TREE_CODE (op1) == CALL_EXPR
&& CALL_EXPR_RETURN_SLOT_OPT (op1))
&& is_really_empty_class (TREE_TYPE (op0)))
@@ -893,7 +893,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
IMPORTED_DECL_ASSOCIATED_DECL (using_directive)
= TREE_OPERAND (stmt, 0);
- TREE_CHAIN (using_directive) = BLOCK_VARS (block);
+ DECL_CHAIN (using_directive) = BLOCK_VARS (block);
BLOCK_VARS (block) = using_directive;
}
/* The USING_STMT won't appear in GENERIC. */
@@ -921,7 +921,7 @@ cp_genericize (tree fndecl)
struct cp_genericize_data wtd;
/* Fix up the types of parms passed by invisible reference. */
- for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (fndecl); t; t = DECL_CHAIN (t))
if (TREE_ADDRESSABLE (TREE_TYPE (t)))
{
/* If a function's arguments are copied to create a thunk,
@@ -1178,7 +1178,7 @@ cxx_omp_predetermined_sharing (tree decl)
tree var;
if (outer)
- for (var = BLOCK_VARS (outer); var; var = TREE_CHAIN (var))
+ for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var))
if (DECL_NAME (decl) == DECL_NAME (var)
&& (TYPE_MAIN_VARIANT (type)
== TYPE_MAIN_VARIANT (TREE_TYPE (var))))
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index dbb6b9d5062..548bf68496e 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -30,19 +30,18 @@ along with GCC; see the file COPYING3. If not see
/* In order for the format checking to accept the C++ front end
diagnostic framework extensions, you must include this file before
- toplev.h, not after. We override the definition of GCC_DIAG_STYLE
+ diagnostic-core.h, not after. We override the definition of GCC_DIAG_STYLE
in c-common.h. */
#undef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_cxxdiag__
-#if defined(GCC_TOPLEV_H) || defined (GCC_C_COMMON_H)
+#if defined(GCC_DIAGNOSTIC_CORE_H) || defined (GCC_C_COMMON_H)
#error \
In order for the format checking to accept the C++ front end diagnostic \
-framework extensions, you must include this file before toplev.h and \
+framework extensions, you must include this file before diagnostic-core.h and \
c-common.h, not after.
#endif
-#include "toplev.h"
-#include "diagnostic.h"
#include "c-family/c-common.h"
+#include "diagnostic.h"
#include "name-lookup.h"
@@ -169,6 +168,9 @@ c-common.h, not after.
The BV_FN is the declaration for the virtual function itself.
+ If BV_LOST_PRIMARY is set, it means that this entry is for a lost
+ primary virtual base and can be left null in the vtable.
+
BINFO_VTABLE
This is an expression with POINTER_TYPE that gives the value
to which the vptr should be initialized. Use get_vtbl_decl_for_binfo
@@ -287,11 +289,6 @@ typedef struct ptrmem_cst * ptrmem_cst_t;
#define same_type_p(TYPE1, TYPE2) \
comptypes ((TYPE1), (TYPE2), COMPARE_STRICT)
-/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
- top-level qualifiers. */
-#define same_type_ignoring_top_level_qualifiers_p(TYPE1, TYPE2) \
- same_type_p (TYPE_MAIN_VARIANT (TYPE1), TYPE_MAIN_VARIANT (TYPE2))
-
/* Nonzero if we are presently building a statement tree, rather
than expanding each statement as we encounter it. */
#define building_stmt_tree() (cur_stmt_list != NULL_TREE)
@@ -435,6 +432,17 @@ typedef enum impl_conv_rhs {
ICR_ASSIGN /* assignment */
} impl_conv_rhs;
+/* Possible cases of implicit or explicit bad conversions to void. */
+typedef enum impl_conv_void {
+ ICV_CAST, /* (explicit) conversion to void */
+ ICV_SECOND_OF_COND, /* second operand of conditional expression */
+ ICV_THIRD_OF_COND, /* third operand of conditional expression */
+ ICV_RIGHT_OF_COMMA, /* right operand of comma operator */
+ ICV_LEFT_OF_COMMA, /* left operand of comma operator */
+ ICV_STATEMENT, /* statement */
+ ICV_THIRD_IN_FOR /* for increment expression */
+} impl_conv_void;
+
/* Macros for access to language-specific slots in an identifier. */
#define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \
@@ -1757,6 +1765,8 @@ struct GTY((variable_size)) lang_type {
/* The function to call. */
#define BV_FN(NODE) (TREE_VALUE (NODE))
+/* Whether or not this entry is for a lost primary virtual base. */
+#define BV_LOST_PRIMARY(NODE) (TREE_LANG_FLAG_0 (NODE))
/* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
@@ -2076,9 +2086,9 @@ struct GTY((variable_size)) lang_decl {
if (TREE_CODE (FN) == FUNCTION_DECL \
&& (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (FN) \
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (FN))) \
- for (CLONE = TREE_CHAIN (FN); \
+ for (CLONE = DECL_CHAIN (FN); \
CLONE && DECL_CLONED_FUNCTION_P (CLONE); \
- CLONE = TREE_CHAIN (CLONE))
+ CLONE = DECL_CHAIN (CLONE))
/* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */
#define DECL_DISCRIMINATOR_P(NODE) \
@@ -3992,7 +4002,6 @@ typedef enum base_kind {
/* For building calls to `delete'. */
extern GTY(()) tree integer_two_node;
-extern GTY(()) tree integer_three_node;
/* The number of function bodies which we are currently processing.
(Zero if we are at namespace scope, one inside the body of a
@@ -4703,8 +4712,8 @@ extern tree ocp_convert (tree, tree, int, int);
extern tree cp_convert (tree, tree);
extern tree cp_convert_and_check (tree, tree);
extern tree cp_fold_convert (tree, tree);
-extern tree convert_to_void (tree, const char */*implicit context*/,
- tsubst_flags_t);
+extern tree convert_to_void (tree, impl_conv_void,
+ tsubst_flags_t);
extern tree convert_force (tree, tree, int);
extern tree build_expr_type_conversion (int, tree, bool);
extern tree type_promotes_to (tree);
@@ -5420,6 +5429,7 @@ extern int type_unknown_p (const_tree);
enum { ce_derived, ce_normal, ce_exact };
extern bool comp_except_specs (const_tree, const_tree, int);
extern bool comptypes (tree, tree, int);
+extern bool same_type_ignoring_top_level_qualifiers_p (tree, tree);
extern bool compparms (const_tree, const_tree);
extern int comp_cv_qualification (const_tree, const_tree);
extern int comp_cv_qual_signature (tree, tree);
@@ -5458,7 +5468,8 @@ extern tree cp_build_unary_op (enum tree_code, tree, int,
extern tree unary_complex_lvalue (enum tree_code, tree);
extern tree build_x_conditional_expr (tree, tree, tree,
tsubst_flags_t);
-extern tree build_x_compound_expr_from_list (tree, expr_list_kind);
+extern tree build_x_compound_expr_from_list (tree, expr_list_kind,
+ tsubst_flags_t);
extern tree build_x_compound_expr_from_vec (VEC(tree,gc) *, const char *);
extern tree build_x_compound_expr (tree, tree, tsubst_flags_t);
extern tree build_compound_expr (location_t, tree, tree);
@@ -5479,7 +5490,8 @@ extern int comp_ptr_ttypes (tree, tree);
extern bool comp_ptr_ttypes_const (tree, tree);
extern bool error_type_p (const_tree);
extern int ptr_reasonably_similar (const_tree, const_tree);
-extern tree build_ptrmemfunc (tree, tree, int, bool);
+extern tree build_ptrmemfunc (tree, tree, int, bool,
+ tsubst_flags_t);
extern int cp_type_quals (const_tree);
extern int type_memfn_quals (const_tree);
extern tree apply_memfn_quals (tree, cp_cv_quals);
@@ -5508,7 +5520,8 @@ extern tree non_reference (tree);
extern tree lookup_anon_field (tree, tree);
extern bool invalid_nonstatic_memfn_p (const_tree, tsubst_flags_t);
extern tree convert_member_func_to_ptr (tree, tree);
-extern tree convert_ptrmem (tree, tree, bool, bool);
+extern tree convert_ptrmem (tree, tree, bool, bool,
+ tsubst_flags_t);
extern int lvalue_or_else (tree, enum lvalue_use,
tsubst_flags_t);
extern void check_template_keyword (tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 40a635153bc..26c4442a94b 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -176,7 +176,7 @@ cp_convert_to_pointer (tree type, tree expr)
else if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
return convert_ptrmem (type, expr, /*allow_inverse_p=*/false,
- /*c_cast_p=*/false);
+ /*c_cast_p=*/false, tf_warning_or_error);
else if (TYPE_PTRMEMFUNC_P (intype))
{
if (!warn_pmf2ptr)
@@ -200,7 +200,7 @@ cp_convert_to_pointer (tree type, tree expr)
{
if (TYPE_PTRMEMFUNC_P (type))
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0,
- /*c_cast_p=*/false);
+ /*c_cast_p=*/false, tf_warning_or_error);
if (TYPE_PTRMEM_P (type))
{
@@ -651,7 +651,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
if (code == VOID_TYPE && (convtype & CONV_STATIC))
{
- e = convert_to_void (e, /*implicit=*/NULL, tf_warning_or_error);
+ e = convert_to_void (e, ICV_CAST, tf_warning_or_error);
return e;
}
@@ -814,19 +814,18 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
make it impossible to ignore the reference return value from functions. We
issue warnings in the confusing cases.
- IMPLICIT is non-NULL iff an expression is being implicitly converted; it
- is NULL when the user is explicitly converting an expression to void via
- a cast. When non-NULL, IMPLICIT is a string indicating the context of
- the implicit conversion. */
+ The IMPLICIT is ICV_CAST when the user is explicitly converting an expression
+ to void via a cast. If an expression is being implicitly converted, IMPLICIT
+ indicates the context of the implicit conversion. */
tree
-convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
+convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
{
if (expr == error_mark_node
|| TREE_TYPE (expr) == error_mark_node)
return error_mark_node;
- if (implicit == NULL)
+ if (implicit == ICV_CAST)
mark_exp_read (expr);
else
{
@@ -865,12 +864,17 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
tree op1 = TREE_OPERAND (expr,1);
tree op2 = TREE_OPERAND (expr,2);
bool side_effects = TREE_SIDE_EFFECTS (op1) || TREE_SIDE_EFFECTS (op2);
- tree new_op1 = convert_to_void
- (op1, (implicit && !side_effects
- ? "second operand of conditional" : NULL), complain);
- tree new_op2 = convert_to_void
- (op2, (implicit && !side_effects
- ? "third operand of conditional" : NULL), complain);
+ tree new_op1, new_op2;
+ if (implicit != ICV_CAST && !side_effects)
+ {
+ new_op1 = convert_to_void (op1, ICV_SECOND_OF_COND, complain);
+ new_op2 = convert_to_void (op2, ICV_THIRD_OF_COND, complain);
+ }
+ else
+ {
+ new_op1 = convert_to_void (op1, ICV_CAST, complain);
+ new_op2 = convert_to_void (op2, ICV_CAST, complain);
+ }
expr = build3 (COND_EXPR, TREE_TYPE (new_op1),
TREE_OPERAND (expr, 0), new_op1, new_op2);
@@ -881,9 +885,11 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
{
/* The second part of a compound expr contains the value. */
tree op1 = TREE_OPERAND (expr,1);
- tree new_op1 = convert_to_void
- (op1, (implicit && !TREE_NO_WARNING (expr)
- ? "right-hand operand of comma" : NULL), complain);
+ tree new_op1;
+ if (implicit != ICV_CAST && !TREE_NO_WARNING (expr))
+ new_op1 = convert_to_void (op1, ICV_RIGHT_OF_COMMA, complain);
+ else
+ new_op1 = convert_to_void (op1, ICV_CAST, complain);
if (new_op1 != op1)
{
@@ -915,18 +921,133 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
if (is_volatile && !is_complete)
{
if (complain & tf_warning)
- warning (0, "object of incomplete type %qT will not be accessed in %s",
- type, implicit ? implicit : "void context");
+ switch (implicit)
+ {
+ case ICV_CAST:
+ warning (0, "conversion to void will not access "
+ "object of incomplete type %qT", type);
+ break;
+ case ICV_SECOND_OF_COND:
+ warning (0, "indirection will not access object of "
+ "incomplete type %qT in second operand "
+ "of conditional expression", type);
+ break;
+ case ICV_THIRD_OF_COND:
+ warning (0, "indirection will not access object of "
+ "incomplete type %qT in third operand "
+ "of conditional expression", type);
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ warning (0, "indirection will not access object of "
+ "incomplete type %qT in right operand of "
+ "comma operator", type);
+ break;
+ case ICV_LEFT_OF_COMMA:
+ warning (0, "indirection will not access object of "
+ "incomplete type %qT in left operand of "
+ "comma operator", type);
+ break;
+ case ICV_STATEMENT:
+ warning (0, "indirection will not access object of "
+ "incomplete type %qT in statement", type);
+ break;
+ case ICV_THIRD_IN_FOR:
+ warning (0, "indirection will not access object of "
+ "incomplete type %qT in for increment "
+ "expression", type);
+ break;
+ default:
+ gcc_unreachable ();
+ }
}
/* Don't load the value if this is an implicit dereference, or if
the type needs to be handled by ctors/dtors. */
- else if (is_volatile && (is_reference || TREE_ADDRESSABLE (type)))
+ else if (is_volatile && is_reference)
{
if (complain & tf_warning)
- warning (0, "object of type %qT will not be accessed in %s",
- TREE_TYPE (TREE_OPERAND (expr, 0)),
- implicit ? implicit : "void context");
+ switch (implicit)
+ {
+ case ICV_CAST:
+ warning (0, "conversion to void will not access "
+ "object of type %qT", type);
+ break;
+ case ICV_SECOND_OF_COND:
+ warning (0, "implicit dereference will not access object "
+ "of type %qT in second operand of "
+ "conditional expression", type);
+ break;
+ case ICV_THIRD_OF_COND:
+ warning (0, "implicit dereference will not access object "
+ "of type %qT in third operand of "
+ "conditional expression", type);
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ warning (0, "implicit dereference will not access object "
+ "of type %qT in right operand of "
+ "comma operator", type);
+ break;
+ case ICV_LEFT_OF_COMMA:
+ warning (0, "implicit dereference will not access object "
+ "of type %qT in left operand of comma operator",
+ type);
+ break;
+ case ICV_STATEMENT:
+ warning (0, "implicit dereference will not access object "
+ "of type %qT in statement", type);
+ break;
+ case ICV_THIRD_IN_FOR:
+ warning (0, "implicit dereference will not access object "
+ "of type %qT in for increment expression",
+ type);
+ break;
+ default:
+ gcc_unreachable ();
+ }
}
+ else if (is_volatile && TREE_ADDRESSABLE (type))
+ {
+ if (complain & tf_warning)
+ switch (implicit)
+ {
+ case ICV_CAST:
+ warning (0, "conversion to void will not access "
+ "object of non-trivially-copyable type %qT",
+ type);
+ break;
+ case ICV_SECOND_OF_COND:
+ warning (0, "indirection will not access object of "
+ "non-trivially-copyable type %qT in second "
+ "operand of conditional expression", type);
+ break;
+ case ICV_THIRD_OF_COND:
+ warning (0, "indirection will not access object of "
+ "non-trivially-copyable type %qT in third "
+ "operand of conditional expression", type);
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ warning (0, "indirection will not access object of "
+ "non-trivially-copyable type %qT in right "
+ "operand of comma operator", type);
+ break;
+ case ICV_LEFT_OF_COMMA:
+ warning (0, "indirection will not access object of "
+ "non-trivially-copyable type %qT in left "
+ "operand of comma operator", type);
+ break;
+ case ICV_STATEMENT:
+ warning (0, "indirection will not access object of "
+ "non-trivially-copyable type %qT in statement",
+ type);
+ break;
+ case ICV_THIRD_IN_FOR:
+ warning (0, "indirection will not access object of "
+ "non-trivially-copyable type %qT in for "
+ "increment expression", type);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
if (is_reference || !is_volatile || !is_complete || TREE_ADDRESSABLE (type))
{
/* Emit a warning (if enabled) when the "effect-less" INDIRECT_REF
@@ -936,7 +1057,7 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
- automatic dereferencing of references, since the user cannot
control it. (See also warn_if_unused_value() in stmt.c.) */
if (warn_unused_value
- && implicit
+ && implicit != ICV_CAST
&& (complain & tf_warning)
&& !TREE_NO_WARNING (expr)
&& !is_reference)
@@ -954,8 +1075,45 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (TYPE_VOLATILE (type) && !is_complete && (complain & tf_warning))
- warning (0, "object %qE of incomplete type %qT will not be accessed in %s",
- expr, type, implicit ? implicit : "void context");
+ switch (implicit)
+ {
+ case ICV_CAST:
+ warning (0, "conversion to void will not access "
+ "object %qE of incomplete type %qT", expr, type);
+ break;
+ case ICV_SECOND_OF_COND:
+ warning (0, "variable %qE of incomplete type %qT will not "
+ "be accessed in second operand of "
+ "conditional expression", expr, type);
+ break;
+ case ICV_THIRD_OF_COND:
+ warning (0, "variable %qE of incomplete type %qT will not "
+ "be accessed in third operand of "
+ "conditional expression", expr, type);
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ warning (0, "variable %qE of incomplete type %qT will not "
+ "be accessed in right operand of comma operator",
+ expr, type);
+ break;
+ case ICV_LEFT_OF_COMMA:
+ warning (0, "variable %qE of incomplete type %qT will not "
+ "be accessed in left operand of comma operator",
+ expr, type);
+ break;
+ case ICV_STATEMENT:
+ warning (0, "variable %qE of incomplete type %qT will not "
+ "be accessed in statement", expr, type);
+ break;
+ case ICV_THIRD_IN_FOR:
+ warning (0, "variable %qE of incomplete type %qT will not "
+ "be accessed in for increment expression",
+ expr, type);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
break;
}
@@ -994,18 +1152,81 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
/* [over.over] enumerates the places where we can take the address
of an overloaded function, and this is not one of them. */
if (complain & tf_error)
- error ("%s cannot resolve address of overloaded function",
- implicit ? implicit : "void cast");
+ switch (implicit)
+ {
+ case ICV_CAST:
+ error ("conversion to void "
+ "cannot resolve address of overloaded function");
+ break;
+ case ICV_SECOND_OF_COND:
+ error ("second operand of conditional expression "
+ "cannot resolve address of overloaded function");
+ break;
+ case ICV_THIRD_OF_COND:
+ error ("third operand of conditional expression "
+ "cannot resolve address of overloaded function");
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ error ("right operand of comma operator "
+ "cannot resolve address of overloaded function");
+ break;
+ case ICV_LEFT_OF_COMMA:
+ error ("left operand of comma operator "
+ "cannot resolve address of overloaded function");
+ break;
+ case ICV_STATEMENT:
+ error ("statement "
+ "cannot resolve address of overloaded function");
+ break;
+ case ICV_THIRD_IN_FOR:
+ error ("for increment expression "
+ "cannot resolve address of overloaded function");
+ break;
+ }
else
return error_mark_node;
expr = void_zero_node;
}
- else if (implicit && probe == expr && is_overloaded_fn (probe))
+ else if (implicit != ICV_CAST && probe == expr && is_overloaded_fn (probe))
{
/* Only warn when there is no &. */
if (complain & tf_warning)
- warning (OPT_Waddress, "%s is a reference, not call, to function %qE",
- implicit, expr);
+ switch (implicit)
+ {
+ case ICV_SECOND_OF_COND:
+ warning (OPT_Waddress,
+ "second operand of conditional expression "
+ "is a reference, not call, to function %qE", expr);
+ break;
+ case ICV_THIRD_OF_COND:
+ warning (OPT_Waddress,
+ "third operand of conditional expression "
+ "is a reference, not call, to function %qE", expr);
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ warning (OPT_Waddress,
+ "right operand of comma operator "
+ "is a reference, not call, to function %qE", expr);
+ break;
+ case ICV_LEFT_OF_COMMA:
+ warning (OPT_Waddress,
+ "left operand of comma operator "
+ "is a reference, not call, to function %qE", expr);
+ break;
+ case ICV_STATEMENT:
+ warning (OPT_Waddress,
+ "statement is a reference, not call, to function %qE",
+ expr);
+ break;
+ case ICV_THIRD_IN_FOR:
+ warning (OPT_Waddress,
+ "for increment expression "
+ "is a reference, not call, to function %qE", expr);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
if (TREE_CODE (expr) == COMPONENT_REF)
expr = TREE_OPERAND (expr, 0);
}
@@ -1013,7 +1234,7 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
if (expr != error_mark_node && !VOID_TYPE_P (TREE_TYPE (expr)))
{
- if (implicit
+ if (implicit != ICV_CAST
&& warn_unused_value
&& !TREE_NO_WARNING (expr)
&& !processing_template_decl)
@@ -1022,7 +1243,35 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
been explicitly cast to void, so we must do so here. */
if (!TREE_SIDE_EFFECTS (expr)) {
if (complain & tf_warning)
- warning (OPT_Wunused_value, "%s has no effect", implicit);
+ switch (implicit)
+ {
+ case ICV_SECOND_OF_COND:
+ warning (OPT_Wunused_value,
+ "second operand of conditional expression has no effect");
+ break;
+ case ICV_THIRD_OF_COND:
+ warning (OPT_Wunused_value,
+ "third operand of conditional expression has no effect");
+ break;
+ case ICV_RIGHT_OF_COMMA:
+ warning (OPT_Wunused_value,
+ "right operand of comma operator has no effect");
+ break;
+ case ICV_LEFT_OF_COMMA:
+ warning (OPT_Wunused_value,
+ "left operand of comma operator has no effect");
+ break;
+ case ICV_STATEMENT:
+ warning (OPT_Wunused_value,
+ "statement has no effect");
+ break;
+ case ICV_THIRD_IN_FOR:
+ warning (OPT_Wunused_value,
+ "for increment expression has no effect");
+ break;
+ default:
+ gcc_unreachable ();
+ }
}
else
{
@@ -1127,7 +1376,7 @@ convert_force (tree type, tree expr, int convtype)
&& TYPE_PTRMEMFUNC_P (type))
/* compatible pointer to member functions. */
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), e, 1,
- /*c_cast_p=*/1);
+ /*c_cast_p=*/1, tf_warning_or_error);
return ocp_convert (type, e, CONV_C_CAST|convtype, LOOKUP_NORMAL);
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 62d3f651ead..73cf2bc58f7 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -169,9 +169,9 @@ tree static_aggregates;
/* -- end of C++ */
-/* A node for the integer constants 2, and 3. */
+/* A node for the integer constant 2. */
-tree integer_two_node, integer_three_node;
+tree integer_two_node;
/* Used only for jumps to as-yet undefined labels, since jumps to
defined labels can have their validity checked immediately. */
@@ -393,7 +393,7 @@ pop_labels_1 (void **slot, void *data)
/* Put the labels into the "variables" of the top-level block,
so debugger can see them. */
- TREE_CHAIN (ent->label_decl) = BLOCK_VARS (block);
+ DECL_CHAIN (ent->label_decl) = BLOCK_VARS (block);
BLOCK_VARS (block) = ent->label_decl;
htab_clear_slot (named_labels, slot);
@@ -474,7 +474,7 @@ poplevel_named_label_1 (void **slot, void *data)
{
tree decl;
- for (decl = ent->names_in_scope; decl; decl = TREE_CHAIN (decl))
+ for (decl = ent->names_in_scope; decl; decl = DECL_CHAIN (decl))
if (decl_jump_unsafe (decl))
VEC_safe_push (tree, gc, ent->bad_decls, decl);
@@ -749,7 +749,7 @@ poplevel (int keep, int reverse, int functionbody)
if (TREE_CODE (*d) == TREE_LIST)
*d = TREE_CHAIN (*d);
else
- d = &TREE_CHAIN (*d);
+ d = &DECL_CHAIN (*d);
}
}
@@ -822,7 +822,7 @@ walk_namespaces_r (tree name_space, walk_namespaces_fn f, void* data)
result |= (*f) (name_space, data);
- for (; current; current = TREE_CHAIN (current))
+ for (; current; current = DECL_CHAIN (current))
result |= walk_namespaces_r (current, f, data);
return result;
@@ -1759,7 +1759,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
DECL_ARGUMENTS (old_result)
= DECL_ARGUMENTS (new_result);
for (parm = DECL_ARGUMENTS (old_result); parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
DECL_CONTEXT (parm) = old_result;
}
}
@@ -2009,7 +2009,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
for (oldarg = DECL_ARGUMENTS(olddecl),
newarg = DECL_ARGUMENTS(newdecl);
oldarg && newarg;
- oldarg = TREE_CHAIN(oldarg), newarg = TREE_CHAIN(newarg)) {
+ oldarg = DECL_CHAIN(oldarg), newarg = DECL_CHAIN(newarg)) {
DECL_ATTRIBUTES (newarg)
= (*targetm.merge_decl_attributes) (oldarg, newarg);
DECL_ATTRIBUTES (oldarg) = DECL_ATTRIBUTES (newarg);
@@ -2073,7 +2073,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
/* Update newdecl's parms to point at olddecl. */
for (parm = DECL_ARGUMENTS (newdecl); parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
DECL_CONTEXT (parm) = olddecl;
if (! types_match)
@@ -2619,7 +2619,7 @@ check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names,
tree new_decls, old_decls = (b == level ? names : NULL_TREE);
for (new_decls = b->names; new_decls != old_decls;
- new_decls = TREE_CHAIN (new_decls))
+ new_decls = DECL_CHAIN (new_decls))
{
int problem = decl_jump_unsafe (new_decls);
if (! problem)
@@ -3472,7 +3472,6 @@ cxx_init_decl_processing (void)
java_boolean_type_node = record_builtin_java_type ("__java_boolean", -1);
integer_two_node = build_int_cst (NULL_TREE, 2);
- integer_three_node = build_int_cst (NULL_TREE, 3);
record_builtin_type (RID_BOOL, "bool", boolean_type_node);
truthvalue_type_node = boolean_type_node;
@@ -3918,7 +3917,7 @@ fixup_anonymous_aggr (tree t)
if (DECL_ARTIFICIAL (*q))
*q = TREE_CHAIN (*q);
else
- q = &TREE_CHAIN (*q);
+ q = &DECL_CHAIN (*q);
}
/* ISO C++ 9.5.3. Anonymous unions may not have function members. */
@@ -3942,7 +3941,7 @@ fixup_anonymous_aggr (tree t)
{
tree field, type;
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
type = TREE_TYPE (field);
@@ -4496,7 +4495,8 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup)
}
if (TREE_CODE (init) == TREE_LIST)
- init = build_x_compound_expr_from_list (init, ELK_INIT);
+ init = build_x_compound_expr_from_list (init, ELK_INIT,
+ tf_warning_or_error);
if (TREE_CODE (TREE_TYPE (type)) != ARRAY_TYPE
&& TREE_CODE (TREE_TYPE (init)) == ARRAY_TYPE)
@@ -4844,7 +4844,7 @@ next_initializable_field (tree field)
&& (TREE_CODE (field) != FIELD_DECL
|| (DECL_C_BIT_FIELD (field) && !DECL_NAME (field))
|| DECL_ARTIFICIAL (field)))
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
return field;
}
@@ -5014,7 +5014,7 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p)
if (TREE_CODE (type) == UNION_TYPE)
break;
- field = next_initializable_field (TREE_CHAIN (field));
+ field = next_initializable_field (DECL_CHAIN (field));
}
return new_init;
@@ -5717,7 +5717,8 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
return;
}
if (TREE_CODE (init) == TREE_LIST)
- init = build_x_compound_expr_from_list (init, ELK_INIT);
+ init = build_x_compound_expr_from_list (init, ELK_INIT,
+ tf_warning_or_error);
if (describable_type (init))
{
type = TREE_TYPE (decl) = do_auto_deduction (type, init, auto_node);
@@ -5871,8 +5872,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
but [cd]tors are never actually compiled directly. We need
to put statics on the list so we can deal with the label
address extension. */
- cfun->local_decls = tree_cons (NULL_TREE, decl,
- cfun->local_decls);
+ add_local_decl (cfun, decl);
}
/* Convert the initializer to the type of DECL, if we have not
@@ -6810,11 +6810,11 @@ grokfndecl (tree ctype,
{
tree parm;
parm = build_this_parm (type, quals);
- TREE_CHAIN (parm) = parms;
+ DECL_CHAIN (parm) = parms;
parms = parm;
}
DECL_ARGUMENTS (decl) = parms;
- for (t = parms; t; t = TREE_CHAIN (t))
+ for (t = parms; t; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = decl;
/* Propagate volatile out from type to decl. */
if (TYPE_VOLATILE (type))
@@ -7314,7 +7314,7 @@ build_ptrmemfunc_type (tree type)
field = build_decl (input_location, FIELD_DECL, delta_identifier,
delta_type_node);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node);
@@ -9238,7 +9238,7 @@ grokdeclarator (const cp_declarator *declarator,
{
tree decl = cp_build_parm_decl (NULL_TREE, TREE_VALUE (args));
- TREE_CHAIN (decl) = decls;
+ DECL_CHAIN (decl) = decls;
decls = decl;
}
@@ -9870,7 +9870,7 @@ grokdeclarator (const cp_declarator *declarator,
static void
require_complete_types_for_parms (tree parms)
{
- for (; parms; parms = TREE_CHAIN (parms))
+ for (; parms; parms = DECL_CHAIN (parms))
{
if (dependent_type_p (TREE_TYPE (parms)))
continue;
@@ -10140,7 +10140,7 @@ grokparms (tree parmlist, tree *parms)
&& TREE_CHAIN (parm) != void_list_node)
error ("parameter packs must be at the end of the parameter list");
- TREE_CHAIN (decl) = decls;
+ DECL_CHAIN (decl) = decls;
decls = decl;
result = tree_cons (init, type, result);
}
@@ -12151,11 +12151,11 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
/* Constructors and destructors need to know whether they're "in
charge" of initializing virtual base classes. */
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
if (DECL_HAS_IN_CHARGE_PARM_P (decl1))
{
current_in_charge_parm = t;
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
}
if (DECL_HAS_VTT_PARM_P (decl1))
{
@@ -12366,7 +12366,7 @@ store_parm_decls (tree current_function_parms)
for (parm = specparms; parm; parm = next)
{
- next = TREE_CHAIN (parm);
+ next = DECL_CHAIN (parm);
if (TREE_CODE (parm) == PARM_DECL)
{
if (DECL_NAME (parm) == NULL_TREE
@@ -12806,7 +12806,7 @@ finish_function (int flags)
for (decl = DECL_ARGUMENTS (fndecl);
decl;
- decl = TREE_CHAIN (decl))
+ decl = DECL_CHAIN (decl))
if (TREE_USED (decl)
&& TREE_CODE (decl) == PARM_DECL
&& !DECL_READ_P (decl)
@@ -12949,7 +12949,7 @@ grokmethod (cp_decl_specifier_seq *declspecs,
if (! DECL_FRIEND_P (fndecl))
{
- if (TREE_CHAIN (fndecl))
+ if (DECL_CHAIN (fndecl))
{
fndecl = copy_node (fndecl);
TREE_CHAIN (fndecl) = NULL_TREE;
@@ -13145,7 +13145,7 @@ revert_static_member_fn (tree decl)
error ("static member function %q#D declared with type qualifiers", decl);
if (DECL_ARGUMENTS (decl))
- DECL_ARGUMENTS (decl) = TREE_CHAIN (DECL_ARGUMENTS (decl));
+ DECL_ARGUMENTS (decl) = DECL_CHAIN (DECL_ARGUMENTS (decl));
DECL_STATIC_FUNCTION_P (decl) = 1;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index ce54c79f20e..a768877b1a8 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -242,7 +242,7 @@ maybe_retrofit_in_chrg (tree fn)
basetype = TREE_TYPE (TREE_VALUE (arg_types));
arg_types = TREE_CHAIN (arg_types);
- parms = TREE_CHAIN (DECL_ARGUMENTS (fn));
+ parms = DECL_CHAIN (DECL_ARGUMENTS (fn));
/* If this is a subobject constructor or destructor, our caller will
pass us a pointer to our VTT. */
@@ -251,7 +251,7 @@ maybe_retrofit_in_chrg (tree fn)
parm = build_artificial_parm (vtt_parm_identifier, vtt_parm_type);
/* First add it to DECL_ARGUMENTS between 'this' and the real args... */
- TREE_CHAIN (parm) = parms;
+ DECL_CHAIN (parm) = parms;
parms = parm;
/* ...and then to TYPE_ARG_TYPES. */
@@ -262,12 +262,12 @@ maybe_retrofit_in_chrg (tree fn)
/* Then add the in-charge parm (before the VTT parm). */
parm = build_artificial_parm (in_charge_identifier, integer_type_node);
- TREE_CHAIN (parm) = parms;
+ DECL_CHAIN (parm) = parms;
parms = parm;
arg_types = hash_tree_chain (integer_type_node, arg_types);
/* Insert our new parameter(s) into the list. */
- TREE_CHAIN (DECL_ARGUMENTS (fn)) = parms;
+ DECL_CHAIN (DECL_ARGUMENTS (fn)) = parms;
/* And rebuild the function type. */
fntype = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (fn)),
@@ -1321,7 +1321,7 @@ build_anon_union_vars (tree type, tree object)
for (field = TYPE_FIELDS (type);
field != NULL_TREE;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
{
tree decl;
tree ref;
@@ -1826,7 +1826,7 @@ maybe_emit_vtables (tree ctype)
determine_key_method (ctype);
/* See if any of the vtables are needed. */
- for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = TREE_CHAIN (vtbl))
+ for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = DECL_CHAIN (vtbl))
{
import_export_decl (vtbl);
if (DECL_NOT_REALLY_EXTERN (vtbl) && decl_needed_p (vtbl))
@@ -1845,7 +1845,7 @@ maybe_emit_vtables (tree ctype)
/* The ABI requires that we emit all of the vtables if we emit any
of them. */
- for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = TREE_CHAIN (vtbl))
+ for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = DECL_CHAIN (vtbl))
{
/* Mark entities references from the virtual table as used. */
mark_vtable_entries (vtbl);
@@ -2242,7 +2242,7 @@ constrain_class_visibility (tree type)
if (CLASSTYPE_VISIBILITY_SPECIFIED (type))
vis = VISIBILITY_INTERNAL;
- for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node)
{
tree ftype = strip_pointer_or_array_types (TREE_TYPE (t));
@@ -2868,7 +2868,7 @@ start_static_storage_duration_function (unsigned count)
DECL_CONTEXT (priority_decl) = ssdf_decl;
TREE_USED (priority_decl) = 1;
- TREE_CHAIN (initialize_p_decl) = priority_decl;
+ DECL_CHAIN (initialize_p_decl) = priority_decl;
DECL_ARGUMENTS (ssdf_decl) = initialize_p_decl;
/* Put the function in the global scope. */
@@ -2966,7 +2966,7 @@ fix_temporary_vars_context_r (tree *node,
{
tree var;
- for (var = BIND_EXPR_VARS (*node); var; var = TREE_CHAIN (var))
+ for (var = BIND_EXPR_VARS (*node); var; var = DECL_CHAIN (var))
if (TREE_CODE (var) == VAR_DECL
&& !DECL_NAME (var)
&& DECL_ARTIFICIAL (var)
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 1902a135b89..cff822a55c1 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1247,7 +1247,7 @@ dump_function_decl (tree t, int flags)
tree exceptions;
VEC(tree,gc) *typenames = NULL;
- if (LAMBDA_FUNCTION_P (t))
+ if (DECL_NAME (t) && LAMBDA_FUNCTION_P (t))
{
/* A lambda's signature is essentially its "type", so defer. */
gcc_assert (LAMBDA_TYPE_P (DECL_CONTEXT (t)));
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 85ad582f2d1..d796fd0822c 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -184,7 +184,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
VEC(constructor_elt,gc) *v = NULL;
/* Iterate over the fields, building initializations. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -337,7 +337,7 @@ build_value_init_noctor (tree type)
VEC(constructor_elt,gc) *v = NULL;
/* Iterate over the fields, building initializations. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
tree ftype, value;
@@ -525,7 +525,8 @@ perform_member_init (tree member, tree init)
else if (TREE_CODE (init) == TREE_LIST)
/* There was an explicit member initialization. Do some work
in that case. */
- init = build_x_compound_expr_from_list (init, ELK_MEM_INIT);
+ init = build_x_compound_expr_from_list (init, ELK_MEM_INIT,
+ tf_warning_or_error);
if (init)
finish_expr_stmt (cp_build_modify_expr (decl, INIT_EXPR, init,
@@ -562,27 +563,29 @@ build_field_list (tree t, tree list, int *uses_unions_p)
if (TREE_CODE (t) == UNION_TYPE)
*uses_unions_p = 1;
- for (fields = TYPE_FIELDS (t); fields; fields = TREE_CHAIN (fields))
+ for (fields = TYPE_FIELDS (t); fields; fields = DECL_CHAIN (fields))
{
+ tree fieldtype;
+
/* Skip CONST_DECLs for enumeration constants and so forth. */
if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
continue;
+ fieldtype = TREE_TYPE (fields);
/* Keep track of whether or not any fields are unions. */
- if (TREE_CODE (TREE_TYPE (fields)) == UNION_TYPE)
+ if (TREE_CODE (fieldtype) == UNION_TYPE)
*uses_unions_p = 1;
/* For an anonymous struct or union, we must recursively
consider the fields of the anonymous type. They can be
directly initialized from the constructor. */
- if (ANON_AGGR_TYPE_P (TREE_TYPE (fields)))
+ if (ANON_AGGR_TYPE_P (fieldtype))
{
/* Add this field itself. Synthesized copy constructors
initialize the entire aggregate. */
list = tree_cons (fields, NULL_TREE, list);
/* And now add the fields in the anonymous aggregate. */
- list = build_field_list (TREE_TYPE (fields), list,
- uses_unions_p);
+ list = build_field_list (fieldtype, list, uses_unions_p);
}
/* Add this field. */
else if (DECL_NAME (fields))
@@ -708,38 +711,54 @@ sort_mem_initializers (tree t, tree mem_inits)
If a ctor-initializer specifies more than one mem-initializer for
multiple members of the same union (including members of
- anonymous unions), the ctor-initializer is ill-formed. */
+ anonymous unions), the ctor-initializer is ill-formed.
+
+ Here we also splice out uninitialized union members. */
if (uses_unions_p)
{
tree last_field = NULL_TREE;
- for (init = sorted_inits; init; init = TREE_CHAIN (init))
+ tree *p;
+ for (p = &sorted_inits; *p; )
{
tree field;
- tree field_type;
+ tree ctx;
int done;
- /* Skip uninitialized members and base classes. */
- if (!TREE_VALUE (init)
- || TREE_CODE (TREE_PURPOSE (init)) != FIELD_DECL)
- continue;
+ init = *p;
+
+ field = TREE_PURPOSE (init);
+
+ /* Skip base classes. */
+ if (TREE_CODE (field) != FIELD_DECL)
+ goto next;
+
+ /* If this is an anonymous union with no explicit initializer,
+ splice it out. */
+ if (!TREE_VALUE (init) && ANON_UNION_TYPE_P (TREE_TYPE (field)))
+ goto splice;
+
/* See if this field is a member of a union, or a member of a
structure contained in a union, etc. */
- field = TREE_PURPOSE (init);
- for (field_type = DECL_CONTEXT (field);
- !same_type_p (field_type, t);
- field_type = TYPE_CONTEXT (field_type))
- if (TREE_CODE (field_type) == UNION_TYPE)
+ for (ctx = DECL_CONTEXT (field);
+ !same_type_p (ctx, t);
+ ctx = TYPE_CONTEXT (ctx))
+ if (TREE_CODE (ctx) == UNION_TYPE)
break;
/* If this field is not a member of a union, skip it. */
- if (TREE_CODE (field_type) != UNION_TYPE)
- continue;
+ if (TREE_CODE (ctx) != UNION_TYPE)
+ goto next;
+
+ /* If this union member has no explicit initializer, splice
+ it out. */
+ if (!TREE_VALUE (init))
+ goto splice;
/* It's only an error if we have two initializers for the same
union type. */
if (!last_field)
{
last_field = field;
- continue;
+ goto next;
}
/* See if LAST_FIELD and the field initialized by INIT are
@@ -750,41 +769,48 @@ sort_mem_initializers (tree t, tree mem_inits)
union { struct { int i; int j; }; };
initializing both `i' and `j' makes sense. */
- field_type = DECL_CONTEXT (field);
+ ctx = DECL_CONTEXT (field);
done = 0;
do
{
- tree last_field_type;
+ tree last_ctx;
- last_field_type = DECL_CONTEXT (last_field);
+ last_ctx = DECL_CONTEXT (last_field);
while (1)
{
- if (same_type_p (last_field_type, field_type))
+ if (same_type_p (last_ctx, ctx))
{
- if (TREE_CODE (field_type) == UNION_TYPE)
+ if (TREE_CODE (ctx) == UNION_TYPE)
error_at (DECL_SOURCE_LOCATION (current_function_decl),
"initializations for multiple members of %qT",
- last_field_type);
+ last_ctx);
done = 1;
break;
}
- if (same_type_p (last_field_type, t))
+ if (same_type_p (last_ctx, t))
break;
- last_field_type = TYPE_CONTEXT (last_field_type);
+ last_ctx = TYPE_CONTEXT (last_ctx);
}
/* If we've reached the outermost class, then we're
done. */
- if (same_type_p (field_type, t))
+ if (same_type_p (ctx, t))
break;
- field_type = TYPE_CONTEXT (field_type);
+ ctx = TYPE_CONTEXT (ctx);
}
while (!done);
last_field = field;
+
+ next:
+ p = &TREE_CHAIN (*p);
+ continue;
+ splice:
+ *p = TREE_CHAIN (*p);
+ continue;
}
}
@@ -1005,7 +1031,7 @@ construct_virtual_base (tree vbase, tree arguments)
in the outer block.) We trust the back end to figure out
that the FLAG will not change across initializations, and
avoid doing multiple tests. */
- flag = TREE_CHAIN (DECL_ARGUMENTS (current_function_decl));
+ flag = DECL_CHAIN (DECL_ARGUMENTS (current_function_decl));
inner_if_stmt = begin_if_stmt ();
finish_if_stmt_cond (flag, inner_if_stmt);
@@ -1374,7 +1400,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
release_tree_vector (parms);
if (TREE_SIDE_EFFECTS (rval))
- finish_expr_stmt (convert_to_void (rval, NULL, complain));
+ finish_expr_stmt (convert_to_void (rval, ICV_CAST, complain));
}
/* This function is responsible for initializing EXP with INIT
@@ -1507,18 +1533,9 @@ build_offset_ref (tree type, tree member, bool address_p)
if (TREE_CODE (member) == TEMPLATE_DECL)
return member;
- if (dependent_type_p (type) || type_dependent_expression_p (member))
- {
- tree ref, mem_type = NULL_TREE;
- if (!dependent_scope_p (type))
- mem_type = TREE_TYPE (member);
- ref = build_qualified_name (mem_type, type, member,
+ if (dependent_scope_p (type) || type_dependent_expression_p (member))
+ return build_qualified_name (NULL_TREE, type, member,
/*template_p=*/false);
- /* Undo convert_from_reference. */
- if (TREE_CODE (ref) == INDIRECT_REF)
- ref = TREE_OPERAND (ref, 0);
- return ref;
- }
gcc_assert (TYPE_P (type));
if (! is_class_type (type, 1))
@@ -1528,6 +1545,7 @@ build_offset_ref (tree type, tree member, bool address_p)
/* Callers should call mark_used before this point. */
gcc_assert (!DECL_P (member) || TREE_USED (member));
+ type = TYPE_MAIN_VARIANT (type);
if (!COMPLETE_OR_OPEN_TYPE_P (complete_type (type)))
{
error ("incomplete type %qT does not have member %qD", type, member);
@@ -1798,7 +1816,7 @@ diagnose_uninitialized_cst_or_ref_member_1 (tree type, tree origin,
if (type_has_user_provided_constructor (type))
return 0;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
tree field_type;
@@ -2016,10 +2034,8 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
}
alloc_fn = OVL_CURRENT (alloc_fn);
class_addr = build1 (ADDR_EXPR, jclass_node, class_decl);
- alloc_call = (cp_build_function_call
- (alloc_fn,
- build_tree_list (NULL_TREE, class_addr),
- complain));
+ alloc_call = cp_build_function_call_nary (alloc_fn, complain,
+ class_addr, NULL_TREE);
}
else if (TYPE_FOR_JAVA (elt_type) && MAYBE_CLASS_TYPE_P (elt_type))
{
@@ -2561,7 +2577,7 @@ build_java_class_ref (tree type)
/* Mangle the class$ field. */
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (DECL_NAME (field) == CL_suffix)
{
mangle_decl (field);
@@ -2726,7 +2742,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
/* Pre-evaluate the SAVE_EXPR outside of the BIND_EXPR. */
body = build2 (COMPOUND_EXPR, void_type_node, base, body);
- return convert_to_void (body, /*implicit=*/NULL, tf_warning_or_error);
+ return convert_to_void (body, ICV_CAST, tf_warning_or_error);
}
/* Create an unnamed variable of the indicated TYPE. */
@@ -3361,21 +3377,27 @@ push_base_cleanups (void)
finish_decl_cleanup (NULL_TREE, expr);
}
+ /* Don't automatically destroy union members. */
+ if (TREE_CODE (current_class_type) == UNION_TYPE)
+ return;
+
for (member = TYPE_FIELDS (current_class_type); member;
- member = TREE_CHAIN (member))
+ member = DECL_CHAIN (member))
{
- if (TREE_TYPE (member) == error_mark_node
+ tree this_type = TREE_TYPE (member);
+ if (this_type == error_mark_node
|| TREE_CODE (member) != FIELD_DECL
|| DECL_ARTIFICIAL (member))
continue;
- if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (member)))
+ if (ANON_UNION_TYPE_P (this_type))
+ continue;
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (this_type))
{
tree this_member = (build_class_member_access_expr
(current_class_ref, member,
/*access_path=*/NULL_TREE,
/*preserve_reference=*/false,
tf_warning_or_error));
- tree this_type = TREE_TYPE (member);
expr = build_delete (this_type, this_member,
sfk_complete_destructor,
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL,
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index e8259521adb..a47dfa8babf 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -346,11 +346,19 @@ canonicalize_for_substitution (tree node)
if (TYPE_P (node)
&& TYPE_CANONICAL (node) != node
&& TYPE_MAIN_VARIANT (node) != node)
+ {
/* Here we want to strip the topmost typedef only.
We need to do that so is_std_substitution can do proper
name matching. */
- node = cp_build_qualified_type (TYPE_MAIN_VARIANT (node),
- cp_type_quals (node));
+ if (TREE_CODE (node) == FUNCTION_TYPE)
+ /* Use build_qualified_type and TYPE_QUALS here to preserve
+ the old buggy mangling of attribute noreturn with abi<5. */
+ node = build_qualified_type (TYPE_MAIN_VARIANT (node),
+ TYPE_QUALS (node));
+ else
+ node = cp_build_qualified_type (TYPE_MAIN_VARIANT (node),
+ cp_type_quals (node));
+ }
return node;
}
@@ -1281,7 +1289,7 @@ nested_anon_class_index (tree type)
{
int index = 0;
tree member = TYPE_FIELDS (TYPE_CONTEXT (type));
- for (; member; member = TREE_CHAIN (member))
+ for (; member; member = DECL_CHAIN (member))
if (DECL_IMPLICIT_TYPEDEF_P (member))
{
tree memtype = TREE_TYPE (member);
@@ -1711,7 +1719,7 @@ write_local_name (tree function, const tree local_entity,
{
tree t;
int i = 0;
- for (t = DECL_ARGUMENTS (function); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (function); t; t = DECL_CHAIN (t))
{
if (t == parm)
i = 1;
@@ -1776,6 +1784,7 @@ write_type (tree type)
if (type == error_mark_node)
return;
+ type = canonicalize_for_substitution (type);
if (find_substitution (type))
return;
@@ -1978,6 +1987,12 @@ write_CV_qualifiers_for_type (const tree type)
array. */
cp_cv_quals quals = TYPE_QUALS (type);
+ /* Attribute const/noreturn are not reflected in mangling. */
+ if (abi_version_at_least (5)
+ && (TREE_CODE (type) == FUNCTION_TYPE
+ || TREE_CODE (type) == METHOD_TYPE))
+ return 0;
+
if (quals & TYPE_QUAL_RESTRICT)
{
write_char ('r');
@@ -2288,12 +2303,12 @@ write_method_parms (tree parm_types, const int method_p, const tree decl)
if (method_p)
{
parm_types = TREE_CHAIN (parm_types);
- parm_decl = parm_decl ? TREE_CHAIN (parm_decl) : NULL_TREE;
+ parm_decl = parm_decl ? DECL_CHAIN (parm_decl) : NULL_TREE;
while (parm_decl && DECL_ARTIFICIAL (parm_decl))
{
parm_types = TREE_CHAIN (parm_types);
- parm_decl = TREE_CHAIN (parm_decl);
+ parm_decl = DECL_CHAIN (parm_decl);
}
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index ad41e9acc57..b9511f5a628 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -103,7 +103,7 @@ make_thunk (tree function, bool this_adjusting,
/* See if we already have the thunk in question. For this_adjusting
thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it
will be a BINFO. */
- for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk))
+ for (thunk = DECL_THUNKS (function); thunk; thunk = DECL_CHAIN (thunk))
if (DECL_THIS_THUNK_P (thunk) == this_adjusting
&& THUNK_FIXED_OFFSET (thunk) == d
&& !virtual_offset == !THUNK_VIRTUAL_OFFSET (thunk)
@@ -156,7 +156,7 @@ make_thunk (tree function, bool this_adjusting,
DECL_TEMPLATE_INFO (thunk) = NULL;
/* Add it to the list of thunks associated with FUNCTION. */
- TREE_CHAIN (thunk) = DECL_THUNKS (function);
+ DECL_CHAIN (thunk) = DECL_THUNKS (function);
DECL_THUNKS (function) = thunk;
return thunk;
@@ -188,7 +188,7 @@ finish_thunk (tree thunk)
tree cov_probe;
for (cov_probe = DECL_THUNKS (function);
- cov_probe; cov_probe = TREE_CHAIN (cov_probe))
+ cov_probe; cov_probe = DECL_CHAIN (cov_probe))
if (DECL_NAME (cov_probe) == name)
{
gcc_assert (!DECL_THUNKS (thunk));
@@ -364,10 +364,10 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* Set up cloned argument trees for the thunk. */
t = NULL_TREE;
- for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a))
+ for (a = DECL_ARGUMENTS (function); a; a = DECL_CHAIN (a))
{
tree x = copy_node (a);
- TREE_CHAIN (x) = t;
+ DECL_CHAIN (x) = t;
DECL_CONTEXT (x) = thunk_fndecl;
SET_DECL_RTL (x, NULL);
DECL_HAS_VALUE_EXPR_P (x) = 0;
@@ -529,7 +529,7 @@ do_build_copy_constructor (tree fndecl)
member_init_list);
}
- for (; fields; fields = TREE_CHAIN (fields))
+ for (; fields; fields = DECL_CHAIN (fields))
{
tree field = fields;
tree expr_type;
@@ -545,7 +545,8 @@ do_build_copy_constructor (tree fndecl)
}
else if (ANON_AGGR_TYPE_P (expr_type) && TYPE_FIELDS (expr_type))
/* Just use the field; anonymous types can't have
- nontrivial copy ctors or assignment ops. */;
+ nontrivial copy ctors or assignment ops or this
+ function would be deleted. */;
else
continue;
@@ -578,7 +579,7 @@ do_build_copy_constructor (tree fndecl)
static void
do_build_copy_assign (tree fndecl)
{
- tree parm = TREE_CHAIN (DECL_ARGUMENTS (fndecl));
+ tree parm = DECL_CHAIN (DECL_ARGUMENTS (fndecl));
tree compound_stmt;
bool move_p = move_fn_p (fndecl);
bool trivial = trivial_fn_p (fndecl);
@@ -629,7 +630,7 @@ do_build_copy_assign (tree fndecl)
/* Assign to each of the non-static data members. */
for (fields = TYPE_FIELDS (current_class_type);
fields;
- fields = TREE_CHAIN (fields))
+ fields = DECL_CHAIN (fields))
{
tree comp = current_class_ref;
tree init = parm;
@@ -663,7 +664,8 @@ do_build_copy_assign (tree fndecl)
else if (ANON_AGGR_TYPE_P (expr_type)
&& TYPE_FIELDS (expr_type) != NULL_TREE)
/* Just use the field; anonymous types can't have
- nontrivial copy ctors or assignment ops. */;
+ nontrivial copy ctors or assignment ops or this
+ function would be deleted. */;
else
continue;
@@ -912,8 +914,19 @@ process_subob_fn (tree fn, bool move_p, tree *spec_p, bool *trivial_p,
*spec_p = merge_exception_specifiers (*spec_p, raises);
}
- if (trivial_p && !trivial_fn_p (fn))
- *trivial_p = false;
+ if (!trivial_fn_p (fn))
+ {
+ if (trivial_p)
+ *trivial_p = false;
+ if (TREE_CODE (arg) == FIELD_DECL
+ && TREE_CODE (DECL_CONTEXT (arg)) == UNION_TYPE)
+ {
+ if (deleted_p)
+ *deleted_p = true;
+ if (msg)
+ error ("union member %q+D with non-trivial %qD", arg, fn);
+ }
+ }
if (move_p && !move_fn_p (fn) && !trivial_fn_p (fn))
{
@@ -929,6 +942,99 @@ process_subob_fn (tree fn, bool move_p, tree *spec_p, bool *trivial_p,
*deleted_p = true;
}
+/* Subroutine of synthesized_method_walk to allow recursion into anonymous
+ aggregates. */
+
+static void
+walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
+ int quals, bool copy_arg_p, bool move_p,
+ bool assign_p, tree *spec_p, bool *trivial_p,
+ bool *deleted_p, const char *msg,
+ int flags, tsubst_flags_t complain)
+{
+ tree field;
+ for (field = fields; field; field = DECL_CHAIN (field))
+ {
+ tree mem_type, argtype, rval;
+
+ if (TREE_CODE (field) != FIELD_DECL
+ || DECL_ARTIFICIAL (field))
+ continue;
+
+ mem_type = strip_array_types (TREE_TYPE (field));
+ if (assign_p)
+ {
+ bool bad = true;
+ if (CP_TYPE_CONST_P (mem_type) && !CLASS_TYPE_P (mem_type))
+ {
+ if (msg)
+ error ("non-static const member %q#D, can't use default "
+ "assignment operator", field);
+ }
+ else if (TREE_CODE (mem_type) == REFERENCE_TYPE)
+ {
+ if (msg)
+ error ("non-static reference member %q#D, can't use "
+ "default assignment operator", field);
+ }
+ else
+ bad = false;
+
+ if (bad && deleted_p)
+ *deleted_p = true;
+ }
+ else if (sfk == sfk_constructor)
+ {
+ bool bad = true;
+ if (CP_TYPE_CONST_P (mem_type)
+ && (!CLASS_TYPE_P (mem_type)
+ || !type_has_user_provided_default_constructor (mem_type)))
+ {
+ if (msg)
+ error ("uninitialized non-static const member %q#D",
+ field);
+ }
+ else if (TREE_CODE (mem_type) == REFERENCE_TYPE)
+ {
+ if (msg)
+ error ("uninitialized non-static reference member %q#D",
+ field);
+ }
+ else
+ bad = false;
+
+ if (bad && deleted_p)
+ *deleted_p = true;
+ }
+
+ if (!CLASS_TYPE_P (mem_type))
+ continue;
+
+ if (ANON_AGGR_TYPE_P (mem_type))
+ {
+ walk_field_subobs (TYPE_FIELDS (mem_type), fnname, sfk, quals,
+ copy_arg_p, move_p, assign_p, spec_p, trivial_p,
+ deleted_p, msg, flags, complain);
+ continue;
+ }
+
+ if (copy_arg_p)
+ {
+ int mem_quals = cp_type_quals (mem_type) | quals;
+ if (DECL_MUTABLE_P (field))
+ mem_quals &= ~TYPE_QUAL_CONST;
+ argtype = build_stub_type (mem_type, mem_quals, move_p);
+ }
+ else
+ argtype = NULL_TREE;
+
+ rval = locate_fn_flags (mem_type, fnname, argtype, flags, complain);
+
+ process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
+ msg, field);
+ }
+}
+
/* The caller wants to generate an implicit declaration of SFK for CTYPE
which is const if relevant and CONST_P is set. If spec_p, trivial_p and
deleted_p are non-null, set their referent appropriately. If diag is
@@ -940,7 +1046,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
tree *spec_p, bool *trivial_p, bool *deleted_p,
bool diag)
{
- tree binfo, base_binfo, field, scope, fnname, rval, argtype;
+ tree binfo, base_binfo, scope, fnname, rval, argtype;
bool move_p, copy_arg_p, assign_p, expected_trivial, check_vdtor;
VEC(tree,gc) *vbases;
int i, quals, flags;
@@ -1004,6 +1110,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
#endif
assign_p = false;
+ check_vdtor = false;
switch (sfk)
{
case sfk_move_assignment:
@@ -1051,6 +1158,15 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
quals = TYPE_UNQUALIFIED;
argtype = NULL_TREE;
+ if (!diag)
+ msg = NULL;
+ else if (assign_p)
+ msg = ("base %qT does not have a move assignment operator or trivial "
+ "copy assignment operator");
+ else
+ msg = ("base %qT does not have a move constructor or trivial "
+ "copy constructor");
+
for (binfo = TYPE_BINFO (ctype), i = 0;
BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
{
@@ -1059,15 +1175,6 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
argtype = build_stub_type (basetype, quals, move_p);
rval = locate_fn_flags (base_binfo, fnname, argtype, flags, complain);
- if (!diag)
- msg = NULL;
- else if (assign_p)
- msg = ("base %qT does not have a move assignment operator or trivial "
- "copy assignment operator");
- else
- msg = ("base %qT does not have a move constructor or trivial "
- "copy constructor");
-
process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
msg, BINFO_TYPE (base_binfo));
@@ -1093,105 +1200,31 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
*deleted_p = true;
}
else if (!assign_p)
- for (i = 0; VEC_iterate (tree, vbases, i, base_binfo); ++i)
- {
- if (copy_arg_p)
- argtype = build_stub_type (BINFO_TYPE (base_binfo), quals, move_p);
- rval = locate_fn_flags (base_binfo, fnname, argtype, flags, complain);
-
- if (!diag)
- msg = NULL;
- else if (assign_p)
- msg = ("virtual base %qT does not have a move assignment "
- "operator or trivial copy assignment operator");
- else
- msg = ("virtual base %qT does not have a move constructor "
- "or trivial copy constructor");
-
- process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
- msg, BINFO_TYPE (base_binfo));
- }
-
- for (field = TYPE_FIELDS (ctype); field; field = TREE_CHAIN (field))
{
- tree mem_type;
-
- if (TREE_CODE (field) != FIELD_DECL
- || DECL_ARTIFICIAL (field))
- continue;
-
- mem_type = strip_array_types (TREE_TYPE (field));
- if (assign_p)
+ if (diag)
+ msg = ("virtual base %qT does not have a move constructor "
+ "or trivial copy constructor");
+ for (i = 0; VEC_iterate (tree, vbases, i, base_binfo); ++i)
{
- bool bad = true;
- if (CP_TYPE_CONST_P (mem_type) && !CLASS_TYPE_P (mem_type))
- {
- if (diag)
- error ("non-static const member %q#D, can't use default "
- "assignment operator", field);
- }
- else if (TREE_CODE (mem_type) == REFERENCE_TYPE)
- {
- if (diag)
- error ("non-static reference member %q#D, can't use "
- "default assignment operator", field);
- }
- else
- bad = false;
+ if (copy_arg_p)
+ argtype = build_stub_type (BINFO_TYPE (base_binfo), quals, move_p);
+ rval = locate_fn_flags (base_binfo, fnname, argtype, flags, complain);
- if (bad && deleted_p)
- *deleted_p = true;
+ process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
+ msg, BINFO_TYPE (base_binfo));
}
- else if (sfk == sfk_constructor)
- {
- bool bad = true;
- if (CP_TYPE_CONST_P (mem_type)
- && (!CLASS_TYPE_P (mem_type)
- || !type_has_user_provided_default_constructor (mem_type)))
- {
- if (diag)
- error ("uninitialized non-static const member %q#D",
- field);
- }
- else if (TREE_CODE (mem_type) == REFERENCE_TYPE)
- {
- if (diag)
- error ("uninitialized non-static reference member %q#D",
- field);
- }
- else
- bad = false;
-
- if (bad && deleted_p)
- *deleted_p = true;
- }
-
- if (!CLASS_TYPE_P (mem_type)
- || ANON_AGGR_TYPE_P (mem_type))
- continue;
-
- if (copy_arg_p)
- {
- int mem_quals = cp_type_quals (mem_type) | quals;
- if (DECL_MUTABLE_P (field))
- mem_quals &= ~TYPE_QUAL_CONST;
- argtype = build_stub_type (mem_type, mem_quals, move_p);
- }
-
- rval = locate_fn_flags (mem_type, fnname, argtype, flags, complain);
-
- if (!diag)
- msg = NULL;
- else if (assign_p)
- msg = ("non-static data member %qD does not have a move "
- "assignment operator or trivial copy assignment operator");
- else
- msg = ("non-static data member %qD does not have a move "
- "constructor or trivial copy constructor");
-
- process_subob_fn (rval, move_p, spec_p, trivial_p, deleted_p,
- msg, field);
}
+ if (!diag)
+ /* Leave msg null. */;
+ else if (assign_p)
+ msg = ("non-static data member %qD does not have a move "
+ "assignment operator or trivial copy assignment operator");
+ else
+ msg = ("non-static data member %qD does not have a move "
+ "constructor or trivial copy constructor");
+ walk_field_subobs (TYPE_FIELDS (ctype), fnname, sfk, quals,
+ copy_arg_p, move_p, assign_p, spec_p, trivial_p,
+ deleted_p, msg, flags, complain);
pop_scope (scope);
@@ -1399,7 +1432,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
}
/* Add the "this" parameter. */
this_parm = build_this_parm (fn_type, TYPE_UNQUALIFIED);
- TREE_CHAIN (this_parm) = DECL_ARGUMENTS (fn);
+ DECL_CHAIN (this_parm) = DECL_ARGUMENTS (fn);
DECL_ARGUMENTS (fn) = this_parm;
grokclassfn (type, fn, kind == sfk_destructor ? DTOR_FLAG : NO_SPECIAL);
@@ -1592,7 +1625,7 @@ lazily_declare_fn (special_function_kind sfk, tree type)
"and may change in a future version of GCC due to "
"implicit virtual destructor",
type);
- TREE_CHAIN (fn) = TYPE_METHODS (type);
+ DECL_CHAIN (fn) = TYPE_METHODS (type);
TYPE_METHODS (type) = fn;
}
maybe_add_class_template_decl_list (type, fn, /*friend_p=*/0);
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 67131190305..c6e31c29445 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -542,7 +542,7 @@ add_decl_to_level (tree decl, cxx_scope *b)
if (TREE_CODE (decl) == NAMESPACE_DECL
&& !DECL_NAMESPACE_ALIAS (decl))
{
- TREE_CHAIN (decl) = b->namespaces;
+ DECL_CHAIN (decl) = b->namespaces;
b->namespaces = decl;
}
else
@@ -1017,10 +1017,22 @@ pushdecl_maybe_friend (tree x, bool is_friend)
/* Inline decls shadow nothing. */
&& !DECL_FROM_INLINE (x)
&& (TREE_CODE (oldlocal) == PARM_DECL
- || TREE_CODE (oldlocal) == VAR_DECL)
- /* Don't check the `this' parameter. */
- && !DECL_ARTIFICIAL (oldlocal)
- && !DECL_ARTIFICIAL (x))
+ || TREE_CODE (oldlocal) == VAR_DECL
+ /* If the old decl is a type decl, only warn if the
+ old decl is an explicit typedef or if both the old
+ and new decls are type decls. */
+ || (TREE_CODE (oldlocal) == TYPE_DECL
+ && (!DECL_ARTIFICIAL (oldlocal)
+ || TREE_CODE (x) == TYPE_DECL)))
+ /* Don't check the `this' parameter or internally generated
+ vars unless it's an implicit typedef (see
+ create_implicit_typedef in decl.c). */
+ && (!DECL_ARTIFICIAL (oldlocal)
+ || DECL_IMPLICIT_TYPEDEF_P (oldlocal))
+ /* Don't check for internally generated vars unless
+ it's an implicit typedef (see create_implicit_typedef
+ in decl.c). */
+ && (!DECL_ARTIFICIAL (x) || DECL_IMPLICIT_TYPEDEF_P (x)))
{
bool nowarn = false;
@@ -1081,10 +1093,12 @@ pushdecl_maybe_friend (tree x, bool is_friend)
/* Maybe warn if shadowing something else. */
else if (warn_shadow && !DECL_EXTERNAL (x)
- /* No shadow warnings for internally generated vars. */
- && ! DECL_ARTIFICIAL (x)
- /* No shadow warnings for vars made for inlining. */
- && ! DECL_FROM_INLINE (x))
+ /* No shadow warnings for internally generated vars unless
+ it's an implicit typedef (see create_implicit_typedef
+ in decl.c). */
+ && (! DECL_ARTIFICIAL (x) || DECL_IMPLICIT_TYPEDEF_P (x))
+ /* No shadow warnings for vars made for inlining. */
+ && ! DECL_FROM_INLINE (x))
{
tree member;
@@ -1103,7 +1117,13 @@ pushdecl_maybe_friend (tree x, bool is_friend)
x);
}
else if (oldglobal != NULL_TREE
- && TREE_CODE (oldglobal) == VAR_DECL)
+ && (TREE_CODE (oldglobal) == VAR_DECL
+ /* If the old decl is a type decl, only warn if the
+ old decl is an explicit typedef or if both the
+ old and new decls are type decls. */
+ || (TREE_CODE (oldglobal) == TYPE_DECL
+ && (!DECL_ARTIFICIAL (oldglobal)
+ || TREE_CODE (x) == TYPE_DECL))))
/* XXX shadow warnings in outer-more namespaces */
{
warning_at (input_location, OPT_Wshadow,
@@ -1973,7 +1993,7 @@ push_using_decl (tree scope, tree name)
timevar_push (TV_NAME_LOOKUP);
gcc_assert (TREE_CODE (scope) == NAMESPACE_DECL);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
- for (decl = current_binding_level->usings; decl; decl = TREE_CHAIN (decl))
+ for (decl = current_binding_level->usings; decl; decl = DECL_CHAIN (decl))
if (USING_DECL_SCOPE (decl) == scope && DECL_NAME (decl) == name)
break;
if (decl)
@@ -1981,7 +2001,7 @@ push_using_decl (tree scope, tree name)
namespace_bindings_p () ? decl : NULL_TREE);
decl = build_lang_decl (USING_DECL, name, NULL_TREE);
USING_DECL_SCOPE (decl) = scope;
- TREE_CHAIN (decl) = current_binding_level->usings;
+ DECL_CHAIN (decl) = current_binding_level->usings;
current_binding_level->usings = decl;
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
@@ -2137,7 +2157,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend)
for (d = &IDENTIFIER_BINDING (name)->scope->names;
*d;
- d = &TREE_CHAIN (*d))
+ d = &DECL_CHAIN (*d))
if (*d == old
|| (TREE_CODE (*d) == TREE_LIST
&& TREE_VALUE (*d) == old))
@@ -2148,7 +2168,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend)
else
/* Build a TREE_LIST to wrap the OVERLOAD. */
*d = tree_cons (NULL_TREE, new_binding,
- TREE_CHAIN (*d));
+ DECL_CHAIN (*d));
/* And update the cxx_binding node. */
IDENTIFIER_BINDING (name)->value = new_binding;
@@ -2706,7 +2726,7 @@ pushdecl_class_level (tree x)
aggregate, for naming purposes. */
tree f;
- for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = DECL_CHAIN (f))
{
location_t save_location = input_location;
input_location = DECL_SOURCE_LOCATION (f);
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 0196eaeb8b1..302a1332d66 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -107,12 +107,11 @@ clone_body (tree clone, tree fn, void *arg_map)
if (DECL_NAME (clone) == base_dtor_identifier
|| DECL_NAME (clone) == base_ctor_identifier)
{
- tree decls = DECL_STRUCT_FUNCTION (fn)->local_decls;
- for (; decls; decls = TREE_CHAIN (decls))
- {
- tree decl = TREE_VALUE (decls);
- walk_tree (&DECL_INITIAL (decl), copy_tree_body_r, &id, NULL);
- }
+ unsigned ix;
+ tree decl;
+
+ FOR_EACH_LOCAL_DECL (DECL_STRUCT_FUNCTION (fn), ix, decl)
+ walk_tree (&DECL_INITIAL (decl), copy_tree_body_r, &id, NULL);
}
append_to_statement_list_force (stmts, &DECL_SAVED_TREE (clone));
@@ -283,16 +282,16 @@ maybe_clone_body (tree fn)
clone_parm = DECL_ARGUMENTS (clone);
/* Update the `this' parameter, which is always first. */
update_cloned_parm (parm, clone_parm, first);
- parm = TREE_CHAIN (parm);
- clone_parm = TREE_CHAIN (clone_parm);
+ parm = DECL_CHAIN (parm);
+ clone_parm = DECL_CHAIN (clone_parm);
if (DECL_HAS_IN_CHARGE_PARM_P (fn))
- parm = TREE_CHAIN (parm);
+ parm = DECL_CHAIN (parm);
if (DECL_HAS_VTT_PARM_P (fn))
- parm = TREE_CHAIN (parm);
+ parm = DECL_CHAIN (parm);
if (DECL_HAS_VTT_PARM_P (clone))
- clone_parm = TREE_CHAIN (clone_parm);
+ clone_parm = DECL_CHAIN (clone_parm);
for (; parm;
- parm = TREE_CHAIN (parm), clone_parm = TREE_CHAIN (clone_parm))
+ parm = DECL_CHAIN (parm), clone_parm = DECL_CHAIN (clone_parm))
/* Update this parameter. */
update_cloned_parm (parm, clone_parm, first);
@@ -349,7 +348,7 @@ maybe_clone_body (tree fn)
clone_parm = DECL_ARGUMENTS (clone);
parm;
++parmno,
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
{
/* Map the in-charge parameter to an appropriate constant. */
if (DECL_HAS_IN_CHARGE_PARM_P (fn) && parmno == 1)
@@ -368,7 +367,7 @@ maybe_clone_body (tree fn)
{
DECL_ABSTRACT_ORIGIN (clone_parm) = parm;
*pointer_map_insert (decl_map, parm) = clone_parm;
- clone_parm = TREE_CHAIN (clone_parm);
+ clone_parm = DECL_CHAIN (clone_parm);
}
/* Otherwise, map the VTT parameter to `NULL'. */
else
@@ -380,7 +379,7 @@ maybe_clone_body (tree fn)
else
{
*pointer_map_insert (decl_map, parm) = clone_parm;
- clone_parm = TREE_CHAIN (clone_parm);
+ clone_parm = DECL_CHAIN (clone_parm);
}
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index e8f10a4d000..3fd96fbe06e 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2650,7 +2650,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser,
base_type = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (base_type);
for (field = TYPE_FIELDS (base_type);
field;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
if (TREE_CODE (field) == TYPE_DECL
&& DECL_NAME (field) == id)
{
@@ -3754,6 +3754,16 @@ cp_parser_primary_expression (cp_parser *parser,
case RID_AT_SELECTOR:
return cp_parser_objc_expression (parser);
+ case RID_TEMPLATE:
+ if (parser->in_function_body
+ && (cp_lexer_peek_nth_token (parser->lexer, 2)->type
+ == CPP_LESS))
+ {
+ error_at (token->location,
+ "a template declaration cannot appear at block scope");
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ return error_mark_node;
+ }
default:
cp_parser_error (parser, "expected primary-expression");
return error_mark_node;
@@ -7696,7 +7706,7 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
/* The function parameters must be in scope all the way until after the
trailing-return-type in case of decltype. */
- for (t = current_binding_level->names; t; t = TREE_CHAIN (t))
+ for (t = current_binding_level->names; t; t = DECL_CHAIN (t))
pop_binding (DECL_NAME (t), t);
leave_scope ();
@@ -14079,7 +14089,7 @@ cp_parser_init_declarator (cp_parser* parser,
`explicit' constructor is OK. Otherwise, an
`explicit' constructor cannot be used. */
((is_direct_init || !is_initialized)
- ? 0 : LOOKUP_ONLYCONVERTING));
+ ? LOOKUP_NORMAL : LOOKUP_IMPLICIT));
}
else if ((cxx_dialect != cxx98) && friend_p
&& decl && TREE_CODE (decl) == FUNCTION_DECL)
@@ -14368,7 +14378,7 @@ cp_parser_direct_declarator (cp_parser* parser,
}
/* Remove the function parms from scope. */
- for (t = current_binding_level->names; t; t = TREE_CHAIN (t))
+ for (t = current_binding_level->names; t; t = DECL_CHAIN (t))
pop_binding (DECL_NAME (t), t);
leave_scope();
@@ -19666,7 +19676,7 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
parmdecl = DECL_ARGUMENTS (fn);
parm && parm != void_list_node;
parm = TREE_CHAIN (parm),
- parmdecl = TREE_CHAIN (parmdecl))
+ parmdecl = DECL_CHAIN (parmdecl))
{
cp_token_cache *tokens;
tree default_arg = TREE_PURPOSE (parm);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 09d077ade06..7a331479d8b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -158,7 +158,7 @@ static tree tsubst_template_arg (tree, tree, tsubst_flags_t, tree);
static tree tsubst_template_args (tree, tree, tsubst_flags_t, tree);
static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
static void regenerate_decl_from_template (tree, tree);
-static tree most_specialized_class (tree, tree);
+static tree most_specialized_class (tree, tree, tsubst_flags_t);
static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int);
static tree tsubst_arg_types (tree, tree, tsubst_flags_t, tree);
static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree);
@@ -1566,31 +1566,43 @@ iterative_hash_template_arg (tree arg, hashval_t val)
gcc_assert (seen_error ());
return val;
+ case CAST_EXPR:
+ case STATIC_CAST_EXPR:
+ case REINTERPRET_CAST_EXPR:
+ case CONST_CAST_EXPR:
+ case DYNAMIC_CAST_EXPR:
+ case NEW_EXPR:
+ val = iterative_hash_template_arg (TREE_TYPE (arg), val);
+ /* Now hash operands as usual. */
+ break;
+
default:
- switch (tclass)
- {
- case tcc_type:
- if (TYPE_CANONICAL (arg))
- return iterative_hash_object (TYPE_HASH (TYPE_CANONICAL (arg)),
- val);
- else if (TREE_CODE (arg) == DECLTYPE_TYPE)
- return iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg), val);
- /* Otherwise just compare the types during lookup. */
- return val;
+ break;
+ }
- case tcc_declaration:
- case tcc_constant:
- return iterative_hash_expr (arg, val);
+ switch (tclass)
+ {
+ case tcc_type:
+ if (TYPE_CANONICAL (arg))
+ return iterative_hash_object (TYPE_HASH (TYPE_CANONICAL (arg)),
+ val);
+ else if (TREE_CODE (arg) == DECLTYPE_TYPE)
+ return iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg), val);
+ /* Otherwise just compare the types during lookup. */
+ return val;
- default:
- gcc_assert (IS_EXPR_CODE_CLASS (tclass));
- {
- unsigned n = TREE_OPERAND_LENGTH (arg);
- for (i = 0; i < n; ++i)
- val = iterative_hash_template_arg (TREE_OPERAND (arg, i), val);
- return val;
- }
- }
+ case tcc_declaration:
+ case tcc_constant:
+ return iterative_hash_expr (arg, val);
+
+ default:
+ gcc_assert (IS_EXPR_CODE_CLASS (tclass));
+ {
+ unsigned n = TREE_OPERAND_LENGTH (arg);
+ for (i = 0; i < n; ++i)
+ val = iterative_hash_template_arg (TREE_OPERAND (arg, i), val);
+ return val;
+ }
}
gcc_unreachable ();
return 0;
@@ -2553,7 +2565,7 @@ check_explicit_specialization (tree declarator,
definition, not in the original declaration. */
DECL_ARGUMENTS (result) = DECL_ARGUMENTS (decl);
for (parm = DECL_ARGUMENTS (result); parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
DECL_CONTEXT (parm) = result;
}
return register_specialization (tmpl, gen_tmpl, targs,
@@ -3831,6 +3843,7 @@ process_partial_specialization (tree decl)
tree inner_args = INNERMOST_TEMPLATE_ARGS (specargs);
tree main_inner_parms = DECL_INNERMOST_TEMPLATE_PARMS (maintmpl);
tree inner_parms;
+ tree inst;
int nargs = TREE_VEC_LENGTH (inner_args);
int ntparms;
int i;
@@ -4045,6 +4058,22 @@ process_partial_specialization (tree decl)
= tree_cons (specargs, inner_parms,
DECL_TEMPLATE_SPECIALIZATIONS (maintmpl));
TREE_TYPE (DECL_TEMPLATE_SPECIALIZATIONS (maintmpl)) = type;
+
+ for (inst = DECL_TEMPLATE_INSTANTIATIONS (maintmpl); inst;
+ inst = TREE_CHAIN (inst))
+ {
+ tree inst_type = TREE_VALUE (inst);
+ if (COMPLETE_TYPE_P (inst_type)
+ && CLASSTYPE_IMPLICIT_INSTANTIATION (inst_type))
+ {
+ tree spec = most_specialized_class (inst_type, maintmpl, tf_none);
+ if (spec && TREE_TYPE (spec) == type)
+ permerror (input_location,
+ "partial specialization of %qT after instantiation "
+ "of %qT", type, inst_type);
+ }
+ }
+
return decl;
}
@@ -4417,7 +4446,7 @@ push_template_decl_real (tree decl, bool is_friend)
TREE_VALUE (argtype) = error_mark_node;
}
- arg = TREE_CHAIN (arg);
+ arg = DECL_CHAIN (arg);
argtype = TREE_CHAIN (argtype);
}
@@ -7749,7 +7778,7 @@ instantiate_class_template (tree type)
/* Determine what specialization of the original template to
instantiate. */
- t = most_specialized_class (type, templ);
+ t = most_specialized_class (type, templ, tf_warning_or_error);
if (t == error_mark_node)
{
TYPE_BEING_DEFINED (type) = 1;
@@ -7803,7 +7832,8 @@ instantiate_class_template (tree type)
/* Set the input location to the most specialized template definition.
This is needed if tsubsting causes an error. */
typedecl = TYPE_MAIN_DECL (pattern);
- input_location = DECL_SOURCE_LOCATION (typedecl);
+ input_location = DECL_SOURCE_LOCATION (TYPE_NAME (type)) =
+ DECL_SOURCE_LOCATION (typedecl);
TYPE_HAS_USER_CONSTRUCTOR (type) = TYPE_HAS_USER_CONSTRUCTOR (pattern);
TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern);
@@ -8196,7 +8226,7 @@ instantiate_class_template (tree type)
any member functions. We don't do this earlier because the
default arguments may reference members of the class. */
if (!PRIMARY_TEMPLATE_P (templ))
- for (t = TYPE_METHODS (type); t; t = TREE_CHAIN (t))
+ for (t = TYPE_METHODS (type); t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == FUNCTION_DECL
/* Implicitly generated member functions will not have template
information; they are not instantiations, but instead are
@@ -8261,7 +8291,7 @@ make_fnparm_pack (tree spec_parm)
/* Fill in PARMVEC and PARMTYPEVEC with all of the parameters. */
parmvec = make_tree_vec (len);
parmtypevec = make_tree_vec (len);
- for (i = 0; i < len; i++, spec_parm = TREE_CHAIN (spec_parm))
+ for (i = 0; i < len; i++, spec_parm = DECL_CHAIN (spec_parm))
{
TREE_VEC_ELT (parmvec, i) = spec_parm;
TREE_VEC_ELT (parmtypevec, i) = TREE_TYPE (spec_parm);
@@ -8541,7 +8571,7 @@ get_pattern_parm (tree parm, tree tmpl)
if (DECL_ARTIFICIAL (parm))
{
for (patparm = DECL_ARGUMENTS (pattern);
- patparm; patparm = TREE_CHAIN (patparm))
+ patparm; patparm = DECL_CHAIN (patparm))
if (DECL_ARTIFICIAL (patparm)
&& DECL_NAME (parm) == DECL_NAME (patparm))
break;
@@ -8936,7 +8966,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
RETURN (error_mark_node);
r = copy_decl (t);
- TREE_CHAIN (r) = NULL_TREE;
+ DECL_CHAIN (r) = NULL_TREE;
TREE_TYPE (r) = new_type;
DECL_TEMPLATE_RESULT (r)
= build_decl (DECL_SOURCE_LOCATION (decl),
@@ -8986,7 +9016,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
than the old one. */
r = copy_decl (t);
gcc_assert (DECL_LANG_SPECIFIC (r) != 0);
- TREE_CHAIN (r) = NULL_TREE;
+ DECL_CHAIN (r) = NULL_TREE;
DECL_TEMPLATE_INFO (r) = build_template_info (t, args);
@@ -9196,7 +9226,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
assigned to the instantiation. */
DECL_INTERFACE_KNOWN (r) = !TREE_PUBLIC (r);
DECL_DEFER_OUTPUT (r) = 0;
- TREE_CHAIN (r) = NULL_TREE;
+ DECL_CHAIN (r) = NULL_TREE;
DECL_PENDING_INLINE_INFO (r) = 0;
DECL_PENDING_INLINE_P (r) = 0;
DECL_SAVED_TREE (r) = NULL_TREE;
@@ -9395,12 +9425,12 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* Build a proper chain of parameters when substituting
into a function parameter pack. */
if (prev_r)
- TREE_CHAIN (prev_r) = r;
+ DECL_CHAIN (prev_r) = r;
}
- if (TREE_CHAIN (t))
- TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args,
- complain, TREE_CHAIN (t));
+ if (DECL_CHAIN (t))
+ DECL_CHAIN (r) = tsubst (DECL_CHAIN (t), args,
+ complain, DECL_CHAIN (t));
/* FIRST_R contains the start of the chain we've built. */
r = first_r;
@@ -9425,7 +9455,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/*integral_constant_expression_p=*/true);
/* We don't have to set DECL_CONTEXT here; it is set by
finish_member_declaration. */
- TREE_CHAIN (r) = NULL_TREE;
+ DECL_CHAIN (r) = NULL_TREE;
if (VOID_TYPE_P (type))
error ("instantiation of %q+D as type %qT", r, type);
@@ -9452,7 +9482,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
else
{
r = copy_node (t);
- TREE_CHAIN (r) = NULL_TREE;
+ DECL_CHAIN (r) = NULL_TREE;
}
break;
@@ -9652,7 +9682,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
else
register_local_specialization (r, t);
- TREE_CHAIN (r) = NULL_TREE;
+ DECL_CHAIN (r) = NULL_TREE;
apply_late_template_attributes (&r, DECL_ATTRIBUTES (r),
/*flags=*/0,
@@ -9958,6 +9988,7 @@ tsubst_exception_specification (tree fntype,
tree
tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
+ enum tree_code code;
tree type, r;
if (t == NULL_TREE || t == error_mark_node
@@ -9974,7 +10005,9 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (args == NULL_TREE)
return t;
- if (TREE_CODE (t) == IDENTIFIER_NODE)
+ code = TREE_CODE (t);
+
+ if (code == IDENTIFIER_NODE)
type = IDENTIFIER_TYPE_VALUE (t);
else
type = TREE_TYPE (t);
@@ -10017,16 +10050,16 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}
if (type
- && TREE_CODE (t) != TYPENAME_TYPE
- && TREE_CODE (t) != TEMPLATE_TYPE_PARM
- && TREE_CODE (t) != IDENTIFIER_NODE
- && TREE_CODE (t) != FUNCTION_TYPE
- && TREE_CODE (t) != METHOD_TYPE)
+ && code != TYPENAME_TYPE
+ && code != TEMPLATE_TYPE_PARM
+ && code != IDENTIFIER_NODE
+ && code != FUNCTION_TYPE
+ && code != METHOD_TYPE)
type = tsubst (type, args, complain, in_decl);
if (type == error_mark_node)
return error_mark_node;
- switch (TREE_CODE (t))
+ switch (code)
{
case RECORD_TYPE:
case UNION_TYPE:
@@ -10156,7 +10189,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}; */
return t;
- if (TREE_CODE (t) == TEMPLATE_TYPE_PARM)
+ if (code == TEMPLATE_TYPE_PARM)
{
int quals;
gcc_assert (TYPE_P (arg));
@@ -10166,7 +10199,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
return cp_build_qualified_type_real
(arg, quals, complain | tf_ignore_bad_quals);
}
- else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ else if (code == BOUND_TEMPLATE_TEMPLATE_PARM)
{
/* We are processing a type constructed from a
template template parameter. */
@@ -10205,7 +10238,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* If we get here, we must have been looking at a parm for a
more deeply nested template. Make a new version of this
template parameter, but with a lower level. */
- switch (TREE_CODE (t))
+ switch (code)
{
case TEMPLATE_TYPE_PARM:
case TEMPLATE_TEMPLATE_PARM:
@@ -10215,7 +10248,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
r = tsubst (TYPE_MAIN_VARIANT (t), args, complain, in_decl);
r = cp_build_qualified_type_real
(r, cp_type_quals (t),
- complain | (TREE_CODE (t) == TEMPLATE_TYPE_PARM
+ complain | (code == TEMPLATE_TYPE_PARM
? tf_ignore_bad_quals : 0));
}
else
@@ -10243,7 +10276,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
else
TYPE_CANONICAL (r) = canonical_type_parameter (r);
- if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ if (code == BOUND_TEMPLATE_TEMPLATE_PARM)
{
tree argvec = tsubst (TYPE_TI_ARGS (t), args,
complain, in_decl);
@@ -10314,14 +10347,9 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case POINTER_TYPE:
case REFERENCE_TYPE:
{
- enum tree_code code;
-
if (type == TREE_TYPE (t) && TREE_CODE (type) != METHOD_TYPE)
return t;
- code = TREE_CODE (t);
-
-
/* [temp.deduct]
Type deduction may fail for any of the following
@@ -10506,7 +10534,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
return error_mark_node;
return fold_build2_loc (input_location,
- TREE_CODE (t), TREE_TYPE (t), e1, e2);
+ code, TREE_TYPE (t), e1, e2);
}
case NEGATE_EXPR:
@@ -10516,7 +10544,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (e == error_mark_node)
return error_mark_node;
- return fold_build1_loc (input_location, TREE_CODE (t), TREE_TYPE (t), e);
+ return fold_build1_loc (input_location, code, TREE_TYPE (t), e);
}
case TYPENAME_TYPE:
@@ -10672,9 +10700,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case TYPE_ARGUMENT_PACK:
case NONTYPE_ARGUMENT_PACK:
{
- tree r = TYPE_P (t)
- ? cxx_make_type (TREE_CODE (t))
- : make_node (TREE_CODE (t));
+ tree r = TYPE_P (t) ? cxx_make_type (code) : make_node (code);
tree packed_out =
tsubst_template_args (ARGUMENT_PACK_ARGS (t),
args,
@@ -10684,7 +10710,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* For template nontype argument packs, also substitute into
the type. */
- if (TREE_CODE (t) == NONTYPE_ARGUMENT_PACK)
+ if (code == NONTYPE_ARGUMENT_PACK)
TREE_TYPE (r) = tsubst (TREE_TYPE (t), args, complain, in_decl);
return r;
@@ -10692,8 +10718,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
break;
default:
- sorry ("use of %qs in template",
- tree_code_name [(int) TREE_CODE (t)]);
+ sorry ("use of %qs in template", tree_code_name [(int) code]);
return error_mark_node;
}
}
@@ -10737,6 +10762,8 @@ tsubst_baselink (tree baselink, tree object_type,
if (IDENTIFIER_TYPENAME_P (name))
name = mangle_conv_op_name_for_type (optype);
baselink = lookup_fnfields (qualifying_scope, name, /*protect=*/1);
+ if (!baselink)
+ return error_mark_node;
/* If lookup found a single function, mark it as used at this
point. (If it lookup found multiple functions the one selected
@@ -11312,8 +11339,13 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
gcc_unreachable ();
case OFFSET_REF:
- mark_used (TREE_OPERAND (t, 1));
- return t;
+ r = build2
+ (code, tsubst (TREE_TYPE (t), args, complain, in_decl),
+ tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl),
+ tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl));
+ PTRMEM_OK_P (r) = PTRMEM_OK_P (t);
+ mark_used (TREE_OPERAND (r, 1));
+ return r;
case EXPR_PACK_EXPANSION:
error ("invalid use of pack expansion expression");
@@ -12500,15 +12532,24 @@ tsubst_copy_and_build (tree t,
ret = build_offset_ref_call_from_tree (function, &call_args);
else if (TREE_CODE (function) == COMPONENT_REF)
{
- if (!BASELINK_P (TREE_OPERAND (function, 1)))
+ tree instance = TREE_OPERAND (function, 0);
+ tree fn = TREE_OPERAND (function, 1);
+
+ if (processing_template_decl
+ && (type_dependent_expression_p (instance)
+ || (!BASELINK_P (fn)
+ && TREE_CODE (fn) != FIELD_DECL)
+ || type_dependent_expression_p (fn)
+ || any_type_dependent_arguments_p (call_args)))
+ ret = build_nt_call_vec (function, call_args);
+ else if (!BASELINK_P (fn))
ret = finish_call_expr (function, &call_args,
/*disallow_virtual=*/false,
/*koenig_p=*/false,
complain);
else
ret = (build_new_method_call
- (TREE_OPERAND (function, 0),
- TREE_OPERAND (function, 1),
+ (instance, fn,
&call_args, NULL_TREE,
qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL,
/*fn_p=*/NULL,
@@ -13121,7 +13162,7 @@ instantiate_template (tree tmpl, tree orig_args, tsubst_flags_t complain)
instantiate all the alternate entry points as well. We do this
by cloning the instantiation of the main entry point, not by
instantiating the template clones. */
- if (TREE_CHAIN (gen_tmpl) && DECL_CLONED_FUNCTION_P (TREE_CHAIN (gen_tmpl)))
+ if (DECL_CHAIN (gen_tmpl) && DECL_CLONED_FUNCTION_P (DECL_CHAIN (gen_tmpl)))
clone_function_decl (fndecl, /*update_method_vec_p=*/0);
return fndecl;
@@ -15972,7 +16013,7 @@ most_general_template (tree decl)
returned. */
static tree
-most_specialized_class (tree type, tree tmpl)
+most_specialized_class (tree type, tree tmpl, tsubst_flags_t complain)
{
tree list = NULL_TREE;
tree t;
@@ -16092,6 +16133,8 @@ most_specialized_class (tree type, tree tmpl)
{
const char *str;
char *spaces = NULL;
+ if (!(complain & tf_error))
+ return error_mark_node;
error ("ambiguous class template instantiation for %q#T", type);
str = TREE_CHAIN (list) ? _("candidates are:") : _("candidate is:");
for (t = list; t; t = TREE_CHAIN (t))
@@ -16390,12 +16433,12 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
interpretation is that it should be an explicit instantiation. */
if (! static_p)
- for (tmp = TYPE_METHODS (t); tmp; tmp = TREE_CHAIN (tmp))
+ for (tmp = TYPE_METHODS (t); tmp; tmp = DECL_CHAIN (tmp))
if (TREE_CODE (tmp) == FUNCTION_DECL
&& DECL_TEMPLATE_INSTANTIATION (tmp))
instantiate_class_member (tmp, extern_p);
- for (tmp = TYPE_FIELDS (t); tmp; tmp = TREE_CHAIN (tmp))
+ for (tmp = TYPE_FIELDS (t); tmp; tmp = DECL_CHAIN (tmp))
if (TREE_CODE (tmp) == VAR_DECL && DECL_TEMPLATE_INSTANTIATION (tmp))
instantiate_class_member (tmp, extern_p);
@@ -16483,8 +16526,8 @@ regenerate_decl_from_template (tree decl, tree tmpl)
DECL_ATTRIBUTES (decl_parm) = attributes;
cplus_decl_attributes (&decl_parm, attributes, /*flags=*/0);
}
- decl_parm = TREE_CHAIN (decl_parm);
- pattern_parm = TREE_CHAIN (pattern_parm);
+ decl_parm = DECL_CHAIN (decl_parm);
+ pattern_parm = DECL_CHAIN (pattern_parm);
}
/* Merge any parameters that match with the function parameter
pack. */
@@ -16516,7 +16559,7 @@ regenerate_decl_from_template (tree decl, tree tmpl)
DECL_ATTRIBUTES (decl_parm) = attributes;
cplus_decl_attributes (&decl_parm, attributes, /*flags=*/0);
}
- decl_parm = TREE_CHAIN (decl_parm);
+ decl_parm = DECL_CHAIN (decl_parm);
}
}
/* Merge additional specifiers from the CODE_PATTERN. */
@@ -16926,8 +16969,8 @@ instantiate_decl (tree d, int defer_ok,
while (tmpl_parm && !FUNCTION_PARAMETER_PACK_P (tmpl_parm))
{
register_local_specialization (spec_parm, tmpl_parm);
- tmpl_parm = TREE_CHAIN (tmpl_parm);
- spec_parm = TREE_CHAIN (spec_parm);
+ tmpl_parm = DECL_CHAIN (tmpl_parm);
+ spec_parm = DECL_CHAIN (spec_parm);
}
if (tmpl_parm && FUNCTION_PARAMETER_PACK_P (tmpl_parm))
{
@@ -16935,7 +16978,7 @@ instantiate_decl (tree d, int defer_ok,
TMPL_PARM, then move on. */
tree argpack = make_fnparm_pack (spec_parm);
register_local_specialization (argpack, tmpl_parm);
- tmpl_parm = TREE_CHAIN (tmpl_parm);
+ tmpl_parm = DECL_CHAIN (tmpl_parm);
spec_parm = NULL_TREE;
}
gcc_assert (!spec_parm);
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index c2493c7fcad..ee3f52faf23 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -207,6 +207,15 @@ cxx_print_xnode (FILE *file, tree node, int indent)
TEMPLATE_PARM_IDX (node), TEMPLATE_PARM_LEVEL (node),
TEMPLATE_PARM_ORIG_LEVEL (node));
break;
+ case TEMPLATE_INFO:
+ print_node (file, "template", TI_TEMPLATE (node), indent+4);
+ print_node (file, "args", TI_ARGS (node), indent+4);
+ if (TI_PENDING_TEMPLATE_FLAG (node))
+ {
+ indent_to (file, indent + 3);
+ fprintf (file, "pending_template");
+ }
+ break;
default:
break;
}
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index dde8e825dbe..c994683aae8 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1210,7 +1210,7 @@ create_pseudo_type_info (int tk, const char *real_name, ...)
/* Now add the derived fields. */
while ((field_decl = va_arg (ap, tree)))
{
- TREE_CHAIN (field_decl) = fields;
+ DECL_CHAIN (field_decl) = fields;
fields = field_decl;
}
@@ -1375,7 +1375,7 @@ create_tinfo_types (void)
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, const_string_type_node);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
ti = VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE);
@@ -1415,7 +1415,7 @@ create_tinfo_types (void)
field = build_decl (BUILTINS_LOCATION,
FIELD_DECL, NULL_TREE, integer_types[itk_long]);
- TREE_CHAIN (field) = fields;
+ DECL_CHAIN (field) = fields;
fields = field;
ti = VEC_index (tinfo_s, tinfo_descs, TK_BASE_TYPE);
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 9dbefd3c5bc..0249fb06d48 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -170,7 +170,7 @@ accessible_base_p (tree t, tree base, bool consider_local_p)
public typedef created in the scope of every class. */
decl = TYPE_FIELDS (base);
while (!DECL_SELF_REFERENCE_P (decl))
- decl = TREE_CHAIN (decl);
+ decl = DECL_CHAIN (decl);
while (ANON_AGGR_TYPE_P (t))
t = TYPE_CONTEXT (t);
return accessible_p (t, decl, consider_local_p);
@@ -447,7 +447,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
#ifdef GATHER_STATISTICS
n_calls_lookup_field_1++;
#endif /* GATHER_STATISTICS */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
#ifdef GATHER_STATISTICS
n_fields_searched++;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 156f278e171..949e108902a 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -607,10 +607,10 @@ finish_expr_stmt (tree expr)
{
if (warn_sequence_point)
verify_sequence_points (expr);
- expr = convert_to_void (expr, "statement", tf_warning_or_error);
+ expr = convert_to_void (expr, ICV_STATEMENT, tf_warning_or_error);
}
else if (!type_dependent_expression_p (expr))
- convert_to_void (build_non_dependent_expr (expr), "statement",
+ convert_to_void (build_non_dependent_expr (expr), ICV_STATEMENT,
tf_warning_or_error);
if (check_for_bare_parameter_packs (expr))
@@ -868,11 +868,11 @@ finish_for_expr (tree expr, tree for_stmt)
{
if (warn_sequence_point)
verify_sequence_points (expr);
- expr = convert_to_void (expr, "3rd expression in for",
+ expr = convert_to_void (expr, ICV_THIRD_IN_FOR,
tf_warning_or_error);
}
else if (!type_dependent_expression_p (expr))
- convert_to_void (build_non_dependent_expr (expr), "3rd expression in for",
+ convert_to_void (build_non_dependent_expr (expr), ICV_THIRD_IN_FOR,
tf_warning_or_error);
expr = maybe_cleanup_point_expr_void (expr);
if (check_for_bare_parameter_packs (expr))
@@ -2418,7 +2418,7 @@ finish_member_declaration (tree decl)
return;
/* We should see only one DECL at a time. */
- gcc_assert (TREE_CHAIN (decl) == NULL_TREE);
+ gcc_assert (DECL_CHAIN (decl) == NULL_TREE);
/* Set up access control for DECL. */
TREE_PRIVATE (decl)
@@ -2460,7 +2460,7 @@ finish_member_declaration (tree decl)
CLASSTYPE_METHOD_VEC. */
if (add_method (current_class_type, decl, NULL_TREE))
{
- TREE_CHAIN (decl) = TYPE_METHODS (current_class_type);
+ DECL_CHAIN (decl) = TYPE_METHODS (current_class_type);
TYPE_METHODS (current_class_type) = decl;
maybe_add_class_template_decl_list (current_class_type, decl,
@@ -2493,7 +2493,7 @@ finish_member_declaration (tree decl)
= chainon (TYPE_FIELDS (current_class_type), decl);
else
{
- TREE_CHAIN (decl) = TYPE_FIELDS (current_class_type);
+ DECL_CHAIN (decl) = TYPE_FIELDS (current_class_type);
TYPE_FIELDS (current_class_type) = decl;
}
@@ -3319,7 +3319,7 @@ emit_associated_thunks (tree fn)
{
tree thunk;
- for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk))
+ for (thunk = DECL_THUNKS (fn); thunk; thunk = DECL_CHAIN (thunk))
{
if (!THUNK_ALIAS (thunk))
{
@@ -3329,7 +3329,7 @@ emit_associated_thunks (tree fn)
tree probe;
for (probe = DECL_THUNKS (thunk);
- probe; probe = TREE_CHAIN (probe))
+ probe; probe = DECL_CHAIN (probe))
use_thunk (probe, /*emit_p=*/1);
}
}
@@ -4899,8 +4899,9 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
type = TYPE_MAIN_VARIANT (type);
else if (real_lvalue_p (expr))
{
- if (TREE_CODE (type) != REFERENCE_TYPE)
- type = build_reference_type (type);
+ if (TREE_CODE (type) != REFERENCE_TYPE
+ || TYPE_REF_IS_RVALUE (type))
+ type = build_reference_type (non_reference (type));
}
else
type = non_reference (type);
@@ -5850,8 +5851,8 @@ maybe_add_lambda_conv_op (tree type)
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_STATIC_FUNCTION_P (fn) = 1;
- DECL_ARGUMENTS (fn) = copy_list (TREE_CHAIN (DECL_ARGUMENTS (callop)));
- for (arg = DECL_ARGUMENTS (fn); arg; arg = TREE_CHAIN (arg))
+ DECL_ARGUMENTS (fn) = copy_list (DECL_CHAIN (DECL_ARGUMENTS (callop)));
+ for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg))
DECL_CONTEXT (arg) = fn;
if (nested)
DECL_INTERFACE_KNOWN (fn) = 1;
@@ -5884,7 +5885,7 @@ maybe_add_lambda_conv_op (tree type)
null_pointer_node);
argvec = make_tree_vector ();
VEC_quick_push (tree, argvec, arg);
- for (arg = DECL_ARGUMENTS (statfn); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (statfn); arg; arg = DECL_CHAIN (arg))
VEC_safe_push (tree, gc, argvec, arg);
call = build_call_a (callop, VEC_length (tree, argvec),
VEC_address (tree, argvec));
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index d62f9d7acf6..450b9e89433 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2023,11 +2023,21 @@ cp_tree_equal (tree t1, tree t2)
/* We need to do this when determining whether or not two
non-type pointer to member function template arguments
are the same. */
- if (!(same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
- /* The first operand is RTL. */
- && TREE_OPERAND (t1, 0) == TREE_OPERAND (t2, 0)))
+ if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ || CONSTRUCTOR_NELTS (t1) != CONSTRUCTOR_NELTS (t2))
return false;
- return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
+ {
+ tree field, value;
+ unsigned int i;
+ FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t1), i, field, value)
+ {
+ constructor_elt *elt2 = CONSTRUCTOR_ELT (t2, i);
+ if (!cp_tree_equal (field, elt2->index)
+ || !cp_tree_equal (value, elt2->value))
+ return false;
+ }
+ }
+ return true;
case TREE_LIST:
if (!cp_tree_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2)))
@@ -2191,6 +2201,17 @@ cp_tree_equal (tree t1, tree t2)
return same_type_p (TRAIT_EXPR_TYPE1 (t1), TRAIT_EXPR_TYPE1 (t2))
&& same_type_p (TRAIT_EXPR_TYPE2 (t1), TRAIT_EXPR_TYPE2 (t2));
+ case CAST_EXPR:
+ case STATIC_CAST_EXPR:
+ case REINTERPRET_CAST_EXPR:
+ case CONST_CAST_EXPR:
+ case DYNAMIC_CAST_EXPR:
+ case NEW_EXPR:
+ if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ return false;
+ /* Now compare operands as usual. */
+ break;
+
default:
break;
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 371bb87c8e8..8411c90c9e8 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1,6 +1,6 @@
/* Build expressions with type checking for C++ compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
@@ -53,7 +53,7 @@ static int comp_ptr_ttypes_real (tree, tree, int);
static bool comp_except_types (tree, tree, bool);
static bool comp_array_types (const_tree, const_tree, bool);
static tree pointer_diff (tree, tree, tree);
-static tree get_delta_difference (tree, tree, bool, bool);
+static tree get_delta_difference (tree, tree, bool, bool, tsubst_flags_t);
static void casts_away_constness_r (tree *, tree *);
static bool casts_away_constness (tree, tree);
static void maybe_warn_about_returning_address_of_local (tree);
@@ -1503,6 +1503,18 @@ comptypes (tree t1, tree t2, int strict)
return structural_comptypes (t1, t2, strict);
}
+/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
+ top-level qualifiers. */
+
+bool
+same_type_ignoring_top_level_qualifiers_p (tree type1, tree type2)
+{
+ if (type1 == error_mark_node || type2 == error_mark_node)
+ return false;
+
+ return same_type_p (TYPE_MAIN_VARIANT (type1), TYPE_MAIN_VARIANT (type2));
+}
+
/* Returns 1 if TYPE1 is at least as qualified as TYPE2. */
bool
@@ -2136,7 +2148,7 @@ lookup_anon_field (tree t, tree type)
{
tree field;
- for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
{
if (TREE_STATIC (field))
continue;
@@ -4781,7 +4793,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
tree val;
const char *invalid_op_diag;
- if (error_operand_p (arg))
+ if (!arg || error_operand_p (arg))
return error_mark_node;
if ((invalid_op_diag
@@ -5276,7 +5288,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
build_ptrmemfunc_type (argtype);
val = build_ptrmemfunc (argtype, val, 0,
- /*c_cast_p=*/false);
+ /*c_cast_p=*/false,
+ tf_warning_or_error);
}
return val;
@@ -5511,14 +5524,16 @@ build_x_conditional_expr (tree ifexp, tree op1, tree op2,
that performs them all and returns the value of the last of them. */
tree
-build_x_compound_expr_from_list (tree list, expr_list_kind exp)
+build_x_compound_expr_from_list (tree list, expr_list_kind exp,
+ tsubst_flags_t complain)
{
tree expr = TREE_VALUE (list);
if (TREE_CHAIN (list))
{
- switch (exp)
- {
+ if (complain & tf_error)
+ switch (exp)
+ {
case ELK_INIT:
permerror (input_location, "expression list treated as compound "
"expression in initializer");
@@ -5533,11 +5548,11 @@ build_x_compound_expr_from_list (tree list, expr_list_kind exp)
break;
default:
gcc_unreachable ();
- }
+ }
for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list))
expr = build_x_compound_expr (expr, TREE_VALUE (list),
- tf_warning_or_error);
+ complain);
}
return expr;
@@ -5613,7 +5628,7 @@ build_compound_expr (location_t loc ATTRIBUTE_UNUSED, tree lhs, tree rhs)
tree
cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain)
{
- lhs = convert_to_void (lhs, "left-hand operand of comma", complain);
+ lhs = convert_to_void (lhs, ICV_LEFT_OF_COMMA, complain);
if (lhs == error_mark_node || rhs == error_mark_node)
return error_mark_node;
@@ -5691,7 +5706,7 @@ check_for_casting_away_constness (tree src_type, tree dest_type,
tree
convert_ptrmem (tree type, tree expr, bool allow_inverse_p,
- bool c_cast_p)
+ bool c_cast_p, tsubst_flags_t complain)
{
if (TYPE_PTRMEM_P (type))
{
@@ -5702,7 +5717,10 @@ convert_ptrmem (tree type, tree expr, bool allow_inverse_p,
delta = get_delta_difference (TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (expr)),
TYPE_PTRMEM_CLASS_TYPE (type),
allow_inverse_p,
- c_cast_p);
+ c_cast_p, complain);
+ if (delta == error_mark_node)
+ return error_mark_node;
+
if (!integer_zerop (delta))
{
tree cond, op1, op2;
@@ -5726,7 +5744,7 @@ convert_ptrmem (tree type, tree expr, bool allow_inverse_p,
}
else
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr,
- allow_inverse_p, c_cast_p);
+ allow_inverse_p, c_cast_p, complain);
}
/* If EXPR is an INTEGER_CST and ORIG is an arithmetic constant, return
@@ -5880,7 +5898,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
Any expression can be explicitly converted to type cv void. */
if (TREE_CODE (type) == VOID_TYPE)
- return convert_to_void (expr, /*implicit=*/NULL, complain);
+ return convert_to_void (expr, ICV_CAST, complain);
/* [expr.static.cast]
@@ -5962,7 +5980,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
if (!c_cast_p)
check_for_casting_away_constness (intype, type, STATIC_CAST_EXPR);
return convert_ptrmem (type, expr, /*allow_inverse_p=*/1,
- c_cast_p);
+ c_cast_p, tf_warning_or_error);
}
}
@@ -6877,20 +6895,32 @@ build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
/* Helper function for get_delta_difference which assumes FROM is a base
class of TO. Returns a delta for the conversion of pointer-to-member
- of FROM to pointer-to-member of TO. If the conversion is invalid,
+ of FROM to pointer-to-member of TO. If the conversion is invalid and
+ tf_error is not set in COMPLAIN returns error_mark_node, otherwise
returns zero. If FROM is not a base class of TO, returns NULL_TREE.
- If C_CAST_P is true, this conversion is taking place as part of a C-style
- cast. */
+ If C_CAST_P is true, this conversion is taking place as part of a
+ C-style cast. */
static tree
-get_delta_difference_1 (tree from, tree to, bool c_cast_p)
+get_delta_difference_1 (tree from, tree to, bool c_cast_p,
+ tsubst_flags_t complain)
{
tree binfo;
base_kind kind;
+ base_access access = c_cast_p ? ba_unique : ba_check;
+
+ /* Note: ba_quiet does not distinguish between access control and
+ ambiguity. */
+ if (!(complain & tf_error))
+ access |= ba_quiet;
+
+ binfo = lookup_base (to, from, access, &kind);
- binfo = lookup_base (to, from, c_cast_p ? ba_unique : ba_check, &kind);
if (kind == bk_inaccessible || kind == bk_ambig)
{
+ if (!(complain & tf_error))
+ return error_mark_node;
+
error (" in pointer to member function conversion");
return size_zero_node;
}
@@ -6902,22 +6932,26 @@ get_delta_difference_1 (tree from, tree to, bool c_cast_p)
/* FROM is a virtual base class of TO. Issue an error or warning
depending on whether or not this is a reinterpret cast. */
{
+ if (!(complain & tf_error))
+ return error_mark_node;
+
error ("pointer to member conversion via virtual base %qT",
BINFO_TYPE (binfo_from_vbase (binfo)));
return size_zero_node;
}
}
- else
- return NULL_TREE;
+ else
+ return NULL_TREE;
}
/* Get difference in deltas for different pointer to member function
- types. Returns an integer constant of type PTRDIFF_TYPE_NODE. If
- the conversion is invalid, the constant is zero. If
- ALLOW_INVERSE_P is true, then allow reverse conversions as well.
- If C_CAST_P is true this conversion is taking place as part of a
- C-style cast.
+ types. If the conversion is invalid and tf_error is not set in
+ COMPLAIN, returns error_mark_node, otherwise returns an integer
+ constant of type PTRDIFF_TYPE_NODE and its value is zero if the
+ conversion is invalid. If ALLOW_INVERSE_P is true, then allow reverse
+ conversions as well. If C_CAST_P is true this conversion is taking
+ place as part of a C-style cast.
Note that the naming of FROM and TO is kind of backwards; the return
value is what we add to a TO in order to get a FROM. They are named
@@ -6927,7 +6961,7 @@ get_delta_difference_1 (tree from, tree to, bool c_cast_p)
static tree
get_delta_difference (tree from, tree to,
bool allow_inverse_p,
- bool c_cast_p)
+ bool c_cast_p, tsubst_flags_t complain)
{
tree result;
@@ -6935,25 +6969,37 @@ get_delta_difference (tree from, tree to,
/* Pointer to member of incomplete class is permitted*/
result = size_zero_node;
else
- result = get_delta_difference_1 (from, to, c_cast_p);
+ result = get_delta_difference_1 (from, to, c_cast_p, complain);
+
+ if (result == error_mark_node)
+ return error_mark_node;
if (!result)
{
if (!allow_inverse_p)
{
+ if (!(complain & tf_error))
+ return error_mark_node;
+
error_not_base_type (from, to);
error (" in pointer to member conversion");
- result = size_zero_node;
+ result = size_zero_node;
}
else
{
- result = get_delta_difference_1 (to, from, c_cast_p);
+ result = get_delta_difference_1 (to, from, c_cast_p, complain);
+
+ if (result == error_mark_node)
+ return error_mark_node;
if (result)
result = size_diffop_loc (input_location,
- size_zero_node, result);
+ size_zero_node, result);
else
{
+ if (!(complain & tf_error))
+ return error_mark_node;
+
error_not_base_type (from, to);
error (" in pointer to member conversion");
result = size_zero_node;
@@ -6978,7 +7024,7 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn)
/* Pull the FIELD_DECLs out of the type. */
pfn_field = TYPE_FIELDS (type);
- delta_field = TREE_CHAIN (pfn_field);
+ delta_field = DECL_CHAIN (pfn_field);
/* Make sure DELTA has the type we want. */
delta = convert_and_check (delta_type_node, delta);
@@ -7012,7 +7058,8 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn)
Return error_mark_node, if something goes wrong. */
tree
-build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p)
+build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p,
+ tsubst_flags_t complain)
{
tree fn;
tree pfn_type;
@@ -7039,7 +7086,9 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p)
n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type),
force,
- c_cast_p);
+ c_cast_p, complain);
+ if (n == error_mark_node)
+ return error_mark_node;
/* We don't have to do any conversion to convert a
pointer-to-member to its own type. But, we don't want to
@@ -7122,7 +7171,7 @@ expand_ptrmemfunc_cst (tree cst, tree *delta, tree *pfn)
/* First, calculate the adjustment to the function's class. */
*delta = get_delta_difference (fn_class, ptr_class, /*force=*/0,
- /*c_cast_p=*/0);
+ /*c_cast_p=*/0, tf_warning_or_error);
if (!DECL_VIRTUAL_P (fn))
*pfn = convert (TYPE_PTRMEMFUNC_FN_TYPE (type), build_addr_func (fn));
@@ -7233,7 +7282,10 @@ convert_for_assignment (tree type, tree rhs,
if (TREE_CODE (type) == VECTOR_TYPE && coder == VECTOR_TYPE
&& vector_types_convertible_p (type, rhstype, true))
- return convert (type, rhs);
+ {
+ rhs = mark_rvalue_use (rhs);
+ return convert (type, rhs);
+ }
if (rhs == error_mark_node || rhstype == error_mark_node)
return error_mark_node;
@@ -7277,7 +7329,10 @@ convert_for_assignment (tree type, tree rhs,
}
if (objc_compare_types (type, rhstype, parmno, rname))
- return convert (type, rhs);
+ {
+ rhs = mark_rvalue_use (rhs);
+ return convert (type, rhs);
+ }
}
/* [expr.ass]
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index f62bbb5d950..ce83d7c40b7 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -737,7 +737,8 @@ store_init_value (tree decl, tree init, int flags)
}
else
/* We get here with code like `int a (2);' */
- init = build_x_compound_expr_from_list (init, ELK_INIT);
+ init = build_x_compound_expr_from_list (init, ELK_INIT,
+ tf_warning_or_error);
}
/* End of special C++ code. */
@@ -1115,7 +1116,7 @@ process_init_constructor_record (tree type, tree init)
/* Generally, we will always have an index for each initializer (which is
a FIELD_DECL, put by reshape_init), but compound literals don't go trough
reshape_init. So we need to handle both cases. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
tree next;
tree type;
@@ -1478,8 +1479,8 @@ build_m_component_ref (tree datum, tree component)
if (error_operand_p (datum) || error_operand_p (component))
return error_mark_node;
- mark_lvalue_use (datum);
- mark_rvalue_use (component);
+ datum = mark_lvalue_use (datum);
+ component = mark_rvalue_use (component);
ptrmem_type = TREE_TYPE (component);
if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type))
@@ -1594,7 +1595,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
return cp_convert (type, integer_zero_node);
/* This must build a C cast. */
- parms = build_x_compound_expr_from_list (parms, ELK_FUNC_CAST);
+ parms = build_x_compound_expr_from_list (parms, ELK_FUNC_CAST, complain);
return cp_build_c_cast (type, parms, complain);
}
diff --git a/gcc/cse.c b/gcc/cse.c
index 82921f66861..ae513eb2a16 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "function.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 28ed6d7b348..64f183f2b1e 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "function.h"
#include "emit-rtl.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
diff --git a/gcc/dbgcnt.c b/gcc/dbgcnt.c
index 911cfb3c412..23d35124a17 100644
--- a/gcc/dbgcnt.c
+++ b/gcc/dbgcnt.c
@@ -22,6 +22,7 @@ See dbgcnt.def for usage information. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm.h"
#include "rtl.h"
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 066e91f191a..7a66a78e8ca 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "reload.h"
#include "output.h"
#include "dbxout.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "ggc.h"
@@ -1098,7 +1099,7 @@ dbxout_init (const char *input_file_name)
static void
dbxout_typedefs (tree syms)
{
- for (; syms != NULL_TREE; syms = TREE_CHAIN (syms))
+ for (; syms != NULL_TREE; syms = DECL_CHAIN (syms))
{
if (TREE_CODE (syms) == TYPE_DECL)
{
@@ -1422,7 +1423,7 @@ dbxout_type_fields (tree type)
/* Output the name, type, position (in bits), size (in bits) of each
field that we can support. */
- for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
+ for (tem = TYPE_FIELDS (type); tem; tem = DECL_CHAIN (tem))
{
/* If one of the nodes is an error_mark or its type is then
return early. */
@@ -1565,7 +1566,7 @@ dbxout_type_methods (tree type)
These differ in the types of the arguments. */
for (last = NULL_TREE;
fndecl && (last == NULL_TREE || DECL_NAME (fndecl) == DECL_NAME (last));
- fndecl = TREE_CHAIN (fndecl))
+ fndecl = DECL_CHAIN (fndecl))
/* Output the name of the field (after overloading), as
well as the name of the field before overloading, along
with its parameter list */
@@ -3306,7 +3307,7 @@ dbxout_syms (tree syms)
comm_prev = comm_new;
result += dbxout_symbol (syms, 1);
- syms = TREE_CHAIN (syms);
+ syms = DECL_CHAIN (syms);
}
if (comm_prev != NULL)
@@ -3333,7 +3334,7 @@ dbxout_parms (tree parms)
++debug_nesting;
emit_pending_bincls_if_required ();
- for (; parms; parms = TREE_CHAIN (parms))
+ for (; parms; parms = DECL_CHAIN (parms))
if (DECL_NAME (parms)
&& TREE_TYPE (parms) != error_mark_node
&& DECL_RTL_SET_P (parms)
@@ -3535,7 +3536,7 @@ dbxout_reg_parms (tree parms)
{
++debug_nesting;
- for (; parms; parms = TREE_CHAIN (parms))
+ for (; parms; parms = DECL_CHAIN (parms))
if (DECL_NAME (parms) && PARM_PASSED_IN_MEMORY (parms))
{
/* Report parms that live in registers during the function
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 72e12de03ca..0a20ed61291 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
@@ -487,7 +488,7 @@ create_ddg (basic_block bb, int closing_branch_deps)
}
/* There is nothing to do for this BB. */
- if (num_nodes <= 1)
+ if ((num_nodes - g->num_debug) <= 1)
{
free (g);
return NULL;
diff --git a/gcc/defaults.h b/gcc/defaults.h
index eb74033657b..c2e68a742e3 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -133,13 +133,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif
/* This is how to output the definition of a user-level label named
- NAME, such as the label on a static function or variable NAME. */
+ NAME, such as the label on variable NAME. */
#ifndef ASM_OUTPUT_LABEL
#define ASM_OUTPUT_LABEL(FILE,NAME) \
do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
#endif
+/* This is how to output the definition of a user-level label named
+ NAME, such as the label on a function. */
+
+#ifndef ASM_OUTPUT_FUNCTION_LABEL
+#define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \
+ ASM_OUTPUT_LABEL ((FILE), (NAME))
+#endif
+
/* Output the definition of a compiler-generated label named NAME. */
#ifndef ASM_OUTPUT_INTERNAL_LABEL
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
@@ -1017,6 +1025,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define MOVE_MAX_PIECES MOVE_MAX
#endif
+#ifndef MAX_MOVE_MAX
+#define MAX_MOVE_MAX MOVE_MAX
+#endif
+
+#ifndef MIN_UNITS_PER_WORD
+#define MIN_UNITS_PER_WORD UNITS_PER_WORD
+#endif
+
+#ifndef MAX_BITS_PER_WORD
+#define MAX_BITS_PER_WORD BITS_PER_WORD
+#endif
+
#ifndef STACK_POINTER_OFFSET
#define STACK_POINTER_OFFSET 0
#endif
@@ -1364,6 +1384,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
#endif
+#ifndef SWITCHABLE_TARGET
+#define SWITCHABLE_TARGET 0
+#endif
+
#endif /* GCC_INSN_FLAGS_H */
#endif /* ! GCC_DEFAULTS_H */
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index 1196e81e729..3b3f4262503 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -3050,12 +3050,10 @@ df_ignore_stack_reg (int regno ATTRIBUTE_UNUSED)
them to OLD_DEAD_NOTES and OLD_UNUSED_NOTES. */
static void
-df_kill_notes (rtx insn, rtx *old_dead_notes, rtx *old_unused_notes)
+df_kill_notes (rtx insn)
{
rtx *pprev = &REG_NOTES (insn);
rtx link = *pprev;
- rtx dead = NULL;
- rtx unused = NULL;
while (link)
{
@@ -3075,8 +3073,7 @@ df_kill_notes (rtx insn, rtx *old_dead_notes, rtx *old_unused_notes)
#ifdef REG_DEAD_DEBUGGING
df_print_note ("deleting: ", insn, link);
#endif
- XEXP (link, 1) = dead;
- dead = link;
+ free_EXPR_LIST_node (link);
*pprev = link = next;
}
break;
@@ -3095,8 +3092,7 @@ df_kill_notes (rtx insn, rtx *old_dead_notes, rtx *old_unused_notes)
#ifdef REG_DEAD_DEBUGGING
df_print_note ("deleting: ", insn, link);
#endif
- XEXP (link, 1) = unused;
- unused = link;
+ free_EXPR_LIST_node (link);
*pprev = link = next;
}
break;
@@ -3107,43 +3103,16 @@ df_kill_notes (rtx insn, rtx *old_dead_notes, rtx *old_unused_notes)
break;
}
}
-
- *old_dead_notes = dead;
- *old_unused_notes = unused;
}
-/* Set a NOTE_TYPE note for REG in INSN. Try to pull it from the OLD
- list, otherwise create a new one. */
+/* Set a NOTE_TYPE note for REG in INSN. */
-static inline rtx
-df_set_note (enum reg_note note_type, rtx insn, rtx old, rtx reg)
+static inline void
+df_set_note (enum reg_note note_type, rtx insn, rtx reg)
{
- rtx curr = old;
- rtx prev = NULL;
-
- gcc_assert (!DEBUG_INSN_P (insn));
-
- while (curr)
- if (XEXP (curr, 0) == reg)
- {
- if (prev)
- XEXP (prev, 1) = XEXP (curr, 1);
- else
- old = XEXP (curr, 1);
- XEXP (curr, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = curr;
- return old;
- }
- else
- {
- prev = curr;
- curr = XEXP (curr, 1);
- }
-
- /* Did not find the note. */
+ gcc_checking_assert (!DEBUG_INSN_P (insn));
add_reg_note (insn, note_type, reg);
- return old;
}
/* A subroutine of df_set_unused_notes_for_mw, with a selection of its
@@ -3179,8 +3148,8 @@ df_whole_mw_reg_unused_p (struct df_mw_hardreg *mws,
instruction.
*/
-static rtx
-df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
+static void
+df_set_unused_notes_for_mw (rtx insn, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen,
bitmap artificial_uses)
{
@@ -3195,7 +3164,7 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
if (df_whole_mw_reg_unused_p (mws, live, artificial_uses))
{
unsigned int regno = mws->start_regno;
- old = df_set_note (REG_UNUSED, insn, old, mws->mw_reg);
+ df_set_note (REG_UNUSED, insn, mws->mw_reg);
#ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 1: ", insn, REG_NOTES (insn));
@@ -3209,14 +3178,13 @@ df_set_unused_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
if (!bitmap_bit_p (live, r)
&& !bitmap_bit_p (artificial_uses, r))
{
- old = df_set_note (REG_UNUSED, insn, old, regno_reg_rtx[r]);
+ df_set_note (REG_UNUSED, insn, regno_reg_rtx[r]);
#ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 2: ", insn, REG_NOTES (insn));
#endif
}
bitmap_set_bit (do_not_gen, r);
}
- return old;
}
@@ -3253,8 +3221,8 @@ df_whole_mw_reg_dead_p (struct df_mw_hardreg *mws,
from being set if the instruction both reads and writes the
register. */
-static rtx
-df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
+static void
+df_set_dead_notes_for_mw (rtx insn, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen,
bitmap artificial_uses, bool *added_notes_p)
{
@@ -3282,9 +3250,9 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
if (is_debug)
{
*added_notes_p = true;
- return old;
+ return;
}
- old = df_set_note (REG_DEAD, insn, old, mws->mw_reg);
+ df_set_note (REG_DEAD, insn, mws->mw_reg);
#ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 1: ", insn, REG_NOTES (insn));
#endif
@@ -3299,23 +3267,23 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
if (is_debug)
{
*added_notes_p = true;
- return old;
+ return;
}
- old = df_set_note (REG_DEAD, insn, old, regno_reg_rtx[r]);
+ df_set_note (REG_DEAD, insn, regno_reg_rtx[r]);
#ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 2: ", insn, REG_NOTES (insn));
#endif
}
}
- return old;
+ return;
}
/* Create a REG_UNUSED note if necessary for DEF in INSN updating
LIVE. Do not generate notes for registers in ARTIFICIAL_USES. */
-static rtx
-df_create_unused_note (rtx insn, rtx old, df_ref def,
+static void
+df_create_unused_note (rtx insn, df_ref def,
bitmap live, bitmap artificial_uses)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -3335,13 +3303,13 @@ df_create_unused_note (rtx insn, rtx old, df_ref def,
{
rtx reg = (DF_REF_LOC (def))
? *DF_REF_REAL_LOC (def): DF_REF_REG (def);
- old = df_set_note (REG_UNUSED, insn, old, reg);
+ df_set_note (REG_UNUSED, insn, reg);
#ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 3: ", insn, REG_NOTES (insn));
#endif
}
- return old;
+ return;
}
/* Node of a linked list of uses of dead REGs in debug insns. */
@@ -3564,8 +3532,6 @@ df_note_bb_compute (unsigned int bb_index,
{
unsigned int uid = INSN_UID (insn);
struct df_mw_hardreg **mws_rec;
- rtx old_dead_notes;
- rtx old_unused_notes;
int debug_insn;
if (!INSN_P (insn))
@@ -3574,7 +3540,7 @@ df_note_bb_compute (unsigned int bb_index,
debug_insn = DEBUG_INSN_P (insn);
bitmap_clear (do_not_gen);
- df_kill_notes (insn, &old_dead_notes, &old_unused_notes);
+ df_kill_notes (insn);
/* Process the defs. */
if (CALL_P (insn))
@@ -3594,10 +3560,9 @@ df_note_bb_compute (unsigned int bb_index,
struct df_mw_hardreg *mws = *mws_rec;
if ((DF_MWS_REG_DEF_P (mws))
&& !df_ignore_stack_reg (mws->start_regno))
- old_unused_notes
- = df_set_unused_notes_for_mw (insn, old_unused_notes,
- mws, live, do_not_gen,
- artificial_uses);
+ df_set_unused_notes_for_mw (insn,
+ mws, live, do_not_gen,
+ artificial_uses);
mws_rec++;
}
@@ -3609,9 +3574,8 @@ df_note_bb_compute (unsigned int bb_index,
unsigned int dregno = DF_REF_REGNO (def);
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER))
{
- old_unused_notes
- = df_create_unused_note (insn, old_unused_notes,
- def, live, artificial_uses);
+ df_create_unused_note (insn,
+ def, live, artificial_uses);
bitmap_set_bit (do_not_gen, dregno);
}
@@ -3627,10 +3591,9 @@ df_note_bb_compute (unsigned int bb_index,
{
struct df_mw_hardreg *mws = *mws_rec;
if (DF_MWS_REG_DEF_P (mws))
- old_unused_notes
- = df_set_unused_notes_for_mw (insn, old_unused_notes,
- mws, live, do_not_gen,
- artificial_uses);
+ df_set_unused_notes_for_mw (insn,
+ mws, live, do_not_gen,
+ artificial_uses);
mws_rec++;
}
@@ -3638,9 +3601,8 @@ df_note_bb_compute (unsigned int bb_index,
{
df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
- old_unused_notes
- = df_create_unused_note (insn, old_unused_notes,
- def, live, artificial_uses);
+ df_create_unused_note (insn,
+ def, live, artificial_uses);
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER))
bitmap_set_bit (do_not_gen, dregno);
@@ -3660,11 +3622,10 @@ df_note_bb_compute (unsigned int bb_index,
{
bool really_add_notes = debug_insn != 0;
- old_dead_notes
- = df_set_dead_notes_for_mw (insn, old_dead_notes,
- mws, live, do_not_gen,
- artificial_uses,
- &really_add_notes);
+ df_set_dead_notes_for_mw (insn,
+ mws, live, do_not_gen,
+ artificial_uses,
+ &really_add_notes);
if (really_add_notes)
debug_insn = -1;
@@ -3706,7 +3667,7 @@ df_note_bb_compute (unsigned int bb_index,
{
rtx reg = (DF_REF_LOC (use))
? *DF_REF_REAL_LOC (use) : DF_REF_REG (use);
- old_dead_notes = df_set_note (REG_DEAD, insn, old_dead_notes, reg);
+ df_set_note (REG_DEAD, insn, reg);
#ifdef REG_DEAD_DEBUGGING
df_print_note ("adding 4: ", insn, REG_NOTES (insn));
@@ -3717,19 +3678,6 @@ df_note_bb_compute (unsigned int bb_index,
}
}
- while (old_unused_notes)
- {
- rtx next = XEXP (old_unused_notes, 1);
- free_EXPR_LIST_node (old_unused_notes);
- old_unused_notes = next;
- }
- while (old_dead_notes)
- {
- rtx next = XEXP (old_dead_notes, 1);
- free_EXPR_LIST_node (old_dead_notes);
- old_dead_notes = next;
- }
-
if (debug_insn == -1)
{
/* ??? We could probably do better here, replacing dead
diff --git a/gcc/doc/arm-neon-intrinsics.texi b/gcc/doc/arm-neon-intrinsics.texi
index 0016111d247..a75e5821e2b 100644
--- a/gcc/doc/arm-neon-intrinsics.texi
+++ b/gcc/doc/arm-neon-intrinsics.texi
@@ -43,20 +43,18 @@
@itemize @bullet
-@item uint64x1_t vadd_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vadd.i64 @var{d0}, @var{d0}, @var{d0}}
+@item float32x2_t vadd_f32 (float32x2_t, float32x2_t)
+@*@emph{Form of expected instruction(s):} @code{vadd.f32 @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
-@item int64x1_t vadd_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vadd.i64 @var{d0}, @var{d0}, @var{d0}}
+@item uint64x1_t vadd_u64 (uint64x1_t, uint64x1_t)
@end itemize
@itemize @bullet
-@item float32x2_t vadd_f32 (float32x2_t, float32x2_t)
-@*@emph{Form of expected instruction(s):} @code{vadd.f32 @var{d0}, @var{d0}, @var{d0}}
+@item int64x1_t vadd_s64 (int64x1_t, int64x1_t)
@end itemize
@@ -1013,20 +1011,18 @@
@itemize @bullet
-@item uint64x1_t vsub_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vsub.i64 @var{d0}, @var{d0}, @var{d0}}
+@item float32x2_t vsub_f32 (float32x2_t, float32x2_t)
+@*@emph{Form of expected instruction(s):} @code{vsub.f32 @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
-@item int64x1_t vsub_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vsub.i64 @var{d0}, @var{d0}, @var{d0}}
+@item uint64x1_t vsub_u64 (uint64x1_t, uint64x1_t)
@end itemize
@itemize @bullet
-@item float32x2_t vsub_f32 (float32x2_t, float32x2_t)
-@*@emph{Form of expected instruction(s):} @code{vsub.f32 @var{d0}, @var{d0}, @var{d0}}
+@item int64x1_t vsub_s64 (int64x1_t, int64x1_t)
@end itemize
@@ -4750,13 +4746,11 @@
@itemize @bullet
@item uint64_t vget_lane_u64 (uint64x1_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{r0}, @var{r0}, @var{d0}}
@end itemize
@itemize @bullet
@item int64_t vget_lane_s64 (int64x1_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{r0}, @var{r0}, @var{d0}}
@end itemize
@@ -4886,13 +4880,11 @@
@itemize @bullet
@item uint64x1_t vset_lane_u64 (uint64_t, uint64x1_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@itemize @bullet
@item int64x1_t vset_lane_s64 (int64_t, int64x1_t, const int)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@@ -5081,13 +5073,11 @@
@itemize @bullet
@item uint64x1_t vdup_n_u64 (uint64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@itemize @bullet
@item int64x1_t vdup_n_s64 (int64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@@ -5147,13 +5137,11 @@
@itemize @bullet
@item uint64x2_t vdupq_n_u64 (uint64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@itemize @bullet
@item int64x2_t vdupq_n_s64 (int64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@@ -5213,13 +5201,11 @@
@itemize @bullet
@item uint64x1_t vmov_n_u64 (uint64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@itemize @bullet
@item int64x1_t vmov_n_s64 (int64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@@ -5279,13 +5265,11 @@
@itemize @bullet
@item uint64x2_t vmovq_n_u64 (uint64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@itemize @bullet
@item int64x2_t vmovq_n_s64 (int64_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{r0}, @var{r0}}
@end itemize
@@ -5572,32 +5556,30 @@
@itemize @bullet
-@item uint64x1_t vget_low_u64 (uint64x2_t)
+@item float32x2_t vget_low_f32 (float32x4_t)
@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
-@item int64x1_t vget_low_s64 (int64x2_t)
+@item poly16x4_t vget_low_p16 (poly16x8_t)
@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
-@item float32x2_t vget_low_f32 (float32x4_t)
+@item poly8x8_t vget_low_p8 (poly8x16_t)
@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
-@item poly16x4_t vget_low_p16 (poly16x8_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{d0}}
+@item uint64x1_t vget_low_u64 (uint64x2_t)
@end itemize
@itemize @bullet
-@item poly8x8_t vget_low_p8 (poly8x16_t)
-@*@emph{Form of expected instruction(s):} @code{vmov @var{d0}, @var{d0}}
+@item int64x1_t vget_low_s64 (int64x2_t)
@end itemize
@@ -9727,13 +9709,11 @@
@itemize @bullet
@item uint64x1_t vand_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vand @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
@item int64x1_t vand_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vand @var{d0}, @var{d0}, @var{d0}}
@end itemize
@@ -9827,13 +9807,11 @@
@itemize @bullet
@item uint64x1_t vorr_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vorr @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
@item int64x1_t vorr_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vorr @var{d0}, @var{d0}, @var{d0}}
@end itemize
@@ -9927,13 +9905,11 @@
@itemize @bullet
@item uint64x1_t veor_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{veor @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
@item int64x1_t veor_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{veor @var{d0}, @var{d0}, @var{d0}}
@end itemize
@@ -10027,13 +10003,11 @@
@itemize @bullet
@item uint64x1_t vbic_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vbic @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
@item int64x1_t vbic_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vbic @var{d0}, @var{d0}, @var{d0}}
@end itemize
@@ -10127,13 +10101,11 @@
@itemize @bullet
@item uint64x1_t vorn_u64 (uint64x1_t, uint64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vorn @var{d0}, @var{d0}, @var{d0}}
@end itemize
@itemize @bullet
@item int64x1_t vorn_s64 (int64x1_t, int64x1_t)
-@*@emph{Form of expected instruction(s):} @code{vorn @var{d0}, @var{d0}, @var{d0}}
@end itemize
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 4c2ac9b2b2a..0f64bcdadb0 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2760,14 +2760,14 @@ the @option{-maccumulate-outgoing-args} option.
@item ms_hook_prologue
@cindex @code{ms_hook_prologue} attribute
-On 32 bit i[34567]86-*-* targets, you can use this function attribute to make
-gcc generate the "hot-patching" function prologue used in Win32 API
-functions in Microsoft Windows XP Service Pack 2 and newer. This requires
-support for the swap suffix in the assembler. (GNU Binutils 2.19.51 or later)
+On 32 bit i[34567]86-*-* targets and 64 bit x86_64-*-* targets, you can use
+this function attribute to make gcc generate the "hot-patching" function
+prologue used in Win32 API functions in Microsoft Windows XP Service Pack 2
+and newer.
@item naked
@cindex function without a prologue/epilogue code
-Use this attribute on the ARM, AVR, IP2K, RX and SPU ports to indicate that
+Use this attribute on the ARM, AVR, MCORE, RX and SPU ports to indicate that
the specified function does not need prologue/epilogue sequences generated by
the compiler. It is up to the programmer to provide these sequences. The
only statements that can be safely included in naked functions are
@@ -8982,6 +8982,31 @@ used.
Generates the @code{pclmulqdq} machine instruction.
@end table
+The following built-in function is available when @option{-mfsgsbase} is
+used. All of them generate the machine instruction that is part of the
+name.
+
+@smallexample
+unsigned int __builtin_ia32_rdfsbase32 (void)
+unsigned long long __builtin_ia32_rdfsbase64 (void)
+unsigned int __builtin_ia32_rdgsbase32 (void)
+unsigned long long __builtin_ia32_rdgsbase64 (void)
+void _writefsbase_u32 (unsigned int)
+void _writefsbase_u64 (unsigned long long)
+void _writegsbase_u32 (unsigned int)
+void _writegsbase_u64 (unsigned long long)
+@end smallexample
+
+The following built-in function is available when @option{-mrdrnd} is
+used. All of them generate the machine instruction that is part of the
+name.
+
+@smallexample
+unsigned short __builtin_ia32_rdrand16 (void)
+unsigned int __builtin_ia32_rdrand32 (void)
+unsigned long long __builtin_ia32_rdrand64 (void)
+@end smallexample
+
The following built-in functions are available when @option{-msse4a} is used.
All of them generate the machine instruction that is part of the name.
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi
index 4d7a5d865bd..3dff70359f2 100644
--- a/gcc/doc/generic.texi
+++ b/gcc/doc/generic.texi
@@ -601,6 +601,7 @@ in hand, using @code{same_type_p}.
@tindex TYPE_DECL
@tindex VAR_DECL
@tindex PARM_DECL
+@tindex DEBUG_EXPR_DECL
@tindex FIELD_DECL
@tindex NAMESPACE_DECL
@tindex RESULT_DECL
@@ -726,6 +727,11 @@ wider type than the @code{TREE_TYPE} of the parameter; for example, the
ordinary type might be @code{short} while the @code{DECL_ARG_TYPE} is
@code{int}.
+@item DEBUG_EXPR_DECL
+Used to represent an anonymous debug-information temporary created to
+hold an expression as it is optimized away, so that its value can be
+referenced in debug bind statements.
+
@item FIELD_DECL
These nodes represent non-static data members. The @code{DECL_SIZE} and
@code{DECL_ALIGN} behave as for @code{VAR_DECL} nodes.
@@ -1116,6 +1122,7 @@ target system bytes are not the same width as host system bytes.
@subsection References to storage
@tindex ADDR_EXPR
@tindex INDIRECT_REF
+@tindex MEM_REF
@tindex ARRAY_REF
@tindex ARRAY_RANGE_REF
@tindex TARGET_MEM_REF
@@ -1176,6 +1183,13 @@ These nodes are used to represent the object pointed to by a pointer.
The operand is the pointer being dereferenced; it will always have
pointer or reference type.
+@item MEM_REF
+These nodes are used to represent the object pointed to by a pointer
+offset by a constant.
+The first operand is the pointer being dereferenced; it will always have
+pointer or reference type. The second operand is a pointer constant.
+Its type is specifying the type to be used for type-based alias analysis.
+
@item COMPONENT_REF
These nodes represent non-static data member accesses. The first
operand is the object (rather than a pointer to it); the second operand
diff --git a/gcc/doc/gimple.texi b/gcc/doc/gimple.texi
index 984f00bd65a..5e217a772da 100644
--- a/gcc/doc/gimple.texi
+++ b/gcc/doc/gimple.texi
@@ -333,6 +333,7 @@ The following table briefly describes the GIMPLE instruction set.
@item @code{GIMPLE_CALL} @tab x @tab x
@item @code{GIMPLE_CATCH} @tab x @tab
@item @code{GIMPLE_COND} @tab x @tab x
+@item @code{GIMPLE_DEBUG} @tab x @tab x
@item @code{GIMPLE_EH_FILTER} @tab x @tab
@item @code{GIMPLE_GOTO} @tab x @tab x
@item @code{GIMPLE_LABEL} @tab x @tab x
@@ -452,8 +453,8 @@ becomes
The same rule holds for arguments to a @code{GIMPLE_CALL}.
-The target of an assignment is usually a variable, but can also be an
-@code{INDIRECT_REF} or a compound lvalue as described below.
+The target of an assignment is usually a variable, but can also be a
+@code{MEM_REF} or a compound lvalue as described below.
@menu
* Compound Expressions::
@@ -664,6 +665,11 @@ Return true if t is a valid expression to use as the function
called by a @code{GIMPLE_CALL}.
@end deftypefn
+@deftypefn {GIMPLE function} is_gimple_mem_ref_addr (tree t)
+Return true if t is a valid expression to use as first operand
+of a @code{MEM_REF} expression.
+@end deftypefn
+
@deftypefn {GIMPLE function} is_gimple_constant (tree t)
Return true if t is a valid gimple constant.
@end deftypefn
@@ -902,6 +908,7 @@ Return a deep copy of statement @code{STMT}.
* @code{GIMPLE_CALL}::
* @code{GIMPLE_CATCH}::
* @code{GIMPLE_COND}::
+* @code{GIMPLE_DEBUG}::
* @code{GIMPLE_EH_FILTER}::
* @code{GIMPLE_LABEL}::
* @code{GIMPLE_NOP}::
@@ -1392,6 +1399,83 @@ Set the conditional @code{COND_STMT} to be of the form 'if (1 == 0)'.
Set the conditional @code{COND_STMT} to be of the form 'if (1 == 1)'.
@end deftypefn
+@node @code{GIMPLE_DEBUG}
+@subsection @code{GIMPLE_DEBUG}
+@cindex @code{GIMPLE_DEBUG}
+@cindex @code{GIMPLE_DEBUG_BIND}
+
+@deftypefn {GIMPLE function} gimple gimple_build_debug_bind (tree var, tree value, gimple stmt)
+Build a @code{GIMPLE_DEBUG} statement with @code{GIMPLE_DEBUG_BIND} of
+@code{subcode}. The effect of this statement is to tell debug
+information generation machinery that the value of user variable
+@code{var} is given by @code{value} at that point, and to remain with
+that value until @code{var} runs out of scope, a
+dynamically-subsequent debug bind statement overrides the binding, or
+conflicting values reach a control flow merge point. Even if
+components of the @code{value} expression change afterwards, the
+variable is supposed to retain the same value, though not necessarily
+the same location.
+
+It is expected that @code{var} be most often a tree for automatic user
+variables (@code{VAR_DECL} or @code{PARM_DECL}) that satisfy the
+requirements for gimple registers, but it may also be a tree for a
+scalarized component of a user variable (@code{ARRAY_REF},
+@code{COMPONENT_REF}), or a debug temporary (@code{DEBUG_EXPR_DECL}).
+
+As for @code{value}, it can be an arbitrary tree expression, but it is
+recommended that it be in a suitable form for a gimple assignment
+@code{RHS}. It is not expected that user variables that could appear
+as @code{var} ever appear in @code{value}, because in the latter we'd
+have their @code{SSA_NAME}s instead, but even if they were not in SSA
+form, user variables appearing in @code{value} are to be regarded as
+part of the executable code space, whereas those in @code{var} are to
+be regarded as part of the source code space. There is no way to
+refer to the value bound to a user variable within a @code{value}
+expression.
+
+If @code{value} is @code{GIMPLE_DEBUG_BIND_NOVALUE}, debug information
+generation machinery is informed that the variable @code{var} is
+unbound, i.e., that its value is indeterminate, which sometimes means
+it is really unavailable, and other times that the compiler could not
+keep track of it.
+
+Block and location information for the newly-created stmt are
+taken from @code{stmt}, if given.
+@end deftypefn
+
+@deftypefn {GIMPLE function} tree gimple_debug_bind_get_var (gimple stmt)
+Return the user variable @var{var} that is bound at @code{stmt}.
+@end deftypefn
+
+@deftypefn {GIMPLE function} tree gimple_debug_bind_get_value (gimple stmt)
+Return the value expression that is bound to a user variable at
+@code{stmt}.
+@end deftypefn
+
+@deftypefn {GIMPLE function} tree *gimple_debug_bind_get_value_ptr (gimple stmt)
+Return a pointer to the value expression that is bound to a user
+variable at @code{stmt}.
+@end deftypefn
+
+@deftypefn {GIMPLE function} void gimple_debug_bind_set_var (gimple stmt, tree var)
+Modify the user variable bound at @code{stmt} to @var{var}.
+@end deftypefn
+
+@deftypefn {GIMPLE function} void gimple_debug_bind_set_value (gimple stmt, tree var)
+Modify the value bound to the user variable bound at @code{stmt} to
+@var{value}.
+@end deftypefn
+
+@deftypefn {GIMPLE function} void gimple_debug_bind_reset_value (gimple stmt)
+Modify the value bound to the user variable bound at @code{stmt} so
+that the variable becomes unbound.
+@end deftypefn
+
+@deftypefn {GIMPLE function} bool gimple_debug_bind_has_value_p (gimple stmt)
+Return @code{TRUE} if @code{stmt} binds a user variable to a value,
+and @code{FALSE} if it unbinds the variable.
+@end deftypefn
+
@node @code{GIMPLE_EH_FILTER}
@subsection @code{GIMPLE_EH_FILTER}
@cindex @code{GIMPLE_EH_FILTER}
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 6492903bcdd..648f0977154 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -456,8 +456,13 @@ snapshots of the development sources are also available via FTP@.
Necessary when regenerating @file{Makefile} dependencies in libiberty.
Necessary when regenerating @file{libiberty/functions.texi}.
Necessary when generating manpages from Texinfo manuals.
-Necessary when targetting Darwin, building libstdc++,
+Necessary when targetting Darwin, building @samp{libstdc++},
and not using @option{--disable-symvers}.
+Necessary when targetting Solaris 2 with Sun @command{ld}, building
+@samp{libstdc++}, and not using @option{--disable-symvers}. A helper
+scripts needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
+included in Solaris~8. The bundled @command{perl} in Solaris~9 and up
+works.
Used by various scripts to generate some files included in SVN (mainly
Unicode-related and rarely changing) from source tables.
@@ -2893,6 +2898,8 @@ information are.
@item
@uref{#ix86-x-linux,,i?86-*-linux*}
@item
+@uref{#ix86-x-solaris289,,i?86-*-solaris2.[89]}
+@item
@uref{#ix86-x-solaris210,,i?86-*-solaris2.10}
@item
@uref{#ia64-x-linux,,ia64-*-linux}
@@ -3468,6 +3475,26 @@ found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
@html
<hr />
@end html
+@heading @anchor{ix86-x-solaris289}i?86-*-solaris2.[89]
+The Sun assembler in Solaris 8 and 9 has several bugs and limitations.
+While GCC works around them, several features are missing, so it is
+@c FIXME: which ones?
+recommended to use the GNU assembler instead. There is no bundled
+version, but the current version, from GNU binutils 2.20.1, is known to
+work.
+
+Solaris~2/x86 doesn't support the execution of SSE/SSE2 instructions
+before Solaris~9 4/04, even if the CPU supports them. Programs will
+receive @code{SIGILL} if they try. The fix is available both in
+Solaris~9 Update~6 and kernel patch 112234-12 or newer. There is no
+corresponding patch for Solaris 8. To avoid this problem,
+@option{-march} defaults to @samp{pentiumpro} on Solaris 8 and 9. If
+you have the patch installed, you can configure GCC with an appropriate
+@option{--with-arch} option, but need GNU @command{as} for SSE2 support.
+
+@html
+<hr />
+@end html
@heading @anchor{ix86-x-solaris210}i?86-*-solaris2.10
Use this for Solaris 10 or later on x86 and x86-64 systems. This
configuration is supported by GCC 4.0 and later versions only. Unlike
@@ -4109,6 +4136,12 @@ Solaris 10 cannot be used due to several bugs. Again, the current
version (2.20.1) is known to work, but generally lacks platform specific
features, so better stay with Sun @command{ld}.
+To enable symbol versioning in @samp{libstdc++} with Sun @command{ld},
+you need to have any version of GNU @command{c++filt}, which is part of
+GNU binutils. @samp{libstdc++} symbol versioning will be disabled if no
+appropriate version is found. Sun @command{c++filt} from the Sun Studio
+compilers does @emph{not} work.
+
Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
newer: @command{g++} will complain that types are missing. These headers
assume that omitting the type means @code{int}; this assumption worked for
@@ -4132,6 +4165,29 @@ There are patches for Solaris 8 (117350-12 or newer for SPARC,
117351-12 or newer for Intel) and Solaris 9 (117171-11 or newer for
SPARC, 117172-11 or newer for Intel) that address this problem.
+Solaris~8 provides an alternate implementation of the thread libraries,
+@samp{libpthread} and @samp{libthread}. They are required for TLS
+support and have been made the default in Solaris~9, so they are always
+used on Solaris~8.
+
+Thread-local storage (TLS) is supported in Solaris~8 and 9, but requires
+some patches. The @samp{libthread} patches provide the
+@code{__tls_get_addr} (SPARC, 64-bit x86) resp.@ @code{___tls_get_addr}
+(32-bit x86) functions. On Solaris~8, you need 108993-26 or newer on
+SPARC, 108994-26 or newer on Intel. On Solaris~9, the necessary support
+on SPARC is present since FCS, while 114432-05 or newer is reqired on
+Intel. Additionally, on Solaris~8, patch 109147-14 or newer on SPARC or
+109148-22 or newer on Intel are required for the Sun @command{ld} and
+runtime linker (@command{ld.so.1}) support. Again, Solaris~9/SPARC
+works since FCS, while 113986-02 is required on Intel. The linker
+patches must be installed even if GNU @command{ld} is used. Sun
+@command{as} in Solaris~8 and 9 doesn't support the necessary
+relocations, so GNU @command{as} must be used. The @command{configure}
+script checks for those prerequisites and automatically enables TLS
+support if they are met. Although those minimal patch versions should
+work, it is recommended to use the latest patch versions which include
+additional bug fixes.
+
@html
<hr />
@end html
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 21740c1523c..9459ec2b558 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -260,8 +260,8 @@ Objective-C and Objective-C++ Dialects}.
-Wstrict-overflow -Wstrict-overflow=@var{n} @gol
-Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
-Wswitch -Wswitch-default -Wswitch-enum -Wsync-nand @gol
--Wsystem-headers -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized @gol
--Wunknown-pragmas -Wno-pragmas @gol
+-Wsystem-headers -Wtrampolines -Wtrigraphs -Wtype-limits -Wundef @gol
+-Wuninitialized -Wunknown-pragmas -Wno-pragmas @gol
-Wunsuffixed-float-constants -Wunused -Wunused-function @gol
-Wunused-label -Wunused-parameter -Wno-unused-result -Wunused-value -Wunused-variable @gol
-Wunused-but-set-parameter -Wunused-but-set-variable -Wvariadic-macros -Wvla @gol
@@ -342,7 +342,7 @@ Objective-C and Objective-C++ Dialects}.
-fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
-ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
-fforward-propagate -ffunction-sections @gol
--fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
+-fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
@@ -352,7 +352,7 @@ Objective-C and Objective-C++ Dialects}.
-fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
-fivopts -fkeep-inline-functions -fkeep-static-consts @gol
--floop-block -floop-interchange -floop-strip-mine -fgraphite-identity @gol
+-floop-block -floop-interchange -floop-strip-mine @gol
-floop-parallelize-all -flto -flto-compression-level -flto-report -fltrans @gol
-fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
@@ -382,8 +382,8 @@ Objective-C and Objective-C++ Dialects}.
-fsplit-wide-types -fstack-protector -fstack-protector-all @gol
-fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
-ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
--ftree-copyrename -ftree-dce @gol
--ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
+-ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
+-ftree-forwprop -ftree-fre -ftree-loop-if-convert -ftree-loop-im @gol
-ftree-phiprop -ftree-loop-distribution @gol
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
@@ -591,7 +591,7 @@ Objective-C and Objective-C++ Dialects}.
-mincoming-stack-boundary=@var{num}
-mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
-mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
--maes -mpclmul -mfused-madd @gol
+-maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfused-madd @gol
-msse4a -m3dnow -mpopcnt -mabm -mfma4 -mxop -mlwp @gol
-mthreads -mno-align-stringops -minline-all-stringops @gol
-minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
@@ -772,6 +772,7 @@ See RS/6000 and PowerPC Options.
-mcall-sysv -mcall-netbsd @gol
-maix-struct-return -msvr4-struct-return @gol
-mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
+-mblock-move-inline-limit=@var{num} @gol
-misel -mno-isel @gol
-misel=yes -misel=no @gol
-mspe -mno-spe @gol
@@ -3724,6 +3725,18 @@ code. However, note that using @option{-Wall} in conjunction with this
option will @emph{not} warn about unknown pragmas in system
headers---for that, @option{-Wunknown-pragmas} must also be used.
+@item -Wtrampolines
+@opindex Wtrampolines
+@opindex Wno-trampolines
+ Warn about trampolines generated for pointers to nested functions.
+
+ A trampoline is a small piece of data or code that is created at run
+ time on the stack when the address of a nested function is taken, and
+ is used to call the nested function indirectly. For some targets, it
+ is made up of data only and thus requires no special treatment. But,
+ for most targets, it is made up of code and thus requires the stack
+ to be made executable in order for the program to work properly.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
@@ -3859,8 +3872,10 @@ Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
@item -Wshadow
@opindex Wshadow
@opindex Wno-shadow
-Warn whenever a local variable shadows another local variable, parameter or
-global variable or whenever a built-in function is shadowed.
+Warn whenever a local variable or type declaration shadows another variable,
+parameter, type, or class member (in C++), or whenever a built-in function
+is shadowed. Note that in C++, the compiler will not warn if a local variable
+shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
@item -Wlarger-than=@var{len}
@opindex Wlarger-than=@var{len}
@@ -6881,6 +6896,13 @@ profitable to parallelize the loops.
Compare the results of several data dependence analyzers. This option
is used for debugging the data dependence analyzers.
+@item -ftree-loop-if-convert
+Attempt to transform conditional jumps in the innermost loops to
+branch-less equivalents. The intent is to remove control-flow from
+the innermost loops in order to improve the ability of the
+vectorization pass to handle these loops. This is enabled by default
+if vectorization is enabled.
+
@item -ftree-loop-distribution
Perform loop distribution. This flag can improve cache performance on
big loop bodies and allow further loop optimizations, like
@@ -9976,6 +9998,14 @@ of GCC@.
If @option{-msoft-float} is specified this specifies the format of
floating point values.
+If the selected floating-point hardware includes the NEON extension
+(e.g. @option{-mfpu}=@samp{neon}), note that floating-point
+operations will not be used by GCC's auto-vectorization pass unless
+@option{-funsafe-math-optimizations} is also specified. This is
+because NEON hardware does not fully implement the IEEE 754 standard for
+floating-point arithmetic (in particular denormal values are treated as
+zero), so the use of NEON instructions may lead to a loss of precision.
+
@item -mfp16-format=@var{name}
@opindex mfp16-format
Specify the format of the @code{__fp16} half-precision floating-point type.
@@ -12216,6 +12246,12 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@itemx -mno-aes
@itemx -mpclmul
@itemx -mno-pclmul
+@itemx -mfsgsbase
+@itemx -mno-fsgsbase
+@itemx -mrdrnd
+@itemx -mno-rdrnd
+@itemx -mf16c
+@itemx -mno-f16c
@itemx -msse4a
@itemx -mno-sse4a
@itemx -mfma4
@@ -12237,8 +12273,8 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@opindex m3dnow
@opindex mno-3dnow
These switches enable or disable the use of instructions in the MMX,
-SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, FMA4, XOP,
-LWP, ABM or 3DNow!@: extended instruction sets.
+SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
+F16C, SSE4A, FMA4, XOP, LWP, ABM or 3DNow!@: extended instruction sets.
These extensions are also available as built-in functions: see
@ref{X86 Built-in Functions}, for details of the functions enabled and
disabled by these switches.
@@ -15591,6 +15627,13 @@ On embedded PowerPC systems, put all initialized global and static data
in the @samp{.data} section, and all uninitialized data in the
@samp{.bss} section.
+@item -mblock-move-inline-limit=@var{num}
+@opindex mblock-move-inline-limit
+Inline all block moves (such as calls to @code{memcpy} or structure
+copies) less than or equal to @var{num} bytes. The minimum value for
+@var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
+targets. The default value is target-specific.
+
@item -G @var{num}
@opindex G
@cindex smaller data references (PowerPC)
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 4681a7104b6..4c15e8fab1d 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -38,6 +38,7 @@ form uses nested parentheses to indicate the pointers in the internal form.
* Side Effects:: Expressions for storing in registers, etc.
* Incdec:: Embedded side-effects for autoincrement addressing.
* Assembler:: Representing @code{asm} with operands.
+* Debug Information:: Expressions representing debugging information.
* Insns:: Expression types for entire insns.
* Calls:: RTL representation of function call insns.
* Sharing:: Some expressions are unique; others *must* be copied.
@@ -3285,6 +3286,38 @@ template and vectors, but each contains the constraint for the respective
output operand. They are also distinguished by the output-operand index
number, which is 0, 1, @dots{} for successive output operands.
+@node Debug Information
+@section Variable Location Debug Information in RTL
+@cindex Variable Location Debug Information in RTL
+
+Variable tracking relies on @code{MEM_EXPR} and @code{REG_EXPR}
+annotations to determine what user variables memory and register
+references refer to.
+
+Variable tracking at assignments uses these notes only when they refer
+to variables that live at fixed locations (e.g., addressable
+variables, global non-automatic variables). For variables whose
+location may vary, it relies on the following types of notes.
+
+@table @code
+@findex var_location
+@item (var_location:@var{mode} @var{var} @var{exp} @var{stat})
+Binds variable @code{var}, a tree, to value @var{exp}, an RTL
+expression. It appears only in @code{NOTE_INSN_VAR_LOCATION} and
+@code{DEBUG_INSN}s, with slightly different meanings. @var{mode}, if
+present, represents the mode of @var{exp}, which is useful if it is a
+modeless expression. @var{stat} is only meaningful in notes,
+indicating whether the variable is known to be initialized or
+uninitialized.
+
+@findex debug_expr
+@item (debug_expr:@var{mode} @var{decl})
+Stands for the value bound to the @code{DEBUG_EXPR_DECL} @var{decl},
+that points back to it, within value expressions in
+@code{VAR_LOCATION} nodes.
+
+@end table
+
@node Insns
@section Insns
@cindex insns
@@ -3360,7 +3393,7 @@ of @code{PREV_INSN (NEXT_INSN (@var{insn}))} if @var{insn} is the last
insn in the @code{sequence} expression. You can use these expressions
to find the containing @code{sequence} expression.
-Every insn has one of the following six expression codes:
+Every insn has one of the following expression codes:
@table @code
@findex insn
@@ -3551,9 +3584,54 @@ invariants.
Appears at the start of the function body, after the function
prologue.
+@findex NOTE_INSN_VAR_LOCATION
+@findex NOTE_VAR_LOCATION
+@item NOTE_INSN_VAR_LOCATION
+This note is used to generate variable location debugging information.
+It indicates that the user variable in its @code{VAR_LOCATION} operand
+is at the location given in the RTL expression, or holds a value that
+can be computed by evaluating the RTL expression from that static
+point in the program up to the next such note for the same user
+variable.
+
@end table
These codes are printed symbolically when they appear in debugging dumps.
+
+@findex debug_insn
+@findex INSN_VAR_LOCATION
+@item debug_insn
+The expression code @code{debug_insn} is used for pseudo-instructions
+that hold debugging information for variable tracking at assignments
+(see @option{-fvar-tracking-assignments} option). They are the RTL
+representation of @code{GIMPLE_DEBUG} statements
+(@ref{@code{GIMPLE_DEBUG}}), with a @code{VAR_LOCATION} operand that
+binds a user variable tree to an RTL representation of the
+@code{value} in the corresponding statement. A @code{DEBUG_EXPR} in
+it stands for the value bound to the corresponding
+@code{DEBUG_EXPR_DECL}.
+
+Throughout optimization passes, binding information is kept in
+pseudo-instruction form, so that, unlike notes, it gets the same
+treatment and adjustments that regular instructions would. It is the
+variable tracking pass that turns these pseudo-instructions into var
+location notes, analyzing control flow, value equivalences and changes
+to registers and memory referenced in value expressions, propagating
+the values of debug temporaries and determining expressions that can
+be used to compute the value of each user variable at as many points
+(ranges, actually) in the program as possible.
+
+Unlike @code{NOTE_INSN_VAR_LOCATION}, the value expression in an
+@code{INSN_VAR_LOCATION} denotes a value at that specific point in the
+program, rather than an expression that can be evaluated at any later
+point before an overriding @code{VAR_LOCATION} is encountered. E.g.,
+if a user variable is bound to a @code{REG} and then a subsequent insn
+modifies the @code{REG}, the note location would keep mapping the user
+variable to the register across the insn, whereas the insn location
+would keep the variable bound to the value, so that the variable
+tracking pass would emit another location note for the variable at the
+point in which the register is modified.
+
@end table
@cindex @code{TImode}, in @code{insn}
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index cb116a93f57..e78158ffc96 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1604,9 +1604,18 @@ Target uses a ColdFire FPU.
@item hard_float
Target supports FPU instructions.
+@item sse
+Target supports compiling @code{sse} instructions.
+
+@item sse_runtime
+Target supports the execution of @code{sse} instructions.
+
@item sse2
Target supports compiling @code{sse2} instructions.
+@item sse2_runtime
+Target supports the execution of @code{sse2} instructions.
+
@item sync_char_short
Target supports atomic operations on @code{char} and @code{short}.
@@ -1870,6 +1879,16 @@ The supported values of @var{feature} for directive @code{dg-add-options}
are:
@table @code
+@item arm_neon
+NEON support. Only ARM targets support this feature, and only then
+in certain modes; see the @ref{arm_neon_ok,,arm_neon_ok effective target
+keyword}.
+
+@item arm_neon_fp16
+NEON and half-precision floating point support. Only ARM targets
+support this feature, and only then in certain modes; see
+the @ref{arm_neon_ok,,arm_neon_fp16_ok effective target keyword}.
+
@item bind_pic_locally
Add the target-specific flags needed to enable functions to bind
locally when using pic/PIC passes in the testsuite.
@@ -1885,15 +1904,8 @@ compliance mode.
@code{mips16} function attributes.
Only MIPS targets support this feature, and only then in certain modes.
-@item arm_neon
-NEON support. Only ARM targets support this feature, and only then
-in certain modes; see the @ref{arm_neon_ok,,arm_neon_ok effective target
-keyword}.
-
-@item arm_neon_fp16
-NEON and half-precision floating point support. Only ARM targets
-support this feature, and only then in certain modes; see
-the @ref{arm_neon_ok,,arm_neon_fp16_ok effective target keyword}.
+@item tls
+Add the target-specific flags needed to use thread-local storage.
@end table
@node Require Support
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index d6bc604b7ee..30210ecc0ae 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -842,6 +842,25 @@ pointer. If this macro is defined, GCC will turn on the
@option{-fomit-frame-pointer} option whenever @option{-O} is specified.
@end defmac
+@defmac SWITCHABLE_TARGET
+Some targets need to switch between substantially different subtargets
+during compilation. For example, the MIPS target has one subtarget for
+the traditional MIPS architecture and another for MIPS16. Source code
+can switch between these two subarchitectures using the @code{mips16}
+and @code{nomips16} attributes.
+
+Such subtargets can differ in things like the set of available
+registers, the set of available instructions, the costs of various
+operations, and so on. GCC caches a lot of this type of information
+in global variables, and recomputing them for each subtarget takes a
+significant amount of time. The compiler therefore provides a facility
+for maintaining several versions of the global variables and quickly
+switching between them; see @file{target-globals.h} for details.
+
+Define this macro to 1 if your target needs this facility. The default
+is 0.
+@end defmac
+
@node Per-Function Data
@section Defining data structures for per-function information.
@cindex per-function data
@@ -4988,33 +5007,8 @@ to use them for its own purposes.
@c 10feb93
@end defmac
-@defmac __builtin_args_info (@var{category})
-Use this built-in function to find the first anonymous arguments in
-registers.
-
-In general, a machine may have several categories of registers used for
-arguments, each for a particular category of data types. (For example,
-on some machines, floating-point registers are used for floating-point
-arguments while other arguments are passed in the general registers.)
-To make non-varargs functions use the proper calling convention, you
-have defined the @code{CUMULATIVE_ARGS} data type to record how many
-registers in each category have been used so far
-
-@code{__builtin_args_info} accesses the same data structure of type
-@code{CUMULATIVE_ARGS} after the ordinary argument layout is finished
-with it, with @var{category} specifying which word to access. Thus, the
-value indicates the first unused register in a given category.
-
-Normally, you would use @code{__builtin_args_info} in the implementation
-of @code{va_start}, accessing each category just once and storing the
-value in the @code{va_list} object. This is because @code{va_list} will
-have to update the values, and there is no way to alter the
-values accessed by @code{__builtin_args_info}.
-@end defmac
-
@defmac __builtin_next_arg (@var{lastarg})
-This is the equivalent of @code{__builtin_args_info}, for stack
-arguments. It returns the address of the first anonymous stack
+This builtin returns the address of the first anonymous stack
argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
returns the address of the location above the first anonymous stack
argument. Use it in @code{va_start} to initialize the pointer for
@@ -5706,8 +5700,10 @@ preserved (e.g.@: used only by a reduction computation). Otherwise, the
@code{widen_mult_hi/lo} idioms will be used.
@end deftypefn
-@deftypefn {Target Hook} int TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST (enum vect_cost_for_stmt @var{type_of_cost})
+@deftypefn {Target Hook} int TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST (enum vect_cost_for_stmt @var{type_of_cost}, tree @var{vectype}, int @var{misalign})
Returns cost of different scalar or vector statements for vectorization cost model.
+For vector memory operations the cost may depend on type (@var{vectype}) and
+misalignment value (@var{misalign}).
@end deftypefn
@deftypefn {Target Hook} bool TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE (const_tree @var{type}, bool @var{is_packed})
@@ -7659,6 +7655,19 @@ assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
@end defmac
+@defmac ASM_OUTPUT_FUNCTION_LABEL (@var{stream}, @var{name}, @var{decl})
+A C statement (sans semicolon) to output to the stdio stream
+@var{stream} the assembler definition of a label named @var{name} of
+a function.
+Use the expression @code{assemble_name (@var{stream}, @var{name})} to
+output the name itself; before and after that, output the additional
+assembler syntax for defining the name, and a newline. A default
+definition of this macro is provided which is correct for most systems.
+
+If this macro is not defined, then the function name is defined in the
+usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
+@end defmac
+
@findex assemble_name_raw
@defmac ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{name})
Identical to @code{ASM_OUTPUT_LABEL}, except that @var{name} is known
@@ -7742,11 +7751,11 @@ A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name @var{name} of a
function which is being defined. This macro is responsible for
outputting the label definition (perhaps using
-@code{ASM_OUTPUT_LABEL}). The argument @var{decl} is the
+@code{ASM_OUTPUT_FUNCTION_LABEL}). The argument @var{decl} is the
@code{FUNCTION_DECL} tree node representing the function.
If this macro is not defined, then the function name is defined in the
-usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
+usual manner as a label (by means of @code{ASM_OUTPUT_FUNCTION_LABEL}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in the definition
of this macro.
@@ -9276,6 +9285,10 @@ line debug info sections. This will result in much more compact line number
tables, and hence is desirable if it works.
@end defmac
+@deftypevr {Target Hook} bool TARGET_WANT_DEBUG_PUB_SECTIONS
+True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them.
+@end deftypevr
+
@defmac ASM_OUTPUT_DWARF_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2})
A C statement to issue assembly directives that create a difference
@var{lab1} minus @var{lab2}, using an integer of the given @var{size}.
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 083d56ffd3b..b5c75d3ec90 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -842,6 +842,25 @@ pointer. If this macro is defined, GCC will turn on the
@option{-fomit-frame-pointer} option whenever @option{-O} is specified.
@end defmac
+@defmac SWITCHABLE_TARGET
+Some targets need to switch between substantially different subtargets
+during compilation. For example, the MIPS target has one subtarget for
+the traditional MIPS architecture and another for MIPS16. Source code
+can switch between these two subarchitectures using the @code{mips16}
+and @code{nomips16} attributes.
+
+Such subtargets can differ in things like the set of available
+registers, the set of available instructions, the costs of various
+operations, and so on. GCC caches a lot of this type of information
+in global variables, and recomputing them for each subtarget takes a
+significant amount of time. The compiler therefore provides a facility
+for maintaining several versions of the global variables and quickly
+switching between them; see @file{target-globals.h} for details.
+
+Define this macro to 1 if your target needs this facility. The default
+is 0.
+@end defmac
+
@node Per-Function Data
@section Defining data structures for per-function information.
@cindex per-function data
@@ -4988,33 +5007,8 @@ to use them for its own purposes.
@c 10feb93
@end defmac
-@defmac __builtin_args_info (@var{category})
-Use this built-in function to find the first anonymous arguments in
-registers.
-
-In general, a machine may have several categories of registers used for
-arguments, each for a particular category of data types. (For example,
-on some machines, floating-point registers are used for floating-point
-arguments while other arguments are passed in the general registers.)
-To make non-varargs functions use the proper calling convention, you
-have defined the @code{CUMULATIVE_ARGS} data type to record how many
-registers in each category have been used so far
-
-@code{__builtin_args_info} accesses the same data structure of type
-@code{CUMULATIVE_ARGS} after the ordinary argument layout is finished
-with it, with @var{category} specifying which word to access. Thus, the
-value indicates the first unused register in a given category.
-
-Normally, you would use @code{__builtin_args_info} in the implementation
-of @code{va_start}, accessing each category just once and storing the
-value in the @code{va_list} object. This is because @code{va_list} will
-have to update the values, and there is no way to alter the
-values accessed by @code{__builtin_args_info}.
-@end defmac
-
@defmac __builtin_next_arg (@var{lastarg})
-This is the equivalent of @code{__builtin_args_info}, for stack
-arguments. It returns the address of the first anonymous stack
+This builtin returns the address of the first anonymous stack
argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
returns the address of the location above the first anonymous stack
argument. Use it in @code{va_start} to initialize the pointer for
@@ -5708,6 +5702,8 @@ preserved (e.g.@: used only by a reduction computation). Otherwise, the
@hook TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST
Returns cost of different scalar or vector statements for vectorization cost model.
+For vector memory operations the cost may depend on type (@var{vectype}) and
+misalignment value (@var{misalign}).
@end deftypefn
@hook TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE
@@ -7658,6 +7654,19 @@ assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
@end defmac
+@defmac ASM_OUTPUT_FUNCTION_LABEL (@var{stream}, @var{name}, @var{decl})
+A C statement (sans semicolon) to output to the stdio stream
+@var{stream} the assembler definition of a label named @var{name} of
+a function.
+Use the expression @code{assemble_name (@var{stream}, @var{name})} to
+output the name itself; before and after that, output the additional
+assembler syntax for defining the name, and a newline. A default
+definition of this macro is provided which is correct for most systems.
+
+If this macro is not defined, then the function name is defined in the
+usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
+@end defmac
+
@findex assemble_name_raw
@defmac ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{name})
Identical to @code{ASM_OUTPUT_LABEL}, except that @var{name} is known
@@ -7741,11 +7750,11 @@ A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name @var{name} of a
function which is being defined. This macro is responsible for
outputting the label definition (perhaps using
-@code{ASM_OUTPUT_LABEL}). The argument @var{decl} is the
+@code{ASM_OUTPUT_FUNCTION_LABEL}). The argument @var{decl} is the
@code{FUNCTION_DECL} tree node representing the function.
If this macro is not defined, then the function name is defined in the
-usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
+usual manner as a label (by means of @code{ASM_OUTPUT_FUNCTION_LABEL}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in the definition
of this macro.
@@ -9275,6 +9284,8 @@ line debug info sections. This will result in much more compact line number
tables, and hence is desirable if it works.
@end defmac
+@hook TARGET_WANT_DEBUG_PUB_SECTIONS
+
@defmac ASM_OUTPUT_DWARF_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2})
A C statement to issue assembly directives that create a difference
@var{lab1} minus @var{lab2}, using an integer of the given @var{size}.
diff --git a/gcc/dominance.c b/gcc/dominance.c
index 9c2dcf03707..2e5f3ee26a2 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -41,6 +41,7 @@
#include "hard-reg-set.h"
#include "obstack.h"
#include "basic-block.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "et-forest.h"
#include "timevar.h"
diff --git a/gcc/double-int.c b/gcc/double-int.c
index aa175e89d41..924e91b6c90 100644
--- a/gcc/double-int.c
+++ b/gcc/double-int.c
@@ -69,71 +69,6 @@ decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low,
*hi = words[2] + words[3] * BASE;
}
-/* Force the double-word integer L1, H1 to be within the range of the
- integer type TYPE. Stores the properly truncated and sign-extended
- double-word integer in *LV, *HV. Returns true if the operation
- overflows, that is, argument and result are different. */
-
-int
-fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
- unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type)
-{
- unsigned HOST_WIDE_INT low0 = l1;
- HOST_WIDE_INT high0 = h1;
- unsigned int prec = TYPE_PRECISION (type);
- int sign_extended_type;
-
- /* Size types *are* sign extended. */
- sign_extended_type = (!TYPE_UNSIGNED (type)
- || (TREE_CODE (type) == INTEGER_TYPE
- && TYPE_IS_SIZETYPE (type)));
-
- /* First clear all bits that are beyond the type's precision. */
- if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
- ;
- else if (prec > HOST_BITS_PER_WIDE_INT)
- h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT));
- else
- {
- h1 = 0;
- if (prec < HOST_BITS_PER_WIDE_INT)
- l1 &= ~((HOST_WIDE_INT) (-1) << prec);
- }
-
- /* Then do sign extension if necessary. */
- if (!sign_extended_type)
- /* No sign extension */;
- else if (prec >= 2 * HOST_BITS_PER_WIDE_INT)
- /* Correct width already. */;
- else if (prec > HOST_BITS_PER_WIDE_INT)
- {
- /* Sign extend top half? */
- if (h1 & ((unsigned HOST_WIDE_INT)1
- << (prec - HOST_BITS_PER_WIDE_INT - 1)))
- h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT);
- }
- else if (prec == HOST_BITS_PER_WIDE_INT)
- {
- if ((HOST_WIDE_INT)l1 < 0)
- h1 = -1;
- }
- else
- {
- /* Sign extend bottom half? */
- if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1)))
- {
- h1 = -1;
- l1 |= (HOST_WIDE_INT)(-1) << prec;
- }
- }
-
- *lv = l1;
- *hv = h1;
-
- /* If the value didn't fit, signal overflow. */
- return l1 != low0 || h1 != high0;
-}
-
/* Add two doubleword integers with doubleword result.
Return nonzero if the operation overflows according to UNSIGNED_P.
Each argument is given as two `HOST_WIDE_INT' pieces.
@@ -792,6 +727,17 @@ double_int_add (double_int a, double_int b)
return ret;
}
+/* Returns A - B. */
+
+double_int
+double_int_sub (double_int a, double_int b)
+{
+ double_int ret;
+ neg_double (b.low, b.high, &b.low, &b.high);
+ add_double (a.low, a.high, b.low, b.high, &ret.low, &ret.high);
+ return ret;
+}
+
/* Returns -A. */
double_int
diff --git a/gcc/double-int.h b/gcc/double-int.h
index 6af0757990c..00ec4efdad1 100644
--- a/gcc/double-int.h
+++ b/gcc/double-int.h
@@ -133,6 +133,7 @@ double_int_fits_in_uhwi_p (double_int cst)
double_int double_int_mul (double_int, double_int);
double_int double_int_add (double_int, double_int);
+double_int double_int_sub (double_int, double_int);
double_int double_int_neg (double_int);
/* You must ensure that double_int_ext is called on the operands
@@ -269,9 +270,6 @@ double_int_equal_p (double_int cst1, double_int cst2)
/* Legacy interface with decomposed high/low parts. */
-extern int fit_double_type (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
- const_tree);
extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
unsigned HOST_WIDE_INT, HOST_WIDE_INT,
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index a72771df2f8..68b64832829 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2791,6 +2791,12 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
insn = PATTERN (insn);
found:
dwarf2out_frame_debug_expr (insn, label);
+
+ /* Check again. A parallel can save and update the same register.
+ We could probably check just once, here, but this is safer than
+ removing the check above. */
+ if (clobbers_queued_reg_save (insn))
+ flush_queued_reg_saves ();
}
/* Determine if we need to save and restore CFI information around this
@@ -4928,10 +4934,28 @@ output_loc_operands (dw_loc_descr_ref loc)
dw2_asm_output_data (2, val1->v.val_int, NULL);
break;
case DW_OP_const4u:
+ if (loc->dtprel)
+ {
+ gcc_assert (targetm.asm_out.output_dwarf_dtprel);
+ targetm.asm_out.output_dwarf_dtprel (asm_out_file, 4,
+ val1->v.val_addr);
+ fputc ('\n', asm_out_file);
+ break;
+ }
+ /* FALLTHRU */
case DW_OP_const4s:
dw2_asm_output_data (4, val1->v.val_int, NULL);
break;
case DW_OP_const8u:
+ if (loc->dtprel)
+ {
+ gcc_assert (targetm.asm_out.output_dwarf_dtprel);
+ targetm.asm_out.output_dwarf_dtprel (asm_out_file, 8,
+ val1->v.val_addr);
+ fputc ('\n', asm_out_file);
+ break;
+ }
+ /* FALLTHRU */
case DW_OP_const8s:
gcc_assert (HOST_BITS_PER_WIDE_INT >= 64);
dw2_asm_output_data (8, val1->v.val_int, NULL);
@@ -6385,11 +6409,6 @@ static void gen_remaining_tmpl_value_param_die_attribute (void);
#define DEBUG_MACINFO_SECTION_LABEL "Ldebug_macinfo"
#endif
-/* Mangled name attribute to use. This used to be a vendor extension
- until DWARF 4 standardized it. */
-#define AT_linkage_name \
- (dwarf_version >= 4 ? DW_AT_linkage_name : DW_AT_MIPS_linkage_name)
-
/* Definitions of defaults for formats and names of various special
(artificial) labels which may be generated within this file (when the -g
@@ -11230,6 +11249,8 @@ output_comdat_type_unit (comdat_type_node *node)
static const char *
dwarf2_name (tree decl, int scope)
{
+ if (DECL_NAMELESS (decl))
+ return NULL;
return lang_hooks.dwarf_name (decl, scope ? 1 : 0);
}
@@ -11238,17 +11259,20 @@ dwarf2_name (tree decl, int scope)
static void
add_pubname_string (const char *str, dw_die_ref die)
{
- pubname_entry e;
+ if (targetm.want_debug_pub_sections)
+ {
+ pubname_entry e;
- e.die = die;
- e.name = xstrdup (str);
- VEC_safe_push (pubname_entry, gc, pubname_table, &e);
+ e.die = die;
+ e.name = xstrdup (str);
+ VEC_safe_push (pubname_entry, gc, pubname_table, &e);
+ }
}
static void
add_pubname (tree decl, dw_die_ref die)
{
- if (TREE_PUBLIC (decl))
+ if (targetm.want_debug_pub_sections && TREE_PUBLIC (decl))
{
const char *name = dwarf2_name (decl, 1);
if (name)
@@ -11263,6 +11287,9 @@ add_pubtype (tree decl, dw_die_ref die)
{
pubname_entry e;
+ if (!targetm.want_debug_pub_sections)
+ return;
+
e.name = NULL;
if ((TREE_PUBLIC (decl)
|| die->die_parent == comp_unit_die)
@@ -12999,6 +13026,26 @@ reg_loc_descriptor (rtx rtl, enum var_init_status initialized)
if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
return 0;
+ /* We only use "frame base" when we're sure we're talking about the
+ post-prologue local stack frame. We do this by *not* running
+ register elimination until this point, and recognizing the special
+ argument pointer and soft frame pointer rtx's.
+ Use DW_OP_fbreg offset DW_OP_stack_value in this case. */
+ if ((rtl == arg_pointer_rtx || rtl == frame_pointer_rtx)
+ && eliminate_regs (rtl, VOIDmode, NULL_RTX) != rtl)
+ {
+ dw_loc_descr_ref result = NULL;
+
+ if (dwarf_version >= 4 || !dwarf_strict)
+ {
+ result = mem_loc_descriptor (rtl, VOIDmode, initialized);
+ if (result)
+ add_loc_descr (&result,
+ new_loc_descr (DW_OP_stack_value, 0, 0));
+ }
+ return result;
+ }
+
regs = targetm.dwarf_register_span (rtl);
if (hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)] > 1 || regs)
@@ -13565,7 +13612,11 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
if (!targetm.have_tls || !targetm.asm_out.output_dwarf_dtprel)
break;
- temp = new_loc_descr (DW_OP_addr, 0, 0);
+ /* We used to emit DW_OP_addr here, but that's wrong, since
+ DW_OP_addr should be relocated by the debug info consumer,
+ while DW_OP_GNU_push_tls_address operand should not. */
+ temp = new_loc_descr (DWARF2_ADDR_SIZE == 4
+ ? DW_OP_const4u : DW_OP_const8u, 0, 0);
temp->dw_loc_oprnd1.val_class = dw_val_class_addr;
temp->dw_loc_oprnd1.v.val_addr = rtl;
temp->dtprel = true;
@@ -14211,11 +14262,6 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
loc_result = reg_loc_descriptor (rtl, initialized);
break;
- case SIGN_EXTEND:
- case ZERO_EXTEND:
- loc_result = loc_descriptor (XEXP (rtl, 0), mode, initialized);
- break;
-
case MEM:
loc_result = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl),
initialized);
@@ -15050,10 +15096,13 @@ loc_list_from_tree (tree loc, int want_address)
/* The way DW_OP_GNU_push_tls_address is specified, we
can only look up addresses of objects in the current
- module. */
+ module. We used DW_OP_addr as first op, but that's
+ wrong, because DW_OP_addr is relocated by the debug
+ info consumer, while DW_OP_GNU_push_tls_address
+ operand shouldn't be. */
if (DECL_EXTERNAL (loc) && !targetm.binds_local_p (loc))
return 0;
- first_op = DW_OP_addr;
+ first_op = DWARF2_ADDR_SIZE == 4 ? DW_OP_const4u : DW_OP_const8u;
dtprel = true;
second_op = DW_OP_GNU_push_tls_address;
}
@@ -15160,8 +15209,12 @@ loc_list_from_tree (tree loc, int want_address)
}
break;
+ case MEM_REF:
+ /* ??? FIXME. */
+ if (!integer_zerop (TREE_OPERAND (loc, 1)))
+ return 0;
+ /* Fallthru. */
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
list_ret = loc_list_from_tree (TREE_OPERAND (loc, 0), 0);
have_address = 1;
@@ -15721,7 +15774,7 @@ field_byte_offset (const_tree decl)
where the lowest addressed bit of the containing object must
be. */
object_offset_in_bits
- = double_int_add (deepest_bitpos, double_int_neg (type_size_in_bits));
+ = double_int_sub (deepest_bitpos, type_size_in_bits);
/* Round up to type_align by default. This works best for
bitfields. */
@@ -15731,8 +15784,7 @@ field_byte_offset (const_tree decl)
if (double_int_ucmp (object_offset_in_bits, bitpos_int) > 0)
{
object_offset_in_bits
- = double_int_add (deepest_bitpos,
- double_int_neg (type_size_in_bits));
+ = double_int_sub (deepest_bitpos, type_size_in_bits);
/* Round up to decl_align instead. */
object_offset_in_bits
@@ -16689,7 +16741,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
for (cnt = 0;
VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce);
- cnt++, field = field ? TREE_CHAIN (field) : 0)
+ cnt++, field = field ? DECL_CHAIN (field) : 0)
{
tree val = ce->value;
int pos, fieldsize;
@@ -17355,6 +17407,25 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl)
}
}
+/* Add a DW_AT_linkage_name or DW_AT_MIPS_linkage_name attribute for the
+ given decl. This used to be a vendor extension until after DWARF 4
+ standardized it. */
+
+static void
+add_linkage_attr (dw_die_ref die, tree decl)
+{
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+
+ /* Mimic what assemble_name_raw does with a leading '*'. */
+ if (name[0] == '*')
+ name = &name[1];
+
+ if (dwarf_version >= 4)
+ add_AT_string (die, DW_AT_linkage_name, name);
+ else
+ add_AT_string (die, DW_AT_MIPS_linkage_name, name);
+}
+
/* Add source coordinate attributes for the given decl. */
static void
@@ -17389,8 +17460,7 @@ add_linkage_name (dw_die_ref die, tree decl)
deferred_asm_name = asm_name;
}
else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
- add_AT_string (die, AT_linkage_name,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
+ add_linkage_attr (die, decl);
}
}
@@ -17523,9 +17593,13 @@ scope_die_for (tree t, dw_die_ref context_die)
{
gcc_assert (debug_info_level <= DINFO_LEVEL_TERSE
|| TREE_ASM_WRITTEN (containing_scope));
+ /*We are not in the middle of emitting the type
+ CONTAINING_SCOPE. Let's see if it's emitted already. */
+ scope_die = lookup_type_die (containing_scope);
/* If none of the current dies are suitable, we get file scope. */
- scope_die = comp_unit_die;
+ if (scope_die == NULL)
+ scope_die = comp_unit_die;
}
else
scope_die = lookup_type_die (containing_scope);
@@ -17645,7 +17719,8 @@ type_tag (const_tree type)
tree t = 0;
/* Find the IDENTIFIER_NODE for the type name. */
- if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
+ if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE
+ && !TYPE_NAMELESS (type))
t = TYPE_NAME (type);
/* The g++ front end makes the TYPE_NAME of *each* tagged type point to
@@ -17658,7 +17733,8 @@ type_tag (const_tree type)
DECL_NAME isn't set. The default hook for decl_printable_name
doesn't like that, and in this context it's correct to return
0, instead of "<anonymous>" or the like. */
- if (DECL_NAME (TYPE_NAME (type)))
+ if (DECL_NAME (TYPE_NAME (type))
+ && !DECL_NAMELESS (TYPE_NAME (type)))
name = lang_hooks.dwarf_name (TYPE_NAME (type), 2);
}
@@ -18228,7 +18304,7 @@ gen_formal_parameter_pack_die (tree parm_pack,
parm_pack_die = new_die (DW_TAG_GNU_formal_parameter_pack, subr_die, parm_pack);
add_src_coords_attributes (parm_pack_die, parm_pack);
- for (arg = pack_arg; arg; arg = TREE_CHAIN (arg))
+ for (arg = pack_arg; arg; arg = DECL_CHAIN (arg))
{
if (! lang_hooks.decls.function_parm_expanded_from_pack_p (arg,
parm_pack))
@@ -18295,7 +18371,7 @@ gen_formal_types_die (tree function_or_method_type, dw_die_ref context_die)
link = TREE_CHAIN (link);
if (arg)
- arg = TREE_CHAIN (arg);
+ arg = DECL_CHAIN (arg);
}
/* If this function type has an ellipsis, add a
@@ -18804,11 +18880,11 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
else if (parm)
{
gen_decl_die (parm, NULL, subr_die);
- parm = TREE_CHAIN (parm);
+ parm = DECL_CHAIN (parm);
}
if (generic_decl_parm)
- generic_decl_parm = TREE_CHAIN (generic_decl_parm);
+ generic_decl_parm = DECL_CHAIN (generic_decl_parm);
}
/* Decide whether we need an unspecified_parameters DIE at the end.
@@ -19510,7 +19586,7 @@ gen_member_die (tree type, dw_die_ref context_die)
}
/* Now output info about the data members and type members. */
- for (member = TYPE_FIELDS (type); member; member = TREE_CHAIN (member))
+ for (member = TYPE_FIELDS (type); member; member = DECL_CHAIN (member))
{
/* If we thought we were generating minimal debug info for TYPE
and then changed our minds, some of the member declarations
@@ -19525,7 +19601,7 @@ gen_member_die (tree type, dw_die_ref context_die)
}
/* Now output info about the function members (if any). */
- for (member = TYPE_METHODS (type); member; member = TREE_CHAIN (member))
+ for (member = TYPE_METHODS (type); member; member = DECL_CHAIN (member))
{
/* Don't include clones in the member list. */
if (DECL_ABSTRACT_ORIGIN (member))
@@ -20091,7 +20167,7 @@ decls_for_scope (tree stmt, dw_die_ref context_die, int depth)
declared directly within this block but not within any nested
sub-blocks. Also, nested function and tag DIEs have been
generated with a parent of NULL; fix that up now. */
- for (decl = BLOCK_VARS (stmt); decl != NULL; decl = TREE_CHAIN (decl))
+ for (decl = BLOCK_VARS (stmt); decl != NULL; decl = DECL_CHAIN (decl))
process_scope_var (stmt, decl, NULL_TREE, context_die);
for (i = 0; i < BLOCK_NUM_NONLOCALIZED_VARS (stmt); i++)
process_scope_var (stmt, NULL, BLOCK_NONLOCALIZED_VAR (stmt, i),
@@ -20872,7 +20948,7 @@ dwarf2out_ignore_block (const_tree block)
tree decl;
unsigned int i;
- for (decl = BLOCK_VARS (block); decl; decl = TREE_CHAIN (decl))
+ for (decl = BLOCK_VARS (block); decl; decl = DECL_CHAIN (decl))
if (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == TYPE_DECL && TYPE_DECL_IS_STUB (decl)))
return 0;
@@ -21988,7 +22064,8 @@ move_linkage_attr (dw_die_ref die)
unsigned ix = VEC_length (dw_attr_node, die->die_attr);
dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1);
- gcc_assert (linkage.dw_attr == AT_linkage_name);
+ gcc_assert (linkage.dw_attr == DW_AT_linkage_name
+ || linkage.dw_attr == DW_AT_MIPS_linkage_name);
while (--ix > 0)
{
@@ -22050,7 +22127,7 @@ static bool
resolve_addr_in_expr (dw_loc_descr_ref loc)
{
for (; loc; loc = loc->dw_loc_next)
- if ((loc->dw_loc_opc == DW_OP_addr
+ if (((loc->dw_loc_opc == DW_OP_addr || loc->dtprel)
&& resolve_one_addr (&loc->dw_loc_oprnd1.v.val_addr, NULL))
|| (loc->dw_loc_opc == DW_OP_implicit_value
&& loc->dw_loc_oprnd2.val_class == dw_val_class_addr
@@ -22221,8 +22298,7 @@ dwarf2out_finish (const char *filename)
tree decl = node->created_for;
if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
{
- add_AT_string (node->die, AT_linkage_name,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
+ add_linkage_attr (node->die, decl);
move_linkage_attr (node->die);
}
}
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 55ed2054e4e..32741dc6b80 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
@@ -60,6 +61,13 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "target.h"
+struct target_rtl default_target_rtl;
+#if SWITCHABLE_TARGET
+struct target_rtl *this_target_rtl = &default_target_rtl;
+#endif
+
+#define initial_regno_reg_rtx (this_target_rtl->x_initial_regno_reg_rtx)
+
/* Commonly used modes. */
enum machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
@@ -83,19 +91,6 @@ rtx * regno_reg_rtx;
static GTY(()) int label_num = 1;
-/* Commonly used rtx's, so that we only need space for one copy.
- These are initialized once for the entire compilation.
- All of these are unique; no other rtx-object will be equal to any
- of these. */
-
-rtx global_rtl[GR_MAX];
-
-/* Commonly used RTL for hard registers. These objects are not necessarily
- unique, so we allocate them separately from global_rtl. They are
- initialized once per compilation unit, then copied into regno_reg_rtx
- at the beginning of each function. */
-static GTY(()) rtx static_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
-
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
the values of 0, 1, and 2. For the integer entries and VOIDmode, we
record a copy of const[012]_rtx. */
@@ -114,30 +109,6 @@ REAL_VALUE_TYPE dconsthalf;
FIXED_VALUE_TYPE fconst0[MAX_FCONST0];
FIXED_VALUE_TYPE fconst1[MAX_FCONST1];
-/* All references to the following fixed hard registers go through
- these unique rtl objects. On machines where the frame-pointer and
- arg-pointer are the same register, they use the same unique object.
-
- After register allocation, other rtl objects which used to be pseudo-regs
- may be clobbered to refer to the frame-pointer register.
- But references that were originally to the frame-pointer can be
- distinguished from the others because they contain frame_pointer_rtx.
-
- When to use frame_pointer_rtx and hard_frame_pointer_rtx is a little
- tricky: until register elimination has taken place hard_frame_pointer_rtx
- should be used if it is being set, and frame_pointer_rtx otherwise. After
- register elimination hard_frame_pointer_rtx should always be used.
- On machines where the two registers are same (most) then these are the
- same.
-
- In an inline procedure, the stack and frame pointer rtxs may not be
- used for anything else. */
-rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */
-
-/* This is used to implement __builtin_return_address for some machines.
- See for instance the MIPS port. */
-rtx return_address_pointer_rtx; /* (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM) */
-
/* We make one copy of (const_int C) where C is in
[- MAX_SAVED_CONST_INT, MAX_SAVED_CONST_INT]
to save space during the compilation and simplify comparisons of
@@ -1610,19 +1581,45 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* We can set the alignment from the type if we are making an object,
this is an INDIRECT_REF, or if TYPE_ALIGN_OK. */
- if (objectp || TREE_CODE (t) == INDIRECT_REF
- || TREE_CODE (t) == ALIGN_INDIRECT_REF
- || TYPE_ALIGN_OK (type))
+ if (objectp || TREE_CODE (t) == INDIRECT_REF || TYPE_ALIGN_OK (type))
align = MAX (align, TYPE_ALIGN (type));
- else
- if (TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
- {
- if (integer_zerop (TREE_OPERAND (t, 1)))
- /* We don't know anything about the alignment. */
- align = BITS_PER_UNIT;
- else
- align = tree_low_cst (TREE_OPERAND (t, 1), 1);
- }
+
+ else if (TREE_CODE (t) == MEM_REF)
+ {
+ tree op0 = TREE_OPERAND (t, 0);
+ unsigned HOST_WIDE_INT aoff = BITS_PER_UNIT;
+ if (host_integerp (TREE_OPERAND (t, 1), 1))
+ {
+ unsigned HOST_WIDE_INT ioff = TREE_INT_CST_LOW (TREE_OPERAND (t, 1));
+ aoff = (ioff & -ioff) * BITS_PER_UNIT;
+ }
+ if (TREE_CODE (op0) == ADDR_EXPR && DECL_P (TREE_OPERAND (op0, 0)))
+ align = MAX (align, DECL_ALIGN (TREE_OPERAND (op0, 0)));
+ else if (TREE_CODE (op0) == ADDR_EXPR
+ && CONSTANT_CLASS_P (TREE_OPERAND (op0, 0)))
+ {
+ align = TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (op0, 0)));
+#ifdef CONSTANT_ALIGNMENT
+ align = CONSTANT_ALIGNMENT (TREE_OPERAND (op0, 0), align);
+#endif
+ }
+ else
+ /* ??? This isn't fully correct, we can't set the alignment from the
+ type in all cases. */
+ align = MAX (align, TYPE_ALIGN (type));
+
+ if (!integer_zerop (TREE_OPERAND (t, 1)) && aoff < align)
+ align = aoff;
+ }
+
+ else if (TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
+ {
+ if (integer_zerop (TREE_OPERAND (t, 1)))
+ /* We don't know anything about the alignment. */
+ align = BITS_PER_UNIT;
+ else
+ align = tree_low_cst (TREE_OPERAND (t, 1), 1);
+ }
/* If the size is known, we can set that. */
if (TYPE_SIZE_UNIT (type) && host_integerp (TYPE_SIZE_UNIT (type), 1))
@@ -1654,6 +1651,9 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
|| TREE_CODE (base) == BIT_FIELD_REF)
base = TREE_OPERAND (base, 0);
+ if (TREE_CODE (base) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (base, 0)) == ADDR_EXPR)
+ base = TREE_OPERAND (TREE_OPERAND (base, 0), 0);
if (DECL_P (base))
{
if (CODE_CONTAINS_STRUCT (TREE_CODE (base), TS_DECL_WITH_VIS))
@@ -1774,7 +1774,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
}
/* If this is an indirect reference, record it. */
- else if (TREE_CODE (t) == INDIRECT_REF
+ else if (TREE_CODE (t) == MEM_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
{
expr = t;
@@ -1784,7 +1784,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
}
/* If this is an indirect reference, record it. */
- else if (TREE_CODE (t) == INDIRECT_REF
+ else if (TREE_CODE (t) == MEM_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
{
expr = t;
@@ -1810,14 +1810,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
size = plus_constant (size, apply_bitpos / BITS_PER_UNIT);
}
- if (TREE_CODE (t) == ALIGN_INDIRECT_REF)
- {
- /* Force EXPR and OFFSET to NULL, since we don't know exactly what
- we're overlapping. */
- offset = NULL;
- expr = NULL;
- }
-
/* Now set the attributes we computed above. */
MEM_ATTRS (ref)
= get_mem_attrs (alias, expr, offset, size, align,
@@ -2383,7 +2375,7 @@ unshare_all_rtl_again (rtx insn)
set_used_decls (DECL_INITIAL (cfun->decl));
/* Make sure that virtual parameters are not shared. */
- for (decl = DECL_ARGUMENTS (cfun->decl); decl; decl = TREE_CHAIN (decl))
+ for (decl = DECL_ARGUMENTS (cfun->decl); decl; decl = DECL_CHAIN (decl))
set_used_flags (DECL_RTL (decl));
reset_used_flags (stack_slot_list);
@@ -2593,7 +2585,7 @@ set_used_decls (tree blk)
tree t;
/* Mark decls. */
- for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
+ for (t = BLOCK_VARS (blk); t; t = DECL_CHAIN (t))
if (DECL_RTL_SET_P (t))
set_used_flags (DECL_RTL (t));
@@ -5554,7 +5546,7 @@ init_emit (void)
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
- static_regno_reg_rtx,
+ initial_regno_reg_rtx,
FIRST_PSEUDO_REGISTER * sizeof (rtx));
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
@@ -5681,7 +5673,7 @@ init_emit_regs (void)
/* Initialize RTL for commonly used hard registers. These are
copied into regno_reg_rtx as we begin to compile each function. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- static_regno_reg_rtx[i] = gen_raw_REG (reg_raw_mode[i], i);
+ initial_regno_reg_rtx[i] = gen_raw_REG (reg_raw_mode[i], i);
#ifdef RETURN_ADDRESS_POINTER_REGNUM
return_address_pointer_rtx
diff --git a/gcc/explow.c b/gcc/explow.c
index 40b3a6ef424..09f786a2531 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
@@ -43,7 +44,6 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
static rtx break_out_memory_refs (rtx);
-static void emit_stack_probe (rtx);
/* Truncate and perhaps sign-extend C as appropriate for MODE. */
@@ -1355,7 +1355,7 @@ set_stack_check_libfunc (const char *libfunc_name)
/* Emit one stack probe at ADDRESS, an address within the stack. */
-static void
+void
emit_stack_probe (rtx address)
{
rtx memref = gen_rtx_MEM (word_mode, address);
@@ -1567,7 +1567,7 @@ anti_adjust_stack_and_probe (rtx size, bool adjust_back)
HOST_WIDE_INT isize = INTVAL (size), i;
bool first_probe = true;
- /* Adjust SP and probe to PROBE_INTERVAL + N * PROBE_INTERVAL for
+ /* Adjust SP and probe at PROBE_INTERVAL + N * PROBE_INTERVAL for
values of N from 1 until it exceeds SIZE. If only one probe is
needed, this will not generate any code. Then adjust and probe
to PROBE_INTERVAL + SIZE. */
@@ -1623,13 +1623,13 @@ anti_adjust_stack_and_probe (rtx size, bool adjust_back)
/* Step 3: the loop
- while (SP != LAST_ADDR)
- {
- SP = SP + PROBE_INTERVAL
- probe at SP
- }
+ while (SP != LAST_ADDR)
+ {
+ SP = SP + PROBE_INTERVAL
+ probe at SP
+ }
- adjusts SP and probes to PROBE_INTERVAL + N * PROBE_INTERVAL for
+ adjusts SP and probes at PROBE_INTERVAL + N * PROBE_INTERVAL for
values of N from 1 until it is equal to ROUNDED_SIZE. */
emit_label (loop_lab);
@@ -1647,7 +1647,7 @@ anti_adjust_stack_and_probe (rtx size, bool adjust_back)
emit_label (end_lab);
- /* Step 4: adjust SP and probe to PROBE_INTERVAL + SIZE if we cannot
+ /* Step 4: adjust SP and probe at PROBE_INTERVAL + SIZE if we cannot
assert at compile-time that SIZE is equal to ROUNDED_SIZE. */
/* TEMP = SIZE - ROUNDED_SIZE. */
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 9aa61a8f244..ddace9f2e39 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
@@ -37,6 +38,12 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "df.h"
#include "target.h"
+#include "expmed.h"
+
+struct target_expmed default_target_expmed;
+#if SWITCHABLE_TARGET
+struct target_expmed *this_target_expmed = &default_target_expmed;
+#endif
static void store_fixed_bit_field (rtx, unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT,
@@ -58,25 +65,10 @@ static rtx expand_sdiv_pow2 (enum machine_mode, rtx, HOST_WIDE_INT);
/* Test whether a value is zero of a power of two. */
#define EXACT_POWER_OF_2_OR_ZERO_P(x) (((x) & ((x) - 1)) == 0)
-/* Nonzero means divides or modulus operations are relatively cheap for
- powers of two, so don't use branches; emit the operation instead.
- Usually, this will mean that the MD file will emit non-branch
- sequences. */
-
-static bool sdiv_pow2_cheap[2][NUM_MACHINE_MODES];
-static bool smod_pow2_cheap[2][NUM_MACHINE_MODES];
-
#ifndef SLOW_UNALIGNED_ACCESS
#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
#endif
-/* For compilers that support multiple targets with different word sizes,
- MAX_BITS_PER_WORD contains the biggest value of BITS_PER_WORD. An example
- is the H8/300(H) compiler. */
-
-#ifndef MAX_BITS_PER_WORD
-#define MAX_BITS_PER_WORD BITS_PER_WORD
-#endif
/* Reduce conditional compilation elsewhere. */
#ifndef HAVE_insv
@@ -95,21 +87,6 @@ static bool smod_pow2_cheap[2][NUM_MACHINE_MODES];
#define gen_extzv(a,b,c,d) NULL_RTX
#endif
-/* Cost of various pieces of RTL. Note that some of these are indexed by
- shift count and some by mode. */
-static int zero_cost[2];
-static int add_cost[2][NUM_MACHINE_MODES];
-static int neg_cost[2][NUM_MACHINE_MODES];
-static int shift_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int shiftadd_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int shiftsub0_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int shiftsub1_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int mul_cost[2][NUM_MACHINE_MODES];
-static int sdiv_cost[2][NUM_MACHINE_MODES];
-static int udiv_cost[2][NUM_MACHINE_MODES];
-static int mul_widen_cost[2][NUM_MACHINE_MODES];
-static int mul_highpart_cost[2][NUM_MACHINE_MODES];
-
void
init_expmed (void)
{
@@ -276,6 +253,10 @@ init_expmed (void)
}
}
}
+ if (alg_hash_used_p)
+ memset (alg_hash, 0, sizeof (alg_hash));
+ else
+ alg_hash_used_p = true;
default_rtl_profile ();
}
@@ -419,15 +400,14 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
available. */
if (VECTOR_MODE_P (GET_MODE (op0))
&& !MEM_P (op0)
- && (optab_handler (vec_set_optab, GET_MODE (op0))->insn_code
- != CODE_FOR_nothing)
+ && optab_handler (vec_set_optab, GET_MODE (op0)) != CODE_FOR_nothing
&& fieldmode == GET_MODE_INNER (GET_MODE (op0))
&& bitsize == GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))
&& !(bitnum % GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))))
{
enum machine_mode outermode = GET_MODE (op0);
enum machine_mode innermode = GET_MODE_INNER (outermode);
- int icode = (int) optab_handler (vec_set_optab, outermode)->insn_code;
+ int icode = (int) optab_handler (vec_set_optab, outermode);
int pos = bitnum / GET_MODE_BITSIZE (innermode);
rtx rtxpos = GEN_INT (pos);
rtx src = value;
@@ -533,10 +513,9 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
if (!MEM_P (op0)
&& (BYTES_BIG_ENDIAN ? bitpos + bitsize == unit : bitpos == 0)
&& bitsize == GET_MODE_BITSIZE (fieldmode)
- && (optab_handler (movstrict_optab, fieldmode)->insn_code
- != CODE_FOR_nothing))
+ && optab_handler (movstrict_optab, fieldmode) != CODE_FOR_nothing)
{
- int icode = optab_handler (movstrict_optab, fieldmode)->insn_code;
+ int icode = optab_handler (movstrict_optab, fieldmode);
rtx insn;
rtx start = get_last_insn ();
rtx arg0 = op0;
@@ -1253,14 +1232,13 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
available. */
if (VECTOR_MODE_P (GET_MODE (op0))
&& !MEM_P (op0)
- && (optab_handler (vec_extract_optab, GET_MODE (op0))->insn_code
- != CODE_FOR_nothing)
+ && optab_handler (vec_extract_optab, GET_MODE (op0)) != CODE_FOR_nothing
&& ((bitnum + bitsize - 1) / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))
== bitnum / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))))
{
enum machine_mode outermode = GET_MODE (op0);
enum machine_mode innermode = GET_MODE_INNER (outermode);
- int icode = (int) optab_handler (vec_extract_optab, outermode)->insn_code;
+ int icode = (int) optab_handler (vec_extract_optab, outermode);
unsigned HOST_WIDE_INT pos = bitnum / GET_MODE_BITSIZE (innermode);
rtx rtxpos = GEN_INT (pos);
rtx src = op0;
@@ -2302,113 +2280,6 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted,
return temp;
}
-enum alg_code {
- alg_unknown,
- alg_zero,
- alg_m, alg_shift,
- alg_add_t_m2,
- alg_sub_t_m2,
- alg_add_factor,
- alg_sub_factor,
- alg_add_t2_m,
- alg_sub_t2_m,
- alg_impossible
-};
-
-/* This structure holds the "cost" of a multiply sequence. The
- "cost" field holds the total rtx_cost of every operator in the
- synthetic multiplication sequence, hence cost(a op b) is defined
- as rtx_cost(op) + cost(a) + cost(b), where cost(leaf) is zero.
- The "latency" field holds the minimum possible latency of the
- synthetic multiply, on a hypothetical infinitely parallel CPU.
- This is the critical path, or the maximum height, of the expression
- tree which is the sum of rtx_costs on the most expensive path from
- any leaf to the root. Hence latency(a op b) is defined as zero for
- leaves and rtx_cost(op) + max(latency(a), latency(b)) otherwise. */
-
-struct mult_cost {
- short cost; /* Total rtx_cost of the multiplication sequence. */
- short latency; /* The latency of the multiplication sequence. */
-};
-
-/* This macro is used to compare a pointer to a mult_cost against an
- single integer "rtx_cost" value. This is equivalent to the macro
- CHEAPER_MULT_COST(X,Z) where Z = {Y,Y}. */
-#define MULT_COST_LESS(X,Y) ((X)->cost < (Y) \
- || ((X)->cost == (Y) && (X)->latency < (Y)))
-
-/* This macro is used to compare two pointers to mult_costs against
- each other. The macro returns true if X is cheaper than Y.
- Currently, the cheaper of two mult_costs is the one with the
- lower "cost". If "cost"s are tied, the lower latency is cheaper. */
-#define CHEAPER_MULT_COST(X,Y) ((X)->cost < (Y)->cost \
- || ((X)->cost == (Y)->cost \
- && (X)->latency < (Y)->latency))
-
-/* This structure records a sequence of operations.
- `ops' is the number of operations recorded.
- `cost' is their total cost.
- The operations are stored in `op' and the corresponding
- logarithms of the integer coefficients in `log'.
-
- These are the operations:
- alg_zero total := 0;
- alg_m total := multiplicand;
- alg_shift total := total * coeff
- alg_add_t_m2 total := total + multiplicand * coeff;
- alg_sub_t_m2 total := total - multiplicand * coeff;
- alg_add_factor total := total * coeff + total;
- alg_sub_factor total := total * coeff - total;
- alg_add_t2_m total := total * coeff + multiplicand;
- alg_sub_t2_m total := total * coeff - multiplicand;
-
- The first operand must be either alg_zero or alg_m. */
-
-struct algorithm
-{
- struct mult_cost cost;
- short ops;
- /* The size of the OP and LOG fields are not directly related to the
- word size, but the worst-case algorithms will be if we have few
- consecutive ones or zeros, i.e., a multiplicand like 10101010101...
- In that case we will generate shift-by-2, add, shift-by-2, add,...,
- in total wordsize operations. */
- enum alg_code op[MAX_BITS_PER_WORD];
- char log[MAX_BITS_PER_WORD];
-};
-
-/* The entry for our multiplication cache/hash table. */
-struct alg_hash_entry {
- /* The number we are multiplying by. */
- unsigned HOST_WIDE_INT t;
-
- /* The mode in which we are multiplying something by T. */
- enum machine_mode mode;
-
- /* The best multiplication algorithm for t. */
- enum alg_code alg;
-
- /* The cost of multiplication if ALG_CODE is not alg_impossible.
- Otherwise, the cost within which multiplication by T is
- impossible. */
- struct mult_cost cost;
-
- /* OPtimized for speed? */
- bool speed;
-};
-
-/* The number of cache/hash entries. */
-#if HOST_BITS_PER_WIDE_INT == 64
-#define NUM_ALG_HASH_ENTRIES 1031
-#else
-#define NUM_ALG_HASH_ENTRIES 307
-#endif
-
-/* Each entry of ALG_HASH caches alg_code for some integer. This is
- actually a hash table. If we have a collision, that the older
- entry is kicked out. */
-static struct alg_hash_entry alg_hash[NUM_ALG_HASH_ENTRIES];
-
/* Indicates the type of fixup needed after a constant multiplication.
BASIC_VARIANT means no fixup is needed, NEGATE_VARIANT means that
the result should be negated, and ADD_VARIANT means that the
@@ -3567,7 +3438,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
/* Try widening multiplication. */
moptab = unsignedp ? umul_widen_optab : smul_widen_optab;
- if (optab_handler (moptab, wider_mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (moptab, wider_mode) != CODE_FOR_nothing
&& mul_widen_cost[speed][wider_mode] < max_cost)
{
tem = expand_binop (wider_mode, moptab, op0, narrow_op1, 0,
@@ -3577,7 +3448,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
}
/* Try widening the mode and perform a non-widening multiplication. */
- if (optab_handler (smul_optab, wider_mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (smul_optab, wider_mode) != CODE_FOR_nothing
&& size - 1 < BITS_PER_WORD
&& mul_cost[speed][wider_mode] + shift_cost[speed][mode][size-1] < max_cost)
{
@@ -3604,7 +3475,7 @@ expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
/* Try widening multiplication of opposite signedness, and adjust. */
moptab = unsignedp ? smul_widen_optab : umul_widen_optab;
- if (optab_handler (moptab, wider_mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (moptab, wider_mode) != CODE_FOR_nothing
&& size - 1 < BITS_PER_WORD
&& (mul_widen_cost[speed][wider_mode] + 2 * shift_cost[speed][mode][size-1]
+ 4 * add_cost[speed][mode] < max_cost))
@@ -3726,7 +3597,7 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
use a LSHIFTRT, 1 ADD, 1 SUB and an AND. */
temp = gen_rtx_LSHIFTRT (mode, result, shift);
- if (optab_handler (lshr_optab, mode)->insn_code == CODE_FOR_nothing
+ if (optab_handler (lshr_optab, mode) == CODE_FOR_nothing
|| rtx_cost (temp, SET, optimize_insn_for_speed_p ()) > COSTS_N_INSNS (2))
{
temp = expand_binop (mode, xor_optab, op0, signmask,
@@ -4030,8 +3901,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
for (compute_mode = mode; compute_mode != VOIDmode;
compute_mode = GET_MODE_WIDER_MODE (compute_mode))
- if (optab_handler (optab1, compute_mode)->insn_code != CODE_FOR_nothing
- || optab_handler (optab2, compute_mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (optab1, compute_mode) != CODE_FOR_nothing
+ || optab_handler (optab2, compute_mode) != CODE_FOR_nothing)
break;
if (compute_mode == VOIDmode)
@@ -4193,10 +4064,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
t2 = force_operand (gen_rtx_MINUS (compute_mode,
op0, t1),
NULL_RTX);
- t3 = expand_shift
- (RSHIFT_EXPR, compute_mode, t2,
- build_int_cst (NULL_TREE, 1),
- NULL_RTX,1);
+ t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2,
+ integer_one_node, NULL_RTX, 1);
t4 = force_operand (gen_rtx_PLUS (compute_mode,
t1, t3),
NULL_RTX);
@@ -4286,11 +4155,11 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
optab has an expander for this mode. */
&& ((optab_handler ((rem_flag ? smod_optab
: sdiv_optab),
- compute_mode)->insn_code
+ compute_mode)
!= CODE_FOR_nothing)
- || (optab_handler(sdivmod_optab,
- compute_mode)
- ->insn_code != CODE_FOR_nothing)))
+ || (optab_handler (sdivmod_optab,
+ compute_mode)
+ != CODE_FOR_nothing)))
;
else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d))
{
@@ -4302,9 +4171,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
}
if (sdiv_pow2_cheap[speed][compute_mode]
- && ((optab_handler (sdiv_optab, compute_mode)->insn_code
+ && ((optab_handler (sdiv_optab, compute_mode)
!= CODE_FOR_nothing)
- || (optab_handler (sdivmod_optab, compute_mode)->insn_code
+ || (optab_handler (sdivmod_optab, compute_mode)
!= CODE_FOR_nothing)))
quotient = expand_divmod (0, TRUNC_DIV_EXPR,
compute_mode, op0,
@@ -4880,8 +4749,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
}
tem = plus_constant (op1, -1);
tem = expand_shift (RSHIFT_EXPR, compute_mode, tem,
- build_int_cst (NULL_TREE, 1),
- NULL_RTX, 1);
+ integer_one_node, NULL_RTX, 1);
do_cmp_and_jump (remainder, tem, LEU, compute_mode, label);
expand_inc (quotient, const1_rtx);
expand_dec (remainder, op1);
@@ -4906,8 +4774,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
abs_rem = expand_abs (compute_mode, remainder, NULL_RTX, 1, 0);
abs_op1 = expand_abs (compute_mode, op1, NULL_RTX, 1, 0);
tem = expand_shift (LSHIFT_EXPR, compute_mode, abs_rem,
- build_int_cst (NULL_TREE, 1),
- NULL_RTX, 1);
+ integer_one_node, NULL_RTX, 1);
do_cmp_and_jump (tem, abs_op1, LTU, compute_mode, label);
tem = expand_binop (compute_mode, xor_optab, op0, op1,
NULL_RTX, 0, OPTAB_WIDEN);
@@ -4952,7 +4819,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
= sign_expand_binop (compute_mode, umod_optab, smod_optab,
op0, op1, target,
unsignedp,
- ((optab_handler (optab2, compute_mode)->insn_code
+ ((optab_handler (optab2, compute_mode)
!= CODE_FOR_nothing)
? OPTAB_DIRECT : OPTAB_WIDEN));
if (remainder == 0)
@@ -4980,7 +4847,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
= sign_expand_binop (compute_mode, udiv_optab, sdiv_optab,
op0, op1, rem_flag ? NULL_RTX : target,
unsignedp,
- ((optab_handler (optab2, compute_mode)->insn_code
+ ((optab_handler (optab2, compute_mode)
!= CODE_FOR_nothing)
? OPTAB_DIRECT : OPTAB_WIDEN));
@@ -5479,7 +5346,7 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1,
compare_mode = GET_MODE_WIDER_MODE (compare_mode))
{
enum machine_mode optab_mode = mclass == MODE_CC ? CCmode : compare_mode;
- icode = optab_handler (cstore_optab, optab_mode)->insn_code;
+ icode = optab_handler (cstore_optab, optab_mode);
if (icode != CODE_FOR_nothing)
{
do_pending_stack_adjust ();
@@ -5674,7 +5541,7 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
as "-(int)X >> 31" is still cheaper than inverting "(int)X == 0". */
rcode = reverse_condition (code);
if (can_compare_p (rcode, mode, ccp_store_flag)
- && ! (optab_handler (cstore_optab, mode)->insn_code == CODE_FOR_nothing
+ && ! (optab_handler (cstore_optab, mode) == CODE_FOR_nothing
&& code == NE
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD
&& op1 == const0_rtx))
@@ -5773,9 +5640,9 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
that is compensated by the subsequent overflow when subtracting
one / negating. */
- if (optab_handler (abs_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (abs_optab, mode) != CODE_FOR_nothing)
tem = expand_unop (mode, abs_optab, op0, subtarget, 1);
- else if (optab_handler (ffs_optab, mode)->insn_code != CODE_FOR_nothing)
+ else if (optab_handler (ffs_optab, mode) != CODE_FOR_nothing)
tem = expand_unop (mode, ffs_optab, op0, subtarget, 1);
else if (GET_MODE_SIZE (mode) < UNITS_PER_WORD)
{
diff --git a/gcc/expmed.h b/gcc/expmed.h
new file mode 100644
index 00000000000..37f57557120
--- /dev/null
+++ b/gcc/expmed.h
@@ -0,0 +1,200 @@
+/* Target-dependent costs for expmed.c.
+ Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option; any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef EXPMED_H
+#define EXPMED_H 1
+
+enum alg_code {
+ alg_unknown,
+ alg_zero,
+ alg_m, alg_shift,
+ alg_add_t_m2,
+ alg_sub_t_m2,
+ alg_add_factor,
+ alg_sub_factor,
+ alg_add_t2_m,
+ alg_sub_t2_m,
+ alg_impossible
+};
+
+/* This structure holds the "cost" of a multiply sequence. The
+ "cost" field holds the total rtx_cost of every operator in the
+ synthetic multiplication sequence, hence cost(a op b) is defined
+ as rtx_cost(op) + cost(a) + cost(b), where cost(leaf) is zero.
+ The "latency" field holds the minimum possible latency of the
+ synthetic multiply, on a hypothetical infinitely parallel CPU.
+ This is the critical path, or the maximum height, of the expression
+ tree which is the sum of rtx_costs on the most expensive path from
+ any leaf to the root. Hence latency(a op b) is defined as zero for
+ leaves and rtx_cost(op) + max(latency(a), latency(b)) otherwise. */
+
+struct mult_cost {
+ short cost; /* Total rtx_cost of the multiplication sequence. */
+ short latency; /* The latency of the multiplication sequence. */
+};
+
+/* This macro is used to compare a pointer to a mult_cost against an
+ single integer "rtx_cost" value. This is equivalent to the macro
+ CHEAPER_MULT_COST(X,Z) where Z = {Y,Y}. */
+#define MULT_COST_LESS(X,Y) ((X)->cost < (Y) \
+ || ((X)->cost == (Y) && (X)->latency < (Y)))
+
+/* This macro is used to compare two pointers to mult_costs against
+ each other. The macro returns true if X is cheaper than Y.
+ Currently, the cheaper of two mult_costs is the one with the
+ lower "cost". If "cost"s are tied, the lower latency is cheaper. */
+#define CHEAPER_MULT_COST(X,Y) ((X)->cost < (Y)->cost \
+ || ((X)->cost == (Y)->cost \
+ && (X)->latency < (Y)->latency))
+
+/* This structure records a sequence of operations.
+ `ops' is the number of operations recorded.
+ `cost' is their total cost.
+ The operations are stored in `op' and the corresponding
+ logarithms of the integer coefficients in `log'.
+
+ These are the operations:
+ alg_zero total := 0;
+ alg_m total := multiplicand;
+ alg_shift total := total * coeff
+ alg_add_t_m2 total := total + multiplicand * coeff;
+ alg_sub_t_m2 total := total - multiplicand * coeff;
+ alg_add_factor total := total * coeff + total;
+ alg_sub_factor total := total * coeff - total;
+ alg_add_t2_m total := total * coeff + multiplicand;
+ alg_sub_t2_m total := total * coeff - multiplicand;
+
+ The first operand must be either alg_zero or alg_m. */
+
+struct algorithm
+{
+ struct mult_cost cost;
+ short ops;
+ /* The size of the OP and LOG fields are not directly related to the
+ word size, but the worst-case algorithms will be if we have few
+ consecutive ones or zeros, i.e., a multiplicand like 10101010101...
+ In that case we will generate shift-by-2, add, shift-by-2, add,...,
+ in total wordsize operations. */
+ enum alg_code op[MAX_BITS_PER_WORD];
+ char log[MAX_BITS_PER_WORD];
+};
+
+/* The entry for our multiplication cache/hash table. */
+struct alg_hash_entry {
+ /* The number we are multiplying by. */
+ unsigned HOST_WIDE_INT t;
+
+ /* The mode in which we are multiplying something by T. */
+ enum machine_mode mode;
+
+ /* The best multiplication algorithm for t. */
+ enum alg_code alg;
+
+ /* The cost of multiplication if ALG_CODE is not alg_impossible.
+ Otherwise, the cost within which multiplication by T is
+ impossible. */
+ struct mult_cost cost;
+
+ /* Optimized for speed? */
+ bool speed;
+};
+
+/* The number of cache/hash entries. */
+#if HOST_BITS_PER_WIDE_INT == 64
+#define NUM_ALG_HASH_ENTRIES 1031
+#else
+#define NUM_ALG_HASH_ENTRIES 307
+#endif
+
+/* Target-dependent globals. */
+struct target_expmed {
+ /* Each entry of ALG_HASH caches alg_code for some integer. This is
+ actually a hash table. If we have a collision, that the older
+ entry is kicked out. */
+ struct alg_hash_entry x_alg_hash[NUM_ALG_HASH_ENTRIES];
+
+ /* True if x_alg_hash might already have been used. */
+ bool x_alg_hash_used_p;
+
+ /* Nonzero means divides or modulus operations are relatively cheap for
+ powers of two, so don't use branches; emit the operation instead.
+ Usually, this will mean that the MD file will emit non-branch
+ sequences. */
+ bool x_sdiv_pow2_cheap[2][NUM_MACHINE_MODES];
+ bool x_smod_pow2_cheap[2][NUM_MACHINE_MODES];
+
+ /* Cost of various pieces of RTL. Note that some of these are indexed by
+ shift count and some by mode. */
+ int x_zero_cost[2];
+ int x_add_cost[2][NUM_MACHINE_MODES];
+ int x_neg_cost[2][NUM_MACHINE_MODES];
+ int x_shift_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
+ int x_shiftadd_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
+ int x_shiftsub0_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
+ int x_shiftsub1_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
+ int x_mul_cost[2][NUM_MACHINE_MODES];
+ int x_sdiv_cost[2][NUM_MACHINE_MODES];
+ int x_udiv_cost[2][NUM_MACHINE_MODES];
+ int x_mul_widen_cost[2][NUM_MACHINE_MODES];
+ int x_mul_highpart_cost[2][NUM_MACHINE_MODES];
+};
+
+extern struct target_expmed default_target_expmed;
+#if SWITCHABLE_TARGET
+extern struct target_expmed *this_target_expmed;
+#else
+#define this_target_expmed (&default_target_expmed)
+#endif
+
+#define alg_hash \
+ (this_target_expmed->x_alg_hash)
+#define alg_hash_used_p \
+ (this_target_expmed->x_alg_hash_used_p)
+#define sdiv_pow2_cheap \
+ (this_target_expmed->x_sdiv_pow2_cheap)
+#define smod_pow2_cheap \
+ (this_target_expmed->x_smod_pow2_cheap)
+#define zero_cost \
+ (this_target_expmed->x_zero_cost)
+#define add_cost \
+ (this_target_expmed->x_add_cost)
+#define neg_cost \
+ (this_target_expmed->x_neg_cost)
+#define shift_cost \
+ (this_target_expmed->x_shift_cost)
+#define shiftadd_cost \
+ (this_target_expmed->x_shiftadd_cost)
+#define shiftsub0_cost \
+ (this_target_expmed->x_shiftsub0_cost)
+#define shiftsub1_cost \
+ (this_target_expmed->x_shiftsub1_cost)
+#define mul_cost \
+ (this_target_expmed->x_mul_cost)
+#define sdiv_cost \
+ (this_target_expmed->x_sdiv_cost)
+#define udiv_cost \
+ (this_target_expmed->x_udiv_cost)
+#define mul_widen_cost \
+ (this_target_expmed->x_mul_widen_cost)
+#define mul_highpart_cost \
+ (this_target_expmed->x_mul_highpart_cost)
+
+#endif
diff --git a/gcc/expr.c b/gcc/expr.c
index 2763dc91991..3e5d18bdebc 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "diagnostic.h"
#include "ssaexpand.h"
+#include "target-globals.h"
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
@@ -158,17 +159,6 @@ static void do_tablejump (rtx, enum machine_mode, rtx, rtx, rtx);
static rtx const_vector_from_tree (tree);
static void write_complex_part (rtx, rtx, bool);
-/* Record for each mode whether we can move a register directly to or
- from an object of that mode in memory. If we can't, we won't try
- to use that mode directly when accessing a field of that mode. */
-
-static char direct_load[NUM_MACHINE_MODES];
-static char direct_store[NUM_MACHINE_MODES];
-
-/* Record for each mode whether we can float-extend from memory. */
-
-static bool float_extend_from_mem[NUM_MACHINE_MODES][NUM_MACHINE_MODES];
-
/* This macro is used to determine whether move_by_pieces should be called
to perform a structure copy. */
#ifndef MOVE_BY_PIECES_P
@@ -201,41 +191,6 @@ static bool float_extend_from_mem[NUM_MACHINE_MODES][NUM_MACHINE_MODES];
< (unsigned int) MOVE_RATIO (optimize_insn_for_speed_p ()))
#endif
-/* This array records the insn_code of insns to perform block moves. */
-enum insn_code movmem_optab[NUM_MACHINE_MODES];
-
-/* This array records the insn_code of insns to perform block sets. */
-enum insn_code setmem_optab[NUM_MACHINE_MODES];
-
-/* These arrays record the insn_code of three different kinds of insns
- to perform block compares. */
-enum insn_code cmpstr_optab[NUM_MACHINE_MODES];
-enum insn_code cmpstrn_optab[NUM_MACHINE_MODES];
-enum insn_code cmpmem_optab[NUM_MACHINE_MODES];
-
-/* Synchronization primitives. */
-enum insn_code sync_add_optab[NUM_MACHINE_MODES];
-enum insn_code sync_sub_optab[NUM_MACHINE_MODES];
-enum insn_code sync_ior_optab[NUM_MACHINE_MODES];
-enum insn_code sync_and_optab[NUM_MACHINE_MODES];
-enum insn_code sync_xor_optab[NUM_MACHINE_MODES];
-enum insn_code sync_nand_optab[NUM_MACHINE_MODES];
-enum insn_code sync_old_add_optab[NUM_MACHINE_MODES];
-enum insn_code sync_old_sub_optab[NUM_MACHINE_MODES];
-enum insn_code sync_old_ior_optab[NUM_MACHINE_MODES];
-enum insn_code sync_old_and_optab[NUM_MACHINE_MODES];
-enum insn_code sync_old_xor_optab[NUM_MACHINE_MODES];
-enum insn_code sync_old_nand_optab[NUM_MACHINE_MODES];
-enum insn_code sync_new_add_optab[NUM_MACHINE_MODES];
-enum insn_code sync_new_sub_optab[NUM_MACHINE_MODES];
-enum insn_code sync_new_ior_optab[NUM_MACHINE_MODES];
-enum insn_code sync_new_and_optab[NUM_MACHINE_MODES];
-enum insn_code sync_new_xor_optab[NUM_MACHINE_MODES];
-enum insn_code sync_new_nand_optab[NUM_MACHINE_MODES];
-enum insn_code sync_compare_and_swap[NUM_MACHINE_MODES];
-enum insn_code sync_lock_test_and_set[NUM_MACHINE_MODES];
-enum insn_code sync_lock_release[NUM_MACHINE_MODES];
-
/* SLOW_UNALIGNED_ACCESS is nonzero if unaligned accesses are very slow. */
#ifndef SLOW_UNALIGNED_ACCESS
@@ -434,7 +389,7 @@ convert_move (rtx to, rtx from, int unsignedp)
/* Try converting directly if the insn is supported. */
- code = convert_optab_handler (tab, to_mode, from_mode)->insn_code;
+ code = convert_optab_handler (tab, to_mode, from_mode);
if (code != CODE_FOR_nothing)
{
emit_unop_insn (code, to, from,
@@ -468,12 +423,12 @@ convert_move (rtx to, rtx from, int unsignedp)
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (to_mode), MODE_INT);
- gcc_assert (convert_optab_handler (trunc_optab, to_mode, full_mode)->insn_code
+ gcc_assert (convert_optab_handler (trunc_optab, to_mode, full_mode)
!= CODE_FOR_nothing);
if (full_mode != from_mode)
from = convert_to_mode (full_mode, from, unsignedp);
- emit_unop_insn (convert_optab_handler (trunc_optab, to_mode, full_mode)->insn_code,
+ emit_unop_insn (convert_optab_handler (trunc_optab, to_mode, full_mode),
to, from, UNKNOWN);
return;
}
@@ -483,18 +438,19 @@ convert_move (rtx to, rtx from, int unsignedp)
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (from_mode), MODE_INT);
- gcc_assert (convert_optab_handler (sext_optab, full_mode, from_mode)->insn_code
+ gcc_assert (convert_optab_handler (sext_optab, full_mode, from_mode)
!= CODE_FOR_nothing);
if (to_mode == full_mode)
{
- emit_unop_insn (convert_optab_handler (sext_optab, full_mode, from_mode)->insn_code,
+ emit_unop_insn (convert_optab_handler (sext_optab, full_mode,
+ from_mode),
to, from, UNKNOWN);
return;
}
new_from = gen_reg_rtx (full_mode);
- emit_unop_insn (convert_optab_handler (sext_optab, full_mode, from_mode)->insn_code,
+ emit_unop_insn (convert_optab_handler (sext_optab, full_mode, from_mode),
new_from, from, UNKNOWN);
/* else proceed to integer conversions below. */
@@ -695,9 +651,10 @@ convert_move (rtx to, rtx from, int unsignedp)
}
/* Support special truncate insns for certain modes. */
- if (convert_optab_handler (trunc_optab, to_mode, from_mode)->insn_code != CODE_FOR_nothing)
+ if (convert_optab_handler (trunc_optab, to_mode,
+ from_mode) != CODE_FOR_nothing)
{
- emit_unop_insn (convert_optab_handler (trunc_optab, to_mode, from_mode)->insn_code,
+ emit_unop_insn (convert_optab_handler (trunc_optab, to_mode, from_mode),
to, from, UNKNOWN);
return;
}
@@ -990,7 +947,7 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
if (mode == VOIDmode)
break;
- icode = optab_handler (mov_optab, mode)->insn_code;
+ icode = optab_handler (mov_optab, mode);
if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
move_by_pieces_1 (GEN_FCN (icode), mode, &data);
@@ -1071,7 +1028,7 @@ move_by_pieces_ninsns (unsigned HOST_WIDE_INT l, unsigned int align,
if (mode == VOIDmode)
break;
- icode = optab_handler (mov_optab, mode)->insn_code;
+ icode = optab_handler (mov_optab, mode);
if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
n_insns += l / GET_MODE_SIZE (mode), l %= GET_MODE_SIZE (mode);
@@ -1163,6 +1120,11 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
rtx retval = 0;
unsigned int align;
+ gcc_assert (size);
+ if (CONST_INT_P (size)
+ && INTVAL (size) == 0)
+ return 0;
+
switch (method)
{
case BLOCK_OP_NORMAL:
@@ -1186,13 +1148,10 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
gcc_unreachable ();
}
+ gcc_assert (MEM_P (x) && MEM_P (y));
align = MIN (MEM_ALIGN (x), MEM_ALIGN (y));
gcc_assert (align >= BITS_PER_UNIT);
- gcc_assert (MEM_P (x));
- gcc_assert (MEM_P (y));
- gcc_assert (size);
-
/* Make sure we've got BLKmode addresses; store_one_arg can decide that
block copy is more efficient for other large modes, e.g. DCmode. */
x = adjust_address (x, BLKmode, 0);
@@ -1202,9 +1161,6 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
can be incorrect is coming from __builtin_memcpy. */
if (CONST_INT_P (size))
{
- if (INTVAL (size) == 0)
- return 0;
-
x = shallow_copy_rtx (x);
y = shallow_copy_rtx (y);
set_mem_size (x, size);
@@ -1313,7 +1269,7 @@ emit_block_move_via_movmem (rtx x, rtx y, rtx size, unsigned int align,
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
{
- enum insn_code code = movmem_optab[(int) mode];
+ enum insn_code code = direct_optab_handler (movmem_optab, mode);
insn_operand_predicate_fn pred;
if (code != CODE_FOR_nothing
@@ -2352,7 +2308,7 @@ can_store_by_pieces (unsigned HOST_WIDE_INT len,
if (mode == VOIDmode)
break;
- icode = optab_handler (mov_optab, mode)->insn_code;
+ icode = optab_handler (mov_optab, mode);
if (icode != CODE_FOR_nothing
&& align >= GET_MODE_ALIGNMENT (mode))
{
@@ -2565,7 +2521,7 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
if (mode == VOIDmode)
break;
- icode = optab_handler (mov_optab, mode)->insn_code;
+ icode = optab_handler (mov_optab, mode);
if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
store_by_pieces_2 (GEN_FCN (icode), mode, data);
@@ -2789,7 +2745,7 @@ set_storage_via_setmem (rtx object, rtx size, rtx val, unsigned int align,
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
{
- enum insn_code code = setmem_optab[(int) mode];
+ enum insn_code code = direct_optab_handler (setmem_optab, mode);
insn_operand_predicate_fn pred;
if (code != CODE_FOR_nothing
@@ -3034,7 +2990,7 @@ emit_move_via_integer (enum machine_mode mode, rtx x, rtx y, bool force)
return NULL_RTX;
/* The target must support moves in this mode. */
- code = optab_handler (mov_optab, imode)->insn_code;
+ code = optab_handler (mov_optab, imode);
if (code == CODE_FOR_nothing)
return NULL_RTX;
@@ -3184,7 +3140,7 @@ emit_move_complex (enum machine_mode mode, rtx x, rtx y)
/* Move floating point as parts. */
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
- && optab_handler (mov_optab, GET_MODE_INNER (mode))->insn_code != CODE_FOR_nothing)
+ && optab_handler (mov_optab, GET_MODE_INNER (mode)) != CODE_FOR_nothing)
try_int = false;
/* Not possible if the values are inherently not adjacent. */
else if (GET_CODE (x) == CONCAT || GET_CODE (y) == CONCAT)
@@ -3235,7 +3191,7 @@ emit_move_ccmode (enum machine_mode mode, rtx x, rtx y)
/* Assume all MODE_CC modes are equivalent; if we have movcc, use it. */
if (mode != CCmode)
{
- enum insn_code code = optab_handler (mov_optab, CCmode)->insn_code;
+ enum insn_code code = optab_handler (mov_optab, CCmode);
if (code != CODE_FOR_nothing)
{
x = emit_move_change_mode (CCmode, mode, x, true);
@@ -3375,7 +3331,7 @@ emit_move_insn_1 (rtx x, rtx y)
gcc_assert ((unsigned int) mode < (unsigned int) MAX_MACHINE_MODE);
- code = optab_handler (mov_optab, mode)->insn_code;
+ code = optab_handler (mov_optab, mode);
if (code != CODE_FOR_nothing)
return emit_insn (GEN_FCN (code) (x, y));
@@ -3627,7 +3583,7 @@ emit_single_push_insn (enum machine_mode mode, rtx x, tree type)
stack_pointer_delta += PUSH_ROUNDING (GET_MODE_SIZE (mode));
/* If there is push pattern, use it. Otherwise try old way of throwing
MEM representing push operation to move expander. */
- icode = optab_handler (push_optab, mode)->insn_code;
+ icode = optab_handler (push_optab, mode);
if (icode != CODE_FOR_nothing)
{
if (((pred = insn_data[(int) icode].operand[0].predicate)
@@ -4213,6 +4169,10 @@ expand_assignment (tree to, tree from, bool nontemporal)
an array element in an unaligned packed structure field, has the same
problem. */
if (handled_component_p (to)
+ /* ??? We only need to handle MEM_REF here if the access is not
+ a full access of the base object. */
+ || (TREE_CODE (to) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (to, 0)) == ADDR_EXPR)
|| TREE_CODE (TREE_TYPE (to)) == ARRAY_TYPE)
{
enum machine_mode mode1;
@@ -4359,7 +4319,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
set_mem_attributes (mem, to, 0);
set_mem_addr_space (mem, as);
- icode = movmisalign_optab->handlers[mode].insn_code;
+ icode = optab_handler (movmisalign_optab, mode);
gcc_assert (icode != CODE_FOR_nothing);
op_mode1 = insn_data[icode].operand[1].mode;
@@ -4492,7 +4452,7 @@ bool
emit_storent_insn (rtx to, rtx from)
{
enum machine_mode mode = GET_MODE (to), imode;
- enum insn_code code = optab_handler (storent_optab, mode)->insn_code;
+ enum insn_code code = optab_handler (storent_optab, mode);
rtx pattern;
if (code == CODE_FOR_nothing)
@@ -4686,6 +4646,51 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
BLOCK_OP_NORMAL);
return NULL_RTX;
}
+ else if (TREE_CODE (exp) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) == STRING_CST
+ && integer_zerop (TREE_OPERAND (exp, 1))
+ && !nontemporal && !call_param_p
+ && TYPE_MODE (TREE_TYPE (exp)) == BLKmode)
+ {
+ /* Optimize initialization of an array with a STRING_CST. */
+ HOST_WIDE_INT exp_len, str_copy_len;
+ rtx dest_mem;
+ tree str = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+
+ exp_len = int_expr_size (exp);
+ if (exp_len <= 0)
+ goto normal_expr;
+
+ str_copy_len = strlen (TREE_STRING_POINTER (str));
+ if (str_copy_len < TREE_STRING_LENGTH (str) - 1)
+ goto normal_expr;
+
+ str_copy_len = TREE_STRING_LENGTH (str);
+ if ((STORE_MAX_PIECES & (STORE_MAX_PIECES - 1)) == 0)
+ {
+ str_copy_len += STORE_MAX_PIECES - 1;
+ str_copy_len &= ~(STORE_MAX_PIECES - 1);
+ }
+ str_copy_len = MIN (str_copy_len, exp_len);
+ if (!can_store_by_pieces (str_copy_len, builtin_strncpy_read_str,
+ CONST_CAST(char *, TREE_STRING_POINTER (str)),
+ MEM_ALIGN (target), false))
+ goto normal_expr;
+
+ dest_mem = target;
+
+ dest_mem = store_by_pieces (dest_mem,
+ str_copy_len, builtin_strncpy_read_str,
+ CONST_CAST(char *, TREE_STRING_POINTER (str)),
+ MEM_ALIGN (target), false,
+ exp_len > str_copy_len ? 1 : 0);
+ if (exp_len > str_copy_len)
+ clear_storage (adjust_address (dest_mem, BLKmode, 0),
+ GEN_INT (exp_len - str_copy_len),
+ BLOCK_OP_NORMAL);
+ return NULL_RTX;
+ }
else
{
rtx tmp_target;
@@ -5048,7 +5053,7 @@ count_type_elements (const_tree type, bool allow_flexarr)
HOST_WIDE_INT n = 0, t;
tree f;
- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (type); f ; f = DECL_CHAIN (f))
if (TREE_CODE (f) == FIELD_DECL)
{
t = count_type_elements (TREE_TYPE (f), false);
@@ -5057,7 +5062,7 @@ count_type_elements (const_tree type, bool allow_flexarr)
/* Check for structures with flexible array member. */
tree tf = TREE_TYPE (f);
if (allow_flexarr
- && TREE_CHAIN (f) == NULL
+ && DECL_CHAIN (f) == NULL
&& TREE_CODE (tf) == ARRAY_TYPE
&& TYPE_DOMAIN (tf)
&& TYPE_MIN_VALUE (TYPE_DOMAIN (tf))
@@ -5654,7 +5659,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{
enum machine_mode mode = GET_MODE (target);
- icode = (int) optab_handler (vec_init_optab, mode)->insn_code;
+ icode = (int) optab_handler (vec_init_optab, mode);
if (icode != CODE_FOR_nothing)
{
unsigned int i;
@@ -5852,7 +5857,15 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
operations. */
|| (bitsize >= 0
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST
- && compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)), bitsize) != 0))
+ && compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)), bitsize) != 0)
+ /* If we are expanding a MEM_REF of a non-BLKmode non-addressable
+ decl we must use bitfield operations. */
+ || (bitsize >= 0
+ && TREE_CODE (exp) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
+ && DECL_P (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
+ && !TREE_ADDRESSABLE (TREE_OPERAND (TREE_OPERAND (exp, 0),0 ))
+ && DECL_MODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) != BLKmode))
{
rtx temp;
gimple nop_def;
@@ -6113,6 +6126,24 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
goto done;
break;
+ case MEM_REF:
+ /* Hand back the decl for MEM[&decl, off]. */
+ if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR)
+ {
+ tree off = TREE_OPERAND (exp, 1);
+ if (!integer_zerop (off))
+ {
+ double_int boff, coff = mem_ref_offset (exp);
+ boff = double_int_lshift (coff,
+ BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT, true);
+ bit_offset = double_int_add (bit_offset, boff);
+ }
+ exp = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ }
+ goto done;
+
default:
goto done;
}
@@ -6628,7 +6659,6 @@ safe_from_p (const_rtx x, tree exp, int top_p)
break;
case MISALIGNED_INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case INDIRECT_REF:
if (MEM_P (x)
&& alias_sets_conflict_p (MEM_ALIAS_SET (x),
@@ -6796,8 +6826,7 @@ emutls_var_address (tree var)
tree emuvar = emutls_decl (var);
tree fn = built_in_decls [BUILT_IN_EMUTLS_GET_ADDRESS];
tree arg = build_fold_addr_expr_with_type (emuvar, ptr_type_node);
- tree arglist = build_tree_list (NULL_TREE, arg);
- tree call = build_function_call_expr (UNKNOWN_LOCATION, fn, arglist);
+ tree call = build_call_expr (fn, 1, arg);
return fold_convert (build_pointer_type (TREE_TYPE (var)), call);
}
@@ -6873,6 +6902,16 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
/* This case will happen via recursion for &a->b. */
return expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier);
+ case MEM_REF:
+ {
+ tree tem = TREE_OPERAND (exp, 0);
+ if (!integer_zerop (TREE_OPERAND (exp, 1)))
+ tem = build2 (POINTER_PLUS_EXPR, TREE_TYPE (TREE_OPERAND (exp, 1)),
+ tem,
+ double_int_to_tree (sizetype, mem_ref_offset (exp)));
+ return expand_expr (tem, target, tmode, modifier);
+ }
+
case CONST_DECL:
/* Expand the initializer like constants above. */
return XEXP (expand_expr_constant (DECL_INITIAL (exp), 0, modifier), 0);
@@ -7619,7 +7658,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
this_optab = usmul_widen_optab;
if (mode == GET_MODE_2XWIDER_MODE (innermode))
{
- if (optab_handler (this_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (this_optab, mode) != CODE_FOR_nothing)
{
if (TYPE_UNSIGNED (TREE_TYPE (treeop0)))
expand_operands (treeop0, treeop1, subtarget, &op0, &op1,
@@ -7645,7 +7684,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
if (mode == GET_MODE_2XWIDER_MODE (innermode))
{
- if (optab_handler (this_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (this_optab, mode) != CODE_FOR_nothing)
{
expand_operands (treeop0, treeop1, NULL_RTX, &op0, &op1,
EXPAND_NORMAL);
@@ -7653,7 +7692,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
unsignedp, this_optab);
return REDUCE_BIT_FIELD (temp);
}
- if (optab_handler (other_optab, mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (other_optab, mode) != CODE_FOR_nothing
&& innermode == word_mode)
{
rtx htem, hipart;
@@ -8594,12 +8633,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return expand_constructor (exp, target, modifier, false);
case MISALIGNED_INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case INDIRECT_REF:
{
tree exp1 = treeop0;
addr_space_t as = ADDR_SPACE_GENERIC;
- enum machine_mode address_mode = Pmode;
if (modifier != EXPAND_WRITE)
{
@@ -8611,21 +8648,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
if (POINTER_TYPE_P (TREE_TYPE (exp1)))
- {
- as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp1)));
- address_mode = targetm.addr_space.address_mode (as);
- }
+ as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp1)));
op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM);
op0 = memory_address_addr_space (mode, op0, as);
- if (code == ALIGN_INDIRECT_REF)
- {
- int align = TYPE_ALIGN_UNIT (type);
- op0 = gen_rtx_AND (address_mode, op0, GEN_INT (-align));
- op0 = memory_address_addr_space (mode, op0, as);
- }
-
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0);
@@ -8642,7 +8669,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| modifier == EXPAND_STACK_PARM);
/* The vectorizer should have already checked the mode. */
- icode = optab_handler (movmisalign_optab, mode)->insn_code;
+ icode = optab_handler (movmisalign_optab, mode);
gcc_assert (icode != CODE_FOR_nothing);
/* We've already validated the memory, and we're creating a
@@ -8684,6 +8711,74 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
return temp;
+ case MEM_REF:
+ {
+ addr_space_t as
+ = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 1))));
+ enum machine_mode address_mode;
+ tree base = TREE_OPERAND (exp, 0);
+ gimple def_stmt;
+ /* Handle expansion of non-aliased memory with non-BLKmode. That
+ might end up in a register. */
+ if (TREE_CODE (base) == ADDR_EXPR)
+ {
+ HOST_WIDE_INT offset = mem_ref_offset (exp).low;
+ tree bit_offset;
+ base = TREE_OPERAND (base, 0);
+ if (!DECL_P (base))
+ {
+ HOST_WIDE_INT off;
+ base = get_addr_base_and_unit_offset (base, &off);
+ gcc_assert (base);
+ offset += off;
+ }
+ /* If we are expanding a MEM_REF of a non-BLKmode non-addressable
+ decl we must use bitfield operations. */
+ if (DECL_P (base)
+ && !TREE_ADDRESSABLE (base)
+ && DECL_MODE (base) != BLKmode
+ && DECL_RTL_SET_P (base)
+ && !MEM_P (DECL_RTL (base)))
+ {
+ tree bftype;
+ if (offset == 0
+ && host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
+ && (GET_MODE_BITSIZE (DECL_MODE (base))
+ == TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp)))))
+ return expand_expr (build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (exp), base),
+ target, tmode, modifier);
+ bit_offset = bitsize_int (offset * BITS_PER_UNIT);
+ bftype = TREE_TYPE (base);
+ if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
+ bftype = TREE_TYPE (exp);
+ return expand_expr (build3 (BIT_FIELD_REF, bftype,
+ base,
+ TYPE_SIZE (TREE_TYPE (exp)),
+ bit_offset),
+ target, tmode, modifier);
+ }
+ }
+ address_mode = targetm.addr_space.address_mode (as);
+ base = TREE_OPERAND (exp, 0);
+ if ((def_stmt = get_def_for_expr (base, BIT_AND_EXPR)))
+ base = build2 (BIT_AND_EXPR, TREE_TYPE (base),
+ gimple_assign_rhs1 (def_stmt),
+ gimple_assign_rhs2 (def_stmt));
+ if (!integer_zerop (TREE_OPERAND (exp, 1)))
+ base = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
+ base, double_int_to_tree (sizetype,
+ mem_ref_offset (exp)));
+ op0 = expand_expr (base, NULL_RTX, address_mode, EXPAND_SUM);
+ op0 = memory_address_addr_space (mode, op0, as);
+ temp = gen_rtx_MEM (mode, op0);
+ set_mem_attributes (temp, exp, 0);
+ set_mem_addr_space (temp, as);
+ if (TREE_THIS_VOLATILE (exp))
+ MEM_VOLATILE_P (temp) = 1;
+ return temp;
+ }
+
case ARRAY_REF:
{
@@ -10145,39 +10240,6 @@ try_tablejump (tree index_type, tree index_expr, tree minval, tree range,
return 1;
}
-/* Nonzero if the mode is a valid vector mode for this architecture.
- This returns nonzero even if there is no hardware support for the
- vector mode, but we can emulate with narrower modes. */
-
-int
-vector_mode_valid_p (enum machine_mode mode)
-{
- enum mode_class mclass = GET_MODE_CLASS (mode);
- enum machine_mode innermode;
-
- /* Doh! What's going on? */
- if (mclass != MODE_VECTOR_INT
- && mclass != MODE_VECTOR_FLOAT
- && mclass != MODE_VECTOR_FRACT
- && mclass != MODE_VECTOR_UFRACT
- && mclass != MODE_VECTOR_ACCUM
- && mclass != MODE_VECTOR_UACCUM)
- return 0;
-
- /* Hardware support. Woo hoo! */
- if (targetm.vector_mode_supported_p (mode))
- return 1;
-
- innermode = GET_MODE_INNER (mode);
-
- /* We should probably return 1 if requesting V4DI and we have no DI,
- but we have V2DI, but this is probably very unlikely. */
-
- /* If we have support for the inner mode, we can safely emulate it.
- We may not have V2DI, but me can emulate with a pair of DIs. */
- return targetm.scalar_mode_supported_p (innermode);
-}
-
/* Return a CONST_VECTOR rtx for a VECTOR_CST tree. */
static rtx
const_vector_from_tree (tree exp)
diff --git a/gcc/expr.h b/gcc/expr.h
index 6ee964a39f4..0146343b87c 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -645,6 +645,9 @@ extern void update_nonlocal_goto_save_area (void);
says how many bytes. */
extern rtx allocate_dynamic_stack_space (rtx, rtx, int);
+/* Emit one stack probe at ADDRESS, an address within the stack. */
+extern void emit_stack_probe (rtx);
+
/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
FIRST is a constant and size is a Pmode RTX. These are offsets from
the current stack pointer. STACK_GROWS_DOWNWARD says whether to add
@@ -692,6 +695,4 @@ extern tree build_libfunc_function (const char *);
/* Get the personality libfunc for a function decl. */
rtx get_personality_function (tree);
-extern int vector_mode_valid_p (enum machine_mode);
-
#endif /* GCC_EXPR_H */
diff --git a/gcc/final.c b/gcc/final.c
index 2bb897dc10b..fd597ac713d 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1850,9 +1850,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
break;
case NOTE_INSN_BASIC_BLOCK:
-#ifdef TARGET_UNWIND_INFO
- targetm.asm_out.unwind_emit (asm_out_file, insn);
-#endif
+ if (targetm.asm_out.unwind_emit)
+ targetm.asm_out.unwind_emit (asm_out_file, insn);
if (flag_debug_asm)
fprintf (asm_out_file, "\t%s basic block %d\n",
@@ -2659,12 +2658,11 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
return new_rtx;
}
-#ifdef TARGET_UNWIND_INFO
/* ??? This will put the directives in the wrong place if
get_insn_template outputs assembly directly. However calling it
before get_insn_template breaks if the insns is split. */
- targetm.asm_out.unwind_emit (asm_out_file, insn);
-#endif
+ if (targetm.asm_out.unwind_emit)
+ targetm.asm_out.unwind_emit (asm_out_file, insn);
if (CALL_P (insn))
{
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c
index 9af431cc8b7..8378b9a289d 100644
--- a/gcc/fixed-value.c
+++ b/gcc/fixed-value.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
/* Compare two fixed objects for bitwise identity. */
@@ -361,7 +362,7 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
double_int one;
one.low = 1;
one.high = 0;
- f->data = double_int_add (f->data, double_int_neg (one));
+ f->data = double_int_sub (f->data, one);
}
}
else
@@ -443,12 +444,12 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
temp1.high = 0;
r = double_int_add (r, temp1);
- /* We need to add neg(b) to r, if a < 0. */
+ /* We need to subtract b from r, if a < 0. */
if (!unsigned_p && a->data.high < 0)
- r = double_int_add (r, double_int_neg (b->data));
- /* We need to add neg(a) to r, if b < 0. */
+ r = double_int_sub (r, b->data);
+ /* We need to subtract a from r, if b < 0. */
if (!unsigned_p && b->data.high < 0)
- r = double_int_add (r, double_int_neg (a->data));
+ r = double_int_sub (r, a->data);
/* Shift right the result by FBIT. */
if (GET_MODE_FBIT (f->mode) == 2 * HOST_BITS_PER_WIDE_INT)
@@ -588,7 +589,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
&quo_s.low, &quo_s.high, 0);
/* Try to calculate (mod - pos_b). */
- temp = double_int_add (mod, double_int_neg (pos_b));
+ temp = double_int_sub (mod, pos_b);
if (leftmost_mod == 1 || double_int_cmp (mod, pos_b, 1) != -1)
{
diff --git a/gcc/flags.h b/gcc/flags.h
index 5e87c097882..93221b4409c 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -232,13 +232,51 @@ enum excess_precision
/* The excess precision specified on the command line, or defaulted by
the front end. */
extern enum excess_precision flag_excess_precision_cmdline;
-
-/* The excess precision currently in effect. */
-extern enum excess_precision flag_excess_precision;
-
/* Other basic status info about current function. */
+/* Target-dependent global state. */
+struct target_flag_state {
+ /* Values of the -falign-* flags: how much to align labels in code.
+ 0 means `use default', 1 means `don't align'.
+ For each variable, there is an _log variant which is the power
+ of two not less than the variable, for .align output. */
+ int x_align_loops_log;
+ int x_align_loops_max_skip;
+ int x_align_jumps_log;
+ int x_align_jumps_max_skip;
+ int x_align_labels_log;
+ int x_align_labels_max_skip;
+ int x_align_functions_log;
+
+ /* The excess precision currently in effect. */
+ enum excess_precision x_flag_excess_precision;
+};
+
+extern struct target_flag_state default_target_flag_state;
+#if SWITCHABLE_TARGET
+extern struct target_flag_state *this_target_flag_state;
+#else
+#define this_target_flag_state (&default_target_flag_state)
+#endif
+
+#define align_loops_log \
+ (this_target_flag_state->x_align_loops_log)
+#define align_loops_max_skip \
+ (this_target_flag_state->x_align_loops_max_skip)
+#define align_jumps_log \
+ (this_target_flag_state->x_align_jumps_log)
+#define align_jumps_max_skip \
+ (this_target_flag_state->x_align_jumps_max_skip)
+#define align_labels_log \
+ (this_target_flag_state->x_align_labels_log)
+#define align_labels_max_skip \
+ (this_target_flag_state->x_align_labels_max_skip)
+#define align_functions_log \
+ (this_target_flag_state->x_align_functions_log)
+#define flag_excess_precision \
+ (this_target_flag_state->x_flag_excess_precision)
+
/* Nonzero if subexpressions must be evaluated from left-to-right. */
extern int flag_evaluation_order;
@@ -252,19 +290,6 @@ extern bool sel_sched_switch_set;
/* Whether to run the warn_unused_result attribute pass. */
extern bool flag_warn_unused_result;
-/* Values of the -falign-* flags: how much to align labels in code.
- 0 means `use default', 1 means `don't align'.
- For each variable, there is an _log variant which is the power
- of two not less than the variable, for .align output. */
-
-extern int align_loops_log;
-extern int align_loops_max_skip;
-extern int align_jumps_log;
-extern int align_jumps_max_skip;
-extern int align_labels_log;
-extern int align_labels_max_skip;
-extern int align_functions_log;
-
/* Nonzero if we dump in VCG format, not plain text. */
extern int dump_for_graph;
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e2b30f90e8d..9ca5eff554e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "tm_p.h"
#include "target.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "intl.h"
#include "ggc.h"
@@ -60,6 +61,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "md5.h"
#include "gimple.h"
+#include "tree-flow.h"
/* Nonzero if we are folding constants inside an initializer; zero
otherwise. */
@@ -2040,8 +2042,8 @@ maybe_lvalue_p (const_tree x)
case SSA_NAME:
case COMPONENT_REF:
+ case MEM_REF:
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
@@ -2585,12 +2587,22 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
switch (TREE_CODE (arg0))
{
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
return OP_SAME (0);
+ case MEM_REF:
+ /* Require equal access sizes. We can have incomplete types
+ for array references of variable-sized arrays from the
+ Fortran frontent though. */
+ return ((TYPE_SIZE (TREE_TYPE (arg0)) == TYPE_SIZE (TREE_TYPE (arg1))
+ || (TYPE_SIZE (TREE_TYPE (arg0))
+ && TYPE_SIZE (TREE_TYPE (arg1))
+ && operand_equal_p (TYPE_SIZE (TREE_TYPE (arg0)),
+ TYPE_SIZE (TREE_TYPE (arg1)), flags)))
+ && OP_SAME (0) && OP_SAME (1));
+
case ARRAY_REF:
case ARRAY_RANGE_REF:
/* Operands 2 and 3 may be null.
@@ -7584,7 +7596,6 @@ build_fold_addr_expr_with_type_loc (location_t loc, tree t, tree ptrtype)
if (TREE_CODE (t) == WITH_SIZE_EXPR)
t = TREE_OPERAND (t, 0);
- /* Note: doesn't apply to ALIGN_INDIRECT_REF */
if (TREE_CODE (t) == INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
{
@@ -7596,6 +7607,9 @@ build_fold_addr_expr_with_type_loc (location_t loc, tree t, tree ptrtype)
SET_EXPR_LOCATION (t, loc);
}
}
+ else if (TREE_CODE (t) == MEM_REF
+ && integer_zerop (TREE_OPERAND (t, 1)))
+ return TREE_OPERAND (t, 0);
else if (TREE_CODE (t) == VIEW_CONVERT_EXPR)
{
t = build_fold_addr_expr_loc (loc, TREE_OPERAND (t, 0));
@@ -8014,6 +8028,9 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
if (TREE_CODE (op0) == VIEW_CONVERT_EXPR)
return fold_build1_loc (loc, VIEW_CONVERT_EXPR,
type, TREE_OPERAND (op0, 0));
+ if (TREE_CODE (op0) == MEM_REF)
+ return fold_build2_loc (loc, MEM_REF, type,
+ TREE_OPERAND (op0, 0), TREE_OPERAND (op0, 1));
/* For integral conversions with the same precision or pointer
conversions use a NOP_EXPR instead. */
@@ -8665,6 +8682,11 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
else if (TREE_CODE (arg0) == POINTER_PLUS_EXPR)
{
base0 = TREE_OPERAND (arg0, 0);
+ if (TREE_CODE (base0) == ADDR_EXPR)
+ {
+ base0 = TREE_OPERAND (base0, 0);
+ indirect_base0 = true;
+ }
offset0 = TREE_OPERAND (arg0, 1);
}
@@ -8682,6 +8704,11 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
else if (TREE_CODE (arg1) == POINTER_PLUS_EXPR)
{
base1 = TREE_OPERAND (arg1, 0);
+ if (TREE_CODE (base1) == ADDR_EXPR)
+ {
+ base1 = TREE_OPERAND (base1, 0);
+ indirect_base1 = true;
+ }
offset1 = TREE_OPERAND (arg1, 1);
}
@@ -9524,6 +9551,36 @@ fold_binary_loc (location_t loc,
switch (code)
{
+ case MEM_REF:
+ /* MEM[&MEM[p, CST1], CST2] -> MEM[p, CST1 + CST2]. */
+ if (TREE_CODE (arg0) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (arg0, 0)) == MEM_REF)
+ {
+ tree iref = TREE_OPERAND (arg0, 0);
+ return fold_build2 (MEM_REF, type,
+ TREE_OPERAND (iref, 0),
+ int_const_binop (PLUS_EXPR, arg1,
+ TREE_OPERAND (iref, 1), 0));
+ }
+
+ /* MEM[&a.b, CST2] -> MEM[&a, offsetof (a, b) + CST2]. */
+ if (TREE_CODE (arg0) == ADDR_EXPR
+ && handled_component_p (TREE_OPERAND (arg0, 0)))
+ {
+ tree base;
+ HOST_WIDE_INT coffset;
+ base = get_addr_base_and_unit_offset (TREE_OPERAND (arg0, 0),
+ &coffset);
+ if (!base)
+ return NULL_TREE;
+ return fold_build2 (MEM_REF, type,
+ build_fold_addr_expr (base),
+ int_const_binop (PLUS_EXPR, arg1,
+ size_int (coffset), 0));
+ }
+
+ return NULL_TREE;
+
case POINTER_PLUS_EXPR:
/* 0 +p index -> (type)index */
if (integer_zerop (arg0))
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 18509132034..baba9e569e9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,472 @@
+2010-07-23 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-types.c (gfc_get_array_descriptor_base,
+ gfc_get_array_type_bounds): Set TYPE_NAMELESS.
+ * trans-decl.c (gfc_build_qualified_array): Set DECL_NAMELESS
+ instead of clearing DECL_NAME.
+ (gfc_build_dummy_array_decl): Set DECL_NAMELESS.
+
+2009-07-23 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/24524
+ * trans-array.c (gfc_init_loopinfo): Initialize the reverse
+ field.
+ gfc_trans_scalarized_loop_end: If reverse set in dimension n,
+ reverse the scalarization loop.
+ gfc_conv_resolve_dependencies: Pass the reverse field of the
+ loopinfo to gfc_dep_resolver.
+ trans-expr.c (gfc_trans_assignment_1): Enable loop reversal for
+ assignment by resetting loop.reverse.
+ gfortran.h : Add the gfc_reverse enum.
+ trans.h : Add the reverse field to gfc_loopinfo.
+ dependency.c (gfc_check_dependency): Pass null to the new arg
+ of gfc_dep_resolver.
+ (gfc_check_section_vs_section): Check for reverse dependencies.
+ (gfc_dep_resolver): Add reverse argument and deal with the loop
+ reversal logic.
+ dependency.h : Modify prototype for gfc_dep_resolver to include
+ gfc_reverse *.
+
+2010-07-23 Daniel Kraft <d@domob.eu>
+
+ PR fortran/44709
+ * gfortran.h (gfc_find_symtree_in_proc): New method.
+ * symbol.c (gfc_find_symtree_in_proc): New method.
+ * match.c (match_exit_cycle): Look for loop name also in parent
+ namespaces within current procedure.
+
+2010-07-22 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45019
+ * dependency.c (gfc_check_dependency): Add argument alising check.
+ * symbol.c (gfc_symbols_could_alias): Add argument alising check.
+
+2010-07-22 Daniel Kraft <d@domob.eu>
+
+ * trans-stmt.c (gfc_trans_return): Put back in the handling of se.post,
+ now in the correct place.
+
+2010-07-21 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/44929
+ * Revert my commit r162325.
+
+2010-07-21 Daniel Kraft <d@domob.eu>
+
+ * trans.h (gfc_get_return_label): Removed.
+ (gfc_generate_return): New method.
+ (gfc_trans_deferred_vars): Update gfc_wrapped_block rather than
+ returning a tree directly.
+ * trans-stmt.c (gfc_trans_return): Use `gfc_generate_return'.
+ (gfc_trans_block_construct): Update for new interface to
+ `gfc_trans_deferred_vars'.
+ * trans-decl.c (current_function_return_label): Removed.
+ (current_procedure_symbol): New variable.
+ (gfc_get_return_label): Removed.
+ (gfc_trans_deferred_vars): Update gfc_wrapped_block rather than
+ returning a tree directly.
+ (get_proc_result), (gfc_generate_return): New methods.
+ (gfc_generate_function_code): Clean up and do init/cleanup here
+ also with gfc_wrapped_block. Remove return-label but rather
+ return directly.
+
+2010-07-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/44929
+ * fortran/match.c (match_type_spec): Check for derived type before
+ intrinsic types.
+
+2010-07-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/42385
+ * interface.c (matching_typebound_op): Add argument for the
+ return of the generic name for the procedure.
+ (build_compcall_for_operator): Add an argument for the generic
+ name of an operator procedure and supply it to the expression.
+ (gfc_extend_expr, gfc_extend_assign): Use the generic name in
+ calls to the above procedures.
+ * resolve.c (resolve_typebound_function): Catch procedure
+ component calls for CLASS objects, check that the vtable is
+ complete and insert the $vptr and procedure components, to make
+ the call.
+ (resolve_typebound_function): The same.
+ * trans-decl.c (gfc_trans_deferred_vars): Do not deallocate
+ an allocatable scalar if it is a result.
+
+2010-07-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/44353
+ * match.c (gfc_match_iterator): Reverted.
+
+2010-07-18 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/44353
+ * match.c (gfc_match_iterator): Remove error that iterator
+ cannot be INTENT(IN).
+
+2010-07-17 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_free_ss): Don't free beyond ss rank.
+ Access subscript through the "dim" field index.
+ (gfc_trans_create_temp_array): Access ss info through the "dim" field
+ index.
+ (gfc_conv_array_index_offset): Ditto.
+ (gfc_conv_loop_setup): Ditto.
+ (gfc_conv_expr_descriptor): Ditto.
+ (gfc_conv_ss_startstride): Ditto. Update call to
+ gfc_conv_section_startstride.
+ (gfc_conv_section_startstride): Set values along the array dimension.
+ Get array dimension directly from the argument.
+
+2010-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ * trans.h (gfc_string_to_single_character): New prototype.
+ * trans-expr.c (string_to_single_character): Renamed to ...
+ (gfc_string_to_single_character): ... this. No longer static.
+ (gfc_conv_scalar_char_value, gfc_build_compare_string,
+ gfc_trans_string_copy): Adjust callers.
+ * config-lang.in (gtfiles): Add fortran/trans-stmt.c.
+ * trans-stmt.c: Include ggc.h and gt-fortran-trans-stmt.h.
+ (select_struct): Move to toplevel, add GTY(()).
+ (gfc_trans_character_select): Optimize SELECT CASE
+ with character length 1.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
+ * trans-common.c: Likewise.
+ * trans-decl.c: Likewise.
+ * trans-types.c: Likewise.
+ * trans.c: Likewise.
+
+2010-07-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44936
+ * resolve.c (resolve_typebound_generic_call): Resolve generic
+ non-polymorphic type-bound procedure calls to the correct specific
+ procedure.
+ (resolve_typebound_subroutine): Remove superfluous code.
+
+2010-07-15 Daniel Kraft <d@domob.eu>
+
+ PR fortran/44709
+ * trans.h (struct gfc_wrapped_block): New struct.
+ (gfc_start_wrapped_block), (gfc_add_init_cleanup): New methods.
+ (gfc_finish_wrapped_block): New method.
+ (gfc_init_default_dt): Add new init code to block rather than
+ returning it.
+ * trans-array.h (gfc_trans_auto_array_allocation): Use gfc_wrapped_block
+ (gfc_trans_dummy_array_bias): Ditto.
+ (gfc_trans_g77_array): Ditto.
+ (gfc_trans_deferred_array): Ditto.
+ * trans.c (gfc_add_expr_to_block): Call add_expr_to_chain.
+ (add_expr_to_chain): New method based on old gfc_add_expr_to_block.
+ (gfc_start_wrapped_block), (gfc_add_init_cleanup): New methods.
+ (gfc_finish_wrapped_block): New method.
+ * trans-array.c (gfc_trans_auto_array_allocation): use gfc_wrapped_block
+ (gfc_trans_g77_array), (gfc_trans_dummy_array_bias): Ditto.
+ (gfc_trans_deferred_array): Ditto.
+ * trans-decl.c (gfc_trans_dummy_character): Ditto.
+ (gfc_trans_auto_character_variable), (gfc_trans_assign_aux_var): Ditto.
+ (init_intent_out_dt): Ditto.
+ (gfc_init_default_dt): Add new init code to block rather than
+ returning it.
+ (gfc_trans_deferred_vars): Use gfc_wrapped_block to collect all init
+ and cleanup code and put it all together.
+
+2010-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ * trans.h (gfc_build_compare_string): Add CODE argument.
+ * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Pass OP to
+ gfc_build_compare_string.
+ * trans-expr.c (gfc_conv_expr_op): Pass CODE to
+ gfc_build_compare_string.
+ (string_to_single_character): Rename len variable to length.
+ (gfc_optimize_len_trim): New function.
+ (gfc_build_compare_string): Add CODE argument. If it is EQ_EXPR
+ or NE_EXPR and one of the strings is string literal with LEN_TRIM
+ bigger than the length of the other string, they compare unequal.
+
+ PR fortran/40206
+ * trans-stmt.c (gfc_trans_character_select): Always use NULL for high
+ in CASE_LABEL_EXPR and use NULL for low for the default case.
+
+2010-07-14 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_conv_section_upper_bound): Remove
+ (gfc_conv_section_startstride): Don't set the upper bound in the
+ vector subscript case.
+ (gfc_conv_loop_setup): Don't use gfc_conv_section_upper_bound
+
+2010-07-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44925
+ * gfortran.h (gfc_is_data_pointer): Remove prototype.
+ * dependency.c (gfc_is_data_pointer): Make it static.
+ * intrinsic.texi: Update documentation on C_LOC.
+ * resolve.c (gfc_iso_c_func_interface): Fix pointer and target checks
+ and add a check for polymorphic variables.
+
+2010-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-expr.c (string_to_single_character): Also optimize
+ string literals containing a single char followed only by spaces.
+ (gfc_trans_string_copy): Remove redundant string_to_single_character
+ calls.
+
+ * trans-decl.c (gfc_build_intrinsic_function_decls,
+ gfc_build_builtin_function_decls): Mark functions as
+ DECL_PURE_P or TREE_READONLY.
+
+2010-07-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * trans-decl.c (build_entry_thunks): Call build_call_expr_loc_vec
+ instead of build_function_call_expr.
+ * trans-intrinsic.c (gfc_conv_intrinsic_sr_kind): Likewise.
+
+2010-07-13 Tobias Burnus <burnus@net-b.de>
+ Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/43665
+ * trans.h (gfc_build_library_function_decl_with_spec): New prototype.
+ * trans-decl.c (gfc_build_library_function_decl_with_spec): Removed
+ static.
+ * trans-io (gfc_build_io_library_fndecls): Add "fn spec" annotations.
+
+2010-07-13 Daniel Franke <franke.daniel@gmail.com>
+ Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/43665
+ * trans-decl.c (gfc_build_intrinsic_function_decls): Add
+ noclobber/noescape annotations to function calls.
+ (gfc_build_builtin_function_decls): Likewise.
+
+2010-07-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44434
+ PR fortran/44565
+ PR fortran/43945
+ PR fortran/44869
+ * gfortran.h (gfc_find_derived_vtab): Modified prototype.
+ * class.c (gfc_build_class_symbol): Modified call to
+ 'gfc_find_derived_vtab'.
+ (add_proc_component): Removed, moved code into 'add_proc_comp'.
+ (add_proc_comps): Renamed to 'add_proc_comp', removed treatment of
+ generics.
+ (add_procs_to_declared_vtab1): Removed unnecessary argument 'resolved'.
+ Removed treatment of generics.
+ (copy_vtab_proc_comps): Removed unnecessary argument 'resolved'.
+ Call 'add_proc_comp' instead of duplicating code.
+ (add_procs_to_declared_vtab): Removed unnecessary arguments 'resolved'
+ and 'declared'.
+ (add_generic_specifics,add_generics_to_declared_vtab): Removed.
+ (gfc_find_derived_vtab): Removed unnecessary argument 'resolved'.
+ Removed treatment of generics.
+ * iresolve.c (gfc_resolve_extends_type_of): Modified call to
+ 'gfc_find_derived_vtab'.
+ * resolve.c (resolve_typebound_function,resolve_typebound_subroutine):
+ Removed treatment of generics.
+ (resolve_select_type,resolve_fl_derived): Modified call to
+ 'gfc_find_derived_vtab'.
+ * trans-decl.c (gfc_get_symbol_decl): Ditto.
+ * trans-expr.c (gfc_conv_derived_to_class,gfc_trans_class_assign):
+ Ditto.
+ * trans-stmt.c (gfc_trans_allocate): Ditto.
+
+2010-07-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/37077
+ * trans-io.c (build_dt): Set common.unit to flag chracter(kind=4)
+ internal unit.
+
+2010-07-12 Mikael Morin <mikael@gcc.gnu.org>
+
+ * expr.c (gfc_get_int_expr): Don't initialize mpfr data twice.
+ * resolve.c (build_default_init_expr): Ditto.
+
+2010-07-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/44702
+ * module.c (sort_iso_c_rename_list): Remove.
+ (import_iso_c_binding_module,use_iso_fortran_env_module):
+ Allow multiple imports of the same symbol.
+
+2010-07-11 Mikael Morin <mikael@gcc.gnu.org>
+
+ * arith.c (gfc_arith_done_1): Release mpfr internal caches.
+
+2010-07-11 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44869
+ * decl.c (build_sym,attr_decl1): Only build the class container if the
+ symbol has sufficient attributes.
+ * expr.c (gfc_check_pointer_assign): Use class_pointer instead of
+ pointer attribute for classes.
+ * match.c (gfc_match_allocate,gfc_match_deallocate): Ditto.
+ * module.c (MOD_VERSION): Bump.
+ (enum ab_attribute,attr_bits): Add AB_CLASS_POINTER.
+ (mio_symbol_attribute): Handle class_pointer attribute.
+ * parse.c (parse_derived): Use class_pointer instead of pointer
+ attribute for classes.
+ * primary.c (gfc_variable_attr,gfc_expr_attr): Ditto.
+ * resolve.c (resolve_structure_cons,resolve_deallocate_expr,
+ resolve_allocate_expr,resolve_fl_derived): Ditto.
+ (resolve_fl_var_and_proc): Check for class_ok attribute.
+
+2010-07-10 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-io.c (gfc_build_st_parameter): Update calls to
+ gfc_add_field_to_struct.
+ * trans-stmt.c (ADD_FIELD): Ditto.
+ * trans-types.c
+ (gfc_get_derived_type): Ditto. Don't create backend_decl for C_PTR's
+ C_ADDRESS field.
+ (gfc_add_field_to_struct_1): Set TYPE_FIELDS(context) instead of
+ fieldlist, remove fieldlist from argument list.
+ (gfc_add_field_to_struct): Update call to gfc_add_field_to_struct_1
+ and remove fieldlist from argument list.
+ (gfc_get_desc_dim_type, gfc_get_array_descriptor_base,
+ gfc_get_mixed_entry_union): Move setting
+ TYPE_FIELDS to gfc_add_field_to_struct_1 and update calls to it.
+ * trans-types.h (gfc_add_field_to_struct): Update prototype.
+
+2010-07-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/44773
+ * trans-expr.c (arrayfunc_assign_needs_temporary): No temporary
+ if the lhs has never been host associated, as well as not being
+ use associated, a pointer or a target.
+ * resolve.c (resolve_variable): Mark variables that are host
+ associated.
+ * gfortran.h: Add the host_assoc bit to the symbol_attribute
+ structure.
+
+2010-07-09 Janus Weil <janus@gcc.gnu.org>
+
+ * intrinsic.texi: Add documentation for SAME_TYPE_AS, EXTENDS_TYPE_OF,
+ STORAGE_SIZE, C_NULL_PTR and C_NULL_FUNPTR. Modify documentation of
+ SIZEOF and C_SIZEOF.
+
+2010-07-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44649
+ * gfortran.h (gfc_isym_id): Add GFC_ISYM_C_SIZEOF,GFC_ISYM_STORAGE_SIZE.
+ * intrinsic.h (gfc_check_c_sizeof,gfc_check_storage_size,
+ gfc_resolve_storage_size): New prototypes.
+ * check.c (gfc_check_c_sizeof,gfc_check_storage_size): New functions.
+ * intrinsic.c (add_functions): Add STORAGE_SIZE.
+ * iresolve.c (gfc_resolve_storage_size): New function.
+ * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Handle polymorphic
+ arguments.
+ (gfc_conv_intrinsic_storage_size): New function.
+ (gfc_conv_intrinsic_function): Handle STORAGE_SIZE.
+
+2010-07-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/44847
+ * match.c (match_exit_cycle): Error on EXIT also from collapsed
+ !$omp do loops. Error on CYCLE to non-innermost collapsed
+ !$omp do loops.
+
+2010-07-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/18918
+ * array.c (gfc_match_array_ref): Better error message for
+ coarrays with too few ranks.
+ (match_subscript): Move one diagnostic to caller.
+ * gfortran.h (gfc_get_corank): Add prottype.
+ * expr.c (gfc_get_corank): New function.
+ * iresolve.c (resolve_bound): Fix rank for cobounds.
+ (gfc_resolve_lbound,gfc_resolve_lcobound, gfc_resolve_ubound,
+ gfc_resolve_ucobound, gfc_resolve_this_image): Update
+ resolve_bound call.
+
+2010-07-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/44742
+ * array.c (gfc_expand_constructor): Add optional diagnostic.
+ * gfortran.h (gfc_expand_constructor): Update prototype.
+ * expr.c (gfc_simplify_expr, check_init_expr,
+ gfc_reduce_init_expr): Update gfc_expand_constructor call.
+ * resolve.c (gfc_resolve_expr): Ditto.
+
+2010-07-06 Tobias Burnus <burnus@net-b.de>
+
+ * trans-decl.c: Include diagnostic-core.h besides toplev.h.
+ * trans-intrinsic.c: Ditto.
+ * trans-types.c: Ditto.
+ * convert.c: Include diagnostic-core.h instead of toplev.h.
+ * options.c: Ditto.
+ * trans-array.c: Ditto.
+ * trans-const.c: Ditto.
+ * trans-expr.c: Ditto.
+ * trans-io.c: Ditto.
+ * trans-openmp.c: Ditto.
+ * trans.c: Ditto.
+
+2010-07-06 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/PR44693
+ * check.c (dim_rank_check): Also check intrinsic functions.
+ Adjust permissible rank for functions which reduce the rank of
+ their argument. Spread is an exception, where DIM can
+ be one larger than the rank of array.
+
+2010-07-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/44797
+ * fortran/io.c (resolve_tag): Check EXIST tag is a default logical.
+
+2010-07-05 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/44596
+ * trans-types.c (gfc_get_derived_type): Derived type fields
+ with the vtype attribute must have TYPE_REF_CAN_ALIAS_ALL set
+ but build_pointer_type_for_mode must be used for this.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * trans.h (gfc_conv_procedure_call): Take a VEC instead of a tree.
+ * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Adjust for new
+ type of gfc_conv_procedure_call.
+ (conv_generic_with_optional_char_arg): Likewise.
+ * trans-stmt.c (gfc_trans_call): Likewise.
+ * trans-expr.c (gfc_conv_function_expr): Likewise.
+ (gfc_conv_procedure_call): Use build_call_vec instead of
+ build_call_list.
+
+2010-07-04 Daniel Kraft <d@domob.eu>
+
+ * gfc-internals.texi (gfc_code): Document BLOCK and ASSOCIATE.
+
+2010-07-04 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/44596
+ PR fortran/44745
+ * trans-types.c (gfc_get_derived_type): Derived type fields
+ with the vtype attribute must have TYPE_REF_CAN_ALIAS_ALL set.
+
+2010-07-02 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/44662
+ * decl.c (match_procedure_in_type): Clear structure before using.
+ (gfc_match_generic): Ditto.
+
+2010-07-02 Nathan Froyd <froydnj@codesourcery.com>
+
+ * trans-types.h (gfc_add_field_to_struct): Add tree ** parameter.
+ * trans-types.c (gfc_add_field_to_struct_1): New function, most
+ of which comes from...
+ (gfc_add_field_to_struct): ...here. Call it. Add new parameter.
+ (gfc_get_desc_dim_type): Call gfc_add_field_to_struct_1 for
+ building fields.
+ (gfc_get_array_descriptor_base): Likewise.
+ (gfc_get_mixed_entry_union): Likewise.
+ (gfc_get_derived_type): Add extra chain parameter for
+ gfc_add_field_to_struct.
+ * trans-stmt.c (gfc_trans_character_select): Likewise.
+ * trans-io.c (gfc_build_st_parameter): Likewise.
+
2010-06-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/44718
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 1e90584be49..f555eb104cd 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -260,6 +260,8 @@ gfc_arith_done_1 (void)
for (rp = gfc_real_kinds; rp->kind; rp++)
mpfr_clears (rp->epsilon, rp->huge, rp->tiny, rp->subnormal, NULL);
+
+ mpfr_free_cache ();
}
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 64816f28abb..68b6456cdbc 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -91,7 +91,9 @@ match_subscript (gfc_array_ref *ar, int init, bool match_star)
else if (!star)
m = gfc_match_expr (&ar->start[i]);
- if (m == MATCH_NO)
+ if (m == MATCH_NO && gfc_match_char ('*') == MATCH_YES)
+ return MATCH_NO;
+ else if (m == MATCH_NO)
gfc_error ("Expected array subscript at %C");
if (m != MATCH_YES)
return MATCH_ERROR;
@@ -229,12 +231,28 @@ coarray:
if (gfc_match_char (']') == MATCH_YES)
{
ar->codimen++;
+ if (ar->codimen < corank)
+ {
+ gfc_error ("Too few codimensions at %C, expected %d not %d",
+ corank, ar->codimen);
+ return MATCH_ERROR;
+ }
return MATCH_YES;
}
if (gfc_match_char (',') != MATCH_YES)
{
- gfc_error ("Invalid form of coarray reference at %C");
+ if (gfc_match_char ('*') == MATCH_YES)
+ gfc_error ("Unexpected '*' for codimension %d of %d at %C",
+ ar->codimen + 1, corank);
+ else
+ gfc_error ("Invalid form of coarray reference at %C");
+ return MATCH_ERROR;
+ }
+ if (ar->codimen >= corank)
+ {
+ gfc_error ("Invalid codimension %d at %C, only %d codimensions exist",
+ ar->codimen + 1, corank);
return MATCH_ERROR;
}
}
@@ -1545,7 +1563,7 @@ gfc_get_array_element (gfc_expr *array, int element)
constructor if they are small enough. */
gfc_try
-gfc_expand_constructor (gfc_expr *e)
+gfc_expand_constructor (gfc_expr *e, bool fatal)
{
expand_info expand_save;
gfc_expr *f;
@@ -1557,6 +1575,15 @@ gfc_expand_constructor (gfc_expr *e)
if (f != NULL)
{
gfc_free_expr (f);
+ if (fatal)
+ {
+ gfc_error ("The number of elements in the array constructor "
+ "at %L requires an increase of the allowed %d "
+ "upper limit. See -fmax-array-constructor "
+ "option", &e->where,
+ gfc_option.flag_max_array_constructor);
+ return FAILURE;
+ }
return SUCCESS;
}
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 34527172431..7578775ef42 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -473,12 +473,15 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
if (dim == NULL)
return SUCCESS;
- if (dim->expr_type != EXPR_CONSTANT
- || (array->expr_type != EXPR_VARIABLE
- && array->expr_type != EXPR_ARRAY))
+ if (dim->expr_type != EXPR_CONSTANT)
return SUCCESS;
- rank = array->rank;
+ if (array->expr_type == EXPR_FUNCTION && array->value.function.isym
+ && array->value.function.isym->id == GFC_ISYM_SPREAD)
+ rank = array->rank + 1;
+ else
+ rank = array->rank;
+
if (array->expr_type == EXPR_VARIABLE)
{
ar = gfc_find_array_ref (array);
@@ -3043,6 +3046,20 @@ gfc_check_sizeof (gfc_expr *arg ATTRIBUTE_UNUSED)
gfc_try
+gfc_check_c_sizeof (gfc_expr *arg)
+{
+ if (verify_c_interop (&arg->ts) != SUCCESS)
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must be be an "
+ "interoperable data entity", gfc_current_intrinsic_arg[0],
+ gfc_current_intrinsic, &arg->where);
+ return FAILURE;
+ }
+ return SUCCESS;
+}
+
+
+gfc_try
gfc_check_sleep_sub (gfc_expr *seconds)
{
if (type_check (seconds, 0, BT_INTEGER) == FAILURE)
@@ -4556,3 +4573,27 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
return SUCCESS;
}
+
+
+gfc_try
+gfc_check_storage_size (gfc_expr *a ATTRIBUTE_UNUSED, gfc_expr *kind)
+{
+ if (kind == NULL)
+ return SUCCESS;
+
+ if (type_check (kind, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (kind, 1) == FAILURE)
+ return FAILURE;
+
+ if (kind->expr_type != EXPR_CONSTANT)
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must be a constant",
+ gfc_current_intrinsic_arg[1], gfc_current_intrinsic,
+ &kind->where);
+ return FAILURE;
+ }
+
+ return SUCCESS;
+}
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 37b9cf01590..b5e17f4e2f6 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -174,7 +174,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
c->ts.u.derived = NULL;
else
{
- vtab = gfc_find_derived_vtab (ts->u.derived, false);
+ vtab = gfc_find_derived_vtab (ts->u.derived);
gcc_assert (vtab);
c->ts.u.derived = vtab->ts.u.derived;
}
@@ -199,344 +199,126 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
}
+/* Add a procedure pointer component to the vtype
+ to represent a specific type-bound procedure. */
+
static void
-add_proc_component (gfc_component *c, gfc_symbol *vtype,
- gfc_symtree *st, gfc_symbol *specific,
- bool is_generic, bool is_generic_specific)
+add_proc_comp (gfc_symbol *vtype, const char *name, gfc_typebound_proc *tb)
{
- /* Add procedure component. */
- if (is_generic)
- {
- if (gfc_add_component (vtype, specific->name, &c) == FAILURE)
- return;
- c->ts.interface = specific;
- }
- else if (c && is_generic_specific)
- {
- c->ts.interface = st->n.tb->u.specific->n.sym;
- }
- else
+ gfc_component *c;
+ c = gfc_find_component (vtype, name, true, true);
+
+ if (c == NULL)
{
- c = gfc_find_component (vtype, st->name, true, true);
- if (!c && gfc_add_component (vtype, st->name, &c) == FAILURE)
+ /* Add procedure component. */
+ if (gfc_add_component (vtype, name, &c) == FAILURE)
return;
- c->ts.interface = st->n.tb->u.specific->n.sym;
- }
-
- if (!c->tb)
- c->tb = XCNEW (gfc_typebound_proc);
- *c->tb = *st->n.tb;
- c->tb->ppc = 1;
- c->attr.procedure = 1;
- c->attr.proc_pointer = 1;
- c->attr.flavor = FL_PROCEDURE;
- c->attr.access = ACCESS_PRIVATE;
- c->attr.external = 1;
- c->attr.untyped = 1;
- c->attr.if_source = IFSRC_IFBODY;
-
- /* A static initializer cannot be used here because the specific
- function is not a constant; internal compiler error: in
- output_constant, at varasm.c:4623 */
- c->initializer = NULL;
-}
+ if (tb->u.specific)
+ c->ts.interface = tb->u.specific->n.sym;
+ if (!c->tb)
+ c->tb = XCNEW (gfc_typebound_proc);
+ *c->tb = *tb;
+ c->tb->ppc = 1;
+ c->attr.procedure = 1;
+ c->attr.proc_pointer = 1;
+ c->attr.flavor = FL_PROCEDURE;
+ c->attr.access = ACCESS_PRIVATE;
+ c->attr.external = 1;
+ c->attr.untyped = 1;
+ c->attr.if_source = IFSRC_IFBODY;
-static void
-add_proc_comps (gfc_component *c, gfc_symbol *vtype,
- gfc_symtree *st, bool is_generic)
-{
- if (c == NULL && !is_generic)
- {
- add_proc_component (c, vtype, st, NULL, false, false);
- }
- else if (is_generic && st->n.tb && vtype->components == NULL)
- {
- gfc_tbp_generic* g;
- gfc_symbol * specific;
- for (g = st->n.tb->u.generic; g; g = g->next)
- {
- if (!g->specific)
- continue;
- specific = g->specific->u.specific->n.sym;
- add_proc_component (NULL, vtype, st, specific, true, false);
- }
+ /* A static initializer cannot be used here because the specific
+ function is not a constant; internal compiler error: in
+ output_constant, at varasm.c:4623 */
+ c->initializer = NULL;
}
else if (c->attr.proc_pointer && c->tb)
{
- *c->tb = *st->n.tb;
+ *c->tb = *tb;
c->tb->ppc = 1;
- c->ts.interface = st->n.tb->u.specific->n.sym;
+ c->ts.interface = tb->u.specific->n.sym;
}
}
+
+/* Add all specific type-bound procedures in the symtree 'st' to a vtype. */
+
static void
-add_procs_to_declared_vtab1 (gfc_symtree *st, gfc_symbol *vtype,
- bool resolved)
+add_procs_to_declared_vtab1 (gfc_symtree *st, gfc_symbol *vtype)
{
- gfc_component *c;
- gfc_symbol *generic;
- char name[3 * GFC_MAX_SYMBOL_LEN + 10];
-
if (!st)
return;
if (st->left)
- add_procs_to_declared_vtab1 (st->left, vtype, resolved);
+ add_procs_to_declared_vtab1 (st->left, vtype);
if (st->right)
- add_procs_to_declared_vtab1 (st->right, vtype, resolved);
+ add_procs_to_declared_vtab1 (st->right, vtype);
if (!st->n.tb)
return;
if (!st->n.tb->is_generic && st->n.tb->u.specific)
- {
- c = gfc_find_component (vtype, st->name, true, true);
- add_proc_comps (c, vtype, st, false);
- }
- else if (st->n.tb->is_generic)
- {
- c = gfc_find_component (vtype, st->name, true, true);
-
- if (c == NULL)
- {
- /* Add derived type component with generic name. */
- if (gfc_add_component (vtype, st->name, &c) == FAILURE)
- return;
- c->ts.type = BT_DERIVED;
- c->attr.flavor = FL_VARIABLE;
- c->attr.pointer = 1;
-
- /* Add a special empty derived type as a placeholder. */
- sprintf (name, "$empty");
- gfc_find_symbol (name, vtype->ns, 0, &generic);
- if (generic == NULL)
- {
- gfc_get_symbol (name, vtype->ns, &generic);
- generic->attr.flavor = FL_DERIVED;
- generic->refs++;
- gfc_set_sym_referenced (generic);
- generic->ts.type = BT_UNKNOWN;
- generic->attr.zero_comp = 1;
- }
-
- c->ts.u.derived = generic;
- }
- }
+ add_proc_comp (vtype, st->name, st->n.tb);
}
+/* Copy procedure pointers components from the parent type. */
+
static void
-copy_vtab_proc_comps (gfc_symbol *declared, gfc_symbol *vtype,
- bool resolved)
+copy_vtab_proc_comps (gfc_symbol *declared, gfc_symbol *vtype)
{
- gfc_component *c, *cmp;
+ gfc_component *cmp;
gfc_symbol *vtab;
- vtab = gfc_find_derived_vtab (declared, resolved);
+ vtab = gfc_find_derived_vtab (declared);
for (cmp = vtab->ts.u.derived->components; cmp; cmp = cmp->next)
{
if (gfc_find_component (vtype, cmp->name, true, true))
continue;
- if (gfc_add_component (vtype, cmp->name, &c) == FAILURE)
- return;
-
- if (cmp->ts.type == BT_DERIVED)
- {
- c->ts = cmp->ts;
- c->ts.u.derived = cmp->ts.u.derived;
- c->attr.flavor = FL_VARIABLE;
- c->attr.pointer = 1;
- c->initializer = NULL;
- continue;
- }
-
- c->tb = XCNEW (gfc_typebound_proc);
- *c->tb = *cmp->tb;
- c->attr.procedure = 1;
- c->attr.proc_pointer = 1;
- c->attr.flavor = FL_PROCEDURE;
- c->attr.access = ACCESS_PRIVATE;
- c->attr.external = 1;
- c->ts.interface = cmp->ts.interface;
- c->attr.untyped = 1;
- c->attr.if_source = IFSRC_IFBODY;
- c->initializer = NULL;
+ add_proc_comp (vtype, cmp->name, cmp->tb);
}
}
-static void
-add_procs_to_declared_vtab (gfc_symbol *declared, gfc_symbol *vtype,
- gfc_symbol *derived, bool resolved)
-{
- gfc_symbol* super_type;
-
- super_type = gfc_get_derived_super_type (declared);
-
- if (super_type && (super_type != declared))
- add_procs_to_declared_vtab (super_type, vtype, derived, resolved);
-
- if (declared != derived)
- copy_vtab_proc_comps (declared, vtype, resolved);
-
- if (declared->f2k_derived && declared->f2k_derived->tb_sym_root)
- add_procs_to_declared_vtab1 (declared->f2k_derived->tb_sym_root,
- vtype, resolved);
-
- if (declared->f2k_derived && declared->f2k_derived->tb_uop_root)
- add_procs_to_declared_vtab1 (declared->f2k_derived->tb_uop_root,
- vtype, resolved);
-}
-
-
-static
-void add_generic_specifics (gfc_symbol *declared, gfc_symbol *vtab,
- const char *name)
-{
- gfc_tbp_generic* g;
- gfc_symbol * specific1;
- gfc_symbol * specific2;
- gfc_symtree *st = NULL;
- gfc_component *c;
-
- /* Find the generic procedure using the component name. */
- st = gfc_find_typebound_proc (declared, NULL, name, true, NULL);
- if (st == NULL)
- st = gfc_find_typebound_user_op (declared, NULL, name, true, NULL);
-
- if (st == NULL)
- return;
-
- /* Add procedure pointer components for the specific procedures. */
- for (g = st->n.tb->u.generic; g; g = g->next)
- {
- if (!g->specific)
- continue;
- specific1 = g->specific_st->n.tb->u.specific->n.sym;
-
- c = vtab->ts.u.derived->components;
- specific2 = NULL;
-
- /* Override identical specific interface. */
- if (vtab->ts.u.derived->components)
- {
- for (; c; c= c->next)
- {
- specific2 = c->ts.interface;
- if (gfc_compare_interfaces (specific2, specific1,
- specific1->name, 0, 0, NULL, 0))
- break;
- }
- }
-
- add_proc_component (c, vtab->ts.u.derived, g->specific_st,
- NULL, false, true);
- vtab->ts.u.derived->attr.zero_comp = 0;
- }
-}
+/* Add procedure pointers for all type-bound procedures to a vtab. */
static void
-add_generics_to_declared_vtab (gfc_symbol *declared, gfc_symbol *vtype,
- gfc_symbol *derived, bool resolved)
+add_procs_to_declared_vtab (gfc_symbol *derived, gfc_symbol *vtype)
{
- gfc_component *cmp;
- gfc_symtree *st = NULL;
- gfc_symbol * vtab;
- char name[2 * GFC_MAX_SYMBOL_LEN + 8];
gfc_symbol* super_type;
- gcc_assert (resolved);
+ super_type = gfc_get_derived_super_type (derived);
- for (cmp = vtype->components; cmp; cmp = cmp->next)
+ if (super_type && (super_type != derived))
{
- if (cmp->ts.type != BT_DERIVED)
- continue;
-
- /* The only derived type that does not represent a generic
- procedure is the pointer to the parent vtab. */
- if (cmp->ts.u.derived
- && strcmp (cmp->ts.u.derived->name, "$extends") == 0)
- continue;
-
- /* Find the generic procedure using the component name. */
- st = gfc_find_typebound_proc (declared, NULL, cmp->name,
- true, NULL);
- if (st == NULL)
- st = gfc_find_typebound_user_op (declared, NULL, cmp->name,
- true, NULL);
-
- /* Should be an error but we pass on it for now. */
- if (st == NULL || !st->n.tb->is_generic)
- continue;
-
- vtab = NULL;
-
- /* Build a vtab and a special vtype, with only the procedure
- pointer fields, to carry the pointers to the specific
- procedures. Should this name ever be changed, the same
- should be done in trans-expr.c(gfc_trans_assign_vtab_procs). */
- sprintf (name, "vtab$%s$%s", vtype->name, cmp->name);
- gfc_find_symbol (name, derived->ns, 0, &vtab);
- if (vtab == NULL)
- {
- gfc_get_symbol (name, derived->ns, &vtab);
- vtab->ts.type = BT_DERIVED;
- vtab->attr.flavor = FL_VARIABLE;
- vtab->attr.target = 1;
- vtab->attr.save = SAVE_EXPLICIT;
- vtab->attr.vtab = 1;
- vtab->refs++;
- gfc_set_sym_referenced (vtab);
- sprintf (name, "%s$%s", vtype->name, cmp->name);
-
- gfc_find_symbol (name, derived->ns, 0, &cmp->ts.u.derived);
- if (cmp->ts.u.derived == NULL
- || (strcmp (cmp->ts.u.derived->name, "$empty") == 0))
- {
- gfc_get_symbol (name, derived->ns, &cmp->ts.u.derived);
- if (gfc_add_flavor (&cmp->ts.u.derived->attr, FL_DERIVED,
- NULL, &gfc_current_locus) == FAILURE)
- return;
- cmp->ts.u.derived->refs++;
- gfc_set_sym_referenced (cmp->ts.u.derived);
- cmp->ts.u.derived->attr.vtype = 1;
- cmp->ts.u.derived->attr.zero_comp = 1;
- }
- vtab->ts.u.derived = cmp->ts.u.derived;
- }
-
- /* Store this for later use in setting the pointer. */
- cmp->ts.interface = vtab;
-
- if (vtab->ts.u.derived->components)
- continue;
-
- super_type = gfc_get_derived_super_type (declared);
+ /* Make sure that the PPCs appear in the same order as in the parent. */
+ copy_vtab_proc_comps (super_type, vtype);
+ /* Only needed to get the PPC interfaces right. */
+ add_procs_to_declared_vtab (super_type, vtype);
+ }
- if (super_type && (super_type != declared))
- add_generic_specifics (super_type, vtab, cmp->name);
+ if (derived->f2k_derived && derived->f2k_derived->tb_sym_root)
+ add_procs_to_declared_vtab1 (derived->f2k_derived->tb_sym_root, vtype);
- add_generic_specifics (declared, vtab, cmp->name);
- }
+ if (derived->f2k_derived && derived->f2k_derived->tb_uop_root)
+ add_procs_to_declared_vtab1 (derived->f2k_derived->tb_uop_root, vtype);
}
-/* Find the symbol for a derived type's vtab. A vtab has the following
- fields:
- $hash a hash value used to identify the derived type
- $size the size in bytes of the derived type
- $extends a pointer to the vtable of the parent derived type
- then:
- procedure pointer components for the specific typebound procedures
- structure pointers to reduced vtabs that contain procedure
- pointers to the specific procedures. */
+/* Find the symbol for a derived type's vtab.
+ A vtab has the following fields:
+ * $hash a hash value used to identify the derived type
+ * $size the size in bytes of the derived type
+ * $extends a pointer to the vtable of the parent derived type
+ After these follow procedure pointer components for the
+ specific type-bound procedures. */
gfc_symbol *
-gfc_find_derived_vtab (gfc_symbol *derived, bool resolved)
+gfc_find_derived_vtab (gfc_symbol *derived)
{
gfc_namespace *ns;
gfc_symbol *vtab = NULL, *vtype = NULL;
@@ -608,7 +390,7 @@ gfc_find_derived_vtab (gfc_symbol *derived, bool resolved)
parent = gfc_get_derived_super_type (derived);
if (parent)
{
- parent_vtab = gfc_find_derived_vtab (parent, resolved);
+ parent_vtab = gfc_find_derived_vtab (parent);
c->ts.type = BT_DERIVED;
c->ts.u.derived = parent_vtab->ts.u.derived;
c->initializer = gfc_get_expr ();
@@ -623,7 +405,7 @@ gfc_find_derived_vtab (gfc_symbol *derived, bool resolved)
c->initializer = gfc_get_null_expr (NULL);
}
- add_procs_to_declared_vtab (derived, vtype, derived, resolved);
+ add_procs_to_declared_vtab (derived, vtype);
vtype->attr.vtype = 1;
}
@@ -632,15 +414,6 @@ gfc_find_derived_vtab (gfc_symbol *derived, bool resolved)
}
}
- /* Catch the call just before the backend declarations are built, so that
- the generic procedures have been resolved and the specific procedures
- have formal interfaces that can be compared. */
- if (resolved
- && vtab->ts.u.derived
- && vtab->ts.u.derived->backend_decl == NULL)
- add_generics_to_declared_vtab (derived, vtab->ts.u.derived,
- derived, resolved);
-
return vtab;
}
diff --git a/gcc/fortran/config-lang.in b/gcc/fortran/config-lang.in
index 030b0f67de0..b7ace71fee4 100644
--- a/gcc/fortran/config-lang.in
+++ b/gcc/fortran/config-lang.in
@@ -29,5 +29,5 @@ compilers="f951\$(exeext)"
target_libs=target-libgfortran
-gtfiles="\$(srcdir)/fortran/f95-lang.c \$(srcdir)/fortran/trans-decl.c \$(srcdir)/fortran/trans-intrinsic.c \$(srcdir)/fortran/trans-io.c \$(srcdir)/fortran/trans-types.c \$(srcdir)/fortran/trans-types.h \$(srcdir)/fortran/trans.h \$(srcdir)/fortran/trans-const.h"
+gtfiles="\$(srcdir)/fortran/f95-lang.c \$(srcdir)/fortran/trans-decl.c \$(srcdir)/fortran/trans-intrinsic.c \$(srcdir)/fortran/trans-io.c \$(srcdir)/fortran/trans-stmt.c \$(srcdir)/fortran/trans-types.c \$(srcdir)/fortran/trans-types.h \$(srcdir)/fortran/trans.h \$(srcdir)/fortran/trans-const.h"
diff --git a/gcc/fortran/convert.c b/gcc/fortran/convert.c
index f69ea2386ef..50e3a6a10f1 100644
--- a/gcc/fortran/convert.c
+++ b/gcc/fortran/convert.c
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "flags.h"
#include "convert.h"
-#include "toplev.h" /* For error. */
+#include "diagnostic-core.h" /* For error. */
#include "gfortran.h"
#include "trans.h"
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 07c3acb9467..9515676acc9 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1155,13 +1155,10 @@ build_sym (const char *name, gfc_charlen *cl,
sym->attr.implied_index = 0;
- if (sym->ts.type == BT_CLASS)
- {
- sym->attr.class_ok = (sym->attr.dummy
- || sym->attr.pointer
- || sym->attr.allocatable) ? 1 : 0;
- gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
- }
+ if (sym->ts.type == BT_CLASS
+ && (sym->attr.class_ok = sym->attr.dummy || sym->attr.pointer
+ || sym->attr.allocatable))
+ gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
return SUCCESS;
}
@@ -5874,7 +5871,7 @@ attr_decl1 (void)
/* Update symbol table. DIMENSION attribute is set in
gfc_set_array_spec(). For CLASS variables, this must be applied
to the first component, or '$data' field. */
- if (sym->ts.type == BT_CLASS)
+ if (sym->ts.type == BT_CLASS && sym->ts.u.derived->attr.is_class)
{
if (gfc_copy_attr (&CLASS_DATA (sym)->attr, &current_attr,&var_locus)
== FAILURE)
@@ -5882,8 +5879,6 @@ attr_decl1 (void)
m = MATCH_ERROR;
goto cleanup;
}
- sym->attr.class_ok = (sym->attr.class_ok || current_attr.allocatable
- || current_attr.pointer);
}
else
{
@@ -5894,6 +5889,11 @@ attr_decl1 (void)
goto cleanup;
}
}
+
+ if (sym->ts.type == BT_CLASS && !sym->attr.class_ok
+ && (sym->attr.class_ok = sym->attr.class_ok || current_attr.allocatable
+ || current_attr.pointer))
+ gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
if (gfc_set_array_spec (sym, as, &var_locus) == FAILURE)
{
@@ -7697,8 +7697,8 @@ match_procedure_in_type (void)
}
/* Construct the data structure. */
+ memset (&tb, 0, sizeof (tb));
tb.where = gfc_current_locus;
- tb.is_generic = 0;
/* Match binding attributes. */
m = match_binding_attributes (&tb, false, false);
@@ -7856,6 +7856,9 @@ gfc_match_generic (void)
ns = block->f2k_derived;
gcc_assert (block && ns);
+ memset (&tbattr, 0, sizeof (tbattr));
+ tbattr.where = gfc_current_locus;
+
/* See if we get an access-specifier. */
m = match_binding_attributes (&tbattr, true, false);
if (m == MATCH_ERROR)
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index fcf5b25d350..9dd4d9c4672 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -39,7 +39,8 @@ typedef enum
{
GFC_DEP_ERROR,
GFC_DEP_EQUAL, /* Identical Ranges. */
- GFC_DEP_FORWARD, /* e.g., a(1:3), a(2:4). */
+ GFC_DEP_FORWARD, /* e.g., a(1:3) = a(2:4). */
+ GFC_DEP_BACKWARD, /* e.g. a(2:4) = a(1:3). */
GFC_DEP_OVERLAP, /* May overlap in some other way. */
GFC_DEP_NODEP /* Distinct ranges. */
}
@@ -424,7 +425,7 @@ gfc_ref_needs_temporary_p (gfc_ref *ref)
}
-int
+static int
gfc_is_data_pointer (gfc_expr *e)
{
gfc_ref *ref;
@@ -807,6 +808,19 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical)
return 1;
}
+ else
+ {
+ gfc_symbol *sym1 = expr1->symtree->n.sym;
+ gfc_symbol *sym2 = expr2->symtree->n.sym;
+ if (sym1->attr.target && sym2->attr.target
+ && ((sym1->attr.dummy && !sym1->attr.contiguous
+ && (!sym1->attr.dimension
+ || sym2->as->type == AS_ASSUMED_SHAPE))
+ || (sym2->attr.dummy && !sym2->attr.contiguous
+ && (!sym2->attr.dimension
+ || sym2->as->type == AS_ASSUMED_SHAPE))))
+ return 1;
+ }
/* Otherwise distinct symbols have no dependencies. */
return 0;
@@ -818,7 +832,7 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical)
/* Identical and disjoint ranges return 0,
overlapping ranges return 1. */
if (expr1->ref && expr2->ref)
- return gfc_dep_resolver (expr1->ref, expr2->ref);
+ return gfc_dep_resolver (expr1->ref, expr2->ref, NULL);
return 1;
@@ -1061,6 +1075,30 @@ gfc_check_section_vs_section (gfc_ref *lref, gfc_ref *rref, int n)
return GFC_DEP_FORWARD;
}
+ /* Check for backward dependencies:
+ Are the strides the same?. */
+ if ((!l_stride && !r_stride)
+ ||
+ (l_stride && r_stride
+ && gfc_dep_compare_expr (l_stride, r_stride) == 0))
+ {
+ /* x:y vs. x+1:z. */
+ if (l_dir == 1 && r_dir == 1
+ && l_start && r_start
+ && gfc_dep_compare_expr (l_start, r_start) == 1
+ && l_end && r_end
+ && gfc_dep_compare_expr (l_end, r_end) == 1)
+ return GFC_DEP_BACKWARD;
+
+ /* x:y:-1 vs. x-1:z:-1. */
+ if (l_dir == -1 && r_dir == -1
+ && l_start && r_start
+ && gfc_dep_compare_expr (l_start, r_start) == -1
+ && l_end && r_end
+ && gfc_dep_compare_expr (l_end, r_end) == -1)
+ return GFC_DEP_BACKWARD;
+ }
+
return GFC_DEP_OVERLAP;
}
@@ -1468,16 +1506,19 @@ ref_same_as_full_array (gfc_ref *full_ref, gfc_ref *ref)
/* Finds if two array references are overlapping or not.
Return value
+ 2 : array references are overlapping but reversal of one or
+ more dimensions will clear the dependency.
1 : array references are overlapping.
0 : array references are identical or not overlapping. */
int
-gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref)
+gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse)
{
int n;
gfc_dependency fin_dep;
gfc_dependency this_dep;
+ this_dep = GFC_DEP_ERROR;
fin_dep = GFC_DEP_ERROR;
/* Dependencies due to pointers should already have been identified.
We only need to check for overlapping array references. */
@@ -1530,6 +1571,7 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref)
if (lref->u.ar.dimen_type[n] == DIMEN_VECTOR
|| rref->u.ar.dimen_type[n] == DIMEN_VECTOR)
return 1;
+
if (lref->u.ar.dimen_type[n] == DIMEN_RANGE
&& rref->u.ar.dimen_type[n] == DIMEN_RANGE)
this_dep = gfc_check_section_vs_section (lref, rref, n);
@@ -1550,6 +1592,38 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref)
if (this_dep == GFC_DEP_NODEP)
return 0;
+ /* Now deal with the loop reversal logic: This only works on
+ ranges and is activated by setting
+ reverse[n] == GFC_CAN_REVERSE
+ The ability to reverse or not is set by previous conditions
+ in this dimension. If reversal is not activated, the
+ value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */
+ if (rref->u.ar.dimen_type[n] == DIMEN_RANGE
+ && lref->u.ar.dimen_type[n] == DIMEN_RANGE)
+ {
+ /* Set reverse if backward dependence and not inhibited. */
+ if (reverse && reverse[n] != GFC_CANNOT_REVERSE)
+ reverse[n] = (this_dep == GFC_DEP_BACKWARD) ?
+ GFC_REVERSE_SET : reverse[n];
+
+ /* Inhibit loop reversal if dependence not compatible. */
+ if (reverse && reverse[n] != GFC_REVERSE_NOT_SET
+ && this_dep != GFC_DEP_EQUAL
+ && this_dep != GFC_DEP_BACKWARD
+ && this_dep != GFC_DEP_NODEP)
+ {
+ reverse[n] = GFC_CANNOT_REVERSE;
+ if (this_dep != GFC_DEP_FORWARD)
+ this_dep = GFC_DEP_OVERLAP;
+ }
+
+ /* If no intention of reversing or reversing is explicitly
+ inhibited, convert backward dependence to overlap. */
+ if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD)
+ || (reverse && reverse[n] == GFC_CANNOT_REVERSE))
+ this_dep = GFC_DEP_OVERLAP;
+ }
+
/* Overlap codes are in order of priority. We only need to
know the worst one.*/
if (this_dep > fin_dep)
@@ -1565,7 +1639,7 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref)
/* Exactly matching and forward overlapping ranges don't cause a
dependency. */
- if (fin_dep < GFC_DEP_OVERLAP)
+ if (fin_dep < GFC_DEP_BACKWARD)
return 0;
/* Keep checking. We only have a dependency if
diff --git a/gcc/fortran/dependency.h b/gcc/fortran/dependency.h
index dd786bedaba..bac2749093b 100644
--- a/gcc/fortran/dependency.h
+++ b/gcc/fortran/dependency.h
@@ -29,7 +29,6 @@ typedef enum
}
gfc_dep_check;
-
/*********************** Functions prototypes **************************/
bool gfc_ref_needs_temporary_p (gfc_ref *);
@@ -41,6 +40,6 @@ int gfc_check_dependency (gfc_expr *, gfc_expr *, bool);
int gfc_is_same_range (gfc_array_ref *, gfc_array_ref *, int, int);
int gfc_expr_is_one (gfc_expr *, int);
-int gfc_dep_resolver(gfc_ref *, gfc_ref *);
+int gfc_dep_resolver(gfc_ref *, gfc_ref *, gfc_reverse *);
int gfc_are_equivalenced_arrays (gfc_expr *, gfc_expr *);
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index c876fdd7740..cb7305ecf5a 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -215,7 +215,7 @@ gfc_get_int_expr (int kind, locus *where, int value)
p = gfc_get_constant_expr (BT_INTEGER, kind,
where ? where : &gfc_current_locus);
- mpz_init_set_si (p->value.integer, value);
+ mpz_set_si (p->value.integer, value);
return p;
}
@@ -1894,7 +1894,7 @@ gfc_simplify_expr (gfc_expr *p, int type)
if (p->expr_type == EXPR_ARRAY && p->ref && p->ref->type == REF_ARRAY
&& p->ref->u.ar.type == AR_FULL)
- gfc_expand_constructor (p);
+ gfc_expand_constructor (p, false);
if (simplify_const_ref (p) == FAILURE)
return FAILURE;
@@ -2573,7 +2573,7 @@ check_init_expr (gfc_expr *e)
if (t == FAILURE)
break;
- t = gfc_expand_constructor (e);
+ t = gfc_expand_constructor (e, true);
if (t == FAILURE)
break;
@@ -2609,7 +2609,7 @@ gfc_reduce_init_expr (gfc_expr *expr)
{
if (gfc_check_constructor_type (expr) == FAILURE)
return FAILURE;
- if (gfc_expand_constructor (expr) == FAILURE)
+ if (gfc_expand_constructor (expr, true) == FAILURE)
return FAILURE;
}
@@ -3306,7 +3306,8 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
}
if (!pointer && !proc_pointer
- && !(lvalue->ts.type == BT_CLASS && CLASS_DATA (lvalue)->attr.pointer))
+ && !(lvalue->ts.type == BT_CLASS
+ && CLASS_DATA (lvalue)->attr.class_pointer))
{
gfc_error ("Pointer assignment to non-POINTER at %L", &lvalue->where);
return FAILURE;
@@ -3543,7 +3544,7 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_expr *rvalue)
lvalue.where = sym->declared_at;
if (sym->attr.pointer || sym->attr.proc_pointer
- || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.pointer
+ || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.class_pointer
&& rvalue->expr_type == EXPR_NULL))
r = gfc_check_pointer_assign (&lvalue, rvalue);
else
@@ -4022,6 +4023,22 @@ gfc_is_coindexed (gfc_expr *e)
}
+bool
+gfc_get_corank (gfc_expr *e)
+{
+ int corank;
+ gfc_ref *ref;
+ corank = e->symtree->n.sym->as ? e->symtree->n.sym->as->corank : 0;
+ for (ref = e->ref; ref; ref = ref->next)
+ {
+ if (ref->type == REF_ARRAY)
+ corank = ref->u.ar.as->corank;
+ gcc_assert (ref->type != REF_SUBSTRING);
+ }
+ return corank;
+}
+
+
/* Check whether the expression has an ultimate allocatable component.
Being itself allocatable does not count. */
bool
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index c6af0026ba8..5b676214e6a 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -310,7 +310,7 @@ struct GTY(())
binding_level {
/* A chain of ..._DECL nodes for all variables, constants, functions,
parameters and type declarations. These ..._DECL nodes are chained
- through the TREE_CHAIN field. Note that these ..._DECL nodes are stored
+ through the DECL_CHAIN field. Note that these ..._DECL nodes are stored
in the reverse of the order supplied to be compatible with the
back-end. */
tree names;
@@ -409,7 +409,7 @@ poplevel (int keep, int reverse, int functionbody)
/* Clear out the meanings of the local variables of this level. */
for (subblock_node = decl_chain; subblock_node;
- subblock_node = TREE_CHAIN (subblock_node))
+ subblock_node = DECL_CHAIN (subblock_node))
if (DECL_NAME (subblock_node) != 0)
/* If the identifier was used or addressed via a local extern decl,
don't forget that fact. */
@@ -467,7 +467,7 @@ pushdecl (tree decl)
order. The list will be reversed later if necessary. This needs to be
this way for compatibility with the back-end. */
- TREE_CHAIN (decl) = current_binding_level->names;
+ DECL_CHAIN (decl) = current_binding_level->names;
current_binding_level->names = decl;
/* For the declaration of a type, set its name if it is not already set. */
diff --git a/gcc/fortran/gfc-internals.texi b/gcc/fortran/gfc-internals.texi
index 90f90fdac5d..ed4c5ed3d66 100644
--- a/gcc/fortran/gfc-internals.texi
+++ b/gcc/fortran/gfc-internals.texi
@@ -406,6 +406,33 @@ case-block, and @code{extx.case_list} contains the case-values this block
corresponds to. The @code{block} member links to the next case in the list.
+@subsection @code{BLOCK} and @code{ASSOCIATE}
+
+The code related to a @code{BLOCK} statement is stored inside an
+@code{gfc_code} structure (say @var{c})
+with @code{c.op} set to @code{EXEC_BLOCK}. The
+@code{gfc_namespace} holding the locally defined variables of the
+@code{BLOCK} is stored in @code{c.ext.block.ns}. The code inside the
+construct is in @code{c.code}.
+
+@code{ASSOCIATE} constructs are based on @code{BLOCK} and thus also have
+the internal storage structure described above (including @code{EXEC_BLOCK}).
+However, for them @code{c.ext.block.assoc} is set additionally and points
+to a linked list of @code{gfc_association_list} structures. Those
+structures basically store a link of associate-names to target expressions.
+The associate-names themselves are still also added to the @code{BLOCK}'s
+namespace as ordinary symbols, but they have their @code{gfc_symbol}'s
+member @code{assoc} set also pointing to the association-list structure.
+This way associate-names can be distinguished from ordinary variables
+and their target expressions identified.
+
+For association to expressions (as opposed to variables), at the very beginning
+of the @code{BLOCK} construct assignments are automatically generated to
+set the corresponding variables to their target expressions' values, and
+later on the compiler simply disallows using such associate-names in contexts
+that may change the value.
+
+
@c gfc_expr
@c --------
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 0c96bf40e6e..a493866ab36 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -348,6 +348,7 @@ enum gfc_isym_id
GFC_ISYM_CPU_TIME,
GFC_ISYM_CSHIFT,
GFC_ISYM_CTIME,
+ GFC_ISYM_C_SIZEOF,
GFC_ISYM_DATE_AND_TIME,
GFC_ISYM_DBLE,
GFC_ISYM_DIGITS,
@@ -504,6 +505,7 @@ enum gfc_isym_id
GFC_ISYM_SRAND,
GFC_ISYM_SR_KIND,
GFC_ISYM_STAT,
+ GFC_ISYM_STORAGE_SIZE,
GFC_ISYM_SUM,
GFC_ISYM_SYMLINK,
GFC_ISYM_SYMLNK,
@@ -574,6 +576,15 @@ typedef enum
}
gfc_fcoarray;
+typedef enum
+{
+ GFC_REVERSE_NOT_SET,
+ GFC_REVERSE_SET,
+ GFC_CAN_REVERSE,
+ GFC_CANNOT_REVERSE
+}
+gfc_reverse;
+
/************************* Structures *****************************/
/* Used for keeping things in balanced binary trees. */
@@ -680,7 +691,8 @@ typedef struct
use_assoc:1, /* Symbol has been use-associated. */
use_only:1, /* Symbol has been use-associated, with ONLY. */
use_rename:1, /* Symbol has been use-associated and renamed. */
- imported:1; /* Symbol has been associated by IMPORT. */
+ imported:1, /* Symbol has been associated by IMPORT. */
+ host_assoc:1; /* Symbol has been host associated. */
unsigned in_namelist:1, in_common:1, in_equivalence:1;
unsigned function:1, subroutine:1, procedure:1;
@@ -2509,6 +2521,7 @@ gfc_user_op *gfc_get_uop (const char *);
gfc_user_op *gfc_find_uop (const char *, gfc_namespace *);
void gfc_free_symbol (gfc_symbol *);
gfc_symbol *gfc_new_symbol (const char *, gfc_namespace *);
+gfc_symtree* gfc_find_symtree_in_proc (const char *, gfc_namespace *);
int gfc_find_symbol (const char *, gfc_namespace *, int, gfc_symbol **);
int gfc_find_sym_tree (const char *, gfc_namespace *, int, gfc_symtree **);
int gfc_get_symbol (const char *, gfc_namespace *, gfc_symbol **);
@@ -2670,6 +2683,7 @@ void gfc_expr_replace_comp (gfc_expr *, gfc_component *);
bool gfc_is_proc_ptr_comp (gfc_expr *, gfc_component **);
bool gfc_is_coindexed (gfc_expr *);
+bool gfc_get_corank (gfc_expr *);
bool gfc_has_ultimate_allocatable (gfc_expr *);
bool gfc_has_ultimate_pointer (gfc_expr *);
@@ -2715,7 +2729,7 @@ gfc_try gfc_resolve_array_spec (gfc_array_spec *, int);
int gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *);
void gfc_simplify_iterator_var (gfc_expr *);
-gfc_try gfc_expand_constructor (gfc_expr *);
+gfc_try gfc_expand_constructor (gfc_expr *, bool);
int gfc_constant_ac (gfc_expr *);
int gfc_expanded_ac (gfc_expr *);
gfc_try gfc_resolve_character_array_constructor (gfc_expr *);
@@ -2806,7 +2820,6 @@ void gfc_global_used (gfc_gsymbol *, locus *);
/* dependency.c */
int gfc_dep_compare_expr (gfc_expr *, gfc_expr *);
-int gfc_is_data_pointer (gfc_expr *);
/* check.c */
gfc_try gfc_check_same_strlen (const gfc_expr*, const gfc_expr*, const char*);
@@ -2816,7 +2829,7 @@ void gfc_add_component_ref (gfc_expr *, const char *);
gfc_expr *gfc_class_null_initializer (gfc_typespec *);
gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *,
gfc_array_spec **, bool);
-gfc_symbol *gfc_find_derived_vtab (gfc_symbol *, bool);
+gfc_symbol *gfc_find_derived_vtab (gfc_symbol *);
gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*,
const char*, bool, locus*);
gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*,
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 587b09cdf8c..201961d6355 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -2779,12 +2779,14 @@ gfc_find_sym_in_symtree (gfc_symbol *sym)
/* See if the arglist to an operator-call contains a derived-type argument
with a matching type-bound operator. If so, return the matching specific
procedure defined as operator-target as well as the base-object to use
- (which is the found derived-type argument with operator). */
+ (which is the found derived-type argument with operator). The generic
+ name, if any, is transmitted to the final expression via 'gname'. */
static gfc_typebound_proc*
matching_typebound_op (gfc_expr** tb_base,
gfc_actual_arglist* args,
- gfc_intrinsic_op op, const char* uop)
+ gfc_intrinsic_op op, const char* uop,
+ const char ** gname)
{
gfc_actual_arglist* base;
@@ -2850,6 +2852,7 @@ matching_typebound_op (gfc_expr** tb_base,
if (matches)
{
*tb_base = base->expr;
+ *gname = g->specific_st->name;
return g->specific;
}
}
@@ -2868,11 +2871,12 @@ matching_typebound_op (gfc_expr** tb_base,
static void
build_compcall_for_operator (gfc_expr* e, gfc_actual_arglist* actual,
- gfc_expr* base, gfc_typebound_proc* target)
+ gfc_expr* base, gfc_typebound_proc* target,
+ const char *gname)
{
e->expr_type = EXPR_COMPCALL;
e->value.compcall.tbp = target;
- e->value.compcall.name = "operator"; /* Should not matter. */
+ e->value.compcall.name = gname ? gname : "$op";
e->value.compcall.actual = actual;
e->value.compcall.base_object = base;
e->value.compcall.ignore_pass = 1;
@@ -2898,6 +2902,7 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
gfc_namespace *ns;
gfc_user_op *uop;
gfc_intrinsic_op i;
+ const char *gname;
sym = NULL;
@@ -2905,6 +2910,7 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
actual->expr = e->value.op.op1;
*real_error = false;
+ gname = NULL;
if (e->value.op.op2 != NULL)
{
@@ -2970,7 +2976,7 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
/* See if we find a matching type-bound operator. */
if (i == INTRINSIC_USER)
tbo = matching_typebound_op (&tb_base, actual,
- i, e->value.op.uop->name);
+ i, e->value.op.uop->name, &gname);
else
switch (i)
{
@@ -2978,10 +2984,10 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
case INTRINSIC_##comp: \
case INTRINSIC_##comp##_OS: \
tbo = matching_typebound_op (&tb_base, actual, \
- INTRINSIC_##comp, NULL); \
+ INTRINSIC_##comp, NULL, &gname); \
if (!tbo) \
tbo = matching_typebound_op (&tb_base, actual, \
- INTRINSIC_##comp##_OS, NULL); \
+ INTRINSIC_##comp##_OS, NULL, &gname); \
break;
CHECK_OS_COMPARISON(EQ)
CHECK_OS_COMPARISON(NE)
@@ -2992,7 +2998,7 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
#undef CHECK_OS_COMPARISON
default:
- tbo = matching_typebound_op (&tb_base, actual, i, NULL);
+ tbo = matching_typebound_op (&tb_base, actual, i, NULL, &gname);
break;
}
@@ -3003,7 +3009,7 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
gfc_try result;
gcc_assert (tb_base);
- build_compcall_for_operator (e, actual, tb_base, tbo);
+ build_compcall_for_operator (e, actual, tb_base, tbo, gname);
result = gfc_resolve_expr (e);
if (result == FAILURE)
@@ -3050,6 +3056,9 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
gfc_actual_arglist *actual;
gfc_expr *lhs, *rhs;
gfc_symbol *sym;
+ const char *gname;
+
+ gname = NULL;
lhs = c->expr1;
rhs = c->expr2;
@@ -3085,7 +3094,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
/* See if we find a matching type-bound assignment. */
tbo = matching_typebound_op (&tb_base, actual,
- INTRINSIC_ASSIGN, NULL);
+ INTRINSIC_ASSIGN, NULL, &gname);
/* If there is one, replace the expression with a call to it and
succeed. */
@@ -3093,7 +3102,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
{
gcc_assert (tb_base);
c->expr1 = gfc_get_expr ();
- build_compcall_for_operator (c->expr1, actual, tb_base, tbo);
+ build_compcall_for_operator (c->expr1, actual, tb_base, tbo, gname);
c->expr1->value.compcall.assign = 1;
c->expr2 = NULL;
c->op = EXEC_COMPCALL;
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 833fd30beb1..87d9c800df0 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -2459,7 +2459,10 @@ add_functions (void)
x, BT_UNKNOWN, 0, REQUIRED);
make_generic ("sizeof", GFC_ISYM_SIZEOF, GFC_STD_GNU);
- make_alias ("c_sizeof", GFC_STD_F2008);
+
+ add_sym_1 ("c_sizeof", GFC_ISYM_C_SIZEOF, CLASS_INQUIRY, ACTUAL_NO,
+ BT_INTEGER, ii, GFC_STD_F2008, gfc_check_c_sizeof, NULL, NULL,
+ x, BT_UNKNOWN, 0, REQUIRED);
add_sym_1 ("spacing", GFC_ISYM_SPACING, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_spacing, gfc_resolve_spacing,
@@ -2500,6 +2503,12 @@ add_functions (void)
make_generic ("stat", GFC_ISYM_STAT, GFC_STD_GNU);
+ add_sym_2 ("storage_size", GFC_ISYM_STORAGE_SIZE, CLASS_INQUIRY, ACTUAL_NO,
+ BT_INTEGER, di, GFC_STD_F2008,
+ gfc_check_storage_size, NULL, gfc_resolve_storage_size,
+ a, BT_UNKNOWN, 0, REQUIRED,
+ kind, BT_INTEGER, di, OPTIONAL);
+
add_sym_3red ("sum", GFC_ISYM_SUM, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F95,
gfc_check_product_sum, gfc_simplify_sum, gfc_resolve_sum,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 919f09e90b4..f5da7a0649c 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -133,10 +133,12 @@ gfc_try gfc_check_size (gfc_expr *, gfc_expr *, gfc_expr *);
gfc_try gfc_check_sign (gfc_expr *, gfc_expr *);
gfc_try gfc_check_signal (gfc_expr *, gfc_expr *);
gfc_try gfc_check_sizeof (gfc_expr *);
+gfc_try gfc_check_c_sizeof (gfc_expr *);
gfc_try gfc_check_sngl (gfc_expr *);
gfc_try gfc_check_spread (gfc_expr *, gfc_expr *, gfc_expr *);
gfc_try gfc_check_srand (gfc_expr *);
gfc_try gfc_check_stat (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_storage_size (gfc_expr *, gfc_expr *);
gfc_try gfc_check_sum (gfc_expr *, gfc_expr *, gfc_expr *);
gfc_try gfc_check_symlnk (gfc_expr *, gfc_expr *);
gfc_try gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *);
@@ -494,6 +496,7 @@ void gfc_resolve_spacing (gfc_expr *, gfc_expr *);
void gfc_resolve_spread (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_sqrt (gfc_expr *, gfc_expr *);
void gfc_resolve_stat (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_storage_size (gfc_expr *f, gfc_expr *a, gfc_expr *kind);
void gfc_resolve_srand (gfc_code *);
void gfc_resolve_sum (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_symlnk (gfc_expr *, gfc_expr *, gfc_expr *);
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 06c6793b2c4..2e91a3eb37a 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -107,6 +107,7 @@ Some basic guidelines for editing this document:
* @code{EXIT}: EXIT, Exit the program with status.
* @code{EXP}: EXP, Exponential function
* @code{EXPONENT}: EXPONENT, Exponent function
+* @code{EXTENDS_TYPE_OF}: EXTENDS_TYPE_OF, Query dynamic type for extension
* @code{FDATE}: FDATE, Subroutine (or function) to get the current time as a string
* @code{FGET}: FGET, Read a single character in stream mode from stdin
* @code{FGETC}: FGETC, Read a single character in stream mode
@@ -223,6 +224,7 @@ Some basic guidelines for editing this document:
* @code{RESHAPE}: RESHAPE, Function to reshape an array
* @code{RRSPACING}: RRSPACING, Reciprocal of the relative spacing
* @code{RSHIFT}: RSHIFT, Right shift bits
+* @code{SAME_TYPE_AS}: SAME_TYPE_AS, Query dynamic types for equality
* @code{SCALE}: SCALE, Scale a real value
* @code{SCAN}: SCAN, Scan a string for the presence of a set of characters
* @code{SECNDS}: SECNDS, Time function
@@ -244,6 +246,7 @@ Some basic guidelines for editing this document:
* @code{SQRT}: SQRT, Square-root function
* @code{SRAND}: SRAND, Reinitialize the random number generator
* @code{STAT}: STAT, Get file status
+* @code{STORAGE_SIZE}: STORAGE_SIZE, Storage size in bits
* @code{SUM}: SUM, Sum of array elements
* @code{SYMLNK}: SYMLNK, Create a symbolic link
* @code{SYSTEM}: SYSTEM, Execute a shell command
@@ -2139,9 +2142,9 @@ Inquiry function
@code{RESULT = C_LOC(X)}
@item @emph{Arguments}:
-@multitable @columnfractions .15 .70
-@item @var{X} @tab Associated scalar pointer or interoperable scalar
-or allocated allocatable variable with @code{TARGET} attribute.
+@multitable @columnfractions .10 .75
+@item @var{X} @tab Shall have either the POINTER or TARGET attribute. It shall not be a coindexed object. It shall either be a variable with interoperable type and kind type parameters, or be a scalar, nonpolymorphic variable with no length type parameters.
+
@end multitable
@item @emph{Return value}:
@@ -2187,7 +2190,7 @@ Intrinsic function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{X} @tab The argument shall be of any type, rank or shape.
+@item @var{X} @tab The argument shall be an interoperable data entity.
@end multitable
@item @emph{Return value}:
@@ -2211,7 +2214,7 @@ The example will print @code{.TRUE.} unless you are using a platform
where default @code{REAL} variables are unusually padded.
@item @emph{See also}:
-@ref{SIZEOF}
+@ref{SIZEOF}, @ref{STORAGE_SIZE}
@end table
@@ -3927,6 +3930,42 @@ end program test_exponent
+@node EXTENDS_TYPE_OF
+@section @code{EXTENDS_TYPE_OF} --- Query dynamic type for extension
+@fnindex EXTENDS_TYPE_OF
+
+@table @asis
+@item @emph{Description}:
+Query dynamic type for extension.
+
+@item @emph{Standard}:
+Fortran 2003 and later
+
+@item @emph{Class}:
+Inquiry function
+
+@item @emph{Syntax}:
+@code{RESULT = EXTENDS_TYPE_OF(A, MOLD)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{A} @tab Shall be an object of extensible declared type or
+unlimited polymorphic.
+@item @var{MOLD} @tab Shall be an object of extensible declared type or
+unlimited polymorphic.
+@end multitable
+
+@item @emph{Return value}:
+The return value is a scalar of type default logical. It is true if and only if
+the dynamic type of A is an extension type of the dynamic type of MOLD.
+
+
+@item @emph{See also}:
+@ref{SAME_TYPE_AS}
+@end table
+
+
+
@node FDATE
@section @code{FDATE} --- Get the current time as a string
@fnindex FDATE
@@ -9405,6 +9444,42 @@ The return value is of type @code{INTEGER} and of the same kind as
+@node SAME_TYPE_AS
+@section @code{SAME_TYPE_AS} --- Query dynamic types for equality
+@fnindex SAME_TYPE_AS
+
+@table @asis
+@item @emph{Description}:
+Query dynamic types for equality.
+
+@item @emph{Standard}:
+Fortran 2003 and later
+
+@item @emph{Class}:
+Inquiry function
+
+@item @emph{Syntax}:
+@code{RESULT = SAME_TYPE_AS(A, B)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{A} @tab Shall be an object of extensible declared type or
+unlimited polymorphic.
+@item @var{B} @tab Shall be an object of extensible declared type or
+unlimited polymorphic.
+@end multitable
+
+@item @emph{Return value}:
+The return value is a scalar of type default logical. It is true if and
+only if the dynamic type of A is the same as the dynamic type of B.
+
+@item @emph{See also}:
+@ref{EXTENDS_TYPE_OF}
+
+@end table
+
+
+
@node SCALE
@section @code{SCALE} --- Scale a real value
@fnindex SCALE
@@ -10146,7 +10221,8 @@ number of bytes occupied by the argument. If the argument has the
@code{POINTER} attribute, the number of bytes of the storage area pointed
to is returned. If the argument is of a derived type with @code{POINTER}
or @code{ALLOCATABLE} components, the return value doesn't account for
-the sizes of the data pointed to by these components.
+the sizes of the data pointed to by these components. If the argument is
+polymorphic, the size according to the declared type is returned.
@item @emph{Example}:
@smallexample
@@ -10159,7 +10235,7 @@ The example will print @code{.TRUE.} unless you are using a platform
where default @code{REAL} variables are unusually padded.
@item @emph{See also}:
-@ref{C_SIZEOF}
+@ref{C_SIZEOF}, @ref{STORAGE_SIZE}
@end table
@@ -10478,6 +10554,37 @@ To stat an open file: @ref{FSTAT}, to stat a link: @ref{LSTAT}
+@node STORAGE_SIZE
+@section @code{STORAGE_SIZE} --- Storage size in bits
+@fnindex STORAGE_SIZE
+@cindex storage size
+
+@table @asis
+@item @emph{Description}:
+Returns the storage size of argument @var{A} in bits.
+@item @emph{Standard}:
+Fortran 2008 and later
+@item @emph{Class}:
+Inquiry function
+@item @emph{Syntax}:
+@code{RESULT = STORAGE_SIZE(A [, KIND])}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{A} @tab Shall be a scalar or array of any type.
+@item @var{KIND} @tab (Optional) shall be a scalar integer constant expression.
+@end multitable
+
+@item @emph{Return Value}:
+The result is a scalar integer with the kind type parameter speciï¬ed by KIND (or default integer type if KIND is missing). The result value is the size expressed in bits for an element of an array that
+has the dynamic type and type parameters of A.
+
+@item @emph{See also}:
+@ref{C_SIZEOF}, @ref{SIZEOF}
+@end table
+
+
+
@node SUM
@section @code{SUM} --- Sum of array elements
@fnindex SUM
@@ -10519,7 +10626,7 @@ The result is of the same type as @var{ARRAY}.
If @var{DIM} is absent, a scalar with the sum of all elements in @var{ARRAY}
is returned. Otherwise, an array of rank n-1, where n equals the rank of
-@var{ARRAY},and a shape similar to that of @var{ARRAY} with dimension @var{DIM}
+@var{ARRAY}, and a shape similar to that of @var{ARRAY} with dimension @var{DIM}
dropped is returned.
@item @emph{Example}:
@@ -10648,7 +10755,6 @@ Subroutine
@code{CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])}
@item @emph{Arguments}:
-@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{COUNT} @tab (Optional) shall be a scalar of type default
@code{INTEGER} with @code{INTENT(OUT)}.
@@ -11658,6 +11764,16 @@ are defined.
@item @code{C_VERTICAL_TAB} @tab vertical tab @tab @code{'\v'}
@end multitable
+Moreover, the following two named constants are defined:
+
+@multitable @columnfractions .20 .80
+@item Name @tab Type
+@item @code{C_NULL_PTR} @tab @code{C_PTR}
+@item @code{C_NULL_FUNPTR} @tab @code{C_FUNPTR}
+@end multitable
+
+Both are equivalent to the value @code{NULL} in C.
+
@node OpenMP Modules OMP_LIB and OMP_LIB_KINDS
@section OpenMP Modules @code{OMP_LIB} and @code{OMP_LIB_KINDS}
@table @asis
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index f9a6d7b1240..afbde0210b4 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1497,6 +1497,14 @@ resolve_tag (const io_tag *tag, gfc_expr *e)
return FAILURE;
}
+ if (tag == &tag_exist && e->ts.kind != gfc_default_logical_kind)
+ {
+ if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Nondefault LOGICAL "
+ "in %s tag at %L", tag->name, &e->where)
+ == FAILURE)
+ return FAILURE;
+ }
+
if (tag == &tag_convert)
{
if (gfc_notify_std (GFC_STD_GNU, "Extension: CONVERT tag at %L",
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 8f764ef9083..9bf767dbaf6 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -122,7 +122,7 @@ resolve_mask_arg (gfc_expr *mask)
static void
resolve_bound (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *kind,
- const char *name)
+ const char *name, bool coarray)
{
f->ts.type = BT_INTEGER;
if (kind)
@@ -134,7 +134,8 @@ resolve_bound (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *kind,
{
f->rank = 1;
f->shape = gfc_get_shape (1);
- mpz_init_set_ui (f->shape[0], array->rank);
+ mpz_init_set_ui (f->shape[0], coarray ? gfc_get_corank (array)
+ : array->rank);
}
f->value.function.name = xstrdup (name);
@@ -853,7 +854,7 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
gfc_add_component_ref (a, "$vptr");
else if (a->ts.type == BT_DERIVED)
{
- vtab = gfc_find_derived_vtab (a->ts.u.derived, false);
+ vtab = gfc_find_derived_vtab (a->ts.u.derived);
/* Clear the old expr. */
gfc_free_ref_list (a->ref);
memset (a, '\0', sizeof (gfc_expr));
@@ -869,7 +870,7 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
gfc_add_component_ref (mo, "$vptr");
else if (mo->ts.type == BT_DERIVED)
{
- vtab = gfc_find_derived_vtab (mo->ts.u.derived, false);
+ vtab = gfc_find_derived_vtab (mo->ts.u.derived);
/* Clear the old expr. */
gfc_free_ref_list (mo->ref);
memset (mo, '\0', sizeof (gfc_expr));
@@ -1268,14 +1269,14 @@ gfc_resolve_kill (gfc_expr *f, gfc_expr *p ATTRIBUTE_UNUSED,
void
gfc_resolve_lbound (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- resolve_bound (f, array, dim, kind, "__lbound");
+ resolve_bound (f, array, dim, kind, "__lbound", false);
}
void
gfc_resolve_lcobound (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- resolve_bound (f, array, dim, kind, "__lcobound");
+ resolve_bound (f, array, dim, kind, "__lcobound", true);
}
@@ -2318,6 +2319,18 @@ gfc_resolve_ftell (gfc_expr *f, gfc_expr *u)
void
+gfc_resolve_storage_size (gfc_expr *f, gfc_expr *a ATTRIBUTE_UNUSED,
+ gfc_expr *kind)
+{
+ f->ts.type = BT_INTEGER;
+ if (kind)
+ f->ts.kind = mpz_get_si (kind->value.integer);
+ else
+ f->ts.kind = gfc_default_integer_kind;
+}
+
+
+void
gfc_resolve_sum (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *mask)
{
const char *name;
@@ -2401,7 +2414,7 @@ gfc_resolve_image_index (gfc_expr *f, gfc_expr *array ATTRIBUTE_UNUSED,
void
gfc_resolve_this_image (gfc_expr *f, gfc_expr *array, gfc_expr *dim)
{
- resolve_bound (f, array, dim, NULL, "__this_image");
+ resolve_bound (f, array, dim, NULL, "__this_image", true);
}
@@ -2540,14 +2553,14 @@ gfc_resolve_trim (gfc_expr *f, gfc_expr *string)
void
gfc_resolve_ubound (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- resolve_bound (f, array, dim, kind, "__ubound");
+ resolve_bound (f, array, dim, kind, "__ubound", false);
}
void
gfc_resolve_ucobound (gfc_expr *f, gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- resolve_bound (f, array, dim, kind, "__ucobound");
+ resolve_bound (f, array, dim, kind, "__ucobound", true);
}
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 92c4da0a4b5..92580e359db 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -2000,12 +2000,16 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op)
gfc_state_data *p, *o;
gfc_symbol *sym;
match m;
+ int cnt;
if (gfc_match_eos () == MATCH_YES)
sym = NULL;
else
{
- m = gfc_match ("% %s%t", &sym);
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ gfc_symtree* stree;
+
+ m = gfc_match ("% %n%t", name);
if (m == MATCH_ERROR)
return MATCH_ERROR;
if (m == MATCH_NO)
@@ -2014,15 +2018,27 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op)
return MATCH_ERROR;
}
+ /* Find the corresponding symbol. If there's a BLOCK statement
+ between here and the label, it is not in gfc_current_ns but a parent
+ namespace! */
+ stree = gfc_find_symtree_in_proc (name, gfc_current_ns);
+ if (!stree)
+ {
+ gfc_error ("Name '%s' in %s statement at %C is unknown",
+ name, gfc_ascii_statement (st));
+ return MATCH_ERROR;
+ }
+
+ sym = stree->n.sym;
if (sym->attr.flavor != FL_LABEL)
{
gfc_error ("Name '%s' in %s statement at %C is not a loop name",
- sym->name, gfc_ascii_statement (st));
+ name, gfc_ascii_statement (st));
return MATCH_ERROR;
}
}
- /* Find the loop mentioned specified by the label (or lack of a label). */
+ /* Find the loop specified by the label (or lack of a label). */
for (o = NULL, p = gfc_state_stack; p; p = p->previous)
if (p->state == COMP_DO && (sym == NULL || sym == p->sym))
break;
@@ -2053,17 +2069,34 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op)
gfc_ascii_statement (st));
return MATCH_ERROR;
}
- else if (st == ST_EXIT
- && p->previous != NULL
- && p->previous->state == COMP_OMP_STRUCTURED_BLOCK
- && (p->previous->head->op == EXEC_OMP_DO
- || p->previous->head->op == EXEC_OMP_PARALLEL_DO))
- {
- gcc_assert (p->previous->head->next != NULL);
- gcc_assert (p->previous->head->next->op == EXEC_DO
- || p->previous->head->next->op == EXEC_DO_WHILE);
- gfc_error ("EXIT statement at %C terminating !$OMP DO loop");
- return MATCH_ERROR;
+
+ for (o = p, cnt = 0; o->state == COMP_DO && o->previous != NULL; cnt++)
+ o = o->previous;
+ if (cnt > 0
+ && o != NULL
+ && o->state == COMP_OMP_STRUCTURED_BLOCK
+ && (o->head->op == EXEC_OMP_DO
+ || o->head->op == EXEC_OMP_PARALLEL_DO))
+ {
+ int collapse = 1;
+ gcc_assert (o->head->next != NULL
+ && (o->head->next->op == EXEC_DO
+ || o->head->next->op == EXEC_DO_WHILE)
+ && o->previous != NULL
+ && o->previous->tail->op == o->head->op);
+ if (o->previous->tail->ext.omp_clauses != NULL
+ && o->previous->tail->ext.omp_clauses->collapse > 1)
+ collapse = o->previous->tail->ext.omp_clauses->collapse;
+ if (st == ST_EXIT && cnt <= collapse)
+ {
+ gfc_error ("EXIT statement at %C terminating !$OMP DO loop");
+ return MATCH_ERROR;
+ }
+ if (st == ST_CYCLE && cnt < collapse)
+ {
+ gfc_error ("CYCLE statement at %C to non-innermost collapsed !$OMP DO loop");
+ return MATCH_ERROR;
+ }
}
/* Save the first statement in the loop - needed by the backend. */
@@ -2878,7 +2911,7 @@ gfc_match_allocate (void)
|| tail->expr->ref->type == REF_ARRAY));
if (sym && sym->ts.type == BT_CLASS)
b2 = !(CLASS_DATA (sym)->attr.allocatable
- || CLASS_DATA (sym)->attr.pointer);
+ || CLASS_DATA (sym)->attr.class_pointer);
else
b2 = sym && !(sym->attr.allocatable || sym->attr.pointer
|| sym->attr.proc_pointer);
@@ -3184,7 +3217,7 @@ gfc_match_deallocate (void)
|| tail->expr->ref->type == REF_ARRAY));
if (sym && sym->ts.type == BT_CLASS)
b2 = !(CLASS_DATA (sym)->attr.allocatable
- || CLASS_DATA (sym)->attr.pointer);
+ || CLASS_DATA (sym)->attr.class_pointer);
else
b2 = sym && !(sym->attr.allocatable || sym->attr.pointer
|| sym->attr.proc_pointer);
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index b42a9e8c1d1..426a17c5cdf 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -80,7 +80,7 @@ along with GCC; see the file COPYING3. If not see
/* Don't put any single quote (') in MOD_VERSION,
if yout want it to be recognized. */
-#define MOD_VERSION "5"
+#define MOD_VERSION "6"
/* Structure that describes a position within a module file. */
@@ -1675,7 +1675,7 @@ typedef enum
AB_POINTER_COMP, AB_PRIVATE_COMP, AB_VALUE, AB_VOLATILE, AB_PROTECTED,
AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP,
AB_IS_CLASS, AB_PROCEDURE, AB_PROC_POINTER, AB_ASYNCHRONOUS, AB_CODIMENSION,
- AB_COARRAY_COMP, AB_VTYPE, AB_VTAB, AB_CONTIGUOUS
+ AB_COARRAY_COMP, AB_VTYPE, AB_VTAB, AB_CONTIGUOUS, AB_CLASS_POINTER
}
ab_attribute;
@@ -1724,6 +1724,7 @@ static const mstring attr_bits[] =
minit ("PROC_POINTER", AB_PROC_POINTER),
minit ("VTYPE", AB_VTYPE),
minit ("VTAB", AB_VTAB),
+ minit ("CLASS_POINTER", AB_CLASS_POINTER),
minit (NULL, -1)
};
@@ -1818,6 +1819,8 @@ mio_symbol_attribute (symbol_attribute *attr)
MIO_NAME (ab_attribute) (AB_OPTIONAL, attr_bits);
if (attr->pointer)
MIO_NAME (ab_attribute) (AB_POINTER, attr_bits);
+ if (attr->class_pointer)
+ MIO_NAME (ab_attribute) (AB_CLASS_POINTER, attr_bits);
if (attr->is_protected)
MIO_NAME (ab_attribute) (AB_PROTECTED, attr_bits);
if (attr->value)
@@ -1933,6 +1936,9 @@ mio_symbol_attribute (symbol_attribute *attr)
case AB_POINTER:
attr->pointer = 1;
break;
+ case AB_CLASS_POINTER:
+ attr->class_pointer = 1;
+ break;
case AB_PROTECTED:
attr->is_protected = 1;
break;
@@ -5195,53 +5201,6 @@ gfc_dump_module (const char *name, int dump_flag)
}
-static void
-sort_iso_c_rename_list (void)
-{
- gfc_use_rename *tmp_list = NULL;
- gfc_use_rename *curr;
- gfc_use_rename *kinds_used[ISOCBINDING_NUMBER] = {NULL};
- int c_kind;
- int i;
-
- for (curr = gfc_rename_list; curr; curr = curr->next)
- {
- c_kind = get_c_kind (curr->use_name, c_interop_kinds_table);
- if (c_kind == ISOCBINDING_INVALID || c_kind == ISOCBINDING_LAST)
- {
- gfc_error ("Symbol '%s' referenced at %L does not exist in "
- "intrinsic module ISO_C_BINDING.", curr->use_name,
- &curr->where);
- }
- else
- /* Put it in the list. */
- kinds_used[c_kind] = curr;
- }
-
- /* Make a new (sorted) rename list. */
- i = 0;
- while (i < ISOCBINDING_NUMBER && kinds_used[i] == NULL)
- i++;
-
- if (i < ISOCBINDING_NUMBER)
- {
- tmp_list = kinds_used[i];
-
- i++;
- curr = tmp_list;
- for (; i < ISOCBINDING_NUMBER; i++)
- if (kinds_used[i] != NULL)
- {
- curr->next = kinds_used[i];
- curr = curr->next;
- curr->next = NULL;
- }
- }
-
- gfc_rename_list = tmp_list;
-}
-
-
/* Import the intrinsic ISO_C_BINDING module, generating symbols in
the current namespace for all named constants, pointer types, and
procedures in the module unless the only clause was used or a rename
@@ -5255,7 +5214,6 @@ import_iso_c_binding_module (void)
const char *iso_c_module_name = "__iso_c_binding";
gfc_use_rename *u;
int i;
- char *local_name;
/* Look only in the current namespace. */
mod_symtree = gfc_find_symtree (gfc_current_ns->sym_root, iso_c_module_name);
@@ -5280,57 +5238,32 @@ import_iso_c_binding_module (void)
/* Generate the symbols for the named constants representing
the kinds for intrinsic data types. */
- if (only_flag)
+ for (i = 0; i < ISOCBINDING_NUMBER; i++)
{
- /* Sort the rename list because there are dependencies between types
- and procedures (e.g., c_loc needs c_ptr). */
- sort_iso_c_rename_list ();
-
+ bool found = false;
for (u = gfc_rename_list; u; u = u->next)
- {
- i = get_c_kind (u->use_name, c_interop_kinds_table);
+ if (strcmp (c_interop_kinds_table[i].name, u->use_name) == 0)
+ {
+ u->found = 1;
+ found = true;
+ generate_isocbinding_symbol (iso_c_module_name,
+ (iso_c_binding_symbol) i,
+ u->local_name);
+ }
- if (i == ISOCBINDING_INVALID || i == ISOCBINDING_LAST)
- {
- gfc_error ("Symbol '%s' referenced at %L does not exist in "
- "intrinsic module ISO_C_BINDING.", u->use_name,
- &u->where);
- continue;
- }
-
- generate_isocbinding_symbol (iso_c_module_name,
- (iso_c_binding_symbol) i,
- u->local_name);
- }
- }
- else
- {
- for (i = 0; i < ISOCBINDING_NUMBER; i++)
- {
- local_name = NULL;
- for (u = gfc_rename_list; u; u = u->next)
- {
- if (strcmp (c_interop_kinds_table[i].name, u->use_name) == 0)
- {
- local_name = u->local_name;
- u->found = 1;
- break;
- }
- }
- generate_isocbinding_symbol (iso_c_module_name,
- (iso_c_binding_symbol) i,
- local_name);
- }
+ if (!found && !only_flag)
+ generate_isocbinding_symbol (iso_c_module_name,
+ (iso_c_binding_symbol) i, NULL);
+ }
- for (u = gfc_rename_list; u; u = u->next)
- {
- if (u->found)
- continue;
+ for (u = gfc_rename_list; u; u = u->next)
+ {
+ if (u->found)
+ continue;
- gfc_error ("Symbol '%s' referenced at %L not found in intrinsic "
- "module ISO_C_BINDING", u->use_name, &u->where);
- }
- }
+ gfc_error ("Symbol '%s' referenced at %L not found in intrinsic "
+ "module ISO_C_BINDING", u->use_name, &u->where);
+ }
}
@@ -5372,7 +5305,6 @@ static void
use_iso_fortran_env_module (void)
{
static char mod[] = "iso_fortran_env";
- const char *local_name;
gfc_use_rename *u;
gfc_symbol *mod_sym;
gfc_symtree *mod_symtree;
@@ -5408,60 +5340,41 @@ use_iso_fortran_env_module (void)
"non-intrinsic module name used previously", mod);
/* Generate the symbols for the module integer named constants. */
- if (only_flag)
- for (u = gfc_rename_list; u; u = u->next)
- {
- for (i = 0; symbol[i].name; i++)
- if (strcmp (symbol[i].name, u->use_name) == 0)
- break;
-
- if (symbol[i].name == NULL)
- {
- gfc_error ("Symbol '%s' referenced at %L does not exist in "
- "intrinsic module ISO_FORTRAN_ENV", u->use_name,
- &u->where);
- continue;
- }
-
- if ((gfc_option.flag_default_integer || gfc_option.flag_default_real)
- && symbol[i].id == ISOFORTRANENV_NUMERIC_STORAGE_SIZE)
- gfc_warning_now ("Use of the NUMERIC_STORAGE_SIZE named constant "
- "from intrinsic module ISO_FORTRAN_ENV at %L is "
- "incompatible with option %s", &u->where,
- gfc_option.flag_default_integer
- ? "-fdefault-integer-8" : "-fdefault-real-8");
-
- if (gfc_notify_std (symbol[i].standard, "The symbol '%s', referrenced "
- "at %C, is not in the selected standard",
- symbol[i].name) == FAILURE)
- continue;
- create_int_parameter (u->local_name[0] ? u->local_name
- : symbol[i].name,
- symbol[i].value, mod, INTMOD_ISO_FORTRAN_ENV,
- symbol[i].id);
- }
- else
+ for (i = 0; symbol[i].name; i++)
{
- for (i = 0; symbol[i].name; i++)
+ bool found = false;
+ for (u = gfc_rename_list; u; u = u->next)
{
- local_name = NULL;
-
- for (u = gfc_rename_list; u; u = u->next)
+ if (strcmp (symbol[i].name, u->use_name) == 0)
{
- if (strcmp (symbol[i].name, u->use_name) == 0)
- {
- local_name = u->local_name;
- u->found = 1;
- break;
- }
+ found = true;
+ u->found = 1;
+
+ if (gfc_notify_std (symbol[i].standard, "The symbol '%s', "
+ "referrenced at %C, is not in the selected "
+ "standard", symbol[i].name) == FAILURE)
+ continue;
+
+ if ((gfc_option.flag_default_integer || gfc_option.flag_default_real)
+ && symbol[i].id == ISOFORTRANENV_NUMERIC_STORAGE_SIZE)
+ gfc_warning_now ("Use of the NUMERIC_STORAGE_SIZE named "
+ "constant from intrinsic module "
+ "ISO_FORTRAN_ENV at %C is incompatible with "
+ "option %s",
+ gfc_option.flag_default_integer
+ ? "-fdefault-integer-8"
+ : "-fdefault-real-8");
+
+ create_int_parameter (u->local_name[0] ? u->local_name : u->use_name,
+ symbol[i].value, mod,
+ INTMOD_ISO_FORTRAN_ENV, symbol[i].id);
}
+ }
- if (u && gfc_notify_std (symbol[i].standard, "The symbol '%s', "
- "referrenced at %C, is not in the selected "
- "standard", symbol[i].name) == FAILURE)
- continue;
- else if ((gfc_option.allow_std & symbol[i].standard) == 0)
+ if (!found && !only_flag)
+ {
+ if ((gfc_option.allow_std & symbol[i].standard) == 0)
continue;
if ((gfc_option.flag_default_integer || gfc_option.flag_default_real)
@@ -5472,19 +5385,18 @@ use_iso_fortran_env_module (void)
gfc_option.flag_default_integer
? "-fdefault-integer-8" : "-fdefault-real-8");
- create_int_parameter (local_name ? local_name : symbol[i].name,
- symbol[i].value, mod, INTMOD_ISO_FORTRAN_ENV,
- symbol[i].id);
+ create_int_parameter (symbol[i].name, symbol[i].value, mod,
+ INTMOD_ISO_FORTRAN_ENV, symbol[i].id);
}
+ }
- for (u = gfc_rename_list; u; u = u->next)
- {
- if (u->found)
- continue;
+ for (u = gfc_rename_list; u; u = u->next)
+ {
+ if (u->found)
+ continue;
- gfc_error ("Symbol '%s' referenced at %L not found in intrinsic "
+ gfc_error ("Symbol '%s' referenced at %L not found in intrinsic "
"module ISO_FORTRAN_ENV", u->use_name, &u->where);
- }
}
}
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index af537a1e70e..d5c6c3caf90 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "gfortran.h"
#include "target.h"
#include "cpp.h"
-#include "toplev.h" /* For sorry. */
+#include "diagnostic-core.h" /* For sorry. */
#include "tm.h"
gfc_option_t gfc_option;
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 50f795723eb..a1af0264658 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -2103,7 +2103,7 @@ endType:
/* Look for pointer components. */
if (c->attr.pointer
- || (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.pointer)
+ || (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.class_pointer)
|| (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.pointer_comp))
sym->attr.pointer_comp = 1;
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index b6c08a9c406..cb6fae20c41 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1999,7 +1999,7 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
if (sym->ts.type == BT_CLASS)
{
dimension = CLASS_DATA (sym)->attr.dimension;
- pointer = CLASS_DATA (sym)->attr.pointer;
+ pointer = CLASS_DATA (sym)->attr.class_pointer;
allocatable = CLASS_DATA (sym)->attr.allocatable;
}
else
@@ -2059,7 +2059,7 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
if (comp->ts.type == BT_CLASS)
{
- pointer = CLASS_DATA (comp)->attr.pointer;
+ pointer = CLASS_DATA (comp)->attr.class_pointer;
allocatable = CLASS_DATA (comp)->attr.allocatable;
}
else
@@ -2109,7 +2109,7 @@ gfc_expr_attr (gfc_expr *e)
if (sym->ts.type == BT_CLASS)
{
attr.dimension = CLASS_DATA (sym)->attr.dimension;
- attr.pointer = CLASS_DATA (sym)->attr.pointer;
+ attr.pointer = CLASS_DATA (sym)->attr.class_pointer;
attr.allocatable = CLASS_DATA (sym)->attr.allocatable;
}
}
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 4e11fc6c311..2434be192d7 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -905,7 +905,7 @@ resolve_structure_cons (gfc_expr *expr)
&& !(comp->attr.pointer || comp->attr.allocatable
|| comp->attr.proc_pointer
|| (comp->ts.type == BT_CLASS
- && (CLASS_DATA (comp)->attr.pointer
+ && (CLASS_DATA (comp)->attr.class_pointer
|| CLASS_DATA (comp)->attr.allocatable))))
{
t = FAILURE;
@@ -2440,10 +2440,11 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
{
char name[GFC_MAX_SYMBOL_LEN + 1];
char binding_label[GFC_MAX_BINDING_LABEL_LEN + 1];
- int optional_arg = 0, is_pointer = 0;
+ int optional_arg = 0;
gfc_try retval = SUCCESS;
gfc_symbol *args_sym;
gfc_typespec *arg_ts;
+ symbol_attribute arg_attr;
if (args->expr->expr_type == EXPR_CONSTANT
|| args->expr->expr_type == EXPR_OP
@@ -2460,8 +2461,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
and not necessarily that of the expr symbol (args_sym), because
the actual expression could be a part-ref of the expr symbol. */
arg_ts = &(args->expr->ts);
-
- is_pointer = gfc_is_data_pointer (args->expr);
+ arg_attr = gfc_expr_attr (args->expr);
if (sym->intmod_sym_id == ISOCBINDING_ASSOCIATED)
{
@@ -2504,7 +2504,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
else if (sym->intmod_sym_id == ISOCBINDING_LOC)
{
/* Make sure we have either the target or pointer attribute. */
- if (!args_sym->attr.target && !is_pointer)
+ if (!arg_attr.target && !arg_attr.pointer)
{
gfc_error_now ("Parameter '%s' to '%s' at %L must be either "
"a TARGET or an associated pointer",
@@ -2587,7 +2587,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
}
}
}
- else if (is_pointer
+ else if (arg_attr.pointer
&& is_scalar_expr_ptr (args->expr) != SUCCESS)
{
/* Case 1c, section 15.1.2.5, J3/04-007: an associated
@@ -2622,6 +2622,13 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
&(args->expr->where));
retval = FAILURE;
}
+ else if (arg_ts->type == BT_CLASS)
+ {
+ gfc_error_now ("Parameter '%s' to '%s' at %L must not be "
+ "polymorphic", args_sym->name, sym->name,
+ &(args->expr->where));
+ retval = FAILURE;
+ }
}
}
else if (sym->intmod_sym_id == ISOCBINDING_FUNLOC)
@@ -4772,6 +4779,15 @@ resolve_variable (gfc_expr *e)
sym->entry_id = current_entry_id + 1;
}
+ /* If a symbol has been host_associated mark it. This is used latter,
+ to identify if aliasing is possible via host association. */
+ if (sym->attr.flavor == FL_VARIABLE
+ && gfc_current_ns->parent
+ && (gfc_current_ns->parent == sym->ns
+ || (gfc_current_ns->parent->parent
+ && gfc_current_ns->parent->parent == sym->ns)))
+ sym->attr.host_assoc = 1;
+
resolve_procedure:
if (t == SUCCESS && resolve_procedure_expression (e) == FAILURE)
t = FAILURE;
@@ -5320,10 +5336,11 @@ resolve_typebound_generic_call (gfc_expr* e, const char **name)
if (matches)
{
e->value.compcall.tbp = g->specific;
+ genname = g->specific_st->name;
/* Pass along the name for CLASS methods, where the vtab
procedure pointer component has to be referenced. */
if (name)
- *name = g->specific_st->name;
+ *name = genname;
goto success;
}
}
@@ -5336,12 +5353,6 @@ resolve_typebound_generic_call (gfc_expr* e, const char **name)
success:
/* Make sure that we have the right specific instance for the name. */
- genname = e->value.compcall.tbp->u.specific->name;
-
- /* Is the symtree name a "unique name". */
- if (*genname == '@')
- genname = e->value.compcall.tbp->u.specific->n.sym->name;
-
derived = get_declared_from_expr (NULL, NULL, e);
st = gfc_find_typebound_proc (derived, NULL, genname, false, &e->where);
@@ -5468,10 +5479,38 @@ resolve_typebound_function (gfc_expr* e)
gfc_ref *class_ref;
gfc_symtree *st;
const char *name;
- const char *genname;
gfc_typespec ts;
+ gfc_expr *expr;
st = e->symtree;
+
+ /* Deal with typebound operators for CLASS objects. */
+ expr = e->value.compcall.base_object;
+ if (expr && expr->symtree->n.sym->ts.type == BT_CLASS
+ && e->value.compcall.name)
+ {
+ /* Since the typebound operators are generic, we have to ensure
+ that any delays in resolution are corrected and that the vtab
+ is present. */
+ ts = expr->symtree->n.sym->ts;
+ declared = ts.u.derived;
+ c = gfc_find_component (declared, "$vptr", true, true);
+ if (c->ts.u.derived == NULL)
+ c->ts.u.derived = gfc_find_derived_vtab (declared);
+
+ if (resolve_compcall (e, &name) == FAILURE)
+ return FAILURE;
+
+ /* Use the generic name if it is there. */
+ name = name ? name : e->value.function.esym->name;
+ e->symtree = expr->symtree;
+ expr->symtree->n.sym->ts.u.derived = declared;
+ gfc_add_component_ref (e, "$vptr");
+ gfc_add_component_ref (e, name);
+ e->value.function.esym = NULL;
+ return SUCCESS;
+ }
+
if (st == NULL)
return resolve_compcall (e, NULL);
@@ -5492,11 +5531,6 @@ resolve_typebound_function (gfc_expr* e)
c = gfc_find_component (declared, "$data", true, true);
declared = c->ts.u.derived;
- /* Keep the generic name so that the vtab reference can be made. */
- genname = NULL;
- if (e->value.compcall.tbp->is_generic)
- genname = e->value.compcall.name;
-
/* Treat the call as if it is a typebound procedure, in order to roll
out the correct name for the specific function. */
if (resolve_compcall (e, &name) == FAILURE)
@@ -5512,15 +5546,6 @@ resolve_typebound_function (gfc_expr* e)
/* '$vptr' points to the vtab, which contains the procedure pointers. */
gfc_add_component_ref (e, "$vptr");
- if (genname)
- {
- /* A generic procedure needs the subsidiary vtabs and vtypes for
- the specific procedures to have been build. */
- gfc_symbol *vtab;
- vtab = gfc_find_derived_vtab (declared, true);
- gcc_assert (vtab);
- gfc_add_component_ref (e, genname);
- }
gfc_add_component_ref (e, name);
/* Recover the typespec for the expression. This is really only
@@ -5543,11 +5568,39 @@ resolve_typebound_subroutine (gfc_code *code)
gfc_ref *new_ref;
gfc_ref *class_ref;
gfc_symtree *st;
- const char *genname;
const char *name;
gfc_typespec ts;
+ gfc_expr *expr;
st = code->expr1->symtree;
+
+ /* Deal with typebound operators for CLASS objects. */
+ expr = code->expr1->value.compcall.base_object;
+ if (expr && expr->symtree->n.sym->ts.type == BT_CLASS
+ && code->expr1->value.compcall.name)
+ {
+ /* Since the typebound operators are generic, we have to ensure
+ that any delays in resolution are corrected and that the vtab
+ is present. */
+ ts = expr->symtree->n.sym->ts;
+ declared = ts.u.derived;
+ c = gfc_find_component (declared, "$vptr", true, true);
+ if (c->ts.u.derived == NULL)
+ c->ts.u.derived = gfc_find_derived_vtab (declared);
+
+ if (resolve_typebound_call (code, &name) == FAILURE)
+ return FAILURE;
+
+ /* Use the generic name if it is there. */
+ name = name ? name : code->expr1->value.function.esym->name;
+ code->expr1->symtree = expr->symtree;
+ expr->symtree->n.sym->ts.u.derived = declared;
+ gfc_add_component_ref (code->expr1, "$vptr");
+ gfc_add_component_ref (code->expr1, name);
+ code->expr1->value.function.esym = NULL;
+ return SUCCESS;
+ }
+
if (st == NULL)
return resolve_typebound_call (code, NULL);
@@ -5555,7 +5608,7 @@ resolve_typebound_subroutine (gfc_code *code)
return FAILURE;
/* Get the CLASS declared type. */
- declared = get_declared_from_expr (&class_ref, &new_ref, code->expr1);
+ get_declared_from_expr (&class_ref, &new_ref, code->expr1);
/* Weed out cases of the ultimate component being a derived type. */
if ((class_ref && class_ref->u.c.component->ts.type == BT_DERIVED)
@@ -5563,15 +5616,7 @@ resolve_typebound_subroutine (gfc_code *code)
{
gfc_free_ref_list (new_ref);
return resolve_typebound_call (code, NULL);
- }
-
- c = gfc_find_component (declared, "$data", true, true);
- declared = c->ts.u.derived;
-
- /* Keep the generic name so that the vtab reference can be made. */
- genname = NULL;
- if (code->expr1->value.compcall.tbp->is_generic)
- genname = code->expr1->value.compcall.name;
+ }
if (resolve_typebound_call (code, &name) == FAILURE)
return FAILURE;
@@ -5586,15 +5631,6 @@ resolve_typebound_subroutine (gfc_code *code)
/* '$vptr' points to the vtab, which contains the procedure pointers. */
gfc_add_component_ref (code->expr1, "$vptr");
- if (genname)
- {
- /* A generic procedure needs the subsidiary vtabs and vtypes for
- the specific procedures to have been build. */
- gfc_symbol *vtab;
- vtab = gfc_find_derived_vtab (declared, true);
- gcc_assert (vtab);
- gfc_add_component_ref (code->expr1, genname);
- }
gfc_add_component_ref (code->expr1, name);
/* Recover the typespec for the expression. This is really only
@@ -5776,7 +5812,7 @@ gfc_resolve_expr (gfc_expr *e)
{
expression_rank (e);
if (gfc_is_constant_expr (e) || gfc_is_expandable_expr (e))
- gfc_expand_constructor (e);
+ gfc_expand_constructor (e, false);
}
/* This provides the opportunity for the length of constructors with
@@ -5786,7 +5822,7 @@ gfc_resolve_expr (gfc_expr *e)
{
/* For efficiency, we call gfc_expand_constructor for BT_CHARACTER
here rather then add a duplicate test for it above. */
- gfc_expand_constructor (e);
+ gfc_expand_constructor (e, false);
t = gfc_resolve_character_array_constructor (e);
}
@@ -6087,7 +6123,7 @@ resolve_deallocate_expr (gfc_expr *e)
if (sym->ts.type == BT_CLASS)
{
allocatable = CLASS_DATA (sym)->attr.allocatable;
- pointer = CLASS_DATA (sym)->attr.pointer;
+ pointer = CLASS_DATA (sym)->attr.class_pointer;
}
else
{
@@ -6111,7 +6147,7 @@ resolve_deallocate_expr (gfc_expr *e)
if (c->ts.type == BT_CLASS)
{
allocatable = CLASS_DATA (c)->attr.allocatable;
- pointer = CLASS_DATA (c)->attr.pointer;
+ pointer = CLASS_DATA (c)->attr.class_pointer;
}
else
{
@@ -6310,7 +6346,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
if (sym->ts.type == BT_CLASS)
{
allocatable = CLASS_DATA (sym)->attr.allocatable;
- pointer = CLASS_DATA (sym)->attr.pointer;
+ pointer = CLASS_DATA (sym)->attr.class_pointer;
dimension = CLASS_DATA (sym)->attr.dimension;
codimension = CLASS_DATA (sym)->attr.codimension;
is_abstract = CLASS_DATA (sym)->attr.abstract;
@@ -6348,7 +6384,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
if (c->ts.type == BT_CLASS)
{
allocatable = CLASS_DATA (c)->attr.allocatable;
- pointer = CLASS_DATA (c)->attr.pointer;
+ pointer = CLASS_DATA (c)->attr.class_pointer;
dimension = CLASS_DATA (c)->attr.dimension;
codimension = CLASS_DATA (c)->attr.codimension;
is_abstract = CLASS_DATA (c)->attr.abstract;
@@ -7496,7 +7532,7 @@ resolve_select_type (gfc_code *code)
new_st->expr1->value.function.actual = gfc_get_actual_arglist ();
new_st->expr1->value.function.actual->expr = gfc_get_variable_expr (code->expr1->symtree);
gfc_add_component_ref (new_st->expr1->value.function.actual->expr, "$vptr");
- vtab = gfc_find_derived_vtab (body->ext.case_list->ts.u.derived, true);
+ vtab = gfc_find_derived_vtab (body->ext.case_list->ts.u.derived);
st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
new_st->expr1->value.function.actual->next = gfc_get_actual_arglist ();
new_st->expr1->value.function.actual->next->expr = gfc_get_variable_expr (st);
@@ -9130,7 +9166,7 @@ build_default_init_expr (gfc_symbol *sym)
{
case BT_INTEGER:
if (gfc_option.flag_init_integer != GFC_INIT_INTEGER_OFF)
- mpz_init_set_si (init_expr->value.integer,
+ mpz_set_si (init_expr->value.integer,
gfc_option.flag_init_integer_value);
else
{
@@ -9140,7 +9176,6 @@ build_default_init_expr (gfc_symbol *sym)
break;
case BT_REAL:
- mpfr_init (init_expr->value.real);
switch (gfc_option.flag_init_real)
{
case GFC_INIT_REAL_SNAN:
@@ -9170,7 +9205,6 @@ build_default_init_expr (gfc_symbol *sym)
break;
case BT_COMPLEX:
- mpc_init2 (init_expr->value.complex, mpfr_get_default_prec());
switch (gfc_option.flag_init_real)
{
case GFC_INIT_REAL_SNAN:
@@ -9318,7 +9352,8 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
if (sym->ts.type == BT_CLASS && !(sym->result && sym->result != sym))
{
/* F03:C502. */
- if (!gfc_type_is_extensible (CLASS_DATA (sym)->ts.u.derived))
+ if (sym->attr.class_ok
+ && !gfc_type_is_extensible (CLASS_DATA (sym)->ts.u.derived))
{
gfc_error ("Type '%s' of CLASS variable '%s' at %L is not extensible",
CLASS_DATA (sym)->ts.u.derived->name, sym->name,
@@ -10769,7 +10804,7 @@ resolve_fl_derived (gfc_symbol *sym)
gfc_component *vptr = gfc_find_component (sym, "$vptr", true, true);
if (vptr->ts.u.derived == NULL)
{
- gfc_symbol *vtab = gfc_find_derived_vtab (data->ts.u.derived, false);
+ gfc_symbol *vtab = gfc_find_derived_vtab (data->ts.u.derived);
gcc_assert (vtab);
vptr->ts.u.derived = vtab->ts.u.derived;
}
@@ -11084,7 +11119,7 @@ resolve_fl_derived (gfc_symbol *sym)
return FAILURE;
}
- if (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.pointer
+ if (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.class_pointer
&& CLASS_DATA (c)->ts.u.derived->components == NULL
&& !CLASS_DATA (c)->ts.u.derived->attr.zero_comp)
{
@@ -11096,7 +11131,8 @@ resolve_fl_derived (gfc_symbol *sym)
/* C437. */
if (c->ts.type == BT_CLASS
- && !(CLASS_DATA (c)->attr.pointer || CLASS_DATA (c)->attr.allocatable))
+ && !(CLASS_DATA (c)->attr.class_pointer
+ || CLASS_DATA (c)->attr.allocatable))
{
gfc_error ("Component '%s' with CLASS at %L must be allocatable "
"or pointer", c->name, &c->loc);
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index df6ada963c3..18f7b253a28 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2565,6 +2565,27 @@ select_type_insert_tmp (gfc_symtree **st)
}
+/* Look for a symtree in the current procedure -- that is, go up to
+ parent namespaces but only if inside a BLOCK. Returns NULL if not found. */
+
+gfc_symtree*
+gfc_find_symtree_in_proc (const char* name, gfc_namespace* ns)
+{
+ while (ns)
+ {
+ gfc_symtree* st = gfc_find_symtree (ns->sym_root, name);
+ if (st)
+ return st;
+
+ if (!ns->construct_entities)
+ break;
+ ns = ns->parent;
+ }
+
+ return NULL;
+}
+
+
/* Search for a symtree starting in the current namespace, resorting to
any parent namespaces if requested by a nonzero parent_flag.
Returns nonzero if the name is ambiguous. */
@@ -2811,6 +2832,17 @@ gfc_symbols_could_alias (gfc_symbol *lsym, gfc_symbol *rsym)
if (lsym->attr.allocatable && rsym->attr.pointer)
return 1;
+ /* Special case: Argument association, cf. F90 12.4.1.6, F2003 12.4.1.7
+ and F2008 12.5.2.13 items 3b and 4b. The pointer case (a) is already
+ checked above. */
+ if (lsym->attr.target && rsym->attr.target
+ && ((lsym->attr.dummy && !lsym->attr.contiguous
+ && (!lsym->attr.dimension || lsym->as->type == AS_ASSUMED_SHAPE))
+ || (rsym->attr.dummy && !rsym->attr.contiguous
+ && (!rsym->attr.dimension
+ || rsym->as->type == AS_ASSUMED_SHAPE))))
+ return 1;
+
return 0;
}
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 7eb8e755785..cca4ecc4d9c 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -80,7 +80,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "toplev.h" /* For internal_error/fatal_error. */
+#include "diagnostic-core.h" /* For internal_error/fatal_error. */
#include "flags.h"
#include "gfortran.h"
#include "constructor.h"
@@ -434,10 +434,10 @@ gfc_free_ss (gfc_ss * ss)
switch (ss->type)
{
case GFC_SS_SECTION:
- for (n = 0; n < GFC_MAX_DIMENSIONS; n++)
+ for (n = 0; n < ss->data.info.dimen; n++)
{
- if (ss->data.info.subscript[n])
- gfc_free_ss_chain (ss->data.info.subscript[n]);
+ if (ss->data.info.subscript[ss->data.info.dim[n]])
+ gfc_free_ss_chain (ss->data.info.subscript[ss->data.info.dim[n]]);
}
break;
@@ -762,25 +762,28 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
for (n = 0; n < info->dimen; n++)
{
+ dim = info->dim[n];
+
if (size == NULL_TREE)
{
/* For a callee allocated array express the loop bounds in terms
of the descriptor fields. */
- tmp =
- fold_build2 (MINUS_EXPR, gfc_array_index_type,
- gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[n]),
- gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[n]));
+ tmp = fold_build2 (
+ MINUS_EXPR, gfc_array_index_type,
+ gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[dim]),
+ gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[dim]));
loop->to[n] = tmp;
continue;
}
/* Store the stride and bound components in the descriptor. */
- gfc_conv_descriptor_stride_set (pre, desc, gfc_rank_cst[n], size);
+ gfc_conv_descriptor_stride_set (pre, desc, gfc_rank_cst[dim], size);
- gfc_conv_descriptor_lbound_set (pre, desc, gfc_rank_cst[n],
+ gfc_conv_descriptor_lbound_set (pre, desc, gfc_rank_cst[dim],
gfc_index_zero_node);
- gfc_conv_descriptor_ubound_set (pre, desc, gfc_rank_cst[n], loop->to[n]);
+ gfc_conv_descriptor_ubound_set (pre, desc, gfc_rank_cst[dim],
+ loop->to[n]);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
loop->to[n], gfc_index_one_node);
@@ -2177,9 +2180,12 @@ gfc_init_loopinfo (gfc_loopinfo * loop)
gfc_init_block (&loop->pre);
gfc_init_block (&loop->post);
- /* Initially scalarize in order. */
+ /* Initially scalarize in order and default to no loop reversal. */
for (n = 0; n < GFC_MAX_DIMENSIONS; n++)
- loop->order[n] = n;
+ {
+ loop->order[n] = n;
+ loop->reverse[n] = GFC_CANNOT_REVERSE;
+ }
loop->ss = gfc_ss_terminator;
}
@@ -2387,7 +2393,8 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
/* Return the offset for an index. Performs bound checking for elemental
- dimensions. Single element references are processed separately. */
+ dimensions. Single element references are processed separately.
+ DIM is the array dimension, I is the loop dimension. */
static tree
gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
@@ -2448,14 +2455,14 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
/* Scalarized dimension. */
gcc_assert (info && se->loop);
- /* Multiply the loop variable by the stride and delta. */
+ /* Multiply the loop variable by the stride and delta. */
index = se->loop->loopvar[i];
- if (!integer_onep (info->stride[i]))
+ if (!integer_onep (info->stride[dim]))
index = fold_build2 (MULT_EXPR, gfc_array_index_type, index,
- info->stride[i]);
- if (!integer_zerop (info->delta[i]))
+ info->stride[dim]);
+ if (!integer_zerop (info->delta[dim]))
index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index,
- info->delta[i]);
+ info->delta[dim]);
break;
default:
@@ -2467,9 +2474,9 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
/* Temporary array or derived type component. */
gcc_assert (se->loop);
index = se->loop->loopvar[se->loop->order[i]];
- if (!integer_zerop (info->delta[i]))
+ if (!integer_zerop (info->delta[dim]))
index = fold_build2 (PLUS_EXPR, gfc_array_index_type,
- index, info->delta[i]);
+ index, info->delta[dim]);
}
/* Multiply by the stride. */
@@ -2838,8 +2845,18 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
}
else
{
+ bool reverse_loop = (loop->reverse[n] == GFC_REVERSE_SET)
+ && (loop->temp_ss == NULL);
+
loopbody = gfc_finish_block (pbody);
+ if (reverse_loop)
+ {
+ tmp = loop->from[n];
+ loop->from[n] = loop->to[n];
+ loop->to[n] = tmp;
+ }
+
/* Initialize the loopvar. */
if (loop->loopvar[n] != loop->from[n])
gfc_add_modify (&loop->code[n], loop->loopvar[n], loop->from[n]);
@@ -2850,8 +2867,8 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
gfc_init_block (&block);
/* The exit condition. */
- cond = fold_build2 (GT_EXPR, boolean_type_node,
- loop->loopvar[n], loop->to[n]);
+ cond = fold_build2 (reverse_loop ? LT_EXPR : GT_EXPR,
+ boolean_type_node, loop->loopvar[n], loop->to[n]);
tmp = build1_v (GOTO_EXPR, exit_label);
TREE_USED (exit_label) = 1;
tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location));
@@ -2861,8 +2878,10 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
gfc_add_expr_to_block (&block, loopbody);
/* Increment the loopvar. */
- tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
- loop->loopvar[n], gfc_index_one_node);
+ tmp = fold_build2 (reverse_loop ? MINUS_EXPR : PLUS_EXPR,
+ gfc_array_index_type, loop->loopvar[n],
+ gfc_index_one_node);
+
gfc_add_modify (&block, loop->loopvar[n], tmp);
/* Build the loop. */
@@ -2964,54 +2983,10 @@ gfc_trans_scalarized_loop_boundary (gfc_loopinfo * loop, stmtblock_t * body)
}
-/* Calculate the upper bound of an array section. */
-
-static tree
-gfc_conv_section_upper_bound (gfc_ss * ss, int n, stmtblock_t * pblock)
-{
- int dim;
- gfc_expr *end;
- tree desc;
- tree bound;
- gfc_se se;
- gfc_ss_info *info;
-
- gcc_assert (ss->type == GFC_SS_SECTION);
-
- info = &ss->data.info;
- dim = info->dim[n];
-
- if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
- /* We'll calculate the upper bound once we have access to the
- vector's descriptor. */
- return NULL;
-
- gcc_assert (info->ref->u.ar.dimen_type[dim] == DIMEN_RANGE);
- desc = info->descriptor;
- end = info->ref->u.ar.end[dim];
-
- if (end)
- {
- /* The upper bound was specified. */
- gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, end, gfc_array_index_type);
- gfc_add_block_to_block (pblock, &se.pre);
- bound = se.expr;
- }
- else
- {
- /* No upper bound was specified, so use the bound of the array. */
- bound = gfc_conv_array_ubound (desc, dim);
- }
-
- return bound;
-}
-
-
/* Calculate the lower bound of an array section. */
static void
-gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int n)
+gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim)
{
gfc_expr *start;
gfc_expr *end;
@@ -3019,19 +2994,17 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int n)
tree desc;
gfc_se se;
gfc_ss_info *info;
- int dim;
gcc_assert (ss->type == GFC_SS_SECTION);
info = &ss->data.info;
- dim = info->dim[n];
if (info->ref->u.ar.dimen_type[dim] == DIMEN_VECTOR)
{
/* We use a zero-based index to access the vector. */
- info->start[n] = gfc_index_zero_node;
- info->end[n] = gfc_index_zero_node;
- info->stride[n] = gfc_index_one_node;
+ info->start[dim] = gfc_index_zero_node;
+ info->stride[dim] = gfc_index_one_node;
+ info->end[dim] = NULL;
return;
}
@@ -3049,14 +3022,14 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int n)
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, start, gfc_array_index_type);
gfc_add_block_to_block (&loop->pre, &se.pre);
- info->start[n] = se.expr;
+ info->start[dim] = se.expr;
}
else
{
/* No lower bound specified so use the bound of the array. */
- info->start[n] = gfc_conv_array_lbound (desc, dim);
+ info->start[dim] = gfc_conv_array_lbound (desc, dim);
}
- info->start[n] = gfc_evaluate_now (info->start[n], &loop->pre);
+ info->start[dim] = gfc_evaluate_now (info->start[dim], &loop->pre);
/* Similarly calculate the end. Although this is not used in the
scalarizer, it is needed when checking bounds and where the end
@@ -3067,24 +3040,24 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int n)
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, end, gfc_array_index_type);
gfc_add_block_to_block (&loop->pre, &se.pre);
- info->end[n] = se.expr;
+ info->end[dim] = se.expr;
}
else
{
/* No upper bound specified so use the bound of the array. */
- info->end[n] = gfc_conv_array_ubound (desc, dim);
+ info->end[dim] = gfc_conv_array_ubound (desc, dim);
}
- info->end[n] = gfc_evaluate_now (info->end[n], &loop->pre);
+ info->end[dim] = gfc_evaluate_now (info->end[dim], &loop->pre);
/* Calculate the stride. */
if (stride == NULL)
- info->stride[n] = gfc_index_one_node;
+ info->stride[dim] = gfc_index_one_node;
else
{
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, stride, gfc_array_index_type);
gfc_add_block_to_block (&loop->pre, &se.pre);
- info->stride[n] = gfc_evaluate_now (se.expr, &loop->pre);
+ info->stride[dim] = gfc_evaluate_now (se.expr, &loop->pre);
}
}
@@ -3149,7 +3122,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter);
for (n = 0; n < ss->data.info.dimen; n++)
- gfc_conv_section_startstride (loop, ss, n);
+ gfc_conv_section_startstride (loop, ss, ss->data.info.dim[n]);
break;
case GFC_SS_INTRINSIC:
@@ -3224,11 +3197,10 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
check_upper = true;
/* Zero stride is not allowed. */
- tmp = fold_build2 (EQ_EXPR, boolean_type_node, info->stride[n],
+ tmp = fold_build2 (EQ_EXPR, boolean_type_node, info->stride[dim],
gfc_index_zero_node);
asprintf (&msg, "Zero stride is not allowed, for dimension %d "
- "of array '%s'", info->dim[n]+1,
- ss->expr->symtree->name);
+ "of array '%s'", dim + 1, ss->expr->symtree->name);
gfc_trans_runtime_check (true, false, tmp, &inner,
&ss->expr->where, msg);
gfc_free (msg);
@@ -3236,27 +3208,27 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
desc = ss->data.info.descriptor;
/* This is the run-time equivalent of resolve.c's
- check_dimension(). The logical is more readable there
- than it is here, with all the trees. */
+ check_dimension(). The logical is more readable there
+ than it is here, with all the trees. */
lbound = gfc_conv_array_lbound (desc, dim);
- end = info->end[n];
+ end = info->end[dim];
if (check_upper)
ubound = gfc_conv_array_ubound (desc, dim);
else
ubound = NULL;
/* non_zerosized is true when the selected range is not
- empty. */
+ empty. */
stride_pos = fold_build2 (GT_EXPR, boolean_type_node,
- info->stride[n], gfc_index_zero_node);
- tmp = fold_build2 (LE_EXPR, boolean_type_node, info->start[n],
+ info->stride[dim], gfc_index_zero_node);
+ tmp = fold_build2 (LE_EXPR, boolean_type_node, info->start[dim],
end);
stride_pos = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
stride_pos, tmp);
stride_neg = fold_build2 (LT_EXPR, boolean_type_node,
- info->stride[n], gfc_index_zero_node);
- tmp = fold_build2 (GE_EXPR, boolean_type_node, info->start[n],
+ info->stride[dim], gfc_index_zero_node);
+ tmp = fold_build2 (GE_EXPR, boolean_type_node, info->start[dim],
end);
stride_neg = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
stride_neg, tmp);
@@ -3269,41 +3241,41 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
error message. */
if (check_upper)
{
- tmp = fold_build2 (LT_EXPR, boolean_type_node,
- info->start[n], lbound);
+ tmp = fold_build2 (LT_EXPR, boolean_type_node,
+ info->start[dim], lbound);
tmp = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
non_zerosized, tmp);
tmp2 = fold_build2 (GT_EXPR, boolean_type_node,
- info->start[n], ubound);
+ info->start[dim], ubound);
tmp2 = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
non_zerosized, tmp2);
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "outside of expected range (%%ld:%%ld)",
- info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (true, false, tmp, &inner,
+ "outside of expected range (%%ld:%%ld)",
+ dim + 1, ss->expr->symtree->name);
+ gfc_trans_runtime_check (true, false, tmp, &inner,
&ss->expr->where, msg,
- fold_convert (long_integer_type_node, info->start[n]),
- fold_convert (long_integer_type_node, lbound),
+ fold_convert (long_integer_type_node, info->start[dim]),
+ fold_convert (long_integer_type_node, lbound),
fold_convert (long_integer_type_node, ubound));
- gfc_trans_runtime_check (true, false, tmp2, &inner,
+ gfc_trans_runtime_check (true, false, tmp2, &inner,
&ss->expr->where, msg,
- fold_convert (long_integer_type_node, info->start[n]),
- fold_convert (long_integer_type_node, lbound),
+ fold_convert (long_integer_type_node, info->start[dim]),
+ fold_convert (long_integer_type_node, lbound),
fold_convert (long_integer_type_node, ubound));
gfc_free (msg);
}
else
{
- tmp = fold_build2 (LT_EXPR, boolean_type_node,
- info->start[n], lbound);
+ tmp = fold_build2 (LT_EXPR, boolean_type_node,
+ info->start[dim], lbound);
tmp = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
non_zerosized, tmp);
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "below lower bound of %%ld",
- info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (true, false, tmp, &inner,
+ "below lower bound of %%ld",
+ dim + 1, ss->expr->symtree->name);
+ gfc_trans_runtime_check (true, false, tmp, &inner,
&ss->expr->where, msg,
- fold_convert (long_integer_type_node, info->start[n]),
+ fold_convert (long_integer_type_node, info->start[dim]),
fold_convert (long_integer_type_node, lbound));
gfc_free (msg);
}
@@ -3313,9 +3285,9 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
and check it against both lower and upper bounds. */
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, end,
- info->start[n]);
+ info->start[dim]);
tmp = fold_build2 (TRUNC_MOD_EXPR, gfc_array_index_type, tmp,
- info->stride[n]);
+ info->stride[dim]);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, end,
tmp);
tmp2 = fold_build2 (LT_EXPR, boolean_type_node, tmp, lbound);
@@ -3327,8 +3299,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
tmp3 = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
non_zerosized, tmp3);
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "outside of expected range (%%ld:%%ld)",
- info->dim[n]+1, ss->expr->symtree->name);
+ "outside of expected range (%%ld:%%ld)",
+ dim + 1, ss->expr->symtree->name);
gfc_trans_runtime_check (true, false, tmp2, &inner,
&ss->expr->where, msg,
fold_convert (long_integer_type_node, tmp),
@@ -3344,32 +3316,32 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
else
{
asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "below lower bound of %%ld",
- info->dim[n]+1, ss->expr->symtree->name);
+ "below lower bound of %%ld",
+ dim + 1, ss->expr->symtree->name);
gfc_trans_runtime_check (true, false, tmp2, &inner,
&ss->expr->where, msg,
fold_convert (long_integer_type_node, tmp),
fold_convert (long_integer_type_node, lbound));
gfc_free (msg);
}
-
+
/* Check the section sizes match. */
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, end,
- info->start[n]);
+ info->start[dim]);
tmp = fold_build2 (FLOOR_DIV_EXPR, gfc_array_index_type, tmp,
- info->stride[n]);
+ info->stride[dim]);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
gfc_index_one_node, tmp);
tmp = fold_build2 (MAX_EXPR, gfc_array_index_type, tmp,
build_int_cst (gfc_array_index_type, 0));
/* We remember the size of the first section, and check all the
- others against this. */
+ others against this. */
if (size[n])
{
tmp3 = fold_build2 (NE_EXPR, boolean_type_node, tmp, size[n]);
asprintf (&msg, "Array bound mismatch for dimension %d "
"of array '%s' (%%ld/%%ld)",
- info->dim[n]+1, ss->expr->symtree->name);
+ dim + 1, ss->expr->symtree->name);
gfc_trans_runtime_check (true, false, tmp3, &inner,
&ss->expr->where, msg,
@@ -3492,7 +3464,8 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
lref = dest->expr->ref;
rref = ss->expr->ref;
- nDepend = gfc_dep_resolver (lref, rref);
+ nDepend = gfc_dep_resolver (lref, rref, &loop->reverse[0]);
+
if (nDepend == 1)
break;
#if 0
@@ -3561,7 +3534,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
void
gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
{
- int n;
+ int n, dim, spec_dim;
gfc_ss_info *info;
gfc_ss_info *specinfo;
gfc_ss *ss;
@@ -3577,14 +3550,34 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
loopspec[n] = NULL;
dynamic[n] = false;
/* We use one SS term, and use that to determine the bounds of the
- loop for this dimension. We try to pick the simplest term. */
+ loop for this dimension. We try to pick the simplest term. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
{
+ if (ss->type == GFC_SS_SCALAR || ss->type == GFC_SS_REFERENCE)
+ continue;
+
+ info = &ss->data.info;
+ dim = info->dim[n];
+
+ if (loopspec[n] != NULL)
+ {
+ specinfo = &loopspec[n]->data.info;
+ spec_dim = specinfo->dim[n];
+ }
+ else
+ {
+ /* Silence unitialized warnings. */
+ specinfo = NULL;
+ spec_dim = 0;
+ }
+
if (ss->shape)
{
+ gcc_assert (ss->shape[dim]);
/* The frontend has worked out the size for us. */
- if (!loopspec[n] || !loopspec[n]->shape
- || !integer_zerop (loopspec[n]->data.info.start[n]))
+ if (!loopspec[n]
+ || !loopspec[n]->shape
+ || !integer_zerop (specinfo->start[spec_dim]))
/* Prefer zero-based descriptors if possible. */
loopspec[n] = ss;
continue;
@@ -3611,22 +3604,16 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
/* TODO: Pick the best bound if we have a choice between a
function and something else. */
- if (ss->type == GFC_SS_FUNCTION)
- {
- loopspec[n] = ss;
- continue;
- }
+ if (ss->type == GFC_SS_FUNCTION)
+ {
+ loopspec[n] = ss;
+ continue;
+ }
if (ss->type != GFC_SS_SECTION)
continue;
- if (loopspec[n])
- specinfo = &loopspec[n]->data.info;
- else
- specinfo = NULL;
- info = &ss->data.info;
-
- if (!specinfo)
+ if (!loopspec[n])
loopspec[n] = ss;
/* Criteria for choosing a loop specifier (most important first):
doesn't need realloc
@@ -3637,14 +3624,14 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
*/
else if (loopspec[n]->type == GFC_SS_CONSTRUCTOR && dynamic[n])
loopspec[n] = ss;
- else if (integer_onep (info->stride[n])
- && !integer_onep (specinfo->stride[n]))
+ else if (integer_onep (info->stride[dim])
+ && !integer_onep (specinfo->stride[spec_dim]))
loopspec[n] = ss;
- else if (INTEGER_CST_P (info->stride[n])
- && !INTEGER_CST_P (specinfo->stride[n]))
+ else if (INTEGER_CST_P (info->stride[dim])
+ && !INTEGER_CST_P (specinfo->stride[spec_dim]))
loopspec[n] = ss;
- else if (INTEGER_CST_P (info->start[n])
- && !INTEGER_CST_P (specinfo->start[n]))
+ else if (INTEGER_CST_P (info->start[dim])
+ && !INTEGER_CST_P (specinfo->start[spec_dim]))
loopspec[n] = ss;
/* We don't work out the upper bound.
else if (INTEGER_CST_P (info->finish[n])
@@ -3657,26 +3644,27 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
gcc_assert (loopspec[n]);
info = &loopspec[n]->data.info;
+ dim = info->dim[n];
/* Set the extents of this range. */
cshape = loopspec[n]->shape;
- if (cshape && INTEGER_CST_P (info->start[n])
- && INTEGER_CST_P (info->stride[n]))
+ if (cshape && INTEGER_CST_P (info->start[dim])
+ && INTEGER_CST_P (info->stride[dim]))
{
- loop->from[n] = info->start[n];
+ loop->from[n] = info->start[dim];
mpz_set (i, cshape[n]);
mpz_sub_ui (i, i, 1);
/* To = from + (size - 1) * stride. */
tmp = gfc_conv_mpz_to_tree (i, gfc_index_integer_kind);
- if (!integer_onep (info->stride[n]))
+ if (!integer_onep (info->stride[dim]))
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
- tmp, info->stride[n]);
+ tmp, info->stride[dim]);
loop->to[n] = fold_build2 (PLUS_EXPR, gfc_array_index_type,
loop->from[n], tmp);
}
else
{
- loop->from[n] = info->start[n];
+ loop->from[n] = info->start[dim];
switch (loopspec[n]->type)
{
case GFC_SS_CONSTRUCTOR:
@@ -3688,17 +3676,13 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
case GFC_SS_SECTION:
/* Use the end expression if it exists and is not constant,
so that it is only evaluated once. */
- if (info->end[n] && !INTEGER_CST_P (info->end[n]))
- loop->to[n] = info->end[n];
- else
- loop->to[n] = gfc_conv_section_upper_bound (loopspec[n], n,
- &loop->pre);
+ loop->to[n] = info->end[dim];
break;
- case GFC_SS_FUNCTION:
+ case GFC_SS_FUNCTION:
/* The loop bound will be set when we generate the call. */
- gcc_assert (loop->to[n] == NULL_TREE);
- break;
+ gcc_assert (loop->to[n] == NULL_TREE);
+ break;
default:
gcc_unreachable ();
@@ -3706,20 +3690,20 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
}
/* Transform everything so we have a simple incrementing variable. */
- if (integer_onep (info->stride[n]))
- info->delta[n] = gfc_index_zero_node;
+ if (integer_onep (info->stride[dim]))
+ info->delta[dim] = gfc_index_zero_node;
else
{
/* Set the delta for this section. */
- info->delta[n] = gfc_evaluate_now (loop->from[n], &loop->pre);
+ info->delta[dim] = gfc_evaluate_now (loop->from[n], &loop->pre);
/* Number of iterations is (end - start + step) / step.
with start = 0, this simplifies to
last = end / step;
for (i = 0; i<=last; i++){...}; */
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
loop->to[n], loop->from[n]);
- tmp = fold_build2 (FLOOR_DIV_EXPR, gfc_array_index_type,
- tmp, info->stride[n]);
+ tmp = fold_build2 (FLOOR_DIV_EXPR, gfc_array_index_type,
+ tmp, info->stride[dim]);
tmp = fold_build2 (MAX_EXPR, gfc_array_index_type, tmp,
build_int_cst (gfc_array_index_type, -1));
loop->to[n] = gfc_evaluate_now (tmp, &loop->pre);
@@ -3780,18 +3764,20 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
/* If we are specifying the range the delta is already set. */
if (loopspec[n] != ss)
{
+ dim = ss->data.info.dim[n];
+
/* Calculate the offset relative to the loop variable.
- First multiply by the stride. */
+ First multiply by the stride. */
tmp = loop->from[n];
- if (!integer_onep (info->stride[n]))
+ if (!integer_onep (info->stride[dim]))
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
- tmp, info->stride[n]);
+ tmp, info->stride[dim]);
/* Then subtract this from our starting value. */
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
- info->start[n], tmp);
+ info->start[dim], tmp);
- info->delta[n] = gfc_evaluate_now (tmp, &loop->pre);
+ info->delta[dim] = gfc_evaluate_now (tmp, &loop->pre);
}
}
}
@@ -4313,10 +4299,11 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
/* Generate code to initialize/allocate an array variable. */
-tree
-gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
+void
+gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym,
+ gfc_wrapped_block * block)
{
- stmtblock_t block;
+ stmtblock_t init;
tree type;
tree tmp;
tree size;
@@ -4327,32 +4314,32 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
/* Do nothing for USEd variables. */
if (sym->attr.use_assoc)
- return fnbody;
+ return;
type = TREE_TYPE (decl);
gcc_assert (GFC_ARRAY_TYPE_P (type));
onstack = TREE_CODE (type) != POINTER_TYPE;
- gfc_start_block (&block);
+ gfc_start_block (&init);
/* Evaluate character string length. */
if (sym->ts.type == BT_CHARACTER
&& onstack && !INTEGER_CST_P (sym->ts.u.cl->backend_decl))
{
- gfc_conv_string_length (sym->ts.u.cl, NULL, &block);
+ gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
- gfc_trans_vla_type_sizes (sym, &block);
+ gfc_trans_vla_type_sizes (sym, &init);
/* Emit a DECL_EXPR for this variable, which will cause the
gimplifier to allocate storage, and all that good stuff. */
tmp = fold_build1 (DECL_EXPR, TREE_TYPE (decl), decl);
- gfc_add_expr_to_block (&block, tmp);
+ gfc_add_expr_to_block (&init, tmp);
}
if (onstack)
{
- gfc_add_expr_to_block (&block, fnbody);
- return gfc_finish_block (&block);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
+ return;
}
type = TREE_TYPE (type);
@@ -4363,17 +4350,18 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.u.cl->backend_decl))
- gfc_conv_string_length (sym->ts.u.cl, NULL, &block);
+ gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
- size = gfc_trans_array_bounds (type, sym, &offset, &block);
+ size = gfc_trans_array_bounds (type, sym, &offset, &init);
/* Don't actually allocate space for Cray Pointees. */
if (sym->attr.cray_pointee)
{
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
- gfc_add_expr_to_block (&block, fnbody);
- return gfc_finish_block (&block);
+ gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
+
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
+ return;
}
/* The size is the number of elements in the array, so multiply by the
@@ -4383,31 +4371,27 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
fold_convert (gfc_array_index_type, tmp));
/* Allocate memory to hold the data. */
- tmp = gfc_call_malloc (&block, TREE_TYPE (decl), size);
- gfc_add_modify (&block, decl, tmp);
+ tmp = gfc_call_malloc (&init, TREE_TYPE (decl), size);
+ gfc_add_modify (&init, decl, tmp);
/* Set offset of the array. */
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
-
+ gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
/* Automatic arrays should not have initializers. */
gcc_assert (!sym->value);
- gfc_add_expr_to_block (&block, fnbody);
-
/* Free the temporary. */
tmp = gfc_call_free (convert (pvoid_type_node, decl));
- gfc_add_expr_to_block (&block, tmp);
- return gfc_finish_block (&block);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp);
}
/* Generate entry and exit code for g77 calling convention arrays. */
-tree
-gfc_trans_g77_array (gfc_symbol * sym, tree body)
+void
+gfc_trans_g77_array (gfc_symbol * sym, gfc_wrapped_block * block)
{
tree parm;
tree type;
@@ -4415,7 +4399,7 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body)
tree offset;
tree tmp;
tree stmt;
- stmtblock_t block;
+ stmtblock_t init;
gfc_get_backend_locus (&loc);
gfc_set_backend_locus (&sym->declared_at);
@@ -4425,31 +4409,29 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body)
type = TREE_TYPE (parm);
gcc_assert (GFC_ARRAY_TYPE_P (type));
- gfc_start_block (&block);
+ gfc_start_block (&init);
if (sym->ts.type == BT_CHARACTER
&& TREE_CODE (sym->ts.u.cl->backend_decl) == VAR_DECL)
- gfc_conv_string_length (sym->ts.u.cl, NULL, &block);
+ gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
/* Evaluate the bounds of the array. */
- gfc_trans_array_bounds (type, sym, &offset, &block);
+ gfc_trans_array_bounds (type, sym, &offset, &init);
/* Set the offset. */
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
+ gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
/* Set the pointer itself if we aren't using the parameter directly. */
if (TREE_CODE (parm) != PARM_DECL)
{
tmp = convert (TREE_TYPE (parm), GFC_DECL_SAVED_DESCRIPTOR (parm));
- gfc_add_modify (&block, parm, tmp);
+ gfc_add_modify (&init, parm, tmp);
}
- stmt = gfc_finish_block (&block);
+ stmt = gfc_finish_block (&init);
gfc_set_backend_locus (&loc);
- gfc_start_block (&block);
-
/* Add the initialization code to the start of the function. */
if (sym->attr.optional || sym->attr.not_always_present)
@@ -4458,10 +4440,7 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body)
stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location));
}
- gfc_add_expr_to_block (&block, stmt);
- gfc_add_expr_to_block (&block, body);
-
- return gfc_finish_block (&block);
+ gfc_add_init_cleanup (block, stmt, NULL_TREE);
}
@@ -4476,22 +4455,22 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body)
Code is also added to copy the data back at the end of the function.
*/
-tree
-gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
+void
+gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc,
+ gfc_wrapped_block * block)
{
tree size;
tree type;
tree offset;
locus loc;
- stmtblock_t block;
- stmtblock_t cleanup;
+ stmtblock_t init;
+ tree stmtInit, stmtCleanup;
tree lbound;
tree ubound;
tree dubound;
tree dlbound;
tree dumdesc;
tree tmp;
- tree stmt;
tree stride, stride2;
tree stmt_packed;
tree stmt_unpacked;
@@ -4504,10 +4483,13 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
/* Do nothing for pointer and allocatable arrays. */
if (sym->attr.pointer || sym->attr.allocatable)
- return body;
+ return;
if (sym->attr.dummy && gfc_is_nodesc_array (sym))
- return gfc_trans_g77_array (sym, body);
+ {
+ gfc_trans_g77_array (sym, block);
+ return;
+ }
gfc_get_backend_locus (&loc);
gfc_set_backend_locus (&sym->declared_at);
@@ -4516,35 +4498,32 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
type = TREE_TYPE (tmpdesc);
gcc_assert (GFC_ARRAY_TYPE_P (type));
dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
- dumdesc = build_fold_indirect_ref_loc (input_location,
- dumdesc);
- gfc_start_block (&block);
+ dumdesc = build_fold_indirect_ref_loc (input_location, dumdesc);
+ gfc_start_block (&init);
if (sym->ts.type == BT_CHARACTER
&& TREE_CODE (sym->ts.u.cl->backend_decl) == VAR_DECL)
- gfc_conv_string_length (sym->ts.u.cl, NULL, &block);
+ gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
checkparm = (sym->as->type == AS_EXPLICIT
&& (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS));
no_repack = !(GFC_DECL_PACKED_ARRAY (tmpdesc)
- || GFC_DECL_PARTIAL_PACKED_ARRAY (tmpdesc));
+ || GFC_DECL_PARTIAL_PACKED_ARRAY (tmpdesc));
if (GFC_DECL_PARTIAL_PACKED_ARRAY (tmpdesc))
{
/* For non-constant shape arrays we only check if the first dimension
- is contiguous. Repacking higher dimensions wouldn't gain us
- anything as we still don't know the array stride. */
+ is contiguous. Repacking higher dimensions wouldn't gain us
+ anything as we still don't know the array stride. */
partial = gfc_create_var (boolean_type_node, "partial");
TREE_USED (partial) = 1;
tmp = gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[0]);
tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, gfc_index_one_node);
- gfc_add_modify (&block, partial, tmp);
+ gfc_add_modify (&init, partial, tmp);
}
else
- {
- partial = NULL_TREE;
- }
+ partial = NULL_TREE;
/* The naming of stmt_unpacked and stmt_packed may be counter-intuitive
here, however I think it does the right thing. */
@@ -4552,14 +4531,14 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
{
/* Set the first stride. */
stride = gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[0]);
- stride = gfc_evaluate_now (stride, &block);
+ stride = gfc_evaluate_now (stride, &init);
tmp = fold_build2 (EQ_EXPR, boolean_type_node,
stride, gfc_index_zero_node);
tmp = fold_build3 (COND_EXPR, gfc_array_index_type, tmp,
gfc_index_one_node, stride);
stride = GFC_TYPE_ARRAY_STRIDE (type, 0);
- gfc_add_modify (&block, stride, tmp);
+ gfc_add_modify (&init, stride, tmp);
/* Allow the user to disable array repacking. */
stmt_unpacked = NULL_TREE;
@@ -4594,7 +4573,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
}
else
tmp = stmt_packed != NULL_TREE ? stmt_packed : stmt_unpacked;
- gfc_add_modify (&block, tmpdesc, fold_convert (type, tmp));
+ gfc_add_modify (&init, tmpdesc, fold_convert (type, tmp));
offset = gfc_index_zero_node;
size = gfc_index_one_node;
@@ -4609,34 +4588,34 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
dlbound = gfc_conv_descriptor_lbound_get (dumdesc, gfc_rank_cst[n]);
}
else
- {
+ {
dubound = NULL_TREE;
dlbound = NULL_TREE;
- }
+ }
lbound = GFC_TYPE_ARRAY_LBOUND (type, n);
if (!INTEGER_CST_P (lbound))
- {
- gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, sym->as->lower[n],
- gfc_array_index_type);
- gfc_add_block_to_block (&block, &se.pre);
- gfc_add_modify (&block, lbound, se.expr);
- }
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_type (&se, sym->as->lower[n],
+ gfc_array_index_type);
+ gfc_add_block_to_block (&init, &se.pre);
+ gfc_add_modify (&init, lbound, se.expr);
+ }
ubound = GFC_TYPE_ARRAY_UBOUND (type, n);
/* Set the desired upper bound. */
if (sym->as->upper[n])
{
/* We know what we want the upper bound to be. */
- if (!INTEGER_CST_P (ubound))
- {
+ if (!INTEGER_CST_P (ubound))
+ {
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, sym->as->upper[n],
- gfc_array_index_type);
- gfc_add_block_to_block (&block, &se.pre);
- gfc_add_modify (&block, ubound, se.expr);
- }
+ gfc_array_index_type);
+ gfc_add_block_to_block (&init, &se.pre);
+ gfc_add_modify (&init, ubound, se.expr);
+ }
/* Check the sizes match. */
if (checkparm)
@@ -4655,11 +4634,11 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
stride2 = fold_build2 (PLUS_EXPR, gfc_array_index_type,
gfc_index_one_node, stride2);
- tmp = fold_build2 (NE_EXPR, gfc_array_index_type, temp, stride2);
+ tmp = fold_build2 (NE_EXPR, gfc_array_index_type, temp, stride2);
asprintf (&msg, "Dimension %d of array '%s' has extent "
- "%%ld instead of %%ld", n+1, sym->name);
+ "%%ld instead of %%ld", n+1, sym->name);
- gfc_trans_runtime_check (true, false, tmp, &block, &loc, msg,
+ gfc_trans_runtime_check (true, false, tmp, &init, &loc, msg,
fold_convert (long_integer_type_node, temp),
fold_convert (long_integer_type_node, stride2));
@@ -4670,10 +4649,10 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
{
/* For assumed shape arrays move the upper bound by the same amount
as the lower bound. */
- tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
+ tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
dubound, dlbound);
- tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, lbound);
- gfc_add_modify (&block, ubound, tmp);
+ tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, lbound);
+ gfc_add_modify (&init, ubound, tmp);
}
/* The offset of this dimension. offset = offset - lbound * stride. */
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, lbound, stride);
@@ -4681,41 +4660,39 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
/* The size of this dimension, and the stride of the next. */
if (n + 1 < sym->as->rank)
- {
- stride = GFC_TYPE_ARRAY_STRIDE (type, n + 1);
+ {
+ stride = GFC_TYPE_ARRAY_STRIDE (type, n + 1);
- if (no_repack || partial != NULL_TREE)
- {
- stmt_unpacked =
- gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[n+1]);
- }
+ if (no_repack || partial != NULL_TREE)
+ stmt_unpacked =
+ gfc_conv_descriptor_stride_get (dumdesc, gfc_rank_cst[n+1]);
- /* Figure out the stride if not a known constant. */
- if (!INTEGER_CST_P (stride))
- {
- if (no_repack)
- stmt_packed = NULL_TREE;
- else
- {
- /* Calculate stride = size * (ubound + 1 - lbound). */
- tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
+ /* Figure out the stride if not a known constant. */
+ if (!INTEGER_CST_P (stride))
+ {
+ if (no_repack)
+ stmt_packed = NULL_TREE;
+ else
+ {
+ /* Calculate stride = size * (ubound + 1 - lbound). */
+ tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
gfc_index_one_node, lbound);
- tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
+ tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
ubound, tmp);
- size = fold_build2 (MULT_EXPR, gfc_array_index_type,
+ size = fold_build2 (MULT_EXPR, gfc_array_index_type,
size, tmp);
- stmt_packed = size;
- }
+ stmt_packed = size;
+ }
- /* Assign the stride. */
- if (stmt_packed != NULL_TREE && stmt_unpacked != NULL_TREE)
+ /* Assign the stride. */
+ if (stmt_packed != NULL_TREE && stmt_unpacked != NULL_TREE)
tmp = fold_build3 (COND_EXPR, gfc_array_index_type, partial,
stmt_unpacked, stmt_packed);
- else
- tmp = (stmt_packed != NULL_TREE) ? stmt_packed : stmt_unpacked;
- gfc_add_modify (&block, stride, tmp);
- }
- }
+ else
+ tmp = (stmt_packed != NULL_TREE) ? stmt_packed : stmt_unpacked;
+ gfc_add_modify (&init, stride, tmp);
+ }
+ }
else
{
stride = GFC_TYPE_ARRAY_SIZE (type);
@@ -4729,20 +4706,18 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
ubound, tmp);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
GFC_TYPE_ARRAY_STRIDE (type, n), tmp);
- gfc_add_modify (&block, stride, tmp);
+ gfc_add_modify (&init, stride, tmp);
}
}
}
/* Set the offset. */
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
-
- gfc_trans_vla_type_sizes (sym, &block);
+ gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
- stmt = gfc_finish_block (&block);
+ gfc_trans_vla_type_sizes (sym, &init);
- gfc_start_block (&block);
+ stmtInit = gfc_finish_block (&init);
/* Only do the entry/initialization code if the arg is present. */
dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc);
@@ -4752,18 +4727,18 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
if (optional_arg)
{
tmp = gfc_conv_expr_present (sym);
- stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location));
+ stmtInit = build3_v (COND_EXPR, tmp, stmtInit,
+ build_empty_stmt (input_location));
}
- gfc_add_expr_to_block (&block, stmt);
-
- /* Add the main function body. */
- gfc_add_expr_to_block (&block, body);
/* Cleanup code. */
- if (!no_repack)
+ if (no_repack)
+ stmtCleanup = NULL_TREE;
+ else
{
+ stmtblock_t cleanup;
gfc_start_block (&cleanup);
-
+
if (sym->attr.intent != INTENT_IN)
{
/* Copy the data back. */
@@ -4776,26 +4751,26 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
tmp = gfc_call_free (tmpdesc);
gfc_add_expr_to_block (&cleanup, tmp);
- stmt = gfc_finish_block (&cleanup);
+ stmtCleanup = gfc_finish_block (&cleanup);
/* Only do the cleanup if the array was repacked. */
- tmp = build_fold_indirect_ref_loc (input_location,
- dumdesc);
+ tmp = build_fold_indirect_ref_loc (input_location, dumdesc);
tmp = gfc_conv_descriptor_data_get (tmp);
tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp, tmpdesc);
- stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location));
+ stmtCleanup = build3_v (COND_EXPR, tmp, stmtCleanup,
+ build_empty_stmt (input_location));
if (optional_arg)
- {
- tmp = gfc_conv_expr_present (sym);
- stmt = build3_v (COND_EXPR, tmp, stmt,
- build_empty_stmt (input_location));
- }
- gfc_add_expr_to_block (&block, stmt);
+ {
+ tmp = gfc_conv_expr_present (sym);
+ stmtCleanup = build3_v (COND_EXPR, tmp, stmtCleanup,
+ build_empty_stmt (input_location));
+ }
}
+
/* We don't need to free any memory allocated by internal_pack as it will
be freed at the end of the function by pop_context. */
- return gfc_finish_block (&block);
+ gfc_add_init_cleanup (block, stmtInit, stmtCleanup);
}
@@ -5355,7 +5330,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
gcc_assert (info->dim[dim] == n);
/* Evaluate and remember the start of the section. */
- start = info->start[dim];
+ start = info->start[n];
stride = gfc_evaluate_now (stride, &loop.pre);
}
@@ -5402,11 +5377,11 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* Multiply the stride by the section stride to get the
total stride. */
stride = fold_build2 (MULT_EXPR, gfc_array_index_type,
- stride, info->stride[dim]);
+ stride, info->stride[n]);
if (se->direct_byref
- && info->ref
- && info->ref->u.ar.type != AR_FULL)
+ && info->ref
+ && info->ref->u.ar.type != AR_FULL)
{
base = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
base, stride);
@@ -6265,13 +6240,14 @@ gfc_copy_only_alloc_comp (gfc_symbol * der_type, tree decl, tree dest, int rank)
Do likewise, recursively if necessary, with the allocatable components of
derived types. */
-tree
-gfc_trans_deferred_array (gfc_symbol * sym, tree body)
+void
+gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
{
tree type;
tree tmp;
tree descriptor;
- stmtblock_t fnblock;
+ stmtblock_t init;
+ stmtblock_t cleanup;
locus loc;
int rank;
bool sym_has_alloc_comp;
@@ -6285,7 +6261,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
"allocatable attribute or derived type without allocatable "
"components.");
- gfc_init_block (&fnblock);
+ gfc_init_block (&init);
gcc_assert (TREE_CODE (sym->backend_decl) == VAR_DECL
|| TREE_CODE (sym->backend_decl) == PARM_DECL);
@@ -6293,16 +6269,15 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.u.cl->backend_decl))
{
- gfc_conv_string_length (sym->ts.u.cl, NULL, &fnblock);
- gfc_trans_vla_type_sizes (sym, &fnblock);
+ gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
+ gfc_trans_vla_type_sizes (sym, &init);
}
/* Dummy, use associated and result variables don't need anything special. */
if (sym->attr.dummy || sym->attr.use_assoc || sym->attr.result)
{
- gfc_add_expr_to_block (&fnblock, body);
-
- return gfc_finish_block (&fnblock);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
+ return;
}
gfc_get_backend_locus (&loc);
@@ -6316,7 +6291,9 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
{
/* SAVEd variables are not freed on exit. */
gfc_trans_static_array_pointer (sym);
- return body;
+
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
+ return;
}
/* Get the descriptor type. */
@@ -6331,14 +6308,12 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
|| !gfc_has_default_initializer (sym->ts.u.derived))
{
rank = sym->as ? sym->as->rank : 0;
- tmp = gfc_nullify_alloc_comp (sym->ts.u.derived, descriptor, rank);
- gfc_add_expr_to_block (&fnblock, tmp);
+ tmp = gfc_nullify_alloc_comp (sym->ts.u.derived,
+ descriptor, rank);
+ gfc_add_expr_to_block (&init, tmp);
}
else
- {
- tmp = gfc_init_default_dt (sym, NULL, false);
- gfc_add_expr_to_block (&fnblock, tmp);
- }
+ gfc_init_default_dt (sym, &init, false);
}
}
else if (!GFC_DESCRIPTOR_TYPE_P (type))
@@ -6346,16 +6321,15 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
/* If the backend_decl is not a descriptor, we must have a pointer
to one. */
descriptor = build_fold_indirect_ref_loc (input_location,
- sym->backend_decl);
+ sym->backend_decl);
type = TREE_TYPE (descriptor);
}
/* NULLIFY the data pointer. */
if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save)
- gfc_conv_descriptor_data_set (&fnblock, descriptor, null_pointer_node);
-
- gfc_add_expr_to_block (&fnblock, body);
+ gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node);
+ gfc_init_block (&cleanup);
gfc_set_backend_locus (&loc);
/* Allocatable arrays need to be freed when they go out of scope.
@@ -6366,17 +6340,18 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
int rank;
rank = sym->as ? sym->as->rank : 0;
tmp = gfc_deallocate_alloc_comp (sym->ts.u.derived, descriptor, rank);
- gfc_add_expr_to_block (&fnblock, tmp);
+ gfc_add_expr_to_block (&cleanup, tmp);
}
if (sym->attr.allocatable && sym->attr.dimension
&& !sym->attr.save && !sym->attr.result)
{
tmp = gfc_trans_dealloc_allocated (sym->backend_decl);
- gfc_add_expr_to_block (&fnblock, tmp);
+ gfc_add_expr_to_block (&cleanup, tmp);
}
- return gfc_finish_block (&fnblock);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init),
+ gfc_finish_block (&cleanup));
}
/************ Expression Walking Functions ******************/
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h
index 44256fb86f4..2e491c8c16b 100644
--- a/gcc/fortran/trans-array.h
+++ b/gcc/fortran/trans-array.h
@@ -37,11 +37,11 @@ tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *,
/* Generate function entry code for allocation of compiler allocated array
variables. */
-tree gfc_trans_auto_array_allocation (tree, gfc_symbol *, tree);
+void gfc_trans_auto_array_allocation (tree, gfc_symbol *, gfc_wrapped_block *);
/* Generate entry and exit code for dummy array parameters. */
-tree gfc_trans_dummy_array_bias (gfc_symbol *, tree, tree);
+void gfc_trans_dummy_array_bias (gfc_symbol *, tree, gfc_wrapped_block *);
/* Generate entry and exit code for g77 calling convention arrays. */
-tree gfc_trans_g77_array (gfc_symbol *, tree);
+void gfc_trans_g77_array (gfc_symbol *, gfc_wrapped_block *);
/* Generate code to deallocate an array, if it is allocated. */
tree gfc_trans_dealloc_allocated (tree);
@@ -58,7 +58,7 @@ tree gfc_copy_alloc_comp (gfc_symbol *, tree, tree, int);
tree gfc_copy_only_alloc_comp (gfc_symbol *, tree, tree, int);
/* Add initialization for deferred arrays. */
-tree gfc_trans_deferred_array (gfc_symbol *, tree);
+void gfc_trans_deferred_array (gfc_symbol *, gfc_wrapped_block *);
/* Generate an initializer for a static pointer or allocatable array. */
void gfc_trans_static_array_pointer (gfc_symbol *);
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 1162636fe5a..a19facb8317 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -432,7 +432,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
what C will do. */
tree field = NULL_TREE;
field = TYPE_FIELDS (TREE_TYPE (decl));
- if (TREE_CHAIN (field) == NULL_TREE)
+ if (DECL_CHAIN (field) == NULL_TREE)
DECL_ALIGN (decl) = TYPE_ALIGN (TREE_TYPE (field));
}
DECL_USER_ALIGN (decl) = 0;
@@ -608,7 +608,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
{
is_init = true;
*field_link = field;
- field_link = &TREE_CHAIN (field);
+ field_link = &DECL_CHAIN (field);
}
for (s = head; s; s = s->next)
@@ -617,7 +617,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
/* Link the field into the type. */
*field_link = s->field;
- field_link = &TREE_CHAIN (s->field);
+ field_link = &DECL_CHAIN (s->field);
/* Has initial value. */
if (s->sym->value)
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 6d4f222ede6..8cd4fda6d8d 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tree.h"
#include "realmpfr.h"
-#include "toplev.h" /* For fatal_error. */
+#include "diagnostic-core.h" /* For fatal_error. */
#include "double-int.h"
#include "gfortran.h"
#include "trans.h"
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 1c7226c41e6..2b030110231 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -29,7 +29,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "gimple.h" /* For create_tmp_var_raw. */
#include "ggc.h"
-#include "toplev.h" /* For announce_function/internal_error. */
+#include "diagnostic-core.h" /* For internal_error. */
+#include "toplev.h" /* For announce_function. */
#include "output.h" /* For decl_default_tls_model. */
#include "target.h"
#include "function.h"
@@ -54,8 +55,6 @@ along with GCC; see the file COPYING3. If not see
static GTY(()) tree current_fake_result_decl;
static GTY(()) tree parent_fake_result_decl;
-static GTY(()) tree current_function_return_label;
-
/* Holds the variable DECLs for the current function. */
@@ -74,6 +73,9 @@ static GTY(()) tree saved_local_decls;
static gfc_namespace *module_namespace;
+/* The currently processed procedure symbol. */
+static gfc_symbol* current_procedure_symbol = NULL;
+
/* List of static constructor functions. */
@@ -173,7 +175,7 @@ gfc_add_decl_to_parent_function (tree decl)
gcc_assert (decl);
DECL_CONTEXT (decl) = DECL_CONTEXT (current_function_decl);
DECL_NONLOCAL (decl) = 1;
- TREE_CHAIN (decl) = saved_parent_function_decls;
+ DECL_CHAIN (decl) = saved_parent_function_decls;
saved_parent_function_decls = decl;
}
@@ -183,7 +185,7 @@ gfc_add_decl_to_function (tree decl)
gcc_assert (decl);
TREE_USED (decl) = 1;
DECL_CONTEXT (decl) = current_function_decl;
- TREE_CHAIN (decl) = saved_function_decls;
+ DECL_CHAIN (decl) = saved_function_decls;
saved_function_decls = decl;
}
@@ -193,7 +195,7 @@ add_decl_as_local (tree decl)
gcc_assert (decl);
TREE_USED (decl) = 1;
DECL_CONTEXT (decl) = current_function_decl;
- TREE_CHAIN (decl) = saved_local_decls;
+ DECL_CHAIN (decl) = saved_local_decls;
saved_local_decls = decl;
}
@@ -236,28 +238,6 @@ gfc_build_label_decl (tree label_id)
}
-/* Returns the return label for the current function. */
-
-tree
-gfc_get_return_label (void)
-{
- char name[GFC_MAX_SYMBOL_LEN + 10];
-
- if (current_function_return_label)
- return current_function_return_label;
-
- sprintf (name, "__return_%s",
- IDENTIFIER_POINTER (DECL_NAME (current_function_decl)));
-
- current_function_return_label =
- gfc_build_label_decl (get_identifier (name));
-
- DECL_ARTIFICIAL (current_function_return_label) = 1;
-
- return current_function_return_label;
-}
-
-
/* Set the backend source location of a decl. */
void
@@ -779,16 +759,16 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
gtype = build_array_type (gtype, rtype);
/* Ensure the bound variables aren't optimized out at -O0.
For -O1 and above they often will be optimized out, but
- can be tracked by VTA. Also clear the artificial
- lbound.N or ubound.N DECL_NAME, so that it doesn't end up
- in debug info. */
+ can be tracked by VTA. Also set DECL_NAMELESS, so that
+ the artificial lbound.N or ubound.N DECL_NAME doesn't
+ end up in debug info. */
if (lbound && TREE_CODE (lbound) == VAR_DECL
&& DECL_ARTIFICIAL (lbound) && DECL_IGNORED_P (lbound))
{
if (DECL_NAME (lbound)
&& strstr (IDENTIFIER_POINTER (DECL_NAME (lbound)),
"lbound") != 0)
- DECL_NAME (lbound) = NULL_TREE;
+ DECL_NAMELESS (lbound) = 1;
DECL_IGNORED_P (lbound) = 0;
}
if (ubound && TREE_CODE (ubound) == VAR_DECL
@@ -797,7 +777,7 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
if (DECL_NAME (ubound)
&& strstr (IDENTIFIER_POINTER (DECL_NAME (ubound)),
"ubound") != 0)
- DECL_NAME (ubound) = NULL_TREE;
+ DECL_NAMELESS (ubound) = 1;
DECL_IGNORED_P (ubound) = 0;
}
}
@@ -899,6 +879,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy)
VAR_DECL, get_identifier (name), type);
DECL_ARTIFICIAL (decl) = 1;
+ DECL_NAMELESS (decl) = 1;
TREE_PUBLIC (decl) = 0;
TREE_STATIC (decl) = 0;
DECL_EXTERNAL (decl) = 0;
@@ -959,7 +940,7 @@ gfc_nonlocal_dummy_array_decl (gfc_symbol *sym)
SET_DECL_VALUE_EXPR (decl, sym->backend_decl);
DECL_HAS_VALUE_EXPR_P (decl) = 1;
DECL_CONTEXT (decl) = DECL_CONTEXT (sym->backend_decl);
- TREE_CHAIN (decl) = nonlocal_dummy_decls;
+ DECL_CHAIN (decl) = nonlocal_dummy_decls;
nonlocal_dummy_decls = decl;
}
@@ -1076,7 +1057,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
{
gfc_component *c = CLASS_DATA (sym);
if (!c->ts.u.derived->backend_decl)
- gfc_find_derived_vtab (c->ts.u.derived, true);
+ gfc_find_derived_vtab (c->ts.u.derived);
}
if ((sym->attr.dummy && ! sym->attr.function) || (sym->attr.result && byref))
@@ -1090,7 +1071,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
/* For entry master function skip over the __entry
argument. */
if (sym->ns->proc_name->attr.entry_master)
- sym->backend_decl = TREE_CHAIN (sym->backend_decl);
+ sym->backend_decl = DECL_CHAIN (sym->backend_decl);
}
/* Dummy variables should already have been created. */
@@ -1980,8 +1961,6 @@ build_entry_thunks (gfc_namespace * ns)
gfc_symbol *thunk_sym;
stmtblock_t body;
tree thunk_fndecl;
- tree args;
- tree string_args;
tree tmp;
locus old_loc;
@@ -1991,6 +1970,9 @@ build_entry_thunks (gfc_namespace * ns)
gfc_get_backend_locus (&old_loc);
for (el = ns->entries; el; el = el->next)
{
+ VEC(tree,gc) *args = NULL;
+ VEC(tree,gc) *string_args = NULL;
+
thunk_sym = el->sym;
build_function_decl (thunk_sym);
@@ -2004,18 +1986,16 @@ build_entry_thunks (gfc_namespace * ns)
/* Pass extra parameter identifying this entry point. */
tmp = build_int_cst (gfc_array_index_type, el->id);
- args = tree_cons (NULL_TREE, tmp, NULL_TREE);
- string_args = NULL_TREE;
+ VEC_safe_push (tree, gc, args, tmp);
if (thunk_sym->attr.function)
{
if (gfc_return_by_reference (ns->proc_name))
{
tree ref = DECL_ARGUMENTS (current_function_decl);
- args = tree_cons (NULL_TREE, ref, args);
+ VEC_safe_push (tree, gc, args, ref);
if (ns->proc_name->ts.type == BT_CHARACTER)
- args = tree_cons (NULL_TREE, TREE_CHAIN (ref),
- args);
+ VEC_safe_push (tree, gc, args, DECL_CHAIN (ref));
}
}
@@ -2039,31 +2019,29 @@ build_entry_thunks (gfc_namespace * ns)
{
/* Pass the argument. */
DECL_ARTIFICIAL (thunk_formal->sym->backend_decl) = 1;
- args = tree_cons (NULL_TREE, thunk_formal->sym->backend_decl,
- args);
+ VEC_safe_push (tree, gc, args, thunk_formal->sym->backend_decl);
if (formal->sym->ts.type == BT_CHARACTER)
{
tmp = thunk_formal->sym->ts.u.cl->backend_decl;
- string_args = tree_cons (NULL_TREE, tmp, string_args);
+ VEC_safe_push (tree, gc, string_args, tmp);
}
}
else
{
/* Pass NULL for a missing argument. */
- args = tree_cons (NULL_TREE, null_pointer_node, args);
+ VEC_safe_push (tree, gc, args, null_pointer_node);
if (formal->sym->ts.type == BT_CHARACTER)
{
tmp = build_int_cst (gfc_charlen_type_node, 0);
- string_args = tree_cons (NULL_TREE, tmp, string_args);
+ VEC_safe_push (tree, gc, string_args, tmp);
}
}
}
/* Call the master function. */
- args = nreverse (args);
- args = chainon (args, nreverse (string_args));
+ VEC_safe_splice (tree, gc, args, string_args);
tmp = ns->proc_name->backend_decl;
- tmp = build_function_call_expr (input_location, tmp, args);
+ tmp = build_call_expr_loc_vec (input_location, tmp, args);
if (ns->proc_name->attr.mixed_entry_master)
{
tree union_decl, field;
@@ -2085,7 +2063,7 @@ build_entry_thunks (gfc_namespace * ns)
gfc_add_expr_to_block (&body, tmp);
for (field = TYPE_FIELDS (TREE_TYPE (union_decl));
- field; field = TREE_CHAIN (field))
+ field; field = DECL_CHAIN (field))
if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)),
thunk_sym->result->name) == 0)
break;
@@ -2221,7 +2199,7 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag)
tree field;
for (field = TYPE_FIELDS (TREE_TYPE (decl));
- field; field = TREE_CHAIN (field))
+ field; field = DECL_CHAIN (field))
if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)),
sym->name) == 0)
break;
@@ -2272,7 +2250,7 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag)
if (sym->ns->proc_name->backend_decl == this_function_decl
&& sym->ns->proc_name->attr.entry_master)
- decl = TREE_CHAIN (decl);
+ decl = DECL_CHAIN (decl);
TREE_USED (decl) = 1;
if (sym->as)
@@ -2387,7 +2365,7 @@ gfc_build_library_function_decl (tree name, tree rettype, int nargs, ...)
The SPEC parameter specifies the function argument and return type
specification according to the fnspec function type attribute. */
-static tree
+tree
gfc_build_library_function_decl_with_spec (tree name, const char *spec,
tree rettype, int nargs, ...)
{
@@ -2410,212 +2388,176 @@ gfc_build_intrinsic_function_decls (void)
tree pchar4_type_node = gfc_get_pchar_type (4);
/* String functions. */
- gfor_fndecl_compare_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("compare_string")),
- integer_type_node, 4,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node);
-
- gfor_fndecl_concat_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("concat_string")),
- void_type_node, 6,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node);
-
- gfor_fndecl_string_len_trim =
- gfc_build_library_function_decl (get_identifier (PREFIX("string_len_trim")),
- gfc_charlen_type_node, 2,
- gfc_charlen_type_node, pchar1_type_node);
-
- gfor_fndecl_string_index =
- gfc_build_library_function_decl (get_identifier (PREFIX("string_index")),
- gfc_charlen_type_node, 5,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_logical4_type_node);
-
- gfor_fndecl_string_scan =
- gfc_build_library_function_decl (get_identifier (PREFIX("string_scan")),
- gfc_charlen_type_node, 5,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_logical4_type_node);
-
- gfor_fndecl_string_verify =
- gfc_build_library_function_decl (get_identifier (PREFIX("string_verify")),
- gfc_charlen_type_node, 5,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node,
- gfc_logical4_type_node);
-
- gfor_fndecl_string_trim =
- gfc_build_library_function_decl (get_identifier (PREFIX("string_trim")),
- void_type_node, 4,
- build_pointer_type (gfc_charlen_type_node),
- build_pointer_type (pchar1_type_node),
- gfc_charlen_type_node, pchar1_type_node);
-
- gfor_fndecl_string_minmax =
- gfc_build_library_function_decl (get_identifier (PREFIX("string_minmax")),
- void_type_node, -4,
- build_pointer_type (gfc_charlen_type_node),
- build_pointer_type (pchar1_type_node),
- integer_type_node, integer_type_node);
-
- gfor_fndecl_adjustl =
- gfc_build_library_function_decl (get_identifier (PREFIX("adjustl")),
- void_type_node, 3, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node);
-
- gfor_fndecl_adjustr =
- gfc_build_library_function_decl (get_identifier (PREFIX("adjustr")),
- void_type_node, 3, pchar1_type_node,
- gfc_charlen_type_node, pchar1_type_node);
-
- gfor_fndecl_select_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("select_string")),
- integer_type_node, 4, pvoid_type_node,
- integer_type_node, pchar1_type_node,
- gfc_charlen_type_node);
-
- gfor_fndecl_compare_string_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("compare_string_char4")),
- integer_type_node, 4,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node);
-
- gfor_fndecl_concat_string_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("concat_string_char4")),
- void_type_node, 6,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node);
-
- gfor_fndecl_string_len_trim_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("string_len_trim_char4")),
- gfc_charlen_type_node, 2,
- gfc_charlen_type_node, pchar4_type_node);
-
- gfor_fndecl_string_index_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("string_index_char4")),
- gfc_charlen_type_node, 5,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_logical4_type_node);
-
- gfor_fndecl_string_scan_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("string_scan_char4")),
- gfc_charlen_type_node, 5,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_logical4_type_node);
-
- gfor_fndecl_string_verify_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("string_verify_char4")),
- gfc_charlen_type_node, 5,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node,
- gfc_logical4_type_node);
-
- gfor_fndecl_string_trim_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("string_trim_char4")),
- void_type_node, 4,
- build_pointer_type (gfc_charlen_type_node),
- build_pointer_type (pchar4_type_node),
- gfc_charlen_type_node, pchar4_type_node);
-
- gfor_fndecl_string_minmax_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("string_minmax_char4")),
- void_type_node, -4,
- build_pointer_type (gfc_charlen_type_node),
- build_pointer_type (pchar4_type_node),
- integer_type_node, integer_type_node);
-
- gfor_fndecl_adjustl_char4 =
- gfc_build_library_function_decl (get_identifier (PREFIX("adjustl_char4")),
- void_type_node, 3, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node);
-
- gfor_fndecl_adjustr_char4 =
- gfc_build_library_function_decl (get_identifier (PREFIX("adjustr_char4")),
- void_type_node, 3, pchar4_type_node,
- gfc_charlen_type_node, pchar4_type_node);
-
- gfor_fndecl_select_string_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("select_string_char4")),
- integer_type_node, 4, pvoid_type_node,
- integer_type_node, pvoid_type_node,
- gfc_charlen_type_node);
+ gfor_fndecl_compare_string = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("compare_string")), "..R.R",
+ integer_type_node, 4, gfc_charlen_type_node, pchar1_type_node,
+ gfc_charlen_type_node, pchar1_type_node);
+ DECL_PURE_P (gfor_fndecl_compare_string) = 1;
+
+ gfor_fndecl_concat_string = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("concat_string")), "..W.R.R",
+ void_type_node, 6, gfc_charlen_type_node, pchar1_type_node,
+ gfc_charlen_type_node, pchar1_type_node,
+ gfc_charlen_type_node, pchar1_type_node);
+
+ gfor_fndecl_string_len_trim = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_len_trim")), "..R",
+ gfc_charlen_type_node, 2, gfc_charlen_type_node, pchar1_type_node);
+ DECL_PURE_P (gfor_fndecl_string_len_trim) = 1;
+
+ gfor_fndecl_string_index = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_index")), "..R.R.",
+ gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar1_type_node,
+ gfc_charlen_type_node, pchar1_type_node, gfc_logical4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_index) = 1;
+
+ gfor_fndecl_string_scan = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_scan")), "..R.R.",
+ gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar1_type_node,
+ gfc_charlen_type_node, pchar1_type_node, gfc_logical4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_scan) = 1;
+
+ gfor_fndecl_string_verify = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_verify")), "..R.R.",
+ gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar1_type_node,
+ gfc_charlen_type_node, pchar1_type_node, gfc_logical4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_verify) = 1;
+
+ gfor_fndecl_string_trim = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_trim")), ".Ww.R",
+ void_type_node, 4, build_pointer_type (gfc_charlen_type_node),
+ build_pointer_type (pchar1_type_node), gfc_charlen_type_node,
+ pchar1_type_node);
+
+ gfor_fndecl_string_minmax = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_minmax")), ".Ww.R",
+ void_type_node, -4, build_pointer_type (gfc_charlen_type_node),
+ build_pointer_type (pchar1_type_node), integer_type_node,
+ integer_type_node);
+
+ gfor_fndecl_adjustl = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("adjustl")), ".W.R",
+ void_type_node, 3, pchar1_type_node, gfc_charlen_type_node,
+ pchar1_type_node);
+
+ gfor_fndecl_adjustr = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("adjustr")), ".W.R",
+ void_type_node, 3, pchar1_type_node, gfc_charlen_type_node,
+ pchar1_type_node);
+
+ gfor_fndecl_select_string = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("select_string")), ".R.R.",
+ integer_type_node, 4, pvoid_type_node, integer_type_node,
+ pchar1_type_node, gfc_charlen_type_node);
+ DECL_PURE_P (gfor_fndecl_select_string) = 1;
+
+ gfor_fndecl_compare_string_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("compare_string_char4")), "..R.R",
+ integer_type_node, 4, gfc_charlen_type_node, pchar4_type_node,
+ gfc_charlen_type_node, pchar4_type_node);
+ DECL_PURE_P (gfor_fndecl_compare_string_char4) = 1;
+
+ gfor_fndecl_concat_string_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("concat_string_char4")), "..W.R.R",
+ void_type_node, 6, gfc_charlen_type_node, pchar4_type_node,
+ gfc_charlen_type_node, pchar4_type_node, gfc_charlen_type_node,
+ pchar4_type_node);
+
+ gfor_fndecl_string_len_trim_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_len_trim_char4")), "..R",
+ gfc_charlen_type_node, 2, gfc_charlen_type_node, pchar4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_len_trim_char4) = 1;
+
+ gfor_fndecl_string_index_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_index_char4")), "..R.R.",
+ gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar4_type_node,
+ gfc_charlen_type_node, pchar4_type_node, gfc_logical4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_index_char4) = 1;
+
+ gfor_fndecl_string_scan_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_scan_char4")), "..R.R.",
+ gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar4_type_node,
+ gfc_charlen_type_node, pchar4_type_node, gfc_logical4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_scan_char4) = 1;
+
+ gfor_fndecl_string_verify_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_verify_char4")), "..R.R.",
+ gfc_charlen_type_node, 5, gfc_charlen_type_node, pchar4_type_node,
+ gfc_charlen_type_node, pchar4_type_node, gfc_logical4_type_node);
+ DECL_PURE_P (gfor_fndecl_string_verify_char4) = 1;
+
+ gfor_fndecl_string_trim_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_trim_char4")), ".Ww.R",
+ void_type_node, 4, build_pointer_type (gfc_charlen_type_node),
+ build_pointer_type (pchar4_type_node), gfc_charlen_type_node,
+ pchar4_type_node);
+
+ gfor_fndecl_string_minmax_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("string_minmax_char4")), ".Ww.R",
+ void_type_node, -4, build_pointer_type (gfc_charlen_type_node),
+ build_pointer_type (pchar4_type_node), integer_type_node,
+ integer_type_node);
+
+ gfor_fndecl_adjustl_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("adjustl_char4")), ".W.R",
+ void_type_node, 3, pchar4_type_node, gfc_charlen_type_node,
+ pchar4_type_node);
+
+ gfor_fndecl_adjustr_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("adjustr_char4")), ".W.R",
+ void_type_node, 3, pchar4_type_node, gfc_charlen_type_node,
+ pchar4_type_node);
+
+ gfor_fndecl_select_string_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("select_string_char4")), ".R.R.",
+ integer_type_node, 4, pvoid_type_node, integer_type_node,
+ pvoid_type_node, gfc_charlen_type_node);
+ DECL_PURE_P (gfor_fndecl_select_string_char4) = 1;
/* Conversion between character kinds. */
- gfor_fndecl_convert_char1_to_char4 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("convert_char1_to_char4")),
- void_type_node, 3,
- build_pointer_type (pchar4_type_node),
- gfc_charlen_type_node, pchar1_type_node);
+ gfor_fndecl_convert_char1_to_char4 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("convert_char1_to_char4")), ".w.R",
+ void_type_node, 3, build_pointer_type (pchar4_type_node),
+ gfc_charlen_type_node, pchar1_type_node);
- gfor_fndecl_convert_char4_to_char1 =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("convert_char4_to_char1")),
- void_type_node, 3,
- build_pointer_type (pchar1_type_node),
- gfc_charlen_type_node, pchar4_type_node);
+ gfor_fndecl_convert_char4_to_char1 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("convert_char4_to_char1")), ".w.R",
+ void_type_node, 3, build_pointer_type (pchar1_type_node),
+ gfc_charlen_type_node, pchar4_type_node);
/* Misc. functions. */
- gfor_fndecl_ttynam =
- gfc_build_library_function_decl (get_identifier (PREFIX("ttynam")),
- void_type_node,
- 3,
- pchar_type_node,
- gfc_charlen_type_node,
- integer_type_node);
-
- gfor_fndecl_fdate =
- gfc_build_library_function_decl (get_identifier (PREFIX("fdate")),
- void_type_node,
- 2,
- pchar_type_node,
- gfc_charlen_type_node);
-
- gfor_fndecl_ctime =
- gfc_build_library_function_decl (get_identifier (PREFIX("ctime")),
- void_type_node,
- 3,
- pchar_type_node,
- gfc_charlen_type_node,
- gfc_int8_type_node);
-
- gfor_fndecl_sc_kind =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("selected_char_kind")),
- gfc_int4_type_node, 2,
- gfc_charlen_type_node, pchar_type_node);
-
- gfor_fndecl_si_kind =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("selected_int_kind")),
- gfc_int4_type_node, 1, pvoid_type_node);
-
- gfor_fndecl_sr_kind =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("selected_real_kind2008")),
- gfc_int4_type_node, 3,
- pvoid_type_node, pvoid_type_node,
- pvoid_type_node);
+ gfor_fndecl_ttynam = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("ttynam")), ".W",
+ void_type_node, 3, pchar_type_node, gfc_charlen_type_node,
+ integer_type_node);
+
+ gfor_fndecl_fdate = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("fdate")), ".W",
+ void_type_node, 2, pchar_type_node, gfc_charlen_type_node);
+
+ gfor_fndecl_ctime = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("ctime")), ".W",
+ void_type_node, 3, pchar_type_node, gfc_charlen_type_node,
+ gfc_int8_type_node);
+
+ gfor_fndecl_sc_kind = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("selected_char_kind")), "..R",
+ gfc_int4_type_node, 2, gfc_charlen_type_node, pchar_type_node);
+ DECL_PURE_P (gfor_fndecl_sc_kind) = 1;
+
+ gfor_fndecl_si_kind = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("selected_int_kind")), ".R",
+ gfc_int4_type_node, 1, pvoid_type_node);
+ DECL_PURE_P (gfor_fndecl_si_kind) = 1;
+
+ gfor_fndecl_sr_kind = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("selected_real_kind2008")), ".RR",
+ gfc_int4_type_node, 3, pvoid_type_node, pvoid_type_node,
+ pvoid_type_node);
+ DECL_PURE_P (gfor_fndecl_sr_kind) = 1;
/* Power functions. */
{
@@ -2674,23 +2616,21 @@ gfc_build_intrinsic_function_decls (void)
#undef NRKINDS
}
- gfor_fndecl_math_ishftc4 =
- gfc_build_library_function_decl (get_identifier (PREFIX("ishftc4")),
- gfc_int4_type_node,
- 3, gfc_int4_type_node,
- gfc_int4_type_node, gfc_int4_type_node);
- gfor_fndecl_math_ishftc8 =
- gfc_build_library_function_decl (get_identifier (PREFIX("ishftc8")),
- gfc_int8_type_node,
- 3, gfc_int8_type_node,
- gfc_int4_type_node, gfc_int4_type_node);
+ gfor_fndecl_math_ishftc4 = gfc_build_library_function_decl (
+ get_identifier (PREFIX("ishftc4")),
+ gfc_int4_type_node, 3, gfc_int4_type_node, gfc_int4_type_node,
+ gfc_int4_type_node);
+
+ gfor_fndecl_math_ishftc8 = gfc_build_library_function_decl (
+ get_identifier (PREFIX("ishftc8")),
+ gfc_int8_type_node, 3, gfc_int8_type_node, gfc_int4_type_node,
+ gfc_int4_type_node);
+
if (gfc_int16_type_node)
- gfor_fndecl_math_ishftc16 =
- gfc_build_library_function_decl (get_identifier (PREFIX("ishftc16")),
- gfc_int16_type_node, 3,
- gfc_int16_type_node,
- gfc_int4_type_node,
- gfc_int4_type_node);
+ gfor_fndecl_math_ishftc16 = gfc_build_library_function_decl (
+ get_identifier (PREFIX("ishftc16")),
+ gfc_int16_type_node, 3, gfc_int16_type_node, gfc_int4_type_node,
+ gfc_int4_type_node);
/* BLAS functions. */
{
@@ -2736,32 +2676,30 @@ gfc_build_intrinsic_function_decls (void)
}
/* Other functions. */
- gfor_fndecl_size0 =
- gfc_build_library_function_decl (get_identifier (PREFIX("size0")),
- gfc_array_index_type,
- 1, pvoid_type_node);
- gfor_fndecl_size1 =
- gfc_build_library_function_decl (get_identifier (PREFIX("size1")),
- gfc_array_index_type,
- 2, pvoid_type_node,
- gfc_array_index_type);
-
- gfor_fndecl_iargc =
- gfc_build_library_function_decl (get_identifier (PREFIX ("iargc")),
- gfc_int4_type_node,
- 0);
+ gfor_fndecl_size0 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("size0")), ".R",
+ gfc_array_index_type, 1, pvoid_type_node);
+ DECL_PURE_P (gfor_fndecl_size0) = 1;
+
+ gfor_fndecl_size1 = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("size1")), ".R",
+ gfc_array_index_type, 2, pvoid_type_node, gfc_array_index_type);
+ DECL_PURE_P (gfor_fndecl_size1) = 1;
+
+ gfor_fndecl_iargc = gfc_build_library_function_decl (
+ get_identifier (PREFIX ("iargc")), gfc_int4_type_node, 0);
if (gfc_type_for_size (128, true))
{
tree uint128 = gfc_type_for_size (128, true);
- gfor_fndecl_clz128 =
- gfc_build_library_function_decl (get_identifier (PREFIX ("clz128")),
- integer_type_node, 1, uint128);
+ gfor_fndecl_clz128 = gfc_build_library_function_decl (
+ get_identifier (PREFIX ("clz128")), integer_type_node, 1, uint128);
+ TREE_READONLY (gfor_fndecl_clz128) = 1;
- gfor_fndecl_ctz128 =
- gfc_build_library_function_decl (get_identifier (PREFIX ("ctz128")),
- integer_type_node, 1, uint128);
+ gfor_fndecl_ctz128 = gfc_build_library_function_decl (
+ get_identifier (PREFIX ("ctz128")), integer_type_node, 1, uint128);
+ TREE_READONLY (gfor_fndecl_ctz128) = 1;
}
}
@@ -2773,113 +2711,104 @@ gfc_build_builtin_function_decls (void)
{
tree gfc_int4_type_node = gfc_get_int_type (4);
- gfor_fndecl_stop_numeric =
- gfc_build_library_function_decl (get_identifier (PREFIX("stop_numeric")),
- void_type_node, 1, gfc_int4_type_node);
+ gfor_fndecl_stop_numeric = gfc_build_library_function_decl (
+ get_identifier (PREFIX("stop_numeric")),
+ void_type_node, 1, gfc_int4_type_node);
/* STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_stop_numeric) = 1;
-
- gfor_fndecl_stop_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("stop_string")),
- void_type_node, 2, pchar_type_node,
- gfc_int4_type_node);
+ gfor_fndecl_stop_string = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("stop_string")), ".R.",
+ void_type_node, 2, pchar_type_node, gfc_int4_type_node);
/* STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_stop_string) = 1;
-
- gfor_fndecl_error_stop_numeric =
- gfc_build_library_function_decl (get_identifier (PREFIX("error_stop_numeric")),
- void_type_node, 1, gfc_int4_type_node);
+ gfor_fndecl_error_stop_numeric = gfc_build_library_function_decl (
+ get_identifier (PREFIX("error_stop_numeric")),
+ void_type_node, 1, gfc_int4_type_node);
/* ERROR STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_error_stop_numeric) = 1;
-
- gfor_fndecl_error_stop_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("error_stop_string")),
- void_type_node, 2, pchar_type_node,
- gfc_int4_type_node);
+ gfor_fndecl_error_stop_string = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("error_stop_string")), ".R.",
+ void_type_node, 2, pchar_type_node, gfc_int4_type_node);
/* ERROR STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_error_stop_string) = 1;
+ gfor_fndecl_pause_numeric = gfc_build_library_function_decl (
+ get_identifier (PREFIX("pause_numeric")),
+ void_type_node, 1, gfc_int4_type_node);
- gfor_fndecl_pause_numeric =
- gfc_build_library_function_decl (get_identifier (PREFIX("pause_numeric")),
- void_type_node, 1, gfc_int4_type_node);
-
- gfor_fndecl_pause_string =
- gfc_build_library_function_decl (get_identifier (PREFIX("pause_string")),
- void_type_node, 2, pchar_type_node,
- gfc_int4_type_node);
+ gfor_fndecl_pause_string = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("pause_string")), ".R.",
+ void_type_node, 2, pchar_type_node, gfc_int4_type_node);
- gfor_fndecl_runtime_error =
- gfc_build_library_function_decl (get_identifier (PREFIX("runtime_error")),
- void_type_node, -1, pchar_type_node);
+ gfor_fndecl_runtime_error = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("runtime_error")), ".R",
+ void_type_node, -1, pchar_type_node);
/* The runtime_error function does not return. */
TREE_THIS_VOLATILE (gfor_fndecl_runtime_error) = 1;
- gfor_fndecl_runtime_error_at =
- gfc_build_library_function_decl (get_identifier (PREFIX("runtime_error_at")),
- void_type_node, -2, pchar_type_node,
- pchar_type_node);
+ gfor_fndecl_runtime_error_at = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("runtime_error_at")), ".RR",
+ void_type_node, -2, pchar_type_node, pchar_type_node);
/* The runtime_error_at function does not return. */
TREE_THIS_VOLATILE (gfor_fndecl_runtime_error_at) = 1;
- gfor_fndecl_runtime_warning_at =
- gfc_build_library_function_decl (get_identifier (PREFIX("runtime_warning_at")),
- void_type_node, -2, pchar_type_node,
- pchar_type_node);
- gfor_fndecl_generate_error =
- gfc_build_library_function_decl (get_identifier (PREFIX("generate_error")),
- void_type_node, 3, pvoid_type_node,
- integer_type_node, pchar_type_node);
-
- gfor_fndecl_os_error =
- gfc_build_library_function_decl (get_identifier (PREFIX("os_error")),
- void_type_node, 1, pchar_type_node);
+ gfor_fndecl_runtime_warning_at = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("runtime_warning_at")), ".RR",
+ void_type_node, -2, pchar_type_node, pchar_type_node);
+
+ gfor_fndecl_generate_error = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("generate_error")), ".R.R",
+ void_type_node, 3, pvoid_type_node, integer_type_node,
+ pchar_type_node);
+
+ gfor_fndecl_os_error = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("os_error")), ".R",
+ void_type_node, 1, pchar_type_node);
/* The runtime_error function does not return. */
TREE_THIS_VOLATILE (gfor_fndecl_os_error) = 1;
- gfor_fndecl_set_args =
- gfc_build_library_function_decl (get_identifier (PREFIX("set_args")),
- void_type_node, 2, integer_type_node,
- build_pointer_type (pchar_type_node));
+ gfor_fndecl_set_args = gfc_build_library_function_decl (
+ get_identifier (PREFIX("set_args")),
+ void_type_node, 2, integer_type_node,
+ build_pointer_type (pchar_type_node));
- gfor_fndecl_set_fpe =
- gfc_build_library_function_decl (get_identifier (PREFIX("set_fpe")),
- void_type_node, 1, integer_type_node);
+ gfor_fndecl_set_fpe = gfc_build_library_function_decl (
+ get_identifier (PREFIX("set_fpe")),
+ void_type_node, 1, integer_type_node);
/* Keep the array dimension in sync with the call, later in this file. */
- gfor_fndecl_set_options =
- gfc_build_library_function_decl (get_identifier (PREFIX("set_options")),
- void_type_node, 2, integer_type_node,
- build_pointer_type (integer_type_node));
+ gfor_fndecl_set_options = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("set_options")), "..R",
+ void_type_node, 2, integer_type_node,
+ build_pointer_type (integer_type_node));
- gfor_fndecl_set_convert =
- gfc_build_library_function_decl (get_identifier (PREFIX("set_convert")),
- void_type_node, 1, integer_type_node);
+ gfor_fndecl_set_convert = gfc_build_library_function_decl (
+ get_identifier (PREFIX("set_convert")),
+ void_type_node, 1, integer_type_node);
- gfor_fndecl_set_record_marker =
- gfc_build_library_function_decl (get_identifier (PREFIX("set_record_marker")),
- void_type_node, 1, integer_type_node);
+ gfor_fndecl_set_record_marker = gfc_build_library_function_decl (
+ get_identifier (PREFIX("set_record_marker")),
+ void_type_node, 1, integer_type_node);
- gfor_fndecl_set_max_subrecord_length =
- gfc_build_library_function_decl (get_identifier (PREFIX("set_max_subrecord_length")),
- void_type_node, 1, integer_type_node);
+ gfor_fndecl_set_max_subrecord_length = gfc_build_library_function_decl (
+ get_identifier (PREFIX("set_max_subrecord_length")),
+ void_type_node, 1, integer_type_node);
gfor_fndecl_in_pack = gfc_build_library_function_decl_with_spec (
- get_identifier (PREFIX("internal_pack")), ".r",
- pvoid_type_node, 1, pvoid_type_node);
+ get_identifier (PREFIX("internal_pack")), ".r",
+ pvoid_type_node, 1, pvoid_type_node);
gfor_fndecl_in_unpack = gfc_build_library_function_decl_with_spec (
- get_identifier (PREFIX("internal_unpack")), ".wR",
- void_type_node, 2, pvoid_type_node, pvoid_type_node);
+ get_identifier (PREFIX("internal_unpack")), ".wR",
+ void_type_node, 2, pvoid_type_node, pvoid_type_node);
- gfor_fndecl_associated =
- gfc_build_library_function_decl (
- get_identifier (PREFIX("associated")),
- integer_type_node, 2, ppvoid_type_node,
- ppvoid_type_node);
+ gfor_fndecl_associated = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("associated")), ".RR",
+ integer_type_node, 2, ppvoid_type_node, ppvoid_type_node);
+ DECL_PURE_P (gfor_fndecl_associated) = 1;
gfc_build_intrinsic_function_decls ();
gfc_build_intrinsic_lib_fndecls ();
@@ -2889,72 +2818,70 @@ gfc_build_builtin_function_decls (void)
/* Evaluate the length of dummy character variables. */
-static tree
-gfc_trans_dummy_character (gfc_symbol *sym, gfc_charlen *cl, tree fnbody)
+static void
+gfc_trans_dummy_character (gfc_symbol *sym, gfc_charlen *cl,
+ gfc_wrapped_block *block)
{
- stmtblock_t body;
+ stmtblock_t init;
gfc_finish_decl (cl->backend_decl);
- gfc_start_block (&body);
+ gfc_start_block (&init);
/* Evaluate the string length expression. */
- gfc_conv_string_length (cl, NULL, &body);
+ gfc_conv_string_length (cl, NULL, &init);
- gfc_trans_vla_type_sizes (sym, &body);
+ gfc_trans_vla_type_sizes (sym, &init);
- gfc_add_expr_to_block (&body, fnbody);
- return gfc_finish_block (&body);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
/* Allocate and cleanup an automatic character variable. */
-static tree
-gfc_trans_auto_character_variable (gfc_symbol * sym, tree fnbody)
+static void
+gfc_trans_auto_character_variable (gfc_symbol * sym, gfc_wrapped_block * block)
{
- stmtblock_t body;
+ stmtblock_t init;
tree decl;
tree tmp;
gcc_assert (sym->backend_decl);
gcc_assert (sym->ts.u.cl && sym->ts.u.cl->length);
- gfc_start_block (&body);
+ gfc_start_block (&init);
/* Evaluate the string length expression. */
- gfc_conv_string_length (sym->ts.u.cl, NULL, &body);
+ gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
- gfc_trans_vla_type_sizes (sym, &body);
+ gfc_trans_vla_type_sizes (sym, &init);
decl = sym->backend_decl;
/* Emit a DECL_EXPR for this variable, which will cause the
gimplifier to allocate storage, and all that good stuff. */
tmp = fold_build1 (DECL_EXPR, TREE_TYPE (decl), decl);
- gfc_add_expr_to_block (&body, tmp);
+ gfc_add_expr_to_block (&init, tmp);
- gfc_add_expr_to_block (&body, fnbody);
- return gfc_finish_block (&body);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
/* Set the initial value of ASSIGN statement auxiliary variable explicitly. */
-static tree
-gfc_trans_assign_aux_var (gfc_symbol * sym, tree fnbody)
+static void
+gfc_trans_assign_aux_var (gfc_symbol * sym, gfc_wrapped_block * block)
{
- stmtblock_t body;
+ stmtblock_t init;
gcc_assert (sym->backend_decl);
- gfc_start_block (&body);
+ gfc_start_block (&init);
/* Set the initial value to length. See the comments in
function gfc_add_assign_aux_vars in this file. */
- gfc_add_modify (&body, GFC_DECL_STRING_LEN (sym->backend_decl),
- build_int_cst (NULL_TREE, -2));
+ gfc_add_modify (&init, GFC_DECL_STRING_LEN (sym->backend_decl),
+ build_int_cst (NULL_TREE, -2));
- gfc_add_expr_to_block (&body, fnbody);
- return gfc_finish_block (&body);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
static void
@@ -3067,15 +2994,15 @@ gfc_trans_vla_type_sizes (gfc_symbol *sym, stmtblock_t *body)
/* Initialize a derived type by building an lvalue from the symbol
and using trans_assignment to do the work. Set dealloc to false
if no deallocation prior the assignment is needed. */
-tree
-gfc_init_default_dt (gfc_symbol * sym, tree body, bool dealloc)
+void
+gfc_init_default_dt (gfc_symbol * sym, stmtblock_t * block, bool dealloc)
{
- stmtblock_t fnblock;
gfc_expr *e;
tree tmp;
tree present;
- gfc_init_block (&fnblock);
+ gcc_assert (block);
+
gcc_assert (!sym->attr.allocatable);
gfc_set_sym_referenced (sym);
e = gfc_lval_expr_from_sym (sym);
@@ -3087,11 +3014,8 @@ gfc_init_default_dt (gfc_symbol * sym, tree body, bool dealloc)
tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present,
tmp, build_empty_stmt (input_location));
}
- gfc_add_expr_to_block (&fnblock, tmp);
+ gfc_add_expr_to_block (block, tmp);
gfc_free_expr (e);
- if (body)
- gfc_add_expr_to_block (&fnblock, body);
- return gfc_finish_block (&fnblock);
}
@@ -3099,15 +3023,15 @@ gfc_init_default_dt (gfc_symbol * sym, tree body, bool dealloc)
them their default initializer, if they do not have allocatable
components, they have their allocatable components deallocated. */
-static tree
-init_intent_out_dt (gfc_symbol * proc_sym, tree body)
+static void
+init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
{
- stmtblock_t fnblock;
+ stmtblock_t init;
gfc_formal_arglist *f;
tree tmp;
tree present;
- gfc_init_block (&fnblock);
+ gfc_init_block (&init);
for (f = proc_sym->formal; f; f = f->next)
if (f->sym && f->sym->attr.intent == INTENT_OUT
&& !f->sym->attr.pointer
@@ -3127,14 +3051,13 @@ init_intent_out_dt (gfc_symbol * proc_sym, tree body)
tmp, build_empty_stmt (input_location));
}
- gfc_add_expr_to_block (&fnblock, tmp);
+ gfc_add_expr_to_block (&init, tmp);
}
else if (f->sym->value)
- body = gfc_init_default_dt (f->sym, body, true);
+ gfc_init_default_dt (f->sym, &init, true);
}
- gfc_add_expr_to_block (&fnblock, body);
- return gfc_finish_block (&fnblock);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
@@ -3146,13 +3069,13 @@ init_intent_out_dt (gfc_symbol * proc_sym, tree body)
Initialization of ASSIGN statement auxiliary variable.
Automatic deallocation. */
-tree
-gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
+void
+gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
{
locus loc;
gfc_symbol *sym;
gfc_formal_arglist *f;
- stmtblock_t body;
+ stmtblock_t tmpblock;
bool seen_trans_deferred_array = false;
/* Deal with implicit return variables. Explicit return variables will
@@ -3176,19 +3099,17 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
else if (proc_sym->as)
{
tree result = TREE_VALUE (current_fake_result_decl);
- fnbody = gfc_trans_dummy_array_bias (proc_sym, result, fnbody);
+ gfc_trans_dummy_array_bias (proc_sym, result, block);
/* An automatic character length, pointer array result. */
if (proc_sym->ts.type == BT_CHARACTER
&& TREE_CODE (proc_sym->ts.u.cl->backend_decl) == VAR_DECL)
- fnbody = gfc_trans_dummy_character (proc_sym, proc_sym->ts.u.cl,
- fnbody);
+ gfc_trans_dummy_character (proc_sym, proc_sym->ts.u.cl, block);
}
else if (proc_sym->ts.type == BT_CHARACTER)
{
if (TREE_CODE (proc_sym->ts.u.cl->backend_decl) == VAR_DECL)
- fnbody = gfc_trans_dummy_character (proc_sym, proc_sym->ts.u.cl,
- fnbody);
+ gfc_trans_dummy_character (proc_sym, proc_sym->ts.u.cl, block);
}
else
gcc_assert (gfc_option.flag_f2c
@@ -3198,7 +3119,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
/* Initialize the INTENT(OUT) derived type dummy arguments. This
should be done here so that the offsets and lbounds of arrays
are available. */
- fnbody = init_intent_out_dt (proc_sym, fnbody);
+ init_intent_out_dt (proc_sym, block);
for (sym = proc_sym->tlink; sym != proc_sym; sym = sym->tlink)
{
@@ -3210,8 +3131,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
{
case AS_EXPLICIT:
if (sym->attr.dummy || sym->attr.result)
- fnbody =
- gfc_trans_dummy_array_bias (sym, sym->backend_decl, fnbody);
+ gfc_trans_dummy_array_bias (sym, sym->backend_decl, block);
else if (sym->attr.pointer || sym->attr.allocatable)
{
if (TREE_STATIC (sym->backend_decl))
@@ -3219,7 +3139,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
else
{
seen_trans_deferred_array = true;
- fnbody = gfc_trans_deferred_array (sym, fnbody);
+ gfc_trans_deferred_array (sym, block);
}
}
else
@@ -3227,18 +3147,24 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
if (sym_has_alloc_comp)
{
seen_trans_deferred_array = true;
- fnbody = gfc_trans_deferred_array (sym, fnbody);
+ gfc_trans_deferred_array (sym, block);
}
else if (sym->ts.type == BT_DERIVED
&& sym->value
&& !sym->attr.data
&& sym->attr.save == SAVE_NONE)
- fnbody = gfc_init_default_dt (sym, fnbody, false);
+ {
+ gfc_start_block (&tmpblock);
+ gfc_init_default_dt (sym, &tmpblock, false);
+ gfc_add_init_cleanup (block,
+ gfc_finish_block (&tmpblock),
+ NULL_TREE);
+ }
gfc_get_backend_locus (&loc);
gfc_set_backend_locus (&sym->declared_at);
- fnbody = gfc_trans_auto_array_allocation (sym->backend_decl,
- sym, fnbody);
+ gfc_trans_auto_array_allocation (sym->backend_decl,
+ sym, block);
gfc_set_backend_locus (&loc);
}
break;
@@ -3249,27 +3175,26 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
/* We should always pass assumed size arrays the g77 way. */
if (sym->attr.dummy)
- fnbody = gfc_trans_g77_array (sym, fnbody);
- break;
+ gfc_trans_g77_array (sym, block);
+ break;
case AS_ASSUMED_SHAPE:
/* Must be a dummy parameter. */
gcc_assert (sym->attr.dummy);
- fnbody = gfc_trans_dummy_array_bias (sym, sym->backend_decl,
- fnbody);
+ gfc_trans_dummy_array_bias (sym, sym->backend_decl, block);
break;
case AS_DEFERRED:
seen_trans_deferred_array = true;
- fnbody = gfc_trans_deferred_array (sym, fnbody);
+ gfc_trans_deferred_array (sym, block);
break;
default:
gcc_unreachable ();
}
if (sym_has_alloc_comp && !seen_trans_deferred_array)
- fnbody = gfc_trans_deferred_array (sym, fnbody);
+ gfc_trans_deferred_array (sym, block);
}
else if (sym->attr.allocatable
|| (sym->ts.type == BT_CLASS
@@ -3282,7 +3207,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
tree tmp;
gfc_expr *e;
gfc_se se;
- stmtblock_t block;
+ stmtblock_t init;
e = gfc_lval_expr_from_sym (sym);
if (sym->ts.type == BT_CLASS)
@@ -3294,49 +3219,54 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
gfc_free_expr (e);
/* Nullify when entering the scope. */
- gfc_start_block (&block);
- gfc_add_modify (&block, se.expr,
+ gfc_start_block (&init);
+ gfc_add_modify (&init, se.expr,
fold_convert (TREE_TYPE (se.expr),
null_pointer_node));
- gfc_add_expr_to_block (&block, fnbody);
/* Deallocate when leaving the scope. Nullifying is not
needed. */
- tmp = gfc_deallocate_with_status (se.expr, NULL_TREE, true,
- NULL);
- gfc_add_expr_to_block (&block, tmp);
- fnbody = gfc_finish_block (&block);
+ tmp = NULL;
+ if (!sym->attr.result)
+ tmp = gfc_deallocate_with_status (se.expr, NULL_TREE,
+ true, NULL);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp);
}
}
else if (sym_has_alloc_comp)
- fnbody = gfc_trans_deferred_array (sym, fnbody);
+ gfc_trans_deferred_array (sym, block);
else if (sym->ts.type == BT_CHARACTER)
{
gfc_get_backend_locus (&loc);
gfc_set_backend_locus (&sym->declared_at);
if (sym->attr.dummy || sym->attr.result)
- fnbody = gfc_trans_dummy_character (sym, sym->ts.u.cl, fnbody);
+ gfc_trans_dummy_character (sym, sym->ts.u.cl, block);
else
- fnbody = gfc_trans_auto_character_variable (sym, fnbody);
+ gfc_trans_auto_character_variable (sym, block);
gfc_set_backend_locus (&loc);
}
else if (sym->attr.assign)
{
gfc_get_backend_locus (&loc);
gfc_set_backend_locus (&sym->declared_at);
- fnbody = gfc_trans_assign_aux_var (sym, fnbody);
+ gfc_trans_assign_aux_var (sym, block);
gfc_set_backend_locus (&loc);
}
else if (sym->ts.type == BT_DERIVED
&& sym->value
&& !sym->attr.data
&& sym->attr.save == SAVE_NONE)
- fnbody = gfc_init_default_dt (sym, fnbody, false);
+ {
+ gfc_start_block (&tmpblock);
+ gfc_init_default_dt (sym, &tmpblock, false);
+ gfc_add_init_cleanup (block, gfc_finish_block (&tmpblock),
+ NULL_TREE);
+ }
else
gcc_unreachable ();
}
- gfc_init_block (&body);
+ gfc_init_block (&tmpblock);
for (f = proc_sym->formal; f; f = f->next)
{
@@ -3344,7 +3274,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
{
gcc_assert (f->sym->ts.u.cl->backend_decl != NULL);
if (TREE_CODE (f->sym->ts.u.cl->backend_decl) == PARM_DECL)
- gfc_trans_vla_type_sizes (f->sym, &body);
+ gfc_trans_vla_type_sizes (f->sym, &tmpblock);
}
}
@@ -3353,11 +3283,10 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
{
gcc_assert (proc_sym->ts.u.cl->backend_decl != NULL);
if (TREE_CODE (proc_sym->ts.u.cl->backend_decl) == PARM_DECL)
- gfc_trans_vla_type_sizes (proc_sym, &body);
+ gfc_trans_vla_type_sizes (proc_sym, &tmpblock);
}
- gfc_add_expr_to_block (&body, fnbody);
- return gfc_finish_block (&body);
+ gfc_add_init_cleanup (block, gfc_finish_block (&tmpblock), NULL_TREE);
}
static GTY ((param_is (struct module_htab_entry))) htab_t module_htab;
@@ -4355,6 +4284,56 @@ create_main_function (tree fndecl)
}
+/* Get the result expression for a procedure. */
+
+static tree
+get_proc_result (gfc_symbol* sym)
+{
+ if (sym->attr.subroutine || sym == sym->result)
+ {
+ if (current_fake_result_decl != NULL)
+ return TREE_VALUE (current_fake_result_decl);
+
+ return NULL_TREE;
+ }
+
+ return sym->result->backend_decl;
+}
+
+
+/* Generate an appropriate return-statement for a procedure. */
+
+tree
+gfc_generate_return (void)
+{
+ gfc_symbol* sym;
+ tree result;
+ tree fndecl;
+
+ sym = current_procedure_symbol;
+ fndecl = sym->backend_decl;
+
+ if (TREE_TYPE (DECL_RESULT (fndecl)) == void_type_node)
+ result = NULL_TREE;
+ else
+ {
+ result = get_proc_result (sym);
+
+ /* Set the return value to the dummy result variable. The
+ types may be different for scalar default REAL functions
+ with -ff2c, therefore we have to convert. */
+ if (result != NULL_TREE)
+ {
+ result = convert (TREE_TYPE (DECL_RESULT (fndecl)), result);
+ result = fold_build2 (MODIFY_EXPR, TREE_TYPE (result),
+ DECL_RESULT (fndecl), result);
+ }
+ }
+
+ return build1_v (RETURN_EXPR, result);
+}
+
+
/* Generate code for a function. */
void
@@ -4364,16 +4343,18 @@ gfc_generate_function_code (gfc_namespace * ns)
tree old_context;
tree decl;
tree tmp;
- tree tmp2;
- stmtblock_t block;
+ stmtblock_t init, cleanup;
stmtblock_t body;
- tree result;
+ gfc_wrapped_block try_block;
tree recurcheckvar = NULL_TREE;
gfc_symbol *sym;
+ gfc_symbol *previous_procedure_symbol;
int rank;
bool is_recursive;
sym = ns->proc_name;
+ previous_procedure_symbol = current_procedure_symbol;
+ current_procedure_symbol = sym;
/* Check that the frontend isn't still using this. */
gcc_assert (sym->tlink == NULL);
@@ -4395,7 +4376,7 @@ gfc_generate_function_code (gfc_namespace * ns)
trans_function_start (sym);
- gfc_init_block (&block);
+ gfc_init_block (&init);
if (ns->entries && ns->proc_name->ts.type == BT_CHARACTER)
{
@@ -4434,34 +4415,32 @@ gfc_generate_function_code (gfc_namespace * ns)
else
current_fake_result_decl = NULL_TREE;
- current_function_return_label = NULL;
+ is_recursive = sym->attr.recursive
+ || (sym->attr.entry_master
+ && sym->ns->entries->sym->attr.recursive);
+ if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
+ && !is_recursive
+ && !gfc_option.flag_recursive)
+ {
+ char * msg;
+
+ asprintf (&msg, "Recursive call to nonrecursive procedure '%s'",
+ sym->name);
+ recurcheckvar = gfc_create_var (boolean_type_node, "is_recursive");
+ TREE_STATIC (recurcheckvar) = 1;
+ DECL_INITIAL (recurcheckvar) = boolean_false_node;
+ gfc_add_expr_to_block (&init, recurcheckvar);
+ gfc_trans_runtime_check (true, false, recurcheckvar, &init,
+ &sym->declared_at, msg);
+ gfc_add_modify (&init, recurcheckvar, boolean_true_node);
+ gfc_free (msg);
+ }
/* Now generate the code for the body of this function. */
gfc_init_block (&body);
- is_recursive = sym->attr.recursive
- || (sym->attr.entry_master
- && sym->ns->entries->sym->attr.recursive);
- if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
- && !is_recursive
- && !gfc_option.flag_recursive)
- {
- char * msg;
-
- asprintf (&msg, "Recursive call to nonrecursive procedure '%s'",
- sym->name);
- recurcheckvar = gfc_create_var (boolean_type_node, "is_recursive");
- TREE_STATIC (recurcheckvar) = 1;
- DECL_INITIAL (recurcheckvar) = boolean_false_node;
- gfc_add_expr_to_block (&block, recurcheckvar);
- gfc_trans_runtime_check (true, false, recurcheckvar, &block,
- &sym->declared_at, msg);
- gfc_add_modify (&block, recurcheckvar, boolean_true_node);
- gfc_free (msg);
- }
-
if (TREE_TYPE (DECL_RESULT (fndecl)) != void_type_node
- && sym->attr.subroutine)
+ && sym->attr.subroutine)
{
tree alternate_return;
alternate_return = gfc_get_fake_result_decl (sym, 0);
@@ -4484,29 +4463,9 @@ gfc_generate_function_code (gfc_namespace * ns)
tmp = gfc_trans_code (ns->code);
gfc_add_expr_to_block (&body, tmp);
- /* Add a return label if needed. */
- if (current_function_return_label)
- {
- tmp = build1_v (LABEL_EXPR, current_function_return_label);
- gfc_add_expr_to_block (&body, tmp);
- }
-
- tmp = gfc_finish_block (&body);
- /* Add code to create and cleanup arrays. */
- tmp = gfc_trans_deferred_vars (sym, tmp);
-
if (TREE_TYPE (DECL_RESULT (fndecl)) != void_type_node)
{
- if (sym->attr.subroutine || sym == sym->result)
- {
- if (current_fake_result_decl != NULL)
- result = TREE_VALUE (current_fake_result_decl);
- else
- result = NULL_TREE;
- current_fake_result_decl = NULL_TREE;
- }
- else
- result = sym->result->backend_decl;
+ tree result = get_proc_result (sym);
if (result != NULL_TREE
&& sym->attr.function
@@ -4516,24 +4475,12 @@ gfc_generate_function_code (gfc_namespace * ns)
&& sym->ts.u.derived->attr.alloc_comp)
{
rank = sym->as ? sym->as->rank : 0;
- tmp2 = gfc_nullify_alloc_comp (sym->ts.u.derived, result, rank);
- gfc_add_expr_to_block (&block, tmp2);
+ tmp = gfc_nullify_alloc_comp (sym->ts.u.derived, result, rank);
+ gfc_add_expr_to_block (&init, tmp);
}
else if (sym->attr.allocatable && sym->attr.dimension == 0)
- gfc_add_modify (&block, result, fold_convert (TREE_TYPE (result),
- null_pointer_node));
- }
-
- gfc_add_expr_to_block (&block, tmp);
-
- /* Reset recursion-check variable. */
- if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
- && !is_recursive
- && !gfc_option.flag_openmp
- && recurcheckvar != NULL_TREE)
- {
- gfc_add_modify (&block, recurcheckvar, boolean_false_node);
- recurcheckvar = NULL;
+ gfc_add_modify (&init, result, fold_convert (TREE_TYPE (result),
+ null_pointer_node));
}
if (result == NULL_TREE)
@@ -4546,31 +4493,28 @@ gfc_generate_function_code (gfc_namespace * ns)
TREE_NO_WARNING(sym->backend_decl) = 1;
}
else
- {
- /* Set the return value to the dummy result variable. The
- types may be different for scalar default REAL functions
- with -ff2c, therefore we have to convert. */
- tmp = convert (TREE_TYPE (DECL_RESULT (fndecl)), result);
- tmp = fold_build2 (MODIFY_EXPR, TREE_TYPE (tmp),
- DECL_RESULT (fndecl), tmp);
- tmp = build1_v (RETURN_EXPR, tmp);
- gfc_add_expr_to_block (&block, tmp);
- }
+ gfc_add_expr_to_block (&body, gfc_generate_return ());
}
- else
+
+ gfc_init_block (&cleanup);
+
+ /* Reset recursion-check variable. */
+ if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
+ && !is_recursive
+ && !gfc_option.flag_openmp
+ && recurcheckvar != NULL_TREE)
{
- gfc_add_expr_to_block (&block, tmp);
- /* Reset recursion-check variable. */
- if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
- && !is_recursive
- && !gfc_option.flag_openmp
- && recurcheckvar != NULL_TREE)
- {
- gfc_add_modify (&block, recurcheckvar, boolean_false_node);
- recurcheckvar = NULL_TREE;
- }
+ gfc_add_modify (&cleanup, recurcheckvar, boolean_false_node);
+ recurcheckvar = NULL;
}
+ /* Finish the function body and add init and cleanup code. */
+ tmp = gfc_finish_block (&body);
+ gfc_start_wrapped_block (&try_block, tmp);
+ /* Add code to create and cleanup arrays. */
+ gfc_trans_deferred_vars (sym, &try_block);
+ gfc_add_init_cleanup (&try_block, gfc_finish_block (&init),
+ gfc_finish_block (&cleanup));
/* Add all the decls we created during processing. */
decl = saved_function_decls;
@@ -4578,14 +4522,14 @@ gfc_generate_function_code (gfc_namespace * ns)
{
tree next;
- next = TREE_CHAIN (decl);
- TREE_CHAIN (decl) = NULL_TREE;
+ next = DECL_CHAIN (decl);
+ DECL_CHAIN (decl) = NULL_TREE;
pushdecl (decl);
decl = next;
}
saved_function_decls = NULL_TREE;
- DECL_SAVED_TREE (fndecl) = gfc_finish_block (&block);
+ DECL_SAVED_TREE (fndecl) = gfc_finish_wrapped_block (&try_block);
decl = getdecls ();
/* Finish off this function and send it for code generation. */
@@ -4636,6 +4580,8 @@ gfc_generate_function_code (gfc_namespace * ns)
if (sym->attr.is_main_program)
create_main_function (fndecl);
+
+ current_procedure_symbol = previous_procedure_symbol;
}
@@ -4757,8 +4703,8 @@ gfc_process_block_locals (gfc_namespace* ns)
{
tree next;
- next = TREE_CHAIN (decl);
- TREE_CHAIN (decl) = NULL_TREE;
+ next = DECL_CHAIN (decl);
+ DECL_CHAIN (decl) = NULL_TREE;
pushdecl (decl);
decl = next;
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 692b3e2f846..a83d4b3eda4 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "toplev.h" /* For fatal_error. */
+#include "diagnostic-core.h" /* For fatal_error. */
#include "langhooks.h"
#include "flags.h"
#include "gfortran.h"
@@ -1365,7 +1365,8 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
lse.expr = gfc_build_compare_string (lse.string_length, lse.expr,
rse.string_length, rse.expr,
- expr->value.op.op1->ts.kind);
+ expr->value.op.op1->ts.kind,
+ code);
rse.expr = build_int_cst (TREE_TYPE (lse.expr), 0);
gfc_add_block_to_block (&lse.post, &rse.post);
}
@@ -1388,17 +1389,45 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
/* If a string's length is one, we convert it to a single character. */
-static tree
-string_to_single_character (tree len, tree str, int kind)
+tree
+gfc_string_to_single_character (tree len, tree str, int kind)
{
gcc_assert (POINTER_TYPE_P (TREE_TYPE (str)));
- if (INTEGER_CST_P (len) && TREE_INT_CST_LOW (len) == 1
- && TREE_INT_CST_HIGH (len) == 0)
+ if (!INTEGER_CST_P (len) || TREE_INT_CST_HIGH (len) != 0)
+ return NULL_TREE;
+
+ if (TREE_INT_CST_LOW (len) == 1)
{
str = fold_convert (gfc_get_pchar_type (kind), str);
- return build_fold_indirect_ref_loc (input_location,
- str);
+ return build_fold_indirect_ref_loc (input_location, str);
+ }
+
+ if (kind == 1
+ && TREE_CODE (str) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (str, 0)) == ARRAY_REF
+ && TREE_CODE (TREE_OPERAND (TREE_OPERAND (str, 0), 0)) == STRING_CST
+ && array_ref_low_bound (TREE_OPERAND (str, 0))
+ == TREE_OPERAND (TREE_OPERAND (str, 0), 1)
+ && TREE_INT_CST_LOW (len) > 1
+ && TREE_INT_CST_LOW (len)
+ == (unsigned HOST_WIDE_INT)
+ TREE_STRING_LENGTH (TREE_OPERAND (TREE_OPERAND (str, 0), 0)))
+ {
+ tree ret = fold_convert (gfc_get_pchar_type (kind), str);
+ ret = build_fold_indirect_ref_loc (input_location, ret);
+ if (TREE_CODE (ret) == INTEGER_CST)
+ {
+ tree string_cst = TREE_OPERAND (TREE_OPERAND (str, 0), 0);
+ int i, length = TREE_STRING_LENGTH (string_cst);
+ const char *ptr = TREE_STRING_POINTER (string_cst);
+
+ for (i = 1; i < length; i++)
+ if (ptr[i] != ' ')
+ return NULL_TREE;
+
+ return ret;
+ }
}
return NULL_TREE;
@@ -1446,7 +1475,7 @@ gfc_conv_scalar_char_value (gfc_symbol *sym, gfc_se *se, gfc_expr **expr)
{
if ((*expr)->ref == NULL)
{
- se->expr = string_to_single_character
+ se->expr = gfc_string_to_single_character
(build_int_cst (integer_type_node, 1),
gfc_build_addr_expr (gfc_get_pchar_type ((*expr)->ts.kind),
gfc_get_symbol_decl
@@ -1456,7 +1485,7 @@ gfc_conv_scalar_char_value (gfc_symbol *sym, gfc_se *se, gfc_expr **expr)
else
{
gfc_conv_variable (se, *expr);
- se->expr = string_to_single_character
+ se->expr = gfc_string_to_single_character
(build_int_cst (integer_type_node, 1),
gfc_build_addr_expr (gfc_get_pchar_type ((*expr)->ts.kind),
se->expr),
@@ -1466,47 +1495,91 @@ gfc_conv_scalar_char_value (gfc_symbol *sym, gfc_se *se, gfc_expr **expr)
}
}
+/* Helper function for gfc_build_compare_string. Return LEN_TRIM value
+ if STR is a string literal, otherwise return -1. */
+
+static int
+gfc_optimize_len_trim (tree len, tree str, int kind)
+{
+ if (kind == 1
+ && TREE_CODE (str) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (str, 0)) == ARRAY_REF
+ && TREE_CODE (TREE_OPERAND (TREE_OPERAND (str, 0), 0)) == STRING_CST
+ && array_ref_low_bound (TREE_OPERAND (str, 0))
+ == TREE_OPERAND (TREE_OPERAND (str, 0), 1)
+ && TREE_INT_CST_LOW (len) >= 1
+ && TREE_INT_CST_LOW (len)
+ == (unsigned HOST_WIDE_INT)
+ TREE_STRING_LENGTH (TREE_OPERAND (TREE_OPERAND (str, 0), 0)))
+ {
+ tree folded = fold_convert (gfc_get_pchar_type (kind), str);
+ folded = build_fold_indirect_ref_loc (input_location, folded);
+ if (TREE_CODE (folded) == INTEGER_CST)
+ {
+ tree string_cst = TREE_OPERAND (TREE_OPERAND (str, 0), 0);
+ int length = TREE_STRING_LENGTH (string_cst);
+ const char *ptr = TREE_STRING_POINTER (string_cst);
+
+ for (; length > 0; length--)
+ if (ptr[length - 1] != ' ')
+ break;
+
+ return length;
+ }
+ }
+ return -1;
+}
/* Compare two strings. If they are all single characters, the result is the
subtraction of them. Otherwise, we build a library call. */
tree
-gfc_build_compare_string (tree len1, tree str1, tree len2, tree str2, int kind)
+gfc_build_compare_string (tree len1, tree str1, tree len2, tree str2, int kind,
+ enum tree_code code)
{
tree sc1;
tree sc2;
- tree tmp;
+ tree fndecl;
gcc_assert (POINTER_TYPE_P (TREE_TYPE (str1)));
gcc_assert (POINTER_TYPE_P (TREE_TYPE (str2)));
- sc1 = string_to_single_character (len1, str1, kind);
- sc2 = string_to_single_character (len2, str2, kind);
+ sc1 = gfc_string_to_single_character (len1, str1, kind);
+ sc2 = gfc_string_to_single_character (len2, str2, kind);
if (sc1 != NULL_TREE && sc2 != NULL_TREE)
{
/* Deal with single character specially. */
sc1 = fold_convert (integer_type_node, sc1);
sc2 = fold_convert (integer_type_node, sc2);
- tmp = fold_build2 (MINUS_EXPR, integer_type_node, sc1, sc2);
+ return fold_build2 (MINUS_EXPR, integer_type_node, sc1, sc2);
}
- else
- {
- /* Build a call for the comparison. */
- tree fndecl;
-
- if (kind == 1)
- fndecl = gfor_fndecl_compare_string;
- else if (kind == 4)
- fndecl = gfor_fndecl_compare_string_char4;
- else
- gcc_unreachable ();
- tmp = build_call_expr_loc (input_location,
- fndecl, 4, len1, str1, len2, str2);
+ if ((code == EQ_EXPR || code == NE_EXPR)
+ && optimize
+ && INTEGER_CST_P (len1) && INTEGER_CST_P (len2))
+ {
+ /* If one string is a string literal with LEN_TRIM longer
+ than the length of the second string, the strings
+ compare unequal. */
+ int len = gfc_optimize_len_trim (len1, str1, kind);
+ if (len > 0 && compare_tree_int (len2, len) < 0)
+ return integer_one_node;
+ len = gfc_optimize_len_trim (len2, str2, kind);
+ if (len > 0 && compare_tree_int (len1, len) < 0)
+ return integer_one_node;
}
- return tmp;
+ /* Build a call for the comparison. */
+ if (kind == 1)
+ fndecl = gfor_fndecl_compare_string;
+ else if (kind == 4)
+ fndecl = gfor_fndecl_compare_string_char4;
+ else
+ gcc_unreachable ();
+
+ return build_call_expr_loc (input_location, fndecl, 4,
+ len1, str1, len2, str2);
}
@@ -2478,8 +2551,8 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e,
var, cmp->backend_decl, NULL_TREE);
/* Remember the vtab corresponds to the derived type
- not to the class declared type. */
- vtab = gfc_find_derived_vtab (e->ts.u.derived, true);
+ not to the class declared type. */
+ vtab = gfc_find_derived_vtab (e->ts.u.derived);
gcc_assert (vtab);
gfc_trans_assign_vtab_procs (&parmse->pre, e->ts.u.derived, vtab);
tmp = gfc_build_addr_expr (NULL_TREE, gfc_get_symbol_decl (vtab));
@@ -2653,7 +2726,6 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
return 0;
}
-
/* Generate code for a procedure call. Note can return se->post != NULL.
If se->direct_byref is set then se->expr contains the return parameter.
Return nonzero, if the call has alternate specifiers.
@@ -2662,11 +2734,11 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
int
gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_actual_arglist * arg, gfc_expr * expr,
- tree append_args)
+ VEC(tree,gc) *append_args)
{
gfc_interface_mapping mapping;
- tree arglist;
- tree retargs;
+ VEC(tree,gc) *arglist;
+ VEC(tree,gc) *retargs;
tree tmp;
tree fntype;
gfc_se parmse;
@@ -2677,7 +2749,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
tree type;
tree var;
tree len;
- tree stringargs;
+ VEC(tree,gc) *stringargs;
tree result = NULL;
gfc_formal_arglist *formal;
int has_alternate_specifier = 0;
@@ -2690,10 +2762,11 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
stmtblock_t post;
enum {MISSING = 0, ELEMENTAL, SCALAR, SCALAR_POINTER, ARRAY};
gfc_component *comp = NULL;
+ int arglen;
- arglist = NULL_TREE;
- retargs = NULL_TREE;
- stringargs = NULL_TREE;
+ arglist = NULL;
+ retargs = NULL;
+ stringargs = NULL;
var = NULL_TREE;
len = NULL_TREE;
gfc_clear_ts (&ts);
@@ -3136,9 +3209,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Character strings are passed as two parameters, a length and a
pointer - except for Bind(c) which only passes the pointer. */
if (parmse.string_length != NULL_TREE && !sym->attr.is_bind_c)
- stringargs = gfc_chainon_list (stringargs, parmse.string_length);
+ VEC_safe_push (tree, gc, stringargs, parmse.string_length);
- arglist = gfc_chainon_list (arglist, parmse.expr);
+ VEC_safe_push (tree, gc, arglist, parmse.expr);
}
gfc_finish_interface_mapping (&mapping, &se->pre, &se->post);
@@ -3160,7 +3233,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
For dummies, we have to look through the formal argument list for
this function and use the character length found there.*/
if (!sym->attr.dummy)
- cl.backend_decl = TREE_VALUE (stringargs);
+ cl.backend_decl = VEC_index (tree, stringargs, 0);
else
{
formal = sym->ns->proc_name->formal;
@@ -3213,7 +3286,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
result = build_fold_indirect_ref_loc (input_location,
se->expr);
- retargs = gfc_chainon_list (retargs, se->expr);
+ VEC_safe_push (tree, gc, retargs, se->expr);
}
else if (comp && comp->attr.dimension)
{
@@ -3237,7 +3310,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Pass the temporary as the first argument. */
result = info->descriptor;
tmp = gfc_build_addr_expr (NULL_TREE, result);
- retargs = gfc_chainon_list (retargs, tmp);
+ VEC_safe_push (tree, gc, retargs, tmp);
}
else if (!comp && sym->result->attr.dimension)
{
@@ -3261,7 +3334,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Pass the temporary as the first argument. */
result = info->descriptor;
tmp = gfc_build_addr_expr (NULL_TREE, result);
- retargs = gfc_chainon_list (retargs, tmp);
+ VEC_safe_push (tree, gc, retargs, tmp);
}
else if (ts.type == BT_CHARACTER)
{
@@ -3288,7 +3361,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
var = gfc_conv_string_tmp (se, type, len);
- retargs = gfc_chainon_list (retargs, var);
+ VEC_safe_push (tree, gc, retargs, var);
}
else
{
@@ -3296,25 +3369,31 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
type = gfc_get_complex_type (ts.kind);
var = gfc_build_addr_expr (NULL_TREE, gfc_create_var (type, "cmplx"));
- retargs = gfc_chainon_list (retargs, var);
+ VEC_safe_push (tree, gc, retargs, var);
}
/* Add the string length to the argument list. */
if (ts.type == BT_CHARACTER)
- retargs = gfc_chainon_list (retargs, len);
+ VEC_safe_push (tree, gc, retargs, len);
}
gfc_free_interface_mapping (&mapping);
+ /* We need to glom RETARGS + ARGLIST + STRINGARGS + APPEND_ARGS. */
+ arglen = (VEC_length (tree, arglist)
+ + VEC_length (tree, stringargs) + VEC_length (tree, append_args));
+ VEC_reserve_exact (tree, gc, retargs, arglen);
+
/* Add the return arguments. */
- arglist = chainon (retargs, arglist);
+ VEC_splice (tree, retargs, arglist);
/* Add the hidden string length parameters to the arguments. */
- arglist = chainon (arglist, stringargs);
+ VEC_splice (tree, retargs, stringargs);
/* We may want to append extra arguments here. This is used e.g. for
calls to libgfortran_matmul_??, which need extra information. */
- if (append_args != NULL_TREE)
- arglist = chainon (arglist, append_args);
+ if (!VEC_empty (tree, append_args))
+ VEC_splice (tree, retargs, append_args);
+ arglist = retargs;
/* Generate the actual call. */
conv_function_val (se, sym, expr);
@@ -3338,7 +3417,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
}
fntype = TREE_TYPE (TREE_TYPE (se->expr));
- se->expr = build_call_list (TREE_TYPE (fntype), se->expr, arglist);
+ se->expr = build_call_vec (TREE_TYPE (fntype), se->expr, arglist);
/* If we have a pointer function, but we don't want a pointer, e.g.
something like
@@ -3539,7 +3618,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
if (slength != NULL_TREE)
{
slen = fold_convert (size_type_node, gfc_evaluate_now (slength, block));
- ssc = string_to_single_character (slen, src, skind);
+ ssc = gfc_string_to_single_character (slen, src, skind);
}
else
{
@@ -3550,7 +3629,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
if (dlength != NULL_TREE)
{
dlen = fold_convert (size_type_node, gfc_evaluate_now (dlength, block));
- dsc = string_to_single_character (slen, dest, dkind);
+ dsc = gfc_string_to_single_character (dlen, dest, dkind);
}
else
{
@@ -3558,12 +3637,6 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
dsc = dest;
}
- if (slength != NULL_TREE && POINTER_TYPE_P (TREE_TYPE (src)))
- ssc = string_to_single_character (slen, src, skind);
- if (dlength != NULL_TREE && POINTER_TYPE_P (TREE_TYPE (dest)))
- dsc = string_to_single_character (dlen, dest, dkind);
-
-
/* Assign directly if the types are compatible. */
if (dsc != NULL_TREE && ssc != NULL_TREE
&& TREE_TYPE (dsc) == TREE_TYPE (ssc))
@@ -3786,8 +3859,7 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr)
if (!sym)
sym = expr->symtree->n.sym;
- gfc_conv_procedure_call (se, sym, expr->value.function.actual, expr,
- NULL_TREE);
+ gfc_conv_procedure_call (se, sym, expr->value.function.actual, expr, NULL);
}
@@ -4973,6 +5045,11 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1, gfc_expr * expr2)
if (!expr2->value.function.esym->attr.contained)
return false;
+ /* A temporary is not needed if the lhs has never been host
+ associated and the procedure is contained. */
+ else if (!sym->attr.host_assoc)
+ return false;
+
/* A temporary is not needed if the variable is local and not
a pointer, a target or a result. */
if (sym->ns->parent
@@ -5226,6 +5303,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
bool l_is_temp;
bool scalar_to_array;
tree string_length;
+ int n;
/* Assignment of the form lhs = rhs. */
gfc_start_block (&block);
@@ -5271,6 +5349,9 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
/* Calculate the bounds of the scalarization. */
gfc_conv_ss_startstride (&loop);
+ /* Enable loop reversal. */
+ for (n = 0; n < loop.dimen; n++)
+ loop.reverse[n] = GFC_REVERSE_NOT_SET;
/* Resolve any data dependencies in the statement. */
gfc_conv_resolve_dependencies (&loop, lss, rss);
/* Setup the scalarizing loops. */
@@ -5631,7 +5712,7 @@ gfc_trans_class_assign (gfc_code *code)
{
gfc_symbol *vtab;
gfc_symtree *st;
- vtab = gfc_find_derived_vtab (code->expr2->ts.u.derived, true);
+ vtab = gfc_find_derived_vtab (code->expr2->ts.u.derived);
gcc_assert (vtab);
gfc_trans_assign_vtab_procs (&block, code->expr2->ts.u.derived, vtab);
rhs = gfc_get_expr ();
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 06fd538d775..c277e8e6376 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -28,7 +28,8 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h" /* For UNITS_PER_WORD. */
#include "tree.h"
#include "ggc.h"
-#include "toplev.h" /* For rest_of_decl_compilation/internal_error. */
+#include "diagnostic-core.h" /* For internal_error. */
+#include "toplev.h" /* For rest_of_decl_compilation. */
#include "flags.h"
#include "gfortran.h"
#include "arith.h"
@@ -1570,7 +1571,7 @@ static void
gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr)
{
gfc_symbol *sym;
- tree append_args;
+ VEC(tree,gc) *append_args;
gcc_assert (!se->ss || se->ss->expr == expr);
@@ -1583,7 +1584,7 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr)
/* Calls to libgfortran_matmul need to be appended special arguments,
to be able to call the BLAS ?gemm functions if required and possible. */
- append_args = NULL_TREE;
+ append_args = NULL;
if (expr->value.function.isym->id == GFC_ISYM_MATMUL
&& sym->ts.type != BT_LOGICAL)
{
@@ -1611,19 +1612,19 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr)
gemm_fndecl = gfor_fndecl_zgemm;
}
- append_args = gfc_chainon_list (NULL_TREE, build_int_cst (cint, 1));
- append_args = gfc_chainon_list
- (append_args, build_int_cst
- (cint, gfc_option.blas_matmul_limit));
- append_args = gfc_chainon_list (append_args,
- gfc_build_addr_expr (NULL_TREE,
- gemm_fndecl));
+ append_args = VEC_alloc (tree, gc, 3);
+ VEC_quick_push (tree, append_args, build_int_cst (cint, 1));
+ VEC_quick_push (tree, append_args,
+ build_int_cst (cint, gfc_option.blas_matmul_limit));
+ VEC_quick_push (tree, append_args,
+ gfc_build_addr_expr (NULL_TREE, gemm_fndecl));
}
else
{
- append_args = gfc_chainon_list (NULL_TREE, build_int_cst (cint, 0));
- append_args = gfc_chainon_list (append_args, build_int_cst (cint, 0));
- append_args = gfc_chainon_list (append_args, null_pointer_node);
+ append_args = VEC_alloc (tree, gc, 3);
+ VEC_quick_push (tree, append_args, build_int_cst (cint, 0));
+ VEC_quick_push (tree, append_args, build_int_cst (cint, 0));
+ VEC_quick_push (tree, append_args, null_pointer_node);
}
}
@@ -3285,7 +3286,7 @@ conv_generic_with_optional_char_arg (gfc_se* se, gfc_expr* expr,
unsigned cur_pos;
gfc_actual_arglist* arg;
gfc_symbol* sym;
- tree append_args;
+ VEC(tree,gc) *append_args;
/* Find the two arguments given as position. */
cur_pos = 0;
@@ -3309,13 +3310,14 @@ conv_generic_with_optional_char_arg (gfc_se* se, gfc_expr* expr,
/* If we do have type CHARACTER and the optional argument is really absent,
append a dummy 0 as string length. */
- append_args = NULL_TREE;
+ append_args = NULL;
if (prim_arg->expr->ts.type == BT_CHARACTER && !opt_arg->expr)
{
tree dummy;
dummy = build_int_cst (gfc_charlen_type_node, 0);
- append_args = gfc_chainon_list (append_args, dummy);
+ append_args = VEC_alloc (tree, gc, 1);
+ VEC_quick_push (tree, append_args, dummy);
}
/* Build the call itself. */
@@ -3883,6 +3885,9 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
if (ss == gfc_ss_terminator)
{
+ if (arg->ts.type == BT_CLASS)
+ gfc_add_component_ref (arg, "$data");
+
gfc_conv_expr_reference (&argse, arg);
type = TREE_TYPE (build_fold_indirect_ref_loc (input_location,
@@ -3932,6 +3937,56 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
}
+static void
+gfc_conv_intrinsic_storage_size (gfc_se *se, gfc_expr *expr)
+{
+ gfc_expr *arg;
+ gfc_ss *ss;
+ gfc_se argse,eight;
+ tree type, result_type, tmp;
+
+ arg = expr->value.function.actual->expr;
+ gfc_init_se (&eight, NULL);
+ gfc_conv_expr (&eight, gfc_get_int_expr (expr->ts.kind, NULL, 8));
+
+ gfc_init_se (&argse, NULL);
+ ss = gfc_walk_expr (arg);
+ result_type = gfc_get_int_type (expr->ts.kind);
+
+ if (ss == gfc_ss_terminator)
+ {
+ if (arg->ts.type == BT_CLASS)
+ {
+ gfc_add_component_ref (arg, "$vptr");
+ gfc_add_component_ref (arg, "$size");
+ gfc_conv_expr (&argse, arg);
+ tmp = fold_convert (result_type, argse.expr);
+ goto done;
+ }
+
+ gfc_conv_expr_reference (&argse, arg);
+ type = TREE_TYPE (build_fold_indirect_ref_loc (input_location,
+ argse.expr));
+ }
+ else
+ {
+ argse.want_pointer = 0;
+ gfc_conv_expr_descriptor (&argse, arg, ss);
+ type = gfc_get_element_type (TREE_TYPE (argse.expr));
+ }
+
+ /* Obtain the argument's word length. */
+ if (arg->ts.type == BT_CHARACTER)
+ tmp = size_of_string_in_bytes (arg->ts.kind, argse.string_length);
+ else
+ tmp = fold_convert (result_type, size_in_bytes (type));
+
+done:
+ se->expr = fold_build2 (MULT_EXPR, result_type, tmp, eight.expr);
+ gfc_add_block_to_block (&se->pre, &argse.pre);
+}
+
+
/* Intrinsic string comparison functions. */
static void
@@ -3943,7 +3998,8 @@ gfc_conv_intrinsic_strcmp (gfc_se * se, gfc_expr * expr, enum tree_code op)
se->expr
= gfc_build_compare_string (args[0], args[1], args[2], args[3],
- expr->value.function.actual->expr->ts.kind);
+ expr->value.function.actual->expr->ts.kind,
+ op);
se->expr = fold_build2 (op, gfc_typenode_for_spec (&expr->ts), se->expr,
build_int_cst (TREE_TYPE (se->expr), 0));
}
@@ -4566,10 +4622,10 @@ static void
gfc_conv_intrinsic_sr_kind (gfc_se *se, gfc_expr *expr)
{
gfc_actual_arglist *actual;
- tree args, type;
+ tree type;
gfc_se argse;
+ VEC(tree,gc) *args = NULL;
- args = NULL_TREE;
for (actual = expr->value.function.actual; actual; actual = actual->next)
{
gfc_init_se (&argse, se);
@@ -4594,13 +4650,13 @@ gfc_conv_intrinsic_sr_kind (gfc_se *se, gfc_expr *expr)
gfc_add_block_to_block (&se->pre, &argse.pre);
gfc_add_block_to_block (&se->post, &argse.post);
- args = gfc_chainon_list (args, argse.expr);
+ VEC_safe_push (tree, gc, args, argse.expr);
}
/* Convert it to the required type. */
type = gfc_typenode_for_spec (&expr->ts);
- se->expr = build_function_call_expr (input_location,
- gfor_fndecl_sr_kind, args);
+ se->expr = build_call_expr_loc_vec (input_location,
+ gfor_fndecl_sr_kind, args);
se->expr = fold_convert (type, se->expr);
}
@@ -5268,9 +5324,14 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
break;
case GFC_ISYM_SIZEOF:
+ case GFC_ISYM_C_SIZEOF:
gfc_conv_intrinsic_sizeof (se, expr);
break;
+ case GFC_ISYM_STORAGE_SIZE:
+ gfc_conv_intrinsic_storage_size (se, expr);
+ break;
+
case GFC_ISYM_SPACING:
gfc_conv_intrinsic_spacing (se, expr);
break;
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 1608a5e6598..a806d423417 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tree.h"
#include "ggc.h"
-#include "toplev.h" /* For internal_error. */
+#include "diagnostic-core.h" /* For internal_error. */
#include "gfortran.h"
#include "trans.h"
#include "trans-stmt.h"
@@ -156,6 +156,7 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
char name[64];
size_t len;
tree t = make_node (RECORD_TYPE);
+ tree *chain = NULL;
len = strlen (st_parameter[ptype].name);
gcc_assert (len <= sizeof (name) - sizeof ("__st_parameter_"));
@@ -175,33 +176,31 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
case IOPARM_type_parray:
case IOPARM_type_pchar:
case IOPARM_type_pad:
- p->field = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
- get_identifier (p->name),
- types[p->type]);
+ p->field = gfc_add_field_to_struct (t, get_identifier (p->name),
+ types[p->type], &chain);
break;
case IOPARM_type_char1:
- p->field = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
- get_identifier (p->name),
- pchar_type_node);
+ p->field = gfc_add_field_to_struct (t, get_identifier (p->name),
+ pchar_type_node, &chain);
/* FALLTHROUGH */
case IOPARM_type_char2:
len = strlen (p->name);
gcc_assert (len <= sizeof (name) - sizeof ("_len"));
memcpy (name, p->name, len);
memcpy (name + len, "_len", sizeof ("_len"));
- p->field_len = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
- get_identifier (name),
- gfc_charlen_type_node);
+ p->field_len = gfc_add_field_to_struct (t, get_identifier (name),
+ gfc_charlen_type_node,
+ &chain);
if (p->type == IOPARM_type_char2)
- p->field = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
- get_identifier (p->name),
- pchar_type_node);
+ p->field = gfc_add_field_to_struct (t, get_identifier (p->name),
+ pchar_type_node, &chain);
break;
case IOPARM_type_common:
p->field
- = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
+ = gfc_add_field_to_struct (t,
get_identifier (p->name),
- st_parameter[IOPARM_ptype_common].type);
+ st_parameter[IOPARM_ptype_common].type,
+ &chain);
break;
case IOPARM_type_num:
gcc_unreachable ();
@@ -304,132 +303,117 @@ gfc_build_io_library_fndecls (void)
for (ptype = IOPARM_ptype_common; ptype < IOPARM_ptype_num; ptype++)
gfc_build_st_parameter ((enum ioparam_type) ptype, types);
- /* Define the transfer functions. */
+ /* Define the transfer functions.
+ TODO: Split them between READ and WRITE to allow further
+ optimizations, e.g. by using aliases? */
dt_parm_type = build_pointer_type (st_parameter[IOPARM_ptype_dt].type);
- iocall[IOCALL_X_INTEGER] =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("transfer_integer")),
- void_type_node, 3, dt_parm_type,
- pvoid_type_node, gfc_int4_type_node);
-
- iocall[IOCALL_X_LOGICAL] =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("transfer_logical")),
- void_type_node, 3, dt_parm_type,
- pvoid_type_node, gfc_int4_type_node);
-
- iocall[IOCALL_X_CHARACTER] =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("transfer_character")),
- void_type_node, 3, dt_parm_type,
- pvoid_type_node, gfc_int4_type_node);
-
- iocall[IOCALL_X_CHARACTER_WIDE] =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("transfer_character_wide")),
- void_type_node, 4, dt_parm_type,
- pvoid_type_node, gfc_charlen_type_node,
- gfc_int4_type_node);
-
- iocall[IOCALL_X_REAL] =
- gfc_build_library_function_decl (get_identifier (PREFIX("transfer_real")),
- void_type_node, 3, dt_parm_type,
- pvoid_type_node, gfc_int4_type_node);
-
- iocall[IOCALL_X_COMPLEX] =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("transfer_complex")),
- void_type_node, 3, dt_parm_type,
- pvoid_type_node, gfc_int4_type_node);
-
- iocall[IOCALL_X_ARRAY] =
- gfc_build_library_function_decl (get_identifier
- (PREFIX("transfer_array")),
- void_type_node, 4, dt_parm_type,
- pvoid_type_node, integer_type_node,
- gfc_charlen_type_node);
+ iocall[IOCALL_X_INTEGER] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_integer")), ".wW",
+ void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node);
+
+ iocall[IOCALL_X_LOGICAL] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_logical")), ".wW",
+ void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node);
+
+ iocall[IOCALL_X_CHARACTER] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_character")), ".wW",
+ void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node);
+
+ iocall[IOCALL_X_CHARACTER_WIDE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_character_wide")), ".wW",
+ void_type_node, 4, dt_parm_type, pvoid_type_node,
+ gfc_charlen_type_node, gfc_int4_type_node);
+
+ iocall[IOCALL_X_REAL] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_real")), ".wW",
+ void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node);
+
+ iocall[IOCALL_X_COMPLEX] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_complex")), ".wW",
+ void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node);
+
+ iocall[IOCALL_X_ARRAY] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("transfer_array")), ".wW",
+ void_type_node, 4, dt_parm_type, pvoid_type_node,
+ integer_type_node, gfc_charlen_type_node);
/* Library entry points */
- iocall[IOCALL_READ] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_read")),
- void_type_node, 1, dt_parm_type);
+ iocall[IOCALL_READ] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_read")), ".w",
+ void_type_node, 1, dt_parm_type);
- iocall[IOCALL_WRITE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_write")),
- void_type_node, 1, dt_parm_type);
+ iocall[IOCALL_WRITE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_write")), ".w",
+ void_type_node, 1, dt_parm_type);
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_open].type);
- iocall[IOCALL_OPEN] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_open")),
- void_type_node, 1, parm_type);
-
+ iocall[IOCALL_OPEN] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_open")), ".w",
+ void_type_node, 1, parm_type);
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_close].type);
- iocall[IOCALL_CLOSE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_close")),
- void_type_node, 1, parm_type);
+ iocall[IOCALL_CLOSE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_close")), ".w",
+ void_type_node, 1, parm_type);
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_inquire].type);
- iocall[IOCALL_INQUIRE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_inquire")),
- gfc_int4_type_node, 1, parm_type);
+ iocall[IOCALL_INQUIRE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_inquire")), ".w",
+ gfc_int4_type_node, 1, parm_type);
- iocall[IOCALL_IOLENGTH] =
- gfc_build_library_function_decl(get_identifier (PREFIX("st_iolength")),
- void_type_node, 1, dt_parm_type);
+ iocall[IOCALL_IOLENGTH] = gfc_build_library_function_decl_with_spec(
+ get_identifier (PREFIX("st_iolength")), ".w",
+ void_type_node, 1, dt_parm_type);
+ /* TODO: Change when asynchronous I/O is implemented. */
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_wait].type);
- iocall[IOCALL_WAIT] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_wait")),
- gfc_int4_type_node, 1, parm_type);
+ iocall[IOCALL_WAIT] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_wait")), ".X",
+ gfc_int4_type_node, 1, parm_type);
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_filepos].type);
- iocall[IOCALL_REWIND] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_rewind")),
- gfc_int4_type_node, 1, parm_type);
+ iocall[IOCALL_REWIND] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_rewind")), ".w",
+ gfc_int4_type_node, 1, parm_type);
- iocall[IOCALL_BACKSPACE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_backspace")),
- gfc_int4_type_node, 1, parm_type);
+ iocall[IOCALL_BACKSPACE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_backspace")), ".w",
+ gfc_int4_type_node, 1, parm_type);
- iocall[IOCALL_ENDFILE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_endfile")),
- gfc_int4_type_node, 1, parm_type);
+ iocall[IOCALL_ENDFILE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_endfile")), ".w",
+ gfc_int4_type_node, 1, parm_type);
- iocall[IOCALL_FLUSH] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_flush")),
- gfc_int4_type_node, 1, parm_type);
+ iocall[IOCALL_FLUSH] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_flush")), ".w",
+ gfc_int4_type_node, 1, parm_type);
/* Library helpers */
- iocall[IOCALL_READ_DONE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_read_done")),
- gfc_int4_type_node, 1, dt_parm_type);
-
- iocall[IOCALL_WRITE_DONE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_write_done")),
- gfc_int4_type_node, 1, dt_parm_type);
+ iocall[IOCALL_READ_DONE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_read_done")), ".w",
+ gfc_int4_type_node, 1, dt_parm_type);
- iocall[IOCALL_IOLENGTH_DONE] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_iolength_done")),
- gfc_int4_type_node, 1, dt_parm_type);
+ iocall[IOCALL_WRITE_DONE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_write_done")), ".w",
+ gfc_int4_type_node, 1, dt_parm_type);
+ iocall[IOCALL_IOLENGTH_DONE] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_iolength_done")), ".w",
+ gfc_int4_type_node, 1, dt_parm_type);
- iocall[IOCALL_SET_NML_VAL] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var")),
- void_type_node, 6, dt_parm_type,
- pvoid_type_node, pvoid_type_node,
- gfc_int4_type_node, gfc_charlen_type_node,
- gfc_int4_type_node);
+ iocall[IOCALL_SET_NML_VAL] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_set_nml_var")), ".w.R",
+ void_type_node, 6, dt_parm_type, pvoid_type_node, pvoid_type_node,
+ gfc_int4_type_node, gfc_charlen_type_node, gfc_int4_type_node);
- iocall[IOCALL_SET_NML_VAL_DIM] =
- gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_dim")),
- void_type_node, 5, dt_parm_type,
- gfc_int4_type_node, gfc_array_index_type,
- gfc_array_index_type, gfc_array_index_type);
+ iocall[IOCALL_SET_NML_VAL_DIM] = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("st_set_nml_var_dim")), ".w",
+ void_type_node, 5, dt_parm_type, gfc_int4_type_node,
+ gfc_array_index_type, gfc_array_index_type, gfc_array_index_type);
}
@@ -1670,7 +1654,8 @@ build_dt (tree function, gfc_code * code)
{
mask |= set_internal_unit (&block, &post_iu_block,
var, dt->io_unit);
- set_parameter_const (&block, var, IOPARM_common_unit, 0);
+ set_parameter_const (&block, var, IOPARM_common_unit,
+ dt->io_unit->ts.kind == 1 ? 0 : -1);
}
}
else
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 7a7d33088d7..4a7f70e7b6e 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tree.h"
#include "gimple.h" /* For create_tmp_var_raw. */
-#include "toplev.h" /* For internal_error. */
+#include "diagnostic-core.h" /* For internal_error. */
#include "gfortran.h"
#include "trans.h"
#include "trans-stmt.h"
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 6fa84b91694..019555ae7f9 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "trans-const.h"
#include "arith.h"
#include "dependency.h"
+#include "ggc.h"
typedef struct iter_info
{
@@ -373,7 +374,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
/* Translate the call. */
has_alternate_specifier
= gfc_conv_procedure_call (&se, code->resolved_sym, code->ext.actual,
- code->expr1, NULL_TREE);
+ code->expr1, NULL);
/* A subroutine without side-effect, by definition, does nothing! */
TREE_SIDE_EFFECTS (se.expr) = 1;
@@ -457,8 +458,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
/* Add the subroutine call to the block. */
gfc_conv_procedure_call (&loopse, code->resolved_sym,
- code->ext.actual, code->expr1,
- NULL_TREE);
+ code->ext.actual, code->expr1, NULL);
if (mask && count1)
{
@@ -491,7 +491,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
/* Translate the RETURN statement. */
tree
-gfc_trans_return (gfc_code * code ATTRIBUTE_UNUSED)
+gfc_trans_return (gfc_code * code)
{
if (code->expr1)
{
@@ -500,16 +500,16 @@ gfc_trans_return (gfc_code * code ATTRIBUTE_UNUSED)
tree result;
/* If code->expr is not NULL, this return statement must appear
- in a subroutine and current_fake_result_decl has already
+ in a subroutine and current_fake_result_decl has already
been generated. */
result = gfc_get_fake_result_decl (NULL, 0);
if (!result)
- {
- gfc_warning ("An alternate return at %L without a * dummy argument",
- &code->expr1->where);
- return build1_v (GOTO_EXPR, gfc_get_return_label ());
- }
+ {
+ gfc_warning ("An alternate return at %L without a * dummy argument",
+ &code->expr1->where);
+ return gfc_generate_return ();
+ }
/* Start a new block for this statement. */
gfc_init_se (&se, NULL);
@@ -517,17 +517,20 @@ gfc_trans_return (gfc_code * code ATTRIBUTE_UNUSED)
gfc_conv_expr (&se, code->expr1);
+ /* Note that the actually returned expression is a simple value and
+ does not depend on any pointers or such; thus we can clean-up with
+ se.post before returning. */
tmp = fold_build2 (MODIFY_EXPR, TREE_TYPE (result), result,
fold_convert (TREE_TYPE (result), se.expr));
gfc_add_expr_to_block (&se.pre, tmp);
+ gfc_add_block_to_block (&se.pre, &se.post);
- tmp = build1_v (GOTO_EXPR, gfc_get_return_label ());
+ tmp = gfc_generate_return ();
gfc_add_expr_to_block (&se.pre, tmp);
- gfc_add_block_to_block (&se.pre, &se.post);
return gfc_finish_block (&se.pre);
}
- else
- return build1_v (GOTO_EXPR, gfc_get_return_label ());
+
+ return gfc_generate_return ();
}
@@ -847,8 +850,7 @@ gfc_trans_block_construct (gfc_code* code)
{
gfc_namespace* ns;
gfc_symbol* sym;
- stmtblock_t body;
- tree tmp;
+ gfc_wrapped_block body;
ns = code->ext.block.ns;
gcc_assert (ns);
@@ -858,14 +860,12 @@ gfc_trans_block_construct (gfc_code* code)
gcc_assert (!sym->tlink);
sym->tlink = sym;
- gfc_start_block (&body);
gfc_process_block_locals (ns);
- tmp = gfc_trans_code (ns->code);
- tmp = gfc_trans_deferred_vars (sym, tmp);
+ gfc_start_wrapped_block (&body, gfc_trans_code (ns->code));
+ gfc_trans_deferred_vars (sym, &body);
- gfc_add_expr_to_block (&body, tmp);
- return gfc_finish_block (&body);
+ return gfc_finish_wrapped_block (&body);
}
@@ -1595,6 +1595,10 @@ gfc_trans_logical_select (gfc_code * code)
}
+/* The jump table types are stored in static variables to avoid
+ constructing them from scratch every single time. */
+static GTY(()) tree select_struct[2];
+
/* Translate the SELECT CASE construct for CHARACTER case expressions.
Instead of generating compares and jumps, it is far simpler to
generate a data structure describing the cases in order and call a
@@ -1611,18 +1615,171 @@ gfc_trans_character_select (gfc_code *code)
stmtblock_t block, body;
gfc_case *cp, *d;
gfc_code *c;
- gfc_se se;
+ gfc_se se, expr1se;
int n, k;
VEC(constructor_elt,gc) *inits = NULL;
+ tree pchartype = gfc_get_pchar_type (code->expr1->ts.kind);
+
/* The jump table types are stored in static variables to avoid
constructing them from scratch every single time. */
- static tree select_struct[2];
static tree ss_string1[2], ss_string1_len[2];
static tree ss_string2[2], ss_string2_len[2];
static tree ss_target[2];
- tree pchartype = gfc_get_pchar_type (code->expr1->ts.kind);
+ cp = code->block->ext.case_list;
+ while (cp->left != NULL)
+ cp = cp->left;
+
+ /* Generate the body */
+ gfc_start_block (&block);
+ gfc_init_se (&expr1se, NULL);
+ gfc_conv_expr_reference (&expr1se, code->expr1);
+
+ gfc_add_block_to_block (&block, &expr1se.pre);
+
+ end_label = gfc_build_label_decl (NULL_TREE);
+
+ gfc_init_block (&body);
+
+ /* Attempt to optimize length 1 selects. */
+ if (expr1se.string_length == integer_one_node)
+ {
+ for (d = cp; d; d = d->right)
+ {
+ int i;
+ if (d->low)
+ {
+ gcc_assert (d->low->expr_type == EXPR_CONSTANT
+ && d->low->ts.type == BT_CHARACTER);
+ if (d->low->value.character.length > 1)
+ {
+ for (i = 1; i < d->low->value.character.length; i++)
+ if (d->low->value.character.string[i] != ' ')
+ break;
+ if (i != d->low->value.character.length)
+ {
+ if (optimize && d->high && i == 1)
+ {
+ gcc_assert (d->high->expr_type == EXPR_CONSTANT
+ && d->high->ts.type == BT_CHARACTER);
+ if (d->high->value.character.length > 1
+ && (d->low->value.character.string[0]
+ == d->high->value.character.string[0])
+ && d->high->value.character.string[1] != ' '
+ && ((d->low->value.character.string[1] < ' ')
+ == (d->high->value.character.string[1]
+ < ' ')))
+ continue;
+ }
+ break;
+ }
+ }
+ }
+ if (d->high)
+ {
+ gcc_assert (d->high->expr_type == EXPR_CONSTANT
+ && d->high->ts.type == BT_CHARACTER);
+ if (d->high->value.character.length > 1)
+ {
+ for (i = 1; i < d->high->value.character.length; i++)
+ if (d->high->value.character.string[i] != ' ')
+ break;
+ if (i != d->high->value.character.length)
+ break;
+ }
+ }
+ }
+ if (d == NULL)
+ {
+ tree ctype = gfc_get_char_type (code->expr1->ts.kind);
+
+ for (c = code->block; c; c = c->block)
+ {
+ for (cp = c->ext.case_list; cp; cp = cp->next)
+ {
+ tree low, high;
+ tree label;
+ gfc_char_t r;
+
+ /* Assume it's the default case. */
+ low = high = NULL_TREE;
+
+ if (cp->low)
+ {
+ /* CASE ('ab') or CASE ('ab':'az') will never match
+ any length 1 character. */
+ if (cp->low->value.character.length > 1
+ && cp->low->value.character.string[1] != ' ')
+ continue;
+
+ if (cp->low->value.character.length > 0)
+ r = cp->low->value.character.string[0];
+ else
+ r = ' ';
+ low = build_int_cst (ctype, r);
+
+ /* If there's only a lower bound, set the high bound
+ to the maximum value of the case expression. */
+ if (!cp->high)
+ high = TYPE_MAX_VALUE (ctype);
+ }
+
+ if (cp->high)
+ {
+ if (!cp->low
+ || (cp->low->value.character.string[0]
+ != cp->high->value.character.string[0]))
+ {
+ if (cp->high->value.character.length > 0)
+ r = cp->high->value.character.string[0];
+ else
+ r = ' ';
+ high = build_int_cst (ctype, r);
+ }
+
+ /* Unbounded case. */
+ if (!cp->low)
+ low = TYPE_MIN_VALUE (ctype);
+ }
+
+ /* Build a label. */
+ label = gfc_build_label_decl (NULL_TREE);
+
+ /* Add this case label.
+ Add parameter 'label', make it match GCC backend. */
+ tmp = fold_build3 (CASE_LABEL_EXPR, void_type_node,
+ low, high, label);
+ gfc_add_expr_to_block (&body, tmp);
+ }
+
+ /* Add the statements for this case. */
+ tmp = gfc_trans_code (c->next);
+ gfc_add_expr_to_block (&body, tmp);
+
+ /* Break to the end of the construct. */
+ tmp = build1_v (GOTO_EXPR, end_label);
+ gfc_add_expr_to_block (&body, tmp);
+ }
+
+ tmp = gfc_string_to_single_character (expr1se.string_length,
+ expr1se.expr,
+ code->expr1->ts.kind);
+ case_num = gfc_create_var (ctype, "case_num");
+ gfc_add_modify (&block, case_num, tmp);
+
+ gfc_add_block_to_block (&block, &expr1se.post);
+
+ tmp = gfc_finish_block (&body);
+ tmp = build3_v (SWITCH_EXPR, case_num, tmp, NULL_TREE);
+ gfc_add_expr_to_block (&block, tmp);
+
+ tmp = build1_v (LABEL_EXPR, end_label);
+ gfc_add_expr_to_block (&block, tmp);
+
+ return gfc_finish_block (&block);
+ }
+ }
if (code->expr1->ts.kind == 1)
k = 0;
@@ -1633,6 +1790,7 @@ gfc_trans_character_select (gfc_code *code)
if (select_struct[k] == NULL)
{
+ tree *chain = NULL;
select_struct[k] = make_node (RECORD_TYPE);
if (code->expr1->ts.kind == 1)
@@ -1643,10 +1801,11 @@ gfc_trans_character_select (gfc_code *code)
gcc_unreachable ();
#undef ADD_FIELD
-#define ADD_FIELD(NAME, TYPE) \
- ss_##NAME[k] = gfc_add_field_to_struct \
- (&(TYPE_FIELDS (select_struct[k])), select_struct[k], \
- get_identifier (stringize(NAME)), TYPE)
+#define ADD_FIELD(NAME, TYPE) \
+ ss_##NAME[k] = gfc_add_field_to_struct (select_struct[k], \
+ get_identifier (stringize(NAME)), \
+ TYPE, \
+ &chain)
ADD_FIELD (string1, pchartype);
ADD_FIELD (string1_len, gfc_charlen_type_node);
@@ -1660,28 +1819,19 @@ gfc_trans_character_select (gfc_code *code)
gfc_finish_type (select_struct[k]);
}
- cp = code->block->ext.case_list;
- while (cp->left != NULL)
- cp = cp->left;
-
n = 0;
for (d = cp; d; d = d->right)
d->n = n++;
- end_label = gfc_build_label_decl (NULL_TREE);
-
- /* Generate the body */
- gfc_start_block (&block);
- gfc_init_block (&body);
-
for (c = code->block; c; c = c->block)
{
for (d = c->ext.case_list; d; d = d->next)
{
label = gfc_build_label_decl (NULL_TREE);
tmp = fold_build3 (CASE_LABEL_EXPR, void_type_node,
- build_int_cst (NULL_TREE, d->n),
- build_int_cst (NULL_TREE, d->n), label);
+ (d->low == NULL && d->high == NULL)
+ ? NULL : build_int_cst (NULL_TREE, d->n),
+ NULL, label);
gfc_add_expr_to_block (&body, tmp);
}
@@ -1693,7 +1843,7 @@ gfc_trans_character_select (gfc_code *code)
}
/* Generate the structure describing the branches */
- for(d = cp; d; d = d->right)
+ for (d = cp; d; d = d->right)
{
VEC(constructor_elt,gc) *node = NULL;
@@ -1750,11 +1900,6 @@ gfc_trans_character_select (gfc_code *code)
/* Build the library call */
init = gfc_build_addr_expr (pvoid_type_node, init);
- gfc_init_se (&se, NULL);
- gfc_conv_expr_reference (&se, code->expr1);
-
- gfc_add_block_to_block (&block, &se.pre);
-
if (code->expr1->ts.kind == 1)
fndecl = gfor_fndecl_select_string;
else if (code->expr1->ts.kind == 4)
@@ -1764,11 +1909,11 @@ gfc_trans_character_select (gfc_code *code)
tmp = build_call_expr_loc (input_location,
fndecl, 4, init, build_int_cst (NULL_TREE, n),
- se.expr, se.string_length);
+ expr1se.expr, expr1se.string_length);
case_num = gfc_create_var (integer_type_node, "case_num");
gfc_add_modify (&block, case_num, tmp);
- gfc_add_block_to_block (&block, &se.post);
+ gfc_add_block_to_block (&block, &expr1se.post);
tmp = gfc_finish_block (&body);
tmp = build3_v (SWITCH_EXPR, case_num, tmp, NULL_TREE);
@@ -4294,7 +4439,7 @@ gfc_trans_allocate (gfc_code * code)
if (ts->type == BT_DERIVED)
{
- vtab = gfc_find_derived_vtab (ts->u.derived, true);
+ vtab = gfc_find_derived_vtab (ts->u.derived);
gcc_assert (vtab);
gfc_trans_assign_vtab_procs (&block, ts->u.derived, vtab);
gfc_init_se (&lse, NULL);
@@ -4492,3 +4637,4 @@ gfc_trans_deallocate (gfc_code *code)
return gfc_finish_block (&block);
}
+#include "gt-fortran-trans-stmt.h"
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 2f5b759886d..34efa9ad82c 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -30,7 +30,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h" /* For iso-c-bindings.def. */
#include "target.h"
#include "ggc.h"
-#include "toplev.h" /* For rest_of_decl_compilation/fatal_error. */
+#include "diagnostic-core.h" /* For fatal_error. */
+#include "toplev.h" /* For rest_of_decl_compilation. */
#include "gfortran.h"
#include "trans.h"
#include "trans-types.h"
@@ -86,6 +87,7 @@ gfc_character_info gfc_character_kinds[MAX_CHARACTER_KINDS + 1];
static GTY(()) tree gfc_character_types[MAX_CHARACTER_KINDS + 1];
static GTY(()) tree gfc_pcharacter_types[MAX_CHARACTER_KINDS + 1];
+static tree gfc_add_field_to_struct_1 (tree, tree, tree, tree **);
/* The integer kind to use for array indices. This will be set to the
proper value based on target information from the backend. */
@@ -1232,8 +1234,7 @@ static tree
gfc_get_desc_dim_type (void)
{
tree type;
- tree decl;
- tree fieldlist;
+ tree decl, *chain = NULL;
if (gfc_desc_dim_type)
return gfc_desc_dim_type;
@@ -1245,30 +1246,22 @@ gfc_get_desc_dim_type (void)
TYPE_PACKED (type) = 1;
/* Consists of the stride, lbound and ubound members. */
- decl = build_decl (input_location,
- FIELD_DECL,
- get_identifier ("stride"), gfc_array_index_type);
- DECL_CONTEXT (decl) = type;
+ decl = gfc_add_field_to_struct_1 (type,
+ get_identifier ("stride"),
+ gfc_array_index_type, &chain);
TREE_NO_WARNING (decl) = 1;
- fieldlist = decl;
- decl = build_decl (input_location,
- FIELD_DECL,
- get_identifier ("lbound"), gfc_array_index_type);
- DECL_CONTEXT (decl) = type;
+ decl = gfc_add_field_to_struct_1 (type,
+ get_identifier ("lbound"),
+ gfc_array_index_type, &chain);
TREE_NO_WARNING (decl) = 1;
- fieldlist = chainon (fieldlist, decl);
- decl = build_decl (input_location,
- FIELD_DECL,
- get_identifier ("ubound"), gfc_array_index_type);
- DECL_CONTEXT (decl) = type;
+ decl = gfc_add_field_to_struct_1 (type,
+ get_identifier ("ubound"),
+ gfc_array_index_type, &chain);
TREE_NO_WARNING (decl) = 1;
- fieldlist = chainon (fieldlist, decl);
/* Finish off the type. */
- TYPE_FIELDS (type) = fieldlist;
-
gfc_finish_type (type);
TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type)) = 1;
@@ -1540,7 +1533,7 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed,
static tree
gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
{
- tree fat_type, fieldlist, decl, arraytype;
+ tree fat_type, decl, arraytype, *chain = NULL;
char name[16 + 2*GFC_RANK_DIGITS + 1 + 1];
int idx = 2 * (codimen + dimen - 1) + restricted;
@@ -1553,30 +1546,26 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
sprintf (name, "array_descriptor" GFC_RANK_PRINTF_FORMAT, dimen + codimen);
TYPE_NAME (fat_type) = get_identifier (name);
+ TYPE_NAMELESS (fat_type) = 1;
/* Add the data member as the first element of the descriptor. */
- decl = build_decl (input_location,
- FIELD_DECL, get_identifier ("data"),
- restricted ? prvoid_type_node : ptr_type_node);
-
- DECL_CONTEXT (decl) = fat_type;
- fieldlist = decl;
+ decl = gfc_add_field_to_struct_1 (fat_type,
+ get_identifier ("data"),
+ (restricted
+ ? prvoid_type_node
+ : ptr_type_node), &chain);
/* Add the base component. */
- decl = build_decl (input_location,
- FIELD_DECL, get_identifier ("offset"),
- gfc_array_index_type);
- DECL_CONTEXT (decl) = fat_type;
+ decl = gfc_add_field_to_struct_1 (fat_type,
+ get_identifier ("offset"),
+ gfc_array_index_type, &chain);
TREE_NO_WARNING (decl) = 1;
- fieldlist = chainon (fieldlist, decl);
/* Add the dtype component. */
- decl = build_decl (input_location,
- FIELD_DECL, get_identifier ("dtype"),
- gfc_array_index_type);
- DECL_CONTEXT (decl) = fat_type;
+ decl = gfc_add_field_to_struct_1 (fat_type,
+ get_identifier ("dtype"),
+ gfc_array_index_type, &chain);
TREE_NO_WARNING (decl) = 1;
- fieldlist = chainon (fieldlist, decl);
/* Build the array type for the stride and bound components. */
arraytype =
@@ -1585,15 +1574,12 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
gfc_index_zero_node,
gfc_rank_cst[codimen + dimen - 1]));
- decl = build_decl (input_location,
- FIELD_DECL, get_identifier ("dim"), arraytype);
- DECL_CONTEXT (decl) = fat_type;
+ decl = gfc_add_field_to_struct_1 (fat_type,
+ get_identifier ("dim"),
+ arraytype, &chain);
TREE_NO_WARNING (decl) = 1;
- fieldlist = chainon (fieldlist, decl);
/* Finish off the type. */
- TYPE_FIELDS (fat_type) = fieldlist;
-
gfc_finish_type (fat_type);
TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (fat_type)) = 1;
@@ -1631,6 +1617,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
sprintf (name, "array" GFC_RANK_PRINTF_FORMAT "_%.*s", dimen + codimen,
GFC_MAX_SYMBOL_LEN, type_name);
TYPE_NAME (fat_type) = get_identifier (name);
+ TYPE_NAMELESS (fat_type) = 1;
GFC_DESCRIPTOR_TYPE_P (fat_type) = 1;
TYPE_LANG_SPECIFIC (fat_type)
@@ -1853,26 +1840,41 @@ gfc_finish_type (tree type)
}
/* Add a field of given NAME and TYPE to the context of a UNION_TYPE
- or RECORD_TYPE pointed to by STYPE. The new field is chained
- to the fieldlist pointed to by FIELDLIST.
+ or RECORD_TYPE pointed to by CONTEXT. The new field is chained
+ to the end of the field list pointed to by *CHAIN.
Returns a pointer to the new field. */
-tree
-gfc_add_field_to_struct (tree *fieldlist, tree context,
- tree name, tree type)
+static tree
+gfc_add_field_to_struct_1 (tree context, tree name, tree type, tree **chain)
{
- tree decl;
-
- decl = build_decl (input_location,
- FIELD_DECL, name, type);
+ tree decl = build_decl (input_location, FIELD_DECL, name, type);
DECL_CONTEXT (decl) = context;
+ DECL_CHAIN (decl) = NULL_TREE;
+ if (TYPE_FIELDS (context) == NULL_TREE)
+ TYPE_FIELDS (context) = decl;
+ if (chain != NULL)
+ {
+ if (*chain != NULL)
+ **chain = decl;
+ *chain = &DECL_CHAIN (decl);
+ }
+
+ return decl;
+}
+
+/* Like `gfc_add_field_to_struct_1', but adds alignment
+ information. */
+
+tree
+gfc_add_field_to_struct (tree context, tree name, tree type, tree **chain)
+{
+ tree decl = gfc_add_field_to_struct_1 (context, name, type, chain);
+
DECL_INITIAL (decl) = 0;
DECL_ALIGN (decl) = 0;
DECL_USER_ALIGN (decl) = 0;
- TREE_CHAIN (decl) = NULL_TREE;
- *fieldlist = chainon (*fieldlist, decl);
return decl;
}
@@ -1948,8 +1950,9 @@ gfc_get_ppc_type (gfc_component* c)
tree
gfc_get_derived_type (gfc_symbol * derived)
{
- tree typenode = NULL, field = NULL, field_type = NULL, fieldlist = NULL;
+ tree typenode = NULL, field = NULL, field_type = NULL;
tree canonical = NULL_TREE;
+ tree *chain = NULL;
bool got_canonical = false;
gfc_component *c;
gfc_dt_list *dt;
@@ -1969,14 +1972,6 @@ gfc_get_derived_type (gfc_symbol * derived)
else
derived->backend_decl = pfunc_type_node;
- /* Create a backend_decl for the __c_ptr_c_address field. */
- derived->components->backend_decl =
- gfc_add_field_to_struct (&(derived->backend_decl->type.values),
- derived->backend_decl,
- get_identifier (derived->components->name),
- gfc_typenode_for_spec (
- &(derived->components->ts)));
-
derived->ts.kind = gfc_index_integer_kind;
derived->ts.type = BT_INTEGER;
/* Set the f90_type to BT_VOID as a way to recognize something of type
@@ -2098,7 +2093,6 @@ gfc_get_derived_type (gfc_symbol * derived)
/* Build the type member list. Install the newly created RECORD_TYPE
node as DECL_CONTEXT of each FIELD_DECL. */
- fieldlist = NULL_TREE;
for (c = derived->components; c; c = c->next)
{
if (c->attr.proc_pointer)
@@ -2145,8 +2139,14 @@ gfc_get_derived_type (gfc_symbol * derived)
&& !c->attr.proc_pointer)
field_type = build_pointer_type (field_type);
- field = gfc_add_field_to_struct (&fieldlist, typenode,
- get_identifier (c->name), field_type);
+ /* vtype fields can point to different types to the base type. */
+ if (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.vtype)
+ field_type = build_pointer_type_for_mode (TREE_TYPE (field_type),
+ ptr_mode, true);
+
+ field = gfc_add_field_to_struct (typenode,
+ get_identifier (c->name),
+ field_type, &chain);
if (c->loc.lb)
gfc_set_decl_location (field, &c->loc);
else if (derived->declared_at.lb)
@@ -2159,9 +2159,7 @@ gfc_get_derived_type (gfc_symbol * derived)
c->backend_decl = field;
}
- /* Now we have the final fieldlist. Record it, then lay out the
- derived type, including the fields. */
- TYPE_FIELDS (typenode) = fieldlist;
+ /* Now lay out the derived type, including the fields. */
if (canonical)
TYPE_CANONICAL (typenode) = canonical;
@@ -2224,8 +2222,7 @@ static tree
gfc_get_mixed_entry_union (gfc_namespace *ns)
{
tree type;
- tree decl;
- tree fieldlist;
+ tree *chain = NULL;
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_entry_list *el, *el2;
@@ -2238,7 +2235,6 @@ gfc_get_mixed_entry_union (gfc_namespace *ns)
type = make_node (UNION_TYPE);
TYPE_NAME (type) = get_identifier (name);
- fieldlist = NULL;
for (el = ns->entries; el; el = el->next)
{
@@ -2248,19 +2244,12 @@ gfc_get_mixed_entry_union (gfc_namespace *ns)
break;
if (el == el2)
- {
- decl = build_decl (input_location,
- FIELD_DECL,
- get_identifier (el->sym->result->name),
- gfc_sym_type (el->sym->result));
- DECL_CONTEXT (decl) = type;
- fieldlist = chainon (fieldlist, decl);
- }
+ gfc_add_field_to_struct_1 (type,
+ get_identifier (el->sym->result->name),
+ gfc_sym_type (el->sym->result), &chain);
}
/* Finish off the type. */
- TYPE_FIELDS (type) = fieldlist;
-
gfc_finish_type (type);
TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type)) = 1;
return type;
@@ -2552,16 +2541,16 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
elem_size = fold_convert (gfc_array_index_type, TYPE_SIZE_UNIT (etype));
field = TYPE_FIELDS (TYPE_MAIN_VARIANT (type));
data_off = byte_position (field);
- field = TREE_CHAIN (field);
- field = TREE_CHAIN (field);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
+ field = DECL_CHAIN (field);
+ field = DECL_CHAIN (field);
dim_off = byte_position (field);
dim_size = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (field)));
field = TYPE_FIELDS (TREE_TYPE (TREE_TYPE (field)));
stride_suboff = byte_position (field);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
lower_suboff = byte_position (field);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
upper_suboff = byte_position (field);
t = base_decl;
diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h
index 0b962114b96..7e79480c438 100644
--- a/gcc/fortran/trans-types.h
+++ b/gcc/fortran/trans-types.h
@@ -77,7 +77,7 @@ tree gfc_get_array_type_bounds (tree, int, int, tree *, tree *, int,
tree gfc_get_nodesc_array_type (tree, gfc_array_spec *, gfc_packed, bool);
/* Add a field of given name and type to a UNION_TYPE or RECORD_TYPE. */
-tree gfc_add_field_to_struct (tree *, tree, tree, tree);
+tree gfc_add_field_to_struct (tree, tree, tree, tree **);
/* Layout and output debugging info for a type. */
void gfc_finish_type (tree);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 43b69d5a2b0..003f6090c2f 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "gimple.h" /* For create_tmp_var_raw. */
#include "tree-iterator.h"
-#include "toplev.h" /* For internal_error. */
+#include "diagnostic-core.h" /* For internal_error. */
#include "defaults.h"
#include "flags.h"
#include "gfortran.h"
@@ -57,7 +57,7 @@ gfc_advance_chain (tree t, int n)
for (; n > 0; n--)
{
gcc_assert (t != NULL_TREE);
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
}
return t;
}
@@ -218,8 +218,8 @@ gfc_merge_block_scope (stmtblock_t * block)
/* Add them to the parent scope. */
while (decl != NULL_TREE)
{
- next = TREE_CHAIN (decl);
- TREE_CHAIN (decl) = NULL_TREE;
+ next = DECL_CHAIN (decl);
+ DECL_CHAIN (decl) = NULL_TREE;
pushdecl (decl);
decl = next;
@@ -977,31 +977,47 @@ gfc_call_realloc (stmtblock_t * block, tree mem, tree size)
return res;
}
-/* Add a statement to a block. */
-void
-gfc_add_expr_to_block (stmtblock_t * block, tree expr)
-{
- gcc_assert (block);
+/* Add an expression to another one, either at the front or the back. */
+static void
+add_expr_to_chain (tree* chain, tree expr, bool front)
+{
if (expr == NULL_TREE || IS_EMPTY_STMT (expr))
return;
- if (block->head)
+ if (*chain)
{
- if (TREE_CODE (block->head) != STATEMENT_LIST)
+ if (TREE_CODE (*chain) != STATEMENT_LIST)
{
tree tmp;
- tmp = block->head;
- block->head = NULL_TREE;
- append_to_statement_list (tmp, &block->head);
+ tmp = *chain;
+ *chain = NULL_TREE;
+ append_to_statement_list (tmp, chain);
}
- append_to_statement_list (expr, &block->head);
+
+ if (front)
+ {
+ tree_stmt_iterator i;
+
+ i = tsi_start (*chain);
+ tsi_link_before (&i, expr, TSI_CONTINUE_LINKING);
+ }
+ else
+ append_to_statement_list (expr, chain);
}
else
- /* Don't bother creating a list if we only have a single statement. */
- block->head = expr;
+ *chain = expr;
+}
+
+/* Add a statement to a block. */
+
+void
+gfc_add_expr_to_block (stmtblock_t * block, tree expr)
+{
+ gcc_assert (block);
+ add_expr_to_chain (&block->head, expr, false);
}
@@ -1393,3 +1409,55 @@ gfc_generate_module_code (gfc_namespace * ns)
}
}
+
+/* Initialize an init/cleanup block with existing code. */
+
+void
+gfc_start_wrapped_block (gfc_wrapped_block* block, tree code)
+{
+ gcc_assert (block);
+
+ block->init = NULL_TREE;
+ block->code = code;
+ block->cleanup = NULL_TREE;
+}
+
+
+/* Add a new pair of initializers/clean-up code. */
+
+void
+gfc_add_init_cleanup (gfc_wrapped_block* block, tree init, tree cleanup)
+{
+ gcc_assert (block);
+
+ /* The new pair of init/cleanup should be "wrapped around" the existing
+ block of code, thus the initialization is added to the front and the
+ cleanup to the back. */
+ add_expr_to_chain (&block->init, init, true);
+ add_expr_to_chain (&block->cleanup, cleanup, false);
+}
+
+
+/* Finish up a wrapped block by building a corresponding try-finally expr. */
+
+tree
+gfc_finish_wrapped_block (gfc_wrapped_block* block)
+{
+ tree result;
+
+ gcc_assert (block);
+
+ /* Build the final expression. For this, just add init and body together,
+ and put clean-up with that into a TRY_FINALLY_EXPR. */
+ result = block->init;
+ add_expr_to_chain (&result, block->code, false);
+ if (block->cleanup)
+ result = build2 (TRY_FINALLY_EXPR, void_type_node, result, block->cleanup);
+
+ /* Clear the block. */
+ block->init = NULL_TREE;
+ block->code = NULL_TREE;
+ block->cleanup = NULL_TREE;
+
+ return result;
+}
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 02361fc8466..9872e83df9e 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -114,8 +114,8 @@ typedef struct gfc_ss_info
tree stride[GFC_MAX_DIMENSIONS];
tree delta[GFC_MAX_DIMENSIONS];
- /* Translation from scalarizer dimensions to actual dimensions.
- actual = dim[scalarizer] */
+ /* Translation from loop dimensions to actual dimensions.
+ actual_dim = dim[loop_dim] */
int dim[GFC_MAX_DIMENSIONS];
}
gfc_ss_info;
@@ -240,6 +240,9 @@ typedef struct gfc_loopinfo
/* Order in which the dimensions should be looped, innermost first. */
int order[GFC_MAX_DIMENSIONS];
+ /* Enum to control loop reversal. */
+ gfc_reverse reverse[GFC_MAX_DIMENSIONS];
+
/* The number of dimensions for which a temporary is used. */
int temp_dim;
@@ -258,6 +261,29 @@ typedef struct
gfc_saved_var;
+/* Store information about a block of code together with special
+ initialization and clean-up code. This can be used to incrementally add
+ init and cleanup, and in the end put everything together to a
+ try-finally expression. */
+typedef struct
+{
+ tree init;
+ tree cleanup;
+ tree code;
+}
+gfc_wrapped_block;
+
+
+/* Initialize an init/cleanup block. */
+void gfc_start_wrapped_block (gfc_wrapped_block* block, tree code);
+/* Add a pair of init/cleanup code to the block. Each one might be a
+ NULL_TREE if not required. */
+void gfc_add_init_cleanup (gfc_wrapped_block* block, tree init, tree cleanup);
+/* Finalize the block, that is, create a single expression encapsulating the
+ original code together with init and clean-up code. */
+tree gfc_finish_wrapped_block (gfc_wrapped_block* block);
+
+
/* Advance the SS chain to the next term. */
void gfc_advance_se_ss_chain (gfc_se *);
@@ -279,7 +305,7 @@ void gfc_make_safe_expr (gfc_se * se);
void gfc_conv_string_parameter (gfc_se * se);
/* Compare two strings. */
-tree gfc_build_compare_string (tree, tree, tree, tree, int);
+tree gfc_build_compare_string (tree, tree, tree, tree, int, enum tree_code);
/* Add an item to the end of TREE_LIST. */
tree gfc_chainon_list (tree, tree);
@@ -299,6 +325,7 @@ void gfc_conv_expr_type (gfc_se * se, gfc_expr *, tree);
/* trans-expr.c */
void gfc_conv_scalar_char_value (gfc_symbol *sym, gfc_se *se, gfc_expr **expr);
+tree gfc_string_to_single_character (tree len, tree str, int kind);
/* Find the decl containing the auxiliary variables for assigned variables. */
void gfc_conv_label_variable (gfc_se * se, gfc_expr * expr);
@@ -314,7 +341,7 @@ int gfc_is_intrinsic_libcall (gfc_expr *);
/* Used to call ordinary functions/subroutines
and procedure pointer components. */
int gfc_conv_procedure_call (gfc_se *, gfc_symbol *, gfc_actual_arglist *,
- gfc_expr *, tree);
+ gfc_expr *, VEC(tree,gc) *);
void gfc_conv_subref_array_arg (gfc_se *, gfc_expr *, int, sym_intent, bool);
@@ -384,9 +411,6 @@ tree gfc_build_label_decl (tree);
Do not use if the function has an explicit result variable. */
tree gfc_get_fake_result_decl (gfc_symbol *, int);
-/* Get the return label for the current function. */
-tree gfc_get_return_label (void);
-
/* Add a decl to the binding level for the current function. */
void gfc_add_decl_to_function (tree);
@@ -403,7 +427,7 @@ tree gfc_get_symbol_decl (gfc_symbol *);
tree gfc_conv_initializer (gfc_expr *, gfc_typespec *, tree, bool, bool);
/* Assign a default initializer to a derived type. */
-tree gfc_init_default_dt (gfc_symbol *, tree, bool);
+void gfc_init_default_dt (gfc_symbol *, stmtblock_t *, bool);
/* Substitute a temporary variable in place of the real one. */
void gfc_shadow_sym (gfc_symbol *, tree, gfc_saved_var *);
@@ -432,6 +456,8 @@ void gfc_generate_function_code (gfc_namespace *);
void gfc_generate_block_data (gfc_namespace *);
/* Output a decl for a module variable. */
void gfc_generate_module_vars (gfc_namespace *);
+/* Get the appropriate return statement for a procedure. */
+tree gfc_generate_return (void);
struct GTY(()) module_htab_entry {
const char *name;
@@ -502,12 +528,14 @@ void gfc_trans_io_runtime_check (tree, tree, int, const char *, stmtblock_t *);
void gfc_build_io_library_fndecls (void);
/* Build a function decl for a library function. */
tree gfc_build_library_function_decl (tree, tree, int, ...);
+tree gfc_build_library_function_decl_with_spec (tree name, const char *spec,
+ tree rettype, int nargs, ...);
/* Process the local variable decls of a block construct. */
void gfc_process_block_locals (gfc_namespace*);
/* Output initialization/clean-up code that was deferred. */
-tree gfc_trans_deferred_vars (gfc_symbol*, tree);
+void gfc_trans_deferred_vars (gfc_symbol*, gfc_wrapped_block *);
/* somewhere! */
tree pushdecl (tree);
diff --git a/gcc/function.c b/gcc/function.c
index 3a7bb25dac6..5a308f44505 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1793,7 +1793,7 @@ instantiate_decls_1 (tree let)
{
tree t;
- for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t))
+ for (t = BLOCK_VARS (let); t; t = DECL_CHAIN (t))
{
if (DECL_RTL_SET_P (t))
instantiate_decl_rtl (DECL_RTL (t));
@@ -1815,10 +1815,11 @@ instantiate_decls_1 (tree let)
static void
instantiate_decls (tree fndecl)
{
- tree decl, t, next;
+ tree decl;
+ unsigned ix;
/* Process all parameters of the function. */
- for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
+ for (decl = DECL_ARGUMENTS (fndecl); decl; decl = DECL_CHAIN (decl))
{
instantiate_decl_rtl (DECL_RTL (decl));
instantiate_decl_rtl (DECL_INCOMING_RTL (decl));
@@ -1832,16 +1833,10 @@ instantiate_decls (tree fndecl)
/* Now process all variables defined in the function or its subblocks. */
instantiate_decls_1 (DECL_INITIAL (fndecl));
- t = cfun->local_decls;
- cfun->local_decls = NULL_TREE;
- for (; t; t = next)
- {
- next = TREE_CHAIN (t);
- decl = TREE_VALUE (t);
- if (DECL_RTL_SET_P (decl))
- instantiate_decl_rtl (DECL_RTL (decl));
- ggc_free (t);
- }
+ FOR_EACH_LOCAL_DECL (cfun, ix, decl)
+ if (DECL_RTL_SET_P (decl))
+ instantiate_decl_rtl (DECL_RTL (decl));
+ VEC_free (tree, gc, cfun->local_decls);
}
/* Pass through the INSNS of function FNDECL and convert virtual register
@@ -2227,7 +2222,7 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all)
VEC(tree, heap) *fnargs = NULL;
tree arg;
- for (arg = DECL_ARGUMENTS (fndecl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (fndecl); arg; arg = DECL_CHAIN (arg))
VEC_safe_push (tree, heap, fnargs, arg);
all->orig_fnargs = DECL_ARGUMENTS (fndecl);
@@ -2246,7 +2241,7 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all)
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
- TREE_CHAIN (decl) = all->orig_fnargs;
+ DECL_CHAIN (decl) = all->orig_fnargs;
all->orig_fnargs = decl;
VEC_safe_insert (tree, heap, fnargs, 0, decl);
@@ -2277,7 +2272,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm,
/* NAMED_ARG is a misnomer. We really mean 'non-variadic'. */
if (!cfun->stdarg)
data->named_arg = 1; /* No variadic parms. */
- else if (TREE_CHAIN (parm))
+ else if (DECL_CHAIN (parm))
data->named_arg = 1; /* Not the last non-variadic parm. */
else if (targetm.calls.strict_argument_naming (&all->args_so_far))
data->named_arg = 1; /* Only variadic ones are unnamed. */
@@ -2859,6 +2854,21 @@ assign_parm_setup_block (struct assign_parm_data_all *all,
SET_DECL_RTL (parm, stack_parm);
}
+/* A subroutine of assign_parm_setup_reg, called through note_stores.
+ This collects sets and clobbers of hard registers in a HARD_REG_SET,
+ which is pointed to by DATA. */
+static void
+record_hard_reg_sets (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
+{
+ HARD_REG_SET *pset = (HARD_REG_SET *)data;
+ if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER)
+ {
+ int nregs = hard_regno_nregs[REGNO (x)][GET_MODE (x)];
+ while (nregs-- > 0)
+ SET_HARD_REG_BIT (*pset, REGNO (x) + nregs);
+ }
+}
+
/* A subroutine of assign_parms. Allocate a pseudo to hold the current
parameter. Get it there. Perform all ABI specified conversions. */
@@ -2866,10 +2876,12 @@ static void
assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
struct assign_parm_data_one *data)
{
- rtx parmreg;
+ rtx parmreg, validated_mem;
+ rtx equiv_stack_parm;
enum machine_mode promoted_nominal_mode;
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (parm));
bool did_conversion = false;
+ bool need_conversion, moved;
/* Store the parm in a pseudoregister during the function, but we may
need to do it in a wider mode. Using 2 here makes the result
@@ -2898,11 +2910,19 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
/* Copy the value into the register, thus bridging between
assign_parm_find_data_types and expand_expr_real_1. */
- if (data->nominal_mode != data->passed_mode
- || promoted_nominal_mode != data->promoted_mode)
- {
- int save_tree_used;
+ equiv_stack_parm = data->stack_parm;
+ validated_mem = validize_mem (data->entry_parm);
+
+ need_conversion = (data->nominal_mode != data->passed_mode
+ || promoted_nominal_mode != data->promoted_mode);
+ moved = false;
+
+ if (need_conversion
+ && GET_MODE_CLASS (data->nominal_mode) == MODE_INT
+ && data->nominal_mode == data->passed_mode
+ && data->nominal_mode == GET_MODE (data->entry_parm))
+ {
/* ENTRY_PARM has been converted to PROMOTED_MODE, its
mode, by the caller. We now have to convert it to
NOMINAL_MODE, if different. However, PARMREG may be in
@@ -2918,13 +2938,71 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
In addition, the conversion may involve a call, which could
clobber parameters which haven't been copied to pseudo
- registers yet. Therefore, we must first copy the parm to
- a pseudo reg here, and save the conversion until after all
+ registers yet.
+
+ First, we try to emit an insn which performs the necessary
+ conversion. We verify that this insn does not clobber any
+ hard registers. */
+
+ enum insn_code icode;
+ rtx op0, op1;
+
+ icode = can_extend_p (promoted_nominal_mode, data->passed_mode,
+ unsignedp);
+
+ op0 = parmreg;
+ op1 = validated_mem;
+ if (icode != CODE_FOR_nothing
+ && insn_data[icode].operand[0].predicate (op0, promoted_nominal_mode)
+ && insn_data[icode].operand[1].predicate (op1, data->passed_mode))
+ {
+ enum rtx_code code = unsignedp ? ZERO_EXTEND : SIGN_EXTEND;
+ rtx insn, insns;
+ HARD_REG_SET hardregs;
+
+ start_sequence ();
+ insn = gen_extend_insn (op0, op1, promoted_nominal_mode,
+ data->passed_mode, unsignedp);
+ emit_insn (insn);
+ insns = get_insns ();
+
+ moved = true;
+ CLEAR_HARD_REG_SET (hardregs);
+ for (insn = insns; insn && moved; insn = NEXT_INSN (insn))
+ {
+ if (INSN_P (insn))
+ note_stores (PATTERN (insn), record_hard_reg_sets,
+ &hardregs);
+ if (!hard_reg_set_empty_p (hardregs))
+ moved = false;
+ }
+
+ end_sequence ();
+
+ if (moved)
+ {
+ emit_insn (insns);
+ if (equiv_stack_parm != NULL_RTX)
+ equiv_stack_parm = gen_rtx_fmt_e (code, GET_MODE (parmreg),
+ equiv_stack_parm);
+ }
+ }
+ }
+
+ if (moved)
+ /* Nothing to do. */
+ ;
+ else if (need_conversion)
+ {
+ /* We did not have an insn to convert directly, or the sequence
+ generated appeared unsafe. We must first copy the parm to a
+ pseudo reg, and save the conversion until after all
parameters have been moved. */
+ int save_tree_used;
rtx tempreg = gen_reg_rtx (GET_MODE (data->entry_parm));
- emit_move_insn (tempreg, validize_mem (data->entry_parm));
+ emit_move_insn (tempreg, validated_mem);
push_to_sequence2 (all->first_conversion_insn, all->last_conversion_insn);
tempreg = convert_to_mode (data->nominal_mode, tempreg, unsignedp);
@@ -2954,7 +3032,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
did_conversion = true;
}
else
- emit_move_insn (parmreg, validize_mem (data->entry_parm));
+ emit_move_insn (parmreg, validated_mem);
/* If we were passed a pointer but the actual value can safely live
in a register, put it in one. */
@@ -3039,7 +3117,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
}
else if ((set = single_set (linsn)) != 0
&& SET_DEST (set) == parmreg)
- set_unique_reg_note (linsn, REG_EQUIV, data->stack_parm);
+ set_unique_reg_note (linsn, REG_EQUIV, equiv_stack_parm);
}
/* For pointer data type, suggest pointer register. */
@@ -3250,7 +3328,7 @@ assign_parms (tree fndecl)
}
}
- if (cfun->stdarg && !TREE_CHAIN (parm))
+ if (cfun->stdarg && !DECL_CHAIN (parm))
assign_parms_setup_varargs (&all, &data, false);
/* Find out where the parameter arrives in this function. */
@@ -3830,7 +3908,7 @@ setjmp_vars_warning (bitmap setjmp_crosses, tree block)
{
tree decl, sub;
- for (decl = BLOCK_VARS (block); decl; decl = TREE_CHAIN (decl))
+ for (decl = BLOCK_VARS (block); decl; decl = DECL_CHAIN (decl))
{
if (TREE_CODE (decl) == VAR_DECL
&& DECL_RTL_SET_P (decl)
@@ -3852,7 +3930,7 @@ setjmp_args_warning (bitmap setjmp_crosses)
{
tree decl;
for (decl = DECL_ARGUMENTS (current_function_decl);
- decl; decl = TREE_CHAIN (decl))
+ decl; decl = DECL_CHAIN (decl))
if (DECL_RTL (decl) != 0
&& REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (setjmp_crosses, REGNO (DECL_RTL (decl))))
@@ -4694,7 +4772,7 @@ do_warn_unused_parameter (tree fn)
tree decl;
for (decl = DECL_ARGUMENTS (fn);
- decl; decl = TREE_CHAIN (decl))
+ decl; decl = DECL_CHAIN (decl))
if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
&& DECL_NAME (decl) && !DECL_ARTIFICIAL (decl)
&& !TREE_NO_WARNING (decl))
diff --git a/gcc/function.h b/gcc/function.h
index 617034872cc..fec0168a5d2 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -503,8 +503,8 @@ struct GTY(()) function {
pointer. */
tree nonlocal_goto_save_area;
- /* List of function local variables, functions, types and constants. */
- tree local_decls;
+ /* Vector of function local variables, functions, types and constants. */
+ VEC(tree,gc) *local_decls;
/* For md files. */
@@ -609,6 +609,17 @@ struct GTY(()) function {
unsigned int is_thunk : 1;
};
+/* Add the decl D to the local_decls list of FUN. */
+
+static inline void
+add_local_decl (struct function *fun, tree d)
+{
+ VEC_safe_push (tree, gc, fun->local_decls, d);
+}
+
+#define FOR_EACH_LOCAL_DECL(FUN, I, D) \
+ FOR_EACH_VEC_ELT_REVERSE (tree, (FUN)->local_decls, I, D)
+
/* If va_list_[gf]pr_size is set to this, it means we don't know how
many units need to be saved. */
#define VA_LIST_MAX_GPR_SIZE 255
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index c96a0a301ec..a6f52cdce5b 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "timevar.h"
diff --git a/gcc/gcse.c b/gcc/gcse.c
index b0a18689326..6f345ccbce6 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -143,6 +143,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
@@ -169,6 +170,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "dbgcnt.h"
#include "target.h"
+#include "gcse.h"
/* We support GCSE via Partial Redundancy Elimination. PRE optimizations
are a superset of those done by classic GCSE.
@@ -262,6 +264,11 @@ along with GCC; see the file COPYING3. If not see
/* GCSE global vars. */
+struct target_gcse default_target_gcse;
+#if SWITCHABLE_TARGET
+struct target_gcse *this_target_gcse = &default_target_gcse;
+#endif
+
/* Set to non-zero if CSE should run after all GCSE optimizations are done. */
int flag_rerun_cse_after_global_opts;
@@ -538,10 +545,10 @@ static bool is_too_expensive (const char *);
/* Misc. utilities. */
-/* Nonzero for each mode that supports (set (reg) (reg)).
- This is trivially true for integer and floating point values.
- It may or may not be true for condition codes. */
-static char can_copy[(int) NUM_MACHINE_MODES];
+#define can_copy \
+ (this_target_gcse->x_can_copy)
+#define can_copy_init_p \
+ (this_target_gcse->x_can_copy_init_p)
/* Compute which modes support reg/reg copy operations. */
@@ -578,8 +585,6 @@ compute_can_copy (void)
bool
can_copy_p (enum machine_mode mode)
{
- static bool can_copy_init_p = false;
-
if (! can_copy_init_p)
{
compute_can_copy ();
diff --git a/gcc/gcse.h b/gcc/gcse.h
new file mode 100644
index 00000000000..b4ed7f22fa1
--- /dev/null
+++ b/gcc/gcse.h
@@ -0,0 +1,43 @@
+/* Global common subexpression elimination/Partial redundancy elimination
+ and global constant/copy propagation for GNU compiler.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_GCSE_H
+#define GCC_GCSE_H
+
+/* Target-dependent globals. */
+struct target_gcse {
+ /* Nonzero for each mode that supports (set (reg) (reg)).
+ This is trivially true for integer and floating point values.
+ It may or may not be true for condition codes. */
+ char x_can_copy[(int) NUM_MACHINE_MODES];
+
+ /* True if the previous field has been initialized. */
+ bool x_can_copy_init_p;
+};
+
+extern GTY(()) struct target_gcse default_target_gcse;
+#if SWITCHABLE_TARGET
+extern struct target_gcse *this_target_gcse;
+#else
+#define this_target_gcse (&default_target_gcse)
+#endif
+
+#endif
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index a86332d49e3..2213b2e134f 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -4920,7 +4920,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"recog.h\"\n");
printf ("#include \"regs.h\"\n");
printf ("#include \"output.h\"\n");
- printf ("#include \"toplev.h\"\n");
+ printf ("#include \"diagnostic-core.h\"\n"
+ "#include \"toplev.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"function.h\"\n");
printf ("\n");
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index a268aa053da..88d358cb86f 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -7854,12 +7854,15 @@ output_automata_list_min_issue_delay_code (automata_list_el_t automata_list)
{
fprintf (output_file, ") / %d];\n",
automaton->min_issue_delay_table_compression_factor);
- fprintf (output_file, " %s = (%s >> (8 - (",
+ fprintf (output_file, " %s = (%s >> (8 - ((",
TEMPORARY_VARIABLE_NAME, TEMPORARY_VARIABLE_NAME);
output_translate_vect_name (output_file, automaton);
+ fprintf (output_file, " [%s] + ", INTERNAL_INSN_CODE_NAME);
+ fprintf (output_file, "%s->", CHIP_PARAMETER_NAME);
+ output_chip_member_name (output_file, automaton);
+ fprintf (output_file, " * %d)", automaton->insn_equiv_classes_num);
fprintf
- (output_file, " [%s] %% %d + 1) * %d)) & %d;\n",
- INTERNAL_INSN_CODE_NAME,
+ (output_file, " %% %d + 1) * %d)) & %d;\n",
automaton->min_issue_delay_table_compression_factor,
8 / automaton->min_issue_delay_table_compression_factor,
(1 << (8 / automaton->min_issue_delay_table_compression_factor))
@@ -9556,7 +9559,7 @@ main (int argc, char **argv)
"#include \"regs.h\"\n"
"#include \"output.h\"\n"
"#include \"insn-attr.h\"\n"
- "#include \"toplev.h\"\n"
+ "#include \"diagnostic-core.h\"\n"
"#include \"flags.h\"\n"
"#include \"function.h\"\n"
"#include \"emit-rtl.h\"\n");
@@ -9565,6 +9568,16 @@ main (int argc, char **argv)
write_automata ();
}
}
+ else
+ {
+ puts ("/* Generated automatically by the program `genautomata'\n"
+ " from the machine description file `md'. */\n\n"
+ "/* There is no automaton, but ISO C forbids empty\n"
+ " translation units, so include a header file with some\n"
+ " declarations, and its pre-requisite header file. */\n"
+ "#include \"config.h\"\n"
+ "#include \"system.h\"\n");
+ }
fflush (stdout);
return (ferror (stdout) != 0 || have_error
diff --git a/gcc/genconditions.c b/gcc/genconditions.c
index 2d93c3470d6..f356519935c 100644
--- a/gcc/genconditions.c
+++ b/gcc/genconditions.c
@@ -86,6 +86,7 @@ write_header (void)
#include \"flags.h\"\n\
#include \"hard-reg-set.h\"\n\
#include \"resource.h\"\n\
+#include \"diagnostic-core.h\"\n\
#include \"toplev.h\"\n\
#include \"reload.h\"\n\
#include \"tm-constrs.h\"\n");
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 98ec42fe0c3..fbf134461e8 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -862,6 +862,7 @@ from the machine description file `md'. */\n\n");
printf ("#include \"recog.h\"\n");
printf ("#include \"resource.h\"\n");
printf ("#include \"reload.h\"\n");
+ printf ("#include \"diagnostic-core.h\"\n");
printf ("#include \"toplev.h\"\n");
printf ("#include \"regs.h\"\n");
printf ("#include \"tm-constrs.h\"\n");
diff --git a/gcc/genenums.c b/gcc/genenums.c
index 8cb48360f62..f5c18f99206 100644
--- a/gcc/genenums.c
+++ b/gcc/genenums.c
@@ -56,6 +56,7 @@ main (int argc, char **argv)
puts (" from the machine description file. */\n");
puts ("#include \"config.h\"\n");
puts ("#include \"system.h\"\n");
+ puts ("#include \"insn-constants.h\"\n");
traverse_enum_types (print_enum_type, 0);
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 2bf9779f381..694069c739e 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -365,6 +365,7 @@ print_header (void)
#include \"rtl.h\"\n\
#include \"insn-config.h\"\n\
#include \"recog.h\"\n\
+#include \"diagnostic-core.h\"\n\
#include \"toplev.h\"\n\
\n\
/* This variable is used as the \"location\" of any missing operand\n\
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index b16a33ac04d..9a7de9fb9a9 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1571,7 +1571,7 @@ open_base_files (void)
"optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
"tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
"cfglayout.h", "except.h", "output.h", "gimple.h", "cfgloop.h",
- "target.h", "ipa-prop.h", "lto-streamer.h", NULL
+ "target.h", "ipa-prop.h", "lto-streamer.h", "target-globals.h", NULL
};
const char *const *ifp;
outf_p gtype_desc_c;
@@ -3174,8 +3174,81 @@ finish_root_table (struct flist *flp, const char *pfx, const char *lastname,
}
}
+/* Write the first three fields (pointer, count and stride) for
+ root NAME to F. V and LINE are as for write_root.
+
+ Return true if the entry could be written; return false on error. */
+
+static bool
+start_root_entry (outf_p f, pair_p v, const char *name, struct fileloc *line)
+{
+ type_p ap;
+
+ if (!v)
+ {
+ error_at_line (line, "`%s' is too complex to be a root", name);
+ return false;
+ }
+
+ oprintf (f, " {\n");
+ oprintf (f, " &%s,\n", name);
+ oprintf (f, " 1");
+
+ for (ap = v->type; ap->kind == TYPE_ARRAY; ap = ap->u.a.p)
+ if (ap->u.a.len[0])
+ oprintf (f, " * (%s)", ap->u.a.len);
+ else if (ap == v->type)
+ oprintf (f, " * ARRAY_SIZE (%s)", v->name);
+ oprintf (f, ",\n");
+ oprintf (f, " sizeof (%s", v->name);
+ for (ap = v->type; ap->kind == TYPE_ARRAY; ap = ap->u.a.p)
+ oprintf (f, "[0]");
+ oprintf (f, "),\n");
+ return true;
+}
+
+/* A subroutine of write_root for writing the roots for field FIELD_NAME,
+ which has type FIELD_TYPE. Parameters F to EMIT_PCH are the parameters
+ of the caller. */
+
+static void
+write_field_root (outf_p f, pair_p v, type_p type, const char *name,
+ int has_length, struct fileloc *line, const char *if_marked,
+ bool emit_pch, type_p field_type, const char *field_name)
+{
+ /* If the field reference is relative to V, rather than to some
+ subcomponent of V, we can mark any subarrays with a single stride.
+ We're effectively treating the field as a global variable in its
+ own right. */
+ if (v && type == v->type)
+ {
+ struct pair newv;
+
+ newv = *v;
+ newv.type = field_type;
+ newv.name = ACONCAT ((v->name, ".", field_name, NULL));
+ v = &newv;
+ }
+ /* Otherwise, any arrays nested in the structure are too complex to
+ handle. */
+ else if (field_type->kind == TYPE_ARRAY)
+ v = NULL;
+ write_root (f, v, field_type, ACONCAT ((name, ".", field_name, NULL)),
+ has_length, line, if_marked, emit_pch);
+}
+
/* Write out to F the table entry and any marker routines needed to
- mark NAME as TYPE. The original variable is V, at LINE.
+ mark NAME as TYPE. V can be one of three values:
+
+ - null, if NAME is too complex to represent using a single
+ count and stride. In this case, it is an error for NAME to
+ contain any gc-ed data.
+
+ - the outermost array that contains NAME, if NAME is part of an array.
+
+ - the C variable that contains NAME, if NAME is not part of an array.
+
+ LINE is the line of the C source that declares the root variable.
HAS_LENGTH is nonzero iff V was a variable-length array. IF_MARKED
is nonzero iff we are building the root table for hash table caches. */
@@ -3232,27 +3305,18 @@ write_root (outf_p f, pair_p v, type_p type, const char *name, int has_length,
validf = ufld;
}
if (validf != NULL)
- {
- char *newname;
- newname = xasprintf ("%s.%s.%s",
- name, fld->name, validf->name);
- write_root (f, v, validf->type, newname, 0, line,
- if_marked, emit_pch);
- free (newname);
- }
+ write_field_root (f, v, type, name, 0, line, if_marked,
+ emit_pch, validf->type,
+ ACONCAT ((fld->name, ".",
+ validf->name, NULL)));
}
else if (desc)
error_at_line (line,
"global `%s.%s' has `desc' option but is not union",
name, fld->name);
else
- {
- char *newname;
- newname = xasprintf ("%s.%s", name, fld->name);
- write_root (f, v, fld->type, newname, 0, line, if_marked,
- emit_pch);
- free (newname);
- }
+ write_field_root (f, v, type, name, 0, line, if_marked,
+ emit_pch, fld->type, fld->name);
}
}
break;
@@ -3269,22 +3333,10 @@ write_root (outf_p f, pair_p v, type_p type, const char *name, int has_length,
case TYPE_POINTER:
{
- type_p ap, tp;
-
- oprintf (f, " {\n");
- oprintf (f, " &%s,\n", name);
- oprintf (f, " 1");
-
- for (ap = v->type; ap->kind == TYPE_ARRAY; ap = ap->u.a.p)
- if (ap->u.a.len[0])
- oprintf (f, " * (%s)", ap->u.a.len);
- else if (ap == v->type)
- oprintf (f, " * ARRAY_SIZE (%s)", v->name);
- oprintf (f, ",\n");
- oprintf (f, " sizeof (%s", v->name);
- for (ap = v->type; ap->kind == TYPE_ARRAY; ap = ap->u.a.p)
- oprintf (f, "[0]");
- oprintf (f, "),\n");
+ type_p tp;
+
+ if (!start_root_entry (f, v, name, line))
+ return;
tp = type->u.p;
@@ -3331,10 +3383,9 @@ write_root (outf_p f, pair_p v, type_p type, const char *name, int has_length,
case TYPE_STRING:
{
- oprintf (f, " {\n");
- oprintf (f, " &%s,\n", name);
- oprintf (f, " 1, \n");
- oprintf (f, " sizeof (%s),\n", v->name);
+ if (!start_root_entry (f, v, name, line))
+ return;
+
oprintf (f, " (gt_pointer_walker) &gt_ggc_m_S,\n");
oprintf (f, " (gt_pointer_walker) &gt_pch_n_S\n");
oprintf (f, " },\n");
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index d0ec274842a..6bc3c3526f6 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -60,219 +60,219 @@ along with GCC; see the file COPYING3. If not see
upper-case forms of the comparison, respectively. */
static const char * const optabs[] =
-{ "convert_optab_handler (sext_optab, $B, $A)->insn_code = CODE_FOR_$(extend$a$b2$)",
- "convert_optab_handler (zext_optab, $B, $A)->insn_code = CODE_FOR_$(zero_extend$a$b2$)",
- "convert_optab_handler (sfix_optab, $B, $A)->insn_code = CODE_FOR_$(fix$F$a$I$b2$)",
- "convert_optab_handler (ufix_optab, $B, $A)->insn_code = CODE_FOR_$(fixuns$F$a$b2$)",
- "convert_optab_handler (sfixtrunc_optab, $B, $A)->insn_code = CODE_FOR_$(fix_trunc$F$a$I$b2$)",
- "convert_optab_handler (ufixtrunc_optab, $B, $A)->insn_code = CODE_FOR_$(fixuns_trunc$F$a$I$b2$)",
- "convert_optab_handler (sfloat_optab, $B, $A)->insn_code = CODE_FOR_$(float$I$a$F$b2$)",
- "convert_optab_handler (ufloat_optab, $B, $A)->insn_code = CODE_FOR_$(floatuns$I$a$F$b2$)",
- "convert_optab_handler (trunc_optab, $B, $A)->insn_code = CODE_FOR_$(trunc$a$b2$)",
- "convert_optab_handler (fract_optab, $B, $A)->insn_code = CODE_FOR_$(fract$a$b2$)",
- "convert_optab_handler (fractuns_optab, $B, $A)->insn_code = CODE_FOR_$(fractuns$I$a$Q$b2$)",
- "convert_optab_handler (fractuns_optab, $B, $A)->insn_code = CODE_FOR_$(fractuns$Q$a$I$b2$)",
- "convert_optab_handler (satfract_optab, $B, $A)->insn_code = CODE_FOR_$(satfract$a$Q$b2$)",
- "convert_optab_handler (satfractuns_optab, $B, $A)->insn_code = CODE_FOR_$(satfractuns$I$a$Q$b2$)",
- "optab_handler (add_optab, $A)->insn_code = CODE_FOR_$(add$P$a3$)",
- "optab_handler (addv_optab, $A)->insn_code =\n\
- optab_handler (add_optab, $A)->insn_code = CODE_FOR_$(add$F$a3$)",
- "optab_handler (addv_optab, $A)->insn_code = CODE_FOR_$(addv$I$a3$)",
- "optab_handler (add_optab, $A)->insn_code = CODE_FOR_$(add$Q$a3$)",
- "optab_handler (ssadd_optab, $A)->insn_code = CODE_FOR_$(ssadd$Q$a3$)",
- "optab_handler (usadd_optab, $A)->insn_code = CODE_FOR_$(usadd$Q$a3$)",
- "optab_handler (sub_optab, $A)->insn_code = CODE_FOR_$(sub$P$a3$)",
- "optab_handler (subv_optab, $A)->insn_code =\n\
- optab_handler (sub_optab, $A)->insn_code = CODE_FOR_$(sub$F$a3$)",
- "optab_handler (subv_optab, $A)->insn_code = CODE_FOR_$(subv$I$a3$)",
- "optab_handler (sub_optab, $A)->insn_code = CODE_FOR_$(sub$Q$a3$)",
- "optab_handler (sssub_optab, $A)->insn_code = CODE_FOR_$(sssub$Q$a3$)",
- "optab_handler (ussub_optab, $A)->insn_code = CODE_FOR_$(ussub$Q$a3$)",
- "optab_handler (smul_optab, $A)->insn_code = CODE_FOR_$(mul$Q$a3$)",
- "optab_handler (ssmul_optab, $A)->insn_code = CODE_FOR_$(ssmul$Q$a3$)",
- "optab_handler (usmul_optab, $A)->insn_code = CODE_FOR_$(usmul$Q$a3$)",
- "optab_handler (smul_optab, $A)->insn_code = CODE_FOR_$(mul$P$a3$)",
- "optab_handler (smulv_optab, $A)->insn_code =\n\
- optab_handler (smul_optab, $A)->insn_code = CODE_FOR_$(mul$F$a3$)",
- "optab_handler (smulv_optab, $A)->insn_code = CODE_FOR_$(mulv$I$a3$)",
- "optab_handler (umul_highpart_optab, $A)->insn_code = CODE_FOR_$(umul$a3_highpart$)",
- "optab_handler (smul_highpart_optab, $A)->insn_code = CODE_FOR_$(smul$a3_highpart$)",
- "optab_handler (smul_widen_optab, $B)->insn_code = CODE_FOR_$(mul$a$b3$)$N",
- "optab_handler (umul_widen_optab, $B)->insn_code = CODE_FOR_$(umul$a$b3$)$N",
- "optab_handler (usmul_widen_optab, $B)->insn_code = CODE_FOR_$(usmul$a$b3$)$N",
- "optab_handler (smadd_widen_optab, $B)->insn_code = CODE_FOR_$(madd$a$b4$)$N",
- "optab_handler (umadd_widen_optab, $B)->insn_code = CODE_FOR_$(umadd$a$b4$)$N",
- "optab_handler (ssmadd_widen_optab, $B)->insn_code = CODE_FOR_$(ssmadd$a$b4$)$N",
- "optab_handler (usmadd_widen_optab, $B)->insn_code = CODE_FOR_$(usmadd$a$b4$)$N",
- "optab_handler (smsub_widen_optab, $B)->insn_code = CODE_FOR_$(msub$a$b4$)$N",
- "optab_handler (umsub_widen_optab, $B)->insn_code = CODE_FOR_$(umsub$a$b4$)$N",
- "optab_handler (ssmsub_widen_optab, $B)->insn_code = CODE_FOR_$(ssmsub$a$b4$)$N",
- "optab_handler (usmsub_widen_optab, $B)->insn_code = CODE_FOR_$(usmsub$a$b4$)$N",
- "optab_handler (sdiv_optab, $A)->insn_code = CODE_FOR_$(div$a3$)",
- "optab_handler (ssdiv_optab, $A)->insn_code = CODE_FOR_$(ssdiv$Q$a3$)",
- "optab_handler (sdivv_optab, $A)->insn_code = CODE_FOR_$(div$V$I$a3$)",
- "optab_handler (udiv_optab, $A)->insn_code = CODE_FOR_$(udiv$I$a3$)",
- "optab_handler (udiv_optab, $A)->insn_code = CODE_FOR_$(udiv$Q$a3$)",
- "optab_handler (usdiv_optab, $A)->insn_code = CODE_FOR_$(usdiv$Q$a3$)",
- "optab_handler (sdivmod_optab, $A)->insn_code = CODE_FOR_$(divmod$a4$)",
- "optab_handler (udivmod_optab, $A)->insn_code = CODE_FOR_$(udivmod$a4$)",
- "optab_handler (smod_optab, $A)->insn_code = CODE_FOR_$(mod$a3$)",
- "optab_handler (umod_optab, $A)->insn_code = CODE_FOR_$(umod$a3$)",
- "optab_handler (fmod_optab, $A)->insn_code = CODE_FOR_$(fmod$a3$)",
- "optab_handler (remainder_optab, $A)->insn_code = CODE_FOR_$(remainder$a3$)",
- "optab_handler (ftrunc_optab, $A)->insn_code = CODE_FOR_$(ftrunc$F$a2$)",
- "optab_handler (and_optab, $A)->insn_code = CODE_FOR_$(and$a3$)",
- "optab_handler (ior_optab, $A)->insn_code = CODE_FOR_$(ior$a3$)",
- "optab_handler (xor_optab, $A)->insn_code = CODE_FOR_$(xor$a3$)",
- "optab_handler (ashl_optab, $A)->insn_code = CODE_FOR_$(ashl$a3$)",
- "optab_handler (ssashl_optab, $A)->insn_code = CODE_FOR_$(ssashl$Q$a3$)",
- "optab_handler (usashl_optab, $A)->insn_code = CODE_FOR_$(usashl$Q$a3$)",
- "optab_handler (ashr_optab, $A)->insn_code = CODE_FOR_$(ashr$a3$)",
- "optab_handler (lshr_optab, $A)->insn_code = CODE_FOR_$(lshr$a3$)",
- "optab_handler (rotl_optab, $A)->insn_code = CODE_FOR_$(rotl$a3$)",
- "optab_handler (rotr_optab, $A)->insn_code = CODE_FOR_$(rotr$a3$)",
- "optab_handler (vashr_optab, $A)->insn_code = CODE_FOR_$(vashr$a3$)",
- "optab_handler (vlshr_optab, $A)->insn_code = CODE_FOR_$(vlshr$a3$)",
- "optab_handler (vashl_optab, $A)->insn_code = CODE_FOR_$(vashl$a3$)",
- "optab_handler (vrotl_optab, $A)->insn_code = CODE_FOR_$(vrotl$a3$)",
- "optab_handler (vrotr_optab, $A)->insn_code = CODE_FOR_$(vrotr$a3$)",
- "optab_handler (smin_optab, $A)->insn_code = CODE_FOR_$(smin$a3$)",
- "optab_handler (smax_optab, $A)->insn_code = CODE_FOR_$(smax$a3$)",
- "optab_handler (umin_optab, $A)->insn_code = CODE_FOR_$(umin$I$a3$)",
- "optab_handler (umax_optab, $A)->insn_code = CODE_FOR_$(umax$I$a3$)",
- "optab_handler (pow_optab, $A)->insn_code = CODE_FOR_$(pow$a3$)",
- "optab_handler (atan2_optab, $A)->insn_code = CODE_FOR_$(atan2$a3$)",
- "optab_handler (neg_optab, $A)->insn_code = CODE_FOR_$(neg$P$a2$)",
- "optab_handler (negv_optab, $A)->insn_code =\n\
- optab_handler (neg_optab, $A)->insn_code = CODE_FOR_$(neg$F$a2$)",
- "optab_handler (negv_optab, $A)->insn_code = CODE_FOR_$(negv$I$a2$)",
- "optab_handler (neg_optab, $A)->insn_code = CODE_FOR_$(neg$Q$a2$)",
- "optab_handler (ssneg_optab, $A)->insn_code = CODE_FOR_$(ssneg$Q$a2$)",
- "optab_handler (usneg_optab, $A)->insn_code = CODE_FOR_$(usneg$Q$a2$)",
- "optab_handler (abs_optab, $A)->insn_code = CODE_FOR_$(abs$P$a2$)",
- "optab_handler (absv_optab, $A)->insn_code =\n\
- optab_handler (abs_optab, $A)->insn_code = CODE_FOR_$(abs$F$a2$)",
- "optab_handler (absv_optab, $A)->insn_code = CODE_FOR_$(absv$I$a2$)",
- "optab_handler (copysign_optab, $A)->insn_code = CODE_FOR_$(copysign$F$a3$)",
- "optab_handler (signbit_optab, $A)->insn_code = CODE_FOR_$(signbit$F$a2$)",
- "optab_handler (isinf_optab, $A)->insn_code = CODE_FOR_$(isinf$a2$)",
- "optab_handler (sqrt_optab, $A)->insn_code = CODE_FOR_$(sqrt$a2$)",
- "optab_handler (floor_optab, $A)->insn_code = CODE_FOR_$(floor$a2$)",
- "convert_optab_handler (lfloor_optab, $B, $A)->insn_code = CODE_FOR_$(lfloor$F$a$I$b2$)",
- "optab_handler (ceil_optab, $A)->insn_code = CODE_FOR_$(ceil$a2$)",
- "convert_optab_handler (lceil_optab, $B, $A)->insn_code = CODE_FOR_$(lceil$F$a$I$b2$)",
- "optab_handler (round_optab, $A)->insn_code = CODE_FOR_$(round$a2$)",
- "optab_handler (btrunc_optab, $A)->insn_code = CODE_FOR_$(btrunc$a2$)",
- "optab_handler (nearbyint_optab, $A)->insn_code = CODE_FOR_$(nearbyint$a2$)",
- "optab_handler (rint_optab, $A)->insn_code = CODE_FOR_$(rint$a2$)",
- "convert_optab_handler (lrint_optab, $B, $A)->insn_code = CODE_FOR_$(lrint$F$a$I$b2$)",
- "convert_optab_handler (lround_optab, $B, $A)->insn_code = CODE_FOR_$(lround$F$a$I$b2$)",
- "optab_handler (sincos_optab, $A)->insn_code = CODE_FOR_$(sincos$a3$)",
- "optab_handler (sin_optab, $A)->insn_code = CODE_FOR_$(sin$a2$)",
- "optab_handler (asin_optab, $A)->insn_code = CODE_FOR_$(asin$a2$)",
- "optab_handler (cos_optab, $A)->insn_code = CODE_FOR_$(cos$a2$)",
- "optab_handler (acos_optab, $A)->insn_code = CODE_FOR_$(acos$a2$)",
- "optab_handler (exp_optab, $A)->insn_code = CODE_FOR_$(exp$a2$)",
- "optab_handler (exp10_optab, $A)->insn_code = CODE_FOR_$(exp10$a2$)",
- "optab_handler (exp2_optab, $A)->insn_code = CODE_FOR_$(exp2$a2$)",
- "optab_handler (expm1_optab, $A)->insn_code = CODE_FOR_$(expm1$a2$)",
- "optab_handler (ldexp_optab, $A)->insn_code = CODE_FOR_$(ldexp$a3$)",
- "optab_handler (scalb_optab, $A)->insn_code = CODE_FOR_$(scalb$a3$)",
- "optab_handler (significand_optab, $A)->insn_code = CODE_FOR_$(significand$a2$)",
- "optab_handler (logb_optab, $A)->insn_code = CODE_FOR_$(logb$a2$)",
- "optab_handler (ilogb_optab, $A)->insn_code = CODE_FOR_$(ilogb$a2$)",
- "optab_handler (log_optab, $A)->insn_code = CODE_FOR_$(log$a2$)",
- "optab_handler (log10_optab, $A)->insn_code = CODE_FOR_$(log10$a2$)",
- "optab_handler (log2_optab, $A)->insn_code = CODE_FOR_$(log2$a2$)",
- "optab_handler (log1p_optab, $A)->insn_code = CODE_FOR_$(log1p$a2$)",
- "optab_handler (tan_optab, $A)->insn_code = CODE_FOR_$(tan$a2$)",
- "optab_handler (atan_optab, $A)->insn_code = CODE_FOR_$(atan$a2$)",
- "optab_handler (strlen_optab, $A)->insn_code = CODE_FOR_$(strlen$a$)",
- "optab_handler (one_cmpl_optab, $A)->insn_code = CODE_FOR_$(one_cmpl$a2$)",
- "optab_handler (bswap_optab, $A)->insn_code = CODE_FOR_$(bswap$a2$)",
- "optab_handler (ffs_optab, $A)->insn_code = CODE_FOR_$(ffs$a2$)",
- "optab_handler (clz_optab, $A)->insn_code = CODE_FOR_$(clz$a2$)",
- "optab_handler (ctz_optab, $A)->insn_code = CODE_FOR_$(ctz$a2$)",
- "optab_handler (popcount_optab, $A)->insn_code = CODE_FOR_$(popcount$a2$)",
- "optab_handler (parity_optab, $A)->insn_code = CODE_FOR_$(parity$a2$)",
- "optab_handler (mov_optab, $A)->insn_code = CODE_FOR_$(mov$a$)",
- "optab_handler (movstrict_optab, $A)->insn_code = CODE_FOR_$(movstrict$a$)",
- "optab_handler (movmisalign_optab, $A)->insn_code = CODE_FOR_$(movmisalign$a$)",
- "optab_handler (storent_optab, $A)->insn_code = CODE_FOR_$(storent$a$)",
- "optab_handler (addcc_optab, $A)->insn_code = CODE_FOR_$(add$acc$)",
- "movcc_gen_code[$A] = CODE_FOR_$(mov$acc$)",
- "optab_handler (cbranch_optab, $A)->insn_code = CODE_FOR_$(cbranch$a4$)",
- "optab_handler (cmov_optab, $A)->insn_code = CODE_FOR_$(cmov$a6$)",
- "optab_handler (cstore_optab, $A)->insn_code = CODE_FOR_$(cstore$a4$)",
- "optab_handler (ctrap_optab, $A)->insn_code = CODE_FOR_$(ctrap$a4$)",
- "optab_handler (push_optab, $A)->insn_code = CODE_FOR_$(push$a1$)",
- "reload_in_optab[$A] = CODE_FOR_$(reload_in$a$)",
- "reload_out_optab[$A] = CODE_FOR_$(reload_out$a$)",
- "movmem_optab[$A] = CODE_FOR_$(movmem$a$)",
- "cmpstr_optab[$A] = CODE_FOR_$(cmpstr$a$)",
- "cmpstrn_optab[$A] = CODE_FOR_$(cmpstrn$a$)",
- "cmpmem_optab[$A] = CODE_FOR_$(cmpmem$a$)",
- "setmem_optab[$A] = CODE_FOR_$(setmem$a$)",
- "sync_add_optab[$A] = CODE_FOR_$(sync_add$I$a$)",
- "sync_sub_optab[$A] = CODE_FOR_$(sync_sub$I$a$)",
- "sync_ior_optab[$A] = CODE_FOR_$(sync_ior$I$a$)",
- "sync_and_optab[$A] = CODE_FOR_$(sync_and$I$a$)",
- "sync_xor_optab[$A] = CODE_FOR_$(sync_xor$I$a$)",
- "sync_nand_optab[$A] = CODE_FOR_$(sync_nand$I$a$)",
- "sync_old_add_optab[$A] = CODE_FOR_$(sync_old_add$I$a$)",
- "sync_old_sub_optab[$A] = CODE_FOR_$(sync_old_sub$I$a$)",
- "sync_old_ior_optab[$A] = CODE_FOR_$(sync_old_ior$I$a$)",
- "sync_old_and_optab[$A] = CODE_FOR_$(sync_old_and$I$a$)",
- "sync_old_xor_optab[$A] = CODE_FOR_$(sync_old_xor$I$a$)",
- "sync_old_nand_optab[$A] = CODE_FOR_$(sync_old_nand$I$a$)",
- "sync_new_add_optab[$A] = CODE_FOR_$(sync_new_add$I$a$)",
- "sync_new_sub_optab[$A] = CODE_FOR_$(sync_new_sub$I$a$)",
- "sync_new_ior_optab[$A] = CODE_FOR_$(sync_new_ior$I$a$)",
- "sync_new_and_optab[$A] = CODE_FOR_$(sync_new_and$I$a$)",
- "sync_new_xor_optab[$A] = CODE_FOR_$(sync_new_xor$I$a$)",
- "sync_new_nand_optab[$A] = CODE_FOR_$(sync_new_nand$I$a$)",
- "sync_compare_and_swap[$A] = CODE_FOR_$(sync_compare_and_swap$I$a$)",
- "sync_lock_test_and_set[$A] = CODE_FOR_$(sync_lock_test_and_set$I$a$)",
- "sync_lock_release[$A] = CODE_FOR_$(sync_lock_release$I$a$)",
- "optab_handler (vec_set_optab, $A)->insn_code = CODE_FOR_$(vec_set$a$)",
- "optab_handler (vec_extract_optab, $A)->insn_code = CODE_FOR_$(vec_extract$a$)",
- "optab_handler (vec_extract_even_optab, $A)->insn_code = CODE_FOR_$(vec_extract_even$a$)",
- "optab_handler (vec_extract_odd_optab, $A)->insn_code = CODE_FOR_$(vec_extract_odd$a$)",
- "optab_handler (vec_interleave_high_optab, $A)->insn_code = CODE_FOR_$(vec_interleave_high$a$)",
- "optab_handler (vec_interleave_low_optab, $A)->insn_code = CODE_FOR_$(vec_interleave_low$a$)",
- "optab_handler (vec_init_optab, $A)->insn_code = CODE_FOR_$(vec_init$a$)",
- "optab_handler (vec_shl_optab, $A)->insn_code = CODE_FOR_$(vec_shl_$a$)",
- "optab_handler (vec_shr_optab, $A)->insn_code = CODE_FOR_$(vec_shr_$a$)",
- "optab_handler (vec_realign_load_optab, $A)->insn_code = CODE_FOR_$(vec_realign_load_$a$)",
- "vcond_gen_code[$A] = CODE_FOR_$(vcond$a$)",
- "vcondu_gen_code[$A] = CODE_FOR_$(vcondu$a$)",
- "optab_handler (ssum_widen_optab, $A)->insn_code = CODE_FOR_$(widen_ssum$I$a3$)",
- "optab_handler (usum_widen_optab, $A)->insn_code = CODE_FOR_$(widen_usum$I$a3$)",
- "optab_handler (udot_prod_optab, $A)->insn_code = CODE_FOR_$(udot_prod$I$a$)",
- "optab_handler (sdot_prod_optab, $A)->insn_code = CODE_FOR_$(sdot_prod$I$a$)",
- "optab_handler (reduc_smax_optab, $A)->insn_code = CODE_FOR_$(reduc_smax_$a$)",
- "optab_handler (reduc_umax_optab, $A)->insn_code = CODE_FOR_$(reduc_umax_$a$)",
- "optab_handler (reduc_smin_optab, $A)->insn_code = CODE_FOR_$(reduc_smin_$a$)",
- "optab_handler (reduc_umin_optab, $A)->insn_code = CODE_FOR_$(reduc_umin_$a$)",
- "optab_handler (reduc_splus_optab, $A)->insn_code = CODE_FOR_$(reduc_splus_$a$)" ,
- "optab_handler (reduc_uplus_optab, $A)->insn_code = CODE_FOR_$(reduc_uplus_$a$)",
- "optab_handler (vec_widen_umult_hi_optab, $A)->insn_code = CODE_FOR_$(vec_widen_umult_hi_$a$)",
- "optab_handler (vec_widen_umult_lo_optab, $A)->insn_code = CODE_FOR_$(vec_widen_umult_lo_$a$)",
- "optab_handler (vec_widen_smult_hi_optab, $A)->insn_code = CODE_FOR_$(vec_widen_smult_hi_$a$)",
- "optab_handler (vec_widen_smult_lo_optab, $A)->insn_code = CODE_FOR_$(vec_widen_smult_lo_$a$)",
- "optab_handler (vec_unpacks_hi_optab, $A)->insn_code = CODE_FOR_$(vec_unpacks_hi_$a$)",
- "optab_handler (vec_unpacks_lo_optab, $A)->insn_code = CODE_FOR_$(vec_unpacks_lo_$a$)",
- "optab_handler (vec_unpacku_hi_optab, $A)->insn_code = CODE_FOR_$(vec_unpacku_hi_$a$)",
- "optab_handler (vec_unpacku_lo_optab, $A)->insn_code = CODE_FOR_$(vec_unpacku_lo_$a$)",
- "optab_handler (vec_unpacks_float_hi_optab, $A)->insn_code = CODE_FOR_$(vec_unpacks_float_hi_$a$)",
- "optab_handler (vec_unpacks_float_lo_optab, $A)->insn_code = CODE_FOR_$(vec_unpacks_float_lo_$a$)",
- "optab_handler (vec_unpacku_float_hi_optab, $A)->insn_code = CODE_FOR_$(vec_unpacku_float_hi_$a$)",
- "optab_handler (vec_unpacku_float_lo_optab, $A)->insn_code = CODE_FOR_$(vec_unpacku_float_lo_$a$)",
- "optab_handler (vec_pack_trunc_optab, $A)->insn_code = CODE_FOR_$(vec_pack_trunc_$a$)",
- "optab_handler (vec_pack_ssat_optab, $A)->insn_code = CODE_FOR_$(vec_pack_ssat_$a$)",
- "optab_handler (vec_pack_usat_optab, $A)->insn_code = CODE_FOR_$(vec_pack_usat_$a$)",
- "optab_handler (vec_pack_sfix_trunc_optab, $A)->insn_code = CODE_FOR_$(vec_pack_sfix_trunc_$a$)",
- "optab_handler (vec_pack_ufix_trunc_optab, $A)->insn_code = CODE_FOR_$(vec_pack_ufix_trunc_$a$)"
+{ "set_convert_optab_handler (sext_optab, $B, $A, CODE_FOR_$(extend$a$b2$))",
+ "set_convert_optab_handler (zext_optab, $B, $A, CODE_FOR_$(zero_extend$a$b2$))",
+ "set_convert_optab_handler (sfix_optab, $B, $A, CODE_FOR_$(fix$F$a$I$b2$))",
+ "set_convert_optab_handler (ufix_optab, $B, $A, CODE_FOR_$(fixuns$F$a$b2$))",
+ "set_convert_optab_handler (sfixtrunc_optab, $B, $A, CODE_FOR_$(fix_trunc$F$a$I$b2$))",
+ "set_convert_optab_handler (ufixtrunc_optab, $B, $A, CODE_FOR_$(fixuns_trunc$F$a$I$b2$))",
+ "set_convert_optab_handler (sfloat_optab, $B, $A, CODE_FOR_$(float$I$a$F$b2$))",
+ "set_convert_optab_handler (ufloat_optab, $B, $A, CODE_FOR_$(floatuns$I$a$F$b2$))",
+ "set_convert_optab_handler (trunc_optab, $B, $A, CODE_FOR_$(trunc$a$b2$))",
+ "set_convert_optab_handler (fract_optab, $B, $A, CODE_FOR_$(fract$a$b2$))",
+ "set_convert_optab_handler (fractuns_optab, $B, $A, CODE_FOR_$(fractuns$I$a$Q$b2$))",
+ "set_convert_optab_handler (fractuns_optab, $B, $A, CODE_FOR_$(fractuns$Q$a$I$b2$))",
+ "set_convert_optab_handler (satfract_optab, $B, $A, CODE_FOR_$(satfract$a$Q$b2$))",
+ "set_convert_optab_handler (satfractuns_optab, $B, $A, CODE_FOR_$(satfractuns$I$a$Q$b2$))",
+ "set_optab_handler (add_optab, $A, CODE_FOR_$(add$P$a3$))",
+ "set_optab_handler (addv_optab, $A, CODE_FOR_$(add$F$a3$)),\n\
+ set_optab_handler (add_optab, $A, CODE_FOR_$(add$F$a3$))",
+ "set_optab_handler (addv_optab, $A, CODE_FOR_$(addv$I$a3$))",
+ "set_optab_handler (add_optab, $A, CODE_FOR_$(add$Q$a3$))",
+ "set_optab_handler (ssadd_optab, $A, CODE_FOR_$(ssadd$Q$a3$))",
+ "set_optab_handler (usadd_optab, $A, CODE_FOR_$(usadd$Q$a3$))",
+ "set_optab_handler (sub_optab, $A, CODE_FOR_$(sub$P$a3$))",
+ "set_optab_handler (subv_optab, $A, CODE_FOR_$(sub$F$a3$)),\n\
+ set_optab_handler (sub_optab, $A, CODE_FOR_$(sub$F$a3$))",
+ "set_optab_handler (subv_optab, $A, CODE_FOR_$(subv$I$a3$))",
+ "set_optab_handler (sub_optab, $A, CODE_FOR_$(sub$Q$a3$))",
+ "set_optab_handler (sssub_optab, $A, CODE_FOR_$(sssub$Q$a3$))",
+ "set_optab_handler (ussub_optab, $A, CODE_FOR_$(ussub$Q$a3$))",
+ "set_optab_handler (smul_optab, $A, CODE_FOR_$(mul$Q$a3$))",
+ "set_optab_handler (ssmul_optab, $A, CODE_FOR_$(ssmul$Q$a3$))",
+ "set_optab_handler (usmul_optab, $A, CODE_FOR_$(usmul$Q$a3$))",
+ "set_optab_handler (smul_optab, $A, CODE_FOR_$(mul$P$a3$))",
+ "set_optab_handler (smulv_optab, $A, CODE_FOR_$(mul$F$a3$)),\n\
+ set_optab_handler (smul_optab, $A, CODE_FOR_$(mul$F$a3$))",
+ "set_optab_handler (smulv_optab, $A, CODE_FOR_$(mulv$I$a3$))",
+ "set_optab_handler (umul_highpart_optab, $A, CODE_FOR_$(umul$a3_highpart$))",
+ "set_optab_handler (smul_highpart_optab, $A, CODE_FOR_$(smul$a3_highpart$))",
+ "set_optab_handler (smul_widen_optab, $B, CODE_FOR_$(mul$a$b3$)$N)",
+ "set_optab_handler (umul_widen_optab, $B, CODE_FOR_$(umul$a$b3$)$N)",
+ "set_optab_handler (usmul_widen_optab, $B, CODE_FOR_$(usmul$a$b3$)$N)",
+ "set_optab_handler (smadd_widen_optab, $B, CODE_FOR_$(madd$a$b4$)$N)",
+ "set_optab_handler (umadd_widen_optab, $B, CODE_FOR_$(umadd$a$b4$)$N)",
+ "set_optab_handler (ssmadd_widen_optab, $B, CODE_FOR_$(ssmadd$a$b4$)$N)",
+ "set_optab_handler (usmadd_widen_optab, $B, CODE_FOR_$(usmadd$a$b4$)$N)",
+ "set_optab_handler (smsub_widen_optab, $B, CODE_FOR_$(msub$a$b4$)$N)",
+ "set_optab_handler (umsub_widen_optab, $B, CODE_FOR_$(umsub$a$b4$)$N)",
+ "set_optab_handler (ssmsub_widen_optab, $B, CODE_FOR_$(ssmsub$a$b4$)$N)",
+ "set_optab_handler (usmsub_widen_optab, $B, CODE_FOR_$(usmsub$a$b4$)$N)",
+ "set_optab_handler (sdiv_optab, $A, CODE_FOR_$(div$a3$))",
+ "set_optab_handler (ssdiv_optab, $A, CODE_FOR_$(ssdiv$Q$a3$))",
+ "set_optab_handler (sdivv_optab, $A, CODE_FOR_$(div$V$I$a3$))",
+ "set_optab_handler (udiv_optab, $A, CODE_FOR_$(udiv$I$a3$))",
+ "set_optab_handler (udiv_optab, $A, CODE_FOR_$(udiv$Q$a3$))",
+ "set_optab_handler (usdiv_optab, $A, CODE_FOR_$(usdiv$Q$a3$))",
+ "set_optab_handler (sdivmod_optab, $A, CODE_FOR_$(divmod$a4$))",
+ "set_optab_handler (udivmod_optab, $A, CODE_FOR_$(udivmod$a4$))",
+ "set_optab_handler (smod_optab, $A, CODE_FOR_$(mod$a3$))",
+ "set_optab_handler (umod_optab, $A, CODE_FOR_$(umod$a3$))",
+ "set_optab_handler (fmod_optab, $A, CODE_FOR_$(fmod$a3$))",
+ "set_optab_handler (remainder_optab, $A, CODE_FOR_$(remainder$a3$))",
+ "set_optab_handler (ftrunc_optab, $A, CODE_FOR_$(ftrunc$F$a2$))",
+ "set_optab_handler (and_optab, $A, CODE_FOR_$(and$a3$))",
+ "set_optab_handler (ior_optab, $A, CODE_FOR_$(ior$a3$))",
+ "set_optab_handler (xor_optab, $A, CODE_FOR_$(xor$a3$))",
+ "set_optab_handler (ashl_optab, $A, CODE_FOR_$(ashl$a3$))",
+ "set_optab_handler (ssashl_optab, $A, CODE_FOR_$(ssashl$Q$a3$))",
+ "set_optab_handler (usashl_optab, $A, CODE_FOR_$(usashl$Q$a3$))",
+ "set_optab_handler (ashr_optab, $A, CODE_FOR_$(ashr$a3$))",
+ "set_optab_handler (lshr_optab, $A, CODE_FOR_$(lshr$a3$))",
+ "set_optab_handler (rotl_optab, $A, CODE_FOR_$(rotl$a3$))",
+ "set_optab_handler (rotr_optab, $A, CODE_FOR_$(rotr$a3$))",
+ "set_optab_handler (vashr_optab, $A, CODE_FOR_$(vashr$a3$))",
+ "set_optab_handler (vlshr_optab, $A, CODE_FOR_$(vlshr$a3$))",
+ "set_optab_handler (vashl_optab, $A, CODE_FOR_$(vashl$a3$))",
+ "set_optab_handler (vrotl_optab, $A, CODE_FOR_$(vrotl$a3$))",
+ "set_optab_handler (vrotr_optab, $A, CODE_FOR_$(vrotr$a3$))",
+ "set_optab_handler (smin_optab, $A, CODE_FOR_$(smin$a3$))",
+ "set_optab_handler (smax_optab, $A, CODE_FOR_$(smax$a3$))",
+ "set_optab_handler (umin_optab, $A, CODE_FOR_$(umin$I$a3$))",
+ "set_optab_handler (umax_optab, $A, CODE_FOR_$(umax$I$a3$))",
+ "set_optab_handler (pow_optab, $A, CODE_FOR_$(pow$a3$))",
+ "set_optab_handler (atan2_optab, $A, CODE_FOR_$(atan2$a3$))",
+ "set_optab_handler (neg_optab, $A, CODE_FOR_$(neg$P$a2$))",
+ "set_optab_handler (negv_optab, $A, CODE_FOR_$(neg$F$a2$)),\n\
+ set_optab_handler (neg_optab, $A, CODE_FOR_$(neg$F$a2$))",
+ "set_optab_handler (negv_optab, $A, CODE_FOR_$(negv$I$a2$))",
+ "set_optab_handler (neg_optab, $A, CODE_FOR_$(neg$Q$a2$))",
+ "set_optab_handler (ssneg_optab, $A, CODE_FOR_$(ssneg$Q$a2$))",
+ "set_optab_handler (usneg_optab, $A, CODE_FOR_$(usneg$Q$a2$))",
+ "set_optab_handler (abs_optab, $A, CODE_FOR_$(abs$P$a2$))",
+ "set_optab_handler (absv_optab, $A, CODE_FOR_$(abs$F$a2$)),\n\
+ set_optab_handler (abs_optab, $A, CODE_FOR_$(abs$F$a2$))",
+ "set_optab_handler (absv_optab, $A, CODE_FOR_$(absv$I$a2$))",
+ "set_optab_handler (copysign_optab, $A, CODE_FOR_$(copysign$F$a3$))",
+ "set_optab_handler (signbit_optab, $A, CODE_FOR_$(signbit$F$a2$))",
+ "set_optab_handler (isinf_optab, $A, CODE_FOR_$(isinf$a2$))",
+ "set_optab_handler (sqrt_optab, $A, CODE_FOR_$(sqrt$a2$))",
+ "set_optab_handler (floor_optab, $A, CODE_FOR_$(floor$a2$))",
+ "set_convert_optab_handler (lfloor_optab, $B, $A, CODE_FOR_$(lfloor$F$a$I$b2$))",
+ "set_optab_handler (ceil_optab, $A, CODE_FOR_$(ceil$a2$))",
+ "set_convert_optab_handler (lceil_optab, $B, $A, CODE_FOR_$(lceil$F$a$I$b2$))",
+ "set_optab_handler (round_optab, $A, CODE_FOR_$(round$a2$))",
+ "set_optab_handler (btrunc_optab, $A, CODE_FOR_$(btrunc$a2$))",
+ "set_optab_handler (nearbyint_optab, $A, CODE_FOR_$(nearbyint$a2$))",
+ "set_optab_handler (rint_optab, $A, CODE_FOR_$(rint$a2$))",
+ "set_convert_optab_handler (lrint_optab, $B, $A, CODE_FOR_$(lrint$F$a$I$b2$))",
+ "set_convert_optab_handler (lround_optab, $B, $A, CODE_FOR_$(lround$F$a$I$b2$))",
+ "set_optab_handler (sincos_optab, $A, CODE_FOR_$(sincos$a3$))",
+ "set_optab_handler (sin_optab, $A, CODE_FOR_$(sin$a2$))",
+ "set_optab_handler (asin_optab, $A, CODE_FOR_$(asin$a2$))",
+ "set_optab_handler (cos_optab, $A, CODE_FOR_$(cos$a2$))",
+ "set_optab_handler (acos_optab, $A, CODE_FOR_$(acos$a2$))",
+ "set_optab_handler (exp_optab, $A, CODE_FOR_$(exp$a2$))",
+ "set_optab_handler (exp10_optab, $A, CODE_FOR_$(exp10$a2$))",
+ "set_optab_handler (exp2_optab, $A, CODE_FOR_$(exp2$a2$))",
+ "set_optab_handler (expm1_optab, $A, CODE_FOR_$(expm1$a2$))",
+ "set_optab_handler (ldexp_optab, $A, CODE_FOR_$(ldexp$a3$))",
+ "set_optab_handler (scalb_optab, $A, CODE_FOR_$(scalb$a3$))",
+ "set_optab_handler (significand_optab, $A, CODE_FOR_$(significand$a2$))",
+ "set_optab_handler (logb_optab, $A, CODE_FOR_$(logb$a2$))",
+ "set_optab_handler (ilogb_optab, $A, CODE_FOR_$(ilogb$a2$))",
+ "set_optab_handler (log_optab, $A, CODE_FOR_$(log$a2$))",
+ "set_optab_handler (log10_optab, $A, CODE_FOR_$(log10$a2$))",
+ "set_optab_handler (log2_optab, $A, CODE_FOR_$(log2$a2$))",
+ "set_optab_handler (log1p_optab, $A, CODE_FOR_$(log1p$a2$))",
+ "set_optab_handler (tan_optab, $A, CODE_FOR_$(tan$a2$))",
+ "set_optab_handler (atan_optab, $A, CODE_FOR_$(atan$a2$))",
+ "set_optab_handler (strlen_optab, $A, CODE_FOR_$(strlen$a$))",
+ "set_optab_handler (one_cmpl_optab, $A, CODE_FOR_$(one_cmpl$a2$))",
+ "set_optab_handler (bswap_optab, $A, CODE_FOR_$(bswap$a2$))",
+ "set_optab_handler (ffs_optab, $A, CODE_FOR_$(ffs$a2$))",
+ "set_optab_handler (clz_optab, $A, CODE_FOR_$(clz$a2$))",
+ "set_optab_handler (ctz_optab, $A, CODE_FOR_$(ctz$a2$))",
+ "set_optab_handler (popcount_optab, $A, CODE_FOR_$(popcount$a2$))",
+ "set_optab_handler (parity_optab, $A, CODE_FOR_$(parity$a2$))",
+ "set_optab_handler (mov_optab, $A, CODE_FOR_$(mov$a$))",
+ "set_optab_handler (movstrict_optab, $A, CODE_FOR_$(movstrict$a$))",
+ "set_optab_handler (movmisalign_optab, $A, CODE_FOR_$(movmisalign$a$))",
+ "set_optab_handler (storent_optab, $A, CODE_FOR_$(storent$a$))",
+ "set_optab_handler (addcc_optab, $A, CODE_FOR_$(add$acc$))",
+ "set_direct_optab_handler (movcc_optab, $A, CODE_FOR_$(mov$acc$))",
+ "set_optab_handler (cbranch_optab, $A, CODE_FOR_$(cbranch$a4$))",
+ "set_optab_handler (cmov_optab, $A, CODE_FOR_$(cmov$a6$))",
+ "set_optab_handler (cstore_optab, $A, CODE_FOR_$(cstore$a4$))",
+ "set_optab_handler (ctrap_optab, $A, CODE_FOR_$(ctrap$a4$))",
+ "set_optab_handler (push_optab, $A, CODE_FOR_$(push$a1$))",
+ "set_direct_optab_handler (reload_in_optab, $A, CODE_FOR_$(reload_in$a$))",
+ "set_direct_optab_handler (reload_out_optab, $A, CODE_FOR_$(reload_out$a$))",
+ "set_direct_optab_handler (movmem_optab, $A, CODE_FOR_$(movmem$a$))",
+ "set_direct_optab_handler (cmpstr_optab, $A, CODE_FOR_$(cmpstr$a$))",
+ "set_direct_optab_handler (cmpstrn_optab, $A, CODE_FOR_$(cmpstrn$a$))",
+ "set_direct_optab_handler (cmpmem_optab, $A, CODE_FOR_$(cmpmem$a$))",
+ "set_direct_optab_handler (setmem_optab, $A, CODE_FOR_$(setmem$a$))",
+ "set_direct_optab_handler (sync_add_optab, $A, CODE_FOR_$(sync_add$I$a$))",
+ "set_direct_optab_handler (sync_sub_optab, $A, CODE_FOR_$(sync_sub$I$a$))",
+ "set_direct_optab_handler (sync_ior_optab, $A, CODE_FOR_$(sync_ior$I$a$))",
+ "set_direct_optab_handler (sync_and_optab, $A, CODE_FOR_$(sync_and$I$a$))",
+ "set_direct_optab_handler (sync_xor_optab, $A, CODE_FOR_$(sync_xor$I$a$))",
+ "set_direct_optab_handler (sync_nand_optab, $A, CODE_FOR_$(sync_nand$I$a$))",
+ "set_direct_optab_handler (sync_old_add_optab, $A, CODE_FOR_$(sync_old_add$I$a$))",
+ "set_direct_optab_handler (sync_old_sub_optab, $A, CODE_FOR_$(sync_old_sub$I$a$))",
+ "set_direct_optab_handler (sync_old_ior_optab, $A, CODE_FOR_$(sync_old_ior$I$a$))",
+ "set_direct_optab_handler (sync_old_and_optab, $A, CODE_FOR_$(sync_old_and$I$a$))",
+ "set_direct_optab_handler (sync_old_xor_optab, $A, CODE_FOR_$(sync_old_xor$I$a$))",
+ "set_direct_optab_handler (sync_old_nand_optab, $A, CODE_FOR_$(sync_old_nand$I$a$))",
+ "set_direct_optab_handler (sync_new_add_optab, $A, CODE_FOR_$(sync_new_add$I$a$))",
+ "set_direct_optab_handler (sync_new_sub_optab, $A, CODE_FOR_$(sync_new_sub$I$a$))",
+ "set_direct_optab_handler (sync_new_ior_optab, $A, CODE_FOR_$(sync_new_ior$I$a$))",
+ "set_direct_optab_handler (sync_new_and_optab, $A, CODE_FOR_$(sync_new_and$I$a$))",
+ "set_direct_optab_handler (sync_new_xor_optab, $A, CODE_FOR_$(sync_new_xor$I$a$))",
+ "set_direct_optab_handler (sync_new_nand_optab, $A, CODE_FOR_$(sync_new_nand$I$a$))",
+ "set_direct_optab_handler (sync_compare_and_swap_optab, $A, CODE_FOR_$(sync_compare_and_swap$I$a$))",
+ "set_direct_optab_handler (sync_lock_test_and_set_optab, $A, CODE_FOR_$(sync_lock_test_and_set$I$a$))",
+ "set_direct_optab_handler (sync_lock_release_optab, $A, CODE_FOR_$(sync_lock_release$I$a$))",
+ "set_optab_handler (vec_set_optab, $A, CODE_FOR_$(vec_set$a$))",
+ "set_optab_handler (vec_extract_optab, $A, CODE_FOR_$(vec_extract$a$))",
+ "set_optab_handler (vec_extract_even_optab, $A, CODE_FOR_$(vec_extract_even$a$))",
+ "set_optab_handler (vec_extract_odd_optab, $A, CODE_FOR_$(vec_extract_odd$a$))",
+ "set_optab_handler (vec_interleave_high_optab, $A, CODE_FOR_$(vec_interleave_high$a$))",
+ "set_optab_handler (vec_interleave_low_optab, $A, CODE_FOR_$(vec_interleave_low$a$))",
+ "set_optab_handler (vec_init_optab, $A, CODE_FOR_$(vec_init$a$))",
+ "set_optab_handler (vec_shl_optab, $A, CODE_FOR_$(vec_shl_$a$))",
+ "set_optab_handler (vec_shr_optab, $A, CODE_FOR_$(vec_shr_$a$))",
+ "set_optab_handler (vec_realign_load_optab, $A, CODE_FOR_$(vec_realign_load_$a$))",
+ "set_direct_optab_handler (vcond_optab, $A, CODE_FOR_$(vcond$a$))",
+ "set_direct_optab_handler (vcondu_optab, $A, CODE_FOR_$(vcondu$a$))",
+ "set_optab_handler (ssum_widen_optab, $A, CODE_FOR_$(widen_ssum$I$a3$))",
+ "set_optab_handler (usum_widen_optab, $A, CODE_FOR_$(widen_usum$I$a3$))",
+ "set_optab_handler (udot_prod_optab, $A, CODE_FOR_$(udot_prod$I$a$))",
+ "set_optab_handler (sdot_prod_optab, $A, CODE_FOR_$(sdot_prod$I$a$))",
+ "set_optab_handler (reduc_smax_optab, $A, CODE_FOR_$(reduc_smax_$a$))",
+ "set_optab_handler (reduc_umax_optab, $A, CODE_FOR_$(reduc_umax_$a$))",
+ "set_optab_handler (reduc_smin_optab, $A, CODE_FOR_$(reduc_smin_$a$))",
+ "set_optab_handler (reduc_umin_optab, $A, CODE_FOR_$(reduc_umin_$a$))",
+ "set_optab_handler (reduc_splus_optab, $A, CODE_FOR_$(reduc_splus_$a$))" ,
+ "set_optab_handler (reduc_uplus_optab, $A, CODE_FOR_$(reduc_uplus_$a$))",
+ "set_optab_handler (vec_widen_umult_hi_optab, $A, CODE_FOR_$(vec_widen_umult_hi_$a$))",
+ "set_optab_handler (vec_widen_umult_lo_optab, $A, CODE_FOR_$(vec_widen_umult_lo_$a$))",
+ "set_optab_handler (vec_widen_smult_hi_optab, $A, CODE_FOR_$(vec_widen_smult_hi_$a$))",
+ "set_optab_handler (vec_widen_smult_lo_optab, $A, CODE_FOR_$(vec_widen_smult_lo_$a$))",
+ "set_optab_handler (vec_unpacks_hi_optab, $A, CODE_FOR_$(vec_unpacks_hi_$a$))",
+ "set_optab_handler (vec_unpacks_lo_optab, $A, CODE_FOR_$(vec_unpacks_lo_$a$))",
+ "set_optab_handler (vec_unpacku_hi_optab, $A, CODE_FOR_$(vec_unpacku_hi_$a$))",
+ "set_optab_handler (vec_unpacku_lo_optab, $A, CODE_FOR_$(vec_unpacku_lo_$a$))",
+ "set_optab_handler (vec_unpacks_float_hi_optab, $A, CODE_FOR_$(vec_unpacks_float_hi_$a$))",
+ "set_optab_handler (vec_unpacks_float_lo_optab, $A, CODE_FOR_$(vec_unpacks_float_lo_$a$))",
+ "set_optab_handler (vec_unpacku_float_hi_optab, $A, CODE_FOR_$(vec_unpacku_float_hi_$a$))",
+ "set_optab_handler (vec_unpacku_float_lo_optab, $A, CODE_FOR_$(vec_unpacku_float_lo_$a$))",
+ "set_optab_handler (vec_pack_trunc_optab, $A, CODE_FOR_$(vec_pack_trunc_$a$))",
+ "set_optab_handler (vec_pack_ssat_optab, $A, CODE_FOR_$(vec_pack_ssat_$a$))",
+ "set_optab_handler (vec_pack_usat_optab, $A, CODE_FOR_$(vec_pack_usat_$a$))",
+ "set_optab_handler (vec_pack_sfix_trunc_optab, $A, CODE_FOR_$(vec_pack_sfix_trunc_$a$))",
+ "set_optab_handler (vec_pack_ufix_trunc_optab, $A, CODE_FOR_$(vec_pack_ufix_trunc_$a$))"
};
static void gen_insn (rtx);
@@ -519,8 +519,9 @@ from the machine description file `md'. */\n\n");
also convert validly to an unsigned one. */\n\
for (i = 0; i < NUM_MACHINE_MODES; i++)\n\
for (j = 0; j < NUM_MACHINE_MODES; j++)\n\
- convert_optab_handler (ufixtrunc_optab, i, j)->insn_code\n\
- = convert_optab_handler (sfixtrunc_optab, i, j)->insn_code;\n\
+ set_convert_optab_handler\n\
+ (ufixtrunc_optab, i, j,\n\
+ convert_optab_handler (sfixtrunc_optab, i, j));\n\
#endif\n\
}");
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index a5d6a128379..e138fcd4c29 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -240,6 +240,7 @@ output_prologue (void)
printf ("#include \"conditions.h\"\n");
printf ("#include \"insn-attr.h\"\n\n");
printf ("#include \"recog.h\"\n\n");
+ printf ("#include \"diagnostic-core.h\"\n");
printf ("#include \"toplev.h\"\n");
printf ("#include \"output.h\"\n");
printf ("#include \"target.h\"\n");
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index b129f94b020..77d14b81bec 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -376,6 +376,7 @@ from the machine description file `md'. */\n\n");
printf ("#include \"recog.h\"\n");
printf ("#include \"except.h\"\n");
printf ("#include \"function.h\"\n");
+ printf ("#include \"diagnostic-core.h\"\n");
printf ("#include \"toplev.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"tm-constrs.h\"\n\n");
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index c69647042c7..02379d67f34 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -1337,6 +1337,7 @@ write_insn_preds_c (void)
#include \"flags.h\"\n\
#include \"hard-reg-set.h\"\n\
#include \"resource.h\"\n\
+#include \"diagnostic-core.h\"\n\
#include \"toplev.h\"\n\
#include \"reload.h\"\n\
#include \"regs.h\"\n\
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index bc7767f192c..9da0aeabb37 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -2448,6 +2448,7 @@ write_header (void)
#include \"flags.h\"\n\
#include \"hard-reg-set.h\"\n\
#include \"resource.h\"\n\
+#include \"diagnostic-core.h\"\n\
#include \"toplev.h\"\n\
#include \"reload.h\"\n\
#include \"regs.h\"\n\
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index 175629b3129..982d266dfba 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "ggc.h"
#include "ggc-internal.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "params.h"
#include "hosthooks.h"
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 27862be8ef4..8b41f404b4a 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -25,7 +25,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
-#include "toplev.h"
+#include "toplev.h" /* exact_log2 */
+#include "diagnostic-core.h"
#include "flags.h"
#include "ggc.h"
#include "ggc-internal.h"
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c
index 12dc8740529..4338bb630d0 100644
--- a/gcc/ggc-zone.c
+++ b/gcc/ggc-zone.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "flags.h"
#include "ggc.h"
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index a1fc0201473..5bf82822a90 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -82,7 +82,7 @@ get_symbol_constant_value (tree sym)
bool
may_propagate_address_into_dereference (tree addr, tree deref)
{
- gcc_assert (INDIRECT_REF_P (deref)
+ gcc_assert (TREE_CODE (deref) == MEM_REF
&& TREE_CODE (addr) == ADDR_EXPR);
/* Don't propagate if ADDR's operand has incomplete type. */
@@ -108,15 +108,12 @@ may_propagate_address_into_dereference (tree addr, tree deref)
/* A subroutine of fold_stmt. Attempts to fold *(A+O) to A[X].
- BASE is an array type. OFFSET is a byte displacement. ORIG_TYPE
- is the desired result type.
+ BASE is an array type. OFFSET is a byte displacement.
LOC is the location of the original expression. */
static tree
-maybe_fold_offset_to_array_ref (location_t loc, tree base, tree offset,
- tree orig_type,
- bool allow_negative_idx)
+maybe_fold_offset_to_array_ref (location_t loc, tree base, tree offset)
{
tree min_idx, idx, idx_type, elt_offset = integer_zero_node;
tree array_type, elt_type, elt_size;
@@ -145,8 +142,6 @@ maybe_fold_offset_to_array_ref (location_t loc, tree base, tree offset,
if (TREE_CODE (array_type) != ARRAY_TYPE)
return NULL_TREE;
elt_type = TREE_TYPE (array_type);
- if (!useless_type_conversion_p (orig_type, elt_type))
- return NULL_TREE;
/* Use signed size type for intermediate computation on the index. */
idx_type = ssizetype;
@@ -219,34 +214,22 @@ maybe_fold_offset_to_array_ref (location_t loc, tree base, tree offset,
char *(c[4]);
c[3][2];
should not be simplified into (*c)[14] or tree-vrp will
- give false warnings. The same is true for
- struct A { long x; char d[0]; } *a;
- (char *)a - 4;
- which should be not folded to &a->d[-8]. */
- if (domain_type
- && TYPE_MAX_VALUE (domain_type)
- && TREE_CODE (TYPE_MAX_VALUE (domain_type)) == INTEGER_CST)
+ give false warnings.
+ This is only an issue for multi-dimensional arrays. */
+ if (TREE_CODE (elt_type) == ARRAY_TYPE
+ && domain_type)
{
- tree up_bound = TYPE_MAX_VALUE (domain_type);
-
- if (tree_int_cst_lt (up_bound, idx)
- /* Accesses after the end of arrays of size 0 (gcc
- extension) and 1 are likely intentional ("struct
- hack"). */
- && compare_tree_int (up_bound, 1) > 0)
+ if (TYPE_MAX_VALUE (domain_type)
+ && TREE_CODE (TYPE_MAX_VALUE (domain_type)) == INTEGER_CST
+ && tree_int_cst_lt (TYPE_MAX_VALUE (domain_type), idx))
return NULL_TREE;
- }
- if (domain_type
- && TYPE_MIN_VALUE (domain_type))
- {
- if (!allow_negative_idx
- && TREE_CODE (TYPE_MIN_VALUE (domain_type)) == INTEGER_CST
- && tree_int_cst_lt (idx, TYPE_MIN_VALUE (domain_type)))
+ else if (TYPE_MIN_VALUE (domain_type)
+ && TREE_CODE (TYPE_MIN_VALUE (domain_type)) == INTEGER_CST
+ && tree_int_cst_lt (idx, TYPE_MIN_VALUE (domain_type)))
+ return NULL_TREE;
+ else if (compare_tree_int (idx, 0) < 0)
return NULL_TREE;
}
- else if (!allow_negative_idx
- && compare_tree_int (idx, 0) < 0)
- return NULL_TREE;
{
tree t = build4 (ARRAY_REF, elt_type, base, idx, NULL_TREE, NULL_TREE);
@@ -256,340 +239,55 @@ maybe_fold_offset_to_array_ref (location_t loc, tree base, tree offset,
}
-/* Attempt to fold *(S+O) to S.X.
- BASE is a record type. OFFSET is a byte displacement. ORIG_TYPE
- is the desired result type.
-
- LOC is the location of the original expression. */
-
-static tree
-maybe_fold_offset_to_component_ref (location_t loc, tree record_type,
- tree base, tree offset, tree orig_type)
-{
- tree f, t, field_type, tail_array_field, field_offset;
- tree ret;
- tree new_base;
-
- if (TREE_CODE (record_type) != RECORD_TYPE
- && TREE_CODE (record_type) != UNION_TYPE
- && TREE_CODE (record_type) != QUAL_UNION_TYPE)
- return NULL_TREE;
-
- /* Short-circuit silly cases. */
- if (useless_type_conversion_p (record_type, orig_type))
- return NULL_TREE;
-
- tail_array_field = NULL_TREE;
- for (f = TYPE_FIELDS (record_type); f ; f = TREE_CHAIN (f))
- {
- int cmp;
-
- if (TREE_CODE (f) != FIELD_DECL)
- continue;
- if (DECL_BIT_FIELD (f))
- continue;
-
- if (!DECL_FIELD_OFFSET (f))
- continue;
- field_offset = byte_position (f);
- if (TREE_CODE (field_offset) != INTEGER_CST)
- continue;
-
- /* ??? Java creates "interesting" fields for representing base classes.
- They have no name, and have no context. With no context, we get into
- trouble with nonoverlapping_component_refs_p. Skip them. */
- if (!DECL_FIELD_CONTEXT (f))
- continue;
-
- /* The previous array field isn't at the end. */
- tail_array_field = NULL_TREE;
-
- /* Check to see if this offset overlaps with the field. */
- cmp = tree_int_cst_compare (field_offset, offset);
- if (cmp > 0)
- continue;
-
- field_type = TREE_TYPE (f);
-
- /* Here we exactly match the offset being checked. If the types match,
- then we can return that field. */
- if (cmp == 0
- && useless_type_conversion_p (orig_type, field_type))
- {
- t = fold_build3 (COMPONENT_REF, field_type, base, f, NULL_TREE);
- return t;
- }
-
- /* Don't care about offsets into the middle of scalars. */
- if (!AGGREGATE_TYPE_P (field_type))
- continue;
-
- /* Check for array at the end of the struct. This is often
- used as for flexible array members. We should be able to
- turn this into an array access anyway. */
- if (TREE_CODE (field_type) == ARRAY_TYPE)
- tail_array_field = f;
-
- /* Check the end of the field against the offset. */
- if (!DECL_SIZE_UNIT (f)
- || TREE_CODE (DECL_SIZE_UNIT (f)) != INTEGER_CST)
- continue;
- t = int_const_binop (MINUS_EXPR, offset, field_offset, 1);
- if (!tree_int_cst_lt (t, DECL_SIZE_UNIT (f)))
- continue;
-
- /* If we matched, then set offset to the displacement into
- this field. */
- new_base = fold_build3 (COMPONENT_REF, field_type, base, f, NULL_TREE);
- SET_EXPR_LOCATION (new_base, loc);
-
- /* Recurse to possibly find the match. */
- ret = maybe_fold_offset_to_array_ref (loc, new_base, t, orig_type,
- f == TYPE_FIELDS (record_type));
- if (ret)
- return ret;
- ret = maybe_fold_offset_to_component_ref (loc, field_type, new_base, t,
- orig_type);
- if (ret)
- return ret;
- }
-
- if (!tail_array_field)
- return NULL_TREE;
-
- f = tail_array_field;
- field_type = TREE_TYPE (f);
- offset = int_const_binop (MINUS_EXPR, offset, byte_position (f), 1);
-
- /* If we get here, we've got an aggregate field, and a possibly
- nonzero offset into them. Recurse and hope for a valid match. */
- base = fold_build3 (COMPONENT_REF, field_type, base, f, NULL_TREE);
- SET_EXPR_LOCATION (base, loc);
-
- t = maybe_fold_offset_to_array_ref (loc, base, offset, orig_type,
- f == TYPE_FIELDS (record_type));
- if (t)
- return t;
- return maybe_fold_offset_to_component_ref (loc, field_type, base, offset,
- orig_type);
-}
-
-/* Attempt to express (ORIG_TYPE)BASE+OFFSET as BASE->field_of_orig_type
- or BASE[index] or by combination of those.
-
+/* Attempt to express (ORIG_TYPE)BASE+OFFSET as BASE[index].
LOC is the location of original expression.
- Before attempting the conversion strip off existing ADDR_EXPRs and
- handled component refs. */
+ Before attempting the conversion strip off existing ADDR_EXPRs. */
tree
maybe_fold_offset_to_reference (location_t loc, tree base, tree offset,
tree orig_type)
{
tree ret;
- tree type;
STRIP_NOPS (base);
if (TREE_CODE (base) != ADDR_EXPR)
return NULL_TREE;
base = TREE_OPERAND (base, 0);
-
- /* Handle case where existing COMPONENT_REF pick e.g. wrong field of union,
- so it needs to be removed and new COMPONENT_REF constructed.
- The wrong COMPONENT_REF are often constructed by folding the
- (type *)&object within the expression (type *)&object+offset */
- if (handled_component_p (base))
- {
- HOST_WIDE_INT sub_offset, size, maxsize;
- tree newbase;
- newbase = get_ref_base_and_extent (base, &sub_offset,
- &size, &maxsize);
- gcc_assert (newbase);
- if (size == maxsize
- && size != -1
- && !(sub_offset & (BITS_PER_UNIT - 1)))
- {
- base = newbase;
- if (sub_offset)
- offset = int_const_binop (PLUS_EXPR, offset,
- build_int_cst (TREE_TYPE (offset),
- sub_offset / BITS_PER_UNIT), 1);
- }
- }
- if (useless_type_conversion_p (orig_type, TREE_TYPE (base))
+ if (types_compatible_p (orig_type, TREE_TYPE (base))
&& integer_zerop (offset))
return base;
- type = TREE_TYPE (base);
- ret = maybe_fold_offset_to_component_ref (loc, type, base, offset, orig_type);
- if (!ret)
- ret = maybe_fold_offset_to_array_ref (loc, base, offset, orig_type, true);
-
- return ret;
+ ret = maybe_fold_offset_to_array_ref (loc, base, offset);
+ if (ret && types_compatible_p (orig_type, TREE_TYPE (ret)))
+ return ret;
+ return NULL_TREE;
}
-/* Attempt to express (ORIG_TYPE)&BASE+OFFSET as &BASE->field_of_orig_type
- or &BASE[index] or by combination of those.
-
- LOC is the location of the original expression.
-
- Before attempting the conversion strip off existing component refs. */
+/* Attempt to express (ORIG_TYPE)ADDR+OFFSET as (*ADDR)[index].
+ LOC is the location of the original expression. */
tree
maybe_fold_offset_to_address (location_t loc, tree addr, tree offset,
tree orig_type)
{
- tree t;
-
- gcc_assert (POINTER_TYPE_P (TREE_TYPE (addr))
- && POINTER_TYPE_P (orig_type));
-
- t = maybe_fold_offset_to_reference (loc, addr, offset,
- TREE_TYPE (orig_type));
- if (t != NULL_TREE)
- {
- tree orig = addr;
- tree ptr_type;
-
- /* For __builtin_object_size to function correctly we need to
- make sure not to fold address arithmetic so that we change
- reference from one array to another. This would happen for
- example for
-
- struct X { char s1[10]; char s2[10] } s;
- char *foo (void) { return &s.s2[-4]; }
-
- where we need to avoid generating &s.s1[6]. As the C and
- C++ frontends create different initial trees
- (char *) &s.s1 + -4 vs. &s.s1[-4] we have to do some
- sophisticated comparisons here. Note that checking for the
- condition after the fact is easier than trying to avoid doing
- the folding. */
- STRIP_NOPS (orig);
- if (TREE_CODE (orig) == ADDR_EXPR)
- orig = TREE_OPERAND (orig, 0);
- if ((TREE_CODE (orig) == ARRAY_REF
- || (TREE_CODE (orig) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (orig, 1))) == ARRAY_TYPE))
- && (TREE_CODE (t) == ARRAY_REF
- || TREE_CODE (t) == COMPONENT_REF)
- && !operand_equal_p (TREE_CODE (orig) == ARRAY_REF
- ? TREE_OPERAND (orig, 0) : orig,
- TREE_CODE (t) == ARRAY_REF
- ? TREE_OPERAND (t, 0) : t, 0))
- return NULL_TREE;
-
- ptr_type = build_pointer_type (TREE_TYPE (t));
- if (!useless_type_conversion_p (orig_type, ptr_type))
- return NULL_TREE;
- return build_fold_addr_expr_with_type_loc (loc, t, ptr_type);
- }
-
- return NULL_TREE;
-}
-
-/* A subroutine of fold_stmt. Attempt to simplify *(BASE+OFFSET).
- Return the simplified expression, or NULL if nothing could be done. */
-
-static tree
-maybe_fold_stmt_indirect (tree expr, tree base, tree offset)
-{
- tree t;
- bool volatile_p = TREE_THIS_VOLATILE (expr);
- location_t loc = EXPR_LOCATION (expr);
-
- /* We may well have constructed a double-nested PLUS_EXPR via multiple
- substitutions. Fold that down to one. Remove NON_LVALUE_EXPRs that
- are sometimes added. */
- base = fold (base);
- STRIP_TYPE_NOPS (base);
- TREE_OPERAND (expr, 0) = base;
-
- /* One possibility is that the address reduces to a string constant. */
- t = fold_read_from_constant_string (expr);
- if (t)
- return t;
+ tree base, ret;
- /* Add in any offset from a POINTER_PLUS_EXPR. */
- if (TREE_CODE (base) == POINTER_PLUS_EXPR)
+ STRIP_NOPS (addr);
+ if (TREE_CODE (addr) != ADDR_EXPR)
+ return NULL_TREE;
+ base = TREE_OPERAND (addr, 0);
+ ret = maybe_fold_offset_to_array_ref (loc, base, offset);
+ if (ret)
{
- tree offset2;
-
- offset2 = TREE_OPERAND (base, 1);
- if (TREE_CODE (offset2) != INTEGER_CST)
+ ret = build_fold_addr_expr (ret);
+ if (!useless_type_conversion_p (orig_type, TREE_TYPE (ret)))
return NULL_TREE;
- base = TREE_OPERAND (base, 0);
-
- offset = fold_convert (sizetype,
- int_const_binop (PLUS_EXPR, offset, offset2, 1));
+ SET_EXPR_LOCATION (ret, loc);
}
- if (TREE_CODE (base) == ADDR_EXPR)
- {
- tree base_addr = base;
-
- /* Strip the ADDR_EXPR. */
- base = TREE_OPERAND (base, 0);
-
- /* Fold away CONST_DECL to its value, if the type is scalar. */
- if (TREE_CODE (base) == CONST_DECL
- && is_gimple_min_invariant (DECL_INITIAL (base)))
- return DECL_INITIAL (base);
-
- /* If there is no offset involved simply return the folded base. */
- if (integer_zerop (offset))
- return base;
-
- /* Try folding *(&B+O) to B.X. */
- t = maybe_fold_offset_to_reference (loc, base_addr, offset,
- TREE_TYPE (expr));
- if (t)
- {
- /* Preserve volatileness of the original expression.
- We can end up with a plain decl here which is shared
- and we shouldn't mess with its flags. */
- if (!SSA_VAR_P (t))
- TREE_THIS_VOLATILE (t) = volatile_p;
- return t;
- }
- }
- else
- {
- /* We can get here for out-of-range string constant accesses,
- such as "_"[3]. Bail out of the entire substitution search
- and arrange for the entire statement to be replaced by a
- call to __builtin_trap. In all likelihood this will all be
- constant-folded away, but in the meantime we can't leave with
- something that get_expr_operands can't understand. */
-
- t = base;
- STRIP_NOPS (t);
- if (TREE_CODE (t) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST)
- {
- /* FIXME: Except that this causes problems elsewhere with dead
- code not being deleted, and we die in the rtl expanders
- because we failed to remove some ssa_name. In the meantime,
- just return zero. */
- /* FIXME2: This condition should be signaled by
- fold_read_from_constant_string directly, rather than
- re-checking for it here. */
- return integer_zero_node;
- }
-
- /* Try folding *(B+O) to B->X. Still an improvement. */
- if (POINTER_TYPE_P (TREE_TYPE (base)))
- {
- t = maybe_fold_offset_to_reference (loc, base, offset,
- TREE_TYPE (expr));
- if (t)
- return t;
- }
- }
-
- /* Otherwise we had an offset that we could not simplify. */
- return NULL_TREE;
+ return ret;
}
@@ -622,18 +320,17 @@ maybe_fold_stmt_addition (location_t loc, tree res_type, tree op0, tree op1)
/* Or op0 should now be A[0] and the non-constant offset defined
via a multiplication by the array element size. */
if (TREE_CODE (op0) == ARRAY_REF
- && integer_zerop (TREE_OPERAND (op0, 1))
- && TREE_CODE (op1) == SSA_NAME
- && host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (op0)), 1))
- {
- gimple offset_def = SSA_NAME_DEF_STMT (op1);
- if (!is_gimple_assign (offset_def))
- return NULL_TREE;
-
/* As we will end up creating a variable index array access
in the outermost array dimension make sure there isn't
a more inner array that the index could overflow to. */
- if (TREE_CODE (TREE_OPERAND (op0, 0)) == ARRAY_REF)
+ && TREE_CODE (TREE_OPERAND (op0, 0)) != ARRAY_REF
+ && integer_zerop (TREE_OPERAND (op0, 1))
+ && TREE_CODE (op1) == SSA_NAME)
+ {
+ gimple offset_def = SSA_NAME_DEF_STMT (op1);
+ tree elsz = TYPE_SIZE_UNIT (TREE_TYPE (op0));
+ if (!host_integerp (elsz, 1)
+ || !is_gimple_assign (offset_def))
return NULL_TREE;
/* Do not build array references of something that we can't
@@ -644,15 +341,14 @@ maybe_fold_stmt_addition (location_t loc, tree res_type, tree op0, tree op1)
if (gimple_assign_rhs_code (offset_def) == MULT_EXPR
&& TREE_CODE (gimple_assign_rhs2 (offset_def)) == INTEGER_CST
- && tree_int_cst_equal (gimple_assign_rhs2 (offset_def),
- TYPE_SIZE_UNIT (TREE_TYPE (op0))))
+ && tree_int_cst_equal (gimple_assign_rhs2 (offset_def), elsz))
return build_fold_addr_expr
(build4 (ARRAY_REF, TREE_TYPE (op0),
TREE_OPERAND (op0, 0),
gimple_assign_rhs1 (offset_def),
TREE_OPERAND (op0, 2),
TREE_OPERAND (op0, 3)));
- else if (integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (op0)))
+ else if (integer_onep (elsz)
&& gimple_assign_rhs_code (offset_def) != MULT_EXPR)
return build_fold_addr_expr
(build4 (ARRAY_REF, TREE_TYPE (op0),
@@ -661,6 +357,38 @@ maybe_fold_stmt_addition (location_t loc, tree res_type, tree op0, tree op1)
TREE_OPERAND (op0, 2),
TREE_OPERAND (op0, 3)));
}
+ else if (TREE_CODE (TREE_TYPE (op0)) == ARRAY_TYPE
+ /* Dto. */
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (op0))) != ARRAY_TYPE
+ && TREE_CODE (op1) == SSA_NAME)
+ {
+ gimple offset_def = SSA_NAME_DEF_STMT (op1);
+ tree elsz = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (op0)));
+ if (!host_integerp (elsz, 1)
+ || !is_gimple_assign (offset_def))
+ return NULL_TREE;
+
+ /* Do not build array references of something that we can't
+ see the true number of array dimensions for. */
+ if (!DECL_P (op0)
+ && !handled_component_p (op0))
+ return NULL_TREE;
+
+ if (gimple_assign_rhs_code (offset_def) == MULT_EXPR
+ && TREE_CODE (gimple_assign_rhs2 (offset_def)) == INTEGER_CST
+ && tree_int_cst_equal (gimple_assign_rhs2 (offset_def), elsz))
+ return build_fold_addr_expr
+ (build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (op0)),
+ op0, gimple_assign_rhs1 (offset_def),
+ integer_zero_node, NULL_TREE));
+ else if (integer_onep (elsz)
+ && gimple_assign_rhs_code (offset_def) != MULT_EXPR)
+ return build_fold_addr_expr
+ (build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (op0)),
+ op0, op1,
+ integer_zero_node, NULL_TREE));
+ }
+
return NULL_TREE;
}
@@ -715,13 +443,12 @@ maybe_fold_stmt_addition (location_t loc, tree res_type, tree op0, tree op1)
ptd_type = TREE_TYPE (TREE_TYPE (op0));
/* At which point we can try some of the same things as for indirects. */
- t = maybe_fold_offset_to_array_ref (loc, op0, op1, ptd_type, true);
- if (!t)
- t = maybe_fold_offset_to_component_ref (loc, TREE_TYPE (op0), op0, op1,
- ptd_type);
+ t = maybe_fold_offset_to_array_ref (loc, op0, op1);
if (t)
{
- t = build1 (ADDR_EXPR, res_type, t);
+ t = build_fold_addr_expr (t);
+ if (!useless_type_conversion_p (res_type, TREE_TYPE (t)))
+ return NULL_TREE;
SET_EXPR_LOCATION (t, loc);
}
@@ -759,19 +486,39 @@ maybe_fold_reference (tree expr, bool is_lhs)
while (handled_component_p (*t))
t = &TREE_OPERAND (*t, 0);
- if (TREE_CODE (*t) == INDIRECT_REF)
+ /* Fold back MEM_REFs to reference trees. */
+ if (TREE_CODE (*t) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (*t, 0)) == ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (*t, 1))
+ && (TREE_THIS_VOLATILE (*t)
+ == TREE_THIS_VOLATILE (TREE_OPERAND (TREE_OPERAND (*t, 0), 0)))
+ && !TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (*t, 1)))
+ && (TYPE_MAIN_VARIANT (TREE_TYPE (*t))
+ == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND (*t, 1)))))
+ /* We have to look out here to not drop a required conversion
+ from the rhs to the lhs if is_lhs, but we don't have the
+ rhs here to verify that. Thus require strict type
+ compatibility. */
+ && types_compatible_p (TREE_TYPE (*t),
+ TREE_TYPE (TREE_OPERAND
+ (TREE_OPERAND (*t, 0), 0))))
{
- tree tem = maybe_fold_stmt_indirect (*t, TREE_OPERAND (*t, 0),
- integer_zero_node);
- /* Avoid folding *"abc" = 5 into 'a' = 5. */
- if (is_lhs && tem && CONSTANT_CLASS_P (tem))
- tem = NULL_TREE;
- if (!tem
- && TREE_CODE (TREE_OPERAND (*t, 0)) == ADDR_EXPR)
- /* If we had a good reason for propagating the address here,
- make sure we end up with valid gimple. See PR34989. */
- tem = TREE_OPERAND (TREE_OPERAND (*t, 0), 0);
-
+ tree tem;
+ *t = TREE_OPERAND (TREE_OPERAND (*t, 0), 0);
+ tem = maybe_fold_reference (expr, is_lhs);
+ if (tem)
+ return tem;
+ return expr;
+ }
+ /* Canonicalize MEM_REFs invariant address operand. */
+ else if (TREE_CODE (*t) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (*t, 0)) == ADDR_EXPR
+ && !DECL_P (TREE_OPERAND (TREE_OPERAND (*t, 0), 0))
+ && !CONSTANT_CLASS_P (TREE_OPERAND (TREE_OPERAND (*t, 0), 0)))
+ {
+ tree tem = fold_binary (MEM_REF, TREE_TYPE (*t),
+ TREE_OPERAND (*t, 0),
+ TREE_OPERAND (*t, 1));
if (tem)
{
*t = tem;
@@ -863,10 +610,18 @@ fold_gimple_assign (gimple_stmt_iterator *si)
else if (TREE_CODE (rhs) == ADDR_EXPR)
{
- tree tem = maybe_fold_reference (TREE_OPERAND (rhs, 0), true);
- if (tem)
+ tree ref = TREE_OPERAND (rhs, 0);
+ tree tem = maybe_fold_reference (ref, true);
+ if (tem
+ && TREE_CODE (tem) == MEM_REF
+ && integer_zerop (TREE_OPERAND (tem, 1)))
+ result = fold_convert (TREE_TYPE (rhs), TREE_OPERAND (tem, 0));
+ else if (tem)
result = fold_convert (TREE_TYPE (rhs),
build_fold_addr_expr_loc (loc, tem));
+ else if (TREE_CODE (ref) == MEM_REF
+ && integer_zerop (TREE_OPERAND (ref, 1)))
+ result = fold_convert (TREE_TYPE (rhs), TREE_OPERAND (ref, 0));
}
else if (TREE_CODE (rhs) == CONSTRUCTOR
@@ -1401,7 +1156,7 @@ gimple_fold_builtin (gimple stmt)
fold_convert (TREE_TYPE (gimple_call_lhs (stmt)), val[0]);
/* If the result is not a valid gimple value, or not a cast
- of a valid gimple value, then we can not use the result. */
+ of a valid gimple value, then we cannot use the result. */
if (is_gimple_val (new_val)
|| (is_gimple_cast (new_val)
&& is_gimple_val (TREE_OPERAND (new_val, 0))))
@@ -1580,7 +1335,7 @@ gimple_get_relevant_ref_binfo (tree ref, tree known_binfo)
return TYPE_BINFO (TREE_TYPE (ref));
else if (known_binfo
&& (TREE_CODE (ref) == SSA_NAME
- || TREE_CODE (ref) == INDIRECT_REF))
+ || TREE_CODE (ref) == MEM_REF))
return known_binfo;
else
return NULL_TREE;
@@ -1596,6 +1351,7 @@ gimple_fold_obj_type_ref_known_binfo (HOST_WIDE_INT token, tree known_binfo)
{
HOST_WIDE_INT i;
tree v, fndecl;
+ struct cgraph_node *node;
v = BINFO_VIRTUALS (known_binfo);
i = 0;
@@ -1607,6 +1363,14 @@ gimple_fold_obj_type_ref_known_binfo (HOST_WIDE_INT token, tree known_binfo)
}
fndecl = TREE_VALUE (v);
+ node = cgraph_get_node (fndecl);
+ /* When cgraph node is missing and function is not public, we cannot
+ devirtualize. This can happen in WHOPR when the actual method
+ ends up in other partition, because we found devirtualization
+ possibility too late. */
+ if ((!node || (!node->analyzed && !node->in_other_partition))
+ && (!TREE_PUBLIC (fndecl) || DECL_COMDAT (fndecl)))
+ return NULL;
return build_fold_addr_expr (fndecl);
}
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 0823b890232..1f7ae2ffdac 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "flags.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-pass.h"
@@ -240,7 +241,7 @@ gimple_check_call_args (gimple stmt)
{
for (i = 0, p = DECL_ARGUMENTS (fndecl);
i < nargs;
- i++, p = TREE_CHAIN (p))
+ i++, p = DECL_CHAIN (p))
{
/* We cannot distinguish a varargs function from the case
of excess parameters, still deferring the inlining decision
@@ -893,7 +894,7 @@ record_vars_into (tree vars, tree fn)
if (fn != current_function_decl)
push_cfun (DECL_STRUCT_FUNCTION (fn));
- for (; vars; vars = TREE_CHAIN (vars))
+ for (; vars; vars = DECL_CHAIN (vars))
{
tree var = vars;
@@ -907,8 +908,7 @@ record_vars_into (tree vars, tree fn)
continue;
/* Record the variable. */
- cfun->local_decls = tree_cons (NULL_TREE, var,
- cfun->local_decls);
+ add_local_decl (cfun, var);
}
if (fn != current_function_decl)
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 491eae3b51b..6e1f6b782c2 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -534,11 +534,7 @@ pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
pp_string (buffer, "{ ");
EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
{
- struct tree_decl_minimal in;
- tree var;
- in.uid = i;
- var = (tree) htab_find_with_hash (gimple_referenced_vars (cfun),
- &in, i);
+ tree var = referenced_var_lookup (i);
if (var)
{
dump_generic_node (buffer, var, 0, dump_flags, false);
@@ -765,7 +761,7 @@ dump_gimple_bind (pretty_printer *buffer, gimple gs, int spc, int flags)
{
tree var;
- for (var = gimple_bind_vars (gs); var; var = TREE_CHAIN (var))
+ for (var = gimple_bind_vars (gs); var; var = DECL_CHAIN (var))
{
newline_and_indent (buffer, 2);
print_declaration (buffer, var, spc, flags);
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 0a5f6fb97d1..e3de8344c56 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1383,7 +1383,10 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
case GIMPLE_CALL:
if (wi)
- wi->is_lhs = false;
+ {
+ wi->is_lhs = false;
+ wi->val_only = true;
+ }
ret = walk_tree (gimple_call_chain_ptr (stmt), callback_op, wi, pset);
if (ret)
@@ -1395,21 +1398,32 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
for (i = 0; i < gimple_call_num_args (stmt); i++)
{
+ if (wi)
+ wi->val_only = is_gimple_reg_type (gimple_call_arg (stmt, i));
ret = walk_tree (gimple_call_arg_ptr (stmt, i), callback_op, wi,
pset);
if (ret)
return ret;
}
- if (wi)
- wi->is_lhs = true;
+ if (gimple_call_lhs (stmt))
+ {
+ if (wi)
+ {
+ wi->is_lhs = true;
+ wi->val_only = is_gimple_reg_type (gimple_call_lhs (stmt));
+ }
- ret = walk_tree (gimple_call_lhs_ptr (stmt), callback_op, wi, pset);
- if (ret)
- return ret;
+ ret = walk_tree (gimple_call_lhs_ptr (stmt), callback_op, wi, pset);
+ if (ret)
+ return ret;
+ }
if (wi)
- wi->is_lhs = false;
+ {
+ wi->is_lhs = false;
+ wi->val_only = true;
+ }
break;
case GIMPLE_CATCH:
@@ -1731,7 +1745,10 @@ gimple_set_body (tree fndecl, gimple_seq seq)
}
-/* Return the body of GIMPLE statements for function FN. */
+/* Return the body of GIMPLE statements for function FN. After the
+ CFG pass, the function body doesn't exist anymore because it has
+ been split up into basic blocks. In this case, it returns
+ NULL. */
gimple_seq
gimple_body (tree fndecl)
@@ -2535,15 +2552,6 @@ const unsigned char gimple_rhs_class_table[] = {
/* Validation of GIMPLE expressions. */
-/* Return true if OP is an acceptable tree node to be used as a GIMPLE
- operand. */
-
-bool
-is_gimple_operand (const_tree op)
-{
- return op && get_gimple_rhs_class (TREE_CODE (op)) == GIMPLE_SINGLE_RHS;
-}
-
/* Returns true iff T is a valid RHS for an assignment to a renamed
user -- or front-end generated artificial -- variable. */
@@ -2595,7 +2603,8 @@ is_gimple_condexpr (tree t)
bool
is_gimple_addressable (tree t)
{
- return (is_gimple_id (t) || handled_component_p (t) || INDIRECT_REF_P (t));
+ return (is_gimple_id (t) || handled_component_p (t)
+ || TREE_CODE (t) == MEM_REF);
}
/* Return true if T is a valid gimple constant. */
@@ -2646,7 +2655,7 @@ is_gimple_address (const_tree t)
op = TREE_OPERAND (op, 0);
}
- if (CONSTANT_CLASS_P (op) || INDIRECT_REF_P (op))
+ if (CONSTANT_CLASS_P (op) || TREE_CODE (op) == MEM_REF)
return true;
switch (TREE_CODE (op))
@@ -2706,8 +2715,18 @@ is_gimple_invariant_address (const_tree t)
return false;
op = strip_invariant_refs (TREE_OPERAND (t, 0));
+ if (!op)
+ return false;
- return op && (CONSTANT_CLASS_P (op) || decl_address_invariant_p (op));
+ if (TREE_CODE (op) == MEM_REF)
+ {
+ const_tree op0 = TREE_OPERAND (op, 0);
+ return (TREE_CODE (op0) == ADDR_EXPR
+ && (CONSTANT_CLASS_P (TREE_OPERAND (op0, 0))
+ || decl_address_invariant_p (TREE_OPERAND (op0, 0))));
+ }
+
+ return CONSTANT_CLASS_P (op) || decl_address_invariant_p (op);
}
/* Return true if T is a gimple invariant address at IPA level
@@ -2924,7 +2943,7 @@ is_gimple_min_lval (tree t)
{
if (!(t = CONST_CAST_TREE (strip_invariant_refs (t))))
return false;
- return (is_gimple_id (t) || TREE_CODE (t) == INDIRECT_REF);
+ return (is_gimple_id (t) || TREE_CODE (t) == MEM_REF);
}
/* Return true if T is a typecast operation. */
@@ -2944,6 +2963,18 @@ is_gimple_call_addr (tree t)
return (TREE_CODE (t) == OBJ_TYPE_REF || is_gimple_val (t));
}
+/* Return true if T is a valid address operand of a MEM_REF. */
+
+bool
+is_gimple_mem_ref_addr (tree t)
+{
+ return (is_gimple_reg (t)
+ || TREE_CODE (t) == INTEGER_CST
+ || (TREE_CODE (t) == ADDR_EXPR
+ && (CONSTANT_CLASS_P (TREE_OPERAND (t, 0))
+ || decl_address_invariant_p (TREE_OPERAND (t, 0)))));
+}
+
/* If T makes a function call, return the corresponding CALL_EXPR operand.
Otherwise, return NULL_TREE. */
@@ -2975,10 +3006,15 @@ get_base_address (tree t)
while (handled_component_p (t))
t = TREE_OPERAND (t, 0);
+ if (TREE_CODE (t) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR)
+ t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
+
if (SSA_VAR_P (t)
|| TREE_CODE (t) == STRING_CST
|| TREE_CODE (t) == CONSTRUCTOR
- || INDIRECT_REF_P (t))
+ || INDIRECT_REF_P (t)
+ || TREE_CODE (t) == MEM_REF)
return t;
else
return NULL_TREE;
@@ -3119,23 +3155,26 @@ static hashval_t gimple_type_hash (const void *);
/* Structure used to maintain a cache of some type pairs compared by
gimple_types_compatible_p when comparing aggregate types. There are
- four possible values for SAME_P:
+ three possible values for SAME_P:
-2: The pair (T1, T2) has just been inserted in the table.
- -1: The pair (T1, T2) is currently being compared.
0: T1 and T2 are different types.
1: T1 and T2 are the same type.
- This table is only used when comparing aggregate types to avoid
- infinite recursion due to self-referential types. */
+ The two elements in the SAME_P array are indexed by the comparison
+ mode gtc_mode. */
+
struct type_pair_d
{
unsigned int uid1;
unsigned int uid2;
- int same_p;
+ signed char same_p[2];
};
typedef struct type_pair_d *type_pair_t;
+DEF_VEC_P(type_pair_t);
+DEF_VEC_ALLOC_P(type_pair_t,heap);
+
/* Return a hash value for the type pair pointed-to by P. */
static hashval_t
@@ -3186,13 +3225,32 @@ lookup_type_pair (tree t1, tree t2, htab_t *visited_p, struct obstack *ob_p)
p = XOBNEW (ob_p, struct type_pair_d);
p->uid1 = TYPE_UID (t1);
p->uid2 = TYPE_UID (t2);
- p->same_p = -2;
+ p->same_p[0] = -2;
+ p->same_p[1] = -2;
*slot = (void *) p;
}
return p;
}
+/* Per pointer state for the SCC finding. The on_sccstack flag
+ is not strictly required, it is true when there is no hash value
+ recorded for the type and false otherwise. But querying that
+ is slower. */
+
+struct sccs
+{
+ unsigned int dfsnum;
+ unsigned int low;
+ bool on_sccstack;
+ union {
+ hashval_t hash;
+ signed char same_p;
+ } u;
+};
+
+static unsigned int next_dfs_num;
+static unsigned int gtc_next_dfs_num;
/* Return true if T1 and T2 have the same name. If FOR_COMPLETION_P is
true then if any type has no name return false, otherwise return
@@ -3287,33 +3345,72 @@ gimple_compare_field_offset (tree f1, tree f2)
return false;
}
-/* Return 1 iff T1 and T2 are structurally identical.
- Otherwise, return 0. */
+/* If the type T1 and the type T2 are a complete and an incomplete
+ variant of the same type return true. */
-static int
-gimple_types_compatible_p (tree t1, tree t2)
+static bool
+gimple_compatible_complete_and_incomplete_subtype_p (tree t1, tree t2)
+{
+ /* If one pointer points to an incomplete type variant of
+ the other pointed-to type they are the same. */
+ if (TREE_CODE (t1) == TREE_CODE (t2)
+ && RECORD_OR_UNION_TYPE_P (t1)
+ && (!COMPLETE_TYPE_P (t1)
+ || !COMPLETE_TYPE_P (t2))
+ && TYPE_QUALS (t1) == TYPE_QUALS (t2)
+ && compare_type_names_p (TYPE_MAIN_VARIANT (t1),
+ TYPE_MAIN_VARIANT (t2), true))
+ return true;
+ return false;
+}
+
+static bool
+gimple_types_compatible_p_1 (tree, tree, enum gtc_mode, type_pair_t,
+ VEC(type_pair_t, heap) **,
+ struct pointer_map_t *, struct obstack *);
+
+/* DFS visit the edge from the callers type pair with state *STATE to
+ the pair T1, T2 while operating in FOR_MERGING_P mode.
+ Update the merging status if it is not part of the SCC containing the
+ callers pair and return it.
+ SCCSTACK, SCCSTATE and SCCSTATE_OBSTACK are state for the DFS walk done. */
+
+static bool
+gtc_visit (tree t1, tree t2, enum gtc_mode mode,
+ struct sccs *state,
+ VEC(type_pair_t, heap) **sccstack,
+ struct pointer_map_t *sccstate,
+ struct obstack *sccstate_obstack)
{
- type_pair_t p = NULL;
+ struct sccs *cstate = NULL;
+ type_pair_t p;
+ void **slot;
/* Check first for the obvious case of pointer identity. */
if (t1 == t2)
- return 1;
+ return true;
/* Check that we have two types to compare. */
if (t1 == NULL_TREE || t2 == NULL_TREE)
- return 0;
+ return false;
+
+ /* If the types have been previously registered and found equal
+ they still are. */
+ if (TYPE_CANONICAL (t1)
+ && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2))
+ return true;
/* Can't be the same type if the types don't have the same code. */
if (TREE_CODE (t1) != TREE_CODE (t2))
- return 0;
+ return false;
/* Can't be the same type if they have different CV qualifiers. */
if (TYPE_QUALS (t1) != TYPE_QUALS (t2))
- return 0;
+ return false;
/* Void types are always the same. */
if (TREE_CODE (t1) == VOID_TYPE)
- return 1;
+ return true;
/* Do some simple checks before doing three hashtable queries. */
if (INTEGRAL_TYPE_P (t1)
@@ -3329,22 +3426,17 @@ gimple_types_compatible_p (tree t1, tree t2)
|| TYPE_PRECISION (t1) != TYPE_PRECISION (t2)
|| TYPE_MODE (t1) != TYPE_MODE (t2)
|| TYPE_UNSIGNED (t1) != TYPE_UNSIGNED (t2))
- return 0;
+ return false;
if (TREE_CODE (t1) == INTEGER_TYPE
&& (TYPE_IS_SIZETYPE (t1) != TYPE_IS_SIZETYPE (t2)
|| TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)))
- return 0;
+ return false;
/* That's all we need to check for float and fixed-point types. */
if (SCALAR_FLOAT_TYPE_P (t1)
|| FIXED_POINT_TYPE_P (t1))
- return 1;
-
- /* Perform cheap tail-recursion for vector and complex types. */
- if (TREE_CODE (t1) == VECTOR_TYPE
- || TREE_CODE (t1) == COMPLEX_TYPE)
- return gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2));
+ return true;
/* For integral types fall thru to more complex checks. */
}
@@ -3354,35 +3446,70 @@ gimple_types_compatible_p (tree t1, tree t2)
/* Can't be the same type if they have different alignment or mode. */
if (TYPE_ALIGN (t1) != TYPE_ALIGN (t2)
|| TYPE_MODE (t1) != TYPE_MODE (t2))
- return 0;
+ return false;
}
/* If the hash values of t1 and t2 are different the types can't
possibly be the same. This helps keeping the type-pair hashtable
small, only tracking comparisons for hash collisions. */
if (gimple_type_hash (t1) != gimple_type_hash (t2))
- return 0;
+ return false;
- /* If we've visited this type pair before (in the case of aggregates
- with self-referential types), and we made a decision, return it. */
+ /* Allocate a new cache entry for this comparison. */
p = lookup_type_pair (t1, t2, &gtc_visited, &gtc_ob);
- if (p->same_p == 0 || p->same_p == 1)
+ if (p->same_p[mode] == 0 || p->same_p[mode] == 1)
{
/* We have already decided whether T1 and T2 are the
same, return the cached result. */
- return p->same_p == 1;
+ return p->same_p[mode] == 1;
}
- else if (p->same_p == -1)
+
+ if ((slot = pointer_map_contains (sccstate, p)) != NULL)
+ cstate = (struct sccs *)*slot;
+ if (!cstate)
{
- /* We are currently comparing this pair of types, assume
- that they are the same and let the caller decide. */
- return 1;
+ bool res;
+ /* Not yet visited. DFS recurse. */
+ res = gimple_types_compatible_p_1 (t1, t2, mode, p,
+ sccstack, sccstate, sccstate_obstack);
+ if (!cstate)
+ cstate = (struct sccs *)* pointer_map_contains (sccstate, p);
+ state->low = MIN (state->low, cstate->low);
+ /* If the type is no longer on the SCC stack and thus is not part
+ of the parents SCC, return its state. Otherwise we will
+ ignore this pair and assume equality. */
+ if (!cstate->on_sccstack)
+ return res;
}
+ if (cstate->dfsnum < state->dfsnum
+ && cstate->on_sccstack)
+ state->low = MIN (cstate->dfsnum, state->low);
+
+ /* We are part of our parents SCC, skip this entry and return true. */
+ return true;
+}
- gcc_assert (p->same_p == -2);
+/* Worker for gimple_types_compatible.
+ SCCSTACK, SCCSTATE and SCCSTATE_OBSTACK are state for the DFS walk done. */
- /* Mark the (T1, T2) comparison in progress. */
- p->same_p = -1;
+static bool
+gimple_types_compatible_p_1 (tree t1, tree t2, enum gtc_mode mode,
+ type_pair_t p,
+ VEC(type_pair_t, heap) **sccstack,
+ struct pointer_map_t *sccstate,
+ struct obstack *sccstate_obstack)
+{
+ struct sccs *state;
+
+ gcc_assert (p->same_p[mode] == -2);
+
+ state = XOBNEW (sccstate_obstack, struct sccs);
+ *pointer_map_insert (sccstate, p) = state;
+
+ VEC_safe_push (type_pair_t, heap, *sccstack, p);
+ state->dfsnum = gtc_next_dfs_num++;
+ state->low = state->dfsnum;
+ state->on_sccstack = true;
/* If their attributes are not the same they can't be the same type. */
if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2)))
@@ -3391,10 +3518,18 @@ gimple_types_compatible_p (tree t1, tree t2)
/* Do type-specific comparisons. */
switch (TREE_CODE (t1))
{
+ case VECTOR_TYPE:
+ case COMPLEX_TYPE:
+ if (!gtc_visit (TREE_TYPE (t1), TREE_TYPE (t2), mode,
+ state, sccstack, sccstate, sccstate_obstack))
+ goto different_types;
+ goto same_types;
+
case ARRAY_TYPE:
/* Array types are the same if the element types are the same and
the number of elements are the same. */
- if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ if (!gtc_visit (TREE_TYPE (t1), TREE_TYPE (t2), mode,
+ state, sccstack, sccstate, sccstate_obstack)
|| TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)
|| TYPE_NONALIASED_COMPONENT (t1) != TYPE_NONALIASED_COMPONENT (t2))
goto different_types;
@@ -3442,8 +3577,8 @@ gimple_types_compatible_p (tree t1, tree t2)
case METHOD_TYPE:
/* Method types should belong to the same class. */
- if (!gimple_types_compatible_p (TYPE_METHOD_BASETYPE (t1),
- TYPE_METHOD_BASETYPE (t2)))
+ if (!gtc_visit (TYPE_METHOD_BASETYPE (t1), TYPE_METHOD_BASETYPE (t2),
+ mode, state, sccstack, sccstate, sccstate_obstack))
goto different_types;
/* Fallthru */
@@ -3451,40 +3586,47 @@ gimple_types_compatible_p (tree t1, tree t2)
case FUNCTION_TYPE:
/* Function types are the same if the return type and arguments types
are the same. */
- if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ if ((mode != GTC_DIAG
+ || !gimple_compatible_complete_and_incomplete_subtype_p
+ (TREE_TYPE (t1), TREE_TYPE (t2)))
+ && !gtc_visit (TREE_TYPE (t1), TREE_TYPE (t2), mode,
+ state, sccstack, sccstate, sccstate_obstack))
+ goto different_types;
+
+ if (!targetm.comp_type_attributes (t1, t2))
goto different_types;
+
+ if (TYPE_ARG_TYPES (t1) == TYPE_ARG_TYPES (t2))
+ goto same_types;
else
{
- if (!targetm.comp_type_attributes (t1, t2))
- goto different_types;
+ tree parms1, parms2;
- if (TYPE_ARG_TYPES (t1) == TYPE_ARG_TYPES (t2))
- goto same_types;
- else
+ for (parms1 = TYPE_ARG_TYPES (t1), parms2 = TYPE_ARG_TYPES (t2);
+ parms1 && parms2;
+ parms1 = TREE_CHAIN (parms1), parms2 = TREE_CHAIN (parms2))
{
- tree parms1, parms2;
-
- for (parms1 = TYPE_ARG_TYPES (t1), parms2 = TYPE_ARG_TYPES (t2);
- parms1 && parms2;
- parms1 = TREE_CHAIN (parms1), parms2 = TREE_CHAIN (parms2))
- {
- if (!gimple_types_compatible_p (TREE_VALUE (parms1),
- TREE_VALUE (parms2)))
- goto different_types;
- }
-
- if (parms1 || parms2)
+ if ((mode == GTC_MERGE
+ || !gimple_compatible_complete_and_incomplete_subtype_p
+ (TREE_VALUE (parms1), TREE_VALUE (parms2)))
+ && !gtc_visit (TREE_VALUE (parms1), TREE_VALUE (parms2), mode,
+ state, sccstack, sccstate, sccstate_obstack))
goto different_types;
-
- goto same_types;
}
+
+ if (parms1 || parms2)
+ goto different_types;
+
+ goto same_types;
}
case OFFSET_TYPE:
{
- if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2))
- || !gimple_types_compatible_p (TYPE_OFFSET_BASETYPE (t1),
- TYPE_OFFSET_BASETYPE (t2)))
+ if (!gtc_visit (TREE_TYPE (t1), TREE_TYPE (t2), mode,
+ state, sccstack, sccstate, sccstate_obstack)
+ || !gtc_visit (TYPE_OFFSET_BASETYPE (t1),
+ TYPE_OFFSET_BASETYPE (t2), mode,
+ state, sccstack, sccstate, sccstate_obstack))
goto different_types;
goto same_types;
@@ -3500,34 +3642,15 @@ gimple_types_compatible_p (tree t1, tree t2)
/* If one pointer points to an incomplete type variant of
the other pointed-to type they are the same. */
- if (TREE_CODE (TREE_TYPE (t1)) == TREE_CODE (TREE_TYPE (t2))
- && RECORD_OR_UNION_TYPE_P (TREE_TYPE (t1))
- && (!COMPLETE_TYPE_P (TREE_TYPE (t1))
- || !COMPLETE_TYPE_P (TREE_TYPE (t2)))
- && TYPE_QUALS (TREE_TYPE (t1)) == TYPE_QUALS (TREE_TYPE (t2))
- && compare_type_names_p (TYPE_MAIN_VARIANT (TREE_TYPE (t1)),
- TYPE_MAIN_VARIANT (TREE_TYPE (t2)), true))
- {
- /* Replace the pointed-to incomplete type with the
- complete one.
- ??? This simple name-based merging causes at least some
- of the ICEs in canonicalizing FIELD_DECLs during stmt
- read. For example in GCC we have two different struct deps
- and we mismatch the use in struct cpp_reader in sched-int.h
- vs. mkdeps.c. Of course the whole exercise is for TBAA
- with structs which contain pointers to incomplete types
- in one unit and to complete ones in another. So we
- probably should merge these types only with more context. */
- if (COMPLETE_TYPE_P (TREE_TYPE (t2)))
- TREE_TYPE (t1) = TREE_TYPE (t2);
- else
- TREE_TYPE (t2) = TREE_TYPE (t1);
- goto same_types;
- }
+ if (mode == GTC_DIAG
+ && gimple_compatible_complete_and_incomplete_subtype_p
+ (TREE_TYPE (t1), TREE_TYPE (t2)))
+ goto same_types;
/* Otherwise, pointer and reference types are the same if the
pointed-to types are the same. */
- if (gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ if (gtc_visit (TREE_TYPE (t1), TREE_TYPE (t2), mode,
+ state, sccstack, sccstate, sccstate_obstack))
goto same_types;
goto different_types;
@@ -3622,8 +3745,8 @@ gimple_types_compatible_p (tree t1, tree t2)
if (DECL_NAME (f1) != DECL_NAME (f2)
|| DECL_NONADDRESSABLE_P (f1) != DECL_NONADDRESSABLE_P (f2)
|| !gimple_compare_field_offset (f1, f2)
- || !gimple_types_compatible_p (TREE_TYPE (f1),
- TREE_TYPE (f2)))
+ || !gtc_visit (TREE_TYPE (f1), TREE_TYPE (f2), mode,
+ state, sccstack, sccstate, sccstate_obstack))
goto different_types;
}
@@ -3641,32 +3764,141 @@ gimple_types_compatible_p (tree t1, tree t2)
/* Common exit path for types that are not compatible. */
different_types:
- p->same_p = 0;
- return 0;
+ state->u.same_p = 0;
+ goto pop;
/* Common exit path for types that are compatible. */
same_types:
- p->same_p = 1;
- return 1;
-}
+ state->u.same_p = 1;
+ goto pop;
+pop:
+ if (state->low == state->dfsnum)
+ {
+ type_pair_t x;
+ /* Pop off the SCC and set its cache values. */
+ do
+ {
+ struct sccs *cstate;
+ x = VEC_pop (type_pair_t, *sccstack);
+ cstate = (struct sccs *)*pointer_map_contains (sccstate, x);
+ cstate->on_sccstack = false;
+ x->same_p[mode] = cstate->u.same_p;
+ }
+ while (x != p);
+ }
+ return state->u.same_p;
+}
-/* Per pointer state for the SCC finding. The on_sccstack flag
- is not strictly required, it is true when there is no hash value
- recorded for the type and false otherwise. But querying that
- is slower. */
+/* Return true iff T1 and T2 are structurally identical. When
+ FOR_MERGING_P is true the an incomplete type and a complete type
+ are considered different, otherwise they are considered compatible. */
-struct sccs
+bool
+gimple_types_compatible_p (tree t1, tree t2, enum gtc_mode mode)
{
- unsigned int dfsnum;
- unsigned int low;
- bool on_sccstack;
- hashval_t hash;
-};
+ VEC(type_pair_t, heap) *sccstack = NULL;
+ struct pointer_map_t *sccstate;
+ struct obstack sccstate_obstack;
+ type_pair_t p = NULL;
+ bool res;
+
+ /* Before starting to set up the SCC machinery handle simple cases. */
+
+ /* Check first for the obvious case of pointer identity. */
+ if (t1 == t2)
+ return true;
+
+ /* Check that we have two types to compare. */
+ if (t1 == NULL_TREE || t2 == NULL_TREE)
+ return false;
+
+ /* If the types have been previously registered and found equal
+ they still are. */
+ if (TYPE_CANONICAL (t1)
+ && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2))
+ return true;
+
+ /* Can't be the same type if the types don't have the same code. */
+ if (TREE_CODE (t1) != TREE_CODE (t2))
+ return false;
+
+ /* Can't be the same type if they have different CV qualifiers. */
+ if (TYPE_QUALS (t1) != TYPE_QUALS (t2))
+ return false;
+
+ /* Void types are always the same. */
+ if (TREE_CODE (t1) == VOID_TYPE)
+ return true;
+
+ /* Do some simple checks before doing three hashtable queries. */
+ if (INTEGRAL_TYPE_P (t1)
+ || SCALAR_FLOAT_TYPE_P (t1)
+ || FIXED_POINT_TYPE_P (t1)
+ || TREE_CODE (t1) == VECTOR_TYPE
+ || TREE_CODE (t1) == COMPLEX_TYPE
+ || TREE_CODE (t1) == OFFSET_TYPE)
+ {
+ /* Can't be the same type if they have different alignment,
+ sign, precision or mode. */
+ if (TYPE_ALIGN (t1) != TYPE_ALIGN (t2)
+ || TYPE_PRECISION (t1) != TYPE_PRECISION (t2)
+ || TYPE_MODE (t1) != TYPE_MODE (t2)
+ || TYPE_UNSIGNED (t1) != TYPE_UNSIGNED (t2))
+ return false;
+
+ if (TREE_CODE (t1) == INTEGER_TYPE
+ && (TYPE_IS_SIZETYPE (t1) != TYPE_IS_SIZETYPE (t2)
+ || TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)))
+ return false;
+
+ /* That's all we need to check for float and fixed-point types. */
+ if (SCALAR_FLOAT_TYPE_P (t1)
+ || FIXED_POINT_TYPE_P (t1))
+ return true;
+
+ /* For integral types fall thru to more complex checks. */
+ }
+
+ else if (AGGREGATE_TYPE_P (t1) || POINTER_TYPE_P (t1))
+ {
+ /* Can't be the same type if they have different alignment or mode. */
+ if (TYPE_ALIGN (t1) != TYPE_ALIGN (t2)
+ || TYPE_MODE (t1) != TYPE_MODE (t2))
+ return false;
+ }
+
+ /* If the hash values of t1 and t2 are different the types can't
+ possibly be the same. This helps keeping the type-pair hashtable
+ small, only tracking comparisons for hash collisions. */
+ if (gimple_type_hash (t1) != gimple_type_hash (t2))
+ return false;
+
+ /* If we've visited this type pair before (in the case of aggregates
+ with self-referential types), and we made a decision, return it. */
+ p = lookup_type_pair (t1, t2, &gtc_visited, &gtc_ob);
+ if (p->same_p[mode] == 0 || p->same_p[mode] == 1)
+ {
+ /* We have already decided whether T1 and T2 are the
+ same, return the cached result. */
+ return p->same_p[mode] == 1;
+ }
+
+ /* Now set up the SCC machinery for the comparison. */
+ gtc_next_dfs_num = 1;
+ sccstate = pointer_map_create ();
+ gcc_obstack_init (&sccstate_obstack);
+ res = gimple_types_compatible_p_1 (t1, t2, mode, p,
+ &sccstack, sccstate, &sccstate_obstack);
+ VEC_free (type_pair_t, heap, sccstack);
+ pointer_map_destroy (sccstate);
+ obstack_free (&sccstate_obstack, NULL);
+
+ return res;
+}
-static unsigned int next_dfs_num;
static hashval_t
iterative_hash_gimple_type (tree, hashval_t, VEC(tree, heap) **,
@@ -3844,13 +4076,29 @@ iterative_hash_gimple_type (tree type, hashval_t val,
v = visit (TYPE_METHOD_BASETYPE (type), state, v,
sccstack, sccstate, sccstate_obstack);
- v = visit (TREE_TYPE (type), state, v,
- sccstack, sccstate, sccstate_obstack);
+ /* For result types allow mismatch in completeness. */
+ if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (type)))
+ {
+ v = iterative_hash_hashval_t (TREE_CODE (TREE_TYPE (type)), v);
+ v = iterative_hash_name
+ (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (type))), v);
+ }
+ else
+ v = visit (TREE_TYPE (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
for (p = TYPE_ARG_TYPES (type), na = 0; p; p = TREE_CHAIN (p))
{
- v = visit (TREE_VALUE (p), state, v,
- sccstack, sccstate, sccstate_obstack);
+ /* For argument types allow mismatch in completeness. */
+ if (RECORD_OR_UNION_TYPE_P (TREE_VALUE (p)))
+ {
+ v = iterative_hash_hashval_t (TREE_CODE (TREE_VALUE (p)), v);
+ v = iterative_hash_name
+ (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_VALUE (p))), v);
+ }
+ else
+ v = visit (TREE_VALUE (p), state, v,
+ sccstack, sccstate, sccstate_obstack);
na++;
}
@@ -3878,7 +4126,7 @@ iterative_hash_gimple_type (tree type, hashval_t val,
}
/* Record hash for us. */
- state->hash = v;
+ state->u.hash = v;
/* See if we found an SCC. */
if (state->low == state->dfsnum)
@@ -3894,7 +4142,7 @@ iterative_hash_gimple_type (tree type, hashval_t val,
cstate = (struct sccs *)*pointer_map_contains (sccstate, x);
cstate->on_sccstack = false;
slot = pointer_map_insert (type_hash_cache, x);
- *slot = (void *) (size_t) cstate->hash;
+ *slot = (void *) (size_t) cstate->u.hash;
}
while (x != type);
}
@@ -3948,7 +4196,8 @@ gimple_type_eq (const void *p1, const void *p2)
{
const_tree t1 = (const_tree) p1;
const_tree t2 = (const_tree) p2;
- return gimple_types_compatible_p (CONST_CAST_TREE (t1), CONST_CAST_TREE (t2));
+ return gimple_types_compatible_p (CONST_CAST_TREE (t1),
+ CONST_CAST_TREE (t2), GTC_MERGE);
}
@@ -4418,7 +4667,7 @@ count_ptr_derefs (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
- if (INDIRECT_REF_P (*tp) && TREE_OPERAND (*tp, 0) == count_p->ptr)
+ if (TREE_CODE (*tp) == MEM_REF && TREE_OPERAND (*tp, 0) == count_p->ptr)
{
if (wi_p->is_lhs)
count_p->num_stores++;
@@ -4491,6 +4740,7 @@ get_base_loadstore (tree op)
op = TREE_OPERAND (op, 0);
if (DECL_P (op)
|| INDIRECT_REF_P (op)
+ || TREE_CODE (op) == MEM_REF
|| TREE_CODE (op) == TARGET_MEM_REF)
return op;
return NULL_TREE;
diff --git a/gcc/gimple.h b/gcc/gimple.h
index ffc344178d7..790998637f0 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -879,7 +879,6 @@ tree gimple_get_lhs (const_gimple);
void gimple_set_lhs (gimple, tree);
void gimple_replace_lhs (gimple, tree);
gimple gimple_copy (gimple);
-bool is_gimple_operand (const_tree);
void gimple_set_modified (gimple, bool);
void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *);
gimple gimple_build_cond_from_tree (tree, tree, tree);
@@ -933,6 +932,8 @@ extern bool is_gimple_ip_invariant (const_tree);
extern bool is_gimple_val (tree);
/* Returns true iff T is a GIMPLE asm statement input. */
extern bool is_gimple_asm_val (tree);
+/* Returns true iff T is a valid address operand of a MEM_REF. */
+bool is_gimple_mem_ref_addr (tree);
/* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a
GIMPLE temporary, a renamed user variable, or something else,
respectively. */
@@ -955,6 +956,8 @@ extern tree get_call_expr_in (tree t);
extern void recalculate_side_effects (tree);
extern bool gimple_compare_field_offset (tree, tree);
extern tree gimple_register_type (tree);
+enum gtc_mode { GTC_MERGE = 0, GTC_DIAG = 1 };
+extern bool gimple_types_compatible_p (tree, tree, enum gtc_mode);
extern void print_gimple_types_stats (void);
extern void free_gimple_type_tables (void);
extern tree gimple_unsigned_type (tree);
@@ -2037,7 +2040,18 @@ gimple_call_fndecl (const_gimple gs)
{
tree addr = gimple_call_fn (gs);
if (TREE_CODE (addr) == ADDR_EXPR)
- return TREE_OPERAND (addr, 0);
+ {
+ tree fndecl = TREE_OPERAND (addr, 0);
+ if (TREE_CODE (fndecl) == MEM_REF)
+ {
+ if (TREE_CODE (TREE_OPERAND (fndecl, 0)) == ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (fndecl, 1)))
+ return TREE_OPERAND (TREE_OPERAND (fndecl, 0), 0);
+ else
+ return NULL_TREE;
+ }
+ return TREE_OPERAND (addr, 0);
+ }
return NULL_TREE;
}
@@ -4857,8 +4871,8 @@ void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
tree gimple_fold_builtin (gimple);
bool fold_stmt (gimple_stmt_iterator *);
bool fold_stmt_inplace (gimple);
-tree maybe_fold_offset_to_reference (location_t, tree, tree, tree);
tree maybe_fold_offset_to_address (location_t, tree, tree, tree);
+tree maybe_fold_offset_to_reference (location_t, tree, tree, tree);
tree maybe_fold_stmt_addition (location_t, tree, tree, tree);
tree get_symbol_constant_value (tree);
bool may_propagate_address_into_dereference (tree, tree);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 567f304fe1f..db28dcd853c 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "output.h"
#include "ggc.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "target.h"
#include "pointer-set.h"
@@ -110,10 +111,13 @@ mark_addressable (tree x)
{
while (handled_component_p (x))
x = TREE_OPERAND (x, 0);
+ if (TREE_CODE (x) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
+ x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
if (TREE_CODE (x) != VAR_DECL
&& TREE_CODE (x) != PARM_DECL
&& TREE_CODE (x) != RESULT_DECL)
- return ;
+ return;
TREE_ADDRESSABLE (x) = 1;
}
@@ -649,7 +653,7 @@ declare_vars (tree vars, gimple scope, bool debug_info)
gcc_assert (!block || TREE_CODE (block) == BLOCK);
if (!block || !debug_info)
{
- TREE_CHAIN (last) = gimple_bind_vars (scope);
+ DECL_CHAIN (last) = gimple_bind_vars (scope);
gimple_bind_set_vars (scope, temps);
}
else
@@ -697,7 +701,7 @@ force_constant_size (tree var)
void
gimple_add_tmp_var (tree tmp)
{
- gcc_assert (!TREE_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp));
+ gcc_assert (!DECL_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp));
/* Later processing assumes that the object size is constant, which might
not be true at this point. Force the use of a constant upper bound in
@@ -710,7 +714,7 @@ gimple_add_tmp_var (tree tmp)
if (gimplify_ctxp)
{
- TREE_CHAIN (tmp) = gimplify_ctxp->temps;
+ DECL_CHAIN (tmp) = gimplify_ctxp->temps;
gimplify_ctxp->temps = tmp;
/* Mark temporaries local within the nearest enclosing parallel. */
@@ -865,9 +869,9 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data)
tree t = *tp;
enum tree_code code = TREE_CODE (t);
- /* Do not copy SAVE_EXPR or TARGET_EXPR nodes themselves, but copy
- their subtrees if we can make sure to do it only once. */
- if (code == SAVE_EXPR || code == TARGET_EXPR)
+ /* Do not copy SAVE_EXPR, TARGET_EXPR or BIND_EXPR nodes themselves, but
+ copy their subtrees if we can make sure to do it only once. */
+ if (code == SAVE_EXPR || code == TARGET_EXPR || code == BIND_EXPR)
{
if (data && !pointer_set_insert ((struct pointer_set_t *)data, t))
;
@@ -892,10 +896,7 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data)
/* Leave the bulk of the work to copy_tree_r itself. */
else
- {
- gcc_assert (code != BIND_EXPR);
- copy_tree_r (tp, walk_subtrees, NULL);
- }
+ copy_tree_r (tp, walk_subtrees, NULL);
return NULL_TREE;
}
@@ -1132,7 +1133,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
tree temp = voidify_wrapper_expr (bind_expr, NULL);
/* Mark variables seen in this bind expr. */
- for (t = BIND_EXPR_VARS (bind_expr); t ; t = TREE_CHAIN (t))
+ for (t = BIND_EXPR_VARS (bind_expr); t ; t = DECL_CHAIN (t))
{
if (TREE_CODE (t) == VAR_DECL)
{
@@ -1901,7 +1902,7 @@ gimplify_var_or_parm_decl (tree *expr_p)
SET_DECL_RTL (copy, 0);
TREE_USED (copy) = 1;
block = DECL_INITIAL (current_function_decl);
- TREE_CHAIN (copy) = BLOCK_VARS (block);
+ DECL_CHAIN (copy) = BLOCK_VARS (block);
BLOCK_VARS (block) = copy;
SET_DECL_VALUE_EXPR (copy, unshare_expr (value_expr));
DECL_HAS_VALUE_EXPR_P (copy) = 1;
@@ -2961,7 +2962,7 @@ gimplify_cond_expr (tree *expr_p, gimple_seq *pre_p, fallback_t fallback)
= build3 (COND_EXPR, type, TREE_OPERAND (expr, 0), then_, else_);
tmp = create_tmp_var (type, "iftmp");
- result = build_fold_indirect_ref_loc (loc, tmp);
+ result = build_simple_mem_ref_loc (loc, tmp);
}
/* Build the new then clause, `tmp = then_;'. But don't build the
@@ -3185,7 +3186,7 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value,
gimple_call_set_lhs (gs, t);
gimplify_seq_add_stmt (seq_p, gs);
- *expr_p = build1 (INDIRECT_REF, TREE_TYPE (to), t);
+ *expr_p = build_simple_mem_ref (t);
return GS_ALL_DONE;
}
@@ -3269,13 +3270,16 @@ gimplify_init_ctor_preeval_1 (tree *tp, int *walk_subtrees, void *xdata)
/* If the constructor component is indirect, determine if we have a
potential overlap with the lhs. The only bits of information we
have to go on at this point are addressability and alias sets. */
- if (TREE_CODE (t) == INDIRECT_REF
+ if ((INDIRECT_REF_P (t)
+ || TREE_CODE (t) == MEM_REF)
&& (!data->lhs_base_decl || TREE_ADDRESSABLE (data->lhs_base_decl))
&& alias_sets_conflict_p (data->lhs_alias_set, get_alias_set (t)))
return t;
/* If the constructor component is a call, determine if it can hide a
- potential overlap with the lhs through an INDIRECT_REF like above. */
+ potential overlap with the lhs through an INDIRECT_REF like above.
+ ??? Ugh - this is completely broken. In fact this whole analysis
+ doesn't look conservative. */
if (TREE_CODE (t) == CALL_EXPR)
{
tree type, fntype = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (t)));
@@ -4004,7 +4008,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
tree
gimple_fold_indirect_ref (tree t)
{
- tree type = TREE_TYPE (TREE_TYPE (t));
+ tree ptype = TREE_TYPE (t), type = TREE_TYPE (ptype);
tree sub = t;
tree subtype;
@@ -4047,51 +4051,52 @@ gimple_fold_indirect_ref (tree t)
}
}
- /* ((foo*)&vectorfoo)[1] => BIT_FIELD_REF<vectorfoo,...> */
+ /* *(p + CST) -> ... */
if (TREE_CODE (sub) == POINTER_PLUS_EXPR
&& TREE_CODE (TREE_OPERAND (sub, 1)) == INTEGER_CST)
{
- tree op00 = TREE_OPERAND (sub, 0);
- tree op01 = TREE_OPERAND (sub, 1);
- tree op00type;
+ tree addr = TREE_OPERAND (sub, 0);
+ tree off = TREE_OPERAND (sub, 1);
+ tree addrtype;
+
+ STRIP_NOPS (addr);
+ addrtype = TREE_TYPE (addr);
- STRIP_NOPS (op00);
- op00type = TREE_TYPE (op00);
- if (TREE_CODE (op00) == ADDR_EXPR
- && TREE_CODE (TREE_TYPE (op00type)) == VECTOR_TYPE
- && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (op00type))))
+ /* ((foo*)&vectorfoo)[1] -> BIT_FIELD_REF<vectorfoo,...> */
+ if (TREE_CODE (addr) == ADDR_EXPR
+ && TREE_CODE (TREE_TYPE (addrtype)) == VECTOR_TYPE
+ && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype))))
{
- HOST_WIDE_INT offset = tree_low_cst (op01, 0);
- tree part_width = TYPE_SIZE (type);
- unsigned HOST_WIDE_INT part_widthi
- = tree_low_cst (part_width, 0) / BITS_PER_UNIT;
- unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
- tree index = bitsize_int (indexi);
- if (offset / part_widthi
- <= TYPE_VECTOR_SUBPARTS (TREE_TYPE (op00type)))
- return fold_build3 (BIT_FIELD_REF, type, TREE_OPERAND (op00, 0),
- part_width, index);
+ HOST_WIDE_INT offset = tree_low_cst (off, 0);
+ tree part_width = TYPE_SIZE (type);
+ unsigned HOST_WIDE_INT part_widthi
+ = tree_low_cst (part_width, 0) / BITS_PER_UNIT;
+ unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
+ tree index = bitsize_int (indexi);
+ if (offset / part_widthi
+ <= TYPE_VECTOR_SUBPARTS (TREE_TYPE (addrtype)))
+ return fold_build3 (BIT_FIELD_REF, type, TREE_OPERAND (addr, 0),
+ part_width, index);
}
- }
- /* ((foo*)&complexfoo)[1] => __imag__ complexfoo */
- if (TREE_CODE (sub) == POINTER_PLUS_EXPR
- && TREE_CODE (TREE_OPERAND (sub, 1)) == INTEGER_CST)
- {
- tree op00 = TREE_OPERAND (sub, 0);
- tree op01 = TREE_OPERAND (sub, 1);
- tree op00type;
+ /* ((foo*)&complexfoo)[1] -> __imag__ complexfoo */
+ if (TREE_CODE (addr) == ADDR_EXPR
+ && TREE_CODE (TREE_TYPE (addrtype)) == COMPLEX_TYPE
+ && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype))))
+ {
+ tree size = TYPE_SIZE_UNIT (type);
+ if (tree_int_cst_equal (size, off))
+ return fold_build1 (IMAGPART_EXPR, type, TREE_OPERAND (addr, 0));
+ }
- STRIP_NOPS (op00);
- op00type = TREE_TYPE (op00);
- if (TREE_CODE (op00) == ADDR_EXPR
- && TREE_CODE (TREE_TYPE (op00type)) == COMPLEX_TYPE
- && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (op00type))))
- {
- tree size = TYPE_SIZE_UNIT (type);
- if (tree_int_cst_equal (size, op01))
- return fold_build1 (IMAGPART_EXPR, type, TREE_OPERAND (op00, 0));
- }
+ /* *(p + CST) -> MEM_REF <p, CST>. */
+ if (TREE_CODE (addr) != ADDR_EXPR
+ || DECL_P (TREE_OPERAND (addr, 0)))
+ return fold_build2 (MEM_REF, type,
+ addr,
+ build_int_cst_wide (ptype,
+ TREE_INT_CST_LOW (off),
+ TREE_INT_CST_HIGH (off)));
}
/* *(foo *)fooarrptr => (*fooarrptr)[0] */
@@ -4555,7 +4560,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
/* Try to alleviate the effects of the gimplification creating artificial
temporaries (see for example is_gimple_reg_rhs) on the debug info. */
if (!gimplify_ctxp->into_ssa
- && DECL_P (*from_p)
+ && TREE_CODE (*from_p) == VAR_DECL
&& DECL_IGNORED_P (*from_p)
&& DECL_P (*to_p)
&& !DECL_IGNORED_P (*to_p))
@@ -5387,7 +5392,7 @@ omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *ctx, tree type)
case QUAL_UNION_TYPE:
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
omp_firstprivatize_variable (ctx, DECL_FIELD_OFFSET (field));
@@ -6558,7 +6563,8 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|| gimple_test_f == is_gimple_mem_rhs_or_call
|| gimple_test_f == is_gimple_reg_rhs
|| gimple_test_f == is_gimple_reg_rhs_or_call
- || gimple_test_f == is_gimple_asm_val)
+ || gimple_test_f == is_gimple_asm_val
+ || gimple_test_f == is_gimple_mem_ref_addr)
gcc_assert (fallback & fb_rvalue);
else if (gimple_test_f == is_gimple_min_lval
|| gimple_test_f == is_gimple_lvalue)
@@ -6764,19 +6770,56 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
recalculate_side_effects (*expr_p);
break;
+ case MISALIGNED_INDIRECT_REF:
+ /* We can only reach this through re-gimplification from
+ tree optimizers. */
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ is_gimple_reg, fb_rvalue);
+ recalculate_side_effects (*expr_p);
+ break;
+
case INDIRECT_REF:
- *expr_p = fold_indirect_ref_loc (input_location, *expr_p);
- if (*expr_p != save_expr)
+ {
+ bool volatilep = TREE_THIS_VOLATILE (*expr_p);
+ tree saved_ptr_type = TREE_TYPE (TREE_OPERAND (*expr_p, 0));
+
+ *expr_p = fold_indirect_ref_loc (input_location, *expr_p);
+ if (*expr_p != save_expr)
+ {
+ ret = GS_OK;
+ break;
+ }
+
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ is_gimple_reg, fb_rvalue);
+ recalculate_side_effects (*expr_p);
+
+ *expr_p = fold_build2_loc (input_location, MEM_REF,
+ TREE_TYPE (*expr_p),
+ TREE_OPERAND (*expr_p, 0),
+ build_int_cst (saved_ptr_type, 0));
+ TREE_THIS_VOLATILE (*expr_p) = volatilep;
+ ret = GS_OK;
+ break;
+ }
+
+ /* We arrive here through the various re-gimplifcation paths. */
+ case MEM_REF:
+ /* First try re-folding the whole thing. */
+ tmp = fold_binary (MEM_REF, TREE_TYPE (*expr_p),
+ TREE_OPERAND (*expr_p, 0),
+ TREE_OPERAND (*expr_p, 1));
+ if (tmp)
{
+ *expr_p = tmp;
+ recalculate_side_effects (*expr_p);
ret = GS_OK;
break;
}
- /* else fall through. */
- case ALIGN_INDIRECT_REF:
- case MISALIGNED_INDIRECT_REF:
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
- is_gimple_reg, fb_rvalue);
+ is_gimple_mem_ref_addr, fb_rvalue);
recalculate_side_effects (*expr_p);
+ ret = GS_ALL_DONE;
break;
/* Constants need not be gimplified. */
@@ -7373,7 +7416,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
that temporary. */
tmp = build_fold_addr_expr_loc (input_location, *expr_p);
gimplify_expr (&tmp, pre_p, post_p, is_gimple_reg, fb_rvalue);
- *expr_p = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (tmp)), tmp);
+ *expr_p = build_simple_mem_ref (tmp);
}
else if ((fallback & fb_rvalue) && is_gimple_reg_rhs_or_call (*expr_p))
{
@@ -7489,7 +7532,7 @@ gimplify_type_sizes (tree type, gimple_seq *list_p)
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
gimplify_one_sizepos (&DECL_FIELD_OFFSET (field), list_p);
@@ -7648,7 +7691,7 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms)
gimple_bind_set_body (outer_bind, parm_stmts);
for (parm = DECL_ARGUMENTS (current_function_decl);
- parm; parm = TREE_CHAIN (parm))
+ parm; parm = DECL_CHAIN (parm))
if (DECL_HAS_VALUE_EXPR_P (parm))
{
DECL_HAS_VALUE_EXPR_P (parm) = 0;
@@ -7698,7 +7741,7 @@ gimplify_function_tree (tree fndecl)
else
push_struct_function (fndecl);
- for (parm = DECL_ARGUMENTS (fndecl); parm ; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (fndecl); parm ; parm = DECL_CHAIN (parm))
{
/* Preliminarily mark non-addressed complex variables as eligible
for promotion to gimple registers. We'll transform their uses
@@ -7994,7 +8037,7 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
}
if (gimple_referenced_vars (cfun))
- for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
+ for (t = gimplify_ctxp->temps; t ; t = DECL_CHAIN (t))
add_referenced_var (t);
pop_gimplify_context (NULL);
diff --git a/gcc/graph.c b/gcc/graph.c
index 04227a4b058..081dec852c5 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "obstack.h"
#include "basic-block.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "graph.h"
#include "emit-rtl.h"
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index a5e1d3ffcf4..f136e40cba3 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -128,6 +128,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
@@ -138,7 +139,6 @@ along with GCC; see the file COPYING3. If not see
#include "insn-config.h"
#include "insn-attr.h"
#include "except.h"
-#include "toplev.h"
#include "recog.h"
#include "sched-int.h"
#include "target.h"
diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h
index 272a2394d5d..486a88a2ed8 100644
--- a/gcc/hard-reg-set.h
+++ b/gcc/hard-reg-set.h
@@ -576,94 +576,123 @@ hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno)
/* Define some standard sets of registers. */
/* Indexed by hard register number, contains 1 for registers
- that are fixed use (stack pointer, pc, frame pointer, etc.).
- These are the registers that cannot be used to allocate
- a pseudo reg whose life does not cross calls. */
-
-extern char fixed_regs[FIRST_PSEUDO_REGISTER];
-
-/* The same info as a HARD_REG_SET. */
-
-extern HARD_REG_SET fixed_reg_set;
-
-/* Indexed by hard register number, contains 1 for registers
- that are fixed use or are clobbered by function calls.
- These are the registers that cannot be used to allocate
- a pseudo reg whose life crosses calls. */
-
-extern char call_used_regs[FIRST_PSEUDO_REGISTER];
-
-#ifdef CALL_REALLY_USED_REGISTERS
-extern char call_really_used_regs[];
-#endif
-
-/* The same info as a HARD_REG_SET. */
-
-extern HARD_REG_SET call_used_reg_set;
-
-/* Contains registers that are fixed use -- i.e. in fixed_reg_set -- or
- a function value return register or TARGET_STRUCT_VALUE_RTX or
- STATIC_CHAIN_REGNUM. These are the registers that cannot hold quantities
- across calls even if we are willing to save and restore them. */
-
-extern HARD_REG_SET call_fixed_reg_set;
-
-/* Indexed by hard register number, contains 1 for registers
that are being used for global register decls.
These must be exempt from ordinary flow analysis
and are also considered fixed. */
extern char global_regs[FIRST_PSEUDO_REGISTER];
-/* Contains 1 for registers that are set or clobbered by calls. */
-/* ??? Ideally, this would be just call_used_regs plus global_regs, but
- for someone's bright idea to have call_used_regs strictly include
- fixed_regs. Which leaves us guessing as to the set of fixed_regs
- that are actually preserved. We know for sure that those associated
- with the local stack frame are safe, but scant others. */
+struct target_hard_regs {
+ /* Indexed by hard register number, contains 1 for registers
+ that are fixed use (stack pointer, pc, frame pointer, etc.;.
+ These are the registers that cannot be used to allocate
+ a pseudo reg whose life does not cross calls. */
+ char x_fixed_regs[FIRST_PSEUDO_REGISTER];
-extern HARD_REG_SET regs_invalidated_by_call;
+ /* The same info as a HARD_REG_SET. */
+ HARD_REG_SET x_fixed_reg_set;
-/* Call used hard registers which can not be saved because there is no
- insn for this. */
+ /* Indexed by hard register number, contains 1 for registers
+ that are fixed use or are clobbered by function calls.
+ These are the registers that cannot be used to allocate
+ a pseudo reg whose life crosses calls. */
+ char x_call_used_regs[FIRST_PSEUDO_REGISTER];
-extern HARD_REG_SET no_caller_save_reg_set;
+ char x_call_really_used_regs[FIRST_PSEUDO_REGISTER];
-#ifdef REG_ALLOC_ORDER
-/* Table of register numbers in the order in which to try to use them. */
+ /* The same info as a HARD_REG_SET. */
+ HARD_REG_SET x_call_used_reg_set;
-extern int reg_alloc_order[FIRST_PSEUDO_REGISTER];
+ /* Contains registers that are fixed use -- i.e. in fixed_reg_set -- or
+ a function value return register or TARGET_STRUCT_VALUE_RTX or
+ STATIC_CHAIN_REGNUM. These are the registers that cannot hold quantities
+ across calls even if we are willing to save and restore them. */
+ HARD_REG_SET x_call_fixed_reg_set;
-/* The inverse of reg_alloc_order. */
+ /* Contains 1 for registers that are set or clobbered by calls. */
+ /* ??? Ideally, this would be just call_used_regs plus global_regs, but
+ for someone's bright idea to have call_used_regs strictly include
+ fixed_regs. Which leaves us guessing as to the set of fixed_regs
+ that are actually preserved. We know for sure that those associated
+ with the local stack frame are safe, but scant others. */
+ HARD_REG_SET x_regs_invalidated_by_call;
-extern int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
-#endif
-
-/* For each reg class, a HARD_REG_SET saying which registers are in it. */
+ /* Call used hard registers which can not be saved because there is no
+ insn for this. */
+ HARD_REG_SET x_no_caller_save_reg_set;
-extern HARD_REG_SET reg_class_contents[N_REG_CLASSES];
+ /* Table of register numbers in the order in which to try to use them. */
+ int x_reg_alloc_order[FIRST_PSEUDO_REGISTER];
-/* For each reg class, number of regs it contains. */
+ /* The inverse of reg_alloc_order. */
+ int x_inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
-extern unsigned int reg_class_size[N_REG_CLASSES];
+ /* For each reg class, a HARD_REG_SET saying which registers are in it. */
+ HARD_REG_SET x_reg_class_contents[N_REG_CLASSES];
-/* For each reg class, table listing all the classes contained in it. */
+ /* For each reg class, a boolean saying whether the class contains only
+ fixed registers. */
+ bool x_class_only_fixed_regs[N_REG_CLASSES];
-extern enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
+ /* For each reg class, number of regs it contains. */
+ unsigned int x_reg_class_size[N_REG_CLASSES];
-/* For each pair of reg classes,
- a largest reg class contained in their union. */
+ /* For each reg class, table listing all the classes contained in it. */
+ enum reg_class x_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
-extern enum reg_class reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
+ /* For each pair of reg classes,
+ a largest reg class contained in their union. */
+ enum reg_class x_reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
-/* For each pair of reg classes,
- the smallest reg class that contains their union. */
+ /* For each pair of reg classes,
+ the smallest reg class that contains their union. */
+ enum reg_class x_reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
-extern enum reg_class reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
+ /* Vector indexed by hardware reg giving its name. */
+ const char *x_reg_names[FIRST_PSEUDO_REGISTER];
+};
-/* Vector indexed by hardware reg giving its name. */
+extern struct target_hard_regs default_target_hard_regs;
+#if SWITCHABLE_TARGET
+extern struct target_hard_regs *this_target_hard_regs;
+#else
+#define this_target_hard_regs (&default_target_hard_regs)
+#endif
-extern const char * reg_names[FIRST_PSEUDO_REGISTER];
+#define fixed_regs \
+ (this_target_hard_regs->x_fixed_regs)
+#define fixed_reg_set \
+ (this_target_hard_regs->x_fixed_reg_set)
+#define call_used_regs \
+ (this_target_hard_regs->x_call_used_regs)
+#define call_really_used_regs \
+ (this_target_hard_regs->x_call_really_used_regs)
+#define call_used_reg_set \
+ (this_target_hard_regs->x_call_used_reg_set)
+#define call_fixed_reg_set \
+ (this_target_hard_regs->x_call_fixed_reg_set)
+#define regs_invalidated_by_call \
+ (this_target_hard_regs->x_regs_invalidated_by_call)
+#define no_caller_save_reg_set \
+ (this_target_hard_regs->x_no_caller_save_reg_set)
+#define reg_alloc_order \
+ (this_target_hard_regs->x_reg_alloc_order)
+#define inv_reg_alloc_order \
+ (this_target_hard_regs->x_inv_reg_alloc_order)
+#define reg_class_contents \
+ (this_target_hard_regs->x_reg_class_contents)
+#define class_only_fixed_regs \
+ (this_target_hard_regs->x_class_only_fixed_regs)
+#define reg_class_size \
+ (this_target_hard_regs->x_reg_class_size)
+#define reg_class_subclasses \
+ (this_target_hard_regs->x_reg_class_subclasses)
+#define reg_class_subunion \
+ (this_target_hard_regs->x_reg_class_subunion)
+#define reg_class_superunion \
+ (this_target_hard_regs->x_reg_class_superunion)
+#define reg_names \
+ (this_target_hard_regs->x_reg_names)
/* Vector indexed by reg class giving its name. */
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 8d6b885f342..3df0c2b3e51 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -35,6 +35,7 @@
#include "expr.h"
#include "output.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "cfgloop.h"
@@ -3156,7 +3157,7 @@ find_if_header (basic_block test_bb, int pass)
goto success;
if (HAVE_trap
- && optab_handler (ctrap_optab, word_mode)->insn_code != CODE_FOR_nothing
+ && optab_handler (ctrap_optab, word_mode) != CODE_FOR_nothing
&& find_cond_trap (test_bb, then_edge, else_edge))
goto success;
diff --git a/gcc/implicit-zee.c b/gcc/implicit-zee.c
index 46029cdac38..e2716d305a7 100644
--- a/gcc/implicit-zee.c
+++ b/gcc/implicit-zee.c
@@ -100,17 +100,17 @@ along with GCC; see the file COPYING3. If not see
}
**********************************************
- $ gcc -O2 -fsee bad_code.c (Turned on existing sign-extension elimination.)
+ $ gcc -O2 -fsee bad_code.c (Turned on existing sign-extension elimination)
........
400315: b8 4e 00 00 00 mov $0x4e,%eax
40031a: 0f af f8 imul %eax,%edi
- 40031d: 89 ff mov %edi,%edi ---> Useless extend.
+ 40031d: 89 ff mov %edi,%edi --> Useless extend
40031f: 8b 04 bd 60 19 40 00 mov 0x401960(,%rdi,4),%eax
400326: c3 retq
......
400330: ba 2d 00 00 00 mov $0x2d,%edx
400335: 0f af fa imul %edx,%edi
- 400338: 89 ff mov %edi,%edi ---> Useless extend.
+ 400338: 89 ff mov %edi,%edi --> Useless extend
40033a: 8b 04 bd 60 19 40 00 mov 0x401960(,%rdi,4),%eax
400341: c3 retq
@@ -141,14 +141,14 @@ along with GCC; see the file COPYING3. If not see
return (unsigned long long)(z);
}
- $ gcc -O2 -fsee bad_code.c (Turned on existing sign-extension elimination.)
+ $ gcc -O2 -fsee bad_code.c (Turned on existing sign-extension elimination)
............
400360: 8d 14 3e lea (%rsi,%rdi,1),%edx
400363: 89 f8 mov %edi,%eax
400365: 29 f0 sub %esi,%eax
400367: 83 ff 65 cmp $0x65,%edi
40036a: 0f 43 c2 cmovae %edx,%eax
- 40036d: 89 c0 mov %eax,%eax ---> Useless extend.
+ 40036d: 89 c0 mov %eax,%eax --> Useless extend
40036f: c3 retq
$ gcc -O2 -fzee bad_code.c
@@ -165,16 +165,13 @@ along with GCC; see the file COPYING3. If not see
Usefulness :
----------
- This pass reduces the dynamic instruction count of a compression benchmark by
- 2.8% and improves its run-time by about 1%. The compression benchmark had the
- following code sequence in a very hot region of code before ZEE optimized it :
+ This pass reduces the dynamic instruction count of a compression benchmark
+ by 2.8% and improves its run time by about 1%. The compression benchmark
+ had the following code sequence in a very hot region of code before ZEE
+ optimized it :
shr $0x5, %edx
- mov %edx, %edx --> Useless zero-extend.
-
- How to turn on ?
- ----------------
- -fzee -O2. */
+ mov %edx, %edx --> Useless zero-extend */
#include "config.h"
@@ -193,6 +190,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "insn-attr.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "target.h"
#include "timevar.h"
@@ -240,31 +238,6 @@ set_insn_status (rtx insn, enum insn_merge_code code)
is_insn_merge_attempted[INSN_UID (insn)] = code;
}
-/* Check to see if this zero-extend matches a pattern
- that could be eliminated. This is called via
- for_each_rtx in function find_and_remove_ze. */
-
-static int
-is_set_with_extension_DI (rtx *expr, void *data)
-{
- /* Looking only for patterns of the type :
- SET (REG:DI X) (ZERO_EXTEND (REG:SI x))
- */
-
- if (GET_CODE (*expr) == SET
- && GET_MODE (SET_DEST (*expr)) == DImode
- && GET_CODE (SET_DEST (*expr)) == REG
- && GET_CODE (SET_SRC (*expr)) == ZERO_EXTEND
- && GET_CODE (XEXP (SET_SRC (*expr),0)) == REG
- && GET_MODE (XEXP (SET_SRC (*expr),0)) == SImode
- && REGNO (SET_DEST (*expr)) == REGNO (XEXP (SET_SRC (*expr),0)))
- {
- *(rtx **)(data) = expr;
- return 1;
- }
- return 0;
-}
-
/* Given a insn (CURR_INSN) and a pointer to the SET rtx (ORIG_SET)
that needs to be modified, this code modifies the SET rtx to a
new SET rtx that zero_extends the right hand expression into a DImode
@@ -737,7 +710,7 @@ combine_reaching_defs (rtx zero_extend_insn, rtx set_pat)
VEC_free (rtx, heap, defs_list);
VEC_free (rtx, heap, copies_list);
if (dump_file)
- fprintf (dump_file, "All definitions have been merged previously...\n");
+ fprintf (dump_file, "All definitions have been merged previously.\n");
return true;
}
@@ -812,8 +785,8 @@ combine_reaching_defs (rtx zero_extend_insn, rtx set_pat)
}
else
{
- /* Changes need not be cancelled explicitly as apply_change_group ()
- does it. Print list of definitions in the dump_file for debug
+ /* Changes need not be cancelled explicitly as apply_change_group
+ does it. Print list of definitions in the dump_file for debug
purposes. This zero-extension cannot be deleted. */
if (dump_file)
@@ -838,50 +811,74 @@ combine_reaching_defs (rtx zero_extend_insn, rtx set_pat)
return false;
}
-/* Goes through the instruction stream looking for zero-extends. If the zero
- extension instruction has atleast one def it adds it to a list of possible
- candidates for deletion. It returns the list of candidates. */
+/* Carry information about zero-extensions while walking the RTL. */
+
+struct zero_extend_info
+{
+ /* The insn where the zero-extension is. */
+ rtx insn;
+
+ /* The list of candidates. */
+ VEC (rtx, heap) *insn_list;
+};
+
+/* Add a zero-extend pattern that could be eliminated. This is called via
+ note_stores from find_removable_zero_extends. */
+
+static void
+add_removable_zero_extend (rtx x ATTRIBUTE_UNUSED, const_rtx expr, void *data)
+{
+ struct zero_extend_info *zei = (struct zero_extend_info *)data;
+ rtx src, dest;
+
+ /* We are looking for SET (REG:DI N) (ZERO_EXTEND (REG:SI N)). */
+ if (GET_CODE (expr) != SET)
+ return;
+
+ src = SET_SRC (expr);
+ dest = SET_DEST (expr);
+
+ if (REG_P (dest)
+ && GET_MODE (dest) == DImode
+ && GET_CODE (src) == ZERO_EXTEND
+ && REG_P (XEXP (src, 0))
+ && GET_MODE (XEXP (src, 0)) == SImode
+ && REGNO (dest) == REGNO (XEXP (src, 0)))
+ {
+ if (get_defs (zei->insn, XEXP (src, 0), NULL))
+ VEC_safe_push (rtx, heap, zei->insn_list, zei->insn);
+ else if (dump_file)
+ {
+ fprintf (dump_file, "Cannot eliminate zero-extension: \n");
+ print_rtl_single (dump_file, zei->insn);
+ fprintf (dump_file, "No defs. Could be extending parameters.\n");
+ }
+ }
+}
+
+/* Traverse the instruction stream looking for zero-extends and return the
+ list of candidates. */
static VEC (rtx,heap)*
find_removable_zero_extends (void)
{
- VEC (rtx, heap) *zeinsn_list;
- basic_block curr_block;
- rtx curr_insn;
- rtx *set_insn;
- rtx which_reg;
- int type ;
- int has_defs;
-
- zeinsn_list = VEC_alloc (rtx, heap, 8);
- FOR_EACH_BB (curr_block)
- {
- FOR_BB_INSNS (curr_block, curr_insn)
- {
- if (!NONDEBUG_INSN_P (curr_insn))
- continue;
+ struct zero_extend_info zei;
+ basic_block bb;
+ rtx insn;
- type = for_each_rtx (&PATTERN (curr_insn),
- is_set_with_extension_DI,
- (void *)&set_insn);
+ zei.insn_list = VEC_alloc (rtx, heap, 8);
- if (!type)
- continue;
+ FOR_EACH_BB (bb)
+ FOR_BB_INSNS (bb, insn)
+ {
+ if (!NONDEBUG_INSN_P (insn))
+ continue;
- which_reg = XEXP (SET_SRC (*set_insn), 0);
- has_defs = get_defs (curr_insn, which_reg, NULL);
- if (has_defs)
- VEC_safe_push (rtx, heap, zeinsn_list, curr_insn);
- else if (dump_file)
- {
- fprintf (dump_file, "Cannot eliminate zero extension : \n");
- print_rtl_single (dump_file, curr_insn);
- fprintf (dump_file,
- "This has no defs. Could be extending parameters.\n");
- }
- }
- }
- return zeinsn_list;
+ zei.insn = insn;
+ note_stores (PATTERN (insn), add_removable_zero_extend, &zei);
+ }
+
+ return zei.insn_list;
}
/* This is the main function that checks the insn stream for redundant
@@ -906,13 +903,12 @@ find_and_remove_ze (void)
max_insn_uid = get_max_uid ();
- is_insn_merge_attempted = XNEWVEC (enum insn_merge_code,
- sizeof (enum insn_merge_code)* max_insn_uid);
+ is_insn_merge_attempted
+ = XNEWVEC (enum insn_merge_code,
+ sizeof (enum insn_merge_code) * max_insn_uid);
for (i = 0; i < max_insn_uid; i++)
- {
- is_insn_merge_attempted[i] = MERGE_NOT_ATTEMPTED;
- }
+ is_insn_merge_attempted[i] = MERGE_NOT_ATTEMPTED;
num_ze_opportunities = num_realized = 0;
@@ -942,9 +938,7 @@ find_and_remove_ze (void)
/* Delete all useless zero extensions here in one sweep. */
for (ix = 0; VEC_iterate (rtx, zeinsn_del_list, ix, curr_insn); ix++)
- {
- delete_insn (curr_insn);
- }
+ delete_insn (curr_insn);
free (is_insn_merge_attempted);
VEC_free (rtx, heap, zeinsn_list);
diff --git a/gcc/integrate.c b/gcc/integrate.c
index b4c1362b3a1..dd75758c9aa 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "integrate.h"
#include "except.h"
#include "function.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "intl.h"
#include "params.h"
@@ -111,7 +112,7 @@ set_block_origin_self (tree stmt)
for (local_decl = BLOCK_VARS (stmt);
local_decl != NULL_TREE;
- local_decl = TREE_CHAIN (local_decl))
+ local_decl = DECL_CHAIN (local_decl))
set_decl_origin_self (local_decl); /* Potential recursion. */
}
@@ -147,7 +148,7 @@ set_decl_origin_self (tree decl)
{
tree arg;
- for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg))
DECL_ABSTRACT_ORIGIN (arg) = arg;
if (DECL_INITIAL (decl) != NULL_TREE
&& DECL_INITIAL (decl) != error_mark_node)
@@ -172,7 +173,7 @@ set_block_abstract_flags (tree stmt, int setting)
for (local_decl = BLOCK_VARS (stmt);
local_decl != NULL_TREE;
- local_decl = TREE_CHAIN (local_decl))
+ local_decl = DECL_CHAIN (local_decl))
set_decl_abstract_flags (local_decl, setting);
for (i = 0; i < BLOCK_NUM_NONLOCALIZED_VARS (stmt); i++)
@@ -203,7 +204,7 @@ set_decl_abstract_flags (tree decl, int setting)
{
tree arg;
- for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg))
DECL_ABSTRACT (arg) = setting;
if (DECL_INITIAL (decl) != NULL_TREE
&& DECL_INITIAL (decl) != error_mark_node)
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 8f9937320a1..6918273cba6 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -951,7 +951,8 @@ ipcp_estimate_growth (struct cgraph_node *node)
struct cgraph_edge *cs;
int redirectable_node_callers = 0;
int removable_args = 0;
- bool need_original = !cgraph_only_called_directly_p (node);
+ bool need_original
+ = !cgraph_will_be_removed_from_program_if_no_direct_calls (node);
struct ipa_node_params *info;
int i, count;
int growth;
@@ -1134,7 +1135,7 @@ ipcp_insert_stage (void)
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
if (cs->caller == node || ipcp_need_redirect_p (cs))
break;
- if (!cs && cgraph_only_called_directly_p (node))
+ if (!cs && cgraph_will_be_removed_from_program_if_no_direct_calls (node))
bitmap_set_bit (dead_nodes, node->uid);
info = IPA_NODE_REF (node);
@@ -1277,7 +1278,9 @@ ipcp_read_summary (void)
static bool
cgraph_gate_cp (void)
{
- return flag_ipa_cp;
+ /* FIXME: We should remove the optimize check after we ensure we never run
+ IPA passes when not optimizng. */
+ return flag_ipa_cp && optimize;
}
struct ipa_opt_pass_d pass_ipa_cp =
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f9e4cf3cfa7..b5063bf8c22 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -334,7 +334,9 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
overall_size += new_size - old_size;
ncalls_inlined++;
- if (flag_indirect_inlining)
+ /* FIXME: We should remove the optimize check after we ensure we never run
+ IPA passes when not optimizng. */
+ if (flag_indirect_inlining && optimize)
return ipa_propagate_indirect_call_infos (curr, new_edges);
else
return false;
@@ -389,7 +391,7 @@ cgraph_estimate_growth (struct cgraph_node *node)
we decide to not inline for different reasons, but it is not big deal
as in that case we will keep the body around, but we will also avoid
some inlining. */
- if (cgraph_only_called_directly_p (node)
+ if (cgraph_will_be_removed_from_program_if_no_direct_calls (node)
&& !DECL_EXTERNAL (node->decl) && !self_recursive)
growth -= node->global.size;
@@ -661,6 +663,30 @@ cgraph_edge_badness (struct cgraph_edge *edge, bool dump)
return badness;
}
+/* Recompute badness of EDGE and update its key in HEAP if needed. */
+static void
+update_edge_key (fibheap_t heap, struct cgraph_edge *edge)
+{
+ int badness = cgraph_edge_badness (edge, false);
+ if (edge->aux)
+ {
+ fibnode_t n = (fibnode_t) edge->aux;
+ gcc_checking_assert (n->data == edge);
+
+ /* fibheap_replace_key only decrease the keys.
+ When we increase the key we do not update heap
+ and instead re-insert the element once it becomes
+ a minium of heap. */
+ if (badness < n->key)
+ {
+ fibheap_replace_key (heap, n, badness);
+ gcc_checking_assert (n->key == badness);
+ }
+ }
+ else
+ edge->aux = fibheap_insert (heap, badness, edge);
+}
+
/* Recompute heap nodes for each of caller edge. */
static void
@@ -678,8 +704,6 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node,
bitmap_set_bit (updated_nodes, node->uid);
node->global.estimated_growth = INT_MIN;
- if (!node->local.inlinable)
- return;
/* See if there is something to do. */
for (edge = node->callers; edge; edge = edge->next_caller)
if (edge->inline_failed)
@@ -702,28 +726,53 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node,
for (; edge; edge = edge->next_caller)
if (edge->inline_failed)
+ update_edge_key (heap, edge);
+}
+
+/* Recompute heap nodes for each uninlined call.
+ This is used when we know that edge badnesses are going only to increase
+ (we introduced new call site) and thus all we need is to insert newly
+ created edges into heap. */
+
+static void
+update_callee_keys (fibheap_t heap, struct cgraph_node *node,
+ bitmap updated_nodes)
+{
+ struct cgraph_edge *e = node->callees;
+ node->global.estimated_growth = INT_MIN;
+
+ if (!e)
+ return;
+ while (true)
+ if (!e->inline_failed && e->callee->callees)
+ e = e->callee->callees;
+ else
{
- int badness = cgraph_edge_badness (edge, false);
- if (edge->aux)
+ if (e->inline_failed
+ && e->callee->local.inlinable
+ && !bitmap_bit_p (updated_nodes, e->callee->uid))
{
- fibnode_t n = (fibnode_t) edge->aux;
- gcc_assert (n->data == edge);
- if (n->key == badness)
- continue;
-
- /* fibheap_replace_key only decrease the keys.
- When we increase the key we do not update heap
- and instead re-insert the element once it becomes
- a minium of heap. */
- if (badness < n->key)
+ node->global.estimated_growth = INT_MIN;
+ /* If function becomes uninlinable, we need to remove it from the heap. */
+ if (!cgraph_default_inline_p (e->callee, &e->inline_failed))
+ update_caller_keys (heap, e->callee, updated_nodes);
+ else
+ /* Otherwise update just edge E. */
+ update_edge_key (heap, e);
+ }
+ if (e->next_callee)
+ e = e->next_callee;
+ else
+ {
+ do
{
- fibheap_replace_key (heap, n, badness);
- gcc_assert (n->key == badness);
- continue;
+ if (e->caller == node)
+ return;
+ e = e->caller->callers;
}
+ while (!e->next_callee);
+ e = e->next_callee;
}
- else
- edge->aux = fibheap_insert (heap, badness, edge);
}
}
@@ -731,8 +780,8 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node,
Walk recursively into all inline clones. */
static void
-update_callee_keys (fibheap_t heap, struct cgraph_node *node,
- bitmap updated_nodes)
+update_all_callee_keys (fibheap_t heap, struct cgraph_node *node,
+ bitmap updated_nodes)
{
struct cgraph_edge *e = node->callees;
node->global.estimated_growth = INT_MIN;
@@ -1166,7 +1215,7 @@ cgraph_decide_inlining_of_small_functions (void)
continue;
if (flag_indirect_inlining)
add_new_edges_to_heap (heap, new_indirect_edges);
- update_callee_keys (heap, where, updated_nodes);
+ update_all_callee_keys (heap, where, updated_nodes);
}
else
{
@@ -1182,11 +1231,18 @@ cgraph_decide_inlining_of_small_functions (void)
continue;
}
callee = edge->callee;
+ gcc_checking_assert (!callee->global.inlined_to);
cgraph_mark_inline_edge (edge, true, &new_indirect_edges);
if (flag_indirect_inlining)
add_new_edges_to_heap (heap, new_indirect_edges);
- update_callee_keys (heap, callee, updated_nodes);
+ /* We inlined last offline copy to the body. This might lead
+ to callees of function having fewer call sites and thus they
+ may need updating. */
+ if (callee->global.inlined_to)
+ update_all_callee_keys (heap, callee, updated_nodes);
+ else
+ update_callee_keys (heap, edge->callee, updated_nodes);
}
where = edge->caller;
if (where->global.inlined_to)
@@ -1442,14 +1498,13 @@ cgraph_decide_inlining (void)
if (node->callers
&& !node->callers->next_caller
- && cgraph_only_called_directly_p (node)
+ && cgraph_will_be_removed_from_program_if_no_direct_calls (node)
&& node->local.inlinable
&& node->callers->inline_failed
&& node->callers->caller != node
&& node->callers->caller->global.inlined_to != node
&& !node->callers->call_stmt_cannot_inline_p
- && !DECL_EXTERNAL (node->decl)
- && !DECL_COMDAT (node->decl))
+ && !DECL_EXTERNAL (node->decl))
{
cgraph_inline_failed_t reason;
old_size = overall_size;
@@ -1832,10 +1887,12 @@ likely_eliminated_by_inlining_p (gimple stmt)
bool rhs_free = false;
bool lhs_free = false;
- while (handled_component_p (inner_lhs) || TREE_CODE (inner_lhs) == INDIRECT_REF)
+ while (handled_component_p (inner_lhs)
+ || TREE_CODE (inner_lhs) == MEM_REF)
inner_lhs = TREE_OPERAND (inner_lhs, 0);
while (handled_component_p (inner_rhs)
- || TREE_CODE (inner_rhs) == ADDR_EXPR || TREE_CODE (inner_rhs) == INDIRECT_REF)
+ || TREE_CODE (inner_rhs) == ADDR_EXPR
+ || TREE_CODE (inner_rhs) == MEM_REF)
inner_rhs = TREE_OPERAND (inner_rhs, 0);
@@ -1855,7 +1912,8 @@ likely_eliminated_by_inlining_p (gimple stmt)
|| (TREE_CODE (inner_lhs) == SSA_NAME
&& TREE_CODE (SSA_NAME_VAR (inner_lhs)) == RESULT_DECL))
lhs_free = true;
- if (lhs_free && (is_gimple_reg (rhs) || is_gimple_min_invariant (rhs)))
+ if (lhs_free
+ && (is_gimple_reg (rhs) || is_gimple_min_invariant (rhs)))
rhs_free = true;
if (lhs_free && rhs_free)
return true;
@@ -1931,7 +1989,7 @@ estimate_function_body_sizes (struct cgraph_node *node)
time_inlining_benefit += cost;
size_inlining_benefit += cost;
}
- for (arg = DECL_ARGUMENTS (node->decl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (node->decl); arg; arg = DECL_CHAIN (arg))
if (!VOID_TYPE_P (TREE_TYPE (arg)))
{
int cost = estimate_move_cost (TREE_TYPE (arg));
@@ -1962,7 +2020,7 @@ compute_inline_parameters (struct cgraph_node *node)
/* Estimate the stack size for the function. But not at -O0
because estimated_stack_frame_size is a quadratic problem. */
- self_stack_size = optimize ? estimated_stack_frame_size () : 0;
+ self_stack_size = optimize ? estimated_stack_frame_size (node->decl) : 0;
inline_summary (node)->estimated_self_stack_size = self_stack_size;
node->global.estimated_stack_size = self_stack_size;
node->global.stack_frame_offset = 0;
@@ -2029,7 +2087,9 @@ analyze_function (struct cgraph_node *node)
current_function_decl = node->decl;
compute_inline_parameters (node);
- if (flag_indirect_inlining)
+ /* FIXME: We should remove the optimize check after we ensure we never run
+ IPA passes when not optimizng. */
+ if (flag_indirect_inlining && optimize)
inline_indirect_intraprocedural_analysis (node);
current_function_decl = NULL;
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 997f8ec9612..77e84c11f7a 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -154,7 +154,7 @@ ipa_populate_param_decls (struct cgraph_node *node,
fndecl = node->decl;
fnargs = DECL_ARGUMENTS (fndecl);
param_num = 0;
- for (parm = fnargs; parm; parm = TREE_CHAIN (parm))
+ for (parm = fnargs; parm; parm = DECL_CHAIN (parm))
{
info->params[param_num].decl = parm;
param_num++;
@@ -169,7 +169,7 @@ count_formal_params_1 (tree fndecl)
tree parm;
int count = 0;
- for (parm = DECL_ARGUMENTS (fndecl); parm; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
count++;
return count;
@@ -405,11 +405,12 @@ compute_complex_assign_jump_func (struct ipa_node_params *info,
if (TREE_CODE (type) != RECORD_TYPE)
return;
op1 = get_ref_base_and_extent (op1, &offset, &size, &max_size);
- if (TREE_CODE (op1) != INDIRECT_REF
+ if (TREE_CODE (op1) != MEM_REF
/* If this is a varying address, punt. */
|| max_size == -1
|| max_size != size)
return;
+ offset += mem_ref_offset (op1).low * BITS_PER_UNIT;
op1 = TREE_OPERAND (op1, 0);
if (TREE_CODE (op1) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (op1))
@@ -481,11 +482,12 @@ compute_complex_ancestor_jump_func (struct ipa_node_params *info,
expr = TREE_OPERAND (expr, 0);
expr = get_ref_base_and_extent (expr, &offset, &size, &max_size);
- if (TREE_CODE (expr) != INDIRECT_REF
+ if (TREE_CODE (expr) != MEM_REF
/* If this is a varying address, punt. */
|| max_size == -1
|| max_size != size)
return;
+ offset += mem_ref_offset (expr).low * BITS_PER_UNIT;
parm = TREE_OPERAND (expr, 0);
if (TREE_CODE (parm) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (parm))
@@ -614,13 +616,13 @@ type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
if (method_ptr)
*method_ptr = fld;
- fld = TREE_CHAIN (fld);
+ fld = DECL_CHAIN (fld);
if (!fld || INTEGRAL_TYPE_P (fld))
return false;
if (delta)
*delta = fld;
- if (TREE_CHAIN (fld))
+ if (DECL_CHAIN (fld))
return false;
return true;
@@ -1179,7 +1181,7 @@ ipa_analyze_virtual_call_uses (struct cgraph_node *node,
obj = TREE_OPERAND (obj, 0);
}
while (TREE_CODE (obj) == COMPONENT_REF);
- if (TREE_CODE (obj) != INDIRECT_REF)
+ if (TREE_CODE (obj) != MEM_REF)
return;
obj = TREE_OPERAND (obj, 0);
}
@@ -1930,7 +1932,7 @@ ipa_get_vector_of_formal_parms (tree fndecl)
count = count_formal_params_1 (fndecl);
args = VEC_alloc (tree, heap, count);
- for (parm = DECL_ARGUMENTS (fndecl); parm; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
VEC_quick_push (tree, args, parm);
return args;
@@ -2015,7 +2017,7 @@ ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec adjustments,
adj->base_index),
new_arg_types);
*link = parm;
- link = &TREE_CHAIN (parm);
+ link = &DECL_CHAIN (parm);
}
else if (!adj->remove_param)
{
@@ -2048,7 +2050,7 @@ ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec adjustments,
*link = new_parm;
- link = &TREE_CHAIN (new_parm);
+ link = &DECL_CHAIN (new_parm);
}
}
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index c73367a4945..2a28aa3ce38 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -170,9 +170,8 @@ struct ipa_param_descriptor
parameters (such as ipa-cp). */
struct ipa_node_params
{
- /* Number of formal parameters of this function. When set to 0,
- this function's parameters would not be analyzed by the different
- stages of IPA CP. */
+ /* Number of formal parameters of this function. When set to 0, this
+ function's parameters would not be analyzed by IPA CP. */
int param_count;
/* Whether this function is called with variable number of actual
arguments. */
@@ -251,9 +250,8 @@ ipa_is_called_with_var_arguments (struct ipa_node_params *info)
-/* ipa_edge_args stores information related to a callsite and particularly
- its arguments. It is pointed to by a field in the
- callsite's corresponding cgraph_edge. */
+/* ipa_edge_args stores information related to a callsite and particularly its
+ arguments. It can be accessed by the IPA_EDGE_REF macro. */
typedef struct GTY(()) ipa_edge_args
{
/* Number of actual arguments in this callsite. When set to 0,
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index c0809517896..5db496aa0c4 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -95,6 +95,11 @@ struct funct_state_d
bool can_throw;
};
+/* State used when we know nothing about function. */
+static struct funct_state_d varying_state
+ = { IPA_NEITHER, IPA_NEITHER, true, true, true };
+
+
typedef struct funct_state_d * funct_state;
/* The storage of the funct_state is abstracted because there is the
@@ -212,13 +217,12 @@ has_function_state (struct cgraph_node *node)
static inline funct_state
get_function_state (struct cgraph_node *node)
{
- static struct funct_state_d varying
- = { IPA_NEITHER, IPA_NEITHER, true, true, true };
if (!funct_state_vec
- || VEC_length (funct_state, funct_state_vec) <= (unsigned int)node->uid)
+ || VEC_length (funct_state, funct_state_vec) <= (unsigned int)node->uid
+ || !VEC_index (funct_state, funct_state_vec, node->uid))
/* We might want to put correct previously_known state into varying. */
- return &varying;
- return VEC_index (funct_state, funct_state_vec, node->uid);
+ return &varying_state;
+ return VEC_index (funct_state, funct_state_vec, node->uid);
}
/* Set the function state S for NODE. */
@@ -324,7 +328,7 @@ check_op (funct_state local, tree t, bool checking_write)
return;
}
else if (t
- && INDIRECT_REF_P (t)
+ && (INDIRECT_REF_P (t) || TREE_CODE (t) == MEM_REF)
&& TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME
&& !ptr_deref_may_alias_global_p (TREE_OPERAND (t, 0)))
{
@@ -442,7 +446,6 @@ special_builtlin_state (enum pure_const_state_e *state, bool *looping,
case BUILT_IN_FRAME_ADDRESS:
case BUILT_IN_APPLY:
case BUILT_IN_APPLY_ARGS:
- case BUILT_IN_ARGS_INFO:
*looping = false;
*state = IPA_CONST;
return true;
@@ -870,7 +873,9 @@ remove_node_data (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
{
if (has_function_state (node))
{
- free (get_function_state (node));
+ funct_state l = get_function_state (node);
+ if (l != &varying_state)
+ free (l);
set_function_state (node, NULL);
}
}
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 289a7b38beb..4bd3f05deb8 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -159,6 +159,91 @@ dump_split_point (FILE * file, struct split_point *current)
dump_bitmap (file, current->ssa_names_to_pass);
}
+/* Look for all BBs in header that might lead to split part and verify that
+ they are not defining any of SSA vars used by split part.
+ Parameters are the same as for consider_split. */
+
+static bool
+verify_non_ssa_vars (struct split_point *current, bitmap non_ssa_vars,
+ basic_block return_bb)
+{
+ bitmap seen = BITMAP_ALLOC (NULL);
+ VEC (basic_block,heap) *worklist = NULL;
+ edge e;
+ edge_iterator ei;
+ bool ok = true;
+
+ FOR_EACH_EDGE (e, ei, current->entry_bb->preds)
+ if (e->src != ENTRY_BLOCK_PTR
+ && !bitmap_bit_p (current->split_bbs, e->src->index))
+ {
+ VEC_safe_push (basic_block, heap, worklist, e->src);
+ bitmap_set_bit (seen, e->src->index);
+ }
+
+ while (!VEC_empty (basic_block, worklist))
+ {
+ gimple_stmt_iterator bsi;
+ basic_block bb = VEC_pop (basic_block, worklist);
+
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ if (e->src != ENTRY_BLOCK_PTR
+ && !bitmap_bit_p (seen, e->src->index))
+ {
+ gcc_checking_assert (!bitmap_bit_p (current->split_bbs,
+ e->src->index));
+ VEC_safe_push (basic_block, heap, worklist, e->src);
+ bitmap_set_bit (seen, e->src->index);
+ }
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ if (is_gimple_debug (gsi_stmt (bsi)))
+ continue;
+ if (walk_stmt_load_store_addr_ops
+ (gsi_stmt (bsi), non_ssa_vars, test_nonssa_use,
+ test_nonssa_use, test_nonssa_use))
+ {
+ ok = false;
+ goto done;
+ }
+ }
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ if (walk_stmt_load_store_addr_ops
+ (gsi_stmt (bsi), non_ssa_vars, test_nonssa_use,
+ test_nonssa_use, test_nonssa_use))
+ {
+ ok = false;
+ goto done;
+ }
+ }
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (e->dest != return_bb)
+ continue;
+ for (bsi = gsi_start_phis (return_bb); !gsi_end_p (bsi);
+ gsi_next (&bsi))
+ {
+ gimple stmt = gsi_stmt (bsi);
+ tree op = gimple_phi_arg_def (stmt, e->dest_idx);
+
+ if (!is_gimple_reg (gimple_phi_result (stmt)))
+ continue;
+ if (TREE_CODE (op) != SSA_NAME
+ && test_nonssa_use (stmt, op, non_ssa_vars))
+ {
+ ok = false;
+ goto done;
+ }
+ }
+ }
+ }
+done:
+ BITMAP_FREE (seen);
+ VEC_free (basic_block, heap, worklist);
+ return ok;
+}
+
/* We found an split_point CURRENT. NON_SSA_VARS is bitmap of all non ssa
variables used and RETURN_BB is return basic block.
See if we can split function here. */
@@ -234,7 +319,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
call overhead. */
call_overhead = eni_size_weights.call_cost;
for (parm = DECL_ARGUMENTS (current_function_decl); parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
{
if (!is_gimple_reg (parm))
{
@@ -292,63 +377,12 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
/* When there are non-ssa vars used in the split region, see if they
are used in the header region. If so, reject the split.
FIXME: we can use nested function support to access both. */
- if (!bitmap_empty_p (non_ssa_vars))
+ if (!bitmap_empty_p (non_ssa_vars)
+ && !verify_non_ssa_vars (current, non_ssa_vars, return_bb))
{
- basic_block bb;
- FOR_EACH_BB (bb)
- {
- gimple_stmt_iterator bsi;
- if (!bitmap_bit_p (current->split_bbs, bb->index))
- continue;
- for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
- {
- if (is_gimple_debug (gsi_stmt (bsi)))
- continue;
- if (walk_stmt_load_store_addr_ops
- (gsi_stmt (bsi), non_ssa_vars, test_nonssa_use,
- test_nonssa_use, test_nonssa_use))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- " Refused: split part has non-ssa uses\n");
- return;
- }
- }
- for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
- {
- if (walk_stmt_load_store_addr_ops
- (gsi_stmt (bsi), non_ssa_vars, test_nonssa_use,
- test_nonssa_use, test_nonssa_use))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- " Refused: split part has non-ssa uses\n");
- return;
- }
- }
- FOR_EACH_EDGE (e, ei, bb->succs)
- {
- if (e->dest != return_bb)
- continue;
- for (bsi = gsi_start_phis (return_bb); !gsi_end_p (bsi);
- gsi_next (&bsi))
- {
- gimple stmt = gsi_stmt (bsi);
- tree op = gimple_phi_arg_def (stmt, e->dest_idx);
-
- if (!is_gimple_reg (gimple_phi_result (stmt)))
- continue;
- if (TREE_CODE (op) != SSA_NAME
- && test_nonssa_use (stmt, op, non_ssa_vars))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- " Refused: split part has non-ssa uses\n");
- return;
- }
- }
- }
- }
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ " Refused: split part has non-ssa uses\n");
return;
}
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -379,10 +413,20 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
}
}
-/* Return basic block containing RETURN statement, or EXIT_BLOCK_PTR if none
- found.
+/* Return basic block containing RETURN statement. We allow basic blocks
+ of the form:
+ <retval> = tmp_var;
+ return <retval>
+ but return_bb can not be more complex than this.
+ If nothing is found, return EXIT_BLOCK_PTR.
+
When there are multiple RETURN statement, chose one with return value,
since that one is more likely shared by multiple code paths.
+
+ Return BB is special, because for function splitting it is the only
+ basic block that is duplicated in between header and split part of the
+ function.
+
TODO: We might support multiple return blocks. */
static basic_block
@@ -399,16 +443,29 @@ find_return_bb (void)
bool found_return = false;
tree retval = NULL_TREE;
- for (bsi = gsi_start_bb (e->src); !gsi_end_p (bsi); gsi_next (&bsi))
- if (gimple_code (gsi_stmt (bsi)) != GIMPLE_RETURN
- && gimple_code (gsi_stmt (bsi)) != GIMPLE_LABEL
- && !is_gimple_debug (gsi_stmt (bsi)))
- break;
- else if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN)
- {
- found_return = true;
- retval = gimple_return_retval (gsi_stmt (bsi));
- }
+ for (bsi = gsi_last_bb (e->src); !gsi_end_p (bsi); gsi_prev (&bsi))
+ {
+ gimple stmt = gsi_stmt (bsi);
+ if (gimple_code (stmt) == GIMPLE_LABEL
+ || is_gimple_debug (stmt))
+ ;
+ else if (gimple_code (stmt) == GIMPLE_ASSIGN
+ && found_return
+ && gimple_assign_single_p (stmt)
+ && (auto_var_in_fn_p (gimple_assign_rhs1 (stmt),
+ current_function_decl)
+ || is_gimple_min_invariant
+ (gimple_assign_rhs1 (stmt)))
+ && retval == gimple_assign_lhs (stmt))
+ ;
+ else if (gimple_code (stmt) == GIMPLE_RETURN)
+ {
+ found_return = true;
+ retval = gimple_return_retval (stmt);
+ }
+ else
+ break;
+ }
if (gsi_end_p (bsi) && found_return)
{
if (retval)
@@ -420,6 +477,20 @@ find_return_bb (void)
return return_bb;
}
+/* Given return basicblock RETURN_BB, see where return value is really
+ stored. */
+static tree
+find_retval (basic_block return_bb)
+{
+ gimple_stmt_iterator bsi;
+ for (bsi = gsi_start_bb (return_bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN)
+ return gimple_return_retval (gsi_stmt (bsi));
+ else if (gimple_code (gsi_stmt (bsi)) == GIMPLE_ASSIGN)
+ return gimple_assign_rhs1 (gsi_stmt (bsi));
+ return NULL;
+}
+
/* Callback for walk_stmt_load_store_addr_ops. If T is non-ssa automatic
variable, mark it as used in bitmap passed via DATA.
Return true when access to T prevents splitting the function. */
@@ -818,7 +889,7 @@ split_function (struct split_point *split_point)
/* Collect the parameters of new function and args_to_skip bitmap. */
for (parm = DECL_ARGUMENTS (current_function_decl);
- parm; parm = TREE_CHAIN (parm), num++)
+ parm; parm = DECL_CHAIN (parm), num++)
if (!is_gimple_reg (parm)
|| !gimple_default_def (cfun, parm)
|| !bitmap_bit_p (split_point->ssa_names_to_pass,
@@ -844,7 +915,7 @@ split_function (struct split_point *split_point)
NULL, NULL,
args_to_skip,
split_point->split_bbs,
- split_point->entry_bb, "_part");
+ split_point->entry_bb, "part");
/* For usual cloning it is enough to clear builtin only when signature
changes. For partial inlining we however can not expect the part
of builtin implementation to have same semantic as the whole. */
@@ -878,6 +949,13 @@ split_function (struct split_point *split_point)
call = gimple_build_call_vec (node->decl, args_to_pass);
gimple_set_block (call, DECL_INITIAL (current_function_decl));
+ /* We avoid address being taken on any variable used by split part,
+ so return slot optimization is always possible. Moreover this is
+ required to make DECL_BY_REFERENCE work. */
+ if (aggregate_value_p (DECL_RESULT (current_function_decl),
+ TREE_TYPE (current_function_decl)))
+ gimple_call_set_return_slot_opt (call, true);
+
/* Update return value. This is bit tricky. When we do not return,
do nothing. When we return we might need to update return_bb
or produce a new return statement. */
@@ -889,42 +967,74 @@ split_function (struct split_point *split_point)
return_bb == EXIT_BLOCK_PTR ? 0 : EDGE_FALLTHRU);
e->count = call_bb->count;
e->probability = REG_BR_PROB_BASE;
+
+ /* If there is return basic block, see what value we need to store
+ return value into and put call just before it. */
if (return_bb != EXIT_BLOCK_PTR)
{
- gimple return_stmt = gsi_stmt (gsi_last_bb (return_bb));
- gcc_assert (gimple_code (return_stmt) == GIMPLE_RETURN);
+ real_retval = retval = find_retval (return_bb);
- if ((real_retval = retval = gimple_return_retval (return_stmt))
+ /* See if return value is computed by split part;
+ function might just return its argument, invariant or undefined
+ value. In this case we don't need to do any updating. */
+ if (real_retval
&& !is_gimple_min_invariant (retval)
&& (TREE_CODE (retval) != SSA_NAME
- || !SSA_NAME_IS_DEFAULT_DEF (retval)))
+ || (!SSA_NAME_IS_DEFAULT_DEF (retval)
+ || DECL_BY_REFERENCE
+ (DECL_RESULT (current_function_decl)))))
{
gimple_stmt_iterator psi;
- /* See if there is PHI definind return value. */
- for (psi = gsi_start_phis (return_bb);
- !gsi_end_p (psi); gsi_next (&psi))
- if (is_gimple_reg (gimple_phi_result (gsi_stmt (psi))))
- break;
-
- /* When we have PHI, update PHI. When there is no PHI,
- update the return statement itself. */
- if (TREE_CODE (retval) == SSA_NAME)
+ /* See if we need new SSA_NAME for the result.
+ When DECL_BY_REFERENCE is true, retval is actually pointer to
+ return value and it is constant in whole function. */
+ if (TREE_CODE (retval) == SSA_NAME
+ && !DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
{
retval = make_ssa_name (SSA_NAME_VAR (retval), call);
+
+ /* See if there is PHI defining return value. */
+ for (psi = gsi_start_phis (return_bb);
+ !gsi_end_p (psi); gsi_next (&psi))
+ if (is_gimple_reg (gimple_phi_result (gsi_stmt (psi))))
+ break;
+
+ /* When there is PHI, just update its value. */
if (TREE_CODE (retval) == SSA_NAME
&& !gsi_end_p (psi))
add_phi_arg (gsi_stmt (psi), retval, e, UNKNOWN_LOCATION);
- else if (TREE_CODE (retval) == SSA_NAME)
+ /* Otherwise update the return BB itself.
+ find_return_bb allows at most one assignment to return value,
+ so update first statement. */
+ else
{
- gimple_return_set_retval (return_stmt, retval);
- update_stmt (return_stmt);
+ gimple_stmt_iterator bsi;
+ for (bsi = gsi_start_bb (return_bb); !gsi_end_p (bsi);
+ gsi_next (&bsi))
+ if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN)
+ {
+ gimple_return_set_retval (gsi_stmt (bsi), retval);
+ break;
+ }
+ else if (gimple_code (gsi_stmt (bsi)) == GIMPLE_ASSIGN)
+ {
+ gimple_assign_set_rhs1 (gsi_stmt (bsi), retval);
+ break;
+ }
+ update_stmt (gsi_stmt (bsi));
}
}
- gimple_call_set_lhs (call, retval);
+ if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
+ gimple_call_set_lhs (call, build_simple_mem_ref (retval));
+ else
+ gimple_call_set_lhs (call, retval);
}
gsi_insert_after (&gsi, call, GSI_NEW_STMT);
}
+ /* We don't use return block (there is either no return in function or
+ multiple of them). So create new basic block with return statement.
+ */
else
{
gimple ret;
@@ -939,8 +1049,32 @@ split_function (struct split_point *split_point)
&& !DECL_BY_REFERENCE (retval))
retval = create_tmp_reg (TREE_TYPE (retval), NULL);
if (is_gimple_reg (retval))
- retval = make_ssa_name (retval, call);
- gimple_call_set_lhs (call, retval);
+ {
+ /* When returning by reference, there is only one SSA name
+ assigned to RESULT_DECL (that is pointer to return value).
+ Look it up or create new one if it is missing. */
+ if (DECL_BY_REFERENCE (retval))
+ {
+ tree retval_name;
+ if ((retval_name = gimple_default_def (cfun, retval))
+ != NULL)
+ retval = retval_name;
+ else
+ {
+ retval_name = make_ssa_name (retval,
+ gimple_build_nop ());
+ set_default_def (retval, retval_name);
+ retval = retval_name;
+ }
+ }
+ /* Otherwise produce new SSA name for return value. */
+ else
+ retval = make_ssa_name (retval, call);
+ }
+ if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
+ gimple_call_set_lhs (call, build_simple_mem_ref (retval));
+ else
+ gimple_call_set_lhs (call, retval);
}
gsi_insert_after (&gsi, call, GSI_NEW_STMT);
ret = gimple_build_return (retval);
@@ -1004,13 +1138,6 @@ execute_split_functions (void)
fprintf (dump_file, "Not splitting: nested function.\n");
return 0;
}
- /* FIXME: Should be easy to support. */
- if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
- {
- if (dump_file)
- fprintf (dump_file, "Not splitting: returns value by reference.\n");
- return 0;
- }
/* See if it makes sense to try to split.
It makes sense to split if we inline, that is if we have direct calls to
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index 6ace2fcd0d7..6f62b703c5e 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -421,6 +421,10 @@ decompose_indirect_ref_acc (tree str_decl, struct field_access_site *acc)
if (!is_result_of_mult (before_cast, &acc->num, struct_size))
return false;
+ /* ??? Add TREE_OPERAND (acc->ref, 1) to acc->offset. */
+ if (!integer_zerop (TREE_OPERAND (acc->ref, 1)))
+ return false;
+
return true;
}
@@ -434,7 +438,7 @@ decompose_access (tree str_decl, struct field_access_site *acc)
{
gcc_assert (acc->ref);
- if (TREE_CODE (acc->ref) == INDIRECT_REF)
+ if (TREE_CODE (acc->ref) == MEM_REF)
return decompose_indirect_ref_acc (str_decl, acc);
else if (TREE_CODE (acc->ref) == ARRAY_REF)
return true;
@@ -969,12 +973,12 @@ replace_field_acc (struct field_access_site *acc, tree new_type)
type_wrapper_t *wr_p = NULL;
struct ref_pos r_pos;
- while (TREE_CODE (ref_var) == INDIRECT_REF
+ while (TREE_CODE (ref_var) == MEM_REF
|| TREE_CODE (ref_var) == ARRAY_REF)
{
type_wrapper_t wr;
- if ( TREE_CODE (ref_var) == INDIRECT_REF)
+ if (TREE_CODE (ref_var) == MEM_REF)
{
wr.wrap = 0;
wr.domain = 0;
@@ -1001,7 +1005,7 @@ replace_field_acc (struct field_access_site *acc, tree new_type)
new_ref = build4 (ARRAY_REF, type, new_ref,
wr_p->domain, NULL_TREE, NULL_TREE);
else /* Pointer. */
- new_ref = build1 (INDIRECT_REF, type, new_ref);
+ new_ref = build_simple_mem_ref (new_ref);
VEC_pop (type_wrapper_t, wrapper);
}
@@ -1041,7 +1045,7 @@ static void
replace_field_access_stmt (struct field_access_site *acc, tree new_type)
{
- if (TREE_CODE (acc->ref) == INDIRECT_REF
+ if (TREE_CODE (acc->ref) == MEM_REF
||TREE_CODE (acc->ref) == ARRAY_REF
||TREE_CODE (acc->ref) == VAR_DECL)
replace_field_acc (acc, new_type);
@@ -1277,13 +1281,11 @@ insert_new_var_in_stmt (gimple stmt, tree var, tree new_var)
pos = find_pos_in_stmt (stmt, var, &r_pos);
gcc_assert (pos);
- while (r_pos.container && (TREE_CODE(r_pos.container) == INDIRECT_REF
+ while (r_pos.container && (TREE_CODE(r_pos.container) == MEM_REF
|| TREE_CODE(r_pos.container) == ADDR_EXPR))
{
- tree type = TREE_TYPE (TREE_TYPE (new_var));
-
- if (TREE_CODE(r_pos.container) == INDIRECT_REF)
- new_var = build1 (INDIRECT_REF, type, new_var);
+ if (TREE_CODE(r_pos.container) == MEM_REF)
+ new_var = build_simple_mem_ref (new_var);
else
new_var = build_fold_addr_expr (new_var);
pos = find_pos_in_stmt (stmt, r_pos.container, &r_pos);
@@ -2530,7 +2532,7 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
tree field_decl = TREE_OPERAND (t, 1);
- if ((TREE_CODE (ref) == INDIRECT_REF
+ if ((TREE_CODE (ref) == MEM_REF
|| TREE_CODE (ref) == ARRAY_REF
|| TREE_CODE (ref) == VAR_DECL)
&& TREE_CODE (field_decl) == FIELD_DECL)
@@ -2923,7 +2925,7 @@ exclude_types_passed_to_local_func (VEC (tree, heap) **unsuitable_types)
tree fn = c_node->decl;
tree arg;
- for (arg = DECL_ARGUMENTS (fn); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg))
{
tree type = TREE_TYPE (arg);
@@ -3416,7 +3418,6 @@ static void
build_data_structure (VEC (tree, heap) **unsuitable_types)
{
tree var, type;
- tree var_list;
struct varpool_node *current_varpool;
struct cgraph_node *c_node;
@@ -3439,6 +3440,7 @@ build_data_structure (VEC (tree, heap) **unsuitable_types)
if (avail == AVAIL_LOCAL || avail == AVAIL_AVAILABLE)
{
struct function *fn = DECL_STRUCT_FUNCTION (c_node->decl);
+ unsigned ix;
for (var = DECL_ARGUMENTS (c_node->decl); var;
var = TREE_CHAIN (var))
@@ -3454,14 +3456,9 @@ build_data_structure (VEC (tree, heap) **unsuitable_types)
}
/* Check function local variables. */
- for (var_list = fn->local_decls; var_list;
- var_list = TREE_CHAIN (var_list))
- {
- var = TREE_VALUE (var_list);
-
- if (is_candidate (var, &type, unsuitable_types))
- add_structure (type);
- }
+ FOR_EACH_LOCAL_DECL (fn, ix, var)
+ if (is_candidate (var, &type, unsuitable_types))
+ add_structure (type);
}
}
}
@@ -4031,7 +4028,10 @@ reorg_structs (void)
static unsigned int
reorg_structs_drive (void)
{
- reorg_structs ();
+ /* IPA struct-reorg is completely broken - its analysis phase is
+ non-conservative (which is not the only reason it is broken). */
+ if (0)
+ reorg_structs ();
return 0;
}
diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c
index b6744a6e042..354e651c476 100644
--- a/gcc/ipa-type-escape.c
+++ b/gcc/ipa-type-escape.c
@@ -1048,7 +1048,7 @@ check_function_parameter_and_return_types (tree fn, bool escapes)
from the TYPE_ARG_LIST. However, Geoff is wrong, this code
does seem to be live. */
- for (arg = DECL_ARGUMENTS (fn); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg))
{
tree type = get_canon_type (TREE_TYPE (arg), false, false);
if (escapes)
@@ -1676,12 +1676,11 @@ analyze_function (struct cgraph_node *fn)
/* There may be const decls with interesting right hand sides. */
if (DECL_STRUCT_FUNCTION (decl))
{
- tree step;
- for (step = DECL_STRUCT_FUNCTION (decl)->local_decls;
- step;
- step = TREE_CHAIN (step))
+ tree var;
+ unsigned ix;
+
+ FOR_EACH_LOCAL_DECL (DECL_STRUCT_FUNCTION (decl), ix, var)
{
- tree var = TREE_VALUE (step);
if (TREE_CODE (var) == VAR_DECL
&& DECL_INITIAL (var)
&& !TREE_STATIC (var))
@@ -1768,7 +1767,7 @@ close_type_seen (tree type)
subfields. */
for (field = TYPE_FIELDS (type);
field;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
{
tree field_type;
if (TREE_CODE (field) != FIELD_DECL)
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 05e164271db..bac3406be39 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "ggc.h"
#include "flags.h"
+#include "pointer-set.h"
/* Fill array order with all nodes with output flag set in the reverse
topological order. */
@@ -567,23 +568,31 @@ ipa_discover_readonly_nonaddressable_vars (void)
/* Return true when function NODE should be considered externally visible. */
static bool
-cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program)
+cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program, bool aliased)
{
if (!node->local.finalized)
return false;
if (!DECL_COMDAT (node->decl)
&& (!TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl)))
return false;
- if (!whole_program)
- return true;
- if (node->local.used_from_object_file)
+
+ /* Do not even try to be smart about aliased nodes. Until we properly
+ represent everything by same body alias, these are just evil. */
+ if (aliased)
return true;
- if (DECL_PRESERVE_P (node->decl))
+
+ /* When doing link time optimizations, hidden symbols become local. */
+ if (in_lto_p && DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
+ /* Be sure that node is defined in IR file, not in other object
+ file. In that case we don't set used_from_other_object_file. */
+ && node->analyzed)
+ ;
+ else if (!whole_program)
return true;
/* COMDAT functions must be shared only if they have address taken,
otherwise we can produce our own private implementation with
-fwhole-program. */
- if (DECL_COMDAT (node->decl))
+ else if (DECL_COMDAT (node->decl))
{
if (node->address_taken || !node->analyzed)
return true;
@@ -601,6 +610,10 @@ cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program)
return true;
}
}
+ if (node->local.used_from_object_file)
+ return true;
+ if (DECL_PRESERVE_P (node->decl))
+ return true;
if (MAIN_NAME_P (DECL_NAME (node->decl)))
return true;
if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (node->decl)))
@@ -639,6 +652,38 @@ function_and_variable_visibility (bool whole_program)
{
struct cgraph_node *node;
struct varpool_node *vnode;
+ struct pointer_set_t *aliased_nodes = pointer_set_create ();
+ struct pointer_set_t *aliased_vnodes = pointer_set_create ();
+ unsigned i;
+ alias_pair *p;
+
+ /* Discover aliased nodes. */
+ for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Alias %s->%s",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (p->decl)),
+ IDENTIFIER_POINTER (p->target));
+
+ if ((node = cgraph_node_for_asm (p->target)) != NULL)
+ {
+ gcc_assert (node->needed);
+ pointer_set_insert (aliased_nodes, node);
+ if (dump_file)
+ fprintf (dump_file, " node %s/%i",
+ cgraph_node_name (node), node->uid);
+ }
+ else if ((vnode = varpool_node_for_asm (p->target)) != NULL)
+ {
+ gcc_assert (vnode->needed);
+ pointer_set_insert (aliased_vnodes, vnode);
+ if (dump_file)
+ fprintf (dump_file, " varpool node %s",
+ varpool_node_name (vnode));
+ }
+ if (dump_file)
+ fprintf (dump_file, "\n");
+ }
for (node = cgraph_nodes; node; node = node->next)
{
@@ -667,7 +712,9 @@ function_and_variable_visibility (bool whole_program)
}
gcc_assert ((!DECL_WEAK (node->decl) && !DECL_COMDAT (node->decl))
|| TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl));
- if (cgraph_externally_visible_p (node, whole_program))
+ if (cgraph_externally_visible_p (node, whole_program,
+ pointer_set_contains (aliased_nodes,
+ node)))
{
gcc_assert (!node->global.inlined_to);
node->local.externally_visible = true;
@@ -678,7 +725,7 @@ function_and_variable_visibility (bool whole_program)
&& !DECL_EXTERNAL (node->decl))
{
struct cgraph_node *alias;
- gcc_assert (whole_program || !TREE_PUBLIC (node->decl));
+ gcc_assert (whole_program || in_lto_p || !TREE_PUBLIC (node->decl));
cgraph_make_decl_local (node->decl);
for (alias = node->same_body; alias; alias = alias->next)
cgraph_make_decl_local (alias->decl);
@@ -725,13 +772,23 @@ function_and_variable_visibility (bool whole_program)
continue;
if (vnode->needed
&& (DECL_COMDAT (vnode->decl) || TREE_PUBLIC (vnode->decl))
- && (!whole_program
- /* We can privatize comdat readonly variables whose address is not taken,
- but doing so is not going to bring us optimization oppurtunities until
- we start reordering datastructures. */
- || DECL_COMDAT (vnode->decl)
- || DECL_WEAK (vnode->decl)
+ && (((!whole_program
+ /* We can privatize comdat readonly variables whose address is
+ not taken, but doing so is not going to bring us
+ optimization oppurtunities until we start reordering
+ datastructures. */
+ || DECL_COMDAT (vnode->decl)
+ || DECL_WEAK (vnode->decl))
+ /* When doing linktime optimizations, all hidden symbols will
+ become local. */
+ && (!in_lto_p
+ || DECL_VISIBILITY (vnode->decl) != VISIBILITY_HIDDEN
+ /* We can get prevailing decision in other object file.
+ In this case we do not sed used_from_object_file. */
+ || !vnode->finalized))
+ || DECL_PRESERVE_P (vnode->decl)
|| vnode->used_from_object_file
+ || pointer_set_contains (aliased_vnodes, vnode)
|| lookup_attribute ("externally_visible",
DECL_ATTRIBUTES (vnode->decl))))
vnode->externally_visible = true;
@@ -739,11 +796,13 @@ function_and_variable_visibility (bool whole_program)
vnode->externally_visible = false;
if (!vnode->externally_visible)
{
- gcc_assert (whole_program || !TREE_PUBLIC (vnode->decl));
+ gcc_assert (in_lto_p || whole_program || !TREE_PUBLIC (vnode->decl));
cgraph_make_decl_local (vnode->decl);
}
gcc_assert (TREE_STATIC (vnode->decl));
}
+ pointer_set_destroy (aliased_nodes);
+ pointer_set_destroy (aliased_vnodes);
if (dump_file)
{
diff --git a/gcc/ira-build.c b/gcc/ira-build.c
index 6936cec3048..bf9124eca59 100644
--- a/gcc/ira-build.c
+++ b/gcc/ira-build.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "insn-config.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "params.h"
#include "df.h"
@@ -71,9 +72,12 @@ ira_allocno_t *ira_allocnos;
/* Sizes of the previous array. */
int ira_allocnos_num;
-/* Map conflict id -> allocno with given conflict id (see comments for
- allocno member `conflict_id'). */
-ira_allocno_t *ira_conflict_id_allocno_map;
+/* Count of conflict record structures we've created, used when creating
+ a new conflict id. */
+int ira_objects_num;
+
+/* Map a conflict id to its conflict record. */
+ira_object_t *ira_object_id_map;
/* Array of references to all copies. The order number of the copy
corresponds to the index in the array. Removed copies have NULL
@@ -380,19 +384,18 @@ rebuild_regno_allocno_maps (void)
loop_tree_node->regno_allocno_map[regno] = a;
}
}
-
-/* Pools for allocnos and live ranges. */
-static alloc_pool allocno_pool, live_range_pool;
+/* Pools for allocnos, allocno live ranges and objects. */
+static alloc_pool allocno_pool, live_range_pool, object_pool;
/* Vec containing references to all created allocnos. It is a
container of array allocnos. */
static VEC(ira_allocno_t,heap) *allocno_vec;
-/* Vec containing references to all created allocnos. It is a
- container of ira_conflict_id_allocno_map. */
-static VEC(ira_allocno_t,heap) *ira_conflict_id_allocno_map_vec;
+/* Vec containing references to all created ira_objects. It is a
+ container of ira_object_id_map. */
+static VEC(ira_object_t,heap) *ira_object_id_map_vec;
/* Initialize data concerning allocnos. */
static void
@@ -403,17 +406,51 @@ initiate_allocnos (void)
sizeof (struct live_range), 100);
allocno_pool
= create_alloc_pool ("allocnos", sizeof (struct ira_allocno), 100);
+ object_pool
+ = create_alloc_pool ("objects", sizeof (struct ira_object), 100);
allocno_vec = VEC_alloc (ira_allocno_t, heap, max_reg_num () * 2);
ira_allocnos = NULL;
ira_allocnos_num = 0;
- ira_conflict_id_allocno_map_vec
- = VEC_alloc (ira_allocno_t, heap, max_reg_num () * 2);
- ira_conflict_id_allocno_map = NULL;
+ ira_objects_num = 0;
+ ira_object_id_map_vec
+ = VEC_alloc (ira_object_t, heap, max_reg_num () * 2);
+ ira_object_id_map = NULL;
ira_regno_allocno_map
= (ira_allocno_t *) ira_allocate (max_reg_num () * sizeof (ira_allocno_t));
memset (ira_regno_allocno_map, 0, max_reg_num () * sizeof (ira_allocno_t));
}
+/* Create and return an object corresponding to a new allocno A. */
+static ira_object_t
+ira_create_object (ira_allocno_t a, int subword)
+{
+ enum reg_class cover_class = ALLOCNO_COVER_CLASS (a);
+ ira_object_t obj = (ira_object_t) pool_alloc (object_pool);
+
+ OBJECT_ALLOCNO (obj) = a;
+ OBJECT_SUBWORD (obj) = subword;
+ OBJECT_CONFLICT_ID (obj) = ira_objects_num;
+ OBJECT_CONFLICT_VEC_P (obj) = false;
+ OBJECT_CONFLICT_ARRAY (obj) = NULL;
+ OBJECT_NUM_CONFLICTS (obj) = 0;
+ COPY_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), ira_no_alloc_regs);
+ COPY_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), ira_no_alloc_regs);
+ IOR_COMPL_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
+ reg_class_contents[cover_class]);
+ IOR_COMPL_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ reg_class_contents[cover_class]);
+ OBJECT_MIN (obj) = INT_MAX;
+ OBJECT_MAX (obj) = -1;
+ OBJECT_LIVE_RANGES (obj) = NULL;
+
+ VEC_safe_push (ira_object_t, heap, ira_object_id_map_vec, obj);
+ ira_object_id_map
+ = VEC_address (ira_object_t, ira_object_id_map_vec);
+ ira_objects_num = VEC_length (ira_object_t, ira_object_id_map_vec);
+
+ return obj;
+}
+
/* Create and return the allocno corresponding to REGNO in
LOOP_TREE_NODE. Add the allocno to the list of allocnos with the
same regno if CAP_P is FALSE. */
@@ -439,10 +476,6 @@ ira_create_allocno (int regno, bool cap_p, ira_loop_tree_node_t loop_tree_node)
ALLOCNO_CAP_MEMBER (a) = NULL;
ALLOCNO_NUM (a) = ira_allocnos_num;
bitmap_set_bit (loop_tree_node->all_allocnos, ALLOCNO_NUM (a));
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = NULL;
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = 0;
- COPY_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
- COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
ALLOCNO_NREFS (a) = 0;
ALLOCNO_FREQ (a) = 0;
ALLOCNO_HARD_REGNO (a) = -1;
@@ -462,7 +495,6 @@ ira_create_allocno (int regno, bool cap_p, ira_loop_tree_node_t loop_tree_node)
ALLOCNO_ASSIGNED_P (a) = false;
ALLOCNO_MAY_BE_SPILLED_P (a) = false;
ALLOCNO_SPLAY_REMOVED_P (a) = false;
- ALLOCNO_CONFLICT_VEC_P (a) = false;
ALLOCNO_MODE (a) = (regno < 0 ? VOIDmode : PSEUDO_REGNO_MODE (regno));
ALLOCNO_COPIES (a) = NULL;
ALLOCNO_HARD_REG_COSTS (a) = NULL;
@@ -480,16 +512,12 @@ ira_create_allocno (int regno, bool cap_p, ira_loop_tree_node_t loop_tree_node)
ALLOCNO_PREV_BUCKET_ALLOCNO (a) = NULL;
ALLOCNO_FIRST_COALESCED_ALLOCNO (a) = a;
ALLOCNO_NEXT_COALESCED_ALLOCNO (a) = a;
- ALLOCNO_LIVE_RANGES (a) = NULL;
- ALLOCNO_MIN (a) = INT_MAX;
- ALLOCNO_MAX (a) = -1;
- ALLOCNO_CONFLICT_ID (a) = ira_allocnos_num;
+ ALLOCNO_NUM_OBJECTS (a) = 0;
+
VEC_safe_push (ira_allocno_t, heap, allocno_vec, a);
ira_allocnos = VEC_address (ira_allocno_t, allocno_vec);
ira_allocnos_num = VEC_length (ira_allocno_t, allocno_vec);
- VEC_safe_push (ira_allocno_t, heap, ira_conflict_id_allocno_map_vec, a);
- ira_conflict_id_allocno_map
- = VEC_address (ira_allocno_t, ira_conflict_id_allocno_map_vec);
+
return a;
}
@@ -498,23 +526,58 @@ void
ira_set_allocno_cover_class (ira_allocno_t a, enum reg_class cover_class)
{
ALLOCNO_COVER_CLASS (a) = cover_class;
- IOR_COMPL_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- reg_class_contents[cover_class]);
- IOR_COMPL_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- reg_class_contents[cover_class]);
}
-/* Merge hard register conflicts from allocno FROM into allocno TO. If
- TOTAL_ONLY is true, we ignore ALLOCNO_CONFLICT_HARD_REGS. */
+/* Determine the number of objects we should associate with allocno A
+ and allocate them. */
+void
+ira_create_allocno_objects (ira_allocno_t a)
+{
+ enum machine_mode mode = ALLOCNO_MODE (a);
+ enum reg_class cover_class = ALLOCNO_COVER_CLASS (a);
+ int n = ira_reg_class_nregs[cover_class][mode];
+ int i;
+
+ if (GET_MODE_SIZE (mode) != 2 * UNITS_PER_WORD || n != 2)
+ n = 1;
+
+ ALLOCNO_NUM_OBJECTS (a) = n;
+ for (i = 0; i < n; i++)
+ ALLOCNO_OBJECT (a, i) = ira_create_object (a, i);
+}
+
+/* For each allocno, set ALLOCNO_NUM_OBJECTS and create the
+ ALLOCNO_OBJECT structures. This must be called after the cover
+ classes are known. */
+static void
+create_allocno_objects (void)
+{
+ ira_allocno_t a;
+ ira_allocno_iterator ai;
+
+ FOR_EACH_ALLOCNO (a, ai)
+ ira_create_allocno_objects (a);
+}
+
+/* Merge hard register conflict information for all objects associated with
+ allocno TO into the corresponding objects associated with FROM.
+ If TOTAL_ONLY is true, we only merge OBJECT_TOTAL_CONFLICT_HARD_REGS. */
static void
merge_hard_reg_conflicts (ira_allocno_t from, ira_allocno_t to,
bool total_only)
{
- if (!total_only)
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (to),
- ALLOCNO_CONFLICT_HARD_REGS (from));
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (to),
- ALLOCNO_TOTAL_CONFLICT_HARD_REGS (from));
+ int i;
+ gcc_assert (ALLOCNO_NUM_OBJECTS (to) == ALLOCNO_NUM_OBJECTS (from));
+ for (i = 0; i < ALLOCNO_NUM_OBJECTS (to); i++)
+ {
+ ira_object_t from_obj = ALLOCNO_OBJECT (from, i);
+ ira_object_t to_obj = ALLOCNO_OBJECT (to, i);
+ if (!total_only)
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (to_obj),
+ OBJECT_CONFLICT_HARD_REGS (from_obj));
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (to_obj),
+ OBJECT_TOTAL_CONFLICT_HARD_REGS (from_obj));
+ }
#ifdef STACK_REGS
if (!total_only && ALLOCNO_NO_STACK_REG_P (from))
ALLOCNO_NO_STACK_REG_P (to) = true;
@@ -523,111 +586,124 @@ merge_hard_reg_conflicts (ira_allocno_t from, ira_allocno_t to,
#endif
}
-/* Return TRUE if the conflict vector with NUM elements is more
- profitable than conflict bit vector for A. */
+/* Update hard register conflict information for all objects associated with
+ A to include the regs in SET. */
+void
+ior_hard_reg_conflicts (ira_allocno_t a, HARD_REG_SET *set)
+{
+ ira_allocno_object_iterator i;
+ ira_object_t obj;
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, i)
+ {
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), *set);
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), *set);
+ }
+}
+
+/* Return TRUE if a conflict vector with NUM elements is more
+ profitable than a conflict bit vector for OBJ. */
bool
-ira_conflict_vector_profitable_p (ira_allocno_t a, int num)
+ira_conflict_vector_profitable_p (ira_object_t obj, int num)
{
int nw;
+ int max = OBJECT_MAX (obj);
+ int min = OBJECT_MIN (obj);
- if (ALLOCNO_MAX (a) < ALLOCNO_MIN (a))
- /* We prefer bit vector in such case because it does not result in
- allocation. */
+ if (max < min)
+ /* We prefer a bit vector in such case because it does not result
+ in allocation. */
return false;
- nw = (ALLOCNO_MAX (a) - ALLOCNO_MIN (a) + IRA_INT_BITS) / IRA_INT_BITS;
- return (2 * sizeof (ira_allocno_t) * (num + 1)
+ nw = (max - min + IRA_INT_BITS) / IRA_INT_BITS;
+ return (2 * sizeof (ira_object_t) * (num + 1)
< 3 * nw * sizeof (IRA_INT_TYPE));
}
-/* Allocates and initialize the conflict vector of A for NUM
- conflicting allocnos. */
+/* Allocates and initialize the conflict vector of OBJ for NUM
+ conflicting objects. */
void
-ira_allocate_allocno_conflict_vec (ira_allocno_t a, int num)
+ira_allocate_conflict_vec (ira_object_t obj, int num)
{
int size;
- ira_allocno_t *vec;
+ ira_object_t *vec;
- ira_assert (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) == NULL);
+ ira_assert (OBJECT_CONFLICT_ARRAY (obj) == NULL);
num++; /* for NULL end marker */
- size = sizeof (ira_allocno_t) * num;
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = ira_allocate (size);
- vec = (ira_allocno_t *) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a);
+ size = sizeof (ira_object_t) * num;
+ OBJECT_CONFLICT_ARRAY (obj) = ira_allocate (size);
+ vec = (ira_object_t *) OBJECT_CONFLICT_ARRAY (obj);
vec[0] = NULL;
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = 0;
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a) = size;
- ALLOCNO_CONFLICT_VEC_P (a) = true;
+ OBJECT_NUM_CONFLICTS (obj) = 0;
+ OBJECT_CONFLICT_ARRAY_SIZE (obj) = size;
+ OBJECT_CONFLICT_VEC_P (obj) = true;
}
-/* Allocate and initialize the conflict bit vector of A. */
+/* Allocate and initialize the conflict bit vector of OBJ. */
static void
-allocate_allocno_conflict_bit_vec (ira_allocno_t a)
+allocate_conflict_bit_vec (ira_object_t obj)
{
unsigned int size;
- ira_assert (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) == NULL);
- size = ((ALLOCNO_MAX (a) - ALLOCNO_MIN (a) + IRA_INT_BITS)
+ ira_assert (OBJECT_CONFLICT_ARRAY (obj) == NULL);
+ size = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
/ IRA_INT_BITS * sizeof (IRA_INT_TYPE));
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = ira_allocate (size);
- memset (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a), 0, size);
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a) = size;
- ALLOCNO_CONFLICT_VEC_P (a) = false;
+ OBJECT_CONFLICT_ARRAY (obj) = ira_allocate (size);
+ memset (OBJECT_CONFLICT_ARRAY (obj), 0, size);
+ OBJECT_CONFLICT_ARRAY_SIZE (obj) = size;
+ OBJECT_CONFLICT_VEC_P (obj) = false;
}
/* Allocate and initialize the conflict vector or conflict bit vector
- of A for NUM conflicting allocnos whatever is more profitable. */
+ of OBJ for NUM conflicting allocnos whatever is more profitable. */
void
-ira_allocate_allocno_conflicts (ira_allocno_t a, int num)
+ira_allocate_object_conflicts (ira_object_t obj, int num)
{
- if (ira_conflict_vector_profitable_p (a, num))
- ira_allocate_allocno_conflict_vec (a, num);
+ if (ira_conflict_vector_profitable_p (obj, num))
+ ira_allocate_conflict_vec (obj, num);
else
- allocate_allocno_conflict_bit_vec (a);
+ allocate_conflict_bit_vec (obj);
}
-/* Add A2 to the conflicts of A1. */
+/* Add OBJ2 to the conflicts of OBJ1. */
static void
-add_to_allocno_conflicts (ira_allocno_t a1, ira_allocno_t a2)
+add_to_conflicts (ira_object_t obj1, ira_object_t obj2)
{
int num;
unsigned int size;
- if (ALLOCNO_CONFLICT_VEC_P (a1))
+ if (OBJECT_CONFLICT_VEC_P (obj1))
{
- ira_allocno_t *vec;
-
- num = ALLOCNO_CONFLICT_ALLOCNOS_NUM (a1) + 2;
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1)
- >= num * sizeof (ira_allocno_t))
- vec = (ira_allocno_t *) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1);
- else
+ ira_object_t *vec = OBJECT_CONFLICT_VEC (obj1);
+ int curr_num = OBJECT_NUM_CONFLICTS (obj1);
+ num = curr_num + 2;
+ if (OBJECT_CONFLICT_ARRAY_SIZE (obj1) < num * sizeof (ira_object_t))
{
+ ira_object_t *newvec;
size = (3 * num / 2 + 1) * sizeof (ira_allocno_t);
- vec = (ira_allocno_t *) ira_allocate (size);
- memcpy (vec, ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1),
- sizeof (ira_allocno_t) * ALLOCNO_CONFLICT_ALLOCNOS_NUM (a1));
- ira_free (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1));
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1) = vec;
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1) = size;
+ newvec = (ira_object_t *) ira_allocate (size);
+ memcpy (newvec, vec, curr_num * sizeof (ira_object_t));
+ ira_free (vec);
+ vec = newvec;
+ OBJECT_CONFLICT_ARRAY (obj1) = vec;
+ OBJECT_CONFLICT_ARRAY_SIZE (obj1) = size;
}
- vec[num - 2] = a2;
+ vec[num - 2] = obj2;
vec[num - 1] = NULL;
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a1)++;
+ OBJECT_NUM_CONFLICTS (obj1)++;
}
else
{
int nw, added_head_nw, id;
- IRA_INT_TYPE *vec;
+ IRA_INT_TYPE *vec = OBJECT_CONFLICT_BITVEC (obj1);
- id = ALLOCNO_CONFLICT_ID (a2);
- vec = (IRA_INT_TYPE *) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1);
- if (ALLOCNO_MIN (a1) > id)
+ id = OBJECT_CONFLICT_ID (obj2);
+ if (OBJECT_MIN (obj1) > id)
{
/* Expand head of the bit vector. */
- added_head_nw = (ALLOCNO_MIN (a1) - id - 1) / IRA_INT_BITS + 1;
- nw = (ALLOCNO_MAX (a1) - ALLOCNO_MIN (a1)) / IRA_INT_BITS + 1;
+ added_head_nw = (OBJECT_MIN (obj1) - id - 1) / IRA_INT_BITS + 1;
+ nw = (OBJECT_MAX (obj1) - OBJECT_MIN (obj1)) / IRA_INT_BITS + 1;
size = (nw + added_head_nw) * sizeof (IRA_INT_TYPE);
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1) >= size)
+ if (OBJECT_CONFLICT_ARRAY_SIZE (obj1) >= size)
{
memmove ((char *) vec + added_head_nw * sizeof (IRA_INT_TYPE),
vec, nw * sizeof (IRA_INT_TYPE));
@@ -639,97 +715,93 @@ add_to_allocno_conflicts (ira_allocno_t a1, ira_allocno_t a2)
= (3 * (nw + added_head_nw) / 2 + 1) * sizeof (IRA_INT_TYPE);
vec = (IRA_INT_TYPE *) ira_allocate (size);
memcpy ((char *) vec + added_head_nw * sizeof (IRA_INT_TYPE),
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1),
- nw * sizeof (IRA_INT_TYPE));
+ OBJECT_CONFLICT_ARRAY (obj1), nw * sizeof (IRA_INT_TYPE));
memset (vec, 0, added_head_nw * sizeof (IRA_INT_TYPE));
memset ((char *) vec
+ (nw + added_head_nw) * sizeof (IRA_INT_TYPE),
0, size - (nw + added_head_nw) * sizeof (IRA_INT_TYPE));
- ira_free (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1));
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1) = vec;
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1) = size;
+ ira_free (OBJECT_CONFLICT_ARRAY (obj1));
+ OBJECT_CONFLICT_ARRAY (obj1) = vec;
+ OBJECT_CONFLICT_ARRAY_SIZE (obj1) = size;
}
- ALLOCNO_MIN (a1) -= added_head_nw * IRA_INT_BITS;
+ OBJECT_MIN (obj1) -= added_head_nw * IRA_INT_BITS;
}
- else if (ALLOCNO_MAX (a1) < id)
+ else if (OBJECT_MAX (obj1) < id)
{
- nw = (id - ALLOCNO_MIN (a1)) / IRA_INT_BITS + 1;
+ nw = (id - OBJECT_MIN (obj1)) / IRA_INT_BITS + 1;
size = nw * sizeof (IRA_INT_TYPE);
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1) < size)
+ if (OBJECT_CONFLICT_ARRAY_SIZE (obj1) < size)
{
/* Expand tail of the bit vector. */
size = (3 * nw / 2 + 1) * sizeof (IRA_INT_TYPE);
vec = (IRA_INT_TYPE *) ira_allocate (size);
- memcpy (vec, ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1),
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1));
- memset ((char *) vec + ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1),
- 0, size - ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1));
- ira_free (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1));
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a1) = vec;
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a1) = size;
+ memcpy (vec, OBJECT_CONFLICT_ARRAY (obj1), OBJECT_CONFLICT_ARRAY_SIZE (obj1));
+ memset ((char *) vec + OBJECT_CONFLICT_ARRAY_SIZE (obj1),
+ 0, size - OBJECT_CONFLICT_ARRAY_SIZE (obj1));
+ ira_free (OBJECT_CONFLICT_ARRAY (obj1));
+ OBJECT_CONFLICT_ARRAY (obj1) = vec;
+ OBJECT_CONFLICT_ARRAY_SIZE (obj1) = size;
}
- ALLOCNO_MAX (a1) = id;
+ OBJECT_MAX (obj1) = id;
}
- SET_MINMAX_SET_BIT (vec, id, ALLOCNO_MIN (a1), ALLOCNO_MAX (a1));
+ SET_MINMAX_SET_BIT (vec, id, OBJECT_MIN (obj1), OBJECT_MAX (obj1));
}
}
-/* Add A1 to the conflicts of A2 and vise versa. */
-void
-ira_add_allocno_conflict (ira_allocno_t a1, ira_allocno_t a2)
+/* Add OBJ1 to the conflicts of OBJ2 and vice versa. */
+static void
+ira_add_conflict (ira_object_t obj1, ira_object_t obj2)
{
- add_to_allocno_conflicts (a1, a2);
- add_to_allocno_conflicts (a2, a1);
+ add_to_conflicts (obj1, obj2);
+ add_to_conflicts (obj2, obj1);
}
-/* Clear all conflicts of allocno A. */
+/* Clear all conflicts of OBJ. */
static void
-clear_allocno_conflicts (ira_allocno_t a)
+clear_conflicts (ira_object_t obj)
{
- if (ALLOCNO_CONFLICT_VEC_P (a))
+ if (OBJECT_CONFLICT_VEC_P (obj))
{
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = 0;
- ((ira_allocno_t *) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a))[0] = NULL;
+ OBJECT_NUM_CONFLICTS (obj) = 0;
+ OBJECT_CONFLICT_VEC (obj)[0] = NULL;
}
- else if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a) != 0)
+ else if (OBJECT_CONFLICT_ARRAY_SIZE (obj) != 0)
{
int nw;
- nw = (ALLOCNO_MAX (a) - ALLOCNO_MIN (a)) / IRA_INT_BITS + 1;
- memset (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a), 0,
- nw * sizeof (IRA_INT_TYPE));
+ nw = (OBJECT_MAX (obj) - OBJECT_MIN (obj)) / IRA_INT_BITS + 1;
+ memset (OBJECT_CONFLICT_BITVEC (obj), 0, nw * sizeof (IRA_INT_TYPE));
}
}
/* The array used to find duplications in conflict vectors of
allocnos. */
-static int *allocno_conflict_check;
+static int *conflict_check;
/* The value used to mark allocation presence in conflict vector of
the current allocno. */
-static int curr_allocno_conflict_check_tick;
+static int curr_conflict_check_tick;
-/* Remove duplications in conflict vector of A. */
+/* Remove duplications in conflict vector of OBJ. */
static void
-compress_allocno_conflict_vec (ira_allocno_t a)
+compress_conflict_vec (ira_object_t obj)
{
- ira_allocno_t *vec, conflict_a;
+ ira_object_t *vec, conflict_obj;
int i, j;
- ira_assert (ALLOCNO_CONFLICT_VEC_P (a));
- vec = (ira_allocno_t *) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a);
- curr_allocno_conflict_check_tick++;
- for (i = j = 0; (conflict_a = vec[i]) != NULL; i++)
+ ira_assert (OBJECT_CONFLICT_VEC_P (obj));
+ vec = OBJECT_CONFLICT_VEC (obj);
+ curr_conflict_check_tick++;
+ for (i = j = 0; (conflict_obj = vec[i]) != NULL; i++)
{
- if (allocno_conflict_check[ALLOCNO_NUM (conflict_a)]
- != curr_allocno_conflict_check_tick)
+ int id = OBJECT_CONFLICT_ID (conflict_obj);
+ if (conflict_check[id] != curr_conflict_check_tick)
{
- allocno_conflict_check[ALLOCNO_NUM (conflict_a)]
- = curr_allocno_conflict_check_tick;
- vec[j++] = conflict_a;
+ conflict_check[id] = curr_conflict_check_tick;
+ vec[j++] = conflict_obj;
}
}
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = j;
+ OBJECT_NUM_CONFLICTS (obj) = j;
vec[j] = NULL;
}
@@ -737,17 +809,18 @@ compress_allocno_conflict_vec (ira_allocno_t a)
static void
compress_conflict_vecs (void)
{
- ira_allocno_t a;
- ira_allocno_iterator ai;
+ ira_object_t obj;
+ ira_object_iterator oi;
- allocno_conflict_check
- = (int *) ira_allocate (sizeof (int) * ira_allocnos_num);
- memset (allocno_conflict_check, 0, sizeof (int) * ira_allocnos_num);
- curr_allocno_conflict_check_tick = 0;
- FOR_EACH_ALLOCNO (a, ai)
- if (ALLOCNO_CONFLICT_VEC_P (a))
- compress_allocno_conflict_vec (a);
- ira_free (allocno_conflict_check);
+ conflict_check = (int *) ira_allocate (sizeof (int) * ira_objects_num);
+ memset (conflict_check, 0, sizeof (int) * ira_objects_num);
+ curr_conflict_check_tick = 0;
+ FOR_EACH_OBJECT (obj, oi)
+ {
+ if (OBJECT_CONFLICT_VEC_P (obj))
+ compress_conflict_vec (obj);
+ }
+ ira_free (conflict_check);
}
/* This recursive function outputs allocno A and if it is a cap the
@@ -786,6 +859,7 @@ create_cap_allocno (ira_allocno_t a)
ALLOCNO_MODE (cap) = ALLOCNO_MODE (a);
cover_class = ALLOCNO_COVER_CLASS (a);
ira_set_allocno_cover_class (cap, cover_class);
+ ira_create_allocno_objects (cap);
ALLOCNO_AVAILABLE_REGS_NUM (cap) = ALLOCNO_AVAILABLE_REGS_NUM (a);
ALLOCNO_CAP_MEMBER (cap) = a;
ALLOCNO_CAP (a) = cap;
@@ -800,7 +874,9 @@ create_cap_allocno (ira_allocno_t a)
ALLOCNO_NREFS (cap) = ALLOCNO_NREFS (a);
ALLOCNO_FREQ (cap) = ALLOCNO_FREQ (a);
ALLOCNO_CALL_FREQ (cap) = ALLOCNO_CALL_FREQ (a);
+
merge_hard_reg_conflicts (a, cap, false);
+
ALLOCNO_CALLS_CROSSED_NUM (cap) = ALLOCNO_CALLS_CROSSED_NUM (a);
if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
{
@@ -811,24 +887,35 @@ create_cap_allocno (ira_allocno_t a)
return cap;
}
-/* Create and return allocno live range with given attributes. */
+/* Create and return a live range for OBJECT with given attributes. */
live_range_t
-ira_create_allocno_live_range (ira_allocno_t a, int start, int finish,
- live_range_t next)
+ira_create_live_range (ira_object_t obj, int start, int finish,
+ live_range_t next)
{
live_range_t p;
p = (live_range_t) pool_alloc (live_range_pool);
- p->allocno = a;
+ p->object = obj;
p->start = start;
p->finish = finish;
p->next = next;
return p;
}
+/* Create a new live range for OBJECT and queue it at the head of its
+ live range list. */
+void
+ira_add_live_range_to_object (ira_object_t object, int start, int finish)
+{
+ live_range_t p;
+ p = ira_create_live_range (object, start, finish,
+ OBJECT_LIVE_RANGES (object));
+ OBJECT_LIVE_RANGES (object) = p;
+}
+
/* Copy allocno live range R and return the result. */
static live_range_t
-copy_allocno_live_range (live_range_t r)
+copy_live_range (live_range_t r)
{
live_range_t p;
@@ -840,7 +927,7 @@ copy_allocno_live_range (live_range_t r)
/* Copy allocno live range list given by its head R and return the
result. */
live_range_t
-ira_copy_allocno_live_range_list (live_range_t r)
+ira_copy_live_range_list (live_range_t r)
{
live_range_t p, first, last;
@@ -848,7 +935,7 @@ ira_copy_allocno_live_range_list (live_range_t r)
return NULL;
for (first = last = NULL; r != NULL; r = r->next)
{
- p = copy_allocno_live_range (r);
+ p = copy_live_range (r);
if (first == NULL)
first = p;
else
@@ -862,7 +949,7 @@ ira_copy_allocno_live_range_list (live_range_t r)
maintains the order of ranges and tries to minimize number of the
result ranges. */
live_range_t
-ira_merge_allocno_live_ranges (live_range_t r1, live_range_t r2)
+ira_merge_live_ranges (live_range_t r1, live_range_t r2)
{
live_range_t first, last, temp;
@@ -886,7 +973,7 @@ ira_merge_allocno_live_ranges (live_range_t r1, live_range_t r2)
r1->finish = r2->finish;
temp = r2;
r2 = r2->next;
- ira_finish_allocno_live_range (temp);
+ ira_finish_live_range (temp);
if (r2 == NULL)
{
/* To try to merge with subsequent ranges in r1. */
@@ -938,7 +1025,7 @@ ira_merge_allocno_live_ranges (live_range_t r1, live_range_t r2)
/* Return TRUE if live ranges R1 and R2 intersect. */
bool
-ira_allocno_live_ranges_intersect_p (live_range_t r1, live_range_t r2)
+ira_live_ranges_intersect_p (live_range_t r1, live_range_t r2)
{
/* Remember the live ranges are always kept ordered. */
while (r1 != NULL && r2 != NULL)
@@ -955,21 +1042,21 @@ ira_allocno_live_ranges_intersect_p (live_range_t r1, live_range_t r2)
/* Free allocno live range R. */
void
-ira_finish_allocno_live_range (live_range_t r)
+ira_finish_live_range (live_range_t r)
{
pool_free (live_range_pool, r);
}
/* Free list of allocno live ranges starting with R. */
void
-ira_finish_allocno_live_range_list (live_range_t r)
+ira_finish_live_range_list (live_range_t r)
{
live_range_t next_r;
for (; r != NULL; r = next_r)
{
next_r = r->next;
- ira_finish_allocno_live_range (r);
+ ira_finish_live_range (r);
}
}
@@ -994,11 +1081,19 @@ static void
finish_allocno (ira_allocno_t a)
{
enum reg_class cover_class = ALLOCNO_COVER_CLASS (a);
+ ira_object_t obj;
+ ira_allocno_object_iterator oi;
+
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, oi)
+ {
+ ira_finish_live_range_list (OBJECT_LIVE_RANGES (obj));
+ ira_object_id_map[OBJECT_CONFLICT_ID (obj)] = NULL;
+ if (OBJECT_CONFLICT_ARRAY (obj) != NULL)
+ ira_free (OBJECT_CONFLICT_ARRAY (obj));
+ pool_free (object_pool, obj);
+ }
ira_allocnos[ALLOCNO_NUM (a)] = NULL;
- ira_conflict_id_allocno_map[ALLOCNO_CONFLICT_ID (a)] = NULL;
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) != NULL)
- ira_free (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a));
if (ALLOCNO_HARD_REG_COSTS (a) != NULL)
ira_free_cost_vector (ALLOCNO_HARD_REG_COSTS (a), cover_class);
if (ALLOCNO_CONFLICT_HARD_REG_COSTS (a) != NULL)
@@ -1008,7 +1103,6 @@ finish_allocno (ira_allocno_t a)
if (ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a) != NULL)
ira_free_cost_vector (ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a),
cover_class);
- ira_finish_allocno_live_range_list (ALLOCNO_LIVE_RANGES (a));
pool_free (allocno_pool, a);
}
@@ -1022,9 +1116,10 @@ finish_allocnos (void)
FOR_EACH_ALLOCNO (a, ai)
finish_allocno (a);
ira_free (ira_regno_allocno_map);
- VEC_free (ira_allocno_t, heap, ira_conflict_id_allocno_map_vec);
+ VEC_free (ira_object_t, heap, ira_object_id_map_vec);
VEC_free (ira_allocno_t, heap, allocno_vec);
free_alloc_pool (allocno_pool);
+ free_alloc_pool (object_pool);
free_alloc_pool (live_range_pool);
}
@@ -1654,52 +1749,70 @@ create_allocnos (void)
will hardly improve the result. As a result we speed up regional
register allocation. */
-/* The function changes allocno in range list given by R onto A. */
+/* The function changes the object in range list given by R to OBJ. */
static void
-change_allocno_in_range_list (live_range_t r, ira_allocno_t a)
+change_object_in_range_list (live_range_t r, ira_object_t obj)
{
for (; r != NULL; r = r->next)
- r->allocno = a;
+ r->object = obj;
}
/* Move all live ranges associated with allocno FROM to allocno TO. */
static void
move_allocno_live_ranges (ira_allocno_t from, ira_allocno_t to)
{
- live_range_t lr = ALLOCNO_LIVE_RANGES (from);
+ int i;
+ int n = ALLOCNO_NUM_OBJECTS (from);
+
+ gcc_assert (n == ALLOCNO_NUM_OBJECTS (to));
- if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL)
+ for (i = 0; i < n; i++)
{
- fprintf (ira_dump_file,
- " Moving ranges of a%dr%d to a%dr%d: ",
- ALLOCNO_NUM (from), ALLOCNO_REGNO (from),
- ALLOCNO_NUM (to), ALLOCNO_REGNO (to));
- ira_print_live_range_list (ira_dump_file, lr);
+ ira_object_t from_obj = ALLOCNO_OBJECT (from, i);
+ ira_object_t to_obj = ALLOCNO_OBJECT (to, i);
+ live_range_t lr = OBJECT_LIVE_RANGES (from_obj);
+
+ if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL)
+ {
+ fprintf (ira_dump_file,
+ " Moving ranges of a%dr%d to a%dr%d: ",
+ ALLOCNO_NUM (from), ALLOCNO_REGNO (from),
+ ALLOCNO_NUM (to), ALLOCNO_REGNO (to));
+ ira_print_live_range_list (ira_dump_file, lr);
+ }
+ change_object_in_range_list (lr, to_obj);
+ OBJECT_LIVE_RANGES (to_obj)
+ = ira_merge_live_ranges (lr, OBJECT_LIVE_RANGES (to_obj));
+ OBJECT_LIVE_RANGES (from_obj) = NULL;
}
- change_allocno_in_range_list (lr, to);
- ALLOCNO_LIVE_RANGES (to)
- = ira_merge_allocno_live_ranges (lr, ALLOCNO_LIVE_RANGES (to));
- ALLOCNO_LIVE_RANGES (from) = NULL;
}
-/* Copy all live ranges associated with allocno FROM to allocno TO. */
static void
copy_allocno_live_ranges (ira_allocno_t from, ira_allocno_t to)
{
- live_range_t lr = ALLOCNO_LIVE_RANGES (from);
+ int i;
+ int n = ALLOCNO_NUM_OBJECTS (from);
+
+ gcc_assert (n == ALLOCNO_NUM_OBJECTS (to));
- if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL)
+ for (i = 0; i < n; i++)
{
- fprintf (ira_dump_file,
- " Copying ranges of a%dr%d to a%dr%d: ",
- ALLOCNO_NUM (from), ALLOCNO_REGNO (from),
- ALLOCNO_NUM (to), ALLOCNO_REGNO (to));
- ira_print_live_range_list (ira_dump_file, lr);
+ ira_object_t from_obj = ALLOCNO_OBJECT (from, i);
+ ira_object_t to_obj = ALLOCNO_OBJECT (to, i);
+ live_range_t lr = OBJECT_LIVE_RANGES (from_obj);
+
+ if (internal_flag_ira_verbose > 4 && ira_dump_file != NULL)
+ {
+ fprintf (ira_dump_file, " Copying ranges of a%dr%d to a%dr%d: ",
+ ALLOCNO_NUM (from), ALLOCNO_REGNO (from),
+ ALLOCNO_NUM (to), ALLOCNO_REGNO (to));
+ ira_print_live_range_list (ira_dump_file, lr);
+ }
+ lr = ira_copy_live_range_list (lr);
+ change_object_in_range_list (lr, to_obj);
+ OBJECT_LIVE_RANGES (to_obj)
+ = ira_merge_live_ranges (lr, OBJECT_LIVE_RANGES (to_obj));
}
- lr = ira_copy_allocno_live_range_list (lr);
- change_allocno_in_range_list (lr, to);
- ALLOCNO_LIVE_RANGES (to)
- = ira_merge_allocno_live_ranges (lr, ALLOCNO_LIVE_RANGES (to));
}
/* Return TRUE if NODE represents a loop with low register
@@ -2079,11 +2192,15 @@ remove_low_level_allocnos (void)
regno = ALLOCNO_REGNO (a);
if (ira_loop_tree_root->regno_allocno_map[regno] == a)
{
+ ira_object_t obj;
+ ira_allocno_object_iterator oi;
+
ira_regno_allocno_map[regno] = a;
ALLOCNO_NEXT_REGNO_ALLOCNO (a) = NULL;
ALLOCNO_CAP_MEMBER (a) = NULL;
- COPY_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, oi)
+ COPY_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
+ OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
#ifdef STACK_REGS
if (ALLOCNO_TOTAL_NO_STACK_REG_P (a))
ALLOCNO_NO_STACK_REG_P (a) = true;
@@ -2146,6 +2263,8 @@ update_bad_spill_attribute (void)
int i;
ira_allocno_t a;
ira_allocno_iterator ai;
+ ira_allocno_object_iterator aoi;
+ ira_object_t obj;
live_range_t r;
enum reg_class cover_class;
bitmap_head dead_points[N_REG_CLASSES];
@@ -2160,8 +2279,9 @@ update_bad_spill_attribute (void)
cover_class = ALLOCNO_COVER_CLASS (a);
if (cover_class == NO_REGS)
continue;
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- bitmap_set_bit (&dead_points[cover_class], r->finish);
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, aoi)
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ bitmap_set_bit (&dead_points[cover_class], r->finish);
}
FOR_EACH_ALLOCNO (a, ai)
{
@@ -2170,16 +2290,22 @@ update_bad_spill_attribute (void)
continue;
if (! ALLOCNO_BAD_SPILL_P (a))
continue;
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, aoi)
{
- for (i = r->start + 1; i < r->finish; i++)
- if (bitmap_bit_p (&dead_points[cover_class], i))
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ {
+ for (i = r->start + 1; i < r->finish; i++)
+ if (bitmap_bit_p (&dead_points[cover_class], i))
+ break;
+ if (i < r->finish)
+ break;
+ }
+ if (r != NULL)
+ {
+ ALLOCNO_BAD_SPILL_P (a) = false;
break;
- if (i < r->finish)
- break;
+ }
}
- if (r != NULL)
- ALLOCNO_BAD_SPILL_P (a) = false;
}
for (i = 0; i < ira_reg_class_cover_size; i++)
{
@@ -2197,52 +2323,71 @@ setup_min_max_allocno_live_range_point (void)
int i;
ira_allocno_t a, parent_a, cap;
ira_allocno_iterator ai;
+#ifdef ENABLE_IRA_CHECKING
+ ira_object_iterator oi;
+ ira_object_t obj;
+#endif
live_range_t r;
ira_loop_tree_node_t parent;
FOR_EACH_ALLOCNO (a, ai)
{
- r = ALLOCNO_LIVE_RANGES (a);
- if (r == NULL)
- continue;
- ALLOCNO_MAX (a) = r->finish;
- for (; r->next != NULL; r = r->next)
- ;
- ALLOCNO_MIN (a) = r->start;
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ r = OBJECT_LIVE_RANGES (obj);
+ if (r == NULL)
+ continue;
+ OBJECT_MAX (obj) = r->finish;
+ for (; r->next != NULL; r = r->next)
+ ;
+ OBJECT_MIN (obj) = r->start;
+ }
}
for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
for (a = ira_regno_allocno_map[i];
a != NULL;
a = ALLOCNO_NEXT_REGNO_ALLOCNO (a))
{
- if (ALLOCNO_MAX (a) < 0)
- continue;
- ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL);
- /* Accumulation of range info. */
- if (ALLOCNO_CAP (a) != NULL)
+ int j;
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ for (j = 0; j < n; j++)
{
- for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap))
+ ira_object_t obj = ALLOCNO_OBJECT (a, j);
+ ira_object_t parent_obj;
+
+ if (OBJECT_MAX (obj) < 0)
+ continue;
+ ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL);
+ /* Accumulation of range info. */
+ if (ALLOCNO_CAP (a) != NULL)
{
- if (ALLOCNO_MAX (cap) < ALLOCNO_MAX (a))
- ALLOCNO_MAX (cap) = ALLOCNO_MAX (a);
- if (ALLOCNO_MIN (cap) > ALLOCNO_MIN (a))
- ALLOCNO_MIN (cap) = ALLOCNO_MIN (a);
+ for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap))
+ {
+ ira_object_t cap_obj = ALLOCNO_OBJECT (cap, j);
+ if (OBJECT_MAX (cap_obj) < OBJECT_MAX (obj))
+ OBJECT_MAX (cap_obj) = OBJECT_MAX (obj);
+ if (OBJECT_MIN (cap_obj) > OBJECT_MIN (obj))
+ OBJECT_MIN (cap_obj) = OBJECT_MIN (obj);
+ }
+ continue;
}
- continue;
+ if ((parent = ALLOCNO_LOOP_TREE_NODE (a)->parent) == NULL)
+ continue;
+ parent_a = parent->regno_allocno_map[i];
+ parent_obj = ALLOCNO_OBJECT (parent_a, j);
+ if (OBJECT_MAX (parent_obj) < OBJECT_MAX (obj))
+ OBJECT_MAX (parent_obj) = OBJECT_MAX (obj);
+ if (OBJECT_MIN (parent_obj) > OBJECT_MIN (obj))
+ OBJECT_MIN (parent_obj) = OBJECT_MIN (obj);
}
- if ((parent = ALLOCNO_LOOP_TREE_NODE (a)->parent) == NULL)
- continue;
- parent_a = parent->regno_allocno_map[i];
- if (ALLOCNO_MAX (parent_a) < ALLOCNO_MAX (a))
- ALLOCNO_MAX (parent_a) = ALLOCNO_MAX (a);
- if (ALLOCNO_MIN (parent_a) > ALLOCNO_MIN (a))
- ALLOCNO_MIN (parent_a) = ALLOCNO_MIN (a);
}
#ifdef ENABLE_IRA_CHECKING
- FOR_EACH_ALLOCNO (a, ai)
+ FOR_EACH_OBJECT (obj, oi)
{
- if ((0 <= ALLOCNO_MIN (a) && ALLOCNO_MIN (a) <= ira_max_point)
- && (0 <= ALLOCNO_MAX (a) && ALLOCNO_MAX (a) <= ira_max_point))
+ if ((0 <= OBJECT_MIN (obj) && OBJECT_MIN (obj) <= ira_max_point)
+ && (0 <= OBJECT_MAX (obj) && OBJECT_MAX (obj) <= ira_max_point))
continue;
gcc_unreachable ();
}
@@ -2251,30 +2396,31 @@ setup_min_max_allocno_live_range_point (void)
/* Sort allocnos according to their live ranges. Allocnos with
smaller cover class are put first unless we use priority coloring.
- Allocnos with the same cove class are ordered according their start
+ Allocnos with the same cover class are ordered according their start
(min). Allocnos with the same start are ordered according their
finish (max). */
static int
-allocno_range_compare_func (const void *v1p, const void *v2p)
+object_range_compare_func (const void *v1p, const void *v2p)
{
int diff;
- ira_allocno_t a1 = *(const ira_allocno_t *) v1p;
- ira_allocno_t a2 = *(const ira_allocno_t *) v2p;
+ ira_object_t obj1 = *(const ira_object_t *) v1p;
+ ira_object_t obj2 = *(const ira_object_t *) v2p;
+ ira_allocno_t a1 = OBJECT_ALLOCNO (obj1);
+ ira_allocno_t a2 = OBJECT_ALLOCNO (obj2);
if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
&& (diff = ALLOCNO_COVER_CLASS (a1) - ALLOCNO_COVER_CLASS (a2)) != 0)
return diff;
- if ((diff = ALLOCNO_MIN (a1) - ALLOCNO_MIN (a2)) != 0)
+ if ((diff = OBJECT_MIN (obj1) - OBJECT_MIN (obj2)) != 0)
return diff;
- if ((diff = ALLOCNO_MAX (a1) - ALLOCNO_MAX (a2)) != 0)
+ if ((diff = OBJECT_MAX (obj1) - OBJECT_MAX (obj2)) != 0)
return diff;
return ALLOCNO_NUM (a1) - ALLOCNO_NUM (a2);
}
-/* Sort ira_conflict_id_allocno_map and set up conflict id of
- allocnos. */
+/* Sort ira_object_id_map and set up conflict id of allocnos. */
static void
-sort_conflict_id_allocno_map (void)
+sort_conflict_id_map (void)
{
int i, num;
ira_allocno_t a;
@@ -2282,14 +2428,23 @@ sort_conflict_id_allocno_map (void)
num = 0;
FOR_EACH_ALLOCNO (a, ai)
- ira_conflict_id_allocno_map[num++] = a;
- qsort (ira_conflict_id_allocno_map, num, sizeof (ira_allocno_t),
- allocno_range_compare_func);
+ {
+ ira_allocno_object_iterator oi;
+ ira_object_t obj;
+
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, oi)
+ ira_object_id_map[num++] = obj;
+ }
+ qsort (ira_object_id_map, num, sizeof (ira_object_t),
+ object_range_compare_func);
for (i = 0; i < num; i++)
- if ((a = ira_conflict_id_allocno_map[i]) != NULL)
- ALLOCNO_CONFLICT_ID (a) = i;
- for (i = num; i < ira_allocnos_num; i++)
- ira_conflict_id_allocno_map[i] = NULL;
+ {
+ ira_object_t obj = ira_object_id_map[i];
+ gcc_assert (obj != NULL);
+ OBJECT_CONFLICT_ID (obj) = i;
+ }
+ for (i = num; i < ira_objects_num; i++)
+ ira_object_id_map[i] = NULL;
}
/* Set up minimal and maximal conflict ids of allocnos with which
@@ -2300,16 +2455,21 @@ setup_min_max_conflict_allocno_ids (void)
int cover_class;
int i, j, min, max, start, finish, first_not_finished, filled_area_start;
int *live_range_min, *last_lived;
+ int word0_min, word0_max;
ira_allocno_t a;
+ ira_allocno_iterator ai;
- live_range_min = (int *) ira_allocate (sizeof (int) * ira_allocnos_num);
+ live_range_min = (int *) ira_allocate (sizeof (int) * ira_objects_num);
cover_class = -1;
first_not_finished = -1;
- for (i = 0; i < ira_allocnos_num; i++)
+ for (i = 0; i < ira_objects_num; i++)
{
- a = ira_conflict_id_allocno_map[i];
- if (a == NULL)
+ ira_object_t obj = ira_object_id_map[i];
+ if (obj == NULL)
continue;
+
+ a = OBJECT_ALLOCNO (obj);
+
if (cover_class < 0
|| (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
&& cover_class != (int) ALLOCNO_COVER_CLASS (a)))
@@ -2320,14 +2480,14 @@ setup_min_max_conflict_allocno_ids (void)
}
else
{
- start = ALLOCNO_MIN (a);
+ start = OBJECT_MIN (obj);
/* If we skip an allocno, the allocno with smaller ids will
be also skipped because of the secondary sorting the
range finishes (see function
- allocno_range_compare_func). */
+ object_range_compare_func). */
while (first_not_finished < i
- && start > ALLOCNO_MAX (ira_conflict_id_allocno_map
- [first_not_finished]))
+ && start > OBJECT_MAX (ira_object_id_map
+ [first_not_finished]))
first_not_finished++;
min = first_not_finished;
}
@@ -2335,17 +2495,19 @@ setup_min_max_conflict_allocno_ids (void)
/* We could increase min further in this case but it is good
enough. */
min++;
- live_range_min[i] = ALLOCNO_MIN (a);
- ALLOCNO_MIN (a) = min;
+ live_range_min[i] = OBJECT_MIN (obj);
+ OBJECT_MIN (obj) = min;
}
last_lived = (int *) ira_allocate (sizeof (int) * ira_max_point);
cover_class = -1;
filled_area_start = -1;
- for (i = ira_allocnos_num - 1; i >= 0; i--)
+ for (i = ira_objects_num - 1; i >= 0; i--)
{
- a = ira_conflict_id_allocno_map[i];
- if (a == NULL)
+ ira_object_t obj = ira_object_id_map[i];
+ if (obj == NULL)
continue;
+
+ a = OBJECT_ALLOCNO (obj);
if (cover_class < 0
|| (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
&& cover_class != (int) ALLOCNO_COVER_CLASS (a)))
@@ -2356,13 +2518,13 @@ setup_min_max_conflict_allocno_ids (void)
filled_area_start = ira_max_point;
}
min = live_range_min[i];
- finish = ALLOCNO_MAX (a);
+ finish = OBJECT_MAX (obj);
max = last_lived[finish];
if (max < 0)
/* We could decrease max further in this case but it is good
enough. */
- max = ALLOCNO_CONFLICT_ID (a) - 1;
- ALLOCNO_MAX (a) = max;
+ max = OBJECT_CONFLICT_ID (obj) - 1;
+ OBJECT_MAX (obj) = max;
/* In filling, we can go further A range finish to recognize
intersection quickly because if the finish of subsequently
processed allocno (it has smaller conflict id) range is
@@ -2376,6 +2538,38 @@ setup_min_max_conflict_allocno_ids (void)
}
ira_free (last_lived);
ira_free (live_range_min);
+
+ /* For allocnos with more than one object, we may later record extra conflicts in
+ subobject 0 that we cannot really know about here.
+ For now, simply widen the min/max range of these subobjects. */
+
+ word0_min = INT_MAX;
+ word0_max = INT_MIN;
+
+ FOR_EACH_ALLOCNO (a, ai)
+ {
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ ira_object_t obj0;
+ if (n < 2)
+ continue;
+ obj0 = ALLOCNO_OBJECT (a, 0);
+ if (OBJECT_CONFLICT_ID (obj0) < word0_min)
+ word0_min = OBJECT_CONFLICT_ID (obj0);
+ if (OBJECT_CONFLICT_ID (obj0) > word0_max)
+ word0_max = OBJECT_CONFLICT_ID (obj0);
+ }
+ FOR_EACH_ALLOCNO (a, ai)
+ {
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ ira_object_t obj0;
+ if (n < 2)
+ continue;
+ obj0 = ALLOCNO_OBJECT (a, 0);
+ if (OBJECT_MIN (obj0) > word0_min)
+ OBJECT_MIN (obj0) = word0_min;
+ if (OBJECT_MAX (obj0) < word0_max)
+ OBJECT_MAX (obj0) = word0_max;
+ }
}
@@ -2463,6 +2657,7 @@ copy_info_to_removed_store_destinations (int regno)
if (a != regno_top_level_allocno_map[REGNO (ALLOCNO_REG (a))])
/* This allocno will be removed. */
continue;
+
/* Caps will be removed. */
ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL);
for (parent = ALLOCNO_LOOP_TREE_NODE (a)->parent;
@@ -2475,8 +2670,10 @@ copy_info_to_removed_store_destinations (int regno)
break;
if (parent == NULL || parent_a == NULL)
continue;
+
copy_allocno_live_ranges (a, parent_a);
merge_hard_reg_conflicts (a, parent_a, true);
+
ALLOCNO_CALL_FREQ (parent_a) += ALLOCNO_CALL_FREQ (a);
ALLOCNO_CALLS_CROSSED_NUM (parent_a)
+= ALLOCNO_CALLS_CROSSED_NUM (a);
@@ -2496,7 +2693,7 @@ copy_info_to_removed_store_destinations (int regno)
void
ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
{
- int i, j, num;
+ int i, j;
bool keep_p;
int hard_regs_num;
bool new_pseudos_p, merged_p, mem_dest_p;
@@ -2508,7 +2705,6 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
live_range_t r;
ira_allocno_iterator ai;
ira_copy_iterator ci;
- sparseset allocnos_live;
regno_top_level_allocno_map
= (ira_allocno_t *) ira_allocate (max_reg_num () * sizeof (ira_allocno_t));
@@ -2517,13 +2713,16 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
new_pseudos_p = merged_p = false;
FOR_EACH_ALLOCNO (a, ai)
{
+ ira_allocno_object_iterator oi;
+ ira_object_t obj;
if (ALLOCNO_CAP_MEMBER (a) != NULL)
/* Caps are not in the regno allocno maps and they are never
will be transformed into allocnos existing after IR
flattening. */
continue;
- COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- ALLOCNO_CONFLICT_HARD_REGS (a));
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, oi)
+ COPY_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ OBJECT_CONFLICT_HARD_REGS (obj));
#ifdef STACK_REGS
ALLOCNO_TOTAL_NO_STACK_REG_P (a) = ALLOCNO_NO_STACK_REG_P (a);
#endif
@@ -2603,44 +2802,52 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
ira_rebuild_start_finish_chains ();
if (new_pseudos_p)
{
+ sparseset objects_live;
+
/* Rebuild conflicts. */
FOR_EACH_ALLOCNO (a, ai)
{
+ ira_allocno_object_iterator oi;
+ ira_object_t obj;
if (a != regno_top_level_allocno_map[REGNO (ALLOCNO_REG (a))]
|| ALLOCNO_CAP_MEMBER (a) != NULL)
continue;
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- ira_assert (r->allocno == a);
- clear_allocno_conflicts (a);
+ FOR_EACH_ALLOCNO_OBJECT (a, obj, oi)
+ {
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ ira_assert (r->object == obj);
+ clear_conflicts (obj);
+ }
}
- allocnos_live = sparseset_alloc (ira_allocnos_num);
+ objects_live = sparseset_alloc (ira_objects_num);
for (i = 0; i < ira_max_point; i++)
{
for (r = ira_start_point_ranges[i]; r != NULL; r = r->start_next)
{
- a = r->allocno;
+ ira_object_t obj = r->object;
+ a = OBJECT_ALLOCNO (obj);
if (a != regno_top_level_allocno_map[REGNO (ALLOCNO_REG (a))]
|| ALLOCNO_CAP_MEMBER (a) != NULL)
continue;
- num = ALLOCNO_NUM (a);
+
cover_class = ALLOCNO_COVER_CLASS (a);
- sparseset_set_bit (allocnos_live, num);
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, n)
+ sparseset_set_bit (objects_live, OBJECT_CONFLICT_ID (obj));
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, n)
{
- ira_allocno_t live_a = ira_allocnos[n];
-
- if (ira_reg_classes_intersect_p
- [cover_class][ALLOCNO_COVER_CLASS (live_a)]
+ ira_object_t live_obj = ira_object_id_map[n];
+ ira_allocno_t live_a = OBJECT_ALLOCNO (live_obj);
+ enum reg_class live_cover = ALLOCNO_COVER_CLASS (live_a);
+ if (ira_reg_classes_intersect_p[cover_class][live_cover]
/* Don't set up conflict for the allocno with itself. */
- && num != (int) n)
- ira_add_allocno_conflict (a, live_a);
+ && live_a != a)
+ ira_add_conflict (obj, live_obj);
}
}
for (r = ira_finish_point_ranges[i]; r != NULL; r = r->finish_next)
- sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (r->allocno));
+ sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (r->object));
}
- sparseset_free (allocnos_live);
+ sparseset_free (objects_live);
compress_conflict_vecs ();
}
/* Mark some copies for removing and change allocnos in the rest
@@ -2825,6 +3032,7 @@ ira_build (bool loops_p)
form_loop_tree ();
create_allocnos ();
ira_costs ();
+ create_allocno_objects ();
ira_create_allocno_live_ranges ();
remove_unnecessary_regions (false);
ira_compress_allocno_live_ranges ();
@@ -2840,7 +3048,7 @@ ira_build (bool loops_p)
check_allocno_creation ();
#endif
setup_min_max_allocno_live_range_point ();
- sort_conflict_id_allocno_map ();
+ sort_conflict_id_map ();
setup_min_max_conflict_allocno_ids ();
ira_build_conflicts ();
update_conflict_hard_reg_costs ();
@@ -2860,35 +3068,39 @@ ira_build (bool loops_p)
allocno crossing calls. */
FOR_EACH_ALLOCNO (a, ai)
if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
- {
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
- }
+ ior_hard_reg_conflicts (a, &call_used_reg_set);
}
if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
print_copies (ira_dump_file);
if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
{
- int n, nr;
+ int n, nr, nr_big;
ira_allocno_t a;
live_range_t r;
ira_allocno_iterator ai;
n = 0;
- FOR_EACH_ALLOCNO (a, ai)
- n += ALLOCNO_CONFLICT_ALLOCNOS_NUM (a);
nr = 0;
+ nr_big = 0;
FOR_EACH_ALLOCNO (a, ai)
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- nr++;
+ {
+ int j, nobj = ALLOCNO_NUM_OBJECTS (a);
+ if (nobj > 1)
+ nr_big++;
+ for (j = 0; j < nobj; j++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, j);
+ n += OBJECT_NUM_CONFLICTS (obj);
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ nr++;
+ }
+ }
fprintf (ira_dump_file, " regions=%d, blocks=%d, points=%d\n",
VEC_length (loop_p, ira_loops.larray), n_basic_blocks,
ira_max_point);
fprintf (ira_dump_file,
- " allocnos=%d, copies=%d, conflicts=%d, ranges=%d\n",
- ira_allocnos_num, ira_copies_num, n, nr);
+ " allocnos=%d (big %d), copies=%d, conflicts=%d, ranges=%d\n",
+ ira_allocnos_num, nr_big, ira_copies_num, n, nr);
}
return loops_p;
}
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 4a841d787d9..6aefdd1ae13 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "basic-block.h"
#include "expr.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "reload.h"
#include "params.h"
@@ -93,14 +94,29 @@ static VEC(ira_allocno_t,heap) *removed_splay_allocno_vec;
static bool
allocnos_have_intersected_live_ranges_p (ira_allocno_t a1, ira_allocno_t a2)
{
+ int i, j;
+ int n1 = ALLOCNO_NUM_OBJECTS (a1);
+ int n2 = ALLOCNO_NUM_OBJECTS (a2);
+
if (a1 == a2)
return false;
if (ALLOCNO_REG (a1) != NULL && ALLOCNO_REG (a2) != NULL
&& (ORIGINAL_REGNO (ALLOCNO_REG (a1))
== ORIGINAL_REGNO (ALLOCNO_REG (a2))))
return false;
- return ira_allocno_live_ranges_intersect_p (ALLOCNO_LIVE_RANGES (a1),
- ALLOCNO_LIVE_RANGES (a2));
+
+ for (i = 0; i < n1; i++)
+ {
+ ira_object_t c1 = ALLOCNO_OBJECT (a1, i);
+ for (j = 0; j < n2; j++)
+ {
+ ira_object_t c2 = ALLOCNO_OBJECT (a2, j);
+ if (ira_live_ranges_intersect_p (OBJECT_LIVE_RANGES (c1),
+ OBJECT_LIVE_RANGES (c2)))
+ return true;
+ }
+ }
+ return false;
}
#ifdef ENABLE_IRA_CHECKING
@@ -439,15 +455,13 @@ print_coalesced_allocno (ira_allocno_t allocno)
static bool
assign_hard_reg (ira_allocno_t allocno, bool retry_p)
{
- HARD_REG_SET conflicting_regs;
- int i, j, k, hard_regno, best_hard_regno, class_size;
- int cost, mem_cost, min_cost, full_cost, min_full_cost;
+ HARD_REG_SET conflicting_regs[2];
+ int i, j, hard_regno, nregs, best_hard_regno, class_size;
+ int cost, mem_cost, min_cost, full_cost, min_full_cost, nwords;
int *a_costs;
- int *conflict_costs;
- enum reg_class cover_class, conflict_cover_class;
+ enum reg_class cover_class;
enum machine_mode mode;
- ira_allocno_t a, conflict_allocno;
- ira_allocno_conflict_iterator aci;
+ ira_allocno_t a;
static int costs[FIRST_PSEUDO_REGISTER], full_costs[FIRST_PSEUDO_REGISTER];
#ifndef HONOR_REG_ALLOC_ORDER
enum reg_class rclass;
@@ -457,11 +471,13 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
bool no_stack_reg_p;
#endif
+ nwords = ALLOCNO_NUM_OBJECTS (allocno);
ira_assert (! ALLOCNO_ASSIGNED_P (allocno));
cover_class = ALLOCNO_COVER_CLASS (allocno);
class_size = ira_class_hard_regs_num[cover_class];
mode = ALLOCNO_MODE (allocno);
- CLEAR_HARD_REG_SET (conflicting_regs);
+ for (i = 0; i < nwords; i++)
+ CLEAR_HARD_REG_SET (conflicting_regs[i]);
best_hard_regno = -1;
memset (full_costs, 0, sizeof (int) * class_size);
mem_cost = 0;
@@ -476,9 +492,9 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
{
+ int word;
mem_cost += ALLOCNO_UPDATED_MEMORY_COST (a);
- IOR_HARD_REG_SET (conflicting_regs,
- ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+
ira_allocate_and_copy_costs (&ALLOCNO_UPDATED_HARD_REG_COSTS (a),
cover_class, ALLOCNO_HARD_REG_COSTS (a));
a_costs = ALLOCNO_UPDATED_HARD_REG_COSTS (a);
@@ -497,61 +513,89 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
costs[i] += cost;
full_costs[i] += cost;
}
- /* Take preferences of conflicting allocnos into account. */
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_allocno, aci)
- /* Reload can give another class so we need to check all
- allocnos. */
- if (retry_p || bitmap_bit_p (consideration_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno)))
- {
- conflict_cover_class = ALLOCNO_COVER_CLASS (conflict_allocno);
- ira_assert (ira_reg_classes_intersect_p
- [cover_class][conflict_cover_class]);
- if (allocno_coalesced_p)
- {
- if (bitmap_bit_p (processed_coalesced_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno)))
- continue;
- bitmap_set_bit (processed_coalesced_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno));
- }
- if (ALLOCNO_ASSIGNED_P (conflict_allocno))
- {
- if ((hard_regno = ALLOCNO_HARD_REGNO (conflict_allocno)) >= 0
- && ira_class_hard_reg_index[cover_class][hard_regno] >= 0)
- {
- IOR_HARD_REG_SET
- (conflicting_regs,
- ira_reg_mode_hard_regset
- [hard_regno][ALLOCNO_MODE (conflict_allocno)]);
- if (hard_reg_set_subset_p (reg_class_contents[cover_class],
- conflicting_regs))
- goto fail;
- }
- }
- else if (! ALLOCNO_MAY_BE_SPILLED_P (ALLOCNO_FIRST_COALESCED_ALLOCNO
- (conflict_allocno)))
- {
- ira_allocate_and_copy_costs
- (&ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (conflict_allocno),
- conflict_cover_class,
- ALLOCNO_CONFLICT_HARD_REG_COSTS (conflict_allocno));
- conflict_costs
- = ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (conflict_allocno);
- if (conflict_costs != NULL)
- for (j = class_size - 1; j >= 0; j--)
- {
- hard_regno = ira_class_hard_regs[cover_class][j];
- ira_assert (hard_regno >= 0);
- k = (ira_class_hard_reg_index
- [conflict_cover_class][hard_regno]);
- if (k < 0)
- continue;
- full_costs[j] -= conflict_costs[k];
- }
- queue_update_cost (conflict_allocno, COST_HOP_DIVISOR);
- }
- }
+ for (word = 0; word < nwords; word++)
+ {
+ ira_object_t conflict_obj;
+ ira_object_t obj = ALLOCNO_OBJECT (allocno, word);
+ ira_object_conflict_iterator oci;
+
+ IOR_HARD_REG_SET (conflicting_regs[word],
+ OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
+ /* Take preferences of conflicting allocnos into account. */
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
+ {
+ ira_allocno_t conflict_allocno = OBJECT_ALLOCNO (conflict_obj);
+ enum reg_class conflict_cover_class;
+ /* Reload can give another class so we need to check all
+ allocnos. */
+ if (!retry_p && !bitmap_bit_p (consideration_allocno_bitmap,
+ ALLOCNO_NUM (conflict_allocno)))
+ continue;
+ conflict_cover_class = ALLOCNO_COVER_CLASS (conflict_allocno);
+ ira_assert (ira_reg_classes_intersect_p
+ [cover_class][conflict_cover_class]);
+ if (ALLOCNO_ASSIGNED_P (conflict_allocno))
+ {
+ hard_regno = ALLOCNO_HARD_REGNO (conflict_allocno);
+ if (hard_regno >= 0
+ && ira_class_hard_reg_index[cover_class][hard_regno] >= 0)
+ {
+ enum machine_mode mode = ALLOCNO_MODE (conflict_allocno);
+ int conflict_nregs = hard_regno_nregs[hard_regno][mode];
+ int n_objects = ALLOCNO_NUM_OBJECTS (conflict_allocno);
+ if (conflict_nregs == n_objects && conflict_nregs > 1)
+ {
+ int num = OBJECT_SUBWORD (conflict_obj);
+ if (WORDS_BIG_ENDIAN)
+ SET_HARD_REG_BIT (conflicting_regs[word],
+ hard_regno + n_objects - num - 1);
+ else
+ SET_HARD_REG_BIT (conflicting_regs[word],
+ hard_regno + num);
+ }
+ else
+ IOR_HARD_REG_SET (conflicting_regs[word],
+ ira_reg_mode_hard_regset[hard_regno][mode]);
+ if (hard_reg_set_subset_p (reg_class_contents[cover_class],
+ conflicting_regs[word]))
+ goto fail;
+ }
+ }
+ else if (! ALLOCNO_MAY_BE_SPILLED_P (ALLOCNO_FIRST_COALESCED_ALLOCNO
+ (conflict_allocno)))
+ {
+ int k, *conflict_costs;
+
+ if (allocno_coalesced_p)
+ {
+ if (bitmap_bit_p (processed_coalesced_allocno_bitmap,
+ ALLOCNO_NUM (conflict_allocno)))
+ continue;
+ bitmap_set_bit (processed_coalesced_allocno_bitmap,
+ ALLOCNO_NUM (conflict_allocno));
+ }
+
+ ira_allocate_and_copy_costs
+ (&ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (conflict_allocno),
+ conflict_cover_class,
+ ALLOCNO_CONFLICT_HARD_REG_COSTS (conflict_allocno));
+ conflict_costs
+ = ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (conflict_allocno);
+ if (conflict_costs != NULL)
+ for (j = class_size - 1; j >= 0; j--)
+ {
+ hard_regno = ira_class_hard_regs[cover_class][j];
+ ira_assert (hard_regno >= 0);
+ k = (ira_class_hard_reg_index
+ [conflict_cover_class][hard_regno]);
+ if (k < 0)
+ continue;
+ full_costs[j] -= conflict_costs[k];
+ }
+ queue_update_cost (conflict_allocno, COST_HOP_DIVISOR);
+ }
+ }
+ }
if (a == allocno)
break;
}
@@ -571,6 +615,7 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
}
update_conflict_hard_regno_costs (full_costs, cover_class, false);
min_cost = min_full_cost = INT_MAX;
+
/* We don't care about giving callee saved registers to allocnos no
living through calls because call clobbered registers are
allocated first (it is usual practice to put them first in
@@ -578,14 +623,34 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
for (i = 0; i < class_size; i++)
{
hard_regno = ira_class_hard_regs[cover_class][i];
+ nregs = hard_regno_nregs[hard_regno][ALLOCNO_MODE (allocno)];
#ifdef STACK_REGS
if (no_stack_reg_p
&& FIRST_STACK_REG <= hard_regno && hard_regno <= LAST_STACK_REG)
continue;
#endif
- if (! ira_hard_reg_not_in_set_p (hard_regno, mode, conflicting_regs)
- || TEST_HARD_REG_BIT (prohibited_class_mode_regs[cover_class][mode],
- hard_regno))
+ if (TEST_HARD_REG_BIT (prohibited_class_mode_regs[cover_class][mode],
+ hard_regno))
+ continue;
+ for (j = 0; j < nregs; j++)
+ {
+ int k;
+ int set_to_test_start = 0, set_to_test_end = nwords;
+ if (nregs == nwords)
+ {
+ if (WORDS_BIG_ENDIAN)
+ set_to_test_start = nwords - j - 1;
+ else
+ set_to_test_start = j;
+ set_to_test_end = set_to_test_start + 1;
+ }
+ for (k = set_to_test_start; k < set_to_test_end; k++)
+ if (TEST_HARD_REG_BIT (conflicting_regs[k], hard_regno + j))
+ break;
+ if (k != set_to_test_end)
+ break;
+ }
+ if (j != nregs)
continue;
cost = costs[i];
full_cost = full_costs[i];
@@ -866,10 +931,9 @@ static splay_tree uncolorable_allocnos_splay_tree[N_REG_CLASSES];
static void
push_allocno_to_stack (ira_allocno_t allocno)
{
- int left_conflicts_size, conflict_size, size;
- ira_allocno_t a, conflict_allocno;
+ int size;
+ ira_allocno_t a;
enum reg_class cover_class;
- ira_allocno_conflict_iterator aci;
ALLOCNO_IN_GRAPH_P (allocno) = false;
VEC_safe_push (ira_allocno_t, heap, allocno_stack_vec, allocno);
@@ -877,71 +941,90 @@ push_allocno_to_stack (ira_allocno_t allocno)
if (cover_class == NO_REGS)
return;
size = ira_reg_class_nregs[cover_class][ALLOCNO_MODE (allocno)];
+ if (ALLOCNO_NUM_OBJECTS (allocno) > 1)
+ {
+ /* We will deal with the subwords individually. */
+ gcc_assert (size == ALLOCNO_NUM_OBJECTS (allocno));
+ size = 1;
+ }
if (allocno_coalesced_p)
bitmap_clear (processed_coalesced_allocno_bitmap);
+
for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
{
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_allocno, aci)
+ int i, n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
{
- conflict_allocno = ALLOCNO_FIRST_COALESCED_ALLOCNO (conflict_allocno);
- if (bitmap_bit_p (coloring_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno)))
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ int conflict_size;
+ ira_object_t conflict_obj;
+ ira_object_conflict_iterator oci;
+
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
{
+ ira_allocno_t conflict_allocno = OBJECT_ALLOCNO (conflict_obj);
+ int left_conflicts_size;
+
+ conflict_allocno = ALLOCNO_FIRST_COALESCED_ALLOCNO (conflict_allocno);
+ if (!bitmap_bit_p (coloring_allocno_bitmap,
+ ALLOCNO_NUM (conflict_allocno)))
+ continue;
+
ira_assert (cover_class
== ALLOCNO_COVER_CLASS (conflict_allocno));
if (allocno_coalesced_p)
{
+ conflict_obj = ALLOCNO_OBJECT (conflict_allocno,
+ OBJECT_SUBWORD (conflict_obj));
if (bitmap_bit_p (processed_coalesced_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno)))
+ OBJECT_CONFLICT_ID (conflict_obj)))
continue;
bitmap_set_bit (processed_coalesced_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno));
+ OBJECT_CONFLICT_ID (conflict_obj));
+ }
+
+ if (!ALLOCNO_IN_GRAPH_P (conflict_allocno)
+ || ALLOCNO_ASSIGNED_P (conflict_allocno))
+ continue;
+
+ left_conflicts_size = ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno);
+ conflict_size
+ = (ira_reg_class_nregs
+ [cover_class][ALLOCNO_MODE (conflict_allocno)]);
+ ira_assert (left_conflicts_size >= size);
+ if (left_conflicts_size + conflict_size
+ <= ALLOCNO_AVAILABLE_REGS_NUM (conflict_allocno))
+ {
+ ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno) -= size;
+ continue;
}
- if (ALLOCNO_IN_GRAPH_P (conflict_allocno)
- && ! ALLOCNO_ASSIGNED_P (conflict_allocno))
+ left_conflicts_size -= size;
+ if (uncolorable_allocnos_splay_tree[cover_class] != NULL
+ && !ALLOCNO_SPLAY_REMOVED_P (conflict_allocno)
+ && USE_SPLAY_P (cover_class))
{
- left_conflicts_size
- = ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno);
- conflict_size
- = (ira_reg_class_nregs
- [cover_class][ALLOCNO_MODE (conflict_allocno)]);
ira_assert
- (ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno) >= size);
- if (left_conflicts_size + conflict_size
- <= ALLOCNO_AVAILABLE_REGS_NUM (conflict_allocno))
- {
- ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno) -= size;
- continue;
- }
- left_conflicts_size
- = ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno) - size;
- if (uncolorable_allocnos_splay_tree[cover_class] != NULL
- && !ALLOCNO_SPLAY_REMOVED_P (conflict_allocno)
- && USE_SPLAY_P (cover_class))
- {
- ira_assert
- (splay_tree_lookup
- (uncolorable_allocnos_splay_tree[cover_class],
- (splay_tree_key) conflict_allocno) != NULL);
- splay_tree_remove
- (uncolorable_allocnos_splay_tree[cover_class],
- (splay_tree_key) conflict_allocno);
- ALLOCNO_SPLAY_REMOVED_P (conflict_allocno) = true;
- VEC_safe_push (ira_allocno_t, heap,
- removed_splay_allocno_vec,
- conflict_allocno);
- }
- ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno)
- = left_conflicts_size;
- if (left_conflicts_size + conflict_size
- <= ALLOCNO_AVAILABLE_REGS_NUM (conflict_allocno))
- {
- delete_allocno_from_bucket
- (conflict_allocno, &uncolorable_allocno_bucket);
- add_allocno_to_ordered_bucket
- (conflict_allocno, &colorable_allocno_bucket);
- }
+ (splay_tree_lookup
+ (uncolorable_allocnos_splay_tree[cover_class],
+ (splay_tree_key) conflict_allocno) != NULL);
+ splay_tree_remove
+ (uncolorable_allocnos_splay_tree[cover_class],
+ (splay_tree_key) conflict_allocno);
+ ALLOCNO_SPLAY_REMOVED_P (conflict_allocno) = true;
+ VEC_safe_push (ira_allocno_t, heap,
+ removed_splay_allocno_vec,
+ conflict_allocno);
+ }
+ ALLOCNO_LEFT_CONFLICTS_SIZE (conflict_allocno)
+ = left_conflicts_size;
+ if (left_conflicts_size + conflict_size
+ <= ALLOCNO_AVAILABLE_REGS_NUM (conflict_allocno))
+ {
+ delete_allocno_from_bucket
+ (conflict_allocno, &uncolorable_allocno_bucket);
+ add_allocno_to_ordered_bucket
+ (conflict_allocno, &colorable_allocno_bucket);
}
}
}
@@ -1355,6 +1438,28 @@ pop_allocnos_from_stack (void)
}
}
+/* Loop over all coalesced allocnos of ALLOCNO and their subobjects, collecting
+ total hard register conflicts in PSET (which the caller must initialize). */
+static void
+all_conflicting_hard_regs_coalesced (ira_allocno_t allocno, HARD_REG_SET *pset)
+{
+ ira_allocno_t a;
+
+ for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
+ a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
+ {
+ int i;
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ IOR_HARD_REG_SET (*pset, OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
+ }
+ if (a == allocno)
+ break;
+ }
+}
+
/* Set up number of available hard registers for ALLOCNO. */
static void
setup_allocno_available_regs_num (ira_allocno_t allocno)
@@ -1362,7 +1467,6 @@ setup_allocno_available_regs_num (ira_allocno_t allocno)
int i, n, hard_regs_num, hard_regno;
enum machine_mode mode;
enum reg_class cover_class;
- ira_allocno_t a;
HARD_REG_SET temp_set;
cover_class = ALLOCNO_COVER_CLASS (allocno);
@@ -1372,13 +1476,8 @@ setup_allocno_available_regs_num (ira_allocno_t allocno)
CLEAR_HARD_REG_SET (temp_set);
ira_assert (ALLOCNO_FIRST_COALESCED_ALLOCNO (allocno) == allocno);
hard_regs_num = ira_class_hard_regs_num[cover_class];
- for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
- a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
- {
- IOR_HARD_REG_SET (temp_set, ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
- if (a == allocno)
- break;
- }
+ all_conflicting_hard_regs_coalesced (allocno, &temp_set);
+
mode = ALLOCNO_MODE (allocno);
for (n = 0, i = hard_regs_num - 1; i >= 0; i--)
{
@@ -1399,24 +1498,19 @@ static void
setup_allocno_left_conflicts_size (ira_allocno_t allocno)
{
int i, hard_regs_num, hard_regno, conflict_allocnos_size;
- ira_allocno_t a, conflict_allocno;
+ ira_allocno_t a;
enum reg_class cover_class;
HARD_REG_SET temp_set;
- ira_allocno_conflict_iterator aci;
cover_class = ALLOCNO_COVER_CLASS (allocno);
hard_regs_num = ira_class_hard_regs_num[cover_class];
CLEAR_HARD_REG_SET (temp_set);
ira_assert (ALLOCNO_FIRST_COALESCED_ALLOCNO (allocno) == allocno);
- for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
- a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
- {
- IOR_HARD_REG_SET (temp_set, ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
- if (a == allocno)
- break;
- }
+ all_conflicting_hard_regs_coalesced (allocno, &temp_set);
+
AND_HARD_REG_SET (temp_set, reg_class_contents[cover_class]);
AND_COMPL_HARD_REG_SET (temp_set, ira_no_alloc_regs);
+
conflict_allocnos_size = 0;
if (! hard_reg_set_empty_p (temp_set))
for (i = 0; i < (int) hard_regs_num; i++)
@@ -1437,13 +1531,23 @@ setup_allocno_left_conflicts_size (ira_allocno_t allocno)
for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
{
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_allocno, aci)
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
{
- conflict_allocno
- = ALLOCNO_FIRST_COALESCED_ALLOCNO (conflict_allocno);
- if (bitmap_bit_p (consideration_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno)))
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ ira_object_t conflict_obj;
+ ira_object_conflict_iterator oci;
+
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
{
+ ira_allocno_t conflict_allocno = OBJECT_ALLOCNO (conflict_obj);
+
+ conflict_allocno
+ = ALLOCNO_FIRST_COALESCED_ALLOCNO (conflict_allocno);
+ if (!bitmap_bit_p (consideration_allocno_bitmap,
+ ALLOCNO_NUM (conflict_allocno)))
+ continue;
+
ira_assert (cover_class
== ALLOCNO_COVER_CLASS (conflict_allocno));
if (allocno_coalesced_p)
@@ -1454,6 +1558,7 @@ setup_allocno_left_conflicts_size (ira_allocno_t allocno)
bitmap_set_bit (processed_coalesced_allocno_bitmap,
ALLOCNO_NUM (conflict_allocno));
}
+
if (! ALLOCNO_ASSIGNED_P (conflict_allocno))
conflict_allocnos_size
+= (ira_reg_class_nregs
@@ -1463,7 +1568,7 @@ setup_allocno_left_conflicts_size (ira_allocno_t allocno)
{
int last = (hard_regno
+ hard_regno_nregs
- [hard_regno][ALLOCNO_MODE (conflict_allocno)]);
+ [hard_regno][ALLOCNO_MODE (conflict_allocno)]);
while (hard_regno < last)
{
@@ -1546,9 +1651,9 @@ merge_allocnos (ira_allocno_t a1, ira_allocno_t a2)
ALLOCNO_NEXT_COALESCED_ALLOCNO (last) = next;
}
-/* Return TRUE if there are conflicting allocnos from two sets of
- coalesced allocnos given correspondingly by allocnos A1 and A2. If
- RELOAD_P is TRUE, we use live ranges to find conflicts because
+/* Given two sets of coalesced sets of allocnos, A1 and A2, this
+ function determines if any conflicts exist between the two sets.
+ If RELOAD_P is TRUE, we use live ranges to find conflicts because
conflicts are represented only for allocnos of the same cover class
and during the reload pass we coalesce allocnos for sharing stack
memory slots. */
@@ -1557,15 +1662,19 @@ coalesced_allocno_conflict_p (ira_allocno_t a1, ira_allocno_t a2,
bool reload_p)
{
ira_allocno_t a, conflict_allocno;
- ira_allocno_conflict_iterator aci;
+ /* When testing for conflicts, it is sufficient to examine only the
+ subobjects of order 0, due to the canonicalization of conflicts
+ we do in record_object_conflict. */
+
+ bitmap_clear (processed_coalesced_allocno_bitmap);
if (allocno_coalesced_p)
{
- bitmap_clear (processed_coalesced_allocno_bitmap);
for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a1);;
a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
{
- bitmap_set_bit (processed_coalesced_allocno_bitmap, ALLOCNO_NUM (a));
+ bitmap_set_bit (processed_coalesced_allocno_bitmap,
+ OBJECT_CONFLICT_ID (ALLOCNO_OBJECT (a, 0)));
if (a == a1)
break;
}
@@ -1588,13 +1697,17 @@ coalesced_allocno_conflict_p (ira_allocno_t a1, ira_allocno_t a2,
}
else
{
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_allocno, aci)
- if (conflict_allocno == a1
+ ira_object_t a_obj = ALLOCNO_OBJECT (a, 0);
+ ira_object_t conflict_obj;
+ ira_object_conflict_iterator oci;
+ FOR_EACH_OBJECT_CONFLICT (a_obj, conflict_obj, oci)
+ if (conflict_obj == ALLOCNO_OBJECT (a1, 0)
|| (allocno_coalesced_p
&& bitmap_bit_p (processed_coalesced_allocno_bitmap,
- ALLOCNO_NUM (conflict_allocno))))
+ OBJECT_CONFLICT_ID (conflict_obj))))
return true;
}
+
if (a == a2)
break;
}
@@ -1731,6 +1844,8 @@ setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n)
{
a = consideration_allocnos[i];
length = ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a);
+ if (ALLOCNO_NUM_OBJECTS (a) > 1)
+ length /= ALLOCNO_NUM_OBJECTS (a);
if (length <= 0)
length = 1;
allocno_priorities[ALLOCNO_NUM (a)]
@@ -1940,9 +2055,8 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
EXECUTE_IF_SET_IN_BITMAP (consideration_allocno_bitmap, 0, j, bi)
{
a = ira_allocnos[j];
- if (! ALLOCNO_ASSIGNED_P (a))
- continue;
- bitmap_clear_bit (coloring_allocno_bitmap, ALLOCNO_NUM (a));
+ if (ALLOCNO_ASSIGNED_P (a))
+ bitmap_clear_bit (coloring_allocno_bitmap, ALLOCNO_NUM (a));
}
/* Color all mentioned allocnos including transparent ones. */
color_allocnos ();
@@ -2284,8 +2398,7 @@ void
ira_reassign_conflict_allocnos (int start_regno)
{
int i, allocnos_to_color_num;
- ira_allocno_t a, conflict_a;
- ira_allocno_conflict_iterator aci;
+ ira_allocno_t a;
enum reg_class cover_class;
bitmap allocnos_to_color;
ira_allocno_iterator ai;
@@ -2294,6 +2407,8 @@ ira_reassign_conflict_allocnos (int start_regno)
allocnos_to_color_num = 0;
FOR_EACH_ALLOCNO (a, ai)
{
+ int n = ALLOCNO_NUM_OBJECTS (a);
+
if (! ALLOCNO_ASSIGNED_P (a)
&& ! bitmap_bit_p (allocnos_to_color, ALLOCNO_NUM (a)))
{
@@ -2311,14 +2426,21 @@ ira_reassign_conflict_allocnos (int start_regno)
if (ALLOCNO_REGNO (a) < start_regno
|| (cover_class = ALLOCNO_COVER_CLASS (a)) == NO_REGS)
continue;
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
+ for (i = 0; i < n; i++)
{
- ira_assert (ira_reg_classes_intersect_p
- [cover_class][ALLOCNO_COVER_CLASS (conflict_a)]);
- if (bitmap_bit_p (allocnos_to_color, ALLOCNO_NUM (conflict_a)))
- continue;
- bitmap_set_bit (allocnos_to_color, ALLOCNO_NUM (conflict_a));
- sorted_allocnos[allocnos_to_color_num++] = conflict_a;
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ ira_object_t conflict_obj;
+ ira_object_conflict_iterator oci;
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
+ {
+ ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj);
+ ira_assert (ira_reg_classes_intersect_p
+ [cover_class][ALLOCNO_COVER_CLASS (conflict_a)]);
+ if (bitmap_bit_p (allocnos_to_color, ALLOCNO_NUM (conflict_a)))
+ continue;
+ bitmap_set_bit (allocnos_to_color, ALLOCNO_NUM (conflict_a));
+ sorted_allocnos[allocnos_to_color_num++] = conflict_a;
+ }
}
}
ira_free_bitmap (allocnos_to_color);
@@ -2506,9 +2628,15 @@ slot_coalesced_allocno_live_ranges_intersect_p (ira_allocno_t allocno, int n)
for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
{
- if (ira_allocno_live_ranges_intersect_p
- (slot_coalesced_allocnos_live_ranges[n], ALLOCNO_LIVE_RANGES (a)))
- return true;
+ int i;
+ int nr = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < nr; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ if (ira_live_ranges_intersect_p (slot_coalesced_allocnos_live_ranges[n],
+ OBJECT_LIVE_RANGES (obj)))
+ return true;
+ }
if (a == allocno)
break;
}
@@ -2520,7 +2648,7 @@ slot_coalesced_allocno_live_ranges_intersect_p (ira_allocno_t allocno, int n)
static void
setup_slot_coalesced_allocno_live_ranges (ira_allocno_t allocno)
{
- int n;
+ int i, n;
ira_allocno_t a;
live_range_t r;
@@ -2528,10 +2656,15 @@ setup_slot_coalesced_allocno_live_ranges (ira_allocno_t allocno)
for (a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
a = ALLOCNO_NEXT_COALESCED_ALLOCNO (a))
{
- r = ira_copy_allocno_live_range_list (ALLOCNO_LIVE_RANGES (a));
- slot_coalesced_allocnos_live_ranges[n]
- = ira_merge_allocno_live_ranges
- (slot_coalesced_allocnos_live_ranges[n], r);
+ int nr = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < nr; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ r = ira_copy_live_range_list (OBJECT_LIVE_RANGES (obj));
+ slot_coalesced_allocnos_live_ranges[n]
+ = ira_merge_live_ranges
+ (slot_coalesced_allocnos_live_ranges[n], r);
+ }
if (a == allocno)
break;
}
@@ -2601,8 +2734,7 @@ coalesce_spill_slots (ira_allocno_t *spilled_coalesced_allocnos, int num)
}
}
for (i = 0; i < ira_allocnos_num; i++)
- ira_finish_allocno_live_range_list
- (slot_coalesced_allocnos_live_ranges[i]);
+ ira_finish_live_range_list (slot_coalesced_allocnos_live_ranges[i]);
ira_free (slot_coalesced_allocnos_live_ranges);
return merged_p;
}
@@ -2789,12 +2921,19 @@ allocno_reload_assign (ira_allocno_t a, HARD_REG_SET forbidden_regs)
int hard_regno;
enum reg_class cover_class;
int regno = ALLOCNO_REGNO (a);
- HARD_REG_SET saved;
+ HARD_REG_SET saved[2];
+ int i, n;
- COPY_HARD_REG_SET (saved, ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), forbidden_regs);
- if (! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), call_used_reg_set);
+ n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ COPY_HARD_REG_SET (saved[i], OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), forbidden_regs);
+ if (! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ call_used_reg_set);
+ }
ALLOCNO_ASSIGNED_P (a) = false;
cover_class = ALLOCNO_COVER_CLASS (a);
update_curr_costs (a);
@@ -2833,7 +2972,11 @@ allocno_reload_assign (ira_allocno_t a, HARD_REG_SET forbidden_regs)
}
else if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
fprintf (ira_dump_file, "\n");
- COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), saved);
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ COPY_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), saved[i]);
+ }
return reg_renumber[regno] >= 0;
}
@@ -2868,9 +3011,8 @@ ira_reassign_pseudos (int *spilled_pseudo_regs, int num,
{
int i, n, regno;
bool changed_p;
- ira_allocno_t a, conflict_a;
+ ira_allocno_t a;
HARD_REG_SET forbidden_regs;
- ira_allocno_conflict_iterator aci;
bitmap temp = BITMAP_ALLOC (NULL);
/* Add pseudos which conflict with pseudos already in
@@ -2882,21 +3024,33 @@ ira_reassign_pseudos (int *spilled_pseudo_regs, int num,
for (i = 0, n = num; i < n; i++)
{
+ int nr, j;
int regno = spilled_pseudo_regs[i];
bitmap_set_bit (temp, regno);
a = ira_regno_allocno_map[regno];
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
- if (ALLOCNO_HARD_REGNO (conflict_a) < 0
- && ! ALLOCNO_DONT_REASSIGN_P (conflict_a)
- && ! bitmap_bit_p (temp, ALLOCNO_REGNO (conflict_a)))
- {
- spilled_pseudo_regs[num++] = ALLOCNO_REGNO (conflict_a);
- bitmap_set_bit (temp, ALLOCNO_REGNO (conflict_a));
- /* ?!? This seems wrong. */
- bitmap_set_bit (consideration_allocno_bitmap,
- ALLOCNO_NUM (conflict_a));
- }
+ nr = ALLOCNO_NUM_OBJECTS (a);
+ for (j = 0; j < nr; j++)
+ {
+ ira_object_t conflict_obj;
+ ira_object_t obj = ALLOCNO_OBJECT (a, j);
+ ira_object_conflict_iterator oci;
+
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
+ {
+ ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj);
+ if (ALLOCNO_HARD_REGNO (conflict_a) < 0
+ && ! ALLOCNO_DONT_REASSIGN_P (conflict_a)
+ && ! bitmap_bit_p (temp, ALLOCNO_REGNO (conflict_a)))
+ {
+ spilled_pseudo_regs[num++] = ALLOCNO_REGNO (conflict_a);
+ bitmap_set_bit (temp, ALLOCNO_REGNO (conflict_a));
+ /* ?!? This seems wrong. */
+ bitmap_set_bit (consideration_allocno_bitmap,
+ ALLOCNO_NUM (conflict_a));
+ }
+ }
+ }
}
if (num > 1)
@@ -3107,7 +3261,7 @@ calculate_spill_cost (int *regnos, rtx in, rtx out, rtx insn,
hard_regno = reg_renumber[regno];
ira_assert (hard_regno >= 0);
a = ira_regno_allocno_map[regno];
- length += ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a);
+ length += ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a) / ALLOCNO_NUM_OBJECTS (a);
cost += ALLOCNO_MEMORY_COST (a) - ALLOCNO_COVER_CLASS_COST (a);
nregs = hard_regno_nregs[hard_regno][ALLOCNO_MODE (a)];
for (j = 0; j < nregs; j++)
@@ -3261,11 +3415,20 @@ fast_allocation (void)
allocno_priority_compare_func);
for (i = 0; i < num; i++)
{
+ int nr, l;
+
a = sorted_allocnos[i];
- COPY_HARD_REG_SET (conflict_hard_regs, ALLOCNO_CONFLICT_HARD_REGS (a));
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- for (j = r->start; j <= r->finish; j++)
- IOR_HARD_REG_SET (conflict_hard_regs, used_hard_regs[j]);
+ nr = ALLOCNO_NUM_OBJECTS (a);
+ CLEAR_HARD_REG_SET (conflict_hard_regs);
+ for (l = 0; l < nr; l++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, l);
+ IOR_HARD_REG_SET (conflict_hard_regs,
+ OBJECT_CONFLICT_HARD_REGS (obj));
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ for (j = r->start; j <= r->finish; j++)
+ IOR_HARD_REG_SET (conflict_hard_regs, used_hard_regs[j]);
+ }
cover_class = ALLOCNO_COVER_CLASS (a);
ALLOCNO_ASSIGNED_P (a) = true;
ALLOCNO_HARD_REGNO (a) = -1;
@@ -3290,10 +3453,14 @@ fast_allocation (void)
(prohibited_class_mode_regs[cover_class][mode], hard_regno)))
continue;
ALLOCNO_HARD_REGNO (a) = hard_regno;
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- for (k = r->start; k <= r->finish; k++)
- IOR_HARD_REG_SET (used_hard_regs[k],
- ira_reg_mode_hard_regset[hard_regno][mode]);
+ for (l = 0; l < nr; l++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, l);
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ for (k = r->start; k <= r->finish; k++)
+ IOR_HARD_REG_SET (used_hard_regs[k],
+ ira_reg_mode_hard_regset[hard_regno][mode]);
+ }
break;
}
}
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index 9e9927a9059..0ce1bbc0a8f 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "insn-config.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "params.h"
#include "df.h"
@@ -47,19 +48,47 @@ along with GCC; see the file COPYING3. If not see
allocno's conflict (can't go in the same hardware register).
Some arrays will be used as conflict bit vector of the
- corresponding allocnos see function build_allocno_conflicts. */
+ corresponding allocnos see function build_object_conflicts. */
static IRA_INT_TYPE **conflicts;
-/* Macro to test a conflict of A1 and A2 in `conflicts'. */
-#define CONFLICT_ALLOCNO_P(A1, A2) \
- (ALLOCNO_MIN (A1) <= ALLOCNO_CONFLICT_ID (A2) \
- && ALLOCNO_CONFLICT_ID (A2) <= ALLOCNO_MAX (A1) \
- && TEST_MINMAX_SET_BIT (conflicts[ALLOCNO_NUM (A1)], \
- ALLOCNO_CONFLICT_ID (A2), \
- ALLOCNO_MIN (A1), \
- ALLOCNO_MAX (A1)))
+/* Macro to test a conflict of C1 and C2 in `conflicts'. */
+#define OBJECTS_CONFLICT_P(C1, C2) \
+ (OBJECT_MIN (C1) <= OBJECT_CONFLICT_ID (C2) \
+ && OBJECT_CONFLICT_ID (C2) <= OBJECT_MAX (C1) \
+ && TEST_MINMAX_SET_BIT (conflicts[OBJECT_CONFLICT_ID (C1)], \
+ OBJECT_CONFLICT_ID (C2), \
+ OBJECT_MIN (C1), OBJECT_MAX (C1)))
+/* Record a conflict between objects OBJ1 and OBJ2. If necessary,
+ canonicalize the conflict by recording it for lower-order subobjects
+ of the corresponding allocnos. */
+static void
+record_object_conflict (ira_object_t obj1, ira_object_t obj2)
+{
+ ira_allocno_t a1 = OBJECT_ALLOCNO (obj1);
+ ira_allocno_t a2 = OBJECT_ALLOCNO (obj2);
+ int w1 = OBJECT_SUBWORD (obj1);
+ int w2 = OBJECT_SUBWORD (obj2);
+ int id1, id2;
+
+ /* Canonicalize the conflict. If two identically-numbered words
+ conflict, always record this as a conflict between words 0. That
+ is the only information we need, and it is easier to test for if
+ it is collected in each allocno's lowest-order object. */
+ if (w1 == w2 && w1 > 0)
+ {
+ obj1 = ALLOCNO_OBJECT (a1, 0);
+ obj2 = ALLOCNO_OBJECT (a2, 0);
+ }
+ id1 = OBJECT_CONFLICT_ID (obj1);
+ id2 = OBJECT_CONFLICT_ID (obj2);
+
+ SET_MINMAX_SET_BIT (conflicts[id1], id2, OBJECT_MIN (obj1),
+ OBJECT_MAX (obj1));
+ SET_MINMAX_SET_BIT (conflicts[id2], id1, OBJECT_MIN (obj2),
+ OBJECT_MAX (obj2));
+}
/* Build allocno conflict table by processing allocno live ranges.
Return true if the table was built. The table is not built if it
@@ -67,100 +96,118 @@ static IRA_INT_TYPE **conflicts;
static bool
build_conflict_bit_table (void)
{
- int i, num, id, allocated_words_num, conflict_bit_vec_words_num;
+ int i;
unsigned int j;
enum reg_class cover_class;
- ira_allocno_t allocno, live_a;
+ int object_set_words, allocated_words_num, conflict_bit_vec_words_num;
live_range_t r;
+ ira_allocno_t allocno;
ira_allocno_iterator ai;
- sparseset allocnos_live;
- int allocno_set_words;
+ sparseset objects_live;
+ ira_object_t obj;
+ ira_allocno_object_iterator aoi;
- allocno_set_words = (ira_allocnos_num + IRA_INT_BITS - 1) / IRA_INT_BITS;
allocated_words_num = 0;
FOR_EACH_ALLOCNO (allocno, ai)
- {
- if (ALLOCNO_MAX (allocno) < ALLOCNO_MIN (allocno))
+ FOR_EACH_ALLOCNO_OBJECT (allocno, obj, aoi)
+ {
+ if (OBJECT_MAX (obj) < OBJECT_MIN (obj))
continue;
- conflict_bit_vec_words_num
- = ((ALLOCNO_MAX (allocno) - ALLOCNO_MIN (allocno) + IRA_INT_BITS)
- / IRA_INT_BITS);
- allocated_words_num += conflict_bit_vec_words_num;
- if ((unsigned long long) allocated_words_num * sizeof (IRA_INT_TYPE)
- > (unsigned long long) IRA_MAX_CONFLICT_TABLE_SIZE * 1024 * 1024)
- {
- if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
- fprintf
- (ira_dump_file,
- "+++Conflict table will be too big(>%dMB) -- don't use it\n",
- IRA_MAX_CONFLICT_TABLE_SIZE);
- return false;
- }
- }
- allocnos_live = sparseset_alloc (ira_allocnos_num);
+ conflict_bit_vec_words_num
+ = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
+ / IRA_INT_BITS);
+ allocated_words_num += conflict_bit_vec_words_num;
+ if ((unsigned long long) allocated_words_num * sizeof (IRA_INT_TYPE)
+ > (unsigned long long) IRA_MAX_CONFLICT_TABLE_SIZE * 1024 * 1024)
+ {
+ if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
+ fprintf
+ (ira_dump_file,
+ "+++Conflict table will be too big(>%dMB) -- don't use it\n",
+ IRA_MAX_CONFLICT_TABLE_SIZE);
+ return false;
+ }
+ }
+
conflicts = (IRA_INT_TYPE **) ira_allocate (sizeof (IRA_INT_TYPE *)
- * ira_allocnos_num);
+ * ira_objects_num);
allocated_words_num = 0;
FOR_EACH_ALLOCNO (allocno, ai)
- {
- num = ALLOCNO_NUM (allocno);
- if (ALLOCNO_MAX (allocno) < ALLOCNO_MIN (allocno))
- {
- conflicts[num] = NULL;
- continue;
- }
- conflict_bit_vec_words_num
- = ((ALLOCNO_MAX (allocno) - ALLOCNO_MIN (allocno) + IRA_INT_BITS)
- / IRA_INT_BITS);
- allocated_words_num += conflict_bit_vec_words_num;
- conflicts[num]
- = (IRA_INT_TYPE *) ira_allocate (sizeof (IRA_INT_TYPE)
- * conflict_bit_vec_words_num);
- memset (conflicts[num], 0,
- sizeof (IRA_INT_TYPE) * conflict_bit_vec_words_num);
- }
+ FOR_EACH_ALLOCNO_OBJECT (allocno, obj, aoi)
+ {
+ int id = OBJECT_CONFLICT_ID (obj);
+ if (OBJECT_MAX (obj) < OBJECT_MIN (obj))
+ {
+ conflicts[id] = NULL;
+ continue;
+ }
+ conflict_bit_vec_words_num
+ = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
+ / IRA_INT_BITS);
+ allocated_words_num += conflict_bit_vec_words_num;
+ conflicts[id]
+ = (IRA_INT_TYPE *) ira_allocate (sizeof (IRA_INT_TYPE)
+ * conflict_bit_vec_words_num);
+ memset (conflicts[id], 0,
+ sizeof (IRA_INT_TYPE) * conflict_bit_vec_words_num);
+ }
+
+ object_set_words = (ira_objects_num + IRA_INT_BITS - 1) / IRA_INT_BITS;
if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
fprintf
(ira_dump_file,
"+++Allocating %ld bytes for conflict table (uncompressed size %ld)\n",
(long) allocated_words_num * sizeof (IRA_INT_TYPE),
- (long) allocno_set_words * ira_allocnos_num * sizeof (IRA_INT_TYPE));
+ (long) object_set_words * ira_objects_num * sizeof (IRA_INT_TYPE));
+
+ objects_live = sparseset_alloc (ira_objects_num);
for (i = 0; i < ira_max_point; i++)
{
for (r = ira_start_point_ranges[i]; r != NULL; r = r->start_next)
{
- allocno = r->allocno;
- num = ALLOCNO_NUM (allocno);
- id = ALLOCNO_CONFLICT_ID (allocno);
+ ira_object_t obj = r->object;
+ ira_allocno_t allocno = OBJECT_ALLOCNO (obj);
+ int id = OBJECT_CONFLICT_ID (obj);
+
+ gcc_assert (id < ira_objects_num);
+
cover_class = ALLOCNO_COVER_CLASS (allocno);
- sparseset_set_bit (allocnos_live, num);
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, j)
+ sparseset_set_bit (objects_live, id);
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, j)
{
- live_a = ira_allocnos[j];
- if (ira_reg_classes_intersect_p
- [cover_class][ALLOCNO_COVER_CLASS (live_a)]
+ ira_object_t live_obj = ira_object_id_map[j];
+ ira_allocno_t live_a = OBJECT_ALLOCNO (live_obj);
+ enum reg_class live_cover_class = ALLOCNO_COVER_CLASS (live_a);
+
+ if (ira_reg_classes_intersect_p[cover_class][live_cover_class]
/* Don't set up conflict for the allocno with itself. */
- && num != (int) j)
+ && live_a != allocno)
{
- SET_MINMAX_SET_BIT (conflicts[num],
- ALLOCNO_CONFLICT_ID (live_a),
- ALLOCNO_MIN (allocno),
- ALLOCNO_MAX (allocno));
- SET_MINMAX_SET_BIT (conflicts[j], id,
- ALLOCNO_MIN (live_a),
- ALLOCNO_MAX (live_a));
+ record_object_conflict (obj, live_obj);
}
}
}
for (r = ira_finish_point_ranges[i]; r != NULL; r = r->finish_next)
- sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (r->allocno));
+ sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (r->object));
}
- sparseset_free (allocnos_live);
+ sparseset_free (objects_live);
return true;
}
-
+/* Return true iff allocnos A1 and A2 cannot be allocated to the same
+ register due to conflicts. */
+
+static bool
+allocnos_conflict_for_copy_p (ira_allocno_t a1, ira_allocno_t a2)
+{
+ /* Due to the fact that we canonicalize conflicts (see
+ record_object_conflict), we only need to test for conflicts of
+ the lowest order words. */
+ ira_object_t obj1 = ALLOCNO_OBJECT (a1, 0);
+ ira_object_t obj2 = ALLOCNO_OBJECT (a2, 0);
+ return OBJECTS_CONFLICT_P (obj1, obj2);
+}
/* Return TRUE if the operand constraint STR is commutative. */
static bool
@@ -365,19 +412,21 @@ process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p,
allocno_preferenced_hard_regno = REGNO (reg2) + offset2 - offset1;
a = ira_curr_regno_allocno_map[REGNO (reg1)];
}
- else if (!CONFLICT_ALLOCNO_P (ira_curr_regno_allocno_map[REGNO (reg1)],
- ira_curr_regno_allocno_map[REGNO (reg2)])
- && offset1 == offset2)
+ else
{
- cp = ira_add_allocno_copy (ira_curr_regno_allocno_map[REGNO (reg1)],
- ira_curr_regno_allocno_map[REGNO (reg2)],
- freq, constraint_p, insn,
- ira_curr_loop_tree_node);
- bitmap_set_bit (ira_curr_loop_tree_node->local_copies, cp->num);
- return true;
+ ira_allocno_t a1 = ira_curr_regno_allocno_map[REGNO (reg1)];
+ ira_allocno_t a2 = ira_curr_regno_allocno_map[REGNO (reg2)];
+ if (!allocnos_conflict_for_copy_p (a1, a2) && offset1 == offset2)
+ {
+ cp = ira_add_allocno_copy (a1, a2, freq, constraint_p, insn,
+ ira_curr_loop_tree_node);
+ bitmap_set_bit (ira_curr_loop_tree_node->local_copies, cp->num);
+ return true;
+ }
+ else
+ return false;
}
- else
- return false;
+
if (! IN_RANGE (allocno_preferenced_hard_regno, 0, FIRST_PSEUDO_REGISTER - 1))
/* Can not be tied. */
return false;
@@ -447,7 +496,7 @@ add_insn_allocno_copies (rtx insn)
const char *str;
bool commut_p, bound_p[MAX_RECOG_OPERANDS];
int i, j, n, freq;
-
+
freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
if (freq == 0)
freq = 1;
@@ -540,79 +589,91 @@ propagate_copies (void)
parent_a1 = ira_parent_or_cap_allocno (a1);
parent_a2 = ira_parent_or_cap_allocno (a2);
ira_assert (parent_a1 != NULL && parent_a2 != NULL);
- if (! CONFLICT_ALLOCNO_P (parent_a1, parent_a2))
+ if (! allocnos_conflict_for_copy_p (parent_a1, parent_a2))
ira_add_allocno_copy (parent_a1, parent_a2, cp->freq,
cp->constraint_p, cp->insn, cp->loop_tree_node);
}
}
/* Array used to collect all conflict allocnos for given allocno. */
-static ira_allocno_t *collected_conflict_allocnos;
+static ira_object_t *collected_conflict_objects;
/* Build conflict vectors or bit conflict vectors (whatever is more
- profitable) for allocno A from the conflict table and propagate the
- conflicts to upper level allocno. */
+ profitable) for object OBJ from the conflict table. */
static void
-build_allocno_conflicts (ira_allocno_t a)
+build_object_conflicts (ira_object_t obj)
{
int i, px, parent_num;
- int conflict_bit_vec_words_num;
- ira_allocno_t parent_a, another_a, another_parent_a;
- ira_allocno_t *vec;
- IRA_INT_TYPE *allocno_conflicts;
+ ira_allocno_t parent_a, another_parent_a;
+ ira_object_t parent_obj;
+ ira_allocno_t a = OBJECT_ALLOCNO (obj);
+ IRA_INT_TYPE *object_conflicts;
minmax_set_iterator asi;
- allocno_conflicts = conflicts[ALLOCNO_NUM (a)];
+ object_conflicts = conflicts[OBJECT_CONFLICT_ID (obj)];
px = 0;
- FOR_EACH_BIT_IN_MINMAX_SET (allocno_conflicts,
- ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
+ FOR_EACH_BIT_IN_MINMAX_SET (object_conflicts,
+ OBJECT_MIN (obj), OBJECT_MAX (obj), i, asi)
{
- another_a = ira_conflict_id_allocno_map[i];
+ ira_object_t another_obj = ira_object_id_map[i];
+ ira_allocno_t another_a = OBJECT_ALLOCNO (obj);
ira_assert (ira_reg_classes_intersect_p
[ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]);
- collected_conflict_allocnos[px++] = another_a;
+ collected_conflict_objects[px++] = another_obj;
}
- if (ira_conflict_vector_profitable_p (a, px))
+ if (ira_conflict_vector_profitable_p (obj, px))
{
- ira_allocate_allocno_conflict_vec (a, px);
- vec = (ira_allocno_t*) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a);
- memcpy (vec, collected_conflict_allocnos, sizeof (ira_allocno_t) * px);
+ ira_object_t *vec;
+ ira_allocate_conflict_vec (obj, px);
+ vec = OBJECT_CONFLICT_VEC (obj);
+ memcpy (vec, collected_conflict_objects, sizeof (ira_object_t) * px);
vec[px] = NULL;
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = px;
+ OBJECT_NUM_CONFLICTS (obj) = px;
}
else
{
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = conflicts[ALLOCNO_NUM (a)];
- if (ALLOCNO_MAX (a) < ALLOCNO_MIN (a))
+ int conflict_bit_vec_words_num;
+ OBJECT_CONFLICT_ARRAY (obj) = object_conflicts;
+ if (OBJECT_MAX (obj) < OBJECT_MIN (obj))
conflict_bit_vec_words_num = 0;
else
conflict_bit_vec_words_num
- = ((ALLOCNO_MAX (a) - ALLOCNO_MIN (a) + IRA_INT_BITS)
+ = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
/ IRA_INT_BITS);
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a)
+ OBJECT_CONFLICT_ARRAY_SIZE (obj)
= conflict_bit_vec_words_num * sizeof (IRA_INT_TYPE);
}
+
parent_a = ira_parent_or_cap_allocno (a);
if (parent_a == NULL)
return;
ira_assert (ALLOCNO_COVER_CLASS (a) == ALLOCNO_COVER_CLASS (parent_a));
- parent_num = ALLOCNO_NUM (parent_a);
- FOR_EACH_BIT_IN_MINMAX_SET (allocno_conflicts,
- ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
+ ira_assert (ALLOCNO_NUM_OBJECTS (a) == ALLOCNO_NUM_OBJECTS (parent_a));
+ parent_obj = ALLOCNO_OBJECT (parent_a, OBJECT_SUBWORD (obj));
+ parent_num = OBJECT_CONFLICT_ID (parent_obj);
+ FOR_EACH_BIT_IN_MINMAX_SET (object_conflicts,
+ OBJECT_MIN (obj), OBJECT_MAX (obj), i, asi)
{
- another_a = ira_conflict_id_allocno_map[i];
+ ira_object_t another_obj = ira_object_id_map[i];
+ ira_allocno_t another_a = OBJECT_ALLOCNO (another_obj);
+ int another_word = OBJECT_SUBWORD (another_obj);
+
ira_assert (ira_reg_classes_intersect_p
[ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]);
+
another_parent_a = ira_parent_or_cap_allocno (another_a);
if (another_parent_a == NULL)
continue;
ira_assert (ALLOCNO_NUM (another_parent_a) >= 0);
ira_assert (ALLOCNO_COVER_CLASS (another_a)
== ALLOCNO_COVER_CLASS (another_parent_a));
+ ira_assert (ALLOCNO_NUM_OBJECTS (another_a)
+ == ALLOCNO_NUM_OBJECTS (another_parent_a));
SET_MINMAX_SET_BIT (conflicts[parent_num],
- ALLOCNO_CONFLICT_ID (another_parent_a),
- ALLOCNO_MIN (parent_a),
- ALLOCNO_MAX (parent_a));
+ OBJECT_CONFLICT_ID (ALLOCNO_OBJECT (another_parent_a,
+ another_word)),
+ OBJECT_MIN (parent_obj),
+ OBJECT_MAX (parent_obj));
}
}
@@ -624,19 +685,28 @@ build_conflicts (void)
int i;
ira_allocno_t a, cap;
- collected_conflict_allocnos
- = (ira_allocno_t *) ira_allocate (sizeof (ira_allocno_t)
- * ira_allocnos_num);
+ collected_conflict_objects
+ = (ira_object_t *) ira_allocate (sizeof (ira_object_t)
+ * ira_objects_num);
for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
for (a = ira_regno_allocno_map[i];
a != NULL;
a = ALLOCNO_NEXT_REGNO_ALLOCNO (a))
{
- build_allocno_conflicts (a);
- for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap))
- build_allocno_conflicts (cap);
+ int j, nregs = ALLOCNO_NUM_OBJECTS (a);
+ for (j = 0; j < nregs; j++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, j);
+ build_object_conflicts (obj);
+ for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap))
+ {
+ ira_object_t cap_obj = ALLOCNO_OBJECT (cap, j);
+ gcc_assert (ALLOCNO_NUM_OBJECTS (cap) == ALLOCNO_NUM_OBJECTS (a));
+ build_object_conflicts (cap_obj);
+ }
+ }
}
- ira_free (collected_conflict_allocnos);
+ ira_free (collected_conflict_objects);
}
@@ -674,9 +744,8 @@ static void
print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
{
HARD_REG_SET conflicting_hard_regs;
- ira_allocno_t conflict_a;
- ira_allocno_conflict_iterator aci;
basic_block bb;
+ int n, i;
if (reg_p)
fprintf (file, ";; r%d", ALLOCNO_REGNO (a));
@@ -689,38 +758,54 @@ print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
fprintf (file, "l%d", ALLOCNO_LOOP_TREE_NODE (a)->loop->num);
putc (')', file);
}
+
fputs (" conflicts:", file);
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) != NULL)
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
- {
- if (reg_p)
- fprintf (file, " r%d,", ALLOCNO_REGNO (conflict_a));
- else
- {
- fprintf (file, " a%d(r%d,", ALLOCNO_NUM (conflict_a),
- ALLOCNO_REGNO (conflict_a));
- if ((bb = ALLOCNO_LOOP_TREE_NODE (conflict_a)->bb) != NULL)
- fprintf (file, "b%d)", bb->index);
- else
- fprintf (file, "l%d)",
- ALLOCNO_LOOP_TREE_NODE (conflict_a)->loop->num);
- }
- }
- COPY_HARD_REG_SET (conflicting_hard_regs,
- ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
- AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs);
- AND_HARD_REG_SET (conflicting_hard_regs,
- reg_class_contents[ALLOCNO_COVER_CLASS (a)]);
- print_hard_reg_set (file, "\n;; total conflict hard regs:",
- conflicting_hard_regs);
- COPY_HARD_REG_SET (conflicting_hard_regs,
- ALLOCNO_CONFLICT_HARD_REGS (a));
- AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs);
- AND_HARD_REG_SET (conflicting_hard_regs,
- reg_class_contents[ALLOCNO_COVER_CLASS (a)]);
- print_hard_reg_set (file, ";; conflict hard regs:",
- conflicting_hard_regs);
- putc ('\n', file);
+ n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ ira_object_t conflict_obj;
+ ira_object_conflict_iterator oci;
+
+ if (OBJECT_CONFLICT_ARRAY (obj) == NULL)
+ continue;
+ if (n > 1)
+ fprintf (file, "\n;; subobject %d:", i);
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
+ {
+ ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj);
+ if (reg_p)
+ fprintf (file, " r%d,", ALLOCNO_REGNO (conflict_a));
+ else
+ {
+ fprintf (file, " a%d(r%d", ALLOCNO_NUM (conflict_a),
+ ALLOCNO_REGNO (conflict_a));
+ if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1)
+ fprintf (file, ",w%d", OBJECT_SUBWORD (conflict_obj));
+ if ((bb = ALLOCNO_LOOP_TREE_NODE (conflict_a)->bb) != NULL)
+ fprintf (file, ",b%d", bb->index);
+ else
+ fprintf (file, ",l%d",
+ ALLOCNO_LOOP_TREE_NODE (conflict_a)->loop->num);
+ putc (')', file);
+ }
+ }
+ COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
+ AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs);
+ AND_HARD_REG_SET (conflicting_hard_regs,
+ reg_class_contents[ALLOCNO_COVER_CLASS (a)]);
+ print_hard_reg_set (file, "\n;; total conflict hard regs:",
+ conflicting_hard_regs);
+
+ COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_CONFLICT_HARD_REGS (obj));
+ AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs);
+ AND_HARD_REG_SET (conflicting_hard_regs,
+ reg_class_contents[ALLOCNO_COVER_CLASS (a)]);
+ print_hard_reg_set (file, ";; conflict hard regs:",
+ conflicting_hard_regs);
+ putc ('\n', file);
+ }
+
}
/* Print information about allocno or only regno (if REG_P) conflicts
@@ -759,19 +844,22 @@ ira_build_conflicts (void)
ira_conflicts_p = build_conflict_bit_table ();
if (ira_conflicts_p)
{
+ ira_object_t obj;
+ ira_object_iterator oi;
+
build_conflicts ();
ira_traverse_loop_tree (true, ira_loop_tree_root, NULL, add_copies);
/* We need finished conflict table for the subsequent call. */
if (flag_ira_region == IRA_REGION_ALL
|| flag_ira_region == IRA_REGION_MIXED)
propagate_copies ();
+
/* Now we can free memory for the conflict table (see function
- build_allocno_conflicts for details). */
- FOR_EACH_ALLOCNO (a, ai)
+ build_object_conflicts for details). */
+ FOR_EACH_OBJECT (obj, oi)
{
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a)
- != conflicts[ALLOCNO_NUM (a)])
- ira_free (conflicts[ALLOCNO_NUM (a)]);
+ if (OBJECT_CONFLICT_ARRAY (obj) != conflicts[OBJECT_CONFLICT_ID (obj)])
+ ira_free (conflicts[OBJECT_CONFLICT_ID (obj)]);
}
ira_free (conflicts);
}
@@ -787,33 +875,38 @@ ira_build_conflicts (void)
}
FOR_EACH_ALLOCNO (a, ai)
{
- reg_attrs *attrs;
- tree decl;
-
- if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
- /* For debugging purposes don't put user defined variables in
- callee-clobbered registers. */
- || (optimize == 0
- && (attrs = REG_ATTRS (regno_reg_rtx [ALLOCNO_REGNO (a)])) != NULL
- && (decl = attrs->decl) != NULL
- && VAR_OR_FUNCTION_DECL_P (decl)
- && ! DECL_ARTIFICIAL (decl)))
- {
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
- }
- else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
+ int i, n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
{
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- no_caller_save_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- temp_hard_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- no_caller_save_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- temp_hard_reg_set);
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ reg_attrs *attrs = REG_ATTRS (regno_reg_rtx [ALLOCNO_REGNO (a)]);
+ tree decl;
+
+ if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
+ /* For debugging purposes don't put user defined variables in
+ callee-clobbered registers. */
+ || (optimize == 0
+ && attrs != NULL
+ && (decl = attrs->decl) != NULL
+ && VAR_OR_FUNCTION_DECL_P (decl)
+ && ! DECL_ARTIFICIAL (decl)))
+ {
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ call_used_reg_set);
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
+ call_used_reg_set);
+ }
+ else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
+ {
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ no_caller_save_reg_set);
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ temp_hard_reg_set);
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
+ no_caller_save_reg_set);
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
+ temp_hard_reg_set);
+ }
}
}
if (optimize && ira_conflicts_p
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index da26ad3d8c9..24e8393dd0b 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "insn-config.h"
#include "recog.h"
#include "reload.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "target.h"
#include "params.h"
@@ -67,20 +68,18 @@ struct costs
int cost[1];
};
-/* Initialized once. It is a maximal possible size of the allocated
- struct costs. */
-static int max_struct_costs_size;
-
-/* Allocated and initialized once, and used to initialize cost values
- for each insn. */
-static struct costs *init_cost;
-
-/* Allocated once, and used for temporary purposes. */
-static struct costs *temp_costs;
-
-/* Allocated once, and used for the cost calculation. */
-static struct costs *op_costs[MAX_RECOG_OPERANDS];
-static struct costs *this_op_costs[MAX_RECOG_OPERANDS];
+#define max_struct_costs_size \
+ (this_target_ira_int->x_max_struct_costs_size)
+#define init_cost \
+ (this_target_ira_int->x_init_cost)
+#define temp_costs \
+ (this_target_ira_int->x_temp_costs)
+#define op_costs \
+ (this_target_ira_int->x_op_costs)
+#define this_op_costs \
+ (this_target_ira_int->x_this_op_costs)
+#define cost_classes \
+ (this_target_ira_int->x_cost_classes)
/* Costs of each class for each allocno or pseudo. */
static struct costs *costs;
@@ -88,11 +87,6 @@ static struct costs *costs;
/* Accumulated costs of each class for each allocno. */
static struct costs *total_allocno_costs;
-/* Classes used for cost calculation. They may be different on
- different iterations of the cost calculations or in different
- optimization modes. */
-static enum reg_class *cost_classes;
-
/* The size of the previous array. */
static int cost_classes_num;
@@ -209,8 +203,7 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class rclass, bool to_p,
static void
record_reg_classes (int n_alts, int n_ops, rtx *ops,
enum machine_mode *modes, const char **constraints,
- rtx insn, struct costs **op_costs,
- enum reg_class *pref)
+ rtx insn, enum reg_class *pref)
{
int alt;
int i, j, k;
@@ -944,7 +937,7 @@ record_address_regs (enum machine_mode mode, rtx x, int context,
/* Calculate the costs of insn operands. */
static void
-record_operand_costs (rtx insn, struct costs **op_costs, enum reg_class *pref)
+record_operand_costs (rtx insn, enum reg_class *pref)
{
const char *constraints[MAX_RECOG_OPERANDS];
enum machine_mode modes[MAX_RECOG_OPERANDS];
@@ -997,11 +990,11 @@ record_operand_costs (rtx insn, struct costs **op_costs, enum reg_class *pref)
xconstraints[i+1] = constraints[i];
record_reg_classes (recog_data.n_alternatives, recog_data.n_operands,
recog_data.operand, modes,
- xconstraints, insn, op_costs, pref);
+ xconstraints, insn, pref);
}
record_reg_classes (recog_data.n_alternatives, recog_data.n_operands,
recog_data.operand, modes,
- constraints, insn, op_costs, pref);
+ constraints, insn, pref);
}
@@ -1046,7 +1039,7 @@ scan_one_insn (rtx insn)
0, MEM, SCRATCH, frequency * 2);
}
- record_operand_costs (insn, op_costs, pref);
+ record_operand_costs (insn, pref);
/* Now add the cost for each operand to the total costs for its
allocno. */
diff --git a/gcc/ira-emit.c b/gcc/ira-emit.c
index 705a306654c..c75974b4bc6 100644
--- a/gcc/ira-emit.c
+++ b/gcc/ira-emit.c
@@ -646,7 +646,7 @@ static move_t
modify_move_list (move_t list)
{
int i, n, nregs, hard_regno;
- ira_allocno_t to, from, new_allocno;
+ ira_allocno_t to, from;
move_t move, new_move, set_move, first, last;
if (list == NULL)
@@ -715,6 +715,9 @@ modify_move_list (move_t list)
&& ALLOCNO_HARD_REGNO
(hard_regno_last_set[hard_regno + i]->to) >= 0)
{
+ int n, j;
+ ira_allocno_t new_allocno;
+
set_move = hard_regno_last_set[hard_regno + i];
/* It does not matter what loop_tree_node (of TO or
FROM) to use for the new allocno because of
@@ -726,16 +729,25 @@ modify_move_list (move_t list)
ALLOCNO_MODE (new_allocno) = ALLOCNO_MODE (set_move->to);
ira_set_allocno_cover_class
(new_allocno, ALLOCNO_COVER_CLASS (set_move->to));
+ ira_create_allocno_objects (new_allocno);
ALLOCNO_ASSIGNED_P (new_allocno) = true;
ALLOCNO_HARD_REGNO (new_allocno) = -1;
ALLOCNO_REG (new_allocno)
= create_new_reg (ALLOCNO_REG (set_move->to));
- ALLOCNO_CONFLICT_ID (new_allocno) = ALLOCNO_NUM (new_allocno);
+
/* Make it possibly conflicting with all earlier
created allocnos. Cases where temporary allocnos
created to remove the cycles are quite rare. */
- ALLOCNO_MIN (new_allocno) = 0;
- ALLOCNO_MAX (new_allocno) = ira_allocnos_num - 1;
+ n = ALLOCNO_NUM_OBJECTS (new_allocno);
+ gcc_assert (n == ALLOCNO_NUM_OBJECTS (set_move->to));
+ for (j = 0; j < n; j++)
+ {
+ ira_object_t new_obj = ALLOCNO_OBJECT (new_allocno, j);
+
+ OBJECT_MIN (new_obj) = 0;
+ OBJECT_MAX (new_obj) = ira_objects_num - 1;
+ }
+
new_move = create_move (set_move->to, new_allocno);
set_move->to = new_allocno;
VEC_safe_push (move_t, heap, move_vec, new_move);
@@ -911,7 +923,7 @@ add_range_and_copies_from_move_list (move_t list, ira_loop_tree_node_t node,
int start, n;
unsigned int regno;
move_t move;
- ira_allocno_t to, from, a;
+ ira_allocno_t a;
ira_copy_t cp;
live_range_t r;
bitmap_iterator bi;
@@ -929,22 +941,28 @@ add_range_and_copies_from_move_list (move_t list, ira_loop_tree_node_t node,
start = ira_max_point;
for (move = list; move != NULL; move = move->next)
{
- from = move->from;
- to = move->to;
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (to) == NULL)
- {
- if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
- fprintf (ira_dump_file, " Allocate conflicts for a%dr%d\n",
- ALLOCNO_NUM (to), REGNO (ALLOCNO_REG (to)));
- ira_allocate_allocno_conflicts (to, n);
- }
+ ira_allocno_t from = move->from;
+ ira_allocno_t to = move->to;
+ int nr, i;
+
bitmap_clear_bit (live_through, ALLOCNO_REGNO (from));
bitmap_clear_bit (live_through, ALLOCNO_REGNO (to));
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (from), hard_regs_live);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (to), hard_regs_live);
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (from),
- hard_regs_live);
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (to), hard_regs_live);
+
+ nr = ALLOCNO_NUM_OBJECTS (to);
+ for (i = 0; i < nr; i++)
+ {
+ ira_object_t to_obj = ALLOCNO_OBJECT (to, i);
+ if (OBJECT_CONFLICT_ARRAY (to_obj) == NULL)
+ {
+ if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
+ fprintf (ira_dump_file, " Allocate conflicts for a%dr%d\n",
+ ALLOCNO_NUM (to), REGNO (ALLOCNO_REG (to)));
+ ira_allocate_object_conflicts (to_obj, n);
+ }
+ }
+ ior_hard_reg_conflicts (from, &hard_regs_live);
+ ior_hard_reg_conflicts (to, &hard_regs_live);
+
update_costs (from, true, freq);
update_costs (to, false, freq);
cp = ira_add_allocno_copy (from, to, freq, false, move->insn, NULL);
@@ -953,53 +971,73 @@ add_range_and_copies_from_move_list (move_t list, ira_loop_tree_node_t node,
cp->num, ALLOCNO_NUM (cp->first),
REGNO (ALLOCNO_REG (cp->first)), ALLOCNO_NUM (cp->second),
REGNO (ALLOCNO_REG (cp->second)));
- r = ALLOCNO_LIVE_RANGES (from);
- if (r == NULL || r->finish >= 0)
+
+ nr = ALLOCNO_NUM_OBJECTS (from);
+ for (i = 0; i < nr; i++)
{
- ALLOCNO_LIVE_RANGES (from)
- = ira_create_allocno_live_range (from, start, ira_max_point, r);
- if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
- fprintf (ira_dump_file,
- " Adding range [%d..%d] to allocno a%dr%d\n",
- start, ira_max_point, ALLOCNO_NUM (from),
- REGNO (ALLOCNO_REG (from)));
+ ira_object_t from_obj = ALLOCNO_OBJECT (from, i);
+ r = OBJECT_LIVE_RANGES (from_obj);
+ if (r == NULL || r->finish >= 0)
+ {
+ ira_add_live_range_to_object (from_obj, start, ira_max_point);
+ if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
+ fprintf (ira_dump_file,
+ " Adding range [%d..%d] to allocno a%dr%d\n",
+ start, ira_max_point, ALLOCNO_NUM (from),
+ REGNO (ALLOCNO_REG (from)));
+ }
+ else
+ {
+ r->finish = ira_max_point;
+ if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
+ fprintf (ira_dump_file,
+ " Adding range [%d..%d] to allocno a%dr%d\n",
+ r->start, ira_max_point, ALLOCNO_NUM (from),
+ REGNO (ALLOCNO_REG (from)));
+ }
}
- else
+ ira_max_point++;
+ nr = ALLOCNO_NUM_OBJECTS (to);
+ for (i = 0; i < nr; i++)
{
- r->finish = ira_max_point;
- if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
- fprintf (ira_dump_file,
- " Adding range [%d..%d] to allocno a%dr%d\n",
- r->start, ira_max_point, ALLOCNO_NUM (from),
- REGNO (ALLOCNO_REG (from)));
+ ira_object_t to_obj = ALLOCNO_OBJECT (to, i);
+ ira_add_live_range_to_object (to_obj, ira_max_point, -1);
}
ira_max_point++;
- ALLOCNO_LIVE_RANGES (to)
- = ira_create_allocno_live_range (to, ira_max_point, -1,
- ALLOCNO_LIVE_RANGES (to));
- ira_max_point++;
}
for (move = list; move != NULL; move = move->next)
{
- r = ALLOCNO_LIVE_RANGES (move->to);
- if (r->finish < 0)
+ int nr, i;
+ nr = ALLOCNO_NUM_OBJECTS (move->to);
+ for (i = 0; i < nr; i++)
{
- r->finish = ira_max_point - 1;
- if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
- fprintf (ira_dump_file,
- " Adding range [%d..%d] to allocno a%dr%d\n",
- r->start, r->finish, ALLOCNO_NUM (move->to),
- REGNO (ALLOCNO_REG (move->to)));
+ ira_object_t to_obj = ALLOCNO_OBJECT (move->to, i);
+ r = OBJECT_LIVE_RANGES (to_obj);
+ if (r->finish < 0)
+ {
+ r->finish = ira_max_point - 1;
+ if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
+ fprintf (ira_dump_file,
+ " Adding range [%d..%d] to allocno a%dr%d\n",
+ r->start, r->finish, ALLOCNO_NUM (move->to),
+ REGNO (ALLOCNO_REG (move->to)));
+ }
}
}
EXECUTE_IF_SET_IN_BITMAP (live_through, FIRST_PSEUDO_REGISTER, regno, bi)
{
+ ira_allocno_t to;
+ int nr, i;
+
a = node->regno_allocno_map[regno];
if ((to = ALLOCNO_MEM_OPTIMIZED_DEST (a)) != NULL)
a = to;
- ALLOCNO_LIVE_RANGES (a)
- = ira_create_allocno_live_range (a, start, ira_max_point - 1,
- ALLOCNO_LIVE_RANGES (a));
+ nr = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < nr; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ ira_add_live_range_to_object (obj, start, ira_max_point - 1);
+ }
if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
fprintf
(ira_dump_file,
diff --git a/gcc/ira-int.h b/gcc/ira-int.h
index 1da087cecdb..d06ce4e57cb 100644
--- a/gcc/ira-int.h
+++ b/gcc/ira-int.h
@@ -62,10 +62,13 @@ extern FILE *ira_dump_file;
typedef struct live_range *live_range_t;
typedef struct ira_allocno *ira_allocno_t;
typedef struct ira_allocno_copy *ira_copy_t;
+typedef struct ira_object *ira_object_t;
/* Definition of vector of allocnos and copies. */
DEF_VEC_P(ira_allocno_t);
DEF_VEC_ALLOC_P(ira_allocno_t, heap);
+DEF_VEC_P(ira_object_t);
+DEF_VEC_ALLOC_P(ira_object_t, heap);
DEF_VEC_P(ira_copy_t);
DEF_VEC_ALLOC_P(ira_copy_t, heap);
@@ -189,7 +192,6 @@ extern ira_loop_tree_node_t ira_loop_nodes;
#define IRA_LOOP_NODE(loop) IRA_LOOP_NODE_BY_INDEX ((loop)->num)
-
/* The structure describes program points where a given allocno lives.
To save memory we store allocno conflicts only for the same cover
class allocnos which is enough to assign hard registers. To find
@@ -198,8 +200,8 @@ extern ira_loop_tree_node_t ira_loop_nodes;
intersected, the allocnos are in conflict. */
struct live_range
{
- /* Allocno whose live range is described by given structure. */
- ira_allocno_t allocno;
+ /* Object whose live range is described by given structure. */
+ ira_object_t object;
/* Program point range. */
int start, finish;
/* Next structure describing program points where the allocno
@@ -222,6 +224,50 @@ extern int ira_max_point;
live ranges with given start/finish point. */
extern live_range_t *ira_start_point_ranges, *ira_finish_point_ranges;
+/* A structure representing conflict information for an allocno
+ (or one of its subwords). */
+struct ira_object
+{
+ /* The allocno associated with this record. */
+ ira_allocno_t allocno;
+ /* Vector of accumulated conflicting conflict_redords with NULL end
+ marker (if OBJECT_CONFLICT_VEC_P is true) or conflict bit vector
+ otherwise. Only ira_objects belonging to allocnos with the
+ same cover class are in the vector or in the bit vector. */
+ void *conflicts_array;
+ /* Pointer to structures describing at what program point the
+ object lives. We always maintain the list in such way that *the
+ ranges in the list are not intersected and ordered by decreasing
+ their program points*. */
+ live_range_t live_ranges;
+ /* The subword within ALLOCNO which is represented by this object.
+ Zero means the lowest-order subword (or the entire allocno in case
+ it is not being tracked in subwords). */
+ int subword;
+ /* Allocated size of the conflicts array. */
+ unsigned int conflicts_array_size;
+ /* A unique number for every instance of this structure, which is used
+ to represent it in conflict bit vectors. */
+ int id;
+ /* Before building conflicts, MIN and MAX are initialized to
+ correspondingly minimal and maximal points of the accumulated
+ live ranges. Afterwards, they hold the minimal and maximal ids
+ of other ira_objects that this one can conflict with. */
+ int min, max;
+ /* Initial and accumulated hard registers conflicting with this
+ object and as a consequences can not be assigned to the allocno.
+ All non-allocatable hard regs and hard regs of cover classes
+ different from given allocno one are included in the sets. */
+ HARD_REG_SET conflict_hard_regs, total_conflict_hard_regs;
+ /* Number of accumulated conflicts in the vector of conflicting
+ objects. */
+ int num_accumulated_conflicts;
+ /* TRUE if conflicts are represented by a vector of pointers to
+ ira_object structures. Otherwise, we use a bit vector indexed
+ by conflict ID numbers. */
+ unsigned int conflict_vec_p : 1;
+};
+
/* A structure representing an allocno (allocation entity). Allocno
represents a pseudo-register in an allocation region. If
pseudo-register does not live in a region but it lives in the
@@ -301,35 +347,13 @@ struct ira_allocno
list is chained by NEXT_COALESCED_ALLOCNO. */
ira_allocno_t first_coalesced_allocno;
ira_allocno_t next_coalesced_allocno;
- /* Pointer to structures describing at what program point the
- allocno lives. We always maintain the list in such way that *the
- ranges in the list are not intersected and ordered by decreasing
- their program points*. */
- live_range_t live_ranges;
- /* Before building conflicts the two member values are
- correspondingly minimal and maximal points of the accumulated
- allocno live ranges. After building conflicts the values are
- correspondingly minimal and maximal conflict ids of allocnos with
- which given allocno can conflict. */
- int min, max;
- /* Vector of accumulated conflicting allocnos with NULL end marker
- (if CONFLICT_VEC_P is true) or conflict bit vector otherwise.
- Only allocnos with the same cover class are in the vector or in
- the bit vector. */
- void *conflict_allocno_array;
- /* The unique member value represents given allocno in conflict bit
- vectors. */
- int conflict_id;
- /* Allocated size of the previous array. */
- unsigned int conflict_allocno_array_size;
- /* Initial and accumulated hard registers conflicting with this
- allocno and as a consequences can not be assigned to the allocno.
- All non-allocatable hard regs and hard regs of cover classes
- different from given allocno one are included in the sets. */
- HARD_REG_SET conflict_hard_regs, total_conflict_hard_regs;
- /* Number of accumulated conflicts in the vector of conflicting
- allocnos. */
- int conflict_allocnos_num;
+ /* The number of objects tracked in the following array. */
+ int num_objects;
+ /* An array of structures describing conflict information and live
+ ranges for each object associated with the allocno. There may be
+ more than one such object in cases where the allocno represents a
+ multi-word register. */
+ ira_object_t objects[2];
/* Accumulated frequency of calls which given allocno
intersects. */
int call_freq;
@@ -374,11 +398,6 @@ struct ira_allocno
/* TRUE if the allocno was removed from the splay tree used to
choose allocn for spilling (see ira-color.c::. */
unsigned int splay_removed_p : 1;
- /* TRUE if conflicts for given allocno are represented by vector of
- pointers to the conflicting allocnos. Otherwise, we use a bit
- vector where a bit with given index represents allocno with the
- same number. */
- unsigned int conflict_vec_p : 1;
/* Non NULL if we remove restoring value from given allocno to
MEM_OPTIMIZED_DEST at loop exit (see ira-emit.c) because the
allocno value is not changed inside the loop. */
@@ -429,13 +448,6 @@ struct ira_allocno
#define ALLOCNO_LOOP_TREE_NODE(A) ((A)->loop_tree_node)
#define ALLOCNO_CAP(A) ((A)->cap)
#define ALLOCNO_CAP_MEMBER(A) ((A)->cap_member)
-#define ALLOCNO_CONFLICT_ALLOCNO_ARRAY(A) ((A)->conflict_allocno_array)
-#define ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE(A) \
- ((A)->conflict_allocno_array_size)
-#define ALLOCNO_CONFLICT_ALLOCNOS_NUM(A) \
- ((A)->conflict_allocnos_num)
-#define ALLOCNO_CONFLICT_HARD_REGS(A) ((A)->conflict_hard_regs)
-#define ALLOCNO_TOTAL_CONFLICT_HARD_REGS(A) ((A)->total_conflict_hard_regs)
#define ALLOCNO_NREFS(A) ((A)->nrefs)
#define ALLOCNO_FREQ(A) ((A)->freq)
#define ALLOCNO_HARD_REGNO(A) ((A)->hard_regno)
@@ -455,7 +467,6 @@ struct ira_allocno
#define ALLOCNO_ASSIGNED_P(A) ((A)->assigned_p)
#define ALLOCNO_MAY_BE_SPILLED_P(A) ((A)->may_be_spilled_p)
#define ALLOCNO_SPLAY_REMOVED_P(A) ((A)->splay_removed_p)
-#define ALLOCNO_CONFLICT_VEC_P(A) ((A)->conflict_vec_p)
#define ALLOCNO_MODE(A) ((A)->mode)
#define ALLOCNO_COPIES(A) ((A)->allocno_copies)
#define ALLOCNO_HARD_REG_COSTS(A) ((A)->hard_reg_costs)
@@ -477,10 +488,23 @@ struct ira_allocno
#define ALLOCNO_TEMP(A) ((A)->temp)
#define ALLOCNO_FIRST_COALESCED_ALLOCNO(A) ((A)->first_coalesced_allocno)
#define ALLOCNO_NEXT_COALESCED_ALLOCNO(A) ((A)->next_coalesced_allocno)
-#define ALLOCNO_LIVE_RANGES(A) ((A)->live_ranges)
-#define ALLOCNO_MIN(A) ((A)->min)
-#define ALLOCNO_MAX(A) ((A)->max)
-#define ALLOCNO_CONFLICT_ID(A) ((A)->conflict_id)
+#define ALLOCNO_OBJECT(A,N) ((A)->objects[N])
+#define ALLOCNO_NUM_OBJECTS(A) ((A)->num_objects)
+
+#define OBJECT_ALLOCNO(C) ((C)->allocno)
+#define OBJECT_SUBWORD(C) ((C)->subword)
+#define OBJECT_CONFLICT_ARRAY(C) ((C)->conflicts_array)
+#define OBJECT_CONFLICT_VEC(C) ((ira_object_t *)(C)->conflicts_array)
+#define OBJECT_CONFLICT_BITVEC(C) ((IRA_INT_TYPE *)(C)->conflicts_array)
+#define OBJECT_CONFLICT_ARRAY_SIZE(C) ((C)->conflicts_array_size)
+#define OBJECT_CONFLICT_VEC_P(C) ((C)->conflict_vec_p)
+#define OBJECT_NUM_CONFLICTS(C) ((C)->num_accumulated_conflicts)
+#define OBJECT_CONFLICT_HARD_REGS(C) ((C)->conflict_hard_regs)
+#define OBJECT_TOTAL_CONFLICT_HARD_REGS(C) ((C)->total_conflict_hard_regs)
+#define OBJECT_MIN(C) ((C)->min)
+#define OBJECT_MAX(C) ((C)->max)
+#define OBJECT_CONFLICT_ID(C) ((C)->id)
+#define OBJECT_LIVE_RANGES(A) ((A)->live_ranges)
/* Map regno -> allocnos with given regno (see comments for
allocno member `next_regno_allocno'). */
@@ -491,12 +515,14 @@ extern ira_allocno_t *ira_regno_allocno_map;
have NULL element value. */
extern ira_allocno_t *ira_allocnos;
-/* Sizes of the previous array. */
+/* The size of the previous array. */
extern int ira_allocnos_num;
-/* Map conflict id -> allocno with given conflict id (see comments for
- allocno member `conflict_id'). */
-extern ira_allocno_t *ira_conflict_id_allocno_map;
+/* Map a conflict id to its corresponding ira_object structure. */
+extern ira_object_t *ira_object_id_map;
+
+/* The size of the previous array. */
+extern int ira_objects_num;
/* The following structure represents a copy of two allocnos. The
copies represent move insns or potential move insns usually because
@@ -564,9 +590,6 @@ extern int ira_overall_cost;
extern int ira_reg_cost, ira_mem_cost;
extern int ira_load_cost, ira_store_cost, ira_shuffle_cost;
extern int ira_move_loops_num, ira_additional_jumps_num;
-
-/* Maximal value of element of array ira_reg_class_nregs. */
-extern int ira_max_nregs;
/* This page contains a bitset implementation called 'min/max sets' used to
record conflicts in IRA.
@@ -577,6 +600,7 @@ extern int ira_max_nregs;
/* The type used as elements in the array, and the number of bits in
this type. */
+
#define IRA_INT_BITS HOST_BITS_PER_WIDE_INT
#define IRA_INT_TYPE HOST_WIDE_INT
@@ -674,7 +698,7 @@ minmax_set_iter_init (minmax_set_iterator *i, IRA_INT_TYPE *vec, int min,
i->word = i->nel == 0 ? 0 : vec[0];
}
-/* Return TRUE if we have more elements to visit, in which case *N is
+/* Return TRUE if we have more allocnos to visit, in which case *N is
set to the number of the element to be visited. Otherwise, return
FALSE. */
static inline bool
@@ -717,97 +741,164 @@ minmax_set_iter_next (minmax_set_iterator *i)
minmax_set_iter_cond (&(ITER), &(N)); \
minmax_set_iter_next (&(ITER)))
-/* ira.c: */
+struct target_ira_int {
+ /* Initialized once. It is a maximal possible size of the allocated
+ struct costs. */
+ int x_max_struct_costs_size;
+
+ /* Allocated and initialized once, and used to initialize cost values
+ for each insn. */
+ struct costs *x_init_cost;
+
+ /* Allocated once, and used for temporary purposes. */
+ struct costs *x_temp_costs;
+
+ /* Allocated once, and used for the cost calculation. */
+ struct costs *x_op_costs[MAX_RECOG_OPERANDS];
+ struct costs *x_this_op_costs[MAX_RECOG_OPERANDS];
+
+ /* Classes used for cost calculation. They may be different on
+ different iterations of the cost calculations or in different
+ optimization modes. */
+ enum reg_class *x_cost_classes;
+
+ /* Hard registers that can not be used for the register allocator for
+ all functions of the current compilation unit. */
+ HARD_REG_SET x_no_unit_alloc_regs;
+
+ /* Map: hard regs X modes -> set of hard registers for storing value
+ of given mode starting with given hard register. */
+ HARD_REG_SET (x_ira_reg_mode_hard_regset
+ [FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]);
+
+ /* Array based on TARGET_REGISTER_MOVE_COST. Don't use
+ ira_register_move_cost directly. Use function of
+ ira_get_may_move_cost instead. */
+ move_table *x_ira_register_move_cost[MAX_MACHINE_MODE];
+
+ /* Similar to may_move_in_cost but it is calculated in IRA instead of
+ regclass. Another difference we take only available hard registers
+ into account to figure out that one register class is a subset of
+ the another one. Don't use it directly. Use function of
+ ira_get_may_move_cost instead. */
+ move_table *x_ira_may_move_in_cost[MAX_MACHINE_MODE];
+
+ /* Similar to may_move_out_cost but it is calculated in IRA instead of
+ regclass. Another difference we take only available hard registers
+ into account to figure out that one register class is a subset of
+ the another one. Don't use it directly. Use function of
+ ira_get_may_move_cost instead. */
+ move_table *x_ira_may_move_out_cost[MAX_MACHINE_MODE];
+
+ /* Register class subset relation: TRUE if the first class is a subset
+ of the second one considering only hard registers available for the
+ allocation. */
+ int x_ira_class_subset_p[N_REG_CLASSES][N_REG_CLASSES];
+
+ /* Array of the number of hard registers of given class which are
+ available for allocation. The order is defined by the the hard
+ register numbers. */
+ short x_ira_non_ordered_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
+
+ /* Index (in ira_class_hard_regs; for given register class and hard
+ register (in general case a hard register can belong to several
+ register classes;. The index is negative for hard registers
+ unavailable for the allocation. */
+ short x_ira_class_hard_reg_index[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
+
+ /* Array whose values are hard regset of hard registers available for
+ the allocation of given register class whose HARD_REGNO_MODE_OK
+ values for given mode are zero. */
+ HARD_REG_SET x_prohibited_class_mode_regs[N_REG_CLASSES][NUM_MACHINE_MODES];
+
+ /* The value is number of elements in the subsequent array. */
+ int x_ira_important_classes_num;
+
+ /* The array containing non-empty classes (including non-empty cover
+ classes; which are subclasses of cover classes. Such classes is
+ important for calculation of the hard register usage costs. */
+ enum reg_class x_ira_important_classes[N_REG_CLASSES];
+
+ /* The biggest important class inside of intersection of the two
+ classes (that is calculated taking only hard registers available
+ for allocation into account;. If the both classes contain no hard
+ registers available for allocation, the value is calculated with
+ taking all hard-registers including fixed ones into account. */
+ enum reg_class x_ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
+
+ /* True if the two classes (that is calculated taking only hard
+ registers available for allocation into account; are
+ intersected. */
+ bool x_ira_reg_classes_intersect_p[N_REG_CLASSES][N_REG_CLASSES];
+
+ /* Classes with end marker LIM_REG_CLASSES which are intersected with
+ given class (the first index;. That includes given class itself.
+ This is calculated taking only hard registers available for
+ allocation into account. */
+ enum reg_class x_ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
+
+ /* The biggest important class inside of union of the two classes
+ (that is calculated taking only hard registers available for
+ allocation into account;. If the both classes contain no hard
+ registers available for allocation, the value is calculated with
+ taking all hard-registers including fixed ones into account. In
+ other words, the value is the corresponding reg_class_subunion
+ value. */
+ enum reg_class x_ira_reg_class_union[N_REG_CLASSES][N_REG_CLASSES];
+
+ /* For each reg class, table listing all the classes contained in it
+ (excluding the class itself. Non-allocatable registers are
+ excluded from the consideration;. */
+ enum reg_class x_alloc_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
+
+ /* Array whose values are hard regset of hard registers for which
+ move of the hard register in given mode into itself is
+ prohibited. */
+ HARD_REG_SET x_ira_prohibited_mode_move_regs[NUM_MACHINE_MODES];
+
+ /* Flag of that the above array has been initialized. */
+ bool x_ira_prohibited_mode_move_regs_initialized_p;
+};
-/* Map: hard regs X modes -> set of hard registers for storing value
- of given mode starting with given hard register. */
-extern HARD_REG_SET ira_reg_mode_hard_regset
- [FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES];
-
-/* Array based on TARGET_REGISTER_MOVE_COST. Don't use
- ira_register_move_cost directly. Use function of
- ira_get_may_move_cost instead. */
-extern move_table *ira_register_move_cost[MAX_MACHINE_MODE];
-
-/* Similar to may_move_in_cost but it is calculated in IRA instead of
- regclass. Another difference we take only available hard registers
- into account to figure out that one register class is a subset of
- the another one. Don't use it directly. Use function of
- ira_get_may_move_cost instead. */
-extern move_table *ira_may_move_in_cost[MAX_MACHINE_MODE];
-
-/* Similar to may_move_out_cost but it is calculated in IRA instead of
- regclass. Another difference we take only available hard registers
- into account to figure out that one register class is a subset of
- the another one. Don't use it directly. Use function of
- ira_get_may_move_cost instead. */
-extern move_table *ira_may_move_out_cost[MAX_MACHINE_MODE];
-
-/* Register class subset relation: TRUE if the first class is a subset
- of the second one considering only hard registers available for the
- allocation. */
-extern int ira_class_subset_p[N_REG_CLASSES][N_REG_CLASSES];
-
-/* Array of the number of hard registers of given class which are
- available for allocation. The order is defined by the the hard
- register numbers. */
-extern short ira_non_ordered_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
-
-/* Index (in ira_class_hard_regs) for given register class and hard
- register (in general case a hard register can belong to several
- register classes). The index is negative for hard registers
- unavailable for the allocation. */
-extern short ira_class_hard_reg_index[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
-
-/* Array whose values are hard regset of hard registers available for
- the allocation of given register class whose HARD_REGNO_MODE_OK
- values for given mode are zero. */
-extern HARD_REG_SET prohibited_class_mode_regs
- [N_REG_CLASSES][NUM_MACHINE_MODES];
-
-/* Array whose values are hard regset of hard registers for which
- move of the hard register in given mode into itself is
- prohibited. */
-extern HARD_REG_SET ira_prohibited_mode_move_regs[NUM_MACHINE_MODES];
-
-/* The value is number of elements in the subsequent array. */
-extern int ira_important_classes_num;
-
-/* The array containing non-empty classes (including non-empty cover
- classes) which are subclasses of cover classes. Such classes is
- important for calculation of the hard register usage costs. */
-extern enum reg_class ira_important_classes[N_REG_CLASSES];
-
-/* The array containing indexes of important classes in the previous
- array. The array elements are defined only for important
- classes. */
-extern int ira_important_class_nums[N_REG_CLASSES];
-
-/* The biggest important class inside of intersection of the two
- classes (that is calculated taking only hard registers available
- for allocation into account). If the both classes contain no hard
- registers available for allocation, the value is calculated with
- taking all hard-registers including fixed ones into account. */
-extern enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
-
-/* True if the two classes (that is calculated taking only hard
- registers available for allocation into account) are
- intersected. */
-extern bool ira_reg_classes_intersect_p[N_REG_CLASSES][N_REG_CLASSES];
-
-/* Classes with end marker LIM_REG_CLASSES which are intersected with
- given class (the first index). That includes given class itself.
- This is calculated taking only hard registers available for
- allocation into account. */
-extern enum reg_class ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
-/* The biggest important class inside of union of the two classes
- (that is calculated taking only hard registers available for
- allocation into account). If the both classes contain no hard
- registers available for allocation, the value is calculated with
- taking all hard-registers including fixed ones into account. In
- other words, the value is the corresponding reg_class_subunion
- value. */
-extern enum reg_class ira_reg_class_union[N_REG_CLASSES][N_REG_CLASSES];
+extern struct target_ira_int default_target_ira_int;
+#if SWITCHABLE_TARGET
+extern struct target_ira_int *this_target_ira_int;
+#else
+#define this_target_ira_int (&default_target_ira_int)
+#endif
+
+#define ira_reg_mode_hard_regset \
+ (this_target_ira_int->x_ira_reg_mode_hard_regset)
+#define ira_register_move_cost \
+ (this_target_ira_int->x_ira_register_move_cost)
+#define ira_may_move_in_cost \
+ (this_target_ira_int->x_ira_may_move_in_cost)
+#define ira_may_move_out_cost \
+ (this_target_ira_int->x_ira_may_move_out_cost)
+#define ira_class_subset_p \
+ (this_target_ira_int->x_ira_class_subset_p)
+#define ira_non_ordered_class_hard_regs \
+ (this_target_ira_int->x_ira_non_ordered_class_hard_regs)
+#define ira_class_hard_reg_index \
+ (this_target_ira_int->x_ira_class_hard_reg_index)
+#define prohibited_class_mode_regs \
+ (this_target_ira_int->x_prohibited_class_mode_regs)
+#define ira_important_classes_num \
+ (this_target_ira_int->x_ira_important_classes_num)
+#define ira_important_classes \
+ (this_target_ira_int->x_ira_important_classes)
+#define ira_reg_class_intersect \
+ (this_target_ira_int->x_ira_reg_class_intersect)
+#define ira_reg_classes_intersect_p \
+ (this_target_ira_int->x_ira_reg_classes_intersect_p)
+#define ira_reg_class_super_classes \
+ (this_target_ira_int->x_ira_reg_class_super_classes)
+#define ira_reg_class_union \
+ (this_target_ira_int->x_ira_reg_class_union)
+#define ira_prohibited_mode_move_regs \
+ (this_target_ira_int->x_ira_prohibited_mode_move_regs)
+
+/* ira.c: */
extern void *ira_allocate (size_t);
extern void *ira_reallocate (void *, size_t);
@@ -846,19 +937,21 @@ extern void ira_traverse_loop_tree (bool, ira_loop_tree_node_t,
extern ira_allocno_t ira_parent_allocno (ira_allocno_t);
extern ira_allocno_t ira_parent_or_cap_allocno (ira_allocno_t);
extern ira_allocno_t ira_create_allocno (int, bool, ira_loop_tree_node_t);
+extern void ira_create_allocno_objects (ira_allocno_t);
extern void ira_set_allocno_cover_class (ira_allocno_t, enum reg_class);
-extern bool ira_conflict_vector_profitable_p (ira_allocno_t, int);
-extern void ira_allocate_allocno_conflict_vec (ira_allocno_t, int);
-extern void ira_allocate_allocno_conflicts (ira_allocno_t, int);
-extern void ira_add_allocno_conflict (ira_allocno_t, ira_allocno_t);
+extern bool ira_conflict_vector_profitable_p (ira_object_t, int);
+extern void ira_allocate_conflict_vec (ira_object_t, int);
+extern void ira_allocate_object_conflicts (ira_object_t, int);
+extern void ior_hard_reg_conflicts (ira_allocno_t, HARD_REG_SET *);
extern void ira_print_expanded_allocno (ira_allocno_t);
-extern live_range_t ira_create_allocno_live_range (ira_allocno_t, int, int,
- live_range_t);
-extern live_range_t ira_copy_allocno_live_range_list (live_range_t);
-extern live_range_t ira_merge_allocno_live_ranges (live_range_t, live_range_t);
-extern bool ira_allocno_live_ranges_intersect_p (live_range_t, live_range_t);
-extern void ira_finish_allocno_live_range (live_range_t);
-extern void ira_finish_allocno_live_range_list (live_range_t);
+extern void ira_add_live_range_to_object (ira_object_t, int, int);
+extern live_range_t ira_create_live_range (ira_object_t, int, int,
+ live_range_t);
+extern live_range_t ira_copy_live_range_list (live_range_t);
+extern live_range_t ira_merge_live_ranges (live_range_t, live_range_t);
+extern bool ira_live_ranges_intersect_p (live_range_t, live_range_t);
+extern void ira_finish_live_range (live_range_t);
+extern void ira_finish_live_range_list (live_range_t);
extern void ira_free_allocno_updated_costs (ira_allocno_t);
extern ira_copy_t ira_create_copy (ira_allocno_t, ira_allocno_t,
int, bool, rtx, ira_loop_tree_node_t);
@@ -973,8 +1066,74 @@ ira_allocno_iter_cond (ira_allocno_iterator *i, ira_allocno_t *a)
#define FOR_EACH_ALLOCNO(A, ITER) \
for (ira_allocno_iter_init (&(ITER)); \
ira_allocno_iter_cond (&(ITER), &(A));)
+
+/* The iterator for all objects. */
+typedef struct {
+ /* The number of the current element in ira_object_id_map. */
+ int n;
+} ira_object_iterator;
+
+/* Initialize the iterator I. */
+static inline void
+ira_object_iter_init (ira_object_iterator *i)
+{
+ i->n = 0;
+}
+
+/* Return TRUE if we have more objects to visit, in which case *OBJ is
+ set to the object to be visited. Otherwise, return FALSE. */
+static inline bool
+ira_object_iter_cond (ira_object_iterator *i, ira_object_t *obj)
+{
+ int n;
+
+ for (n = i->n; n < ira_objects_num; n++)
+ if (ira_object_id_map[n] != NULL)
+ {
+ *obj = ira_object_id_map[n];
+ i->n = n + 1;
+ return true;
+ }
+ return false;
+}
+/* Loop over all objects. In each iteration, OBJ is set to the next
+ object. ITER is an instance of ira_object_iterator used to iterate
+ the objects. */
+#define FOR_EACH_OBJECT(OBJ, ITER) \
+ for (ira_object_iter_init (&(ITER)); \
+ ira_object_iter_cond (&(ITER), &(OBJ));)
+
+/* The iterator for objects associated with an allocno. */
+typedef struct {
+ /* The number of the element the allocno's object array. */
+ int n;
+} ira_allocno_object_iterator;
+
+/* Initialize the iterator I. */
+static inline void
+ira_allocno_object_iter_init (ira_allocno_object_iterator *i)
+{
+ i->n = 0;
+}
+
+/* Return TRUE if we have more objects to visit in allocno A, in which
+ case *O is set to the object to be visited. Otherwise, return
+ FALSE. */
+static inline bool
+ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
+ ira_object_t *o)
+{
+ *o = ALLOCNO_OBJECT (a, i->n);
+ return i->n++ < ALLOCNO_NUM_OBJECTS (a);
+}
+/* Loop over all objects associated with allocno A. In each
+ iteration, O is set to the next object. ITER is an instance of
+ ira_allocno_object_iterator used to iterate the conflicts. */
+#define FOR_EACH_ALLOCNO_OBJECT(A, O, ITER) \
+ for (ira_allocno_object_iter_init (&(ITER)); \
+ ira_allocno_object_iter_cond (&(ITER), (A), &(O));)
/* The iterator for copies. */
@@ -1013,61 +1172,57 @@ ira_copy_iter_cond (ira_copy_iterator *i, ira_copy_t *cp)
#define FOR_EACH_COPY(C, ITER) \
for (ira_copy_iter_init (&(ITER)); \
ira_copy_iter_cond (&(ITER), &(C));)
-
-
-
-/* The iterator for allocno conflicts. */
+/* The iterator for object conflicts. */
typedef struct {
/* TRUE if the conflicts are represented by vector of allocnos. */
- bool allocno_conflict_vec_p;
+ bool conflict_vec_p;
/* The conflict vector or conflict bit vector. */
void *vec;
/* The number of the current element in the vector (of type
- ira_allocno_t or IRA_INT_TYPE). */
+ ira_object_t or IRA_INT_TYPE). */
unsigned int word_num;
/* The bit vector size. It is defined only if
- ALLOCNO_CONFLICT_VEC_P is FALSE. */
+ OBJECT_CONFLICT_VEC_P is FALSE. */
unsigned int size;
/* The current bit index of bit vector. It is defined only if
- ALLOCNO_CONFLICT_VEC_P is FALSE. */
+ OBJECT_CONFLICT_VEC_P is FALSE. */
unsigned int bit_num;
- /* Allocno conflict id corresponding to the 1st bit of the bit
- vector. It is defined only if ALLOCNO_CONFLICT_VEC_P is
- FALSE. */
+ /* The object id corresponding to the 1st bit of the bit vector. It
+ is defined only if OBJECT_CONFLICT_VEC_P is FALSE. */
int base_conflict_id;
/* The word of bit vector currently visited. It is defined only if
- ALLOCNO_CONFLICT_VEC_P is FALSE. */
+ OBJECT_CONFLICT_VEC_P is FALSE. */
unsigned IRA_INT_TYPE word;
-} ira_allocno_conflict_iterator;
+} ira_object_conflict_iterator;
/* Initialize the iterator I with ALLOCNO conflicts. */
static inline void
-ira_allocno_conflict_iter_init (ira_allocno_conflict_iterator *i,
- ira_allocno_t allocno)
+ira_object_conflict_iter_init (ira_object_conflict_iterator *i,
+ ira_object_t obj)
{
- i->allocno_conflict_vec_p = ALLOCNO_CONFLICT_VEC_P (allocno);
- i->vec = ALLOCNO_CONFLICT_ALLOCNO_ARRAY (allocno);
+ i->conflict_vec_p = OBJECT_CONFLICT_VEC_P (obj);
+ i->vec = OBJECT_CONFLICT_ARRAY (obj);
i->word_num = 0;
- if (i->allocno_conflict_vec_p)
+ if (i->conflict_vec_p)
i->size = i->bit_num = i->base_conflict_id = i->word = 0;
else
{
- if (ALLOCNO_MIN (allocno) > ALLOCNO_MAX (allocno))
+ if (OBJECT_MIN (obj) > OBJECT_MAX (obj))
i->size = 0;
else
- i->size = ((ALLOCNO_MAX (allocno) - ALLOCNO_MIN (allocno)
+ i->size = ((OBJECT_MAX (obj) - OBJECT_MIN (obj)
+ IRA_INT_BITS)
/ IRA_INT_BITS) * sizeof (IRA_INT_TYPE);
i->bit_num = 0;
- i->base_conflict_id = ALLOCNO_MIN (allocno);
+ i->base_conflict_id = OBJECT_MIN (obj);
i->word = (i->size == 0 ? 0 : ((IRA_INT_TYPE *) i->vec)[0]);
}
}
@@ -1076,18 +1231,16 @@ ira_allocno_conflict_iter_init (ira_allocno_conflict_iterator *i,
case *A is set to the allocno to be visited. Otherwise, return
FALSE. */
static inline bool
-ira_allocno_conflict_iter_cond (ira_allocno_conflict_iterator *i,
- ira_allocno_t *a)
+ira_object_conflict_iter_cond (ira_object_conflict_iterator *i,
+ ira_object_t *pobj)
{
- ira_allocno_t conflict_allocno;
+ ira_object_t obj;
- if (i->allocno_conflict_vec_p)
+ if (i->conflict_vec_p)
{
- conflict_allocno = ((ira_allocno_t *) i->vec)[i->word_num];
- if (conflict_allocno == NULL)
+ obj = ((ira_object_t *) i->vec)[i->word_num];
+ if (obj == NULL)
return false;
- *a = conflict_allocno;
- return true;
}
else
{
@@ -1107,17 +1260,18 @@ ira_allocno_conflict_iter_cond (ira_allocno_conflict_iterator *i,
for (; (i->word & 1) == 0; i->word >>= 1)
i->bit_num++;
- *a = ira_conflict_id_allocno_map[i->bit_num + i->base_conflict_id];
-
- return true;
+ obj = ira_object_id_map[i->bit_num + i->base_conflict_id];
}
+
+ *pobj = obj;
+ return true;
}
/* Advance to the next conflicting allocno. */
static inline void
-ira_allocno_conflict_iter_next (ira_allocno_conflict_iterator *i)
+ira_object_conflict_iter_next (ira_object_conflict_iterator *i)
{
- if (i->allocno_conflict_vec_p)
+ if (i->conflict_vec_p)
i->word_num++;
else
{
@@ -1126,14 +1280,13 @@ ira_allocno_conflict_iter_next (ira_allocno_conflict_iterator *i)
}
}
-/* Loop over all allocnos conflicting with ALLOCNO. In each
- iteration, A is set to the next conflicting allocno. ITER is an
- instance of ira_allocno_conflict_iterator used to iterate the
- conflicts. */
-#define FOR_EACH_ALLOCNO_CONFLICT(ALLOCNO, A, ITER) \
- for (ira_allocno_conflict_iter_init (&(ITER), (ALLOCNO)); \
- ira_allocno_conflict_iter_cond (&(ITER), &(A)); \
- ira_allocno_conflict_iter_next (&(ITER)))
+/* Loop over all objects conflicting with OBJ. In each iteration,
+ CONF is set to the next conflicting object. ITER is an instance
+ of ira_object_conflict_iterator used to iterate the conflicts. */
+#define FOR_EACH_OBJECT_CONFLICT(OBJ, CONF, ITER) \
+ for (ira_object_conflict_iter_init (&(ITER), (OBJ)); \
+ ira_object_conflict_iter_cond (&(ITER), &(CONF)); \
+ ira_object_conflict_iter_next (&(ITER)))
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index f879068aa5e..5b75f54e5d3 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "insn-config.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "params.h"
#include "df.h"
@@ -67,8 +68,12 @@ static int curr_point;
classes. */
static int high_pressure_start_point[N_REG_CLASSES];
-/* Allocnos live at current point in the scan. */
-static sparseset allocnos_live;
+/* Objects live at current point in the scan. */
+static sparseset objects_live;
+
+/* A temporary bitmap used in functions that wish to avoid visiting an allocno
+ multiple times. */
+static sparseset allocnos_processed;
/* Set of hard regs (except eliminable ones) currently live. */
static HARD_REG_SET hard_regs_live;
@@ -81,20 +86,19 @@ static int last_call_num;
/* The number of last call at which given allocno was saved. */
static int *allocno_saved_at_call;
-/* Record the birth of hard register REGNO, updating hard_regs_live
- and hard reg conflict information for living allocno. */
+/* Record the birth of hard register REGNO, updating hard_regs_live and
+ hard reg conflict information for living allocnos. */
static void
make_hard_regno_born (int regno)
{
unsigned int i;
SET_HARD_REG_BIT (hard_regs_live, regno);
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, i)
{
- SET_HARD_REG_BIT (ALLOCNO_CONFLICT_HARD_REGS (ira_allocnos[i]),
- regno);
- SET_HARD_REG_BIT (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (ira_allocnos[i]),
- regno);
+ ira_object_t obj = ira_object_id_map[i];
+ SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno);
+ SET_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno);
}
}
@@ -106,29 +110,29 @@ make_hard_regno_dead (int regno)
CLEAR_HARD_REG_BIT (hard_regs_live, regno);
}
-/* Record the birth of allocno A, starting a new live range for
- it if necessary, and updating hard reg conflict information. We also
- record it in allocnos_live. */
+/* Record the birth of object OBJ. Set a bit for it in objects_live,
+ start a new live range for it if necessary and update hard register
+ conflicts. */
static void
-make_allocno_born (ira_allocno_t a)
+make_object_born (ira_object_t obj)
{
- live_range_t p = ALLOCNO_LIVE_RANGES (a);
+ live_range_t lr = OBJECT_LIVE_RANGES (obj);
- sparseset_set_bit (allocnos_live, ALLOCNO_NUM (a));
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), hard_regs_live);
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), hard_regs_live);
+ sparseset_set_bit (objects_live, OBJECT_CONFLICT_ID (obj));
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), hard_regs_live);
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), hard_regs_live);
- if (p == NULL
- || (p->finish != curr_point && p->finish + 1 != curr_point))
- ALLOCNO_LIVE_RANGES (a)
- = ira_create_allocno_live_range (a, curr_point, -1,
- ALLOCNO_LIVE_RANGES (a));
+ if (lr == NULL
+ || (lr->finish != curr_point && lr->finish + 1 != curr_point))
+ ira_add_live_range_to_object (obj, curr_point, -1);
}
-/* Update ALLOCNO_EXCESS_PRESSURE_POINTS_NUM for allocno A. */
+/* Update ALLOCNO_EXCESS_PRESSURE_POINTS_NUM for the allocno
+ associated with object OBJ. */
static void
-update_allocno_pressure_excess_length (ira_allocno_t a)
+update_allocno_pressure_excess_length (ira_object_t obj)
{
+ ira_allocno_t a = OBJECT_ALLOCNO (obj);
int start, i;
enum reg_class cover_class, cl;
live_range_t p;
@@ -140,7 +144,7 @@ update_allocno_pressure_excess_length (ira_allocno_t a)
{
if (high_pressure_start_point[cl] < 0)
continue;
- p = ALLOCNO_LIVE_RANGES (a);
+ p = OBJECT_LIVE_RANGES (obj);
ira_assert (p != NULL);
start = (high_pressure_start_point[cl] > p->start
? high_pressure_start_point[cl] : p->start);
@@ -148,18 +152,18 @@ update_allocno_pressure_excess_length (ira_allocno_t a)
}
}
-/* Process the death of allocno A. This finishes the current live
- range for it. */
+/* Process the death of object OBJ, which is associated with allocno
+ A. This finishes the current live range for it. */
static void
-make_allocno_dead (ira_allocno_t a)
+make_object_dead (ira_object_t obj)
{
- live_range_t p;
+ live_range_t lr;
- p = ALLOCNO_LIVE_RANGES (a);
- ira_assert (p != NULL);
- p->finish = curr_point;
- update_allocno_pressure_excess_length (a);
- sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (a));
+ sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (obj));
+ lr = OBJECT_LIVE_RANGES (obj);
+ ira_assert (lr != NULL);
+ lr->finish = curr_point;
+ update_allocno_pressure_excess_length (obj);
}
/* The current register pressures for each cover class for the current
@@ -214,8 +218,8 @@ dec_register_pressure (enum reg_class cover_class, int nregs)
}
if (set_p)
{
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, j)
- update_allocno_pressure_excess_length (ira_allocnos[j]);
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, j)
+ update_allocno_pressure_excess_length (ira_object_id_map[j]);
for (i = 0;
(cl = ira_reg_class_super_classes[cover_class][i])
!= LIM_REG_CLASSES;
@@ -232,8 +236,8 @@ static void
mark_pseudo_regno_live (int regno)
{
ira_allocno_t a = ira_curr_regno_allocno_map[regno];
+ int i, n, nregs;
enum reg_class cl;
- int nregs;
if (a == NULL)
return;
@@ -241,18 +245,66 @@ mark_pseudo_regno_live (int regno)
/* Invalidate because it is referenced. */
allocno_saved_at_call[ALLOCNO_NUM (a)] = 0;
- if (sparseset_bit_p (allocnos_live, ALLOCNO_NUM (a)))
+ n = ALLOCNO_NUM_OBJECTS (a);
+ cl = ALLOCNO_COVER_CLASS (a);
+ nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)];
+ if (n > 1)
+ {
+ /* We track every subobject separately. */
+ gcc_assert (nregs == n);
+ nregs = 1;
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ if (sparseset_bit_p (objects_live, OBJECT_CONFLICT_ID (obj)))
+ continue;
+
+ inc_register_pressure (cl, nregs);
+ make_object_born (obj);
+ }
+}
+
+/* Like mark_pseudo_regno_live, but try to only mark one subword of
+ the pseudo as live. SUBWORD indicates which; a value of 0
+ indicates the low part. */
+static void
+mark_pseudo_regno_subword_live (int regno, int subword)
+{
+ ira_allocno_t a = ira_curr_regno_allocno_map[regno];
+ int n, nregs;
+ enum reg_class cl;
+ ira_object_t obj;
+
+ if (a == NULL)
return;
+ /* Invalidate because it is referenced. */
+ allocno_saved_at_call[ALLOCNO_NUM (a)] = 0;
+
+ n = ALLOCNO_NUM_OBJECTS (a);
+ if (n == 1)
+ {
+ mark_pseudo_regno_live (regno);
+ return;
+ }
+
cl = ALLOCNO_COVER_CLASS (a);
nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)];
+ gcc_assert (nregs == n);
+ obj = ALLOCNO_OBJECT (a, subword);
+
+ if (sparseset_bit_p (objects_live, OBJECT_CONFLICT_ID (obj)))
+ return;
+
inc_register_pressure (cl, nregs);
- make_allocno_born (a);
+ make_object_born (obj);
}
-/* Mark the hard register REG as live. Store a 1 in hard_regs_live
- for this register, record how many consecutive hardware registers
- it actually needs. */
+/* Mark the register REG as live. Store a 1 in hard_regs_live for
+ this register, record how many consecutive hardware registers it
+ actually needs. */
static void
mark_hard_reg_live (rtx reg)
{
@@ -280,13 +332,22 @@ mark_hard_reg_live (rtx reg)
static void
mark_ref_live (df_ref ref)
{
- rtx reg;
+ rtx reg = DF_REF_REG (ref);
+ rtx orig_reg = reg;
- reg = DF_REF_REG (ref);
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
+
if (REGNO (reg) >= FIRST_PSEUDO_REGISTER)
- mark_pseudo_regno_live (REGNO (reg));
+ {
+ if (df_read_modify_subreg_p (orig_reg))
+ {
+ mark_pseudo_regno_subword_live (REGNO (reg),
+ subreg_lowpart_p (orig_reg) ? 0 : 1);
+ }
+ else
+ mark_pseudo_regno_live (REGNO (reg));
+ }
else
mark_hard_reg_live (reg);
}
@@ -297,8 +358,44 @@ static void
mark_pseudo_regno_dead (int regno)
{
ira_allocno_t a = ira_curr_regno_allocno_map[regno];
+ int n, i, nregs;
+ enum reg_class cl;
+
+ if (a == NULL)
+ return;
+
+ /* Invalidate because it is referenced. */
+ allocno_saved_at_call[ALLOCNO_NUM (a)] = 0;
+
+ n = ALLOCNO_NUM_OBJECTS (a);
+ cl = ALLOCNO_COVER_CLASS (a);
+ nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)];
+ if (n > 1)
+ {
+ /* We track every subobject separately. */
+ gcc_assert (nregs == n);
+ nregs = 1;
+ }
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ if (!sparseset_bit_p (objects_live, OBJECT_CONFLICT_ID (obj)))
+ continue;
+
+ dec_register_pressure (cl, nregs);
+ make_object_dead (obj);
+ }
+}
+
+/* Like mark_pseudo_regno_dead, but called when we know that only part of the
+ register dies. SUBWORD indicates which; a value of 0 indicates the low part. */
+static void
+mark_pseudo_regno_subword_dead (int regno, int subword)
+{
+ ira_allocno_t a = ira_curr_regno_allocno_map[regno];
+ int n, nregs;
enum reg_class cl;
- int nregs;
+ ira_object_t obj;
if (a == NULL)
return;
@@ -306,18 +403,25 @@ mark_pseudo_regno_dead (int regno)
/* Invalidate because it is referenced. */
allocno_saved_at_call[ALLOCNO_NUM (a)] = 0;
- if (! sparseset_bit_p (allocnos_live, ALLOCNO_NUM (a)))
+ n = ALLOCNO_NUM_OBJECTS (a);
+ if (n == 1)
+ /* The allocno as a whole doesn't die in this case. */
return;
cl = ALLOCNO_COVER_CLASS (a);
nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)];
- dec_register_pressure (cl, nregs);
+ gcc_assert (nregs == n);
+
+ obj = ALLOCNO_OBJECT (a, subword);
+ if (!sparseset_bit_p (objects_live, OBJECT_CONFLICT_ID (obj)))
+ return;
- make_allocno_dead (a);
+ dec_register_pressure (cl, 1);
+ make_object_dead (obj);
}
-/* Mark the hard register REG as dead. Store a 0 in hard_regs_live
- for the register. */
+/* Mark the hard register REG as dead. Store a 0 in hard_regs_live for the
+ register. */
static void
mark_hard_reg_dead (rtx reg)
{
@@ -345,17 +449,31 @@ mark_hard_reg_dead (rtx reg)
static void
mark_ref_dead (df_ref def)
{
- rtx reg;
+ rtx reg = DF_REF_REG (def);
+ rtx orig_reg = reg;
- if (DF_REF_FLAGS_IS_SET (def, DF_REF_PARTIAL)
- || DF_REF_FLAGS_IS_SET (def, DF_REF_CONDITIONAL))
+ if (DF_REF_FLAGS_IS_SET (def, DF_REF_CONDITIONAL))
return;
- reg = DF_REF_REG (def);
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
+
+ if (DF_REF_FLAGS_IS_SET (def, DF_REF_PARTIAL)
+ && (GET_CODE (orig_reg) != SUBREG
+ || REGNO (reg) < FIRST_PSEUDO_REGISTER
+ || !df_read_modify_subreg_p (orig_reg)))
+ return;
+
if (REGNO (reg) >= FIRST_PSEUDO_REGISTER)
- mark_pseudo_regno_dead (REGNO (reg));
+ {
+ if (df_read_modify_subreg_p (orig_reg))
+ {
+ mark_pseudo_regno_subword_dead (REGNO (reg),
+ subreg_lowpart_p (orig_reg) ? 0 : 1);
+ }
+ else
+ mark_pseudo_regno_dead (REGNO (reg));
+ }
else
mark_hard_reg_dead (reg);
}
@@ -466,7 +584,7 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
/* If there's any alternative that allows USE to match DEF, do not
record a conflict. If that causes us to create an invalid
- instruction due to the earlyclobber, reload must fix it up. */
+ instruction due to the earlyclobber, reload must fix it up. */
for (alt1 = 0; alt1 < recog_data.n_alternatives; alt1++)
if (recog_op_alt[use][alt1].matches == def
|| (use < recog_data.n_operands - 1
@@ -834,17 +952,18 @@ process_single_reg_class_operands (bool in_p, int freq)
}
}
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, px)
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, px)
{
- a = ira_allocnos[px];
+ ira_object_t obj = ira_object_id_map[px];
+ a = OBJECT_ALLOCNO (obj);
if (a != operand_a)
{
/* We could increase costs of A instead of making it
conflicting with the hard register. But it works worse
because it will be spilled in reload in anyway. */
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
reg_class_contents[cl]);
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
reg_class_contents[cl]);
}
}
@@ -893,7 +1012,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
}
curr_bb_node = loop_tree_node;
reg_live_out = DF_LR_OUT (bb);
- sparseset_clear (allocnos_live);
+ sparseset_clear (objects_live);
REG_SET_TO_HARD_REG_SET (hard_regs_live, reg_live_out);
AND_COMPL_HARD_REG_SET (hard_regs_live, eliminable_regset);
AND_COMPL_HARD_REG_SET (hard_regs_live, ira_no_alloc_regs);
@@ -1007,21 +1126,14 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
if (call_p)
{
last_call_num++;
+ sparseset_clear (allocnos_processed);
/* The current set of live allocnos are live across the call. */
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, i)
{
- ira_allocno_t a = ira_allocnos[i];
+ ira_object_t obj = ira_object_id_map[i];
+ ira_allocno_t a = OBJECT_ALLOCNO (obj);
+ int num = ALLOCNO_NUM (a);
- if (allocno_saved_at_call[i] != last_call_num)
- /* Here we are mimicking caller-save.c behaviour
- which does not save hard register at a call if
- it was saved on previous call in the same basic
- block and the hard register was not mentioned
- between the two calls. */
- ALLOCNO_CALL_FREQ (a) += freq;
- /* Mark it as saved at the next call. */
- allocno_saved_at_call[i] = last_call_num + 1;
- ALLOCNO_CALLS_CROSSED_NUM (a)++;
/* Don't allocate allocnos that cross setjmps or any
call, if this function receives a nonlocal
goto. */
@@ -1029,16 +1141,31 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
|| find_reg_note (insn, REG_SETJMP,
NULL_RTX) != NULL_RTX)
{
- SET_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a));
- SET_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a));
+ SET_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj));
+ SET_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
}
if (can_throw_internal (insn))
{
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
call_used_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
call_used_reg_set);
}
+
+ if (sparseset_bit_p (allocnos_processed, num))
+ continue;
+ sparseset_set_bit (allocnos_processed, num);
+
+ if (allocno_saved_at_call[num] != last_call_num)
+ /* Here we are mimicking caller-save.c behaviour
+ which does not save hard register at a call if
+ it was saved on previous call in the same basic
+ block and the hard register was not mentioned
+ between the two calls. */
+ ALLOCNO_CALL_FREQ (a) += freq;
+ /* Mark it as saved at the next call. */
+ allocno_saved_at_call[num] = last_call_num + 1;
+ ALLOCNO_CALLS_CROSSED_NUM (a)++;
}
}
@@ -1096,10 +1223,11 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
if (bb_has_abnormal_pred (bb))
{
#ifdef STACK_REGS
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, px)
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, px)
{
- ALLOCNO_NO_STACK_REG_P (ira_allocnos[px]) = true;
- ALLOCNO_TOTAL_NO_STACK_REG_P (ira_allocnos[px]) = true;
+ ira_allocno_t a = OBJECT_ALLOCNO (ira_object_id_map[px]);
+ ALLOCNO_NO_STACK_REG_P (a) = true;
+ ALLOCNO_TOTAL_NO_STACK_REG_P (a) = true;
}
for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++)
make_hard_regno_born (px);
@@ -1113,8 +1241,8 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
make_hard_regno_born (px);
}
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
- make_allocno_dead (ira_allocnos[i]);
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, i)
+ make_object_dead (ira_object_id_map[i]);
curr_point++;
@@ -1138,30 +1266,24 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
static void
create_start_finish_chains (void)
{
- ira_allocno_t a;
- ira_allocno_iterator ai;
+ ira_object_t obj;
+ ira_object_iterator oi;
live_range_t r;
ira_start_point_ranges
- = (live_range_t *) ira_allocate (ira_max_point
- * sizeof (live_range_t));
- memset (ira_start_point_ranges, 0,
- ira_max_point * sizeof (live_range_t));
+ = (live_range_t *) ira_allocate (ira_max_point * sizeof (live_range_t));
+ memset (ira_start_point_ranges, 0, ira_max_point * sizeof (live_range_t));
ira_finish_point_ranges
- = (live_range_t *) ira_allocate (ira_max_point
- * sizeof (live_range_t));
- memset (ira_finish_point_ranges, 0,
- ira_max_point * sizeof (live_range_t));
- FOR_EACH_ALLOCNO (a, ai)
- {
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- {
- r->start_next = ira_start_point_ranges[r->start];
- ira_start_point_ranges[r->start] = r;
- r->finish_next = ira_finish_point_ranges[r->finish];
+ = (live_range_t *) ira_allocate (ira_max_point * sizeof (live_range_t));
+ memset (ira_finish_point_ranges, 0, ira_max_point * sizeof (live_range_t));
+ FOR_EACH_OBJECT (obj, oi)
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ {
+ r->start_next = ira_start_point_ranges[r->start];
+ ira_start_point_ranges[r->start] = r;
+ r->finish_next = ira_finish_point_ranges[r->finish];
ira_finish_point_ranges[r->finish] = r;
- }
- }
+ }
}
/* Rebuild IRA_START_POINT_RANGES and IRA_FINISH_POINT_RANGES after
@@ -1183,22 +1305,21 @@ remove_some_program_points_and_update_live_ranges (void)
unsigned i;
int n;
int *map;
- ira_allocno_t a;
- ira_allocno_iterator ai;
+ ira_object_t obj;
+ ira_object_iterator oi;
live_range_t r;
bitmap born_or_died;
bitmap_iterator bi;
born_or_died = ira_allocate_bitmap ();
- FOR_EACH_ALLOCNO (a, ai)
- {
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- {
- ira_assert (r->start <= r->finish);
- bitmap_set_bit (born_or_died, r->start);
- bitmap_set_bit (born_or_died, r->finish);
- }
- }
+ FOR_EACH_OBJECT (obj, oi)
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ {
+ ira_assert (r->start <= r->finish);
+ bitmap_set_bit (born_or_died, r->start);
+ bitmap_set_bit (born_or_died, r->finish);
+ }
+
map = (int *) ira_allocate (sizeof (int) * ira_max_point);
n = 0;
EXECUTE_IF_SET_IN_BITMAP(born_or_died, 0, i, bi)
@@ -1210,14 +1331,14 @@ remove_some_program_points_and_update_live_ranges (void)
fprintf (ira_dump_file, "Compressing live ranges: from %d to %d - %d%%\n",
ira_max_point, n, 100 * n / ira_max_point);
ira_max_point = n;
- FOR_EACH_ALLOCNO (a, ai)
- {
- for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
- {
- r->start = map[r->start];
- r->finish = map[r->finish];
- }
- }
+
+ FOR_EACH_OBJECT (obj, oi)
+ for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ {
+ r->start = map[r->start];
+ r->finish = map[r->finish];
+ }
+
ira_free (map);
}
@@ -1237,12 +1358,27 @@ ira_debug_live_range_list (live_range_t r)
ira_print_live_range_list (stderr, r);
}
+/* Print live ranges of object OBJ to file F. */
+static void
+print_object_live_ranges (FILE *f, ira_object_t obj)
+{
+ ira_print_live_range_list (f, OBJECT_LIVE_RANGES (obj));
+}
+
/* Print live ranges of allocno A to file F. */
static void
print_allocno_live_ranges (FILE *f, ira_allocno_t a)
{
- fprintf (f, " a%d(r%d):", ALLOCNO_NUM (a), ALLOCNO_REGNO (a));
- ira_print_live_range_list (f, ALLOCNO_LIVE_RANGES (a));
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ fprintf (f, " a%d(r%d", ALLOCNO_NUM (a), ALLOCNO_REGNO (a));
+ if (n > 1)
+ fprintf (f, " [%d]", i);
+ fprintf (f, "):");
+ print_object_live_ranges (f, ALLOCNO_OBJECT (a, i));
+ }
}
/* Print live ranges of allocno A to stderr. */
@@ -1271,12 +1407,13 @@ ira_debug_live_ranges (void)
}
/* The main entry function creates live ranges, set up
- CONFLICT_HARD_REGS and TOTAL_CONFLICT_HARD_REGS for allocnos, and
+ CONFLICT_HARD_REGS and TOTAL_CONFLICT_HARD_REGS for objects, and
calculate register pressure info. */
void
ira_create_allocno_live_ranges (void)
{
- allocnos_live = sparseset_alloc (ira_allocnos_num);
+ objects_live = sparseset_alloc (ira_objects_num);
+ allocnos_processed = sparseset_alloc (ira_allocnos_num);
curr_point = 0;
last_call_num = 0;
allocno_saved_at_call
@@ -1290,7 +1427,8 @@ ira_create_allocno_live_ranges (void)
print_live_ranges (ira_dump_file);
/* Clean up. */
ira_free (allocno_saved_at_call);
- sparseset_free (allocnos_live);
+ sparseset_free (objects_live);
+ sparseset_free (allocnos_processed);
}
/* Compress allocno live ranges. */
diff --git a/gcc/ira.c b/gcc/ira.c
index 0f0b70ab473..a6b77cdd3df 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -319,12 +319,19 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "except.h"
#include "reload.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "integrate.h"
#include "ggc.h"
#include "ira-int.h"
+struct target_ira default_target_ira;
+struct target_ira_int default_target_ira_int;
+#if SWITCHABLE_TARGET
+struct target_ira *this_target_ira = &default_target_ira;
+struct target_ira_int *this_target_ira_int = &default_target_ira_int;
+#endif
+
/* A modified value of flag `-fira-verbose' used internally. */
int internal_flag_ira_verbose;
@@ -351,33 +358,6 @@ int ira_move_loops_num, ira_additional_jumps_num;
HARD_REG_SET eliminable_regset;
-/* Map: hard regs X modes -> set of hard registers for storing value
- of given mode starting with given hard register. */
-HARD_REG_SET ira_reg_mode_hard_regset[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES];
-
-/* Array analogous to target hook TARGET_MEMORY_MOVE_COST. */
-short int ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
-
-/* Array based on TARGET_REGISTER_MOVE_COST. */
-move_table *ira_register_move_cost[MAX_MACHINE_MODE];
-
-/* Similar to may_move_in_cost but it is calculated in IRA instead of
- regclass. Another difference is that we take only available hard
- registers into account to figure out that one register class is a
- subset of the another one. */
-move_table *ira_may_move_in_cost[MAX_MACHINE_MODE];
-
-/* Similar to may_move_out_cost but it is calculated in IRA instead of
- regclass. Another difference is that we take only available hard
- registers into account to figure out that one register class is a
- subset of the another one. */
-move_table *ira_may_move_out_cost[MAX_MACHINE_MODE];
-
-/* Register class subset relation: TRUE if the first class is a subset
- of the second one considering only hard registers available for the
- allocation. */
-int ira_class_subset_p[N_REG_CLASSES][N_REG_CLASSES];
-
/* Temporary hard reg set used for a different calculation. */
static HARD_REG_SET temp_hard_regset;
@@ -401,30 +381,8 @@ setup_reg_mode_hard_regset (void)
}
-
-/* Hard registers that can not be used for the register allocator for
- all functions of the current compilation unit. */
-static HARD_REG_SET no_unit_alloc_regs;
-
-/* Array of the number of hard registers of given class which are
- available for allocation. The order is defined by the
- allocation order. */
-short ira_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
-
-/* Array of the number of hard registers of given class which are
- available for allocation. The order is defined by the
- the hard register numbers. */
-short ira_non_ordered_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
-
-/* The number of elements of the above array for given register
- class. */
-int ira_class_hard_regs_num[N_REG_CLASSES];
-
-/* Index (in ira_class_hard_regs) for given register class and hard
- register (in general case a hard register can belong to several
- register classes). The index is negative for hard registers
- unavailable for the allocation. */
-short ira_class_hard_reg_index[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
+#define no_unit_alloc_regs \
+ (this_target_ira_int->x_no_unit_alloc_regs)
/* The function sets up the three arrays declared above. */
static void
@@ -470,10 +428,6 @@ setup_class_hard_regs (void)
}
}
-/* Number of given class hard registers available for the register
- allocation for given classes. */
-int ira_available_class_regs[N_REG_CLASSES];
-
/* Set up IRA_AVAILABLE_CLASS_REGS. */
static void
setup_available_class_regs (void)
@@ -666,11 +620,8 @@ ira_debug_disposition (void)
}
-
-/* For each reg class, table listing all the classes contained in it
- (excluding the class itself. Non-allocatable registers are
- excluded from the consideration). */
-static enum reg_class alloc_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
+#define alloc_reg_class_subclasses \
+ (this_target_ira_int->x_alloc_reg_class_subclasses)
/* Initialize the table of subclasses of each reg class. */
static void
@@ -711,29 +662,6 @@ setup_reg_subclasses (void)
-/* Number of cover classes. Cover classes is non-intersected register
- classes containing all hard-registers available for the
- allocation. */
-int ira_reg_class_cover_size;
-
-/* The array containing cover classes (see also comments for macro
- IRA_COVER_CLASSES). Only first IRA_REG_CLASS_COVER_SIZE elements are
- used for this. */
-enum reg_class ira_reg_class_cover[N_REG_CLASSES];
-
-/* The number of elements in the subsequent array. */
-int ira_important_classes_num;
-
-/* The array containing non-empty classes (including non-empty cover
- classes) which are subclasses of cover classes. Such classes is
- important for calculation of the hard register usage costs. */
-enum reg_class ira_important_classes[N_REG_CLASSES];
-
-/* The array containing indexes of important classes in the previous
- array. The array elements are defined only for important
- classes. */
-int ira_important_class_nums[N_REG_CLASSES];
-
/* Set the four global variables defined above. */
static void
setup_cover_and_important_classes (void)
@@ -838,11 +766,6 @@ setup_cover_and_important_classes (void)
= ira_reg_class_cover[j];
}
-/* Map of all register classes to corresponding cover class containing
- the given class. If given class is not a subset of a cover class,
- we translate it into the cheapest cover class. */
-enum reg_class ira_class_translate[N_REG_CLASSES];
-
/* Set up array IRA_CLASS_TRANSLATE. */
static void
setup_class_translate (void)
@@ -931,7 +854,8 @@ setup_class_translate (void)
}
/* Order numbers of cover classes in original target cover class
- array, -1 for non-cover classes. */
+ array, -1 for non-cover classes. This is only live during
+ reorder_important_classes. */
static int cover_class_order[N_REG_CLASSES];
/* The function used to sort the important classes. */
@@ -951,7 +875,7 @@ comp_reg_classes_func (const void *v1p, const void *v2p)
}
/* Reorder important classes according to the order of their cover
- classes. Set up array ira_important_class_nums too. */
+ classes. */
static void
reorder_important_classes (void)
{
@@ -963,37 +887,7 @@ reorder_important_classes (void)
cover_class_order[ira_reg_class_cover[i]] = i;
qsort (ira_important_classes, ira_important_classes_num,
sizeof (enum reg_class), comp_reg_classes_func);
- for (i = 0; i < ira_important_classes_num; i++)
- ira_important_class_nums[ira_important_classes[i]] = i;
-}
-
-/* The biggest important reg_class inside of intersection of the two
- reg_classes (that is calculated taking only hard registers
- available for allocation into account). If the both reg_classes
- contain no hard registers available for allocation, the value is
- calculated by taking all hard-registers including fixed ones into
- account. */
-enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
-
-/* True if the two classes (that is calculated taking only hard
- registers available for allocation into account) are
- intersected. */
-bool ira_reg_classes_intersect_p[N_REG_CLASSES][N_REG_CLASSES];
-
-/* Important classes with end marker LIM_REG_CLASSES which are
- supersets with given important class (the first index). That
- includes given class itself. This is calculated taking only hard
- registers available for allocation into account. */
-enum reg_class ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
-
-/* The biggest important reg_class inside of union of the two
- reg_classes (that is calculated taking only hard registers
- available for allocation into account). If the both reg_classes
- contain no hard registers available for allocation, the value is
- calculated by taking all hard-registers including fixed ones into
- account. In other words, the value is the corresponding
- reg_class_subunion value. */
-enum reg_class ira_reg_class_union[N_REG_CLASSES][N_REG_CLASSES];
+}
/* Set up the above reg class relations. */
static void
@@ -1137,11 +1031,6 @@ find_reg_class_closure (void)
-/* Map: hard register number -> cover class it belongs to. If the
- corresponding class is NO_REGS, the hard register is not available
- for allocation. */
-enum reg_class ira_hard_regno_cover_class[FIRST_PSEUDO_REGISTER];
-
/* Set up the array above. */
static void
setup_hard_regno_cover_class (void)
@@ -1167,38 +1056,20 @@ setup_hard_regno_cover_class (void)
-/* Map: register class x machine mode -> number of hard registers of
- given class needed to store value of given mode. If the number is
- different, the size will be negative. */
-int ira_reg_class_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
-
-/* Maximal value of the previous array elements. */
-int ira_max_nregs;
-
/* Form IRA_REG_CLASS_NREGS map. */
static void
setup_reg_class_nregs (void)
{
int cl, m;
- ira_max_nregs = -1;
for (cl = 0; cl < N_REG_CLASSES; cl++)
for (m = 0; m < MAX_MACHINE_MODE; m++)
- {
- ira_reg_class_nregs[cl][m] = CLASS_MAX_NREGS ((enum reg_class) cl,
- (enum machine_mode) m);
- if (ira_max_nregs < ira_reg_class_nregs[cl][m])
- ira_max_nregs = ira_reg_class_nregs[cl][m];
- }
+ ira_reg_class_nregs[cl][m] = CLASS_MAX_NREGS ((enum reg_class) cl,
+ (enum machine_mode) m);
}
-/* Array whose values are hard regset of hard registers available for
- the allocation of given register class whose HARD_REGNO_MODE_OK
- values for given mode are zero. */
-HARD_REG_SET prohibited_class_mode_regs[N_REG_CLASSES][NUM_MACHINE_MODES];
-
/* Set up PROHIBITED_CLASS_MODE_REGS. */
static void
setup_prohibited_class_mode_regs (void)
@@ -1324,14 +1195,8 @@ ira_finish_once (void)
}
-
-/* Array whose values are hard regset of hard registers for which
- move of the hard register in given mode into itself is
- prohibited. */
-HARD_REG_SET ira_prohibited_mode_move_regs[NUM_MACHINE_MODES];
-
-/* Flag of that the above array has been initialized. */
-static bool ira_prohibited_mode_move_regs_initialized_p = false;
+#define ira_prohibited_mode_move_regs_initialized_p \
+ (this_target_ira_int->x_ira_prohibited_mode_move_regs_initialized_p)
/* Set up IRA_PROHIBITED_MODE_MOVE_REGS. */
static void
@@ -1376,7 +1241,7 @@ setup_prohibited_mode_move_regs (void)
static bool
ira_bad_reload_regno_1 (int regno, rtx x)
{
- int x_regno;
+ int x_regno, n, i;
ira_allocno_t a;
enum reg_class pref;
@@ -1397,9 +1262,13 @@ ira_bad_reload_regno_1 (int regno, rtx x)
/* If the pseudo conflicts with REGNO, then we consider REGNO a
poor choice for a reload regno. */
a = ira_regno_allocno_map[x_regno];
- if (TEST_HARD_REG_BIT (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), regno))
- return true;
-
+ n = ALLOCNO_NUM_OBJECTS (a);
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ if (TEST_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno))
+ return true;
+ }
return false;
}
@@ -1742,33 +1611,73 @@ calculate_allocation_cost (void)
static void
check_allocation (void)
{
- ira_allocno_t a, conflict_a;
- int hard_regno, conflict_hard_regno, nregs, conflict_nregs;
- ira_allocno_conflict_iterator aci;
+ ira_allocno_t a;
+ int hard_regno, nregs, conflict_nregs;
ira_allocno_iterator ai;
FOR_EACH_ALLOCNO (a, ai)
{
+ int n = ALLOCNO_NUM_OBJECTS (a);
+ int i;
+
if (ALLOCNO_CAP_MEMBER (a) != NULL
|| (hard_regno = ALLOCNO_HARD_REGNO (a)) < 0)
continue;
nregs = hard_regno_nregs[hard_regno][ALLOCNO_MODE (a)];
- FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
- if ((conflict_hard_regno = ALLOCNO_HARD_REGNO (conflict_a)) >= 0)
- {
- conflict_nregs
- = (hard_regno_nregs
- [conflict_hard_regno][ALLOCNO_MODE (conflict_a)]);
- if ((conflict_hard_regno <= hard_regno
- && hard_regno < conflict_hard_regno + conflict_nregs)
- || (hard_regno <= conflict_hard_regno
- && conflict_hard_regno < hard_regno + nregs))
- {
- fprintf (stderr, "bad allocation for %d and %d\n",
- ALLOCNO_REGNO (a), ALLOCNO_REGNO (conflict_a));
- gcc_unreachable ();
- }
- }
+ if (nregs == 1)
+ /* We allocated a single hard register. */
+ n = 1;
+ else if (n > 1)
+ /* We allocated multiple hard registers, and we will test
+ conflicts in a granularity of single hard regs. */
+ nregs = 1;
+
+ for (i = 0; i < n; i++)
+ {
+ ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ ira_object_t conflict_obj;
+ ira_object_conflict_iterator oci;
+ int this_regno = hard_regno;
+ if (n > 1)
+ {
+ if (WORDS_BIG_ENDIAN)
+ this_regno += n - i - 1;
+ else
+ this_regno += i;
+ }
+ FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
+ {
+ ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj);
+ int conflict_hard_regno = ALLOCNO_HARD_REGNO (conflict_a);
+ if (conflict_hard_regno < 0)
+ continue;
+
+ conflict_nregs
+ = (hard_regno_nregs
+ [conflict_hard_regno][ALLOCNO_MODE (conflict_a)]);
+
+ if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1
+ && conflict_nregs == ALLOCNO_NUM_OBJECTS (conflict_a))
+ {
+ if (WORDS_BIG_ENDIAN)
+ conflict_hard_regno += (ALLOCNO_NUM_OBJECTS (conflict_a)
+ - OBJECT_SUBWORD (conflict_obj) - 1);
+ else
+ conflict_hard_regno += OBJECT_SUBWORD (conflict_obj);
+ conflict_nregs = 1;
+ }
+
+ if ((conflict_hard_regno <= this_regno
+ && this_regno < conflict_hard_regno + conflict_nregs)
+ || (this_regno <= conflict_hard_regno
+ && conflict_hard_regno < this_regno + nregs))
+ {
+ fprintf (stderr, "bad allocation for %d and %d\n",
+ ALLOCNO_REGNO (a), ALLOCNO_REGNO (conflict_a));
+ gcc_unreachable ();
+ }
+ }
+ }
}
}
#endif
diff --git a/gcc/ira.h b/gcc/ira.h
index 12b4b42017a..46ea89e4bae 100644
--- a/gcc/ira.h
+++ b/gcc/ira.h
@@ -20,36 +20,6 @@ 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/>. */
-/* Number of given class hard registers available for the register
- allocation for given classes. */
-extern int ira_available_class_regs[N_REG_CLASSES];
-
-/* Map: hard register number -> cover class it belongs to. If the
- corresponding class is NO_REGS, the hard register is not available
- for allocation. */
-extern enum reg_class ira_hard_regno_cover_class[FIRST_PSEUDO_REGISTER];
-
-/* Number of cover classes. Cover classes is non-intersected register
- classes containing all hard-registers available for the
- allocation. */
-extern int ira_reg_class_cover_size;
-
-/* The array containing cover classes (see also comments for macro
- IRA_COVER_CLASSES). Only first IRA_REG_CLASS_COVER_SIZE elements are
- used for this. */
-extern enum reg_class ira_reg_class_cover[N_REG_CLASSES];
-
-/* Map of all register classes to corresponding cover class containing
- the given class. If given class is not a subset of a cover class,
- we translate it into the cheapest cover class. */
-extern enum reg_class ira_class_translate[N_REG_CLASSES];
-
-/* Map: register class x machine mode -> number of hard registers of
- given class needed to store value of given mode. If the number for
- some hard-registers of the register class is different, the size
- will be negative. */
-extern int ira_reg_class_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
-
/* Function specific hard registers can not be used for the register
allocation. */
extern HARD_REG_SET ira_no_alloc_regs;
@@ -58,17 +28,75 @@ extern HARD_REG_SET ira_no_alloc_regs;
mode or when the conflict table is too big. */
extern bool ira_conflicts_p;
-/* Array analogous to target hook TARGET_MEMORY_MOVE_COST. */
-extern short ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
-
-/* Array of number of hard registers of given class which are
- available for the allocation. The order is defined by the
- allocation order. */
-extern short ira_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
-
-/* The number of elements of the above array for given register
- class. */
-extern int ira_class_hard_regs_num[N_REG_CLASSES];
+struct target_ira {
+ /* Number of given class hard registers available for the register
+ allocation for given classes. */
+ int x_ira_available_class_regs[N_REG_CLASSES];
+
+ /* Map: hard register number -> cover class it belongs to. If the
+ corresponding class is NO_REGS, the hard register is not available
+ for allocation. */
+ enum reg_class x_ira_hard_regno_cover_class[FIRST_PSEUDO_REGISTER];
+
+ /* Number of cover classes. Cover classes is non-intersected register
+ classes containing all hard-registers available for the
+ allocation. */
+ int x_ira_reg_class_cover_size;
+
+ /* The array containing cover classes (see also comments for macro
+ IRA_COVER_CLASSES;. Only first IRA_REG_CLASS_COVER_SIZE elements are
+ used for this. */
+ enum reg_class x_ira_reg_class_cover[N_REG_CLASSES];
+
+ /* Map of all register classes to corresponding cover class containing
+ the given class. If given class is not a subset of a cover class,
+ we translate it into the cheapest cover class. */
+ enum reg_class x_ira_class_translate[N_REG_CLASSES];
+
+ /* Map: register class x machine mode -> number of hard registers of
+ given class needed to store value of given mode. If the number for
+ some hard-registers of the register class is different, the size
+ will be negative. */
+ int x_ira_reg_class_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
+
+ /* Array analogous to target hook TARGET_MEMORY_MOVE_COST. */
+ short x_ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
+
+ /* Array of number of hard registers of given class which are
+ available for the allocation. The order is defined by the
+ allocation order. */
+ short x_ira_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
+
+ /* The number of elements of the above array for given register
+ class. */
+ int x_ira_class_hard_regs_num[N_REG_CLASSES];
+};
+
+extern struct target_ira default_target_ira;
+#if SWITCHABLE_TARGET
+extern struct target_ira *this_target_ira;
+#else
+#define this_target_ira (&default_target_ira)
+#endif
+
+#define ira_available_class_regs \
+ (this_target_ira->x_ira_available_class_regs)
+#define ira_hard_regno_cover_class \
+ (this_target_ira->x_ira_hard_regno_cover_class)
+#define ira_reg_class_cover_size \
+ (this_target_ira->x_ira_reg_class_cover_size)
+#define ira_reg_class_cover \
+ (this_target_ira->x_ira_reg_class_cover)
+#define ira_class_translate \
+ (this_target_ira->x_ira_class_translate)
+#define ira_reg_class_nregs \
+ (this_target_ira->x_ira_reg_class_nregs)
+#define ira_memory_move_cost \
+ (this_target_ira->x_ira_memory_move_cost)
+#define ira_class_hard_regs \
+ (this_target_ira->x_ira_class_hard_regs)
+#define ira_class_hard_regs_num \
+ (this_target_ira->x_ira_class_hard_regs_num)
extern void ira_init_once (void);
extern void ira_init (void);
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index e7589638f54..372739ff5a7 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,49 @@
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
+ * boehm.c: Likewise.
+ * class.c: Likewise.
+ * decl.c: Likewise.
+ * expr.c: Likewise.
+ * jcf-parse.c: Likewise.
+ * typeck.c: Likewise.
+ * verify-glue.c: Likewise.
+
+2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * boehm.c: Include diagnostic-core.h in every file that includes
+ toplev.h.
+ * class.c: Likewise.
+ * constants.c: Likewise.
+ * decl.c: Likewise.
+ * except.c: Likewise.
+ * expr.c: Likewise.
+ * jcf-parse.c: Likewise.
+ * mangle.c: Likewise.
+ * mangle_name.c: Likewise.
+ * resource.c: Likewise.
+ * typeck.c: Likewise.
+ * verify-glue.c: Likewise.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR bootstrap/44825
+ * class.c (make_class_data): Cast result of VEC_length calls to int.
+
+2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
+
+ * constants.c (build_constants_constructor): Use build_constructor
+ instead of build_constructor_from_list.
+ * class.c (make_method_value): Likewise.
+ (get_dispatch_table): Likewise.
+ (make_class_data): Likewise.
+ (emit_indirect_register_classes): Likewise.
+ (emit_symbol_table): Likewise.
+ (add_assertion_table_entry): Likewise.
+ (emit_assertion_table): Likewise.
+ (make_field_value): Use build_constructor_single instead of
+ build_constructor_from_list.
+
2010-06-28 Nathan Froyd <froydnj@codesourcery.com>
* java-tree.h (struct lang_type) [catch_classes]: Change type to a
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c
index 35ba68d0fb3..2a0690ce51d 100644
--- a/gcc/java/boehm.c
+++ b/gcc/java/boehm.c
@@ -32,6 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "parse.h"
+#include "diagnostic-core.h"
#include "toplev.h"
static void mark_reference_fields (tree, double_int *, unsigned int,
@@ -62,10 +63,10 @@ mark_reference_fields (tree field,
mask, ubit,
pointer_after_end, all_bits_set,
last_set_index, last_view_index);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
}
- for (; field != NULL_TREE; field = TREE_CHAIN (field))
+ for (; field != NULL_TREE; field = DECL_CHAIN (field))
{
HOST_WIDE_INT offset;
HOST_WIDE_INT size_bytes;
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 74859411758..527c4e6fb9a 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -323,7 +323,8 @@ compareAndSwapInt_builtin (tree method_return_type ATTRIBUTE_UNUSED,
tree orig_call)
{
enum machine_mode mode = TYPE_MODE (int_type_node);
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing
|| flag_use_atomic_builtins)
{
tree addr, stmt;
@@ -344,7 +345,8 @@ compareAndSwapLong_builtin (tree method_return_type ATTRIBUTE_UNUSED,
tree orig_call)
{
enum machine_mode mode = TYPE_MODE (long_type_node);
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing
|| (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (word_mode)
&& flag_use_atomic_builtins))
/* We don't trust flag_use_atomic_builtins for multi-word
@@ -368,7 +370,8 @@ compareAndSwapObject_builtin (tree method_return_type ATTRIBUTE_UNUSED,
tree orig_call)
{
enum machine_mode mode = TYPE_MODE (ptr_type_node);
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing
|| flag_use_atomic_builtins)
{
tree addr, stmt;
@@ -448,7 +451,8 @@ VMSupportsCS8_builtin (tree method_return_type,
{
enum machine_mode mode = TYPE_MODE (long_type_node);
gcc_assert (method_return_type == boolean_type_node);
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing)
return boolean_true_node;
else
return boolean_false_node;
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 7d90a032a81..78f77ab2d26 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -32,6 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "java-tree.h"
#include "jcf.h"
#include "obstack.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "parse.h"
@@ -781,7 +782,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl) =
htab_create_ggc (50, htab_hash_pointer, htab_eq_pointer, NULL);
- TREE_CHAIN (fndecl) = TYPE_METHODS (this_class);
+ DECL_CHAIN (fndecl) = TYPE_METHODS (this_class);
TYPE_METHODS (this_class) = fndecl;
/* If pointers to member functions use the least significant bit to
@@ -852,7 +853,7 @@ add_field (tree klass, tree name, tree field_type, int flags)
tree field;
field = build_decl (input_location,
is_static ? VAR_DECL : FIELD_DECL, name, field_type);
- TREE_CHAIN (field) = TYPE_FIELDS (klass);
+ DECL_CHAIN (field) = TYPE_FIELDS (klass);
TYPE_FIELDS (klass) = field;
DECL_CONTEXT (field) = klass;
MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (field);
@@ -1453,20 +1454,21 @@ make_field_value (tree fdecl)
{
tree field_address = integer_zero_node;
+ tree index, value;
if ((DECL_INITIAL (fdecl) || ! flag_indirect_classes)
&& FIELD_STATIC (fdecl))
field_address = build_address_of (fdecl);
+ index = (FIELD_STATIC (fdecl)
+ ? DECL_CHAIN (TYPE_FIELDS (field_info_union_node))
+ : TYPE_FIELDS (field_info_union_node));
+ value = (FIELD_STATIC (fdecl)
+ ? field_address
+ : byte_position (fdecl));
+
PUSH_FIELD_VALUE
(v, "info",
- build_constructor_from_list (field_info_union_node,
- build_tree_list
- ((FIELD_STATIC (fdecl)
- ? TREE_CHAIN (TYPE_FIELDS (field_info_union_node))
- : TYPE_FIELDS (field_info_union_node)),
- (FIELD_STATIC (fdecl)
- ? field_address
- : byte_position (fdecl)))));
+ build_constructor_single (field_info_union_node, index, value));
}
FINISH_RECORD_CONSTRUCTOR (finit, v, field_type_node);
@@ -1524,14 +1526,23 @@ make_method_value (tree mdecl)
{
/* Compute the `throws' information for the method. */
tree table = null_pointer_node;
- if (DECL_FUNCTION_THROWS (mdecl) != NULL)
+
+ if (!VEC_empty (tree, DECL_FUNCTION_THROWS (mdecl)))
{
int length = 1 + VEC_length (tree, DECL_FUNCTION_THROWS (mdecl));
tree t, type, array;
char buf[60];
- unsigned ix;
+ VEC(constructor_elt,gc) *v = NULL;
+ int idx = length - 1;
+ unsigned ix;
+ constructor_elt *e;
+
+ v = VEC_alloc (constructor_elt, gc, length);
+ VEC_safe_grow_cleared (constructor_elt, gc, v, length);
+
+ e = VEC_index (constructor_elt, v, idx--);
+ e->value = null_pointer_node;
- table = tree_cons (NULL_TREE, table, NULL_TREE);
for (ix = 0;
VEC_iterate (tree, DECL_FUNCTION_THROWS (mdecl), ix, t);
ix++)
@@ -1540,10 +1551,12 @@ make_method_value (tree mdecl)
tree utf8
= build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig),
IDENTIFIER_LENGTH (sig)));
- table = tree_cons (NULL_TREE, utf8, table);
+ e = VEC_index (constructor_elt, v, idx--);
+ e->value = utf8;
}
+ gcc_assert (idx == -1);
type = build_prim_array_type (ptr_type_node, length);
- table = build_constructor_from_list (type, table);
+ table = build_constructor (type, v);
/* Compute something unique enough. */
sprintf (buf, "_methods%d", method_name_count++);
array = build_decl (input_location,
@@ -1586,7 +1599,7 @@ get_dispatch_vector (tree type)
}
for (method = TYPE_METHODS (type); method != NULL_TREE;
- method = TREE_CHAIN (method))
+ method = DECL_CHAIN (method))
{
tree method_index = get_method_index (method);
if (method_index != NULL_TREE
@@ -1604,11 +1617,22 @@ get_dispatch_table (tree type, tree this_class_addr)
int abstract_p = CLASS_ABSTRACT (TYPE_NAME (type));
tree vtable = get_dispatch_vector (type);
int i, j;
- tree list = NULL_TREE;
int nvirtuals = TREE_VEC_LENGTH (vtable);
int arraysize;
tree gc_descr;
+ VEC(constructor_elt,gc) *v = NULL;
+ constructor_elt *e;
+ tree arraytype;
+
+ arraysize = (TARGET_VTABLE_USES_DESCRIPTORS? nvirtuals + 1 : nvirtuals + 2);
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ arraysize *= TARGET_VTABLE_USES_DESCRIPTORS;
+ arraysize += 2;
+
+ VEC_safe_grow_cleared (constructor_elt, gc, v, arraysize);
+ e = VEC_index (constructor_elt, v, arraysize - 1);
+#define CONSTRUCTOR_PREPEND_VALUE(E, V) E->value = V, E--
for (i = nvirtuals; --i >= 0; )
{
tree method = TREE_VEC_ELT (vtable, i);
@@ -1620,9 +1644,9 @@ get_dispatch_table (tree type, tree this_class_addr)
if (TARGET_VTABLE_USES_DESCRIPTORS)
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
- list = tree_cons (NULL_TREE, null_pointer_node, list);
+ CONSTRUCTOR_PREPEND_VALUE (e, null_pointer_node);
else
- list = tree_cons (NULL_TREE, null_pointer_node, list);
+ CONSTRUCTOR_PREPEND_VALUE (e, null_pointer_node);
}
else
{
@@ -1632,13 +1656,13 @@ get_dispatch_table (tree type, tree this_class_addr)
tree fdesc = build2 (FDESC_EXPR, nativecode_ptr_type_node,
method, build_int_cst (NULL_TREE, j));
TREE_CONSTANT (fdesc) = 1;
- list = tree_cons (NULL_TREE, fdesc, list);
+ CONSTRUCTOR_PREPEND_VALUE (e, fdesc);
}
else
- list = tree_cons (NULL_TREE,
- build1 (ADDR_EXPR, nativecode_ptr_type_node,
- method),
- list);
+ CONSTRUCTOR_PREPEND_VALUE (e,
+ build1 (ADDR_EXPR,
+ nativecode_ptr_type_node,
+ method));
}
}
@@ -1651,23 +1675,21 @@ get_dispatch_table (tree type, tree this_class_addr)
pointer, and subsequent words (usually one) contain the GC descriptor.
In all other cases, we reserve two extra vtable slots. */
gc_descr = get_boehm_type_descriptor (type);
- list = tree_cons (NULL_TREE, gc_descr, list);
+ CONSTRUCTOR_PREPEND_VALUE (e, gc_descr);
for (j = 1; j < TARGET_VTABLE_USES_DESCRIPTORS-1; ++j)
- list = tree_cons (NULL_TREE, gc_descr, list);
- list = tree_cons (NULL_TREE, this_class_addr, list);
+ CONSTRUCTOR_PREPEND_VALUE (e, gc_descr);
+ CONSTRUCTOR_PREPEND_VALUE (e, this_class_addr);
/** Pointer to type_info object (to be implemented), according to g++ ABI. */
- list = tree_cons (NULL_TREE, null_pointer_node, list);
+ CONSTRUCTOR_PREPEND_VALUE (e, null_pointer_node);
/** Offset to start of whole object. Always (ptrdiff_t)0 for Java. */
- list = tree_cons (integer_zero_node, null_pointer_node, list);
+ gcc_assert (e == VEC_address (constructor_elt, v));
+ e->index = integer_zero_node;
+ e->value = null_pointer_node;
+#undef CONSTRUCTOR_PREPEND_VALUE
- arraysize = (TARGET_VTABLE_USES_DESCRIPTORS? nvirtuals + 1 : nvirtuals + 2);
- if (TARGET_VTABLE_USES_DESCRIPTORS)
- arraysize *= TARGET_VTABLE_USES_DESCRIPTORS;
- arraysize += 2;
- return build_constructor_from_list
- (build_prim_array_type (nativecode_ptr_type_node,
- arraysize), list);
+ arraytype = build_prim_array_type (nativecode_ptr_type_node, arraysize);
+ return build_constructor (arraytype, v);
}
@@ -1751,14 +1773,11 @@ make_class_data (tree type)
{
tree decl, cons, temp;
tree field, fields_decl;
- tree static_fields = NULL_TREE;
- tree instance_fields = NULL_TREE;
HOST_WIDE_INT static_field_count = 0;
HOST_WIDE_INT instance_field_count = 0;
HOST_WIDE_INT field_count;
tree field_array_type;
tree method;
- tree methods = NULL_TREE;
tree dtable_decl = NULL_TREE;
HOST_WIDE_INT method_count = 0;
tree method_array_type;
@@ -1779,6 +1798,9 @@ make_class_data (tree type)
tree first_real_field;
VEC(constructor_elt,gc) *v1 = NULL, *v2 = NULL;
tree reflection_data;
+ VEC(constructor_elt,gc) *static_fields = NULL;
+ VEC(constructor_elt,gc) *instance_fields = NULL;
+ VEC(constructor_elt,gc) *methods = NULL;
this_class_addr = build_static_class_ref (type);
decl = TREE_OPERAND (this_class_addr, 0);
@@ -1820,13 +1842,13 @@ make_class_data (tree type)
/* Build Field array. */
field = TYPE_FIELDS (type);
while (field && DECL_ARTIFICIAL (field))
- field = TREE_CHAIN (field); /* Skip dummy fields. */
+ field = DECL_CHAIN (field); /* Skip dummy fields. */
if (field && DECL_NAME (field) == NULL_TREE)
- field = TREE_CHAIN (field); /* Skip dummy field for inherited data. */
+ field = DECL_CHAIN (field); /* Skip dummy field for inherited data. */
first_real_field = field;
/* First count static and instance fields. */
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
+ for ( ; field != NULL_TREE; field = DECL_CHAIN (field))
{
if (! DECL_ARTIFICIAL (field))
{
@@ -1855,7 +1877,7 @@ make_class_data (tree type)
for (i = 0, field = first_real_field;
field != NULL_TREE;
- field = TREE_CHAIN (field), i++)
+ field = DECL_CHAIN (field), i++)
{
if (! DECL_ARTIFICIAL (field))
{
@@ -1872,7 +1894,7 @@ make_class_data (tree type)
}
for (field = first_real_field; field != NULL_TREE;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
{
if (! DECL_ARTIFICIAL (field))
{
@@ -1882,7 +1904,7 @@ make_class_data (tree type)
as it is used in the creation of the field itself. */
tree init = make_field_value (field);
tree initial = DECL_INITIAL (field);
- static_fields = tree_cons (NULL_TREE, init, static_fields);
+ CONSTRUCTOR_APPEND_ELT (static_fields, NULL_TREE, init);
/* If the initial value is a string constant,
prevent output_constant from trying to assemble the value. */
if (initial != NULL_TREE
@@ -1894,22 +1916,25 @@ make_class_data (tree type)
else if (uses_jv_markobj || !flag_reduced_reflection)
{
tree init = make_field_value (field);
- instance_fields = tree_cons (NULL_TREE, init, instance_fields);
+ CONSTRUCTOR_APPEND_ELT (instance_fields, NULL_TREE, init);
}
}
}
+ gcc_assert (static_field_count
+ == (int) VEC_length (constructor_elt, static_fields));
+ gcc_assert (instance_field_count
+ == (int) VEC_length (constructor_elt, instance_fields));
+
if (field_count > 0)
{
- static_fields = nreverse (static_fields);
- instance_fields = nreverse (instance_fields);
- static_fields = chainon (static_fields, instance_fields);
+ VEC_safe_splice (constructor_elt, gc, static_fields, instance_fields);
field_array_type = build_prim_array_type (field_type_node, field_count);
fields_decl = build_decl (input_location,
VAR_DECL, mangled_classname ("_FL_", type),
field_array_type);
- DECL_INITIAL (fields_decl) = build_constructor_from_list
- (field_array_type, static_fields);
+ DECL_INITIAL (fields_decl)
+ = build_constructor (field_array_type, static_fields);
TREE_STATIC (fields_decl) = 1;
DECL_ARTIFICIAL (fields_decl) = 1;
DECL_IGNORED_P (fields_decl) = 1;
@@ -1920,7 +1945,7 @@ make_class_data (tree type)
/* Build Method array. */
for (method = TYPE_METHODS (type);
- method != NULL_TREE; method = TREE_CHAIN (method))
+ method != NULL_TREE; method = DECL_CHAIN (method))
{
tree init;
if (METHOD_PRIVATE (method)
@@ -1958,15 +1983,14 @@ make_class_data (tree type)
{
init = make_method_value (method);
method_count++;
- methods = tree_cons (NULL_TREE, init, methods);
+ CONSTRUCTOR_APPEND_ELT (methods, NULL_TREE, init);
}
}
method_array_type = build_prim_array_type (method_type_node, method_count);
methods_decl = build_decl (input_location,
VAR_DECL, mangled_classname ("_MT_", type),
method_array_type);
- DECL_INITIAL (methods_decl) = build_constructor_from_list
- (method_array_type, nreverse (methods));
+ DECL_INITIAL (methods_decl) = build_constructor (method_array_type, methods);
TREE_STATIC (methods_decl) = 1;
DECL_ARTIFICIAL (methods_decl) = 1;
DECL_IGNORED_P (methods_decl) = 1;
@@ -2004,16 +2028,17 @@ make_class_data (tree type)
if (interface_len > 0)
{
- tree init = NULL_TREE;
int i;
tree interface_array_type, idecl;
+ VEC(constructor_elt,gc) *init = VEC_alloc (constructor_elt, gc,
+ interface_len);
interface_array_type
= build_prim_array_type (class_ptr_type, interface_len);
idecl = build_decl (input_location,
VAR_DECL, mangled_classname ("_IF_", type),
interface_array_type);
- for (i = interface_len; i > 0; i--)
+ for (i = 1; i <= interface_len; i++)
{
tree child = BINFO_BASE_BINFO (TYPE_BINFO (type), i);
tree iclass = BINFO_TYPE (child);
@@ -2027,10 +2052,9 @@ make_class_data (tree type)
int int_index = alloc_class_constant (iclass);
index = build_int_cst (ptr_type_node, int_index);
}
- init = tree_cons (NULL_TREE, index, init);
+ CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, index);
}
- DECL_INITIAL (idecl) = build_constructor_from_list (interface_array_type,
- init);
+ DECL_INITIAL (idecl) = build_constructor (interface_array_type, init);
TREE_STATIC (idecl) = 1;
DECL_ARTIFICIAL (idecl) = 1;
DECL_IGNORED_P (idecl) = 1;
@@ -2366,7 +2390,7 @@ push_super_field (tree this_class, tree super_class)
base_decl = build_decl (input_location,
FIELD_DECL, NULL_TREE, super_class);
DECL_IGNORED_P (base_decl) = 1;
- TREE_CHAIN (base_decl) = TYPE_FIELDS (this_class);
+ DECL_CHAIN (base_decl) = TYPE_FIELDS (this_class);
TYPE_FIELDS (this_class) = base_decl;
DECL_SIZE (base_decl) = TYPE_SIZE (super_class);
DECL_SIZE_UNIT (base_decl) = TYPE_SIZE_UNIT (super_class);
@@ -2526,7 +2550,7 @@ add_miranda_methods (tree base_class, tree search_class)
will be correct. This code must match similar layout code in the
runtime. */
for (method_decl = TYPE_METHODS (elt);
- method_decl; method_decl = TREE_CHAIN (method_decl))
+ method_decl; method_decl = DECL_CHAIN (method_decl))
{
tree sig, override;
@@ -2590,7 +2614,7 @@ layout_class_methods (tree this_class)
TYPE_METHODS (this_class) = nreverse (TYPE_METHODS (this_class));
for (method_decl = TYPE_METHODS (this_class);
- method_decl; method_decl = TREE_CHAIN (method_decl))
+ method_decl; method_decl = DECL_CHAIN (method_decl))
dtable_count = layout_class_method (this_class, super_class,
method_decl, dtable_count);
@@ -2605,7 +2629,7 @@ get_interface_method_index (tree method, tree interface)
tree meth;
int i = 1;
- for (meth = TYPE_METHODS (interface); ; meth = TREE_CHAIN (meth))
+ for (meth = TYPE_METHODS (interface); ; meth = DECL_CHAIN (meth))
{
if (meth == method)
return i;
@@ -2729,8 +2753,8 @@ emit_indirect_register_classes (tree *list_p)
tree klass, t, register_class_fn;
int i;
- tree init = NULL_TREE;
int size = VEC_length (tree, registered_class) * 2 + 1;
+ VEC(constructor_elt,gc) *init = VEC_alloc (constructor_elt, gc, size);
tree class_array_type
= build_prim_array_type (ptr_type_node, size);
tree cdecl = build_decl (input_location,
@@ -2739,18 +2763,14 @@ emit_indirect_register_classes (tree *list_p)
tree reg_class_list;
for (i = 0; VEC_iterate (tree, registered_class, i, klass); ++i)
{
- init = tree_cons (NULL_TREE,
- fold_convert (ptr_type_node,
- build_static_class_ref (klass)), init);
- init = tree_cons
- (NULL_TREE,
- fold_convert (ptr_type_node,
- build_address_of (build_classdollar_field (klass))),
- init);
- }
- init = tree_cons (NULL_TREE, integer_zero_node, init);
- DECL_INITIAL (cdecl) = build_constructor_from_list (class_array_type,
- nreverse (init));
+ t = fold_convert (ptr_type_node, build_static_class_ref (klass));
+ CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, t);
+ t = fold_convert (ptr_type_node,
+ build_address_of (build_classdollar_field (klass)));
+ CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, t);
+ }
+ CONSTRUCTOR_APPEND_ELT (init, NULL_TREE, integer_zero_node);
+ DECL_INITIAL (cdecl) = build_constructor (class_array_type, init);
TREE_CONSTANT (DECL_INITIAL (cdecl)) = 1;
TREE_STATIC (cdecl) = 1;
DECL_ARTIFICIAL (cdecl) = 1;
@@ -2896,10 +2916,10 @@ emit_symbol_table (tree name, tree the_table,
tree the_syms_decl, tree the_array_element_type,
int element_size)
{
- tree table, list, null_symbol;
- tree table_size, the_array_type;
+ tree table, null_symbol, table_size, the_array_type;
unsigned index;
method_entry *e;
+ VEC(constructor_elt,gc) *v = NULL;
/* Only emit a table if this translation unit actually made any
references via it. */
@@ -2907,21 +2927,17 @@ emit_symbol_table (tree name, tree the_table,
return the_table;
/* Build a list of _Jv_MethodSymbols for each entry in otable_methods. */
- list = NULL_TREE;
for (index = 0; VEC_iterate (method_entry, decl_table, index, e); index++)
- list = tree_cons (NULL_TREE,
- build_symbol_entry (e->method, e->special),
- list);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_symbol_entry (e->method, e->special));
/* Terminate the list with a "null" entry. */
null_symbol = build_symbol_table_entry (null_pointer_node,
null_pointer_node,
null_pointer_node);
- list = tree_cons (NULL_TREE, null_symbol, list);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_symbol);
- /* Put the list in the right order and make it a constructor. */
- list = nreverse (list);
- table = build_constructor_from_list (symbols_array_type, list);
+ table = build_constructor (symbols_array_type, v);
/* Make it the initial value for otable_syms and emit the decl. */
DECL_INITIAL (the_syms_decl) = table;
@@ -3033,7 +3049,7 @@ add_assertion_table_entry (void **htab_entry, void *ptr)
{
tree entry;
tree code_val, op1_utf8, op2_utf8;
- tree *list = (tree *) ptr;
+ VEC(constructor_elt,gc) **v = (VEC(constructor_elt,gc) **) ptr;
type_assertion *as = (type_assertion *) *htab_entry;
code_val = build_int_cst (NULL_TREE, as->assertion_code);
@@ -3050,7 +3066,7 @@ add_assertion_table_entry (void **htab_entry, void *ptr)
entry = build_assertion_table_entry (code_val, op1_utf8, op2_utf8);
- *list = tree_cons (NULL_TREE, entry, *list);
+ CONSTRUCTOR_APPEND_ELT (*v, NULL_TREE, entry);
return true;
}
@@ -3060,22 +3076,20 @@ static tree
emit_assertion_table (tree klass)
{
tree null_entry, ctor, table_decl;
- tree list = NULL_TREE;
htab_t assertions_htab = TYPE_ASSERTIONS (klass);
+ VEC(constructor_elt,gc) *v = NULL;
/* Iterate through the hash table. */
- htab_traverse (assertions_htab, add_assertion_table_entry, &list);
+ htab_traverse (assertions_htab, add_assertion_table_entry, &v);
/* Finish with a null entry. */
null_entry = build_assertion_table_entry (integer_zero_node,
null_pointer_node,
null_pointer_node);
- list = tree_cons (NULL_TREE, null_entry, list);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_entry);
- /* Put the list in the right order and make it a constructor. */
- list = nreverse (list);
- ctor = build_constructor_from_list (assertion_table_type, list);
+ ctor = build_constructor (assertion_table_type, v);
table_decl = build_decl (input_location,
VAR_DECL, mangled_classname ("_type_assert_", klass),
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index f018a707911..14410d1df18 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -28,6 +28,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "jcf.h"
#include "tree.h"
#include "java-tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
@@ -501,11 +502,23 @@ build_constants_constructor (void)
CPool *outgoing_cpool = cpool_for_class (current_class);
tree tags_value, data_value;
tree cons;
- tree tags_list = NULL_TREE;
- tree data_list = NULL_TREE;
VEC(constructor_elt,gc) *v = NULL;
int i;
+ VEC(constructor_elt,gc) *tags = NULL;
+ VEC(constructor_elt,gc) *data = NULL;
+ constructor_elt *t = NULL;
+ constructor_elt *d = NULL;
+ if (outgoing_cpool->count > 0)
+ {
+ int c = outgoing_cpool->count;
+ VEC_safe_grow_cleared (constructor_elt, gc, tags, c);
+ VEC_safe_grow_cleared (constructor_elt, gc, data, c);
+ t = VEC_index (constructor_elt, tags, c-1);
+ d = VEC_index (constructor_elt, data, c-1);
+ }
+
+#define CONSTRUCTOR_PREPEND_VALUE(E, V) E->value = V, E--
for (i = outgoing_cpool->count; --i > 0; )
switch (outgoing_cpool->tags[i] & ~CONSTANT_LazyFlag)
{
@@ -530,14 +543,11 @@ build_constants_constructor (void)
if (BYTES_BIG_ENDIAN && POINTER_SIZE > 32)
temp <<= POINTER_SIZE - 32;
- tags_list
- = tree_cons (NULL_TREE, get_tag_node (outgoing_cpool->tags[i]),
- tags_list);
- data_list
- = tree_cons (NULL_TREE,
- fold_convert (ptr_type_node,
- (build_int_cst (NULL_TREE, temp))),
- data_list);
+ CONSTRUCTOR_PREPEND_VALUE (t, get_tag_node (outgoing_cpool->tags[i]));
+ CONSTRUCTOR_PREPEND_VALUE (d,
+ fold_convert (ptr_type_node,
+ (build_int_cst (NULL_TREE,
+ temp))));
}
break;
@@ -545,17 +555,15 @@ build_constants_constructor (void)
case CONSTANT_String:
case CONSTANT_Unicode:
case CONSTANT_Utf8:
- tags_list
- = tree_cons (NULL_TREE, get_tag_node (outgoing_cpool->tags[i]),
- tags_list);
- data_list
- = tree_cons (NULL_TREE, build_utf8_ref (outgoing_cpool->data[i].t),
- data_list);
+ CONSTRUCTOR_PREPEND_VALUE (t, get_tag_node (outgoing_cpool->tags[i]));
+ CONSTRUCTOR_PREPEND_VALUE (d, build_utf8_ref (outgoing_cpool->data[i].t));
break;
default:
gcc_assert (false);
}
+#undef CONSTRUCTOR_PREPEND_VALUE
+
if (outgoing_cpool->count > 0)
{
tree data_decl, tags_decl, tags_type;
@@ -564,8 +572,10 @@ build_constants_constructor (void)
tree tem;
/* Add dummy 0'th element of constant pool. */
- tags_list = tree_cons (NULL_TREE, get_tag_node (0), tags_list);
- data_list = tree_cons (NULL_TREE, null_pointer_node, data_list);
+ gcc_assert (t == VEC_address (constructor_elt, tags));
+ gcc_assert (d == VEC_address (constructor_elt, data));
+ t->value = get_tag_node (0);
+ d->value = null_pointer_node;
/* Change the type of the decl to have the proper array size.
??? Make sure to transition the old type-pointer-to list to this
@@ -577,8 +587,7 @@ build_constants_constructor (void)
TYPE_POINTER_TO (TREE_TYPE (data_decl)) = NULL_TREE;
TREE_TYPE (data_decl) = build_array_type (ptr_type_node, index_type);
TYPE_POINTER_TO (TREE_TYPE (data_decl)) = tem;
- DECL_INITIAL (data_decl) = build_constructor_from_list
- (TREE_TYPE (data_decl), data_list);
+ DECL_INITIAL (data_decl) = build_constructor (TREE_TYPE (data_decl), data);
DECL_SIZE (data_decl) = TYPE_SIZE (TREE_TYPE (data_decl));
DECL_SIZE_UNIT (data_decl) = TYPE_SIZE_UNIT (TREE_TYPE (data_decl));
rest_of_decl_compilation (data_decl, 1, 0);
@@ -590,8 +599,7 @@ build_constants_constructor (void)
current_class),
tags_type);
TREE_STATIC (tags_decl) = 1;
- DECL_INITIAL (tags_decl) = build_constructor_from_list
- (tags_type, tags_list);
+ DECL_INITIAL (tags_decl) = build_constructor (tags_type, tags);
rest_of_decl_compilation (tags_decl, 1, 0);
tags_value = build_address_of (tags_decl);
}
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index d3e671067a6..36a2c2916e0 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -29,6 +29,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "system.h"
#include "coretypes.h"
#include "tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "flags.h"
#include "java-tree.h"
@@ -824,7 +825,7 @@ java_init_decl_processing (void)
if (! flag_hash_synchronization)
PUSH_FIELD (input_location, object_type_node, field, "sync_info",
build_pointer_type (object_type_node));
- for (t = TYPE_FIELDS (object_type_node); t != NULL_TREE; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (object_type_node); t != NULL_TREE; t = DECL_CHAIN (t))
FIELD_PRIVATE (t) = 1;
FINISH_RECORD (object_type_node);
@@ -906,7 +907,7 @@ java_init_decl_processing (void)
PUSH_FIELD (input_location, class_type_node, field, "engine", ptr_type_node);
PUSH_FIELD (input_location,
class_type_node, field, "reflection_data", ptr_type_node);
- for (t = TYPE_FIELDS (class_type_node); t != NULL_TREE; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (class_type_node); t != NULL_TREE; t = DECL_CHAIN (t))
FIELD_PRIVATE (t) = 1;
push_super_field (class_type_node, object_type_node);
@@ -1214,7 +1215,7 @@ lookup_name_current_level (tree name)
if (IDENTIFIER_LOCAL_VALUE (name) == 0)
return 0;
- for (t = current_binding_level->names; t; t = TREE_CHAIN (t))
+ for (t = current_binding_level->names; t; t = DECL_CHAIN (t))
if (DECL_NAME (t) == name)
break;
@@ -1283,7 +1284,7 @@ pushdecl (tree x)
/* Put decls on list in reverse order.
We will reverse them later if necessary. */
- TREE_CHAIN (x) = b->names;
+ DECL_CHAIN (x) = b->names;
b->names = x;
return x;
@@ -1434,7 +1435,7 @@ poplevel (int keep, int reverse, int functionbody)
else
decls = current_binding_level->names;
- for (decl = decls; decl; decl = TREE_CHAIN (decl))
+ for (decl = decls; decl; decl = DECL_CHAIN (decl))
if (TREE_CODE (decl) == VAR_DECL
&& DECL_LANG_SPECIFIC (decl) != NULL
&& DECL_LOCAL_SLOT_NUMBER (decl))
@@ -1467,11 +1468,11 @@ poplevel (int keep, int reverse, int functionbody)
/* Copy decls from names list, ignoring labels. */
while (decl)
{
- tree next = TREE_CHAIN (decl);
+ tree next = DECL_CHAIN (decl);
if (TREE_CODE (decl) != LABEL_DECL)
{
*var = decl;
- var = &TREE_CHAIN (decl);
+ var = &DECL_CHAIN (decl);
}
decl = next;
}
@@ -1507,7 +1508,7 @@ poplevel (int keep, int reverse, int functionbody)
/* Clear out the meanings of the local variables of this level. */
- for (link = decls; link; link = TREE_CHAIN (link))
+ for (link = decls; link; link = DECL_CHAIN (link))
{
tree name = DECL_NAME (link);
if (name != 0 && IDENTIFIER_LOCAL_VALUE (name) == link)
@@ -1603,7 +1604,7 @@ maybe_pushlevels (int pc)
while (*ptr != NULL_TREE
&& DECL_LOCAL_START_PC (*ptr) <= pc
&& DECL_LOCAL_END_PC (*ptr) == end_pc)
- ptr = &TREE_CHAIN (*ptr);
+ ptr = &DECL_CHAIN (*ptr);
pending_local_decls = *ptr;
*ptr = NULL_TREE;
@@ -1613,7 +1614,7 @@ maybe_pushlevels (int pc)
{
tree t;
end_pc = current_binding_level->end_pc;
- for (t = decl; t != NULL_TREE; t = TREE_CHAIN (t))
+ for (t = decl; t != NULL_TREE; t = DECL_CHAIN (t))
DECL_LOCAL_END_PC (t) = end_pc;
}
@@ -1628,7 +1629,7 @@ maybe_pushlevels (int pc)
{
int index = DECL_LOCAL_SLOT_NUMBER (decl);
tree base_decl;
- next = TREE_CHAIN (decl);
+ next = DECL_CHAIN (decl);
push_jvm_slot (index, decl);
pushdecl (decl);
base_decl
@@ -1756,8 +1757,8 @@ give_name_to_locals (JCF *jcf)
&& (DECL_LOCAL_START_PC (*ptr) > start_pc
|| (DECL_LOCAL_START_PC (*ptr) == start_pc
&& DECL_LOCAL_END_PC (*ptr) < end_pc)))
- ptr = &TREE_CHAIN (*ptr);
- TREE_CHAIN (decl) = *ptr;
+ ptr = &DECL_CHAIN (*ptr);
+ DECL_CHAIN (decl) = *ptr;
*ptr = decl;
}
}
@@ -1766,7 +1767,7 @@ give_name_to_locals (JCF *jcf)
/* Fill in default names for the parameters. */
for (parm = DECL_ARGUMENTS (current_function_decl), i = 0;
- parm != NULL_TREE; parm = TREE_CHAIN (parm), i++)
+ parm != NULL_TREE; parm = DECL_CHAIN (parm), i++)
{
if (DECL_NAME (parm) == NULL_TREE)
{
@@ -1839,7 +1840,7 @@ start_java_method (tree fndecl)
DECL_ARG_TYPE (parm_decl) = parm_type;
*ptr = parm_decl;
- ptr = &TREE_CHAIN (parm_decl);
+ ptr = &DECL_CHAIN (parm_decl);
/* Add parm_decl to the decl_map. */
push_jvm_slot (i, parm_decl);
@@ -1992,7 +1993,7 @@ java_mark_class_local (tree klass)
{
tree t;
- for (t = TYPE_FIELDS (klass); t ; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (klass); t ; t = DECL_CHAIN (t))
if (FIELD_STATIC (t))
{
if (DECL_EXTERNAL (t))
@@ -2000,7 +2001,7 @@ java_mark_class_local (tree klass)
java_mark_decl_local (t);
}
- for (t = TYPE_METHODS (klass); t ; t = TREE_CHAIN (t))
+ for (t = TYPE_METHODS (klass); t ; t = DECL_CHAIN (t))
if (!METHOD_ABSTRACT (t))
{
if (METHOD_NATIVE (t) && !flag_jni)
@@ -2088,7 +2089,7 @@ java_add_local_var (tree decl)
{
tree *vars = &current_binding_level->names;
tree next = *vars;
- TREE_CHAIN (decl) = next;
+ DECL_CHAIN (decl) = next;
*vars = decl;
DECL_CONTEXT (decl) = current_function_decl;
MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl);
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 0033da30653..2cc03085db4 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -32,6 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "java-opcodes.h"
#include "jcf.h"
#include "java-except.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-iterator.h"
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 042ed1b7297..3c987c5fe82 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -35,6 +35,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "jcf.h"
#include "java-except.h"
#include "parse.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "tree-iterator.h"
@@ -1633,7 +1634,7 @@ lookup_field (tree *typep, tree name)
tree save_field;
int i;
- for (field = TYPE_FIELDS (*typep); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (*typep); field; field = DECL_CHAIN (field))
if (DECL_NAME (field) == name)
return field;
@@ -1951,7 +1952,7 @@ attach_init_test_initialization_flags (void **entry, void *ptr)
if (TREE_CODE (block) == BIND_EXPR)
{
tree body = BIND_EXPR_BODY (block);
- TREE_CHAIN (ite->value) = BIND_EXPR_VARS (block);
+ DECL_CHAIN (ite->value) = BIND_EXPR_VARS (block);
BIND_EXPR_VARS (block) = ite->value;
body = build2 (COMPOUND_EXPR, void_type_node,
build1 (DECL_EXPR, void_type_node, ite->value), body);
@@ -2238,7 +2239,7 @@ build_known_method_ref (tree method, tree method_type ATTRIBUTE_UNUSED,
lookup_field (&class_type_node, methods_ident),
NULL_TREE);
for (meth = TYPE_METHODS (self_type);
- ; meth = TREE_CHAIN (meth))
+ ; meth = DECL_CHAIN (meth))
{
if (method == meth)
break;
@@ -2642,7 +2643,7 @@ build_jni_stub (tree method)
res_var = build_decl (input_location, VAR_DECL, get_identifier ("res"),
TREE_TYPE (TREE_TYPE (method)));
DECL_CONTEXT (res_var) = method;
- TREE_CHAIN (env_var) = res_var;
+ DECL_CHAIN (env_var) = res_var;
}
method_args = DECL_ARGUMENTS (method);
@@ -2672,7 +2673,7 @@ build_jni_stub (tree method)
/* All the arguments to this method become arguments to the
underlying JNI function. If we had to wrap object arguments in a
special way, we would do that here. */
- for (tem = method_args; tem != NULL_TREE; tem = TREE_CHAIN (tem))
+ for (tem = method_args; tem != NULL_TREE; tem = DECL_CHAIN (tem))
{
int arg_bits = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (tem)));
#ifdef PARM_BOUNDARY
@@ -3778,7 +3779,7 @@ promote_arguments (void)
int i;
tree arg;
for (arg = DECL_ARGUMENTS (current_function_decl), i = 0;
- arg != NULL_TREE; arg = TREE_CHAIN (arg), i++)
+ arg != NULL_TREE; arg = DECL_CHAIN (arg), i++)
{
tree arg_type = TREE_TYPE (arg);
if (INTEGRAL_TYPE_P (arg_type)
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index ccaa0e34eb7..110eb83e00c 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -1461,7 +1461,7 @@ extern tree *type_map;
if (TYPE_FIELDS (RTYPE) == NULL_TREE) \
TYPE_FIELDS (RTYPE) = _field; \
else \
- TREE_CHAIN(FIELD) = _field; \
+ DECL_CHAIN(FIELD) = _field; \
DECL_CONTEXT (_field) = (RTYPE); \
DECL_ARTIFICIAL (_field) = 1; \
FIELD = _field; }
@@ -1485,7 +1485,7 @@ extern tree *type_map;
do \
{ \
constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
- tree _next___ = TREE_CHAIN (_elt___->index); \
+ tree _next___ = DECL_CHAIN (_elt___->index); \
gcc_assert (!DECL_NAME (_elt___->index)); \
_elt___->value = VALUE; \
CONSTRUCTOR_APPEND_ELT (V, _next___, NULL); \
@@ -1499,7 +1499,7 @@ extern tree *type_map;
do \
{ \
constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
- tree _next___ = TREE_CHAIN (_elt___->index); \
+ tree _next___ = DECL_CHAIN (_elt___->index); \
gcc_assert (strcmp (IDENTIFIER_POINTER (DECL_NAME (_elt___->index)), \
NAME) == 0); \
_elt___->value = VALUE; \
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 37d27b41b43..c27d4b553d8 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -34,6 +34,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "input.h"
#include "javaop.h"
#include "java-tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "parse.h"
#include "ggc.h"
@@ -1570,7 +1571,7 @@ parse_class_file (void)
gen_indirect_dispatch_tables (current_class);
for (method = TYPE_METHODS (current_class);
- method != NULL_TREE; method = TREE_CHAIN (method))
+ method != NULL_TREE; method = DECL_CHAIN (method))
{
JCF *jcf = current_jcf;
diff --git a/gcc/java/mangle.c b/gcc/java/mangle.c
index c6a753fa61d..5df5b4ca1b3 100644
--- a/gcc/java/mangle.c
+++ b/gcc/java/mangle.c
@@ -32,6 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "obstack.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "langhooks-def.h"
diff --git a/gcc/java/mangle_name.c b/gcc/java/mangle_name.c
index 8327d7e86de..8e37b28426f 100644
--- a/gcc/java/mangle_name.c
+++ b/gcc/java/mangle_name.c
@@ -31,6 +31,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "obstack.h"
+#include "diagnostic-core.h"
#include "toplev.h"
static void append_unicode_mangled_name (const char *, int);
diff --git a/gcc/java/resource.c b/gcc/java/resource.c
index 56a0a1b04d6..d96d2d8d362 100644
--- a/gcc/java/resource.c
+++ b/gcc/java/resource.c
@@ -28,6 +28,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "jcf.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "parse.h"
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index e71b109b7e9..dca14ab5f81 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -33,6 +33,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "java-tree.h"
#include "jcf.h"
#include "convert.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
@@ -210,7 +211,7 @@ java_array_type_length (tree array_type)
tree arfld;
if (TREE_CODE (array_type) == POINTER_TYPE)
array_type = TREE_TYPE (array_type);
- arfld = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (array_type)));
+ arfld = DECL_CHAIN (DECL_CHAIN (TYPE_FIELDS (array_type)));
if (arfld != NULL_TREE)
{
tree index_type = TYPE_DOMAIN (TREE_TYPE (arfld));
@@ -305,7 +306,7 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
arfld = build_decl (input_location,
FIELD_DECL, get_identifier ("data"), atype);
DECL_CONTEXT (arfld) = t;
- TREE_CHAIN (fld) = arfld;
+ DECL_CHAIN (fld) = arfld;
DECL_ALIGN (arfld) = TYPE_ALIGN (element_type);
/* We could layout_class, but that loads java.lang.Object prematurely.
@@ -643,7 +644,7 @@ shallow_find_method (tree searched_class, int flags, tree method_name,
{
tree method;
for (method = TYPE_METHODS (searched_class);
- method != NULL_TREE; method = TREE_CHAIN (method))
+ method != NULL_TREE; method = DECL_CHAIN (method))
{
tree method_sig = (*signature_builder) (TREE_TYPE (method));
if (DECL_NAME (method) == method_name && method_sig == signature)
@@ -778,7 +779,7 @@ tree
lookup_java_constructor (tree clas, tree method_signature)
{
tree method = TYPE_METHODS (clas);
- for ( ; method != NULL_TREE; method = TREE_CHAIN (method))
+ for ( ; method != NULL_TREE; method = DECL_CHAIN (method))
{
tree method_sig = build_java_signature (TREE_TYPE (method));
if (DECL_CONSTRUCTOR_P (method) && method_sig == method_signature)
diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c
index 77ef45f725e..78d35495478 100644
--- a/gcc/java/verify-glue.c
+++ b/gcc/java/verify-glue.c
@@ -33,6 +33,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "verify.h"
#include "java-tree.h"
#include "java-except.h"
+#include "diagnostic-core.h"
#include "toplev.h"
void *
@@ -364,7 +365,7 @@ vfy_class_has_field (vfy_jclass klass, vfy_string name,
if (DECL_NAME (field) == name
&& build_java_signature (TREE_TYPE (field)) == signature)
return true;
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
}
return false;
}
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index bdda6236c72..f56b42b7786 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -320,7 +320,7 @@ write_global_declarations (void)
/* Process the decls in reverse order--earliest first.
Put them into VEC from back to front, then take out from front. */
- for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
+ for (i = 0, decl = globals; i < len; i++, decl = DECL_CHAIN (decl))
vec[len - i - 1] = decl;
wrapup_global_declarations (vec, len);
diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h
index 9916d2f94f0..68b090eaad1 100644
--- a/gcc/libfuncs.h
+++ b/gcc/libfuncs.h
@@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_LIBFUNCS_H
#define GCC_LIBFUNCS_H
+#include "hashtab.h"
+
/* Enumeration of indexes into libfunc_table. */
enum libfunc_index
{
@@ -45,9 +47,34 @@ enum libfunc_index
LTI_MAX
};
-/* SYMBOL_REF rtx's for the library functions that are called
- implicitly and not via optabs. */
-extern GTY(()) rtx libfunc_table[LTI_MAX];
+/* Information about an optab-related libfunc. We use the same hashtable
+ for normal optabs and conversion optabs. In the first case mode2
+ is unused. */
+struct GTY(()) libfunc_entry {
+ size_t optab;
+ enum machine_mode mode1, mode2;
+ rtx libfunc;
+};
+
+/* Target-dependent globals. */
+struct GTY(()) target_libfuncs {
+ /* SYMBOL_REF rtx's for the library functions that are called
+ implicitly and not via optabs. */
+ rtx x_libfunc_table[LTI_MAX];
+
+ /* Hash table used to convert declarations into nodes. */
+ htab_t GTY((param_is (struct libfunc_entry))) x_libfunc_hash;
+};
+
+extern GTY(()) struct target_libfuncs default_target_libfuncs;
+#if SWITCHABLE_TARGET
+extern struct target_libfuncs *this_target_libfuncs;
+#else
+#define this_target_libfuncs (&default_target_libfuncs)
+#endif
+
+#define libfunc_table \
+ (this_target_libfuncs->x_libfunc_table)
/* Accessor macros for libfunc_table. */
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index d6816d0b6e8..02828e3f640 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -36,10 +36,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define ATTRIBUTE_HIDDEN
#endif
-#ifndef MIN_UNITS_PER_WORD
-#define MIN_UNITS_PER_WORD UNITS_PER_WORD
-#endif
-
/* Work out the largest "word" size that we can deal with on this target. */
#if MIN_UNITS_PER_WORD > 4
# define LIBGCC2_MAX_UNITS_PER_WORD 8
diff --git a/gcc/lists.c b/gcc/lists.c
index 5517e5f6a62..5bf6023d876 100644
--- a/gcc/lists.c
+++ b/gcc/lists.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "ggc.h"
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c
index d1bd2855915..4f0850b7702 100644
--- a/gcc/loop-doloop.c
+++ b/gcc/loop-doloop.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "hard-reg-set.h"
#include "basic-block.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "cfgloop.h"
@@ -103,11 +104,11 @@ doloop_condition_get (rtx doloop_pat)
if (GET_CODE (pattern) != PARALLEL)
{
rtx cond;
+ rtx prev_insn = prev_nondebug_insn (doloop_pat);
/* We expect the decrement to immediately precede the branch. */
- if ((PREV_INSN (doloop_pat) == NULL_RTX)
- || !INSN_P (PREV_INSN (doloop_pat)))
+ if (prev_insn == NULL_RTX || !INSN_P (prev_insn))
return 0;
cmp = pattern;
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 2f38123c7d4..19da7dd6e6d 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -1173,11 +1173,13 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
/* Calculates gain for eliminating invariant INV. REGS_USED is the number
of registers used in the loop, NEW_REGS is the number of new variables
already added due to the invariant motion. The number of registers needed
- for it is stored in *REGS_NEEDED. */
+ for it is stored in *REGS_NEEDED. SPEED and CALL_P are flags passed
+ through to estimate_reg_pressure_cost. */
static int
gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
- unsigned *new_regs, unsigned regs_used, bool speed)
+ unsigned *new_regs, unsigned regs_used,
+ bool speed, bool call_p)
{
int comp_cost, size_cost;
@@ -1188,9 +1190,9 @@ gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
if (! flag_ira_loop_pressure)
{
size_cost = (estimate_reg_pressure_cost (new_regs[0] + regs_needed[0],
- regs_used, speed)
+ regs_used, speed, call_p)
- estimate_reg_pressure_cost (new_regs[0],
- regs_used, speed));
+ regs_used, speed, call_p));
}
else
{
@@ -1245,7 +1247,8 @@ gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
static int
best_gain_for_invariant (struct invariant **best, unsigned *regs_needed,
- unsigned *new_regs, unsigned regs_used, bool speed)
+ unsigned *new_regs, unsigned regs_used,
+ bool speed, bool call_p)
{
struct invariant *inv;
int i, gain = 0, again;
@@ -1261,7 +1264,7 @@ best_gain_for_invariant (struct invariant **best, unsigned *regs_needed,
continue;
again = gain_for_invariant (inv, aregs_needed, new_regs, regs_used,
- speed);
+ speed, call_p);
if (again > gain)
{
gain = again;
@@ -1314,7 +1317,7 @@ set_move_mark (unsigned invno, int gain)
/* Determines which invariants to move. */
static void
-find_invariants_to_move (bool speed)
+find_invariants_to_move (bool speed, bool call_p)
{
int gain;
unsigned i, regs_used, regs_needed[N_REG_CLASSES], new_regs[N_REG_CLASSES];
@@ -1353,7 +1356,8 @@ find_invariants_to_move (bool speed)
new_regs[ira_reg_class_cover[i]] = 0;
}
while ((gain = best_gain_for_invariant (&inv, regs_needed,
- new_regs, regs_used, speed)) > 0)
+ new_regs, regs_used,
+ speed, call_p)) > 0)
{
set_move_mark (inv->invno, gain);
if (! flag_ira_loop_pressure)
@@ -1573,7 +1577,8 @@ move_single_loop_invariants (struct loop *loop)
init_inv_motion_data ();
find_invariants (loop);
- find_invariants_to_move (optimize_loop_for_speed_p (loop));
+ find_invariants_to_move (optimize_loop_for_speed_p (loop),
+ LOOP_DATA (loop)->has_call);
move_invariants (loop);
free_inv_motion_data ();
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 141b51fc322..836fe15a2d1 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "intl.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "df.h"
#include "hashtab.h"
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 160328ccefc..1cc972ac72d 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -63,6 +63,12 @@ static bitmap decomposable_context;
which it can not be decomposed. */
static bitmap non_decomposable_context;
+/* Bit N in this bitmap is set if regno N is used in a subreg
+ which changes the mode but not the size. This typically happens
+ when the register accessed as a floating-point value; we want to
+ avoid generating accesses to its subwords in integer modes. */
+static bitmap subreg_context;
+
/* Bit N in the bitmap in element M of this array is set if there is a
copy from reg M to reg N. */
static VEC(bitmap,heap) *reg_copy_graph;
@@ -289,6 +295,7 @@ find_decomposable_subregs (rtx *px, void *data)
&& !MODES_TIEABLE_P (GET_MODE (x), GET_MODE (inner)))
{
bitmap_set_bit (non_decomposable_context, regno);
+ bitmap_set_bit (subreg_context, regno);
return -1;
}
}
@@ -616,7 +623,7 @@ can_decompose_p (rtx x)
return (validate_subreg (word_mode, GET_MODE (x), x, UNITS_PER_WORD)
&& HARD_REGNO_MODE_OK (regno, word_mode));
else
- return !bitmap_bit_p (non_decomposable_context, regno);
+ return !bitmap_bit_p (subreg_context, regno);
}
return true;
@@ -1091,6 +1098,7 @@ decompose_multiword_subregs (void)
decomposable_context = BITMAP_ALLOC (NULL);
non_decomposable_context = BITMAP_ALLOC (NULL);
+ subreg_context = BITMAP_ALLOC (NULL);
reg_copy_graph = VEC_alloc (bitmap, heap, max);
VEC_safe_grow (bitmap, heap, reg_copy_graph, max);
@@ -1309,6 +1317,7 @@ decompose_multiword_subregs (void)
BITMAP_FREE (decomposable_context);
BITMAP_FREE (non_decomposable_context);
+ BITMAP_FREE (subreg_context);
}
/* Gate function for lower subreg pass. */
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 9722a807842..9c7af2ba507 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -319,13 +319,15 @@ referenced_from_other_partition_p (struct ipa_ref_list *list, cgraph_node_set se
{
if (ref->refering_type == IPA_REF_CGRAPH)
{
- if (!cgraph_node_in_set_p (ipa_ref_refering_node (ref), set))
+ if (ipa_ref_refering_node (ref)->in_other_partition
+ || !cgraph_node_in_set_p (ipa_ref_refering_node (ref), set))
return true;
}
else
{
- if (!varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
- vset))
+ if (ipa_ref_refering_varpool_node (ref)->in_other_partition
+ || !varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
+ vset))
return true;
}
}
@@ -343,7 +345,8 @@ reachable_from_other_partition_p (struct cgraph_node *node, cgraph_node_set set)
if (node->global.inlined_to)
return false;
for (e = node->callers; e; e = e->next_caller)
- if (!cgraph_node_in_set_p (e->caller, set))
+ if (e->caller->in_other_partition
+ || !cgraph_node_in_set_p (e->caller, set))
return true;
return false;
}
@@ -503,6 +506,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (&bp, node->abstract_and_needed, 1);
bp_pack_value (&bp, tag == LTO_cgraph_analyzed_node
&& !DECL_EXTERNAL (node->decl)
+ && !DECL_COMDAT (node->decl)
&& (reachable_from_other_partition_p (node, set)
|| referenced_from_other_partition_p (&node->ref_list, set, vset)), 1);
bp_pack_value (&bp, node->lowered, 1);
@@ -576,7 +580,8 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node
/* Constant pool initializers can be de-unified into individual ltrans units.
FIXME: Alternatively at -Os we may want to avoid generating for them the local
labels and share them across LTRANS partitions. */
- if (DECL_IN_CONSTANT_POOL (node->decl))
+ if (DECL_IN_CONSTANT_POOL (node->decl)
+ && !DECL_COMDAT (node->decl))
{
bp_pack_value (&bp, 0, 1); /* used_from_other_parition. */
bp_pack_value (&bp, 0, 1); /* in_other_partition. */
@@ -841,6 +846,7 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset)
lto_cgraph_encoder_t encoder;
lto_varpool_encoder_t varpool_encoder;
struct cgraph_asm_node *can;
+ static bool asm_nodes_output = false;
if (flag_wpa)
output_cgraph_opt_summary ();
@@ -876,14 +882,21 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset)
lto_output_uleb128_stream (ob->main_stream, 0);
- /* Emit toplevel asms. */
- for (can = cgraph_asm_nodes; can; can = can->next)
+ /* Emit toplevel asms.
+ When doing WPA we must output every asm just once. Since we do not partition asm
+ nodes at all, output them to first output. This is kind of hack, but should work
+ well. */
+ if (!asm_nodes_output)
{
- int len = TREE_STRING_LENGTH (can->asm_str);
- lto_output_uleb128_stream (ob->main_stream, len);
- for (i = 0; i < len; ++i)
- lto_output_1_stream (ob->main_stream,
- TREE_STRING_POINTER (can->asm_str)[i]);
+ asm_nodes_output = true;
+ for (can = cgraph_asm_nodes; can; can = can->next)
+ {
+ int len = TREE_STRING_LENGTH (can->asm_str);
+ lto_output_uleb128_stream (ob->main_stream, len);
+ for (i = 0; i < len; ++i)
+ lto_output_1_stream (ob->main_stream,
+ TREE_STRING_POINTER (can->asm_str)[i]);
+ }
}
lto_output_uleb128_stream (ob->main_stream, 0);
@@ -1158,7 +1171,6 @@ input_edge (struct lto_input_block *ib, VEC(cgraph_node_ptr, heap) *nodes,
unsigned int nest;
cgraph_inline_failed_t inline_failed;
struct bitpack_d bp;
- enum ld_plugin_symbol_resolution caller_resolution;
int ecf_flags = 0;
caller = VEC_index (cgraph_node_ptr, nodes, lto_input_sleb128 (ib));
@@ -1183,13 +1195,6 @@ input_edge (struct lto_input_block *ib, VEC(cgraph_node_ptr, heap) *nodes,
freq = (int) bp_unpack_value (&bp, HOST_BITS_PER_INT);
nest = (unsigned) bp_unpack_value (&bp, 30);
- /* If the caller was preempted, don't create the edge.
- ??? Should we ever have edges from a preempted caller? */
- caller_resolution = lto_symtab_get_resolution (caller->decl);
- if (caller_resolution == LDPR_PREEMPTED_REG
- || caller_resolution == LDPR_PREEMPTED_IR)
- return;
-
if (indirect)
edge = cgraph_create_indirect_edge (caller, NULL, 0, count, freq, nest);
else
@@ -1482,7 +1487,7 @@ output_node_opt_summary (struct output_block *ob,
tree parm;
for (parm_num = 0, parm = DECL_ARGUMENTS (node->decl); parm;
- parm = TREE_CHAIN (parm), parm_num++)
+ parm = DECL_CHAIN (parm), parm_num++)
if (map->old_tree == parm)
break;
/* At the moment we assume all old trees to be PARM_DECLs, because we have no
@@ -1566,7 +1571,7 @@ input_node_opt_summary (struct cgraph_node *node,
VEC_safe_push (ipa_replace_map_p, gc, node->clone.tree_map, map);
for (parm_num = 0, parm = DECL_ARGUMENTS (node->decl); parm_num;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
parm_num --;
map->parm_num = lto_input_uleb128 (ib_main);
map->old_tree = NULL;
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index b7bf6ca2c96..fa52f953608 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h"
#include "options.h"
#include "target.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "lto-streamer.h"
@@ -293,7 +294,7 @@ output_options (struct lto_output_stream *stream)
void
lto_write_options (void)
{
- char *const section_name = lto_get_section_name (LTO_section_opts, NULL);
+ char *const section_name = lto_get_section_name (LTO_section_opts, NULL, NULL);
struct lto_output_stream stream;
struct lto_simple_header header;
struct lto_output_stream *header_stream;
@@ -355,6 +356,8 @@ lto_read_file_options (struct lto_file_decl_data *file_data)
struct lto_input_block ib;
data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len);
+ if (!data)
+ return;
header = (const struct lto_simple_header *) data;
opts_offset = sizeof (*header);
diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c
index 7f4065e6df6..c8c3d4acfa2 100644
--- a/gcc/lto-section-in.c
+++ b/gcc/lto-section-in.c
@@ -50,13 +50,13 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] =
{
"decls",
"function_body",
- "static_initializer",
+ "statics",
"cgraph",
- "varpool",
+ "vars",
"refs",
- "jump_funcs"
- "ipa_pure_const",
- "ipa_reference",
+ "jmpfuncs",
+ "pureconst",
+ "reference",
"symtab",
"opts",
"cgraphopt"
diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
index b5353f34af2..e9b7b0a70fa 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -486,7 +486,7 @@ lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
struct lto_simple_header header;
struct lto_output_stream *header_stream;
- section_name = lto_get_section_name (ob->section_type, NULL);
+ section_name = lto_get_section_name (ob->section_type, NULL, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 635cff4d3f5..3451b84c076 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -872,124 +872,6 @@ input_ssa_names (struct lto_input_block *ib, struct data_in *data_in,
}
}
-
-/* Fixup the reference tree OP for replaced VAR_DECLs with mismatched
- types. */
-
-static void
-maybe_fixup_handled_component (tree op)
-{
- tree decl_type;
- tree wanted_type;
-
- while (handled_component_p (TREE_OPERAND (op, 0)))
- op = TREE_OPERAND (op, 0);
- if (TREE_CODE (TREE_OPERAND (op, 0)) != VAR_DECL)
- return;
-
- decl_type = TREE_TYPE (TREE_OPERAND (op, 0));
-
- switch (TREE_CODE (op))
- {
- case COMPONENT_REF:
- /* The DECL_CONTEXT of the field-decl is the record type we look for. */
- wanted_type = DECL_CONTEXT (TREE_OPERAND (op, 1));
- break;
-
- case ARRAY_REF:
- if (TREE_CODE (decl_type) == ARRAY_TYPE
- && (TREE_TYPE (decl_type) == TREE_TYPE (op)
- || useless_type_conversion_p (TREE_TYPE (op),
- TREE_TYPE (decl_type))))
- return;
- /* An unknown size array type should be ok. But we do not
- lower the lower bound in all cases - ugh. */
- wanted_type = build_array_type (TREE_TYPE (op), NULL_TREE);
- break;
-
- case ARRAY_RANGE_REF:
- if (TREE_CODE (decl_type) == ARRAY_TYPE
- && (TREE_TYPE (decl_type) == TREE_TYPE (TREE_TYPE (op))
- || useless_type_conversion_p (TREE_TYPE (TREE_TYPE (op)),
- TREE_TYPE (decl_type))))
- return;
- /* An unknown size array type should be ok. But we do not
- lower the lower bound in all cases - ugh. */
- wanted_type = build_array_type (TREE_TYPE (TREE_TYPE (op)), NULL_TREE);
- break;
-
- case BIT_FIELD_REF:
- case VIEW_CONVERT_EXPR:
- /* Very nice - nothing to do. */
- return;
-
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- if (TREE_CODE (decl_type) == COMPLEX_TYPE
- && (TREE_TYPE (decl_type) == TREE_TYPE (op)
- || useless_type_conversion_p (TREE_TYPE (op),
- TREE_TYPE (decl_type))))
- return;
- wanted_type = build_complex_type (TREE_TYPE (op));
- break;
-
- default:
- gcc_unreachable ();
- }
-
- if (!useless_type_conversion_p (wanted_type, decl_type))
- TREE_OPERAND (op, 0) = build1 (VIEW_CONVERT_EXPR, wanted_type,
- TREE_OPERAND (op, 0));
-}
-
-/* Fixup reference tree operands for substituted prevailing decls
- with mismatched types in STMT. This handles plain DECLs where
- we need the stmt for context to lookup the required type. */
-
-static void
-maybe_fixup_decls (gimple stmt)
-{
- /* We have to fixup replaced decls here in case there were
- inter-TU type mismatches. Catch the most common cases
- for now - this way we'll get testcases for the rest as
- the type verifier will complain. */
- if (gimple_assign_single_p (stmt))
- {
- tree lhs = gimple_assign_lhs (stmt);
- tree rhs = gimple_assign_rhs1 (stmt);
-
- /* First catch loads and aggregate copies by adjusting the rhs. */
- if (TREE_CODE (rhs) == VAR_DECL)
- {
- if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
- gimple_assign_set_rhs1 (stmt, build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (lhs), rhs));
- }
- /* Then catch scalar stores. */
- else if (TREE_CODE (lhs) == VAR_DECL)
- {
- if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
- gimple_assign_set_lhs (stmt, build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (rhs), lhs));
- }
- }
- else if (is_gimple_call (stmt))
- {
- tree lhs = gimple_call_lhs (stmt);
-
- if (lhs && TREE_CODE (lhs) == VAR_DECL)
- {
- if (!useless_type_conversion_p (TREE_TYPE (lhs),
- gimple_call_return_type (stmt)))
- gimple_call_set_lhs (stmt, build1 (VIEW_CONVERT_EXPR,
- gimple_call_return_type (stmt),
- lhs));
- }
-
- /* Arguments, especially for varargs functions will be funny... */
- }
-}
-
/* Read a statement with tag TAG in function FN from block IB using
descriptors in DATA_IN. */
@@ -1064,21 +946,6 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
if (!op)
continue;
- /* Fixup reference tree operands for substituted prevailing decls
- with mismatched types. For plain VAR_DECLs we need to look
- at context to determine the wanted type - we do that below
- after the stmt is completed. */
- if (TREE_CODE (op) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (op, 0)) == VAR_DECL
- && !useless_type_conversion_p (TREE_TYPE (TREE_TYPE (op)),
- TREE_TYPE (TREE_OPERAND (op, 0))))
- {
- TREE_OPERAND (op, 0)
- = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (TREE_TYPE (op)),
- TREE_OPERAND (op, 0));
- continue;
- }
-
/* Fixup FIELD_DECLs in COMPONENT_REFs, they are not handled
by decl merging. */
if (TREE_CODE (op) == ADDR_EXPR)
@@ -1093,7 +960,9 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
{
if (tem == field
- || (TREE_TYPE (tem) == TREE_TYPE (field)
+ || (gimple_types_compatible_p (TREE_TYPE (tem),
+ TREE_TYPE (field),
+ GTC_DIAG)
&& DECL_NONADDRESSABLE_P (tem)
== DECL_NONADDRESSABLE_P (field)
&& gimple_compare_field_offset (tem, field)))
@@ -1110,17 +979,8 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
TREE_OPERAND (op, 1) = tem;
}
- /* Preserve the last handled component for the fixup of
- its operand below. */
- if (!handled_component_p (TREE_OPERAND (op, 0)))
- break;
op = TREE_OPERAND (op, 0);
}
-
- /* Fixup reference tree operands for substituted prevailing decls
- with mismatched types. */
- if (handled_component_p (op))
- maybe_fixup_handled_component (op);
}
break;
@@ -1160,10 +1020,6 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
if (code == GIMPLE_CALL)
gimple_call_reset_alias_info (stmt);
- /* Fixup reference tree operands for substituted prevailing decls
- with mismatched types. */
- maybe_fixup_decls (stmt);
-
/* Mark the statement modified so its operand vectors can be filled in. */
gimple_set_modified (stmt, true);
@@ -1286,6 +1142,7 @@ input_function (tree fn_decl, struct data_in *data_in,
struct bitpack_d bp;
struct cgraph_node *node;
tree args, narg, oarg;
+ int len;
fn = DECL_STRUCT_FUNCTION (fn_decl);
tag = input_record_start (ib);
@@ -1320,7 +1177,17 @@ input_function (tree fn_decl, struct data_in *data_in,
fn->nonlocal_goto_save_area = lto_input_tree (ib, data_in);
/* Read all the local symbols. */
- fn->local_decls = lto_input_tree (ib, data_in);
+ len = lto_input_sleb128 (ib);
+ if (len > 0)
+ {
+ int i;
+ VEC_safe_grow (tree, gc, fn->local_decls, len);
+ for (i = 0; i < len; i++)
+ {
+ tree t = lto_input_tree (ib, data_in);
+ VEC_replace (tree, fn->local_decls, i, t);
+ }
+ }
/* Read all function arguments. We need to re-map them here to the
arguments of the merged function declaration. */
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 6ee2eda2784..c96c13aeefe 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1706,6 +1706,25 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
for (i = 0; i < gimple_num_ops (stmt); i++)
{
tree op = gimple_op (stmt, i);
+ /* Wrap all uses of non-automatic variables inside MEM_REFs
+ so that we do not have to deal with type mismatches on
+ merged symbols during IL read in. */
+ if (op)
+ {
+ tree *basep = &op;
+ if (handled_component_p (*basep))
+ basep = &TREE_OPERAND (*basep, 0);
+ if (TREE_CODE (*basep) == VAR_DECL
+ && !auto_var_in_fn_p (*basep, current_function_decl))
+ {
+ bool volatilep = TREE_THIS_VOLATILE (*basep);
+ *basep = build2 (MEM_REF, TREE_TYPE (*basep),
+ build_fold_addr_expr (*basep),
+ build_int_cst (build_pointer_type
+ (TREE_TYPE (*basep)), 0));
+ TREE_THIS_VOLATILE (*basep) = volatilep;
+ }
+ }
lto_output_tree_ref (ob, op);
}
break;
@@ -1791,10 +1810,10 @@ produce_asm (struct output_block *ob, tree fn)
if (section_type == LTO_section_function_body)
{
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn));
- section_name = lto_get_section_name (section_type, name);
+ section_name = lto_get_section_name (section_type, name, NULL);
}
else
- section_name = lto_get_section_name (section_type, NULL);
+ section_name = lto_get_section_name (section_type, NULL, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
@@ -1840,6 +1859,8 @@ output_function (struct cgraph_node *node)
struct function *fn;
basic_block bb;
struct output_block *ob;
+ unsigned i;
+ tree t;
function = node->decl;
fn = DECL_STRUCT_FUNCTION (function);
@@ -1886,7 +1907,9 @@ output_function (struct cgraph_node *node)
lto_output_tree_ref (ob, fn->nonlocal_goto_save_area);
/* Output all the local variables in the function. */
- lto_output_tree_ref (ob, fn->local_decls);
+ output_sleb128 (ob, VEC_length (tree, fn->local_decls));
+ for (i = 0; VEC_iterate (tree, fn->local_decls, i, t); i++)
+ lto_output_tree_ref (ob, t);
/* Output the head of the arguments list. */
lto_output_tree_ref (ob, DECL_ARGUMENTS (function));
@@ -2018,7 +2041,7 @@ copy_function (struct cgraph_node *node)
size_t len;
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));
char *section_name =
- lto_get_section_name (LTO_section_function_body, name);
+ lto_get_section_name (LTO_section_function_body, name, NULL);
size_t i, j;
struct lto_in_decl_state *in_state;
struct lto_out_decl_state *out_state = lto_get_out_decl_state ();
@@ -2132,7 +2155,7 @@ struct ipa_opt_pass_d pass_ipa_lto_gimple_out =
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
- TV_IPA_LTO_GIMPLE_IO, /* tv_id */
+ TV_IPA_LTO_GIMPLE_OUT, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
@@ -2262,155 +2285,163 @@ lto_out_decl_state_written_size (struct lto_out_decl_state *state)
}
-/* Helper function of write_symbols_of_kind. CACHE is the streamer
- cache with all the pickled nodes. STREAM is the stream where to
- write the table. V is a vector with the DECLs that should be on
- the table. SEEN is a bitmap of symbols written so far. */
+/* Write symbol T into STREAM in CACHE. SEEN specify symbols we wrote so
+ far. */
static void
-write_symbol_vec (struct lto_streamer_cache_d *cache,
- struct lto_output_stream *stream,
- VEC(tree,heap) *v, bitmap seen)
+write_symbol (struct lto_streamer_cache_d *cache,
+ struct lto_output_stream *stream,
+ tree t, bitmap seen, bool alias)
{
- tree t;
- int index;
+ const char *name;
+ enum gcc_plugin_symbol_kind kind;
+ enum gcc_plugin_symbol_visibility visibility;
+ int slot_num;
+ uint64_t size;
+ const char *comdat;
- for (index = 0; VEC_iterate(tree, v, index, t); index++)
- {
- const char *name;
- enum gcc_plugin_symbol_kind kind;
- enum gcc_plugin_symbol_visibility visibility;
- int slot_num;
- uint64_t size;
- const char *comdat;
-
- /* None of the following kinds of symbols are needed in the
- symbol table. */
- if (!TREE_PUBLIC (t)
- || is_builtin_fn (t)
- || DECL_ABSTRACT (t)
- || TREE_CODE (t) == RESULT_DECL)
- continue;
+ /* None of the following kinds of symbols are needed in the
+ symbol table. */
+ if (!TREE_PUBLIC (t)
+ || is_builtin_fn (t)
+ || DECL_ABSTRACT (t)
+ || TREE_CODE (t) == RESULT_DECL)
+ return;
- gcc_assert (TREE_CODE (t) == VAR_DECL
- || TREE_CODE (t) == FUNCTION_DECL);
+ gcc_assert (TREE_CODE (t) == VAR_DECL
+ || TREE_CODE (t) == FUNCTION_DECL);
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (t));
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (t));
- /* FIXME lto: this is from assemble_name_raw in varasm.c. For some
- architectures we might have to do the same name manipulations that
- ASM_OUTPUT_LABELREF does. */
- if (name[0] == '*')
- name = &name[1];
+ /* FIXME lto: this is from assemble_name_raw in varasm.c. For some
+ architectures we might have to do the same name manipulations that
+ ASM_OUTPUT_LABELREF does. */
+ if (name[0] == '*')
+ name = &name[1];
- lto_streamer_cache_lookup (cache, t, &slot_num);
- gcc_assert (slot_num >= 0);
+ lto_streamer_cache_lookup (cache, t, &slot_num);
+ gcc_assert (slot_num >= 0);
- /* Avoid duplicate symbols. */
- if (bitmap_bit_p (seen, slot_num))
- continue;
- else
- bitmap_set_bit (seen, slot_num);
-
- if (DECL_EXTERNAL (t))
- {
- if (DECL_WEAK (t))
- kind = GCCPK_WEAKUNDEF;
- else
- kind = GCCPK_UNDEF;
- }
- else
- {
- if (DECL_WEAK (t))
- kind = GCCPK_WEAKDEF;
- else if (DECL_COMMON (t))
- kind = GCCPK_COMMON;
- else
- kind = GCCPK_DEF;
- }
-
- switch (DECL_VISIBILITY(t))
- {
- case VISIBILITY_DEFAULT:
- visibility = GCCPV_DEFAULT;
- break;
- case VISIBILITY_PROTECTED:
- visibility = GCCPV_PROTECTED;
- break;
- case VISIBILITY_HIDDEN:
- visibility = GCCPV_HIDDEN;
- break;
- case VISIBILITY_INTERNAL:
- visibility = GCCPV_INTERNAL;
- break;
- }
+ /* Avoid duplicate symbols. */
+ if (bitmap_bit_p (seen, slot_num))
+ return;
+ else
+ bitmap_set_bit (seen, slot_num);
- if (kind == GCCPK_COMMON
- && DECL_SIZE (t)
- && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST)
- size = (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE (t))) << 32)
- | TREE_INT_CST_LOW (DECL_SIZE (t));
+ if (DECL_EXTERNAL (t))
+ {
+ if (DECL_WEAK (t))
+ kind = GCCPK_WEAKUNDEF;
else
- size = 0;
-
- if (DECL_ONE_ONLY (t))
- comdat = IDENTIFIER_POINTER (DECL_COMDAT_GROUP (t));
+ kind = GCCPK_UNDEF;
+ }
+ else
+ {
+ if (DECL_WEAK (t))
+ kind = GCCPK_WEAKDEF;
+ else if (DECL_COMMON (t))
+ kind = GCCPK_COMMON;
else
- comdat = "";
-
- lto_output_data_stream (stream, name, strlen (name) + 1);
- lto_output_data_stream (stream, comdat, strlen (comdat) + 1);
- lto_output_data_stream (stream, &kind, 1);
- lto_output_data_stream (stream, &visibility, 1);
- lto_output_data_stream (stream, &size, 8);
- lto_output_data_stream (stream, &slot_num, 4);
+ kind = GCCPK_DEF;
+
+ /* When something is defined, it should have a node attached.
+ FIXME: For fortran this is still not the case since wrapup global
+ decls is done after streaming. */
+ gcc_assert (alias || TREE_CODE (t) != FUNCTION_DECL
+ || (cgraph_get_node (t)
+ && cgraph_get_node (t)->analyzed));
}
-}
-
-
-/* Write IL symbols of KIND. CACHE is the streamer cache with all the
- pickled nodes. SEEN is a bitmap of symbols written so far. */
-
-static void
-write_symbols_of_kind (lto_decl_stream_e_t kind,
- struct lto_streamer_cache_d *cache, bitmap seen)
-{
- struct lto_out_decl_state *out_state;
- struct lto_output_stream stream;
- unsigned num_fns =
- VEC_length (lto_out_decl_state_ptr, lto_function_decl_states);
- unsigned idx;
-
- memset (&stream, 0, sizeof (stream));
- out_state = lto_get_out_decl_state ();
- write_symbol_vec (cache, &stream, out_state->streams[kind].trees, seen);
- for (idx = 0; idx < num_fns; idx++)
+ switch (DECL_VISIBILITY(t))
{
- out_state =
- VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx);
- write_symbol_vec (cache, &stream, out_state->streams[kind].trees, seen);
+ case VISIBILITY_DEFAULT:
+ visibility = GCCPV_DEFAULT;
+ break;
+ case VISIBILITY_PROTECTED:
+ visibility = GCCPV_PROTECTED;
+ break;
+ case VISIBILITY_HIDDEN:
+ visibility = GCCPV_HIDDEN;
+ break;
+ case VISIBILITY_INTERNAL:
+ visibility = GCCPV_INTERNAL;
+ break;
}
- lto_write_stream (&stream);
+ if (kind == GCCPK_COMMON
+ && DECL_SIZE (t)
+ && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST)
+ size = (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE (t))) << 32)
+ | TREE_INT_CST_LOW (DECL_SIZE (t));
+ else
+ size = 0;
+
+ if (DECL_ONE_ONLY (t))
+ comdat = IDENTIFIER_POINTER (DECL_COMDAT_GROUP (t));
+ else
+ comdat = "";
+
+ lto_output_data_stream (stream, name, strlen (name) + 1);
+ lto_output_data_stream (stream, comdat, strlen (comdat) + 1);
+ lto_output_data_stream (stream, &kind, 1);
+ lto_output_data_stream (stream, &visibility, 1);
+ lto_output_data_stream (stream, &size, 8);
+ lto_output_data_stream (stream, &slot_num, 4);
}
-/* Write an IL symbol table. CACHE is the streamer cache with all the
- pickled nodes. */
+/* Write an IL symbol table to OB.
+ SET and VSET are cgraph/varpool node sets we are outputting. */
static void
-produce_symtab (struct lto_streamer_cache_d *cache)
+produce_symtab (struct output_block *ob,
+ cgraph_node_set set, varpool_node_set vset)
{
- char *section_name = lto_get_section_name (LTO_section_symtab, NULL);
+ struct lto_streamer_cache_d *cache = ob->writer_cache;
+ char *section_name = lto_get_section_name (LTO_section_symtab, NULL, NULL);
bitmap seen;
+ struct cgraph_node *node, *alias;
+ struct varpool_node *vnode, *valias;
+ struct lto_output_stream stream;
+ lto_varpool_encoder_t varpool_encoder = ob->decl_state->varpool_node_encoder;
+ lto_cgraph_encoder_t encoder = ob->decl_state->cgraph_node_encoder;
+ int i;
+ alias_pair *p;
lto_begin_section (section_name, false);
free (section_name);
seen = lto_bitmap_alloc ();
- write_symbols_of_kind (LTO_DECL_STREAM_FN_DECL, cache, seen);
- write_symbols_of_kind (LTO_DECL_STREAM_VAR_DECL, cache, seen);
+ memset (&stream, 0, sizeof (stream));
+
+ /* Write all functions. */
+ for (i = 0; i < lto_cgraph_encoder_size (encoder); i++)
+ {
+ node = lto_cgraph_encoder_deref (encoder, i);
+ if (node->alias)
+ continue;
+ write_symbol (cache, &stream, node->decl, seen, false);
+ for (alias = node->same_body; alias; alias = alias->next)
+ write_symbol (cache, &stream, alias->decl, seen, true);
+ }
+
+ /* Write all variables. */
+ for (i = 0; i < lto_varpool_encoder_size (varpool_encoder); i++)
+ {
+ vnode = lto_varpool_encoder_deref (varpool_encoder, i);
+ if (vnode->alias)
+ continue;
+ write_symbol (cache, &stream, vnode->decl, seen, false);
+ for (valias = vnode->extra_name; valias; valias = valias->next)
+ write_symbol (cache, &stream, valias->decl, seen, true);
+ }
+
+ /* Write all aliases. */
+ for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p); i++)
+ if (output_alias_pair_p (p, set, vset))
+ write_symbol (cache, &stream, p->decl, seen, true);
+
+ lto_write_stream (&stream);
lto_bitmap_free (seen);
lto_end_section ();
@@ -2446,7 +2477,7 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset)
memset (&header, 0, sizeof (struct lto_decl_header));
- section_name = lto_get_section_name (LTO_section_decls, NULL);
+ section_name = lto_get_section_name (LTO_section_decls, NULL, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
@@ -2513,8 +2544,10 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset)
lto_end_section ();
- /* Write the symbol table. */
- produce_symtab (ob->writer_cache);
+ /* Write the symbol table. It is used by linker to determine dependencies
+ and thus we can skip it for WPA. */
+ if (!flag_wpa)
+ produce_symtab (ob, set, vset);
/* Write command line opts. */
lto_write_options ();
@@ -2544,7 +2577,7 @@ struct ipa_opt_pass_d pass_ipa_lto_finish_out =
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
- TV_IPA_LTO_DECL_IO, /* tv_id */
+ TV_IPA_LTO_DECL_OUT, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c
index 406096015f4..0536bb97b25 100644
--- a/gcc/lto-streamer.c
+++ b/gcc/lto-streamer.c
@@ -133,57 +133,45 @@ lto_bitmap_free (bitmap b)
/* Get a section name for a particular type or name. The NAME field
- is only used if SECTION_TYPE is LTO_section_function_body or
- LTO_static_initializer. For all others it is ignored. The callee
- of this function is responcible to free the returned name. */
+ is only used if SECTION_TYPE is LTO_section_function_body. For all
+ others it is ignored. The callee of this function is responsible
+ to free the returned name. */
char *
-lto_get_section_name (int section_type, const char *name)
+lto_get_section_name (int section_type, const char *name, struct lto_file_decl_data *f)
{
- switch (section_type)
+ const char *add;
+ char post[32];
+ const char *sep;
+
+ if (section_type == LTO_section_function_body)
{
- case LTO_section_function_body:
gcc_assert (name != NULL);
if (name[0] == '*')
name++;
- return concat (LTO_SECTION_NAME_PREFIX, name, NULL);
-
- case LTO_section_static_initializer:
- return concat (LTO_SECTION_NAME_PREFIX, ".statics", NULL);
-
- case LTO_section_symtab:
- return concat (LTO_SECTION_NAME_PREFIX, ".symtab", NULL);
-
- case LTO_section_decls:
- return concat (LTO_SECTION_NAME_PREFIX, ".decls", NULL);
-
- case LTO_section_cgraph:
- return concat (LTO_SECTION_NAME_PREFIX, ".cgraph", NULL);
-
- case LTO_section_varpool:
- return concat (LTO_SECTION_NAME_PREFIX, ".vars", NULL);
-
- case LTO_section_refs:
- return concat (LTO_SECTION_NAME_PREFIX, ".refs", NULL);
-
- case LTO_section_jump_functions:
- return concat (LTO_SECTION_NAME_PREFIX, ".jmpfuncs", NULL);
-
- case LTO_section_ipa_pure_const:
- return concat (LTO_SECTION_NAME_PREFIX, ".pureconst", NULL);
-
- case LTO_section_ipa_reference:
- return concat (LTO_SECTION_NAME_PREFIX, ".reference", NULL);
+ add = name;
+ sep = "";
+ }
+ else if (section_type < LTO_N_SECTION_TYPES)
+ {
+ add = lto_section_name[section_type];
+ sep = ".";
+ }
+ else
+ internal_error ("bytecode stream: unexpected LTO section %s", name);
- case LTO_section_opts:
- return concat (LTO_SECTION_NAME_PREFIX, ".opts", NULL);
+ /* Make the section name unique so that ld -r combining sections
+ doesn't confuse the reader with merged sections.
- case LTO_section_cgraph_opt_sum:
- return concat (LTO_SECTION_NAME_PREFIX, ".cgraphopt", NULL);
+ For options don't add a ID, the option reader cannot deal with them
+ and merging should be ok here.
- default:
- internal_error ("bytecode stream: unexpected LTO section %s", name);
- }
+ XXX: use crc64 to minimize collisions? */
+ if (section_type == LTO_section_opts)
+ strcpy (post, "");
+ else
+ sprintf (post, ".%x", f ? f->id : crc32_string(0, get_random_seed (false)));
+ return concat (LTO_SECTION_NAME_PREFIX, sep, add, post, NULL);
}
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index cc38b22d179..3304132b1d0 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -600,6 +600,15 @@ struct GTY(()) lto_file_decl_data
/* Hash new name of renamed global declaration to its original name. */
htab_t GTY((skip)) renaming_hash_table;
+
+ /* Linked list used temporarily in reader */
+ struct lto_file_decl_data *next;
+
+ /* Sub ID for merged objects. */
+ unsigned id;
+
+ /* Symbol resolutions for this file */
+ VEC(ld_plugin_symbol_resolution_t,heap) *resolutions;
};
typedef struct lto_file_decl_data *lto_file_decl_data_ptr;
@@ -815,7 +824,7 @@ extern void lto_record_function_out_decl_state (tree,
extern const char *lto_tag_name (enum LTO_tags);
extern bitmap lto_bitmap_alloc (void);
extern void lto_bitmap_free (bitmap);
-extern char *lto_get_section_name (int, const char *);
+extern char *lto_get_section_name (int, const char *, struct lto_file_decl_data *);
extern void print_lto_report (void);
extern bool lto_streamer_cache_insert (struct lto_streamer_cache_d *, tree,
int *, unsigned *);
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index e94bc204b22..9e782d578a2 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree.h"
#include "gimple.h"
@@ -206,6 +207,24 @@ lto_cgraph_replace_node (struct cgraph_node *node,
struct cgraph_node *prevailing_node)
{
struct cgraph_edge *e, *next;
+ bool no_aliases_please = false;
+
+ if (cgraph_dump_file)
+ {
+ fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i"
+ " for symbol %s\n",
+ cgraph_node_name (node), node->uid,
+ cgraph_node_name (prevailing_node),
+ prevailing_node->uid,
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)));
+ }
+
+ if (prevailing_node->same_body_alias)
+ {
+ if (prevailing_node->thunk.thunk_p)
+ no_aliases_please = true;
+ prevailing_node = prevailing_node->same_body;
+ }
/* Merge node flags. */
if (node->needed)
@@ -227,27 +246,37 @@ lto_cgraph_replace_node (struct cgraph_node *node,
/* Redirect incomming references. */
ipa_clone_refering (prevailing_node, NULL, &node->ref_list);
- if (node->same_body)
+ /* If we have aliases, redirect them to the prevailing node. */
+ if (!node->same_body_alias && node->same_body)
{
- struct cgraph_node *alias;
+ struct cgraph_node *alias, *last;
+ /* We prevail aliases/tunks by a thunk. This is doable but
+ would need thunk combination. Hopefully no ABI changes will
+ every be crazy enough. */
+ gcc_assert (!no_aliases_please);
for (alias = node->same_body; alias; alias = alias->next)
- if (DECL_ASSEMBLER_NAME_SET_P (alias->decl))
- {
- lto_symtab_entry_t se
- = lto_symtab_get (DECL_ASSEMBLER_NAME (alias->decl));
-
- for (; se; se = se->next)
- if (se->node == node)
- {
- se->node = NULL;
- break;
- }
- }
+ {
+ last = alias;
+ gcc_assert (alias->same_body_alias);
+ alias->same_body = prevailing_node;
+ alias->thunk.alias = prevailing_node->decl;
+ }
+ last->next = prevailing_node->same_body;
+ /* Node with aliases is prevailed by alias.
+ We could handle this, but combining thunks together will be tricky.
+ Hopefully this does not happen. */
+ if (prevailing_node->same_body)
+ prevailing_node->same_body->previous = last;
+ prevailing_node->same_body = node->same_body;
+ node->same_body = NULL;
}
/* Finally remove the replaced node. */
- cgraph_remove_node (node);
+ if (node->same_body_alias)
+ cgraph_remove_same_body_alias (node);
+ else
+ cgraph_remove_node (node);
}
/* Replace the cgraph node NODE with PREVAILING_NODE in the cgraph, merging
@@ -319,7 +348,8 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
if (TREE_CODE (decl) == FUNCTION_DECL)
{
- if (TREE_TYPE (prevailing_decl) != TREE_TYPE (decl))
+ if (!gimple_types_compatible_p (TREE_TYPE (prevailing_decl),
+ TREE_TYPE (decl), GTC_DIAG))
/* If we don't have a merged type yet...sigh. The linker
wouldn't complain if the types were mismatched, so we
probably shouldn't either. Just use the type from
@@ -352,7 +382,7 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
fixup process didn't yet run. */
prevailing_type = gimple_register_type (prevailing_type);
type = gimple_register_type (type);
- if (prevailing_type != type)
+ if (!gimple_types_compatible_p (prevailing_type, type, GTC_DIAG))
{
if (COMPLETE_TYPE_P (type))
return false;
@@ -377,7 +407,9 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
if (TREE_CODE (tem1) != TREE_CODE (tem2))
return false;
- if (gimple_register_type (tem1) != gimple_register_type (tem2))
+ if (!gimple_types_compatible_p (gimple_register_type (tem1),
+ gimple_register_type (tem2),
+ GTC_DIAG))
return false;
}
@@ -433,7 +465,9 @@ lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e)
/* For functions we need a non-discarded body. */
if (TREE_CODE (e->decl) == FUNCTION_DECL)
- return (e->node && e->node->analyzed);
+ return (e->node
+ && (e->node->analyzed
+ || (e->node->same_body_alias && e->node->same_body->analyzed)));
/* A variable should have a size. */
else if (TREE_CODE (e->decl) == VAR_DECL)
@@ -461,15 +495,9 @@ lto_symtab_resolve_symbols (void **slot)
for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
{
if (TREE_CODE (e->decl) == FUNCTION_DECL)
- e->node = cgraph_get_node (e->decl);
+ e->node = cgraph_get_node_or_alias (e->decl);
else if (TREE_CODE (e->decl) == VAR_DECL)
- {
- e->vnode = varpool_get_node (e->decl);
- /* The LTO plugin for gold doesn't handle common symbols
- properly. Let us choose manually. */
- if (DECL_COMMON (e->decl))
- e->resolution = LDPR_UNKNOWN;
- }
+ e->vnode = varpool_get_node (e->decl);
}
e = (lto_symtab_entry_t) *slot;
@@ -575,7 +603,8 @@ lto_symtab_merge_decls_2 (void **slot)
/* Diagnose all mismatched re-declarations. */
for (i = 0; VEC_iterate (tree, mismatches, i, decl); ++i)
{
- if (TREE_TYPE (prevailing->decl) != TREE_TYPE (decl))
+ if (!gimple_types_compatible_p (TREE_TYPE (prevailing->decl),
+ TREE_TYPE (decl), GTC_DIAG))
diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
"type of %qD does not match original "
"declaration", decl);
@@ -618,8 +647,12 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
/* Assert it's the only one. */
if (prevailing)
for (e = prevailing->next; e; e = e->next)
- gcc_assert (e->resolution != LDPR_PREVAILING_DEF_IRONLY
- && e->resolution != LDPR_PREVAILING_DEF);
+ {
+ if (e->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || e->resolution == LDPR_PREVAILING_DEF)
+ fatal_error ("multiple prevailing defs for %qE",
+ DECL_NAME (prevailing->decl));
+ }
/* If there's not a prevailing symbol yet it's an external reference.
Happens a lot during ltrans. Choose the first symbol with a
@@ -707,23 +740,26 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
&& TREE_CODE (prevailing->decl) != VAR_DECL)
prevailing->next = NULL;
- /* Set externally_visible flags for declaration of LDPR_PREVAILING_DEF */
- if (flag_whole_program)
+ /* Set used_from_object_file flags. */
+ if (prevailing->resolution == LDPR_PREVAILING_DEF
+ || prevailing->resolution == LDPR_PREEMPTED_REG
+ || prevailing->resolution == LDPR_RESOLVED_EXEC
+ || prevailing->resolution == LDPR_RESOLVED_DYN)
{
- if (prevailing->resolution == LDPR_PREVAILING_DEF)
- {
- if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
- prevailing->node->local.used_from_object_file = true;
- else
- prevailing->vnode->used_from_object_file = true;
- }
- else if (prevailing->resolution == LDPR_PREVAILING_DEF_IRONLY)
- {
- if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
- prevailing->node->local.used_from_object_file = false;
- else
- prevailing->vnode->used_from_object_file = false;
- }
+ if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
+ {
+ if (prevailing->node->same_body_alias)
+ prevailing->node->same_body->local.used_from_object_file = true;
+ else
+ prevailing->node->local.used_from_object_file = true;
+ }
+ else
+ {
+ if (prevailing->vnode->alias)
+ prevailing->vnode->extra_name->used_from_object_file = true;
+ else
+ prevailing->vnode->used_from_object_file = true;
+ }
}
return 1;
}
@@ -751,22 +787,7 @@ lto_symtab_merge_cgraph_nodes_1 (void **slot, void *data ATTRIBUTE_UNUSED)
for (e = prevailing->next; e; e = e->next)
{
if (e->node != NULL)
- {
- if (e->node->decl != e->decl && e->node->same_body)
- {
- struct cgraph_node *alias;
-
- for (alias = e->node->same_body; alias; alias = alias->next)
- if (alias->decl == e->decl)
- break;
- if (alias)
- {
- cgraph_remove_same_body_alias (alias);
- continue;
- }
- }
- lto_cgraph_replace_node (e->node, prevailing->node);
- }
+ lto_cgraph_replace_node (e->node, prevailing->node);
if (e->vnode != NULL)
lto_varpool_replace_node (e->vnode, prevailing->vnode);
}
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index c3618b6ab4a..6d3e7b8bc7f 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,60 @@
+2010-07-10 Andi Kleen <ak@linux.intel.com>
+
+ PR lto/44992
+ * lto.c: Include splay-tree.h
+ (lto_resolution_read): Change to walk file_ids tree and parse
+ extra file_id in resolution file.
+ (lto_section_with_id): Add.
+ (create_subid_section_table): Add.
+ (lwstate): Add.
+ (lto_create_files_from_ids): Add.
+ (lto_file_read): Change to handle sub file ids and create list
+ of file_datas. Add output argument for count.
+ (get_section_data): Pass file_data to lto_get_section_name.
+ (lto_flatten_file): Add.
+ (read_cgraph_and_symbols): Handle linked lists of file_datas.
+
+2010-07-10 Andi Kleen <ak@linux.intel.com>
+
+ * lto-coff.c (hash_name, eq_name): Move.
+ (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
+ * lto-elf.c: (hash_name, eq_name): Move.
+ (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
+ * lto-macho.c: (hash_name, eq_name): Move.
+ (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
+ * lto.c: (hash_name, eq_name): Move from lto-*.c
+ (lto_obj_create_section_hash_table): Add.
+ (free_with_string): Add.
+
+2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * lto-coff.c: Include diagnostic-core.h in every file that
+ includes toplev.h.
+ * lto-elf.c: Likewise.
+ * lto-lang.c: Likewise.
+ * lto-macho.c: Likewise.
+
+2010-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ * lto-elf.c (ELFOSABI_NONE, ELFOSABI_LINUX): Define if not defined.
+ (validate_file): Allow merging of ELFOSABI_NONE with ELFOSABI_LINUX
+ objects.
+
+2010-07-05 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (add_cgraph_node_to_partition): Forward declare; walk also
+ nodes from same comdat group as well as all comdat functions referenced
+ here.
+ (add_varpool_node_to_partition, add_references_to_partition): New function.
+ (lto_1_1_map): Skip COMDAT fnctions/variables; use add_varpool_node_to_partition;
+ clear aux flags when done.
+ (lto_promote_cross_file_statics): Do not promote stuff that gets duplicated to
+ each ltrans.
+
+2010-07-04 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (read_cgraph_and_symbols): Dump cgraph before merging.
+
2010-06-13 Richard Guenther <rguenther@suse.de>
* lto.c (lto_fixup_type): Do not register or fixup TYPE_CANONICAL.
diff --git a/gcc/lto/lto-coff.c b/gcc/lto/lto-coff.c
index 1f4264e6d24..f5aaff8bcaa 100644
--- a/gcc/lto/lto-coff.c
+++ b/gcc/lto/lto-coff.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "lto.h"
#include "tm.h"
@@ -133,29 +134,6 @@ lto_file_init (lto_file *file, const char *filename, off_t offset)
file->offset = offset;
}
-/* Returns a hash code for P. */
-
-static hashval_t
-hash_name (const void *p)
-{
- const struct lto_section_slot *ds = (const struct lto_section_slot *) p;
- return (hashval_t) htab_hash_string (ds->name);
-}
-
-/* Returns nonzero if P1 and P2 are equal. */
-
-static int
-eq_name (const void *p1, const void *p2)
-{
- const struct lto_section_slot *s1 =
- (const struct lto_section_slot *) p1;
- const struct lto_section_slot *s2 =
- (const struct lto_section_slot *) p2;
-
- return strcmp (s1->name, s2->name) == 0;
-}
-
-
/* Build a hash table whose key is the section names and whose data is
the start and size of each section in the .o file. */
@@ -168,7 +146,7 @@ lto_obj_build_section_table (lto_file *lto_file)
ssize_t strtab_size;
char *strtab;
- section_hash_table = htab_create (37, hash_name, eq_name, free);
+ section_hash_table = lto_obj_create_section_hash_table ();
/* Seek to start of string table. */
if (coff_file->strtab_offs != lseek (coff_file->fd,
diff --git a/gcc/lto/lto-elf.c b/gcc/lto/lto-elf.c
index bb4df809d9e..ad496217ede 100644
--- a/gcc/lto/lto-elf.c
+++ b/gcc/lto/lto-elf.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include <gelf.h>
#include "lto.h"
@@ -38,6 +39,13 @@ along with GCC; see the file COPYING3. If not see
# define EM_SPARC32PLUS 18
#endif
+#ifndef ELFOSABI_NONE
+# define ELFOSABI_NONE 0
+#endif
+#ifndef ELFOSABI_LINUX
+# define ELFOSABI_LINUX 3
+#endif
+
/* Handle opening elf files on hosts, such as Windows, that may use
text file handling that will break binary access. */
@@ -150,31 +158,6 @@ lto_elf_free_shdr (Elf64_Shdr *shdr)
free (shdr);
}
-
-/* Returns a hash code for P. */
-
-static hashval_t
-hash_name (const void *p)
-{
- const struct lto_section_slot *ds = (const struct lto_section_slot *) p;
- return (hashval_t) htab_hash_string (ds->name);
-}
-
-
-/* Returns nonzero if P1 and P2 are equal. */
-
-static int
-eq_name (const void *p1, const void *p2)
-{
- const struct lto_section_slot *s1 =
- (const struct lto_section_slot *) p1;
- const struct lto_section_slot *s2 =
- (const struct lto_section_slot *) p2;
-
- return strcmp (s1->name, s2->name) == 0;
-}
-
-
/* Build a hash table whose key is the section names and whose data is
the start and size of each section in the .o file. */
@@ -186,7 +169,7 @@ lto_obj_build_section_table (lto_file *lto_file)
Elf_Scn *section;
size_t base_offset;
- section_hash_table = htab_create (37, hash_name, eq_name, free);
+ section_hash_table = lto_obj_create_section_hash_table ();
base_offset = elf_getbase (elf_file->elf);
/* We are reasonably sure that elf_getbase does not fail at this
@@ -519,10 +502,28 @@ validate_file (lto_elf_file *elf_file)
memcpy (cached_file_attrs.elf_ident, elf_ident,
sizeof cached_file_attrs.elf_ident);
}
+ else
+ {
+ char elf_ident_buf[EI_NIDENT];
- if (memcmp (elf_ident, cached_file_attrs.elf_ident,
- sizeof cached_file_attrs.elf_ident))
- return false;
+ memcpy (elf_ident_buf, elf_ident, sizeof elf_ident_buf);
+
+ if (elf_ident_buf[EI_OSABI] != cached_file_attrs.elf_ident[EI_OSABI])
+ {
+ /* Allow mixing ELFOSABI_NONE with ELFOSABI_LINUX, with the result
+ ELFOSABI_LINUX. */
+ if (elf_ident_buf[EI_OSABI] == ELFOSABI_NONE
+ && cached_file_attrs.elf_ident[EI_OSABI] == ELFOSABI_LINUX)
+ elf_ident_buf[EI_OSABI] = cached_file_attrs.elf_ident[EI_OSABI];
+ else if (elf_ident_buf[EI_OSABI] == ELFOSABI_LINUX
+ && cached_file_attrs.elf_ident[EI_OSABI] == ELFOSABI_NONE)
+ cached_file_attrs.elf_ident[EI_OSABI] = elf_ident_buf[EI_OSABI];
+ }
+
+ if (memcmp (elf_ident_buf, cached_file_attrs.elf_ident,
+ sizeof cached_file_attrs.elf_ident))
+ return false;
+ }
/* Check that the input file is a relocatable object file with the correct
architecture. */
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 636b62aec58..fc25df6b9e5 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "lto.h"
#include "tree-inline.h"
#include "gimple.h"
+#include "diagnostic-core.h"
#include "toplev.h"
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
diff --git a/gcc/lto/lto-macho.c b/gcc/lto/lto-macho.c
index 1ba74c0a3a0..9f89e8e9bb3 100644
--- a/gcc/lto/lto-macho.c
+++ b/gcc/lto/lto-macho.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "lto.h"
#include "tm.h"
@@ -140,28 +141,6 @@ lto_file_init (lto_file *file, const char *filename, off_t offset)
file->offset = offset;
}
-/* Returns a hash code for P. */
-
-static hashval_t
-hash_name (const void *p)
-{
- const struct lto_section_slot *s = (const struct lto_section_slot *) p;
- return (hashval_t) htab_hash_string (s->name);
-}
-
-/* Returns nonzero if P1 and P2 are equal. */
-
-static int
-eq_name (const void *p1, const void *p2)
-{
- const struct lto_section_slot *s1 =
- (const struct lto_section_slot *) p1;
- const struct lto_section_slot *s2 =
- (const struct lto_section_slot *) p2;
-
- return strcmp (s1->name, s2->name) == 0;
-}
-
/* Build a hash table whose key is the section names and whose data is
the start and size of each section in the .o file. */
@@ -176,7 +155,7 @@ lto_obj_build_section_table (lto_file *lto_file)
char *strtab = NULL;
int i;
- section_hash_table = htab_create (37, hash_name, eq_name, free);
+ section_hash_table = lto_obj_create_section_hash_table ();
/* Seek the string table. */
/* FIXME The segment name should be in darwin.h, but can we include it
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index d969a1042d7..e4ee214f622 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "lto.h"
#include "lto-tree.h"
#include "lto-streamer.h"
+#include "splay-tree.h"
/* This needs to be included after config.h. Otherwise, _GNU_SOURCE will not
be defined in time to set __USE_GNU in the system headers, and strsignal
@@ -60,6 +61,47 @@ along with GCC; see the file COPYING3. If not see
static GTY(()) tree first_personality_decl;
+/* Returns a hash code for P. */
+
+static hashval_t
+hash_name (const void *p)
+{
+ const struct lto_section_slot *ds = (const struct lto_section_slot *) p;
+ return (hashval_t) htab_hash_string (ds->name);
+}
+
+
+/* Returns nonzero if P1 and P2 are equal. */
+
+static int
+eq_name (const void *p1, const void *p2)
+{
+ const struct lto_section_slot *s1 =
+ (const struct lto_section_slot *) p1;
+ const struct lto_section_slot *s2 =
+ (const struct lto_section_slot *) p2;
+
+ return strcmp (s1->name, s2->name) == 0;
+}
+
+/* Free lto_section_slot */
+
+static void
+free_with_string (void *arg)
+{
+ struct lto_section_slot *s = (struct lto_section_slot *)arg;
+
+ free (CONST_CAST (char *, s->name));
+ free (arg);
+}
+
+/* Create section hash table */
+
+htab_t
+lto_obj_create_section_hash_table (void)
+{
+ return htab_create (37, hash_name, eq_name, free_with_string);
+}
/* Read the constructors and inits. */
@@ -268,11 +310,10 @@ lto_parse_hex (const char *p) {
}
/* Read resolution for file named FILE_NAME. The resolution is read from
- RESOLUTION. An array with the symbol resolution is returned. The array
- size is written to SIZE. */
+ RESOLUTION. */
-static VEC(ld_plugin_symbol_resolution_t,heap) *
-lto_resolution_read (FILE *resolution, lto_file *file)
+static void
+lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file)
{
/* We require that objects in the resolution file are in the same
order as the lto1 command line. */
@@ -280,11 +321,12 @@ lto_resolution_read (FILE *resolution, lto_file *file)
char *obj_name;
unsigned int num_symbols;
unsigned int i;
- VEC(ld_plugin_symbol_resolution_t,heap) *ret = NULL;
+ struct lto_file_decl_data *file_data;
unsigned max_index = 0;
+ splay_tree_node nd = NULL;
if (!resolution)
- return NULL;
+ return;
name_len = strlen (file->filename);
obj_name = XNEWVEC (char, name_len + 1);
@@ -315,15 +357,15 @@ lto_resolution_read (FILE *resolution, lto_file *file)
for (i = 0; i < num_symbols; i++)
{
int t;
- unsigned index;
+ unsigned index, id;
char r_str[27];
enum ld_plugin_symbol_resolution r = (enum ld_plugin_symbol_resolution) 0;
unsigned int j;
unsigned int lto_resolution_str_len =
sizeof (lto_resolution_str) / sizeof (char *);
- t = fscanf (resolution, "%u %26s %*[^\n]\n", &index, r_str);
- if (t != 2)
+ t = fscanf (resolution, "%u %x %26s %*[^\n]\n", &index, &id, r_str);
+ if (t != 3)
internal_error ("Invalid line in the resolution file.");
if (index > max_index)
max_index = index;
@@ -339,12 +381,120 @@ lto_resolution_read (FILE *resolution, lto_file *file)
if (j == lto_resolution_str_len)
internal_error ("Invalid resolution in the resolution file.");
- VEC_safe_grow_cleared (ld_plugin_symbol_resolution_t, heap, ret,
+ if (!(nd && nd->key == id))
+ {
+ nd = splay_tree_lookup (file_ids, id);
+ if (nd == NULL)
+ internal_error ("Resolution sub id %x not in object file", id);
+ }
+
+ file_data = (struct lto_file_decl_data *)nd->value;
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Adding resolution %u %u to id %x\n",
+ index, r, file_data->id);
+ VEC_safe_grow_cleared (ld_plugin_symbol_resolution_t, heap,
+ file_data->resolutions,
max_index + 1);
- VEC_replace (ld_plugin_symbol_resolution_t, ret, index, r);
+ VEC_replace (ld_plugin_symbol_resolution_t,
+ file_data->resolutions, index, r);
}
+}
- return ret;
+/* Is the name for a id'ed LTO section? */
+
+static int
+lto_section_with_id (const char *name, unsigned *id)
+{
+ char *s;
+
+ if (strncmp (name, LTO_SECTION_NAME_PREFIX, strlen (LTO_SECTION_NAME_PREFIX)))
+ return 0;
+ s = strrchr (name, '.');
+ return s && sscanf (s, ".%x", id) == 1;
+}
+
+/* Create file_data of each sub file id */
+
+static int
+create_subid_section_table (void **slot, void *data)
+{
+ struct lto_section_slot s_slot, *new_slot;
+ struct lto_section_slot *ls = *(struct lto_section_slot **)slot;
+ splay_tree file_ids = (splay_tree)data;
+ unsigned id;
+ splay_tree_node nd;
+ void **hash_slot;
+ char *new_name;
+ struct lto_file_decl_data *file_data;
+
+ if (!lto_section_with_id (ls->name, &id))
+ return 1;
+
+ /* Find hash table of sub module id */
+ nd = splay_tree_lookup (file_ids, id);
+ if (nd != NULL)
+ {
+ file_data = (struct lto_file_decl_data *)nd->value;
+ }
+ else
+ {
+ file_data = ggc_alloc_lto_file_decl_data ();
+ memset(file_data, 0, sizeof (struct lto_file_decl_data));
+ file_data->id = id;
+ file_data->section_hash_table = lto_obj_create_section_hash_table ();;
+ splay_tree_insert (file_ids, id, (splay_tree_value)file_data);
+ }
+
+ /* Copy section into sub module hash table */
+ new_name = XDUPVEC (char, ls->name, strlen (ls->name) + 1);
+ s_slot.name = new_name;
+ hash_slot = htab_find_slot (file_data->section_hash_table, &s_slot, INSERT);
+ gcc_assert (*hash_slot == NULL);
+
+ new_slot = XDUP (struct lto_section_slot, ls);
+ new_slot->name = new_name;
+ *hash_slot = new_slot;
+ return 1;
+}
+
+/* Read declarations and other initializations for a FILE_DATA. */
+
+static void
+lto_file_finalize (struct lto_file_decl_data *file_data, lto_file *file)
+{
+ const char *data;
+ size_t len;
+
+ file_data->renaming_hash_table = lto_create_renaming_table ();
+ file_data->file_name = file->filename;
+ data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len);
+ gcc_assert (data != NULL);
+ lto_read_decls (file_data, data, file_data->resolutions);
+ lto_free_section_data (file_data, LTO_section_decls, NULL, data, len);
+}
+
+struct lwstate
+{
+ lto_file *file;
+ struct lto_file_decl_data **file_data;
+ int *count;
+};
+
+/* Traverse ids and create a list of file_datas out of it. */
+
+static int lto_create_files_from_ids (splay_tree_node node, void *data)
+{
+ struct lwstate *lw = (struct lwstate *)data;
+ struct lto_file_decl_data *file_data = (struct lto_file_decl_data *)node->value;
+
+ lto_file_finalize (file_data, lw->file);
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Creating file %s with sub id %x\n",
+ file_data->file_name, file_data->id);
+ file_data->next = *lw->file_data;
+ *lw->file_data = file_data;
+ (*lw->count)++;
+ return 0;
}
/* Generate a TREE representation for all types and external decls
@@ -355,23 +505,32 @@ lto_resolution_read (FILE *resolution, lto_file *file)
the .o file to load the functions and ipa information. */
static struct lto_file_decl_data *
-lto_file_read (lto_file *file, FILE *resolution_file)
+lto_file_read (lto_file *file, FILE *resolution_file, int *count)
{
- struct lto_file_decl_data *file_data;
- const char *data;
- size_t len;
- VEC(ld_plugin_symbol_resolution_t,heap) *resolutions;
+ struct lto_file_decl_data *file_data = NULL;
+ splay_tree file_ids;
+ htab_t section_hash_table;
+ struct lwstate state;
- resolutions = lto_resolution_read (resolution_file, file);
-
- file_data = ggc_alloc_lto_file_decl_data ();
- file_data->file_name = file->filename;
- file_data->section_hash_table = lto_obj_build_section_table (file);
- file_data->renaming_hash_table = lto_create_renaming_table ();
+ section_hash_table = lto_obj_build_section_table (file);
- data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len);
- lto_read_decls (file_data, data, resolutions);
- lto_free_section_data (file_data, LTO_section_decls, NULL, data, len);
+ /* Find all sub modules in the object and put their sections into new hash
+ tables in a splay tree. */
+ file_ids = splay_tree_new (splay_tree_compare_ints, NULL, NULL);
+ htab_traverse (section_hash_table, create_subid_section_table, file_ids);
+
+ /* Add resolutions to file ids */
+ lto_resolution_read (file_ids, resolution_file, file);
+
+ /* Finalize each lto file for each submodule in the merged object
+ and create list for returning. */
+ state.file = file;
+ state.file_data = &file_data;
+ state.count = count;
+ splay_tree_foreach (file_ids, lto_create_files_from_ids, &state);
+
+ splay_tree_delete (file_ids);
+ htab_delete (section_hash_table);
return file_data;
}
@@ -466,7 +625,7 @@ get_section_data (struct lto_file_decl_data *file_data,
htab_t section_hash_table = file_data->section_hash_table;
struct lto_section_slot *f_slot;
struct lto_section_slot s_slot;
- const char *section_name = lto_get_section_name (section_type, name);
+ const char *section_name = lto_get_section_name (section_type, name, file_data);
char *data = NULL;
*len = 0;
@@ -525,6 +684,9 @@ DEF_VEC_ALLOC_P(ltrans_partition,gc);
static GTY (()) VEC(ltrans_partition, gc) *ltrans_partitions;
+static void add_cgraph_node_to_partition (ltrans_partition part, struct cgraph_node *node);
+static void add_varpool_node_to_partition (ltrans_partition part, struct varpool_node *vnode);
+
/* Create new partition with name NAME. */
static ltrans_partition
new_partition (const char *name)
@@ -538,17 +700,77 @@ new_partition (const char *name)
return part;
}
-/* Add NODE to partition as well as the inline callees into partition PART. */
+/* See all references that go to comdat objects and bring them into partition too. */
+static void
+add_references_to_partition (ltrans_partition part, struct ipa_ref_list *refs)
+{
+ int i;
+ struct ipa_ref *ref;
+ for (i = 0; ipa_ref_list_reference_iterate (refs, i, ref); i++)
+ {
+ if (ref->refered_type == IPA_REF_CGRAPH
+ && DECL_COMDAT (ipa_ref_node (ref)->decl)
+ && !cgraph_node_in_set_p (ipa_ref_node (ref), part->cgraph_set))
+ add_cgraph_node_to_partition (part, ipa_ref_node (ref));
+ else
+ if (ref->refered_type == IPA_REF_VARPOOL
+ && DECL_COMDAT (ipa_ref_varpool_node (ref)->decl)
+ && !varpool_node_in_set_p (ipa_ref_varpool_node (ref), part->varpool_set))
+ add_varpool_node_to_partition (part, ipa_ref_varpool_node (ref));
+ }
+}
+
+/* Add NODE to partition as well as the inline callees and referred comdats into partition PART. */
static void
add_cgraph_node_to_partition (ltrans_partition part, struct cgraph_node *node)
{
struct cgraph_edge *e;
+
part->insns += node->local.inline_summary.self_size;
+
+ if (node->aux)
+ {
+ gcc_assert (node->aux != part);
+ node->in_other_partition = 1;
+ }
+ else
+ node->aux = part;
+
cgraph_node_set_add (part->cgraph_set, node);
+
for (e = node->callees; e; e = e->next_callee)
- if (!e->inline_failed)
+ if ((!e->inline_failed || DECL_COMDAT (e->callee->decl))
+ && !cgraph_node_in_set_p (e->callee, part->cgraph_set))
add_cgraph_node_to_partition (part, e->callee);
+
+ add_references_to_partition (part, &node->ref_list);
+
+ if (node->same_comdat_group
+ && !cgraph_node_in_set_p (node->same_comdat_group, part->cgraph_set))
+ add_cgraph_node_to_partition (part, node->same_comdat_group);
+}
+
+/* Add VNODE to partition as well as comdat references partition PART. */
+
+static void
+add_varpool_node_to_partition (ltrans_partition part, struct varpool_node *vnode)
+{
+ varpool_node_set_add (part->varpool_set, vnode);
+
+ if (vnode->aux)
+ {
+ gcc_assert (vnode->aux != part);
+ vnode->in_other_partition = 1;
+ }
+ else
+ vnode->aux = part;
+
+ add_references_to_partition (part, &vnode->ref_list);
+
+ if (vnode->same_comdat_group
+ && !varpool_node_in_set_p (vnode->same_comdat_group, part->varpool_set))
+ add_varpool_node_to_partition (part, vnode->same_comdat_group);
}
/* Group cgrah nodes by input files. This is used mainly for testing
@@ -577,6 +799,10 @@ lto_1_to_1_map (void)
/* Nodes without a body do not need partitioning. */
if (!node->analyzed)
continue;
+ /* Extern inlines and comdat are always only in partitions they are needed. */
+ if (DECL_EXTERNAL (node->decl)
+ || DECL_COMDAT (node->decl))
+ continue;
file_data = node->local.lto_file_data;
gcc_assert (!node->same_body_alias && file_data);
@@ -599,6 +825,10 @@ lto_1_to_1_map (void)
{
if (vnode->alias || !vnode->needed)
continue;
+ /* Constant pool and comdat are always only in partitions they are needed. */
+ if (DECL_IN_CONSTANT_POOL (vnode->decl)
+ || DECL_COMDAT (vnode->decl))
+ continue;
file_data = vnode->lto_file_data;
slot = pointer_map_contains (pmap, file_data);
if (slot)
@@ -611,8 +841,12 @@ lto_1_to_1_map (void)
npartitions++;
}
- varpool_node_set_add (partition->varpool_set, vnode);
+ add_varpool_node_to_partition (partition, vnode);
}
+ for (node = cgraph_nodes; node; node = node->next)
+ node->aux = NULL;
+ for (vnode = varpool_nodes; vnode; vnode = vnode->next)
+ vnode->aux = NULL;
/* If the cgraph is empty, create one cgraph node set so that there is still
an output file for any variables that need to be exported in a DSO. */
@@ -704,7 +938,7 @@ lto_promote_cross_file_statics (void)
continue;
if (node->global.inlined_to)
continue;
- if (!DECL_EXTERNAL (node->decl)
+ if ((!DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
&& (referenced_from_other_partition_p (&node->ref_list, set, vset)
|| reachable_from_other_partition_p (node, set)))
promote_fn (node);
@@ -715,10 +949,10 @@ lto_promote_cross_file_statics (void)
/* Constant pool references use internal labels and thus can not
be made global. It is sensible to keep those ltrans local to
allow better optimization. */
- if (!DECL_IN_CONSTANT_POOL (vnode->decl)
- && !vnode->externally_visible && vnode->analyzed
- && referenced_from_other_partition_p (&vnode->ref_list,
- set, vset))
+ if (!DECL_IN_CONSTANT_POOL (vnode->decl) && !DECL_COMDAT (vnode->decl)
+ && !vnode->externally_visible && vnode->analyzed
+ && referenced_from_other_partition_p (&vnode->ref_list,
+ set, vset))
promote_var (vnode);
}
@@ -1422,6 +1656,33 @@ lto_read_all_file_options (void)
static GTY((length ("lto_stats.num_input_files + 1"))) struct lto_file_decl_data **all_file_decl_data;
+/* Turn file datas for sub files into a single array, so that they look
+ like separate files for further passes. */
+
+static void
+lto_flatten_files (struct lto_file_decl_data **orig, int count, int last_file_ix)
+{
+ struct lto_file_decl_data *n, *next;
+ int i, k;
+
+ lto_stats.num_input_files = count;
+ all_file_decl_data
+ = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (count + 1);
+ /* Set the hooks so that all of the ipa passes can read in their data. */
+ lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
+ for (i = 0, k = 0; i < last_file_ix; i++)
+ {
+ for (n = orig[i]; n != NULL; n = next)
+ {
+ all_file_decl_data[k++] = n;
+ next = n->next;
+ n->next = NULL;
+ }
+ }
+ all_file_decl_data[k] = NULL;
+ gcc_assert (k == count);
+}
+
/* Read all the symbols from the input files FNAMES. NFILES is the
number of files requested in the command line. Instantiate a
global call graph by aggregating all the sub-graphs found in each
@@ -1433,15 +1694,14 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
unsigned int i, last_file_ix;
FILE *resolution;
struct cgraph_node *node;
+ int count = 0;
+ struct lto_file_decl_data **decl_data;
- lto_stats.num_input_files = nfiles;
+ init_cgraph ();
- timevar_push (TV_IPA_LTO_DECL_IO);
+ timevar_push (TV_IPA_LTO_DECL_IN);
- /* Set the hooks so that all of the ipa passes can read in their data. */
- all_file_decl_data
- = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (nfiles + 1);
- lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
+ decl_data = (struct lto_file_decl_data **)xmalloc (sizeof(*decl_data) * (nfiles+1));
/* Read the resolution file. */
resolution = NULL;
@@ -1478,11 +1738,11 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
if (!current_lto_file)
break;
- file_data = lto_file_read (current_lto_file, resolution);
+ file_data = lto_file_read (current_lto_file, resolution, &count);
if (!file_data)
break;
- all_file_decl_data[last_file_ix++] = file_data;
+ decl_data[last_file_ix++] = file_data;
lto_obj_file_close (current_lto_file);
current_lto_file = NULL;
@@ -1490,15 +1750,17 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
code in gimple.c uses hashtables that are not ggc aware. */
}
+ lto_flatten_files (decl_data, count, last_file_ix);
+ lto_stats.num_input_files = count;
+ free(decl_data);
+
if (resolution_file_name)
fclose (resolution);
- all_file_decl_data[last_file_ix] = NULL;
-
/* Set the hooks so that all of the ipa passes can read in their data. */
lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
- timevar_pop (TV_IPA_LTO_DECL_IO);
+ timevar_pop (TV_IPA_LTO_DECL_IN);
if (!quiet_flag)
fprintf (stderr, "\nReading the callgraph\n");
@@ -1534,6 +1796,12 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* Finally merge the cgraph according to the decl merging decisions. */
timevar_push (TV_IPA_LTO_CGRAPH_MERGE);
+ if (cgraph_dump_file)
+ {
+ fprintf (cgraph_dump_file, "Before merging:\n");
+ dump_cgraph (cgraph_dump_file);
+ dump_varpool (cgraph_dump_file);
+ }
lto_symtab_merge_cgraph_nodes ();
ggc_collect ();
@@ -1590,7 +1858,7 @@ materialize_cgraph (void)
/* Now that we have input the cgraph, we need to clear all of the aux
nodes and read the functions if we are not running in WPA mode. */
- timevar_push (TV_IPA_LTO_GIMPLE_IO);
+ timevar_push (TV_IPA_LTO_GIMPLE_IN);
for (node = cgraph_nodes; node; node = node->next)
{
@@ -1611,7 +1879,7 @@ materialize_cgraph (void)
}
}
- timevar_pop (TV_IPA_LTO_GIMPLE_IO);
+ timevar_pop (TV_IPA_LTO_GIMPLE_IN);
/* Start the appropriate timer depending on the mode that we are
operating in. */
diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h
index cdd30d6e960..47d9973b31f 100644
--- a/gcc/lto/lto.h
+++ b/gcc/lto/lto.h
@@ -44,6 +44,7 @@ extern void lto_read_all_file_options (void);
extern lto_file *lto_obj_file_open (const char *filename, bool writable);
extern void lto_obj_file_close (lto_file *file);
extern htab_t lto_obj_build_section_table (lto_file *file);
+extern htab_t lto_obj_create_section_hash_table (void);
extern void lto_obj_begin_section (const char *name);
extern void lto_obj_append_data (const void *data, size_t len, void *block);
extern void lto_obj_end_section (void);
diff --git a/gcc/main.c b/gcc/main.c
index 3e6c41c39a1..7a8390e71ec 100644
--- a/gcc/main.c
+++ b/gcc/main.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
int main (int argc, char **argv);
diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c
index 4958762169f..84c6e6ea3c2 100644
--- a/gcc/matrix-reorg.c
+++ b/gcc/matrix-reorg.c
@@ -218,7 +218,7 @@ collect_data_for_malloc_call (gimple stmt, struct malloc_call_data *m_data)
initial address and index of each dimension. */
struct access_site_info
{
- /* The statement (INDIRECT_REF or POINTER_PLUS_EXPR). */
+ /* The statement (MEM_REF or POINTER_PLUS_EXPR). */
gimple stmt;
/* In case of POINTER_PLUS_EXPR, what is the offset. */
@@ -334,7 +334,7 @@ struct ssa_acc_in_tree
/* The variable whose accesses in the tree we are looking for. */
tree ssa_var;
/* The tree and code inside it the ssa_var is accessed, currently
- it could be an INDIRECT_REF or CALL_EXPR. */
+ it could be an MEM_REF or CALL_EXPR. */
enum tree_code t_code;
tree t_tree;
/* The place in the containing tree. */
@@ -413,33 +413,18 @@ mtt_info_eq (const void *mtt1, const void *mtt2)
static bool
may_flatten_matrices_1 (gimple stmt)
{
- tree t;
-
switch (gimple_code (stmt))
{
case GIMPLE_ASSIGN:
- if (!gimple_assign_cast_p (stmt))
+ case GIMPLE_CALL:
+ if (!gimple_has_lhs (stmt))
return true;
-
- t = gimple_assign_rhs1 (stmt);
- while (CONVERT_EXPR_P (t))
+ if (TREE_CODE (TREE_TYPE (gimple_get_lhs (stmt))) == VECTOR_TYPE)
{
- if (TREE_TYPE (t) && POINTER_TYPE_P (TREE_TYPE (t)))
- {
- tree pointee;
-
- pointee = TREE_TYPE (t);
- while (POINTER_TYPE_P (pointee))
- pointee = TREE_TYPE (pointee);
- if (TREE_CODE (pointee) == VECTOR_TYPE)
- {
- if (dump_file)
- fprintf (dump_file,
- "Found vector type, don't flatten matrix\n");
- return false;
- }
- }
- t = TREE_OPERAND (t, 0);
+ if (dump_file)
+ fprintf (dump_file,
+ "Found vector type, don't flatten matrix\n");
+ return false;
}
break;
case GIMPLE_ASM:
@@ -602,7 +587,7 @@ mark_min_matrix_escape_level (struct matrix_info *mi, int l, gimple s)
/* Find if the SSA variable is accessed inside the
tree and record the tree containing it.
The only relevant uses are the case of SSA_NAME, or SSA inside
- INDIRECT_REF, PLUS_EXPR, POINTER_PLUS_EXPR, MULT_EXPR. */
+ MEM_REF, PLUS_EXPR, POINTER_PLUS_EXPR, MULT_EXPR. */
static void
ssa_accessed_in_tree (tree t, struct ssa_acc_in_tree *a)
{
@@ -613,7 +598,7 @@ ssa_accessed_in_tree (tree t, struct ssa_acc_in_tree *a)
if (t == a->ssa_var)
a->var_found = true;
break;
- case INDIRECT_REF:
+ case MEM_REF:
if (SSA_VAR_P (TREE_OPERAND (t, 0))
&& TREE_OPERAND (t, 0) == a->ssa_var)
a->var_found = true;
@@ -660,7 +645,7 @@ ssa_accessed_in_assign_rhs (gimple stmt, struct ssa_acc_in_tree *a)
tree op1, op2;
case SSA_NAME:
- case INDIRECT_REF:
+ case MEM_REF:
CASE_CONVERT:
case VIEW_CONVERT_EXPR:
ssa_accessed_in_tree (gimple_assign_rhs1 (stmt), a);
@@ -984,7 +969,7 @@ get_index_from_offset (tree offset, gimple def_stmt)
/* update MI->dimension_type_size[CURRENT_INDIRECT_LEVEL] with the size
of the type related to the SSA_VAR, or the type related to the
- lhs of STMT, in the case that it is an INDIRECT_REF. */
+ lhs of STMT, in the case that it is an MEM_REF. */
static void
update_type_size (struct matrix_info *mi, gimple stmt, tree ssa_var,
int current_indirect_level)
@@ -992,9 +977,9 @@ update_type_size (struct matrix_info *mi, gimple stmt, tree ssa_var,
tree lhs;
HOST_WIDE_INT type_size;
- /* Update type according to the type of the INDIRECT_REF expr. */
+ /* Update type according to the type of the MEM_REF expr. */
if (is_gimple_assign (stmt)
- && TREE_CODE (gimple_assign_lhs (stmt)) == INDIRECT_REF)
+ && TREE_CODE (gimple_assign_lhs (stmt)) == MEM_REF)
{
lhs = gimple_assign_lhs (stmt);
gcc_assert (POINTER_TYPE_P
@@ -1073,7 +1058,7 @@ analyze_accesses_for_call_stmt (struct matrix_info *mi, tree ssa_var,
at this level because in this case we cannot calculate the
address correctly. */
if ((lhs_acc.var_found && rhs_acc.var_found
- && lhs_acc.t_code == INDIRECT_REF)
+ && lhs_acc.t_code == MEM_REF)
|| (!rhs_acc.var_found && !lhs_acc.var_found))
{
mark_min_matrix_escape_level (mi, current_indirect_level, use_stmt);
@@ -1087,7 +1072,7 @@ analyze_accesses_for_call_stmt (struct matrix_info *mi, tree ssa_var,
{
int l = current_indirect_level + 1;
- gcc_assert (lhs_acc.t_code == INDIRECT_REF);
+ gcc_assert (lhs_acc.t_code == MEM_REF);
mark_min_matrix_escape_level (mi, l, use_stmt);
return current_indirect_level;
}
@@ -1213,7 +1198,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var,
at this level because in this case we cannot calculate the
address correctly. */
if ((lhs_acc.var_found && rhs_acc.var_found
- && lhs_acc.t_code == INDIRECT_REF)
+ && lhs_acc.t_code == MEM_REF)
|| (!rhs_acc.var_found && !lhs_acc.var_found))
{
mark_min_matrix_escape_level (mi, current_indirect_level, use_stmt);
@@ -1227,7 +1212,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var,
{
int l = current_indirect_level + 1;
- gcc_assert (lhs_acc.t_code == INDIRECT_REF);
+ gcc_assert (lhs_acc.t_code == MEM_REF);
if (!(gimple_assign_copy_p (use_stmt)
|| gimple_assign_cast_p (use_stmt))
@@ -1248,7 +1233,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var,
is used. */
if (rhs_acc.var_found)
{
- if (rhs_acc.t_code != INDIRECT_REF
+ if (rhs_acc.t_code != MEM_REF
&& rhs_acc.t_code != POINTER_PLUS_EXPR && rhs_acc.t_code != SSA_NAME)
{
mark_min_matrix_escape_level (mi, current_indirect_level, use_stmt);
@@ -1256,7 +1241,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var,
}
/* If the access in the RHS has an indirection increase the
indirection level. */
- if (rhs_acc.t_code == INDIRECT_REF)
+ if (rhs_acc.t_code == MEM_REF)
{
if (record_accesses)
record_access_alloc_site_info (mi, use_stmt, NULL_TREE,
@@ -1309,7 +1294,7 @@ analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var,
}
/* If we are storing this level of indirection mark it as
escaping. */
- if (lhs_acc.t_code == INDIRECT_REF || TREE_CODE (lhs) != SSA_NAME)
+ if (lhs_acc.t_code == MEM_REF || TREE_CODE (lhs) != SSA_NAME)
{
int l = current_indirect_level;
@@ -1369,8 +1354,8 @@ analyze_matrix_accesses (struct matrix_info *mi, tree ssa_var,
return;
/* Now go over the uses of the SSA_NAME and check how it is used in
- each one of them. We are mainly looking for the pattern INDIRECT_REF,
- then a POINTER_PLUS_EXPR, then INDIRECT_REF etc. while in between there could
+ each one of them. We are mainly looking for the pattern MEM_REF,
+ then a POINTER_PLUS_EXPR, then MEM_REF etc. while in between there could
be any number of copies and casts. */
gcc_assert (TREE_CODE (ssa_var) == SSA_NAME);
@@ -1856,7 +1841,7 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
gimple new_stmt;
gcc_assert (gimple_assign_rhs_code (acc_info->stmt)
- == INDIRECT_REF);
+ == MEM_REF);
/* Emit convert statement to convert to type of use. */
tmp = create_tmp_var (TREE_TYPE (lhs), "new");
add_referenced_var (tmp);
@@ -1878,10 +1863,10 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
continue;
}
code = gimple_assign_rhs_code (acc_info->stmt);
- if (code == INDIRECT_REF
+ if (code == MEM_REF
&& acc_info->level < min_escape_l - 1)
{
- /* Replace the INDIRECT_REF with NOP (cast) usually we are casting
+ /* Replace the MEM_REF with NOP (cast) usually we are casting
from "pointer to type" to "type". */
tree t =
build1 (NOP_EXPR, TREE_TYPE (gimple_assign_rhs1 (acc_info->stmt)),
@@ -2206,7 +2191,6 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
for (i = 1; i < mi->min_indirect_level_escape; i++)
{
gimple_stmt_iterator gsi;
- gimple use_stmt1 = NULL;
gimple call_stmt = mi->malloc_for_level[i];
gcc_assert (is_gimple_call (call_stmt));
@@ -2216,17 +2200,9 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
gsi = gsi_for_stmt (call_stmt);
/* Remove the call stmt. */
gsi_remove (&gsi, true);
- /* remove the type cast stmt. */
- FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter,
- gimple_call_lhs (call_stmt))
- {
- use_stmt1 = use_stmt;
- gsi = gsi_for_stmt (use_stmt);
- gsi_remove (&gsi, true);
- }
/* Remove the assignment of the allocated area. */
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter,
- gimple_get_lhs (use_stmt1))
+ gimple_call_lhs (call_stmt))
{
gsi = gsi_for_stmt (use_stmt);
gsi_remove (&gsi, true);
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index c0db7c4d367..306fb5d4c25 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -1,6 +1,6 @@
/* CPU mode switching
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
- 2009 Free Software Foundation, Inc.
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -445,7 +445,7 @@ optimize_mode_switching (void)
int i, j;
int n_entities;
int max_num_modes = 0;
- bool emited = false;
+ bool emited ATTRIBUTE_UNUSED = false;
basic_block post_entry ATTRIBUTE_UNUSED, pre_exit ATTRIBUTE_UNUSED;
for (e = N_ENTITIES - 1, n_entities = 0; e >= 0; e--)
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index ebf76492e2b..07e718c6505 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 099bc6595ac..de6cbebd2ad 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,71 @@
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
+
+2010-07-10 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR objc/44140
+ * objc-act.c: build_objc_string_decl() remove declaration.
+ (finish_var_decl): Remove forcing of var output and marking
+ as "Used".
+ (init_def_list): Use integer_zero_node.
+ (init_objc_symtab): Use integer_zero_node, make the short
+ integer type specific on relevant nodes.
+ (generate_objc_symtab_decl): Remove call to
+ forward_declare_categories(). Use null_pointer_node where
+ appropriate.
+ (build_module_descriptor): Comment and mark this item as
+ DECL_PRESERVE_P.
+ (generate_static_references): Use gcc_unreachable instead of
+ abort ().
+ (diagnose_missing_method): New.
+ (build_next_selector_translation_table): New.
+ (build_gnu_selector_translation_table): New.
+ (add_objc_string): Merge code from build_objc_string_decl...
+ ... and delete build_objc_string_decl().
+ (generate_dispatch_table): Make integer types explicit.
+ (generate_category): Pass implent and arrange for the data
+ to be extracted within the routine. Do not start new vars,
+ but finish the ones collcted during parsing.
+ (generate_shared_structures): Likewise.
+ (finish_objc): Reorder code so that we finish variables before
+ referencing them. Save the global data before calling meta-data
+ creation routines, and pass the current reference to the two
+ main routines. Only call generate_objc_image_info () for the
+ NeXT runtime.
+ (generate_classref_translation_entry): Comment on and make this
+ item DECL_PRESERVE_P.
+ (handle_class_ref): Use varpool interfaces, comment on and make
+ this item DECL_PRESERVE_P.
+ (handle_impent): Likewise.
+ (generate_objc_image_info): Only generate when the content is
+ non-zero. Make integer types explict.
+
+2010-07-03 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR objc/24867
+ * objc-act.c (build_sized_array_type): New function.
+ (add_objc_string): Use it.
+ (generate_protocol_list): Likewise.
+ (generate_objc_image_info): Likewise.
+ (add_field_decl): New function.
+ (objc_build_struct): Use a VEC rather than building a TREE_LIST.
+ (generate_struct_by_value_array): Use add_field_decl.
+ (build_objc_symtab_template): Likewise.
+ (build_module_descriptor): Likewise.
+ (build_objc_exception_stuff): Likewise.
+ (build_protocol_template): Likewise.
+ (build_method_prototype_list_template): Likewise.
+ (build_method_prototype_template): Likewise.
+ (build_category_template): Likewise.
+ (build_selector_template): Likewise.
+ (build_class_template): Likewise.
+ (build_super_template): Likewise.
+ (build_ivar_template): Likewise.
+ (build_ivar_list_template): Likewise.
+ (build_method_list_template): Likewise.
+ (build_method_template): Likewise.
+
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* objc-act.c: Do not include except.h.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 45b10207629..81aba84eb97 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -214,7 +214,6 @@ enum string_section
};
static tree add_objc_string (tree, enum string_section);
-static tree build_objc_string_decl (enum string_section);
static void build_selector_table_decl (void);
/* Protocol additions. */
@@ -442,6 +441,25 @@ objc_finish_struct (tree type, tree fieldlist)
objc_struct_info);
}
+static tree
+build_sized_array_type (tree base_type, int size)
+{
+ tree index_type = build_index_type (build_int_cst (NULL_TREE, size - 1));
+ return build_array_type (base_type, index_type);
+}
+
+static tree
+add_field_decl (tree type, const char *name, tree **chain)
+{
+ tree field = create_field_decl (type, name);
+
+ if (*chain != NULL)
+ **chain = field;
+ *chain = &DECL_CHAIN (field);
+
+ return field;
+}
+
/* Some platforms pass small structures through registers versus
through an invisible pointer. Determine at what size structure is
the transition point between the two possibilities. */
@@ -450,7 +468,7 @@ static void
generate_struct_by_value_array (void)
{
tree type;
- tree field_decl, field_decl_chain;
+ tree decls;
int i, j;
int aggregate_in_mem[32];
int found = 0;
@@ -459,23 +477,20 @@ generate_struct_by_value_array (void)
for (i = 1; i < 32; i++)
{
char buffer[5];
+ tree *chain = NULL;
/* Create an unnamed struct that has `i' character components */
type = objc_start_struct (NULL_TREE);
strcpy (buffer, "c1");
- field_decl = create_field_decl (char_type_node,
- buffer);
- field_decl_chain = field_decl;
+ decls = add_field_decl (char_type_node, buffer, &chain);
for (j = 1; j < i; j++)
{
sprintf (buffer, "c%d", j + 1);
- field_decl = create_field_decl (char_type_node,
- buffer);
- chainon (field_decl_chain, field_decl);
+ add_field_decl (char_type_node, buffer, &chain);
}
- objc_finish_struct (type, field_decl_chain);
+ objc_finish_struct (type, decls);
aggregate_in_mem[i] = aggregate_value_p (type, 0);
if (!aggregate_in_mem[i])
@@ -824,7 +839,9 @@ objc_build_struct (tree klass, tree fields, tree super_name)
tree name = CLASS_NAME (klass);
tree s = objc_start_struct (name);
tree super = (super_name ? xref_tag (RECORD_TYPE, super_name) : NULL_TREE);
- tree t, objc_info = NULL_TREE;
+ tree t;
+ VEC(tree,heap) *objc_info = NULL;
+ int i;
if (super)
{
@@ -834,9 +851,9 @@ objc_build_struct (tree klass, tree fields, tree super_name)
FIELD_DECL, NULL_TREE, super);
tree field = TYPE_FIELDS (super);
- while (field && TREE_CHAIN (field)
- && TREE_CODE (TREE_CHAIN (field)) == FIELD_DECL)
- field = TREE_CHAIN (field);
+ while (field && DECL_CHAIN (field)
+ && TREE_CODE (DECL_CHAIN (field)) == FIELD_DECL)
+ field = DECL_CHAIN (field);
/* For ObjC ABI purposes, the "packed" size of a base class is
the sum of the offset and the size (in bits) of the last field
@@ -865,7 +882,7 @@ objc_build_struct (tree klass, tree fields, tree super_name)
if (fields)
TREE_NO_WARNING (fields) = 1; /* Suppress C++ ABI warnings -- we */
#endif /* are following the ObjC ABI here. */
- TREE_CHAIN (base) = fields;
+ DECL_CHAIN (base) = fields;
fields = base;
}
@@ -882,9 +899,7 @@ objc_build_struct (tree klass, tree fields, tree super_name)
INIT_TYPE_OBJC_INFO (t);
TYPE_OBJC_INTERFACE (t) = klass;
}
- objc_info
- = chainon (objc_info,
- build_tree_list (NULL_TREE, TYPE_OBJC_INFO (t)));
+ VEC_safe_push (tree, heap, objc_info, TYPE_OBJC_INFO (t));
}
/* Point the struct at its related Objective-C class. */
@@ -893,13 +908,13 @@ objc_build_struct (tree klass, tree fields, tree super_name)
s = objc_finish_struct (s, fields);
- for (t = TYPE_NEXT_VARIANT (s); t;
- t = TYPE_NEXT_VARIANT (t), objc_info = TREE_CHAIN (objc_info))
+ for (i = 0, t = TYPE_NEXT_VARIANT (s); t; t = TYPE_NEXT_VARIANT (t), i++)
{
- TYPE_OBJC_INFO (t) = TREE_VALUE (objc_info);
+ TYPE_OBJC_INFO (t) = VEC_index (tree, objc_info, i);
/* Replace the IDENTIFIER_NODE with an actual @interface. */
TYPE_OBJC_INTERFACE (t) = klass;
}
+ VEC_free (tree, heap, objc_info);
/* Use TYPE_BINFO structures to point at the super class, if any. */
objc_xref_basetypes (s, super);
@@ -1525,14 +1540,6 @@ static void
finish_var_decl (tree var, tree initializer)
{
finish_decl (var, input_location, initializer, NULL_TREE, NULL_TREE);
- /* Ensure that the variable actually gets output. */
- mark_decl_referenced (var);
- /* Mark the decl to avoid "defined but not used" warning. */
- TREE_USED (var) = 1;
- DECL_READ_P (var) = 1;
- /* We reserve the right for the runtime to use/modify these variables
- in ways that are opaque to us. */
- DECL_PRESERVE_P (var) = 1;
}
/* Find the decl for the constant string class reference. This is only
@@ -1841,11 +1848,11 @@ check_string_class_template (void)
if (!AT_LEAST_AS_LARGE_AS (field_decl, ptr_type_node))
return 0;
- field_decl = TREE_CHAIN (field_decl);
+ field_decl = DECL_CHAIN (field_decl);
if (!AT_LEAST_AS_LARGE_AS (field_decl, ptr_type_node))
return 0;
- field_decl = TREE_CHAIN (field_decl);
+ field_decl = DECL_CHAIN (field_decl);
return AT_LEAST_AS_LARGE_AS (field_decl, unsigned_type_node);
#undef AT_LEAST_AS_LARGE_AS
@@ -1866,10 +1873,10 @@ objc_build_internal_const_str_type (void)
tree field = build_decl (input_location,
FIELD_DECL, NULL_TREE, ptr_type_node);
- TREE_CHAIN (field) = fields; fields = field;
+ DECL_CHAIN (field) = fields; fields = field;
field = build_decl (input_location,
FIELD_DECL, NULL_TREE, unsigned_type_node);
- TREE_CHAIN (field) = fields; fields = field;
+ DECL_CHAIN (field) = fields; fields = field;
/* NB: The finish_builtin_struct() routine expects FIELD_DECLs in
reverse order! */
finish_builtin_struct (type, "__builtin_ObjCString",
@@ -1996,11 +2003,11 @@ objc_build_string_object (tree string)
? build_unary_op (input_location,
ADDR_EXPR, string_class_decl, 0)
: build_int_cst (NULL_TREE, 0));
- fields = TREE_CHAIN (fields);
+ fields = DECL_CHAIN (fields);
CONSTRUCTOR_APPEND_ELT (v, fields,
build_unary_op (input_location,
ADDR_EXPR, string, 1));
- fields = TREE_CHAIN (fields);
+ fields = DECL_CHAIN (fields);
CONSTRUCTOR_APPEND_ELT (v, fields, build_int_cst (NULL_TREE, length));
constructor = objc_build_constructor (internal_const_str_type, v);
@@ -2105,43 +2112,32 @@ objc_build_constructor (tree type, VEC(constructor_elt,gc) *elts)
static void
build_objc_symtab_template (void)
{
- tree field_decl, field_decl_chain;
+ tree fields, *chain = NULL;
objc_symtab_template = objc_start_struct (get_identifier (UTAG_SYMTAB));
/* long sel_ref_cnt; */
- field_decl = create_field_decl (long_integer_type_node, "sel_ref_cnt");
- field_decl_chain = field_decl;
+ fields = add_field_decl (long_integer_type_node, "sel_ref_cnt", &chain);
/* SEL *refs; */
- field_decl = create_field_decl (build_pointer_type (objc_selector_type),
- "refs");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (objc_selector_type), "refs", &chain);
/* short cls_def_cnt; */
- field_decl = create_field_decl (short_integer_type_node, "cls_def_cnt");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (short_integer_type_node, "cls_def_cnt", &chain);
/* short cat_def_cnt; */
- field_decl = create_field_decl (short_integer_type_node,
- "cat_def_cnt");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (short_integer_type_node, "cat_def_cnt", &chain);
if (imp_count || cat_count || !flag_next_runtime)
{
/* void *defs[imp_count + cat_count (+ 1)]; */
/* NB: The index is one less than the size of the array. */
- int index = imp_count + cat_count
- + (flag_next_runtime? -1: 0);
- field_decl = create_field_decl
- (build_array_type
- (ptr_type_node,
- build_index_type (build_int_cst (NULL_TREE, index))),
- "defs");
- chainon (field_decl_chain, field_decl);
+ int index = imp_count + cat_count + (flag_next_runtime ? -1: 0);
+ tree array_type = build_sized_array_type (ptr_type_node, index + 1);
+ add_field_decl (array_type, "defs", &chain);
}
- objc_finish_struct (objc_symtab_template, field_decl_chain);
+ objc_finish_struct (objc_symtab_template, fields);
}
/* Create the initial value for the `defs' field of _objc_symtab.
@@ -2183,7 +2179,7 @@ init_def_list (tree type)
expr = build_unary_op (input_location,
ADDR_EXPR, static_instances_decl, 0);
else
- expr = build_int_cst (NULL_TREE, 0);
+ expr = integer_zero_node;
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
}
@@ -2206,7 +2202,9 @@ init_objc_symtab (tree type)
/* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */
if (flag_next_runtime || ! sel_ref_chain)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, convert (
+ build_pointer_type (objc_selector_type),
+ integer_zero_node));
else
{
tree expr = build_unary_op (input_location, ADDR_EXPR,
@@ -2219,11 +2217,13 @@ init_objc_symtab (tree type)
/* cls_def_cnt = { ..., 5, ... } */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, imp_count));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (short_integer_type_node, imp_count));
/* cat_def_cnt = { ..., 5, ... } */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, cat_count));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (short_integer_type_node, cat_count));
/* cls_def = { ..., { &Foo, &Bar, ...}, ... } */
@@ -2231,7 +2231,7 @@ init_objc_symtab (tree type)
{
tree field = TYPE_FIELDS (type);
- field = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (field))));
+ field = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (field))));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init_def_list (TREE_TYPE (field)));
}
@@ -2284,10 +2284,7 @@ forward_declare_categories (void)
static void
generate_objc_symtab_decl (void)
{
- /* forward declare categories */
- if (cat_count)
- forward_declare_categories ();
-
+
build_objc_symtab_template ();
UOBJC_SYMBOLS_decl = start_var_decl (objc_symtab_template, "_OBJC_SYMBOLS");
finish_var_decl (UOBJC_SYMBOLS_decl,
@@ -2323,7 +2320,7 @@ init_module_descriptor (tree type)
expr = build_unary_op (input_location,
ADDR_EXPR, UOBJC_SYMBOLS_decl, 0);
else
- expr = build_int_cst (NULL_TREE, 0);
+ expr = null_pointer_node;
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
return objc_build_constructor (type, v);
@@ -2336,7 +2333,7 @@ init_module_descriptor (tree type)
static void
build_module_descriptor (void)
{
- tree field_decl, field_decl_chain;
+ tree decls, *chain = NULL;
#ifdef OBJCPLUS
push_lang_context (lang_name_c); /* extern "C" */
@@ -2345,29 +2342,26 @@ build_module_descriptor (void)
objc_module_template = objc_start_struct (get_identifier (UTAG_MODULE));
/* long version; */
- field_decl = create_field_decl (long_integer_type_node, "version");
- field_decl_chain = field_decl;
+ decls = add_field_decl (long_integer_type_node, "version", &chain);
/* long size; */
- field_decl = create_field_decl (long_integer_type_node, "size");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (long_integer_type_node, "size", &chain);
/* char *name; */
- field_decl = create_field_decl (string_type_node, "name");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "name", &chain);
/* struct _objc_symtab *symtab; */
- field_decl
- = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_SYMTAB))),
- "symtab");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_SYMTAB))),
+ "symtab", &chain);
- objc_finish_struct (objc_module_template, field_decl_chain);
+ objc_finish_struct (objc_module_template, decls);
/* Create an instance of "_objc_module". */
UOBJC_MODULES_decl = start_var_decl (objc_module_template, "_OBJC_MODULES");
+ /* This is the root of the metadata for defined classes and categories, it
+ is referenced by the runtime and, therefore, needed. */
+ DECL_PRESERVE_P (UOBJC_MODULES_decl) = 1;
finish_var_decl (UOBJC_MODULES_decl,
init_module_descriptor (TREE_TYPE (UOBJC_MODULES_decl)));
@@ -2491,7 +2485,7 @@ generate_static_references (void)
VEC(constructor_elt,gc) *decls = NULL;
if (flag_next_runtime)
- abort ();
+ gcc_unreachable ();
for (cl_chain = objc_static_instances, num_class = 0;
cl_chain; cl_chain = TREE_CHAIN (cl_chain), num_class++)
@@ -2575,54 +2569,78 @@ build_selector (tree ident)
add_objc_string (ident, meth_var_names));
}
+/* Used only by build_*_selector_translation_table (). */
static void
-build_selector_translation_table (void)
+diagnose_missing_method (tree meth, location_t here)
{
- tree chain;
- int offset = 0;
- tree decl = NULL_TREE;
- VEC(constructor_elt,gc) *inits = NULL;
+ tree method_chain;
+ bool found = false;
+ for (method_chain = meth_var_names_chain;
+ method_chain;
+ method_chain = TREE_CHAIN (method_chain))
+ {
+ if (TREE_VALUE (method_chain) == meth)
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ warning_at (here, 0, "creating selector for nonexistent method %qE",
+ meth);
+}
+static void
+build_next_selector_translation_table (void)
+{
+ tree chain;
for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
{
tree expr;
-
+ tree decl = TREE_PURPOSE (chain);
if (warn_selector && objc_implementation_context)
- {
- tree method_chain;
- bool found = false;
- for (method_chain = meth_var_names_chain;
- method_chain;
- method_chain = TREE_CHAIN (method_chain))
- {
- if (TREE_VALUE (method_chain) == TREE_VALUE (chain))
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- location_t loc;
- if (flag_next_runtime && TREE_PURPOSE (chain))
- loc = DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
- else
- loc = input_location;
- warning_at (loc, 0, "creating selector for nonexistent method %qE",
- TREE_VALUE (chain));
- }
- }
+ {
+ location_t loc;
+ if (decl)
+ loc = DECL_SOURCE_LOCATION (decl);
+ else
+ loc = input_location;
+ diagnose_missing_method (TREE_VALUE (chain), loc);
+ }
expr = build_selector (TREE_VALUE (chain));
- /* add one for the '\0' character */
- offset += IDENTIFIER_LENGTH (TREE_VALUE (chain)) + 1;
- if (flag_next_runtime)
+ if (decl)
{
- decl = TREE_PURPOSE (chain);
+ /* Entries of this form are used for references to methods.
+ The runtime re-writes these on start-up, but the compiler can't see
+ that and optimizes it away unless we force it. */
+ DECL_PRESERVE_P (decl) = 1;
finish_var_decl (decl, expr);
}
- else
+ }
+}
+
+static void
+build_gnu_selector_translation_table (void)
+{
+ tree chain;
+/* int offset = 0;
+ tree decl = NULL_TREE;*/
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ tree expr;
+
+ if (warn_selector && objc_implementation_context)
+ diagnose_missing_method (TREE_VALUE (chain), input_location);
+
+ expr = build_selector (TREE_VALUE (chain));
+ /* add one for the '\0' character
+ offset += IDENTIFIER_LENGTH (TREE_VALUE (chain)) + 1;*/
+
{
if (flag_typed_selectors)
{
@@ -2635,9 +2653,8 @@ build_selector_translation_table (void)
CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
}
- }
+ } /* each element in the chain */
- if (! flag_next_runtime)
{
/* Cause the selector table (previously forward-declared)
to be actually output. */
@@ -2646,12 +2663,12 @@ build_selector_translation_table (void)
if (flag_typed_selectors)
{
VEC(constructor_elt,gc) *v = NULL;
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
expr = objc_build_constructor (objc_selector_template, v);
}
else
- expr = build_int_cst (NULL_TREE, 0);
+ expr = integer_zero_node;
CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
expr = objc_build_constructor (TREE_TYPE (UOBJC_SELECTOR_TABLE_decl),
@@ -2855,19 +2872,34 @@ objc_get_class_reference (tree ident)
/* For each string section we have a chain which maps identifier nodes
to decls for the strings. */
+static GTY(()) int class_names_idx;
+static GTY(()) int meth_var_names_idx;
+static GTY(()) int meth_var_types_idx;
+
static tree
add_objc_string (tree ident, enum string_section section)
{
tree *chain, decl, type, string_expr;
-
+ char buf[256];
+
+ buf[0] = 0;
if (section == class_names)
- chain = &class_names_chain;
+ {
+ chain = &class_names_chain;
+ sprintf (buf, "_OBJC_CLASS_NAME_%d", class_names_idx++);
+ }
else if (section == meth_var_names)
- chain = &meth_var_names_chain;
+ {
+ chain = &meth_var_names_chain;
+ sprintf (buf, "_OBJC_METH_VAR_NAME_%d", meth_var_names_idx++);
+ }
else if (section == meth_var_types)
- chain = &meth_var_types_chain;
+ {
+ chain = &meth_var_types_chain;
+ sprintf (buf, "_OBJC_METH_VAR_TYPE_%d", meth_var_types_idx++);
+ }
else
- abort ();
+ gcc_unreachable ();
while (*chain)
{
@@ -2879,16 +2911,11 @@ add_objc_string (tree ident, enum string_section section)
chain = &TREE_CHAIN (*chain);
}
- decl = build_objc_string_decl (section);
-
- type = build_array_type
- (char_type_node,
- build_index_type
- (build_int_cst (NULL_TREE,
- IDENTIFIER_LENGTH (ident))));
- decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl)));
+ type = build_sized_array_type (char_type_node, IDENTIFIER_LENGTH (ident) + 1);
+ decl = start_var_decl (type, buf);
string_expr = my_build_string (IDENTIFIER_LENGTH (ident) + 1,
IDENTIFIER_POINTER (ident));
+ TREE_CONSTANT (decl) = 1;
finish_var_decl (decl, string_expr);
*chain = tree_cons (decl, ident, NULL_TREE);
@@ -2897,44 +2924,6 @@ add_objc_string (tree ident, enum string_section section)
ADDR_EXPR, decl, 1));
}
-static GTY(()) int class_names_idx;
-static GTY(()) int meth_var_names_idx;
-static GTY(()) int meth_var_types_idx;
-
-static tree
-build_objc_string_decl (enum string_section section)
-{
- tree decl, ident;
- char buf[256];
-
- if (section == class_names)
- sprintf (buf, "_OBJC_CLASS_NAME_%d", class_names_idx++);
- else if (section == meth_var_names)
- sprintf (buf, "_OBJC_METH_VAR_NAME_%d", meth_var_names_idx++);
- else if (section == meth_var_types)
- sprintf (buf, "_OBJC_METH_VAR_TYPE_%d", meth_var_types_idx++);
-
- ident = get_identifier (buf);
-
- decl = build_decl (input_location,
- VAR_DECL, ident, build_array_type (char_type_node, 0));
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 0;
- TREE_USED (decl) = 1;
- TREE_CONSTANT (decl) = 1;
- DECL_CONTEXT (decl) = 0;
- DECL_ARTIFICIAL (decl) = 1;
-#ifdef OBJCPLUS
- DECL_THIS_STATIC (decl) = 1; /* squash redeclaration errors */
-#endif
-
- make_decl_rtl (decl);
- pushdecl_top_level (decl);
-
- return decl;
-}
-
-
void
objc_declare_alias (tree alias_ident, tree class_ident)
{
@@ -4067,26 +4056,22 @@ objc_build_synchronized (location_t start_locus, tree mutex, tree body)
static void
build_next_objc_exception_stuff (void)
{
- tree field_decl, field_decl_chain, index, temp_type;
+ tree decls, temp_type, *chain = NULL;
objc_exception_data_template
= objc_start_struct (get_identifier (UTAG_EXCDATA));
/* int buf[OBJC_JBLEN]; */
- index = build_index_type (build_int_cst (NULL_TREE, OBJC_JBLEN - 1));
- field_decl = create_field_decl (build_array_type (integer_type_node, index),
- "buf");
- field_decl_chain = field_decl;
+ temp_type = build_sized_array_type (integer_type_node, OBJC_JBLEN);
+ decls = add_field_decl (temp_type, "buf", &chain);
/* void *pointers[4]; */
- index = build_index_type (build_int_cst (NULL_TREE, 4 - 1));
- field_decl = create_field_decl (build_array_type (ptr_type_node, index),
- "pointers");
- chainon (field_decl_chain, field_decl);
+ temp_type = build_sized_array_type (ptr_type_node, 4);
+ add_field_decl (temp_type, "pointers", &chain);
- objc_finish_struct (objc_exception_data_template, field_decl_chain);
+ objc_finish_struct (objc_exception_data_template, decls);
/* int _setjmp(...); */
/* If the user includes <setjmp.h>, this shall be superseded by
@@ -4225,39 +4210,29 @@ build_private_template (tree klass)
static void
build_protocol_template (void)
{
- tree field_decl, field_decl_chain;
+ tree ptype, decls, *chain = NULL;
objc_protocol_template = objc_start_struct (get_identifier (UTAG_PROTOCOL));
/* struct _objc_class *isa; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_CLASS))),
- "isa");
- field_decl_chain = field_decl;
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_CLASS)));
+ decls = add_field_decl (ptype, "isa", &chain);
/* char *protocol_name; */
- field_decl = create_field_decl (string_type_node, "protocol_name");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "protocol_name", &chain);
/* struct _objc_protocol **protocol_list; */
- field_decl = create_field_decl (build_pointer_type
- (build_pointer_type
- (objc_protocol_template)),
- "protocol_list");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
+ add_field_decl (ptype, "protocol_list", &chain);
/* struct _objc__method_prototype_list *instance_methods; */
- field_decl = create_field_decl (objc_method_proto_list_ptr,
- "instance_methods");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (objc_method_proto_list_ptr, "instance_methods", &chain);
/* struct _objc__method_prototype_list *class_methods; */
- field_decl = create_field_decl (objc_method_proto_list_ptr,
- "class_methods");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (objc_method_proto_list_ptr, "class_methods", &chain);
- objc_finish_struct (objc_protocol_template, field_decl_chain);
+ objc_finish_struct (objc_protocol_template, decls);
}
static tree
@@ -4278,7 +4253,7 @@ build_descriptor_table_initializer (tree type, tree entries)
CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
objc_build_constructor (type, elts));
- entries = TREE_CHAIN (entries);
+ entries = DECL_CHAIN (entries);
}
while (entries);
@@ -4297,25 +4272,20 @@ static tree
build_method_prototype_list_template (tree list_type, int size)
{
tree objc_ivar_list_record;
- tree field_decl, field_decl_chain;
+ tree array_type, decls, *chain = NULL;
/* Generate an unnamed struct definition. */
objc_ivar_list_record = objc_start_struct (NULL_TREE);
/* int method_count; */
- field_decl = create_field_decl (integer_type_node, "method_count");
- field_decl_chain = field_decl;
+ decls = add_field_decl (integer_type_node, "method_count", &chain);
/* struct objc_method method_list[]; */
- field_decl = create_field_decl (build_array_type
- (list_type,
- build_index_type
- (build_int_cst (NULL_TREE, size - 1))),
- "method_list");
- chainon (field_decl_chain, field_decl);
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "method_list", &chain);
- objc_finish_struct (objc_ivar_list_record, field_decl_chain);
+ objc_finish_struct (objc_ivar_list_record, decls);
return objc_ivar_list_record;
}
@@ -4324,19 +4294,17 @@ static tree
build_method_prototype_template (void)
{
tree proto_record;
- tree field_decl, field_decl_chain;
+ tree decls, *chain = NULL;
proto_record = objc_start_struct (get_identifier (UTAG_METHOD_PROTOTYPE));
/* SEL _cmd; */
- field_decl = create_field_decl (objc_selector_type, "_cmd");
- field_decl_chain = field_decl;
+ decls = add_field_decl (objc_selector_type, "_cmd", &chain);
/* char *method_types; */
- field_decl = create_field_decl (string_type_node, "method_types");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "method_types", &chain);
- objc_finish_struct (proto_record, field_decl_chain);
+ objc_finish_struct (proto_record, decls);
return proto_record;
}
@@ -4388,7 +4356,7 @@ encode_method_prototype (tree method_decl)
i = int_size_in_bytes (ptr_type_node);
parm_offset = 2 * i;
for (parms = METHOD_SEL_ARGS (method_decl); parms;
- parms = TREE_CHAIN (parms))
+ parms = DECL_CHAIN (parms))
{
tree type = objc_method_parm_type (parms);
int sz = objc_encoded_type_size (type);
@@ -4411,7 +4379,7 @@ encode_method_prototype (tree method_decl)
/* Argument types. */
parm_offset = 2 * i;
for (parms = METHOD_SEL_ARGS (method_decl); parms;
- parms = TREE_CHAIN (parms))
+ parms = DECL_CHAIN (parms))
{
tree type = objc_method_parm_type (parms);
@@ -4727,7 +4695,7 @@ generate_protocols (void)
encoding = encode_method_prototype (nst_methods);
METHOD_ENCODING (nst_methods) = encoding;
}
- nst_methods = TREE_CHAIN (nst_methods);
+ nst_methods = DECL_CHAIN (nst_methods);
}
while (cls_methods)
@@ -4738,7 +4706,7 @@ generate_protocols (void)
METHOD_ENCODING (cls_methods) = encoding;
}
- cls_methods = TREE_CHAIN (cls_methods);
+ cls_methods = DECL_CHAIN (cls_methods);
}
generate_method_descriptors (p);
@@ -4821,36 +4789,27 @@ build_protocol_initializer (tree type, tree protocol_name,
static void
build_category_template (void)
{
- tree field_decl, field_decl_chain;
+ tree ptype, decls, *chain = NULL;
objc_category_template = objc_start_struct (get_identifier (UTAG_CATEGORY));
/* char *category_name; */
- field_decl = create_field_decl (string_type_node, "category_name");
- field_decl_chain = field_decl;
+ decls = add_field_decl (string_type_node, "category_name", &chain);
/* char *class_name; */
- field_decl = create_field_decl (string_type_node, "class_name");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "class_name", &chain);
/* struct _objc_method_list *instance_methods; */
- field_decl = create_field_decl (objc_method_list_ptr,
- "instance_methods");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (objc_method_list_ptr, "instance_methods", &chain);
/* struct _objc_method_list *class_methods; */
- field_decl = create_field_decl (objc_method_list_ptr,
- "class_methods");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (objc_method_list_ptr, "class_methods", &chain);
/* struct _objc_protocol **protocol_list; */
- field_decl = create_field_decl (build_pointer_type
- (build_pointer_type
- (objc_protocol_template)),
- "protocol_list");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
+ add_field_decl (ptype, "protocol_list", &chain);
- objc_finish_struct (objc_category_template, field_decl_chain);
+ objc_finish_struct (objc_category_template, decls);
}
/* struct _objc_selector {
@@ -4861,19 +4820,17 @@ build_category_template (void)
static void
build_selector_template (void)
{
- tree field_decl, field_decl_chain;
+ tree decls, *chain = NULL;
objc_selector_template = objc_start_struct (get_identifier (UTAG_SELECTOR));
/* SEL sel_id; */
- field_decl = create_field_decl (objc_selector_type, "sel_id");
- field_decl_chain = field_decl;
+ decls = add_field_decl (objc_selector_type, "sel_id", &chain);
/* char *sel_type; */
- field_decl = create_field_decl (string_type_node, "sel_type");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "sel_type", &chain);
- objc_finish_struct (objc_selector_template, field_decl_chain);
+ objc_finish_struct (objc_selector_template, decls);
}
/* struct _objc_class {
@@ -4907,102 +4864,76 @@ build_selector_template (void)
static void
build_class_template (void)
{
- tree field_decl, field_decl_chain;
+ tree ptype, decls, *chain = NULL;
objc_class_template = objc_start_struct (get_identifier (UTAG_CLASS));
/* struct _objc_class *isa; */
- field_decl = create_field_decl (build_pointer_type (objc_class_template),
- "isa");
- field_decl_chain = field_decl;
+ decls = add_field_decl (build_pointer_type (objc_class_template),
+ "isa", &chain);
/* struct _objc_class *super_class; */
- field_decl = create_field_decl (build_pointer_type (objc_class_template),
- "super_class");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (objc_class_template),
+ "super_class", &chain);
/* char *name; */
- field_decl = create_field_decl (string_type_node, "name");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "name", &chain);
/* long version; */
- field_decl = create_field_decl (long_integer_type_node, "version");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (long_integer_type_node, "version", &chain);
/* long info; */
- field_decl = create_field_decl (long_integer_type_node, "info");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (long_integer_type_node, "info", &chain);
/* long instance_size; */
- field_decl = create_field_decl (long_integer_type_node, "instance_size");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (long_integer_type_node, "instance_size", &chain);
/* struct _objc_ivar_list *ivars; */
- field_decl = create_field_decl (objc_ivar_list_ptr,
- "ivars");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (objc_ivar_list_ptr,"ivars", &chain);
/* struct _objc_method_list *methods; */
- field_decl = create_field_decl (objc_method_list_ptr,
- "methods");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (objc_method_list_ptr, "methods", &chain);
if (flag_next_runtime)
{
/* struct objc_cache *cache; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- ("objc_cache"))),
- "cache");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("objc_cache")));
+ add_field_decl (ptype, "cache", &chain);
}
else
{
/* struct sarray *dtable; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- ("sarray"))),
- "dtable");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type(xref_tag (RECORD_TYPE,
+ get_identifier ("sarray")));
+ add_field_decl (ptype, "dtable", &chain);
/* struct objc_class *subclass_list; */
- field_decl = create_field_decl (build_pointer_type
- (objc_class_template),
- "subclass_list");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type (objc_class_template);
+ add_field_decl (ptype, "subclass_list", &chain);
/* struct objc_class *sibling_class; */
- field_decl = create_field_decl (build_pointer_type
- (objc_class_template),
- "sibling_class");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type (objc_class_template);
+ add_field_decl (ptype, "sibling_class", &chain);
}
/* struct _objc_protocol **protocol_list; */
- field_decl = create_field_decl (build_pointer_type
- (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_PROTOCOL)))),
- "protocol_list");
- chainon (field_decl_chain, field_decl);
+ ptype = build_pointer_type (build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_PROTOCOL))));
+ add_field_decl (ptype, "protocol_list", &chain);
if (flag_next_runtime)
{
/* void *sel_id; */
- field_decl = create_field_decl (build_pointer_type (void_type_node),
- "sel_id");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (void_type_node), "sel_id", &chain);
}
/* void *gc_object_type; */
- field_decl = create_field_decl (build_pointer_type (void_type_node),
- "gc_object_type");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (void_type_node),
+ "gc_object_type", &chain);
- objc_finish_struct (objc_class_template, field_decl_chain);
+ objc_finish_struct (objc_class_template, decls);
}
/* Generate appropriate forward declarations for an implementation. */
@@ -5085,8 +5016,8 @@ check_ivars (tree inter, tree imp)
intdecls);
}
- intdecls = TREE_CHAIN (intdecls);
- impdecls = TREE_CHAIN (impdecls);
+ intdecls = DECL_CHAIN (intdecls);
+ impdecls = DECL_CHAIN (impdecls);
}
}
@@ -5101,20 +5032,18 @@ check_ivars (tree inter, tree imp)
static void
build_super_template (void)
{
- tree field_decl, field_decl_chain;
+ tree decls, *chain = NULL;
objc_super_template = objc_start_struct (get_identifier (UTAG_SUPER));
/* struct _objc_object *self; */
- field_decl = create_field_decl (objc_object_type, "self");
- field_decl_chain = field_decl;
+ decls = add_field_decl (objc_object_type, "self", &chain);
/* struct _objc_class *super_class; */
- field_decl = create_field_decl (build_pointer_type (objc_class_template),
- "super_class");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (objc_class_template),
+ "super_class", &chain);
- objc_finish_struct (objc_super_template, field_decl_chain);
+ objc_finish_struct (objc_super_template, decls);
}
/* struct _objc_ivar {
@@ -5127,24 +5056,21 @@ static tree
build_ivar_template (void)
{
tree objc_ivar_id, objc_ivar_record;
- tree field_decl, field_decl_chain;
+ tree decls, *chain = NULL;
objc_ivar_id = get_identifier (UTAG_IVAR);
objc_ivar_record = objc_start_struct (objc_ivar_id);
/* char *ivar_name; */
- field_decl = create_field_decl (string_type_node, "ivar_name");
- field_decl_chain = field_decl;
+ decls = add_field_decl (string_type_node, "ivar_name", &chain);
/* char *ivar_type; */
- field_decl = create_field_decl (string_type_node, "ivar_type");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "ivar_type", &chain);
/* int ivar_offset; */
- field_decl = create_field_decl (integer_type_node, "ivar_offset");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (integer_type_node, "ivar_offset", &chain);
- objc_finish_struct (objc_ivar_record, field_decl_chain);
+ objc_finish_struct (objc_ivar_record, decls);
return objc_ivar_record;
}
@@ -5158,23 +5084,18 @@ static tree
build_ivar_list_template (tree list_type, int size)
{
tree objc_ivar_list_record;
- tree field_decl, field_decl_chain;
+ tree array_type, decls, *chain = NULL;
objc_ivar_list_record = objc_start_struct (NULL_TREE);
/* int ivar_count; */
- field_decl = create_field_decl (integer_type_node, "ivar_count");
- field_decl_chain = field_decl;
+ decls = add_field_decl (integer_type_node, "ivar_count", &chain);
/* struct objc_ivar ivar_list[]; */
- field_decl = create_field_decl (build_array_type
- (list_type,
- build_index_type
- (build_int_cst (NULL_TREE, size - 1))),
- "ivar_list");
- chainon (field_decl_chain, field_decl);
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "ivar_list", &chain);
- objc_finish_struct (objc_ivar_list_record, field_decl_chain);
+ objc_finish_struct (objc_ivar_list_record, decls);
return objc_ivar_list_record;
}
@@ -5189,28 +5110,21 @@ static tree
build_method_list_template (tree list_type, int size)
{
tree objc_ivar_list_record;
- tree field_decl, field_decl_chain;
+ tree array_type, decls, *chain = NULL;
objc_ivar_list_record = objc_start_struct (NULL_TREE);
/* struct _objc__method_prototype_list *method_next; */
- field_decl = create_field_decl (objc_method_proto_list_ptr,
- "method_next");
- field_decl_chain = field_decl;
+ decls = add_field_decl (objc_method_proto_list_ptr, "method_next", &chain);
/* int method_count; */
- field_decl = create_field_decl (integer_type_node, "method_count");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (integer_type_node, "method_count", &chain);
/* struct objc_method method_list[]; */
- field_decl = create_field_decl (build_array_type
- (list_type,
- build_index_type
- (build_int_cst (NULL_TREE, size - 1))),
- "method_list");
- chainon (field_decl_chain, field_decl);
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "method_list", &chain);
- objc_finish_struct (objc_ivar_list_record, field_decl_chain);
+ objc_finish_struct (objc_ivar_list_record, decls);
return objc_ivar_list_record;
}
@@ -5251,7 +5165,7 @@ build_ivar_list_initializer (tree type, tree field_decl)
CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
objc_build_constructor (type, ivar));
do
- field_decl = TREE_CHAIN (field_decl);
+ field_decl = DECL_CHAIN (field_decl);
while (field_decl && TREE_CODE (field_decl) != FIELD_DECL);
}
while (field_decl);
@@ -5284,7 +5198,7 @@ ivar_list_length (tree t)
{
int count = 0;
- for (; t; t = TREE_CHAIN (t))
+ for (; t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == FIELD_DECL)
++count;
@@ -5367,7 +5281,7 @@ build_dispatch_table_initializer (tree type, tree entries)
CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
objc_build_constructor (type, elems));
- entries = TREE_CHAIN (entries);
+ entries = DECL_CHAIN (entries);
}
while (entries);
@@ -5386,24 +5300,20 @@ static tree
build_method_template (void)
{
tree _SLT_record;
- tree field_decl, field_decl_chain;
+ tree decls, *chain = NULL;
_SLT_record = objc_start_struct (get_identifier (UTAG_METHOD));
/* SEL _cmd; */
- field_decl = create_field_decl (objc_selector_type, "_cmd");
- field_decl_chain = field_decl;
+ decls = add_field_decl (objc_selector_type, "_cmd", &chain);
/* char *method_types; */
- field_decl = create_field_decl (string_type_node, "method_types");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (string_type_node, "method_types", &chain);
/* void *_imp; */
- field_decl = create_field_decl (build_pointer_type (void_type_node),
- "_imp");
- chainon (field_decl_chain, field_decl);
+ add_field_decl (build_pointer_type (void_type_node), "_imp", &chain);
- objc_finish_struct (_SLT_record, field_decl_chain);
+ objc_finish_struct (_SLT_record, decls);
return _SLT_record;
}
@@ -5418,8 +5328,8 @@ generate_dispatch_table (tree type, const char *name, int size, tree list)
decl = start_var_decl (type, synth_id_with_class_suffix
(name, objc_implementation_context));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, size));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, list);
finish_var_decl (decl,
@@ -5440,14 +5350,14 @@ mark_referenced_methods (void)
while (chain)
{
cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
- chain = TREE_CHAIN (chain);
+ chain = DECL_CHAIN (chain);
}
chain = CLASS_NST_METHODS (impent->imp_context);
while (chain)
{
cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
- chain = TREE_CHAIN (chain);
+ chain = DECL_CHAIN (chain);
}
}
}
@@ -5511,7 +5421,7 @@ generate_dispatch_tables (void)
static tree
generate_protocol_list (tree i_or_p)
{
- tree refs_decl, lproto, e, plist;
+ tree array_type, ptype, refs_decl, lproto, e, plist;
int size = 0;
const char *ref_name;
VEC(constructor_elt,gc) *v = NULL;
@@ -5559,11 +5469,9 @@ generate_protocol_list (tree i_or_p)
else
abort ();
- refs_decl = start_var_decl
- (build_array_type
- (build_pointer_type (objc_protocol_template),
- build_index_type (build_int_cst (NULL_TREE, size + 2))),
- ref_name);
+ ptype = build_pointer_type (objc_protocol_template);
+ array_type = build_sized_array_type (ptype, size + 3);
+ refs_decl = start_var_decl (array_type, ref_name);
finish_var_decl (refs_decl,
objc_build_constructor (TREE_TYPE (refs_decl), v));
@@ -5744,11 +5652,15 @@ lookup_category (tree klass, tree cat_name)
/* static struct objc_category _OBJC_CATEGORY_<name> = { ... }; */
static void
-generate_category (tree cat)
+generate_category (struct imp_entry *impent)
{
- tree decl;
tree initlist, cat_name_expr, class_name_expr;
tree protocol_decl, category;
+ tree cat = impent->imp_context;
+
+ implementation_template = impent->imp_template;
+ UOBJC_CLASS_decl = impent->class_decl;
+ UOBJC_METACLASS_decl = impent->meta_decl;
add_class_reference (CLASS_NAME (cat));
cat_name_expr = add_objc_string (CLASS_SUPER_NAME (cat), class_names);
@@ -5766,30 +5678,32 @@ generate_category (tree cat)
else
protocol_decl = 0;
- decl = start_var_decl (objc_category_template,
- synth_id_with_class_suffix
- ("_OBJC_CATEGORY", objc_implementation_context));
-
- initlist = build_category_initializer (TREE_TYPE (decl),
+ initlist = build_category_initializer (TREE_TYPE (UOBJC_CLASS_decl),
cat_name_expr, class_name_expr,
UOBJC_INSTANCE_METHODS_decl,
UOBJC_CLASS_METHODS_decl,
protocol_decl);
-
- finish_var_decl (decl, initlist);
+ /* Finish and initialize the forward decl. */
+ finish_var_decl (UOBJC_CLASS_decl, initlist);
}
/* static struct objc_class _OBJC_METACLASS_Foo={ ... };
static struct objc_class _OBJC_CLASS_Foo={ ... }; */
static void
-generate_shared_structures (int cls_flags)
+generate_shared_structures (struct imp_entry *impent)
{
- tree decl;
tree name_expr, super_expr, root_expr;
- tree my_root_id = NULL_TREE, my_super_id = NULL_TREE;
+ tree my_root_id, my_super_id;
tree cast_type, initlist, protocol_decl;
-
+ int cls_flags;
+
+ objc_implementation_context = impent->imp_context;
+ implementation_template = impent->imp_template;
+ UOBJC_CLASS_decl = impent->class_decl;
+ UOBJC_METACLASS_decl = impent->meta_decl;
+ cls_flags = impent->has_cxx_cdtors ? CLS_HAS_CXX_STRUCTORS : 0 ;
+
my_super_id = CLASS_SUPER_NAME (implementation_template);
if (my_super_id)
{
@@ -5820,13 +5734,12 @@ generate_shared_structures (int cls_flags)
/* Install class `isa' and `super' pointers at runtime. */
if (my_super_id)
- {
- super_expr = add_objc_string (my_super_id, class_names);
- super_expr = build_c_cast (input_location,
- cast_type, super_expr); /* cast! */
- }
+ super_expr = add_objc_string (my_super_id, class_names);
else
- super_expr = build_int_cst (NULL_TREE, 0);
+ super_expr = integer_zero_node;
+
+ super_expr = build_c_cast (input_location,
+ cast_type, super_expr); /* cast! */
root_expr = add_objc_string (my_root_id, class_names);
root_expr = build_c_cast (input_location, cast_type, root_expr); /* cast! */
@@ -5842,13 +5755,9 @@ generate_shared_structures (int cls_flags)
/* static struct objc_class _OBJC_METACLASS_Foo = { ... }; */
- decl = start_var_decl (objc_class_template,
- IDENTIFIER_POINTER
- (DECL_NAME (UOBJC_METACLASS_decl)));
-
initlist
= build_shared_structure_initializer
- (TREE_TYPE (decl),
+ (TREE_TYPE (UOBJC_METACLASS_decl),
root_expr, super_expr, name_expr,
convert (integer_type_node, TYPE_SIZE_UNIT (objc_class_template)),
2 /*CLS_META*/,
@@ -5856,17 +5765,13 @@ generate_shared_structures (int cls_flags)
UOBJC_CLASS_VARIABLES_decl,
protocol_decl);
- finish_var_decl (decl, initlist);
+ finish_var_decl (UOBJC_METACLASS_decl, initlist);
/* static struct objc_class _OBJC_CLASS_Foo={ ... }; */
- decl = start_var_decl (objc_class_template,
- IDENTIFIER_POINTER
- (DECL_NAME (UOBJC_CLASS_decl)));
-
initlist
= build_shared_structure_initializer
- (TREE_TYPE (decl),
+ (TREE_TYPE (UOBJC_CLASS_decl),
build_unary_op (input_location, ADDR_EXPR, UOBJC_METACLASS_decl, 0),
super_expr, name_expr,
convert (integer_type_node,
@@ -5877,7 +5782,7 @@ generate_shared_structures (int cls_flags)
UOBJC_INSTANCE_VARIABLES_decl,
protocol_decl);
- finish_var_decl (decl, initlist);
+ finish_var_decl (UOBJC_CLASS_decl, initlist);
}
@@ -6085,7 +5990,7 @@ get_arg_type_list (tree meth, int context, int superflag)
return arglist;
/* Build a list of argument types. */
- for (akey = METHOD_SEL_ARGS (meth); akey; akey = TREE_CHAIN (akey))
+ for (akey = METHOD_SEL_ARGS (meth); akey; akey = DECL_CHAIN (akey))
{
tree arg_type = TREE_VALUE (TREE_TYPE (akey));
@@ -6917,7 +6822,7 @@ lookup_method (tree mchain, tree method)
if (METHOD_SEL_NAME (mchain) == key)
return mchain;
- mchain = TREE_CHAIN (mchain);
+ mchain = DECL_CHAIN (mchain);
}
return NULL_TREE;
}
@@ -7029,12 +6934,12 @@ objc_add_method (tree klass, tree method, int is_class)
/* put method on list in reverse order */
if (is_class)
{
- TREE_CHAIN (method) = CLASS_CLS_METHODS (klass);
+ DECL_CHAIN (method) = CLASS_CLS_METHODS (klass);
CLASS_CLS_METHODS (klass) = method;
}
else
{
- TREE_CHAIN (method) = CLASS_NST_METHODS (klass);
+ DECL_CHAIN (method) = CLASS_NST_METHODS (klass);
CLASS_NST_METHODS (klass) = method;
}
}
@@ -7246,7 +7151,7 @@ add_instance_variable (tree klass, int visibility, tree field_decl)
static tree
is_ivar (tree decl_chain, tree ident)
{
- for ( ; decl_chain; decl_chain = TREE_CHAIN (decl_chain))
+ for ( ; decl_chain; decl_chain = DECL_CHAIN (decl_chain))
if (DECL_NAME (decl_chain) == ident)
return decl_chain;
return NULL_TREE;
@@ -7373,7 +7278,7 @@ check_methods (tree chain, tree list, int mtype)
mtype, METHOD_SEL_NAME (chain));
}
- chain = TREE_CHAIN (chain);
+ chain = DECL_CHAIN (chain);
}
return first;
@@ -8047,7 +7952,7 @@ encode_aggregate_fields (tree type, int pointed_to, int curtype, int format)
{
tree field = TYPE_FIELDS (type);
- for (; field; field = TREE_CHAIN (field))
+ for (; field; field = DECL_CHAIN (field))
{
#ifdef OBJCPLUS
/* C++ static members, and things that are not field at all,
@@ -8396,9 +8301,9 @@ objc_get_parm_info (int have_ellipsis)
declare_parm_level ();
while (parm_info)
{
- tree next = TREE_CHAIN (parm_info);
+ tree next = DECL_CHAIN (parm_info);
- TREE_CHAIN (parm_info) = NULL_TREE;
+ DECL_CHAIN (parm_info) = NULL_TREE;
parm_info = pushdecl (parm_info);
finish_decl (parm_info, input_location, NULL_TREE, NULL_TREE, NULL_TREE);
parm_info = next;
@@ -8476,7 +8381,7 @@ start_method_def (tree method)
parm = build_decl (input_location,
PARM_DECL, KEYWORD_ARG_NAME (parmlist), type);
objc_push_parm (parm);
- parmlist = TREE_CHAIN (parmlist);
+ parmlist = DECL_CHAIN (parmlist);
}
if (METHOD_ADD_ARGS (method))
@@ -8709,8 +8614,8 @@ really_start_method (tree method,
/* Suppress unused warnings. */
TREE_USED (self_decl) = 1;
DECL_READ_P (self_decl) = 1;
- TREE_USED (TREE_CHAIN (self_decl)) = 1;
- DECL_READ_P (TREE_CHAIN (self_decl)) = 1;
+ TREE_USED (DECL_CHAIN (self_decl)) = 1;
+ DECL_READ_P (DECL_CHAIN (self_decl)) = 1;
#ifdef OBJCPLUS
pop_lang_context ();
#endif
@@ -9068,7 +8973,7 @@ gen_method_decl (tree method)
strcat (errbuf, ")");
strcat (errbuf, IDENTIFIER_POINTER (KEYWORD_ARG_NAME (chain)));
- if ((chain = TREE_CHAIN (chain)))
+ if ((chain = DECL_CHAIN (chain)))
strcat (errbuf, " ");
}
while (chain);
@@ -9262,15 +9167,17 @@ finish_objc (void)
if (objc_static_instances)
generate_static_references ();
- if (imp_list || class_names_chain
- || meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
- generate_objc_symtab_decl ();
+ /* forward declare categories */
+ if (cat_count)
+ forward_declare_categories ();
for (impent = imp_list; impent; impent = impent->next)
{
objc_implementation_context = impent->imp_context;
implementation_template = impent->imp_template;
+ /* FIXME: This needs reworking to be more obvious. */
+
UOBJC_CLASS_decl = impent->class_decl;
UOBJC_METACLASS_decl = impent->meta_decl;
@@ -9288,28 +9195,35 @@ finish_objc (void)
/* all of the following reference the string pool... */
generate_ivar_lists ();
generate_dispatch_tables ();
- generate_shared_structures (impent->has_cxx_cdtors
- ? CLS_HAS_CXX_STRUCTORS
- : 0);
+ generate_shared_structures (impent);
}
else
{
generate_dispatch_tables ();
- generate_category (objc_implementation_context);
+ generate_category (impent);
}
+
+ impent->class_decl = UOBJC_CLASS_decl;
+ impent->meta_decl = UOBJC_METACLASS_decl;
}
/* If we are using an array of selectors, we must always
finish up the array decl even if no selectors were used. */
- if (! flag_next_runtime || sel_ref_chain)
- build_selector_translation_table ();
+ if (flag_next_runtime)
+ build_next_selector_translation_table ();
+ else
+ build_gnu_selector_translation_table ();
if (protocol_chain)
generate_protocols ();
- if ((flag_replace_objc_classes && imp_list) || flag_objc_gc)
+ if (flag_next_runtime)
generate_objc_image_info ();
+ if (imp_list || class_names_chain
+ || meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
+ generate_objc_symtab_decl ();
+
/* Arrange for ObjC data structures to be initialized at run time. */
if (objc_implementation_context || class_names_chain || objc_static_instances
|| meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
@@ -9368,8 +9282,9 @@ generate_classref_translation_entry (tree chain)
expr = add_objc_string (TREE_VALUE (chain), class_names);
expr = convert (type, expr); /* cast! */
- /* The decl that is the one that we
- forward declared in build_class_reference. */
+ /* This is a class reference. It is re-written by the runtime,
+ but will be optimized away unless we force it. */
+ DECL_PRESERVE_P (decl) = 1;
finish_var_decl (decl, expr);
return;
}
@@ -9395,12 +9310,11 @@ handle_class_ref (tree chain)
/* Make a decl for this name, so we can use its address in a tree. */
decl = build_decl (input_location,
- VAR_DECL, get_identifier (string), char_type_node);
+ VAR_DECL, get_identifier (string), TREE_TYPE (integer_zero_node));
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
-
pushdecl (decl);
- rest_of_decl_compilation (decl, 0, 0);
+ finish_var_decl (decl, 0);
/* Make a decl for the address. */
sprintf (string, "%sobjc_class_ref_%s",
@@ -9408,15 +9322,17 @@ handle_class_ref (tree chain)
exp = build1 (ADDR_EXPR, string_type_node, decl);
decl = build_decl (input_location,
VAR_DECL, get_identifier (string), string_type_node);
- DECL_INITIAL (decl) = exp;
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
DECL_READ_P (decl) = 1;
- /* Force the output of the decl as this forces the reference of the class. */
- mark_decl_referenced (decl);
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_INITIAL (decl) = error_mark_node;
+
+ /* We must force the reference. */
+ DECL_PRESERVE_P (decl) = 1;
pushdecl (decl);
- rest_of_decl_compilation (decl, 0, 0);
+ finish_var_decl (decl, exp);
}
static void
@@ -9467,17 +9383,21 @@ handle_impent (struct imp_entry *impent)
{
tree decl, init;
- init = build_int_cst (c_common_type_for_size (BITS_PER_WORD, 1), 0);
+ init = integer_zero_node;
decl = build_decl (input_location,
VAR_DECL, get_identifier (string), TREE_TYPE (init));
TREE_PUBLIC (decl) = 1;
TREE_READONLY (decl) = 1;
TREE_USED (decl) = 1;
TREE_CONSTANT (decl) = 1;
- DECL_CONTEXT (decl) = 0;
+ DECL_CONTEXT (decl) = NULL_TREE;
DECL_ARTIFICIAL (decl) = 1;
- DECL_INITIAL (decl) = init;
- assemble_variable (decl, 1, 0, 0);
+ TREE_STATIC (decl) = 1;
+ DECL_INITIAL (decl) = error_mark_node; /* A real initializer is coming... */
+ /* We must force the reference. */
+ DECL_PRESERVE_P (decl) = 1;
+
+ finish_var_decl(decl, init) ;
}
}
@@ -9492,18 +9412,24 @@ generate_objc_image_info (void)
{
tree decl;
int flags
- = ((flag_replace_objc_classes && imp_list ? 1 : 0)
+ = ((flag_replace_objc_classes && imp_count ? 1 : 0)
| (flag_objc_gc ? 2 : 0));
VEC(constructor_elt,gc) *v = NULL;
+ tree array_type;
+
+ if (!flags)
+ return; /* No need for an image_info entry. */
+
+ array_type = build_sized_array_type (integer_type_node, 2);
- decl = start_var_decl (build_array_type
- (integer_type_node,
- build_index_type (build_int_cst (NULL_TREE, 2 - 1))),
- "_OBJC_IMAGE_INFO");
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, flags));
+ decl = start_var_decl (array_type, "_OBJC_IMAGE_INFO");
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, flags));
+ /* If we need this (determined above) it is because the runtime wants to
+ refer to it in a manner hidden from the compiler. So we must force the
+ output. */
+ DECL_PRESERVE_P (decl) = 1;
finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), v));
}
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 53309ad02a9..3fe94c94999 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -555,34 +555,35 @@ workshare_safe_to_combine_p (basic_block ws_entry_bb)
parallel+workshare call. WS_STMT is the workshare directive being
expanded. */
-static tree
+static VEC(tree,gc) *
get_ws_args_for (gimple ws_stmt)
{
tree t;
location_t loc = gimple_location (ws_stmt);
+ VEC(tree,gc) *ws_args;
if (gimple_code (ws_stmt) == GIMPLE_OMP_FOR)
{
struct omp_for_data fd;
- tree ws_args;
extract_omp_for_data (ws_stmt, &fd, NULL);
- ws_args = NULL_TREE;
- if (fd.chunk_size)
- {
- t = fold_convert_loc (loc, long_integer_type_node, fd.chunk_size);
- ws_args = tree_cons (NULL, t, ws_args);
- }
+ ws_args = VEC_alloc (tree, gc, 3 + (fd.chunk_size != 0));
- t = fold_convert_loc (loc, long_integer_type_node, fd.loop.step);
- ws_args = tree_cons (NULL, t, ws_args);
+ t = fold_convert_loc (loc, long_integer_type_node, fd.loop.n1);
+ VEC_quick_push (tree, ws_args, t);
t = fold_convert_loc (loc, long_integer_type_node, fd.loop.n2);
- ws_args = tree_cons (NULL, t, ws_args);
+ VEC_quick_push (tree, ws_args, t);
- t = fold_convert_loc (loc, long_integer_type_node, fd.loop.n1);
- ws_args = tree_cons (NULL, t, ws_args);
+ t = fold_convert_loc (loc, long_integer_type_node, fd.loop.step);
+ VEC_quick_push (tree, ws_args, t);
+
+ if (fd.chunk_size)
+ {
+ t = fold_convert_loc (loc, long_integer_type_node, fd.chunk_size);
+ VEC_quick_push (tree, ws_args, t);
+ }
return ws_args;
}
@@ -593,8 +594,9 @@ get_ws_args_for (gimple ws_stmt)
the exit of the sections region. */
basic_block bb = single_succ (gimple_bb (ws_stmt));
t = build_int_cst (unsigned_type_node, EDGE_COUNT (bb->succs) - 1);
- t = tree_cons (NULL, t, NULL);
- return t;
+ ws_args = VEC_alloc (tree, gc, 1);
+ VEC_quick_push (tree, ws_args, t);
+ return ws_args;
}
gcc_unreachable ();
@@ -839,7 +841,7 @@ omp_copy_decl_2 (tree var, tree name, tree type, omp_context *ctx)
tree copy = copy_var_decl (var, name, type);
DECL_CONTEXT (copy) = current_function_decl;
- TREE_CHAIN (copy) = ctx->block_vars;
+ DECL_CHAIN (copy) = ctx->block_vars;
ctx->block_vars = copy;
return copy;
@@ -864,10 +866,10 @@ build_receiver_ref (tree var, bool by_ref, omp_context *ctx)
if (x != NULL)
field = x;
- x = build_fold_indirect_ref (ctx->receiver_decl);
+ x = build_simple_mem_ref (ctx->receiver_decl);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL);
if (by_ref)
- x = build_fold_indirect_ref (x);
+ x = build_simple_mem_ref (x);
return x;
}
@@ -887,7 +889,7 @@ build_outer_var_ref (tree var, omp_context *ctx)
{
x = TREE_OPERAND (DECL_VALUE_EXPR (var), 0);
x = build_outer_var_ref (x, ctx);
- x = build_fold_indirect_ref (x);
+ x = build_simple_mem_ref (x);
}
else if (is_taskreg_ctx (ctx))
{
@@ -904,7 +906,7 @@ build_outer_var_ref (tree var, omp_context *ctx)
gcc_unreachable ();
if (is_reference (var))
- x = build_fold_indirect_ref (x);
+ x = build_simple_mem_ref (x);
return x;
}
@@ -1284,13 +1286,13 @@ delete_omp_context (splay_tree_value value)
if (ctx->record_type)
{
tree t;
- for (t = TYPE_FIELDS (ctx->record_type); t ; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (ctx->record_type); t ; t = DECL_CHAIN (t))
DECL_ABSTRACT_ORIGIN (t) = NULL;
}
if (ctx->srecord_type)
{
tree t;
- for (t = TYPE_FIELDS (ctx->srecord_type); t ; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (ctx->srecord_type); t ; t = DECL_CHAIN (t))
DECL_ABSTRACT_ORIGIN (t) = NULL;
}
@@ -1312,7 +1314,7 @@ fixup_child_record_type (omp_context *ctx)
variably_modified_type_p doesn't work the way we expect for
record types. Testing each field for whether it needs remapping
and creating a new record by hand works, however. */
- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (type); f ; f = DECL_CHAIN (f))
if (variably_modified_type_p (TREE_TYPE (f), ctx->cb.src_fn))
break;
if (f)
@@ -1325,12 +1327,12 @@ fixup_child_record_type (omp_context *ctx)
TYPE_DECL, name, type);
TYPE_NAME (type) = name;
- for (f = TYPE_FIELDS (ctx->record_type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (ctx->record_type); f ; f = DECL_CHAIN (f))
{
tree new_f = copy_node (f);
DECL_CONTEXT (new_f) = type;
TREE_TYPE (new_f) = remap_type (TREE_TYPE (f), &ctx->cb);
- TREE_CHAIN (new_f) = new_fields;
+ DECL_CHAIN (new_f) = new_fields;
walk_tree (&DECL_SIZE (new_f), copy_tree_body_r, &ctx->cb, NULL);
walk_tree (&DECL_SIZE_UNIT (new_f), copy_tree_body_r,
&ctx->cb, NULL);
@@ -1561,6 +1563,7 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
+ DECL_NAMELESS (decl) = 1;
DECL_IGNORED_P (decl) = 0;
TREE_PUBLIC (decl) = 0;
DECL_UNINLINABLE (decl) = 1;
@@ -1578,6 +1581,7 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
t = build_decl (DECL_SOURCE_LOCATION (decl),
PARM_DECL, get_identifier (".omp_data_i"), ptr_type_node);
DECL_ARTIFICIAL (t) = 1;
+ DECL_NAMELESS (t) = 1;
DECL_ARG_TYPE (t) = ptr_type_node;
DECL_CONTEXT (t) = current_function_decl;
TREE_USED (t) = 1;
@@ -1590,11 +1594,12 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
PARM_DECL, get_identifier (".omp_data_o"),
ptr_type_node);
DECL_ARTIFICIAL (t) = 1;
+ DECL_NAMELESS (t) = 1;
DECL_ARG_TYPE (t) = ptr_type_node;
DECL_CONTEXT (t) = current_function_decl;
TREE_USED (t) = 1;
TREE_ADDRESSABLE (t) = 1;
- TREE_CHAIN (t) = DECL_ARGUMENTS (decl);
+ DECL_CHAIN (t) = DECL_ARGUMENTS (decl);
DECL_ARGUMENTS (decl) = t;
}
@@ -1636,6 +1641,8 @@ scan_omp_parallel (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
name = create_tmp_var_name (".omp_data_s");
name = build_decl (gimple_location (stmt),
TYPE_DECL, name, ctx->record_type);
+ DECL_ARTIFICIAL (name) = 1;
+ DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->record_type) = name;
create_omp_child_function (ctx, false);
gimple_omp_parallel_set_child_fn (stmt, ctx->cb.dst_fn);
@@ -1679,6 +1686,8 @@ scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
name = create_tmp_var_name (".omp_data_s");
name = build_decl (gimple_location (stmt),
TYPE_DECL, name, ctx->record_type);
+ DECL_ARTIFICIAL (name) = 1;
+ DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->record_type) = name;
create_omp_child_function (ctx, false);
gimple_omp_task_set_child_fn (stmt, ctx->cb.dst_fn);
@@ -1690,6 +1699,8 @@ scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
name = create_tmp_var_name (".omp_data_a");
name = build_decl (gimple_location (stmt),
TYPE_DECL, name, ctx->srecord_type);
+ DECL_ARTIFICIAL (name) = 1;
+ DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->srecord_type) = name;
create_omp_child_function (ctx, true);
}
@@ -1719,7 +1730,7 @@ scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
q = &TREE_CHAIN (*q);
}
else
- p = &TREE_CHAIN (*p);
+ p = &DECL_CHAIN (*p);
*p = vla_fields;
layout_type (ctx->record_type);
fixup_child_record_type (ctx);
@@ -1916,7 +1927,18 @@ scan_omp_1_op (tree *tp, int *walk_subtrees, void *data)
{
*walk_subtrees = 1;
if (ctx)
- TREE_TYPE (t) = remap_type (TREE_TYPE (t), &ctx->cb);
+ {
+ tree tem = remap_type (TREE_TYPE (t), &ctx->cb);
+ if (tem != TREE_TYPE (t))
+ {
+ if (TREE_CODE (t) == INTEGER_CST)
+ *tp = build_int_cst_wide (tem,
+ TREE_INT_CST_LOW (t),
+ TREE_INT_CST_HIGH (t));
+ else
+ TREE_TYPE (t) = tem;
+ }
+ }
}
break;
}
@@ -1996,7 +2018,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
*handled_ops_p = false;
if (ctx)
- for (var = gimple_bind_vars (stmt); var ; var = TREE_CHAIN (var))
+ for (var = gimple_bind_vars (stmt); var ; var = DECL_CHAIN (var))
insert_decl_map (&ctx->cb, var, var);
}
break;
@@ -2337,7 +2359,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
x = fold_convert_loc (clause_loc, TREE_TYPE (new_var), x);
gimplify_assign (new_var, x, ilist);
- new_var = build_fold_indirect_ref_loc (clause_loc, new_var);
+ new_var = build_simple_mem_ref_loc (clause_loc, new_var);
}
else if (c_kind == OMP_CLAUSE_REDUCTION
&& OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
@@ -2555,7 +2577,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
x = build_outer_var_ref (var, ctx);
if (is_reference (var))
- new_var = build_fold_indirect_ref_loc (clause_loc, new_var);
+ new_var = build_simple_mem_ref_loc (clause_loc, new_var);
x = lang_hooks.decls.omp_clause_assign_op (c, x, new_var);
gimplify_and_add (x, stmt_list);
}
@@ -2622,7 +2644,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, omp_context *ctx)
var = OMP_CLAUSE_DECL (c);
new_var = lookup_decl (var, ctx);
if (is_reference (var))
- new_var = build_fold_indirect_ref_loc (clause_loc, new_var);
+ new_var = build_simple_mem_ref_loc (clause_loc, new_var);
ref = build_outer_var_ref (var, ctx);
code = OMP_CLAUSE_REDUCTION_CODE (c);
@@ -2714,8 +2736,8 @@ lower_copyprivate_clauses (tree clauses, gimple_seq *slist, gimple_seq *rlist,
if (is_reference (var))
{
ref = fold_convert_loc (clause_loc, TREE_TYPE (new_var), ref);
- ref = build_fold_indirect_ref_loc (clause_loc, ref);
- new_var = build_fold_indirect_ref_loc (clause_loc, new_var);
+ ref = build_simple_mem_ref_loc (clause_loc, ref);
+ new_var = build_simple_mem_ref_loc (clause_loc, new_var);
}
x = lang_hooks.decls.omp_clause_assign_op (c, new_var, ref);
gimplify_and_add (x, rlist);
@@ -2825,7 +2847,7 @@ lower_send_shared_vars (gimple_seq *ilist, gimple_seq *olist, omp_context *ctx)
return;
record_type = ctx->srecord_type ? ctx->srecord_type : ctx->record_type;
- for (f = TYPE_FIELDS (record_type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (record_type); f ; f = DECL_CHAIN (f))
{
ovar = DECL_ABSTRACT_ORIGIN (f);
nvar = maybe_lookup_decl (ovar, ctx);
@@ -2888,13 +2910,14 @@ gimple_build_cond_empty (tree cond)
static void
expand_parallel_call (struct omp_region *region, basic_block bb,
- gimple entry_stmt, tree ws_args)
+ gimple entry_stmt, VEC(tree,gc) *ws_args)
{
tree t, t1, t2, val, cond, c, clauses;
gimple_stmt_iterator gsi;
gimple stmt;
int start_ix;
location_t clause_loc;
+ VEC(tree,gc) *args;
clauses = gimple_omp_parallel_clauses (entry_stmt);
@@ -3025,16 +3048,14 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
t1 = build_fold_addr_expr (t);
t2 = build_fold_addr_expr (gimple_omp_parallel_child_fn (entry_stmt));
- if (ws_args)
- {
- tree args = tree_cons (NULL, t2,
- tree_cons (NULL, t1,
- tree_cons (NULL, val, ws_args)));
- t = build_function_call_expr (UNKNOWN_LOCATION,
- built_in_decls[start_ix], args);
- }
- else
- t = build_call_expr (built_in_decls[start_ix], 3, t2, t1, val);
+ args = VEC_alloc (tree, gc, 3 + VEC_length (tree, ws_args));
+ VEC_quick_push (tree, args, t2);
+ VEC_quick_push (tree, args, t1);
+ VEC_quick_push (tree, args, val);
+ VEC_splice (tree, args, ws_args);
+
+ t = build_call_expr_loc_vec (UNKNOWN_LOCATION,
+ built_in_decls[start_ix], args);
force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
@@ -3127,20 +3148,18 @@ maybe_catch_exception (gimple_seq body)
/* Chain all the DECLs in LIST by their TREE_CHAIN fields. */
static tree
-list2chain (tree list)
+vec2chain (VEC(tree,gc) *v)
{
- tree t;
+ tree chain = NULL_TREE, t;
+ unsigned ix;
- for (t = list; t; t = TREE_CHAIN (t))
+ FOR_EACH_VEC_ELT_REVERSE (tree, v, ix, t)
{
- tree var = TREE_VALUE (t);
- if (TREE_CHAIN (t))
- TREE_CHAIN (var) = TREE_VALUE (TREE_CHAIN (t));
- else
- TREE_CHAIN (var) = NULL_TREE;
+ DECL_CHAIN (t) = chain;
+ chain = t;
}
- return list ? TREE_VALUE (list) : NULL_TREE;
+ return chain;
}
@@ -3199,12 +3218,12 @@ remove_exit_barrier (struct omp_region *region)
{
gimple parallel_stmt = last_stmt (region->entry);
tree child_fun = gimple_omp_parallel_child_fn (parallel_stmt);
- tree local_decls = DECL_STRUCT_FUNCTION (child_fun)->local_decls;
- tree block;
+ tree local_decls, block, decl;
+ unsigned ix;
any_addressable_vars = 0;
- for (; local_decls; local_decls = TREE_CHAIN (local_decls))
- if (TREE_ADDRESSABLE (TREE_VALUE (local_decls)))
+ FOR_EACH_LOCAL_DECL (DECL_STRUCT_FUNCTION (child_fun), ix, decl)
+ if (TREE_ADDRESSABLE (decl))
{
any_addressable_vars = 1;
break;
@@ -3217,7 +3236,7 @@ remove_exit_barrier (struct omp_region *region)
{
for (local_decls = BLOCK_VARS (block);
local_decls;
- local_decls = TREE_CHAIN (local_decls))
+ local_decls = DECL_CHAIN (local_decls))
if (TREE_ADDRESSABLE (local_decls))
{
any_addressable_vars = 1;
@@ -3323,11 +3342,12 @@ expand_omp_taskreg (struct omp_region *region)
{
basic_block entry_bb, exit_bb, new_bb;
struct function *child_cfun;
- tree child_fn, block, t, ws_args, *tp;
+ tree child_fn, block, t;
tree save_current;
gimple_stmt_iterator gsi;
gimple entry_stmt, stmt;
edge e;
+ VEC(tree,gc) *ws_args;
entry_stmt = last_stmt (region->entry);
child_fn = gimple_omp_taskreg_child_fn (entry_stmt);
@@ -3342,7 +3362,7 @@ expand_omp_taskreg (struct omp_region *region)
if (is_combined_parallel (region))
ws_args = region->ws_args;
else
- ws_args = NULL_TREE;
+ ws_args = NULL;
if (child_cfun->cfg)
{
@@ -3369,6 +3389,8 @@ expand_omp_taskreg (struct omp_region *region)
}
else
{
+ unsigned srcidx, dstidx, num;
+
/* If the parallel region needs data sent from the parent
function, then the very first statement (except possible
tree profile counter updates) of the parallel body
@@ -3446,11 +3468,11 @@ expand_omp_taskreg (struct omp_region *region)
/* Declare local variables needed in CHILD_CFUN. */
block = DECL_INITIAL (child_fn);
- BLOCK_VARS (block) = list2chain (child_cfun->local_decls);
+ BLOCK_VARS (block) = vec2chain (child_cfun->local_decls);
/* The gimplifier could record temporaries in parallel/task block
rather than in containing function's local_decls chain,
which would mean cgraph missed finalizing them. Do it now. */
- for (t = BLOCK_VARS (block); t; t = TREE_CHAIN (t))
+ for (t = BLOCK_VARS (block); t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == VAR_DECL
&& TREE_STATIC (t)
&& !DECL_EXTERNAL (t))
@@ -3460,7 +3482,7 @@ expand_omp_taskreg (struct omp_region *region)
TREE_USED (block) = 1;
/* Reset DECL_CONTEXT on function arguments. */
- for (t = DECL_ARGUMENTS (child_fn); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (child_fn); t; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = child_fn;
/* Split ENTRY_BB at GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK,
@@ -3504,11 +3526,18 @@ expand_omp_taskreg (struct omp_region *region)
single_succ_edge (new_bb)->flags = EDGE_FALLTHRU;
/* Remove non-local VAR_DECLs from child_cfun->local_decls list. */
- for (tp = &child_cfun->local_decls; *tp; )
- if (DECL_CONTEXT (TREE_VALUE (*tp)) != cfun->decl)
- tp = &TREE_CHAIN (*tp);
- else
- *tp = TREE_CHAIN (*tp);
+ num = VEC_length (tree, child_cfun->local_decls);
+ for (srcidx = 0, dstidx = 0; srcidx < num; srcidx++)
+ {
+ t = VEC_index (tree, child_cfun->local_decls, srcidx);
+ if (DECL_CONTEXT (t) == cfun->decl)
+ continue;
+ if (srcidx != dstidx)
+ VEC_replace (tree, child_cfun->local_decls, dstidx, t);
+ dstidx++;
+ }
+ if (dstidx != num)
+ VEC_truncate (tree, child_cfun->local_decls, dstidx);
/* Inform the callgraph about the new function. */
DECL_STRUCT_FUNCTION (child_fn)->curr_properties
@@ -4907,7 +4936,7 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
{
enum built_in_function base;
tree decl, itype, call;
- enum insn_code *optab;
+ direct_optab optab;
tree rhs;
basic_block store_bb = single_succ (load_bb);
gimple_stmt_iterator gsi;
@@ -4979,7 +5008,7 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
decl = built_in_decls[base + index + 1];
itype = TREE_TYPE (TREE_TYPE (decl));
- if (optab[TYPE_MODE (itype)] == CODE_FOR_nothing)
+ if (direct_optab_handler (optab, TYPE_MODE (itype)) == CODE_FOR_nothing)
return false;
gsi = gsi_last_bb (load_bb);
@@ -5031,7 +5060,8 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
itype = TREE_TYPE (TREE_TYPE (cmpxchg));
- if (sync_compare_and_swap[TYPE_MODE (itype)] == CODE_FOR_nothing)
+ if (direct_optab_handler (sync_compare_and_swap_optab, TYPE_MODE (itype))
+ == CODE_FOR_nothing)
return false;
/* Load the initial value, replacing the GIMPLE_OMP_ATOMIC_LOAD. */
@@ -5067,8 +5097,12 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
loadedi = loaded_val;
}
- initial = force_gimple_operand_gsi (&si, build_fold_indirect_ref (iaddr),
- true, NULL_TREE, true, GSI_SAME_STMT);
+ initial
+ = force_gimple_operand_gsi (&si,
+ build2 (MEM_REF, TREE_TYPE (TREE_TYPE (iaddr)),
+ iaddr,
+ build_int_cst (TREE_TYPE (iaddr), 0)),
+ true, NULL_TREE, true, GSI_SAME_STMT);
/* Move the value to the LOADEDI temporary. */
if (gimple_in_ssa_p (cfun))
@@ -5209,22 +5243,22 @@ expand_omp_atomic_mutex (basic_block load_bb, basic_block store_bb,
gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ATOMIC_LOAD);
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_START];
- t = build_function_call_expr (UNKNOWN_LOCATION, t, 0);
+ t = build_call_expr (t, 0);
force_gimple_operand_gsi (&si, t, true, NULL_TREE, true, GSI_SAME_STMT);
- stmt = gimple_build_assign (loaded_val, build_fold_indirect_ref (addr));
+ stmt = gimple_build_assign (loaded_val, build_simple_mem_ref (addr));
gsi_insert_before (&si, stmt, GSI_SAME_STMT);
gsi_remove (&si, true);
si = gsi_last_bb (store_bb);
gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ATOMIC_STORE);
- stmt = gimple_build_assign (build_fold_indirect_ref (unshare_expr (addr)),
- stored_val);
+ stmt = gimple_build_assign (build_simple_mem_ref (unshare_expr (addr)),
+ stored_val);
gsi_insert_before (&si, stmt, GSI_SAME_STMT);
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_END];
- t = build_function_call_expr (UNKNOWN_LOCATION, t, 0);
+ t = build_call_expr (t, 0);
force_gimple_operand_gsi (&si, t, true, NULL_TREE, true, GSI_SAME_STMT);
gsi_remove (&si, true);
@@ -6196,7 +6230,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
DECL_SAVED_TREE (child_fn) = alloc_stmt_list ();
/* Reset DECL_CONTEXT on function arguments. */
- for (t = DECL_ARGUMENTS (child_fn); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (child_fn); t; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = child_fn;
/* Populate the function. */
@@ -6212,13 +6246,13 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
/* Remap src and dst argument types if needed. */
record_type = ctx->record_type;
srecord_type = ctx->srecord_type;
- for (f = TYPE_FIELDS (record_type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (record_type); f ; f = DECL_CHAIN (f))
if (variably_modified_type_p (TREE_TYPE (f), ctx->cb.src_fn))
{
record_needs_remap = true;
break;
}
- for (f = TYPE_FIELDS (srecord_type); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (srecord_type); f ; f = DECL_CHAIN (f))
if (variably_modified_type_p (TREE_TYPE (f), ctx->cb.src_fn))
{
srecord_needs_remap = true;
@@ -6251,7 +6285,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
arg = DECL_ARGUMENTS (child_fn);
TREE_TYPE (arg) = build_pointer_type (record_type);
- sarg = TREE_CHAIN (arg);
+ sarg = DECL_CHAIN (arg);
TREE_TYPE (sarg) = build_pointer_type (srecord_type);
/* First pass: initialize temporaries used in record_type and srecord_type
@@ -6269,7 +6303,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
n = splay_tree_lookup (ctx->sfield_map, (splay_tree_key) decl);
sf = (tree) n->value;
sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf);
- src = build_fold_indirect_ref_loc (loc, sarg);
+ src = build_simple_mem_ref_loc (loc, sarg);
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
t = build2 (MODIFY_EXPR, TREE_TYPE (*p), *p, src);
append_to_statement_list (t, &list);
@@ -6292,9 +6326,9 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
sf = (tree) n->value;
if (tcctx.cb.decl_map)
sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf);
- src = build_fold_indirect_ref_loc (loc, sarg);
+ src = build_simple_mem_ref_loc (loc, sarg);
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
- dst = build_fold_indirect_ref_loc (loc, arg);
+ dst = build_simple_mem_ref_loc (loc, arg);
dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL);
t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
append_to_statement_list (t, &list);
@@ -6315,14 +6349,14 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
sf = (tree) n->value;
if (tcctx.cb.decl_map)
sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf);
- src = build_fold_indirect_ref_loc (loc, sarg);
+ src = build_simple_mem_ref_loc (loc, sarg);
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
if (use_pointer_for_field (decl, NULL) || is_reference (decl))
- src = build_fold_indirect_ref_loc (loc, src);
+ src = build_simple_mem_ref_loc (loc, src);
}
else
src = decl;
- dst = build_fold_indirect_ref_loc (loc, arg);
+ dst = build_simple_mem_ref_loc (loc, arg);
dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL);
t = lang_hooks.decls.omp_clause_copy_ctor (c, dst, src);
append_to_statement_list (t, &list);
@@ -6341,14 +6375,14 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
sf = (tree) n->value;
if (tcctx.cb.decl_map)
sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf);
- src = build_fold_indirect_ref_loc (loc, sarg);
+ src = build_simple_mem_ref_loc (loc, sarg);
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
if (use_pointer_for_field (decl, NULL))
- src = build_fold_indirect_ref_loc (loc, src);
+ src = build_simple_mem_ref_loc (loc, src);
}
else
src = decl;
- dst = build_fold_indirect_ref_loc (loc, arg);
+ dst = build_simple_mem_ref_loc (loc, arg);
dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL);
t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
append_to_statement_list (t, &list);
@@ -6380,10 +6414,10 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
(splay_tree_key) TREE_OPERAND (ind, 0));
sf = (tree) n->value;
sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf);
- src = build_fold_indirect_ref_loc (loc, sarg);
+ src = build_simple_mem_ref_loc (loc, sarg);
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
- src = build_fold_indirect_ref_loc (loc, src);
- dst = build_fold_indirect_ref_loc (loc, arg);
+ src = build_simple_mem_ref_loc (loc, src);
+ dst = build_simple_mem_ref_loc (loc, arg);
dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL);
t = lang_hooks.decls.omp_clause_copy_ctor (c, dst, src);
append_to_statement_list (t, &list);
@@ -6391,7 +6425,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
(splay_tree_key) TREE_OPERAND (ind, 0));
df = (tree) n->value;
df = *(tree *) pointer_map_contains (tcctx.cb.decl_map, df);
- ptr = build_fold_indirect_ref_loc (loc, arg);
+ ptr = build_simple_mem_ref_loc (loc, arg);
ptr = build3 (COMPONENT_REF, TREE_TYPE (df), ptr, df, NULL);
t = build2 (MODIFY_EXPR, TREE_TYPE (ptr), ptr,
build_fold_addr_expr_loc (loc, dst));
@@ -6462,6 +6496,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
ctx->sender_decl
= create_tmp_var (ctx->srecord_type ? ctx->srecord_type
: ctx->record_type, ".omp_data_o");
+ DECL_NAMELESS (ctx->sender_decl) = 1;
TREE_ADDRESSABLE (ctx->sender_decl) = 1;
gimple_omp_taskreg_set_data_arg (stmt, ctx->sender_decl);
}
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 38de4916c10..b9db02fe83f 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
/* Include insn-config.h before expr.h so that HAVE_conditional_move
@@ -44,55 +45,19 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "target.h"
-/* Each optab contains info on how this target machine
- can perform a particular operation
- for all sizes and kinds of operands.
-
- The operation to be performed is often specified
- by passing one of these optabs as an argument.
-
- See expr.h for documentation of these optabs. */
-
-#if GCC_VERSION >= 4000 && HAVE_DESIGNATED_INITIALIZERS
-__extension__ struct optab_d optab_table[OTI_MAX]
- = { [0 ... OTI_MAX - 1].handlers[0 ... NUM_MACHINE_MODES - 1].insn_code
- = CODE_FOR_nothing };
-#else
-/* init_insn_codes will do runtime initialization otherwise. */
-struct optab_d optab_table[OTI_MAX];
+struct target_optabs default_target_optabs;
+struct target_libfuncs default_target_libfuncs;
+#if SWITCHABLE_TARGET
+struct target_optabs *this_target_optabs = &default_target_optabs;
+struct target_libfuncs *this_target_libfuncs = &default_target_libfuncs;
#endif
-rtx libfunc_table[LTI_MAX];
-
-/* Tables of patterns for converting one mode to another. */
-#if GCC_VERSION >= 4000 && HAVE_DESIGNATED_INITIALIZERS
-__extension__ struct convert_optab_d convert_optab_table[COI_MAX]
- = { [0 ... COI_MAX - 1].handlers[0 ... NUM_MACHINE_MODES - 1]
- [0 ... NUM_MACHINE_MODES - 1].insn_code
- = CODE_FOR_nothing };
-#else
-/* init_convert_optab will do runtime initialization otherwise. */
-struct convert_optab_d convert_optab_table[COI_MAX];
-#endif
+#define libfunc_hash \
+ (this_target_libfuncs->x_libfunc_hash)
/* Contains the optab used for each rtx code. */
optab code_to_optab[NUM_RTX_CODE + 1];
-#ifdef HAVE_conditional_move
-/* Indexed by the machine mode, gives the insn code to make a conditional
- move insn. This is not indexed by the rtx-code like bcc_gen_fctn and
- setcc_gen_code to cut down on the number of named patterns. Consider a day
- when a lot more rtx codes are conditional (eg: for the ARM). */
-
-enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
-#endif
-
-/* Indexed by the machine mode, gives the insn code for vector conditional
- operation. */
-
-enum insn_code vcond_gen_code[NUM_MACHINE_MODES];
-enum insn_code vcondu_gen_code[NUM_MACHINE_MODES];
-
static void prepare_float_lib_cmp (rtx, rtx, enum rtx_code, rtx *,
enum machine_mode *);
static rtx expand_unop_direct (enum machine_mode, optab, rtx, rtx, int);
@@ -107,19 +72,7 @@ void debug_optab_libfuncs (void);
#define DECIMAL_PREFIX "dpd_"
#endif
-
-/* Info about libfunc. We use same hashtable for normal optabs and conversion
- optab. In the first case mode2 is unused. */
-struct GTY(()) libfunc_entry {
- size_t optab;
- enum machine_mode mode1, mode2;
- rtx libfunc;
-};
-
-/* Hash table used to convert declarations into nodes. */
-static GTY((param_is (struct libfunc_entry))) htab_t libfunc_hash;
-
-/* Used for attribute_hash. */
+/* Used for libfunc_hash. */
static hashval_t
hash_libfunc (const void *p)
@@ -130,7 +83,7 @@ hash_libfunc (const void *p)
^ e->optab);
}
-/* Used for optab_hash. */
+/* Used for libfunc_hash. */
static int
eq_libfunc (const void *p, const void *q)
@@ -563,9 +516,9 @@ expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op,
if (ops->code == WIDEN_MULT_PLUS_EXPR
|| ops->code == WIDEN_MULT_MINUS_EXPR)
icode = (int) optab_handler (widen_pattern_optab,
- TYPE_MODE (TREE_TYPE (ops->op2)))->insn_code;
+ TYPE_MODE (TREE_TYPE (ops->op2)));
else
- icode = (int) optab_handler (widen_pattern_optab, tmode0)->insn_code;
+ icode = (int) optab_handler (widen_pattern_optab, tmode0);
gcc_assert (icode != CODE_FOR_nothing);
xmode0 = insn_data[icode].operand[1].mode;
@@ -690,7 +643,7 @@ rtx
expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0,
rtx op1, rtx op2, rtx target, int unsignedp)
{
- int icode = (int) optab_handler (ternary_optab, mode)->insn_code;
+ int icode = (int) optab_handler (ternary_optab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
enum machine_mode mode2 = insn_data[icode].operand[3].mode;
@@ -698,8 +651,7 @@ expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0,
rtx pat;
rtx xop0 = op0, xop1 = op1, xop2 = op2;
- gcc_assert (optab_handler (ternary_optab, mode)->insn_code
- != CODE_FOR_nothing);
+ gcc_assert (optab_handler (ternary_optab, mode) != CODE_FOR_nothing);
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
temp = gen_reg_rtx (mode);
@@ -819,7 +771,7 @@ expand_vec_shift_expr (sepops ops, rtx target)
gcc_unreachable ();
}
- icode = optab_handler (shift_optab, mode)->insn_code;
+ icode = optab_handler (shift_optab, mode);
gcc_assert (icode != CODE_FOR_nothing);
mode1 = insn_data[icode].operand[1].mode;
@@ -1436,7 +1388,7 @@ expand_binop_directly (enum machine_mode mode, optab binoptab,
rtx target, int unsignedp, enum optab_methods methods,
rtx last)
{
- int icode = (int) optab_handler (binoptab, mode)->insn_code;
+ int icode = (int) optab_handler (binoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
enum machine_mode tmp_mode;
@@ -1593,7 +1545,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
/* If we can do it with a three-operand insn, do so. */
if (methods != OPTAB_MUST_WIDEN
- && optab_handler (binoptab, mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (binoptab, mode) != CODE_FOR_nothing)
{
temp = expand_binop_directly (mode, binoptab, op0, op1, target,
unsignedp, methods, last);
@@ -1604,9 +1556,9 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
/* If we were trying to rotate, and that didn't work, try rotating
the other direction before falling back to shifts and bitwise-or. */
if (((binoptab == rotl_optab
- && optab_handler (rotr_optab, mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (rotr_optab, mode) != CODE_FOR_nothing)
|| (binoptab == rotr_optab
- && optab_handler (rotl_optab, mode)->insn_code != CODE_FOR_nothing))
+ && optab_handler (rotl_optab, mode) != CODE_FOR_nothing))
&& mclass == MODE_INT)
{
optab otheroptab = (binoptab == rotl_optab ? rotr_optab : rotl_optab);
@@ -1633,8 +1585,8 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if (binoptab == smul_optab
&& GET_MODE_WIDER_MODE (mode) != VOIDmode
- && ((optab_handler ((unsignedp ? umul_widen_optab : smul_widen_optab),
- GET_MODE_WIDER_MODE (mode))->insn_code)
+ && (optab_handler ((unsignedp ? umul_widen_optab : smul_widen_optab),
+ GET_MODE_WIDER_MODE (mode))
!= CODE_FOR_nothing))
{
temp = expand_binop (GET_MODE_WIDER_MODE (mode),
@@ -1662,12 +1614,12 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if (optab_handler (binoptab, wider_mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (binoptab, wider_mode) != CODE_FOR_nothing
|| (binoptab == smul_optab
&& GET_MODE_WIDER_MODE (wider_mode) != VOIDmode
- && ((optab_handler ((unsignedp ? umul_widen_optab
- : smul_widen_optab),
- GET_MODE_WIDER_MODE (wider_mode))->insn_code)
+ && (optab_handler ((unsignedp ? umul_widen_optab
+ : smul_widen_optab),
+ GET_MODE_WIDER_MODE (wider_mode))
!= CODE_FOR_nothing)))
{
rtx xop0 = op0, xop1 = op1;
@@ -1734,7 +1686,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if ((binoptab == and_optab || binoptab == ior_optab || binoptab == xor_optab)
&& mclass == MODE_INT
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD
- && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (binoptab, word_mode) != CODE_FOR_nothing)
{
int i;
rtx insns;
@@ -1778,9 +1730,9 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
&& mclass == MODE_INT
&& (CONST_INT_P (op1) || optimize_insn_for_speed_p ())
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
- && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing
- && optab_handler (ashl_optab, word_mode)->insn_code != CODE_FOR_nothing
- && optab_handler (lshr_optab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (binoptab, word_mode) != CODE_FOR_nothing
+ && optab_handler (ashl_optab, word_mode) != CODE_FOR_nothing
+ && optab_handler (lshr_optab, word_mode) != CODE_FOR_nothing)
{
unsigned HOST_WIDE_INT shift_mask, double_shift_mask;
enum machine_mode op1_mode;
@@ -1848,8 +1800,8 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
&& mclass == MODE_INT
&& CONST_INT_P (op1)
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
- && optab_handler (ashl_optab, word_mode)->insn_code != CODE_FOR_nothing
- && optab_handler (lshr_optab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (ashl_optab, word_mode) != CODE_FOR_nothing
+ && optab_handler (lshr_optab, word_mode) != CODE_FOR_nothing)
{
rtx insns;
rtx into_target, outof_target;
@@ -1960,7 +1912,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if ((binoptab == add_optab || binoptab == sub_optab)
&& mclass == MODE_INT
&& GET_MODE_SIZE (mode) >= 2 * UNITS_PER_WORD
- && optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (binoptab, word_mode) != CODE_FOR_nothing)
{
unsigned int i;
optab otheroptab = binoptab == add_optab ? sub_optab : add_optab;
@@ -2057,7 +2009,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if (i == GET_MODE_BITSIZE (mode) / (unsigned) BITS_PER_WORD)
{
- if (optab_handler (mov_optab, mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (mov_optab, mode) != CODE_FOR_nothing
|| ! rtx_equal_p (target, xtarget))
{
rtx temp = emit_move_insn (target, xtarget);
@@ -2086,13 +2038,12 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if (binoptab == smul_optab
&& mclass == MODE_INT
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
- && optab_handler (smul_optab, word_mode)->insn_code != CODE_FOR_nothing
- && optab_handler (add_optab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (smul_optab, word_mode) != CODE_FOR_nothing
+ && optab_handler (add_optab, word_mode) != CODE_FOR_nothing)
{
rtx product = NULL_RTX;
- if (optab_handler (umul_widen_optab, mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (umul_widen_optab, mode) != CODE_FOR_nothing)
{
product = expand_doubleword_mult (mode, op0, op1, target,
true, methods);
@@ -2101,8 +2052,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
}
if (product == NULL_RTX
- && optab_handler (smul_widen_optab, mode)->insn_code
- != CODE_FOR_nothing)
+ && optab_handler (smul_widen_optab, mode) != CODE_FOR_nothing)
{
product = expand_doubleword_mult (mode, op0, op1, target,
false, methods);
@@ -2112,7 +2062,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if (product != NULL_RTX)
{
- if (optab_handler (mov_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (mov_optab, mode) != CODE_FOR_nothing)
{
temp = emit_move_insn (target ? target : product, product);
set_unique_reg_note (temp,
@@ -2193,8 +2143,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if ((optab_handler (binoptab, wider_mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (binoptab, wider_mode) != CODE_FOR_nothing
|| (methods == OPTAB_LIB
&& optab_libfunc (binoptab, wider_mode)))
{
@@ -2270,7 +2219,7 @@ sign_expand_binop (enum machine_mode mode, optab uoptab, optab soptab,
/* Try widening to a signed int. Make a fake signed optab that
hides any signed insn for direct use. */
wide_soptab = *soptab;
- optab_handler (&wide_soptab, mode)->insn_code = CODE_FOR_nothing;
+ set_optab_handler (&wide_soptab, mode, CODE_FOR_nothing);
/* We don't want to generate new hash table entries from this fake
optab. */
wide_soptab.libcall_gen = NULL;
@@ -2332,9 +2281,9 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
/* Record where to go back to if we fail. */
last = get_last_insn ();
- if (optab_handler (unoptab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (unoptab, mode) != CODE_FOR_nothing)
{
- int icode = (int) optab_handler (unoptab, mode)->insn_code;
+ int icode = (int) optab_handler (unoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[2].mode;
rtx pat;
rtx xop0 = op0;
@@ -2370,8 +2319,7 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if (optab_handler (unoptab, wider_mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (unoptab, wider_mode) != CODE_FOR_nothing)
{
rtx t0 = gen_reg_rtx (wider_mode);
rtx t1 = gen_reg_rtx (wider_mode);
@@ -2425,9 +2373,9 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
/* Record where to go back to if we fail. */
last = get_last_insn ();
- if (optab_handler (binoptab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (binoptab, mode) != CODE_FOR_nothing)
{
- int icode = (int) optab_handler (binoptab, mode)->insn_code;
+ int icode = (int) optab_handler (binoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
rtx pat;
@@ -2487,8 +2435,7 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if (optab_handler (binoptab, wider_mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (binoptab, wider_mode) != CODE_FOR_nothing)
{
rtx t0 = gen_reg_rtx (wider_mode);
rtx t1 = gen_reg_rtx (wider_mode);
@@ -2589,8 +2536,7 @@ widen_clz (enum machine_mode mode, rtx op0, rtx target)
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if (optab_handler (clz_optab, wider_mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (clz_optab, wider_mode) != CODE_FOR_nothing)
{
rtx xop0, temp, last;
@@ -2702,7 +2648,7 @@ widen_bswap (enum machine_mode mode, rtx op0, rtx target)
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
- if (optab_handler (bswap_optab, wider_mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (bswap_optab, wider_mode) != CODE_FOR_nothing)
goto found;
return NULL_RTX;
@@ -2764,8 +2710,7 @@ expand_parity (enum machine_mode mode, rtx op0, rtx target)
for (wider_mode = mode; wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if (optab_handler (popcount_optab, wider_mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (popcount_optab, wider_mode) != CODE_FOR_nothing)
{
rtx xop0, temp, last;
@@ -2806,7 +2751,7 @@ expand_ctz (enum machine_mode mode, rtx op0, rtx target)
{
rtx seq, temp;
- if (optab_handler (clz_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (clz_optab, mode) == CODE_FOR_nothing)
return 0;
start_sequence ();
@@ -2849,7 +2794,7 @@ expand_ffs (enum machine_mode mode, rtx op0, rtx target)
bool defined_at_zero = false;
rtx temp, seq;
- if (optab_handler (ctz_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (ctz_optab, mode) != CODE_FOR_nothing)
{
start_sequence ();
@@ -2859,7 +2804,7 @@ expand_ffs (enum machine_mode mode, rtx op0, rtx target)
defined_at_zero = (CTZ_DEFINED_VALUE_AT_ZERO (mode, val) == 2);
}
- else if (optab_handler (clz_optab, mode)->insn_code != CODE_FOR_nothing)
+ else if (optab_handler (clz_optab, mode) != CODE_FOR_nothing)
{
start_sequence ();
temp = expand_ctz (mode, op0, 0);
@@ -3037,9 +2982,9 @@ static rtx
expand_unop_direct (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
int unsignedp)
{
- if (optab_handler (unoptab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (unoptab, mode) != CODE_FOR_nothing)
{
- int icode = (int) optab_handler (unoptab, mode)->insn_code;
+ int icode = (int) optab_handler (unoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
rtx xop0 = op0;
rtx last = get_last_insn ();
@@ -3116,7 +3061,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
return temp;
if (GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
- && optab_handler (unoptab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (unoptab, word_mode) != CODE_FOR_nothing)
{
temp = expand_doubleword_clz (mode, op0, target);
if (temp)
@@ -3134,7 +3079,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
return temp;
if (GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
- && optab_handler (unoptab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (unoptab, word_mode) != CODE_FOR_nothing)
{
temp = expand_doubleword_bswap (mode, op0, target);
if (temp)
@@ -3149,7 +3094,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if (optab_handler (unoptab, wider_mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (unoptab, wider_mode) != CODE_FOR_nothing)
{
rtx xop0 = op0;
rtx last = get_last_insn ();
@@ -3189,7 +3134,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
if (unoptab == one_cmpl_optab
&& mclass == MODE_INT
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD
- && optab_handler (unoptab, word_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (unoptab, word_mode) != CODE_FOR_nothing)
{
int i;
rtx insns;
@@ -3311,8 +3256,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
- if ((optab_handler (unoptab, wider_mode)->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (unoptab, wider_mode) != CODE_FOR_nothing
|| optab_libfunc (unoptab, wider_mode))
{
rtx xop0 = op0;
@@ -3405,7 +3349,7 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
}
/* If we have a MAX insn, we can do this as MAX (x, -x). */
- if (optab_handler (smax_optab, mode)->insn_code != CODE_FOR_nothing
+ if (optab_handler (smax_optab, mode) != CODE_FOR_nothing
&& !HONOR_SIGNED_ZEROS (mode))
{
rtx last = get_last_insn ();
@@ -3508,7 +3452,7 @@ expand_one_cmpl_abs_nojump (enum machine_mode mode, rtx op0, rtx target)
return NULL_RTX;
/* If we have a MAX insn, we can do this as MAX (x, ~x). */
- if (optab_handler (smax_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (smax_optab, mode) != CODE_FOR_nothing)
{
rtx last = get_last_insn ();
@@ -3562,7 +3506,7 @@ expand_copysign_absneg (enum machine_mode mode, rtx op0, rtx op1, rtx target,
/* Check if the back end provides an insn that handles signbit for the
argument's mode. */
- icode = (int) signbit_optab->handlers [(int) mode].insn_code;
+ icode = (int) optab_handler (signbit_optab, mode);
if (icode != CODE_FOR_nothing)
{
imode = insn_data[icode].operand[0].mode;
@@ -3762,8 +3706,8 @@ expand_copysign (rtx op0, rtx op1, rtx target)
if (fmt->signbit_ro >= 0
&& (GET_CODE (op0) == CONST_DOUBLE
- || (optab_handler (neg_optab, mode)->insn_code != CODE_FOR_nothing
- && optab_handler (abs_optab, mode)->insn_code != CODE_FOR_nothing)))
+ || (optab_handler (neg_optab, mode) != CODE_FOR_nothing
+ && optab_handler (abs_optab, mode) != CODE_FOR_nothing)))
{
temp = expand_copysign_absneg (mode, op0, op1, target,
fmt->signbit_ro, op0_is_abs);
@@ -3975,8 +3919,7 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
}
last = emit_move_insn (target, result);
- if (optab_handler (mov_optab, GET_MODE (target))->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (mov_optab, GET_MODE (target)) != CODE_FOR_nothing)
set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv));
if (final_dest != target)
@@ -4002,15 +3945,15 @@ can_compare_p (enum rtx_code code, enum machine_mode mode,
int icode;
if (purpose == ccp_jump
- && (icode = optab_handler (cbranch_optab, mode)->insn_code) != CODE_FOR_nothing
+ && (icode = optab_handler (cbranch_optab, mode)) != CODE_FOR_nothing
&& insn_data[icode].operand[0].predicate (test, mode))
return 1;
if (purpose == ccp_store_flag
- && (icode = optab_handler (cstore_optab, mode)->insn_code) != CODE_FOR_nothing
+ && (icode = optab_handler (cstore_optab, mode)) != CODE_FOR_nothing
&& insn_data[icode].operand[1].predicate (test, mode))
return 1;
if (purpose == ccp_cmov
- && optab_handler (cmov_optab, mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (cmov_optab, mode) != CODE_FOR_nothing)
return 1;
mode = GET_MODE_WIDER_MODE (mode);
@@ -4096,11 +4039,11 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
cmp_mode != VOIDmode;
cmp_mode = GET_MODE_WIDER_MODE (cmp_mode))
{
- cmp_code = cmpmem_optab[cmp_mode];
+ cmp_code = direct_optab_handler (cmpmem_optab, cmp_mode);
if (cmp_code == CODE_FOR_nothing)
- cmp_code = cmpstr_optab[cmp_mode];
+ cmp_code = direct_optab_handler (cmpstr_optab, cmp_mode);
if (cmp_code == CODE_FOR_nothing)
- cmp_code = cmpstrn_optab[cmp_mode];
+ cmp_code = direct_optab_handler (cmpstrn_optab, cmp_mode);
if (cmp_code == CODE_FOR_nothing)
continue;
@@ -4166,7 +4109,7 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
do
{
enum insn_code icode;
- icode = optab_handler (cbranch_optab, cmp_mode)->insn_code;
+ icode = optab_handler (cbranch_optab, cmp_mode);
if (icode != CODE_FOR_nothing
&& insn_data[icode].operand[0].predicate (test, VOIDmode))
{
@@ -4285,7 +4228,7 @@ emit_cmp_and_jump_insn_1 (rtx test, enum machine_mode mode, rtx label)
mclass = GET_MODE_CLASS (mode);
optab_mode = (mclass == MODE_CC) ? CCmode : mode;
- icode = optab_handler (cbranch_optab, optab_mode)->insn_code;
+ icode = optab_handler (cbranch_optab, optab_mode);
gcc_assert (icode != CODE_FOR_nothing);
gcc_assert (insn_data[icode].operand[0].predicate (test, VOIDmode));
@@ -4545,7 +4488,7 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
if (mode == VOIDmode)
mode = GET_MODE (op2);
- icode = movcc_gen_code[mode];
+ icode = direct_optab_handler (movcc_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
@@ -4618,7 +4561,7 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
int
can_conditionally_move_p (enum machine_mode mode)
{
- if (movcc_gen_code[mode] != CODE_FOR_nothing)
+ if (direct_optab_handler (movcc_optab, mode) != CODE_FOR_nothing)
return 1;
return 0;
@@ -4684,7 +4627,7 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
if (mode == VOIDmode)
mode = GET_MODE (op2);
- icode = optab_handler (addcc_optab, mode)->insn_code;
+ icode = optab_handler (addcc_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
@@ -4755,7 +4698,7 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
rtx
gen_add2_insn (rtx x, rtx y)
{
- int icode = (int) optab_handler (add_optab, GET_MODE (x))->insn_code;
+ int icode = (int) optab_handler (add_optab, GET_MODE (x));
gcc_assert (insn_data[icode].operand[0].predicate
(x, insn_data[icode].operand[0].mode));
@@ -4773,7 +4716,7 @@ gen_add2_insn (rtx x, rtx y)
rtx
gen_add3_insn (rtx r0, rtx r1, rtx c)
{
- int icode = (int) optab_handler (add_optab, GET_MODE (r0))->insn_code;
+ int icode = (int) optab_handler (add_optab, GET_MODE (r0));
if (icode == CODE_FOR_nothing
|| !(insn_data[icode].operand[0].predicate
@@ -4794,7 +4737,7 @@ have_add2_insn (rtx x, rtx y)
gcc_assert (GET_MODE (x) != VOIDmode);
- icode = (int) optab_handler (add_optab, GET_MODE (x))->insn_code;
+ icode = (int) optab_handler (add_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
@@ -4815,7 +4758,7 @@ have_add2_insn (rtx x, rtx y)
rtx
gen_sub2_insn (rtx x, rtx y)
{
- int icode = (int) optab_handler (sub_optab, GET_MODE (x))->insn_code;
+ int icode = (int) optab_handler (sub_optab, GET_MODE (x));
gcc_assert (insn_data[icode].operand[0].predicate
(x, insn_data[icode].operand[0].mode));
@@ -4833,7 +4776,7 @@ gen_sub2_insn (rtx x, rtx y)
rtx
gen_sub3_insn (rtx r0, rtx r1, rtx c)
{
- int icode = (int) optab_handler (sub_optab, GET_MODE (r0))->insn_code;
+ int icode = (int) optab_handler (sub_optab, GET_MODE (r0));
if (icode == CODE_FOR_nothing
|| !(insn_data[icode].operand[0].predicate
@@ -4854,7 +4797,7 @@ have_sub2_insn (rtx x, rtx y)
gcc_assert (GET_MODE (x) != VOIDmode);
- icode = (int) optab_handler (sub_optab, GET_MODE (x))->insn_code;
+ icode = (int) optab_handler (sub_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
@@ -4900,7 +4843,7 @@ can_extend_p (enum machine_mode to_mode, enum machine_mode from_mode,
#endif
tab = unsignedp ? zext_optab : sext_optab;
- return convert_optab_handler (tab, to_mode, from_mode)->insn_code;
+ return convert_optab_handler (tab, to_mode, from_mode);
}
/* Generate the body of an insn to extend Y (with mode MFROM)
@@ -4931,7 +4874,7 @@ can_fix_p (enum machine_mode fixmode, enum machine_mode fltmode,
enum insn_code icode;
tab = unsignedp ? ufixtrunc_optab : sfixtrunc_optab;
- icode = convert_optab_handler (tab, fixmode, fltmode)->insn_code;
+ icode = convert_optab_handler (tab, fixmode, fltmode);
if (icode != CODE_FOR_nothing)
{
*truncp_ptr = 0;
@@ -4942,9 +4885,9 @@ can_fix_p (enum machine_mode fixmode, enum machine_mode fltmode,
for this to work. We need to rework the fix* and ftrunc* patterns
and documentation. */
tab = unsignedp ? ufix_optab : sfix_optab;
- icode = convert_optab_handler (tab, fixmode, fltmode)->insn_code;
+ icode = convert_optab_handler (tab, fixmode, fltmode);
if (icode != CODE_FOR_nothing
- && optab_handler (ftrunc_optab, fltmode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (ftrunc_optab, fltmode) != CODE_FOR_nothing)
{
*truncp_ptr = 1;
return icode;
@@ -4961,7 +4904,7 @@ can_float_p (enum machine_mode fltmode, enum machine_mode fixmode,
convert_optab tab;
tab = unsignedp ? ufloat_optab : sfloat_optab;
- return convert_optab_handler (tab, fltmode, fixmode)->insn_code;
+ return convert_optab_handler (tab, fltmode, fixmode);
}
/* Generate code to convert FROM to floating point
@@ -5295,8 +5238,7 @@ expand_fix (rtx to, rtx from, int unsignedp)
emit_label (lab2);
- if (optab_handler (mov_optab, GET_MODE (to))->insn_code
- != CODE_FOR_nothing)
+ if (optab_handler (mov_optab, GET_MODE (to)) != CODE_FOR_nothing)
{
/* Make a place for a REG_NOTE and add it. */
insn = emit_move_insn (to, to);
@@ -5383,7 +5325,7 @@ expand_fixed_convert (rtx to, rtx from, int uintp, int satp)
tab = satp ? satfract_optab : fract_optab;
this_code = satp ? SAT_FRACT : FRACT_CONVERT;
}
- code = tab->handlers[to_mode][from_mode].insn_code;
+ code = convert_optab_handler (tab, to_mode, from_mode);
if (code != CODE_FOR_nothing)
{
emit_unop_insn (code, to, from, this_code);
@@ -5424,7 +5366,7 @@ expand_sfix_optab (rtx to, rtx from, convert_optab tab)
for (imode = GET_MODE (to); imode != VOIDmode;
imode = GET_MODE_WIDER_MODE (imode))
{
- icode = convert_optab_handler (tab, imode, fmode)->insn_code;
+ icode = convert_optab_handler (tab, imode, fmode);
if (icode != CODE_FOR_nothing)
{
rtx last = get_last_insn ();
@@ -5454,7 +5396,7 @@ int
have_insn_for (enum rtx_code code, enum machine_mode mode)
{
return (code_to_optab[(int) code] != 0
- && (optab_handler (code_to_optab[(int) code], mode)->insn_code
+ && (optab_handler (code_to_optab[(int) code], mode)
!= CODE_FOR_nothing));
}
@@ -5463,27 +5405,9 @@ have_insn_for (enum rtx_code code, enum machine_mode mode)
static void
init_insn_codes (void)
{
- unsigned int i;
-
- for (i = 0; i < (unsigned int) OTI_MAX; i++)
- {
- unsigned int j;
- optab op;
-
- op = &optab_table[i];
- for (j = 0; j < NUM_MACHINE_MODES; j++)
- optab_handler (op, j)->insn_code = CODE_FOR_nothing;
- }
- for (i = 0; i < (unsigned int) COI_MAX; i++)
- {
- unsigned int j, k;
- convert_optab op;
-
- op = &convert_optab_table[i];
- for (j = 0; j < NUM_MACHINE_MODES; j++)
- for (k = 0; k < NUM_MACHINE_MODES; k++)
- convert_optab_handler (op, j, k)->insn_code = CODE_FOR_nothing;
- }
+ memset (optab_table, 0, sizeof (optab_table));
+ memset (convert_optab_table, 0, sizeof (convert_optab_table));
+ memset (direct_optab_table, 0, sizeof (direct_optab_table));
}
/* Initialize OP's code to CODE, and write it into the code_to_optab table. */
@@ -6191,32 +6115,15 @@ set_conv_libfunc (convert_optab optable, enum machine_mode tmode,
void
init_optabs (void)
{
- unsigned int i;
-#if GCC_VERSION >= 4000 && HAVE_DESIGNATED_INITIALIZERS
- static bool reinit;
-#endif
-
- libfunc_hash = htab_create_ggc (10, hash_libfunc, eq_libfunc, NULL);
- /* Start by initializing all tables to contain CODE_FOR_nothing. */
-
-#ifdef HAVE_conditional_move
- for (i = 0; i < NUM_MACHINE_MODES; i++)
- movcc_gen_code[i] = CODE_FOR_nothing;
-#endif
-
- for (i = 0; i < NUM_MACHINE_MODES; i++)
+ if (libfunc_hash)
{
- vcond_gen_code[i] = CODE_FOR_nothing;
- vcondu_gen_code[i] = CODE_FOR_nothing;
+ htab_empty (libfunc_hash);
+ /* We statically initialize the insn_codes with the equivalent of
+ CODE_FOR_nothing. Repeat the process if reinitialising. */
+ init_insn_codes ();
}
-
-#if GCC_VERSION >= 4000 && HAVE_DESIGNATED_INITIALIZERS
- /* We statically initialize the insn_codes with CODE_FOR_nothing. */
- if (reinit)
- init_insn_codes ();
-#else
- init_insn_codes ();
-#endif
+ else
+ libfunc_hash = htab_create_ggc (10, hash_libfunc, eq_libfunc, NULL);
init_optab (add_optab, PLUS);
init_optabv (addv_optab, PLUS);
@@ -6407,39 +6314,6 @@ init_optabs (void)
init_convert_optab (satfract_optab, SAT_FRACT);
init_convert_optab (satfractuns_optab, UNSIGNED_SAT_FRACT);
- for (i = 0; i < NUM_MACHINE_MODES; i++)
- {
- movmem_optab[i] = CODE_FOR_nothing;
- cmpstr_optab[i] = CODE_FOR_nothing;
- cmpstrn_optab[i] = CODE_FOR_nothing;
- cmpmem_optab[i] = CODE_FOR_nothing;
- setmem_optab[i] = CODE_FOR_nothing;
-
- sync_add_optab[i] = CODE_FOR_nothing;
- sync_sub_optab[i] = CODE_FOR_nothing;
- sync_ior_optab[i] = CODE_FOR_nothing;
- sync_and_optab[i] = CODE_FOR_nothing;
- sync_xor_optab[i] = CODE_FOR_nothing;
- sync_nand_optab[i] = CODE_FOR_nothing;
- sync_old_add_optab[i] = CODE_FOR_nothing;
- sync_old_sub_optab[i] = CODE_FOR_nothing;
- sync_old_ior_optab[i] = CODE_FOR_nothing;
- sync_old_and_optab[i] = CODE_FOR_nothing;
- sync_old_xor_optab[i] = CODE_FOR_nothing;
- sync_old_nand_optab[i] = CODE_FOR_nothing;
- sync_new_add_optab[i] = CODE_FOR_nothing;
- sync_new_sub_optab[i] = CODE_FOR_nothing;
- sync_new_ior_optab[i] = CODE_FOR_nothing;
- sync_new_and_optab[i] = CODE_FOR_nothing;
- sync_new_xor_optab[i] = CODE_FOR_nothing;
- sync_new_nand_optab[i] = CODE_FOR_nothing;
- sync_compare_and_swap[i] = CODE_FOR_nothing;
- sync_lock_test_and_set[i] = CODE_FOR_nothing;
- sync_lock_release[i] = CODE_FOR_nothing;
-
- reload_in_optab[i] = reload_out_optab[i] = CODE_FOR_nothing;
- }
-
/* Fill in the optabs with the insns we support. */
init_all_optabs ();
@@ -6690,10 +6564,6 @@ init_optabs (void)
/* Allow the target to add more libcalls or rename some, etc. */
targetm.init_libfuncs ();
-
-#if GCC_VERSION >= 4000 && HAVE_DESIGNATED_INITIALIZERS
- reinit = true;
-#endif
}
/* Print information about the current contents of the optabs on
@@ -6763,7 +6633,7 @@ gen_cond_trap (enum rtx_code code, rtx op1, rtx op2, rtx tcode)
if (mode == VOIDmode)
return 0;
- icode = optab_handler (ctrap_optab, mode)->insn_code;
+ icode = optab_handler (ctrap_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
@@ -6897,9 +6767,9 @@ get_vcond_icode (tree type, enum machine_mode mode)
enum insn_code icode = CODE_FOR_nothing;
if (TYPE_UNSIGNED (type))
- icode = vcondu_gen_code[mode];
+ icode = direct_optab_handler (vcondu_optab, mode);
else
- icode = vcond_gen_code[mode];
+ icode = direct_optab_handler (vcond_optab, mode);
return icode;
}
@@ -6997,7 +6867,8 @@ rtx
expand_val_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target)
{
enum machine_mode mode = GET_MODE (mem);
- enum insn_code icode = sync_compare_and_swap[mode];
+ enum insn_code icode
+ = direct_optab_handler (sync_compare_and_swap_optab, mode);
if (icode == CODE_FOR_nothing)
return NULL_RTX;
@@ -7034,7 +6905,7 @@ expand_bool_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target)
/* If the target supports a compare-and-swap pattern that simultaneously
sets some flag for success, then use it. Otherwise use the regular
compare-and-swap and follow that immediately with a compare insn. */
- icode = sync_compare_and_swap[mode];
+ icode = direct_optab_handler (sync_compare_and_swap_optab, mode);
if (icode == CODE_FOR_nothing)
return NULL_RTX;
@@ -7112,7 +6983,7 @@ expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
/* If the target supports a compare-and-swap pattern that simultaneously
sets some flag for success, then use it. Otherwise use the regular
compare-and-swap and follow that immediately with a compare insn. */
- icode = sync_compare_and_swap[mode];
+ icode = direct_optab_handler (sync_compare_and_swap_optab, mode);
if (icode == CODE_FOR_nothing)
return false;
@@ -7156,26 +7027,26 @@ expand_sync_operation (rtx mem, rtx val, enum rtx_code code)
switch (code)
{
case PLUS:
- icode = sync_add_optab[mode];
+ icode = direct_optab_handler (sync_add_optab, mode);
break;
case IOR:
- icode = sync_ior_optab[mode];
+ icode = direct_optab_handler (sync_ior_optab, mode);
break;
case XOR:
- icode = sync_xor_optab[mode];
+ icode = direct_optab_handler (sync_xor_optab, mode);
break;
case AND:
- icode = sync_and_optab[mode];
+ icode = direct_optab_handler (sync_and_optab, mode);
break;
case NOT:
- icode = sync_nand_optab[mode];
+ icode = direct_optab_handler (sync_nand_optab, mode);
break;
case MINUS:
- icode = sync_sub_optab[mode];
+ icode = direct_optab_handler (sync_sub_optab, mode);
if (icode == CODE_FOR_nothing || CONST_INT_P (val))
{
- icode = sync_add_optab[mode];
+ icode = direct_optab_handler (sync_add_optab, mode);
if (icode != CODE_FOR_nothing)
{
val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
@@ -7206,7 +7077,8 @@ expand_sync_operation (rtx mem, rtx val, enum rtx_code code)
/* Failing that, generate a compare-and-swap loop in which we perform the
operation with normal arithmetic instructions. */
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing)
{
rtx t0 = gen_reg_rtx (mode), t1;
@@ -7251,34 +7123,34 @@ expand_sync_fetch_operation (rtx mem, rtx val, enum rtx_code code,
switch (code)
{
case PLUS:
- old_code = sync_old_add_optab[mode];
- new_code = sync_new_add_optab[mode];
+ old_code = direct_optab_handler (sync_old_add_optab, mode);
+ new_code = direct_optab_handler (sync_new_add_optab, mode);
break;
case IOR:
- old_code = sync_old_ior_optab[mode];
- new_code = sync_new_ior_optab[mode];
+ old_code = direct_optab_handler (sync_old_ior_optab, mode);
+ new_code = direct_optab_handler (sync_new_ior_optab, mode);
break;
case XOR:
- old_code = sync_old_xor_optab[mode];
- new_code = sync_new_xor_optab[mode];
+ old_code = direct_optab_handler (sync_old_xor_optab, mode);
+ new_code = direct_optab_handler (sync_new_xor_optab, mode);
break;
case AND:
- old_code = sync_old_and_optab[mode];
- new_code = sync_new_and_optab[mode];
+ old_code = direct_optab_handler (sync_old_and_optab, mode);
+ new_code = direct_optab_handler (sync_new_and_optab, mode);
break;
case NOT:
- old_code = sync_old_nand_optab[mode];
- new_code = sync_new_nand_optab[mode];
+ old_code = direct_optab_handler (sync_old_nand_optab, mode);
+ new_code = direct_optab_handler (sync_new_nand_optab, mode);
break;
case MINUS:
- old_code = sync_old_sub_optab[mode];
- new_code = sync_new_sub_optab[mode];
+ old_code = direct_optab_handler (sync_old_sub_optab, mode);
+ new_code = direct_optab_handler (sync_new_sub_optab, mode);
if ((old_code == CODE_FOR_nothing && new_code == CODE_FOR_nothing)
|| CONST_INT_P (val))
{
- old_code = sync_old_add_optab[mode];
- new_code = sync_new_add_optab[mode];
+ old_code = direct_optab_handler (sync_old_add_optab, mode);
+ new_code = direct_optab_handler (sync_new_add_optab, mode);
if (old_code != CODE_FOR_nothing || new_code != CODE_FOR_nothing)
{
val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
@@ -7368,7 +7240,8 @@ expand_sync_fetch_operation (rtx mem, rtx val, enum rtx_code code,
/* Failing that, generate a compare-and-swap loop in which we perform the
operation with normal arithmetic instructions. */
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing)
{
rtx t0 = gen_reg_rtx (mode), t1;
@@ -7417,7 +7290,7 @@ expand_sync_lock_test_and_set (rtx mem, rtx val, rtx target)
rtx insn;
/* If the target supports the test-and-set directly, great. */
- icode = sync_lock_test_and_set[mode];
+ icode = direct_optab_handler (sync_lock_test_and_set_optab, mode);
if (icode != CODE_FOR_nothing)
{
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
@@ -7437,7 +7310,8 @@ expand_sync_lock_test_and_set (rtx mem, rtx val, rtx target)
}
/* Otherwise, use a compare-and-swap loop for the exchange. */
- if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
+ if (direct_optab_handler (sync_compare_and_swap_optab, mode)
+ != CODE_FOR_nothing)
{
if (!target || !register_operand (target, mode))
target = gen_reg_rtx (mode);
diff --git a/gcc/optabs.h b/gcc/optabs.h
index faa4330e5dd..547339bcee6 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -29,10 +29,6 @@ along with GCC; see the file COPYING3. If not see
For example, add_optab applies to addition.
- The insn_code slot is the enum insn_code that says how to
- generate an insn for this operation on a particular machine mode.
- It is CODE_FOR_nothing if there is no such insn on the target machine.
-
The `lib_call' slot is the name of the library function that
can be used to perform the operation.
@@ -40,7 +36,10 @@ along with GCC; see the file COPYING3. If not see
struct optab_handlers
{
- enum insn_code insn_code;
+ /* I - CODE_FOR_nothing, where I is either the insn code of the
+ associated insn generator or CODE_FOR_nothing if there is no such
+ insn on the target machine. */
+ int insn_code;
};
struct optab_d
@@ -372,8 +371,6 @@ enum optab_index
OTI_MAX
};
-extern struct optab_d optab_table[OTI_MAX];
-
#define ssadd_optab (&optab_table[OTI_ssadd])
#define usadd_optab (&optab_table[OTI_usadd])
#define sssub_optab (&optab_table[OTI_sssub])
@@ -575,8 +572,6 @@ enum convert_optab_index
COI_MAX
};
-extern struct convert_optab_d convert_optab_table[COI_MAX];
-
#define sext_optab (&convert_optab_table[COI_sext])
#define zext_optab (&convert_optab_table[COI_zext])
#define trunc_optab (&convert_optab_table[COI_trunc])
@@ -595,79 +590,152 @@ extern struct convert_optab_d convert_optab_table[COI_MAX];
#define satfract_optab (&convert_optab_table[COI_satfract])
#define satfractuns_optab (&convert_optab_table[COI_satfractuns])
-/* These arrays record the insn_code of insns that may be needed to
- perform input and output reloads of special objects. They provide a
- place to pass a scratch register. */
-extern enum insn_code reload_in_optab[NUM_MACHINE_MODES];
-extern enum insn_code reload_out_optab[NUM_MACHINE_MODES];
-
/* Contains the optab used for each rtx code. */
extern optab code_to_optab[NUM_RTX_CODE + 1];
typedef rtx (*rtxfun) (rtx);
+/* Enumerates operations that have a named .md pattern associated
+ with them, but which are not implemented as library functions. */
+enum direct_optab_index
+{
#ifdef HAVE_conditional_move
-/* Indexed by the machine mode, gives the insn code to make a conditional
- move insn. */
+ /* Conditional move operations. */
+ DOI_movcc,
+#endif
+
+ /* Operations that use a scratch register to perform input and output
+ reloads of special objects. */
+ DOI_reload_in,
+ DOI_reload_out,
+
+ /* Vector conditional operations. */
+ DOI_vcond,
+ DOI_vcondu,
+
+ /* Block move operation. */
+ DOI_movmem,
+
+ /* Block set operation. */
+ DOI_setmem,
+
+ /* Various types of block compare operation. */
+ DOI_cmpstr,
+ DOI_cmpstrn,
+ DOI_cmpmem,
+
+ /* Synchronization primitives. This first set is atomic operation for
+ which we don't care about the resulting value. */
+ DOI_sync_add,
+ DOI_sync_sub,
+ DOI_sync_ior,
+ DOI_sync_and,
+ DOI_sync_xor,
+ DOI_sync_nand,
+
+ /* This second set is atomic operations in which we return the value
+ that existed in memory before the operation. */
+ DOI_sync_old_add,
+ DOI_sync_old_sub,
+ DOI_sync_old_ior,
+ DOI_sync_old_and,
+ DOI_sync_old_xor,
+ DOI_sync_old_nand,
+
+ /* This third set is atomic operations in which we return the value
+ that resulted after performing the operation. */
+ DOI_sync_new_add,
+ DOI_sync_new_sub,
+ DOI_sync_new_ior,
+ DOI_sync_new_and,
+ DOI_sync_new_xor,
+ DOI_sync_new_nand,
+
+ /* Atomic compare and swap. */
+ DOI_sync_compare_and_swap,
+
+ /* Atomic exchange with acquire semantics. */
+ DOI_sync_lock_test_and_set,
+
+ /* Atomic clear with release semantics. */
+ DOI_sync_lock_release,
+
+ DOI_MAX
+};
+
+/* A structure that says which insn should be used to perform an operation
+ in a particular mode. */
+struct direct_optab_d
+{
+ struct optab_handlers handlers[NUM_MACHINE_MODES];
+};
+typedef struct direct_optab_d *direct_optab;
-extern enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
+#ifdef HAVE_conditional_move
+#define movcc_optab (&direct_optab_table[(int) DOI_movcc])
#endif
+#define reload_in_optab (&direct_optab_table[(int) DOI_reload_in])
+#define reload_out_optab (&direct_optab_table[(int) DOI_reload_out])
+#define vcond_optab (&direct_optab_table[(int) DOI_vcond])
+#define vcondu_optab (&direct_optab_table[(int) DOI_vcondu])
+#define movmem_optab (&direct_optab_table[(int) DOI_movmem])
+#define setmem_optab (&direct_optab_table[(int) DOI_setmem])
+#define cmpstr_optab (&direct_optab_table[(int) DOI_cmpstr])
+#define cmpstrn_optab (&direct_optab_table[(int) DOI_cmpstrn])
+#define cmpmem_optab (&direct_optab_table[(int) DOI_cmpmem])
+#define sync_add_optab (&direct_optab_table[(int) DOI_sync_add])
+#define sync_sub_optab (&direct_optab_table[(int) DOI_sync_sub])
+#define sync_ior_optab (&direct_optab_table[(int) DOI_sync_ior])
+#define sync_and_optab (&direct_optab_table[(int) DOI_sync_and])
+#define sync_xor_optab (&direct_optab_table[(int) DOI_sync_xor])
+#define sync_nand_optab (&direct_optab_table[(int) DOI_sync_nand])
+#define sync_old_add_optab (&direct_optab_table[(int) DOI_sync_old_add])
+#define sync_old_sub_optab (&direct_optab_table[(int) DOI_sync_old_sub])
+#define sync_old_ior_optab (&direct_optab_table[(int) DOI_sync_old_ior])
+#define sync_old_and_optab (&direct_optab_table[(int) DOI_sync_old_and])
+#define sync_old_xor_optab (&direct_optab_table[(int) DOI_sync_old_xor])
+#define sync_old_nand_optab (&direct_optab_table[(int) DOI_sync_old_nand])
+#define sync_new_add_optab (&direct_optab_table[(int) DOI_sync_new_add])
+#define sync_new_sub_optab (&direct_optab_table[(int) DOI_sync_new_sub])
+#define sync_new_ior_optab (&direct_optab_table[(int) DOI_sync_new_ior])
+#define sync_new_and_optab (&direct_optab_table[(int) DOI_sync_new_and])
+#define sync_new_xor_optab (&direct_optab_table[(int) DOI_sync_new_xor])
+#define sync_new_nand_optab (&direct_optab_table[(int) DOI_sync_new_nand])
+#define sync_compare_and_swap_optab \
+ (&direct_optab_table[(int) DOI_sync_compare_and_swap])
+#define sync_lock_test_and_set_optab \
+ (&direct_optab_table[(int) DOI_sync_lock_test_and_set])
+#define sync_lock_release_optab \
+ (&direct_optab_table[(int) DOI_sync_lock_release])
+
+/* Target-dependent globals. */
+struct target_optabs {
+ /* Tables of patterns that may have an associated libcall. */
+ struct optab_d x_optab_table[(int) OTI_MAX];
-/* Indexed by the machine mode, gives the insn code for vector conditional
- operation. */
-
-extern enum insn_code vcond_gen_code[NUM_MACHINE_MODES];
-extern enum insn_code vcondu_gen_code[NUM_MACHINE_MODES];
-
-/* This array records the insn_code of insns to perform block moves. */
-extern enum insn_code movmem_optab[NUM_MACHINE_MODES];
-
-/* This array records the insn_code of insns to perform block sets. */
-extern enum insn_code setmem_optab[NUM_MACHINE_MODES];
-
-/* These arrays record the insn_code of two different kinds of insns
- to perform block compares. */
-extern enum insn_code cmpstr_optab[NUM_MACHINE_MODES];
-extern enum insn_code cmpstrn_optab[NUM_MACHINE_MODES];
-extern enum insn_code cmpmem_optab[NUM_MACHINE_MODES];
-
-/* Synchronization primitives. This first set is atomic operation for
- which we don't care about the resulting value. */
-extern enum insn_code sync_add_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_sub_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_ior_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_and_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_xor_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_nand_optab[NUM_MACHINE_MODES];
-
-/* This second set is atomic operations in which we return the value
- that existed in memory before the operation. */
-extern enum insn_code sync_old_add_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_old_sub_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_old_ior_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_old_and_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_old_xor_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_old_nand_optab[NUM_MACHINE_MODES];
-
-/* This third set is atomic operations in which we return the value
- that resulted after performing the operation. */
-extern enum insn_code sync_new_add_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_new_sub_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_new_ior_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_new_and_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_new_xor_optab[NUM_MACHINE_MODES];
-extern enum insn_code sync_new_nand_optab[NUM_MACHINE_MODES];
-
-/* Atomic compare and swap. */
-extern enum insn_code sync_compare_and_swap[NUM_MACHINE_MODES];
-
-/* Atomic exchange with acquire semantics. */
-extern enum insn_code sync_lock_test_and_set[NUM_MACHINE_MODES];
-
-/* Atomic clear with release semantics. */
-extern enum insn_code sync_lock_release[NUM_MACHINE_MODES];
+ /* Tables of patterns for converting one mode to another. */
+ struct convert_optab_d x_convert_optab_table[(int) COI_MAX];
+
+ /* Tables of patterns for direct optabs (i.e. those which cannot be
+ implemented using a libcall). */
+ struct direct_optab_d x_direct_optab_table[(int) DOI_MAX];
+};
+
+extern struct target_optabs default_target_optabs;
+#if SWITCHABLE_TARGET
+extern struct target_optabs *this_target_optabs;
+#else
+#define this_target_optabs (&default_target_optabs)
+#endif
+#define optab_table \
+ (this_target_optabs->x_optab_table)
+#define convert_optab_table \
+ (this_target_optabs->x_convert_optab_table)
+#define direct_optab_table \
+ (this_target_optabs->x_direct_optab_table)
+
/* Define functions given in optabs.c. */
extern rtx expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op,
@@ -782,9 +850,66 @@ extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx);
/* Generate code for VEC_LSHIFT_EXPR and VEC_RSHIFT_EXPR. */
extern rtx expand_vec_shift_expr (sepops, rtx);
-#define optab_handler(optab,mode) (&(optab)->handlers[(int) (mode)])
-#define convert_optab_handler(optab,mode,mode2) \
- (&(optab)->handlers[(int) (mode)][(int) (mode2)])
+/* Return the insn used to implement mode MODE of OP, or CODE_FOR_nothing
+ if the target does not have such an insn. */
+
+static inline enum insn_code
+optab_handler (optab op, enum machine_mode mode)
+{
+ return (enum insn_code) (op->handlers[(int) mode].insn_code
+ + (int) CODE_FOR_nothing);
+}
+
+/* Record that insn CODE should be used to implement mode MODE of OP. */
+
+static inline void
+set_optab_handler (optab op, enum machine_mode mode, enum insn_code code)
+{
+ op->handlers[(int) mode].insn_code = (int) code - (int) CODE_FOR_nothing;
+}
+
+/* Return the insn used to perform conversion OP from mode FROM_MODE
+ to mode TO_MODE; return CODE_FOR_nothing if the target does not have
+ such an insn. */
+
+static inline enum insn_code
+convert_optab_handler (convert_optab op, enum machine_mode to_mode,
+ enum machine_mode from_mode)
+{
+ return ((enum insn_code)
+ (op->handlers[(int) to_mode][(int) from_mode].insn_code
+ + (int) CODE_FOR_nothing));
+}
+
+/* Record that insn CODE should be used to perform conversion OP
+ from mode FROM_MODE to mode TO_MODE. */
+
+static inline void
+set_convert_optab_handler (convert_optab op, enum machine_mode to_mode,
+ enum machine_mode from_mode, enum insn_code code)
+{
+ op->handlers[(int) to_mode][(int) from_mode].insn_code
+ = (int) code - (int) CODE_FOR_nothing;
+}
+
+/* Return the insn used to implement mode MODE of OP, or CODE_FOR_nothing
+ if the target does not have such an insn. */
+
+static inline enum insn_code
+direct_optab_handler (direct_optab op, enum machine_mode mode)
+{
+ return (enum insn_code) (op->handlers[(int) mode].insn_code
+ + (int) CODE_FOR_nothing);
+}
+
+/* Record that insn CODE should be used to implement mode MODE of OP. */
+
+static inline void
+set_direct_optab_handler (direct_optab op, enum machine_mode mode,
+ enum insn_code code)
+{
+ op->handlers[(int) mode].insn_code = (int) code - (int) CODE_FOR_nothing;
+}
extern rtx optab_libfunc (optab optab, enum machine_mode mode);
extern rtx convert_optab_libfunc (convert_optab optab, enum machine_mode mode1,
diff --git a/gcc/params.c b/gcc/params.c
index 04eff112055..cec5751a5f6 100644
--- a/gcc/params.c
+++ b/gcc/params.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "params.h"
+#include "diagnostic-core.h"
#include "toplev.h"
/* An array containing the compiler parameters and their current
diff --git a/gcc/passes.c b/gcc/passes.c
index 8828967d0d8..72e9b5aaa32 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -194,8 +194,6 @@ rest_of_decl_compilation (tree decl,
;
else if (TREE_CODE (decl) != FUNCTION_DECL)
varpool_finalize_decl (decl);
- else
- assemble_variable (decl, top_level, at_end, 0);
}
#ifdef ASM_FINISH_DECLARE_OBJECT
diff --git a/gcc/plugin.c b/gcc/plugin.c
index 6de4a8b0739..e7c4cf689fe 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#endif
#include "coretypes.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree.h"
#include "tree-pass.h"
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 77897aadf43..b54090d7b5c 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 3882719ccd3..31012214682 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -40,9 +40,11 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "output.h"
#include "cselib.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "except.h"
#include "tree.h"
+#include "target.h"
#include "timevar.h"
#include "tree-pass.h"
#include "df.h"
@@ -55,10 +57,10 @@ static int reload_cse_simplify_set (rtx, rtx);
static int reload_cse_simplify_operands (rtx, rtx);
static void reload_combine (void);
-static void reload_combine_note_use (rtx *, rtx);
+static void reload_combine_note_use (rtx *, rtx, int, rtx);
static void reload_combine_note_store (rtx, const_rtx, void *);
-static void reload_cse_move2add (rtx);
+static bool reload_cse_move2add (rtx);
static void move2add_note_store (rtx, const_rtx, void *);
/* Call cse / combine like post-reload optimization phases.
@@ -66,11 +68,16 @@ static void move2add_note_store (rtx, const_rtx, void *);
void
reload_cse_regs (rtx first ATTRIBUTE_UNUSED)
{
+ bool moves_converted;
reload_cse_regs_1 (first);
reload_combine ();
- reload_cse_move2add (first);
+ moves_converted = reload_cse_move2add (first);
if (flag_expensive_optimizations)
- reload_cse_regs_1 (first);
+ {
+ if (moves_converted)
+ reload_combine ();
+ reload_cse_regs_1 (first);
+ }
}
/* See whether a single set SET is a noop. */
@@ -659,30 +666,43 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
/* The maximum number of uses of a register we can keep track of to
replace them with reg+reg addressing. */
-#define RELOAD_COMBINE_MAX_USES 6
+#define RELOAD_COMBINE_MAX_USES 16
-/* INSN is the insn where a register has been used, and USEP points to the
- location of the register within the rtl. */
-struct reg_use { rtx insn, *usep; };
+/* Describes a recorded use of a register. */
+struct reg_use
+{
+ /* The insn where a register has been used. */
+ rtx insn;
+ /* Points to the memory reference enclosing the use, if any, NULL_RTX
+ otherwise. */
+ rtx containing_mem;
+ /* Location of the register withing INSN. */
+ rtx *usep;
+ /* The reverse uid of the insn. */
+ int ruid;
+};
/* If the register is used in some unknown fashion, USE_INDEX is negative.
If it is dead, USE_INDEX is RELOAD_COMBINE_MAX_USES, and STORE_RUID
- indicates where it becomes live again.
+ indicates where it is first set or clobbered.
Otherwise, USE_INDEX is the index of the last encountered use of the
- register (which is first among these we have seen since we scan backwards),
- OFFSET contains the constant offset that is added to the register in
- all encountered uses, and USE_RUID indicates the first encountered, i.e.
- last, of these uses.
+ register (which is first among these we have seen since we scan backwards).
+ USE_RUID indicates the first encountered, i.e. last, of these uses.
+ If ALL_OFFSETS_MATCH is true, all encountered uses were inside a PLUS
+ with a constant offset; OFFSET contains this constant in that case.
STORE_RUID is always meaningful if we only want to use a value in a
register in a different place: it denotes the next insn in the insn
- stream (i.e. the last encountered) that sets or clobbers the register. */
+ stream (i.e. the last encountered) that sets or clobbers the register.
+ REAL_STORE_RUID is similar, but clobbers are ignored when updating it. */
static struct
{
struct reg_use reg_use[RELOAD_COMBINE_MAX_USES];
- int use_index;
rtx offset;
+ int use_index;
int store_ruid;
+ int real_store_ruid;
int use_ruid;
+ bool all_offsets_match;
} reg_state[FIRST_PSEUDO_REGISTER];
/* Reverse linear uid. This is increased in reload_combine while scanning
@@ -690,42 +710,538 @@ static struct
and the store_ruid / use_ruid fields in reg_state. */
static int reload_combine_ruid;
+/* The RUID of the last label we encountered in reload_combine. */
+static int last_label_ruid;
+
+/* The RUID of the last jump we encountered in reload_combine. */
+static int last_jump_ruid;
+
+/* The register numbers of the first and last index register. A value of
+ -1 in LAST_INDEX_REG indicates that we've previously computed these
+ values and found no suitable index registers. */
+static int first_index_reg = -1;
+static int last_index_reg;
+
#define LABEL_LIVE(LABEL) \
(label_live[CODE_LABEL_NUMBER (LABEL) - min_labelno])
+/* Subroutine of reload_combine_split_ruids, called to fix up a single
+ ruid pointed to by *PRUID if it is higher than SPLIT_RUID. */
+
+static inline void
+reload_combine_split_one_ruid (int *pruid, int split_ruid)
+{
+ if (*pruid > split_ruid)
+ (*pruid)++;
+}
+
+/* Called when we insert a new insn in a position we've already passed in
+ the scan. Examine all our state, increasing all ruids that are higher
+ than SPLIT_RUID by one in order to make room for a new insn. */
+
+static void
+reload_combine_split_ruids (int split_ruid)
+{
+ unsigned i;
+
+ reload_combine_split_one_ruid (&reload_combine_ruid, split_ruid);
+ reload_combine_split_one_ruid (&last_label_ruid, split_ruid);
+ reload_combine_split_one_ruid (&last_jump_ruid, split_ruid);
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j, idx = reg_state[i].use_index;
+ reload_combine_split_one_ruid (&reg_state[i].use_ruid, split_ruid);
+ reload_combine_split_one_ruid (&reg_state[i].store_ruid, split_ruid);
+ reload_combine_split_one_ruid (&reg_state[i].real_store_ruid,
+ split_ruid);
+ if (idx < 0)
+ continue;
+ for (j = idx; j < RELOAD_COMBINE_MAX_USES; j++)
+ {
+ reload_combine_split_one_ruid (&reg_state[i].reg_use[j].ruid,
+ split_ruid);
+ }
+ }
+}
+
+/* Called when we are about to rescan a previously encountered insn with
+ reload_combine_note_use after modifying some part of it. This clears all
+ information about uses in that particular insn. */
+
+static void
+reload_combine_purge_insn_uses (rtx insn)
+{
+ unsigned i;
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j, k, idx = reg_state[i].use_index;
+ if (idx < 0)
+ continue;
+ j = k = RELOAD_COMBINE_MAX_USES;
+ while (j-- > idx)
+ {
+ if (reg_state[i].reg_use[j].insn != insn)
+ {
+ k--;
+ if (k != j)
+ reg_state[i].reg_use[k] = reg_state[i].reg_use[j];
+ }
+ }
+ reg_state[i].use_index = k;
+ }
+}
+
+/* Called when we need to forget about all uses of REGNO after an insn
+ which is identified by RUID. */
+
+static void
+reload_combine_purge_reg_uses_after_ruid (unsigned regno, int ruid)
+{
+ int j, k, idx = reg_state[regno].use_index;
+ if (idx < 0)
+ return;
+ j = k = RELOAD_COMBINE_MAX_USES;
+ while (j-- > idx)
+ {
+ if (reg_state[regno].reg_use[j].ruid >= ruid)
+ {
+ k--;
+ if (k != j)
+ reg_state[regno].reg_use[k] = reg_state[regno].reg_use[j];
+ }
+ }
+ reg_state[regno].use_index = k;
+}
+
+/* Find the use of REGNO with the ruid that is highest among those
+ lower than RUID_LIMIT, and return it if it is the only use of this
+ reg in the insn. Return NULL otherwise. */
+
+static struct reg_use *
+reload_combine_closest_single_use (unsigned regno, int ruid_limit)
+{
+ int i, best_ruid = 0;
+ int use_idx = reg_state[regno].use_index;
+ struct reg_use *retval;
+
+ if (use_idx < 0)
+ return NULL;
+ retval = NULL;
+ for (i = use_idx; i < RELOAD_COMBINE_MAX_USES; i++)
+ {
+ struct reg_use *use = reg_state[regno].reg_use + i;
+ int this_ruid = use->ruid;
+ if (this_ruid >= ruid_limit)
+ continue;
+ if (this_ruid > best_ruid)
+ {
+ best_ruid = this_ruid;
+ retval = use;
+ }
+ else if (this_ruid == best_ruid)
+ retval = NULL;
+ }
+ if (last_label_ruid >= best_ruid)
+ return NULL;
+ return retval;
+}
+
+/* After we've moved an add insn, fix up any debug insns that occur
+ between the old location of the add and the new location. REG is
+ the destination register of the add insn; REPLACEMENT is the
+ SET_SRC of the add. FROM and TO specify the range in which we
+ should make this change on debug insns. */
+
+static void
+fixup_debug_insns (rtx reg, rtx replacement, rtx from, rtx to)
+{
+ rtx insn;
+ for (insn = from; insn != to; insn = NEXT_INSN (insn))
+ {
+ rtx t;
+
+ if (!DEBUG_INSN_P (insn))
+ continue;
+
+ t = INSN_VAR_LOCATION_LOC (insn);
+ t = simplify_replace_rtx (t, reg, replacement);
+ validate_change (insn, &INSN_VAR_LOCATION_LOC (insn), t, 0);
+ }
+}
+
+/* Called by reload_combine when scanning INSN. This function tries to detect
+ patterns where a constant is added to a register, and the result is used
+ in an address.
+ Return true if no further processing is needed on INSN; false if it wasn't
+ recognized and should be handled normally. */
+
+static bool
+reload_combine_recognize_const_pattern (rtx insn)
+{
+ int from_ruid = reload_combine_ruid;
+ rtx set, pat, reg, src, addreg;
+ unsigned int regno;
+ struct reg_use *use;
+ bool must_move_add;
+ rtx add_moved_after_insn = NULL_RTX;
+ int add_moved_after_ruid = 0;
+ int clobbered_regno = -1;
+
+ set = single_set (insn);
+ if (set == NULL_RTX)
+ return false;
+
+ reg = SET_DEST (set);
+ src = SET_SRC (set);
+ if (!REG_P (reg)
+ || hard_regno_nregs[REGNO (reg)][GET_MODE (reg)] != 1
+ || GET_MODE (reg) != Pmode
+ || reg == stack_pointer_rtx)
+ return false;
+
+ regno = REGNO (reg);
+
+ /* We look for a REG1 = REG2 + CONSTANT insn, followed by either
+ uses of REG1 inside an address, or inside another add insn. If
+ possible and profitable, merge the addition into subsequent
+ uses. */
+ if (GET_CODE (src) != PLUS
+ || !REG_P (XEXP (src, 0))
+ || !CONSTANT_P (XEXP (src, 1)))
+ return false;
+
+ addreg = XEXP (src, 0);
+ must_move_add = rtx_equal_p (reg, addreg);
+
+ pat = PATTERN (insn);
+ if (must_move_add && set != pat)
+ {
+ /* We have to be careful when moving the add; apart from the
+ single_set there may also be clobbers. Recognize one special
+ case, that of one clobber alongside the set (likely a clobber
+ of the CC register). */
+ gcc_assert (GET_CODE (PATTERN (insn)) == PARALLEL);
+ if (XVECLEN (pat, 0) != 2 || XVECEXP (pat, 0, 0) != set
+ || GET_CODE (XVECEXP (pat, 0, 1)) != CLOBBER
+ || !REG_P (XEXP (XVECEXP (pat, 0, 1), 0)))
+ return false;
+ clobbered_regno = REGNO (XEXP (XVECEXP (pat, 0, 1), 0));
+ }
+
+ do
+ {
+ use = reload_combine_closest_single_use (regno, from_ruid);
+
+ if (use)
+ /* Start the search for the next use from here. */
+ from_ruid = use->ruid;
+
+ if (use && GET_MODE (*use->usep) == Pmode)
+ {
+ rtx use_insn = use->insn;
+ int use_ruid = use->ruid;
+ rtx mem = use->containing_mem;
+ bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (use_insn));
+
+ /* Avoid moving the add insn past a jump. */
+ if (must_move_add && use_ruid <= last_jump_ruid)
+ break;
+
+ /* If the add clobbers another hard reg in parallel, don't move
+ it past a real set of this hard reg. */
+ if (must_move_add && clobbered_regno >= 0
+ && reg_state[clobbered_regno].real_store_ruid >= use_ruid)
+ break;
+
+ /* Avoid moving a use of ADDREG past a point where it
+ is stored. */
+ if (reg_state[REGNO (addreg)].store_ruid >= use_ruid)
+ break;
+
+ if (mem != NULL_RTX)
+ {
+ addr_space_t as = MEM_ADDR_SPACE (mem);
+ rtx oldaddr = XEXP (mem, 0);
+ rtx newaddr = NULL_RTX;
+ int old_cost = address_cost (oldaddr, GET_MODE (mem), as, speed);
+ int new_cost;
+
+ newaddr = simplify_replace_rtx (oldaddr, reg, src);
+ if (memory_address_addr_space_p (GET_MODE (mem), newaddr, as))
+ {
+ XEXP (mem, 0) = newaddr;
+ new_cost = address_cost (newaddr, GET_MODE (mem), as, speed);
+ XEXP (mem, 0) = oldaddr;
+ if (new_cost <= old_cost
+ && validate_change (use_insn,
+ &XEXP (mem, 0), newaddr, 0))
+ {
+ reload_combine_purge_insn_uses (use_insn);
+ reload_combine_note_use (&PATTERN (use_insn), use_insn,
+ use_ruid, NULL_RTX);
+
+ if (must_move_add)
+ {
+ add_moved_after_insn = use_insn;
+ add_moved_after_ruid = use_ruid;
+ }
+ continue;
+ }
+ }
+ }
+ else
+ {
+ rtx new_set = single_set (use_insn);
+ if (new_set
+ && REG_P (SET_DEST (new_set))
+ && GET_CODE (SET_SRC (new_set)) == PLUS
+ && REG_P (XEXP (SET_SRC (new_set), 0))
+ && CONSTANT_P (XEXP (SET_SRC (new_set), 1)))
+ {
+ rtx new_src;
+ int old_cost = rtx_cost (SET_SRC (new_set), SET, speed);
+
+ gcc_assert (rtx_equal_p (XEXP (SET_SRC (new_set), 0), reg));
+ new_src = simplify_replace_rtx (SET_SRC (new_set), reg, src);
+
+ if (rtx_cost (new_src, SET, speed) <= old_cost
+ && validate_change (use_insn, &SET_SRC (new_set),
+ new_src, 0))
+ {
+ reload_combine_purge_insn_uses (use_insn);
+ reload_combine_note_use (&SET_SRC (new_set), use_insn,
+ use_ruid, NULL_RTX);
+
+ if (must_move_add)
+ {
+ /* See if that took care of the add insn. */
+ if (rtx_equal_p (SET_DEST (new_set), reg))
+ {
+ fixup_debug_insns (reg, src, insn, use_insn);
+ delete_insn (insn);
+ return true;
+ }
+ else
+ {
+ add_moved_after_insn = use_insn;
+ add_moved_after_ruid = use_ruid;
+ }
+ }
+ continue;
+ }
+ }
+ }
+ /* If we get here, we couldn't handle this use. */
+ if (must_move_add)
+ break;
+ }
+ }
+ while (use);
+
+ if (!must_move_add || add_moved_after_insn == NULL_RTX)
+ /* Process the add normally. */
+ return false;
+
+ fixup_debug_insns (reg, src, insn, add_moved_after_insn);
+
+ reorder_insns (insn, insn, add_moved_after_insn);
+ reload_combine_purge_reg_uses_after_ruid (regno, add_moved_after_ruid);
+ reload_combine_split_ruids (add_moved_after_ruid - 1);
+ reload_combine_note_use (&PATTERN (insn), insn,
+ add_moved_after_ruid, NULL_RTX);
+ reg_state[regno].store_ruid = add_moved_after_ruid;
+
+ return true;
+}
+
+/* Called by reload_combine when scanning INSN. Try to detect a pattern we
+ can handle and improve. Return true if no further processing is needed on
+ INSN; false if it wasn't recognized and should be handled normally. */
+
+static bool
+reload_combine_recognize_pattern (rtx insn)
+{
+ rtx set, reg, src;
+ unsigned int regno;
+
+ set = single_set (insn);
+ if (set == NULL_RTX)
+ return false;
+
+ reg = SET_DEST (set);
+ src = SET_SRC (set);
+ if (!REG_P (reg)
+ || hard_regno_nregs[REGNO (reg)][GET_MODE (reg)] != 1)
+ return false;
+
+ regno = REGNO (reg);
+
+ /* Look for (set (REGX) (CONST_INT))
+ (set (REGX) (PLUS (REGX) (REGY)))
+ ...
+ ... (MEM (REGX)) ...
+ and convert it to
+ (set (REGZ) (CONST_INT))
+ ...
+ ... (MEM (PLUS (REGZ) (REGY)))... .
+
+ First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
+ and that we know all uses of REGX before it dies.
+ Also, explicitly check that REGX != REGY; our life information
+ does not yet show whether REGY changes in this insn. */
+
+ if (GET_CODE (src) == PLUS
+ && reg_state[regno].all_offsets_match
+ && last_index_reg != -1
+ && REG_P (XEXP (src, 1))
+ && rtx_equal_p (XEXP (src, 0), reg)
+ && !rtx_equal_p (XEXP (src, 1), reg)
+ && reg_state[regno].use_index >= 0
+ && reg_state[regno].use_index < RELOAD_COMBINE_MAX_USES
+ && last_label_ruid < reg_state[regno].use_ruid)
+ {
+ rtx base = XEXP (src, 1);
+ rtx prev = prev_nonnote_insn (insn);
+ rtx prev_set = prev ? single_set (prev) : NULL_RTX;
+ rtx index_reg = NULL_RTX;
+ rtx reg_sum = NULL_RTX;
+ int i;
+
+ /* Now we need to set INDEX_REG to an index register (denoted as
+ REGZ in the illustration above) and REG_SUM to the expression
+ register+register that we want to use to substitute uses of REG
+ (typically in MEMs) with. First check REG and BASE for being
+ index registers; we can use them even if they are not dead. */
+ if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], regno)
+ || TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
+ REGNO (base)))
+ {
+ index_reg = reg;
+ reg_sum = src;
+ }
+ else
+ {
+ /* Otherwise, look for a free index register. Since we have
+ checked above that neither REG nor BASE are index registers,
+ if we find anything at all, it will be different from these
+ two registers. */
+ for (i = first_index_reg; i <= last_index_reg; i++)
+ {
+ if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], i)
+ && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES
+ && reg_state[i].store_ruid <= reg_state[regno].use_ruid
+ && (call_used_regs[i] || df_regs_ever_live_p (i))
+ && (!frame_pointer_needed || i != HARD_FRAME_POINTER_REGNUM)
+ && !fixed_regs[i] && !global_regs[i]
+ && hard_regno_nregs[i][GET_MODE (reg)] == 1
+ && targetm.hard_regno_scratch_ok (i))
+ {
+ index_reg = gen_rtx_REG (GET_MODE (reg), i);
+ reg_sum = gen_rtx_PLUS (GET_MODE (reg), index_reg, base);
+ break;
+ }
+ }
+ }
+
+ /* Check that PREV_SET is indeed (set (REGX) (CONST_INT)) and that
+ (REGY), i.e. BASE, is not clobbered before the last use we'll
+ create. */
+ if (reg_sum
+ && prev_set
+ && CONST_INT_P (SET_SRC (prev_set))
+ && rtx_equal_p (SET_DEST (prev_set), reg)
+ && (reg_state[REGNO (base)].store_ruid
+ <= reg_state[regno].use_ruid))
+ {
+ /* Change destination register and, if necessary, the constant
+ value in PREV, the constant loading instruction. */
+ validate_change (prev, &SET_DEST (prev_set), index_reg, 1);
+ if (reg_state[regno].offset != const0_rtx)
+ validate_change (prev,
+ &SET_SRC (prev_set),
+ GEN_INT (INTVAL (SET_SRC (prev_set))
+ + INTVAL (reg_state[regno].offset)),
+ 1);
+
+ /* Now for every use of REG that we have recorded, replace REG
+ with REG_SUM. */
+ for (i = reg_state[regno].use_index;
+ i < RELOAD_COMBINE_MAX_USES; i++)
+ validate_unshare_change (reg_state[regno].reg_use[i].insn,
+ reg_state[regno].reg_use[i].usep,
+ /* Each change must have its own
+ replacement. */
+ reg_sum, 1);
+
+ if (apply_change_group ())
+ {
+ struct reg_use *lowest_ruid = NULL;
+
+ /* For every new use of REG_SUM, we have to record the use
+ of BASE therein, i.e. operand 1. */
+ for (i = reg_state[regno].use_index;
+ i < RELOAD_COMBINE_MAX_USES; i++)
+ {
+ struct reg_use *use = reg_state[regno].reg_use + i;
+ reload_combine_note_use (&XEXP (*use->usep, 1), use->insn,
+ use->ruid, use->containing_mem);
+ if (lowest_ruid == NULL || use->ruid < lowest_ruid->ruid)
+ lowest_ruid = use;
+ }
+
+ fixup_debug_insns (reg, reg_sum, insn, lowest_ruid->insn);
+
+ /* Delete the reg-reg addition. */
+ delete_insn (insn);
+
+ if (reg_state[regno].offset != const0_rtx)
+ /* Previous REG_EQUIV / REG_EQUAL notes for PREV
+ are now invalid. */
+ remove_reg_equal_equiv_notes (prev);
+
+ reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
static void
reload_combine (void)
{
- rtx insn, set;
- int first_index_reg = -1;
- int last_index_reg = 0;
+ rtx insn, prev;
int i;
basic_block bb;
unsigned int r;
- int last_label_ruid;
int min_labelno, n_labels;
HARD_REG_SET ever_live_at_start, *label_live;
- /* If reg+reg can be used in offsetable memory addresses, the main chunk of
- reload has already used it where appropriate, so there is no use in
- trying to generate it now. */
- if (double_reg_address_ok && INDEX_REG_CLASS != NO_REGS)
- return;
-
/* To avoid wasting too much time later searching for an index register,
determine the minimum and maximum index register numbers. */
- for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
- if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], r))
- {
- if (first_index_reg == -1)
- first_index_reg = r;
+ if (INDEX_REG_CLASS == NO_REGS)
+ last_index_reg = -1;
+ else if (first_index_reg == -1 && last_index_reg == 0)
+ {
+ for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
+ if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], r))
+ {
+ if (first_index_reg == -1)
+ first_index_reg = r;
- last_index_reg = r;
- }
+ last_index_reg = r;
+ }
- /* If no index register is available, we can quit now. */
- if (first_index_reg == -1)
- return;
+ /* If no index register is available, we can quit now. Set LAST_INDEX_REG
+ to -1 so we'll know to quit early the next time we get here. */
+ if (first_index_reg == -1)
+ {
+ last_index_reg = -1;
+ return;
+ }
+ }
/* Set up LABEL_LIVE and EVER_LIVE_AT_START. The register lifetime
information is a bit fuzzy immediately after reload, but it's
@@ -752,20 +1268,23 @@ reload_combine (void)
}
/* Initialize last_label_ruid, reload_combine_ruid and reg_state. */
- last_label_ruid = reload_combine_ruid = 0;
+ last_label_ruid = last_jump_ruid = reload_combine_ruid = 0;
for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
{
- reg_state[r].store_ruid = reload_combine_ruid;
+ reg_state[r].store_ruid = 0;
+ reg_state[r].real_store_ruid = 0;
if (fixed_regs[r])
reg_state[r].use_index = -1;
else
reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;
}
- for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
+ for (insn = get_last_insn (); insn; insn = prev)
{
rtx note;
+ prev = PREV_INSN (insn);
+
/* We cannot do our optimization across labels. Invalidating all the use
information we have would be costly, so we just note where the label
is and then later disable any optimization that would cross it. */
@@ -776,141 +1295,17 @@ reload_combine (void)
if (! fixed_regs[r])
reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;
- if (! INSN_P (insn))
+ if (! NONDEBUG_INSN_P (insn))
continue;
reload_combine_ruid++;
- /* Look for (set (REGX) (CONST_INT))
- (set (REGX) (PLUS (REGX) (REGY)))
- ...
- ... (MEM (REGX)) ...
- and convert it to
- (set (REGZ) (CONST_INT))
- ...
- ... (MEM (PLUS (REGZ) (REGY)))... .
-
- First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
- and that we know all uses of REGX before it dies.
- Also, explicitly check that REGX != REGY; our life information
- does not yet show whether REGY changes in this insn. */
- set = single_set (insn);
- if (set != NULL_RTX
- && REG_P (SET_DEST (set))
- && (hard_regno_nregs[REGNO (SET_DEST (set))]
- [GET_MODE (SET_DEST (set))]
- == 1)
- && GET_CODE (SET_SRC (set)) == PLUS
- && REG_P (XEXP (SET_SRC (set), 1))
- && rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set))
- && !rtx_equal_p (XEXP (SET_SRC (set), 1), SET_DEST (set))
- && last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid)
- {
- rtx reg = SET_DEST (set);
- rtx plus = SET_SRC (set);
- rtx base = XEXP (plus, 1);
- rtx prev = prev_nonnote_insn (insn);
- rtx prev_set = prev ? single_set (prev) : NULL_RTX;
- unsigned int regno = REGNO (reg);
- rtx index_reg = NULL_RTX;
- rtx reg_sum = NULL_RTX;
-
- /* Now we need to set INDEX_REG to an index register (denoted as
- REGZ in the illustration above) and REG_SUM to the expression
- register+register that we want to use to substitute uses of REG
- (typically in MEMs) with. First check REG and BASE for being
- index registers; we can use them even if they are not dead. */
- if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], regno)
- || TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
- REGNO (base)))
- {
- index_reg = reg;
- reg_sum = plus;
- }
- else
- {
- /* Otherwise, look for a free index register. Since we have
- checked above that neither REG nor BASE are index registers,
- if we find anything at all, it will be different from these
- two registers. */
- for (i = first_index_reg; i <= last_index_reg; i++)
- {
- if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
- i)
- && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES
- && reg_state[i].store_ruid <= reg_state[regno].use_ruid
- && hard_regno_nregs[i][GET_MODE (reg)] == 1)
- {
- index_reg = gen_rtx_REG (GET_MODE (reg), i);
- reg_sum = gen_rtx_PLUS (GET_MODE (reg), index_reg, base);
- break;
- }
- }
- }
-
- /* Check that PREV_SET is indeed (set (REGX) (CONST_INT)) and that
- (REGY), i.e. BASE, is not clobbered before the last use we'll
- create. */
- if (reg_sum
- && prev_set
- && CONST_INT_P (SET_SRC (prev_set))
- && rtx_equal_p (SET_DEST (prev_set), reg)
- && reg_state[regno].use_index >= 0
- && (reg_state[REGNO (base)].store_ruid
- <= reg_state[regno].use_ruid))
- {
- int i;
-
- /* Change destination register and, if necessary, the constant
- value in PREV, the constant loading instruction. */
- validate_change (prev, &SET_DEST (prev_set), index_reg, 1);
- if (reg_state[regno].offset != const0_rtx)
- validate_change (prev,
- &SET_SRC (prev_set),
- GEN_INT (INTVAL (SET_SRC (prev_set))
- + INTVAL (reg_state[regno].offset)),
- 1);
-
- /* Now for every use of REG that we have recorded, replace REG
- with REG_SUM. */
- for (i = reg_state[regno].use_index;
- i < RELOAD_COMBINE_MAX_USES; i++)
- validate_unshare_change (reg_state[regno].reg_use[i].insn,
- reg_state[regno].reg_use[i].usep,
- /* Each change must have its own
- replacement. */
- reg_sum, 1);
+ if (control_flow_insn_p (insn))
+ last_jump_ruid = reload_combine_ruid;
- if (apply_change_group ())
- {
- /* For every new use of REG_SUM, we have to record the use
- of BASE therein, i.e. operand 1. */
- for (i = reg_state[regno].use_index;
- i < RELOAD_COMBINE_MAX_USES; i++)
- reload_combine_note_use
- (&XEXP (*reg_state[regno].reg_use[i].usep, 1),
- reg_state[regno].reg_use[i].insn);
-
- if (reg_state[REGNO (base)].use_ruid
- > reg_state[regno].use_ruid)
- reg_state[REGNO (base)].use_ruid
- = reg_state[regno].use_ruid;
-
- /* Delete the reg-reg addition. */
- delete_insn (insn);
-
- if (reg_state[regno].offset != const0_rtx)
- /* Previous REG_EQUIV / REG_EQUAL notes for PREV
- are now invalid. */
- remove_reg_equal_equiv_notes (prev);
-
- reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES;
- reg_state[REGNO (index_reg)].store_ruid
- = reload_combine_ruid;
- continue;
- }
- }
- }
+ if (reload_combine_recognize_const_pattern (insn)
+ || reload_combine_recognize_pattern (insn))
+ continue;
note_stores (PATTERN (insn), reload_combine_note_store, NULL);
@@ -966,7 +1361,8 @@ reload_combine (void)
reg_state[i].use_index = -1;
}
- reload_combine_note_use (&PATTERN (insn), insn);
+ reload_combine_note_use (&PATTERN (insn), insn,
+ reload_combine_ruid, NULL_RTX);
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
{
if (REG_NOTE_KIND (note) == REG_INC
@@ -975,6 +1371,7 @@ reload_combine (void)
int regno = REGNO (XEXP (note, 0));
reg_state[regno].store_ruid = reload_combine_ruid;
+ reg_state[regno].real_store_ruid = reload_combine_ruid;
reg_state[regno].use_index = -1;
}
}
@@ -984,8 +1381,8 @@ reload_combine (void)
}
/* Check if DST is a register or a subreg of a register; if it is,
- update reg_state[regno].store_ruid and reg_state[regno].use_index
- accordingly. Called via note_stores from reload_combine. */
+ update store_ruid, real_store_ruid and use_index in the reg_state
+ structure accordingly. Called via note_stores from reload_combine. */
static void
reload_combine_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
@@ -1009,14 +1406,14 @@ reload_combine_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
/* note_stores might have stripped a STRICT_LOW_PART, so we have to be
careful with registers / register parts that are not full words.
Similarly for ZERO_EXTRACT. */
- if (GET_CODE (set) != SET
- || GET_CODE (SET_DEST (set)) == ZERO_EXTRACT
+ if (GET_CODE (SET_DEST (set)) == ZERO_EXTRACT
|| GET_CODE (SET_DEST (set)) == STRICT_LOW_PART)
{
for (i = hard_regno_nregs[regno][mode] - 1 + regno; i >= regno; i--)
{
reg_state[i].use_index = -1;
reg_state[i].store_ruid = reload_combine_ruid;
+ reg_state[i].real_store_ruid = reload_combine_ruid;
}
}
else
@@ -1024,6 +1421,8 @@ reload_combine_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
for (i = hard_regno_nregs[regno][mode] - 1 + regno; i >= regno; i--)
{
reg_state[i].store_ruid = reload_combine_ruid;
+ if (GET_CODE (set) == SET)
+ reg_state[i].real_store_ruid = reload_combine_ruid;
reg_state[i].use_index = RELOAD_COMBINE_MAX_USES;
}
}
@@ -1034,7 +1433,7 @@ reload_combine_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
*XP is the pattern of INSN, or a part of it.
Called from reload_combine, and recursively by itself. */
static void
-reload_combine_note_use (rtx *xp, rtx insn)
+reload_combine_note_use (rtx *xp, rtx insn, int ruid, rtx containing_mem)
{
rtx x = *xp;
enum rtx_code code = x->code;
@@ -1047,7 +1446,7 @@ reload_combine_note_use (rtx *xp, rtx insn)
case SET:
if (REG_P (SET_DEST (x)))
{
- reload_combine_note_use (&SET_SRC (x), insn);
+ reload_combine_note_use (&SET_SRC (x), insn, ruid, NULL_RTX);
return;
}
break;
@@ -1103,6 +1502,11 @@ reload_combine_note_use (rtx *xp, rtx insn)
return;
}
+ /* We may be called to update uses in previously seen insns.
+ Don't add uses beyond the last store we saw. */
+ if (ruid < reg_state[regno].store_ruid)
+ return;
+
/* If this register is already used in some unknown fashion, we
can't do anything.
If we decrement the index from zero to -1, we can't store more
@@ -1111,29 +1515,34 @@ reload_combine_note_use (rtx *xp, rtx insn)
if (use_index < 0)
return;
- if (use_index != RELOAD_COMBINE_MAX_USES - 1)
- {
- /* We have found another use for a register that is already
- used later. Check if the offsets match; if not, mark the
- register as used in an unknown fashion. */
- if (! rtx_equal_p (offset, reg_state[regno].offset))
- {
- reg_state[regno].use_index = -1;
- return;
- }
- }
- else
+ if (use_index == RELOAD_COMBINE_MAX_USES - 1)
{
/* This is the first use of this register we have seen since we
marked it as dead. */
reg_state[regno].offset = offset;
- reg_state[regno].use_ruid = reload_combine_ruid;
+ reg_state[regno].all_offsets_match = true;
+ reg_state[regno].use_ruid = ruid;
}
+ else
+ {
+ if (reg_state[regno].use_ruid > ruid)
+ reg_state[regno].use_ruid = ruid;
+
+ if (! rtx_equal_p (offset, reg_state[regno].offset))
+ reg_state[regno].all_offsets_match = false;
+ }
+
reg_state[regno].reg_use[use_index].insn = insn;
+ reg_state[regno].reg_use[use_index].ruid = ruid;
+ reg_state[regno].reg_use[use_index].containing_mem = containing_mem;
reg_state[regno].reg_use[use_index].usep = xp;
return;
}
+ case MEM:
+ containing_mem = x;
+ break;
+
default:
break;
}
@@ -1143,11 +1552,12 @@ reload_combine_note_use (rtx *xp, rtx insn)
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
- reload_combine_note_use (&XEXP (x, i), insn);
+ reload_combine_note_use (&XEXP (x, i), insn, ruid, containing_mem);
else if (fmt[i] == 'E')
{
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- reload_combine_note_use (&XVECEXP (x, i, j), insn);
+ reload_combine_note_use (&XVECEXP (x, i, j), insn, ruid,
+ containing_mem);
}
}
}
@@ -1159,17 +1569,19 @@ reload_combine_note_use (rtx *xp, rtx insn)
information about register contents we have would be costly, so we
use move2add_last_label_luid to note where the label is and then
later disable any optimization that would cross it.
- reg_offset[n] / reg_base_reg[n] / reg_mode[n] are only valid if
- reg_set_luid[n] is greater than move2add_last_label_luid. */
+ reg_offset[n] / reg_base_reg[n] / reg_symbol_ref[n] / reg_mode[n]
+ are only valid if reg_set_luid[n] is greater than
+ move2add_last_label_luid. */
static int reg_set_luid[FIRST_PSEUDO_REGISTER];
/* If reg_base_reg[n] is negative, register n has been set to
- reg_offset[n] in mode reg_mode[n] .
+ reg_offset[n] or reg_symbol_ref[n] + reg_offset[n] in mode reg_mode[n].
If reg_base_reg[n] is non-negative, register n has been set to the
sum of reg_offset[n] and the value of register reg_base_reg[n]
before reg_set_luid[n], calculated in mode reg_mode[n] . */
static HOST_WIDE_INT reg_offset[FIRST_PSEUDO_REGISTER];
static int reg_base_reg[FIRST_PSEUDO_REGISTER];
+static rtx reg_symbol_ref[FIRST_PSEUDO_REGISTER];
static enum machine_mode reg_mode[FIRST_PSEUDO_REGISTER];
/* move2add_luid is linearly increased while scanning the instructions
@@ -1189,14 +1601,176 @@ static int move2add_last_label_luid;
&& TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (OUTMODE), \
GET_MODE_BITSIZE (INMODE))))
-static void
+/* This function is called with INSN that sets REG to (SYM + OFF),
+ while REG is known to already have value (SYM + offset).
+ This function tries to change INSN into an add instruction
+ (set (REG) (plus (REG) (OFF - offset))) using the known value.
+ It also updates the information about REG's known value.
+ Return true if we made a change. */
+
+static bool
+move2add_use_add2_insn (rtx reg, rtx sym, rtx off, rtx insn)
+{
+ rtx pat = PATTERN (insn);
+ rtx src = SET_SRC (pat);
+ int regno = REGNO (reg);
+ rtx new_src = gen_int_mode (INTVAL (off) - reg_offset[regno],
+ GET_MODE (reg));
+ bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
+ bool changed = false;
+
+ /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
+ use (set (reg) (reg)) instead.
+ We don't delete this insn, nor do we convert it into a
+ note, to avoid losing register notes or the return
+ value flag. jump2 already knows how to get rid of
+ no-op moves. */
+ if (new_src == const0_rtx)
+ {
+ /* If the constants are different, this is a
+ truncation, that, if turned into (set (reg)
+ (reg)), would be discarded. Maybe we should
+ try a truncMN pattern? */
+ if (INTVAL (off) == reg_offset [regno])
+ changed = validate_change (insn, &SET_SRC (pat), reg, 0);
+ }
+ else if (rtx_cost (new_src, PLUS, speed) < rtx_cost (src, SET, speed)
+ && have_add2_insn (reg, new_src))
+ {
+ rtx tem = gen_rtx_PLUS (GET_MODE (reg), reg, new_src);
+ changed = validate_change (insn, &SET_SRC (pat), tem, 0);
+ }
+ else if (sym == NULL_RTX && GET_MODE (reg) != BImode)
+ {
+ enum machine_mode narrow_mode;
+ for (narrow_mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
+ narrow_mode != VOIDmode
+ && narrow_mode != GET_MODE (reg);
+ narrow_mode = GET_MODE_WIDER_MODE (narrow_mode))
+ {
+ if (have_insn_for (STRICT_LOW_PART, narrow_mode)
+ && ((reg_offset[regno]
+ & ~GET_MODE_MASK (narrow_mode))
+ == (INTVAL (off)
+ & ~GET_MODE_MASK (narrow_mode))))
+ {
+ rtx narrow_reg = gen_rtx_REG (narrow_mode,
+ REGNO (reg));
+ rtx narrow_src = gen_int_mode (INTVAL (off),
+ narrow_mode);
+ rtx new_set =
+ gen_rtx_SET (VOIDmode,
+ gen_rtx_STRICT_LOW_PART (VOIDmode,
+ narrow_reg),
+ narrow_src);
+ changed = validate_change (insn, &PATTERN (insn),
+ new_set, 0);
+ if (changed)
+ break;
+ }
+ }
+ }
+ reg_set_luid[regno] = move2add_luid;
+ reg_base_reg[regno] = -1;
+ reg_mode[regno] = GET_MODE (reg);
+ reg_symbol_ref[regno] = sym;
+ reg_offset[regno] = INTVAL (off);
+ return changed;
+}
+
+
+/* This function is called with INSN that sets REG to (SYM + OFF),
+ but REG doesn't have known value (SYM + offset). This function
+ tries to find another register which is known to already have
+ value (SYM + offset) and change INSN into an add instruction
+ (set (REG) (plus (the found register) (OFF - offset))) if such
+ a register is found. It also updates the information about
+ REG's known value.
+ Return true iff we made a change. */
+
+static bool
+move2add_use_add3_insn (rtx reg, rtx sym, rtx off, rtx insn)
+{
+ rtx pat = PATTERN (insn);
+ rtx src = SET_SRC (pat);
+ int regno = REGNO (reg);
+ int min_cost = INT_MAX;
+ int min_regno = 0;
+ bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
+ int i;
+ bool changed = false;
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (reg_set_luid[i] > move2add_last_label_luid
+ && reg_mode[i] == GET_MODE (reg)
+ && reg_base_reg[i] < 0
+ && reg_symbol_ref[i] != NULL_RTX
+ && rtx_equal_p (sym, reg_symbol_ref[i]))
+ {
+ rtx new_src = gen_int_mode (INTVAL (off) - reg_offset[i],
+ GET_MODE (reg));
+ /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
+ use (set (reg) (reg)) instead.
+ We don't delete this insn, nor do we convert it into a
+ note, to avoid losing register notes or the return
+ value flag. jump2 already knows how to get rid of
+ no-op moves. */
+ if (new_src == const0_rtx)
+ {
+ min_cost = 0;
+ min_regno = i;
+ break;
+ }
+ else
+ {
+ int cost = rtx_cost (new_src, PLUS, speed);
+ if (cost < min_cost)
+ {
+ min_cost = cost;
+ min_regno = i;
+ }
+ }
+ }
+
+ if (min_cost < rtx_cost (src, SET, speed))
+ {
+ rtx tem;
+
+ tem = gen_rtx_REG (GET_MODE (reg), min_regno);
+ if (i != min_regno)
+ {
+ rtx new_src = gen_int_mode (INTVAL (off) - reg_offset[min_regno],
+ GET_MODE (reg));
+ tem = gen_rtx_PLUS (GET_MODE (reg), tem, new_src);
+ }
+ if (validate_change (insn, &SET_SRC (pat), tem, 0))
+ changed = true;
+ }
+ reg_set_luid[regno] = move2add_luid;
+ reg_base_reg[regno] = -1;
+ reg_mode[regno] = GET_MODE (reg);
+ reg_symbol_ref[regno] = sym;
+ reg_offset[regno] = INTVAL (off);
+ return changed;
+}
+
+/* Convert move insns with constant inputs to additions if they are cheaper.
+ Return true if any changes were made. */
+static bool
reload_cse_move2add (rtx first)
{
int i;
rtx insn;
+ bool changed = false;
for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
- reg_set_luid[i] = 0;
+ {
+ reg_set_luid[i] = 0;
+ reg_offset[i] = 0;
+ reg_base_reg[i] = 0;
+ reg_symbol_ref[i] = NULL_RTX;
+ reg_mode[i] = VOIDmode;
+ }
move2add_last_label_luid = 0;
move2add_luid = 2;
@@ -1244,65 +1818,11 @@ reload_cse_move2add (rtx first)
(set (STRICT_LOW_PART (REGX)) (CONST_INT B))
*/
- if (CONST_INT_P (src) && reg_base_reg[regno] < 0)
+ if (CONST_INT_P (src)
+ && reg_base_reg[regno] < 0
+ && reg_symbol_ref[regno] == NULL_RTX)
{
- rtx new_src = gen_int_mode (INTVAL (src) - reg_offset[regno],
- GET_MODE (reg));
- bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
-
- /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
- use (set (reg) (reg)) instead.
- We don't delete this insn, nor do we convert it into a
- note, to avoid losing register notes or the return
- value flag. jump2 already knows how to get rid of
- no-op moves. */
- if (new_src == const0_rtx)
- {
- /* If the constants are different, this is a
- truncation, that, if turned into (set (reg)
- (reg)), would be discarded. Maybe we should
- try a truncMN pattern? */
- if (INTVAL (src) == reg_offset [regno])
- validate_change (insn, &SET_SRC (pat), reg, 0);
- }
- else if (rtx_cost (new_src, PLUS, speed) < rtx_cost (src, SET, speed)
- && have_add2_insn (reg, new_src))
- {
- rtx tem = gen_rtx_PLUS (GET_MODE (reg), reg, new_src);
- validate_change (insn, &SET_SRC (pat), tem, 0);
- }
- else if (GET_MODE (reg) != BImode)
- {
- enum machine_mode narrow_mode;
- for (narrow_mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
- narrow_mode != VOIDmode
- && narrow_mode != GET_MODE (reg);
- narrow_mode = GET_MODE_WIDER_MODE (narrow_mode))
- {
- if (have_insn_for (STRICT_LOW_PART, narrow_mode)
- && ((reg_offset[regno]
- & ~GET_MODE_MASK (narrow_mode))
- == (INTVAL (src)
- & ~GET_MODE_MASK (narrow_mode))))
- {
- rtx narrow_reg = gen_rtx_REG (narrow_mode,
- REGNO (reg));
- rtx narrow_src = gen_int_mode (INTVAL (src),
- narrow_mode);
- rtx new_set =
- gen_rtx_SET (VOIDmode,
- gen_rtx_STRICT_LOW_PART (VOIDmode,
- narrow_reg),
- narrow_src);
- if (validate_change (insn, &PATTERN (insn),
- new_set, 0))
- break;
- }
- }
- }
- reg_set_luid[regno] = move2add_luid;
- reg_mode[regno] = GET_MODE (reg);
- reg_offset[regno] = INTVAL (src);
+ changed |= move2add_use_add2_insn (reg, NULL_RTX, src, insn);
continue;
}
@@ -1363,6 +1883,7 @@ reload_cse_move2add (rtx first)
}
if (success)
delete_insn (insn);
+ changed |= success;
insn = next;
reg_mode[regno] = GET_MODE (reg);
reg_offset[regno] =
@@ -1372,6 +1893,51 @@ reload_cse_move2add (rtx first)
}
}
}
+
+ /* Try to transform
+ (set (REGX) (CONST (PLUS (SYMBOL_REF) (CONST_INT A))))
+ ...
+ (set (REGY) (CONST (PLUS (SYMBOL_REF) (CONST_INT B))))
+ to
+ (set (REGX) (CONST (PLUS (SYMBOL_REF) (CONST_INT A))))
+ ...
+ (set (REGY) (CONST (PLUS (REGX) (CONST_INT B-A)))) */
+ if ((GET_CODE (src) == SYMBOL_REF
+ || (GET_CODE (src) == CONST
+ && GET_CODE (XEXP (src, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (src, 0), 0)) == SYMBOL_REF
+ && CONST_INT_P (XEXP (XEXP (src, 0), 1))))
+ && dbg_cnt (cse2_move2add))
+ {
+ rtx sym, off;
+
+ if (GET_CODE (src) == SYMBOL_REF)
+ {
+ sym = src;
+ off = const0_rtx;
+ }
+ else
+ {
+ sym = XEXP (XEXP (src, 0), 0);
+ off = XEXP (XEXP (src, 0), 1);
+ }
+
+ /* If the reg already contains the value which is sum of
+ sym and some constant value, we can use an add2 insn. */
+ if (reg_set_luid[regno] > move2add_last_label_luid
+ && MODES_OK_FOR_MOVE2ADD (GET_MODE (reg), reg_mode[regno])
+ && reg_base_reg[regno] < 0
+ && reg_symbol_ref[regno] != NULL_RTX
+ && rtx_equal_p (sym, reg_symbol_ref[regno]))
+ changed |= move2add_use_add2_insn (reg, sym, off, insn);
+
+ /* Otherwise, we have to find a register whose value is sum
+ of sym and some constant value. */
+ else
+ changed |= move2add_use_add3_insn (reg, sym, off, insn);
+
+ continue;
+ }
}
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
@@ -1385,7 +1951,7 @@ reload_cse_move2add (rtx first)
reg_set_luid[regno] = 0;
}
}
- note_stores (PATTERN (insn), move2add_note_store, NULL);
+ note_stores (PATTERN (insn), move2add_note_store, insn);
/* If INSN is a conditional branch, we try to extract an
implicit set out of it. */
@@ -1407,7 +1973,7 @@ reload_cse_move2add (rtx first)
{
rtx implicit_set =
gen_rtx_SET (VOIDmode, XEXP (cnd, 0), XEXP (cnd, 1));
- move2add_note_store (SET_DEST (implicit_set), implicit_set, 0);
+ move2add_note_store (SET_DEST (implicit_set), implicit_set, insn);
}
}
@@ -1423,15 +1989,18 @@ reload_cse_move2add (rtx first)
}
}
}
+ return changed;
}
-/* SET is a SET or CLOBBER that sets DST.
+/* SET is a SET or CLOBBER that sets DST. DATA is the insn which
+ contains SET.
Update reg_set_luid, reg_offset and reg_base_reg accordingly.
Called from reload_cse_move2add via note_stores. */
static void
-move2add_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
+move2add_note_store (rtx dst, const_rtx set, void *data)
{
+ rtx insn = (rtx) data;
unsigned int regno = 0;
unsigned int nregs = 0;
unsigned int i;
@@ -1465,6 +2034,38 @@ move2add_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
nregs = hard_regno_nregs[regno][mode];
if (SCALAR_INT_MODE_P (GET_MODE (dst))
+ && nregs == 1 && GET_CODE (set) == SET)
+ {
+ rtx note, sym = NULL_RTX;
+ HOST_WIDE_INT off;
+
+ note = find_reg_equal_equiv_note (insn);
+ if (note && GET_CODE (XEXP (note, 0)) == SYMBOL_REF)
+ {
+ sym = XEXP (note, 0);
+ off = 0;
+ }
+ else if (note && GET_CODE (XEXP (note, 0)) == CONST
+ && GET_CODE (XEXP (XEXP (note, 0), 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (XEXP (note, 0), 0), 0)) == SYMBOL_REF
+ && CONST_INT_P (XEXP (XEXP (XEXP (note, 0), 0), 1)))
+ {
+ sym = XEXP (XEXP (XEXP (note, 0), 0), 0);
+ off = INTVAL (XEXP (XEXP (XEXP (note, 0), 0), 1));
+ }
+
+ if (sym != NULL_RTX)
+ {
+ reg_base_reg[regno] = -1;
+ reg_symbol_ref[regno] = sym;
+ reg_offset[regno] = off;
+ reg_mode[regno] = mode;
+ reg_set_luid[regno] = move2add_luid;
+ return;
+ }
+ }
+
+ if (SCALAR_INT_MODE_P (GET_MODE (dst))
&& nregs == 1 && GET_CODE (set) == SET
&& GET_CODE (SET_DEST (set)) != ZERO_EXTRACT
&& GET_CODE (SET_DEST (set)) != STRICT_LOW_PART)
@@ -1524,6 +2125,7 @@ move2add_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
case CONST_INT:
/* Start tracking the register as a constant. */
reg_base_reg[regno] = -1;
+ reg_symbol_ref[regno] = NULL_RTX;
reg_offset[regno] = INTVAL (SET_SRC (set));
/* We assign the same luid to all registers set to constants. */
reg_set_luid[regno] = move2add_last_label_luid + 1;
@@ -1544,6 +2146,7 @@ move2add_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
if (reg_set_luid[base_regno] <= move2add_last_label_luid)
{
reg_base_reg[base_regno] = base_regno;
+ reg_symbol_ref[base_regno] = NULL_RTX;
reg_offset[base_regno] = 0;
reg_set_luid[base_regno] = move2add_luid;
reg_mode[base_regno] = mode;
@@ -1557,6 +2160,7 @@ move2add_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
/* Copy base information from our base register. */
reg_set_luid[regno] = reg_set_luid[base_regno];
reg_base_reg[regno] = reg_base_reg[base_regno];
+ reg_symbol_ref[regno] = reg_symbol_ref[base_regno];
/* Compute the sum of the offsets or constants. */
reg_offset[regno] = trunc_int_for_mode (offset
diff --git a/gcc/predict.c b/gcc/predict.c
index 5d61140e4e6..b881a64401e 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "function.h"
#include "except.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "recog.h"
#include "expr.h"
@@ -1786,8 +1787,33 @@ predict_paths_for_bb (basic_block cur, basic_block bb,
if (e->src->index >= NUM_FIXED_BLOCKS
&& !dominated_by_p (CDI_POST_DOMINATORS, e->src, bb))
{
+ edge e2;
+ edge_iterator ei2;
+ bool found = false;
+
+ /* Ignore abnormals, we predict them as not taken anyway. */
+ if (e->flags & (EDGE_EH | EDGE_FAKE | EDGE_ABNORMAL))
+ continue;
gcc_assert (bb == cur || dominated_by_p (CDI_POST_DOMINATORS, cur, bb));
- predict_edge_def (e, pred, taken);
+
+ /* See if there is how many edge from e->src that is not abnormal
+ and does not lead to BB. */
+ FOR_EACH_EDGE (e2, ei2, e->src->succs)
+ if (e2 != e
+ && !(e2->flags & (EDGE_EH | EDGE_FAKE | EDGE_ABNORMAL))
+ && !dominated_by_p (CDI_POST_DOMINATORS, e2->dest, bb))
+ {
+ found = true;
+ break;
+ }
+
+ /* If there is non-abnormal path leaving e->src, predict edge
+ using predictor. Otherwise we need to look for paths
+ leading to e->src. */
+ if (found)
+ predict_edge_def (e, pred, taken);
+ else
+ predict_paths_for_bb (e->src, e->src, pred, taken);
}
for (son = first_dom_son (CDI_POST_DOMINATORS, cur);
son;
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index a2e3c40a882..3b6d18e9254 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -303,7 +303,7 @@ extern const char *pp_base_last_position_in_text (const pretty_printer *);
extern void pp_base_emit_prefix (pretty_printer *);
extern void pp_base_append_text (pretty_printer *, const char *, const char *);
-/* This header may be included before toplev.h, hence the duplicate
+/* This header may be included before diagnostics-core.h, hence the duplicate
definitions to allow for GCC-specific formats. */
#if GCC_VERSION >= 3005
#define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (__gcc_diag__, m ,n))) ATTRIBUTE_NONNULL(m)
diff --git a/gcc/profile.c b/gcc/profile.c
index efbbf7936fe..ffcd802375f 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "function.h"
#include "basic-block.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "coverage.h"
#include "value-prof.h"
diff --git a/gcc/real.c b/gcc/real.c
index 8a5799e5d94..c4b9b9e4517 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -25,6 +25,7 @@
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "real.h"
#include "realmpfr.h"
diff --git a/gcc/recog.c b/gcc/recog.c
index 803aff5f786..368783ff570 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "tree-pass.h"
#include "df.h"
+#include "toplev.h" /* exact_log2 may be used by targets */
#ifndef STACK_PUSH_CODE
#ifdef STACK_GROWS_DOWNWARD
@@ -2741,7 +2742,7 @@ constrain_operands (int strict)
case PRE_MODIFY:
case POST_MODIFY:
if (strchr (recog_data.constraints[opno], '<') == NULL
- || strchr (recog_data.constraints[opno], '>')
+ && strchr (recog_data.constraints[opno], '>')
== NULL)
return 0;
break;
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 039c8b0769b..0e11f97dc10 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -35,6 +35,7 @@
#include "recog.h"
#include "flags.h"
#include "toplev.h"
+#include "diagnostic-core.h"
#include "obstack.h"
#include "timevar.h"
#include "tree-pass.h"
@@ -946,7 +947,14 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
did_replacement:
if (changed)
- anything_changed = true;
+ {
+ anything_changed = true;
+
+ /* If something changed, perhaps further changes to earlier
+ DEBUG_INSNs can be applied. */
+ if (vd->n_debug_insn_changes)
+ note_uses (&PATTERN (insn), cprop_find_used_regs, vd);
+ }
/* Clobber call-clobbered registers. */
if (CALL_P (insn))
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index bf2d8025b3c..0fc86d3627f 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -44,8 +44,8 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "reload.h"
#include "toplev.h"
+#include "diagnostic-core.h"
#include "output.h"
-#include "ggc.h"
#include "timevar.h"
#include "hashtab.h"
#include "target.h"
@@ -58,39 +58,22 @@ along with GCC; see the file COPYING3. If not see
int max_regno;
-/* Register tables used by many passes. */
-
-/* Indexed by hard register number, contains 1 for registers
- that are fixed use (stack pointer, pc, frame pointer, etc.).
- These are the registers that cannot be used to allocate
- a pseudo reg for general use. */
-char fixed_regs[FIRST_PSEUDO_REGISTER];
-
-/* Same info as a HARD_REG_SET. */
-HARD_REG_SET fixed_reg_set;
+struct target_hard_regs default_target_hard_regs;
+struct target_regs default_target_regs;
+#if SWITCHABLE_TARGET
+struct target_hard_regs *this_target_hard_regs = &default_target_hard_regs;
+struct target_regs *this_target_regs = &default_target_regs;
+#endif
-/* Data for initializing the above. */
+/* Data for initializing fixed_regs. */
static const char initial_fixed_regs[] = FIXED_REGISTERS;
-/* Indexed by hard register number, contains 1 for registers
- that are fixed use or are clobbered by function calls.
- These are the registers that cannot be used to allocate
- a pseudo reg whose life crosses calls unless we are able
- to save/restore them across the calls. */
-char call_used_regs[FIRST_PSEUDO_REGISTER];
-
-/* Same info as a HARD_REG_SET. */
-HARD_REG_SET call_used_reg_set;
-
-/* Data for initializing the above. */
+/* Data for initializing call_used_regs. */
static const char initial_call_used_regs[] = CALL_USED_REGISTERS;
-/* This is much like call_used_regs, except it doesn't have to
- be a superset of FIXED_REGISTERS. This vector indicates
- what is really call clobbered, and is used when defining
- regs_invalidated_by_call. */
#ifdef CALL_REALLY_USED_REGISTERS
-char call_really_used_regs[] = CALL_REALLY_USED_REGISTERS;
+/* Data for initializing call_really_used_regs. */
+static const char initial_call_really_used_regs[] = CALL_REALLY_USED_REGISTERS;
#endif
#ifdef CALL_REALLY_USED_REGISTERS
@@ -99,28 +82,12 @@ char call_really_used_regs[] = CALL_REALLY_USED_REGISTERS;
#define CALL_REALLY_USED_REGNO_P(X) call_used_regs[X]
#endif
-
-/* Contains registers that are fixed use -- i.e. in fixed_reg_set -- or
- a function value return register or TARGET_STRUCT_VALUE_RTX or
- STATIC_CHAIN_REGNUM. These are the registers that cannot hold quantities
- across calls even if we are willing to save and restore them. */
-
-HARD_REG_SET call_fixed_reg_set;
-
/* Indexed by hard register number, contains 1 for registers
that are being used for global register decls.
These must be exempt from ordinary flow analysis
and are also considered fixed. */
char global_regs[FIRST_PSEUDO_REGISTER];
-/* Contains 1 for registers that are set or clobbered by calls. */
-/* ??? Ideally, this would be just call_used_regs plus global_regs, but
- for someone's bright idea to have call_used_regs strictly include
- fixed_regs. Which leaves us guessing as to the set of fixed_regs
- that are actually preserved. We know for sure that those associated
- with the local stack frame are safe, but scant others. */
-HARD_REG_SET regs_invalidated_by_call;
-
/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
in dataflow more conveniently. */
regset regs_invalidated_by_call_regset;
@@ -129,17 +96,11 @@ regset regs_invalidated_by_call_regset;
should not be reset after each function is compiled. */
static bitmap_obstack persistent_obstack;
-/* Table of register numbers in the order in which to try to use them. */
+/* Used to initialize reg_alloc_order. */
#ifdef REG_ALLOC_ORDER
-int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
-
-/* The inverse of reg_alloc_order. */
-int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
+static int initial_reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
#endif
-/* For each reg class, a HARD_REG_SET saying which registers are in it. */
-HARD_REG_SET reg_class_contents[N_REG_CLASSES];
-
/* The same information, but as an array of unsigned ints. We copy from
these unsigned ints to the table above. We do this so the tm.h files
do not have to be aware of the wordsize for machines with <= 64 regs.
@@ -150,63 +111,19 @@ HARD_REG_SET reg_class_contents[N_REG_CLASSES];
static const unsigned int_reg_class_contents[N_REG_CLASSES][N_REG_INTS]
= REG_CLASS_CONTENTS;
-/* For each reg class, number of regs it contains. */
-unsigned int reg_class_size[N_REG_CLASSES];
-
-/* For each reg class, table listing all the classes contained in it. */
-enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
-
-/* For each pair of reg classes,
- a largest reg class contained in their union. */
-enum reg_class reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
-
-/* For each pair of reg classes,
- the smallest reg class containing their union. */
-enum reg_class reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
-
/* Array containing all of the register names. */
-const char * reg_names[] = REGISTER_NAMES;
+static const char *const initial_reg_names[] = REGISTER_NAMES;
/* Array containing all of the register class names. */
const char * reg_class_names[] = REG_CLASS_NAMES;
-/* For each hard register, the widest mode object that it can contain.
- This will be a MODE_INT mode if the register can hold integers. Otherwise
- it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
- register. */
-enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
-
-/* 1 if there is a register of given mode. */
-bool have_regs_of_mode [MAX_MACHINE_MODE];
-
-/* 1 if class does contain register of given mode. */
-char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
-
-/* Maximum cost of moving from a register in one class to a register in
- another class. Based on TARGET_REGISTER_MOVE_COST. */
-move_table *move_cost[MAX_MACHINE_MODE];
-
-/* Similar, but here we don't have to move if the first index is a subset
- of the second so in that case the cost is zero. */
-move_table *may_move_in_cost[MAX_MACHINE_MODE];
-
-/* Similar, but here we don't have to move if the first index is a superset
- of the second so in that case the cost is zero. */
-move_table *may_move_out_cost[MAX_MACHINE_MODE];
-
-/* Keep track of the last mode we initialized move costs for. */
-static int last_mode_for_init_move_cost;
-
-/* Sample MEM values for use by memory_move_secondary_cost. */
-static GTY(()) rtx top_of_stack[MAX_MACHINE_MODE];
+#define last_mode_for_init_move_cost \
+ (this_target_regs->x_last_mode_for_init_move_cost)
/* No more global register variables may be declared; true once
reginfo has been initialized. */
static int no_global_reg_vars = 0;
-/* Specify number of hard registers given machine mode occupy. */
-unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
-
/* Given a register bitmap, turn on the bits in a HARD_REG_SET that
correspond to the hard registers, if any, set in that map. This
could be done far more efficiently by having all sorts of special-cases
@@ -225,8 +142,9 @@ reg_set_to_hard_reg_set (HARD_REG_SET *to, const_bitmap from)
}
}
-/* Function called only once to initialize the above data on reg usage.
- Once this is done, various switches may override. */
+/* Function called only once per target_globals to initialize the
+ target_hard_regs structure. Once this is done, various switches
+ may override. */
void
init_reg_sets (void)
{
@@ -250,10 +168,25 @@ init_reg_sets (void)
CALL_USED_REGISTERS had the right number of initializers. */
gcc_assert (sizeof fixed_regs == sizeof initial_fixed_regs);
gcc_assert (sizeof call_used_regs == sizeof initial_call_used_regs);
+#ifdef CALL_REALLY_USED_REGISTERS
+ gcc_assert (sizeof call_really_used_regs
+ == sizeof initial_call_really_used_regs);
+#endif
+#ifdef REG_ALLOC_ORDER
+ gcc_assert (sizeof reg_alloc_order == sizeof initial_reg_alloc_order);
+#endif
+ gcc_assert (sizeof reg_names == sizeof initial_reg_names);
memcpy (fixed_regs, initial_fixed_regs, sizeof fixed_regs);
memcpy (call_used_regs, initial_call_used_regs, sizeof call_used_regs);
- memset (global_regs, 0, sizeof global_regs);
+#ifdef CALL_REALLY_USED_REGISTERS
+ memcpy (call_really_used_regs, initial_call_really_used_regs,
+ sizeof call_really_used_regs);
+#endif
+#ifdef REG_ALLOC_ORDER
+ memcpy (reg_alloc_order, initial_reg_alloc_order, sizeof reg_alloc_order);
+#endif
+ memcpy (reg_names, initial_reg_names, sizeof reg_names);
}
/* Initialize may_move_cost and friends for mode M. */
@@ -420,9 +353,17 @@ init_reg_sets_1 (void)
memset (reg_class_size, 0, sizeof reg_class_size);
for (i = 0; i < N_REG_CLASSES; i++)
- for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
- if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
- reg_class_size[i]++;
+ {
+ bool any_nonfixed = false;
+ for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
+ if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
+ {
+ reg_class_size[i]++;
+ if (!fixed_regs[j])
+ any_nonfixed = true;
+ }
+ class_only_fixed_regs[i] = !any_nonfixed;
+ }
/* Initialize the table of subunions.
reg_class_subunion[I][J] gets the largest-numbered reg-class
@@ -1243,7 +1184,7 @@ reg_class_subset_p (enum reg_class c1, enum reg_class c2)
/* Return nonzero if there is a register that is in both C1 and C2. */
int
-reg_classes_intersect_p (enum reg_class c1, enum reg_class c2)
+reg_classes_intersect_p (reg_class_t c1, reg_class_t c2)
{
return (c1 == c2
|| c1 == ALL_REGS
@@ -1402,5 +1343,3 @@ finish_subregs_of_mode (void)
}
#endif /* CANNOT_CHANGE_MODE_CLASS */
-
-#include "gt-reginfo.h"
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 3e1bf40e75a..eb205f89ee9 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "basic-block.h"
#include "except.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "reload.h"
#include "timevar.h"
diff --git a/gcc/regs.h b/gcc/regs.h
index c9dddb5abd1..9e8ea814570 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -214,17 +214,6 @@ extern size_t reg_info_p_size;
extern short *reg_renumber;
-/* Vector indexed by machine mode saying whether there are regs of that mode. */
-
-extern bool have_regs_of_mode [MAX_MACHINE_MODE];
-
-/* For each hard register, the widest mode object that it can contain.
- This will be a MODE_INT mode if the register can hold integers. Otherwise
- it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
- register. */
-
-extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
-
/* Flag set by local-alloc or global-alloc if they decide to allocate
something in a call-clobbered register. */
@@ -256,26 +245,79 @@ extern int caller_save_needed;
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
#endif
-/* 1 if the corresponding class does contain register of given
- mode. */
-extern char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
-
typedef unsigned short move_table[N_REG_CLASSES];
-/* Maximum cost of moving from a register in one class to a register
- in another class. */
-extern move_table *move_cost[MAX_MACHINE_MODE];
+/* Target-dependent globals. */
+struct target_regs {
+ /* For each starting hard register, the number of consecutive hard
+ registers that a given machine mode occupies. */
+ unsigned char x_hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+
+ /* For each hard register, the widest mode object that it can contain.
+ This will be a MODE_INT mode if the register can hold integers. Otherwise
+ it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
+ register. */
+ enum machine_mode x_reg_raw_mode[FIRST_PSEUDO_REGISTER];
+
+ /* Vector indexed by machine mode saying whether there are regs of
+ that mode. */
+ bool x_have_regs_of_mode[MAX_MACHINE_MODE];
+
+ /* 1 if the corresponding class contains a register of the given mode. */
+ char x_contains_reg_of_mode[N_REG_CLASSES][MAX_MACHINE_MODE];
-/* Specify number of hard registers given machine mode occupy. */
-extern unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+ /* Maximum cost of moving from a register in one class to a register
+ in another class. Based on TARGET_REGISTER_MOVE_COST. */
+ move_table *x_move_cost[MAX_MACHINE_MODE];
-/* Similar, but here we don't have to move if the first index is a
- subset of the second so in that case the cost is zero. */
-extern move_table *may_move_in_cost[MAX_MACHINE_MODE];
+ /* Similar, but here we don't have to move if the first index is a
+ subset of the second so in that case the cost is zero. */
+ move_table *x_may_move_in_cost[MAX_MACHINE_MODE];
+
+ /* Similar, but here we don't have to move if the first index is a
+ superset of the second so in that case the cost is zero. */
+ move_table *x_may_move_out_cost[MAX_MACHINE_MODE];
+
+ /* Keep track of the last mode we initialized move costs for. */
+ int x_last_mode_for_init_move_cost;
+
+ /* Record for each mode whether we can move a register directly to or
+ from an object of that mode in memory. If we can't, we won't try
+ to use that mode directly when accessing a field of that mode. */
+ char x_direct_load[NUM_MACHINE_MODES];
+ char x_direct_store[NUM_MACHINE_MODES];
+
+ /* Record for each mode whether we can float-extend from memory. */
+ bool x_float_extend_from_mem[NUM_MACHINE_MODES][NUM_MACHINE_MODES];
+};
+
+extern struct target_regs default_target_regs;
+#if SWITCHABLE_TARGET
+extern struct target_regs *this_target_regs;
+#else
+#define this_target_regs (&default_target_regs)
+#endif
-/* Similar, but here we don't have to move if the first index is a
- superset of the second so in that case the cost is zero. */
-extern move_table *may_move_out_cost[MAX_MACHINE_MODE];
+#define hard_regno_nregs \
+ (this_target_regs->x_hard_regno_nregs)
+#define reg_raw_mode \
+ (this_target_regs->x_reg_raw_mode)
+#define have_regs_of_mode \
+ (this_target_regs->x_have_regs_of_mode)
+#define contains_reg_of_mode \
+ (this_target_regs->x_contains_reg_of_mode)
+#define move_cost \
+ (this_target_regs->x_move_cost)
+#define may_move_in_cost \
+ (this_target_regs->x_may_move_in_cost)
+#define may_move_out_cost \
+ (this_target_regs->x_may_move_out_cost)
+#define direct_load \
+ (this_target_regs->x_direct_load)
+#define direct_store \
+ (this_target_regs->x_direct_store)
+#define float_extend_from_mem \
+ (this_target_regs->x_float_extend_from_mem)
/* Return an exclusive upper bound on the registers occupied by hard
register (reg:MODE REGNO). */
diff --git a/gcc/reload.c b/gcc/reload.c
index ea552e6695c..98aaa236200 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -111,6 +111,7 @@ a register with any other reload. */
#include "params.h"
#include "target.h"
#include "ira.h"
+#include "toplev.h" /* exact_log2 may be used by targets */
/* True if X is a constant that can be forced into the constant pool. */
#define CONST_POOL_OK_P(X) \
@@ -2601,7 +2602,6 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
char goal_alternative_earlyclobber[MAX_RECOG_OPERANDS];
int goal_alternative_swapped;
int best;
- int best_small_class_operands_num;
int commutative;
char operands_match[MAX_RECOG_OPERANDS][MAX_RECOG_OPERANDS];
rtx substed_operand[MAX_RECOG_OPERANDS];
@@ -2927,7 +2927,6 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
all the operands together against the register constraints. */
best = MAX_RECOG_OPERANDS * 2 + 600;
- best_small_class_operands_num = 0;
swapped = 0;
goal_alternative_swapped = 0;
@@ -3469,7 +3468,8 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* If this operand could be handled with a reg,
and some reg is allowed, then this operand can be handled. */
- if (winreg && this_alternative[i] != NO_REGS)
+ if (winreg && this_alternative[i] != NO_REGS
+ && (win || !class_only_fixed_regs[this_alternative[i]]))
badop = 0;
/* Record which operands fit this alternative. */
@@ -3713,27 +3713,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
record it as the chosen goal for reloading. */
if (! bad)
{
- bool change_p = false;
- int small_class_operands_num = 0;
-
- if (best >= losers)
- {
- for (i = 0; i < noperands; i++)
- small_class_operands_num
- += SMALL_REGISTER_CLASS_P (this_alternative[i]) ? 1 : 0;
- if (best > losers
- || (best == losers
- /* If the cost of the reloads is the same,
- prefer alternative which requires minimal
- number of small register classes for the
- operands. This improves chances of reloads
- for insn requiring small register
- classes. */
- && (small_class_operands_num
- < best_small_class_operands_num)))
- change_p = true;
- }
- if (change_p)
+ if (best > losers)
{
for (i = 0; i < noperands; i++)
{
@@ -3749,7 +3729,6 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
}
goal_alternative_swapped = swapped;
best = losers;
- best_small_class_operands_num = small_class_operands_num;
goal_alternative_number = this_alternative_number;
goal_earlyclobber = this_earlyclobber;
}
@@ -5833,8 +5812,7 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
rtx equiv = (MEM_P (XEXP (x, 0))
? XEXP (x, 0)
: reg_equiv_mem[regno]);
- int icode
- = (int) optab_handler (add_optab, GET_MODE (x))->insn_code;
+ int icode = (int) optab_handler (add_optab, GET_MODE (x));
if (insn && NONJUMP_INSN_P (insn) && equiv
&& memory_operand (equiv, GET_MODE (equiv))
#ifdef HAVE_cc0
diff --git a/gcc/reload.h b/gcc/reload.h
index a3c1f07bd9f..01bbfb1bbc6 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -154,6 +154,58 @@ extern struct reload rld[MAX_RELOADS];
extern int n_reloads;
#endif
+/* Target-dependent globals. */
+struct target_reload {
+ /* Nonzero if indirect addressing is supported when the innermost MEM is
+ of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
+ which these are valid is the same as spill_indirect_levels, above. */
+ bool x_indirect_symref_ok;
+
+ /* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
+ bool x_double_reg_address_ok;
+
+ /* Nonzero if indirect addressing is supported on the machine; this means
+ that spilling (REG n) does not require reloading it into a register in
+ order to do (MEM (REG n)) or (MEM (PLUS (REG n) (CONST_INT c))). The
+ value indicates the level of indirect addressing supported, e.g., two
+ means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
+ a hard register. */
+ bool x_spill_indirect_levels;
+
+ /* True if caller-save has been reinitialized. */
+ bool x_caller_save_initialized_p;
+
+ /* Modes for each hard register that we can save. The smallest mode is wide
+ enough to save the entire contents of the register. When saving the
+ register because it is live we first try to save in multi-register modes.
+ If that is not possible the save is done one register at a time. */
+ enum machine_mode (x_regno_save_mode
+ [FIRST_PSEUDO_REGISTER]
+ [MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1]);
+
+ /* We will only make a register eligible for caller-save if it can be
+ saved in its widest mode with a simple SET insn as long as the memory
+ address is valid. We record the INSN_CODE is those insns here since
+ when we emit them, the addresses might not be valid, so they might not
+ be recognized. */
+ int x_cached_reg_save_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+ int x_cached_reg_restore_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+};
+
+extern struct target_reload default_target_reload;
+#if SWITCHABLE_TARGET
+extern struct target_reload *this_target_reload;
+#else
+#define this_target_reload (&default_target_reload)
+#endif
+
+#define indirect_symref_ok \
+ (this_target_reload->x_indirect_symref_ok)
+#define double_reg_address_ok \
+ (this_target_reload->x_double_reg_address_ok)
+#define caller_save_initialized_p \
+ (this_target_reload->x_caller_save_initialized_p)
+
extern GTY (()) VEC(rtx,gc) *reg_equiv_memory_loc_vec;
extern rtx *reg_equiv_constant;
extern rtx *reg_equiv_invariant;
@@ -181,15 +233,6 @@ extern int reload_n_operands;
Used in find_equiv_reg. */
extern int reload_first_uid;
-/* Nonzero if indirect addressing is supported when the innermost MEM is
- of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
- which these are valid is the same as spill_indirect_levels, above. */
-
-extern char indirect_symref_ok;
-
-/* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
-extern char double_reg_address_ok;
-
extern int num_not_at_initial_offset;
#if defined SET_HARD_REG_BIT && defined CLEAR_REG_SET
@@ -355,9 +398,6 @@ extern void calculate_elim_costs_all_insns (void);
/* Deallocate the reload register used by reload number R. */
extern void deallocate_reload_reg (int r);
-/* True if caller-save has been reinitialized. */
-extern bool caller_save_initialized_p;
-
/* Functions in caller-save.c: */
/* Initialize for caller-save. */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 412f45d10d8..437b8c2f286 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -81,6 +81,14 @@ along with GCC; see the file COPYING3. If not see
fixing up each insn, and generating the new insns to copy values
into the reload registers. */
+struct target_reload default_target_reload;
+#if SWITCHABLE_TARGET
+struct target_reload *this_target_reload = &default_target_reload;
+#endif
+
+#define spill_indirect_levels \
+ (this_target_reload->x_spill_indirect_levels)
+
/* During reload_as_needed, element N contains a REG rtx for the hard reg
into which reg N has been reloaded (perhaps for a previous insn). */
static rtx *reg_last_reload_reg;
@@ -231,22 +239,6 @@ static HARD_REG_SET used_spill_regs;
a round-robin fashion. */
static int last_spill_reg;
-/* Nonzero if indirect addressing is supported on the machine; this means
- that spilling (REG n) does not require reloading it into a register in
- order to do (MEM (REG n)) or (MEM (PLUS (REG n) (CONST_INT c))). The
- value indicates the level of indirect addressing supported, e.g., two
- means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
- a hard register. */
-static char spill_indirect_levels;
-
-/* Nonzero if indirect addressing is supported when the innermost MEM is
- of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
- which these are valid is the same as spill_indirect_levels, above. */
-char indirect_symref_ok;
-
-/* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
-char double_reg_address_ok;
-
/* Record the stack slot for each spilled hard register. */
static rtx spill_stack_slot[FIRST_PSEUDO_REGISTER];
@@ -275,12 +267,6 @@ int caller_save_needed;
Required by some machines to handle any generated moves differently. */
int reload_in_progress = 0;
-/* These arrays record the insn_code of insns that may be needed to
- perform input and output reloads of special objects. They provide a
- place to pass a scratch register. */
-enum insn_code reload_in_optab[NUM_MACHINE_MODES];
-enum insn_code reload_out_optab[NUM_MACHINE_MODES];
-
/* This obstack is used for allocation of rtl during register elimination.
The allocated storage can be freed once find_reloads has processed the
insn. */
@@ -8680,7 +8666,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
DEFINE_PEEPHOLE should be specified that recognizes the sequence
we emit below. */
- code = (int) optab_handler (add_optab, GET_MODE (out))->insn_code;
+ code = (int) optab_handler (add_optab, GET_MODE (out));
if (CONSTANT_P (op1) || MEM_P (op1) || GET_CODE (op1) == SUBREG
|| (REG_P (op1)
diff --git a/gcc/reorg.c b/gcc/reorg.c
index c649dfc9b12..ec13bcc470e 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -115,6 +115,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/resource.c b/gcc/resource.c
index 9dc44b9ac29..4917273b7f6 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/rtl.c b/gcc/rtl.c
index d886e9381d2..79dafcb004f 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#ifdef GENERATOR_FILE
# include "errors.h"
#else
-# include "toplev.h"
+# include "diagnostic-core.h"
#endif
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 02f74f575c3..4fb96e49d93 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2006,8 +2006,62 @@ enum global_rtl_index
GR_MAX
};
-/* Pointers to standard pieces of rtx are stored here. */
-extern GTY(()) rtx global_rtl[GR_MAX];
+/* Target-dependent globals. */
+struct GTY(()) target_rtl {
+ /* All references to the hard registers in global_rtl_index go through
+ these unique rtl objects. On machines where the frame-pointer and
+ arg-pointer are the same register, they use the same unique object.
+
+ After register allocation, other rtl objects which used to be pseudo-regs
+ may be clobbered to refer to the frame-pointer register.
+ But references that were originally to the frame-pointer can be
+ distinguished from the others because they contain frame_pointer_rtx.
+
+ When to use frame_pointer_rtx and hard_frame_pointer_rtx is a little
+ tricky: until register elimination has taken place hard_frame_pointer_rtx
+ should be used if it is being set, and frame_pointer_rtx otherwise. After
+ register elimination hard_frame_pointer_rtx should always be used.
+ On machines where the two registers are same (most) then these are the
+ same. */
+ rtx x_global_rtl[GR_MAX];
+
+ /* A unique representation of (REG:Pmode PIC_OFFSET_TABLE_REGNUM). */
+ rtx x_pic_offset_table_rtx;
+
+ /* A unique representation of (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM).
+ This is used to implement __builtin_return_address for some machines;
+ see for instance the MIPS port. */
+ rtx x_return_address_pointer_rtx;
+
+ /* Commonly used RTL for hard registers. These objects are not
+ necessarily unique, so we allocate them separately from global_rtl.
+ They are initialized once per compilation unit, then copied into
+ regno_reg_rtx at the beginning of each function. */
+ rtx x_initial_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
+
+ /* A sample (mem:M stack_pointer_rtx) rtx for each mode M. */
+ rtx x_top_of_stack[MAX_MACHINE_MODE];
+
+ /* Static hunks of RTL used by the aliasing code; these are treated
+ as persistent to avoid unnecessary RTL allocations. */
+ rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER];
+};
+
+extern GTY(()) struct target_rtl default_target_rtl;
+#if SWITCHABLE_TARGET
+extern struct target_rtl *this_target_rtl;
+#else
+#define this_target_rtl (&default_target_rtl)
+#endif
+
+#define global_rtl \
+ (this_target_rtl->x_global_rtl)
+#define pic_offset_table_rtx \
+ (this_target_rtl->x_pic_offset_table_rtx)
+#define return_address_pointer_rtx \
+ (this_target_rtl->x_return_address_pointer_rtx)
+#define top_of_stack \
+ (this_target_rtl->x_top_of_stack)
/* Standard pieces of rtx, to be substituted directly into things. */
#define pc_rtx (global_rtl[GR_PC])
@@ -2021,9 +2075,6 @@ extern GTY(()) rtx global_rtl[GR_MAX];
#define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
-extern GTY(()) rtx pic_offset_table_rtx;
-extern GTY(()) rtx return_address_pointer_rtx;
-
/* Include the RTL generation functions. */
#ifndef GENERATOR_FILE
@@ -2314,7 +2365,7 @@ extern HARD_REG_SET eliminable_regset;
extern void mark_elimination (int, int);
/* In reginfo.c */
-extern int reg_classes_intersect_p (enum reg_class, enum reg_class);
+extern int reg_classes_intersect_p (reg_class_t, reg_class_t);
extern int reg_class_subset_p (enum reg_class, enum reg_class);
extern void globalize_reg (int);
extern void init_reg_modes_target (void);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index a26bf3b2272..3c14109f804 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 4577c8e1c51..608f7245d1c 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 534df4ad0f7..2e797b17d25 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 89743c31b74..4a0ae511be0 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index f0e54bf4052..f7bf9e334a1 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -75,6 +75,7 @@ static GTY(()) bool sdbout_initialized;
#include "insn-config.h"
#include "reload.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tm_p.h"
#include "gsyms.h"
diff --git a/gcc/sel-sched-dump.c b/gcc/sel-sched-dump.c
index e9b486f332b..c9f68067389 100644
--- a/gcc/sel-sched-dump.c
+++ b/gcc/sel-sched-dump.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index e831a785cd4..4e15eba16ff 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 3a30e882907..8e29d2da35c 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "expr.h"
#include "toplev.h"
+#include "diagnostic-core.h"
#include "output.h"
#include "ggc.h"
#include "target.h"
diff --git a/gcc/stmt.c b/gcc/stmt.c
index bb346ab5948..baa9cf1a23e 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see
#include "libfuncs.h"
#include "recog.h"
#include "machmode.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
@@ -1594,8 +1595,11 @@ expand_value_return (rtx val)
tree type = TREE_TYPE (decl);
int unsignedp = TYPE_UNSIGNED (type);
enum machine_mode old_mode = DECL_MODE (decl);
- enum machine_mode mode = promote_function_mode (type, old_mode,
- &unsignedp, funtype, 1);
+ enum machine_mode mode;
+ if (DECL_BY_REFERENCE (decl))
+ mode = promote_function_mode (type, old_mode, &unsignedp, funtype, 2);
+ else
+ mode = promote_function_mode (type, old_mode, &unsignedp, funtype, 1);
if (mode != old_mode)
val = convert_modes (mode, old_mode, val, unsignedp);
@@ -2071,7 +2075,7 @@ add_case_node (struct case_node *head, tree type, tree low, tree high,
/* By default, enable case bit tests on targets with ashlsi3. */
#ifndef CASE_USE_BIT_TESTS
-#define CASE_USE_BIT_TESTS (optab_handler (ashl_optab, word_mode)->insn_code \
+#define CASE_USE_BIT_TESTS (optab_handler (ashl_optab, word_mode) \
!= CODE_FOR_nothing)
#endif
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 89f5fa986a7..d4b266282c7 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "expr.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "target.h"
@@ -233,10 +234,11 @@ self_referential_size (tree size)
{
static unsigned HOST_WIDE_INT fnno = 0;
VEC (tree, heap) *self_refs = NULL;
- tree param_type_list = NULL, param_decl_list = NULL, arg_list = NULL;
+ tree param_type_list = NULL, param_decl_list = NULL;
tree t, ref, return_type, fntype, fnname, fndecl;
unsigned int i;
char buf[128];
+ VEC(tree,gc) *args = NULL;
/* Do not factor out simple operations. */
t = skip_simple_arithmetic (size);
@@ -255,6 +257,7 @@ self_referential_size (tree size)
/* Build the parameter and argument lists in parallel; also
substitute the former for the latter in the expression. */
+ args = VEC_alloc (tree, gc, VEC_length (tree, self_refs));
for (i = 0; VEC_iterate (tree, self_refs, i, ref); i++)
{
tree subst, param_name, param_type, param_decl;
@@ -290,7 +293,7 @@ self_referential_size (tree size)
param_type_list = tree_cons (NULL_TREE, param_type, param_type_list);
param_decl_list = chainon (param_decl, param_decl_list);
- arg_list = tree_cons (NULL_TREE, ref, arg_list);
+ VEC_quick_push (tree, args, ref);
}
VEC_free (tree, heap, self_refs);
@@ -301,7 +304,6 @@ self_referential_size (tree size)
/* The 3 lists have been created in reverse order. */
param_type_list = nreverse (param_type_list);
param_decl_list = nreverse (param_decl_list);
- arg_list = nreverse (arg_list);
/* Build the function type. */
return_type = TREE_TYPE (size);
@@ -311,7 +313,7 @@ self_referential_size (tree size)
sprintf (buf, "SZ"HOST_WIDE_INT_PRINT_UNSIGNED, fnno++);
fnname = get_file_function_name (buf);
fndecl = build_decl (input_location, FUNCTION_DECL, fnname, fntype);
- for (t = param_decl_list; t; t = TREE_CHAIN (t))
+ for (t = param_decl_list; t; t = DECL_CHAIN (t))
DECL_CONTEXT (t) = fndecl;
DECL_ARGUMENTS (fndecl) = param_decl_list;
DECL_RESULT (fndecl)
@@ -342,7 +344,7 @@ self_referential_size (tree size)
VEC_safe_push (tree, gc, size_functions, fndecl);
/* Replace the original expression with a call to the size function. */
- return build_function_call_expr (UNKNOWN_LOCATION, fndecl, arg_list);
+ return build_call_expr_loc_vec (input_location, fndecl, args);
}
/* Take, queue and compile all the size functions. It is essential that
@@ -1427,8 +1429,8 @@ place_field (record_layout_info rli, tree field)
/* If we ended a bitfield before the full length of the type then
pad the struct out to the full length of the last type. */
- if ((TREE_CHAIN (field) == NULL
- || TREE_CODE (TREE_CHAIN (field)) != FIELD_DECL)
+ if ((DECL_CHAIN (field) == NULL
+ || TREE_CODE (DECL_CHAIN (field)) != FIELD_DECL)
&& DECL_BIT_FIELD_TYPE (field)
&& !integer_zerop (DECL_SIZE (field)))
rli->bitpos = size_binop (PLUS_EXPR, rli->bitpos,
@@ -1549,7 +1551,7 @@ compute_record_mode (tree type)
/* A record which has any BLKmode members must itself be
BLKmode; it can't go in a register. Unless the member is
BLKmode only because it isn't aligned. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
@@ -1744,8 +1746,8 @@ finish_builtin_struct (tree type, const char *name, tree fields,
for (tail = NULL_TREE; fields; tail = fields, fields = next)
{
DECL_FIELD_CONTEXT (fields) = type;
- next = TREE_CHAIN (fields);
- TREE_CHAIN (fields) = tail;
+ next = DECL_CHAIN (fields);
+ DECL_CHAIN (fields) = tail;
}
TYPE_FIELDS (type) = tail;
@@ -2059,7 +2061,7 @@ layout_type (tree type)
TYPE_FIELDS (type) = nreverse (TYPE_FIELDS (type));
/* Place all the fields. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
place_field (rli, field);
if (TREE_CODE (type) == QUAL_UNION_TYPE)
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 61d0cba8159..f6a021eb778 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
diff --git a/gcc/system.h b/gcc/system.h
index dd72d07fa3d..a8b4fa93558 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -800,7 +800,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
/* Front ends should never have to include middle-end headers. Enforce
this by poisoning the header double-include protection defines. */
#ifdef IN_GCC_FRONTEND
-#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H
+#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H GCC_EXPR_H
#endif
/* Note: not all uses of the `index' token (e.g. variable names and
diff --git a/gcc/target-globals.c b/gcc/target-globals.c
new file mode 100644
index 00000000000..7a4058ebd18
--- /dev/null
+++ b/gcc/target-globals.c
@@ -0,0 +1,88 @@
+/* Target-dependent globals.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "insn-config.h"
+#include "machmode.h"
+#include "ggc.h"
+#include "toplev.h"
+#include "target-globals.h"
+#include "flags.h"
+#include "regs.h"
+#include "rtl.h"
+#include "hard-reg-set.h"
+#include "reload.h"
+#include "expmed.h"
+#include "expr.h"
+#include "optabs.h"
+#include "libfuncs.h"
+#include "cfgloop.h"
+#include "ira-int.h"
+#include "builtins.h"
+#include "gcse.h"
+#include "bb-reorder.h"
+
+#if SWITCHABLE_TARGET
+struct target_globals default_target_globals = {
+ &default_target_flag_state,
+ &default_target_regs,
+ &default_target_rtl,
+ &default_target_hard_regs,
+ &default_target_reload,
+ &default_target_expmed,
+ &default_target_optabs,
+ &default_target_libfuncs,
+ &default_target_cfgloop,
+ &default_target_ira,
+ &default_target_ira_int,
+ &default_target_builtins,
+ &default_target_gcse,
+ &default_target_bb_reorder
+};
+
+struct target_globals *
+save_target_globals (void)
+{
+ struct target_globals *g;
+
+ g = ggc_alloc_target_globals ();
+ g->flag_state = XCNEW (struct target_flag_state);
+ g->regs = XCNEW (struct target_regs);
+ g->rtl = ggc_alloc_cleared_target_rtl ();
+ g->hard_regs = XCNEW (struct target_hard_regs);
+ g->reload = XCNEW (struct target_reload);
+ g->expmed = XCNEW (struct target_expmed);
+ g->optabs = XCNEW (struct target_optabs);
+ g->libfuncs = ggc_alloc_cleared_target_libfuncs ();
+ g->cfgloop = XCNEW (struct target_cfgloop);
+ g->ira = XCNEW (struct target_ira);
+ g->ira_int = XCNEW (struct target_ira_int);
+ g->builtins = XCNEW (struct target_builtins);
+ g->gcse = XCNEW (struct target_gcse);
+ g->bb_reorder = XCNEW (struct target_bb_reorder);
+ restore_target_globals (g);
+ init_reg_sets ();
+ target_reinit ();
+ return g;
+}
+
+#endif
diff --git a/gcc/target-globals.h b/gcc/target-globals.h
new file mode 100644
index 00000000000..166f21ada4f
--- /dev/null
+++ b/gcc/target-globals.h
@@ -0,0 +1,80 @@
+/* Target-dependent globals.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef TARGET_GLOBALS_H
+#define TARGET_GLOBALS_H 1
+
+#if SWITCHABLE_TARGET
+extern struct target_flag_state *this_target_flag_state;
+extern struct target_regs *this_target_regs;
+extern struct target_rtl *this_target_rtl;
+extern struct target_hard_regs *this_target_hard_regs;
+extern struct target_reload *this_target_reload;
+extern struct target_expmed *this_target_expmed;
+extern struct target_optabs *this_target_optabs;
+extern struct target_libfuncs *this_target_libfuncs;
+extern struct target_cfgloop *this_target_cfgloop;
+extern struct target_ira *this_target_ira;
+extern struct target_ira_int *this_target_ira_int;
+extern struct target_builtins *this_target_builtins;
+extern struct target_gcse *this_target_gcse;
+extern struct target_bb_reorder *this_target_bb_reorder;
+
+struct GTY(()) target_globals {
+ struct target_flag_state *GTY((skip)) flag_state;
+ struct target_regs *GTY((skip)) regs;
+ struct target_rtl *rtl;
+ struct target_hard_regs *GTY((skip)) hard_regs;
+ struct target_reload *GTY((skip)) reload;
+ struct target_expmed *GTY((skip)) expmed;
+ struct target_optabs *GTY((skip)) optabs;
+ struct target_libfuncs *libfuncs;
+ struct target_cfgloop *GTY((skip)) cfgloop;
+ struct target_ira *GTY((skip)) ira;
+ struct target_ira_int *GTY((skip)) ira_int;
+ struct target_builtins *GTY((skip)) builtins;
+ struct target_gcse *GTY((skip)) gcse;
+ struct target_bb_reorder *GTY((skip)) bb_reorder;
+};
+
+extern struct target_globals default_target_globals;
+
+extern struct target_globals *save_target_globals (void);
+
+static inline void
+restore_target_globals (struct target_globals *g)
+{
+ this_target_flag_state = g->flag_state;
+ this_target_regs = g->regs;
+ this_target_rtl = g->rtl;
+ this_target_hard_regs = g->hard_regs;
+ this_target_reload = g->reload;
+ this_target_expmed = g->expmed;
+ this_target_optabs = g->optabs;
+ this_target_libfuncs = g->libfuncs;
+ this_target_cfgloop = g->cfgloop;
+ this_target_ira = g->ira;
+ this_target_ira_int = g->ira_int;
+ this_target_builtins = g->builtins;
+ this_target_gcse = g->gcse;
+ this_target_bb_reorder = g->bb_reorder;
+}
+#endif
+
+#endif
diff --git a/gcc/target.def b/gcc/target.def
index 8bcf877359c..583e78b48b6 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -150,7 +150,7 @@ DEFHOOK
(unwind_emit,
"",
void, (FILE *stream, rtx insn),
- default_unwind_emit)
+ NULL)
/* Output an internal label. */
DEFHOOK
@@ -789,11 +789,13 @@ DEFHOOK
"",
tree, (tree x), NULL)
-/* Cost of different vector/scalar statements in vectorization cost model. */
+/* Cost of different vector/scalar statements in vectorization cost
+ model. In case of misaligned vector loads and stores the cost depends
+ on the data type and misalignment value. */
DEFHOOK
(builtin_vectorization_cost,
"",
- int, (enum vect_cost_for_stmt type_of_cost),
+ int, (enum vect_cost_for_stmt type_of_cost, tree vectype, int misalign),
default_builtin_vectorization_cost)
/* Return true if vector alignment is reachable (by peeling N
@@ -2335,6 +2337,13 @@ DEFHOOKPOD
"",
bool, false)
+DEFHOOKPOD
+(want_debug_pub_sections,
+ "True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections\
+ should be emitted. These sections are not used on most platforms, and\
+ in particular GDB does not use them.",
+ bool, false)
+
/* Leave the boolean fields at the end. */
/* Empty macro arguments are undefined in C90, so use an empty macro. */
diff --git a/gcc/target.h b/gcc/target.h
index 18d160dbeb2..99dd1eea998 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -119,6 +119,7 @@ enum vect_cost_for_stmt
vector_stmt,
vector_load,
unaligned_load,
+ unaligned_store,
vector_store,
vec_to_scalar,
scalar_to_vec,
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 9271db829bf..22077f8c437 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "expr.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "function.h"
#include "target.h"
@@ -315,16 +316,6 @@ hook_callee_copies_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
return named;
}
-/* Emit any directives required to unwind this instruction. */
-
-void
-default_unwind_emit (FILE * stream ATTRIBUTE_UNUSED,
- rtx insn ATTRIBUTE_UNUSED)
-{
- /* Should never happen. */
- gcc_unreachable ();
-}
-
/* Emit to STREAM the assembler syntax for insn operand X. */
void
@@ -479,7 +470,9 @@ default_builtin_vectorized_conversion (unsigned int code ATTRIBUTE_UNUSED,
/* Default vectorizer cost model values. */
int
-default_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost)
+default_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
+ tree vectype ATTRIBUTE_UNUSED,
+ int misalign ATTRIBUTE_UNUSED)
{
switch (type_of_cost)
{
@@ -496,6 +489,7 @@ default_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost)
return 1;
case unaligned_load:
+ case unaligned_store:
return 2;
case cond_branch_taken:
@@ -846,8 +840,9 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
#endif
if (rclass != NO_REGS)
{
- enum insn_code icode = (in_p ? reload_in_optab[(int) reload_mode]
- : reload_out_optab[(int) reload_mode]);
+ enum insn_code icode
+ = direct_optab_handler (in_p ? reload_in_optab : reload_out_optab,
+ reload_mode);
if (icode != CODE_FOR_nothing
&& insn_data[(int) icode].operand[in_p].predicate
@@ -971,7 +966,7 @@ default_builtin_support_vector_misalignment (enum machine_mode mode,
bool is_packed
ATTRIBUTE_UNUSED)
{
- if (optab_handler (movmisalign_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (movmisalign_optab, mode) != CODE_FOR_nothing)
return true;
return false;
}
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index f491dbd4d29..23393b46255 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -62,7 +62,6 @@ extern bool hook_pass_by_reference_must_pass_in_stack
extern bool hook_callee_copies_named
(CUMULATIVE_ARGS *ca, enum machine_mode, const_tree, bool);
-extern void default_unwind_emit (FILE *, rtx);
extern void default_print_operand (FILE *, rtx, int);
extern void default_print_operand_address (FILE *, rtx);
extern bool default_print_operand_punct_valid_p (unsigned char);
@@ -77,7 +76,7 @@ extern tree default_builtin_vectorized_function (tree, tree, tree);
extern tree default_builtin_vectorized_conversion (unsigned int, tree, tree);
-extern int default_builtin_vectorization_cost (enum vect_cost_for_stmt);
+extern int default_builtin_vectorization_cost (enum vect_cost_for_stmt, tree, int);
extern tree default_builtin_reciprocal (unsigned int, bool, bool);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d9e9a4025f9..f6a20dc290a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,1385 @@
+2010-07-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/aes-avx-check.h (main): Require OSXSAVE for
+ AVX support.
+ * gcc.target/i386/pclmul-avx-check.h (main): Likewise.
+ * gcc.target/x86_64/abi/avx/avx-check.h (main): Likewise.
+
+2010-07-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/target-supports.exp (add_options_for_tls): New proc.
+ * g++.dg/tls/static-1.C: Use dg-add-options tls.
+ * g++.dg/tls/static-1a.cc: Likewise.
+ * gcc.dg/tls/emutls-1.c: Likewise.
+ * gcc.dg/tls/opt-11.c: Likewise.
+ * gcc.dg/tls/opt-12.c: Likewise.
+ * gcc.dg/tls/pr24428-2.c: Likewise.
+ * gcc.dg/tls/pr24428.c: Likewise.
+ * obj-c++.dg/tls/static-1.mm: Likewise.
+ * obj-c++.dg/torture/tls/thr-init-1.mm: Likewise.
+ * obj-c++.dg/torture/tls/thr-init-2.mm: Likewise.
+ * obj-c++.dg/torture/tls/thr-init-3.mm: Likewise.
+ * objc.dg/torture/tls/thr-init-2.m: Likewise.
+ * objc.dg/torture/tls/thr-init-3.m: Likewise.
+ * objc.dg/torture/tls/thr-init.m: Likewise.
+ * gcc.dg/lto/20090210_0.c: Add -pthread for *-*-solaris2.[89].
+
+2010-07-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/tree-ssa/loadpre6.c: Cleanup fre dump file.
+ * gcc.dg/ipa/ipa-sra-6.c: Cleanup eipa_sra dump file.
+ * gcc.dg/ipa/pure-const-2.c: Cleanup local-pure-const1 and
+ optimized dump files.
+
+2010-07-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/45047
+ * gcc.c-torture/compile/pr45047.c: New test.
+
+2010-07-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/float-range-3.c: Use "dg-do compile" dejagnu directive
+ instead of dg-compile.
+ * gcc.dg/float-range-4.c: Ditto.
+ * gcc.dg/float-range-5.c: Ditto.
+ * gcc.dg/fold-overflow-1.c: Ditto.
+ * gcc.dg/gomp/sections-4.c: Ditto.
+ * gcc.dg/transparent-union-1.c: Ditto.
+ * gcc.dg/transparent-union-2.c: Ditto.
+ * gcc.target/i386/pr39315-check.c: Ditto.
+ * g++.dg/gomp/sections-4.C: Ditto.
+ * g++.dg/template/dtor7.C: Ditto.
+ * g++.dg/tree-ssa/pr19952.C: Ditto.
+ * gfortran.dg/derived_constructor_comps_3.f90: Ditto.
+ * gfortran.dg/graphite/pr42185.f90: Ditto.
+ * gfortran.dg/namelist_36.f90: Ditto.
+ * gnat.dg/noreturn1.adb: Ditto.
+ * gnat.dg/specs/small_alignment.ads: Ditto.
+
+2010-07-23 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44915
+ * g++.dg/torture/pr44915.C: New test.
+
+2010-07-23 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44914
+ * g++.dg/tree-ssa/pr44914.C: New test.
+
+2010-07-23 Jie Zhang <jie@codesourcery.com>
+
+ PR target/44290
+ * gcc.dg/pr44290-1.c: New test.
+ * gcc.dg/pr44290-2.c: New test.
+
+2010-07-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/45008
+ * g++.dg/abi/mangle44.C: New.
+
+2010-07-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/*.c: Do not require sse{,2,3,4} effective target
+ for compile-time only tests.
+ * gcc.target/i386/pr39315-2.c: Remove redundant sse2 effective
+ target check.
+ * gcc.target/i386/pr39315-4.c: Ditto.
+ * gcc.target/i386/vperm-v4si-1.c: Remove sse_runtime effective
+ target check. Include sse-os-support.h.
+ (main): Call check_isa and sse_os_support.
+ * gcc.target/i386/vperm-v4sf-1.c: Ditto.
+ * gcc.target/i386/vperm-v4si-2.c (main): Call check_isa.
+ * gcc.target/i386/vperm-v4sf-2.c: Ditto.
+ * gcc.target/i386/vperm-v2di.c: Remove sse2_runtime effective
+ target check. Include sse-os-support.h.
+ (main): Call check_isa and sse_os_support.
+ * gcc.target/i386/vperm-v2df.c: Ditto.
+
+2010-07-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * lib/target-supports.exp (check_avx_hw_available): New procedure.
+ (check_effective_target_avx_runtime): New procedure.
+ (check_effective_target_sse2_runtime): Add check_effective_target_sse2.
+ (check_effective_target_sse_runtime): Add check_effective_target_sse.
+
+ * gcc.dg/compat/pr38736_main.c: Use avx_runtime effective target.
+ * gcc.dg/compat/vector-1b_main.c: Ditto. Remove cpuid.h include
+ and __get_cpuid test.
+ * gcc.dg/compat/vector-2b_main.c: Ditto.
+
+ * gcc.target/i386/avx-check.h (main): Also check bit_OSXSAVE.
+
+ * gcc.dg/20020418-1.c: Do not require sse{,2} effective target
+ for compile-time only test.
+ * gcc.dg/pr32716.c: Ditto.
+ * gcc.dg/pr34856.c: Ditto.
+ * gcc.dg/pr36997.c: Ditto.
+ * gcc.dg/prefetch-loop-arrays-1.c: Ditto.
+ * gfortran.dg/pr28158.f90: Ditto.
+ * gfortran.dg/pr30667.f: Ditto.
+
+ * gcc.dg/vect/vect.exp: Use check_effective_target_sse2_runtime for
+ i?86-*-* and x86_64-*-* targets to disable execution on targets
+ without sse2 runtime support.
+ * g++.dg/vect/vect.exp: Ditto.
+ * gfortran.dg/vect/vect.exp: Ditto.
+
+ * gcc.dg/pr36584.c: Remove redundant sse{,2} effective target check.
+ * gcc.dg/pr37544.c: Ditto.
+ * gcc.dg/pr40550.c: Ditto.
+ * gcc.dg/compat/union-m128-1_main.c: Ditto.
+ * gcc.dg/compat/vector-1a_main.c: Ditto.
+ * gcc.dg/compat/vector-2a_main.c: Ditto.
+ * gcc.dg/torture/pr16104-1.c: Ditto.
+ * gcc.dg/torture/pr35771-1.c: Ditto.
+ * gcc.dg/torture/pr35771-2.c: Ditto.
+ * gcc.dg/torture/pr35771-3.c: Ditto.
+ * gcc.dg/torture/stackalign/alloca-2.c: Ditto.
+ * gcc.dg/torture/stackalign/alloca-3.c: Ditto.
+ * gcc.dg/torture/stackalign/push-1.c: Ditto.
+ * gcc.dg/torture/stackalign/vararg-3.c: Ditto.
+ * g++.dg/other/i386-1.C: Ditto.
+ * g++.dg/other/pr40446.C: Ditto.
+
+2010-07-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/pr43058.c: Use dg-timeout-factor 4.
+
+2010-07-23 Daniel Kraft <d@domob.eu>
+
+ PR fortran/44709
+ * gfortran.dg/exit_1.f08: New test.
+ * gfortran.dg/exit_2.f08: New test.
+
+2010-07-22 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR tree-optimization/39839
+ * gcc.target/arm/pr39839.c: New test case.
+
+2010-07-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/unchecked_convert5b.adb: New test.
+ * gnat.dg/unchecked_convert6.adb: Likewise.
+ * gnat.dg/unchecked_convert6b.adb: Likewise.
+
+2010-07-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/aggr15.ad[sb]: New test.
+
+2010-07-22 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/45024
+ * g++.dg/debug/dwarf2/nested-2.C: New test case.
+
+2010-07-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.dg/lto/20100722-1_0.c: Replace dg-require-lto-plugin
+ with dg-require-linker-plugin.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/43850
+ * g++.dg/lto/20100722-1_0.C: New testcase.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ PR lto/42451
+ * gcc.dg/lto/20100720-3_0.c: New testcase.
+ * gcc.dg/lto/20100720-3_1.c: Likewise.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ * lib/target-supports-dg.exp (dg-require-linker-plugin): New proc.
+ * lib/target-supports.exp (check_linker_plugin_available): Likewise.
+
+ PR lto/43373
+ * gcc.dg/lto/20100722-1_0.c: New testcase.
+
+2010-07-22 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44891
+ * testsuite/gcc.c-torture/compile/pr44891.c: New test.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/45017
+ * gcc.c-torture/execute/pr45017.c: New testcase.
+
+2010-07-22 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45019
+ * gfortran.dg/aliasing_dummy_5.f90: New.
+
+2010-07-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ PR target/43698
+ * gcc.target/arm/pr43698.c: New test.
+
+2010-07-21 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/44929
+ * Revert my commit r162325 for this PR.
+
+2010-07-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45015
+ * gcc.target/m68k/pr45015.c: New test.
+
+2010-07-21 Jeffrey Yasskin <jyasskin@google.com>
+
+ PR c++/44641
+ * lib/scanasm.exp (dg-function-on-line): Fix regex for IA64's
+ comments.
+
+2010-07-21 Richard Guenther <rguenther@suse.de>
+
+ PR lto/45018
+ * g++.dg/lto/20100721-1_0.C: New testcase.
+
+2010-07-21 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/44900
+ * g++.dg/torture/pr44900.C: New test.
+
+2010-07-21 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR middle-end/44738
+ * c-c++-common/uninit-17.c: Correct expected error.
+
+2010-07-21 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/guality/asm-1.c: New test.
+
+ PR debug/45003
+ * gcc.dg/guality/pr45003-2.c: New test.
+ * gcc.dg/guality/pr45003-3.c: New test.
+
+2010-07-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/44697
+ * gfortran.dg/ftell_3.f90: Take care of cr-lf record endings.
+
+2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
+
+ * lib/scanasm.exp (dg-function-on-line): Test that a function is
+ defined on the current line.
+ * g++.dg/debug/dwarf2/lineno-simple1.C: New. Line number sanity test.
+ * g++.dg/debug/dwarf2/pr44641.C: New.
+
+2010-07-20 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc.target/powerpc/block-move-1.c: New test.
+ * gcc.target/powerpc/block-move-2.c: New test.
+
+2010-07-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/44967
+ * g++.dg/cpp0x/sfinae2.C: New.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR lto/42696
+ * gcc.dg/lto/20100720-4_0.c: New testcase.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR lto/43221
+ * gcc.dg/lto/20100720-2_0.c: New testcase.
+ * gcc.dg/lto/20100720-2_1.c: Likewise.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR lto/43208
+ * gcc.dg/lto/20100720-1_0.c: New testcase.
+ * gcc.dg/lto/20100720-1_1.c: Likewise.
+
+2010-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45003
+ * gcc.dg/guality/pr45003-1.c: New test.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44977
+ * gcc.dg/torture/pr44977.c: New testcase.
+
+2010-07-20 Bingfeng Mei <bmei@broadcom.com>
+
+ * gcc.dg/lto/20090313_0.c: Use dg-require-effective-target
+ sync_char_short
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44971
+ PR middle-end/44988
+ * gcc.dg/pr44971.c: New testcase.
+ * gcc.c-torture/compile/pr44988.c: Likewise.
+
+2010-07-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/44929
+ * gfortran.dg/allocate_with_typespec.f90: New test.
+ * gfortran.dg/allocate_derived_1.f90: Update error message.
+
+2010-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/44996
+ * g++.dg/cpp0x/decltype23.C: New.
+
+2010-07-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/42385
+ * gfortran.dg/class_defined_operator_1.f03 : New test.
+
+2010-07-19 Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.dg/vect/slp-perm-1.c (main): Make sure loops aren't vectorized.
+ * gcc.dg/vect/slp-perm-2.c (main): Likewise.
+ * gcc.dg/vect/slp-perm-3.c (main): Likewise. Fix loop limit.
+ * gcc.dg/vect/slp-perm-4.c (main): Fix loop limit.
+
+2010-07-19 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44941
+ * gcc.c-torture/compile/pr44941.c: New testcase.
+
+2010-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/44969
+ * g++.dg/template/sfinae24.C: New.
+
+2010-07-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR fortran/44353
+ * gfortran.dg/data_implied_do_2.f90: Removed.
+
+2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44969
+ * g++.dg/template/sfinae23.C: New.
+
+2010-07-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/target-supports.exp (check_sse_os_support_available): New
+ proc.
+ (check_sse_hw_available): New proc.
+ (check_effective_target_sse_runtime): New proc.
+ (check_effective_target_sse2_runtime): New proc.
+ * lib/fortran-torture.exp (get-fortran-torture-options): Only add
+ -msse2 if check_sse_os_support_available.
+ * g++.dg/vect/vect.exp: Only run -msse2 tests if
+ check_sse_os_support_available.
+ * gcc.dg/vect/vect.exp: Likewise.
+ * gfortran.dg/vect/vect.exp: Likewise.
+ * gcc.target/i386/sol2-check: Renamed to ...
+ * gcc.target/i386/sse-os-support.h: ... this.
+ (sol2_check): Renamed to ...
+ (sse_os_support): ... this.
+ Only test movss with xmm registers.
+ * gcc.target/i386/sse-check.h: Reflect new header and function names.
+ Removed ILL_INSN, ILL_INSN_LEN.
+ * gcc.target/i386/sse2-check.h: Likewise.
+ * gcc.target/i386/sse3-check.h: Likewise.
+ * gcc.dg/pr40550.c: Use dg-require-effective-target sse_runtime.
+ Removed cpuid.h, __get_cpuid test.
+ * g++.dg/other/i386-1.C: Use dg-require-effective-target sse2_runtime.
+ Removed cpuid.h, __get_cpuid test.
+ * g++.dg/other/pr40446.C: Likewise.
+ * gcc.dg/compat/union-m128-1_main.c: Likewise.
+ * gcc.dg/compat/vector-1a_main.c: Likewise.
+ * gcc.dg/compat/vector-2a_main.c: Likewise.
+ * gcc.dg/pr36584.c: Likewise.
+ * gcc.dg/pr37544.c: Likewise.
+ * gcc.dg/torture/pr16104-1.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-2.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-3.c: Likewise.
+ * gcc.dg/torture/stackalign/push-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-3.c: Likewise.
+ * gcc.dg/torture/pr35771.h: Removed cpuid.h, __get_cpuid test.
+ * gcc.dg/torture/pr35771-1.c: Use dg-require-effective-target
+ sse2_runtime.
+ * gcc.dg/torture/pr35771-2.c: Likewise.
+ * gcc.dg/torture/pr35771-3.c: Likewise.
+ * gcc.target/i386/pr39315-2.c: Likewise.
+ * gcc.target/i386/pr39315-4.c: Likewise.
+ * gcc.target/i386/vperm-v2df.c: Likewise.
+ * gcc.target/i386/vperm-v2di.c: Likewise.
+ * gcc.target/i386/vperm-v4si-1.c: Likewise.
+ * gcc.target/i386/vperm-v4sf-1.c: Use dg-require-effective-target
+ sse_runtime.
+
+2010-07-18 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/44353
+ * gfortran.dg/data_implied_do_2.f90: New test.
+
+2010-07-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc.target/mips/cache-1.c: Allow 0 instead of 0x0.
+
+2010-07-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc.target/mips/mips.exp (mips_option_groups): Add -mflip-mips16
+ to the "mips16" group.
+ (mips_using_mips16_p): New procedure.
+ (mips-dg-options): Use it.
+
+2010-07-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc.target/mips/mips16-attributes-4.c: New test.
+
+2010-07-17 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR testsuite/44418
+ * gcc.target/powerpc/recip-1.c: Do not run for powerpc*-apple-darwin*
+ * gcc.target/powerpc/recip-2.c: Ditto.
+ * gcc.target/powerpc/recip-3.c: Ditto.
+
+2010-07-17 Bernd Schmidt <bernds@codesourcery.com>
+
+ * gcc.target/arm/pr42235.c: New test.
+
+2010-07-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/32505
+ * g++.dg/template/partial8.C: New.
+
+2010-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/guality/guality.exp: Run also c-c++-common/guality/ tests.
+ * gcc.dg/guality/guality.h: Include unistd.h. Make the header usable
+ in C++.
+ (gualcvt): New overloaded inline.
+ (GUALCVT): Use it for C++.
+ * g++.dg/guality/guality.exp: New.
+ * g++.dg/guality/guality.h: New.
+ * g++.dg/guality/redeclaration1.C: New test.
+ * g++.dg/dg.exp: Prune also guality/* tests.
+ * gcc.dg/guality/pr43141.c: Moved to...
+ * c-c++-common/guality/pr43141.c: ... here.
+
+2010-07-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/37077
+ * gfortran.dg/char4_iunit_2.f03: New test.
+
+2010-07-16 Iain Sandoe <iains@gcc.gnu.org>
+
+ * lib/plugin-support.exp (plugin-test-execute):
+ Add ${gcc_objdir}/intl to includes.
+
+2010-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/44942
+ * gcc.c-torture/execute/pr44942.c: New test.
+ * gcc.target/i386/pr44942.c: New test.
+
+2010-07-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/44909
+ * g++.dg/cpp0x/implicit7.C: New.
+ * g++.dg/cpp0x/implicit8.C: New.
+
+2010-07-15 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ Disable float tests for __SPU__ targets due to lack of signed zero:
+ * c-c++-common/torture/complex-sign-add.c (check_add_float).
+ * c-c++-common/torture/complex-sign-sub.c (check_sub_float).
+ * c-c++-common/torture/complex-sign-mul.c (check_mul_float).
+ * c-c++-common/torture/complex-sign-mul-one.c (check_mul_float).
+ * c-c++-common/torture/complex-sign-mul-minus-one.c (check_mul_float).
+ * c-c++-common/torture/complex-sign-mixed-add.c (check_add_float).
+ * c-c++-common/torture/complex-sign-mixed-sub.c (check_sub_float).
+ * c-c++-common/torture/complex-sign-mixed-mul.c (check_mul_float).
+ * c-c++-common/torture/complex-sign-mixed-div.c (check_div_float).
+
+2010-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ * gfortran.dg/select_char_2.f90: New test.
+
+2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN
+ with DECL_CHAIN.
+
+2010-07-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44936
+ * gfortran.dg/typebound_generic_9.f03: New.
+
+2010-07-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44946
+ * gcc.c-torture/compile/pr44946.c: New testcase.
+
+2010-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/40206
+ * gfortran.dg/select_char_3.f90: New test.
+
+2010-07-15 Magnus Granberg <zorry@gentoo.org>
+ Kevin F. Quinn <kevquinn@gentoo.org>
+
+ * gcc.dg/Wtrampolines.c: New.
+
+2010-07-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/44934
+ * gfortran.dg/endfile_2.f90: Fix to unformatted file type.
+
+2010-07-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/44810
+ * g++.dg/torture/pr36745.C: Avoid undefined behavior.
+
+ Implement C++0x unrestricted unions (N2544)
+ * g++.dg/cpp0x/union1.C: New.
+ * g++.dg/cpp0x/union2.C: New.
+ * g++.dg/cpp0x/union3.C: New.
+ * g++.dg/cpp0x/defaulted2.C: Adjust.
+ * g++.old-deja/g++.bugs/900121_02.C: Adjust.
+ * g++.old-deja/g++.ext/anon2.C: Adjust.
+ * g++.old-deja/g++.mike/misc6.C: Adjust.
+
+2010-07-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44925
+ * gfortran.dg/c_loc_tests_15.f90: New.
+
+2010-07-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/44909
+ * g++.dg/cpp0x/implicit6.C: New.
+
+2010-07-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/44540
+ * g++.dg/abi/noreturn1.C: New.
+ * g++.dg/abi/noreturn2.C: New.
+
+2010-07-13 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR other/44874
+ PR debug/44832
+ * c-c++-common/pr44832.c: New test.
+
+2010-07-13 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR objc/44488
+ * lib/objc-torture.exp (objc-set-runtime-options): Base runtime list
+ on the target. Make sure that we can assemble the emitted asm when
+ the test type is 'compile'.
+
+2010-07-13 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36960
+ * g++.dg/torture/pr36960.C: New testcase.
+
+2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44908
+ * g++.dg/template/sfinae21.C: New.
+ * g++.dg/template/sfinae22.C: Likewise.
+
+2010-07-16 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR testsuite/42843
+ * gcc.dg/plugin/selfassign.c: Include diagnostic.h.
+ * gcc.dg/plugin/ggcplug.c: Likewise.
+ * g++.dg/plugin/selfassign.c: Likewise.
+ * g++.dg/plugin/attribute_plugin.c: Likewise.
+ * g++.dg/plugin/dumb_plugin.c: Likewise.
+ * g++.dg/plugin/pragma_plugin.c: Likewise.
+
+2010-07-13 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * gcc.c-torture/execute/pr44683.x: New.
+ * gcc.dg/torture/builtin-cproj-1.c: Add dg-add-options ieee.
+
+2010-07-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44434
+ PR fortran/44565
+ PR fortran/43945
+ PR fortran/44869
+ * gfortran.dg/dynamic_dispatch_1.f03: Fixed invalid test case.
+ * gfortran.dg/dynamic_dispatch_2.f03: Ditto.
+ * gfortran.dg/dynamic_dispatch_3.f03: Ditto.
+ * gfortran.dh/typebound_call_16.f03: New.
+ * gfortran.dg/typebound_generic_6.f03: New.
+ * gfortran.dg/typebound_generic_7.f03: New.
+ * gfortran.dg/typebound_generic_8.f03: New.
+
+2010-07-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/37077
+ * gfortran.dg/char4_iunit_1.f03: New test.
+
+2010-07-12 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/tree-ssa/vrp53.c: New test.
+
+2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44907
+ * g++.dg/template/sfinae19.C: New.
+ * g++.dg/template/sfinae20.C: Likewise.
+
+2010-07-12 Jie Zhang <jie@codesourcery.com>
+
+ * gcc.target/arm/interrupt-1.c: New test.
+ * gcc.target/arm/interrupt-2.c: New test.
+
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/pr42427.c: Require c99_runtime.
+ * gcc.target/i386/avx-cmpsd-1.c: Use dg-require-effective-target
+ c99_runtime.
+ * gcc.target/i386/avx-cmpss-1.c: Likewise.
+ * gcc.target/i386/avx-vcmppd-1.c: Likewise.
+ * gcc.target/i386/avx-vcmppd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpps-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpsd-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpss-1.c: Likewise.
+ * gcc.target/i386/sse-cmpss-1.c: Likewise.
+ * gcc.target/i386/sse2-cmpsd-1.c: Likewise
+ * gcc.target/i386/pr37275.c: Require visibility support.
+
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/target-supports.exp (check_effective_target_sse): New proc.
+ * gcc.target/i386/sol2-check.h: New file.
+ * gcc.target/i386/sse-check.h (ILL_INSN, ILL_INSN_LEN): Define.
+ Include sol2-check.h.
+ (main) Only run do_test () if sol2_check ().
+ * gcc.target/i386/sse2-check.h: Likewise.
+ * gcc.target/i386/sse3-check.h: Likewise.
+ * gcc.dg/vect/tree-vect.h (check_vect) [__i386__ || __x86_64__]
+ [__sun__ && __svr4__]: Execute SSE2 instruction.
+ * gcc.target/i386/math-torture/math-torture.exp: Only add options
+ with -msse to MATH_TORTURE_OPTIONS if check_effective_target_sse.
+ * g++.dg/debug/dwarf2/const2b.C: Use dg-require-effective-target sse.
+ * g++.dg/ext/vector14.C: Likewise.
+ * g++.dg/other/mmintrin.C: Likewise.
+ * gcc.dg/20020418-1.c: Likewise.
+ * gcc.dg/debug/dwarf2/const-2b.c: Likewise.
+ * gcc.dg/format/ms_unnamed-1.c: Likewise.
+ * gcc.dg/format/unnamed-1.c: Likewise.
+ Adapt dg-warning line number.
+ * gcc.dg/graphite/pr40281.c: Likewise.
+ * gcc.dg/pr32176.c: Likewise.
+ * gcc.dg/pr40550.c: Likewise.
+ * gcc.dg/prefetch-loop-arrays-1.c: Likewise.
+ * gcc.dg/torture/pr36891.c: Likewise.
+ * gcc.target/i386/20020218-1.c: Likewise.
+ * gcc.target/i386/20020523.c: Likewise.
+ * gcc.target/i386/abi-1.c: Likewise.
+ * gcc.target/i386/brokensqrt.c: Likewise.
+ * gcc.target/i386/fastcall-sseregparm.c: Likewise.
+ * gcc.target/i386/pr13366.c: Likewise.
+ * gcc.target/i386/pr13685.c: Likewise.
+ * gcc.target/i386/pr24306.c: Likewise.
+ * gcc.target/i386/pr31486.c: Likewise.
+ * gcc.target/i386/pr32065-1.c: Likewise.
+ * gcc.target/i386/pr32065-2.c: Likewise.
+ * gcc.target/i386/pr32389.c: Likewise.
+ * gcc.target/i386/pr38824.c: Likewise.
+ * gcc.target/i386/pr38931.c: Likewise.
+ * gcc.target/i386/pr39592-1.c: Likewise.
+ * gcc.target/i386/pr43766.c: Likewise.
+ * gcc.target/i386/recip-divf.c: Likewise.
+ * gcc.target/i386/recip-sqrtf.c: Likewise.
+ * gcc.target/i386/recip-vec-divf.c: Likewise.
+ * gcc.target/i386/recip-vec-sqrtf.c: Likewise.
+ * gcc.target/i386/sse-1.c: Likewise.
+ * gcc.target/i386/sse-16.c: Likewise.
+ * gcc.target/i386/sse-2.c: Likewise.
+ * gcc.target/i386/sse-20.c: Likewise.
+ * gcc.target/i386/sse-3.c: Likewise.
+ * gcc.target/i386/sse-7.c: Likewise.
+ * gcc.target/i386/sse-9.c: Likewise.
+ * gcc.target/i386/sse-addps-1.c: Likewise.
+ * gcc.target/i386/sse-addss-1.c: Likewise.
+ * gcc.target/i386/sse-andnps-1.c: Likewise.
+ * gcc.target/i386/sse-andps-1.c: Likewise.
+ * gcc.target/i386/sse-cmpss-1.c: Likewise.
+ * gcc.target/i386/sse-comiss-1.c: Likewise.
+ * gcc.target/i386/sse-comiss-2.c: Likewise.
+ * gcc.target/i386/sse-comiss-3.c: Likewise.
+ * gcc.target/i386/sse-comiss-4.c: Likewise.
+ * gcc.target/i386/sse-comiss-5.c: Likewise.
+ * gcc.target/i386/sse-comiss-6.c: Likewise.
+ * gcc.target/i386/sse-copysignf-vec.c: Likewise.
+ * gcc.target/i386/sse-cvtsi2ss-1.c: Likewise.
+ * gcc.target/i386/sse-cvtsi2ss-2.c: Likewise.
+ * gcc.target/i386/sse-cvtss2si-1.c: Likewise.
+ * gcc.target/i386/sse-cvtss2si-2.c: Likewise.
+ * gcc.target/i386/sse-cvttss2si-1.c: Likewise.
+ * gcc.target/i386/sse-cvttss2si-2.c: Likewise.
+ * gcc.target/i386/sse-divps-1.c: Likewise.
+ * gcc.target/i386/sse-divss-1.c: Likewise.
+ * gcc.target/i386/sse-init-v4hi-1.c: Likewise.
+ * gcc.target/i386/sse-init-v4sf-1.c: Likewise.
+ * gcc.target/i386/sse-maxps-1.c: Likewise.
+ * gcc.target/i386/sse-maxss-1.c: Likewise.
+ * gcc.target/i386/sse-minps-1.c: Likewise.
+ * gcc.target/i386/sse-minss-1.c: Likewise.
+ * gcc.target/i386/sse-movaps-1.c: Likewise.
+ * gcc.target/i386/sse-movaps-2.c: Likewise.
+ * gcc.target/i386/sse-movhlps-1.c: Likewise.
+ * gcc.target/i386/sse-movhps-1.c: Likewise.
+ * gcc.target/i386/sse-movhps-2.c: Likewise.
+ * gcc.target/i386/sse-movlhps-1.c: Likewise.
+ * gcc.target/i386/sse-movmskps-1.c: Likewise.
+ * gcc.target/i386/sse-movntps-1.c: Likewise.
+ * gcc.target/i386/sse-movss-1.c: Likewise.
+ * gcc.target/i386/sse-movss-2.c: Likewise.
+ * gcc.target/i386/sse-movss-3.c: Likewise.
+ * gcc.target/i386/sse-movups-1.c: Likewise.
+ * gcc.target/i386/sse-movups-2.c: Likewise.
+ * gcc.target/i386/sse-mulps-1.c: Likewise.
+ * gcc.target/i386/sse-mulss-1.c: Likewise.
+ * gcc.target/i386/sse-orps-1.c: Likewise.
+ * gcc.target/i386/sse-rcpps-1.c: Likewise.
+ * gcc.target/i386/sse-recip-vec.c: Likewise.
+ * gcc.target/i386/sse-recip.c: Likewise.
+ * gcc.target/i386/sse-rsqrtps-1.c: Likewise.
+ * gcc.target/i386/sse-set-ps-1.c: Likewise.
+ * gcc.target/i386/sse-sqrtps-1.c: Likewise.
+ * gcc.target/i386/sse-subps-1.c: Likewise.
+ * gcc.target/i386/sse-subss-1.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-1.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-2.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-3.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-4.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-5.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-6.c: Likewise.
+ * gcc.target/i386/sse-unpckhps-1.c: Likewise.
+ * gcc.target/i386/sse-unpcklps-1.c: Likewise.
+ * gcc.target/i386/sse-xorps-1.c: Likewise.
+ * gcc.target/i386/ssefn-1.c: Likewise.
+ * gcc.target/i386/ssefn-3.c: Likewise.
+ * gcc.target/i386/sseregparm-1.c: Likewise.
+ * gcc.target/i386/stackalign/return-3.c: Likewise.
+ * gcc.target/i386/vectorize1.c: Likewise.
+ * gcc.target/i386/vperm-v4sf-1.c: Likewise.
+ * gcc.target/i386/xorps-sse.c: Likewise.
+ * gfortran.dg/pr28158.f90: Likewise.
+ * gfortran.dg/pr30667.f: Likewise.
+ * gnat.dg/loop_optimization7.adb: Likewise.
+ * gnat.dg/sse_nolib.adb: Likewise.
+
+2010-07-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/44702
+ * gfortran.dg/use_rename_6.f90: New.
+ * gfortran.dg/use_iso_c_binding.f90: Update dg-error.
+
+2010-07-11 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44869
+ * gfortran.dg/class_24.f03: New.
+
+2010-07-10 Richard Guenther <rguenther@suse.de>
+
+ PR lto/44889
+ * gcc.dg/lto/20100709-1_0.c: New testcase.
+ * gcc.dg/lto/20100709-1_1.c: Likewise.
+
+2010-07-10 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * gcc.dg/attr-weak-hidden-1.c, gcc.dg/attr-weak-hidden-1a.c: New test.
+
+2010-07-10 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR objc/44140
+ * objc.dg/lto/trivial-1_0.m: New.
+ * objc.dg/lto/lto.exp: New.
+ * obj-c++.dg/lto/trivial-1_0.mm: New.
+ * obj-c++.dg/lto/lto.exp: New.
+ * objc.dg/symtab-1.m: Adjust sizes.
+ * objc.dg/image-info.m: Do not run for gnu-runtime.
+
+2010-07-09 Bernd Schmidt <bernds@codesourcery.com>
+
+ * gcc.dg/pr32370.c: Allow another kind of error message.
+
+2010-07-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/atomic3.adb: New test.
+
+2010-07-09 Jakub Jelinek <jakub@redhat.com>
+ Denys Vlasenko <dvlasenk@redhat.com>
+ Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ PR tree-optimization/28632
+ * gcc.dg/tree-ssa/vrp51.c: New test.
+ * gcc.dg/tree-ssa/vrp52.c: New test.
+
+2010-07-09 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/abi/covariant6.C: New.
+ * g++.dg/inherit/covariant17.C: Test both bases.
+ * g++.dg/inherit/covariant7.C: Check vtable layout.
+
+2010-07-09 Tom de Vries <tjvries@xs4all.nl>
+
+ * gcc.dg/debug/dwarf2/pr31230.c: New testcase.
+
+2010-07-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44852
+ * gcc.c-torture/execute/pr44852.c: New testcase.
+
+2010-07-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.target/x86_64/abi/asm-support.S (snapshot): Replace
+ multiplication by values.
+ * gcc.target/x86_64/abi/asm-support-darwin.s (_snapshot): Likewise.
+ * gcc.target/x86_64/abi/avx/asm-support.S (snapshot): Likewise.
+
+2010-07-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44882
+ * gfortran.dg/pr44882.f90: New testcase.
+
+2010-07-09 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/40657
+ * gcc.target/arm/pr40657-1.c: New test.
+ * gcc.target/arm/pr40657-2.c: New test.
+ * gcc.c-torture/execute/pr40657.c: New test.
+
+2010-07-09 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/tree-ssa/vrp50.c: New test.
+ * gcc.dg/vect/slp-perm-4.c (main): Make sure loop isn't vectorized.
+
+2010-07-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/44649
+ * gfortran.dg/c_sizeof_1.f90: Modified.
+ * gfortran.dg/storage_size_1.f08: New.
+ * gfortran.dg/storage_size_2.f08: New.
+
+2010-07-08 Mikael Pettersson <mikpe@it.uu.se>
+
+ * gcc.c-torture/execute/20100708-1.c: New test.
+
+2010-07-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/44847
+ * gfortran.dg/gomp/pr44847.f90: New test.
+
+2010-07-08 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/44710
+ * gcc.dg/tree-ssa/ifc-6.c: New.
+ * gcc.dg/tree-ssa/ifc-pr44710.c: New.
+
+2010-07-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/18918
+ * gfortran.dg/coarray_10.f90: Add an additional test.
+
+2010-07-08 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR middle-end/44828
+ * gcc.c-torture/execute/pr44828.c (foo): Use signed char.
+ * gcc.c-torture/execute/pr44828.x: Revert.
+
+2010-07-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/43120
+ * g++.dg/inherit/covariant17.C: New.
+ * g++.dg/abi/covariant1.C: Actually test for the bug.
+
+2010-07-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/44838
+ * gcc.dg/pr44838.c: New.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44831
+ * gcc.c-torture/compile/pr44831.c: New testcase.
+ * gcc.dg/tree-ssa/pr21463.c: Adjust.
+
+2010-07-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44861
+ * g++.dg/vect/pr44861.cc: New testcase.
+
+2010-07-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR middle-end/44828
+ * gcc.c-torture/execute/pr44828.x: New file.
+
+2010-07-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ * g++.dg/ext/altivec-2.C: Add -Wno-unused-but-set-variable to
+ dg-options.
+ * g++.dg/ext/altivec-17.C: Adjust error message.
+
+2010-07-07 Tom Tromey <tromey@redhat.com>
+
+ * g++.dg/debug/dwarf2/pubnames-1.C: Make darwin-specific.
+
+2010-07-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/44844
+ * gcc.target/i386/rdrand-1.c: Scan "jnc".
+ * gcc.target/i386/rdrand-2.c: Likewise.
+ * gcc.target/i386/rdrand-3.c: Likewise.
+
+2010-07-07 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/44813
+ * g++.dg/torture/pr44813.C: New testcase.
+ * g++.dg/torture/pr44826.C: New testcase.
+
+2010-07-07 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR rtl-optimization/44787
+ * gcc.c-torture/compile/pr44788.c: New test.
+ * gcc.target/arm/pr44788.c: New test.
+
+2010-07-06 Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.target/powerpc/altivec-volatile.c: Adjust expected warning.
+
+2010-07-06 Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.target/powerpc/ppu-intrinsics.c: Add -Wno-unused-but-set-variable
+ to dg-options.
+
+2010-07-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/44742
+ * gfortran.dg/parameter_array_init_6.f90: New.
+ * gfortran.dg/initialization_20.f90: Update dg-error.
+ * gfortran.dg/initialization_24.f90: Ditto.
+
+2010-07-06 Thomas Koenig <tkoenig@gcc.gnu.org>
+ PR fortran/PR44693
+ * gfortran.dg/dim_range_1.f90: New test.
+ * gfortran.dg/minmaxloc_4.f90: Remove invalid test.
+
+2010-07-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/44703
+ * g++.dg/cpp0x/initlist41.C: New.
+
+ PR c++/44778
+ * g++.dg/template/ptrmem22.C: New.
+
+2010-07-06 Kai Tietz <kai.tietz@onevision.com>
+
+ * gcc.target/i386/ms_hook_prologue.c: Add x64 ms_hook_prologue
+ support.
+ * gcc.target/i386/i386.exp: Likewise.
+
+2010-07-06 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR testsuite/44195
+ * gcc.dg/lto/20100518_0.c: Limit to x86.
+
+2010-07-06 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44828
+ * gcc.c-torture/execute/pr44828.c: New testcase.
+
+2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * g++.dg/warn/noeffect2.C: Adjust expected warning.
+ * g++.dg/warn/volatile1.C: Likewise.
+ * g++.dg/template/warn1.C: Likewise.
+
+2010-07-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ AVX Programming Reference (June, 2010)
+ * g++.dg/other/i386-2.C: Add -mfsgsbase -mrdrnd -mf16c.
+ * g++.dg/other/i386-3.C: Likewise.
+ * gcc.target/i386/sse-12.c: Likewise.
+
+ * gcc.target/i386/f16c-check.h: New.
+ * gcc.target/i386/rdfsbase-1.c: Likewise.
+ * gcc.target/i386/rdfsbase-2.c: Likewise.
+ * gcc.target/i386/rdgsbase-1.c: Likewise.
+ * gcc.target/i386/rdgsbase-2.c: Likewise.
+ * gcc.target/i386/rdrand-1.c: Likewise.
+ * gcc.target/i386/rdrand-2.c: Likewise.
+ * gcc.target/i386/rdrand-3.c: Likewise.
+ * gcc.target/i386/vcvtph2ps-1.c: Likewise.
+ * gcc.target/i386/vcvtph2ps-2.c: Likewise.
+ * gcc.target/i386/vcvtph2ps-3.c: Likewise.
+ * gcc.target/i386/vcvtps2ph-1.c: Likewise.
+ * gcc.target/i386/vcvtps2ph-2.c: Likewise.
+ * gcc.target/i386/vcvtps2ph-3.c: Likewise.
+ * gcc.target/i386/wrfsbase-1.c: Likewise.
+ * gcc.target/i386/wrfsbase-2.c: Likewise.
+ * gcc.target/i386/wrgsbase-1.c: Likewise.
+ * gcc.target/i386/wrgsbase-2.c: Likewise.
+
+ * gcc.target/i386/sse-13.c: Add -mfsgsbase -mrdrnd -mf16c.
+ (__builtin_ia32_vcvtps2ph): New.
+ (__builtin_ia32_vcvtps2ph256): Likewise.
+
+ * gcc.target/i386/sse-14.c: Add -mfsgsbase -mrdrnd -mf16c.
+ Test _cvtss_sh, _mm_cvtps_ph and _mm256_cvtps_ph.
+
+ * gcc.target/i386/sse-22.c: Add fsgsbase,rdrnd,f16c.
+ Test _cvtss_sh, _mm_cvtps_ph and _mm256_cvtps_ph.
+
+ * gcc.target/i386/sse-23.c (__builtin_ia32_vcvtps2ph): New.
+ (__builtin_ia32_vcvtps2ph256): Likewise.
+ Add fsgsbase,rdrnd,f16c.
+
+ * lib/target-supports.exp (check_effective_target_f16c): New.
+
+2010-07-05 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/guality/nrv-1.c: New test.
+
+2010-07-05 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR middle-end/42505
+ * gcc.target/arm/pr42505.c: New test case.
+
+2010-07-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44808
+ * g++.dg/opt/nrv16.C: New test.
+
+2010-07-05 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44784
+ * gcc.c-torture/compile/pr44784.c: New testcase.
+
+2010-07-05 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c:
+ Increase loop bound and array size.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+
+2010-07-05 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c: Remove.
+ * gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c: Increase loop bound.
+ * gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Likewise.
+ * gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c: Remove.
+ * gcc.dg/vect/pr35821-altivec.c, gcc.dg/vect/pr35821-spu.c: Likewise.
+
+2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR c++/22138
+ * g++.dg/parse/template25.C: New.
+
+2010-07-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/44695
+ * gcc.dg/torture/pr44695.c: New.
+
+2010-07-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c++/16630
+ * g++.dg/ext/pretty3.C: New.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44809
+ * g++.dg/torture/pr44809.C: New testcase.
+
+2010-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44656
+ * gcc.dg/tree-ssa/loadpre6.c: Remove XFAIL.
+
+2010-07-04 Ira Rosen <irar@il.ibm.com>
+ Revital Eres <eres@il.ibm.com>
+
+ * gcc.dg/vect/vect-42.c: Don't expect peeling on targets that support
+ misaligned stores.
+ * gcc.dg/vect/vect-60.c, gcc.dg/vect/vect-56.c, gcc.dg/vect/vect-93.c,
+ gcc.dg/vect/vect-96.c: Likewise.
+ * gcc.dg/vect/vect-109.c: Expect vectorization only on targets that
+ that support misaligned stores. Change the number of expected
+ misaligned accesses.
+ * gcc.dg/vect/vect-peel-1.c: New test.
+ * gcc.dg/vect/vect-peel-2.c, gcc.dg/vect/vect-peel-3.c,
+ gcc.dg/vect/vect-peel-4.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-1.c: Change the test to make it
+ vectorizable on all targets that support realignment.
+ * gcc.dg/vect/vect-multitypes-4.c: Likewise.
+
+2010-07-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c/44806
+ * gcc.dg/torture/pr44806.c: New.
+
+2010-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/cond_expr1.adb: New test.
+
+2010-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/modular3.adb: New test.
+ * gnat.dg/modular3_pkg.ads: New helper.
+
+2010-07-03 Iain Sandoe <iains@gcc.gnu.org>
+ Mikael Pettersson <mikpe@it.uu.se>
+
+ PR testsuite/44518
+ * obj-c++.dg/encode-2.mm: Produce object and save temps.
+ Make signed-ness of chars explicit. Scan the object for
+ strings that are split by some target assemblers.
+ * obj-c++.dg/encode-3.mm: Make the signed-ness of chars
+ explicit.
+
+2010-07-03 Hans-Peter Nilsson <hp@axis.com>
+
+ * gfortran.dg/char_bounds_check_fail_1.f90: Correct dg-output string.
+
+2010-07-02 Le-Chun Wu <lcwu@google.com>
+
+ PR/44128
+ * g++.dg/warn/Wshadow-7.C: New test.
+
+2010-07-02 Daniel Jacobowitz <dan@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ * gcc.c-torture/execute/20100416-1.c: New test case.
+
+2010-07-02 Julian Brown <julian@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ PR target/43703
+
+ * gcc.dg/vect/vect.exp: Add -ffast-math for NEON.
+ * gcc.dg/vect/vect-reduc-6.c: Add XFAIL for NEON.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+
+ * gcc.target/arm/neon/vadds64.c: Regenerated.
+ * gcc.target/arm/neon/vaddu64.c: Regenerated.
+ * gcc.target/arm/neon/vsubs64.c: Regenerated.
+ * gcc.target/arm/neon/vsubu64.c: Regenerated.
+ * gcc.target/arm/neon-vmla-1.c: Add -ffast-math to options.
+ * gcc.target/arm/neon-vmls-1.c: Likewise.
+ * gcc.target/arm/neon-vsubs64.c: New execution test.
+ * gcc.target/arm/neon-vsubu64.c: New execution test.
+ * gcc.target/arm/neon-vadds64.c: New execution test.
+ * gcc.target/arm/neon-vaddu64.c: New execution test.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gcc.target/arm/neon-vands64.c: New.
+ * gcc.target/arm/neon-vandu64.c: New.
+ * gcc.target/arm/neon-vbics64.c: New.
+ * gcc.target/arm/neon-vbicu64.c: New.
+ * gcc.target/arm/neon-veors64.c: New.
+ * gcc.target/arm/neon-veoru64.c: New.
+ * gcc.target/arm/neon-vorns64.c: New.
+ * gcc.target/arm/neon-vornu64.c: New.
+ * gcc.target/arm/neon-vorrs64.c: New.
+ * gcc.target/arm/neon-vorru64.c: New.
+ * gcc.target/arm/neon/vands64.c: Regenerated.
+ * gcc.target/arm/neon/vandu64.c: Regenerated.
+ * gcc.target/arm/neon/vbics64.c: Regenerated.
+ * gcc.target/arm/neon/vbicu64.c: Regenerated.
+ * gcc.target/arm/neon/veors64.c: Regenerated.
+ * gcc.target/arm/neon/veoru64.c: Regenerated.
+ * gcc.target/arm/neon/vorns64.c: Regenerated.
+ * gcc.target/arm/neon/vornu64.c: Regenerated.
+ * gcc.target/arm/neon/vorrs64.c: Regenerated.
+ * gcc.target/arm/neon/vorru64.c: Regenerated.
+
+2010-07-02 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * gfortran.dg/runtime_warning_1.f90: Remove extra dg line.
+
+2010-07-02 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * gfortran.dg/runtime_warning_1.f90: Fix dg syntax.
+ * gfortran.dg/intent_out_5.f90: Same.
+ * gfortran.dg/ltrans-7.f90: Same.
+ * gfortran.dg/char_bounds_check_fail_1.f90: Same.
+
+2010-07-02 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/ipa-split-5.c: New function.
+
+2010-07-02 Iain Sandoe <iains@gcc.gnu.org>
+
+ * objc-obj-c++-shared/Object1.h: Correct Line endings.
+
+2010-07-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44780
+ * c-c++-common/Wunused-var-12.c: New test.
+
+2010-07-02 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR target/42835
+ * gcc.target/arm/pr42835.c: New test.
+
+ PR target/42172
+ * gcc.target/arm/pr42172-1.c: New test.
+
+2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/template/crash98.C: Remove stray // from dg-error comment.
+
+2010-07-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gcc.target/arm/neon/vdup_ns64.c: Regenerated.
+ * gcc.target/arm/neon/vdup_nu64.c: Regenerated.
+ * gcc.target/arm/neon/vdupQ_ns64.c: Regenerated.
+ * gcc.target/arm/neon/vdupQ_nu64.c: Regenerated.
+ * gcc.target/arm/neon/vmov_ns64.c: Regenerated.
+ * gcc.target/arm/neon/vmov_nu64.c: Regenerated.
+ * gcc.target/arm/neon/vmovQ_ns64.c: Regenerated.
+ * gcc.target/arm/neon/vmovQ_nu64.c: Regenerated.
+ * gcc.target/arm/neon/vget_lanes64.c: Regenerated.
+ * gcc.target/arm/neon/vget_laneu64.c: Regenerated.
+ * gcc.target/arm/neon/vset_lanes64.c: Regenerated.
+ * gcc.target/arm/neon/vset_laneu64.c: Regenerated.
+ * gcc.target/arm/neon-vdup_ns64.c: New.
+ * gcc.target/arm/neon-vdup_nu64.c: New.
+ * gcc.target/arm/neon-vdupQ_ns64.c: New.
+ * gcc.target/arm/neon-vdupQ_nu64.c: New.
+ * gcc.target/arm/neon-vdupQ_lanes64.c: New.
+ * gcc.target/arm/neon-vdupQ_laneu64.c: New.
+ * gcc.target/arm/neon-vmov_ns64.c: New.
+ * gcc.target/arm/neon-vmov_nu64.c: New.
+ * gcc.target/arm/neon-vmovQ_ns64.c: New.
+ * gcc.target/arm/neon-vmovQ_nu64.c: New.
+ * gcc.target/arm/neon-vget_lanes64.c: New.
+ * gcc.target/arm/neon-vget_laneu64.c: New.
+ * gcc.target/arm/neon-vset_lanes64.c: New.
+ * gcc.target/arm/neon-vset_laneu64.c: New.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ * g++.dg/torture/20100702-1.C: New testcase.
+
+2010-07-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR target/44707
+ * gcc.c-torture/compile/pr44707.c: New test.
+
+2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44039
+ * g++.dg/template/crash101.C: New.
+
+2010-07-02 Iain Sandoe <iains@gcc.gnu.org>
+
+ * obj-c++.dg/cxx-ivars-3.mm: Make the test require OSX <= 10.4.
+ Use the ABI-0 accessors and fail it for m64.
+
+2010-07-02 Jan Hubicka <jh@suse.cz>
+
+ * g++.dg/tree-ssa/pr44706.C: New testcase.
+
+2010-07-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44748
+ * gcc.dg/tree-ssa/ssa-ccp-29.c: New testcase.
+
+2010-07-02 Iain Sandoe <iains@gcc.gnu.org>
+
+ * objc-obj-c++-shared/next-abi.h: Remove dependency on system
+ headers. Add clause to reflect that, pre-10.5, ABI is always 0.
+ * objc/execute/forward-1.m: Depend only on __NEXT_RUNTIME__ for
+ the method types to forward:.
+
+2010-06-30 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/nullptr04.C: Use __INTPTR_TYPE__.
+ * g++.dg/other/pr25632.C: Likewise.
+
+2010-07-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/40421
+ * gfortran.fortran-torture/compile/pr40421.f90: New test.
+
+2010-07-01 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/42834
+ PR middle-end/44468
+ * gcc.c-torture/execute/20100316-1.c: New testcase.
+ * gcc.c-torture/execute/pr44468.c: Likewise.
+ * gcc.c-torture/compile/20100609-1.c: Likewise.
+ * gcc.dg/volatile2.c: Adjust.
+ * gcc.dg/plugin/selfassign.c: Likewise.
+ * gcc.dg/pr36902.c: Likewise.
+ * gcc.dg/tree-ssa/foldaddr-2.c: Remove.
+ * gcc.dg/tree-ssa/foldaddr-3.c: Likewise.
+ * gcc.dg/tree-ssa/forwprop-8.c: Adjust.
+ * gcc.dg/tree-ssa/pr17141-1.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise.
+ * gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-7.c: Likewise.
+ * gcc.dg/tree-ssa/forwprop-10.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise.
+ * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
+ * gcc.dg/tree-ssa/forwprop-1.c: Likewise.
+ * gcc.dg/tree-ssa/forwprop-2.c: Likewise.
+ * gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-pre-26.c: Likewise.
+ * gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-pre-7.c: Likewise.
+ * gcc.dg/tree-ssa/forwprop-5.c: Likewise.
+ * gcc.dg/struct/w_prof_two_strs.c: XFAIL.
+ * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise.
+ * gcc.dg/struct/wo_prof_global_var.c: Likewise.
+ * gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise.
+ * gcc.dg/struct/w_prof_local_array.c: Likewise.
+ * gcc.dg/struct/w_prof_single_str_global.c: Likewise.
+ * gcc.dg/struct/wo_prof_escape_str_init.c: Likewise.
+ * gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise.
+ * gcc.dg/struct/w_prof_global_array.c: Likewise.
+ * gcc.dg/struct/wo_prof_array_field.c: Likewise.
+ * gcc.dg/struct/wo_prof_single_str_local.c: Likewise.
+ * gcc.dg/struct/w_prof_local_var.c: Likewise.
+ * gcc.dg/struct/wo_prof_two_strs.c: Likewise.
+ * gcc.dg/struct/wo_prof_empty_str.c: Likewise.
+ * gcc.dg/struct/wo_prof_local_array.c: Likewise.
+ * gcc.dg/struct/w_prof_global_var.c: Likewise.
+ * gcc.dg/struct/wo_prof_single_str_global.c: Likewise.
+ * gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise.
+ * gcc.dg/struct/wo_prof_global_array.c: Likewise.
+ * gcc.dg/struct/wo_prof_escape_return.c: Likewise.
+ * gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise.
+ * gcc.dg/struct/wo_prof_double_malloc.c: Likewise.
+ * gcc.dg/struct/w_ratio_cold_str.c: Likewise.
+ * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise.
+ * gcc.dg/struct/wo_prof_local_var.c: Likewise.
+ * gcc.dg/tree-prof/stringop-1.c: Adjust.
+ * g++.dg/tree-ssa/pr31146.C: Likewise.
+ * g++.dg/tree-ssa/copyprop-1.C: Likewise.
+ * g++.dg/tree-ssa/pr33604.C: Likewise.
+ * g++.dg/plugin/selfassign.c: Likewise.
+ * gfortran.dg/array_memcpy_3.f90: Likewise.
+ * gfortran.dg/array_memcpy_4.f90: Likewise.
+ * c-c++-common/torture/pr42834.c: New testcase.
+
+2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44628
+ * g++.dg/template/crash100.C: New.
+
2010-06-30 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/ipa-split-4.c: New testcase.
diff --git a/gcc/testsuite/c-c++-common/Wunused-var-12.c b/gcc/testsuite/c-c++-common/Wunused-var-12.c
new file mode 100644
index 00000000000..312680a72e8
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wunused-var-12.c
@@ -0,0 +1,25 @@
+/* PR c++/44780 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef double vec __attribute__ ((__vector_size__ (16)));
+vec c, d;
+
+void
+foo (void)
+{
+ vec a;
+ vec b;
+ a = c;
+ b = a;
+ d = b;
+}
+
+void
+bar (void)
+{
+ vec a;
+ vec b; /* { dg-warning "set but not used" } */
+ a = c;
+ b = a;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr43141.c b/gcc/testsuite/c-c++-common/guality/pr43141.c
index e6fe79a0efc..e6fe79a0efc 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43141.c
+++ b/gcc/testsuite/c-c++-common/guality/pr43141.c
diff --git a/gcc/testsuite/c-c++-common/pr44832.c b/gcc/testsuite/c-c++-common/pr44832.c
new file mode 100644
index 00000000000..4138e37f01d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr44832.c
@@ -0,0 +1,160 @@
+/* PR debug/44832 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+typedef const struct rtx_def *const_rtx;
+struct rtvec_def;
+typedef struct rtvec_def *rtvec;
+extern int ix86_isa_flags;
+
+enum machine_mode
+{
+ VOIDmode,
+ V8HImode,
+ V16QImode,
+ V4SImode,
+ V2DImode,
+ V32QImode,
+ MAX_MACHINE_MODE,
+
+ NUM_MACHINE_MODES = MAX_MACHINE_MODE
+};
+extern unsigned char mode_size[NUM_MACHINE_MODES];
+extern const unsigned char mode_inner[NUM_MACHINE_MODES];
+extern const unsigned char mode_nunits[NUM_MACHINE_MODES];
+enum rtx_code {
+
+CONST_INT ,
+
+CONST_FIXED ,
+
+CONST_DOUBLE
+
+ };
+union rtunion_def
+{
+ rtvec rt_rtvec;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def {
+
+ __extension__ enum rtx_code code: 16;
+
+ __extension__ enum machine_mode mode : 8;
+
+ union u {
+ rtunion fld[1];
+ } u;
+};
+struct rtvec_def {
+ rtx elem[1];
+};
+extern int rtx_equal_p (const_rtx, const_rtx);
+extern rtx gen_reg_rtx (enum machine_mode);
+
+extern void
+ix86_expand_vector_init_concat (enum machine_mode mode,
+ rtx target, rtx *ops, int n);
+
+static void
+ix86_expand_vector_init_general (unsigned char mmx_ok, enum machine_mode mode,
+ rtx target, rtx vals)
+{
+ rtx ops[32], op0, op1;
+ enum machine_mode half_mode = VOIDmode;
+ int n, i;
+
+ switch (mode)
+ {
+ case V4SImode:
+ case V2DImode:
+ n = mode_nunits[mode];
+ ix86_expand_vector_init_concat (mode, target, ops, n);
+ return;
+
+ case V32QImode:
+ goto half;
+half:
+{
+ typedef int eger;
+ if (mode != V4SImode)
+ ops[0] = 0;
+}
+ n = mode_nunits[mode];
+ for (i = 0; i < n; i++)
+ ops[i] = (((((vals)->u.fld[0]).rt_rtvec))->elem[i]);
+ op0 = gen_reg_rtx (VOIDmode);
+ return;
+
+ case V16QImode:
+ if (!((ix86_isa_flags & (1 << 19)) != 0))
+ break;
+
+ case V8HImode:
+ if (!((ix86_isa_flags & (1 << 17)) != 0))
+ break;
+
+ n = mode_nunits[mode];
+ for (i = 0; i < n; i++)
+ ops[i] = (((((vals)->u.fld[0]).rt_rtvec))->elem[i]);
+ return;
+
+ default:
+ ;
+ }
+
+ {
+ int n_words;
+
+ n_words = ((unsigned short) mode_size[mode]) / 4;
+
+ if (n_words == 4)
+ ix86_expand_vector_init_general (0, V4SImode, 0, 0);
+ }
+}
+
+
+void
+ix86_expand_vector_init (unsigned char mmx_ok, rtx target, rtx vals)
+{
+ enum machine_mode mode = ((enum machine_mode) (target)->mode);
+ enum machine_mode inner_mode = ((enum machine_mode) mode_inner[mode]);
+ int n_elts = mode_nunits[mode];
+ int n_var = 0, one_var = -1;
+ unsigned char all_same = 1, all_const_zero = 1;
+ int i;
+ rtx x;
+
+ for (i = 0; i < n_elts; ++i)
+ {
+ x = (((((vals)->u.fld[0]).rt_rtvec))->elem[i]);
+ if (!((((enum rtx_code) (x)->code) == CONST_INT)
+ || ((enum rtx_code) (x)->code) == CONST_DOUBLE
+ || ((enum rtx_code) (x)->code) == CONST_FIXED))
+ n_var++, one_var = i;
+ else
+ all_const_zero = 0;
+ if (i > 0 && !rtx_equal_p (x, (((((vals)->u.fld[0]).rt_rtvec))->elem[0])))
+ all_same = 0;
+ }
+
+
+ if (n_var == 0)
+ {
+ return;
+ }
+
+ if (all_same)
+ return;
+
+ if (n_var == 1)
+ {
+ if (all_const_zero)
+ return;
+
+ }
+
+ ix86_expand_vector_init_general (mmx_ok, mode, target, vals);
+}
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-add.c b/gcc/testsuite/c-c++-common/torture/complex-sign-add.c
index e81223224dc..bcaf8bba9e3 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-add.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-add.c
@@ -28,7 +28,9 @@
void
check_add_float (void)
{
+#ifndef __SPU__
CHECK_ADD (float, __builtin_copysignf, 0.0f, 0.0if);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-add.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-add.c
index d1e20912ae1..caea562e8bd 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-add.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-add.c
@@ -28,7 +28,9 @@
void
check_add_float (void)
{
+#ifndef __SPU__
CHECK_ADD (float, __builtin_copysignf, 0.0f, 0.0if);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-div.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-div.c
index f7ee48341c0..269d5ec42ea 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-div.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-div.c
@@ -20,7 +20,9 @@
void
check_div_float (void)
{
+#ifndef __SPU__
CHECK_DIV (float, __builtin_copysignf, 0.0f, 0.0if, 1.0f);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-mul.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-mul.c
index 02f936b75bd..e79db6d4559 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-mul.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-mul.c
@@ -28,7 +28,9 @@
void
check_mul_float (void)
{
+#ifndef __SPU__
CHECK_MUL (float, __builtin_copysignf, 0.0f, 0.0if);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-sub.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-sub.c
index 739500d2f8b..d9e083cfdce 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-sub.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mixed-sub.c
@@ -28,7 +28,9 @@
void
check_sub_float (void)
{
+#ifndef __SPU__
CHECK_SUB (float, __builtin_copysignf, 0.0f, 0.0if);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mul-minus-one.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mul-minus-one.c
index 05cc4fabea4..d20b5e6c87f 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mul-minus-one.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mul-minus-one.c
@@ -36,7 +36,9 @@
void
check_mul_float (void)
{
+#ifndef __SPU__
CHECK_MUL (float, __builtin_copysignf, 0.0f, 0.0if, 1.0f);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mul-one.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mul-one.c
index 014d813e99e..ad02a2cd666 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mul-one.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mul-one.c
@@ -36,7 +36,9 @@
void
check_mul_float (void)
{
+#ifndef __SPU__
CHECK_MUL (float, __builtin_copysignf, 0.0f, 0.0if, 1.0f);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-mul.c b/gcc/testsuite/c-c++-common/torture/complex-sign-mul.c
index 08d247aa5c0..a3274d2ea44 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-mul.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-mul.c
@@ -28,7 +28,9 @@
void
check_mul_float (void)
{
+#ifndef __SPU__
CHECK_MUL (float, __builtin_copysignf, 0.0f, 0.0if);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/complex-sign-sub.c b/gcc/testsuite/c-c++-common/torture/complex-sign-sub.c
index d4da14dc5f5..0a4e3029e68 100644
--- a/gcc/testsuite/c-c++-common/torture/complex-sign-sub.c
+++ b/gcc/testsuite/c-c++-common/torture/complex-sign-sub.c
@@ -28,7 +28,9 @@
void
check_sub_float (void)
{
+#ifndef __SPU__
CHECK_SUB (float, __builtin_copysignf, 0.0f, 0.0if);
+#endif
}
void
diff --git a/gcc/testsuite/c-c++-common/torture/pr42834.c b/gcc/testsuite/c-c++-common/torture/pr42834.c
new file mode 100644
index 00000000000..a1ba49e46d4
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/torture/pr42834.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+void __attribute__((noinline,noclone))
+foo(int *p, float *q) { __asm__ volatile ("" : : : "memory"); }
+
+int main()
+{
+ if (sizeof (int) == sizeof (float))
+ {
+ int i;
+ float f;
+ int *p;
+ /* Prevent i and f from being rewritten into SSA form. */
+ foo (&i, &f);
+ i = 0;
+ f = 1.0;
+ p = (int *)&f;
+ __builtin_memcpy (&i, p, 4);
+ if (*(float *)&i != 1.0)
+ __builtin_abort ();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/uninit-17.c b/gcc/testsuite/c-c++-common/uninit-17.c
index b895ac7dcd9..628296213d5 100644
--- a/gcc/testsuite/c-c++-common/uninit-17.c
+++ b/gcc/testsuite/c-c++-common/uninit-17.c
@@ -9,9 +9,9 @@ static void bar(int a, int *ptr)
{
do
{
- int b; /* { dg-message "note: 'b' was declared here" } */
+ int b; /* { dg-warning "is used uninitialized" } */
if (b < 40) {
- ptr[0] = b; /* { dg-warning "may be used uninitialized" } */
+ ptr[0] = b;
}
b += 1;
ptr++;
diff --git a/gcc/testsuite/g++.dg/abi/covariant1.C b/gcc/testsuite/g++.dg/abi/covariant1.C
index 203ec2c9fcb..ae8c5e603da 100644
--- a/gcc/testsuite/g++.dg/abi/covariant1.C
+++ b/gcc/testsuite/g++.dg/abi/covariant1.C
@@ -1,8 +1,8 @@
// { dg-do compile }
// { dg-options "-w" }
-// We don't want to use a covariant thunk to have a virtual
-// primary base
+// If a covariant thunk is overriding a virtual primary base, we have to
+// use the vcall offset even though we know it will be 0.
struct c4 {};
@@ -16,6 +16,11 @@ struct c12 : c11 { };
struct c14 :
virtual c12,
- virtual c11 { virtual c12* f17(); };
+ virtual c11 { virtual void f(); c12* f17(); };
-// { dg-final { scan-assembler-not "\n_ZTch0_v0_n16_N3c143f17Ev\[: \t\n\]" } }
+void c14::f() { }
+
+// { dg-final { scan-assembler "_ZTcv0_n12_v0_n16_N3c143f17Ev" { target ilp32 } } }
+// { dg-final { scan-assembler-not "_ZTch0_v0_n16_N3c143f17Ev" } }
+// { dg-final { scan-assembler "_ZTcv0_n24_v0_n32_N3c143f17Ev" { target lp64 } } }
+// { dg-final { scan-assembler-not "_ZTch0_v0_n32_N3c143f17Ev" } }
diff --git a/gcc/testsuite/g++.dg/abi/covariant6.C b/gcc/testsuite/g++.dg/abi/covariant6.C
new file mode 100644
index 00000000000..9dfc5ba74ab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/covariant6.C
@@ -0,0 +1,34 @@
+struct A
+{
+ virtual A* f();
+};
+
+struct B: virtual A
+{
+ virtual A* f();
+};
+
+struct C: B
+{
+ virtual C* f();
+};
+
+C* C::f() { return 0; }
+
+// When we emit C::f, we should emit both thunks: one for B and one for A.
+// { dg-final { scan-assembler "_ZTch0_v0_n16_N1C1fEv" { target ilp32 } } }
+// { dg-final { scan-assembler "_ZTch0_v0_n32_N1C1fEv" { target lp64 } } }
+// { dg-final { scan-assembler "_ZTcv0_n12_v0_n16_N1C1fEv" { target ilp32 } } }
+// { dg-final { scan-assembler "_ZTcv0_n24_v0_n32_N1C1fEv" { target lp64 } } }
+
+struct D: B
+{
+ virtual void dummy ();
+ virtual D* f();
+};
+
+void D::dummy() { }
+
+// When we emit the D vtable, it should refer to the thunk for B.
+// { dg-final { scan-assembler "_ZTch0_v0_n16_N1D1fEv" { target ilp32 } } }
+// { dg-final { scan-assembler "_ZTch0_v0_n32_N1D1fEv" { target lp64 } } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle44.C b/gcc/testsuite/g++.dg/abi/mangle44.C
new file mode 100644
index 00000000000..8454148421c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle44.C
@@ -0,0 +1,19 @@
+// PR c++/45008
+
+template <typename T>
+struct A
+{
+ void fn1 () {
+ struct Nested {
+ static void fn2 () { }
+ };
+ Nested::fn2();
+ }
+};
+
+void fn3 () {
+ A<double> a;
+ a.fn1();
+}
+
+// { dg-final { scan-assembler-not "_ZZN1AIT_E3fn1EvEN6Nested3fn2Ev" } }
diff --git a/gcc/testsuite/g++.dg/abi/noreturn1.C b/gcc/testsuite/g++.dg/abi/noreturn1.C
new file mode 100644
index 00000000000..0532cf2f803
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/noreturn1.C
@@ -0,0 +1,14 @@
+// Test that attribute noreturn is not part of the mangled name.
+// { dg-options -fabi-version=0 }
+
+void baz (const char *fmt, ...);
+
+// { dg-final { scan-assembler "_Z3barPFvPKczE" } }
+void bar (void (*baz) (const char *fmt, ...)
+ __attribute__ ((noreturn, format (printf, 1, 2))));
+
+void
+foo ()
+{
+ bar (&baz);
+}
diff --git a/gcc/testsuite/g++.dg/abi/noreturn2.C b/gcc/testsuite/g++.dg/abi/noreturn2.C
new file mode 100644
index 00000000000..72accafe660
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/noreturn2.C
@@ -0,0 +1,14 @@
+// Test for buggy mangling of attribute noreturn in abi<=4
+// { dg-options -fabi-version=4 }
+
+void baz (const char *fmt, ...);
+
+// { dg-final { scan-assembler "_Z3barPVFvPKczE" } }
+void bar (void (*baz) (const char *fmt, ...)
+ __attribute__ ((noreturn, format (printf, 1, 2))));
+
+void
+foo ()
+{
+ bar (&baz);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype23.C b/gcc/testsuite/g++.dg/cpp0x/decltype23.C
new file mode 100644
index 00000000000..78eb89d8ee2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype23.C
@@ -0,0 +1,5 @@
+// { dg-options -std=c++0x }
+
+int x, &&y = static_cast<int &&>(x);
+typedef decltype((y)) myInt; // `y' is a parenthesized id-expression of type int that is an lvalue
+typedef int &myInt;
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
index 909ebc5e6e0..1f400f4fad0 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
@@ -54,7 +54,7 @@ G::G() = default;
union U
{
- G g; // { dg-error "constructor" }
+ G g; // { dg-error "union member.*non-trivial" }
};
int main()
@@ -62,5 +62,7 @@ int main()
F f;
F f2(f); // { dg-error "use" }
B* b = new const B; // { dg-error "uninitialized const" }
+ U u; // { dg-error "deleted" }
}
+// { dg-prune-output "implicitly deleted because" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit6.C b/gcc/testsuite/g++.dg/cpp0x/implicit6.C
new file mode 100644
index 00000000000..c7902969dce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit6.C
@@ -0,0 +1,23 @@
+// Circular implicit declarations were causing errors
+// { dg-options -std=c++0x }
+
+struct Ray;
+
+struct Vector
+{
+ virtual void f(); // make non-trivially-copyable
+ Vector(const Ray &) ;
+};
+
+struct array
+{
+ Vector v;
+};
+
+struct Ray
+{
+ array a;
+};
+
+extern Ray r1;
+Ray r2=r1;
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit7.C b/gcc/testsuite/g++.dg/cpp0x/implicit7.C
new file mode 100644
index 00000000000..f29e5009fbd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit7.C
@@ -0,0 +1,37 @@
+// PR c++/44909
+// { dg-options -std=c++0x }
+// Declaring A<D<E>>'s copy ctor means choosing a ctor to initialize D<E>,
+// which means choosing a ctor for C<B<E>>, which meant considering
+// C(const B<E>&) which means choosing a ctor for B<E>, which means choosing
+// a ctor for A<D<E>>. Cycle.
+
+template<typename T>
+struct A
+{
+ T t;
+};
+
+template <typename T>
+struct B
+{
+ typename T::U u;
+};
+
+template <typename T>
+struct C
+{
+ C(const T&);
+};
+
+template <typename T>
+struct D
+{
+ C<B<T> > v;
+};
+
+struct E {
+ typedef A<D<E> > U;
+};
+
+extern A<D<E> > a;
+A<D<E> > a2(a);
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit8.C b/gcc/testsuite/g++.dg/cpp0x/implicit8.C
new file mode 100644
index 00000000000..2f3febae8b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit8.C
@@ -0,0 +1,34 @@
+// The hack for PR c++/44909 breaks this testcase. We need feedback
+// from the C++ committee to know how to proceed.
+// { dg-options -std=c++0x }
+// { dg-prune-output "implicitly deleted" }
+// { dg-prune-output "cannot bind" }
+// { dg-prune-output "initializing argument" }
+
+struct A
+{
+ A();
+ A(A&);
+};
+
+struct B;
+struct BP
+{
+ BP(const B&);
+};
+
+struct B
+{
+ B();
+ B(B&&);
+ B(const BP&);
+};
+
+// If B(B&&) suppresses the B copy constructor, then copying the B
+// subobject of C should use B(const BP&). But we ignore that constructor
+// in order to break the cycle in 44909. Perhaps the move ctor shouldn't
+// suppress the copy ctor?
+struct C: A, B { };
+
+C c;
+C c2(c); // { dg-bogus "deleted" "" { xfail *-*-* } }
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist41.C b/gcc/testsuite/g++.dg/cpp0x/initlist41.C
new file mode 100644
index 00000000000..b5385480c89
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist41.C
@@ -0,0 +1,14 @@
+// PR c++/44703
+// { dg-options -std=c++0x }
+
+#include <initializer_list>
+
+typedef std::initializer_list<int> type ;
+void f(type) {}
+
+int main()
+{
+// error: could not convert '{1, 2, 3}' to 'type'
+ f({1,2,3}) ;
+}
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr04.C b/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
index 6e1d1256c57..be581bcb6e3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
@@ -3,17 +3,15 @@
// Test cast to int
-#define unsigned
-__extension__ typedef __SIZE_TYPE__ ssize_t;
-#undef unsigned
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
const int n4 = static_cast<const int>(nullptr); // { dg-error "invalid static_cast " }
const short int n5 = reinterpret_cast<short int>(nullptr); // { dg-error "loses precision" }
-const ssize_t n6 = reinterpret_cast<ssize_t>(nullptr);
-const ssize_t n7 = (ssize_t)nullptr;
+const intptr_t n6 = reinterpret_cast<intptr_t>(nullptr);
+const intptr_t n7 = (intptr_t)nullptr;
decltype(nullptr) mynull = 0;
const int n8 = static_cast<const int>(mynull); // { dg-error "invalid static_cast " }
const short int n9 = reinterpret_cast<short int>(mynull); // { dg-error "loses precision" }
-const ssize_t n10 = reinterpret_cast<ssize_t>(mynull);
-const ssize_t n11 = (ssize_t)mynull;
+const intptr_t n10 = reinterpret_cast<intptr_t>(mynull);
+const intptr_t n11 = (intptr_t)mynull;
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae2.C b/gcc/testsuite/g++.dg/cpp0x/sfinae2.C
new file mode 100644
index 00000000000..b9ef70d99cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae2.C
@@ -0,0 +1,39 @@
+// PR c++/44967
+// { dg-options -std=c++0x }
+
+template <typename T> T&& declval();
+
+template<typename T1, typename T2, typename... Args>
+struct has_construct
+{
+ typedef char one;
+ typedef struct {char _m[2]; } two;
+
+ template<typename U1, typename U2, typename... Args2>
+ static decltype(declval<U1>().construct(declval<U2*>(), declval<Args2>()...), one()) test(int);
+ template<typename, typename, typename...>
+ static two test(...);
+
+ static const bool value = sizeof(test<T1, T2, Args...>(0)) == 1;
+};
+
+
+struct A0
+{};
+
+struct A1
+{
+ void construct(int*, int);
+};
+
+template<typename _Tp>
+struct A2
+{
+ template<typename _Tp1, typename... _Args>
+ void construct(_Tp1*, _Args&&...) {}
+};
+
+#define SA(X) static_assert(X,#X)
+SA((!has_construct<A0, int, int>::value)); // ok
+SA((has_construct<A1, int, int>::value)); // bang
+SA((has_construct<A2<int>, int>::value)); // bang
diff --git a/gcc/testsuite/g++.dg/cpp0x/union1.C b/gcc/testsuite/g++.dg/cpp0x/union1.C
new file mode 100644
index 00000000000..291853d5aae
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/union1.C
@@ -0,0 +1,34 @@
+// Negative test for C++0x unrestricted unions
+// { dg-options -std=c++0x }
+// { dg-prune-output "implicitly deleted because" }
+
+struct A
+{
+ A();
+ A(const A&);
+ ~A();
+};
+
+union B
+{
+ A a; // { dg-error "union member" }
+};
+
+B b; // { dg-error "B::B\\(\\)" }
+B b2(b); // { dg-error "B::B\\(const B&\\)" }
+
+struct C
+{
+ union
+ {
+ A a; // { dg-error "union member" }
+ };
+};
+
+C c; // { dg-error "C::C\\(\\)" }
+C c2(c); // { dg-error "C::C\\(const C&\\)" }
+
+// { dg-error "B::~B" "" { target *-*-* } 17 }
+// { dg-error "B::~B" "" { target *-*-* } 18 }
+// { dg-error "C::~C" "" { target *-*-* } 28 }
+// { dg-error "C::~C" "" { target *-*-* } 29 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/union2.C b/gcc/testsuite/g++.dg/cpp0x/union2.C
new file mode 100644
index 00000000000..4f193e281c8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/union2.C
@@ -0,0 +1,34 @@
+// Positive test for C++0x unrestricted unions
+// { dg-options -std=c++0x }
+
+struct A
+{
+ A();
+ A(const A&);
+ ~A();
+};
+
+union B
+{
+ A a;
+ B();
+ B(const B&);
+ ~B();
+};
+
+B b;
+B b2(b);
+
+struct C
+{
+ union
+ {
+ A a;
+ };
+ C();
+ C(const C&);
+ ~C();
+};
+
+C c;
+C c2(c);
diff --git a/gcc/testsuite/g++.dg/cpp0x/union3.C b/gcc/testsuite/g++.dg/cpp0x/union3.C
new file mode 100644
index 00000000000..f1e8ddb6109
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/union3.C
@@ -0,0 +1,69 @@
+// Runtime test for C++0x unrestricted unions
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+int c, d;
+struct A
+{
+ int i;
+ A(): i(1) { ++c; }
+ A(const A&): i(2) { ++c; }
+ ~A() { ++d; }
+};
+
+union B
+{
+ A a;
+ B() { }
+ B(const B& b) { }
+ ~B() { }
+};
+
+struct C
+{
+ union { A a; };
+ C() { }
+ C(const C&) { }
+ ~C() { }
+};
+
+union D
+{
+ A a;
+ D(): a() { }
+ D(const D& d): a(d.a) { }
+ ~D() { a.~A(); }
+};
+
+struct E
+{
+ union { A a; };
+ E(): a() { }
+ E(const E& e): a (e.a) { }
+ ~E() { a.~A(); }
+};
+
+int main()
+{
+ {
+ B b1;
+ B b2(b1);
+
+ C c1;
+ C c2(c1);
+ }
+
+ if (c != 0 || d != 0)
+ return c+d*10;
+
+ {
+ D d1;
+ D d2(d1);
+
+ E e1;
+ E e2(e1);
+ }
+
+ if (c != 4 || d != 4)
+ return c*100+d*1000;
+}
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C b/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C
index 593e080ac69..81360c2439f 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C
@@ -1,5 +1,6 @@
/* { dg-do compile { target i386*-*-* } } */
/* { dg-options "-O -gdwarf-2 -dA -msse" } */
+/* { dg-require-effective-target sse } */
/* { dg-final { scan-assembler "DW_AT_const_value" } } */
typedef float FloatVect __attribute__((__vector_size__(16)));
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C b/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C
new file mode 100644
index 00000000000..e0ef7f71ca3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-g -O0 -dA" }
+
+struct C { // { dg-function-on-line {_ZN1CC[12]Ev} }
+ virtual void
+ foo() {} // { dg-function-on-line _ZN1C3fooEv }
+};
+static C dummy;
+
+int
+main (void)
+{ // { dg-function-on-line main }
+}
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C
new file mode 100644
index 00000000000..2386baaacb9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C
@@ -0,0 +1,37 @@
+/*
+ Origin: PR debug/45024
+ { dg-options "-g -dA -fno-merge-debug-strings" }
+ { dg-do compile }
+*/
+
+struct S {
+ template<typename Z> struct T { };
+};
+
+S::T<int> tval;
+
+/*
+We want to express that the DIE of S::T<int> must be a child of the DIE of S, like in assembly this output:
+
+ .uleb128 0x2 # (DIE (0x9e) DW_TAG_structure_type)
+ .ascii "S\0" # DW_AT_name
+ .byte 0x1 # DW_AT_byte_size
+ .byte 0x1 # DW_AT_decl_file (../../prtests/test-PR45024.cc)
+ .byte 0x1 # DW_AT_decl_line
+ .long 0xbc # DW_AT_sibling
+ .uleb128 0x3 # (DIE (0xa8) DW_TAG_structure_type)
+ .ascii "T<int>\0" # DW_AT_name
+ .byte 0x1 # DW_AT_byte_size
+ .byte 0x1 # DW_AT_decl_file (../../prtests/test-PR45024.cc)
+ .byte 0x2 # DW_AT_decl_line
+ .uleb128 0x4 # (DIE (0xb3) DW_TAG_template_type_param)
+ .ascii "Z\0" # DW_AT_name
+ .long 0xbc # DW_AT_type
+ .byte 0 # end of children of DIE 0xa8
+ .byte 0 # end of children of DIE 0x9e
+
+Hence the slightly odd regexp:
+
+ { dg-final { scan-assembler "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"S\\\\0\"\[ \t\]+#\[ \t\]+DW_AT_name\[\n\r\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"T<int>\\\\0\"\[ \t\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_template_type_param\\)\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*#\[ \t\]+end of children of DIE\[^\n\r\]*\[\n\r\]+\[^\n\r\]*end of children of DIE\[^\n\r\]*" } }
+
+ */
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C
new file mode 100644
index 00000000000..2df002f6b00
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C
@@ -0,0 +1,41 @@
+// Origin: PR 44641
+// { dg-do compile }
+// { dg-options "-g -O0 -dA" }
+
+template <class A> struct MisplacedDbg;
+template<class T> struct MisplacedDbg<T*>;
+struct Full;
+template<> struct MisplacedDbg<Full>;
+
+struct Arg;
+typedef MisplacedDbg<Arg> Typedef1;
+typedef MisplacedDbg<Arg*> Typedef2;
+typedef MisplacedDbg<Full> Typedef3;
+
+template<typename T> struct Base {
+ virtual ~Base() {
+ }
+};
+
+template <>
+struct MisplacedDbg<Full> // { dg-function-on-line {_ZN12MisplacedDbgI4FullEC[12]Ev} }
+ // { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* } 21 }
+
+ : public Base<int> {
+};
+
+template <class T>
+struct MisplacedDbg<T*> // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgEC[12]Ev} }
+ // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* } 28 }
+ : public Base<int> {
+};
+
+template <class A>
+struct MisplacedDbg // { dg-function-on-line {_ZN12MisplacedDbgI3ArgEC[12]Ev} }
+ // { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* } 34 }
+ : public Base<int> {
+};
+
+static MisplacedDbg<Arg> static_var1;
+static MisplacedDbg<Arg*> static_var2;
+static MisplacedDbg<Full> static_var3;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
index 543439da323..18d1df0d952 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/39706
+// { dg-do compile { target *-*-darwin* } }
// { dg-options "-g -dA -fno-merge-debug-strings" }
-// { dg-do compile }
//
// There should be one debug_pubnames section generated.
// On Darwin though, there is also a label pointing at the begining of the
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
index 5758218a267..5851dcc94f2 100644
--- a/gcc/testsuite/g++.dg/dg.exp
+++ b/gcc/testsuite/g++.dg/dg.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2007, 2009, 2010 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -47,6 +47,7 @@ set tests [prune $tests $srcdir/$subdir/gomp/*]
set tests [prune $tests $srcdir/$subdir/tree-prof/*]
set tests [prune $tests $srcdir/$subdir/torture/*]
set tests [prune $tests $srcdir/$subdir/graphite/*]
+set tests [prune $tests $srcdir/$subdir/guality/*]
# Main loop.
dg-runtest $tests "" $DEFAULT_CXXFLAGS
diff --git a/gcc/testsuite/g++.dg/ext/altivec-17.C b/gcc/testsuite/g++.dg/ext/altivec-17.C
index e83c46b7039..54eff8a24ed 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-17.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-17.C
@@ -12,5 +12,5 @@ typedef vector__ bool__ int bool_simd_type;
void Foo (bool_simd_type const &a)
{
- simd_type const &v = a; // { dg-error "'const __vector.4. unsigned int&' from expression of type 'const __vector.4. __bool int'" }
+ simd_type const &v = a; // { dg-error "'const simd_type&' from expression of type 'const bool_simd_type'" }
}
diff --git a/gcc/testsuite/g++.dg/ext/altivec-2.C b/gcc/testsuite/g++.dg/ext/altivec-2.C
index 1185a79e5ec..eb8a92942bc 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-2.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-2.C
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -Wall" } */
+/* { dg-options "-maltivec -Wall -Wno-unused-but-set-variable" } */
/* This test checks if AltiVec builtins accept const-qualified
arguments. */
diff --git a/gcc/testsuite/g++.dg/ext/pretty3.C b/gcc/testsuite/g++.dg/ext/pretty3.C
new file mode 100644
index 00000000000..01b14579af2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/pretty3.C
@@ -0,0 +1,19 @@
+// PR c++/16630
+// { dg-do compile }
+// { dg-options "" }
+extern "C" int printf (const char*, ...);
+
+template <class T>
+struct B { typedef T X; };
+
+template <class U>
+struct D
+{
+ const char* foo (typename B<U>::X) { return __PRETTY_FUNCTION__; }
+};
+
+int main ()
+{
+ printf ("%s\n", D<int>().foo (0));
+}
+// { dg-final { scan-assembler "const char\\* D<U>::foo\\(typename B<U>::X\\)" } }
diff --git a/gcc/testsuite/g++.dg/ext/vector14.C b/gcc/testsuite/g++.dg/ext/vector14.C
index 78109c1a676..8e792108fb8 100644
--- a/gcc/testsuite/g++.dg/ext/vector14.C
+++ b/gcc/testsuite/g++.dg/ext/vector14.C
@@ -1,6 +1,7 @@
// PR c++/35758
// { dg-do compile }
-// { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+// { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
+// { dg-require-effective-target sse }
// Ignore warning on some powerpc-linux configurations.
// { dg-prune-output "non-standard ABI extension" }
// { dg-prune-output "mangled name" }
diff --git a/gcc/testsuite/g++.dg/gomp/sections-4.C b/gcc/testsuite/g++.dg/gomp/sections-4.C
index 44e7de98c20..62a2ecddf9a 100644
--- a/gcc/testsuite/g++.dg/gomp/sections-4.C
+++ b/gcc/testsuite/g++.dg/gomp/sections-4.C
@@ -1,5 +1,5 @@
/* PR c++/24613 */
-/* { dg-compile } */
+/* { dg-do compile } */
#pragma omp section /* { dg-error "may only be used in" } */
diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp
new file mode 100644
index 00000000000..9a1785036ef
--- /dev/null
+++ b/gcc/testsuite/g++.dg/guality/guality.exp
@@ -0,0 +1,53 @@
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib g++-dg.exp
+load_lib gcc-gdb-test.exp
+
+# Disable on darwin until radr://7264615 is resolved.
+if { [istarget *-*-darwin*] } {
+ return
+}
+
+proc check_guality {args} {
+ set result [eval check_compile guality_check executable $args "-g -O0"]
+ set lines [lindex $result 0]
+ set output [lindex $result 1]
+ set ret 0
+ if {[string match "" $lines]} {
+ set execout [g++_load "./$output"]
+ set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
+ }
+ remote_file build delete $output
+ return $ret
+}
+
+dg-init
+
+global GDB
+if ![info exists ::env(GUALITY_GDB_NAME)] {
+ if [info exists GDB] {
+ set guality_gdb_name "$GDB"
+ } else {
+ set guality_gdb_name "[transform gdb]"
+ }
+ setenv GUALITY_GDB_NAME "$guality_gdb_name"
+}
+
+if {[check_guality "
+ #include \"$srcdir/$subdir/guality.h\"
+ volatile long int varl = 6;
+ int main (int argc, char *argv\[\])
+ {
+ GUALCHKVAL (varl);
+ return 0;
+ }
+"]} {
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] ""
+ gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/guality/*.c]] ""
+}
+
+if [info exists guality_gdb_name] {
+ unsetenv GUALITY_GDB_NAME
+}
+
+dg-finish
diff --git a/gcc/testsuite/g++.dg/guality/guality.h b/gcc/testsuite/g++.dg/guality/guality.h
new file mode 100644
index 00000000000..dd858d28b4b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/guality/guality.h
@@ -0,0 +1 @@
+#include "../../gcc.dg/guality/guality.h"
diff --git a/gcc/testsuite/g++.dg/guality/redeclaration1.C b/gcc/testsuite/g++.dg/guality/redeclaration1.C
new file mode 100644
index 00000000000..16f2f0ca481
--- /dev/null
+++ b/gcc/testsuite/g++.dg/guality/redeclaration1.C
@@ -0,0 +1,26 @@
+// { dg-do run }
+// { dg-options "-g" }
+
+volatile int l;
+
+namespace S
+{
+ int i = 24;
+ void __attribute__((noinline))
+ f()
+ {
+ int i = 42;
+ l = i; // { dg-final { gdb-test 13 "i" "42" } }
+ {
+ extern int i;
+ l = i; // { dg-final { gdb-test 16 "i" "24" } }
+ }
+ }
+}
+
+int
+main (void)
+{
+ S::f ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/inherit/covariant17.C b/gcc/testsuite/g++.dg/inherit/covariant17.C
new file mode 100644
index 00000000000..b2de15f7ed6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/covariant17.C
@@ -0,0 +1,43 @@
+// PR c++/43120
+// { dg-do run }
+
+extern "C" void abort ();
+
+struct A {
+ int a;
+
+ A(int a_) : a(a_) {}
+
+ A(const A &other) { }
+
+ virtual void dummy() {}
+};
+
+struct B {
+ virtual B *clone() const = 0;
+};
+
+struct C : public virtual B {
+ virtual C *clone() const = 0;
+};
+
+struct E* ep;
+struct E : public A, public C {
+ E(int a_) : A(a_) { ep = this; }
+
+ virtual E *clone() const {
+ if (this != ep)
+ abort();
+ return 0;
+ }
+};
+
+int main() {
+ E *a = new E(123);
+ C *c = a;
+ B *b = a;
+ c->clone();
+ b->clone();
+ delete a;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/inherit/covariant7.C b/gcc/testsuite/g++.dg/inherit/covariant7.C
index cbd58bb24e1..4d519ed400b 100644
--- a/gcc/testsuite/g++.dg/inherit/covariant7.C
+++ b/gcc/testsuite/g++.dg/inherit/covariant7.C
@@ -1,4 +1,6 @@
// { dg-do compile }
+// { dg-prune-output "direct base" }
+// { dg-options "-fdump-class-hierarchy" }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 27 Dec 2002 <nathan@codesourcery.com>
@@ -27,7 +29,23 @@ struct c4 : virtual c3, virtual c0, virtual c1
int m;
};
-struct c6 : c0, c3, c4 // { dg-warning "direct base" "" }
+struct c6 : c0, c3, c4
{
virtual c1 &f2() volatile;
};
+
+// f2 appears four times in the c6 vtables:
+// once in c1-in-c3-in-c6 - covariant, virtual base, uses c1 vcall offset and c0 vbase offset
+// { dg-final { scan-tree-dump "24 c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } }
+// { dg-final { scan-tree-dump "48 c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } }
+// once in c3-in-c6 - non-covariant, non-virtual base, calls f2 directly
+// { dg-final { scan-tree-dump "28 c6::f2" "class" { target ilp32 } } }
+// { dg-final { scan-tree-dump "56 c6::f2" "class" { target lp64 } } }
+// once in c1-in-c3-in-c4-in-c6 - lost primary
+// { dg-final { scan-tree-dump "80 0u" "class" { target ilp32 } } }
+// { dg-final { scan-tree-dump "160 0u" "class" { target lp64 } } }
+// once in c3-in-c4-in-c6 - c3 vcall offset
+// { dg-final { scan-tree-dump "84 c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } }
+// { dg-final { scan-tree-dump "168 c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } }
+
+// { dg-final { cleanup-tree-dump "class" } }
diff --git a/gcc/testsuite/g++.dg/lto/20100721-1_0.C b/gcc/testsuite/g++.dg/lto/20100721-1_0.C
new file mode 100644
index 00000000000..09132e5992b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20100721-1_0.C
@@ -0,0 +1,9 @@
+/* { dg-lto-do assemble } */
+
+static inline int __gthread_active_p (void) { }
+template <int rank, int dim> class Tensor;
+template <int dimension> struct G;
+template <int dim> class T {
+ typedef void A;
+ typedef Tensor<1,dim> F[G<dim>::v];
+};
diff --git a/gcc/testsuite/g++.dg/lto/20100722-1_0.C b/gcc/testsuite/g++.dg/lto/20100722-1_0.C
new file mode 100644
index 00000000000..72393950d03
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20100722-1_0.C
@@ -0,0 +1,5 @@
+/* { dg-lto-do assemble } */
+
+template <class T> void void_cast_register(T *) __attribute__ ((used));
+template <class T> void void_cast_register(T *) { }
+
diff --git a/gcc/testsuite/g++.dg/opt/nrv16.C b/gcc/testsuite/g++.dg/opt/nrv16.C
new file mode 100644
index 00000000000..7b24d4a4ee0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/nrv16.C
@@ -0,0 +1,16 @@
+// PR c++/44808
+// { dg-do compile }
+
+struct S
+{
+ void *a, *b;
+ int c;
+};
+
+S
+foo ()
+{
+ S x;
+ S y = x;
+ return x;
+}
diff --git a/gcc/testsuite/g++.dg/other/i386-1.C b/gcc/testsuite/g++.dg/other/i386-1.C
index 5a91e603660..ec572ec948d 100644
--- a/gcc/testsuite/g++.dg/other/i386-1.C
+++ b/gcc/testsuite/g++.dg/other/i386-1.C
@@ -1,11 +1,9 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <xmmintrin.h>
-#include "cpuid.h"
-
static void
sse2_test (void)
{
@@ -25,14 +23,6 @@ sse2_test (void)
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- sse2_test ();
-
+ sse2_test ();
return 0;
}
diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C
index 952fa14c364..729706852e2 100644
--- a/gcc/testsuite/g++.dg/other/i386-2.C
+++ b/gcc/testsuite/g++.dg/other/i386-2.C
@@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp" } */
+/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, xopintrin.h, abmintrin.h,
lwpintrin.h, popcntintrin.h and mm3dnow.h are usable with
diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C
index 88dd7693891..75515efb42b 100644
--- a/gcc/testsuite/g++.dg/other/i386-3.C
+++ b/gcc/testsuite/g++.dg/other/i386-3.C
@@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp" } */
+/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, xopintrin.h, abmintrin.h,
lwpintrin.h, popcntintrin.h and mm3dnow.h are usable with
diff --git a/gcc/testsuite/g++.dg/other/mmintrin.C b/gcc/testsuite/g++.dg/other/mmintrin.C
index 417a1acc6de..8315f93d355 100644
--- a/gcc/testsuite/g++.dg/other/mmintrin.C
+++ b/gcc/testsuite/g++.dg/other/mmintrin.C
@@ -1,4 +1,5 @@
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-msse" }
+// { dg-require-effective-target sse }
#include <xmmintrin.h>
diff --git a/gcc/testsuite/g++.dg/other/pr25632.C b/gcc/testsuite/g++.dg/other/pr25632.C
index fe0ad7a2497..e66ae3b51ec 100644
--- a/gcc/testsuite/g++.dg/other/pr25632.C
+++ b/gcc/testsuite/g++.dg/other/pr25632.C
@@ -2,14 +2,12 @@
/* { dg-do compile } */
-#define unsigned
-__extension__ typedef __SIZE_TYPE__ ssize_t;
-#undef unsigned
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
struct sockaddr_un {
char sun_path[1];
};
-const unsigned SI_SUN_HEAD_LEN = (ssize_t)(((struct sockaddr_un *)0)->sun_path);
+const unsigned SI_SUN_HEAD_LEN = (intptr_t)(((struct sockaddr_un *)0)->sun_path);
int SiGetPeerName ()
{
return SI_SUN_HEAD_LEN;
diff --git a/gcc/testsuite/g++.dg/other/pr40446.C b/gcc/testsuite/g++.dg/other/pr40446.C
index dd0aa482075..72cd1960649 100644
--- a/gcc/testsuite/g++.dg/other/pr40446.C
+++ b/gcc/testsuite/g++.dg/other/pr40446.C
@@ -1,10 +1,9 @@
// PR middle-end/40446
// { dg-do run { target i?86-*-* x86_64-*-* } }
// { dg-options "-O1 -msse2" }
-// { dg-require-effective-target sse2 }
+// { dg-require-effective-target sse2_runtime }
#include <emmintrin.h>
-#include "cpuid.h"
extern "C" void abort ();
@@ -34,14 +33,6 @@ sse2_test ()
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- sse2_test ();
-
+ sse2_test ();
return 0;
}
diff --git a/gcc/testsuite/g++.dg/parse/error28.C b/gcc/testsuite/g++.dg/parse/error28.C
index 7e235a13b21..a0b1e7f690f 100644
--- a/gcc/testsuite/g++.dg/parse/error28.C
+++ b/gcc/testsuite/g++.dg/parse/error28.C
@@ -3,7 +3,7 @@
struct virt { virt () {} virt (int i) {} };
struct der : public virtual virt { // { dg-message "8:der::der" }
- der (int i) : virt(i) {} // { dg-message "3:candidates are: der" }
+ der (int i) : virt(i) {} // { dg-message "3:der::der" }
};
struct top : public der {
top () {} // { dg-bogus "der\\(const" }
diff --git a/gcc/testsuite/g++.dg/parse/template25.C b/gcc/testsuite/g++.dg/parse/template25.C
new file mode 100644
index 00000000000..8ffcd121e18
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/template25.C
@@ -0,0 +1,14 @@
+// PR c++/22318. Improve diagnostic for local template declaration.
+// { dg-do compile }
+void f(void)
+{
+ template<typename T> class A /* { dg-error "a template declaration cannot appear at block scope" } */
+ {
+ };
+}
+
+void g(void)
+{
+ template f<int>(); /* { dg-error "expected primary-expression" } */
+ /* { dg-error "expected ';'" "" { target *-*-* } 12 } */
+}
diff --git a/gcc/testsuite/g++.dg/plugin/attribute_plugin.c b/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
index 6327095f7cd..e5b0566837d 100644
--- a/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/attribute_plugin.c
@@ -10,6 +10,7 @@
#include "intl.h"
#include "toplev.h"
#include "plugin.h"
+#include "diagnostic.h"
int plugin_is_GPL_compatible;
@@ -43,7 +44,7 @@ handle_pre_generic (void *event_data, void *data)
{
tree fndecl = (tree) event_data;
tree arg;
- for (arg = DECL_ARGUMENTS(fndecl); arg; arg = TREE_CHAIN (arg)) {
+ for (arg = DECL_ARGUMENTS(fndecl); arg; arg = DECL_CHAIN (arg)) {
tree attr;
for (attr = DECL_ATTRIBUTES (arg); attr; attr = TREE_CHAIN (attr)) {
tree attrname = TREE_PURPOSE (attr);
diff --git a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
index f12a6a0d35b..5bbd5d790fe 100644
--- a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c
@@ -10,6 +10,7 @@
#include "tree-pass.h"
#include "intl.h"
#include "toplev.h"
+#include "diagnostic.h"
int plugin_is_GPL_compatible;
diff --git a/gcc/testsuite/g++.dg/plugin/pragma_plugin.c b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
index 4a9ea47195d..940c302df7d 100644
--- a/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
+++ b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c
@@ -14,6 +14,7 @@
#include "tree-pass.h"
#include "intl.h"
#include "toplev.h"
+#include "diagnostic.h"
int plugin_is_GPL_compatible;
diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c
index df42abd27df..84d2801d202 100644
--- a/gcc/testsuite/g++.dg/plugin/selfassign.c
+++ b/gcc/testsuite/g++.dg/plugin/selfassign.c
@@ -14,6 +14,7 @@
#include "tree-pass.h"
#include "intl.h"
#include "plugin-version.h"
+#include "diagnostic.h"
int plugin_is_GPL_compatible;
@@ -52,9 +53,7 @@ get_real_ref_rhs (tree expr)
/* We are only interested in an assignment with a single
rhs operand because if it is not, the original assignment
will not possibly be a self-assignment. */
- if (is_gimple_assign (def_stmt)
- && (get_gimple_rhs_class (gimple_assign_rhs_code (def_stmt))
- == GIMPLE_SINGLE_RHS))
+ if (gimple_assign_single_p (def_stmt))
return get_real_ref_rhs (gimple_assign_rhs1 (def_stmt));
else
return NULL_TREE;
@@ -66,7 +65,7 @@ get_real_ref_rhs (tree expr)
case PARM_DECL:
case FIELD_DECL:
case COMPONENT_REF:
- case INDIRECT_REF:
+ case MEM_REF:
case ARRAY_REF:
return expr;
default:
@@ -116,17 +115,18 @@ get_non_ssa_expr (tree expr)
else
return expr;
}
- case INDIRECT_REF:
+ case MEM_REF:
{
tree orig_base = TREE_OPERAND (expr, 0);
- tree base = get_non_ssa_expr (orig_base);
- if (!base)
- return NULL_TREE;
- /* If BASE is converted, build a new indirect reference tree. */
- if (base != orig_base)
- return build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (base)), base);
- else
- return expr;
+ if (TREE_CODE (orig_base) == SSA_NAME)
+ {
+ tree base = get_non_ssa_expr (orig_base);
+ if (!base)
+ return NULL_TREE;
+ return fold_build2 (MEM_REF, TREE_TYPE (expr),
+ base, TREE_OPERAND (expr, 1));
+ }
+ return expr;
}
case ARRAY_REF:
{
@@ -153,9 +153,7 @@ get_non_ssa_expr (tree expr)
&& !gimple_nop_p (SSA_NAME_DEF_STMT (expr)))
{
gimple def_stmt = SSA_NAME_DEF_STMT (expr);
- if (is_gimple_assign (def_stmt)
- && (get_gimple_rhs_class (gimple_assign_rhs_code (def_stmt))
- == GIMPLE_SINGLE_RHS))
+ if (gimple_assign_single_p (def_stmt))
vdecl = gimple_assign_rhs1 (def_stmt);
}
return get_non_ssa_expr (vdecl);
@@ -201,9 +199,7 @@ warn_self_assign (gimple stmt)
tree rhs, lhs;
/* Check assigment statement. */
- if (is_gimple_assign (stmt)
- && (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
- == GIMPLE_SINGLE_RHS))
+ if (gimple_assign_single_p (stmt))
{
rhs = get_real_ref_rhs (gimple_assign_rhs1 (stmt));
if (!rhs)
diff --git a/gcc/testsuite/g++.dg/template/crash100.C b/gcc/testsuite/g++.dg/template/crash100.C
new file mode 100644
index 00000000000..c67ae2eca38
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash100.C
@@ -0,0 +1,24 @@
+// PR c++/44628
+
+template <typename T>
+class Temp
+{
+ int Val;
+ public:
+ operator T&(void) { return Val; }
+
+ virtual T& operator=(T a ) // { dg-error "overriding" }
+ {
+ Val = a;
+ return Val;
+ }
+};
+
+class Int : public Temp<int>
+{
+ public:
+ Int& operator=(int a) // { dg-error "conflicting return type" }
+ {
+ return (*this);
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/crash101.C b/gcc/testsuite/g++.dg/template/crash101.C
new file mode 100644
index 00000000000..c59737a8938
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash101.C
@@ -0,0 +1,12 @@
+// PR c++/44039
+
+struct locale { };
+
+template<class charT>
+ void
+ foo()
+ { locale::locale(); } // { dg-error "cannot call|function-style" }
+
+void
+bar()
+{ foo<char>(); }
diff --git a/gcc/testsuite/g++.dg/template/dtor7.C b/gcc/testsuite/g++.dg/template/dtor7.C
index e96f56397eb..186b561e9c3 100644
--- a/gcc/testsuite/g++.dg/template/dtor7.C
+++ b/gcc/testsuite/g++.dg/template/dtor7.C
@@ -1,5 +1,5 @@
// PR c++/40373
-// { dg-compile }
+// { dg-do compile }
struct A;
namespace
diff --git a/gcc/testsuite/g++.dg/template/partial8.C b/gcc/testsuite/g++.dg/template/partial8.C
new file mode 100644
index 00000000000..4db7e18689e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial8.C
@@ -0,0 +1,4 @@
+// PR c++/32505
+template <class T> struct A { };
+A<int*> a;
+template <class T> struct A<T*> { }; // { dg-error "A<int\\*>" }
diff --git a/gcc/testsuite/g++.dg/template/ptrmem17.C b/gcc/testsuite/g++.dg/template/ptrmem17.C
index a79e3c882fa..5c5ee3fc30e 100644
--- a/gcc/testsuite/g++.dg/template/ptrmem17.C
+++ b/gcc/testsuite/g++.dg/template/ptrmem17.C
@@ -7,4 +7,4 @@ template<int> struct A
~A() { &A::i; } // { dg-error "reference" }
};
-A<0> a; // { dg-message "instantiated" }
+A<0> a;
diff --git a/gcc/testsuite/g++.dg/template/ptrmem22.C b/gcc/testsuite/g++.dg/template/ptrmem22.C
new file mode 100644
index 00000000000..762f377f5b7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem22.C
@@ -0,0 +1,29 @@
+// PR c++/44778
+
+enum Healpix_Ordering_Scheme { RING, NEST };
+
+class Healpix_Base
+ {
+ protected:
+ Healpix_Ordering_Scheme scheme_;
+ int nest2ring (int pix) const;
+ int ring2nest (int pix) const;
+
+ typedef int (Healpix_Base::*swapfunc)(int pix) const;
+ };
+
+template<typename T> class Healpix_Map: public Healpix_Base
+ {
+ public:
+ void Import_nograde (const Healpix_Map<T> &orig)
+ {
+ swapfunc swapper = (scheme_ == NEST) ?
+ &Healpix_Map::ring2nest : &Healpix_Map::nest2ring;
+ }
+ };
+
+int main()
+ {
+ Healpix_Map<double> a,b;
+ a.Import_nograde(b);
+ }
diff --git a/gcc/testsuite/g++.dg/template/sfinae19.C b/gcc/testsuite/g++.dg/template/sfinae19.C
new file mode 100644
index 00000000000..59be183feb5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae19.C
@@ -0,0 +1,44 @@
+// PR c++/44907
+
+struct A { };
+
+struct B
+: public A { };
+
+struct C
+: public A { };
+
+struct D
+: public B, public C { };
+
+template<bool, typename T = void> struct enable_if { typedef T type; };
+template<typename T> struct enable_if<false, T> { };
+
+template<typename From, typename To>
+ class mini_is_convertible
+ {
+ typedef char one;
+ typedef struct { char arr[2]; } two;
+
+ template<typename To1>
+ static void test_aux(To1);
+
+ template<typename To1, typename From1>
+ static typename
+ enable_if<(sizeof(test_aux<To1>(From1()), 1) > 0), one>::type
+ test(int);
+
+ template<typename, typename>
+ static two test(...);
+
+ public:
+ static const bool value = sizeof(test<To, From>(0)) == 1;
+ };
+
+template<typename From, typename To>
+ const bool mini_is_convertible<From, To>::value;
+
+int Test1[mini_is_convertible<D*, A*>::value ? -1 : 1];
+int Test2[mini_is_convertible<A*, D*>::value ? -1 : 1];
+int Test3[mini_is_convertible<D, A>::value ? -1 : 1];
+int Test4[mini_is_convertible<A, D>::value ? -1 : 1];
diff --git a/gcc/testsuite/g++.dg/template/sfinae20.C b/gcc/testsuite/g++.dg/template/sfinae20.C
new file mode 100644
index 00000000000..9767bc02984
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae20.C
@@ -0,0 +1,45 @@
+// PR c++/44907
+// { dg-options "-std=c++0x" }
+
+#include <utility>
+
+struct A { };
+
+struct B
+: public A { };
+
+struct C
+: public A { };
+
+struct D
+: public B, public C { };
+
+template<typename From, typename To>
+ class mini_is_convertible
+ {
+ typedef char one;
+ typedef struct { char arr[2]; } two;
+
+ template<typename To1>
+ static void test_aux(To1);
+
+ template<typename To1, typename From1>
+ static decltype(test_aux<To1>(std::declval<From1>()), one())
+ test(int);
+
+ template<typename, typename>
+ static two test(...);
+
+ public:
+ static const bool value = sizeof(test<To, From>(0)) == 1;
+ };
+
+template<typename From, typename To>
+ const bool mini_is_convertible<From, To>::value;
+
+static_assert (!mini_is_convertible<D*, A*>::value, "");
+static_assert (!mini_is_convertible<A*, D*>::value, "");
+static_assert (!mini_is_convertible<D&, A&>::value, "");
+static_assert (!mini_is_convertible<A&, D&>::value, "");
+static_assert (!mini_is_convertible<D, A>::value, "");
+static_assert (!mini_is_convertible<A, D>::value, "");
diff --git a/gcc/testsuite/g++.dg/template/sfinae21.C b/gcc/testsuite/g++.dg/template/sfinae21.C
new file mode 100644
index 00000000000..6086f2f9e7d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae21.C
@@ -0,0 +1,40 @@
+// PR c++/44908
+
+struct A { };
+
+struct B
+: public virtual A { };
+
+template<bool, typename T = void> struct enable_if { typedef T type; };
+template<typename T> struct enable_if<false, T> { };
+
+template<typename From, typename To>
+ class mini_is_convertible
+ {
+ typedef char one;
+ typedef struct { char arr[2]; } two;
+
+ template<typename To1>
+ static void test_aux(To1);
+
+ template<typename To1, typename From1>
+ static typename
+ enable_if<(sizeof(test_aux<To1>(From1()), 1) > 0), one>::type
+ test(int);
+
+ template<typename, typename>
+ static two test(...);
+
+ public:
+ static const bool value = sizeof(test<To, From>(0)) == 1;
+ };
+
+template<typename From, typename To>
+ const bool mini_is_convertible<From, To>::value;
+
+int Test1[mini_is_convertible<int (B::*) (int),
+ int (A::*) (int)>::value ? -1 : 1];
+int Test2[mini_is_convertible<int (B::*), int (A::*)>::value ? -1 : 1];
+int Test3[mini_is_convertible<int (A::*) (int),
+ int (B::*) (int)>::value ? -1 : 1];
+int Test4[mini_is_convertible<int (A::*), int (B::*)>::value ? -1 : 1];
diff --git a/gcc/testsuite/g++.dg/template/sfinae22.C b/gcc/testsuite/g++.dg/template/sfinae22.C
new file mode 100644
index 00000000000..cdac99d91b7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae22.C
@@ -0,0 +1,39 @@
+// PR c++/44908
+// { dg-options "-std=c++0x" }
+
+#include <utility>
+
+struct A { };
+
+struct B
+: public virtual A { };
+
+template<typename From, typename To>
+ class mini_is_convertible
+ {
+ typedef char one;
+ typedef struct { char arr[2]; } two;
+
+ template<typename To1>
+ static void test_aux(To1);
+
+ template<typename To1, typename From1>
+ static decltype(test_aux<To1>(std::declval<From1>()), one())
+ test(int);
+
+ template<typename, typename>
+ static two test(...);
+
+ public:
+ static const bool value = sizeof(test<To, From>(0)) == 1;
+ };
+
+template<typename From, typename To>
+ const bool mini_is_convertible<From, To>::value;
+
+static_assert (!mini_is_convertible<int (B::*) (int),
+ int (A::*) (int)>::value, "");
+static_assert (!mini_is_convertible<int (B::*), int (A::*)>::value, "");
+static_assert (!mini_is_convertible<int (A::*) (int),
+ int (B::*) (int)>::value, "");
+static_assert (!mini_is_convertible<int (A::*), int (B::*)>::value, "");
diff --git a/gcc/testsuite/g++.dg/template/sfinae23.C b/gcc/testsuite/g++.dg/template/sfinae23.C
new file mode 100644
index 00000000000..9e0197a7050
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae23.C
@@ -0,0 +1,23 @@
+// PR c++/44969
+// { dg-options "-std=c++0x" }
+
+template<typename Tp, typename... Args>
+ class mini_is_constructible
+ {
+ typedef char one;
+ typedef struct { char arr[2]; } two;
+
+ template<typename Tp1, typename... Args1>
+ static decltype(Tp1(Args1()...), one())
+ test(int);
+
+ template<typename, typename...>
+ static two test(...);
+
+ public:
+ static const bool value = sizeof(test<Tp, Args...>(0)) == 1;
+ };
+
+class A { };
+
+int Test[mini_is_constructible<int, A, A>::value ? -1 : 1];
diff --git a/gcc/testsuite/g++.dg/template/sfinae24.C b/gcc/testsuite/g++.dg/template/sfinae24.C
new file mode 100644
index 00000000000..7138c96e66f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae24.C
@@ -0,0 +1,26 @@
+// PR c++/44969
+
+template<bool, typename T = void> struct enable_if { typedef T type; };
+template<typename T> struct enable_if<false, T> { };
+
+template<typename Tp, typename Arg1, typename Arg2>
+ class mini_is_constructible
+ {
+ typedef char one;
+ typedef struct { char arr[2]; } two;
+
+ template<typename Tp1, typename Arg1_, typename Arg2_>
+ static typename
+ enable_if<(sizeof(Tp1(Arg1_(), Arg2_()), 1) > 0), one>::type
+ test(int);
+
+ template<typename, typename, typename>
+ static two test(...);
+
+ public:
+ static const bool value = sizeof(test<Tp, Arg1, Arg2>(0)) == 1;
+ };
+
+class A { };
+
+int Test[mini_is_constructible<int, A, A>::value ? -1 : 1];
diff --git a/gcc/testsuite/g++.dg/template/warn1.C b/gcc/testsuite/g++.dg/template/warn1.C
index 0cdffcd3c51..2b804f7ca8f 100644
--- a/gcc/testsuite/g++.dg/template/warn1.C
+++ b/gcc/testsuite/g++.dg/template/warn1.C
@@ -9,8 +9,8 @@
template <class T> void Foo(T i)
{
i++, i++;
- i, i++; // { dg-warning "left-hand operand" "" }
- i++, i; // { dg-warning "right-hand operand" "" }
+ i, i++; // { dg-warning "left operand" "" }
+ i++, i; // { dg-warning "right operand" "" }
for (;; --i, ++i)
;
}
diff --git a/gcc/testsuite/g++.dg/tls/static-1.C b/gcc/testsuite/g++.dg/tls/static-1.C
index 027a9429766..506b0fcf7a0 100644
--- a/gcc/testsuite/g++.dg/tls/static-1.C
+++ b/gcc/testsuite/g++.dg/tls/static-1.C
@@ -1,6 +1,7 @@
// { dg-do run }
// { dg-options "-O2" }
// { dg-require-effective-target tls_runtime }
+// { dg-add-options tls }
// { dg-additional-sources "static-1a.cc" }
extern "C" void abort ();
diff --git a/gcc/testsuite/g++.dg/tls/static-1a.cc b/gcc/testsuite/g++.dg/tls/static-1a.cc
index 47a7a2717c0..1c6109f861e 100644
--- a/gcc/testsuite/g++.dg/tls/static-1a.cc
+++ b/gcc/testsuite/g++.dg/tls/static-1a.cc
@@ -1,6 +1,7 @@
// { dg-do run }
// { dg-options "-O2" }
// { dg-require-effective-target tls_runtime }
+// { dg-add-options tls }
// { dg-additional-sources "static-1a.cc" }
struct A
diff --git a/gcc/testsuite/g++.dg/torture/20100702-1.C b/gcc/testsuite/g++.dg/torture/20100702-1.C
new file mode 100644
index 00000000000..3d223fffb48
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/20100702-1.C
@@ -0,0 +1,37 @@
+// { dg-do compile }
+// { dg-options "-fprefetch-loop-arrays -w" }
+
+class ggPoint3 {
+public:
+ ggPoint3();
+ inline double &x() {
+ return e[0];
+ }
+ inline double &y() {
+ return e[1];
+ }
+ ggPoint3(const ggPoint3 &p);
+ double e[3];
+};
+class ggBox3 {
+public:
+ ggPoint3 min() const;
+};
+class ggHAffineMatrix3;
+ggPoint3 operator*(const ggHAffineMatrix3 &m, const ggPoint3 &v);
+void foo (ggPoint3 *);
+void SetMatrix(ggHAffineMatrix3& toworld, ggBox3& box)
+{
+ ggPoint3 p[2][2][2];
+ int i, j, k;
+ for (i = 0; i < 2; j++)
+ for (k = 0; k < 2; k++)
+ {
+ if (i == 0)
+ p[i][j][k].x() = box.min().x();
+ if (j == 0)
+ p[i][j][k].y() = box.min().y();
+ p[i][j][k] = toworld * p[i][j][k];
+ }
+ foo (&p[0][0][0]);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr36745.C b/gcc/testsuite/g++.dg/torture/pr36745.C
index 86047f1f0d8..53845aaa78e 100644
--- a/gcc/testsuite/g++.dg/torture/pr36745.C
+++ b/gcc/testsuite/g++.dg/torture/pr36745.C
@@ -52,6 +52,7 @@ public: inline QMap ():d (&QMapData::shared_null)
};
struct QVectorData
{
+ QBasicAtomicInt ref;
static QVectorData shared_null;
};
template < typename T > struct QVectorTypedData
diff --git a/gcc/testsuite/g++.dg/torture/pr36960.C b/gcc/testsuite/g++.dg/torture/pr36960.C
new file mode 100644
index 00000000000..280a6755d95
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr36960.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+
+struct Lower {
+ const int& ref;
+ Lower(const int& ref) : ref(ref) { }
+};
+struct Middle : public virtual Lower {
+ Middle(const int& ref) : Lower(ref) { }
+};
+struct Upper : public Middle {
+ Upper(const int& ref) : Lower(ref), Middle(ref) { }
+ int get() { return ref; }
+};
+extern "C" void abort (void);
+int main()
+{
+ int i = 0;
+ Upper upper(i);
+ if (upper.get() != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr44809.C b/gcc/testsuite/g++.dg/torture/pr44809.C
new file mode 100644
index 00000000000..b6615f23f1c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr44809.C
@@ -0,0 +1,6 @@
+// { dg-do compile }
+unsigned int mEvictionRank[(1 << 5)];
+void Unswap(int i)
+{
+ mEvictionRank[i] = ({ unsigned int __v = i; __v; });
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr44813.C b/gcc/testsuite/g++.dg/torture/pr44813.C
new file mode 100644
index 00000000000..1dc01b06a17
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr44813.C
@@ -0,0 +1,60 @@
+typedef unsigned int PRUint32;
+typedef int PRInt32;
+typedef unsigned long PRUint64;
+typedef int PRIntn;
+typedef PRIntn PRBool;
+struct nsRect {
+ nsRect(const nsRect& aRect) { }
+};
+enum nsCompatibility { eCompatibility_NavQuirks = 3 };
+class gfxContext;
+typedef PRUint64 nsFrameState;
+class nsPresContext {
+public:
+ nsCompatibility CompatibilityMode() const { }
+};
+class nsStyleContext {
+public:
+ PRBool HasTextDecorations() const;
+};
+class nsIFrame {
+public:
+ nsPresContext* PresContext() const;
+ nsStyleContext* GetStyleContext() const;
+ nsFrameState GetStateBits() const;
+ nsRect GetOverflowRect() const;
+};
+class nsFrame : public nsIFrame { };
+class nsLineList_iterator { };
+class nsLineList {
+public:
+ typedef nsLineList_iterator iterator;
+};
+class gfxSkipCharsIterator { };
+class gfxTextRun {
+public:
+ class PropertyProvider { };
+};
+class nsTextFrame : public nsFrame
+{
+ virtual nsRect ComputeTightBounds(gfxContext* aContext) const;
+ gfxSkipCharsIterator EnsureTextRun(gfxContext* aReferenceContext = 0L,
+ nsIFrame* aLineContainer = 0L,
+ const nsLineList::iterator* aLine = 0L,
+ PRUint32* aFlowEndInTextRun = 0L);
+};
+class PropertyProvider : public gfxTextRun::PropertyProvider
+{
+public:
+ PropertyProvider(nsTextFrame* aFrame, const gfxSkipCharsIterator& aStart);
+ PRInt32 mLength[64];
+};
+nsRect nsTextFrame::ComputeTightBounds(gfxContext* aContext) const
+{
+ if ((GetStyleContext()->HasTextDecorations()
+ && eCompatibility_NavQuirks == PresContext()->CompatibilityMode())
+ || (GetStateBits() & (nsFrameState(1) << (23))))
+ return GetOverflowRect();
+ gfxSkipCharsIterator iter = const_cast<nsTextFrame*>(this)->EnsureTextRun();
+ PropertyProvider provider(const_cast<nsTextFrame*>(this), iter);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr44826.C b/gcc/testsuite/g++.dg/torture/pr44826.C
new file mode 100644
index 00000000000..aece1407070
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr44826.C
@@ -0,0 +1,44 @@
+typedef unsigned short PRUint16;
+typedef PRUint16 PRUnichar;
+template <class CharT> struct nsCharTraits {
+};
+class nsAString_internal {
+public:
+ typedef PRUnichar char_type;
+};
+class nsString : public nsAString_internal {
+public:
+ typedef nsString self_type;
+ nsString( const self_type& str );
+};
+class nsDependentString : public nsString {
+public:
+ explicit nsDependentString( const char_type* data );
+};
+typedef struct sqlite3_stmt sqlite3_stmt;
+const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
+class nsIVariant { };
+template <typename DataType> struct variant_storage_traits {
+ typedef DataType ConstructorType;
+ typedef DataType StorageType;
+ static inline StorageType storage_conversion(ConstructorType aData) {
+ return aData;
+ }
+};
+template <typename DataType> class Variant : public nsIVariant {
+public:
+ Variant(typename variant_storage_traits<DataType>::ConstructorType aData)
+ : mData(variant_storage_traits<DataType>::storage_conversion(aData)) {}
+ typename variant_storage_traits<DataType>::StorageType mData;
+};
+typedef Variant<nsString> TextVariant;
+class Row {
+ void initialize(sqlite3_stmt *aStatement);
+};
+void Row::initialize(sqlite3_stmt *aStatement)
+{
+ nsDependentString str(static_cast<const PRUnichar
+*>(::sqlite3_column_text16(aStatement, 0)));
+ new TextVariant(str);
+}
+
diff --git a/gcc/testsuite/g++.dg/torture/pr44900.C b/gcc/testsuite/g++.dg/torture/pr44900.C
new file mode 100644
index 00000000000..5c0efcb4b4e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr44900.C
@@ -0,0 +1,76 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse" } */
+/* { dg-require-effective-target sse } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__,
+__artificial__))
+_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W)
+{
+ return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z };
+}
+
+struct vec
+{
+ union {
+ __m128 v;
+ float e[4];
+ };
+
+ static const vec & zero()
+ {
+ static const vec v = _mm_set_ps(0, 0, 0, 0);
+ return v;
+ }
+
+ vec() {}
+ vec(const __m128 & a) : v(a) {}
+
+ operator const __m128&() const { return v; }
+};
+
+struct vec2
+{
+ vec _v1;
+ vec _v2;
+
+ vec2() {}
+ vec2(const vec & a, const vec & b) : _v1(a), _v2(b) {}
+
+ static vec2 load(const float * a)
+ {
+ return vec2(
+ __builtin_ia32_loadups(&a[0]),
+ __builtin_ia32_loadups(&a[4]));
+ }
+
+ const vec & v1() const { return _v1; }
+ const vec & v2() const { return _v2; }
+};
+
+extern "C" void abort(void);
+
+
+inline bool operator==(const vec & a, const vec & b)
+{ return 0xf == __builtin_ia32_movmskps(__builtin_ia32_cmpeqps(a, b)); }
+
+int main( int argc, char * argv[] )
+{
+ __attribute__((aligned(16))) float data[] =
+ { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5 };
+
+ float * p = &data[2];
+ vec2 a;
+
+ a = vec2::load(p);
+
+ vec v1 = a.v1();
+ vec v2 = a.v2();
+
+ if (v2.e[3] != 7.0)
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr44915.C b/gcc/testsuite/g++.dg/torture/pr44915.C
new file mode 100644
index 00000000000..ba7e9660622
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr44915.C
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-findirect-inlining" } */
+
+struct A;
+
+typedef void (A::*f_ptr) ();
+
+void dummy (f_ptr) { }
+
+void call_dummy (f_ptr cb)
+{
+ dummy (cb);
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/copyprop-1.C b/gcc/testsuite/g++.dg/tree-ssa/copyprop-1.C
index 2be04691537..03f6b1207c7 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/copyprop-1.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/copyprop-1.C
@@ -25,5 +25,7 @@ int foo(Object&o)
return o[0];
}
-/* { dg-final { scan-tree-dump-not ".* = \[^>;\]*;" "dce2" } } */
+/* Remaining should be two loads. */
+
+/* { dg-final { scan-tree-dump-times " = \[^\n\]*;" 2 "dce2" } } */
/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr19952.C b/gcc/testsuite/g++.dg/tree-ssa/pr19952.C
index 92d669c1415..54589a294cc 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr19952.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr19952.C
@@ -1,5 +1,5 @@
/* PR 19952 */
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-options "-ftree-vectorize -O2" } */
int i;
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
index 96790239693..478a488e3c2 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
@@ -12,5 +12,5 @@ void foo (int j)
*q = 1;
}
-/* { dg-final { scan-tree-dump "i\\\[j.*\\\] =.* 1;" "forwprop1" } } */
+/* { dg-final { scan-tree-dump "MEM\\\[.*&i\\\]\\\[j.*\\\] =.* 1;" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr33604.C b/gcc/testsuite/g++.dg/tree-ssa/pr33604.C
index d78006220ed..7e820d3ef16 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr33604.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr33604.C
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-O -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fdump-tree-optimized-vops" } */
struct Value
{
@@ -35,12 +35,14 @@ int main(int argc, char *argv[])
return 0;
}
-/* Check that we forward propagated
+/* Check that we propagate
D.2182_13 = (struct Ref *) &D.2137.lhs;
to
D.2182_13->lhs.m ={v} &I;
yielding
- D.2137.lhs.m ={v} &I; */
+ D.2137.lhs.m ={v} &I;
+ so that SRA can promote all locals to registers and we end up
+ referencing a single virtual operand at abort () after optimization. */
-/* { dg-final { scan-tree-dump-times "D\\\.....\\\..hs\\\.m =" 2 "forwprop1" } } */
-/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times ".MEM_\[0-9\]*\\\(D\\\)" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr44706.C b/gcc/testsuite/g++.dg/tree-ssa/pr44706.C
new file mode 100644
index 00000000000..39904d8b9e0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr44706.C
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-fnsplit" } */
+class MemoryManager;
+class XMLExcepts {
+public :
+ enum Codes {
+ AttrList_BadIndex
+ };
+};
+class XMLException {
+public:
+ XMLException(const char* const srcFile, const unsigned int srcLine,
+MemoryManager* const memoryManager = 0);
+};
+class ArrayIndexOutOfBoundsException : public XMLException {
+public:
+ ArrayIndexOutOfBoundsException(const char* const srcFile , const unsigned
+int srcLine , const XMLExcepts::Codes toThrow , MemoryManager* memoryManager =
+0) : XMLException(srcFile, srcLine, memoryManager) {
+ }
+};
+class XMLAttDef {
+ bool fExternalAttribute;
+};
+class XMLAttDefList {
+public:
+ MemoryManager* getMemoryManager() const;
+};
+class DTDAttDef : public XMLAttDef {
+};
+class DTDAttDefList : public XMLAttDefList {
+ virtual const XMLAttDef &getAttDef(unsigned int index) const ;
+ DTDAttDef** fArray;
+ unsigned int fCount;
+};
+const XMLAttDef &DTDAttDefList::getAttDef(unsigned int index) const {
+ if(index >= fCount)
+ throw ArrayIndexOutOfBoundsException("foo.cpp", 0,
+XMLExcepts::AttrList_BadIndex, getMemoryManager());
+ return *(fArray[index]);
+}
+
+/* Mistake in branch prediction caused us to split away real body of the function keeping
+ only throw () invokation. This is bad idea. */
+/* { dg-final { scan-tree-dump-not "Splitting function" "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr44914.C b/gcc/testsuite/g++.dg/tree-ssa/pr44914.C
new file mode 100644
index 00000000000..57ca7e83f17
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr44914.C
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fipa-sra -fnon-call-exceptions" } */
+
+struct A
+{
+ ~A () { }
+};
+
+struct B
+{
+ A a;
+ int i;
+ void f (int) { }
+ B ()
+ {
+ f (i);
+ }
+};
+
+B b;
diff --git a/gcc/testsuite/g++.dg/vect/pr44861.cc b/gcc/testsuite/g++.dg/vect/pr44861.cc
new file mode 100644
index 00000000000..07c59a1382d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr44861.cc
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+bool f();
+
+struct counted_base {
+ virtual void destroy() { }
+ void release() { if (f()) destroy(); }
+};
+
+struct shared_count {
+ shared_count() { }
+ ~shared_count() { if (pi) pi->release(); }
+ shared_count(shared_count& r) : pi(r.pi) { if (pi) pi->release(); }
+ counted_base* pi;
+};
+
+struct Foo;
+
+struct shared_ptr {
+ Foo& operator*() { return *ptr; }
+ Foo* ptr;
+ shared_count refcount;
+};
+
+struct Bar {
+ Bar(Foo&, shared_ptr);
+};
+
+void g() {
+ shared_ptr foo;
+ new Bar(*foo, foo);
+}
+
+// { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect/vect.exp
index aa450661107..fe173429a76 100644
--- a/gcc/testsuite/g++.dg/vect/vect.exp
+++ b/gcc/testsuite/g++.dg/vect/vect.exp
@@ -75,11 +75,8 @@ if [istarget "powerpc-*paired*"] {
} elseif { [istarget "spu-*-*"] } {
set dg-do-what-default run
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
- if { ![check_effective_target_sse2] } then {
- return
- }
lappend DEFAULT_VECTCFLAGS "-msse2"
- if [check_sse2_hw_available] {
+ if { [check_effective_target_sse2_runtime] } {
set dg-do-what-default run
} else {
set dg-do-what-default compile
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-7.C b/gcc/testsuite/g++.dg/warn/Wshadow-7.C
new file mode 100644
index 00000000000..5de952ee790
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-7.C
@@ -0,0 +1,37 @@
+// PR c++/44128
+// { dg-options "-Wshadow" }
+
+typedef long My_ssize_t; // { dg-warning "shadowed declaration" }
+typedef int Foo; // { dg-warning "shadowed declaration" }
+struct Bar1 { // { dg-bogus "shadowed declaration" }
+ int a;
+};
+struct Bar2 { // { dg-warning "shadowed declaration" }
+ int a;
+};
+
+void func() {
+ typedef int My_ssize_t; // { dg-warning "shadows a global" }
+ typedef char My_Num; // { dg-warning "shadowed declaration" }
+ {
+ typedef short My_Num; // { dg-warning "shadows a previous local" }
+ }
+ int Foo; // { dg-warning "shadows a global" }
+ float Bar1; // { dg-bogus "shadows a global" }
+ struct Bar2 { // { dg-warning "shadows a global" }
+ int a;
+ };
+ struct Bar3 { // { dg-warning "shadowed declaration" }
+ int a;
+ };
+ struct Bar4 { // { dg-bogus "shadowed declaration" }
+ int a;
+ };
+ {
+ struct Bar3 { // { dg-warning "shadows a previous local" }
+ int a;
+ };
+ char Bar4; // { dg-bogus "shadows a previous local" }
+ int My_Num; // { dg-warning "shadows a previous local" }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/warn/noeffect2.C b/gcc/testsuite/g++.dg/warn/noeffect2.C
index 01323659597..451e0382a86 100644
--- a/gcc/testsuite/g++.dg/warn/noeffect2.C
+++ b/gcc/testsuite/g++.dg/warn/noeffect2.C
@@ -10,11 +10,11 @@
extern "C" void FormatDisk();
template <class T>
struct C {
- C(){ FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" }
+ C(){ FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
};
template struct C<int>; // { dg-message "instantiated" }
template <class T>
- void f() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" }
+ void f() { FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
template void f<int> (); // { dg-message "instantiated" }
-void g() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" }
+void g() { FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
diff --git a/gcc/testsuite/g++.dg/warn/volatile1.C b/gcc/testsuite/g++.dg/warn/volatile1.C
index 5b1050f9a1c..ac9dd4df354 100644
--- a/gcc/testsuite/g++.dg/warn/volatile1.C
+++ b/gcc/testsuite/g++.dg/warn/volatile1.C
@@ -8,5 +8,5 @@ struct A
};
void A::baz() volatile
{
- *this; // { dg-warning "will not be accessed" }
+ *this; // { dg-warning "indirection will not access" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C b/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C
index cb313667ebd..1a96e8e3b06 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900121_02.C
@@ -1,4 +1,6 @@
// { dg-do assemble }
+// { dg-prune-output "note" }
+
// g++ 1.36.1 bug 900121_02
// Assignment of structs is defined as memberwise assignment,
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/anon2.C b/gcc/testsuite/g++.old-deja/g++.ext/anon2.C
index 6cf16bf2412..5bde08db952 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/anon2.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/anon2.C
@@ -1,5 +1,6 @@
// { dg-do assemble }
// { dg-options "" }
+// { dg-prune-output "note" }
struct S
{
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/misc6.C b/gcc/testsuite/g++.old-deja/g++.mike/misc6.C
index 5fbca65b952..1a07c12b34a 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/misc6.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/misc6.C
@@ -1,4 +1,6 @@
// { dg-do assemble }
+// { dg-prune-output "note" }
+
// GROUPS uncaught
// Cfront bug A.4 (See Language System Release Notes for the
// SPARCompiler C++ version 3.0)
diff --git a/gcc/testsuite/gcc.c-torture/compile/20100609-1.c b/gcc/testsuite/gcc.c-torture/compile/20100609-1.c
new file mode 100644
index 00000000000..8e1175faa32
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20100609-1.c
@@ -0,0 +1,8 @@
+extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base);
+int find_reloads (int i, char *p)
+{
+ int c;
+ while ((c = *p++))
+ return strtoul (p - 1, &p, 10);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44707.c b/gcc/testsuite/gcc.c-torture/compile/pr44707.c
new file mode 100644
index 00000000000..9031f0042c9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44707.c
@@ -0,0 +1,14 @@
+extern struct { int a, b, c, d; } v;
+extern int w;
+
+void
+foo (void)
+{
+ int e1 = v.a;
+ int e2 = w;
+ int e3 = v.b;
+ int e4 = v.c;
+ int e5 = v.d;
+ __asm__ volatile ("/* %0 %1 %2 %3 %4 */" : : "nro" (e1), "nro" (e2), "nro" (e3), "nro" (e4), "nro" (e5));
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44784.c b/gcc/testsuite/gcc.c-torture/compile/pr44784.c
new file mode 100644
index 00000000000..54d531a3dff
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44784.c
@@ -0,0 +1,47 @@
+typedef struct rtx_def *rtx;
+enum rtx_code { SUBREG };
+typedef union rtunion_def {
+ long rtint;
+ unsigned long rtuint;
+ rtx rtx;
+} rtunion;
+struct rtx_def {
+ enum rtx_code code: 8;
+ rtunion fld[1];
+};
+typedef struct simple_bitmap_def {
+ unsigned long long elms[1];
+} *sbitmap;
+struct df_link {
+ struct df_link *next;
+ rtx reg;
+};
+typedef enum { UNDEFINED, CONSTANT, VARYING } latticevalue;
+typedef struct {
+ latticevalue lattice_val;
+} value;
+static value *values;
+static sbitmap ssa_edges;
+void defs_to_varying (struct df_link *start)
+{
+ struct df_link *currdef;
+ for (currdef = start;
+ currdef;
+ currdef = currdef->next)
+ {
+ rtx reg = currdef->reg;
+ if (values[(reg->code == SUBREG
+ ? reg->fld[0].rtx
+ : reg)->fld[0].rtuint].lattice_val != VARYING)
+ ssa_edges->elms [(reg->code == SUBREG
+ ? reg->fld[0].rtx
+ : reg)->fld[0].rtuint / 64]
+ |= ((unsigned long long) 1
+ << (reg->code == SUBREG
+ ? reg->fld[0].rtx
+ : reg)->fld[0].rtuint % 64);
+ values[(reg->code == SUBREG
+ ? reg->fld[0].rtx
+ : reg)->fld[0].rtuint].lattice_val = VARYING;
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44788.c b/gcc/testsuite/gcc.c-torture/compile/pr44788.c
new file mode 100644
index 00000000000..99dc7982394
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44788.c
@@ -0,0 +1,8 @@
+void joint_decode(float* mlt_buffer1, int t) {
+ int i;
+ float decode_buffer[1060];
+ foo(decode_buffer);
+ for (i=0; i<10 ; i++) {
+ mlt_buffer1[i] = i * decode_buffer[t];
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44831.c b/gcc/testsuite/gcc.c-torture/compile/pr44831.c
new file mode 100644
index 00000000000..5539583deb0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44831.c
@@ -0,0 +1,15 @@
+typedef unsigned char UCHAR, *PUCHAR;
+typedef void *HANDLE;
+typedef struct _NCB {
+ UCHAR ncb_reserve[10];
+} NCB, *PNCB;
+struct NBCmdQueue {
+ PNCB head;
+};
+PNCB *NBCmdQueueFindNBC(struct NBCmdQueue *queue, PNCB ncb)
+{
+ PNCB *ret = &queue->head;
+ while (ret && *ret != ncb)
+ ret = (PNCB *)((*ret)->ncb_reserve + sizeof(HANDLE));
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44891.c b/gcc/testsuite/gcc.c-torture/compile/pr44891.c
new file mode 100644
index 00000000000..145b1446903
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44891.c
@@ -0,0 +1,26 @@
+struct S
+{
+ float f;
+ long l;
+};
+
+extern int gi;
+extern float gf;
+
+long foo (long p)
+{
+ struct S s;
+ float *pf;
+
+ s.l = p;
+
+ pf = &s.f;
+
+ pf++;
+ pf--;
+
+ gf = *pf + 3.3;
+ gi = *((int *)pf) + 2;
+
+ return s.l + 6;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44941.c b/gcc/testsuite/gcc.c-torture/compile/pr44941.c
new file mode 100644
index 00000000000..7d9cc8372fc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44941.c
@@ -0,0 +1,8 @@
+struct S { };
+
+extern void bar(struct S);
+
+void foo (int i)
+{
+ bar (*(struct S *)&i);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44946.c b/gcc/testsuite/gcc.c-torture/compile/pr44946.c
new file mode 100644
index 00000000000..7b230124585
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44946.c
@@ -0,0 +1,27 @@
+struct A
+{
+ int i;
+ long l;
+};
+
+struct B
+{
+ int i;
+};
+
+struct C
+{
+ int i;
+ struct B b;
+};
+
+struct B foo (struct A a)
+{
+ struct C *c = (struct C *) &a;
+ return c->b;
+}
+void bar (struct A a, struct B b)
+{
+ struct C *c = (struct C *) &a;
+ c->b = b;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44988.c b/gcc/testsuite/gcc.c-torture/compile/pr44988.c
new file mode 100644
index 00000000000..317eafdf7c8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44988.c
@@ -0,0 +1,13 @@
+struct S
+{
+ int i;
+};
+
+extern void bar (struct S);
+
+void
+foo (void)
+{
+ int i = 0;
+ bar (*(struct S *) &i);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr45047.c b/gcc/testsuite/gcc.c-torture/compile/pr45047.c
new file mode 100644
index 00000000000..f37955a0372
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr45047.c
@@ -0,0 +1,9 @@
+/* PR tree-optimization/45047 */
+
+void
+foo (const unsigned short *w, char *x, int y, int z)
+{
+ int i;
+ for (i = 0; i < y; i++)
+ x[i] = w[i] == z;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20100316-1.c b/gcc/testsuite/gcc.c-torture/execute/20100316-1.c
new file mode 100644
index 00000000000..8367d7273d2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20100316-1.c
@@ -0,0 +1,24 @@
+struct Foo {
+ int i;
+ unsigned precision : 10;
+ unsigned blah : 3;
+} f;
+
+int __attribute__((noinline,noclone))
+foo (struct Foo *p)
+{
+ struct Foo *q = p;
+ return (*q).precision;
+}
+
+extern void abort (void);
+
+int main()
+{
+ f.i = -1;
+ f.precision = 0;
+ f.blah = -1;
+ if (foo (&f) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20100416-1.c b/gcc/testsuite/gcc.c-torture/execute/20100416-1.c
new file mode 100644
index 00000000000..8b5a6f45e87
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20100416-1.c
@@ -0,0 +1,40 @@
+void abort(void);
+
+int
+movegt(int x, int y, long long a)
+{
+ int i;
+ int ret = 0;
+ for (i = 0; i < y; i++)
+ {
+ if (a >= (long long) 0xf000000000000000LL)
+ ret = x;
+ else
+ ret = y;
+ }
+ return ret;
+}
+
+struct test
+{
+ long long val;
+ int ret;
+} tests[] = {
+ { 0xf000000000000000LL, -1 },
+ { 0xefffffffffffffffLL, 1 },
+ { 0xf000000000000001LL, -1 },
+ { 0x0000000000000000LL, -1 },
+ { 0x8000000000000000LL, 1 },
+};
+
+int
+main()
+{
+ int i;
+ for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ if (movegt (-1, 1, tests[i].val) != tests[i].ret)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20100708-1.c b/gcc/testsuite/gcc.c-torture/execute/20100708-1.c
new file mode 100644
index 00000000000..590a94a70b7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20100708-1.c
@@ -0,0 +1,29 @@
+/* PR middle-end/44843 */
+/* Verify that we don't use the alignment of struct S for inner accesses. */
+
+struct S
+{
+ double for_alignment;
+ struct { int x, y, z; } a[16];
+};
+
+void f(struct S *s) __attribute__((noinline));
+
+void f(struct S *s)
+{
+ unsigned int i;
+
+ for (i = 0; i < 16; ++i)
+ {
+ s->a[i].x = 0;
+ s->a[i].y = 0;
+ s->a[i].z = 0;
+ }
+}
+
+int main (void)
+{
+ struct S s;
+ f (&s);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40657.c b/gcc/testsuite/gcc.c-torture/execute/pr40657.c
new file mode 100644
index 00000000000..e6d8dda9f99
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr40657.c
@@ -0,0 +1,23 @@
+/* Verify that that Thumb-1 epilogue size optimization does not clobber the
+ return value. */
+
+long long v = 0x123456789abc;
+
+__attribute__((noinline)) void bar (int *x)
+{
+ asm volatile ("" : "=m" (x) ::);
+}
+
+__attribute__((noinline)) long long foo()
+{
+ int x;
+ bar(&x);
+ return v;
+}
+
+int main ()
+{
+ if (foo () != v)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44468.c b/gcc/testsuite/gcc.c-torture/execute/pr44468.c
new file mode 100644
index 00000000000..c4bd492656d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr44468.c
@@ -0,0 +1,60 @@
+#include <stddef.h>
+
+struct S {
+ int i;
+ int j;
+};
+struct R {
+ int k;
+ struct S a;
+};
+struct Q {
+ float k;
+ struct S a;
+};
+struct Q s;
+int __attribute__((noinline,noclone))
+test1 (void *q)
+{
+ struct S *b = (struct S *)((char *)q + sizeof (int));
+ s.a.i = 0;
+ b->i = 3;
+ return s.a.i;
+}
+int __attribute__((noinline,noclone))
+test2 (void *q)
+{
+ struct S *b = &((struct R *)q)->a;
+ s.a.i = 0;
+ b->i = 3;
+ return s.a.i;
+}
+int __attribute__((noinline,noclone))
+test3 (void *q)
+{
+ s.a.i = 0;
+ ((struct S *)((char *)q + sizeof (int)))->i = 3;
+ return s.a.i;
+}
+extern void abort (void);
+int
+main()
+{
+ if (sizeof (float) != sizeof (int)
+ || offsetof (struct R, a) != sizeof (int)
+ || offsetof (struct Q, a) != sizeof (int))
+ return 0;
+ s.a.i = 1;
+ s.a.j = 2;
+ if (test1 ((void *)&s) != 3)
+ abort ();
+ s.a.i = 1;
+ s.a.j = 2;
+ if (test2 ((void *)&s) != 3)
+ abort ();
+ s.a.i = 1;
+ s.a.j = 2;
+ if (test3 ((void *)&s) != 3)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44683.x b/gcc/testsuite/gcc.c-torture/execute/pr44683.x
new file mode 100644
index 00000000000..20413409a20
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr44683.x
@@ -0,0 +1,6 @@
+if { [istarget "sh*-*-*"] } {
+ # SH require -mieee for this test.
+ set additional_flags "-mieee"
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44828.c b/gcc/testsuite/gcc.c-torture/execute/pr44828.c
new file mode 100644
index 00000000000..93837344b2d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr44828.c
@@ -0,0 +1,19 @@
+extern void abort (void);
+
+static signed char
+foo (signed char si1, signed char si2)
+{
+ return si1 * si2;
+}
+
+int a = 0x105F61CA;
+
+int
+main (void)
+{
+ int b = 0x0332F5C8;
+ if (foo (b, a) > 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44852.c b/gcc/testsuite/gcc.c-torture/execute/pr44852.c
new file mode 100644
index 00000000000..440653e5f17
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr44852.c
@@ -0,0 +1,22 @@
+__attribute__ ((__noinline__))
+char *sf(char *s, char *s0)
+{
+ asm ("");
+ while (*--s == '9')
+ if (s == s0)
+ {
+ *s = '0';
+ break;
+ }
+ ++*s++;
+ return s;
+}
+
+int main()
+{
+ char s[] = "999999";
+ char *x = sf (s+2, s);
+ if (x != s+1 || __builtin_strcmp (s, "199999") != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44942.c b/gcc/testsuite/gcc.c-torture/execute/pr44942.c
new file mode 100644
index 00000000000..3ef0830220d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr44942.c
@@ -0,0 +1,70 @@
+/* PR target/44942 */
+
+#include <stdarg.h>
+
+void
+test1 (int a, int b, int c, int d, int e, int f, int g, long double h, ...)
+{
+ int i;
+ va_list ap;
+
+ va_start (ap, h);
+ i = va_arg (ap, int);
+ if (i != 1234)
+ __builtin_abort ();
+ va_end (ap);
+}
+
+void
+test2 (int a, int b, int c, int d, int e, int f, int g, long double h, int i,
+ long double j, int k, long double l, int m, long double n, ...)
+{
+ int o;
+ va_list ap;
+
+ va_start (ap, n);
+ o = va_arg (ap, int);
+ if (o != 1234)
+ __builtin_abort ();
+ va_end (ap);
+}
+
+void
+test3 (double a, double b, double c, double d, double e, double f,
+ double g, long double h, ...)
+{
+ double i;
+ va_list ap;
+
+ va_start (ap, h);
+ i = va_arg (ap, double);
+ if (i != 1234.0)
+ __builtin_abort ();
+ va_end (ap);
+}
+
+void
+test4 (double a, double b, double c, double d, double e, double f, double g,
+ long double h, double i, long double j, double k, long double l,
+ double m, long double n, ...)
+{
+ double o;
+ va_list ap;
+
+ va_start (ap, n);
+ o = va_arg (ap, double);
+ if (o != 1234.0)
+ __builtin_abort ();
+ va_end (ap);
+}
+
+int
+main ()
+{
+ test1 (0, 0, 0, 0, 0, 0, 0, 0.0L, 1234);
+ test2 (0, 0, 0, 0, 0, 0, 0, 0.0L, 0, 0.0L, 0, 0.0L, 0, 0.0L, 1234);
+ test3 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0L, 1234.0);
+ test4 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0L, 0.0, 0.0L,
+ 0.0, 0.0L, 0.0, 0.0L, 1234.0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr45017.c b/gcc/testsuite/gcc.c-torture/execute/pr45017.c
new file mode 100644
index 00000000000..37ff286cc72
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr45017.c
@@ -0,0 +1,22 @@
+int tester(char *bytes)
+{
+ union {
+ struct {
+ unsigned int r1:4;
+ unsigned int r2:4;
+ } fmt;
+ char value[1];
+ } ovl;
+
+ ovl.value[0] = bytes[0];
+ return ovl.fmt.r1;
+}
+extern void abort (void);
+int main()
+{
+ char buff = 0x2f;
+ if (tester(&buff) != 0x0f)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/Wtrampolines.c b/gcc/testsuite/gcc.dg/Wtrampolines.c
new file mode 100644
index 00000000000..dcb36814774
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wtrampolines.c
@@ -0,0 +1,57 @@
+/* Origin: trampoline-1.c Waldek Hebisch <hebisch@math.uni.wroc.pl> */
+/* Ported to test -Wtrampolines Magnus Granberg <zorry@gentoo.org> */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target trampolines } */
+/* { dg-options "-O2 -Wtrampolines" } */
+
+#ifndef NO_TRAMPOLINES
+
+/* This used to fail on various versions of Solaris 2 because the
+ trampoline couldn't be made executable. */
+
+extern void abort(void);
+extern double fabs(double);
+
+void foo (void)
+{
+ const int correct[1100] = {1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67};
+ int i;
+
+ double x1 (void) {return 1; }
+ double x2 (void) {return -1;}
+ double x3 (void) {return -1;}
+ double x4 (void) {return 1; }
+ double x5 (void) {return 0; }
+
+ typedef double pfun(void);
+
+ double a (int k, pfun x1, pfun x2, pfun x3, pfun x4, pfun x5)
+ {
+ double b (void) /* { dg-warning "trampoline generated for nested function 'b'" } */
+ {
+ k = k - 1;
+ return a (k, b, x1, x2, x3, x4 );
+ }
+
+ if (k <= 0)
+ return x4 () + x5 ();
+ else
+ return b ();
+ }
+
+ for (i=0; i<=10; i++)
+ {
+ if (fabs(a( i, x1, x2, x3, x4, x5 ) - correct [i]) > 0.1)
+ abort();
+ }
+}
+#endif
+
+int main (void)
+{
+#ifndef NO_TRAMPOLINES
+ foo ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c b/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
new file mode 100644
index 00000000000..968bab7ad34
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-require-visibility "" } */
+/* { dg-options "-O2" } */
+/* { dg-additional-sources "attr-weak-hidden-1a.c" } */
+int __attribute__((weak, visibility("hidden"))) foo (void) { return 0; }
diff --git a/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c b/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c
new file mode 100644
index 00000000000..b04d8d251ed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c
@@ -0,0 +1,9 @@
+void abort (void);
+int __attribute__((weak, visibility("hidden"))) foo (void) { return 1; }
+int
+main (void)
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/compat/pr38736_main.c b/gcc/testsuite/gcc.dg/compat/pr38736_main.c
index 88c3586db4b..8f221083c90 100644
--- a/gcc/testsuite/gcc.dg/compat/pr38736_main.c
+++ b/gcc/testsuite/gcc.dg/compat/pr38736_main.c
@@ -1,6 +1,6 @@
/* PR target/38736 */
/* { dg-skip-if "attribute ((aligned))" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target avx_runtime } */
/* Test compatibility of attribute ((aligned)) with and without -mavx. */
diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c
index cfd081db896..59e68d96c7a 100644
--- a/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c
+++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c
@@ -1,8 +1,6 @@
/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */
/* { dg-options "-O" } */
-/* { dg-require-effective-target sse2 } */
-
-#include "cpuid.h"
+/* { dg-require-effective-target sse2_runtime } */
/* Test function argument passing. PR target/15301. */
@@ -12,14 +10,6 @@ extern void exit (int);
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE vector test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- union_m128_1_x ();
-
+ union_m128_1_x ();
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/vector-1a_main.c b/gcc/testsuite/gcc.dg/compat/vector-1a_main.c
index c5acc35f4d8..608f5dd9b85 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1a_main.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1a_main.c
@@ -1,12 +1,10 @@
/* { dg-skip-if "test SSE2 vector" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
modules, parameter passing, and function return. This test uses
vectors of integer values. */
-#include "cpuid.h"
-
extern void vector_1_x (void);
extern void exit (int);
int fails;
@@ -14,14 +12,6 @@ int fails;
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE vector test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- vector_1_x ();
-
+ vector_1_x ();
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/vector-1b_main.c b/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
index fb5a5a93d79..427e8caf38b 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
@@ -1,12 +1,10 @@
/* { dg-skip-if "test AVX vector" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target avx_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
modules, parameter passing, and function return. This test uses
vectors of integer values. */
-#include "cpuid.h"
-
extern void vector_1_x (void);
extern void exit (int);
int fails;
@@ -14,14 +12,6 @@ int fails;
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run AVX vector test only if host has AVX support. */
- if (ecx & bit_AVX)
- vector_1_x ();
-
+ vector_1_x ();
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2a_main.c b/gcc/testsuite/gcc.dg/compat/vector-2a_main.c
index 164c4b25e2e..e957faf90d2 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2a_main.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2a_main.c
@@ -1,12 +1,10 @@
/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
modules, parameter passing, and function return. This test uses
vectors of floating points values. */
-#include "cpuid.h"
-
extern void vector_2_x (void);
extern void exit (int);
int fails;
@@ -14,14 +12,6 @@ int fails;
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE vector test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- vector_2_x ();
-
+ vector_2_x ();
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2b_main.c b/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
index c5a9300c8ac..2c195764249 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
@@ -1,12 +1,10 @@
/* { dg-skip-if "test AVX support" { ! { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target avx_runtime } */
/* Test compatibility of vector types: layout between separately-compiled
modules, parameter passing, and function return. This test uses
vectors of floating points values. */
-#include "cpuid.h"
-
extern void vector_2_x (void);
extern void exit (int);
int fails;
@@ -14,14 +12,6 @@ int fails;
int
main ()
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run AVX vector test only if host has AVX support. */
- if (ecx & bit_AVX)
- vector_2_x ();
-
+ vector_2_x ();
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c b/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c
index 9d577ea7771..6cbdc85b3d5 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target i386*-*-* } } */
/* { dg-options "-O -gdwarf-2 -dA -msse" } */
+/* { dg-require-effective-target sse } */
/* { dg-final { scan-assembler "DW_AT_const_value" } } */
typedef float FloatVect __attribute__((__vector_size__(16)));
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c
new file mode 100644
index 00000000000..ce26ec639c3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA --param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+/* { dg-final { scan-assembler-times "DIE.*DW_TAG_array_type" 1 } } */
+/* { dg-final { scan-assembler-times "DIE.*DW_TAG_subrange_type" 1 } } */
+
+void f1 (void)
+{
+ char buffer1[100];
+}
+
+int f2 (void)
+{
+ return 0;
+}
+
+void f3 (void)
+{
+ char buffer2[100];
+}
diff --git a/gcc/testsuite/gcc.dg/float-range-3.c b/gcc/testsuite/gcc.dg/float-range-3.c
index e018a1ebc16..32bef98df9d 100644
--- a/gcc/testsuite/gcc.dg/float-range-3.c
+++ b/gcc/testsuite/gcc.dg/float-range-3.c
@@ -1,5 +1,5 @@
/* PR 23572 : warnings for out of range floating-point constants. */
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-options "-std=c99" } */
/* { dg-skip-if "No Inf support" { spu-*-* } } */
#include <math.h>
diff --git a/gcc/testsuite/gcc.dg/float-range-4.c b/gcc/testsuite/gcc.dg/float-range-4.c
index fbb820f9b21..a50a47d18c2 100644
--- a/gcc/testsuite/gcc.dg/float-range-4.c
+++ b/gcc/testsuite/gcc.dg/float-range-4.c
@@ -1,5 +1,5 @@
/* PR 23572 : warnings for out of range floating-point constants. */
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-options "-Wno-overflow -std=c99" } */
/* { dg-skip-if "No Inf support" { spu-*-* } } */
#include <math.h>
diff --git a/gcc/testsuite/gcc.dg/float-range-5.c b/gcc/testsuite/gcc.dg/float-range-5.c
index 89f00796aec..034f3605898 100644
--- a/gcc/testsuite/gcc.dg/float-range-5.c
+++ b/gcc/testsuite/gcc.dg/float-range-5.c
@@ -1,6 +1,6 @@
/* PR 23572 : warnings for out of range floating-point constants
Test that they are NOT pedantic warnings. */
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-options "-pedantic-errors -std=c99" } */
/* { dg-skip-if "No Inf support" { spu-*-* } } */
#include <math.h>
diff --git a/gcc/testsuite/gcc.dg/fold-overflow-1.c b/gcc/testsuite/gcc.dg/fold-overflow-1.c
index bd4d25a73ed..8fddc9fc0ee 100644
--- a/gcc/testsuite/gcc.dg/fold-overflow-1.c
+++ b/gcc/testsuite/gcc.dg/fold-overflow-1.c
@@ -1,4 +1,4 @@
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-skip-if "consts are shorts, not longs" { "m32c-*-*" "avr-*-*" } { "*" } { "" } } */
/* { dg-skip-if "No Inf support" { spu-*-* } } */
/* { dg-options "-O -ftrapping-math" } */
diff --git a/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c b/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
index aa4f6cb5f3d..4b837e50675 100644
--- a/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
+++ b/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
@@ -3,6 +3,7 @@
/* { dg-do compile { target { *-*-mingw* } } } */
/* { dg-options "-Wformat" } */
/* { dg-options "-Wformat -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
#define USE_SYSTEM_FORMATS
#include "format.h"
diff --git a/gcc/testsuite/gcc.dg/format/unnamed-1.c b/gcc/testsuite/gcc.dg/format/unnamed-1.c
index 2d4f77cc315..b3efdcbf68f 100644
--- a/gcc/testsuite/gcc.dg/format/unnamed-1.c
+++ b/gcc/testsuite/gcc.dg/format/unnamed-1.c
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-Wformat" } */
/* { dg-options "-Wformat -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
#include "format.h"
@@ -20,5 +21,5 @@ f (TItype x)
{
printf("%d", x); /* { dg-warning "expects type" } */
printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects type" } */
- /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 22 } */
+ /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 23 } */
}
diff --git a/gcc/testsuite/gcc.dg/gomp/sections-4.c b/gcc/testsuite/gcc.dg/gomp/sections-4.c
index 44e7de98c20..62a2ecddf9a 100644
--- a/gcc/testsuite/gcc.dg/gomp/sections-4.c
+++ b/gcc/testsuite/gcc.dg/gomp/sections-4.c
@@ -1,5 +1,5 @@
/* PR c++/24613 */
-/* { dg-compile } */
+/* { dg-do compile } */
#pragma omp section /* { dg-error "may only be used in" } */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr40281.c b/gcc/testsuite/gcc.dg/graphite/pr40281.c
index a09147a9fb0..437f3434e4b 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr40281.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr40281.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O -fprefetch-loop-arrays -w" } */
/* { dg-options "-O -fprefetch-loop-arrays -march=i686 -msse -w" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
void foo(int);
void bar(int n)
diff --git a/gcc/testsuite/gcc.dg/guality/asm-1.c b/gcc/testsuite/gcc.dg/guality/asm-1.c
new file mode 100644
index 00000000000..5279722c094
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/asm-1.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+struct A { int x; unsigned short y; char z[64]; };
+
+void __attribute__((noinline))
+foo (struct A *p, char *q)
+{
+ int f = &p->z[p->y] - q;
+ asm volatile ("nop");
+ asm volatile ("nop" : : "g" (f)); /* { dg-final { gdb-test 12 "f" "14" } } */
+ asm volatile ("" : : "g" (p), "g" (q));
+}
+
+int
+main ()
+{
+ struct A a;
+ __builtin_memset (&a, 0, sizeof a);
+ a.y = 26;
+ a.x = 12;
+ asm volatile ("" : : "r" (&a) : "memory");
+ foo (&a, &a.z[a.x]);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp
index d4ee6864ba4..49e2ac5a550 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.exp
+++ b/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -43,6 +43,7 @@ if {[check_guality "
}
"]} {
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
+ gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/guality/*.c]] "-Wc++-compat"
}
if [info exists guality_gdb_name] {
diff --git a/gcc/testsuite/gcc.dg/guality/guality.h b/gcc/testsuite/gcc.dg/guality/guality.h
index e744d0d72ee..f6c662ce8f6 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.h
+++ b/gcc/testsuite/gcc.dg/guality/guality.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+#include <unistd.h>
/* This is a first cut at checking that debug information matches
run-time. The idea is to annotate programs with GUALCHK* macros
@@ -61,6 +62,7 @@ typedef intmax_t gualchk_t;
/* Convert a pointer or integral type to the widest integral type,
as expected by guality_check. */
+#ifndef __cplusplus
#define GUALCVT(val) \
((gualchk_t)__builtin_choose_expr \
(__builtin_types_compatible_p (__typeof (val), gualchk_t), \
@@ -69,6 +71,30 @@ typedef intmax_t gualchk_t;
(__builtin_classify_type (val) \
== __builtin_classify_type (&guality_skip), \
(uintptr_t)(val),(intptr_t)(val))))
+#else
+template <typename T>
+inline __attribute__((always_inline)) gualchk_t
+gualcvt (T *val)
+{
+ return (uintptr_t) val;
+}
+
+template <typename T>
+inline __attribute__((always_inline)) gualchk_t
+gualcvt (T val)
+{
+ return (intptr_t) val;
+}
+
+template <>
+inline __attribute__((always_inline)) gualchk_t
+gualcvt<gualchk_t> (gualchk_t val)
+{
+ return val;
+}
+
+#define GUALCVT(val) gualcvt (val)
+#endif
/* Attach a debugger to the current process and verify that the string
EXPR, evaluated by the debugger, yields the gualchk_t number VAL.
@@ -195,7 +221,7 @@ main (int argc, char *argv[])
else
{
int len = strlen (guality_gdb_command) + sizeof (GUALITY_GDB_ARGS);
- char *buf = __builtin_alloca (len);
+ char *buf = (char *) __builtin_alloca (len);
strcpy (buf, guality_gdb_command);
strcat (buf, GUALITY_GDB_ARGS);
guality_gdb_command = buf;
diff --git a/gcc/testsuite/gcc.dg/guality/nrv-1.c b/gcc/testsuite/gcc.dg/guality/nrv-1.c
new file mode 100644
index 00000000000..6e70050ec4d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/nrv-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-g -fno-tree-sra" } */
+
+void abort (void);
+
+struct A
+{
+ int i[100];
+};
+
+struct A a1, a3;
+
+__attribute__((noinline)) struct A
+f ()
+{
+ struct A a2;
+ a2.i[0] = 42;
+ if (a3.i[0] != 0)
+ abort ();
+ a2.i[4] = 7; /* { dg-final { gdb-test 20 "a2.i\[0\]" "42" } } */
+ return a2;
+}
+
+int
+main ()
+{
+ a1 = f ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-1.c b/gcc/testsuite/gcc.dg/guality/pr45003-1.c
new file mode 100644
index 00000000000..7cef8f6284c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-1.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = *p;
+ asm volatile ("nop");
+ asm volatile ("nop" : : "D" (a)); /* { dg-final { gdb-test 10 "a" "0x8078" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = *p;
+ asm volatile ("nop");
+ asm volatile ("nop" : : "D" (a)); /* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-2.c b/gcc/testsuite/gcc.dg/guality/pr45003-2.c
new file mode 100644
index 00000000000..dcdba237ff4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-2.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = *p;
+ asm volatile ("nop" : : "D" ((int) *p));
+ asm volatile ("nop" : : "D" ((int) *p)); /* { dg-final { gdb-test 10 "a" "0x8078" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = *p;
+ asm volatile ("nop" : : "D" ((unsigned int) *p));
+ asm volatile ("nop" : : "D" ((unsigned int) *p)); /* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-3.c b/gcc/testsuite/gcc.dg/guality/pr45003-3.c
new file mode 100644
index 00000000000..3adc4f2383e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-3.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = (short) *p;
+ asm volatile ("nop" : : "D" ((int) *p));
+ asm volatile ("nop" : : "D" ((int) *p)); /* { dg-final { gdb-test 10 "a" "-32648" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = (unsigned short) *p;
+ asm volatile ("nop" : : "D" ((unsigned int) *p));
+ asm volatile ("nop" : : "D" ((unsigned int) *p)); /* { dg-final { gdb-test 19 "a" "0x8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
index c9a766d9e8f..60382949175 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
@@ -30,3 +30,4 @@ int main (int argc, char *argv[])
}
/* { dg-final { scan-tree-dump-times "foo " 1 "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-2.c b/gcc/testsuite/gcc.dg/ipa/pure-const-2.c
index 51d779776bc..2dcca18c09f 100644
--- a/gcc/testsuite/gcc.dg/ipa/pure-const-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/pure-const-2.c
@@ -26,3 +26,5 @@ main(void)
}
/* { dg-final { scan-tree-dump "found to be pure: i_am_pure" "local-pure-const1"} } */
/* { dg-final { scan-tree-dump-not "i_am_pure" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/lto/20090210_0.c b/gcc/testsuite/gcc.dg/lto/20090210_0.c
index c588e8a2778..2c858a67d32 100644
--- a/gcc/testsuite/gcc.dg/lto/20090210_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20090210_0.c
@@ -1,5 +1,7 @@
/* { dg-lto-do run } */
/* { dg-suppress-ld-options {-fPIC} } */
+/* { dg-require-effective-target tls } */
+/* { dg-extra-ld-options "-pthread" { target *-*-solaris2.[89] } } */
int foo (int x)
{
return x;
diff --git a/gcc/testsuite/gcc.dg/lto/20090313_0.c b/gcc/testsuite/gcc.dg/lto/20090313_0.c
index 523ae2de7c5..226e647135a 100644
--- a/gcc/testsuite/gcc.dg/lto/20090313_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20090313_0.c
@@ -1,4 +1,5 @@
/* { dg-lto-options "-mcpu=v9" { target sparc*-*-* } } */
+/* { dg-require-effective-target sync_char_short } */
void
_cairo_clip_path_reference () {
int a;
diff --git a/gcc/testsuite/gcc.dg/lto/20100518_0.c b/gcc/testsuite/gcc.dg/lto/20100518_0.c
index 02290b5feb2..c0e9c8be2f7 100644
--- a/gcc/testsuite/gcc.dg/lto/20100518_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20100518_0.c
@@ -1,4 +1,5 @@
/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
/* Forgot to steam in/out the number of labels for asm goto. PR44184. */
extern int printf (__const char *__restrict __format, ...);
diff --git a/gcc/testsuite/gcc.dg/lto/20100709-1_0.c b/gcc/testsuite/gcc.dg/lto/20100709-1_0.c
new file mode 100644
index 00000000000..33f38f6c204
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100709-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+
+struct X;
+struct Y {
+ struct X (*fnptr)(struct X);
+};
+struct Y foo;
diff --git a/gcc/testsuite/gcc.dg/lto/20100709-1_1.c b/gcc/testsuite/gcc.dg/lto/20100709-1_1.c
new file mode 100644
index 00000000000..b970795c61d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100709-1_1.c
@@ -0,0 +1,11 @@
+struct X { int i; };
+struct Y {
+ struct X (*fnptr)(struct X);
+};
+extern struct Y foo;
+int main()
+{
+ struct X x;
+ foo.fnptr(x);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-1_0.c b/gcc/testsuite/gcc.dg/lto/20100720-1_0.c
new file mode 100644
index 00000000000..ca9366f6247
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-1_0.c
@@ -0,0 +1,22 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int a;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ struct X *value;
+};
+
+list f(void)
+{
+ return 0;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-1_1.c b/gcc/testsuite/gcc.dg/lto/20100720-1_1.c
new file mode 100644
index 00000000000..789e88e7d06
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-1_1.c
@@ -0,0 +1,15 @@
+struct X {
+ int b;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ struct X *value;
+};
+
+list g(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-2_0.c b/gcc/testsuite/gcc.dg/lto/20100720-2_0.c
new file mode 100644
index 00000000000..87b13b0de92
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-2_0.c
@@ -0,0 +1,23 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int a;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ list *ptr;
+ struct X *value;
+};
+
+list f(list lst)
+{
+ return lst->next;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-2_1.c b/gcc/testsuite/gcc.dg/lto/20100720-2_1.c
new file mode 100644
index 00000000000..b3a2cd06e66
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-2_1.c
@@ -0,0 +1,16 @@
+struct X {
+ int b;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ list *ptr;
+ struct X *value;
+};
+
+list *g(list *ptr)
+{
+ return ptr;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-3_0.c b/gcc/testsuite/gcc.dg/lto/20100720-3_0.c
new file mode 100644
index 00000000000..99c89ebd7fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-3_0.c
@@ -0,0 +1,24 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int a;
+};
+
+struct link {
+ struct list_node *next;
+};
+
+struct list_node {
+ struct link lnk;
+ struct X *value;
+};
+
+void f(struct list_node *lst)
+{
+ lst->lnk.next = 0;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-3_1.c b/gcc/testsuite/gcc.dg/lto/20100720-3_1.c
new file mode 100644
index 00000000000..3d323813edd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-3_1.c
@@ -0,0 +1,17 @@
+struct X {
+ int b;
+};
+
+struct link {
+ struct list_node *next;
+};
+
+struct list_node {
+ struct link lnk;
+ struct X *value;
+};
+
+void g(struct list_node *lst)
+{
+ lst->lnk.next = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100720-4_0.c b/gcc/testsuite/gcc.dg/lto/20100720-4_0.c
new file mode 100644
index 00000000000..e7669552fa9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100720-4_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -fsigned-char} {-flto -funsigned-char}} } */
+
+char *a;
+int f;
+
+void
+foo (void)
+{
+ f = (*a != '-');
+}
+int main()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20100722-1_0.c b/gcc/testsuite/gcc.dg/lto/20100722-1_0.c
new file mode 100644
index 00000000000..275a03c25a0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100722-1_0.c
@@ -0,0 +1,6 @@
+/* { dg-lto-do run } */
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin" } */
+
+int main() { return 0; }
+
diff --git a/gcc/testsuite/gcc.dg/plugin/ggcplug.c b/gcc/testsuite/gcc.dg/plugin/ggcplug.c
index 03bd563b5ad..3094b2ebb63 100644
--- a/gcc/testsuite/gcc.dg/plugin/ggcplug.c
+++ b/gcc/testsuite/gcc.dg/plugin/ggcplug.c
@@ -13,6 +13,7 @@
#include "intl.h"
#include "gcc-plugin.h"
#include "plugin-version.h"
+#include "diagnostic.h"
int plugin_is_GPL_compatible;
diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c
index df42abd27df..84d2801d202 100644
--- a/gcc/testsuite/gcc.dg/plugin/selfassign.c
+++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -14,6 +14,7 @@
#include "tree-pass.h"
#include "intl.h"
#include "plugin-version.h"
+#include "diagnostic.h"
int plugin_is_GPL_compatible;
@@ -52,9 +53,7 @@ get_real_ref_rhs (tree expr)
/* We are only interested in an assignment with a single
rhs operand because if it is not, the original assignment
will not possibly be a self-assignment. */
- if (is_gimple_assign (def_stmt)
- && (get_gimple_rhs_class (gimple_assign_rhs_code (def_stmt))
- == GIMPLE_SINGLE_RHS))
+ if (gimple_assign_single_p (def_stmt))
return get_real_ref_rhs (gimple_assign_rhs1 (def_stmt));
else
return NULL_TREE;
@@ -66,7 +65,7 @@ get_real_ref_rhs (tree expr)
case PARM_DECL:
case FIELD_DECL:
case COMPONENT_REF:
- case INDIRECT_REF:
+ case MEM_REF:
case ARRAY_REF:
return expr;
default:
@@ -116,17 +115,18 @@ get_non_ssa_expr (tree expr)
else
return expr;
}
- case INDIRECT_REF:
+ case MEM_REF:
{
tree orig_base = TREE_OPERAND (expr, 0);
- tree base = get_non_ssa_expr (orig_base);
- if (!base)
- return NULL_TREE;
- /* If BASE is converted, build a new indirect reference tree. */
- if (base != orig_base)
- return build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (base)), base);
- else
- return expr;
+ if (TREE_CODE (orig_base) == SSA_NAME)
+ {
+ tree base = get_non_ssa_expr (orig_base);
+ if (!base)
+ return NULL_TREE;
+ return fold_build2 (MEM_REF, TREE_TYPE (expr),
+ base, TREE_OPERAND (expr, 1));
+ }
+ return expr;
}
case ARRAY_REF:
{
@@ -153,9 +153,7 @@ get_non_ssa_expr (tree expr)
&& !gimple_nop_p (SSA_NAME_DEF_STMT (expr)))
{
gimple def_stmt = SSA_NAME_DEF_STMT (expr);
- if (is_gimple_assign (def_stmt)
- && (get_gimple_rhs_class (gimple_assign_rhs_code (def_stmt))
- == GIMPLE_SINGLE_RHS))
+ if (gimple_assign_single_p (def_stmt))
vdecl = gimple_assign_rhs1 (def_stmt);
}
return get_non_ssa_expr (vdecl);
@@ -201,9 +199,7 @@ warn_self_assign (gimple stmt)
tree rhs, lhs;
/* Check assigment statement. */
- if (is_gimple_assign (stmt)
- && (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
- == GIMPLE_SINGLE_RHS))
+ if (gimple_assign_single_p (stmt))
{
rhs = get_real_ref_rhs (gimple_assign_rhs1 (stmt));
if (!rhs)
diff --git a/gcc/testsuite/gcc.dg/pr32370.c b/gcc/testsuite/gcc.dg/pr32370.c
index f039bdf98e7..fc3d724e6c4 100644
--- a/gcc/testsuite/gcc.dg/pr32370.c
+++ b/gcc/testsuite/gcc.dg/pr32370.c
@@ -19,7 +19,7 @@ unsigned int
foo (TYPE port)
{
unsigned int v;
- __asm__ __volatile__ ("" : C (v) : "Nd" (port)); /* { dg-error "while reloading\|has impossible" } */
+ __asm__ __volatile__ ("" : C (v) : "Nd" (port)); /* { dg-error "while reloading\|has impossible\|inconsistent operand constraints" } */
return v;
}
diff --git a/gcc/testsuite/gcc.dg/pr34856.c b/gcc/testsuite/gcc.dg/pr34856.c
index 76499f7b8f5..6bfc704774f 100644
--- a/gcc/testsuite/gcc.dg/pr34856.c
+++ b/gcc/testsuite/gcc.dg/pr34856.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 { target { i?86-*-* x86_64-*-* } } } */
/* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
typedef unsigned __attribute__ ((__mode__ (__pointer__))) uintptr_t;
diff --git a/gcc/testsuite/gcc.dg/pr36584.c b/gcc/testsuite/gcc.dg/pr36584.c
index a39eb572e1d..c0b005db7d7 100644
--- a/gcc/testsuite/gcc.dg/pr36584.c
+++ b/gcc/testsuite/gcc.dg/pr36584.c
@@ -1,11 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -lm" } */
/* { dg-options "-O2 -msse2 -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target sse2 { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-
-#ifdef __i386__
-#include "cpuid.h"
-#endif
+/* { dg-require-effective-target sse2_runtime { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
extern double fabs (double);
extern void abort (void);
@@ -263,16 +259,6 @@ main ()
double roots[7];
int nroots;
-#ifdef __i386__
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- if (!(edx & bit_SSE2))
- return 0;
-#endif
-
nroots = sbisect (6, sseq, 0.0, 10000000.0, 5, 1, roots);
if (nroots != 4)
abort ();
diff --git a/gcc/testsuite/gcc.dg/pr36902.c b/gcc/testsuite/gcc.dg/pr36902.c
index 8b4ba6fcdb2..43a2d14f981 100644
--- a/gcc/testsuite/gcc.dg/pr36902.c
+++ b/gcc/testsuite/gcc.dg/pr36902.c
@@ -44,7 +44,7 @@ foo2(unsigned char * to, const unsigned char * from, int n)
*to = *from;
break;
case 5:
- to[4] = from [4]; /* { dg-warning "20:array subscript is above array bounds" } */
+ to[4] = from [4]; /* { dg-warning "array subscript is above array bounds" } */
break;
}
return to;
diff --git a/gcc/testsuite/gcc.dg/pr36997.c b/gcc/testsuite/gcc.dg/pr36997.c
index 51b06a7791c..13461b8a134 100644
--- a/gcc/testsuite/gcc.dg/pr36997.c
+++ b/gcc/testsuite/gcc.dg/pr36997.c
@@ -1,10 +1,9 @@
/* { dg-do compile { target x86_64-*-* i?86-*-* } } */
/* { dg-options "-std=c99 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
__m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
{
return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); /* { dg-error "incompatible type" } */
- /* { dg-message "note: expected '__vector.1. long long int' but argument is of type 'long long int'" "" { target *-*-* } 8 } */
+ /* { dg-message "note: expected '__vector.1. long long int' but argument is of type 'long long int'" "" { target *-*-* } 7 } */
}
diff --git a/gcc/testsuite/gcc.dg/pr37544.c b/gcc/testsuite/gcc.dg/pr37544.c
index efca1db6d4a..99979cef7ad 100644
--- a/gcc/testsuite/gcc.dg/pr37544.c
+++ b/gcc/testsuite/gcc.dg/pr37544.c
@@ -1,11 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -msse2 -mtune=core2 -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 { target { i?86-*-* x86_64-*-* } } } */
-
-#ifdef __i386__
-#include "cpuid.h"
-#endif
+/* { dg-require-effective-target sse2_runtime { target { i?86-*-* x86_64-*-* } } } */
extern void abort (void);
@@ -16,17 +12,6 @@ int main(void)
int i;
-#ifdef __i386__
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (!(edx & bit_SSE2))
- return 0;
-#endif
-
for (i = 0; i < 1000; i++)
arr[i] = 4294967296.0 + (double)i;
diff --git a/gcc/testsuite/gcc.dg/pr40550.c b/gcc/testsuite/gcc.dg/pr40550.c
index 27935ab005a..08951137dd3 100644
--- a/gcc/testsuite/gcc.dg/pr40550.c
+++ b/gcc/testsuite/gcc.dg/pr40550.c
@@ -1,9 +1,6 @@
/* { dg-do run } */
/* { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-
-#ifdef __i386__
-#include "cpuid.h"
-#endif
+/* { dg-require-effective-target sse_runtime { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float))));
@@ -17,18 +14,6 @@ static void test (void)
int main ()
{
-
-#ifdef __i386__
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- if (!(edx & bit_SSE))
- return 0;
-#endif
-
test ();
-
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/pr42427.c b/gcc/testsuite/gcc.dg/pr42427.c
index 1961313bc5f..cb43dd2affb 100644
--- a/gcc/testsuite/gcc.dg/pr42427.c
+++ b/gcc/testsuite/gcc.dg/pr42427.c
@@ -1,5 +1,6 @@
-/* { dg-do assemble } */
+/* { dg-do assemble { target c99_runtime } } */
/* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fpeel-loops" } */
+/* { dg-add-options c99_runtime } */
/* { dg-require-effective-target ilp32 } */
#include <complex.h>
diff --git a/gcc/testsuite/gcc.dg/pr43058.c b/gcc/testsuite/gcc.dg/pr43058.c
index 50d8a63bb8f..bba6f814a71 100644
--- a/gcc/testsuite/gcc.dg/pr43058.c
+++ b/gcc/testsuite/gcc.dg/pr43058.c
@@ -1,6 +1,7 @@
/* PR debug/43058 */
/* { dg-do compile } */
/* { dg-options "-g -O2" } */
+/* { dg-timeout-factor 4 } */
extern void *f1 (void *, void *, void *);
extern void *f2 (const char *, int, int, int, void *(*) ());
diff --git a/gcc/testsuite/gcc.dg/pr44290-1.c b/gcc/testsuite/gcc.dg/pr44290-1.c
new file mode 100644
index 00000000000..071a2710425
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr44290-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target arm*-*-* avr-*-* mcore-*-* rx-*-* spu-*-* } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static void __attribute__((naked))
+foo(void *from, void *to)
+{
+ asm volatile("dummy"::"r"(from), "r"(to));
+}
+
+unsigned int fie[2];
+
+void fum(void *to)
+{
+ foo(fie, to);
+}
+
+/* { dg-final { scan-tree-dump "foo \\\(void \\\* from, void \\\* to\\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr44290-2.c b/gcc/testsuite/gcc.dg/pr44290-2.c
new file mode 100644
index 00000000000..1951a519dfc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr44290-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target arm*-*-* avr-*-* mcore-*-* rx-*-* spu-*-* } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static unsigned long __attribute__((naked))
+foo (unsigned long base)
+{
+ asm volatile ("dummy");
+}
+unsigned long
+bar (void)
+{
+ static int start, set;
+
+ if (!set)
+ {
+ set = 1;
+ start = foo (0);
+ }
+
+ return foo (start);
+}
+
+/* { dg-final { scan-tree-dump "foo \\\(long unsigned int base\\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr44838.c b/gcc/testsuite/gcc.dg/pr44838.c
new file mode 100644
index 00000000000..61608ed0b71
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr44838.c
@@ -0,0 +1,33 @@
+/* PR rtl-optimization/44838 */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+extern void abort ();
+
+void
+foo (int *a, int n)
+{
+ int *lasta = a + n;
+ for (; a != lasta; a++)
+ {
+ *a *= 2;
+ a[1] = a[-1] + a[-2];
+ }
+}
+
+int a[16];
+int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44,
+ 72, 136, 232, 416, 736, 1296, 2304, 2032 };
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] = i;
+ foo (a + 2, 16 - 3);
+ for (i = 0; i < 16; i++)
+ if (ref[i] != a[i])
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr44971.c b/gcc/testsuite/gcc.dg/pr44971.c
new file mode 100644
index 00000000000..a1faef51be1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr44971.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug -w" } */
+
+typedef struct
+{
+ int default_screen;
+} *_XPrivint;
+typedef int FcBool;
+typedef struct
+{
+ struct _XftintInfo *next;
+} XftintInfo;
+int _XftintInfo;
+
+void _XftintInfoGet (int * dpy, FcBool createIfNecessary)
+{
+ int event_base;
+ &event_base
+ && dpy[createIfNecessary] != 0;
+}
+
+void _XftCloseint (int dpy, XftintInfo * info,XftintInfo * *prev)
+{
+ _XftintInfoGet (dpy, 0);
+ for (prev = &_XftintInfo; info = *prev; prev = &(*prev)->next)
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c
index cbfd0bc72bb..ca3643e43de 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c
@@ -26,5 +26,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
index c51648c4ef0..baff45d917d 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
@@ -39,5 +39,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
index 1a798e399d3..8953264fea1 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
@@ -34,5 +34,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
index 82f24a1a4b1..9a23f8d53a8 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
@@ -37,5 +37,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
index b2223c88b8b..b0202399104 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
@@ -28,6 +28,6 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
index 308c30e4fd7..e9de98c3b8a 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
@@ -61,6 +61,6 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c
index 19de595e8ed..3c26e3be7b6 100644
--- a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c
+++ b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c
@@ -39,5 +39,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c
index 12c217aad97..5d5e37b4f0e 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c
@@ -23,5 +23,5 @@ int main()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c
index abf50a54fec..efb68be8bdd 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c
@@ -35,5 +35,5 @@ main ()
return 0;
}
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c
index b1508eec5c7..77226b449c5 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c
@@ -26,5 +26,5 @@ int main()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c b/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c
index db7f6b09cb5..58411202767 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c
@@ -43,5 +43,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
index e6638b73a60..781a847f9f7 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
@@ -42,5 +42,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "is passed to local function...Excluded." "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "is passed to local function...Excluded." "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c
index 8830c55601d..8892fa99098 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c
@@ -29,5 +29,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "is return type of function...Excluded" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "is return type of function...Excluded" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c
index 5f634fc119c..6da3420f6e8 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c
@@ -28,6 +28,6 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "is initialized...Excluded" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "is initialized...Excluded" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c
index 55a644e1971..bd03ec42f05 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c
@@ -30,5 +30,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c
index 4cb94afc5df..59e0e48321a 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_pointer.c
@@ -45,5 +45,5 @@ main (void)
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c
index bade3153909..a6b32ddd688 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_value.c
@@ -42,5 +42,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c
index 4ffd4b5a265..b61e26b1248 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c
@@ -29,5 +29,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
index 4c00d02434a..39351e072e2 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
@@ -42,5 +42,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c
index 3d92da40517..18d5a734740 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c
@@ -37,5 +37,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
index a6fd7be4371..26a9dbd7314 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
@@ -40,5 +40,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
index 04b8b6621fb..6caadcf1230 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
@@ -44,5 +44,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c
index 22193f2ae57..812763d53ff 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c
@@ -31,5 +31,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
index e17ca56ee8b..313af1080c1 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c
@@ -31,5 +31,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c
index 24dae559829..92da94d2923 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c
@@ -64,5 +64,5 @@ main ()
}
/*--------------------------------------------------------------------------*/
-/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
diff --git a/gcc/testsuite/gcc.dg/tls/emutls-1.c b/gcc/testsuite/gcc.dg/tls/emutls-1.c
index a0dea509434..3b3577c895e 100644
--- a/gcc/testsuite/gcc.dg/tls/emutls-1.c
+++ b/gcc/testsuite/gcc.dg/tls/emutls-1.c
@@ -1,5 +1,6 @@
/* { dg-do run { target *-wrs-vxworks } } */
/* { dg-require-effective-target tls } */
+/* { dg-add-options tls } */
/* vxworks' TLS model requires no extra padding on the tls proxy
objects. */
diff --git a/gcc/testsuite/gcc.dg/tls/opt-11.c b/gcc/testsuite/gcc.dg/tls/opt-11.c
index 3739645257a..0069c484a2c 100644
--- a/gcc/testsuite/gcc.dg/tls/opt-11.c
+++ b/gcc/testsuite/gcc.dg/tls/opt-11.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
extern void abort (void);
extern void *memset (void *, int, __SIZE_TYPE__);
diff --git a/gcc/testsuite/gcc.dg/tls/opt-12.c b/gcc/testsuite/gcc.dg/tls/opt-12.c
index 7c6e73430a1..7b9e498a5a8 100644
--- a/gcc/testsuite/gcc.dg/tls/opt-12.c
+++ b/gcc/testsuite/gcc.dg/tls/opt-12.c
@@ -2,6 +2,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -fpic" } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
/* { dg-require-effective-target fpic } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/tls/pr24428-2.c b/gcc/testsuite/gcc.dg/tls/pr24428-2.c
index a0ceecc0624..b147f60d6a9 100644
--- a/gcc/testsuite/gcc.dg/tls/pr24428-2.c
+++ b/gcc/testsuite/gcc.dg/tls/pr24428-2.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
__thread double thrtest[81];
int main ()
diff --git a/gcc/testsuite/gcc.dg/tls/pr24428.c b/gcc/testsuite/gcc.dg/tls/pr24428.c
index ecb747ede6d..6439698775a 100644
--- a/gcc/testsuite/gcc.dg/tls/pr24428.c
+++ b/gcc/testsuite/gcc.dg/tls/pr24428.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
__thread double thrtest[81];
int main ()
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c b/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
index 31cd5874ffb..031a2fca0a9 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
@@ -6,6 +6,7 @@
Origin: Kaveh R. Ghazi, April 9, 2010. */
/* { dg-do link } */
+/* { dg-add-options ieee } */
/* All references to link_error should go away at compile-time. The
argument is the __LINE__ number. It appears in the tree dump file
diff --git a/gcc/testsuite/gcc.dg/torture/pr16104-1.c b/gcc/testsuite/gcc.dg/torture/pr16104-1.c
index 3eb405906a2..ad5eda65fca 100644
--- a/gcc/testsuite/gcc.dg/torture/pr16104-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr16104-1.c
@@ -1,9 +1,7 @@
/* PR rtl-optimization/16104 */
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
-
-#include "cpuid.h"
+/* { dg-require-effective-target sse2_runtime } */
extern void abort (void);
@@ -76,14 +74,6 @@ do_test (void)
int
main (void)
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- do_test ();
-
+ do_test ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771-1.c b/gcc/testsuite/gcc.dg/torture/pr35771-1.c
index 8def464aa6d..b3fd554da22 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr35771-1.c
@@ -1,6 +1,6 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771-2.c b/gcc/testsuite/gcc.dg/torture/pr35771-2.c
index 3d6add10de9..a033caefd5c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr35771-2.c
@@ -1,6 +1,6 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771-3.c b/gcc/testsuite/gcc.dg/torture/pr35771-3.c
index 9a69b21a511..fcbe86cb1ba 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771-3.c
+++ b/gcc/testsuite/gcc.dg/torture/pr35771-3.c
@@ -1,6 +1,6 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771.h b/gcc/testsuite/gcc.dg/torture/pr35771.h
index 01c248751c1..7b921c41ba9 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771.h
+++ b/gcc/testsuite/gcc.dg/torture/pr35771.h
@@ -1,7 +1,5 @@
typedef TYPE __attribute__((aligned(1))) unaligned;
-#include "cpuid.h"
-
extern void abort (void);
@@ -27,14 +25,6 @@ do_test (void)
int
main (void)
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- do_test ();
-
+ do_test ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/pr36891.c b/gcc/testsuite/gcc.dg/torture/pr36891.c
index 31f7e173142..53e6163de14 100644
--- a/gcc/testsuite/gcc.dg/torture/pr36891.c
+++ b/gcc/testsuite/gcc.dg/torture/pr36891.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-ffast-math" } */
/* { dg-options "-ffast-math -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
#define __vector __attribute__((vector_size(16) ))
__vector float f(void);
diff --git a/gcc/testsuite/gcc.dg/torture/pr44695.c b/gcc/testsuite/gcc.dg/torture/pr44695.c
new file mode 100644
index 00000000000..85bb4c7b927
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44695.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+
+static uint8_t
+safe_div_func_uint8_t_u_u (uint8_t ui1, uint8_t ui2)
+{
+ return ui2 ? ui2 : (ui1 / ui2);
+}
+
+int
+int81 (int x)
+{
+ return safe_div_func_uint8_t_u_u (1, 8 & x);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr44806.c b/gcc/testsuite/gcc.dg/torture/pr44806.c
new file mode 100644
index 00000000000..d0002d308d0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44806.c
@@ -0,0 +1,90 @@
+/* { dg-do run } */
+
+#include <stdint.h>
+
+extern void abort (void);
+
+#define N_DEV_BITS_4 5
+#define N_INO_BITS_4 (32 - N_DEV_BITS_4 - 2 - 1)
+
+#define N_DEV_BITS_8 8
+#define N_INO_BITS_8 (64 - N_DEV_BITS_8 - 2 - 1)
+
+struct dev_ino_4
+{
+ uint32_t mode:2;
+ uint32_t short_ino:N_INO_BITS_4;
+ uint32_t mapped_dev:N_DEV_BITS_4;
+ uint32_t always_set:1;
+};
+
+struct dev_ino_8
+{
+ uint32_t mode:2;
+ uint64_t short_ino:N_INO_BITS_8;
+ uint32_t mapped_dev:N_DEV_BITS_8;
+ uint32_t always_set:1;
+};
+
+struct dev_ino_full
+{
+ uint32_t mode:2;
+ uint32_t dev;
+ uint32_t ino;
+};
+
+enum di_mode
+{
+ DI_MODE_4 = 1,
+ DI_MODE_8 = 2,
+ DI_MODE_FULL = 3
+};
+
+struct di_ent
+{
+ union
+ {
+ struct dev_ino_4 di4;
+ struct dev_ino_8 di8;
+ struct dev_ino_full full;
+ uint32_t u32;
+ uint64_t u64;
+ void *ptr;
+ } u;
+};
+
+static struct di_ent
+decode_ptr (struct di_ent const *v)
+{
+ struct di_ent di;
+ di.u.ptr = (void *) v;
+ return di;
+}
+
+static int
+di_ent_equal (void const *x, void const *y)
+{
+ struct di_ent a = decode_ptr (x);
+ struct di_ent b = decode_ptr (y);
+ if (a.u.di4.mode != b.u.di4.mode)
+ return 0;
+
+ if (a.u.di4.mode == DI_MODE_4)
+ return (a.u.di4.short_ino == b.u.di4.short_ino
+ && a.u.di4.mapped_dev == b.u.di4.mapped_dev);
+
+ if (a.u.di8.mode == DI_MODE_8)
+ return (a.u.di8.short_ino == b.u.di8.short_ino
+ && a.u.di8.mapped_dev == b.u.di8.mapped_dev);
+
+ return (a.u.full.ino == b.u.full.ino
+ && a.u.full.dev == b.u.full.dev);
+}
+
+int
+main ()
+{
+ if (di_ent_equal ((void *) 0x80143c4d, (void *) 0x80173851) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr44977.c b/gcc/testsuite/gcc.dg/torture/pr44977.c
new file mode 100644
index 00000000000..66fd7d1bfae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44977.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+static unsigned short
+foo (unsigned short ui1, unsigned short ui2)
+{
+ return ui1 - ui2;
+}
+
+static unsigned short
+bar (unsigned ui1, unsigned short ui2)
+{
+ return ui1 + ui2;
+}
+
+struct S1
+{
+ const short f3;
+};
+int g_31;
+short g_67;
+struct S1 g_68[2][5][9][1][1] = {
+};
+
+int func_90 (int);
+
+int int329 (int * const *const int32p_81, short ** p_82)
+{
+ short l_169[8];
+ for (g_31 = 0; g_31 <= 0; g_31 = foo (g_31, 1))
+ {
+ short l_85;
+lbl_89:g_67 ^= l_85;
+ for (l_85 = 0; l_85 >= 0; l_85 = bar)
+ if (g_31)
+ goto lbl_89;
+ func_90 (1), g_68[0][2][2][0][0].f3, 0;
+ }
+ return l_169[6];
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
index cbbb9d03a4c..139b74ed9c6 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
@@ -1,10 +1,9 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-#include "cpuid.h"
#include "check.h"
#ifndef ALIGNMENT
@@ -44,14 +43,7 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- foo (x, x, x, 5);
+ foo (x, x, x, 5);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
index ffe52f2a3e0..31cb0c472b5 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
@@ -1,10 +1,9 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-#include "cpuid.h"
#include "check.h"
#ifndef ALIGNMENT
@@ -44,14 +43,7 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- foo (x, x, x, x, 5);
+ foo (x, x, x, x, 5);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
index c020d731293..dd5dffc1581 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
@@ -1,10 +1,9 @@
/* PR middle-end/37010 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-#include "cpuid.h"
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
@@ -42,19 +41,11 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- {
- foo (x, x, x, x, 5);
+ foo (x, x, x, x, 5);
- if (__builtin_memcmp (&r, &x, sizeof (r)))
- abort ();
- }
+ if (__builtin_memcmp (&r, &x, sizeof (r)))
+ abort ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
index 3e34cf148b7..5b49685fa82 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
@@ -1,11 +1,10 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <stdarg.h>
#include <emmintrin.h>
-#include "cpuid.h"
#include "check.h"
#ifndef ALIGNMENT
@@ -72,14 +71,8 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- foo ("foo", 5, 5.0, x);
+
+ foo ("foo", 5, 5.0, x);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/transparent-union-1.c b/gcc/testsuite/gcc.dg/transparent-union-1.c
index 2360912e3c5..3f0c260c906 100644
--- a/gcc/testsuite/gcc.dg/transparent-union-1.c
+++ b/gcc/testsuite/gcc.dg/transparent-union-1.c
@@ -1,5 +1,5 @@
/* PR c/20043 */
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
extern void f0 (int *);
diff --git a/gcc/testsuite/gcc.dg/transparent-union-2.c b/gcc/testsuite/gcc.dg/transparent-union-2.c
index 09fbb4d9722..adc20761796 100644
--- a/gcc/testsuite/gcc.dg/transparent-union-2.c
+++ b/gcc/testsuite/gcc.dg/transparent-union-2.c
@@ -1,5 +1,5 @@
/* PR c/20043 */
-/* { dg-compile } */
+/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
typedef union { int *i; long *l; } U
diff --git a/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c b/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c
index d32a6cedc7a..0f477b2376c 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c
@@ -16,7 +16,7 @@ main()
/* { dg-final-use { scan-tree-dump "Single value 4 stringop" "tree_profile"} } */
/* Really this ought to simplify into assignment, but we are not there yet. */
/* a[0] = b[0] is what we fold the resulting memcpy into. */
-/* { dg-final-use { scan-tree-dump "a.0. = " "optimized"} } */
-/* { dg-final-use { scan-tree-dump "= b.0." "optimized"} } */
+/* { dg-final-use { scan-tree-dump " = MEM.*&b" "optimized"} } */
+/* { dg-final-use { scan-tree-dump "MEM.*&a\\\] = " "optimized"} } */
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
index f9f5fb798ef..ed6f7c0d5d5 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
@@ -33,5 +33,5 @@ simplify_condition (cond_p)
}
/* There should be exactly one IF conditional. */
-/* { dg-final { scan-tree-dump-times "if " 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "if " 1 "vrp1" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-2.c b/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-2.c
deleted file mode 100644
index dc764c3d79e..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-optimized" } */
-struct a{
- int a;
- int b;
-} a;
-int *
-t()
-{
- return (int *)&a;
-}
-/* { dg-final { scan-tree-dump "a.a" "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-3.c b/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-3.c
deleted file mode 100644
index b764187a029..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-3.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-optimized" } */
-union a
-{
- struct s1
- {
- long long a;
- long long b;
- } s1;
- struct s2
- {
- int c;
- int d;
- } s2;
- struct s3
- {
- unsigned long long e;
- unsigned long long f;
- } s3;
-} a;
-int *
-t ()
-{
- return (int *) &a;
-}
-
-/* { dg-final { scan-tree-dump "a.s2.c" "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
index ee3cb0ebfe5..7b07d7f488f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
@@ -15,5 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i)
c[i] = 1;
}
-/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\].* = 1;" 1 "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
index 0b865245a96..b46b8ece816 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fdump-tree-fre-details" } */
int b;
unsigned a;
@@ -15,9 +15,8 @@ void test2(void)
}
/* The indirect load should be replaced by a load from a and a
- conversion to int. */
+ conversion to int. FRE should then be able to replace
+ the rhs of the store to b by 1. */
-/* { dg-final { scan-tree-dump "= a;" "forwprop1" } } */
-/* { dg-final { scan-tree-dump "= \\\(int\\\) " "forwprop1" } } */
-/* { dg-final { scan-tree-dump-not "= \\\*" "forwprop1" } } */
-/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+/* { dg-final { scan-tree-dump "Replaced\[^\\n\]*with 1" "fre" } } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
index fe04e66fa1a..2aefb9ace63 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
@@ -17,5 +17,5 @@ void f(__SIZE_TYPE__ i)
c[i] = 1;
}
-/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\].* = 1;" 1 "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
index 710bc5dd114..1b68d5a35f0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-forwprop1 -w" } */
+/* { dg-options "-O1 -fdump-tree-esra -w" } */
#define vector __attribute__((vector_size(16) ))
struct VecClass
@@ -15,7 +15,8 @@ vector float foo( vector float v )
return y.v;
}
-/* We should be able to convert the cast to a VCE in forwprop1. */
-/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "forwprop1"} } */
-/* { dg-final { cleanup-tree-dump "forwprop1" } } */
-
+/* We should be able to remove the intermediate struct and directly
+ return x. As we do not fold VIEW_CONVERT_EXPR<struct VecClass>(x).v
+ that doesn't happen right now. */
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "esra"} } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
index 4e0751f8119..fc74297242c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
@@ -12,5 +12,5 @@ int foo(struct X *q)
/* We should have propragated &q->a into (*pointer). */
/* { dg-final { scan-tree-dump-times "pointer" 0 "forwprop1"} } */
-/* { dg-final { scan-tree-dump "->a\\\[0\\\]" "forwprop1" } } */
+/* { dg-final { scan-tree-dump "\\\[0\\\]" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c
new file mode 100644
index 00000000000..a9c5db3873f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize" { target *-*-* } } */
+
+static int x;
+foo (int n, int *A)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ if (A[i])
+ x = 2;
+ if (A[i + 1])
+ x = 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c
new file mode 100644
index 00000000000..d4a1be8f03e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize" { target *-*-* } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define N 64
+float arr[N];
+
+__attribute__ ((noinline))
+int foo (unsigned int n, float *min)
+{
+ unsigned int pos = 1;
+ unsigned int i;
+ float limit = N+N;
+
+ for (i = 0; i < N; i++)
+ if (arr[i] < limit)
+ {
+ pos = i + 1;
+ limit = arr[i];
+ }
+
+ *min = limit;
+ return pos;
+}
+
+int main (void)
+{
+ int i, pos;
+ float min;
+
+ for (i = 0; i < N; i++)
+ arr[i] = (float)(i);
+
+ arr[2] = -5.8;
+
+ pos = foo (N, &min);
+ if (pos != 3 || min != arr[2])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
new file mode 100644
index 00000000000..bf0714902a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized" } */
+
+struct a {int a,b;};
+struct a make_me_big (int a);
+struct a split_me (int a)
+{
+ struct a retval;
+ if (__builtin_expect (a!=0,1))
+ {
+ retval.a = 0;
+ retval.b = 0;
+ return retval;
+ }
+ else
+ {
+ struct a retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ return retval;
+ }
+}
+int val;
+test()
+{
+ split_me (val);
+ split_me (val);
+ split_me (val);
+ split_me (val);
+}
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
+/* { dg-final { scan-tree-dump "part" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
index 9733d8f99d8..e6130bbe7bd 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre" } */
#include <stddef.h>
union tree_node;
@@ -72,7 +72,9 @@ main (void)
remove_useless_vars (&unexpanded_var_list, 0);
return 0;
}
+
+/* { dg-final { scan-tree-dump-not "= unexpanded_var_list;" "fre" } } */
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
/* { dg-final { scan-tree-dump-times "Insertions: 2" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
-
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
index af867515002..853fe70c623 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
struct A { int i; };
int
@@ -11,5 +11,7 @@ foo(struct A *locp, int str)
return locp->i;
}
-/* { dg-final { scan-tree-dump "locp.*->i =" "forwprop1" } } */
+/* We should have propagated &locp->i into its dereference. */
+
+/* { dg-final { scan-tree-dump "locp_\[^\\n\]* =" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c
index f490bf61e5a..3f63cdd8e8c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-phiprop" } */
+/* { dg-options "-O -fdump-tree-phiprop-details" } */
struct f
{
@@ -16,5 +16,5 @@ int g(int i, int c, struct f *ff, int g)
return *t;
}
-/* { dg-final { scan-tree-dump-not "\\*t" "phiprop" } } */
+/* { dg-final { scan-tree-dump-times "Inserting PHI for result of load" 1 "phiprop" } } */
/* { dg-final { cleanup-tree-dump "phiprop" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c
index b61674dff3a..6db9ba0d871 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-alias" } */
+/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */
extern void abort (void);
struct X {
@@ -22,5 +22,5 @@ foo(int i, int j, int k, int off)
return *q;
}
-/* { dg-final { scan-tree-dump "q_., points-to vars: { k }" "alias" } } */
-/* { dg-final { cleanup-tree-dump "alias" } } */
+/* { dg-final { scan-tree-dump "q_., points-to vars: { k }" "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c
index adb01b23165..85b96b190e2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-alias" } */
+/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */
extern void abort (void);
struct X {
@@ -22,5 +22,5 @@ foo(int i, int j, int k, int off)
return *q;
}
-/* { dg-final { scan-tree-dump "q_., points-to vars: { i }" "alias" } } */
-/* { dg-final { cleanup-tree-dump "alias" } } */
+/* { dg-final { scan-tree-dump "q_., points-to vars: { i }" "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
index 3b23c36238e..3f4adf43483 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
@@ -21,5 +21,9 @@ int bar (void)
return q->i;
}
-/* { dg-final { scan-tree-dump-times "a.b.i" 2 "ccp1" } } */
+/* The first access is through struct A, so a.b.i is fine,
+ the second access needs to preserve the original access type struct B. */
+
+/* { dg-final { scan-tree-dump-times "a.b.i" 1 "ccp1" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\\(struct B \\\*\\\)&a\\\].i" 1 "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
index ac7f068cfd1..fb4af2d484d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
@@ -15,5 +15,5 @@ int foo (void)
return *x;
}
-/* { dg-final { scan-tree-dump "a.i\\\[1\\\]" "ccp1" } } */
+/* { dg-final { scan-tree-dump "MEM\\\[\\\(int \\\*\\\)&a \\\+ 4B\\\]" "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c
index f29c4942ace..7912a57f09e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-25.c
@@ -9,6 +9,6 @@ int foo(int i)
}
/* { dg-final { scan-tree-dump "&a\\\[\[iD\]\\\." "ccp1" } } */
-/* { dg-final { scan-tree-dump "= a\\\[\[iD\]\\\." "forwprop1" } } */
+/* { dg-final { scan-tree-dump "= .*&a\\\]\\\[\[iD\]\\\." "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c
index 542c4293960..c0a548155cb 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-26.c
@@ -7,5 +7,5 @@ int foo(int i)
return (a + 1)[i];
}
-/* { dg-final { scan-tree-dump "= a\\\[D\\\." "forwprop1" } } */
+/* { dg-final { scan-tree-dump "=.*&a\\\]\\\[D\\\." "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c
new file mode 100644
index 00000000000..44d2945a311
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp2" } */
+
+static double num;
+int foo (void)
+{
+ return *(unsigned *)&num;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "ccp2" } } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c
index 0cb63242c0e..b9ec6bc720f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c
@@ -11,6 +11,5 @@ int f(int *a)
return *c + t;
}
-/* { dg-final { scan-tree-dump "Replaced \\\(int \\\*\\\) b_.*with a_" "fre" } } */
-/* { dg-final { scan-tree-dump "Replaced \\\*c_.*with t_" "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*a_\[^\n\].*with t_" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
index ae9eb5a2002..972e6c69ef9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
@@ -23,6 +23,5 @@ void foo(double (*q)[4], struct Foo *tmp1)
}
}
-/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
-/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data with &a" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
index 81b82fe4880..9d1b3f2ba92 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
@@ -27,6 +27,5 @@ void foo(double (*q)[4])
bar(a);
}
-/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
-/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced tmp1.data with &a" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
index 978b7abab3a..b986bdd92a9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Os -fdump-tree-pre-details" } */
+/* { dg-options "-O -fdump-tree-fre-details" } */
typedef union
{
@@ -23,5 +23,5 @@ void foo(SA* pResult, SB* method, SC* self)
pResult->data = pResult->data;
}
-/* { dg-final { scan-tree-dump "Deleted redundant store" "pre" } } */
-/* { dg-final { cleanup-tree-dump "pre" } } */
+/* { dg-final { scan-tree-dump "Deleted redundant store" "fre" } } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c
index c87f62e69c6..f87476a3a9f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c
@@ -7,6 +7,6 @@ foo (int *array)
return array[1];
return 0;
}
-/* We should eliminate one address calculation, and one load. */
-/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "fre"} } */
+/* We should eliminate one load. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre"} } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c
index fe41966a6d4..7caf4eec6f8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c
@@ -23,5 +23,5 @@ int vnum_test8(int *data)
}
/* We should eliminate m - n, n + k, set data[5] = 0, eliminate the
address arithmetic for data[5], and set p = 0.
-/* { dg-final { scan-tree-dump-times "Eliminated: 7" 1 "fre"} } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 5" 1 "fre"} } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
index 78e92d769e4..7dc7833647b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
@@ -1,5 +1,5 @@
/* { dg-do "compile" } */
-/* { dg-options "-O2 -fdump-tree-fre" } */
+/* { dg-options "-O2 -fdump-tree-fre-details" } */
struct S { float f; };
int __attribute__((noinline))
@@ -11,5 +11,5 @@ foo (float *r, struct S *p)
return i + *q;
}
-/* { dg-final { scan-tree-dump-times "\\\*q" 1 "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced\[^\n\]*with i_." "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
index aa9e142bba0..812dac928da 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
@@ -12,7 +12,8 @@ foo ( struct S *p)
}
-/* There should only be one load of p->f because fwprop can change *(int *)&p->f into just (int)p->f. */
-/* { dg-final { scan-tree-dump-times "p_.\\\(D\\\)->f" 1 "fre" } } */
+/* There should only be one load of p->f because fwprop can change
+ *(int *)&p->f into just (int)p->f. */
+/* { dg-final { scan-tree-dump-times "= \[^\n\]*p_.\\\(D\\\)" 1 "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c
new file mode 100644
index 00000000000..bf21672c61a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+foo (unsigned int i, unsigned int j)
+{
+ i &= 15;
+ j &= 15;
+ i += 1024;
+ j += 2048;
+ i &= j;
+ return i < 16;
+}
+
+int
+bar (int i)
+{
+ int c = 2;
+ c &= i > 6;
+ return c == 0;
+}
+
+int baz (int x, int y)
+{
+ x &= 15;
+ y &= 15;
+ x += 4;
+ y += 16;
+ x &= y;
+ return x < 20;
+}
+
+/* { dg-final { scan-tree-dump "Folding predicate i_\[^\n\r\]* to 1" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate c_\[^\n\r\]* to 1" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate x_\[^\n\r\]* to 1" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c
new file mode 100644
index 00000000000..66aa5ed6d6b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c
@@ -0,0 +1,58 @@
+/* PR tree-optimization/28632 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vrp" } */
+
+void
+v4 (unsigned a, unsigned b)
+{
+ if (a < 0x1000) return;
+ if (a > 0x1000) return;
+ if (b < 0x0110) return;
+ /* constant true. */
+ if (!__builtin_constant_p ((a|b) >= 0x01000))
+ __asm__("bug.always.true");
+ /* VRP must not think that this is constant. */
+ if (__builtin_constant_p ((a|b) >= 0x10000))
+ __asm__("bug.not.always.true");
+}
+
+void
+u4 (unsigned n)
+{
+ if (n > 0x10111) return;
+ if (n < 0x10101) return;
+ /* always true. */
+ if (!__builtin_constant_p (n & 0x00100))
+ __asm__("bug.always.true");
+ /* VRP must not think that this is constant true. */
+ if (__builtin_constant_p (n & 0x00001))
+ __asm__("bug.not.always.true");
+ /* Out of range, always evaluates to constant false. */
+ if (!__builtin_constant_p (n & 0x01000))
+ __asm__("bug.always.false");
+}
+
+void
+u5 (unsigned n)
+{
+ struct s {unsigned exp:8;} x;
+ x.exp = n;
+ if (__builtin_constant_p(((n + 1) & 255) > 1))
+ __asm__("bug.not.always.true");
+}
+
+void
+v5 (int a, int b)
+{
+ if (a < 0x1000) return;
+ if (a > 0x1000) return;
+ if (b < 0x0110) return;
+ /* constant true. */
+ if (!__builtin_constant_p ((a|b) >= 0x01000))
+ __asm__("bug.always.true");
+ /* VRP must not think that this is always true. */
+ if (__builtin_constant_p ((a|b) >= 0x10000))
+ __asm__("bug.not.always.true");
+}
+
+/* { dg-final { scan-assembler-not "bug\." } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c
new file mode 100644
index 00000000000..7d530e24688
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+foo (unsigned int i, unsigned int j)
+{
+ i &= 15;
+ j &= 15;
+ i += 1024;
+ j += 2048;
+ i |= j;
+ return i >= 1024 + 2048;
+}
+
+/* { dg-final { scan-tree-dump "Folding predicate i_\[^\n\r\]* to 1" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c
new file mode 100644
index 00000000000..66bbfb67b90
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+f1 (int x)
+{
+ x &= 0xff;
+ x += 0x400;
+ x &= 0x7ff;
+ return x;
+}
+
+int
+f2 (int x)
+{
+ x &= 0xff;
+ x += 0x5400;
+ x |= 0x4400;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not "\& (2047|0x7ff)" "vrp1" } } */
+/* { dg-final { scan-tree-dump-not "\\| (17408|0x4400)" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
index 5627c265523..d5c0a1a1331 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
@@ -13,7 +13,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
for (i=0;i<len;i++)
{
float tmp = 0;
- for (k=0;k<7;k++)
+ for (k=0;k<12;k++)
{
tmp += exc[i-pitch+k+maxj-6];
}
@@ -23,7 +23,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
int main()
{
- float *exc = calloc(126,sizeof(float));
+ float *exc = calloc(136,sizeof(float));
float *interp = calloc(80,sizeof(float));
int pitch = -35;
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c
deleted file mode 100644
index d9ea5d12638..00000000000
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* { dg-require-effective-target vect_int } */
-
-#include <stdarg.h>
-#include "../../tree-vect.h"
-
-#define N 5
-
-struct t{
- int k[N];
- int l;
-};
-
-struct s{
- char a; /* aligned */
- char b[N-1]; /* unaligned (offset 1B) */
- char c[N]; /* aligned (offset NB) */
- struct t d; /* aligned (offset 2NB) */
- struct t e; /* unaligned (offset 2N+4N+4 B) */
-};
-
-int main1 ()
-{
- int i;
- struct s tmp;
-
- /* unaligned */
- for (i = 0; i < N; i++)
- {
- tmp.e.k[i] = 8;
- }
-
- /* check results: */
- for (i = 0; i < N; i++)
- {
- if (tmp.e.k[i] != 8)
- abort ();
- }
-
- return 0;
-}
-
-int main (void)
-{
- check_vect ();
-
- return main1 ();
-}
-
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
-/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c
deleted file mode 100644
index 7fc25946587..00000000000
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68d.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* { dg-require-effective-target vect_int } */
-
-#include <stdarg.h>
-#include "../../tree-vect.h"
-
-#define N 11
-
-struct s{
- int m;
- int n[N][N][N];
-};
-
-struct test1{
- struct s a; /* array a.n is unaligned */
- int b;
- int c;
- struct s e; /* array e.n is aligned */
-};
-
-int main1 ()
-{
- int i,j;
- struct test1 tmp1;
-
- /* 4. unaligned */
- for (i = 3; i < N-3; i++)
- {
- tmp1.e.n[1][2][i] = 8;
- }
-
- /* check results: */
- for (i = 3; i <N-3; i++)
- {
- if (tmp1.e.n[1][2][i] != 8)
- abort ();
- }
-
- return 0;
-}
-
-int main (void)
-{
- check_vect ();
-
- return main1 ();
-}
-
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
-/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c
index 41fe3aebf90..d11a9a2d781 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c
@@ -3,7 +3,7 @@
#include <stdarg.h>
#include "../../tree-vect.h"
-#define N 8
+#define N 16
#define OFF 4
/* Check handling of accesses for which the "initial condition" -
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c
index 8723d266f9d..d716b613946 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c
@@ -3,7 +3,7 @@
#include <stdarg.h>
#include "../../tree-vect.h"
-#define N 8
+#define N 16
#define OFF 4
/* Check handling of accesses for which the "initial condition" -
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
index 5627c265523..d5c0a1a1331 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
@@ -13,7 +13,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
for (i=0;i<len;i++)
{
float tmp = 0;
- for (k=0;k<7;k++)
+ for (k=0;k<12;k++)
{
tmp += exc[i-pitch+k+maxj-6];
}
@@ -23,7 +23,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
int main()
{
- float *exc = calloc(126,sizeof(float));
+ float *exc = calloc(136,sizeof(float));
float *interp = calloc(80,sizeof(float));
int pitch = -35;
diff --git a/gcc/testsuite/gcc.dg/vect/pr35821-altivec.c b/gcc/testsuite/gcc.dg/vect/pr35821-altivec.c
deleted file mode 100644
index 79fa926ec67..00000000000
--- a/gcc/testsuite/gcc.dg/vect/pr35821-altivec.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* { dg-do compile { target { powerpc_altivec_ok } } } */
-
-#include "altivec.h"
-
-void
-foo (float f_gain1, int n_tail, float * __restrict__ f_in_hptr,
- float * __restrict__ f_out_hptr)
-{
- int i;
- vector float *v_f_in_hptr, *v_f_out_hptr;
-
- f_in_hptr = ( float* )v_f_in_hptr;
- f_out_hptr = ( float* )v_f_out_hptr;
-
- for( i = 0 ; i < n_tail ; i++ ) {
- f_out_hptr[0] = f_in_hptr[0] * f_gain1;
- f_in_hptr++;
- f_out_hptr++;
- }
-}
-
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { cleanup-tree-dump "vect" } } */
-
diff --git a/gcc/testsuite/gcc.dg/vect/pr35821-spu.c b/gcc/testsuite/gcc.dg/vect/pr35821-spu.c
deleted file mode 100644
index 4cc255f07ee..00000000000
--- a/gcc/testsuite/gcc.dg/vect/pr35821-spu.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* { dg-do compile { target { spu-*-* } } } */
-
-void
-foo (float f_gain1, int n_tail, float * __restrict__ f_in_hptr,
- float * __restrict__ f_out_hptr)
-{
- int i;
- __attribute__((__spu_vector__)) float *v_f_in_hptr, *v_f_out_hptr;
-
- f_in_hptr = ( float* )v_f_in_hptr;
- f_out_hptr = ( float* )v_f_out_hptr;
-
- for( i = 0 ; i < n_tail ; i++ ) {
- f_out_hptr[0] = f_in_hptr[0] * f_gain1;
- f_in_hptr++;
- f_out_hptr++;
- }
-}
-
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { cleanup-tree-dump "vect" } } */
-
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-1.c b/gcc/testsuite/gcc.dg/vect/slp-perm-1.c
index afd66b63461..fcaef1e3966 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-1.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-1.c
@@ -42,16 +42,18 @@ int main (int argc, const char* argv[])
for (i = 0; i < N; i++)
{
input[i] = i%256;
- if (input[i] > 200)
- abort();
output[i] = 0;
+ __asm__ volatile ("");
}
foo (input, output);
for (i = 0; i < N; i++)
- if (output[i] != check_results[i])
- abort ();
+ {
+ if (output[i] != check_results[i])
+ abort ();
+ __asm__ volatile ("");
+ }
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-2.c b/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
index a033498d5b6..e6851911413 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
@@ -37,16 +37,18 @@ int main (int argc, const char* argv[])
for (i = 0; i < N; i++)
{
input[i] = i%256;
- if (input[i] > 200)
- abort();
output[i] = 0;
+ __asm__ volatile ("");
}
foo (input, output);
for (i = 0; i < N; i++)
- if (output[i] != check_results[i])
- abort ();
+ {
+ if (output[i] != check_results[i])
+ abort ();
+ __asm__ volatile ("");
+ }
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-3.c b/gcc/testsuite/gcc.dg/vect/slp-perm-3.c
index 33c09a6d449..e83124f34cb 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-3.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-3.c
@@ -51,16 +51,18 @@ int main (int argc, const char* argv[])
for (i = 0; i < N; i++)
{
input[i] = i%256;
- if (input[i] > 200)
- abort();
output[i] = 0;
+ __asm__ volatile ("");
}
foo (input, output);
- for (i = 0; i < N - N; i++)
- if (output[i] != check_results[i])
- abort ();
+ for (i = 0; i < N; i++)
+ {
+ if (output[i] != check_results[i])
+ abort ();
+ __asm__ volatile ("");
+ }
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c
index 867dfd4aa90..91a423249f8 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c
@@ -69,11 +69,12 @@ int main (int argc, const char* argv[])
if (input[i] > 200)
abort();
output[i] = 0;
+ __asm__ volatile ("");
}
foo (input, output);
- for (i = 0; i < N - N; i++)
+ for (i = 0; i < N; i++)
if (output[i] != check_results[i])
abort ();
diff --git a/gcc/testsuite/gcc.dg/vect/tree-vect.h b/gcc/testsuite/gcc.dg/vect/tree-vect.h
index 2f21c2b1673..ed59d7976b9 100644
--- a/gcc/testsuite/gcc.dg/vect/tree-vect.h
+++ b/gcc/testsuite/gcc.dg/vect/tree-vect.h
@@ -41,6 +41,11 @@ check_vect (void)
want_level = 1, want_c = bit_SSSE3, want_d = 0;
# else
want_level = 1, want_c = 0, want_d = bit_SSE2;
+# if defined(__sun__) && defined(__svr4__)
+ /* Before Solaris 9 4/04, trying to execute an SSE2 instruction gives
+ SIGILL even if the CPU can handle them. */
+ asm volatile ("unpcklpd %xmm0,%xmm2");
+# endif
# endif
if (!__get_cpuid (want_level, &a, &b, &c, &d)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c
index 393909312bd..ddba2635bff 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-109.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-109.c
@@ -72,8 +72,8 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 10 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-42.c b/gcc/testsuite/gcc.dg/vect/vect-42.c
index 3ba1c6f7fde..fa832008698 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-42.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-42.c
@@ -65,6 +65,7 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_hw_misalign } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c
index 7b7da123591..1555d41df6f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-56.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -68,6 +68,8 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c
index cbdf63db123..ba8ffe65400 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-60.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -69,6 +69,8 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c
index 85666d9e699..dfb98cfd541 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-93.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-93.c
@@ -72,7 +72,7 @@ int main (void)
/* main && main1 together: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && {! vector_alignment_reachable} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_hw_misalign } } } } } */
/* in main1: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-96.c b/gcc/testsuite/gcc.dg/vect/vect-96.c
index f392169f770..c7dea6123a8 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-96.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-96.c
@@ -44,6 +44,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_hw_misalign } } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align || { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
index e8fe027f5f3..7981c4a475f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
@@ -27,13 +27,13 @@ __attribute__ ((noinline)) int main1 (int n)
for (i = 0; i < n; i++)
{
sa[i+7] = sb[i];
- ia[i+3] = ib[i];
+ ia[i+3] = ib[i+1];
}
/* check results: */
for (i = 0; i < n; i++)
{
- if (sa[i+7] != sb[i] || ia[i+3] != ib[i])
+ if (sa[i+7] != sb[i] || ia[i+3] != ib[i+1])
abort ();
}
@@ -44,7 +44,9 @@ __attribute__ ((noinline)) int main1 (int n)
access for peeling, and therefore will examine the option of
using a peeling factor = (V-3)%V = 1 for V=2,4.
This will not align the access 'sa[i+3]' (for which we need to
- peel 5 iterations), so the loop can not be vectorized. */
+ peel 5 iterations). However, 'ia[i+3]' also gets aligned if we peel 5
+ iterations, so the loop is vectorizable on all targets that support
+ unaligned loads. */
__attribute__ ((noinline)) int main2 (int n)
{
@@ -55,13 +57,13 @@ __attribute__ ((noinline)) int main2 (int n)
for (i = 0; i < n; i++)
{
ia[i+3] = ib[i];
- sa[i+3] = sb[i];
+ sa[i+3] = sb[i+1];
}
/* check results: */
for (i = 0; i < n; i++)
{
- if (sa[i+3] != sb[i] || ia[i+3] != ib[i])
+ if (sa[i+3] != sb[i+1] || ia[i+3] != ib[i])
abort ();
}
@@ -78,11 +80,8 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
index 274fb025319..3a83491065f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
@@ -20,7 +20,9 @@ unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
access for peeling, and therefore will examine the option of
using a peeling factor = VF-7%VF. This will result in a peeling factor 1,
which will also align the access to 'ia[i+3]', and the loop could be
- vectorized on all targets that support unaligned loads. */
+ vectorized on all targets that support unaligned loads.
+ Without cost model on targets that support misaligned stores, no peeling
+ will be applied since we want to keep the four loads aligned. */
__attribute__ ((noinline))
int main1 (int n)
@@ -50,7 +52,11 @@ int main1 (int n)
using a peeling factor = VF-3%VF. This will result in a peeling factor
1 if VF=4,2. This will not align the access to 'sa[i+3]', for which we
need to peel 5,1 iterations for VF=4,2 respectively, so the loop can not
- be vectorized. */
+ be vectorized. However, 'ia[i+3]' also gets aligned if we peel 5
+ iterations, so the loop is vectorizable on all targets that support
+ unaligned loads.
+ Without cost model on targets that support misaligned stores, no peeling
+ will be applied since we want to keep the four loads aligned. */
__attribute__ ((noinline))
int main2 (int n)
@@ -85,11 +91,10 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target { vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-peel-1.c b/gcc/testsuite/gcc.dg/vect/vect-peel-1.c
new file mode 100644
index 00000000000..ae7746389d3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-peel-1.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int ib[N+5];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N+1];
+
+ /* All the accesses are misaligned. With cost model disabled, we count the
+ the number of aligned accesses for each peeling option, and in this case
+ we align the two loads if possible (i.e., if misaligned stores are
+ supported). */
+ for (i = 1; i <= N; i++)
+ {
+ ia[i] = ib[i+2] + ib[i+6];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != ib[i+2] + ib[i+6])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N+5; i++)
+ ib[i] = i;
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-peel-2.c b/gcc/testsuite/gcc.dg/vect/vect-peel-2.c
new file mode 100644
index 00000000000..ee7b8dbe62e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-peel-2.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* unaligned store. */
+
+int ib[N+5];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N+1];
+
+ /* The store is aligned and the loads are misaligned with the same
+ misalignment. Cost model is disabled. If misaligned stores are supported,
+ we peel according to the loads to align them. */
+ for (i = 0; i <= N; i++)
+ {
+ ia[i] = ib[i+2] + ib[i+6];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != ib[i+2] + ib[i+6])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N+5; i++)
+ ib[i] = i;
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-peel-3.c b/gcc/testsuite/gcc.dg/vect/vect-peel-3.c
new file mode 100644
index 00000000000..80f03c8d8af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-peel-3.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 128
+#define RES 21888
+
+/* unaligned store. */
+
+int ib[N+10];
+int ia[N+10];
+int ic[N+10];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, suma = 0, sumb = 0, sumc = 0;
+
+ /* ib and ic have same misalignment, we peel to align them. */
+ for (i = 1; i <= N; i++)
+ {
+ suma += ia[i];
+ sumb += ib[i+6];
+ sumc += ic[i+2];
+ }
+
+ /* check results: */
+ if (suma + sumb + sumc != RES)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N+10; i++)
+ {
+ ib[i] = i;
+ ic[i] = i+2;
+ ia[i] = i/2;
+ }
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-peel-4.c b/gcc/testsuite/gcc.dg/vect/vect-peel-4.c
new file mode 100644
index 00000000000..971d02334ac
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-peel-4.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int ib[N+5];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N+1];
+
+ /* Don't peel keeping one load and the store aligned. */
+ for (i = 0; i <= N; i++)
+ {
+ ia[i] = ib[i] + ib[i+6];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != ib[i] + ib[i+6])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N+5; i++)
+ ib[i] = i;
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c
index 4b27be8c694..3f8e2ec69a0 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c
@@ -49,5 +49,6 @@ int main (void)
}
/* need -ffast-math to vectorizer these loops. */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* ARM NEON passes -ffast-math to these tests, so expect this to fail. */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail arm_neon_ok } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 24717c844cc..a68d8c65f6e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -67,11 +67,8 @@ if [istarget "powerpc-*paired*"] {
} elseif { [istarget "spu-*-*"] } {
set dg-do-what-default run
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
- if { ![check_effective_target_sse2] } then {
- return
- }
lappend DEFAULT_VECTCFLAGS "-msse2"
- if [check_sse2_hw_available] {
+ if { [check_effective_target_sse2_runtime] } {
set dg-do-what-default run
} else {
set dg-do-what-default compile
@@ -105,6 +102,10 @@ if [istarget "powerpc-*paired*"] {
set dg-do-what-default run
} elseif [is-effective-target arm_neon_ok] {
eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""]
+ # NEON does not support denormals, so is not used for vectorization by
+ # default to avoid loss of precision. We must pass -ffast-math to test
+ # vectorization of float operations.
+ lappend DEFAULT_VECTCFLAGS "-ffast-math"
if [is-effective-target arm_neon_hw] {
set dg-do-what-default run
} else {
diff --git a/gcc/testsuite/gcc.dg/volatile2.c b/gcc/testsuite/gcc.dg/volatile2.c
index 4bfc441c862..d663123c83d 100644
--- a/gcc/testsuite/gcc.dg/volatile2.c
+++ b/gcc/testsuite/gcc.dg/volatile2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-gimple -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
struct GTeth_desc
{
@@ -12,14 +12,11 @@ struct GTeth_softc
void foo(struct GTeth_softc *sc)
{
- /* Verify that we retain the cast to (volatile struct GTeth_desc *)
- after gimplification and that we keep the volatileness on the
+ /* Verify that we retain the volatileness on the
store until after optimization. */
volatile struct GTeth_desc *p = &sc->txq_desc[0];
p->ed_cmdsts = 0;
}
-/* { dg-final { scan-tree-dump "\\(volatile struct GTeth_desc \\*\\) D" "gimple" } } */
/* { dg-final { scan-tree-dump "{v}" "optimized" } } */
-/* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c
new file mode 100644
index 00000000000..18379de33d0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c
@@ -0,0 +1,23 @@
+/* Verify that prologue and epilogue are correct for functions with
+ __attribute__ ((interrupt)). */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+/* This test is not valid when -mthumb. We just cheat. */
+#ifndef __thumb__
+extern void bar (int);
+extern void foo (void) __attribute__ ((interrupt("IRQ")));
+
+void foo ()
+{
+ bar (0);
+}
+#else
+void foo ()
+{
+ asm ("stmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, lr}");
+ asm ("ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}^");
+}
+#endif
+/* { dg-final { scan-assembler "stmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, lr}" } } */
+/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" } } */
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c
new file mode 100644
index 00000000000..b979bf17e8a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c
@@ -0,0 +1,26 @@
+/* Verify that prologue and epilogue are correct for functions with
+ __attribute__ ((interrupt)). */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This test is not valid when -mthum. We just cheat. */
+#ifndef __thumb__
+extern void bar (int);
+extern void test (void) __attribute__((__interrupt__));
+
+int foo;
+void test()
+{
+ funcptrs(foo);
+ foo = 0;
+}
+#else
+void test ()
+{
+ asm ("stmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, lr}");
+ asm ("ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}^");
+}
+#endif
+
+/* { dg-final { scan-assembler "stmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, lr}" } } */
+/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon-vadds64.c b/gcc/testsuite/gcc.target/arm/neon-vadds64.c
new file mode 100644
index 00000000000..284a1d8adc9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vadds64.c
@@ -0,0 +1,21 @@
+/* Test the `vadd_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeef00000000LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)0x00000000deadbeefLL;
+
+ out_int64x1_t = vadd_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0xdeadbeefdeadbeefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vaddu64.c b/gcc/testsuite/gcc.target/arm/neon-vaddu64.c
new file mode 100644
index 00000000000..05bda8b046e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vaddu64.c
@@ -0,0 +1,21 @@
+/* Test the `vadd_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeef00000000LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)0x00000000deadbeefLL;
+
+ out_uint64x1_t = vadd_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0xdeadbeefdeadbeefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vands64.c b/gcc/testsuite/gcc.target/arm/neon-vands64.c
new file mode 100644
index 00000000000..8b6975db6e0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vands64.c
@@ -0,0 +1,21 @@
+/* Test the `vand_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeef00000000LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)0xdead00000000beefLL;
+
+ out_int64x1_t = vand_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0xdead000000000000LL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vandu64.c b/gcc/testsuite/gcc.target/arm/neon-vandu64.c
new file mode 100644
index 00000000000..a8ec3a28b4d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vandu64.c
@@ -0,0 +1,21 @@
+/* Test the `vand_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeef00000000LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)0xdead00000000beefLL;
+
+ out_uint64x1_t = vand_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0xdead000000000000LL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vbics64.c b/gcc/testsuite/gcc.target/arm/neon-vbics64.c
new file mode 100644
index 00000000000..ec3438baef8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vbics64.c
@@ -0,0 +1,21 @@
+/* Test the `vbic_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeef00000000LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)(~0xdead00000000beefLL);
+
+ out_int64x1_t = vbic_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0xdead000000000000LL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vbicu64.c b/gcc/testsuite/gcc.target/arm/neon-vbicu64.c
new file mode 100644
index 00000000000..a0c1b85b405
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vbicu64.c
@@ -0,0 +1,21 @@
+/* Test the `vbic_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeef00000000LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)(~0xdead00000000beefLL);
+
+ out_uint64x1_t = vbic_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0xdead000000000000LL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vdupQ_lanes64.c b/gcc/testsuite/gcc.target/arm/neon-vdupQ_lanes64.c
new file mode 100644
index 00000000000..da24eaca69f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vdupQ_lanes64.c
@@ -0,0 +1,22 @@
+/* Test the `vdupq_lanes64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x2_t out_int64x2_t = {0, 0};
+ int64_t arg0_int64_t = (int64_t) 0xdeadbeef;
+
+ out_int64x2_t = vdupq_lane_s64 ((int64x1_t)arg0_int64_t, 0);
+ if (vgetq_lane_s64 (out_int64x2_t, 0) != arg0_int64_t)
+ abort();
+ if (vgetq_lane_s64 (out_int64x2_t, 1) != arg0_int64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vdupQ_laneu64.c b/gcc/testsuite/gcc.target/arm/neon-vdupQ_laneu64.c
new file mode 100644
index 00000000000..cc19ea51252
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vdupQ_laneu64.c
@@ -0,0 +1,22 @@
+/* Test the `vdupq_laneu64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x2_t out_uint64x2_t = {0, 0};
+ uint64_t arg0_uint64_t = (uint64_t) 0xdeadbeef;
+
+ out_uint64x2_t = vdupq_lane_u64 ((uint64x1_t)arg0_uint64_t, 0);
+ if (vgetq_lane_u64 (out_uint64x2_t, 0) != arg0_uint64_t)
+ abort();
+ if (vgetq_lane_u64 (out_uint64x2_t, 1) != arg0_uint64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vdupQ_ns64.c b/gcc/testsuite/gcc.target/arm/neon-vdupQ_ns64.c
new file mode 100644
index 00000000000..79b4d4eb60d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vdupQ_ns64.c
@@ -0,0 +1,22 @@
+/* Test the `vdupq_ns64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x2_t out_int64x2_t = {0, 0};
+ int64_t arg0_int64_t = (int64_t) 0xdeadbeef;
+
+ out_int64x2_t = vdupq_n_s64 (arg0_int64_t);
+ if (vgetq_lane_s64 (out_int64x2_t, 0) != arg0_int64_t)
+ abort();
+ if (vgetq_lane_s64 (out_int64x2_t, 1) != arg0_int64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vdupQ_nu64.c b/gcc/testsuite/gcc.target/arm/neon-vdupQ_nu64.c
new file mode 100644
index 00000000000..ef6f47fd3aa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vdupQ_nu64.c
@@ -0,0 +1,22 @@
+/* Test the `vdupq_nu64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x2_t out_uint64x2_t = {0, 0};
+ uint64_t arg0_uint64_t = (uint64_t) 0xdeadbeef;
+
+ out_uint64x2_t = vdupq_n_u64 (arg0_uint64_t);
+ if (vgetq_lane_u64 (out_uint64x2_t, 0) != arg0_uint64_t)
+ abort();
+ if (vgetq_lane_u64 (out_uint64x2_t, 1) != arg0_uint64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vdup_ns64.c b/gcc/testsuite/gcc.target/arm/neon-vdup_ns64.c
new file mode 100644
index 00000000000..589ea22930d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vdup_ns64.c
@@ -0,0 +1,20 @@
+/* Test the `vdup_ns64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64_t arg0_int64_t = (int64_t) 0xdeadbeef;
+
+ out_int64x1_t = vdup_n_s64 (arg0_int64_t);
+ if ((int64_t)out_int64x1_t != arg0_int64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vdup_nu64.c b/gcc/testsuite/gcc.target/arm/neon-vdup_nu64.c
new file mode 100644
index 00000000000..8bed5a0c7d7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vdup_nu64.c
@@ -0,0 +1,20 @@
+/* Test the `vdup_nu64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64_t arg0_uint64_t = (uint64_t) 0xdeadbeef;
+
+ out_uint64x1_t = vdup_n_u64 (arg0_uint64_t);
+ if ((uint64_t)out_uint64x1_t != arg0_uint64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-veors64.c b/gcc/testsuite/gcc.target/arm/neon-veors64.c
new file mode 100644
index 00000000000..59d5baa3579
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-veors64.c
@@ -0,0 +1,21 @@
+/* Test the `veor_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeef00000000LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)0xdead00000000beefLL;
+
+ out_int64x1_t = veor_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0x0000beef0000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-veoru64.c b/gcc/testsuite/gcc.target/arm/neon-veoru64.c
new file mode 100644
index 00000000000..b7ff77af0d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-veoru64.c
@@ -0,0 +1,21 @@
+/* Test the `veor_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeef00000000LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)0xdead00000000beefLL;
+
+ out_uint64x1_t = veor_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0x0000beef0000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vget_lanes64.c b/gcc/testsuite/gcc.target/arm/neon-vget_lanes64.c
new file mode 100644
index 00000000000..5891e66193a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vget_lanes64.c
@@ -0,0 +1,20 @@
+/* Test the `vget_lane_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64_t out_int64_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t) 0xdeadbeefbadf00dLL;
+
+ out_int64_t = vget_lane_s64 (arg0_int64x1_t, 0);
+ if (out_int64_t != (int64_t)arg0_int64x1_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vget_laneu64.c b/gcc/testsuite/gcc.target/arm/neon-vget_laneu64.c
new file mode 100644
index 00000000000..b0ce070d3b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vget_laneu64.c
@@ -0,0 +1,20 @@
+/* Test the `vget_lane_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64_t out_uint64_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t) 0xdeadbeefbadf00dLL;
+
+ out_uint64_t = vget_lane_u64 (arg0_uint64x1_t, 0);
+ if (out_uint64_t != (uint64_t)arg0_uint64x1_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vmla-1.c b/gcc/testsuite/gcc.target/arm/neon-vmla-1.c
index 336a53bb481..9d239ed47d0 100644
--- a/gcc/testsuite/gcc.target/arm/neon-vmla-1.c
+++ b/gcc/testsuite/gcc.target/arm/neon-vmla-1.c
@@ -1,5 +1,5 @@
/* { dg-require-effective-target arm_neon_hw } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */
/* { dg-add-options arm_neon } */
/* { dg-final { scan-assembler "vmla\\.f32" } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon-vmls-1.c b/gcc/testsuite/gcc.target/arm/neon-vmls-1.c
index 5e5e0c757ac..2beaebe17cf 100644
--- a/gcc/testsuite/gcc.target/arm/neon-vmls-1.c
+++ b/gcc/testsuite/gcc.target/arm/neon-vmls-1.c
@@ -1,5 +1,5 @@
/* { dg-require-effective-target arm_neon_hw } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */
/* { dg-add-options arm_neon } */
/* { dg-final { scan-assembler "vmls\\.f32" } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon-vmovQ_ns64.c b/gcc/testsuite/gcc.target/arm/neon-vmovQ_ns64.c
new file mode 100644
index 00000000000..5a8abdce038
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vmovQ_ns64.c
@@ -0,0 +1,22 @@
+/* Test the `vmovq_ns64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x2_t out_int64x2_t = {0, 0};
+ int64_t arg0_int64_t = (int64_t) 0xdeadbeef;
+
+ out_int64x2_t = vmovq_n_s64 (arg0_int64_t);
+ if (vgetq_lane_s64 (out_int64x2_t, 0) != arg0_int64_t)
+ abort();
+ if (vgetq_lane_s64 (out_int64x2_t, 1) != arg0_int64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vmovQ_nu64.c b/gcc/testsuite/gcc.target/arm/neon-vmovQ_nu64.c
new file mode 100644
index 00000000000..8012fc1753d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vmovQ_nu64.c
@@ -0,0 +1,23 @@
+/* Test the `vmovq_nu64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x2_t out_uint64x2_t = {0, 0};
+ uint64_t arg0_uint64_t = (uint64_t) 0xdeadbeef;
+
+ out_uint64x2_t = vmovq_n_u64 (arg0_uint64_t);
+ if (vgetq_lane_u64 (out_uint64x2_t, 0) != arg0_uint64_t)
+ abort();
+ if (vgetq_lane_u64 (out_uint64x2_t, 1) != arg0_uint64_t)
+ abort();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/arm/neon-vmov_ns64.c b/gcc/testsuite/gcc.target/arm/neon-vmov_ns64.c
new file mode 100644
index 00000000000..c125f4a247d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vmov_ns64.c
@@ -0,0 +1,20 @@
+/* Test the `vmov_ns64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64_t arg0_int64_t = (int64_t) 0xdeadbeef;
+
+ out_int64x1_t = vmov_n_s64 (arg0_int64_t);
+ if ((int64_t)out_int64x1_t != arg0_int64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vmov_nu64.c b/gcc/testsuite/gcc.target/arm/neon-vmov_nu64.c
new file mode 100644
index 00000000000..71ecaed134e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vmov_nu64.c
@@ -0,0 +1,20 @@
+/* Test the `vmov_nu64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64_t arg0_uint64_t = (uint64_t) 0xdeadbeef;
+
+ out_uint64x1_t = vmov_n_u64 (arg0_uint64_t);
+ if ((uint64_t)out_uint64x1_t != arg0_uint64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vorns64.c b/gcc/testsuite/gcc.target/arm/neon-vorns64.c
new file mode 100644
index 00000000000..364dbd1904c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vorns64.c
@@ -0,0 +1,21 @@
+/* Test the `vorn_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeef00000000LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)(~0xdead00000000beefLL);
+
+ out_int64x1_t = vorn_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0xdeadbeef0000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vornu64.c b/gcc/testsuite/gcc.target/arm/neon-vornu64.c
new file mode 100644
index 00000000000..b352868469f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vornu64.c
@@ -0,0 +1,21 @@
+/* Test the `vorn_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeef00000000LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)(~0xdead00000000beefLL);
+
+ out_uint64x1_t = vorn_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0xdeadbeef0000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vorrs64.c b/gcc/testsuite/gcc.target/arm/neon-vorrs64.c
new file mode 100644
index 00000000000..90ced9e9c86
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vorrs64.c
@@ -0,0 +1,21 @@
+/* Test the `vorr_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeef00000000LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)0xdead00000000beefLL;
+
+ out_int64x1_t = vorr_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0xdeadbeef0000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vorru64.c b/gcc/testsuite/gcc.target/arm/neon-vorru64.c
new file mode 100644
index 00000000000..5b44afb07ab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vorru64.c
@@ -0,0 +1,21 @@
+/* Test the `vorr_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeef00000000LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)0xdead00000000beefLL;
+
+ out_uint64x1_t = vorr_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0xdeadbeef0000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vset_lanes64.c b/gcc/testsuite/gcc.target/arm/neon-vset_lanes64.c
new file mode 100644
index 00000000000..10113932711
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vset_lanes64.c
@@ -0,0 +1,21 @@
+/* Test the `vset_lane_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64_t arg0_int64_t = 0xf00f00f00LL;
+ int64x1_t arg1_int64x1_t = (int64x1_t) 0xdeadbeefbadf00dLL;
+
+ out_int64x1_t = vset_lane_s64 (arg0_int64_t, arg1_int64x1_t, 0);
+ if ((int64_t)out_int64x1_t != arg0_int64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vset_laneu64.c b/gcc/testsuite/gcc.target/arm/neon-vset_laneu64.c
new file mode 100644
index 00000000000..cafc2607687
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vset_laneu64.c
@@ -0,0 +1,21 @@
+/* Test the `vset_lane_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64_t arg0_uint64_t = 0xf00f00f00LL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t) 0xdeadbeefbadf00dLL;
+
+ out_uint64x1_t = vset_lane_u64 (arg0_uint64_t, arg1_uint64x1_t, 0);
+ if ((uint64_t)out_uint64x1_t != arg0_uint64_t)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vsubs64.c b/gcc/testsuite/gcc.target/arm/neon-vsubs64.c
new file mode 100644
index 00000000000..23947004127
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vsubs64.c
@@ -0,0 +1,21 @@
+/* Test the `vsub_s64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ int64x1_t out_int64x1_t = 0;
+ int64x1_t arg0_int64x1_t = (int64x1_t)0xdeadbeefdeadbeefLL;
+ int64x1_t arg1_int64x1_t = (int64x1_t)0x0000beefdead0000LL;
+
+ out_int64x1_t = vsub_s64 (arg0_int64x1_t, arg1_int64x1_t);
+ if (out_int64x1_t != (int64x1_t)0xdead00000000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon-vsubu64.c b/gcc/testsuite/gcc.target/arm/neon-vsubu64.c
new file mode 100644
index 00000000000..0162e206ef6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-vsubu64.c
@@ -0,0 +1,21 @@
+/* Test the `vsub_u64' ARM Neon intrinsic. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O0" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm_neon.h"
+#include <stdlib.h>
+
+int main (void)
+{
+ uint64x1_t out_uint64x1_t = 0;
+ uint64x1_t arg0_uint64x1_t = (uint64x1_t)0xdeadbeefdeadbeefLL;
+ uint64x1_t arg1_uint64x1_t = (uint64x1_t)0x0000beefdead0000LL;
+
+ out_uint64x1_t = vsub_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
+ if (out_uint64x1_t != (uint64x1_t)0xdead00000000beefLL)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/neon/vadds64.c b/gcc/testsuite/gcc.target/arm/neon/vadds64.c
index d3923775237..fb17e0ea3b6 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vadds64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vadds64.c
@@ -17,5 +17,4 @@ void test_vadds64 (void)
out_int64x1_t = vadd_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "vadd\.i64\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vaddu64.c b/gcc/testsuite/gcc.target/arm/neon/vaddu64.c
index 1114725b44d..18fc500b9f2 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vaddu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vaddu64.c
@@ -17,5 +17,4 @@ void test_vaddu64 (void)
out_uint64x1_t = vadd_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "vadd\.i64\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vands64.c b/gcc/testsuite/gcc.target/arm/neon/vands64.c
index b34abab6651..13e18fb0cbf 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vands64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vands64.c
@@ -17,5 +17,4 @@ void test_vands64 (void)
out_int64x1_t = vand_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "vand\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vandu64.c b/gcc/testsuite/gcc.target/arm/neon/vandu64.c
index 4660272cc20..d9ddf847af3 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vandu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vandu64.c
@@ -17,5 +17,4 @@ void test_vandu64 (void)
out_uint64x1_t = vand_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "vand\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vbics64.c b/gcc/testsuite/gcc.target/arm/neon/vbics64.c
index 41db18e2744..379db45f4db 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vbics64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vbics64.c
@@ -17,5 +17,4 @@ void test_vbics64 (void)
out_int64x1_t = vbic_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "vbic\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vbicu64.c b/gcc/testsuite/gcc.target/arm/neon/vbicu64.c
index 9f0a047fc92..c276d65ebe3 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vbicu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vbicu64.c
@@ -17,5 +17,4 @@ void test_vbicu64 (void)
out_uint64x1_t = vbic_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "vbic\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vdupQ_ns64.c b/gcc/testsuite/gcc.target/arm/neon/vdupQ_ns64.c
index 987a4d3f63f..ab749a7bbad 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vdupQ_ns64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vdupQ_ns64.c
@@ -16,6 +16,4 @@ void test_vdupQ_ns64 (void)
out_int64x2_t = vdupq_n_s64 (arg0_int64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vdupQ_nu64.c b/gcc/testsuite/gcc.target/arm/neon/vdupQ_nu64.c
index c2e5d481a3d..0ddb72decc8 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vdupQ_nu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vdupQ_nu64.c
@@ -16,6 +16,4 @@ void test_vdupQ_nu64 (void)
out_uint64x2_t = vdupq_n_u64 (arg0_uint64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vdup_ns64.c b/gcc/testsuite/gcc.target/arm/neon/vdup_ns64.c
index 720cc0452d2..033f1b4744c 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vdup_ns64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vdup_ns64.c
@@ -16,5 +16,4 @@ void test_vdup_ns64 (void)
out_int64x1_t = vdup_n_s64 (arg0_int64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vdup_nu64.c b/gcc/testsuite/gcc.target/arm/neon/vdup_nu64.c
index 4033e4757dc..6888125c638 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vdup_nu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vdup_nu64.c
@@ -16,5 +16,4 @@ void test_vdup_nu64 (void)
out_uint64x1_t = vdup_n_u64 (arg0_uint64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/veors64.c b/gcc/testsuite/gcc.target/arm/neon/veors64.c
index 0543b22e2e1..2781be1b2cc 100644
--- a/gcc/testsuite/gcc.target/arm/neon/veors64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/veors64.c
@@ -17,5 +17,4 @@ void test_veors64 (void)
out_int64x1_t = veor_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "veor\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/veoru64.c b/gcc/testsuite/gcc.target/arm/neon/veoru64.c
index 1098285dc6f..19d081489ed 100644
--- a/gcc/testsuite/gcc.target/arm/neon/veoru64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/veoru64.c
@@ -17,5 +17,4 @@ void test_veoru64 (void)
out_uint64x1_t = veor_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "veor\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vget_lanes64.c b/gcc/testsuite/gcc.target/arm/neon/vget_lanes64.c
index 136242900a7..5dc99424fa5 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vget_lanes64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vget_lanes64.c
@@ -16,5 +16,4 @@ void test_vget_lanes64 (void)
out_int64_t = vget_lane_s64 (arg0_int64x1_t, 0);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[rR\]\[0-9\]+, \[rR\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vget_laneu64.c b/gcc/testsuite/gcc.target/arm/neon/vget_laneu64.c
index 4b44a1e8c37..496a057fc73 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vget_laneu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vget_laneu64.c
@@ -16,5 +16,4 @@ void test_vget_laneu64 (void)
out_uint64_t = vget_lane_u64 (arg0_uint64x1_t, 0);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[rR\]\[0-9\]+, \[rR\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vmovQ_ns64.c b/gcc/testsuite/gcc.target/arm/neon/vmovQ_ns64.c
index 89fe2c150fd..35936cbd43a 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vmovQ_ns64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vmovQ_ns64.c
@@ -16,6 +16,4 @@ void test_vmovQ_ns64 (void)
out_int64x2_t = vmovq_n_s64 (arg0_int64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vmovQ_nu64.c b/gcc/testsuite/gcc.target/arm/neon/vmovQ_nu64.c
index d7d3e365ecd..e373a121865 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vmovQ_nu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vmovQ_nu64.c
@@ -16,6 +16,4 @@ void test_vmovQ_nu64 (void)
out_uint64x2_t = vmovq_n_u64 (arg0_uint64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vmov_ns64.c b/gcc/testsuite/gcc.target/arm/neon/vmov_ns64.c
index 6d2d61678b9..7b011282832 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vmov_ns64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vmov_ns64.c
@@ -16,5 +16,4 @@ void test_vmov_ns64 (void)
out_int64x1_t = vmov_n_s64 (arg0_int64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vmov_nu64.c b/gcc/testsuite/gcc.target/arm/neon/vmov_nu64.c
index 9434377d2ff..b9613e06ff1 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vmov_nu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vmov_nu64.c
@@ -16,5 +16,4 @@ void test_vmov_nu64 (void)
out_uint64x1_t = vmov_n_u64 (arg0_uint64_t);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vorns64.c b/gcc/testsuite/gcc.target/arm/neon/vorns64.c
index eb3253743a2..d7b8e60d208 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vorns64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vorns64.c
@@ -17,5 +17,4 @@ void test_vorns64 (void)
out_int64x1_t = vorn_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "vorn\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vornu64.c b/gcc/testsuite/gcc.target/arm/neon/vornu64.c
index a92a7d7124c..6fb3a9502a6 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vornu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vornu64.c
@@ -17,5 +17,4 @@ void test_vornu64 (void)
out_uint64x1_t = vorn_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "vorn\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vorrs64.c b/gcc/testsuite/gcc.target/arm/neon/vorrs64.c
index eaa107cb649..a1c7e5ee222 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vorrs64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vorrs64.c
@@ -17,5 +17,4 @@ void test_vorrs64 (void)
out_int64x1_t = vorr_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "vorr\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vorru64.c b/gcc/testsuite/gcc.target/arm/neon/vorru64.c
index 2dc4898a779..1991b02152f 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vorru64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vorru64.c
@@ -17,5 +17,4 @@ void test_vorru64 (void)
out_uint64x1_t = vorr_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "vorr\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vset_lanes64.c b/gcc/testsuite/gcc.target/arm/neon/vset_lanes64.c
index 2c4bede7796..5c5454f9807 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vset_lanes64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vset_lanes64.c
@@ -17,5 +17,4 @@ void test_vset_lanes64 (void)
out_int64x1_t = vset_lane_s64 (arg0_int64_t, arg1_int64x1_t, 0);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vset_laneu64.c b/gcc/testsuite/gcc.target/arm/neon/vset_laneu64.c
index 22ba53c20a9..3bff5d232c7 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vset_laneu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vset_laneu64.c
@@ -17,5 +17,4 @@ void test_vset_laneu64 (void)
out_uint64x1_t = vset_lane_u64 (arg0_uint64_t, arg1_uint64x1_t, 0);
}
-/* { dg-final { scan-assembler "vmov\[ \]+\[dD\]\[0-9\]+, \[rR\]\[0-9\]+, \[rR\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vsubs64.c b/gcc/testsuite/gcc.target/arm/neon/vsubs64.c
index 656039989a0..57bcd33d42c 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vsubs64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vsubs64.c
@@ -17,5 +17,4 @@ void test_vsubs64 (void)
out_int64x1_t = vsub_s64 (arg0_int64x1_t, arg1_int64x1_t);
}
-/* { dg-final { scan-assembler "vsub\.i64\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon/vsubu64.c b/gcc/testsuite/gcc.target/arm/neon/vsubu64.c
index 5e4a2a871e9..3a8ae462e81 100644
--- a/gcc/testsuite/gcc.target/arm/neon/vsubu64.c
+++ b/gcc/testsuite/gcc.target/arm/neon/vsubu64.c
@@ -17,5 +17,4 @@ void test_vsubu64 (void)
out_uint64x1_t = vsub_u64 (arg0_uint64x1_t, arg1_uint64x1_t);
}
-/* { dg-final { scan-assembler "vsub\.i64\[ \]+\[dD\]\[0-9\]+, \[dD\]\[0-9\]+, \[dD\]\[0-9\]+!?\(\[ \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr39839.c b/gcc/testsuite/gcc.target/arm/pr39839.c
new file mode 100644
index 00000000000..31e865af2f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr39839.c
@@ -0,0 +1,24 @@
+/* { dg-options "-mthumb -Os -march=armv5te -mthumb-interwork -fpic" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-final { scan-assembler-not "str\[\\t \]*r.,\[\\t \]*.sp," } } */
+
+struct S
+{
+ int count;
+ char *addr;
+};
+
+void func(const char*, const char*, int, const char*);
+
+/* This function should not need to spill to the stack. */
+void test(struct S *p)
+{
+ int off = p->count;
+ while (p->count >= 0)
+ {
+ const char *s = "xyz";
+ if (*p->addr) s = "pqr";
+ func("abcde", p->addr + off, off, s);
+ p->count--;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr40657-1.c b/gcc/testsuite/gcc.target/arm/pr40657-1.c
new file mode 100644
index 00000000000..a6ac6c78a1c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr40657-1.c
@@ -0,0 +1,13 @@
+/* { dg-options "-Os -march=armv5te -mthumb" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-final { scan-assembler "pop.*r1.*pc" } } */
+/* { dg-final { scan-assembler-not "sub\[\\t \]*sp,\[\\t \]*sp" } } */
+/* { dg-final { scan-assembler-not "add\[\\t \]*sp,\[\\t \]*sp" } } */
+
+extern void bar(int*);
+int foo()
+{
+ int x;
+ bar(&x);
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr40657-2.c b/gcc/testsuite/gcc.target/arm/pr40657-2.c
new file mode 100644
index 00000000000..31d48376730
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr40657-2.c
@@ -0,0 +1,20 @@
+/* { dg-options "-Os -march=armv4t -mthumb" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-final { scan-assembler-not "sub\[\\t \]*sp,\[\\t \]*sp" } } */
+/* { dg-final { scan-assembler-not "add\[\\t \]*sp,\[\\t \]*sp" } } */
+
+/* Here, we test that if there's a pop of r[4567] in the epilogue,
+ add sp,sp,#12 is removed and replaced by three additional pops
+ of lower-numbered regs. */
+
+extern void bar(int*);
+
+int t1, t2, t3, t4, t5;
+int foo()
+{
+ int i,j,k,x = 0;
+ for (i = 0; i < t1; i++)
+ for (j = 0; j < t2; j++)
+ bar(&x);
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr42172-1.c b/gcc/testsuite/gcc.target/arm/pr42172-1.c
new file mode 100644
index 00000000000..207f6001fb7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr42172-1.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O2" } */
+
+struct A {
+ unsigned int f1 : 3;
+ unsigned int f2 : 3;
+ unsigned int f3 : 1;
+ unsigned int f4 : 1;
+
+};
+
+void init_A (struct A *this)
+{
+ this->f1 = 0;
+ this->f2 = 1;
+ this->f3 = 0;
+ this->f4 = 0;
+}
+
+/* { dg-final { scan-assembler-times "ldr" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr42235.c b/gcc/testsuite/gcc.target/arm/pr42235.c
new file mode 100644
index 00000000000..478abcc0765
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr42235.c
@@ -0,0 +1,11 @@
+/* { dg-options "-mthumb -O2 -march=armv5te" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-final { scan-assembler-not "add\[\\t \]*r.,\[\\t \]*r.,\[\\t \]*\#1" } } */
+/* { dg-final { scan-assembler-not "add\[\\t \]*r.,\[\\t \]*\#1" } } */
+
+#include <string.h>
+
+int foo (char *x)
+{
+ memset (x, 0, 6);
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr42505.c b/gcc/testsuite/gcc.target/arm/pr42505.c
new file mode 100644
index 00000000000..60902c35d27
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr42505.c
@@ -0,0 +1,23 @@
+/* { dg-options "-mthumb -Os -march=armv5te" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-final { scan-assembler-not "str\[\\t \]*r.,\[\\t \]*.sp," } } */
+
+struct A {
+ int f1;
+ int f2;
+};
+
+int func(int c);
+
+/* This function should not need to spill anything to the stack. */
+int test(struct A* src, struct A* dst, int count)
+{
+ while (count--) {
+ if (!func(src->f2)) {
+ return 0;
+ }
+ *dst++ = *src++;
+ }
+
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr42835.c b/gcc/testsuite/gcc.target/arm/pr42835.c
new file mode 100644
index 00000000000..71c51ebe31c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr42835.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+
+int foo(int *p, int i)
+{
+ return( (i < 0 && *p == 1)
+ || (i > 0 && *p == 2) );
+}
+
+/* { dg-final { scan-assembler-times "movne\[\\t \]*r.,\[\\t \]*#" 1 } } */
+/* { dg-final { scan-assembler-times "moveq\[\\t \]*r.,\[\\t \]*#" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr43698.c b/gcc/testsuite/gcc.target/arm/pr43698.c
new file mode 100644
index 00000000000..407cf7eac2c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr43698.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-Os -march=armv7-a" } */
+#include <stdint.h>
+#include <stdlib.h>
+
+
+char do_reverse_endian = 0;
+
+# define bswap_32(x) \
+ ((((x) & 0xff000000) >> 24) | \
+ (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | \
+ (((x) & 0x000000ff) << 24))
+
+#define EGET(X) \
+ (__extension__ ({ \
+ uint64_t __res; \
+ if (!do_reverse_endian) { __res = (X); \
+ } else if (sizeof(X) == 4) { __res = bswap_32((X)); \
+ } \
+ __res; \
+ }))
+
+void __attribute__((noinline)) X(char **phdr, char **data, int *phoff)
+{
+ *phdr = *data + EGET(*phoff);
+}
+
+int main()
+{
+ char *phdr;
+ char *data = (char *)0x40164000;
+ int phoff = 0x34;
+ X(&phdr, &data, &phoff);
+ if (phdr != (char *)0x40164034)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr44788.c b/gcc/testsuite/gcc.target/arm/pr44788.c
new file mode 100644
index 00000000000..eb4bc11af9f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr44788.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-options "-Os -fno-strict-aliasing -fPIC -mthumb -march=armv7-a -mfpu=vfp3 -mfloat-abi=softfp" } */
+
+void joint_decode(float* mlt_buffer1, int t) {
+ int i;
+ float decode_buffer[1060];
+ foo(decode_buffer);
+ for (i=0; i<10 ; i++) {
+ mlt_buffer1[i] = i * decode_buffer[t];
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/20020523.c b/gcc/testsuite/gcc.target/i386/20020523.c
index 7c3490f780b..0684d5feb42 100644
--- a/gcc/testsuite/gcc.target/i386/20020523.c
+++ b/gcc/testsuite/gcc.target/i386/20020523.c
@@ -4,6 +4,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse -mfpmath=sse -ffast-math" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/aes-avx-check.h b/gcc/testsuite/gcc.target/i386/aes-avx-check.h
index e91e88173cf..36a038ea341 100644
--- a/gcc/testsuite/gcc.target/i386/aes-avx-check.h
+++ b/gcc/testsuite/gcc.target/i386/aes-avx-check.h
@@ -22,7 +22,8 @@ main ()
return 0;
/* Run AES + AVX test only if host has AES + AVX support. */
- if ((ecx & (bit_AVX | bit_AES)) == (bit_AVX | bit_AES))
+ if ((ecx & (bit_AVX | bit_OSXSAVE | bit_AES))
+ == (bit_AVX | bit_OSXSAVE | bit_AES))
{
do_test ();
#ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/i386/all_one_m128i.c b/gcc/testsuite/gcc.target/i386/all_one_m128i.c
index 24d870fa37f..fa973e420ab 100644
--- a/gcc/testsuite/gcc.target/i386/all_one_m128i.c
+++ b/gcc/testsuite/gcc.target/i386/all_one_m128i.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
typedef int __v4si __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/avx-check.h b/gcc/testsuite/gcc.target/i386/avx-check.h
index 7736fc9f40b..b15584ad274 100644
--- a/gcc/testsuite/gcc.target/i386/avx-check.h
+++ b/gcc/testsuite/gcc.target/i386/avx-check.h
@@ -20,7 +20,7 @@ main ()
return 0;
/* Run AVX test only if host has AVX support. */
- if (ecx & bit_AVX)
+ if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
{
do_test ();
#ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/i386/avx-cmpsd-1.c b/gcc/testsuite/gcc.target/i386/avx-cmpsd-1.c
index 65cda0b2cbf..7898606b0bc 100644
--- a/gcc/testsuite/gcc.target/i386/avx-cmpsd-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-cmpsd-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#define CHECK_H "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-cmpss-1.c b/gcc/testsuite/gcc.target/i386/avx-cmpss-1.c
index b2603aad4c5..e0ee934dad5 100644
--- a/gcc/testsuite/gcc.target/i386/avx-cmpss-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-cmpss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#define CHECK_H "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c
index be69d47e822..f9646a10d12 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#include "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c
index 7000bb07feb..1c169f5ac5c 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#include "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c
index 753f2ce64d0..888f9eb2878 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#include "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c
index c1292a25555..b82abb6dcea 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#include "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c
index 97ca6e6c50f..9b6d580289c 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#include "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c
index 627333a860c..0dd1b09228e 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target avx } */
+/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -mavx -std=c99" } */
#include "avx-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/brokensqrt.c b/gcc/testsuite/gcc.target/i386/brokensqrt.c
index 19a59d822e6..836d3b37d4c 100644
--- a/gcc/testsuite/gcc.target/i386/brokensqrt.c
+++ b/gcc/testsuite/gcc.target/i386/brokensqrt.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
extern float sqrtf (float);
diff --git a/gcc/testsuite/gcc.target/i386/f16c-check.h b/gcc/testsuite/gcc.target/i386/f16c-check.h
new file mode 100644
index 00000000000..af7f32c5f4f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/f16c-check.h
@@ -0,0 +1,30 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include "cpuid.h"
+#include "m256-check.h"
+
+static void f16c_test (void);
+
+int
+main ()
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run F16C test only if host has F16C support. */
+ if (ecx & bit_F16C)
+ {
+ f16c_test ();
+#ifdef DEBUG
+ printf ("PASSED\n");
+#endif
+ }
+#ifdef DEBUG
+ else
+ printf ("SKIPPED\n");
+#endif
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/fastcall-sseregparm.c b/gcc/testsuite/gcc.target/i386/fastcall-sseregparm.c
index bdfae5b3b7b..1a55a3d60eb 100644
--- a/gcc/testsuite/gcc.target/i386/fastcall-sseregparm.c
+++ b/gcc/testsuite/gcc.target/i386/fastcall-sseregparm.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-options "-mpreferred-stack-boundary=4 -msse" } */
/* { dg-require-effective-target ilp32 } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/fpcvt-1.c b/gcc/testsuite/gcc.target/i386/fpcvt-1.c
index 5f09aedc53e..1c3b9b83453 100644
--- a/gcc/testsuite/gcc.target/i386/fpcvt-1.c
+++ b/gcc/testsuite/gcc.target/i386/fpcvt-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler-not "cvtss2sd" } } */
float a,b;
main()
diff --git a/gcc/testsuite/gcc.target/i386/fpcvt-2.c b/gcc/testsuite/gcc.target/i386/fpcvt-2.c
index 317aa13b887..066d84365ed 100644
--- a/gcc/testsuite/gcc.target/i386/fpcvt-2.c
+++ b/gcc/testsuite/gcc.target/i386/fpcvt-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler-not "cvtss2sd" } } */
float a,b;
main()
diff --git a/gcc/testsuite/gcc.target/i386/fpcvt-3.c b/gcc/testsuite/gcc.target/i386/fpcvt-3.c
index 70377c3d627..569d21a5aa7 100644
--- a/gcc/testsuite/gcc.target/i386/fpcvt-3.c
+++ b/gcc/testsuite/gcc.target/i386/fpcvt-3.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler-not "cvtss2sd" } } */
extern double fabs (double);
float a,b;
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-9.c b/gcc/testsuite/gcc.target/i386/funcspec-9.c
index 1c05f134ab5..78714e12417 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-9.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-9.c
@@ -1,7 +1,6 @@
/* Test whether using target specific options, we can generate FMA4 code. */
/* { dg-do compile } */
/* { dg-options "-O2 -march=k8 -mfpmath=sse -msse2" } */
-/* { dg-require-effective-target sse2 } */
extern void exit (int);
diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp
index 8b31231b61c..65abf58db81 100644
--- a/gcc/testsuite/gcc.target/i386/i386.exp
+++ b/gcc/testsuite/gcc.target/i386/i386.exp
@@ -27,8 +27,7 @@ load_lib gcc-dg.exp
# Return 1 if attribute ms_hook_prologue is supported.
proc check_effective_target_ms_hook_prologue { } {
- if { [check_effective_target_ilp32]
- && [check_no_compiler_messages ms_hook_prologue object {
+ if { [check_no_compiler_messages ms_hook_prologue object {
void __attribute__ ((__ms_hook_prologue__)) foo ();
} ""] } {
return 1
diff --git a/gcc/testsuite/gcc.target/i386/incoming-1.c b/gcc/testsuite/gcc.target/i386/incoming-1.c
index 9129ad00e17..86e98a79b47 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-1.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-1.c
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/incoming-12.c b/gcc/testsuite/gcc.target/i386/incoming-12.c
index b6bfa418d90..d7ef1038bb5 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-12.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-12.c
@@ -1,7 +1,6 @@
/* PR target/40838 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -mstackrealign -O2 -msse2 -mpreferred-stack-boundary=4" } */
-/* { dg-require-effective-target sse2 } */
typedef int v4si __attribute__ ((vector_size (16)));
diff --git a/gcc/testsuite/gcc.target/i386/incoming-2.c b/gcc/testsuite/gcc.target/i386/incoming-2.c
index 18451669612..2947d3347cd 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-2.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-2.c
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/incoming-3.c b/gcc/testsuite/gcc.target/i386/incoming-3.c
index bb9653a4067..1edbfda0b39 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-3.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-3.c
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/incoming-4.c b/gcc/testsuite/gcc.target/i386/incoming-4.c
index e1d1b751e7b..80c169c2469 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-4.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-4.c
@@ -1,7 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
#include <stdarg.h>
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/incoming-6.c b/gcc/testsuite/gcc.target/i386/incoming-6.c
index f6b64b7abd2..5cc4ab3f766 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-6.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-6.c
@@ -1,7 +1,6 @@
/* PR target/40838 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -mstackrealign -O2 -msse2 -mpreferred-stack-boundary=4" } */
-/* { dg-require-effective-target sse2 } */
typedef int v4si __attribute__ ((vector_size (16)));
diff --git a/gcc/testsuite/gcc.target/i386/incoming-7.c b/gcc/testsuite/gcc.target/i386/incoming-7.c
index fb5380490d6..cdd60379683 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-7.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-7.c
@@ -1,7 +1,6 @@
/* PR target/40838 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -mstackrealign -O2 -msse2 -mpreferred-stack-boundary=4" } */
-/* { dg-require-effective-target sse2 } */
typedef int v4si __attribute__ ((vector_size (16)));
diff --git a/gcc/testsuite/gcc.target/i386/incoming-8.c b/gcc/testsuite/gcc.target/i386/incoming-8.c
index 0f27af72078..2dd8800fd6c 100644
--- a/gcc/testsuite/gcc.target/i386/incoming-8.c
+++ b/gcc/testsuite/gcc.target/i386/incoming-8.c
@@ -1,7 +1,6 @@
/* PR target/40838 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-w -mstackrealign -O3 -msse2 -mpreferred-stack-boundary=4" } */
-/* { dg-require-effective-target sse2 } */
float
foo (float f)
diff --git a/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp b/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
index a0e7b8d1eaa..2b1d63de17a 100644
--- a/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
+++ b/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
@@ -28,19 +28,23 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
set MATH_TORTURE_OPTIONS [list \
{ -O0 } \
{ -O0 -mfpmath=387 } \
+ { -O0 -mfpmath=387 -ffast-math } \
+ { -O2 } \
+ { -O2 -mfpmath=387 } \
+ { -O2 -mfpmath=387 -ffast-math } \
+]
+
+if { [check_effective_target_sse] } {
+ lappend MATH_TORTURE_OPTIONS \
{ -O0 -msse -mno-sse2 -mfpmath=sse } \
{ -O0 -msse -mno-sse2 -mfpmath=sse,387 } \
- { -O0 -mfpmath=387 -ffast-math } \
{ -O0 -msse -mno-sse2 -mfpmath=sse -ffast-math } \
{ -O0 -msse -mno-sse2 -mfpmath=sse,387 -ffast-math } \
- { -O2 } \
- { -O2 -mfpmath=387 } \
{ -O2 -msse -mno-sse2 -mfpmath=sse } \
{ -O2 -msse -mno-sse2 -mfpmath=sse,387 } \
- { -O2 -mfpmath=387 -ffast-math } \
{ -O2 -msse -mno-sse2 -mfpmath=sse -ffast-math } \
{ -O2 -msse -mno-sse2 -mfpmath=sse,387 -ffast-math } \
-]
+}
if { [check_effective_target_sse2] } {
lappend MATH_TORTURE_OPTIONS \
diff --git a/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c b/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c
index f945492dfde..e11bcc049cb 100644
--- a/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c
+++ b/gcc/testsuite/gcc.target/i386/ms_hook_prologue.c
@@ -11,7 +11,7 @@ int __attribute__ ((__ms_hook_prologue__)) foo ()
/* The NOP mov must not be optimized away by optimizations.
The push %ebp, mov %esp, %ebp must not be removed by
-fomit-frame-pointer */
-
+#ifndef __x86_64__
/* movl.s %edi, %edi */
if(*ptr++ != 0x8b) return 1;
if(*ptr++ != 0xff) return 1;
@@ -20,6 +20,15 @@ int __attribute__ ((__ms_hook_prologue__)) foo ()
/* movl.s %esp, %ebp */
if(*ptr++ != 0x8b) return 1;
if(*ptr++ != 0xec) return 1;
+#else
+ /* leaq 0(%rsp), %rsp */
+ if (*ptr++ != 0x48) return 1;
+ if (*ptr++ != 0x8d) return 1;
+ if (*ptr++ != 0xa4) return 1;
+ if (*ptr++ != 0x24) return 1;
+ if (ptr[0] != 0 || ptr[1] != 0 || ptr[2] != 0 || ptr[3] != 0)
+ return 1;
+#endif
return 0;
}
diff --git a/gcc/testsuite/gcc.target/i386/opt-1.c b/gcc/testsuite/gcc.target/i386/opt-1.c
index 74d3e8d1046..28e2ef38c34 100644
--- a/gcc/testsuite/gcc.target/i386/opt-1.c
+++ b/gcc/testsuite/gcc.target/i386/opt-1.c
@@ -2,7 +2,6 @@
whether we vectorize a simple loop. */
/* { dg-do compile } */
/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "prefetcht0" } } */
/* { dg-final { scan-assembler "addps" } } */
/* { dg-final { scan-assembler "subss" } } */
diff --git a/gcc/testsuite/gcc.target/i386/opt-2.c b/gcc/testsuite/gcc.target/i386/opt-2.c
index d247d71fc23..d2791e071c3 100644
--- a/gcc/testsuite/gcc.target/i386/opt-2.c
+++ b/gcc/testsuite/gcc.target/i386/opt-2.c
@@ -2,7 +2,6 @@
whether we vectorize a simple loop. */
/* { dg-do compile } */
/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "prefetcht0" } } */
/* { dg-final { scan-assembler "addps" } } */
/* { dg-final { scan-assembler "subss" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ordcmp-1.c b/gcc/testsuite/gcc.target/i386/ordcmp-1.c
index 9be97e52b91..a136182aca9 100644
--- a/gcc/testsuite/gcc.target/i386/ordcmp-1.c
+++ b/gcc/testsuite/gcc.target/i386/ordcmp-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "cmpordss" } } */
/* { dg-final { scan-assembler "cmpordps" } } */
/* { dg-final { scan-assembler "cmpordsd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h b/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h
index 550e49904d9..750e25c5069 100644
--- a/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h
+++ b/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h
@@ -22,7 +22,8 @@ main ()
return 0;
/* Run PCLMUL + AVX test only if host has PCLMUL + AVX support. */
- if ((ecx & (bit_AVX | bit_PCLMUL)) == (bit_AVX | bit_PCLMUL))
+ if ((ecx & (bit_AVX | bit_OSXSAVE | bit_PCLMUL))
+ == (bit_AVX | bit_OSXSAVE | bit_PCLMUL))
{
do_test ();
#ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/i386/pr13685.c b/gcc/testsuite/gcc.target/i386/pr13685.c
index 159112d1666..a50681bea26 100644
--- a/gcc/testsuite/gcc.target/i386/pr13685.c
+++ b/gcc/testsuite/gcc.target/i386/pr13685.c
@@ -1,6 +1,7 @@
/* PR target/13685 */
/* { dg-do run } */
/* { dg-options "-Os -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/pr17692.c b/gcc/testsuite/gcc.target/i386/pr17692.c
index f8aed82750f..476d8e3de3f 100644
--- a/gcc/testsuite/gcc.target/i386/pr17692.c
+++ b/gcc/testsuite/gcc.target/i386/pr17692.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O -mfpmath=sse -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
/* The fact that t1 and t2 are uninitialized is critical. With them
uninitialized, the register allocator is free to put them in the same
hard register, which results in
diff --git a/gcc/testsuite/gcc.target/i386/pr18614-1.c b/gcc/testsuite/gcc.target/i386/pr18614-1.c
index 6e16616cae6..1a499753760 100644
--- a/gcc/testsuite/gcc.target/i386/pr18614-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr18614-1.c
@@ -1,7 +1,6 @@
/* PR rtl-optimization/18614 */
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef double v2df __attribute__ ((vector_size (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr22152.c b/gcc/testsuite/gcc.target/i386/pr22152.c
index 4dce76cc947..d12597703ea 100644
--- a/gcc/testsuite/gcc.target/i386/pr22152.c
+++ b/gcc/testsuite/gcc.target/i386/pr22152.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <mmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/pr23570.c b/gcc/testsuite/gcc.target/i386/pr23570.c
index f220a8cb80d..1542663fa22 100644
--- a/gcc/testsuite/gcc.target/i386/pr23570.c
+++ b/gcc/testsuite/gcc.target/i386/pr23570.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef float __v4sf __attribute__ ((__vector_size__ (16)));
typedef float __m128 __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr23575.c b/gcc/testsuite/gcc.target/i386/pr23575.c
index 1b0ec7f88c3..522226ef7a2 100644
--- a/gcc/testsuite/gcc.target/i386/pr23575.c
+++ b/gcc/testsuite/gcc.target/i386/pr23575.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-msse2 -O2" } */
-/* { dg-require-effective-target sse2 } */
/* We used to ICE because of a bogous pattern. */
diff --git a/gcc/testsuite/gcc.target/i386/pr24306.c b/gcc/testsuite/gcc.target/i386/pr24306.c
index c578475bbea..1319918c350 100644
--- a/gcc/testsuite/gcc.target/i386/pr24306.c
+++ b/gcc/testsuite/gcc.target/i386/pr24306.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/pr26449-1.c b/gcc/testsuite/gcc.target/i386/pr26449-1.c
index e83375d6d0f..b4ef7804887 100644
--- a/gcc/testsuite/gcc.target/i386/pr26449-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr26449-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -mtune=k8" } */
-/* { dg-require-effective-target sse2 } */
typedef short __v8hi __attribute__ ((__vector_size__ (16)));
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr26600.c b/gcc/testsuite/gcc.target/i386/pr26600.c
index 61941de70e4..bbe0663da7e 100644
--- a/gcc/testsuite/gcc.target/i386/pr26600.c
+++ b/gcc/testsuite/gcc.target/i386/pr26600.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O -ftree-vectorize -msse2" } */
-/* { dg-require-effective-target sse2 } */
void foo(int *p, int N)
{
diff --git a/gcc/testsuite/gcc.target/i386/pr27790.c b/gcc/testsuite/gcc.target/i386/pr27790.c
index 4c5cdb6dc74..e8986c4158a 100644
--- a/gcc/testsuite/gcc.target/i386/pr27790.c
+++ b/gcc/testsuite/gcc.target/i386/pr27790.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O -ftree-vectorize -msse2" } */
-/* { dg-require-effective-target sse2 } */
void binarize (int npixels, unsigned char *b)
{
diff --git a/gcc/testsuite/gcc.target/i386/pr28839.c b/gcc/testsuite/gcc.target/i386/pr28839.c
index ccb715d7478..6a215164c58 100644
--- a/gcc/testsuite/gcc.target/i386/pr28839.c
+++ b/gcc/testsuite/gcc.target/i386/pr28839.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -ftree-vectorize -funswitch-loops" } */
-/* { dg-require-effective-target sse2 } */
static int ready[10];
void abort (void);
diff --git a/gcc/testsuite/gcc.target/i386/pr30970.c b/gcc/testsuite/gcc.target/i386/pr30970.c
index 25f773915f8..96d64e5a962 100644
--- a/gcc/testsuite/gcc.target/i386/pr30970.c
+++ b/gcc/testsuite/gcc.target/i386/pr30970.c
@@ -1,6 +1,5 @@
/* { dg-do compile }
/* { dg-options "-msse2 -O2 -ftree-vectorize" } */
-/* { dg-require-effective-target sse2 } */
#define N 256
int b[N];
diff --git a/gcc/testsuite/gcc.target/i386/pr32065-2.c b/gcc/testsuite/gcc.target/i386/pr32065-2.c
index e1a88592d3c..5f055b59c3a 100644
--- a/gcc/testsuite/gcc.target/i386/pr32065-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr32065-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target dfp } */
+/* { dg-require-effective-target sse } */
/* { dg-options "-Os -msse -std=gnu99" } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/pr32280.c b/gcc/testsuite/gcc.target/i386/pr32280.c
index 49865ea4ba6..d48a635a4b8 100644
--- a/gcc/testsuite/gcc.target/i386/pr32280.c
+++ b/gcc/testsuite/gcc.target/i386/pr32280.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr32661.c b/gcc/testsuite/gcc.target/i386/pr32661.c
index 2eb1544e336..247ae131923 100644
--- a/gcc/testsuite/gcc.target/i386/pr32661.c
+++ b/gcc/testsuite/gcc.target/i386/pr32661.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef int __v4si __attribute__ ((__vector_size__ (16)));
typedef float __v4sf __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr32708-1.c b/gcc/testsuite/gcc.target/i386/pr32708-1.c
index 5200f3f6547..c5308937bb0 100644
--- a/gcc/testsuite/gcc.target/i386/pr32708-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr32708-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef long long __v2di __attribute__ ((__vector_size__ (16)));
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr32961.c b/gcc/testsuite/gcc.target/i386/pr32961.c
index 8b513623111..a2326289af9 100644
--- a/gcc/testsuite/gcc.target/i386/pr32961.c
+++ b/gcc/testsuite/gcc.target/i386/pr32961.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O0 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <xmmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/pr33329.c b/gcc/testsuite/gcc.target/i386/pr33329.c
index e8036082cf1..bb589ee2780 100644
--- a/gcc/testsuite/gcc.target/i386/pr33329.c
+++ b/gcc/testsuite/gcc.target/i386/pr33329.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize -msse2" } */
-/* { dg-require-effective-target sse2 } */
extern void g (int *);
diff --git a/gcc/testsuite/gcc.target/i386/pr35714.c b/gcc/testsuite/gcc.target/i386/pr35714.c
index d5d2755ed07..13ca47c23a3 100644
--- a/gcc/testsuite/gcc.target/i386/pr35714.c
+++ b/gcc/testsuite/gcc.target/i386/pr35714.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/pr35767-5.c b/gcc/testsuite/gcc.target/i386/pr35767-5.c
index 9f533033b71..4372d2e5746 100644
--- a/gcc/testsuite/gcc.target/i386/pr35767-5.c
+++ b/gcc/testsuite/gcc.target/i386/pr35767-5.c
@@ -1,7 +1,6 @@
/* Test that we generate aligned load when memory is aligned. */
/* { dg-do compile } */
/* { dg-options "-O -msse2 -mtune=generic" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler-not "movups" } } */
/* { dg-final { scan-assembler "movaps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr36222-1.c b/gcc/testsuite/gcc.target/i386/pr36222-1.c
index 647e1039619..2d4c5b9b76c 100644
--- a/gcc/testsuite/gcc.target/i386/pr36222-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr36222-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
typedef int __v4si __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr36992-1.c b/gcc/testsuite/gcc.target/i386/pr36992-1.c
index 017616bcc5b..7cd24cccf3e 100644
--- a/gcc/testsuite/gcc.target/i386/pr36992-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr36992-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile }
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/pr37101.c b/gcc/testsuite/gcc.target/i386/pr37101.c
index 69b913c4103..8fd3bfc5f85 100644
--- a/gcc/testsuite/gcc.target/i386/pr37101.c
+++ b/gcc/testsuite/gcc.target/i386/pr37101.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -ftree-vectorize -march=nocona" } */
-/* { dg-require-effective-target sse2 } */
typedef __SIZE_TYPE__ size_t;
extern void *malloc (size_t);
diff --git a/gcc/testsuite/gcc.target/i386/pr37275.c b/gcc/testsuite/gcc.target/i386/pr37275.c
index ca9612bba30..070dab554c7 100644
--- a/gcc/testsuite/gcc.target/i386/pr37275.c
+++ b/gcc/testsuite/gcc.target/i386/pr37275.c
@@ -1,6 +1,7 @@
/* PR middle-end/37275 */
/* { dg-do compile { target ilp32 } } */
/* { dg-options "-g -dA -O2 -march=i686 -fstack-protector" } */
+/* { dg-require-visibility "" } */
typedef __SIZE_TYPE__ size_t;
extern void *memcpy (void *, const void *, size_t);
diff --git a/gcc/testsuite/gcc.target/i386/pr37434-1.c b/gcc/testsuite/gcc.target/i386/pr37434-1.c
index 00ed55e3234..b556bf0848e 100644
--- a/gcc/testsuite/gcc.target/i386/pr37434-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr37434-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef short __v8hi __attribute__ ((__vector_size__ (16)));
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr37434-2.c b/gcc/testsuite/gcc.target/i386/pr37434-2.c
index b92d52100da..00ff9fd2e6c 100644
--- a/gcc/testsuite/gcc.target/i386/pr37434-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr37434-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -mtune=core2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef short __v8hi __attribute__ ((__vector_size__ (16)));
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr37434-3.c b/gcc/testsuite/gcc.target/i386/pr37434-3.c
index 916c99fe02f..2cc597b04f5 100644
--- a/gcc/testsuite/gcc.target/i386/pr37434-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr37434-3.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
typedef char __v16qi __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr37434-4.c b/gcc/testsuite/gcc.target/i386/pr37434-4.c
index 15f8292b029..6848c63505e 100644
--- a/gcc/testsuite/gcc.target/i386/pr37434-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr37434-4.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -mtune=core2 -msse4.1" } */
typedef char __v16qi __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr39162.c b/gcc/testsuite/gcc.target/i386/pr39162.c
index 1a5e3e7aab0..2d114b8fd00 100644
--- a/gcc/testsuite/gcc.target/i386/pr39162.c
+++ b/gcc/testsuite/gcc.target/i386/pr39162.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -mno-avx" } */
-/* { dg-require-effective-target sse2 } */
typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__));
diff --git a/gcc/testsuite/gcc.target/i386/pr39315-1.c b/gcc/testsuite/gcc.target/i386/pr39315-1.c
index 9f4d484639f..16ba5d59fe4 100644
--- a/gcc/testsuite/gcc.target/i386/pr39315-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr39315-1.c
@@ -1,7 +1,6 @@
/* PR middle-end/39315 */
/* { dg-do compile } */
/* { dg-options "-O -msse2 -mtune=generic" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler-not "movups" } } */
/* { dg-final { scan-assembler-not "movlps" } } */
/* { dg-final { scan-assembler-not "movhps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr39315-2.c b/gcc/testsuite/gcc.target/i386/pr39315-2.c
index 5363e97509b..c1a3da75a36 100644
--- a/gcc/testsuite/gcc.target/i386/pr39315-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr39315-2.c
@@ -1,7 +1,7 @@
/* PR middle-end/39315 */
/* { dg-do run } */
/* { dg-options "-O -msse2 -mtune=generic" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
/* { dg-additional-sources pr39315-check.c } */
typedef float __m128 __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr39315-3.c b/gcc/testsuite/gcc.target/i386/pr39315-3.c
index 38ea7aed745..07862db603a 100644
--- a/gcc/testsuite/gcc.target/i386/pr39315-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr39315-3.c
@@ -1,7 +1,6 @@
/* PR middle-end/39315 */
/* { dg-do compile } */
/* { dg-options "-O -msse2 -mtune=generic" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler-not "movups" } } */
/* { dg-final { scan-assembler-not "movlps" } } */
/* { dg-final { scan-assembler-not "movhps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr39315-4.c b/gcc/testsuite/gcc.target/i386/pr39315-4.c
index 4a62a1d51b9..77258a7c76c 100644
--- a/gcc/testsuite/gcc.target/i386/pr39315-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr39315-4.c
@@ -1,7 +1,7 @@
/* PR middle-end/39315 */
/* { dg-do run } */
/* { dg-options "-O -msse2 -mtune=generic" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
/* { dg-additional-sources pr39315-check.c } */
typedef float __m128 __attribute__ ((__vector_size__ (16)));
diff --git a/gcc/testsuite/gcc.target/i386/pr39315-check.c b/gcc/testsuite/gcc.target/i386/pr39315-check.c
index 8f7376015d0..cb09d3f2be5 100644
--- a/gcc/testsuite/gcc.target/i386/pr39315-check.c
+++ b/gcc/testsuite/gcc.target/i386/pr39315-check.c
@@ -1,4 +1,5 @@
-/* { dg-compile } */
+/* { dg-do compile } */
+
typedef float __m128 __attribute__ ((__vector_size__ (16)));
__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
diff --git a/gcc/testsuite/gcc.target/i386/pr39496.c b/gcc/testsuite/gcc.target/i386/pr39496.c
index bdaca2e55a8..e4132a1165b 100644
--- a/gcc/testsuite/gcc.target/i386/pr39496.c
+++ b/gcc/testsuite/gcc.target/i386/pr39496.c
@@ -1,7 +1,6 @@
/* PR target/39496 */
/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } } */
/* { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -mtune=i686 -msse2 -mfpmath=sse" } */
-/* { dg-require-effective-target sse2 } */
/* Verify that {foo,bar}{,2}param are all passed on the stack, using
normal calling conventions, when not optimizing. */
/* { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*fooparam," } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr40957.c b/gcc/testsuite/gcc.target/i386/pr40957.c
index 56762d7e810..b7ee26dffcd 100644
--- a/gcc/testsuite/gcc.target/i386/pr40957.c
+++ b/gcc/testsuite/gcc.target/i386/pr40957.c
@@ -1,5 +1,4 @@
/* { dg-do compile } */
-/* { dg-require-effective-target avx } */
/* { dg-options "-O2 -mavx" } */
typedef int __v8si __attribute__((__vector_size__(32)));
diff --git a/gcc/testsuite/gcc.target/i386/pr42542-3a.c b/gcc/testsuite/gcc.target/i386/pr42542-3a.c
index 89c9ed4945b..754e59e8487 100644
--- a/gcc/testsuite/gcc.target/i386/pr42542-3a.c
+++ b/gcc/testsuite/gcc.target/i386/pr42542-3a.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O1 -msse2 -ftree-vectorize" } */
-/* { dg-require-effective-target sse2 } */
#include "pr42542-3.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr44942.c b/gcc/testsuite/gcc.target/i386/pr44942.c
new file mode 100644
index 00000000000..4664f7e0d53
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr44942.c
@@ -0,0 +1,44 @@
+/* PR target/44942 */
+/* { dg-do run { target lp64 } } */
+
+#include <stdarg.h>
+#include <emmintrin.h>
+
+void
+test1 (double a, double b, double c, double d, double e, double f,
+ double g, __m128d h, ...)
+{
+ double i;
+ va_list ap;
+
+ va_start (ap, h);
+ i = va_arg (ap, double);
+ if (i != 1234.0)
+ __builtin_abort ();
+ va_end (ap);
+}
+
+void
+test2 (double a, double b, double c, double d, double e, double f, double g,
+ __m128d h, double i, __m128d j, double k, __m128d l,
+ double m, __m128d n, ...)
+{
+ double o;
+ va_list ap;
+
+ va_start (ap, n);
+ o = va_arg (ap, double);
+ if (o != 1234.0)
+ __builtin_abort ();
+ va_end (ap);
+}
+
+int
+main ()
+{
+ __m128d m = _mm_set1_pd (7.0);
+ test1 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, m, 1234.0);
+ test2 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, m, 0.0, m,
+ 0.0, m, 0.0, m, 1234.0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/push-1.c b/gcc/testsuite/gcc.target/i386/push-1.c
index 797ad575dd1..09464bf9229 100644
--- a/gcc/testsuite/gcc.target/i386/push-1.c
+++ b/gcc/testsuite/gcc.target/i386/push-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-w -msse2 -Os" } */
-/* { dg-require-effective-target sse2 } */
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.target/i386/quad-sse.c b/gcc/testsuite/gcc.target/i386/quad-sse.c
index 8c594452618..4b6fe792575 100644
--- a/gcc/testsuite/gcc.target/i386/quad-sse.c
+++ b/gcc/testsuite/gcc.target/i386/quad-sse.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
__float128 x, y;
diff --git a/gcc/testsuite/gcc.target/i386/rdfsbase-1.c b/gcc/testsuite/gcc.target/i386/rdfsbase-1.c
new file mode 100644
index 00000000000..c4808e9683b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdfsbase-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "rdfsbase\[ \t]+(%|)eax" } } */
+
+#include <immintrin.h>
+
+unsigned int
+read_fs_base32 (void)
+{
+ return _readfsbase_u32 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/rdfsbase-2.c b/gcc/testsuite/gcc.target/i386/rdfsbase-2.c
new file mode 100644
index 00000000000..40b8f4a999f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdfsbase-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "rdfsbase\[ \t]+(%|)rax" } } */
+
+#include <immintrin.h>
+
+unsigned long long
+read_fs_base64 (void)
+{
+ return _readfsbase_u64 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/rdgsbase-1.c b/gcc/testsuite/gcc.target/i386/rdgsbase-1.c
new file mode 100644
index 00000000000..1e5a302085e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdgsbase-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "rdgsbase\[ \t]+(%|)eax" } } */
+
+#include <immintrin.h>
+
+unsigned int
+read_gs_base32 (void)
+{
+ return _readgsbase_u32 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/rdgsbase-2.c b/gcc/testsuite/gcc.target/i386/rdgsbase-2.c
new file mode 100644
index 00000000000..13215825069
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdgsbase-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "rdgsbase\[ \t]+(%|)rax" } } */
+
+#include <immintrin.h>
+
+unsigned long long
+read_gs_base64 (void)
+{
+ return _readgsbase_u64 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/rdrand-1.c b/gcc/testsuite/gcc.target/i386/rdrand-1.c
new file mode 100644
index 00000000000..4f6b9e177e0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdrand-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mrdrnd " } */
+/* { dg-final { scan-assembler "rdrand\[ \t]+(%|)ax" } } */
+/* { dg-final { scan-assembler "jnc\[ \t]+" } } */
+
+#include <immintrin.h>
+
+unsigned short
+read_rdrand16 (void)
+{
+ return _rdrand_u16 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/rdrand-2.c b/gcc/testsuite/gcc.target/i386/rdrand-2.c
new file mode 100644
index 00000000000..22973834dca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdrand-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mrdrnd " } */
+/* { dg-final { scan-assembler "rdrand\[ \t]+(%|)eax" } } */
+/* { dg-final { scan-assembler "jnc\[ \t]+" } } */
+
+#include <immintrin.h>
+
+unsigned int
+read_rdrand32 (void)
+{
+ return _rdrand_u32 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/rdrand-3.c b/gcc/testsuite/gcc.target/i386/rdrand-3.c
new file mode 100644
index 00000000000..17c7c6fff24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/rdrand-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mrdrnd " } */
+/* { dg-final { scan-assembler "rdrand\[ \t]+(%|)rax" } } */
+/* { dg-final { scan-assembler "jnc\[ \t]+" } } */
+
+#include <immintrin.h>
+
+unsigned long long
+read_rdrand64 (void)
+{
+ return _rdrand_u64 ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/reload-1.c b/gcc/testsuite/gcc.target/i386/reload-1.c
index 299871585e2..f8075acaed4 100644
--- a/gcc/testsuite/gcc.target/i386/reload-1.c
+++ b/gcc/testsuite/gcc.target/i386/reload-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O3 -msse2 -fdump-rtl-csa" } */
/* { dg-skip-if "no stdint" { vxworks_kernel } } */
diff --git a/gcc/testsuite/gcc.target/i386/sse-12.c b/gcc/testsuite/gcc.target/i386/sse-12.c
index 77baff0f4b9..2d50f41d540 100644
--- a/gcc/testsuite/gcc.target/i386/sse-12.c
+++ b/gcc/testsuite/gcc.target/i386/sse-12.c
@@ -2,7 +2,7 @@
abmintrin.h, lwpintrin.h, popcntintrin.h and mm_malloc.h are usable
with -O -std=c89 -pedantic-errors. */
/* { dg-do compile } */
-/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlwp" } */
+/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */
#include <x86intrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c
index 96214e02280..01809d0cffa 100644
--- a/gcc/testsuite/gcc.target/i386/sse-13.c
+++ b/gcc/testsuite/gcc.target/i386/sse-13.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp" } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */
#include <mm_malloc.h>
@@ -50,6 +50,8 @@
#define __builtin_ia32_vinsertf128_si256(X, Y, C) __builtin_ia32_vinsertf128_si256(X, Y, 1)
#define __builtin_ia32_roundpd256(V, M) __builtin_ia32_roundpd256(V, 1)
#define __builtin_ia32_roundps256(V, M) __builtin_ia32_roundps256(V, 1)
+#define __builtin_ia32_vcvtps2ph(A, I) __builtin_ia32_vcvtps2ph(A, 1)
+#define __builtin_ia32_vcvtps2ph256(A, I) __builtin_ia32_vcvtps2ph256(A, 1)
/* wmmintrin.h */
#define __builtin_ia32_aeskeygenassist128(X, C) __builtin_ia32_aeskeygenassist128(X, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c
index 96a3f210eb0..d256e68c4be 100644
--- a/gcc/testsuite/gcc.target/i386/sse-14.c
+++ b/gcc/testsuite/gcc.target/i386/sse-14.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -msse4a -maes -mpclmul -mpopcnt -mabm -mlwp" } */
+/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -msse4a -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */
#include <mm_malloc.h>
@@ -89,6 +89,9 @@ test_2 (_mm256_insert_epi64, __m256i, __m256i, long long, 1)
#endif
test_1 (_mm256_round_pd, __m256d, __m256d, 1)
test_1 (_mm256_round_ps, __m256, __m256, 1)
+test_1 (_cvtss_sh, unsigned short, float, 1)
+test_1 (_mm_cvtps_ph, __m128i, __m128, 1)
+test_1 (_mm256_cvtps_ph, __m128i, __m256, 1)
/* wmmintrin.h */
test_1 (_mm_aeskeygenassist_si128, __m128i, __m128i, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-15.c b/gcc/testsuite/gcc.target/i386/sse-15.c
index ed91ee65d38..5a1da7a755f 100644
--- a/gcc/testsuite/gcc.target/i386/sse-15.c
+++ b/gcc/testsuite/gcc.target/i386/sse-15.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse -msse2" } */
-/* { dg-require-effective-target sse2 } */
/* Test that the intrinsics compile with optimization. These were not
tested in i386-sse-[12].c because these builtins require immediate
diff --git a/gcc/testsuite/gcc.target/i386/sse-19.c b/gcc/testsuite/gcc.target/i386/sse-19.c
index 112c3e1cfad..43c090bd4e1 100644
--- a/gcc/testsuite/gcc.target/i386/sse-19.c
+++ b/gcc/testsuite/gcc.target/i386/sse-19.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O3 -msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "punpcklbw" } } */
extern void abort();
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-2.c b/gcc/testsuite/gcc.target/i386/sse-2.c
index cbaa5e6a30d..c2f3e0b17cd 100644
--- a/gcc/testsuite/gcc.target/i386/sse-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-2.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -msse" } */
+
#include <xmmintrin.h>
static const __m128 v_sign = {-.0f, -.0f, -.0f, -.0f};
static const __m128 v_half = {0.5f, 0.5f, 0.5f, 0.5f};
diff --git a/gcc/testsuite/gcc.target/i386/sse-20.c b/gcc/testsuite/gcc.target/i386/sse-20.c
index 5aa8f7a2812..fc0744f2554 100644
--- a/gcc/testsuite/gcc.target/i386/sse-20.c
+++ b/gcc/testsuite/gcc.target/i386/sse-20.c
@@ -1,5 +1,6 @@
/* PR target/13685 */
/* { dg-options "-Os -msse" } */
+/* { dg-require-effective-target sse } */
typedef float __m128 __attribute__ ((vector_size (16)));
typedef int __m64 __attribute__ ((vector_size (8)));
diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
index 6d976972d28..bb0472d471c 100644
--- a/gcc/testsuite/gcc.target/i386/sse-22.c
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -39,7 +39,7 @@
#ifndef DIFFERENT_PRAGMAS
-#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,aes,pclmul,xop,popcnt,abm,lwp")
+#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,aes,pclmul,xop,popcnt,abm,lwp,fsgsbase,rdrnd,f16c")
#endif
/* Following intrinsics require immediate arguments. They
@@ -179,3 +179,12 @@ test_2 ( __lwpins32, unsigned char, unsigned int, unsigned int, 1)
test_2 ( __lwpval64, void, unsigned long long, unsigned int, 1)
test_2 ( __lwpins64, unsigned char, unsigned long long, unsigned int, 1)
#endif
+
+/* immintrin.h (F16C). */
+#ifdef DIFFERENT_PRAGMAS
+#pragma GCC target ("f16c")
+#endif
+#include <x86intrin.h>
+test_1 (_cvtss_sh, unsigned short, float, 1)
+test_1 (_mm_cvtps_ph, __m128i, __m128, 1)
+test_1 (_mm256_cvtps_ph, __m128i, __m256, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c
index f74d3a71f6e..0e15bb25418 100644
--- a/gcc/testsuite/gcc.target/i386/sse-23.c
+++ b/gcc/testsuite/gcc.target/i386/sse-23.c
@@ -126,6 +126,8 @@
#define __builtin_ia32_vinsertf128_si256(X, Y, C) __builtin_ia32_vinsertf128_si256(X, Y, 1)
#define __builtin_ia32_roundpd256(V, M) __builtin_ia32_roundpd256(V, 1)
#define __builtin_ia32_roundps256(V, M) __builtin_ia32_roundps256(V, 1)
+#define __builtin_ia32_vcvtps2ph(A, I) __builtin_ia32_vcvtps2ph(A, 1)
+#define __builtin_ia32_vcvtps2ph256(A, I) __builtin_ia32_vcvtps2ph256(A, 1)
/* xopintrin.h */
#define __builtin_ia32_vprotbi(A, B) __builtin_ia32_vprotbi(A,1)
@@ -139,7 +141,7 @@
#define __builtin_ia32_lwpins32(D2, D1, F) __builtin_ia32_lwpins32 (D2, D1, 1)
#define __builtin_ia32_lwpins64(D2, D1, F) __builtin_ia32_lwpins64 (D2, D1, 1)
-#pragma GCC target ("3dnow,sse4,sse4a,aes,pclmul,xop,abm,popcnt,lwp")
+#pragma GCC target ("3dnow,sse4,sse4a,aes,pclmul,xop,abm,popcnt,lwp,fsgsbase,rdrnd,f16c")
#include <wmmintrin.h>
#include <smmintrin.h>
#include <mm3dnow.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-3.c b/gcc/testsuite/gcc.target/i386/sse-3.c
index 338b7c60ba7..1be1d1aa223 100644
--- a/gcc/testsuite/gcc.target/i386/sse-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse-3.c
@@ -1,6 +1,7 @@
/* PR target/21149 */
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-4.c b/gcc/testsuite/gcc.target/i386/sse-4.c
index 5d49884ab85..394ad9d7ec4 100644
--- a/gcc/testsuite/gcc.target/i386/sse-4.c
+++ b/gcc/testsuite/gcc.target/i386/sse-4.c
@@ -1,7 +1,6 @@
/* This testcase caused a buffer overflow in simplify_immed_subreg. */
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-7.c b/gcc/testsuite/gcc.target/i386/sse-7.c
index 12b88ca53f3..30e2c13ba04 100644
--- a/gcc/testsuite/gcc.target/i386/sse-7.c
+++ b/gcc/testsuite/gcc.target/i386/sse-7.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-9.c b/gcc/testsuite/gcc.target/i386/sse-9.c
index 0106cb52f63..e1a0a2270cb 100644
--- a/gcc/testsuite/gcc.target/i386/sse-9.c
+++ b/gcc/testsuite/gcc.target/i386/sse-9.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-addps-1.c b/gcc/testsuite/gcc.target/i386/sse-addps-1.c
index 2aa1cfa411a..b280667b5d0 100644
--- a/gcc/testsuite/gcc.target/i386/sse-addps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-addps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-addss-1.c b/gcc/testsuite/gcc.target/i386/sse-addss-1.c
index 911a6cd9192..43aa2d53efd 100644
--- a/gcc/testsuite/gcc.target/i386/sse-addss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-addss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-andnps-1.c b/gcc/testsuite/gcc.target/i386/sse-andnps-1.c
index 06d1e07dd40..eeeec020a7d 100644
--- a/gcc/testsuite/gcc.target/i386/sse-andnps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-andnps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-andps-1.c b/gcc/testsuite/gcc.target/i386/sse-andps-1.c
index aa46b8a28b7..6094dba7d34 100644
--- a/gcc/testsuite/gcc.target/i386/sse-andps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-andps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-check.h b/gcc/testsuite/gcc.target/i386/sse-check.h
index 85629cc71b9..11b71bc3e97 100644
--- a/gcc/testsuite/gcc.target/i386/sse-check.h
+++ b/gcc/testsuite/gcc.target/i386/sse-check.h
@@ -1,8 +1,7 @@
-#include <stdio.h>
#include <stdlib.h>
#include "m128-check.h"
-
#include "cpuid.h"
+#include "sse-os-support.h"
static void sse_test (void);
@@ -22,7 +21,7 @@ main ()
return 0;
/* Run SSE test only if host has SSE support. */
- if (edx & bit_SSE)
+ if ((edx & bit_SSE) && sse_os_support ())
do_test ();
return 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse-cmpss-1.c b/gcc/testsuite/gcc.target/i386/sse-cmpss-1.c
index e4be7318e06..45438bcd1b7 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cmpss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cmpss-1.c
@@ -1,5 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse -std=c99" } */
+/* { dg-require-effective-target sse } */
+/* { dg-require-effective-target c99_runtime } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-1.c b/gcc/testsuite/gcc.target/i386/sse-comiss-1.c
index 2892a70a67b..ff623aa8bed 100644
--- a/gcc/testsuite/gcc.target/i386/sse-comiss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-comiss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-2.c b/gcc/testsuite/gcc.target/i386/sse-comiss-2.c
index 63b6d6d113f..d674bed002b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-comiss-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-comiss-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-3.c b/gcc/testsuite/gcc.target/i386/sse-comiss-3.c
index 75ac4e4faaf..d2301ad8e51 100644
--- a/gcc/testsuite/gcc.target/i386/sse-comiss-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse-comiss-3.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-4.c b/gcc/testsuite/gcc.target/i386/sse-comiss-4.c
index ceeeca79472..7f372e249b9 100644
--- a/gcc/testsuite/gcc.target/i386/sse-comiss-4.c
+++ b/gcc/testsuite/gcc.target/i386/sse-comiss-4.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-5.c b/gcc/testsuite/gcc.target/i386/sse-comiss-5.c
index 8f503512ffa..104fdd701f7 100644
--- a/gcc/testsuite/gcc.target/i386/sse-comiss-5.c
+++ b/gcc/testsuite/gcc.target/i386/sse-comiss-5.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-6.c b/gcc/testsuite/gcc.target/i386/sse-comiss-6.c
index 38df9b8e47b..8229b7d55d7 100644
--- a/gcc/testsuite/gcc.target/i386/sse-comiss-6.c
+++ b/gcc/testsuite/gcc.target/i386/sse-comiss-6.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-copysignf-vec.c b/gcc/testsuite/gcc.target/i386/sse-copysignf-vec.c
index 9342e2c7187..bd85889503d 100644
--- a/gcc/testsuite/gcc.target/i386/sse-copysignf-vec.c
+++ b/gcc/testsuite/gcc.target/i386/sse-copysignf-vec.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c
index e5435b6b733..740227feef4 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c
index aa74e11ec55..6abc4d5afed 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target sse } */
/* { dg-options "-O2 -msse" } */
#ifndef CHECK_H
diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c
index 5740626659a..3f8c549c962 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c
index e136b7198a0..44a5fafc31b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target sse } */
/* { dg-options "-O2 -msse" } */
#ifndef CHECK_H
diff --git a/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c
index 8edc197eafd..667806d970f 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c
index 94e831e782f..eb85223450d 100644
--- a/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target sse } */
/* { dg-options "-O2 -msse" } */
#ifndef CHECK_H
diff --git a/gcc/testsuite/gcc.target/i386/sse-divps-1.c b/gcc/testsuite/gcc.target/i386/sse-divps-1.c
index d4d441aeb1f..321bb5ac7c6 100644
--- a/gcc/testsuite/gcc.target/i386/sse-divps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-divps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-divss-1.c b/gcc/testsuite/gcc.target/i386/sse-divss-1.c
index e7449496e0a..1427e4f1a44 100644
--- a/gcc/testsuite/gcc.target/i386/sse-divss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-divss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c b/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c
index 5c254772709..f2513154788 100644
--- a/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-init-v4hi-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c b/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c
index 4cb1f337e2a..eea03ecadea 100644
--- a/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-init-v4sf-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-maxps-1.c b/gcc/testsuite/gcc.target/i386/sse-maxps-1.c
index 5e6fcd654ef..9a82f665a4b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-maxps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-maxps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-maxss-1.c b/gcc/testsuite/gcc.target/i386/sse-maxss-1.c
index 5b5215a5772..7b88dfce710 100644
--- a/gcc/testsuite/gcc.target/i386/sse-maxss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-maxss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-minps-1.c b/gcc/testsuite/gcc.target/i386/sse-minps-1.c
index a41139f8b96..452df8318ab 100644
--- a/gcc/testsuite/gcc.target/i386/sse-minps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-minps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-minss-1.c b/gcc/testsuite/gcc.target/i386/sse-minss-1.c
index 9280b07052d..b7288f85915 100644
--- a/gcc/testsuite/gcc.target/i386/sse-minss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-minss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movaps-1.c b/gcc/testsuite/gcc.target/i386/sse-movaps-1.c
index 3677ac44288..ed3562ba53a 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movaps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movaps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movaps-2.c b/gcc/testsuite/gcc.target/i386/sse-movaps-2.c
index 46b971a9d9c..fcfa80bebbc 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movaps-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movaps-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c b/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c
index 7023bf95d1e..4d7b3edc2ac 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movhps-1.c b/gcc/testsuite/gcc.target/i386/sse-movhps-1.c
index 9f28927a881..44b88592701 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movhps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movhps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movhps-2.c b/gcc/testsuite/gcc.target/i386/sse-movhps-2.c
index 023937b6633..11ab383977c 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movhps-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movhps-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c b/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c
index aba9a9aa413..4ce3edf59e7 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c b/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c
index f1f0d7ed5a4..8557a30214b 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movntps-1.c b/gcc/testsuite/gcc.target/i386/sse-movntps-1.c
index 8c45da31dde..067f29616e1 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movntps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movntps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movss-1.c b/gcc/testsuite/gcc.target/i386/sse-movss-1.c
index eccdf5af907..ee53d5faf11 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movss-2.c b/gcc/testsuite/gcc.target/i386/sse-movss-2.c
index f64fa4db698..638666594c9 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movss-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movss-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movss-3.c b/gcc/testsuite/gcc.target/i386/sse-movss-3.c
index 1212622b7ea..a090aada7f5 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movss-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movss-3.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movups-1.c b/gcc/testsuite/gcc.target/i386/sse-movups-1.c
index 222da79d940..7ea9122897a 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movups-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movups-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-movups-2.c b/gcc/testsuite/gcc.target/i386/sse-movups-2.c
index 41657239c32..188967a2a37 100644
--- a/gcc/testsuite/gcc.target/i386/sse-movups-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-movups-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-mulps-1.c b/gcc/testsuite/gcc.target/i386/sse-mulps-1.c
index a07b5abf610..de66a28e142 100644
--- a/gcc/testsuite/gcc.target/i386/sse-mulps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-mulps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-mulss-1.c b/gcc/testsuite/gcc.target/i386/sse-mulss-1.c
index 7b45063508d..99161a811a1 100644
--- a/gcc/testsuite/gcc.target/i386/sse-mulss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-mulss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-orps-1.c b/gcc/testsuite/gcc.target/i386/sse-orps-1.c
index 6c8dac5cc5c..605603726c0 100644
--- a/gcc/testsuite/gcc.target/i386/sse-orps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-orps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-os-support.h b/gcc/testsuite/gcc.target/i386/sse-os-support.h
new file mode 100644
index 00000000000..a2b4e2d3c7e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-os-support.h
@@ -0,0 +1,55 @@
+#if defined(__sun__) && defined(__svr4__)
+/* Make sure sigaction() is declared even with -std=c99. */
+#define __EXTENSIONS__
+#include <signal.h>
+#include <ucontext.h>
+
+static volatile sig_atomic_t sigill_caught;
+
+static void
+sigill_hdlr (int sig __attribute((unused)),
+ siginfo_t *sip __attribute__((unused)),
+ ucontext_t *ucp)
+{
+ sigill_caught = 1;
+ /* Set PC to the instruction after the faulting one to skip over it,
+ otherwise we enter an infinite loop. */
+ ucp->uc_mcontext.gregs[EIP] += 4;
+ setcontext (ucp);
+}
+#endif
+
+/* Check if the OS supports executing SSE instructions. This function is
+ only used in sse-check.h, sse2-check.h, and sse3-check.h so far since
+ Solaris 8 and 9 won't run on newer CPUs anyway. */
+
+static int
+sse_os_support (void)
+{
+#if defined(__sun__) && defined(__svr4__)
+ /* Solaris 2 before Solaris 9 4/04 cannot execute SSE instructions
+ even if the CPU supports them. Programs receive SIGILL instead, so
+ check for that at runtime. */
+
+ struct sigaction act, oact;
+
+ act.sa_handler = sigill_hdlr;
+ sigemptyset (&act.sa_mask);
+ /* Need to set SA_SIGINFO so a ucontext_t * is passed to the handler. */
+ act.sa_flags = SA_SIGINFO;
+ sigaction (SIGILL, &act, &oact);
+
+ /* We need a single SSE instruction here so the handler can safely skip
+ over it. */
+ __asm__ volatile ("movss %xmm2,%xmm1");
+
+ sigaction (SIGILL, &oact, NULL);
+
+ if (sigill_caught)
+ exit (0);
+ else
+ return 1;
+#else
+ return 1;
+#endif /* __sun__ && __svr4__ */
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c b/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c
index 7a1a8fa7370..4d0783515e6 100644
--- a/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-recip-vec.c b/gcc/testsuite/gcc.target/i386/sse-recip-vec.c
index 202351dc987..bb1e458f92d 100644
--- a/gcc/testsuite/gcc.target/i386/sse-recip-vec.c
+++ b/gcc/testsuite/gcc.target/i386/sse-recip-vec.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-recip.c b/gcc/testsuite/gcc.target/i386/sse-recip.c
index d88eb7f007b..4f7d3bf3d54 100644
--- a/gcc/testsuite/gcc.target/i386/sse-recip.c
+++ b/gcc/testsuite/gcc.target/i386/sse-recip.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c b/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c
index 4052c21f010..c2db7254957 100644
--- a/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c b/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c
index 8232c7229c5..5a0c9b95d66 100644
--- a/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-set-ps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c b/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c
index 9f0658d0e27..1dbd260e515 100644
--- a/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-subps-1.c b/gcc/testsuite/gcc.target/i386/sse-subps-1.c
index 2e7e8d50231..e63e4784a11 100644
--- a/gcc/testsuite/gcc.target/i386/sse-subps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-subps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-subss-1.c b/gcc/testsuite/gcc.target/i386/sse-subss-1.c
index 5b3ef26bd9f..5d9a5f504f9 100644
--- a/gcc/testsuite/gcc.target/i386/sse-subss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-subss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c
index b38b1fd424a..4d72b01873e 100644
--- a/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c
index e0212a4e3df..dc4ba8045b3 100644
--- a/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c
index dc728fb503b..042898bf6d2 100644
--- a/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c
index 3251c0b8fb0..a3f32bb3576 100644
--- a/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c
+++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c
index ad34f01d979..821dd772640 100644
--- a/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c
+++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c
index b9b2f4b2892..602a923a0a5 100644
--- a/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c
+++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c b/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c
index be4ab3659cb..005924b5b6c 100644
--- a/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c b/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c
index 5a5da2064a1..456ef201bca 100644
--- a/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse-vect-types.c b/gcc/testsuite/gcc.target/i386/sse-vect-types.c
index 2658f020eff..9cb6f3e07cd 100644
--- a/gcc/testsuite/gcc.target/i386/sse-vect-types.c
+++ b/gcc/testsuite/gcc.target/i386/sse-vect-types.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O0 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <xmmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-xorps-1.c b/gcc/testsuite/gcc.target/i386/sse-xorps-1.c
index 6f96e691064..8ec500838ae 100644
--- a/gcc/testsuite/gcc.target/i386/sse-xorps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse-xorps-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
#ifndef CHECK_H
#define CHECK_H "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-check.h b/gcc/testsuite/gcc.target/i386/sse2-check.h
index e9f17f04079..fd4a6ce1dbf 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-check.h
+++ b/gcc/testsuite/gcc.target/i386/sse2-check.h
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include "cpuid.h"
#include "m128-check.h"
+#include "sse-os-support.h"
static void sse2_test (void);
@@ -20,7 +21,7 @@ main ()
return 0;
/* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
+ if ((edx & bit_SSE2) && sse_os_support ())
do_test ();
return 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse2-cmpsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-cmpsd-1.c
index 953f220d1b1..153fd2bf045 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-cmpsd-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-cmpsd-1.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse2 -std=c99" } */
/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target c99_runtime } */
#ifndef CHECK_H
#define CHECK_H "sse2-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c b/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c
index ed067082594..a2676396cd3 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse3-check.h b/gcc/testsuite/gcc.target/i386/sse3-check.h
index df0e63a4575..5a0a0b1a02e 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-check.h
+++ b/gcc/testsuite/gcc.target/i386/sse3-check.h
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
-
#include "cpuid.h"
+#include "sse-os-support.h"
static void sse3_test (void);
@@ -21,7 +21,7 @@ main ()
return 0;
/* Run SSE3 test only if host has SSE3 support. */
- if (ecx & bit_SSE3)
+ if ((ecx & bit_SSE3) && sse_os_support ())
do_test ();
return 0;
diff --git a/gcc/testsuite/gcc.target/i386/ssefn-2.c b/gcc/testsuite/gcc.target/i386/ssefn-2.c
index dfaacf6bdca..09b920ea7ca 100644
--- a/gcc/testsuite/gcc.target/i386/ssefn-2.c
+++ b/gcc/testsuite/gcc.target/i386/ssefn-2.c
@@ -3,7 +3,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "movss" } } */
/* { dg-final { scan-assembler "mulss" } } */
/* { dg-final { scan-assembler "movsd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ssefn-3.c b/gcc/testsuite/gcc.target/i386/ssefn-3.c
index adf72cce18a..b96b21179dc 100644
--- a/gcc/testsuite/gcc.target/i386/ssefn-3.c
+++ b/gcc/testsuite/gcc.target/i386/ssefn-3.c
@@ -3,6 +3,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse -mfpmath=sse" } */
+/* { dg-require-effective-target sse } */
#include "sse-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/ssefp-1.c b/gcc/testsuite/gcc.target/i386/ssefp-1.c
index fdce233173b..621e362f490 100644
--- a/gcc/testsuite/gcc.target/i386/ssefp-1.c
+++ b/gcc/testsuite/gcc.target/i386/ssefp-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8 -mfpmath=sse" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "maxsd" } } */
/* { dg-final { scan-assembler "minsd" } } */
double x;
diff --git a/gcc/testsuite/gcc.target/i386/ssefp-2.c b/gcc/testsuite/gcc.target/i386/ssefp-2.c
index 0b8b72262b5..a6caee398b2 100644
--- a/gcc/testsuite/gcc.target/i386/ssefp-2.c
+++ b/gcc/testsuite/gcc.target/i386/ssefp-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8 -mfpmath=sse" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "maxsd" } } */
/* { dg-final { scan-assembler "minsd" } } */
double x;
diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-3.c b/gcc/testsuite/gcc.target/i386/sseregparm-3.c
index 7475e4f827f..9ee82af44ae 100644
--- a/gcc/testsuite/gcc.target/i386/sseregparm-3.c
+++ b/gcc/testsuite/gcc.target/i386/sseregparm-3.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-msse2 -O2" } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* Make sure we know that mysinfp returns in %xmm0. */
diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-4.c b/gcc/testsuite/gcc.target/i386/sseregparm-4.c
index b8fc521264e..a29cf06bf5c 100644
--- a/gcc/testsuite/gcc.target/i386/sseregparm-4.c
+++ b/gcc/testsuite/gcc.target/i386/sseregparm-4.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-msse2 -O2" } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* Make sure we know that mysinfp returns in %xmm0. */
diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-5.c b/gcc/testsuite/gcc.target/i386/sseregparm-5.c
index fa41a2c87b9..7423722d694 100644
--- a/gcc/testsuite/gcc.target/i386/sseregparm-5.c
+++ b/gcc/testsuite/gcc.target/i386/sseregparm-5.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-msse2 -O2" } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* Make sure we know that mysinfp returns in %xmm0. */
diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-6.c b/gcc/testsuite/gcc.target/i386/sseregparm-6.c
index d0358c5e693..6203b6b5971 100644
--- a/gcc/testsuite/gcc.target/i386/sseregparm-6.c
+++ b/gcc/testsuite/gcc.target/i386/sseregparm-6.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-msse2 -O2" } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* Make sure we know that mysinfp returns in %xmm0. */
diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-7.c b/gcc/testsuite/gcc.target/i386/sseregparm-7.c
index 99953b5aa9c..61267df9853 100644
--- a/gcc/testsuite/gcc.target/i386/sseregparm-7.c
+++ b/gcc/testsuite/gcc.target/i386/sseregparm-7.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-msse2 -O2" } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* Make sure we know that mysinfp returns in %xmm0. */
diff --git a/gcc/testsuite/gcc.target/i386/ssetype-1.c b/gcc/testsuite/gcc.target/i386/ssetype-1.c
index 00ea2857484..ef89059b8d8 100644
--- a/gcc/testsuite/gcc.target/i386/ssetype-1.c
+++ b/gcc/testsuite/gcc.target/i386/ssetype-1.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* This test checks for absolute memory operands. */
/* { dg-require-effective-target nonpic } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -msse2 -march=k8" } */
/* { dg-final { scan-assembler "andpd\[^\\n\]*magic" } } */
/* { dg-final { scan-assembler "andnpd\[^\\n\]*magic" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ssetype-2.c b/gcc/testsuite/gcc.target/i386/ssetype-2.c
index c6a8ba7b548..b68a63923fb 100644
--- a/gcc/testsuite/gcc.target/i386/ssetype-2.c
+++ b/gcc/testsuite/gcc.target/i386/ssetype-2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "andpd" } } */
/* { dg-final { scan-assembler "andnpd" } } */
/* { dg-final { scan-assembler "xorpd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ssetype-3.c b/gcc/testsuite/gcc.target/i386/ssetype-3.c
index 0e83e28c468..d6887d5cd20 100644
--- a/gcc/testsuite/gcc.target/i386/ssetype-3.c
+++ b/gcc/testsuite/gcc.target/i386/ssetype-3.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* This test checks for absolute memory operands. */
/* { dg-require-effective-target nonpic } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -msse2 -march=k8" } */
/* { dg-final { scan-assembler "andps\[^\\n\]*magic" } } */
/* { dg-final { scan-assembler "andnps\[^\\n\]*magic" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ssetype-4.c b/gcc/testsuite/gcc.target/i386/ssetype-4.c
index 9b68792390d..9994b07f21c 100644
--- a/gcc/testsuite/gcc.target/i386/ssetype-4.c
+++ b/gcc/testsuite/gcc.target/i386/ssetype-4.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -march=k8" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "andps" } } */
/* { dg-final { scan-assembler "andnps" } } */
/* { dg-final { scan-assembler "xorps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ssetype-5.c b/gcc/testsuite/gcc.target/i386/ssetype-5.c
index 098ed89ad66..75133e9fa68 100644
--- a/gcc/testsuite/gcc.target/i386/ssetype-5.c
+++ b/gcc/testsuite/gcc.target/i386/ssetype-5.c
@@ -1,7 +1,6 @@
/* { dg-do compile } */
/* This test checks for absolute memory operands. */
/* { dg-require-effective-target nonpic } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -msse2 -march=k8" } */
/* { dg-final { scan-assembler "pand\[^\\n\]*magic" } } */
/* { dg-final { scan-assembler "pandn\[^\\n\]*magic" } } */
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-3.c b/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
index 87210d817a8..dd2c2e8b452 100644
--- a/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-skip-if "" { ! { ilp32 && dfp } } { "*" } { "" } } */
/* { dg-options "-msse -std=gnu99 -mpreferred-stack-boundary=2" } */
+/* { dg-require-effective-target sse } */
/* This compile only test is to detect an assertion failure in stack branch
development. */
diff --git a/gcc/testsuite/gcc.target/i386/unordcmp-1.c b/gcc/testsuite/gcc.target/i386/unordcmp-1.c
index 85de4865d2f..49d4b8e076a 100644
--- a/gcc/testsuite/gcc.target/i386/unordcmp-1.c
+++ b/gcc/testsuite/gcc.target/i386/unordcmp-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "cmpunordss" } } */
/* { dg-final { scan-assembler "cmpunordps" } } */
/* { dg-final { scan-assembler "cmpunordsd" } } */
diff --git a/gcc/testsuite/gcc.target/i386/vcvtph2ps-1.c b/gcc/testsuite/gcc.target/i386/vcvtph2ps-1.c
new file mode 100644
index 00000000000..3b46671f056
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vcvtph2ps-1.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-require-effective-target f16c } */
+/* { dg-options "-O2 -mf16c" } */
+
+#include "f16c-check.h"
+
+static void
+f16c_test (void)
+{
+ union128i_w val;
+ union128 res;
+ float exp[4];
+
+ exp[0] = 1;
+ exp[1] = -2;
+ exp[2] = -1;
+ exp[3] = 2;
+
+ val.a[0] = 0x3c00;
+ val.a[1] = 0xc000;
+ val.a[2] = 0xbc00;
+ val.a[3] = 0x4000;
+
+ res.x = _mm_cvtph_ps (val.x);
+
+ if (check_union128 (res, exp))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vcvtph2ps-2.c b/gcc/testsuite/gcc.target/i386/vcvtph2ps-2.c
new file mode 100644
index 00000000000..1523deaa1d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vcvtph2ps-2.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-require-effective-target f16c } */
+/* { dg-options "-O2 -mf16c" } */
+
+#include "f16c-check.h"
+
+static void
+f16c_test (void)
+{
+ union256 res;
+ union128i_w val;
+ float exp[8];
+
+ exp[0] = 1;
+ exp[1] = 2;
+ exp[2] = 4;
+ exp[3] = 8;
+ exp[4] = -1;
+ exp[5] = -2;
+ exp[6] = -4;
+ exp[7] = -8;
+
+ val.a[0] = 0x3c00;
+ val.a[1] = 0x4000;
+ val.a[2] = 0x4400;
+ val.a[3] = 0x4800;
+ val.a[4] = 0xbc00;
+ val.a[5] = 0xc000;
+ val.a[6] = 0xc400;
+ val.a[7] = 0xc800;
+
+ res.x = _mm256_cvtph_ps (val.x);
+
+ if (check_union256 (res, exp))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vcvtph2ps-3.c b/gcc/testsuite/gcc.target/i386/vcvtph2ps-3.c
new file mode 100644
index 00000000000..49b61f678c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vcvtph2ps-3.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-require-effective-target f16c } */
+/* { dg-options "-O2 -mf16c" } */
+
+#include "f16c-check.h"
+
+static void
+f16c_test (void)
+{
+ unsigned short val = 0xc000;
+ float exp = -2;
+ float res;
+
+ res = _cvtsh_ss (val);
+
+ if (res != exp)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vcvtps2ph-1.c b/gcc/testsuite/gcc.target/i386/vcvtps2ph-1.c
new file mode 100644
index 00000000000..c114c98ad8d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vcvtps2ph-1.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target f16c } */
+/* { dg-options "-O2 -mf16c" } */
+
+#include "f16c-check.h"
+
+static void
+f16c_test (void)
+{
+ union128 val;
+ union128i_w res;
+ short exp[8];
+
+ val.a[0] = 1;
+ val.a[1] = -2;
+ val.a[2] = -1;
+ val.a[3] = 2;
+
+ exp[0] = 0x3c00;
+ exp[1] = 0xc000;
+ exp[2] = 0xbc00;
+ exp[3] = 0x4000;
+ exp[4] = 0;
+ exp[5] = 0;
+ exp[6] = 0;
+ exp[7] = 0;
+
+ res.x = _mm_cvtps_ph (val.x, 0);
+
+ if (check_union128i_w (res, exp))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vcvtps2ph-2.c b/gcc/testsuite/gcc.target/i386/vcvtps2ph-2.c
new file mode 100644
index 00000000000..57436ae86bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vcvtps2ph-2.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-require-effective-target f16c } */
+/* { dg-options "-O2 -mf16c" } */
+
+#include "f16c-check.h"
+
+static void
+f16c_test (void)
+{
+ union256 val;
+ union128i_w res;
+ short exp[8];
+
+ val.a[0] = 1;
+ val.a[1] = 2;
+ val.a[2] = 4;
+ val.a[3] = 8;
+ val.a[4] = -1;
+ val.a[5] = -2;
+ val.a[6] = -4;
+ val.a[7] = -8;
+
+ exp[0] = 0x3c00;
+ exp[1] = 0x4000;
+ exp[2] = 0x4400;
+ exp[3] = 0x4800;
+ exp[4] = 0xbc00;
+ exp[5] = 0xc000;
+ exp[6] = 0xc400;
+ exp[7] = 0xc800;
+
+ res.x = _mm256_cvtps_ph (val.x, 0);
+
+ if (check_union128i_w (res, exp))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vcvtps2ph-3.c b/gcc/testsuite/gcc.target/i386/vcvtps2ph-3.c
new file mode 100644
index 00000000000..3b7cb5c5ca0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vcvtps2ph-3.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-require-effective-target f16c } */
+/* { dg-options "-O2 -mf16c" } */
+
+#include "f16c-check.h"
+
+static void
+f16c_test (void)
+{
+ float val = -2;
+ unsigned short exp = 0xc000;
+ unsigned short res;
+
+ res = _cvtss_sh (val, 0);
+
+ if (res != exp)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-1.c b/gcc/testsuite/gcc.target/i386/vecinit-1.c
index cba7429f242..fad0c07e100 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-1.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
#define vector __attribute__((vector_size(16)))
float a;
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-2.c b/gcc/testsuite/gcc.target/i386/vecinit-2.c
index fdfa837c698..a3a7abc5340 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-2.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
#define vector __attribute__((vector_size(16)))
int a;
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-3.c b/gcc/testsuite/gcc.target/i386/vecinit-3.c
index aae642ae27c..062fb1ed10a 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-3.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
#define vector __attribute__((vector_size(16)))
char a;
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-4.c b/gcc/testsuite/gcc.target/i386/vecinit-4.c
index 101b68badc4..2dfa29c4922 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-4.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
#define vector __attribute__((vector_size(16)))
short a;
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-5.c b/gcc/testsuite/gcc.target/i386/vecinit-5.c
index b9e7e27c78f..dcf8b9206aa 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-5.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-5.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
#define vector __attribute__((vector_size(16)))
float a, b;
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-6.c b/gcc/testsuite/gcc.target/i386/vecinit-6.c
index 3b22043273b..6817922d26b 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-6.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-6.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2" } */
-/* { dg-require-effective-target sse2 } */
+
#define vector __attribute__((vector_size(16)))
int a, b;
diff --git a/gcc/testsuite/gcc.target/i386/vectorize1.c b/gcc/testsuite/gcc.target/i386/vectorize1.c
index 7a5023aa905..f673e44c963 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize1.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize1.c
@@ -1,5 +1,6 @@
/* PR middle-end/28915 */
/* { dg-options "-msse -O2 -ftree-vectorize -fdump-tree-vect" } */
+/* { dg-require-effective-target sse } */
extern char lanip[3][40];
typedef struct
diff --git a/gcc/testsuite/gcc.target/i386/vectorize2.c b/gcc/testsuite/gcc.target/i386/vectorize2.c
index a7196c70d13..41964871959 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize2.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize2.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 -mfpmath=sse" } */
double a[256];
diff --git a/gcc/testsuite/gcc.target/i386/vectorize3.c b/gcc/testsuite/gcc.target/i386/vectorize3.c
index e19f8d87bda..2947acbafda 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize3.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize3.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 -mfpmath=sse" } */
float a[256];
diff --git a/gcc/testsuite/gcc.target/i386/vectorize4.c b/gcc/testsuite/gcc.target/i386/vectorize4.c
index 9933d299729..f3d605e228a 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize4.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize4.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 --param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
/* This test, tests two thing, we vectorize square root and also we don't crash due to a GC issue. */
diff --git a/gcc/testsuite/gcc.target/i386/vectorize6.c b/gcc/testsuite/gcc.target/i386/vectorize6.c
index 41e61aa2ccd..78ec53d15a8 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize6.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize6.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -ftree-vectorize -mveclibabi=svml -ffast-math" } */
-/* { dg-require-effective-target sse2 } */
double x[256];
diff --git a/gcc/testsuite/gcc.target/i386/vectorize7.c b/gcc/testsuite/gcc.target/i386/vectorize7.c
index eca043bdfa2..10b7ba27868 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize7.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize7.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize -msse2" } */
-/* { dg-require-effective-target sse2 } */
unsigned int a[256];
float b[256];
diff --git a/gcc/testsuite/gcc.target/i386/vectorize8.c b/gcc/testsuite/gcc.target/i386/vectorize8.c
index e26362035ad..ed1517b93ef 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize8.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize8.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize -msse2" } */
-/* { dg-require-effective-target sse2 } */
unsigned int a[256];
double b[256];
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v2df.c b/gcc/testsuite/gcc.target/i386/vperm-v2df.c
index d0394635c59..40a51306fdc 100644
--- a/gcc/testsuite/gcc.target/i386/vperm-v2df.c
+++ b/gcc/testsuite/gcc.target/i386/vperm-v2df.c
@@ -3,6 +3,7 @@
/* { dg-require-effective-target sse2 } */
#include "isa-check.h"
+#include "sse-os-support.h"
typedef double S;
typedef double V __attribute__((vector_size(16)));
@@ -25,6 +26,11 @@ extern int memcmp (const void *, const void *, __SIZE_TYPE__);
int main()
{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
i[0].s[0] = 0;
i[0].s[1] = 1;
i[0].s[2] = 2;
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v2di.c b/gcc/testsuite/gcc.target/i386/vperm-v2di.c
index 940de68af19..8e300837da8 100644
--- a/gcc/testsuite/gcc.target/i386/vperm-v2di.c
+++ b/gcc/testsuite/gcc.target/i386/vperm-v2di.c
@@ -3,6 +3,7 @@
/* { dg-require-effective-target sse2 } */
#include "isa-check.h"
+#include "sse-os-support.h"
typedef long long S;
typedef long long V __attribute__((vector_size(16)));
@@ -25,6 +26,11 @@ extern int memcmp (const void *, const void *, __SIZE_TYPE__);
int main()
{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
i[0].s[0] = 0;
i[0].s[1] = 1;
i[0].s[2] = 2;
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v4sf-1.c b/gcc/testsuite/gcc.target/i386/vperm-v4sf-1.c
index b9fc9b172fe..23608b3cf0a 100644
--- a/gcc/testsuite/gcc.target/i386/vperm-v4sf-1.c
+++ b/gcc/testsuite/gcc.target/i386/vperm-v4sf-1.c
@@ -1,7 +1,9 @@
/* { dg-do run } */
/* { dg-options "-O -msse" } */
+/* { dg-require-effective-target sse } */
#include "isa-check.h"
+#include "sse-os-support.h"
typedef float S;
typedef float V __attribute__((vector_size(16)));
@@ -26,6 +28,11 @@ extern int memcmp (const void *, const void *, __SIZE_TYPE__);
int main()
{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
i[0].s[0] = 0;
i[0].s[1] = 1;
i[0].s[2] = 2;
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v4sf-2.c b/gcc/testsuite/gcc.target/i386/vperm-v4sf-2.c
index 61b0d5a80dd..a0d49874f99 100644
--- a/gcc/testsuite/gcc.target/i386/vperm-v4sf-2.c
+++ b/gcc/testsuite/gcc.target/i386/vperm-v4sf-2.c
@@ -27,6 +27,8 @@ extern int memcmp (const void *, const void *, __SIZE_TYPE__);
int main()
{
+ check_isa ();
+
i[0].s[0] = 0;
i[0].s[1] = 1;
i[0].s[2] = 2;
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v4si-1.c b/gcc/testsuite/gcc.target/i386/vperm-v4si-1.c
index 93c25c6826a..01b7c6fdab6 100644
--- a/gcc/testsuite/gcc.target/i386/vperm-v4si-1.c
+++ b/gcc/testsuite/gcc.target/i386/vperm-v4si-1.c
@@ -3,6 +3,7 @@
/* { dg-require-effective-target sse2 } */
#include "isa-check.h"
+#include "sse-os-support.h"
typedef int S;
typedef int V __attribute__((vector_size(16)));
@@ -27,6 +28,11 @@ extern int memcmp (const void *, const void *, __SIZE_TYPE__);
int main()
{
+ check_isa ();
+
+ if (!sse_os_support ())
+ exit (0);
+
i[0].s[0] = 0;
i[0].s[1] = 1;
i[0].s[2] = 2;
diff --git a/gcc/testsuite/gcc.target/i386/vperm-v4si-2.c b/gcc/testsuite/gcc.target/i386/vperm-v4si-2.c
index d77146896e4..43f88ee0935 100644
--- a/gcc/testsuite/gcc.target/i386/vperm-v4si-2.c
+++ b/gcc/testsuite/gcc.target/i386/vperm-v4si-2.c
@@ -27,6 +27,8 @@ extern int memcmp (const void *, const void *, __SIZE_TYPE__);
int main()
{
+ check_isa ();
+
i[0].s[0] = 0;
i[0].s[1] = 1;
i[0].s[2] = 2;
diff --git a/gcc/testsuite/gcc.target/i386/wrfsbase-1.c b/gcc/testsuite/gcc.target/i386/wrfsbase-1.c
new file mode 100644
index 00000000000..4b849269bb2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/wrfsbase-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "wrfsbase\[ \t]+(%|)edi" } } */
+
+#include <immintrin.h>
+
+void
+write_fs_base32 (unsigned int base)
+{
+ _writefsbase_u32 (base);
+}
diff --git a/gcc/testsuite/gcc.target/i386/wrfsbase-2.c b/gcc/testsuite/gcc.target/i386/wrfsbase-2.c
new file mode 100644
index 00000000000..5e1762dfa3d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/wrfsbase-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "wrfsbase\[ \t]+(%|)rdi" } } */
+
+#include <immintrin.h>
+
+void
+write_fs_base64 (unsigned long long base)
+{
+ _writefsbase_u64 (base);
+}
diff --git a/gcc/testsuite/gcc.target/i386/wrgsbase-1.c b/gcc/testsuite/gcc.target/i386/wrgsbase-1.c
new file mode 100644
index 00000000000..15d2d7ffb9c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/wrgsbase-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "wrgsbase\[ \t]+(%|)edi" } } */
+
+#include <immintrin.h>
+
+void
+write_gs_base32 (unsigned int base)
+{
+ _writegsbase_u32 (base);
+}
diff --git a/gcc/testsuite/gcc.target/i386/wrgsbase-2.c b/gcc/testsuite/gcc.target/i386/wrgsbase-2.c
new file mode 100644
index 00000000000..0a33d770710
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/wrgsbase-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -mfsgsbase" } */
+/* { dg-final { scan-assembler "wrgsbase\[ \t]+(%|)rdi" } } */
+
+#include <immintrin.h>
+
+void
+write_gs_base64 (unsigned long long base)
+{
+ _writegsbase_u64 (base);
+}
diff --git a/gcc/testsuite/gcc.target/i386/xorps-sse2.c b/gcc/testsuite/gcc.target/i386/xorps-sse2.c
index 4d3994c88ef..3c268b4cbaa 100644
--- a/gcc/testsuite/gcc.target/i386/xorps-sse2.c
+++ b/gcc/testsuite/gcc.target/i386/xorps-sse2.c
@@ -1,7 +1,6 @@
/* Test that we generate xorps when the result is used in FP math. */
/* { dg-do compile } */
/* { dg-options "-O -msse2 -mno-sse3" } */
-/* { dg-require-effective-target sse2 } */
/* { dg-final { scan-assembler "xorps\[ \t\]" { xfail *-*-* } } } */
/* { dg-final { scan-assembler-not "pxor" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/i386/xorps.c b/gcc/testsuite/gcc.target/i386/xorps.c
index bc2e97d76d6..6803a4d8916 100644
--- a/gcc/testsuite/gcc.target/i386/xorps.c
+++ b/gcc/testsuite/gcc.target/i386/xorps.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-Os -msse2" } */
-/* { dg-require-effective-target sse2 } */
typedef float __m128 __attribute__ ((vector_size (16)));
diff --git a/gcc/testsuite/gcc.target/m68k/pr45015.c b/gcc/testsuite/gcc.target/m68k/pr45015.c
new file mode 100644
index 00000000000..fba9550e9ef
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/pr45015.c
@@ -0,0 +1,26 @@
+/* PR debug/45015 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+unsigned int
+foo (unsigned int *x, const unsigned int *y, int z, unsigned int w)
+{
+ unsigned int a, b, c, s;
+ int j;
+ j = -z;
+ x -= j;
+ y -= j;
+ a = 0;
+ do
+ {
+ __asm__ ("move.l %2, %0; move.l %3, %1" : "=d" (b), "=d" (c) : "g<>" (y[j]), "d" (w));
+ c += a;
+ a = (c < a) + b;
+ s = x[j];
+ c = s + c;
+ a += (c < s);
+ x[j] = c;
+ }
+ while (++j != 0);
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/mips/cache-1.c b/gcc/testsuite/gcc.target/mips/cache-1.c
index 05cb4079157..da897066d49 100644
--- a/gcc/testsuite/gcc.target/mips/cache-1.c
+++ b/gcc/testsuite/gcc.target/mips/cache-1.c
@@ -26,5 +26,5 @@ f4 (const volatile unsigned char *area)
/* { dg-final { scan-assembler "\tcache\t0x14,0\\(\\\$4\\)" } } */
/* { dg-final { scan-assembler "\tcache\t0x18,20\\(\\\$4\\)" } } */
-/* { dg-final { scan-assembler "\tcache\t0x0,0\\(\\\$.\\)" } } */
+/* { dg-final { scan-assembler "\tcache\t(0x|)0,0\\(\\\$.\\)" } } */
/* { dg-final { scan-assembler "\tcache\t0x4,-80\\(\\\$4\\)" } } */
diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
index 02e031cd15c..0a7bc1de8dd 100644
--- a/gcc/testsuite/gcc.target/mips/mips.exp
+++ b/gcc/testsuite/gcc.target/mips/mips.exp
@@ -233,7 +233,7 @@ set mips_option_groups {
fp "-mfp(32|64)"
gp "-mgp(32|64)"
long "-mlong(32|64)"
- mips16 "-mips16|-mno-mips16"
+ mips16 "-mips16|-mno-mips16|-mflip-mips16"
mips3d "-mips3d|-mno-mips3d"
optimization "-O(|[0-3s])"
pic "-f(no-|)(pic|PIC)"
@@ -509,6 +509,14 @@ proc mips_have_option_p { upstatus option } {
$option]
}
+# Return true if the options described by UPSTATUS require MIPS16 support.
+proc mips_using_mips16_p { upstatus } {
+ upvar $upstatus status
+
+ return [expr { [mips_have_option_p status "-mips16"]
+ || [mips_have_option_p status "-mflip-mips16"] }]
+}
+
# Return true if the test described by UPSTATUS requires option OPTION.
proc mips_have_test_option_p { upstatus option } {
upvar $upstatus status
@@ -763,7 +771,7 @@ proc mips-dg-finish {} {
#
# START END
# | |
-# -mips16 -mno-mips16
+# -mips16/-mflip-mips16 -mno-mips16
# | |
# -mips3d -mno-mips3d
# | |
@@ -1011,7 +1019,7 @@ proc mips-dg-options { args } {
# EABI doesn't support -mabicalls.
# EABI doesn't support the combination -mgp32 -mfp64.
set force_abi 1
- } elseif { [mips_have_option_p options "-mips16"]
+ } elseif { [mips_using_mips16_p options]
&& ![mips_same_option_p $abi "-mabi=32"]
&& ![mips_same_option_p $abi "-mabi=o64"]
&& (![mips_have_option_p options "addressing=absolute"]
@@ -1048,7 +1056,7 @@ proc mips-dg-options { args } {
mips_make_test_option options "-mfp32"
}
}
- if { [mips_have_option_p options "-mips16"]
+ if { [mips_using_mips16_p options]
&& ![mips_same_option_p $abi "-mabi=32"]
&& ![mips_same_option_p $abi "-mabi=o64"]
&& (![mips_have_option_p options "addressing=absolute"]
diff --git a/gcc/testsuite/gcc.target/mips/mips16-attributes-4.c b/gcc/testsuite/gcc.target/mips/mips16-attributes-4.c
new file mode 100644
index 00000000000..de7cb4349b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/mips16-attributes-4.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "(-mips16)" } */
+
+extern void abort (void);
+
+__complex float f = { -1.0 + -1.0i };
+__complex float __attribute__((nomips16)) foo (void) { return f; }
+__complex float (*volatile foop) (void) = foo;
+__complex float __attribute__((mips16, noinline)) bar (void) { return foop (); }
+
+int
+main (void)
+{
+ if (bar () != f)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c b/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c
index 594ec88b4e7..a2aa111459e 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c
@@ -8,6 +8,6 @@
vector float *f (volatile vector float *a)
{
- return a; /* { dg-warning "discards qualifiers" } */
+ return a; /* { dg-warning "discards 'volatile' qualifier" } */
}
diff --git a/gcc/testsuite/gcc.target/powerpc/block-move-1.c b/gcc/testsuite/gcc.target/powerpc/block-move-1.c
new file mode 100644
index 00000000000..7b6623fbe51
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/block-move-1.c
@@ -0,0 +1,14 @@
+/* Test that we bump up low values of -mblock-move-inline-limit */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mblock-move-inline-limit=8" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *memcpy (void *, const void *, size_t);
+
+void
+cpy16 (void *x, void *y)
+{
+ memcpy (x, y, 16);
+}
+
+/* { dg-final { scan-assembler-not "memcpy" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/block-move-2.c b/gcc/testsuite/gcc.target/powerpc/block-move-2.c
new file mode 100644
index 00000000000..ffaf9ef05e8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/block-move-2.c
@@ -0,0 +1,14 @@
+/* Test that we honor -mblock-move-inline-limit. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mblock-move-inline-limit=128" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *memcpy (void *, const void *, size_t);
+
+void
+cpy128 (void *x, void *y)
+{
+ memcpy (x, y, 128);
+}
+
+/* { dg-final { scan-assembler-not "memcpy" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
index 3d9afb25aa7..8efaeaba38a 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
@@ -1,5 +1,5 @@
/* { dg-do link { target { *-*-linux* && powerpc_fprs } } } */
-/* { dg-options "-W -Wall -Wno-uninitialized -mcpu=cell" } */
+/* { dg-options "-W -Wall -Wno-uninitialized -Wno-unused-but-set-variable -mcpu=cell" } */
/* Test some PPU intrinsics from <ppu_intrinsics.h>. */
#include <ppu_intrinsics.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-1.c b/gcc/testsuite/gcc.target/powerpc/recip-1.c
index d1e383dc4ea..590881bb892 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */
/* { dg-options "-O2 -mrecip -ffast-math -mcpu=power6" } */
/* { dg-final { scan-assembler-times "frsqrte" 2 } } */
/* { dg-final { scan-assembler-times "fmsub" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-2.c b/gcc/testsuite/gcc.target/powerpc/recip-2.c
index 69442733aab..3e64c07578f 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-2.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */
/* { dg-options "-O2 -mrecip -ffast-math -mcpu=power5" } */
/* { dg-final { scan-assembler-times "frsqrtes" 1 } } */
/* { dg-final { scan-assembler-times "fmsubs" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-3.c b/gcc/testsuite/gcc.target/powerpc/recip-3.c
index 80a34e8ee59..c5ce539bb42 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */
/* { dg-options "-O2 -mrecip -ffast-math -mcpu=power7" } */
/* { dg-final { scan-assembler-times "xsrsqrtedp" 1 } } */
/* { dg-final { scan-assembler-times "xsmsub.dp" 1 } } */
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s b/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s
index 5a7c91be6ee..b3b88466a62 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s
+++ b/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s
@@ -22,20 +22,20 @@ _snapshot:
movq %r15, _r15(%rip)
movdqu %xmm0, _xmm_regs+0(%rip)
movdqu %xmm1, _xmm_regs+16(%rip)
- movdqu %xmm2, _xmm_regs+16*2(%rip)
- movdqu %xmm3, _xmm_regs+16*3(%rip)
- movdqu %xmm4, _xmm_regs+16*4(%rip)
- movdqu %xmm5, _xmm_regs+16*5(%rip)
- movdqu %xmm6, _xmm_regs+16*6(%rip)
- movdqu %xmm7, _xmm_regs+16*7(%rip)
- movdqu %xmm8, _xmm_regs+16*8(%rip)
- movdqu %xmm9, _xmm_regs+16*9(%rip)
- movdqu %xmm10, _xmm_regs+16*10(%rip)
- movdqu %xmm11, _xmm_regs+16*11(%rip)
- movdqu %xmm12, _xmm_regs+16*12(%rip)
- movdqu %xmm13, _xmm_regs+16*13(%rip)
- movdqu %xmm14, _xmm_regs+16*14(%rip)
- movdqu %xmm15, _xmm_regs+16*15(%rip)
+ movdqu %xmm2, _xmm_regs+32(%rip)
+ movdqu %xmm3, _xmm_regs+48(%rip)
+ movdqu %xmm4, _xmm_regs+64(%rip)
+ movdqu %xmm5, _xmm_regs+80(%rip)
+ movdqu %xmm6, _xmm_regs+96(%rip)
+ movdqu %xmm7, _xmm_regs+112(%rip)
+ movdqu %xmm8, _xmm_regs+128(%rip)
+ movdqu %xmm9, _xmm_regs+144(%rip)
+ movdqu %xmm10, _xmm_regs+160(%rip)
+ movdqu %xmm11, _xmm_regs+176(%rip)
+ movdqu %xmm12, _xmm_regs+192(%rip)
+ movdqu %xmm13, _xmm_regs+208(%rip)
+ movdqu %xmm14, _xmm_regs+224(%rip)
+ movdqu %xmm15, _xmm_regs+240(%rip)
jmp *_callthis(%rip)
.LFE3:
.p2align 4,,15
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S
index cb1e31ea785..8e0bffe8b49 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S
+++ b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S
@@ -26,20 +26,20 @@ snapshot:
movq %r15, r15(%rip)
movdqu %xmm0, xmm_regs+0(%rip)
movdqu %xmm1, xmm_regs+16(%rip)
- movdqu %xmm2, xmm_regs+16*2(%rip)
- movdqu %xmm3, xmm_regs+16*3(%rip)
- movdqu %xmm4, xmm_regs+16*4(%rip)
- movdqu %xmm5, xmm_regs+16*5(%rip)
- movdqu %xmm6, xmm_regs+16*6(%rip)
- movdqu %xmm7, xmm_regs+16*7(%rip)
- movdqu %xmm8, xmm_regs+16*8(%rip)
- movdqu %xmm9, xmm_regs+16*9(%rip)
- movdqu %xmm10, xmm_regs+16*10(%rip)
- movdqu %xmm11, xmm_regs+16*11(%rip)
- movdqu %xmm12, xmm_regs+16*12(%rip)
- movdqu %xmm13, xmm_regs+16*13(%rip)
- movdqu %xmm14, xmm_regs+16*14(%rip)
- movdqu %xmm15, xmm_regs+16*15(%rip)
+ movdqu %xmm2, xmm_regs+32(%rip)
+ movdqu %xmm3, xmm_regs+48(%rip)
+ movdqu %xmm4, xmm_regs+64(%rip)
+ movdqu %xmm5, xmm_regs+80(%rip)
+ movdqu %xmm6, xmm_regs+96(%rip)
+ movdqu %xmm7, xmm_regs+112(%rip)
+ movdqu %xmm8, xmm_regs+128(%rip)
+ movdqu %xmm9, xmm_regs+144(%rip)
+ movdqu %xmm10, xmm_regs+160(%rip)
+ movdqu %xmm11, xmm_regs+176(%rip)
+ movdqu %xmm12, xmm_regs+192(%rip)
+ movdqu %xmm13, xmm_regs+208(%rip)
+ movdqu %xmm14, xmm_regs+224(%rip)
+ movdqu %xmm15, xmm_regs+240(%rip)
jmp *callthis(%rip)
.LFE3:
.size snapshot, .-snapshot
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S
index a4d002e19e4..d248ef02e84 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S
@@ -23,20 +23,20 @@ snapshot:
movq %r15, r15(%rip)
vmovdqu %ymm0, ymm_regs+0(%rip)
vmovdqu %ymm1, ymm_regs+32(%rip)
- vmovdqu %ymm2, ymm_regs+32*2(%rip)
- vmovdqu %ymm3, ymm_regs+32*3(%rip)
- vmovdqu %ymm4, ymm_regs+32*4(%rip)
- vmovdqu %ymm5, ymm_regs+32*5(%rip)
- vmovdqu %ymm6, ymm_regs+32*6(%rip)
- vmovdqu %ymm7, ymm_regs+32*7(%rip)
- vmovdqu %ymm8, ymm_regs+32*8(%rip)
- vmovdqu %ymm9, ymm_regs+32*9(%rip)
- vmovdqu %ymm10, ymm_regs+32*10(%rip)
- vmovdqu %ymm11, ymm_regs+32*11(%rip)
- vmovdqu %ymm12, ymm_regs+32*12(%rip)
- vmovdqu %ymm13, ymm_regs+32*13(%rip)
- vmovdqu %ymm14, ymm_regs+32*14(%rip)
- vmovdqu %ymm15, ymm_regs+32*15(%rip)
+ vmovdqu %ymm2, ymm_regs+64(%rip)
+ vmovdqu %ymm3, ymm_regs+96(%rip)
+ vmovdqu %ymm4, ymm_regs+128(%rip)
+ vmovdqu %ymm5, ymm_regs+160(%rip)
+ vmovdqu %ymm6, ymm_regs+192(%rip)
+ vmovdqu %ymm7, ymm_regs+224(%rip)
+ vmovdqu %ymm8, ymm_regs+256(%rip)
+ vmovdqu %ymm9, ymm_regs+288(%rip)
+ vmovdqu %ymm10, ymm_regs+320(%rip)
+ vmovdqu %ymm11, ymm_regs+352(%rip)
+ vmovdqu %ymm12, ymm_regs+384(%rip)
+ vmovdqu %ymm13, ymm_regs+416(%rip)
+ vmovdqu %ymm14, ymm_regs+448(%rip)
+ vmovdqu %ymm15, ymm_regs+480(%rip)
jmp *callthis(%rip)
.LFE3:
.size snapshot, .-snapshot
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h b/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
index 7f1f8f9fc5c..e66a27e9afd 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
@@ -12,7 +12,7 @@ main ()
return 0;
/* Run AVX test only if host has AVX support. */
- if (ecx & bit_AVX)
+ if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
{
avx_test ();
#ifdef DEBUG
diff --git a/gcc/testsuite/gfortran.dg/aliasing_dummy_5.f90 b/gcc/testsuite/gfortran.dg/aliasing_dummy_5.f90
new file mode 100644
index 00000000000..379fbd7f8f9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/aliasing_dummy_5.f90
@@ -0,0 +1,55 @@
+! { dg-do run }
+!
+! PR fortran/45019
+!
+! Check that the compiler knows that
+! "arg" and "arr" can alias.
+!
+MODULE m
+ IMPLICIT NONE
+ INTEGER, TARGET :: arr(3)
+CONTAINS
+ SUBROUTINE foobar (arg)
+ INTEGER, TARGET :: arg(:)
+ arr(2:3) = arg(1:2)
+ END SUBROUTINE foobar
+END MODULE m
+
+PROGRAM main
+ USE m
+ IMPLICIT NONE
+ arr = (/ 1, 2, 3 /)
+ CALL bar(arr)
+ if (any (arr /= (/ 1, 1, 2 /))) call abort()
+ CALL test()
+contains
+ subroutine bar(x)
+ INTEGER, TARGET :: x(:)
+ CALL foobar (x)
+ end subroutine bar
+END PROGRAM main
+
+MODULE m2
+ IMPLICIT NONE
+ INTEGER, TARGET :: arr(3)
+CONTAINS
+ SUBROUTINE foobar (arg)
+ INTEGER, TARGET :: arg(:)
+ arr(1) = 5
+ arg(1) = 6
+ if (arr(1) == 5) call abort()
+ END SUBROUTINE foobar
+END MODULE m2
+subroutine test
+ USE m2
+ IMPLICIT NONE
+ arr = (/ 1, 2, 3 /)
+ CALL bar(arr)
+contains
+ subroutine bar(x)
+ INTEGER, TARGET :: x(:)
+ CALL foobar (x)
+ end subroutine bar
+END subroutine test
+
+! { dg-final { cleanup-modules "m m2" } }
diff --git a/gcc/testsuite/gfortran.dg/array_memcpy_3.f90 b/gcc/testsuite/gfortran.dg/array_memcpy_3.f90
index df6bd49ef26..78097308030 100644
--- a/gcc/testsuite/gfortran.dg/array_memcpy_3.f90
+++ b/gcc/testsuite/gfortran.dg/array_memcpy_3.f90
@@ -11,5 +11,5 @@ subroutine bar(x)
x = (/ 3, 1, 4, 1 /)
end subroutine
-! { dg-final { scan-tree-dump-times "memcpy|ref-all" 2 "original" } }
+! { dg-final { scan-tree-dump-times "memcpy|(ref-all.*ref-all)" 2 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/array_memcpy_4.f90 b/gcc/testsuite/gfortran.dg/array_memcpy_4.f90
index 0f8b5cb15b0..9f2279d881c 100644
--- a/gcc/testsuite/gfortran.dg/array_memcpy_4.f90
+++ b/gcc/testsuite/gfortran.dg/array_memcpy_4.f90
@@ -9,5 +9,5 @@
d = s
end
-! { dg-final { scan-tree-dump-times "d = " 1 "original" } }
+! { dg-final { scan-tree-dump-times "MEM.*d\\\] = MEM" 1 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90 b/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90
new file mode 100644
index 00000000000..63f8816379e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_15.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR 44925: [OOP] C_LOC with CLASS pointer
+!
+! Contributed by Barron Bichon <barron.bichon@swri.org>
+
+ use iso_c_binding
+
+ type :: t
+ end type t
+
+ type(c_ptr) :: tt_cptr
+ class(t), pointer :: tt_fptr
+ if (associated(tt_fptr)) tt_cptr = c_loc(tt_fptr) ! { dg-error "must not be polymorphic" }
+
+end
diff --git a/gcc/testsuite/gfortran.dg/c_sizeof_1.f90 b/gcc/testsuite/gfortran.dg/c_sizeof_1.f90
index f2a5caf6864..b30bdc5285e 100644
--- a/gcc/testsuite/gfortran.dg/c_sizeof_1.f90
+++ b/gcc/testsuite/gfortran.dg/c_sizeof_1.f90
@@ -1,8 +1,12 @@
! { dg-do run }
! Support F2008's c_sizeof()
!
-integer(4) :: i, j(10)
-character(4),parameter :: str(1) = "abcd"
+use iso_c_binding, only: c_int, c_char, c_ptr, c_intptr_t, c_null_ptr
+
+integer(kind=c_int) :: i, j(10)
+character(kind=c_char,len=4),parameter :: str(1) = "abcd"
+type(c_ptr) :: cptr
+integer(c_intptr_t) :: iptr
! Using F2008's C_SIZEOF
i = c_sizeof(i)
@@ -18,9 +22,10 @@ i = c_sizeof(str(1))
if (i /= 4) call abort()
i = c_sizeof(str(1)(1:3))
-print *, i
if (i /= 3) call abort()
+write(*,*) c_sizeof(cptr), c_sizeof(iptr), c_sizeof(C_NULL_PTR)
+
! Using GNU's SIZEOF
i = sizeof(i)
if (i /= 4) call abort()
@@ -36,5 +41,6 @@ if (i /= 4) call abort()
i = sizeof(str(1)(1:3))
if (i /= 3) call abort()
+
end
diff --git a/gcc/testsuite/gfortran.dg/char4_iunit_1.f03 b/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
new file mode 100644
index 00000000000..98e5cdd070c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
@@ -0,0 +1,32 @@
+! { dg-do run }
+! PR37077 Implement Internal Unit I/O for character KIND=4
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program char4_iunit_1
+ implicit none
+ character(kind=4,len=42) :: string
+ integer(kind=4) :: i,j
+ real(kind=4) :: inf, nan, large
+
+ large = huge(large)
+ inf = 2 * large
+ nan = 0
+ nan = nan / nan
+
+ string = 4_"123456789x"
+ write(string,'(a11)') 4_"abcdefg"
+ if (string .ne. 4_" abcdefg ") call abort
+ write(string,*) 12345
+ if (string .ne. 4_" 12345 ") call abort
+ write(string, '(i6,5x,i8,a5)') 78932, 123456, "abc"
+ if (string .ne. 4_" 78932 123456 abc ") call abort
+ write(string, *) .true., .false. , .true.
+ if (string .ne. 4_" T F T ") call abort
+ write(string, *) 1.2345e-06, 4.2846e+10_8
+ if (string .ne. 4_" 1.23450002E-06 42846000000.000000 ") call abort
+ write(string, *) nan, inf
+ if (string .ne. 4_" NaN +Infinity ") call abort
+ write(string, '(10x,f3.1,3x,f9.1)') nan, inf
+ if (string .ne. 4_" NaN +Infinity ") call abort
+ write(string, *) (1.2, 3.4 )
+ if (string .ne. 4_" ( 1.2000000 , 3.4000001 ) ") call abort
+end program char4_iunit_1
diff --git a/gcc/testsuite/gfortran.dg/char4_iunit_2.f03 b/gcc/testsuite/gfortran.dg/char4_iunit_2.f03
new file mode 100644
index 00000000000..074321274ca
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char4_iunit_2.f03
@@ -0,0 +1,47 @@
+! { dg-do run }
+! PR37077 Implement Internal Unit I/O for character KIND=4
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program char4_iunit_2
+ implicit none
+ integer, parameter :: k = 4
+ character(kind=4,len=80) :: widestring, str_char4
+ character(kind=1,len=80) :: skinnystring
+ integer :: i,j
+ real :: x
+ character(9) :: str_default
+
+ widestring = k_"12345 2.54360 hijklmnop qwertyuiopasdfg"
+ skinnystring = "12345 2.54360 hijklmnop qwertyuiopasdfg"
+ i = 77777
+ x = 0.0
+ str_default = "xxxxxxxxx"
+ str_char4 = k_"xyzzy"
+ read(widestring,'(i5,1x,f7.5,1x,a9,1x,a15)') i, x, str_default, str_char4
+ if (i /= 12345 .or. (x - 2.5436001) > epsilon(x) .or. &
+ str_default /= "hijklmnop" .or. str_char4 /= k_"qwertyuiopasdfg")&
+ call abort
+ i = 77777
+ x = 0.0
+ str_default = "xxxxxxxxx"
+ str_char4 = k_"xyzzy"
+ read(widestring,'(2x,i4,tl3,1x,f7.5,1x,a9,1x,a15)')i, x, str_default,&
+ str_char4
+ if (i /= 345 .or. (x - 52.542999) > epsilon(x) .or. &
+ str_default /= "0 hijklmn" .or. str_char4 /= k_"p qwertyuiopasd")&
+ call abort
+ read(skinnystring,'(2x,i4,tl3,1x,f7.5,1x,a9,1x,a15)')i, x, str_default,&
+ str_char4
+ if (i /= 345 .or. (x - 52.542999) > epsilon(x) .or. &
+ str_default /= "0 hijklmn" .or. str_char4 /= k_"p qwertyuiopasd")&
+ call abort
+ write(widestring,'(2x,i4,tl3,1x,f10.5,1x,a9,1x,a15)')i, x, str_default,&
+ trim(str_char4)
+ if (widestring .ne. k_" 3 52.54300 0 hijklmn p qwertyuiopasd") call abort
+ write(skinnystring,'(2x,i4,tl3,1x,f10.5,1x,a9,1x,a15)')i, x, str_default,&
+ trim(str_char4)
+ if (skinnystring .ne. " 3 52.54300 0 hijklmn p qwertyuiopasd") call abort
+ write(widestring,*)"test",i, x, str_default,&
+ trim(str_char4)
+ if (widestring .ne. &
+ k_" test 345 52.542999 0 hijklmnp qwertyuiopasd") call abort
+end program char4_iunit_2
diff --git a/gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90 b/gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90
index bd5552c0ea6..15d70215020 100644
--- a/gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90
+++ b/gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90
@@ -10,4 +10,4 @@ program bound_check
zz(i:j) = 'abcdef'
print * , zz
end
-! { dg-output "Substring out of bounds: upper bound exceeds string length.*at line 9)}
+! { dg-output "At line 10.*Substring out of bounds: upper bound \\(11\\) of 'zz' exceeds string length" }
diff --git a/gcc/testsuite/gfortran.dg/class_24.f03 b/gcc/testsuite/gfortran.dg/class_24.f03
new file mode 100644
index 00000000000..085e6d1e1ce
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_24.f03
@@ -0,0 +1,22 @@
+! { dg-do compile }
+!
+! PR 44869: [OOP] Missing TARGET check - and wrong code or accepts-invalid?
+!
+! Contributed by Satish.BD <bdsatish@gmail.com>
+
+ type :: test_case
+ end type
+
+ type :: test_suite
+ type(test_case) :: list
+ end type
+
+contains
+
+ subroutine sub(self)
+ class(test_suite), intent(inout) :: self
+ type(test_case), pointer :: tst_case
+ tst_case => self%list ! { dg-error "is neither TARGET nor POINTER" }
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/class_defined_operator_1.f03 b/gcc/testsuite/gfortran.dg/class_defined_operator_1.f03
new file mode 100644
index 00000000000..008739e3f98
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_defined_operator_1.f03
@@ -0,0 +1,102 @@
+! { dg-do run }
+! Test the fix for PR42385, in which CLASS defined operators
+! compiled but were not correctly dynamically dispatched.
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+!
+module foo_module
+ implicit none
+ private
+ public :: foo
+
+ type :: foo
+ integer :: foo_x
+ contains
+ procedure :: times => times_foo
+ procedure :: assign => assign_foo
+ generic :: operator(*) => times
+ generic :: assignment(=) => assign
+ end type
+
+contains
+
+ function times_foo(this,factor) result(product)
+ class(foo) ,intent(in) :: this
+ class(foo) ,allocatable :: product
+ integer, intent(in) :: factor
+ allocate (product, source = this)
+ product%foo_x = -product%foo_x * factor
+ end function
+
+ subroutine assign_foo(lhs,rhs)
+ class(foo) ,intent(inout) :: lhs
+ class(foo) ,intent(in) :: rhs
+ lhs%foo_x = -rhs%foo_x
+ end subroutine
+
+end module
+
+module bar_module
+ use foo_module ,only : foo
+ implicit none
+ private
+ public :: bar
+
+ type ,extends(foo) :: bar
+ integer :: bar_x
+ contains
+ procedure :: times => times_bar
+ procedure :: assign => assign_bar
+ end type
+
+contains
+ subroutine assign_bar(lhs,rhs)
+ class(bar) ,intent(inout) :: lhs
+ class(foo) ,intent(in) :: rhs
+ select type(rhs)
+ type is (bar)
+ lhs%bar_x = rhs%bar_x
+ lhs%foo_x = -rhs%foo_x
+ end select
+ end subroutine
+ function times_bar(this,factor) result(product)
+ class(bar) ,intent(in) :: this
+ integer, intent(in) :: factor
+ class(foo), allocatable :: product
+ select type(this)
+ type is (bar)
+ allocate(product,source=this)
+ select type(product)
+ type is(bar)
+ product%bar_x = 2*this%bar_x*factor
+ end select
+ end select
+ end function
+end module
+
+program main
+ use foo_module ,only : foo
+ use bar_module ,only : bar
+ implicit none
+ type(foo) :: unitf
+ type(bar) :: unitb
+
+! foo's assign negates, whilst its '*' negates and mutliplies.
+ unitf%foo_x = 1
+ call rescale(unitf, 42)
+ if (unitf%foo_x .ne. 42) call abort
+
+! bar's assign negates foo_x, whilst its '*' copies foo_x
+! and does a multiply by twice factor.
+ unitb%foo_x = 1
+ unitb%bar_x = 2
+ call rescale(unitb, 3)
+ if (unitb%bar_x .ne. 12) call abort
+ if (unitb%foo_x .ne. -1) call abort
+contains
+ subroutine rescale(this,scale)
+ class(foo) ,intent(inout) :: this
+ integer, intent(in) :: scale
+ this = this*scale
+ end subroutine
+end program
diff --git a/gcc/testsuite/gfortran.dg/coarray_10.f90 b/gcc/testsuite/gfortran.dg/coarray_10.f90
index 7a50c89fc3c..6ee425d7bf9 100644
--- a/gcc/testsuite/gfortran.dg/coarray_10.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_10.f90
@@ -24,5 +24,23 @@ subroutine this_image_check()
j = this_image(dim=3) ! { dg-error "DIM argument without ARRAY argument" }
i = image_index(i, [ 1 ]) ! { dg-error "Expected coarray variable" }
i = image_index(z, 2) ! { dg-error "must be a rank one array" }
-
end subroutine this_image_check
+
+
+subroutine rank_mismatch()
+ implicit none
+ integer,allocatable :: A(:)[:,:,:,:]
+ allocate(A(1)[1,1,1:*]) ! { dg-error "Unexpected ... for codimension" }
+ allocate(A(1)[1,1,1,1,1,*]) ! { dg-error "Invalid codimension 5" }
+ allocate(A(1)[1,1,1,*])
+ allocate(A(1)[1,1]) ! { dg-error "Too few codimensions" }
+ allocate(A(1)[1,*]) ! { dg-error "Too few codimensions" }
+ allocate(A(1)[1,1:*]) ! { dg-error "Unexpected ... for codimension" }
+
+ A(1)[1,1,1] = 1 ! { dg-error "Too few codimensions" }
+ A(1)[1,1,1,1,1,1] = 1 ! { dg-error "Invalid codimension 5" }
+ A(1)[1,1,1,1] = 1
+ A(1)[1,1] = 1 ! { dg-error "Too few codimensions" }
+ A(1)[1,1] = 1 ! { dg-error "Too few codimensions" }
+ A(1)[1,1:1] = 1 ! { dg-error "Too few codimensions" }
+end subroutine rank_mismatch
diff --git a/gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f90 b/gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f90
index 688c38d9192..0aa2e4e1c18 100644
--- a/gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f90
+++ b/gcc/testsuite/gfortran.dg/derived_constructor_comps_3.f90
@@ -1,4 +1,4 @@
-! { dg-compile }
+! { dg-do compile }
!
! gfortran was ICEing for the constructor of
! componentfree types.
diff --git a/gcc/testsuite/gfortran.dg/dim_range_1.f90 b/gcc/testsuite/gfortran.dg/dim_range_1.f90
new file mode 100644
index 00000000000..59f3f431143
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dim_range_1.f90
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! PR 44693 - check for invalid dim even in functions.
+! Based on a test case by Dominique d'Humieres.
+subroutine test1(esss,Ix,Iyz, n)
+ real(kind=kind(1.0d0)), dimension(n), intent(out) :: esss
+ real(kind=kind(1.0d0)), dimension(n,n,n) :: sp
+ real(kind=kind(1.0d0)), dimension(n,n) :: Ix,Iyz
+ esss = sum(Ix * Iyz, 0) ! { dg-error "is not a valid dimension index" }
+ esss = sum(Ix * Iyz, 1)
+ esss = sum(Ix * Iyz, 2)
+ esss = sum(Ix * Iyz, 3) ! { dg-error "is not a valid dimension index" }
+ sp = spread (ix * iyz, 0, n) ! { dg-error "is not a valid dimension index" }
+ sp = spread (ix * iyz, 1, n)
+ sp = spread (ix * iyz, 2, n)
+ sp = spread (ix * iyz, 3, n)
+ sp = spread (ix * iyz, 4, n) ! { dg-error "is not a valid dimension index" }
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03
index 4854b0ff08d..2182dce3e4f 100644
--- a/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_1.f03
@@ -12,16 +12,14 @@ module m
procedure, pass :: make_integer
procedure, pass :: prod => i_m_j
generic, public :: extract => real, make_integer
- generic, public :: base_extract => real, make_integer
end type t1
type, extends(t1) :: t2
integer :: j = 99
contains
procedure, pass :: real => make_real2
- procedure, pass :: make_integer_2
+ procedure, pass :: make_integer => make_integer_2
procedure, pass :: prod => i_m_j_2
- generic, public :: extract => real, make_integer_2
end type t2
contains
real function make_real (arg)
@@ -69,16 +67,13 @@ end module m
if (a%real() .ne. real (42)) call abort
if (a%prod() .ne. 42) call abort
if (a%extract (2) .ne. 84) call abort
- if (a%base_extract (2) .ne. 84) call abort
a => c ! extension in module
if (a%real() .ne. real (99)) call abort
if (a%prod() .ne. 99) call abort
if (a%extract (3) .ne. 297) call abort
- if (a%base_extract (3) .ne. 126) call abort
a => d ! extension in main
if (a%real() .ne. real (42)) call abort
if (a%prod() .ne. 42) call abort
if (a%extract (4) .ne. 168) call abort
- if (a%base_extract (4) .ne. 168) call abort
end
! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03
index 989a2e0d3f0..95ce8372325 100644
--- a/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_2.f03
@@ -12,16 +12,14 @@ module m
procedure, pass :: make_integer
procedure, pass :: prod => i_m_j
generic, public :: extract => real, make_integer
- generic, public :: base_extract => real, make_integer
end type t1
type, extends(t1) :: t2
integer :: j = 99
contains
procedure, pass :: real => make_real2
- procedure, pass :: make_integer_2
+ procedure, pass :: make_integer => make_integer_2
procedure, pass :: prod => i_m_j_2
- generic, public :: extract => real, make_integer_2
end type t2
contains
subroutine make_real (arg, arg2)
@@ -79,8 +77,6 @@ end module m
if (i .ne. 42) call abort
call a%extract (2, i)
if (i .ne. 84) call abort
- call a%base_extract (2, i)
- if (i .ne. 84) call abort
a => c ! extension in module
call a%real(r)
@@ -89,8 +85,6 @@ end module m
if (i .ne. 99) call abort
call a%extract (3, i)
if (i .ne. 297) call abort
- call a%base_extract (3, i)
- if (i .ne. 126) call abort
a => d ! extension in main
call a%real(r)
@@ -99,7 +93,5 @@ end module m
if (i .ne. 42) call abort
call a%extract (4, i)
if (i .ne. 168) call abort
- call a%extract (4, i)
- if (i .ne. 168) call abort
end
! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03 b/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03
index aa8713ef4d4..884d3426039 100644
--- a/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03
+++ b/gcc/testsuite/gfortran.dg/dynamic_dispatch_3.f03
@@ -15,7 +15,6 @@ module m1
procedure, pass :: make_integer
procedure, pass :: prod => i_m_j
generic, public :: extract => real, make_integer
- generic, public :: base_extract => real, make_integer
end type t1
contains
real function make_real (arg)
@@ -41,9 +40,8 @@ module m2
integer :: j = 99
contains
procedure, pass :: real => make_real2
- procedure, pass :: make_integer_2
+ procedure, pass :: make_integer => make_integer_2
procedure, pass :: prod => i_m_j_2
- generic, public :: extract => real, make_integer_2
end type t2
contains
real function make_real2 (arg)
@@ -76,16 +74,13 @@ end module m2
if (a%real() .ne. real (42)) call abort
if (a%prod() .ne. 42) call abort
if (a%extract (2) .ne. 84) call abort
- if (a%base_extract (2) .ne. 84) call abort
a => c ! extension in module m2
if (a%real() .ne. real (99)) call abort
if (a%prod() .ne. 99) call abort
if (a%extract (3) .ne. 297) call abort
- if (a%base_extract (3) .ne. 126) call abort
a => d ! extension in main
if (a%real() .ne. real (42)) call abort
if (a%prod() .ne. 42) call abort
if (a%extract (4) .ne. 168) call abort
- if (a%base_extract (4) .ne. 168) call abort
end
! { dg-final { cleanup-modules "m1, m2" } }
diff --git a/gcc/testsuite/gfortran.dg/endfile_2.f90 b/gcc/testsuite/gfortran.dg/endfile_2.f90
index ee911e89e9e..e91e80eb2aa 100644
--- a/gcc/testsuite/gfortran.dg/endfile_2.f90
+++ b/gcc/testsuite/gfortran.dg/endfile_2.f90
@@ -5,7 +5,7 @@
integer i
endfile(8)
rewind(8)
- read(8,*,end=0023)i
+ read(8,end=0023)i
call abort ! should never get here
stop
0023 continue
diff --git a/gcc/testsuite/gfortran.dg/exit_1.f08 b/gcc/testsuite/gfortran.dg/exit_1.f08
new file mode 100644
index 00000000000..9ebc2eccb50
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/exit_1.f08
@@ -0,0 +1,50 @@
+! { dg-do run }
+! { dg-options "-std=f2008 -fall-intrinsics" }
+
+! PR fortran/44709
+! Check that exit and cycle from within a BLOCK works for loops as expected.
+
+! Contributed by Daniel Kraft, d@domob.eu.
+
+PROGRAM main
+ IMPLICIT NONE
+ INTEGER :: i
+
+ ! Simple exit without loop name.
+ DO
+ BLOCK
+ EXIT
+ END BLOCK
+ CALL abort ()
+ END DO
+
+ ! Cycle without loop name.
+ DO i = 1, 1
+ BLOCK
+ CYCLE
+ END BLOCK
+ CALL abort ()
+ END DO
+
+ ! Exit loop by name from within a BLOCK.
+ loop1: DO
+ DO
+ BLOCK
+ EXIT loop1
+ END BLOCK
+ CALL abort ()
+ END DO
+ CALL abort ()
+ END DO loop1
+
+ ! Cycle loop by name from within a BLOCK.
+ loop2: DO i = 1, 1
+ loop3: DO
+ BLOCK
+ CYCLE loop2
+ END BLOCK
+ CALL abort ()
+ END DO loop3
+ CALL abort ()
+ END DO loop2
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/exit_2.f08 b/gcc/testsuite/gfortran.dg/exit_2.f08
new file mode 100644
index 00000000000..23e7009cbf8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/exit_2.f08
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+
+! PR fortran/44709
+! Check that the resolving of loop names in parent namespaces introduced to
+! handle intermediate BLOCK's does not go too far and other sanity checks.
+
+! Contributed by Daniel Kraft, d@domob.eu.
+
+PROGRAM main
+ IMPLICIT NONE
+
+ EXIT ! { dg-error "is not within a loop" }
+ EXIT foobar ! { dg-error "is unknown" }
+ EXIT main ! { dg-error "is not a loop name" }
+
+ mainLoop: DO
+ CALL test ()
+ END DO mainLoop
+
+ otherLoop: DO
+ EXIT mainLoop ! { dg-error "is not within loop 'mainloop'" }
+ END DO otherLoop
+
+CONTAINS
+
+ SUBROUTINE test ()
+ EXIT mainLoop ! { dg-error "is unknown" }
+ END SUBROUTINE test
+
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/ftell_3.f90 b/gcc/testsuite/gfortran.dg/ftell_3.f90
index c16afe8ed16..16875d812a8 100644
--- a/gcc/testsuite/gfortran.dg/ftell_3.f90
+++ b/gcc/testsuite/gfortran.dg/ftell_3.f90
@@ -3,9 +3,10 @@
! Contributed by Janne Blomqvist, Manfred Schwarb
! and Dominique d'Humieres.
program ftell_3
- integer :: i
+ integer :: i, j
+ character(1) :: ch
character(len=99) :: buffer
- open(10, form='formatted', status='scratch', position='rewind')
+ open(10, form='formatted', position='rewind')
write(10, '(a)') '123456'
write(10, '(a)') '789'
write(10, '(a)') 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'
@@ -13,16 +14,29 @@ program ftell_3
rewind(10)
read(10, '(a)') buffer
call ftell(10, i)
- if(i /= 7) then
- call abort()
+! Expected: On '\n' systems: 7, on \r\n systems: 8
+ if(i /= 7 .and. i /= 8) then
+ call abort
end if
read(10,'(a)') buffer
if (trim(buffer) /= "789") then
call abort()
end if
- call ftell(10,i)
- if (i /= 11) then
- call abort()
- end if
+ call ftell(10,j)
close(10)
+ open(10, access="stream")
+! Expected: On '\n' systems: 11, on \r\n systems: 13
+ if (i == 7) then
+ read(10, pos=7) ch
+ if (ch /= char(10)) call abort
+ if (j /= 11) call abort
+ end if
+ if (i == 8) then
+ read(10, pos=7) ch
+ if (ch /= char(13)) call abort
+ read(10) ch
+ if (ch /= char(10)) call abort
+ if (j /= 13) call abort
+ end if
+ close(10, status="delete")
end program ftell_3
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44847.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44847.f90
new file mode 100644
index 00000000000..3da4311499e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr44847.f90
@@ -0,0 +1,86 @@
+! PR fortran/44847
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+
+subroutine pr44847_1
+ integer :: i, j
+!$omp parallel do collapse(2)
+l:do i = 1, 2
+ do j = 1, 2
+ cycle l ! { dg-error "CYCLE statement" }
+ end do
+ end do l
+end subroutine
+subroutine pr44847_2
+ integer :: i, j, k
+!$omp parallel do collapse(3)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ cycle l ! { dg-error "CYCLE statement" }
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_3
+ integer :: i, j
+!$omp parallel do
+l:do i = 1, 2
+ do j = 1, 2
+ cycle l
+ end do
+ end do l
+end subroutine
+subroutine pr44847_4
+ integer :: i, j, k
+!$omp parallel do collapse(2)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ cycle l
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_5
+ integer :: i, j
+!$omp parallel do collapse(2)
+l:do i = 1, 2
+ do j = 1, 2
+ exit l ! { dg-error "EXIT statement" }
+ end do
+ end do l
+end subroutine
+subroutine pr44847_6
+ integer :: i, j, k
+!$omp parallel do collapse(3)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ exit l ! { dg-error "EXIT statement" }
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_7
+ integer :: i, j, k
+!$omp parallel do collapse(2)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ exit l ! { dg-error "EXIT statement" }
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_8
+ integer :: i, j, k
+!$omp parallel do
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ exit l
+ end do
+ end do l
+ end do
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr42185.f90 b/gcc/testsuite/gfortran.dg/graphite/pr42185.f90
index d0e1b017879..6fa6e303677 100644
--- a/gcc/testsuite/gfortran.dg/graphite/pr42185.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/pr42185.f90
@@ -1,4 +1,4 @@
-! { dg-compile }
+! { dg-do compile }
! { dg-options "-fgraphite -O -ffast-math" }
MODULE powell
diff --git a/gcc/testsuite/gfortran.dg/initialization_20.f90 b/gcc/testsuite/gfortran.dg/initialization_20.f90
index 47d552834ae..6af1a00a45d 100644
--- a/gcc/testsuite/gfortran.dg/initialization_20.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_20.f90
@@ -6,5 +6,5 @@ program pr19925
integer j
integer, parameter :: n = 100000
integer, parameter :: i(n)=(/(j,j=1,n)/) ! { dg-error "number of elements" }
- print *, i(5)
+ print *, i(5) ! { dg-error "has no IMPLICIT type" }
end program pr19925
diff --git a/gcc/testsuite/gfortran.dg/initialization_24.f90 b/gcc/testsuite/gfortran.dg/initialization_24.f90
index 4c203312be4..0ab8dc624e4 100644
--- a/gcc/testsuite/gfortran.dg/initialization_24.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_24.f90
@@ -3,7 +3,7 @@
! Test case by Dominique d'Humieres
INTEGER, PARAMETER ::N=65536
INTEGER, PARAMETER ::I(N)=(/(MOD(K,2),K=1,N)/)!{ dg-error "number of elements" }
-INTEGER, PARAMETER ::M(N)=I(N:1:-1)
+INTEGER, PARAMETER ::M(N)=I(N:1:-1) ! { dg-error "Syntax error in argument" }
print *, I(1), M(1), I(N), M(N)
END
diff --git a/gcc/testsuite/gfortran.dg/intent_out_5.f90 b/gcc/testsuite/gfortran.dg/intent_out_5.f90
index acd2b606525..6a9c6f4bd39 100644
--- a/gcc/testsuite/gfortran.dg/intent_out_5.f90
+++ b/gcc/testsuite/gfortran.dg/intent_out_5.f90
@@ -1,4 +1,4 @@
-! { dg-do run}
+! { dg-do run }
!
! PR fortran/41479
!
diff --git a/gcc/testsuite/gfortran.dg/ltrans-7.f90 b/gcc/testsuite/gfortran.dg/ltrans-7.f90
index 9c9bcf939eb..583edf216ba 100644
--- a/gcc/testsuite/gfortran.dg/ltrans-7.f90
+++ b/gcc/testsuite/gfortran.dg/ltrans-7.f90
@@ -27,5 +27,5 @@ Program FOO
end Program FOO
! Please do not XFAIL.
-! { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} }
+! { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" } }
! { dg-final { cleanup-tree-dump "ltrans" } }
diff --git a/gcc/testsuite/gfortran.dg/minmaxloc_4.f90 b/gcc/testsuite/gfortran.dg/minmaxloc_4.f90
index 2ea2e7b86ab..673739518dc 100644
--- a/gcc/testsuite/gfortran.dg/minmaxloc_4.f90
+++ b/gcc/testsuite/gfortran.dg/minmaxloc_4.f90
@@ -3,7 +3,6 @@
PROGRAM TST
IMPLICIT NONE
REAL :: A(1,3)
- REAL :: B(3,1)
A(:,1) = 10
A(:,2) = 20
A(:,3) = 30
@@ -13,9 +12,4 @@ PROGRAM TST
if (minloc(sum(a(:,1:3),1),1) .ne. 1) call abort()
if (maxloc(sum(a(:,1:3),1),1) .ne. 3) call abort()
- B(1,:) = 10
- B(2,:) = 20
- B(3,:) = 30
- if (minloc(sum(b(1:3,:),2),2) .ne. 1) call abort()
- if (maxloc(sum(b(1:3,:),2),2) .ne. 3) call abort()
END PROGRAM TST
diff --git a/gcc/testsuite/gfortran.dg/namelist_36.f90 b/gcc/testsuite/gfortran.dg/namelist_36.f90
index 61e88b6b3e9..b6a14e36bc3 100644
--- a/gcc/testsuite/gfortran.dg/namelist_36.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_36.f90
@@ -1,4 +1,4 @@
-! { dg-compile }
+! { dg-do compile }
!
! Private types and types with private components
! are acceptable in local namelists.
diff --git a/gcc/testsuite/gfortran.dg/parameter_array_init_6.f90 b/gcc/testsuite/gfortran.dg/parameter_array_init_6.f90
new file mode 100644
index 00000000000..9a654db3f00
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/parameter_array_init_6.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+!
+! PR fortran/44742
+!
+! Test case based on Juergen Reuter's and reduced by
+! Janus Weil.
+!
+! The program creates a large array constructor, which
+! exceeds -fmax-array-constructor - and caused an ICE.
+!
+
+module proc8
+ implicit none
+ integer, parameter :: N = 256
+ logical, dimension(N**2), parameter :: A = .false.
+ logical, dimension(N,N), parameter :: B &
+ = reshape ( (/ A /), (/ N, N /) ) ! { dg-error "array constructor at .1. requires an increase" }
+end module
diff --git a/gcc/testsuite/gfortran.dg/pr44882.f90 b/gcc/testsuite/gfortran.dg/pr44882.f90
new file mode 100644
index 00000000000..ac22459dc08
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr44882.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-O3 -ffast-math -funroll-loops -w" }
+
+ SUBROUTINE TRUDGE(KDIR)
+! There is a type mismatch here for TRUPAR which caused an ICE
+ COMMON /TRUPAR/ DR(10),V(10,10)
+ DO 110 I=1,NDIR
+ 110 DR(I)=V(I,JDIR)
+ END
+ SUBROUTINE TRUSRC(LEAVE)
+ IMPLICIT DOUBLE PRECISION (A-H,O-Z)
+ COMMON /TRUPAR/ DX(10),V(10,10)
+ END
+
diff --git a/gcc/testsuite/gfortran.dg/runtime_warning_1.f90 b/gcc/testsuite/gfortran.dg/runtime_warning_1.f90
index cff9eae7ae7..2894136a8b5 100644
--- a/gcc/testsuite/gfortran.dg/runtime_warning_1.f90
+++ b/gcc/testsuite/gfortran.dg/runtime_warning_1.f90
@@ -14,4 +14,4 @@
close (42)
if (c /= 'abcde') call abort ()
end
-! { dg-warning ".*descriptor" "" 10}
+
diff --git a/gcc/testsuite/gfortran.dg/select_char_2.f90 b/gcc/testsuite/gfortran.dg/select_char_2.f90
new file mode 100644
index 00000000000..22af1c76dfc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_char_2.f90
@@ -0,0 +1,45 @@
+! { dg-do run }
+! { dg-options "-O -fdump-tree-original" }
+
+ if (foo ('E') .ne. 1) call abort
+ if (foo ('e') .ne. 1) call abort
+ if (foo ('f') .ne. 2) call abort
+ if (foo ('g') .ne. 2) call abort
+ if (foo ('h') .ne. 2) call abort
+ if (foo ('Q') .ne. 3) call abort
+ if (foo (' ') .ne. 4) call abort
+ if (bar ('e') .ne. 1) call abort
+ if (bar ('f') .ne. 3) call abort
+contains
+ function foo (c)
+ character :: c
+ integer :: foo
+ select case (c)
+ case ('E','e')
+ foo = 1
+ case ('f':'h ')
+ foo = 2
+ case default
+ foo = 3
+ case ('')
+ foo = 4
+ end select
+ end function
+ function bar (c)
+ character :: c
+ integer :: bar
+ select case (c)
+ case ('ea':'ez')
+ bar = 2
+ case ('e')
+ bar = 1
+ case default
+ bar = 3
+ case ('fd')
+ bar = 4
+ end select
+ end function
+end
+
+! { dg-final { scan-tree-dump-not "_gfortran_select_string" "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/select_char_3.f90 b/gcc/testsuite/gfortran.dg/select_char_3.f90
new file mode 100644
index 00000000000..f0a7c874175
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_char_3.f90
@@ -0,0 +1,15 @@
+! PR fortran/40206
+! { dg-do compile }
+! { dg-options "-O2 -Wuninitialized" }
+
+function char2type (char)
+ character, intent(in) :: char
+ integer :: char2type
+
+ select case (char)
+ case ('E','e')
+ char2type=1
+ case default
+ char2type=-1234
+ end select
+end function
diff --git a/gcc/testsuite/gfortran.dg/storage_size_1.f08 b/gcc/testsuite/gfortran.dg/storage_size_1.f08
new file mode 100644
index 00000000000..ade9dfc30b0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/storage_size_1.f08
@@ -0,0 +1,31 @@
+! { dg-do run }
+!
+! PR 44649: [OOP] F2008: storage_size intrinsic
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+type :: t
+ integer(4) :: i
+ real(4) :: r
+end type
+
+type,extends(t) :: t2
+ integer(4) :: j
+end type
+
+type(t) :: a
+type(t), dimension(1:3) :: b
+class(t), allocatable :: cp
+
+allocate(t2::cp)
+
+if (sizeof(a) /= 8) call abort()
+if (storage_size(a) /= 64) call abort()
+
+if (sizeof(b) /= 24) call abort()
+if (storage_size(b) /= 64) call abort()
+
+if (sizeof(cp) /= 8) call abort()
+if (storage_size(cp) /= 96) call abort()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/storage_size_2.f08 b/gcc/testsuite/gfortran.dg/storage_size_2.f08
new file mode 100644
index 00000000000..50de9575e74
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/storage_size_2.f08
@@ -0,0 +1,27 @@
+! { dg-do compile }
+!
+! PR 44649: [OOP] F2008: storage_size intrinsic
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+use iso_c_binding, only: c_int
+
+type, bind(c) :: t
+ integer(c_int) :: j
+end type
+
+integer(4) :: i1
+integer(c_int) :: i2
+type(t) :: x
+
+print *,c_sizeof(i1) ! { dg-error "must be be an interoperable data entity" }
+print *,c_sizeof(i2)
+print *,c_sizeof(x)
+print *, c_sizeof(ran()) ! { dg-error "must be be an interoperable data entity" }
+
+print *,storage_size(1.0,4)
+print *,storage_size(1.0,3.2) ! { dg-error "must be INTEGER" }
+print *,storage_size(1.0,(/1,2/)) ! { dg-error "must be a scalar" }
+print *,storage_size(1.0,irand()) ! { dg-error "must be a constant" }
+
+end
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_16.f03 b/gcc/testsuite/gfortran.dg/typebound_call_16.f03
new file mode 100644
index 00000000000..fdd60c603cc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_16.f03
@@ -0,0 +1,35 @@
+! { dg-do compile }
+!
+! PR 41685: [OOP] internal compiler error: verify_flow_info failed
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+module base_mat_mod
+
+ type :: base_sparse_mat
+ contains
+ procedure, pass(a) :: get_nrows
+ end type base_sparse_mat
+
+contains
+
+ integer function get_nrows(a)
+ implicit none
+ class(base_sparse_mat), intent(in) :: a
+ end function get_nrows
+
+end module base_mat_mod
+
+
+ use base_mat_mod
+
+ type, extends(base_sparse_mat) :: s_coo_sparse_mat
+ end type s_coo_sparse_mat
+
+ class(s_coo_sparse_mat), pointer :: a
+ Integer :: m
+ m = a%get_nrows()
+
+end
+
+! { dg-final { cleanup-modules "base_mat_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_6.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_6.f03
new file mode 100644
index 00000000000..973e10a35e3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_generic_6.f03
@@ -0,0 +1,69 @@
+! { dg-do run }
+!
+! PR 43945: [OOP] Derived type with GENERIC: resolved to the wrong specific TBP
+!
+! Contributed by by Salvatore Filippone <sfilippone@uniroma2.it>
+
+module foo_mod
+ type foo
+ integer :: i
+ contains
+ procedure, pass(a) :: doit
+ procedure, pass(a) :: getit
+ generic, public :: do => doit
+ generic, public :: get => getit
+ end type foo
+ private doit,getit
+contains
+ subroutine doit(a)
+ class(foo) :: a
+ a%i = 1
+ write(*,*) 'FOO%DOIT base version'
+ end subroutine doit
+ function getit(a) result(res)
+ class(foo) :: a
+ integer :: res
+ res = a%i
+ end function getit
+end module foo_mod
+
+module foo2_mod
+ use foo_mod
+ type, extends(foo) :: foo2
+ integer :: j
+ contains
+ procedure, pass(a) :: doit => doit2
+ procedure, pass(a) :: getit => getit2
+ end type foo2
+ private doit2, getit2
+
+contains
+
+ subroutine doit2(a)
+ class(foo2) :: a
+ a%i = 2
+ a%j = 3
+ end subroutine doit2
+ function getit2(a) result(res)
+ class(foo2) :: a
+ integer :: res
+ res = a%j
+ end function getit2
+end module foo2_mod
+
+program testd15
+ use foo2_mod
+ type(foo2) :: af2
+ class(foo), allocatable :: afab
+
+ allocate(foo2 :: afab)
+ call af2%do()
+ if (af2%i .ne. 2) call abort
+ if (af2%get() .ne. 3) call abort
+ call afab%do()
+ if (afab%i .ne. 2) call abort
+ if (afab%get() .ne. 3) call abort
+
+end program testd15
+
+! { dg-final { cleanup-modules "foo_mod foo2_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_7.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_7.f03
new file mode 100644
index 00000000000..2519ab09416
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_generic_7.f03
@@ -0,0 +1,28 @@
+! { dg-do compile }
+!
+! PR 44434: [OOP] ICE in in gfc_add_component_ref
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+module foo_mod
+ type foo
+ contains
+ procedure :: doit
+ generic :: do => doit
+ end type
+contains
+ subroutine doit(a)
+ class(foo) :: a
+ end subroutine
+end module
+
+program testd15
+contains
+ subroutine dodo(x)
+ use foo_mod
+ class(foo) :: x
+ call x%do()
+ end subroutine
+end
+
+! { dg-final { cleanup-modules "foo_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_8.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_8.f03
new file mode 100644
index 00000000000..0ee6610e173
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_generic_8.f03
@@ -0,0 +1,29 @@
+! { dg-do compile }
+!
+! PR 44565: [4.6 Regression] [OOP] ICE in gimplify_expr with array-valued generic TBP
+!
+! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
+
+module ice6
+
+ type :: t
+ contains
+ procedure :: get_array
+ generic :: get_something => get_array
+ end type
+
+contains
+
+ function get_array(this)
+ class(t) :: this
+ real,dimension(2) :: get_array
+ end function get_array
+
+ subroutine do_something(this)
+ class(t) :: this
+ print *,this%get_something()
+ end subroutine do_something
+
+end module ice6
+
+! { dg-final { cleanup-modules "ice6" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_9.f03 b/gcc/testsuite/gfortran.dg/typebound_generic_9.f03
new file mode 100644
index 00000000000..f85bb385706
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_generic_9.f03
@@ -0,0 +1,63 @@
+! { dg-do run }
+!
+! PR 44936: [OOP] Generic TBP not resolved correctly at compile time
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+module foo_mod
+ type foo
+ integer :: i
+ contains
+ procedure, pass(a) :: doit => doit1
+ procedure, pass(a) :: getit=> getit1
+ generic, public :: do => doit
+ generic, public :: get => getit
+ end type foo
+ private doit1,getit1
+contains
+ subroutine doit1(a)
+ class(foo) :: a
+ a%i = 1
+ write(*,*) 'FOO%DOIT base version'
+ end subroutine doit1
+ function getit1(a) result(res)
+ class(foo) :: a
+ integer :: res
+ res = a%i
+ end function getit1
+end module foo_mod
+
+module foo2_mod
+ use foo_mod
+ type, extends(foo) :: foo2
+ integer :: j
+ contains
+ procedure, pass(a) :: doit => doit2
+ procedure, pass(a) :: getit => getit2
+ end type foo2
+ private doit2, getit2
+contains
+ subroutine doit2(a)
+ class(foo2) :: a
+ a%i = 2
+ a%j = 3
+ end subroutine doit2
+ function getit2(a) result(res)
+ class(foo2) :: a
+ integer :: res
+ res = a%j
+ end function getit2
+end module foo2_mod
+
+program testd15
+ use foo2_mod
+ type(foo2) :: af2
+
+ call af2%do()
+ if (af2%i .ne. 2) call abort
+ if (af2%get() .ne. 3) call abort
+
+end program testd15
+
+! { dg-final { cleanup-modules "foo_mod foo2_mod" } }
+
diff --git a/gcc/testsuite/gfortran.dg/use_iso_c_binding.f90 b/gcc/testsuite/gfortran.dg/use_iso_c_binding.f90
index b35c024c08c..8a28490f7b2 100644
--- a/gcc/testsuite/gfortran.dg/use_iso_c_binding.f90
+++ b/gcc/testsuite/gfortran.dg/use_iso_c_binding.f90
@@ -7,12 +7,12 @@
! intrinsic one. --Rickett, 09.26.06
module use_stmt_0
! this is an error because c_ptr_2 does not exist
- use, intrinsic :: iso_c_binding, only: c_ptr_2 ! { dg-error "Symbol 'c_ptr_2' referenced at \\(1\\) does not exist" }
+ use, intrinsic :: iso_c_binding, only: c_ptr_2 ! { dg-error "Symbol 'c_ptr_2' referenced at \\(1\\) not found" }
end module use_stmt_0
module use_stmt_1
! this is an error because c_ptr_2 does not exist
- use iso_c_binding, only: c_ptr_2 ! { dg-error "Symbol 'c_ptr_2' referenced at \\(1\\) does not exist" }
+ use iso_c_binding, only: c_ptr_2 ! { dg-error "Symbol 'c_ptr_2' referenced at \\(1\\) not found" }
end module use_stmt_1
module use_stmt_2
diff --git a/gcc/testsuite/gfortran.dg/use_rename_6.f90 b/gcc/testsuite/gfortran.dg/use_rename_6.f90
new file mode 100644
index 00000000000..02f25c36e97
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_rename_6.f90
@@ -0,0 +1,40 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/44702
+!
+! Based on a test case by Joe Krahn.
+!
+! Multiple import of the same symbol was failing for
+! intrinsic modules.
+!
+subroutine one()
+ use iso_c_binding, only: a => c_ptr, b => c_ptr, c_ptr
+ implicit none
+ type(a) :: x
+ type(b) :: y
+ type(c_ptr) :: z
+end subroutine one
+
+subroutine two()
+ use iso_c_binding, a => c_ptr, b => c_ptr
+ implicit none
+ type(a) :: x
+ type(b) :: y
+end subroutine two
+
+subroutine three()
+ use iso_fortran_env, only: a => error_unit, b => error_unit, error_unit
+ implicit none
+ if(a /= b) call shall_not_be_there()
+ if(a /= error_unit) call shall_not_be_there()
+end subroutine three
+
+subroutine four()
+ use iso_fortran_env, a => error_unit, b => error_unit
+ implicit none
+ if(a /= b) call shall_not_be_there()
+end subroutine four
+
+! { dg-final { scan-tree-dump-times "shall_not_be_there" 0 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index 39a1f9d811a..5783e929496 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -68,11 +68,8 @@ if [istarget "powerpc-*paired*"] {
} elseif { [istarget "spu-*-*"] } {
set dg-do-what-default run
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
- if { ![check_effective_target_sse2] } then {
- return
- }
lappend DEFAULT_VECTCFLAGS "-msse2"
- if [check_sse2_hw_available] {
+ if { [check_effective_target_sse2_runtime] } {
set dg-do-what-default run
} else {
set dg-do-what-default compile
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr40421.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr40421.f90
new file mode 100644
index 00000000000..64b129efc3c
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr40421.f90
@@ -0,0 +1,15 @@
+subroutine pr40421 (j, q, r)
+ double precision :: q(1,1), r(1,1,3)
+ save
+ integer :: i, j, m, n
+ double precision :: s, t, u
+ do i=1,2
+ do m=1,j
+ do n=1,1
+ s=q(n,m)*r(n,m,1)
+ t=q(n,m)*r(n,m,2)
+ u=q(n,m)*r(n,m,3)
+ end do
+ end do
+ end do
+end
diff --git a/gcc/testsuite/gnat.dg/aggr15.adb b/gcc/testsuite/gnat.dg/aggr15.adb
new file mode 100644
index 00000000000..e69e9d346e1
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/aggr15.adb
@@ -0,0 +1,18 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+package body Aggr15 is
+
+ function CREATE return DATA_T is
+ D : DATA_T;
+ begin
+ return D;
+ end;
+
+ function ALL_CREATE return ALL_DATA_T is
+ C : constant ALL_DATA_T := (others => (others => Create));
+ begin
+ return C;
+ end;
+
+end Aggr15;
diff --git a/gcc/testsuite/gnat.dg/aggr15.ads b/gcc/testsuite/gnat.dg/aggr15.ads
new file mode 100644
index 00000000000..23f26a8df7d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/aggr15.ads
@@ -0,0 +1,15 @@
+package Aggr15 is
+
+ type T is tagged record
+ I : Integer;
+ end record;
+
+ type DATA_T is record
+ D : T;
+ end record;
+
+ type ALL_DATA_T is array (1..2, 1..2) of DATA_T;
+
+ function ALL_CREATE return ALL_DATA_T;
+
+end Aggr15;
diff --git a/gcc/testsuite/gnat.dg/atomic3.adb b/gcc/testsuite/gnat.dg/atomic3.adb
new file mode 100644
index 00000000000..592a856caef
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/atomic3.adb
@@ -0,0 +1,24 @@
+-- { dg-do compile }
+
+procedure Atomic3 is
+
+ type Unsigned_32_T is mod 2 ** 32;
+ for Unsigned_32_T'Size use 32;
+
+ type Id_T is (One, Two, Three);
+
+ type Array_T is array (Id_T) of Unsigned_32_T;
+ pragma Atomic_Components (Array_T);
+
+ A : Array_T := (others => 0);
+
+ function Get_Array return Array_T is
+ begin
+ return A;
+ end;
+
+ X : Array_T;
+
+begin
+ X := Get_Array;
+end;
diff --git a/gcc/testsuite/gnat.dg/cond_expr1.adb b/gcc/testsuite/gnat.dg/cond_expr1.adb
new file mode 100644
index 00000000000..e1a87a36ab5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/cond_expr1.adb
@@ -0,0 +1,7 @@
+-- { dg-do compile }
+-- { dg-options "-gnat12" }
+
+function Cond_Expr1 (Dir : in String) return String is
+begin
+ return (if Dir (Dir'Last) = '\' then Dir else Dir & '\');
+end;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization7.adb b/gcc/testsuite/gnat.dg/loop_optimization7.adb
index 16683949465..c6a5dc98900 100644
--- a/gcc/testsuite/gnat.dg/loop_optimization7.adb
+++ b/gcc/testsuite/gnat.dg/loop_optimization7.adb
@@ -1,6 +1,7 @@
-- { dg-do compile }
-- { dg-options "-O3" }
-- { dg-options "-O3 -msse" { target i?86-*-* x86_64-*-* } }
+-- { dg-require-effective-target sse }
package body Loop_Optimization7 is
diff --git a/gcc/testsuite/gnat.dg/modular3.adb b/gcc/testsuite/gnat.dg/modular3.adb
new file mode 100644
index 00000000000..539edcaf4d4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/modular3.adb
@@ -0,0 +1,32 @@
+-- { dg-do run }
+
+with Modular3_Pkg; use Modular3_Pkg;
+
+procedure Modular3 is
+
+ function F1 (A : Int16_T) return Int16_T is
+ begin
+ return A + 128;
+ end;
+
+ function F2 (B : Mod16_T) return Mod16_T is
+ begin
+ return B + 128;
+ end;
+
+ A : Int16_T := 16384;
+ B : Mod16_T := 65504;
+
+begin
+
+ A := F1 (A);
+ if A /= 16512 then
+ raise Program_Error;
+ end if;
+
+ B := F2 (B);
+ if B /= 96 then
+ raise Program_Error;
+ end if;
+
+end Modular3;
diff --git a/gcc/testsuite/gnat.dg/modular3_pkg.ads b/gcc/testsuite/gnat.dg/modular3_pkg.ads
new file mode 100644
index 00000000000..85cf6a8bfaa
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/modular3_pkg.ads
@@ -0,0 +1,11 @@
+package Modular3_Pkg is
+
+ type Int16_T is range -32768 .. 32767;
+ for Int16_T'Size use 16;
+ for Int16_T'Alignment use 1;
+
+ type Mod16_T is mod 2 ** 16;
+ for Mod16_T'Size use 16;
+ for Mod16_T'Alignment use 1;
+
+end Modular3_Pkg;
diff --git a/gcc/testsuite/gnat.dg/noreturn1.adb b/gcc/testsuite/gnat.dg/noreturn1.adb
index 83eafe7f364..f854e662be3 100644
--- a/gcc/testsuite/gnat.dg/noreturn1.adb
+++ b/gcc/testsuite/gnat.dg/noreturn1.adb
@@ -1,4 +1,4 @@
--- { dg-compile }
+-- { dg-do compile }
package body Noreturn1 is
diff --git a/gcc/testsuite/gnat.dg/specs/small_alignment.ads b/gcc/testsuite/gnat.dg/specs/small_alignment.ads
index 318148d1a68..fbedf47d131 100644
--- a/gcc/testsuite/gnat.dg/specs/small_alignment.ads
+++ b/gcc/testsuite/gnat.dg/specs/small_alignment.ads
@@ -1,4 +1,4 @@
--- { dg-compile }
+-- { dg-do compile }
package Small_Alignment is
diff --git a/gcc/testsuite/gnat.dg/sse_nolib.adb b/gcc/testsuite/gnat.dg/sse_nolib.adb
index b024a216e94..d678b9a868b 100644
--- a/gcc/testsuite/gnat.dg/sse_nolib.adb
+++ b/gcc/testsuite/gnat.dg/sse_nolib.adb
@@ -1,5 +1,6 @@
-- { dg-do run { target i?86-*-* x86_64-*-* } }
-- { dg-options "-O1 -msse" }
+-- { dg-require-effective-target sse }
with Ada.Unchecked_Conversion;
diff --git a/gcc/testsuite/gnat.dg/unchecked_convert5b.adb b/gcc/testsuite/gnat.dg/unchecked_convert5b.adb
new file mode 100644
index 00000000000..5232041c0d8
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/unchecked_convert5b.adb
@@ -0,0 +1,22 @@
+-- { dg-do run { target i?86-*-* x86_64-*-* alpha*-*-* ia64-*-* } }
+
+with Unchecked_Conversion;
+
+procedure Unchecked_Convert5b is
+
+ subtype c_1 is string(1..1);
+
+ function int2c1 is -- { dg-warning "different sizes" }
+ new unchecked_conversion (source => integer, target => c_1);
+
+ c1 : c_1;
+
+begin
+
+ c1 := int2c1(16#12#);
+
+ if c1 (1) /= ASCII.DC2 then
+ raise Program_Error;
+ end if;
+
+end;
diff --git a/gcc/testsuite/gnat.dg/unchecked_convert6.adb b/gcc/testsuite/gnat.dg/unchecked_convert6.adb
new file mode 100644
index 00000000000..a26a6a9b762
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/unchecked_convert6.adb
@@ -0,0 +1,22 @@
+-- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
+
+with Unchecked_Conversion;
+
+procedure Unchecked_Convert6 is
+
+ subtype c_5 is string(1..5);
+
+ function int2c5 is -- { dg-warning "different sizes" }
+ new unchecked_conversion (source => integer, target => c_5);
+
+ c5 : c_5;
+
+begin
+
+ c5 := int2c5(16#12#);
+
+ if c5 (4) /= ASCII.DC2 then
+ raise Program_Error;
+ end if;
+
+end;
diff --git a/gcc/testsuite/gnat.dg/unchecked_convert6b.adb b/gcc/testsuite/gnat.dg/unchecked_convert6b.adb
new file mode 100644
index 00000000000..d696f7d5f09
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/unchecked_convert6b.adb
@@ -0,0 +1,22 @@
+-- { dg-do run { target i?86-*-* x86_64-*-* alpha*-*-* ia64-*-* } }
+
+with Unchecked_Conversion;
+
+procedure Unchecked_Convert6b is
+
+ subtype c_5 is string(1..5);
+
+ function int2c5 is -- { dg-warning "different sizes" }
+ new unchecked_conversion (source => integer, target => c_5);
+
+ c5 : c_5;
+
+begin
+
+ c5 := int2c5(16#12#);
+
+ if c5 (1) /= ASCII.DC2 then
+ raise Program_Error;
+ end if;
+
+end;
diff --git a/gcc/testsuite/lib/fortran-torture.exp b/gcc/testsuite/lib/fortran-torture.exp
index 72ce9d682cd..cd24ace426f 100644
--- a/gcc/testsuite/lib/fortran-torture.exp
+++ b/gcc/testsuite/lib/fortran-torture.exp
@@ -46,7 +46,8 @@ proc get-fortran-torture-options { } {
set test_tree_vectorize 1
} elseif { ( [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] )
&& [check_effective_target_sse2]
- && [check_sse2_hw_available] } {
+ && [check_sse2_hw_available]
+ && [check_sse_os_support_available] } {
lappend vectorizer_options "-msse2"
set test_tree_vectorize 1
} elseif { [istarget "mips*-*-*"]
diff --git a/gcc/testsuite/lib/objc-torture.exp b/gcc/testsuite/lib/objc-torture.exp
index a3d1ef2446e..d3207a466ac 100644
--- a/gcc/testsuite/lib/objc-torture.exp
+++ b/gcc/testsuite/lib/objc-torture.exp
@@ -23,17 +23,24 @@ load_lib target-supports.exp
# Make sure that the runtime list is re-evaluated for each multilib.
proc objc-set-runtime-options { dowhat args } {
global OBJC_RUNTIME_OPTIONS
- if ![info exists OBJC_RUNTIME_OPTIONS] {
- set rtlist [list "-fgnu-runtime" "-fnext-runtime" ]
- } else {
- set rtlist [list "-fgnu-runtime" "-fnext-runtime" ]
- foreach other $OBJC_RUNTIME_OPTIONS {
- # Don't do tests twice...
- if { ( $other == "-fnext-runtime" || $other == "-fgnu-runtime" ) } {
- continue
- }
- lappend rtlist $other
+ set rtlist [list "-fgnu-runtime" ]
+ # At present (4.6), the only NeXT runtime target is Darwin.
+ # The previously used approach of testing trivial compiles is not reliable
+ # for determining the absence of the NeXT runtime, since a non-Darwin
+ # installation can have the objc headers present in the same locations
+ # that Darwin uses. If NeXT is ported to another target, then it should
+ # be listed here.
+ if [istarget "*-*-darwin*" ] {
+ lappend rtlist "-fnext-runtime"
+ }
+ if [info exists OBJC_RUNTIME_OPTIONS] {
+ foreach other $OBJC_RUNTIME_OPTIONS {
+ # Don't do tests twice...
+ if { ( $other == "-fnext-runtime" || $other == "-fgnu-runtime" ) } {
+ continue
}
+ lappend rtlist $other
+ }
}
set OBJC_RUNTIME_OPTIONS ""
@@ -49,8 +56,10 @@ proc objc-set-runtime-options { dowhat args } {
if [info exists dowhat] {
switch $dowhat {
"compile" {
- set compile_type "assembly"
- set output_file "trivial.s"
+ # We should check that the generated asm is sensible, so do
+ # the equivalent of -c.
+ set compile_type "object"
+ set output_file "trivial.o"
set comp_output [objc_target_compile \
"$srcdir/$subdir/trivial.m" "$output_file" "$compile_type" $options]
diff --git a/gcc/testsuite/lib/plugin-support.exp b/gcc/testsuite/lib/plugin-support.exp
index fe4526549b3..9444f52662b 100644
--- a/gcc/testsuite/lib/plugin-support.exp
+++ b/gcc/testsuite/lib/plugin-support.exp
@@ -84,7 +84,7 @@ proc plugin-test-execute { plugin_src plugin_tests } {
set gcc_objdir "$objdir/../../.."
set includes "-I. -I${srcdir} -I${gcc_srcdir}/gcc -I${gcc_objdir}/gcc \
-I${gcc_srcdir}/include -I${gcc_srcdir}/libcpp/include \
- $GMPINC"
+ $GMPINC -I${gcc_objdir}/intl"
set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared"
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index abc01b7cc55..20aed864ce0 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -291,3 +291,40 @@ proc scan-assembler-dem-not { args } {
fail "$testcase scan-assembler-dem-not $pp_pattern"
}
}
+
+# Utility for testing that a function is defined on the current line.
+# Call pass if so, otherwise fail. Invoked directly; the file must
+# have been compiled with -g -dA.
+#
+# Argument 0 is the current line, passed implicitly by dejagnu
+# Argument 1 is the function to check
+# Argument 2 handles expected failures and the like
+# Argument 3 is "." to match the current line, or an integer to match
+# an explicit line.
+proc dg-function-on-line { args } {
+ # Upvar from dg-final:
+ upvar dg-final-code final-code
+
+ set line [lindex $args 0]
+ set symbol [lindex $args 1]
+ set failures [lindex $args 2]
+
+ if { [llength $args] >= 4 } {
+ switch [lindex $args 3] {
+ "." { }
+ "default" { set line [lindex $args 3] }
+ }
+ }
+
+ set pattern [format {%s:[^\t]*(\t.file[^\t]*)?\t[^:]+:%d\n} \
+ $symbol $line]
+
+ # The lack of spaces around $pattern is important, since they'd
+ # become part of the regex scan-assembler tries to match.
+ set cmd "scan-assembler {$pattern}"
+ if { [llength $args] >= 3 } {
+ set cmd "$cmd {$failures}"
+ }
+
+ append final-code "$cmd\n"
+}
diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp
index e742d750c76..02f0bc19f57 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -207,6 +207,14 @@ proc dg-require-host-local { args } {
}
}
+proc dg-require-linker-plugin { args } {
+ set linker_plugin_available [ check_linker_plugin_available ]
+ if { $linker_plugin_available == 0 } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ }
+}
+
# Add any target-specific flags needed for accessing the given list
# of features. This must come after all dg-options.
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 1cdc53b4983..b3123442837 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -569,6 +569,24 @@ proc check_effective_target_pcc_bitfield_type_matters { } {
}]
}
+# Add to FLAGS all the target-specific flags needed to use thread-local storage.
+
+proc add_options_for_tls { flags } {
+ # On Solaris 8 and 9, __tls_get_addr/___tls_get_addr only lives in
+ # libthread, so always pass -pthread for native TLS.
+ # Need to duplicate native TLS check from
+ # check_effective_target_tls_native to avoid recursion.
+ if { [istarget *-*-solaris2.\[89\]*] &&
+ [check_no_messages_and_pattern tls_native "!emutls" assembly {
+ __thread int i;
+ int f (void) { return i; }
+ void g (int j) { i = j; }
+ }] } {
+ return "$flags -pthread"
+ }
+ return $flags
+}
+
# Return 1 if thread local storage (TLS) is supported, 0 otherwise.
proc check_effective_target_tls {} {
@@ -886,6 +904,12 @@ proc check_effective_target_static_libgfortran { } {
} "-static"]
}
+proc check_linker_plugin_available { } {
+ return [check_no_compiler_messages_nocache linker_plugin executable {
+ int main() { return 0; }
+ } "-flto -fuse-linker-plugin"]
+}
+
# Return 1 if the target supports executing 750CL paired-single instructions, 0
# otherwise. Cache the result.
@@ -910,6 +934,53 @@ proc check_750cl_hw_available { } {
}]
}
+# Return 1 if the target OS supports running SSE executables, 0
+# otherwise. Cache the result.
+
+proc check_sse_os_support_available { } {
+ return [check_cached_effective_target sse_os_support_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+ expr 0
+ } elseif { [istarget i?86-*-solaris2*] } {
+ # The Solaris 2 kernel doesn't save and restore SSE registers
+ # before Solaris 9 4/04. Before that, executables die with SIGILL.
+ check_runtime_nocache sse_os_support_available {
+ int main ()
+ {
+ __asm__ volatile ("movss %xmm2,%xmm1");
+ return 0;
+ }
+ } "-msse"
+ } else {
+ expr 1
+ }
+ }]
+}
+
+# Return 1 if the target supports executing SSE instructions, 0
+# otherwise. Cache the result.
+
+proc check_sse_hw_available { } {
+ return [check_cached_effective_target sse_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+ expr 0
+ } else {
+ check_runtime_nocache sse_hw_available {
+ #include "cpuid.h"
+ int main ()
+ {
+ unsigned int eax, ebx, ecx, edx;
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return !(edx & bit_SSE);
+ return 1;
+ }
+ } ""
+ }
+ }]
+}
+
# Return 1 if the target supports executing SSE2 instructions, 0
# otherwise. Cache the result.
@@ -923,7 +994,7 @@ proc check_sse2_hw_available { } {
#include "cpuid.h"
int main ()
{
- unsigned int eax, ebx, ecx, edx = 0;
+ unsigned int eax, ebx, ecx, edx;
if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
return !(edx & bit_SSE2);
return 1;
@@ -933,6 +1004,62 @@ proc check_sse2_hw_available { } {
}]
}
+# Return 1 if the target supports executing AVX instructions, 0
+# otherwise. Cache the result.
+
+proc check_avx_hw_available { } {
+ return [check_cached_effective_target avx_hw_available {
+ # If this is not the right target then we can skip the test.
+ if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+ expr 0
+ } else {
+ check_runtime_nocache avx_hw_available {
+ #include "cpuid.h"
+ int main ()
+ {
+ unsigned int eax, ebx, ecx, edx;
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return ((ecx & (bit_AVX | bit_OSXSAVE))
+ != (bit_AVX | bit_OSXSAVE));
+ return 1;
+ }
+ } ""
+ }
+ }]
+}
+
+# Return 1 if the target supports running SSE executables, 0 otherwise.
+
+proc check_effective_target_sse_runtime { } {
+ if { [check_effective_target_sse]
+ && [check_sse_hw_available]
+ && [check_sse_os_support_available] } {
+ return 1
+ }
+ return 0
+}
+
+# Return 1 if the target supports running SSE2 executables, 0 otherwise.
+
+proc check_effective_target_sse2_runtime { } {
+ if { [check_effective_target_sse2]
+ && [check_sse2_hw_available]
+ && [check_sse_os_support_available] } {
+ return 1
+ }
+ return 0
+}
+
+# Return 1 if the target supports running AVX executables, 0 otherwise.
+
+proc check_effective_target_avx_runtime { } {
+ if { [check_effective_target_avx]
+ && [check_avx_hw_available] } {
+ return 1
+ }
+ return 0
+}
+
# Return 1 if the target supports executing VSX instructions, 0
# otherwise. Cache the result.
@@ -3261,6 +3388,17 @@ proc check_effective_target_avx { } {
} "-O2 -mavx" ]
}
+# Return 1 if sse instructions can be compiled.
+proc check_effective_target_sse { } {
+ return [check_no_compiler_messages sse object {
+ int main ()
+ {
+ __builtin_ia32_stmxcsr ();
+ return 0;
+ }
+ } "-O2 -msse" ]
+}
+
# Return 1 if sse2 instructions can be compiled.
proc check_effective_target_sse2 { } {
return [check_no_compiler_messages sse2 object {
@@ -3273,6 +3411,19 @@ proc check_effective_target_sse2 { } {
} "-O2 -msse2" ]
}
+# Return 1 if F16C instructions can be compiled.
+
+proc check_effective_target_f16c { } {
+ return [check_no_compiler_messages f16c object {
+ #include "immintrin.h"
+ float
+ foo (unsigned short val)
+ {
+ return _cvtsh_ss (val);
+ }
+ } "-O2 -mf16c" ]
+}
+
# Return 1 if C wchar_t type is compatible with char16_t.
proc check_effective_target_wchar_t_char16_t_compatible { } {
diff --git a/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm b/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
index a3c4b0c492a..e94e6ec57a2 100644
--- a/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
+++ b/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
@@ -1,13 +1,12 @@
// Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata.
// { dg-do run { target *-*-darwin* } }
-// { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
-// { dg-options "-fobjc-call-cxx-cdtors" }
-// { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } }
-
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
+// { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
+// { dg-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4" }
+// This test has no equivalent or meaning for m64/ABI V2
+// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } }
+#include <objc/objc-runtime.h>
#include <stdlib.h>
#define CHECK_IF(expr) if(!(expr)) abort()
@@ -39,18 +38,17 @@ struct cxx_struct {
int main (void)
{
+#ifndef __LP64__
Class cls;
- cls = objc_get_class("Foo");
-#if NEXT_OBJC_USE_NEW_INTERFACE
- CHECK_IF(class_isMetaClass(cls) & CLS_HAS_CXX_STRUCTORS);
- cls = objc_getClass("Bar");
- CHECK_IF(!(class_isMetaClass(cls) & CLS_HAS_CXX_STRUCTORS));
-#else
+ cls = objc_getClass("Foo");
CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS);
cls = objc_getClass("Bar");
CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS));
+
+#else
+ /* No test needed or available. */
+ abort ();
#endif
return 0;
}
-#include "../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/obj-c++.dg/encode-2.mm b/gcc/testsuite/obj-c++.dg/encode-2.mm
index cfa9bc783e3..157bb526700 100644
--- a/gcc/testsuite/obj-c++.dg/encode-2.mm
+++ b/gcc/testsuite/obj-c++.dg/encode-2.mm
@@ -1,4 +1,5 @@
-/* { dg-do compile } */
+/* { dg-do assemble } */
+/* { dg-options "-save-temps" } */
template <class T>
struct Vec {
@@ -11,7 +12,7 @@ typedef struct {
Vec<float> fvec;
float fscalar;
double dscalar;
- Vec<char> chVec;
+ Vec<signed char> chVec;
int iscalar;
} anonymous;
@@ -23,4 +24,5 @@ const char *enc3 = @encode(anonymous);
/* { dg-final { scan-assembler "{Vec<float>=ffi}" } } */
/* { dg-final { scan-assembler "{Vec<double>=ddi}" } } */
-/* { dg-final { scan-assembler "{?={Vec<double>=ddi}{Vec<float>=ffi}fd{Vec<char>=cci}i}" } } */
+/* { dg-final { scan-file "encode-2.o" "{?={Vec<double>=ddi}{Vec<float>=ffi}fd{Vec<signed char>=cci}i}" } }
+/* { dg-final cleanup-saved-temps } */
diff --git a/gcc/testsuite/obj-c++.dg/encode-3.mm b/gcc/testsuite/obj-c++.dg/encode-3.mm
index 05193ae2c2f..8627a773e25 100644
--- a/gcc/testsuite/obj-c++.dg/encode-3.mm
+++ b/gcc/testsuite/obj-c++.dg/encode-3.mm
@@ -18,7 +18,7 @@ typedef struct {
int iscalar;
long z;
long long zz;
- Vec<const char> cv;
+ Vec<const signed char> cv;
} anonymous;
//Vec<double> dd;
@@ -44,7 +44,7 @@ int main(void) {
if (strcmp (enc2, "{Vec<double>=dd" L "q}"))
_exit(-(__LINE__));
- if (strcmp (enc3, "{?=f[10d]i" L "q{Vec<const char>=rcrc" L "q}}"))
+ if (strcmp (enc3, "{?=f[10d]i" L "q{Vec<const signed char>=rcrc" L "q}}"))
_exit(-(__LINE__));
return 0;
diff --git a/gcc/testsuite/obj-c++.dg/lto/lto.exp b/gcc/testsuite/obj-c++.dg/lto/lto.exp
new file mode 100644
index 00000000000..291895ffc01
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/lto/lto.exp
@@ -0,0 +1,84 @@
+# Copyright (C) 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Based on gcc/testsuite/gcc.dg/lto/lto.exp.
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib obj-c++-dg.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+global LTO_OPTIONS
+
+set LTO_OPTIONS [list \
+ {-O0 -fwhopr -fgnu-runtime} \
+ {-O2 -fwhopr -fgnu-runtime} \
+ {-O0 -flto -fgnu-runtime} \
+ {-O2 -flto -fgnu-runtime} \
+]
+
+obj-c++_init
+lto_init no-mathlib
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "obj_cpp_lto"
+set tests [lsort [glob -nocomplain $srcdir/$subdir/*_0.mm]]
+
+# Main loop.
+foreach src $tests {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+ lto-execute $src $sid
+}
+
+# darwin targets can also run code with the NeXT runtime.
+if [istarget "*-*-darwin*" ] {
+set LTO_OPTIONS [list \
+ {-O0 -fwhopr -fnext-runtime} \
+ {-O2 -fwhopr -fnext-runtime} \
+ {-O0 -flto -fnext-runtime} \
+ {-O2 -flto -fnext-runtime} \
+]
+ foreach src $tests {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+ lto-execute $src $sid
+ }
+}
+
+lto_finish
diff --git a/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm b/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm
new file mode 100644
index 00000000000..45b6e702481
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm
@@ -0,0 +1,43 @@
+/* { dg-lto-do run } */
+/* { dg-skip-if "Needs OBJC2 ABI" { "*-*-darwin*" && lp64 } { "*" } { "" } } */
+extern "C" {
+extern int printf (char *,...) ;
+extern void abort (void) ;
+}
+
+typedef struct objc_class *Class;
+
+struct objc_class {
+ Class isa;
+ /* other stuff... */
+} ;
+
+@interface myRootObject {
+@public
+ Class isa;
+}
++initialize;
++(Class)class;
+
+@end
+
+@implementation myRootObject
++initialize {
+ return self;
+}
+
++(Class)class {
+ return (Class)self;
+}
+
+@end
+
+int main(void)
+{
+ Class cl = [myRootObject class];
+ if (cl != (Class)0) {
+ printf((char *)"trivial OK\n");
+ return 0;
+ }
+ abort () ;
+}
diff --git a/gcc/testsuite/obj-c++.dg/tls/static-1.mm b/gcc/testsuite/obj-c++.dg/tls/static-1.mm
index 2d20b8881f9..6d58010eb0c 100644
--- a/gcc/testsuite/obj-c++.dg/tls/static-1.mm
+++ b/gcc/testsuite/obj-c++.dg/tls/static-1.mm
@@ -1,5 +1,6 @@
// { dg-do run }
// { dg-require-effective-target tls }
+// { dg-add-options tls }
// { dg-additional-sources "static-1a.mm" }
extern "C" {
diff --git a/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm b/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm
index 056073789a5..1ec8623f3ee 100644
--- a/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm
+++ b/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-1.mm
@@ -1,5 +1,6 @@
// { dg-do run }
// { dg-require-effective-target tls }
+// { dg-add-options tls }
/* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
extern "C" {
extern void abort ();
diff --git a/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm b/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm
index 233cf20e132..4e5baac790d 100644
--- a/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm
+++ b/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-2.mm
@@ -1,5 +1,6 @@
// { dg-do run }
// { dg-require-effective-target tls }
+// { dg-add-options tls }
/* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
extern "C" {
@@ -42,4 +43,4 @@ int main (int ac, char *av[])
abort () ;
return 0;
-} \ No newline at end of file
+}
diff --git a/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm b/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm
index e106a9fe878..1515d250057 100644
--- a/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm
+++ b/gcc/testsuite/obj-c++.dg/torture/tls/thr-init-3.mm
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target tls } */
+/* { dg-add-options tls } */
/* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.mm" } */
diff --git a/gcc/testsuite/objc-obj-c++-shared/Object1.h b/gcc/testsuite/objc-obj-c++-shared/Object1.h
index 3c7dd9aed72..324b6807cf3 100644
--- a/gcc/testsuite/objc-obj-c++-shared/Object1.h
+++ b/gcc/testsuite/objc-obj-c++-shared/Object1.h
@@ -1 +1,150 @@
-/* Object definition taken from <objc/Object.h> */ #ifndef _OBJC_OBJECT1_H_ #define _OBJC_OBJECT1_H_ #undef DO_NEXT_M64_OBJECT_IMPLEMENTATION #ifndef __NEXT_RUNTIME__ # include <objc/Object.h> #else # include "next-abi.h" # ifndef NEXT_OBJC_USE_NEW_INTERFACE /* We are on a next system, or version, that is happy to compile V0 ABI */ # include <objc/Object.h> # else # if (NEXT_OBJC_ABI_VERSION==0) /* We are on a system that has V0 ABI implementation in libobjc.dylib. * However, we need to use the new accessors and pretend that the * structures are opaque to avoid 'deprecated' warnings */ # include <objc/Object.h> # else /* We are on a system that includes a V2 ABI Object in libobjc.dylib. */ # ifdef __OBJC2__ /* ... and we have a V2 ABI compiler .. */ # include <objc/Object.h> # else /* We can't access the Object definition in libobjc.dylib because * we can't yet generate OBJC2 code. * * So we'll roll our own Object - purely for the sake of compile * checks - the code is unlikely to run... */ # ifndef _OBJC_OBJECT_H_ # define _OBJC_OBJECT_H_ #include <stdarg.h> #import <objc/objc-runtime.h> /* This is a cut-down Object with only the methods currently required by the testsuite declared. For those executables that require an implementation (to link) this can be provided in a given test by placing: #include "path/to/objc-c++shared/Object1-implementation.h" at the end of the source for the test. */ @interface Object { Class isa; /* A pointer to the instance's class structure */ } + initialize; - init; + new; + free; - free; + alloc; //- copy; //+ allocFromZone:(void *)zone; //- copyFromZone:(void *)zone; //- (void *)zone; + class; //+ superclass; //+ (const char *) name; - class; - superclass; - (const char *) name; //- self; //- (unsigned int) hash; //-(BOOL) isEqual:anObject; /* Testing inheritance relationships */ //- (BOOL) isKindOf: aClassObject; //- (BOOL) isMemberOf: aClassObject; //- (BOOL) isKindOfClassNamed: (const char *)aClassName; //- (BOOL) isMemberOfClassNamed: (const char *)aClassName; /* Testing class functionality */ //+ (BOOL) instancesRespondTo:(SEL)aSelector; //- (BOOL) respondsTo:(SEL)aSelector; /* Testing protocol conformance */ - (BOOL) conformsTo: (Protocol *)aProtocolObject; //+ (BOOL) conformsTo: (Protocol *)aProtocolObject; /* Obtaining method descriptors from protocols */ //- (struct objc_method_description *) descriptionForMethod:(SEL)aSel; //+ (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel; /* Obtaining method handles */ //- (IMP) methodFor:(SEL)aSelector; //+ (IMP) instanceMethodFor:(SEL)aSelector; /* Sending messages determined at run time */ //- perform:(SEL)aSelector; //- perform:(SEL)aSelector with:anObject; //- perform:(SEL)aSelector with:object1 with:object2; /* Posing */ //+ poseAs: aClassObject; /* Enforcing intentions */ //- subclassResponsibility:(SEL)aSelector; //- notImplemented:(SEL)aSelector; /* Error handling */ //- doesNotRecognize:(SEL)aSelector; //- error:(const char *)aString, ...; /* Debugging */ //- (void) printForDebugger:(void *)stream; /* Archiving */ //- awake; //- write:(void *)stream; //- read:(void *)stream; //+ (int) version; //+ setVersion: (int) aVersion; /* Forwarding */ //- forward: (SEL)sel : (marg_list)args; //- performv: (SEL)sel : (marg_list)args; @end #define DO_NEXT_M64_OBJECT_IMPLEMENTATION # endif /* _OBJC_OBJECT_H_ */ # endif /* __OBJC2__ */ # endif /* ABI=0 */ # endif /* NEXT_OBJC_USE_NEW_INTERFACE */ # endif /* __NEXT_RUNTIME__ */ #endif /* _OBJC_OBJECT1_H_ */ \ No newline at end of file
+/* Object definition taken from <objc/Object.h>
+ */
+#ifndef _OBJC_OBJECT1_H_
+#define _OBJC_OBJECT1_H_
+
+#undef DO_NEXT_M64_OBJECT_IMPLEMENTATION
+
+#ifndef __NEXT_RUNTIME__
+# include <objc/Object.h>
+#else
+# include "next-abi.h"
+# ifndef NEXT_OBJC_USE_NEW_INTERFACE
+/* We are on a next system, or version, that is happy to compile V0 ABI */
+# include <objc/Object.h>
+# else
+# if (NEXT_OBJC_ABI_VERSION==0)
+/* We are on a system that has V0 ABI implementation in libobjc.dylib.
+ * However, we need to use the new accessors and pretend that the
+ * structures are opaque to avoid 'deprecated' warnings
+ */
+# include <objc/Object.h>
+# else
+/* We are on a system that includes a V2 ABI Object in libobjc.dylib.
+*/
+# ifdef __OBJC2__
+/* ... and we have a V2 ABI compiler .. */
+# include <objc/Object.h>
+# else
+/* We can't access the Object definition in libobjc.dylib because
+ * we can't yet generate OBJC2 code.
+ *
+ * So we'll roll our own Object - purely for the sake of compile
+ * checks - the code is unlikely to run...
+*/
+# ifndef _OBJC_OBJECT_H_
+# define _OBJC_OBJECT_H_
+
+#include <stdarg.h>
+#import <objc/objc-runtime.h>
+
+/* This is a cut-down Object with only the methods currently required
+ by the testsuite declared.
+
+ For those executables that require an implementation (to link) this
+ can be provided in a given test by placing:
+ #include "path/to/objc-c++shared/Object1-implementation.h"
+ at the end of the source for the test.
+*/
+
+@interface Object
+{
+ Class isa; /* A pointer to the instance's class structure */
+}
++ initialize;
+- init;
+
++ new;
++ free;
+- free;
++ alloc;
+//- copy;
+//+ allocFromZone:(void *)zone;
+//- copyFromZone:(void *)zone;
+//- (void *)zone;
+
++ class;
+//+ superclass;
+//+ (const char *) name;
+- class;
+- superclass;
+- (const char *) name;
+
+//- self;
+//- (unsigned int) hash;
+//-(BOOL) isEqual:anObject;
+
+/* Testing inheritance relationships */
+
+//- (BOOL) isKindOf: aClassObject;
+//- (BOOL) isMemberOf: aClassObject;
+//- (BOOL) isKindOfClassNamed: (const char *)aClassName;
+//- (BOOL) isMemberOfClassNamed: (const char *)aClassName;
+
+/* Testing class functionality */
+
+//+ (BOOL) instancesRespondTo:(SEL)aSelector;
+//- (BOOL) respondsTo:(SEL)aSelector;
+
+/* Testing protocol conformance */
+
+- (BOOL) conformsTo: (Protocol *)aProtocolObject;
+//+ (BOOL) conformsTo: (Protocol *)aProtocolObject;
+
+/* Obtaining method descriptors from protocols */
+
+//- (struct objc_method_description *) descriptionForMethod:(SEL)aSel;
+//+ (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
+
+/* Obtaining method handles */
+
+//- (IMP) methodFor:(SEL)aSelector;
+//+ (IMP) instanceMethodFor:(SEL)aSelector;
+
+/* Sending messages determined at run time */
+
+//- perform:(SEL)aSelector;
+//- perform:(SEL)aSelector with:anObject;
+//- perform:(SEL)aSelector with:object1 with:object2;
+
+/* Posing */
+
+//+ poseAs: aClassObject;
+
+/* Enforcing intentions */
+
+//- subclassResponsibility:(SEL)aSelector;
+//- notImplemented:(SEL)aSelector;
+
+/* Error handling */
+
+//- doesNotRecognize:(SEL)aSelector;
+//- error:(const char *)aString, ...;
+
+/* Debugging */
+
+//- (void) printForDebugger:(void *)stream;
+
+/* Archiving */
+
+//- awake;
+//- write:(void *)stream;
+//- read:(void *)stream;
+//+ (int) version;
+//+ setVersion: (int) aVersion;
+
+/* Forwarding */
+
+//- forward: (SEL)sel : (marg_list)args;
+//- performv: (SEL)sel : (marg_list)args;
+
+@end
+
+#define DO_NEXT_M64_OBJECT_IMPLEMENTATION
+
+# endif /* _OBJC_OBJECT_H_ */
+# endif /* __OBJC2__ */
+# endif /* ABI=0 */
+# endif /* NEXT_OBJC_USE_NEW_INTERFACE */
+# endif /* __NEXT_RUNTIME__ */
+#endif /* _OBJC_OBJECT1_H_ */
diff --git a/gcc/testsuite/objc-obj-c++-shared/next-abi.h b/gcc/testsuite/objc-obj-c++-shared/next-abi.h
index 21a49d341e1..3ab9804e510 100644
--- a/gcc/testsuite/objc-obj-c++-shared/next-abi.h
+++ b/gcc/testsuite/objc-obj-c++-shared/next-abi.h
@@ -19,7 +19,7 @@
#undef NEXT_OBJC_USE_NEW_INTERFACE
#ifdef __NEXT_RUNTIME__
-# if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 || __OBJC2__)
+# if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 || __OBJC2__)
/* We have to use an updated interface for 32bit NeXT to avoid
* 'deprecated' warnings.
* For 64bit NeXT the ABI is different (and the interfaces 'deprecated'
@@ -36,7 +36,10 @@
*/
# define NEXT_OBJC_ABI_VERSION 0
# endif
-# endif
-#endif
+# else
+ /* Pre-OSX 10.5 all is ABI 0. */
+# define NEXT_OBJC_ABI_VERSION 0
+# endif /* MAC_OS_X_VERSION_MIN_REQUIRED > 10.5 or OBJC2 */
+#endif /* __NEXT_RUNTIME__ */
#endif /* _OBJC_NEXT_ABI_H_ */
diff --git a/gcc/testsuite/objc.dg/image-info.m b/gcc/testsuite/objc.dg/image-info.m
index 0a740fa31f1..e9e9de68906 100644
--- a/gcc/testsuite/objc.dg/image-info.m
+++ b/gcc/testsuite/objc.dg/image-info.m
@@ -4,6 +4,7 @@
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile { target { *-*-darwin* } } } */
+/* { dg-skip-if "NeXT-only" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-options "-freplace-objc-classes" } */
#include "../objc-obj-c++-shared/Object1.h"
diff --git a/gcc/testsuite/objc.dg/lto/lto.exp b/gcc/testsuite/objc.dg/lto/lto.exp
new file mode 100644
index 00000000000..4ea89cced6c
--- /dev/null
+++ b/gcc/testsuite/objc.dg/lto/lto.exp
@@ -0,0 +1,84 @@
+# Copyright (C) 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Based on gcc/testsuite/gcc.dg/lto/lto.exp.
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib objc-dg.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+global LTO_OPTIONS
+
+set LTO_OPTIONS [list \
+ {-O0 -fwhopr -fgnu-runtime} \
+ {-O2 -fwhopr -fgnu-runtime} \
+ {-O0 -flto -fgnu-runtime} \
+ {-O2 -flto -fgnu-runtime} \
+]
+
+objc_init
+lto_init no-mathlib
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "objc_lto"
+set tests [lsort [glob -nocomplain $srcdir/$subdir/*_0.m]]
+
+# Main loop.
+foreach src $tests {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+ lto-execute $src $sid
+}
+
+# darwin targets can also run code with the NeXT runtime.
+if [istarget "*-*-darwin*" ] {
+set LTO_OPTIONS [list \
+ {-O0 -fwhopr -fnext-runtime} \
+ {-O2 -fwhopr -fnext-runtime} \
+ {-O0 -flto -fnext-runtime} \
+ {-O2 -flto -fnext-runtime} \
+]
+ foreach src $tests {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+ lto-execute $src $sid
+ }
+}
+
+lto_finish
diff --git a/gcc/testsuite/objc.dg/lto/trivial-1_0.m b/gcc/testsuite/objc.dg/lto/trivial-1_0.m
new file mode 100644
index 00000000000..076f2306c1b
--- /dev/null
+++ b/gcc/testsuite/objc.dg/lto/trivial-1_0.m
@@ -0,0 +1,37 @@
+/* { dg-lto-do run } */
+/* { dg-skip-if "" { "*-*-darwin*" && lp64 } { "*" } { "" } } */
+extern int printf (char *,...) ;
+
+typedef struct objc_class *Class;
+
+struct objc_class {
+ Class isa;
+ /* other stuff... */
+} ;
+
+@interface myRootObject {
+@public
+ Class isa;
+}
++initialize;
++(Class)class;
+
+@end
+
+@implementation myRootObject
++initialize {
+ return self;
+}
+
++(Class)class {
+ return (Class)self;
+}
+
+@end
+
+int main(void)
+{
+ [myRootObject class];
+ printf("trivial OK\n");
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/symtab-1.m b/gcc/testsuite/objc.dg/symtab-1.m
index 90a79691721..100b245325e 100644
--- a/gcc/testsuite/objc.dg/symtab-1.m
+++ b/gcc/testsuite/objc.dg/symtab-1.m
@@ -22,6 +22,7 @@
-(void)checkValues { }
@end
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.word\t2\n\t.word\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { i?86-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { powerpc-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.quad\t0\n\t.long\t0\n\t.space 4\n\t.word\t2\n\t.word\t0\n\t.space 4\n\t.quad\tL_OBJC_CLASS_Derived.*\n\t.quad\tL_OBJC_CLASS_Base.*\n" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.word\t2\n\t.word\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { *86*-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { powerpc*-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.quad\t0\n\t.quad\t0\n\t.word\t2\n\t.word\t0\n\t.space 4\n\t.quad\tL_OBJC_CLASS_Derived.*\n\t.quad\tL_OBJC_CLASS_Base.*\n" { target { *86*-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.quad\t0\n\t.quad\t0\n\t.short\t2\n\t.short\t0\n\t.space 4\n\t.quad\tL_OBJC_CLASS_Derived.*\n\t.quad\tL_OBJC_CLASS_Base.*\n" { target { powerpc*-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m b/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m
index b637e2544e6..9a946bb444d 100644
--- a/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m
+++ b/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m
@@ -1,5 +1,6 @@
// { dg-do run }
// { dg-require-effective-target tls }
+// { dg-add-options tls }
/* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
extern void _exit(int);
diff --git a/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m b/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m
index f30315d8819..6ac977c9bae 100644
--- a/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m
+++ b/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target tls } */
+/* { dg-add-options tls } */
/* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */
diff --git a/gcc/testsuite/objc.dg/torture/tls/thr-init.m b/gcc/testsuite/objc.dg/torture/tls/thr-init.m
index 6c3bad1b9bb..286a4706f06 100644
--- a/gcc/testsuite/objc.dg/torture/tls/thr-init.m
+++ b/gcc/testsuite/objc.dg/torture/tls/thr-init.m
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target tls } */
+/* { dg-add-options tls } */
/* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
extern void _exit(int);
diff --git a/gcc/testsuite/objc/execute/forward-1.m b/gcc/testsuite/objc/execute/forward-1.m
index c20f8c4934f..258a9164999 100644
--- a/gcc/testsuite/objc/execute/forward-1.m
+++ b/gcc/testsuite/objc/execute/forward-1.m
@@ -55,13 +55,12 @@ id forwarder, receiver;
receiver = theReceiver;
return self;
}
-#ifdef NEXT_OBJC_USE_NEW_INTERFACE
+#ifdef __NEXT_RUNTIME__
- forward: (SEL)theSel: (marg_list)theArgFrame
-{
#else
-(retval_t) forward: (SEL)theSel: (arglist_t)theArgFrame
-{
#endif
+{
/* If we have a reciever try to perform on that object */
if (receiver)
return [receiver performv: theSel: theArgFrame];
diff --git a/gcc/timevar.def b/gcc/timevar.def
index e4e61fb2f1a..a3e93bc4d06 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -53,8 +53,10 @@ DEFTIMEVAR (TV_CGRAPHOPT , "callgraph optimization")
DEFTIMEVAR (TV_VARPOOL , "varpool construction")
DEFTIMEVAR (TV_IPA_CONSTANT_PROP , "ipa cp")
DEFTIMEVAR (TV_IPA_FNSPLIT , "ipa function splitting")
-DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IO , "ipa lto gimple I/O")
-DEFTIMEVAR (TV_IPA_LTO_DECL_IO , "ipa lto decl I/O")
+DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IN , "ipa lto gimple in")
+DEFTIMEVAR (TV_IPA_LTO_GIMPLE_OUT , "ipa lto gimple out")
+DEFTIMEVAR (TV_IPA_LTO_DECL_IN , "ipa lto decl in")
+DEFTIMEVAR (TV_IPA_LTO_DECL_OUT , "ipa lto decl out")
DEFTIMEVAR (TV_IPA_LTO_DECL_INIT_IO , "ipa lto decl init I/O")
DEFTIMEVAR (TV_IPA_LTO_CGRAPH_IO , "ipa lto cgraph I/O")
DEFTIMEVAR (TV_IPA_LTO_DECL_MERGE , "ipa lto decl merge")
@@ -172,7 +174,10 @@ DEFTIMEVAR (TV_DOMINANCE , "dominance computation")
DEFTIMEVAR (TV_CONTROL_DEPENDENCES , "control dependences")
DEFTIMEVAR (TV_OVERLOAD , "overload resolution")
DEFTIMEVAR (TV_TEMPLATE_INSTANTIATION, "template instantiation")
+DEFTIMEVAR (TV_OUT_OF_SSA , "out of ssa")
+DEFTIMEVAR (TV_VAR_EXPAND , "expand vars")
DEFTIMEVAR (TV_EXPAND , "expand")
+DEFTIMEVAR (TV_POST_EXPAND , "post expand cleanups")
DEFTIMEVAR (TV_VARCONST , "varconst")
DEFTIMEVAR (TV_LOWER_SUBREG , "lower subreg")
DEFTIMEVAR (TV_JUMP , "jump")
@@ -226,6 +231,8 @@ DEFTIMEVAR (TV_FINAL , "final")
DEFTIMEVAR (TV_VAROUT , "variable output")
DEFTIMEVAR (TV_SYMOUT , "symout")
DEFTIMEVAR (TV_VAR_TRACKING , "variable tracking")
+DEFTIMEVAR (TV_VAR_TRACKING_DATAFLOW , "var-tracking dataflow")
+DEFTIMEVAR (TV_VAR_TRACKING_EMIT , "var-tracking emit")
DEFTIMEVAR (TV_TREE_IFCOMBINE , "tree if-combine")
DEFTIMEVAR (TV_TREE_UNINIT , "uninit var anaysis")
DEFTIMEVAR (TV_PLUGIN_INIT , "plugin initialization")
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 276ae7ed4f1..964669fb615 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -259,7 +259,6 @@ enum ira_region flag_ira_region = IRA_REGION_MIXED;
/* Set the default for excess precision. */
enum excess_precision flag_excess_precision_cmdline = EXCESS_PRECISION_DEFAULT;
-enum excess_precision flag_excess_precision = EXCESS_PRECISION_DEFAULT;
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard. */
@@ -317,18 +316,12 @@ enum stack_check_type flag_stack_check = NO_STACK_CHECK;
bool user_defined_section_attribute = false;
-/* Values of the -falign-* flags: how much to align labels in code.
- 0 means `use default', 1 means `don't align'.
- For each variable, there is an _log variant which is the power
- of two not less than the variable, for .align output. */
-
-int align_loops_log;
-int align_loops_max_skip;
-int align_jumps_log;
-int align_jumps_max_skip;
-int align_labels_log;
-int align_labels_max_skip;
-int align_functions_log;
+struct target_flag_state default_target_flag_state;
+#if SWITCHABLE_TARGET
+struct target_flag_state *this_target_flag_state = &default_target_flag_state;
+#else
+#define this_target_flag_state (&default_target_flag_state)
+#endif
typedef struct
{
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 517d359dbb4..ae08c5579ed 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#define GCC_TOPLEV_H
#include "input.h"
#include "bversion.h"
-#include "diagnostic-core.h"
/* If non-NULL, return one past-the-end of the matching SUBPART of
the WHOLE string. */
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 4d63de381c4..a02d56cdc8d 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -309,6 +309,15 @@ tree_to_aff_combination (tree expr, tree type, aff_tree *comb)
return;
case ADDR_EXPR:
+ /* Handle &MEM[ptr + CST] which is equivalent to POINTER_PLUS_EXPR. */
+ if (TREE_CODE (TREE_OPERAND (expr, 0)) == MEM_REF)
+ {
+ expr = TREE_OPERAND (expr, 0);
+ tree_to_aff_combination (TREE_OPERAND (expr, 0), type, comb);
+ tree_to_aff_combination (TREE_OPERAND (expr, 1), sizetype, &tmp);
+ aff_combination_add (comb, &tmp);
+ return;
+ }
core = get_inner_reference (TREE_OPERAND (expr, 0), &bitsize, &bitpos,
&toffset, &mode, &unsignedp, &volatilep,
false);
@@ -331,6 +340,25 @@ tree_to_aff_combination (tree expr, tree type, aff_tree *comb)
}
return;
+ case MEM_REF:
+ if (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
+ tree_to_aff_combination (TREE_OPERAND (TREE_OPERAND (expr, 0), 0),
+ type, comb);
+ else if (integer_zerop (TREE_OPERAND (expr, 1)))
+ {
+ aff_combination_elt (comb, type, expr);
+ return;
+ }
+ else
+ aff_combination_elt (comb, type,
+ build2 (MEM_REF, TREE_TYPE (expr),
+ TREE_OPERAND (expr, 0),
+ build_int_cst
+ (TREE_TYPE (TREE_OPERAND (expr, 1)), 0)));
+ tree_to_aff_combination (TREE_OPERAND (expr, 1), sizetype, &tmp);
+ aff_combination_add (comb, &tmp);
+ return;
+
default:
break;
}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index f05aaaa505f..2a9e9d2d70e 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "tree-dump.h"
#include "tree-pass.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "except.h"
#include "cfgloop.h"
@@ -2533,6 +2534,49 @@ gimple_split_edge (edge edge_in)
return new_bb;
}
+
+/* Verify properties of the address expression T with base object BASE. */
+
+static tree
+verify_address (tree t, tree base)
+{
+ bool old_constant;
+ bool old_side_effects;
+ bool new_constant;
+ bool new_side_effects;
+
+ old_constant = TREE_CONSTANT (t);
+ old_side_effects = TREE_SIDE_EFFECTS (t);
+
+ recompute_tree_invariant_for_addr_expr (t);
+ new_side_effects = TREE_SIDE_EFFECTS (t);
+ new_constant = TREE_CONSTANT (t);
+
+ if (old_constant != new_constant)
+ {
+ error ("constant not recomputed when ADDR_EXPR changed");
+ return t;
+ }
+ if (old_side_effects != new_side_effects)
+ {
+ error ("side effects not recomputed when ADDR_EXPR changed");
+ return t;
+ }
+
+ if (!(TREE_CODE (base) == VAR_DECL
+ || TREE_CODE (base) == PARM_DECL
+ || TREE_CODE (base) == RESULT_DECL))
+ return NULL_TREE;
+
+ if (DECL_GIMPLE_REG_P (base))
+ {
+ error ("DECL_GIMPLE_REG_P set on a variable with address taken");
+ return base;
+ }
+
+ return NULL_TREE;
+}
+
/* Callback for walk_tree, check that all elements with address taken are
properly noticed as such. The DATA is an int* that is 1 if TP was seen
inside a PHI node. */
@@ -2561,12 +2605,27 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
break;
case INDIRECT_REF:
+ error ("INDIRECT_REF in gimple IL");
+ return t;
+
+ case MEM_REF:
x = TREE_OPERAND (t, 0);
- if (!is_gimple_reg (x) && !is_gimple_min_invariant (x))
+ if (!POINTER_TYPE_P (TREE_TYPE (x))
+ || !is_gimple_mem_ref_addr (x))
{
- error ("Indirect reference's operand is not a register or a constant.");
+ error ("Invalid first operand of MEM_REF.");
return x;
}
+ if (TREE_CODE (TREE_OPERAND (t, 1)) != INTEGER_CST
+ || !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 1))))
+ {
+ error ("Invalid offset operand of MEM_REF.");
+ return TREE_OPERAND (t, 1);
+ }
+ if (TREE_CODE (x) == ADDR_EXPR
+ && (x = verify_address (x, TREE_OPERAND (x, 0))))
+ return x;
+ *walk_subtrees = 0;
break;
case ASSERT_EXPR:
@@ -2584,31 +2643,10 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case ADDR_EXPR:
{
- bool old_constant;
- bool old_side_effects;
- bool new_constant;
- bool new_side_effects;
+ tree tem;
gcc_assert (is_gimple_address (t));
- old_constant = TREE_CONSTANT (t);
- old_side_effects = TREE_SIDE_EFFECTS (t);
-
- recompute_tree_invariant_for_addr_expr (t);
- new_side_effects = TREE_SIDE_EFFECTS (t);
- new_constant = TREE_CONSTANT (t);
-
- if (old_constant != new_constant)
- {
- error ("constant not recomputed when ADDR_EXPR changed");
- return t;
- }
- if (old_side_effects != new_side_effects)
- {
- error ("side effects not recomputed when ADDR_EXPR changed");
- return t;
- }
-
/* Skip any references (they will be checked when we recurse down the
tree) and ensure that any variable used as a prefix is marked
addressable. */
@@ -2617,20 +2655,19 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
x = TREE_OPERAND (x, 0))
;
+ if ((tem = verify_address (t, x)))
+ return tem;
+
if (!(TREE_CODE (x) == VAR_DECL
|| TREE_CODE (x) == PARM_DECL
|| TREE_CODE (x) == RESULT_DECL))
return NULL;
+
if (!TREE_ADDRESSABLE (x))
{
error ("address taken, but ADDRESSABLE bit not set");
return x;
}
- if (DECL_GIMPLE_REG_P (x))
- {
- error ("DECL_GIMPLE_REG_P set on a variable with address taken");
- return x;
- }
break;
}
@@ -2815,8 +2852,9 @@ verify_types_in_gimple_min_lval (tree expr)
if (is_gimple_id (expr))
return false;
- if (!INDIRECT_REF_P (expr)
- && TREE_CODE (expr) != TARGET_MEM_REF)
+ if (TREE_CODE (expr) != MISALIGNED_INDIRECT_REF
+ && TREE_CODE (expr) != TARGET_MEM_REF
+ && TREE_CODE (expr) != MEM_REF)
{
error ("invalid expression for min lvalue");
return true;
@@ -2833,14 +2871,7 @@ verify_types_in_gimple_min_lval (tree expr)
debug_generic_stmt (op);
return true;
}
- if (!useless_type_conversion_p (TREE_TYPE (expr),
- TREE_TYPE (TREE_TYPE (op))))
- {
- error ("type mismatch in indirect reference");
- debug_generic_stmt (TREE_TYPE (expr));
- debug_generic_stmt (TREE_TYPE (TREE_TYPE (op)));
- return true;
- }
+ /* Memory references now generally can involve a value conversion. */
return false;
}
@@ -2927,6 +2958,13 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
debug_generic_stmt (expr);
return true;
}
+ else if (TREE_CODE (op) == SSA_NAME
+ && TYPE_SIZE (TREE_TYPE (expr)) != TYPE_SIZE (TREE_TYPE (op)))
+ {
+ error ("Conversion of register to a different size.");
+ debug_generic_stmt (expr);
+ return true;
+ }
else if (!handled_component_p (op))
return false;
}
@@ -2934,6 +2972,23 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
expr = op;
}
+ if (TREE_CODE (expr) == MEM_REF)
+ {
+ if (!is_gimple_mem_ref_addr (TREE_OPERAND (expr, 0)))
+ {
+ error ("Invalid address operand in MEM_REF.");
+ debug_generic_stmt (expr);
+ return true;
+ }
+ if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST
+ || !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 1))))
+ {
+ error ("Invalid offset operand in MEM_REF.");
+ debug_generic_stmt (expr);
+ return true;
+ }
+ }
+
return ((require_lvalue || !is_gimple_min_invariant (expr))
&& verify_types_in_gimple_min_lval (expr));
}
@@ -3061,7 +3116,10 @@ verify_gimple_call (gimple stmt)
for (i = 0; i < gimple_call_num_args (stmt); ++i)
{
tree arg = gimple_call_arg (stmt, i);
- if (!is_gimple_operand (arg))
+ if ((is_gimple_reg_type (TREE_TYPE (arg))
+ && !is_gimple_val (arg))
+ || (!is_gimple_reg_type (TREE_TYPE (arg))
+ && !is_gimple_lvalue (arg)))
{
error ("invalid argument to gimple call");
debug_generic_expr (arg);
@@ -3642,10 +3700,12 @@ verify_gimple_assign_single (gimple stmt)
}
/* tcc_reference */
+ case INDIRECT_REF:
+ error ("INDIRECT_REF in gimple IL");
+ return true;
+
case COMPONENT_REF:
case BIT_FIELD_REF:
- case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
@@ -3653,6 +3713,7 @@ verify_gimple_assign_single (gimple stmt)
case REALPART_EXPR:
case IMAGPART_EXPR:
case TARGET_MEM_REF:
+ case MEM_REF:
if (!is_gimple_reg (lhs)
&& is_gimple_reg_type (TREE_TYPE (lhs)))
{
@@ -3768,12 +3829,14 @@ verify_gimple_return (gimple stmt)
return true;
}
- if (!useless_type_conversion_p (restype, TREE_TYPE (op))
- /* ??? With C++ we can have the situation that the result
- decl is a reference type while the return type is an aggregate. */
- && !(TREE_CODE (op) == RESULT_DECL
- && TREE_CODE (TREE_TYPE (op)) == REFERENCE_TYPE
- && useless_type_conversion_p (restype, TREE_TYPE (TREE_TYPE (op)))))
+ if ((TREE_CODE (op) == RESULT_DECL
+ && DECL_BY_REFERENCE (op))
+ || (TREE_CODE (op) == SSA_NAME
+ && TREE_CODE (SSA_NAME_VAR (op)) == RESULT_DECL
+ && DECL_BY_REFERENCE (SSA_NAME_VAR (op))))
+ op = TREE_TYPE (op);
+
+ if (!useless_type_conversion_p (restype, TREE_TYPE (op)))
{
error ("invalid conversion in return statement");
debug_generic_stmt (restype);
@@ -5538,7 +5601,7 @@ replace_by_duplicate_decl (tree *tp, struct pointer_map_t *vars_map,
if (SSA_VAR_P (t))
{
new_t = copy_var_decl (t, DECL_NAME (t), TREE_TYPE (t));
- f->local_decls = tree_cons (NULL_TREE, new_t, f->local_decls);
+ add_local_decl (f, new_t);
}
else
{
@@ -6009,7 +6072,7 @@ replace_block_vars_by_duplicates (tree block, struct pointer_map_t *vars_map,
{
tree *tp, t;
- for (tp = &BLOCK_VARS (block); *tp; tp = &TREE_CHAIN (*tp))
+ for (tp = &BLOCK_VARS (block); *tp; tp = &DECL_CHAIN (*tp))
{
t = *tp;
if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != CONST_DECL)
@@ -6022,7 +6085,7 @@ replace_block_vars_by_duplicates (tree block, struct pointer_map_t *vars_map,
SET_DECL_VALUE_EXPR (t, DECL_VALUE_EXPR (*tp));
DECL_HAS_VALUE_EXPR_P (t) = 1;
}
- TREE_CHAIN (t) = TREE_CHAIN (*tp);
+ DECL_CHAIN (t) = DECL_CHAIN (*tp);
*tp = t;
}
}
@@ -6258,7 +6321,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
void
dump_function_to_file (tree fn, FILE *file, int flags)
{
- tree arg, vars, var;
+ tree arg, var;
struct function *dsf;
bool ignore_topmost_bind = false, any_var = false;
basic_block bb;
@@ -6274,9 +6337,9 @@ dump_function_to_file (tree fn, FILE *file, int flags)
print_generic_expr (file, arg, dump_flags);
if (flags & TDF_VERBOSE)
print_node (file, "", arg, 4);
- if (TREE_CHAIN (arg))
+ if (DECL_CHAIN (arg))
fprintf (file, ", ");
- arg = TREE_CHAIN (arg);
+ arg = DECL_CHAIN (arg);
}
fprintf (file, ")\n");
@@ -6298,15 +6361,14 @@ dump_function_to_file (tree fn, FILE *file, int flags)
/* When GIMPLE is lowered, the variables are no longer available in
BIND_EXPRs, so display them separately. */
- if (cfun && cfun->decl == fn && cfun->local_decls)
+ if (cfun && cfun->decl == fn && !VEC_empty (tree, cfun->local_decls))
{
+ unsigned ix;
ignore_topmost_bind = true;
fprintf (file, "{\n");
- for (vars = cfun->local_decls; vars; vars = TREE_CHAIN (vars))
+ FOR_EACH_LOCAL_DECL (cfun, ix, var)
{
- var = TREE_VALUE (vars);
-
print_generic_decl (file, var, flags);
if (flags & TDF_VERBOSE)
print_node (file, "", var, 4);
@@ -6387,6 +6449,8 @@ dump_function_to_file (tree fn, FILE *file, int flags)
fprintf (file, "}\n");
}
+ if (flags & TDF_ENUMERATE_LOCALS)
+ dump_enumerated_decls (file, flags);
fprintf (file, "\n\n");
/* Restore CFUN. */
@@ -6568,7 +6632,7 @@ static bool
gimple_block_ends_with_call_p (basic_block bb)
{
gimple_stmt_iterator gsi = gsi_last_nondebug_bb (bb);
- return is_gimple_call (gsi_stmt (gsi));
+ return !gsi_end_p (gsi) && is_gimple_call (gsi_stmt (gsi));
}
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 7f8498a4483..f798b2f50ed 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "flags.h"
#include "function.h"
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index c491ac8173c..49165713725 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -174,7 +174,7 @@ init_parameter_lattice_values (void)
{
tree parm, ssa_name;
- for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = DECL_CHAIN (parm))
if (is_complex_reg (parm)
&& var_ann (parm) != NULL
&& (ssa_name = gimple_default_def (cfun, parm)) != NULL_TREE)
@@ -596,10 +596,10 @@ extract_component (gimple_stmt_iterator *gsi, tree t, bool imagpart_p,
case VAR_DECL:
case RESULT_DECL:
case PARM_DECL:
- case INDIRECT_REF:
case COMPONENT_REF:
case ARRAY_REF:
case VIEW_CONVERT_EXPR:
+ case MEM_REF:
{
tree inner_type = TREE_TYPE (TREE_TYPE (t));
@@ -680,7 +680,7 @@ update_parameter_components (void)
edge entry_edge = single_succ_edge (ENTRY_BLOCK_PTR);
tree parm;
- for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = DECL_CHAIN (parm))
{
tree type = TREE_TYPE (parm);
tree ssa_name, r, i;
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index c41cf51f775..e7aa277a69f 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -746,7 +746,22 @@ dr_analyze_innermost (struct data_reference *dr)
return false;
}
- base = build_fold_addr_expr (base);
+ if (TREE_CODE (base) == MEM_REF)
+ {
+ if (!integer_zerop (TREE_OPERAND (base, 1)))
+ {
+ if (!poffset)
+ {
+ double_int moff = mem_ref_offset (base);
+ poffset = double_int_to_tree (sizetype, moff);
+ }
+ else
+ poffset = size_binop (PLUS_EXPR, poffset, TREE_OPERAND (base, 1));
+ }
+ base = TREE_OPERAND (base, 0);
+ }
+ else
+ base = build_fold_addr_expr (base);
if (in_loop)
{
if (!simple_iv (loop, loop_containing_stmt (stmt), base, &base_iv,
@@ -844,13 +859,18 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
aref = TREE_OPERAND (aref, 0);
}
- if (nest && INDIRECT_REF_P (aref))
+ if (nest
+ && (INDIRECT_REF_P (aref)
+ || TREE_CODE (aref) == MEM_REF))
{
op = TREE_OPERAND (aref, 0);
access_fn = analyze_scalar_evolution (loop, op);
access_fn = instantiate_scev (before_loop, loop, access_fn);
base = initial_condition (access_fn);
split_constant_offset (base, &base, &off);
+ if (TREE_CODE (aref) == MEM_REF)
+ off = size_binop (PLUS_EXPR, off,
+ fold_convert (ssizetype, TREE_OPERAND (aref, 1)));
access_fn = chrec_replace_initial_condition (access_fn,
fold_convert (TREE_TYPE (base), off));
@@ -858,6 +878,22 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
VEC_safe_push (tree, heap, access_fns, access_fn);
}
+ if (TREE_CODE (aref) == MEM_REF)
+ TREE_OPERAND (aref, 1)
+ = build_int_cst (TREE_TYPE (TREE_OPERAND (aref, 1)), 0);
+
+ if (TREE_CODE (ref) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (ref, 0)) == ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (ref, 1)))
+ ref = TREE_OPERAND (TREE_OPERAND (ref, 0), 0);
+
+ /* For canonicalization purposes we'd like to strip all outermost
+ zero-offset component-refs.
+ ??? For now simply handle zero-index array-refs. */
+ while (TREE_CODE (ref) == ARRAY_REF
+ && integer_zerop (TREE_OPERAND (ref, 1)))
+ ref = TREE_OPERAND (ref, 0);
+
DR_BASE_OBJECT (dr) = ref;
DR_ACCESS_FNS (dr) = access_fns;
}
@@ -870,7 +906,8 @@ dr_analyze_alias (struct data_reference *dr)
tree ref = DR_REF (dr);
tree base = get_base_address (ref), addr;
- if (INDIRECT_REF_P (base))
+ if (INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
{
addr = TREE_OPERAND (base, 0);
if (TREE_CODE (addr) == SSA_NAME)
@@ -1188,7 +1225,8 @@ object_address_invariant_in_loop_p (const struct loop *loop, const_tree obj)
obj = TREE_OPERAND (obj, 0);
}
- if (!INDIRECT_REF_P (obj))
+ if (!INDIRECT_REF_P (obj)
+ && TREE_CODE (obj) != MEM_REF)
return true;
return !chrec_contains_symbols_defined_in_loop (TREE_OPERAND (obj, 0),
@@ -1414,7 +1452,14 @@ initialize_data_dependence_relation (struct data_reference *a,
return res;
}
- gcc_assert (DR_NUM_DIMENSIONS (a) == DR_NUM_DIMENSIONS (b));
+ /* If the number of dimensions of the access to not agree we can have
+ a pointer access to a component of the array element type and an
+ array access while the base-objects are still the same. Punt. */
+ if (DR_NUM_DIMENSIONS (a) != DR_NUM_DIMENSIONS (b))
+ {
+ DDR_ARE_DEPENDENT (res) = chrec_dont_know;
+ return res;
+ }
DDR_AFFINE_P (res) = true;
DDR_ARE_DEPENDENT (res) = NULL_TREE;
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 6d016fd3b52..461e2cf2277 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "toplev.h"
#include "hashtab.h"
#include "pointer-set.h"
#include "tree.h"
@@ -494,7 +495,6 @@ referenced_var_lookup (unsigned int uid)
struct tree_decl_minimal in;
in.uid = uid;
h = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
- gcc_assert (h || uid == 0);
return h;
}
@@ -769,9 +769,9 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
&& maxsize != -1)
{
tree stype = TREE_TYPE (TREE_OPERAND (exp, 0));
- tree next = TREE_CHAIN (field);
+ tree next = DECL_CHAIN (field);
while (next && TREE_CODE (next) != FIELD_DECL)
- next = TREE_CHAIN (next);
+ next = DECL_CHAIN (next);
if (!next
|| TREE_CODE (stype) != RECORD_TYPE)
{
@@ -855,6 +855,29 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
case VIEW_CONVERT_EXPR:
break;
+ case MEM_REF:
+ /* Hand back the decl for MEM[&decl, off]. */
+ if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR)
+ {
+ if (integer_zerop (TREE_OPERAND (exp, 1)))
+ exp = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ else
+ {
+ double_int off = mem_ref_offset (exp);
+ off = double_int_lshift (off,
+ BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT, true);
+ off = double_int_add (off, shwi_to_double_int (bit_offset));
+ if (double_int_fits_in_shwi_p (off))
+ {
+ bit_offset = double_int_to_shwi (off);
+ exp = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ }
+ }
+ }
+ goto done;
+
default:
goto done;
}
@@ -901,6 +924,104 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
return exp;
}
+/* Returns the base object and a constant BITS_PER_UNIT offset in *POFFSET that
+ denotes the starting address of the memory access EXP.
+ Returns NULL_TREE if the offset is not constant or any component
+ is not BITS_PER_UNIT-aligned. */
+
+tree
+get_addr_base_and_unit_offset (tree exp, HOST_WIDE_INT *poffset)
+{
+ HOST_WIDE_INT byte_offset = 0;
+
+ /* Compute cumulative byte-offset for nested component-refs and array-refs,
+ and find the ultimate containing object. */
+ while (1)
+ {
+ switch (TREE_CODE (exp))
+ {
+ case BIT_FIELD_REF:
+ return NULL_TREE;
+
+ case COMPONENT_REF:
+ {
+ tree field = TREE_OPERAND (exp, 1);
+ tree this_offset = component_ref_field_offset (exp);
+ HOST_WIDE_INT hthis_offset;
+
+ if (!this_offset
+ || TREE_CODE (this_offset) != INTEGER_CST
+ || (TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field))
+ % BITS_PER_UNIT))
+ return NULL_TREE;
+
+ hthis_offset = TREE_INT_CST_LOW (this_offset);
+ hthis_offset += (TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field))
+ / BITS_PER_UNIT);
+ byte_offset += hthis_offset;
+ }
+ break;
+
+ case ARRAY_REF:
+ case ARRAY_RANGE_REF:
+ {
+ tree index = TREE_OPERAND (exp, 1);
+ tree low_bound, unit_size;
+
+ /* If the resulting bit-offset is constant, track it. */
+ if (TREE_CODE (index) == INTEGER_CST
+ && (low_bound = array_ref_low_bound (exp),
+ TREE_CODE (low_bound) == INTEGER_CST)
+ && (unit_size = array_ref_element_size (exp),
+ TREE_CODE (unit_size) == INTEGER_CST))
+ {
+ HOST_WIDE_INT hindex = TREE_INT_CST_LOW (index);
+
+ hindex -= TREE_INT_CST_LOW (low_bound);
+ hindex *= TREE_INT_CST_LOW (unit_size);
+ byte_offset += hindex;
+ }
+ else
+ return NULL_TREE;
+ }
+ break;
+
+ case REALPART_EXPR:
+ break;
+
+ case IMAGPART_EXPR:
+ byte_offset += TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (exp)));
+ break;
+
+ case VIEW_CONVERT_EXPR:
+ break;
+
+ case MEM_REF:
+ /* Hand back the decl for MEM[&decl, off]. */
+ if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR)
+ {
+ if (!integer_zerop (TREE_OPERAND (exp, 1)))
+ {
+ double_int off = mem_ref_offset (exp);
+ gcc_assert (off.high == -1 || off.high == 0);
+ byte_offset += double_int_to_shwi (off);
+ }
+ exp = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ }
+ goto done;
+
+ default:
+ goto done;
+ }
+
+ exp = TREE_OPERAND (exp, 0);
+ }
+done:
+
+ *poffset = byte_offset;
+ return exp;
+}
+
/* Returns true if STMT references an SSA_NAME that has
SSA_NAME_OCCURS_IN_ABNORMAL_PHI set, otherwise false. */
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 539a11dfe35..75fb7f72441 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "splay-tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-dump.h"
#include "tree-pass.h"
@@ -369,8 +370,8 @@ dequeue_and_dump (dump_info_p di)
if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_COMMON)
&& DECL_ARTIFICIAL (t))
dump_string_field (di, "note", "artificial");
- if (TREE_CHAIN (t) && !dump_flag (di, TDF_SLIM, NULL))
- dump_child ("chan", TREE_CHAIN (t));
+ if (DECL_CHAIN (t) && !dump_flag (di, TDF_SLIM, NULL))
+ dump_child ("chain", DECL_CHAIN (t));
}
else if (code_class == tcc_type)
{
@@ -571,7 +572,6 @@ dequeue_and_dump (dump_info_p di)
case TRUTH_NOT_EXPR:
case ADDR_EXPR:
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case CLEANUP_POINT_EXPR:
case SAVE_EXPR:
@@ -821,9 +821,10 @@ static const struct dump_option_value_info dump_options[] =
{"eh", TDF_EH},
{"alias", TDF_ALIAS},
{"nouid", TDF_NOUID},
+ {"enumerate_locals", TDF_ENUMERATE_LOCALS},
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
| TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
- | TDF_RHS_ONLY | TDF_NOUID)},
+ | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS)},
{NULL, 0}
};
diff --git a/gcc/tree-dump.h b/gcc/tree-dump.h
index eeb28e0aad6..f5b04ff67ea 100644
--- a/gcc/tree-dump.h
+++ b/gcc/tree-dump.h
@@ -91,6 +91,7 @@ extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int);
extern void queue_and_dump_type (dump_info_p, const_tree);
extern void dump_function (int, tree);
extern void dump_function_to_file (tree, FILE *, int);
+extern void dump_enumerated_decls (FILE *, int);
extern void debug_function (tree, int);
extern int dump_flag (dump_info_p, int, const_tree);
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 3a6292c1b2f..ab501d5e0a6 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "langhooks.h"
#include "ggc.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "gimple.h"
#include "target.h"
@@ -1877,7 +1877,7 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
else
{
/* The user has dome something silly. Remove it. */
- rhs = build_int_cst (ptr_type_node, 0);
+ rhs = null_pointer_node;
goto do_replace;
}
break;
@@ -2437,8 +2437,11 @@ tree_could_trap_p (tree expr)
return false;
return !in_array_bounds_p (expr);
+ case MEM_REF:
+ if (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
+ return false;
+ /* Fallthru. */
case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
return !TREE_THIS_NOTRAP (expr);
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 7e935378c81..7103d238b09 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -98,6 +98,16 @@ next_htab_element (htab_iterator *hti)
return NULL;
}
+/* Get the variable with uid UID from the list of referenced vars. */
+
+static inline tree
+referenced_var (unsigned int uid)
+{
+ tree var = referenced_var_lookup (uid);
+ gcc_assert (var || uid == 0);
+ return var;
+}
+
/* Initialize ITER to point to the first referenced variable in the
referenced_vars hashtable, and return that variable. */
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index af396411974..6209a844df3 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -321,7 +321,6 @@ typedef struct
extern tree referenced_var_lookup (unsigned int);
extern bool referenced_var_check_and_insert (tree);
#define num_referenced_vars htab_elements (gimple_referenced_vars (cfun))
-#define referenced_var(i) referenced_var_lookup (i)
#define num_ssa_names (VEC_length (tree, cfun->gimple_df->ssa_names))
#define ssa_name(i) (VEC_index (tree, cfun->gimple_df->ssa_names, (i)))
@@ -368,7 +367,7 @@ struct omp_region
/* If this is a combined parallel+workshare region, this is a list
of additional arguments needed by the combined parallel+workshare
library call. */
- tree ws_args;
+ VEC(tree,gc) *ws_args;
/* The code for the omp directive of this region. */
enum gimple_code type;
@@ -491,6 +490,7 @@ extern tree gimple_default_def (struct function *, tree);
extern bool stmt_references_abnormal_ssa_name (gimple);
extern tree get_ref_base_and_extent (tree, HOST_WIDE_INT *,
HOST_WIDE_INT *, HOST_WIDE_INT *);
+extern tree get_addr_base_and_unit_offset (tree, HOST_WIDE_INT *);
extern void find_referenced_vars_in (gimple);
/* In tree-phinodes.c */
@@ -572,6 +572,7 @@ void release_ssa_name_after_update_ssa (tree);
void compute_global_livein (bitmap, bitmap);
void mark_sym_for_renaming (tree);
void mark_set_for_renaming (bitmap);
+bool symbol_marked_for_renaming (tree);
tree get_current_def (tree);
void set_current_def (tree, tree);
@@ -831,7 +832,7 @@ struct mem_address
};
struct affine_tree_combination;
-tree create_mem_ref (gimple_stmt_iterator *, tree,
+tree create_mem_ref (gimple_stmt_iterator *, tree, tree,
struct affine_tree_combination *, tree, bool);
rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool);
void get_address_description (tree, struct mem_address *);
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 8d5d2268ec5..0f1caaa3dbc 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -259,17 +259,96 @@ is_predicated (basic_block bb)
return !is_true_predicate (bb_predicate (bb));
}
-/* Add condition NEW_COND to the predicate list of basic block BB. */
+/* Parses the predicate COND and returns its comparison code and
+ operands OP0 and OP1. */
+
+static enum tree_code
+parse_predicate (tree cond, tree *op0, tree *op1)
+{
+ gimple s;
+
+ if (TREE_CODE (cond) == SSA_NAME
+ && is_gimple_assign (s = SSA_NAME_DEF_STMT (cond)))
+ {
+ if (TREE_CODE_CLASS (gimple_assign_rhs_code (s)) == tcc_comparison)
+ {
+ *op0 = gimple_assign_rhs1 (s);
+ *op1 = gimple_assign_rhs2 (s);
+ return gimple_assign_rhs_code (s);
+ }
+
+ else if (gimple_assign_rhs_code (s) == TRUTH_NOT_EXPR)
+ {
+ tree op = gimple_assign_rhs1 (s);
+ tree type = TREE_TYPE (op);
+ enum tree_code code = parse_predicate (op, op0, op1);
+
+ return code == ERROR_MARK ? ERROR_MARK
+ : invert_tree_comparison (code, HONOR_NANS (TYPE_MODE (type)));
+ }
+
+ return ERROR_MARK;
+ }
+
+ if (TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison)
+ {
+ *op0 = TREE_OPERAND (cond, 0);
+ *op1 = TREE_OPERAND (cond, 1);
+ return TREE_CODE (cond);
+ }
+
+ return ERROR_MARK;
+}
+
+/* Returns the fold of predicate C1 OR C2 at location LOC. */
+
+static tree
+fold_or_predicates (location_t loc, tree c1, tree c2)
+{
+ tree op1a, op1b, op2a, op2b;
+ enum tree_code code1 = parse_predicate (c1, &op1a, &op1b);
+ enum tree_code code2 = parse_predicate (c2, &op2a, &op2b);
+
+ if (code1 != ERROR_MARK && code2 != ERROR_MARK)
+ {
+ tree t = maybe_fold_or_comparisons (code1, op1a, op1b,
+ code2, op2a, op2b);
+ if (t)
+ return t;
+ }
+
+ return fold_build2_loc (loc, TRUTH_OR_EXPR, boolean_type_node, c1, c2);
+}
+
+/* Add condition NC to the predicate list of basic block BB. */
static inline void
-add_to_predicate_list (basic_block bb, tree new_cond)
+add_to_predicate_list (basic_block bb, tree nc)
{
- tree cond = bb_predicate (bb);
+ tree bc;
+
+ if (is_true_predicate (nc))
+ return;
- set_bb_predicate (bb, is_true_predicate (cond) ? new_cond :
- fold_build2_loc (EXPR_LOCATION (cond),
- TRUTH_OR_EXPR, boolean_type_node,
- cond, new_cond));
+ if (!is_predicated (bb))
+ bc = nc;
+ else
+ {
+ bc = bb_predicate (bb);
+ bc = fold_or_predicates (EXPR_LOCATION (bc), nc, bc);
+ }
+
+ if (!is_gimple_condexpr (bc))
+ {
+ gimple_seq stmts;
+ bc = force_gimple_operand (bc, &stmts, true, NULL_TREE);
+ add_bb_predicate_gimplified_stmts (bb, stmts);
+ }
+
+ if (is_true_predicate (bc))
+ reset_bb_predicate (bb);
+ else
+ set_bb_predicate (bb, bc);
}
/* Add the condition COND to the previous condition PREV_COND, and add
@@ -1239,10 +1318,13 @@ main_tree_if_conversion (void)
return changed ? TODO_cleanup_cfg : 0;
}
+/* Returns true when the if-conversion pass is enabled. */
+
static bool
gate_tree_if_conversion (void)
{
- return flag_tree_vectorize != 0;
+ return ((flag_tree_vectorize && flag_tree_loop_if_convert != 0)
+ || flag_tree_loop_if_convert == 1);
}
struct gimple_opt_pass pass_if_conversion =
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index f1470d7a384..dc09c29b6ea 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -23,7 +23,8 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include "toplev.h"
+#include "toplev.h" /* floor_log2 */
+#include "diagnostic-core.h"
#include "tree.h"
#include "tree-inline.h"
#include "flags.h"
@@ -113,7 +114,7 @@ eni_weights eni_time_weights;
/* Prototypes. */
-static tree declare_return_variable (copy_body_data *, tree, tree);
+static tree declare_return_variable (copy_body_data *, tree, tree, basic_block);
static void remap_block (tree *, copy_body_data *);
static void copy_bind_expr (tree *, int *, copy_body_data *);
static tree mark_local_for_remap_r (tree *, int *, void *);
@@ -421,11 +422,11 @@ remap_type_1 (tree type, copy_body_data *id)
{
tree f, nf = NULL;
- for (f = TYPE_FIELDS (new_tree); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (new_tree); f ; f = DECL_CHAIN (f))
{
t = remap_decl (f, id);
DECL_CONTEXT (t) = new_tree;
- TREE_CHAIN (t) = nf;
+ DECL_CHAIN (t) = nf;
nf = t;
}
TYPE_FIELDS (new_tree) = nreverse (nf);
@@ -536,7 +537,7 @@ remap_decls (tree decls, VEC(tree,gc) **nonlocalized_list, copy_body_data *id)
tree new_decls = NULL_TREE;
/* Remap its variables. */
- for (old_var = decls; old_var; old_var = TREE_CHAIN (old_var))
+ for (old_var = decls; old_var; old_var = DECL_CHAIN (old_var))
{
tree new_var;
@@ -545,8 +546,7 @@ remap_decls (tree decls, VEC(tree,gc) **nonlocalized_list, copy_body_data *id)
if (TREE_CODE (old_var) == VAR_DECL
&& ! DECL_EXTERNAL (old_var)
&& (var_ann (old_var) || !gimple_in_ssa_p (cfun)))
- cfun->local_decls = tree_cons (NULL_TREE, old_var,
- cfun->local_decls);
+ add_local_decl (cfun, old_var);
if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE)
&& !DECL_IGNORED_P (old_var)
&& nonlocalized_list)
@@ -573,7 +573,7 @@ remap_decls (tree decls, VEC(tree,gc) **nonlocalized_list, copy_body_data *id)
else
{
gcc_assert (DECL_P (new_var));
- TREE_CHAIN (new_var) = new_decls;
+ DECL_CHAIN (new_var) = new_decls;
new_decls = new_var;
/* Also copy value-expressions. */
@@ -811,48 +811,55 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
{
/* Otherwise, just copy the node. Note that copy_tree_r already
knows not to copy VAR_DECLs, etc., so this is safe. */
- if (TREE_CODE (*tp) == INDIRECT_REF)
+ if (TREE_CODE (*tp) == MEM_REF)
{
- /* Get rid of *& from inline substitutions that can happen when a
- pointer argument is an ADDR_EXPR. */
+ /* We need to re-canonicalize MEM_REFs from inline substitutions
+ that can happen when a pointer argument is an ADDR_EXPR. */
tree decl = TREE_OPERAND (*tp, 0);
tree *n;
+ /* See remap_ssa_name. */
+ if (TREE_CODE (decl) == SSA_NAME
+ && TREE_CODE (SSA_NAME_VAR (decl)) == RESULT_DECL
+ && id->transform_return_to_modify)
+ decl = SSA_NAME_VAR (decl);
+
n = (tree *) pointer_map_contains (id->decl_map, decl);
if (n)
{
- tree type, new_tree, old;
-
- /* If we happen to get an ADDR_EXPR in n->value, strip
- it manually here as we'll eventually get ADDR_EXPRs
- which lie about their types pointed to. In this case
- build_fold_indirect_ref wouldn't strip the
- INDIRECT_REF, but we absolutely rely on that. As
- fold_indirect_ref does other useful transformations,
- try that first, though. */
- type = TREE_TYPE (TREE_TYPE (*n));
- new_tree = unshare_expr (*n);
- old = *tp;
- *tp = gimple_fold_indirect_ref (new_tree);
- if (!*tp)
- {
- if (TREE_CODE (new_tree) == ADDR_EXPR)
- {
- *tp = fold_indirect_ref_1 (EXPR_LOCATION (new_tree),
- type, new_tree);
- /* ??? We should either assert here or build
- a VIEW_CONVERT_EXPR instead of blindly leaking
- incompatible types to our IL. */
- if (! *tp)
- *tp = TREE_OPERAND (new_tree, 0);
- }
- else
- {
- *tp = build1 (INDIRECT_REF, type, new_tree);
- TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
- TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
- }
+ tree old = *tp;
+ tree ptr = unshare_expr (*n);
+ tree tem;
+ if ((tem = maybe_fold_offset_to_reference (EXPR_LOCATION (*tp),
+ ptr,
+ TREE_OPERAND (*tp, 1),
+ TREE_TYPE (*tp)))
+ && TREE_THIS_VOLATILE (tem) == TREE_THIS_VOLATILE (old))
+ {
+ tree *tem_basep = &tem;
+ while (handled_component_p (*tem_basep))
+ tem_basep = &TREE_OPERAND (*tem_basep, 0);
+ if (TREE_CODE (*tem_basep) == MEM_REF)
+ *tem_basep
+ = build2 (MEM_REF, TREE_TYPE (*tem_basep),
+ TREE_OPERAND (*tem_basep, 0),
+ fold_convert (TREE_TYPE (TREE_OPERAND (*tp, 1)),
+ TREE_OPERAND (*tem_basep, 1)));
+ else
+ *tem_basep
+ = build2 (MEM_REF, TREE_TYPE (*tem_basep),
+ build_fold_addr_expr (*tem_basep),
+ build_int_cst
+ (TREE_TYPE (TREE_OPERAND (*tp, 1)), 0));
+ *tp = tem;
}
+ else
+ {
+ *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),
+ ptr, TREE_OPERAND (*tp, 1));
+ TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
+ }
+ TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
*walk_subtrees = 0;
return NULL;
}
@@ -887,7 +894,7 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
else if (TREE_CODE (*tp) == ADDR_EXPR)
{
/* Variable substitution need not be simple. In particular,
- the INDIRECT_REF substitution above. Make sure that
+ the MEM_REF substitution above. Make sure that
TREE_CONSTANT and friends are up-to-date. But make sure
to not improperly set TREE_BLOCK on some sub-expressions. */
int invariant = is_gimple_min_invariant (*tp);
@@ -895,13 +902,7 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
id->block = NULL_TREE;
walk_tree (&TREE_OPERAND (*tp, 0), remap_gimple_op_r, data, NULL);
id->block = block;
-
- /* Handle the case where we substituted an INDIRECT_REF
- into the operand of the ADDR_EXPR. */
- if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
- *tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
- else
- recompute_tree_invariant_for_addr_expr (*tp);
+ recompute_tree_invariant_for_addr_expr (*tp);
/* If this used to be invariant, but is not any longer,
then regimplification is probably needed. */
@@ -1092,6 +1093,25 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
return NULL;
}
}
+ else if (TREE_CODE (*tp) == MEM_REF)
+ {
+ /* We need to re-canonicalize MEM_REFs from inline substitutions
+ that can happen when a pointer argument is an ADDR_EXPR. */
+ tree decl = TREE_OPERAND (*tp, 0);
+ tree *n;
+
+ n = (tree *) pointer_map_contains (id->decl_map, decl);
+ if (n)
+ {
+ tree old = *tp;
+ *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),
+ unshare_expr (*n), TREE_OPERAND (*tp, 1));
+ TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
+ TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
+ *walk_subtrees = 0;
+ return NULL;
+ }
+ }
/* Here is the "usual case". Copy this tree node, and then
tweak some special cases. */
@@ -1222,7 +1242,10 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
If RETVAL is just the result decl, the result decl has
already been set (e.g. a recent "foo (&result_decl, ...)");
just toss the entire GIMPLE_RETURN. */
- if (retval && TREE_CODE (retval) != RESULT_DECL)
+ if (retval
+ && (TREE_CODE (retval) != RESULT_DECL
+ && (TREE_CODE (retval) != SSA_NAME
+ || TREE_CODE (SSA_NAME_VAR (retval)) != RESULT_DECL)))
{
copy = gimple_build_assign (id->retvar, retval);
/* id->retvar is already substituted. Skip it on later remapping. */
@@ -1572,7 +1595,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
size_t nargs = gimple_call_num_args (id->gimple_call);
size_t n;
- for (p = DECL_ARGUMENTS (id->src_fn); p; p = TREE_CHAIN (p))
+ for (p = DECL_ARGUMENTS (id->src_fn); p; p = DECL_CHAIN (p))
nargs--;
/* Create the new array of arguments. */
@@ -1619,7 +1642,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
tree count, p;
gimple new_stmt;
- for (p = DECL_ARGUMENTS (id->src_fn); p; p = TREE_CHAIN (p))
+ for (p = DECL_ARGUMENTS (id->src_fn); p; p = DECL_CHAIN (p))
nargs--;
count = build_int_cst (integer_type_node, nargs);
@@ -2530,7 +2553,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
}
/* Declare this new variable. */
- TREE_CHAIN (var) = *vars;
+ DECL_CHAIN (var) = *vars;
*vars = var;
/* Make gimplifier happy about this variable. */
@@ -2660,7 +2683,7 @@ initialize_inlined_parameters (copy_body_data *id, gimple stmt,
/* Loop through the parameter declarations, replacing each with an
equivalent VAR_DECL, appropriately initialized. */
- for (p = parms, i = 0; p; p = TREE_CHAIN (p), i++)
+ for (p = parms, i = 0; p; p = DECL_CHAIN (p), i++)
{
tree val;
val = i < gimple_call_num_args (stmt) ? gimple_call_arg (stmt, i) : NULL;
@@ -2670,25 +2693,26 @@ initialize_inlined_parameters (copy_body_data *id, gimple stmt,
in a second loop over all parameters to appropriately remap
variable sized arrays when the size is specified in a
parameter following the array. */
- for (p = parms, i = 0; p; p = TREE_CHAIN (p), i++)
+ for (p = parms, i = 0; p; p = DECL_CHAIN (p), i++)
{
tree *varp = (tree *) pointer_map_contains (id->decl_map, p);
if (varp
&& TREE_CODE (*varp) == VAR_DECL)
{
- tree def = (gimple_in_ssa_p (cfun)
+ tree def = (gimple_in_ssa_p (cfun) && is_gimple_reg (p)
? gimple_default_def (id->src_cfun, p) : NULL);
- TREE_TYPE (*varp) = remap_type (TREE_TYPE (*varp), id);
+ tree var = *varp;
+ TREE_TYPE (var) = remap_type (TREE_TYPE (var), id);
/* Also remap the default definition if it was remapped
to the default definition of the parameter replacement
by the parameter setup. */
- if (def && gimple_in_ssa_p (cfun) && is_gimple_reg (p))
+ if (def)
{
tree *defp = (tree *) pointer_map_contains (id->decl_map, def);
if (defp
&& TREE_CODE (*defp) == SSA_NAME
- && SSA_NAME_VAR (*defp) == *varp)
- TREE_TYPE (*defp) = TREE_TYPE (*varp);
+ && SSA_NAME_VAR (*defp) == var)
+ TREE_TYPE (*defp) = TREE_TYPE (var);
}
}
}
@@ -2721,7 +2745,8 @@ initialize_inlined_parameters (copy_body_data *id, gimple stmt,
as seen by the caller. */
static tree
-declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest)
+declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
+ basic_block entry_bb)
{
tree callee = id->src_fn;
tree caller = id->dst_fn;
@@ -2839,9 +2864,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest)
}
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
- DECL_STRUCT_FUNCTION (caller)->local_decls
- = tree_cons (NULL_TREE, var,
- DECL_STRUCT_FUNCTION (caller)->local_decls);
+ add_local_decl (DECL_STRUCT_FUNCTION (caller), var);
/* Do not have the rest of GCC warn about this variable as it should
not be visible to the user. */
@@ -2866,8 +2889,28 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest)
done:
/* Register the VAR_DECL as the equivalent for the RESULT_DECL; that
way, when the RESULT_DECL is encountered, it will be
- automatically replaced by the VAR_DECL. */
- insert_decl_map (id, result, var);
+ automatically replaced by the VAR_DECL.
+
+ When returning by reference, ensure that RESULT_DECL remaps to
+ gimple_val. */
+ if (DECL_BY_REFERENCE (result)
+ && !is_gimple_val (var))
+ {
+ tree temp = create_tmp_var (TREE_TYPE (result), "retvalptr");
+ if (gimple_in_ssa_p (id->src_cfun))
+ {
+ get_var_ann (temp);
+ add_referenced_var (temp);
+ }
+ insert_decl_map (id, result, temp);
+ /* When RESULT_DECL is in SSA form, we need to use it's default_def
+ SSA_NAME. */
+ if (gimple_in_ssa_p (id->src_cfun) && gimple_default_def (id->src_cfun, result))
+ temp = remap_ssa_name (gimple_default_def (id->src_cfun, result), id);
+ insert_init_stmt (id, entry_bb, gimple_build_assign (temp, var));
+ }
+ else
+ insert_decl_map (id, result, var);
/* Remember this so we can ignore it in remap_decls. */
id->retvar = var;
@@ -2900,7 +2943,8 @@ static const char *
copy_forbidden (struct function *fun, tree fndecl)
{
const char *reason = fun->cannot_be_copied_reason;
- tree step;
+ tree decl;
+ unsigned ix;
/* Only examine the function once. */
if (fun->cannot_be_copied_set)
@@ -2919,23 +2963,19 @@ copy_forbidden (struct function *fun, tree fndecl)
goto fail;
}
- for (step = fun->local_decls; step; step = TREE_CHAIN (step))
- {
- tree decl = TREE_VALUE (step);
-
- if (TREE_CODE (decl) == VAR_DECL
- && TREE_STATIC (decl)
- && !DECL_EXTERNAL (decl)
- && DECL_INITIAL (decl)
- && walk_tree_without_duplicates (&DECL_INITIAL (decl),
- has_label_address_in_static_1,
- fndecl))
- {
- reason = G_("function %q+F can never be copied because it saves "
- "address of local label in a static variable");
- goto fail;
- }
- }
+ FOR_EACH_LOCAL_DECL (fun, ix, decl)
+ if (TREE_CODE (decl) == VAR_DECL
+ && TREE_STATIC (decl)
+ && !DECL_EXTERNAL (decl)
+ && DECL_INITIAL (decl)
+ && walk_tree_without_duplicates (&DECL_INITIAL (decl),
+ has_label_address_in_static_1,
+ fndecl))
+ {
+ reason = G_("function %q+F can never be copied because it saves "
+ "address of local label in a static variable");
+ goto fail;
+ }
fail:
fun->cannot_be_copied_reason = reason;
@@ -3438,105 +3478,13 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
if (POINTER_TYPE_P (funtype))
funtype = TREE_TYPE (funtype);
- if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_MD)
+ if (is_simple_builtin (decl))
+ return 0;
+ else if (is_inexpensive_builtin (decl))
cost = weights->target_builtin_call_cost;
else
cost = weights->call_cost;
- if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
- switch (DECL_FUNCTION_CODE (decl))
- {
- /* Builtins that expand to constants. */
- case BUILT_IN_CONSTANT_P:
- case BUILT_IN_EXPECT:
- case BUILT_IN_OBJECT_SIZE:
- case BUILT_IN_UNREACHABLE:
- /* Simple register moves or loads from stack. */
- case BUILT_IN_RETURN_ADDRESS:
- case BUILT_IN_EXTRACT_RETURN_ADDR:
- case BUILT_IN_FROB_RETURN_ADDR:
- case BUILT_IN_RETURN:
- case BUILT_IN_AGGREGATE_INCOMING_ADDRESS:
- case BUILT_IN_FRAME_ADDRESS:
- case BUILT_IN_VA_END:
- case BUILT_IN_STACK_SAVE:
- case BUILT_IN_STACK_RESTORE:
- /* Exception state returns or moves registers around. */
- case BUILT_IN_EH_FILTER:
- case BUILT_IN_EH_POINTER:
- case BUILT_IN_EH_COPY_VALUES:
- return 0;
-
- /* builtins that are not expensive (that is they are most probably
- expanded inline into resonably simple code). */
- case BUILT_IN_ABS:
- case BUILT_IN_ALLOCA:
- case BUILT_IN_BSWAP32:
- case BUILT_IN_BSWAP64:
- case BUILT_IN_CLZ:
- case BUILT_IN_CLZIMAX:
- case BUILT_IN_CLZL:
- case BUILT_IN_CLZLL:
- case BUILT_IN_CTZ:
- case BUILT_IN_CTZIMAX:
- case BUILT_IN_CTZL:
- case BUILT_IN_CTZLL:
- case BUILT_IN_FFS:
- case BUILT_IN_FFSIMAX:
- case BUILT_IN_FFSL:
- case BUILT_IN_FFSLL:
- case BUILT_IN_IMAXABS:
- case BUILT_IN_FINITE:
- case BUILT_IN_FINITEF:
- case BUILT_IN_FINITEL:
- case BUILT_IN_FINITED32:
- case BUILT_IN_FINITED64:
- case BUILT_IN_FINITED128:
- case BUILT_IN_FPCLASSIFY:
- case BUILT_IN_ISFINITE:
- case BUILT_IN_ISINF_SIGN:
- case BUILT_IN_ISINF:
- case BUILT_IN_ISINFF:
- case BUILT_IN_ISINFL:
- case BUILT_IN_ISINFD32:
- case BUILT_IN_ISINFD64:
- case BUILT_IN_ISINFD128:
- case BUILT_IN_ISNAN:
- case BUILT_IN_ISNANF:
- case BUILT_IN_ISNANL:
- case BUILT_IN_ISNAND32:
- case BUILT_IN_ISNAND64:
- case BUILT_IN_ISNAND128:
- case BUILT_IN_ISNORMAL:
- case BUILT_IN_ISGREATER:
- case BUILT_IN_ISGREATEREQUAL:
- case BUILT_IN_ISLESS:
- case BUILT_IN_ISLESSEQUAL:
- case BUILT_IN_ISLESSGREATER:
- case BUILT_IN_ISUNORDERED:
- case BUILT_IN_VA_ARG_PACK:
- case BUILT_IN_VA_ARG_PACK_LEN:
- case BUILT_IN_VA_COPY:
- case BUILT_IN_TRAP:
- case BUILT_IN_SAVEREGS:
- case BUILT_IN_POPCOUNTL:
- case BUILT_IN_POPCOUNTLL:
- case BUILT_IN_POPCOUNTIMAX:
- case BUILT_IN_POPCOUNT:
- case BUILT_IN_PARITYL:
- case BUILT_IN_PARITYLL:
- case BUILT_IN_PARITYIMAX:
- case BUILT_IN_PARITY:
- case BUILT_IN_LABS:
- case BUILT_IN_LLABS:
- case BUILT_IN_PREFETCH:
- cost = weights->target_builtin_call_cost;
- break;
-
- default:
- break;
- }
-
if (decl)
funtype = TREE_TYPE (decl);
@@ -3557,7 +3505,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
if (decl && DECL_ARGUMENTS (decl) && !stdarg)
{
tree arg;
- for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (decl); arg; arg = DECL_CHAIN (arg))
if (!VOID_TYPE_P (TREE_TYPE (arg)))
cost += estimate_move_cost (TREE_TYPE (arg));
}
@@ -3722,6 +3670,26 @@ prepend_lexical_block (tree current_block, tree new_block)
BLOCK_SUPERCONTEXT (new_block) = current_block;
}
+/* Add local variables from CALLEE to CALLER. */
+
+static inline void
+add_local_variables (struct function *callee, struct function *caller,
+ copy_body_data *id, bool check_var_ann)
+{
+ tree var;
+ unsigned ix;
+
+ FOR_EACH_LOCAL_DECL (callee, ix, var)
+ if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
+ {
+ if (!check_var_ann
+ || (var_ann (var) && add_referenced_var (var)))
+ add_local_decl (caller, var);
+ }
+ else if (!can_be_nonlocal (var, id))
+ add_local_decl (caller, remap_decl (var, id));
+}
+
/* Fetch callee declaration from the call graph edge going from NODE and
associated with STMR call statement. Return NULL_TREE if not found. */
static tree
@@ -3754,8 +3722,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
gimple_stmt_iterator gsi, stmt_gsi;
bool successfully_inlined = FALSE;
bool purge_dead_abnormal_edges;
- tree t_step;
- tree var;
/* Set input_location here so we get the right instantiation context
if we call instantiate_decl from inlinable_function_p. */
@@ -3956,23 +3922,10 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
}
/* Declare the return variable for the function. */
- use_retvar = declare_return_variable (id, return_slot, modify_dest);
+ use_retvar = declare_return_variable (id, return_slot, modify_dest, bb);
/* Add local vars in this inlined callee to caller. */
- t_step = id->src_cfun->local_decls;
- for (; t_step; t_step = TREE_CHAIN (t_step))
- {
- var = TREE_VALUE (t_step);
- if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
- {
- if (var_ann (var) && add_referenced_var (var))
- cfun->local_decls = tree_cons (NULL_TREE, var,
- cfun->local_decls);
- }
- else if (!can_be_nonlocal (var, id))
- cfun->local_decls = tree_cons (NULL_TREE, remap_decl (var, id),
- cfun->local_decls);
- }
+ add_local_variables (id->src_cfun, cfun, id, true);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -4710,11 +4663,11 @@ static void
declare_inline_vars (tree block, tree vars)
{
tree t;
- for (t = vars; t; t = TREE_CHAIN (t))
+ for (t = vars; t; t = DECL_CHAIN (t))
{
DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
gcc_assert (!TREE_STATIC (t) && !TREE_ASM_WRITTEN (t));
- cfun->local_decls = tree_cons (NULL_TREE, t, cfun->local_decls);
+ add_local_decl (cfun, t);
}
if (block)
@@ -4859,13 +4812,13 @@ copy_arguments_for_versioning (tree orig_parm, copy_body_data * id,
parg = &new_parm;
- for (arg = orig_parm; arg; arg = TREE_CHAIN (arg), i++)
+ for (arg = orig_parm; arg; arg = DECL_CHAIN (arg), i++)
if (!args_to_skip || !bitmap_bit_p (args_to_skip, i))
{
tree new_tree = remap_decl (arg, id);
lang_hooks.dup_lang_specific_decl (new_tree);
*parg = new_tree;
- parg = &TREE_CHAIN (new_tree);
+ parg = &DECL_CHAIN (new_tree);
}
else if (!pointer_map_contains (id->decl_map, arg))
{
@@ -4877,7 +4830,7 @@ copy_arguments_for_versioning (tree orig_parm, copy_body_data * id,
add_referenced_var (var);
insert_decl_map (id, arg, var);
/* Declare this new variable. */
- TREE_CHAIN (var) = *vars;
+ DECL_CHAIN (var) = *vars;
*vars = var;
}
return new_parm;
@@ -4890,11 +4843,11 @@ copy_static_chain (tree static_chain, copy_body_data * id)
tree *chain_copy, *pvar;
chain_copy = &static_chain;
- for (pvar = chain_copy; *pvar; pvar = &TREE_CHAIN (*pvar))
+ for (pvar = chain_copy; *pvar; pvar = &DECL_CHAIN (*pvar))
{
tree new_tree = remap_decl (*pvar, id);
lang_hooks.dup_lang_specific_decl (new_tree);
- TREE_CHAIN (new_tree) = TREE_CHAIN (*pvar);
+ DECL_CHAIN (new_tree) = DECL_CHAIN (*pvar);
*pvar = new_tree;
}
return static_chain;
@@ -5045,7 +4998,6 @@ tree_function_versioning (tree old_decl, tree new_decl,
basic_block old_entry_block, bb;
VEC (gimple, heap) *init_stmts = VEC_alloc (gimple, heap, 10);
- tree t_step;
tree old_current_function_decl = current_function_decl;
tree vars = NULL_TREE;
@@ -5129,7 +5081,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
{
int i = replace_info->parm_num;
tree parm;
- for (parm = DECL_ARGUMENTS (old_decl); i; parm = TREE_CHAIN (parm))
+ for (parm = DECL_ARGUMENTS (old_decl); i; parm = DECL_CHAIN (parm))
i --;
replace_info->old_tree = parm;
}
@@ -5170,19 +5122,9 @@ tree_function_versioning (tree old_decl, tree new_decl,
declare_inline_vars (DECL_INITIAL (new_decl), vars);
- if (DECL_STRUCT_FUNCTION (old_decl)->local_decls != NULL_TREE)
+ if (!VEC_empty (tree, DECL_STRUCT_FUNCTION (old_decl)->local_decls))
/* Add local vars. */
- for (t_step = DECL_STRUCT_FUNCTION (old_decl)->local_decls;
- t_step; t_step = TREE_CHAIN (t_step))
- {
- tree var = TREE_VALUE (t_step);
- if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
- cfun->local_decls = tree_cons (NULL_TREE, var, cfun->local_decls);
- else if (!can_be_nonlocal (var, &id))
- cfun->local_decls =
- tree_cons (NULL_TREE, remap_decl (var, &id),
- cfun->local_decls);
- }
+ add_local_variables (DECL_STRUCT_FUNCTION (old_decl), cfun, &id, false);
/* Copy the Function's body. */
copy_body (&id, old_entry_block->count, REG_BR_PROB_BASE,
@@ -5242,7 +5184,15 @@ tree_function_versioning (tree old_decl, tree new_decl,
for (e = new_version_node->callees; e; e = e->next_callee)
{
basic_block bb = gimple_bb (e->call_stmt);
- e->frequency = compute_call_stmt_bb_frequency (current_function_decl, bb);
+ e->frequency = compute_call_stmt_bb_frequency (current_function_decl,
+ bb);
+ e->count = bb->count;
+ }
+ for (e = new_version_node->indirect_calls; e; e = e->next_callee)
+ {
+ basic_block bb = gimple_bb (e->call_stmt);
+ e->frequency = compute_call_stmt_bb_frequency (current_function_decl,
+ bb);
e->count = bb->count;
}
}
@@ -5278,7 +5228,7 @@ maybe_inline_call_in_expr (tree exp)
/* Remap the parameters. */
for (param = DECL_ARGUMENTS (fn), arg = first_call_expr_arg (exp, &iter);
param;
- param = TREE_CHAIN (param), arg = next_call_expr_arg (&iter))
+ param = DECL_CHAIN (param), arg = next_call_expr_arg (&iter))
*pointer_map_insert (decl_map, param) = arg;
memset (&id, 0, sizeof (id));
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index 7f62ffc4f10..a8a33aa84d9 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -185,6 +185,6 @@ extern tree remap_decl (tree decl, copy_body_data *id);
extern tree remap_type (tree type, copy_body_data *id);
extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
-extern HOST_WIDE_INT estimated_stack_frame_size (void);
+extern HOST_WIDE_INT estimated_stack_frame_size (tree);
#endif /* GCC_TREE_INLINE_H */
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 05b313cbe3e..e7c4eca1bb9 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -556,7 +556,7 @@ set_livein_block (tree var, basic_block bb)
/* Return true if symbol SYM is marked for renaming. */
-static inline bool
+bool
symbol_marked_for_renaming (tree sym)
{
return bitmap_bit_p (SYMS_TO_RENAME (cfun), DECL_UID (sym));
@@ -1470,11 +1470,7 @@ dump_decl_set (FILE *file, bitmap set)
EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
{
- struct tree_decl_minimal in;
- tree var;
- in.uid = i;
- var = (tree) htab_find_with_hash (gimple_referenced_vars (cfun),
- &in, i);
+ tree var = referenced_var_lookup (i);
if (var)
print_generic_expr (file, var, 0);
else
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index be1a1ee2058..099a7fe479f 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -397,7 +397,7 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
op1 = gimple_assign_rhs1 (write);
if (!(TREE_CODE (op0) == ARRAY_REF
- || TREE_CODE (op0) == INDIRECT_REF))
+ || TREE_CODE (op0) == MEM_REF))
goto end;
/* The new statements will be placed before LOOP. */
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 2437bc48470..99c5bce1726 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -322,7 +322,7 @@ mf_make_mf_cache_struct_type (tree field_type)
tree struct_type = make_node (RECORD_TYPE);
DECL_CONTEXT (fieldlo) = struct_type;
DECL_CONTEXT (fieldhi) = struct_type;
- TREE_CHAIN (fieldlo) = fieldhi;
+ DECL_CHAIN (fieldlo) = fieldhi;
TYPE_FIELDS (struct_type) = fieldlo;
TYPE_NAME (struct_type) = get_identifier ("__mf_cache");
layout_type (struct_type);
@@ -622,7 +622,7 @@ mf_build_check_statement_for (tree base, tree limit,
u = build3 (COMPONENT_REF, mf_uintptr_type,
build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem),
- TREE_CHAIN (TYPE_FIELDS (mf_cache_struct_type)), NULL_TREE);
+ DECL_CHAIN (TYPE_FIELDS (mf_cache_struct_type)), NULL_TREE);
v = mf_limit;
@@ -790,7 +790,8 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
}
else if (TREE_CODE (var) == COMPONENT_REF)
var = TREE_OPERAND (var, 0);
- else if (INDIRECT_REF_P (var))
+ else if (INDIRECT_REF_P (var)
+ || TREE_CODE (var) == MEM_REF)
{
base = TREE_OPERAND (var, 0);
break;
@@ -868,6 +869,18 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
size_int (-1));
break;
+ case MEM_REF:
+ addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (TREE_OPERAND (t, 1)),
+ TREE_OPERAND (t, 0),
+ fold_convert (sizetype, TREE_OPERAND (t, 1)));
+ base = addr;
+ limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
+ fold_build2_loc (location,
+ POINTER_PLUS_EXPR, ptr_type_node, base,
+ size),
+ size_int (-1));
+ break;
+
case TARGET_MEM_REF:
addr = tree_mem_ref_addr (ptr_type_node, t);
base = addr;
@@ -1061,7 +1074,7 @@ mx_register_decls (tree decl, gimple_seq seq, location_t location)
unregister_fncall = gimple_build_call (mf_unregister_fndecl, 3,
unregister_fncall_param,
size,
- build_int_cst (NULL_TREE, 3));
+ integer_three_node);
variable_name = mf_varname_tree (decl);
@@ -1074,7 +1087,7 @@ mx_register_decls (tree decl, gimple_seq seq, location_t location)
register_fncall = gimple_build_call (mf_register_fndecl, 4,
register_fncall_param,
size,
- build_int_cst (NULL_TREE, 3),
+ integer_three_node,
variable_name);
@@ -1101,7 +1114,7 @@ mx_register_decls (tree decl, gimple_seq seq, location_t location)
mf_mark (decl);
}
- decl = TREE_CHAIN (decl);
+ decl = DECL_CHAIN (decl);
}
/* Actually, (initially_stmts!=NULL) <=> (finally_stmts!=NULL) */
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index cd153074095..81ae38f6f3a 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -84,6 +84,7 @@ struct nesting_info
struct pointer_map_t *field_map;
struct pointer_map_t *var_map;
+ struct pointer_set_t *mem_refs;
bitmap suppress_expansion;
tree context;
@@ -147,7 +148,7 @@ create_tmp_var_for (struct nesting_info *info, tree type, const char *prefix)
tmp_var = create_tmp_var_raw (type, prefix);
DECL_CONTEXT (tmp_var) = info->context;
- TREE_CHAIN (tmp_var) = info->new_local_var_chain;
+ DECL_CHAIN (tmp_var) = info->new_local_var_chain;
DECL_SEEN_IN_BIND_EXPR_P (tmp_var) = 1;
if (TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
@@ -197,11 +198,11 @@ insert_field_into_struct (tree type, tree field)
DECL_CONTEXT (field) = type;
- for (p = &TYPE_FIELDS (type); *p ; p = &TREE_CHAIN (*p))
+ for (p = &TYPE_FIELDS (type); *p ; p = &DECL_CHAIN (*p))
if (DECL_ALIGN (field) >= DECL_ALIGN (*p))
break;
- TREE_CHAIN (field) = *p;
+ DECL_CHAIN (field) = *p;
*p = field;
/* Set correct alignment for frame struct type. */
@@ -697,7 +698,7 @@ check_for_nested_with_variably_modified (tree fndecl, tree orig_fndecl)
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
{
- for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = DECL_CHAIN (arg))
if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
return true;
@@ -717,6 +718,7 @@ create_nesting_tree (struct cgraph_node *cgn)
struct nesting_info *info = XCNEW (struct nesting_info);
info->field_map = pointer_map_create ();
info->var_map = pointer_map_create ();
+ info->mem_refs = pointer_set_create ();
info->suppress_expansion = BITMAP_ALLOC (&nesting_info_bitmap_obstack);
info->context = cgn->decl;
@@ -758,7 +760,7 @@ get_static_chain (struct nesting_info *info, tree target_context,
{
tree field = get_chain_field (i);
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
x = init_tmp_var (info, x, gsi);
}
@@ -793,12 +795,12 @@ get_frame_field (struct nesting_info *info, tree target_context,
{
tree field = get_chain_field (i);
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
x = init_tmp_var (info, x, gsi);
}
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
}
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
@@ -841,16 +843,16 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl)
for (i = info->outer; i->context != target_context; i = i->outer)
{
field = get_chain_field (i);
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
}
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
}
field = lookup_field_for_decl (i, decl, INSERT);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
if (use_pointer_in_frame (decl))
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
/* ??? We should be remapping types as well, surely. */
new_decl = build_decl (DECL_SOURCE_LOCATION (decl),
@@ -873,7 +875,7 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl)
DECL_HAS_VALUE_EXPR_P (new_decl) = 1;
*slot = new_decl;
- TREE_CHAIN (new_decl) = info->debug_var_chain;
+ DECL_CHAIN (new_decl) = info->debug_var_chain;
info->debug_var_chain = new_decl;
if (!optimize
@@ -927,7 +929,7 @@ convert_nonlocal_reference_op (tree *tp, int *walk_subtrees, void *data)
if (use_pointer_in_frame (t))
{
x = init_tmp_var (info, x, &wi->gsi);
- x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
+ x = build_simple_mem_ref (x);
}
}
@@ -1200,7 +1202,7 @@ note_nonlocal_block_vlas (struct nesting_info *info, tree block)
{
tree var;
- for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var))
+ for (var = BLOCK_VARS (block); var; var = DECL_CHAIN (var))
if (TREE_CODE (var) == VAR_DECL
&& variably_modified_type_p (TREE_TYPE (var), NULL)
&& DECL_HAS_VALUE_EXPR_P (var)
@@ -1365,7 +1367,7 @@ get_local_debug_decl (struct nesting_info *info, tree decl, tree field)
DECL_HAS_VALUE_EXPR_P (new_decl) = 1;
*slot = new_decl;
- TREE_CHAIN (new_decl) = info->debug_var_chain;
+ DECL_CHAIN (new_decl) = info->debug_var_chain;
info->debug_var_chain = new_decl;
/* Do not emit debug info twice. */
@@ -1498,6 +1500,21 @@ convert_local_reference_op (tree *tp, int *walk_subtrees, void *data)
wi->val_only = save_val_only;
break;
+ case MEM_REF:
+ save_val_only = wi->val_only;
+ wi->val_only = true;
+ wi->is_lhs = false;
+ walk_tree (&TREE_OPERAND (t, 0), convert_local_reference_op,
+ wi, NULL);
+ /* We need to re-fold the MEM_REF as component references as
+ part of a ADDR_EXPR address are not allowed. But we cannot
+ fold here, as the chain record type is not yet finalized. */
+ if (TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR
+ && !DECL_P (TREE_OPERAND (TREE_OPERAND (t, 0), 0)))
+ pointer_set_insert (info->mem_refs, tp);
+ wi->val_only = save_val_only;
+ break;
+
case VIEW_CONVERT_EXPR:
/* Just request to look at the subtrees, leaving val_only and lhs
untouched. This might actually be for !val_only + lhs, in which
@@ -2179,7 +2196,7 @@ remap_vla_decls (tree block, struct nesting_info *root)
subblock = BLOCK_CHAIN (subblock))
remap_vla_decls (subblock, root);
- for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var))
+ for (var = BLOCK_VARS (block); var; var = DECL_CHAIN (var))
{
if (TREE_CODE (var) == VAR_DECL
&& variably_modified_type_p (TREE_TYPE (var), NULL)
@@ -2200,7 +2217,7 @@ remap_vla_decls (tree block, struct nesting_info *root)
id.cb.decl_map = pointer_map_create ();
id.root = root;
- for (; var; var = TREE_CHAIN (var))
+ for (; var; var = DECL_CHAIN (var))
if (TREE_CODE (var) == VAR_DECL
&& variably_modified_type_p (TREE_TYPE (var), NULL)
&& DECL_HAS_VALUE_EXPR_P (var))
@@ -2247,6 +2264,15 @@ remap_vla_decls (tree block, struct nesting_info *root)
pointer_map_destroy (id.cb.decl_map);
}
+/* Fold the MEM_REF *E. */
+static bool
+fold_mem_refs (const void *e, void *data ATTRIBUTE_UNUSED)
+{
+ tree *ref_p = CONST_CAST2(tree *, const tree *, (const tree *)e);
+ *ref_p = fold (*ref_p);
+ return true;
+}
+
/* Do "everything else" to clean up or complete state collected by the
various walking passes -- lay out the types and decls, generate code
to initialize the frame decl, store critical expressions in the
@@ -2282,11 +2308,11 @@ finalize_nesting_tree_1 (struct nesting_info *root)
expression get substituted in instantiate_virtual_regs(). */
for (adjust = &root->new_local_var_chain;
*adjust != root->frame_decl;
- adjust = &TREE_CHAIN (*adjust))
- gcc_assert (TREE_CHAIN (*adjust));
- *adjust = TREE_CHAIN (*adjust);
+ adjust = &DECL_CHAIN (*adjust))
+ gcc_assert (DECL_CHAIN (*adjust));
+ *adjust = DECL_CHAIN (*adjust);
- TREE_CHAIN (root->frame_decl) = NULL_TREE;
+ DECL_CHAIN (root->frame_decl) = NULL_TREE;
declare_vars (root->frame_decl,
gimple_seq_first_stmt (gimple_body (context)), true);
}
@@ -2297,7 +2323,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
if (root->any_parm_remapped)
{
tree p;
- for (p = DECL_ARGUMENTS (context); p ; p = TREE_CHAIN (p))
+ for (p = DECL_ARGUMENTS (context); p ; p = DECL_CHAIN (p))
{
tree field, x, y;
@@ -2402,7 +2428,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
remap_vla_decls (DECL_INITIAL (root->context), root);
for (debug_var = root->debug_var_chain; debug_var;
- debug_var = TREE_CHAIN (debug_var))
+ debug_var = DECL_CHAIN (debug_var))
if (variably_modified_type_p (TREE_TYPE (debug_var), NULL))
break;
@@ -2417,7 +2443,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
id.cb.decl_map = pointer_map_create ();
id.root = root;
- for (; debug_var; debug_var = TREE_CHAIN (debug_var))
+ for (; debug_var; debug_var = DECL_CHAIN (debug_var))
if (variably_modified_type_p (TREE_TYPE (debug_var), NULL))
{
tree type = TREE_TYPE (debug_var);
@@ -2461,6 +2487,9 @@ finalize_nesting_tree_1 (struct nesting_info *root)
root->debug_var_chain);
}
+ /* Fold the rewritten MEM_REF trees. */
+ pointer_set_traverse (root->mem_refs, fold_mem_refs, NULL);
+
/* Dump the translated tree function. */
if (dump_file)
{
@@ -2514,6 +2543,7 @@ free_nesting_tree (struct nesting_info *root)
next = iter_nestinfo_next (node);
pointer_map_destroy (node->var_map);
pointer_map_destroy (node->field_map);
+ pointer_set_destroy (node->mem_refs);
free (node);
node = next;
}
diff --git a/gcc/tree-nomudflap.c b/gcc/tree-nomudflap.c
index 4d54efdf089..41fb39e0121 100644
--- a/gcc/tree-nomudflap.c
+++ b/gcc/tree-nomudflap.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-mudflap.h"
#include "tree-pass.h"
#include "ggc.h"
+#include "diagnostic-core.h"
#include "toplev.h"
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 31de9ba7753..2f40d563d33 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -259,6 +259,9 @@ tree_nrv (void)
}
}
+ SET_DECL_VALUE_EXPR (found, result);
+ DECL_HAS_VALUE_EXPR_P (found) = 1;
+
/* FOUND is no longer used. Ensure it gets removed. */
var_ann (found)->used = 0;
return 0;
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 5c7d6f599c8..0ea5538640f 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-pretty-print.h"
#include "gimple-pretty-print.h"
@@ -141,6 +142,10 @@ compute_object_offset (const_tree expr, const_tree var)
off = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (TREE_TYPE (expr)), t);
break;
+ case MEM_REF:
+ gcc_assert (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR);
+ return TREE_OPERAND (expr, 1);
+
default:
return error_mark_node;
}
@@ -166,15 +171,21 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
pt_var = get_base_address (pt_var);
if (pt_var
- && TREE_CODE (pt_var) == INDIRECT_REF
+ && TREE_CODE (pt_var) == MEM_REF
&& TREE_CODE (TREE_OPERAND (pt_var, 0)) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (pt_var, 0))))
{
unsigned HOST_WIDE_INT sz;
if (!osi || (object_size_type & 1) != 0)
- sz = compute_builtin_object_size (TREE_OPERAND (pt_var, 0),
- object_size_type & ~1);
+ {
+ sz = compute_builtin_object_size (TREE_OPERAND (pt_var, 0),
+ object_size_type & ~1);
+ if (host_integerp (TREE_OPERAND (pt_var, 1), 0))
+ sz -= TREE_INT_CST_LOW (TREE_OPERAND (pt_var, 1));
+ else
+ sz = offset_limit;
+ }
else
{
tree var = TREE_OPERAND (pt_var, 0);
@@ -185,6 +196,10 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
sz = object_sizes[object_size_type][SSA_NAME_VERSION (var)];
else
sz = unknown[object_size_type];
+ if (host_integerp (TREE_OPERAND (pt_var, 1), 0))
+ sz -= TREE_INT_CST_LOW (TREE_OPERAND (pt_var, 1));
+ else
+ sz = offset_limit;
}
if (sz != unknown[object_size_type] && sz < offset_limit)
@@ -225,7 +240,7 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
&& tree_int_cst_lt (pt_var_size,
TYPE_SIZE_UNIT (TREE_TYPE (var)))))
var = pt_var;
- else if (var != pt_var && TREE_CODE (pt_var) == INDIRECT_REF)
+ else if (var != pt_var && TREE_CODE (pt_var) == MEM_REF)
{
tree v = var;
/* For &X->fld, compute object size only if fld isn't the last
@@ -275,8 +290,8 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (v, 0)))
== RECORD_TYPE)
{
- tree fld_chain = TREE_CHAIN (TREE_OPERAND (v, 1));
- for (; fld_chain; fld_chain = TREE_CHAIN (fld_chain))
+ tree fld_chain = DECL_CHAIN (TREE_OPERAND (v, 1));
+ for (; fld_chain; fld_chain = DECL_CHAIN (fld_chain))
if (TREE_CODE (fld_chain) == FIELD_DECL)
break;
@@ -328,12 +343,14 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
}
if (var != pt_var
&& pt_var_size
- && TREE_CODE (pt_var) == INDIRECT_REF
+ && TREE_CODE (pt_var) == MEM_REF
&& bytes != error_mark_node)
{
tree bytes2 = compute_object_offset (TREE_OPERAND (ptr, 0), pt_var);
if (bytes2 != error_mark_node)
{
+ bytes2 = size_binop (PLUS_EXPR, bytes2,
+ TREE_OPERAND (pt_var, 1));
if (TREE_CODE (bytes2) == INTEGER_CST
&& tree_int_cst_lt (pt_var_size, bytes2))
bytes2 = size_zero_node;
@@ -746,10 +763,20 @@ plus_stmt_object_size (struct object_size_info *osi, tree var, gimple stmt)
unsigned HOST_WIDE_INT bytes;
tree op0, op1;
- gcc_assert (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR);
-
- op0 = gimple_assign_rhs1 (stmt);
- op1 = gimple_assign_rhs2 (stmt);
+ if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ {
+ op0 = gimple_assign_rhs1 (stmt);
+ op1 = gimple_assign_rhs2 (stmt);
+ }
+ else if (gimple_assign_rhs_code (stmt) == ADDR_EXPR)
+ {
+ tree rhs = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
+ gcc_assert (TREE_CODE (rhs) == MEM_REF);
+ op0 = TREE_OPERAND (rhs, 0);
+ op1 = TREE_OPERAND (rhs, 1);
+ }
+ else
+ gcc_unreachable ();
if (object_sizes[object_size_type][varno] == unknown[object_size_type])
return false;
@@ -897,13 +924,14 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
{
case GIMPLE_ASSIGN:
{
- if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ tree rhs = gimple_assign_rhs1 (stmt);
+ if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
+ || (gimple_assign_rhs_code (stmt) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == MEM_REF))
reexamine = plus_stmt_object_size (osi, var, stmt);
else if (gimple_assign_single_p (stmt)
|| gimple_assign_unary_nop_p (stmt))
{
- tree rhs = gimple_assign_rhs1 (stmt);
-
if (TREE_CODE (rhs) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (rhs)))
reexamine = merge_object_sizes (osi, var, rhs, 0);
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index ef60cde53bf..5df3fdb75cf 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "function.h"
#include "langhooks.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "flags.h"
#include "cgraph.h"
@@ -86,13 +87,27 @@ gate_all_early_local_passes (void)
return (!seen_error () && !in_lto_p);
}
+static unsigned int
+execute_all_early_local_passes (void)
+{
+ /* Once this pass (and its sub-passes) are complete, all functions
+ will be in SSA form. Technically this state change is happening
+ a tad early, since the sub-passes have not yet run, but since
+ none of the sub-passes are IPA passes and do not create new
+ functions, this is ok. We're setting this value for the benefit
+ of IPA passes that follow. */
+ if (cgraph_state < CGRAPH_STATE_IPA_SSA)
+ cgraph_state = CGRAPH_STATE_IPA_SSA;
+ return 0;
+}
+
struct simple_ipa_opt_pass pass_early_local_passes =
{
{
SIMPLE_IPA_PASS,
"early_local_cleanups", /* name */
gate_all_early_local_passes, /* gate */
- NULL, /* execute */
+ execute_all_early_local_passes, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
@@ -105,18 +120,6 @@ struct simple_ipa_opt_pass pass_early_local_passes =
}
};
-static unsigned int
-execute_early_local_optimizations (void)
-{
- /* First time we start with early optimization we need to advance
- cgraph state so newly inserted functions are also early optimized.
- However we execute early local optimizations for lately inserted
- functions, in that case don't reset cgraph state back to IPA_SSA. */
- if (cgraph_state < CGRAPH_STATE_IPA_SSA)
- cgraph_state = CGRAPH_STATE_IPA_SSA;
- return 0;
-}
-
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
@@ -133,7 +136,7 @@ struct gimple_opt_pass pass_all_early_optimizations =
GIMPLE_PASS,
"early_optimizations", /* name */
gate_all_early_optimizations, /* gate */
- execute_early_local_optimizations, /* execute */
+ NULL, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
@@ -190,6 +193,35 @@ execute_cleanup_cfg_post_optimizing (void)
cleanup_tree_cfg ();
cleanup_dead_labels ();
group_case_labels ();
+ if ((flag_compare_debug_opt || flag_compare_debug)
+ && flag_dump_final_insns)
+ {
+ FILE *final_output = fopen (flag_dump_final_insns, "a");
+
+ if (!final_output)
+ {
+ error ("could not open final insn dump file %qs: %m",
+ flag_dump_final_insns);
+ flag_dump_final_insns = NULL;
+ }
+ else
+ {
+ int save_unnumbered = flag_dump_unnumbered;
+ int save_noaddr = flag_dump_noaddr;
+
+ flag_dump_noaddr = flag_dump_unnumbered = 1;
+ fprintf (final_output, "\n");
+ dump_enumerated_decls (final_output, dump_flags | TDF_NOUID);
+ flag_dump_noaddr = save_noaddr;
+ flag_dump_unnumbered = save_unnumbered;
+ if (fclose (final_output))
+ {
+ error ("could not close final insn dump file %qs: %m",
+ flag_dump_final_insns);
+ flag_dump_final_insns = NULL;
+ }
+ }
+ }
return 0;
}
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 188cf0c8d7a..e5a35f40550 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "tree-pass.h"
#include "toplev.h"
+#include "diagnostic-core.h"
#include "ssaexpand.h"
/* FIXME: A lot of code here deals with expanding to RTL. All that code
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index a17655ed699..af2708667d2 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -357,7 +357,7 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address)
if (var_p != &obj)
{
- *var_p = build1 (INDIRECT_REF, TREE_TYPE (*var_p), name);
+ *var_p = build_simple_mem_ref (name);
name = force_gimple_operand (build_addr (obj, current_function_decl),
&stmts, true, NULL_TREE);
if (!gimple_seq_empty_p (stmts))
@@ -456,7 +456,7 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
type = TREE_TYPE (t);
addr_type = build_pointer_type (type);
addr = take_address_of (t, addr_type, dta->entry, dta->decl_address);
- *tp = build1 (INDIRECT_REF, TREE_TYPE (*tp), addr);
+ *tp = build_simple_mem_ref (addr);
dta->changed = true;
return NULL_TREE;
@@ -857,7 +857,6 @@ create_call_for_reduction_1 (void **slot, void *data)
struct clsn_data *const clsn_data = (struct clsn_data *) data;
gimple_stmt_iterator gsi;
tree type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi));
- tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
tree load_struct;
basic_block bb;
basic_block new_bb;
@@ -866,7 +865,7 @@ create_call_for_reduction_1 (void **slot, void *data)
tree tmp_load, name;
gimple load;
- load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load);
+ load_struct = build_simple_mem_ref (clsn_data->load);
t = build3 (COMPONENT_REF, type, load_struct, reduc->field, NULL_TREE);
addr = build_addr (t, current_function_decl);
@@ -925,13 +924,12 @@ create_loads_for_reductions (void **slot, void *data)
gimple stmt;
gimple_stmt_iterator gsi;
tree type = TREE_TYPE (gimple_assign_lhs (red->reduc_stmt));
- tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
tree load_struct;
tree name;
tree x;
gsi = gsi_after_labels (clsn_data->load_bb);
- load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load);
+ load_struct = build_simple_mem_ref (clsn_data->load);
load_struct = build3 (COMPONENT_REF, type, load_struct, red->field,
NULL_TREE);
@@ -1012,7 +1010,6 @@ create_loads_and_stores_for_name (void **slot, void *data)
gimple stmt;
gimple_stmt_iterator gsi;
tree type = TREE_TYPE (elt->new_name);
- tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
tree load_struct;
gsi = gsi_last_bb (clsn_data->store_bb);
@@ -1022,7 +1019,7 @@ create_loads_and_stores_for_name (void **slot, void *data)
gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
gsi = gsi_last_bb (clsn_data->load_bb);
- load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load);
+ load_struct = build_simple_mem_ref (clsn_data->load);
t = build3 (COMPONENT_REF, type, load_struct, elt->field, NULL_TREE);
stmt = gimple_build_assign (elt->new_name, t);
SSA_NAME_DEF_STMT (elt->new_name) = stmt;
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index a4c97b39155..c72d7cfa6da 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -81,6 +81,7 @@ enum tree_dump_index
holding this gimple statement. */
#define TDF_NOUID (1 << 20) /* omit UIDs from dumps. */
#define TDF_ALIAS (1 << 21) /* display alias information */
+#define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */
/* In tree-dump.c */
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index 05b63fbea88..7fb85d4ebd8 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "basic-block.h"
#include "tree-flow.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "gimple.h"
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index de147e7ec96..49683d5093b 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -925,7 +925,7 @@ add_ref_to_chain (chain_p chain, dref ref)
double_int dist;
gcc_assert (double_int_scmp (root->offset, ref->offset) <= 0);
- dist = double_int_add (ref->offset, double_int_neg (root->offset));
+ dist = double_int_sub (ref->offset, root->offset);
if (double_int_ucmp (uhwi_to_double_int (MAX_DISTANCE), dist) <= 0)
{
free (ref);
@@ -1199,8 +1199,7 @@ determine_roots_comp (struct loop *loop,
{
if (!chain || !DR_IS_READ (a->ref)
|| double_int_ucmp (uhwi_to_double_int (MAX_DISTANCE),
- double_int_add (a->offset,
- double_int_neg (last_ofs))) <= 0)
+ double_int_sub (a->offset, last_ofs)) <= 0)
{
if (nontrivial_chain_p (chain))
{
@@ -1345,14 +1344,16 @@ ref_at_iteration (struct loop *loop, tree ref, int iter)
if (!op0)
return NULL_TREE;
}
- else if (!INDIRECT_REF_P (ref))
+ else if (!INDIRECT_REF_P (ref)
+ && TREE_CODE (ref) != MEM_REF)
return unshare_expr (ref);
- if (INDIRECT_REF_P (ref))
+ if (INDIRECT_REF_P (ref)
+ || TREE_CODE (ref) == MEM_REF)
{
- /* Take care for INDIRECT_REF and MISALIGNED_INDIRECT_REF at
+ /* Take care for MEM_REF and MISALIGNED_INDIRECT_REF at
the same time. */
- ret = copy_node (ref);
+ ret = unshare_expr (ref);
idx = TREE_OPERAND (ref, 0);
idx_p = &TREE_OPERAND (ret, 0);
}
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index f7bbef43a18..4c03fbed332 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -71,7 +71,7 @@ do_niy (pretty_printer *buffer, const_tree node)
}
}
- pp_string (buffer, " >>>\n");
+ pp_string (buffer, " >>>");
}
/* Debugging function to print out a generic expression. */
@@ -757,6 +757,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_string (buffer, str);
if (TYPE_NAME (node) && DECL_NAME (TYPE_NAME (node)))
dump_decl_name (buffer, TYPE_NAME (node), flags);
+ else if (flags & TDF_NOUID)
+ pp_printf (buffer, "<Txxxx>");
else
pp_printf (buffer, "<T%x>", TYPE_UID (node));
@@ -794,6 +796,55 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
NIY;
break;
+ case MEM_REF:
+ {
+ if (integer_zerop (TREE_OPERAND (node, 1))
+ /* Same pointer types, but ignoring POINTER_TYPE vs.
+ REFERENCE_TYPE. */
+ && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
+ == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))
+ && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 0)))
+ == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 1))))
+ && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 0)))
+ == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 1))))
+ && (TYPE_QUALS (TREE_TYPE (TREE_OPERAND (node, 0)))
+ == TYPE_QUALS (TREE_TYPE (TREE_OPERAND (node, 1))))
+ /* Same value types ignoring qualifiers. */
+ && (TYPE_MAIN_VARIANT (TREE_TYPE (node))
+ == TYPE_MAIN_VARIANT
+ (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))))
+ {
+ if (TREE_CODE (TREE_OPERAND (node, 0)) != ADDR_EXPR)
+ {
+ pp_string (buffer, "*");
+ dump_generic_node (buffer, TREE_OPERAND (node, 0),
+ spc, flags, false);
+ }
+ else
+ dump_generic_node (buffer,
+ TREE_OPERAND (TREE_OPERAND (node, 0), 0),
+ spc, flags, false);
+ }
+ else
+ {
+ pp_string (buffer, "MEM[");
+ pp_string (buffer, "(");
+ dump_generic_node (buffer, TREE_TYPE (TREE_OPERAND (node, 1)),
+ spc, flags | TDF_SLIM, false);
+ pp_string (buffer, ")");
+ dump_generic_node (buffer, TREE_OPERAND (node, 0),
+ spc, flags, false);
+ if (!integer_zerop (TREE_OPERAND (node, 1)))
+ {
+ pp_string (buffer, " + ");
+ dump_generic_node (buffer, TREE_OPERAND (node, 1),
+ spc, flags, false);
+ }
+ pp_string (buffer, "]");
+ }
+ break;
+ }
+
case TARGET_MEM_REF:
{
const char *sep = "";
@@ -1032,6 +1083,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
}
if (TYPE_NAME (node) && DECL_NAME (TYPE_NAME (node)))
dump_decl_name (buffer, TYPE_NAME (node), flags);
+ else if (flags & TDF_NOUID)
+ pp_printf (buffer, "<Txxxx>");
else
pp_printf (buffer, "<T%x>", TYPE_UID (node));
dump_function_declaration (buffer, node, spc, flags);
@@ -1064,7 +1117,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
}
if (DECL_NAME (node))
dump_decl_name (buffer, node, flags);
- else
+ else if (TYPE_NAME (TREE_TYPE (node)) != node)
{
if ((TREE_CODE (TREE_TYPE (node)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (node)) == UNION_TYPE)
@@ -1083,6 +1136,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
}
}
+ else
+ pp_string (buffer, "<anon>");
break;
case VAR_DECL:
@@ -1100,7 +1155,25 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case COMPONENT_REF:
op0 = TREE_OPERAND (node, 0);
str = ".";
- if (op0 && TREE_CODE (op0) == INDIRECT_REF)
+ if (op0
+ && (TREE_CODE (op0) == INDIRECT_REF
+ || (TREE_CODE (op0) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (op0, 0)) != ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (op0, 1))
+ /* Same pointer types, but ignoring POINTER_TYPE vs.
+ REFERENCE_TYPE. */
+ && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0)))
+ == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1))))
+ && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 0)))
+ == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 1))))
+ && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0, 0)))
+ == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0, 1))))
+ && (TYPE_QUALS (TREE_TYPE (TREE_OPERAND (op0, 0)))
+ == TYPE_QUALS (TREE_TYPE (TREE_OPERAND (op0, 1))))
+ /* Same value types ignoring qualifiers. */
+ && (TYPE_MAIN_VARIANT (TREE_TYPE (op0))
+ == TYPE_MAIN_VARIANT
+ (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1))))))))
{
op0 = TREE_OPERAND (op0, 0);
str = "->";
@@ -1359,7 +1432,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
{
pp_newline (buffer);
- for (op0 = BIND_EXPR_VARS (node); op0; op0 = TREE_CHAIN (op0))
+ for (op0 = BIND_EXPR_VARS (node); op0; op0 = DECL_CHAIN (op0))
{
print_declaration (buffer, op0, spc+2, flags);
pp_newline (buffer);
@@ -1519,7 +1592,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case ADDR_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
if (TREE_CODE (node) == ADDR_EXPR
@@ -2244,7 +2316,7 @@ print_declaration (pretty_printer *buffer, tree t, int spc, int flags)
pp_string (buffer, "static ");
/* Print the type and name. */
- if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
+ if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
{
tree tmp;
@@ -2360,7 +2432,7 @@ print_struct_decl (pretty_printer *buffer, const_tree node, int spc, int flags)
print_declaration (buffer, tmp, spc+2, flags);
pp_newline (buffer);
}
- tmp = TREE_CHAIN (tmp);
+ tmp = DECL_CHAIN (tmp);
}
}
INDENT (spc);
@@ -2482,7 +2554,6 @@ op_code_prio (enum tree_code code)
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
case NEGATE_EXPR:
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
case ADDR_EXPR:
@@ -2653,9 +2724,6 @@ op_symbol_code (enum tree_code code)
case INDIRECT_REF:
return "*";
- case ALIGN_INDIRECT_REF:
- return "A*";
-
case MISALIGNED_INDIRECT_REF:
return "M*";
@@ -2760,6 +2828,13 @@ print_call_name (pretty_printer *buffer, tree node, int flags)
dump_generic_node (buffer, op0, 0, flags, false);
break;
+ case MEM_REF:
+ if (integer_zerop (TREE_OPERAND (op0, 1)))
+ {
+ op0 = TREE_OPERAND (op0, 0);
+ goto again;
+ }
+ /* Fallthru. */
case COMPONENT_REF:
case SSA_NAME:
case OBJ_TYPE_REF:
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 127082e1530..50ce013830d 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "regs.h"
#include "function.h"
#include "basic-block.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "coverage.h"
#include "tree.h"
@@ -340,7 +341,7 @@ tree_gen_ic_func_profiler (void)
basic_block bb;
edge_iterator ei;
gimple stmt1, stmt2;
- tree tree_uid, cur_func;
+ tree tree_uid, cur_func, counter_ptr, ptr_var;
if (cgraph_only_called_directly_p (c_node))
return;
@@ -358,13 +359,16 @@ tree_gen_ic_func_profiler (void)
build_addr (current_function_decl,
current_function_decl),
true, NULL_TREE,
- true, GSI_SAME_STMT);
+ true, GSI_NEW_STMT);
+ counter_ptr = force_gimple_operand_gsi (&gsi, ic_gcov_type_ptr_var,
+ true, NULL_TREE, false,
+ GSI_NEW_STMT);
+ ptr_var = force_gimple_operand_gsi (&gsi, ic_void_ptr_var,
+ true, NULL_TREE, false,
+ GSI_NEW_STMT);
tree_uid = build_int_cst (gcov_type_node, c_node->pid);
stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 4,
- ic_gcov_type_ptr_var,
- tree_uid,
- cur_func,
- ic_void_ptr_var);
+ counter_ptr, tree_uid, cur_func, ptr_var);
gsi_insert_after (&gsi, stmt1, GSI_NEW_STMT);
gcc_assert (EDGE_COUNT (bb->succs) == 1);
bb = split_edge (EDGE_I (bb->succs, 0));
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 13d897fd5ce..0e372567c89 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -1170,6 +1170,24 @@ follow_ssa_edge_expr (struct loop *loop, gimple at_stmt, tree expr,
halting_phi, evolution_of_loop, limit);
break;
+ case ADDR_EXPR:
+ /* Handle &MEM[ptr + CST] which is equivalent to POINTER_PLUS_EXPR. */
+ if (TREE_CODE (TREE_OPERAND (expr, 0)) == MEM_REF)
+ {
+ expr = TREE_OPERAND (expr, 0);
+ rhs0 = TREE_OPERAND (expr, 0);
+ rhs1 = TREE_OPERAND (expr, 1);
+ type = TREE_TYPE (rhs0);
+ STRIP_USELESS_TYPE_CONVERSION (rhs0);
+ STRIP_USELESS_TYPE_CONVERSION (rhs1);
+ res = follow_ssa_edge_binary (loop, at_stmt, type,
+ rhs0, POINTER_PLUS_EXPR, rhs1,
+ halting_phi, evolution_of_loop, limit);
+ }
+ else
+ res = t_false;
+ break;
+
case ASSERT_EXPR:
/* This assignment is of the form: "a_1 = ASSERT_EXPR <a_2, ...>"
It must be handled as a copy assignment of the form a_1 = a_2. */
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 84d950f770f..fa567e54e8b 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -90,6 +90,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "dbgcnt.h"
#include "tree-inline.h"
+#include "gimple-pretty-print.h"
/* Enumeration of all aggregate reductions we can do. */
enum sra_mode { SRA_MODE_EARLY_IPA, /* early call regularization */
@@ -634,7 +635,7 @@ type_internals_preclude_sra_p (tree type)
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
- for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
+ for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
if (TREE_CODE (fld) == FIELD_DECL)
{
tree ft = TREE_TYPE (fld);
@@ -697,7 +698,7 @@ mark_parm_dereference (tree base, HOST_WIDE_INT dist, gimple stmt)
for (parm = DECL_ARGUMENTS (current_function_decl);
parm && parm != base;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
parm_index++;
gcc_assert (parm_index < func_param_count);
@@ -751,7 +752,8 @@ create_access (tree expr, gimple stmt, bool write)
base = get_ref_base_and_extent (expr, &offset, &size, &max_size);
- if (sra_mode == SRA_MODE_EARLY_IPA && INDIRECT_REF_P (base))
+ if (sra_mode == SRA_MODE_EARLY_IPA
+ && TREE_CODE (base) == MEM_REF)
{
base = get_ssa_base_param (TREE_OPERAND (base, 0));
if (!base)
@@ -820,7 +822,7 @@ type_consists_of_records_p (tree type)
if (TREE_CODE (type) != RECORD_TYPE)
return false;
- for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
+ for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
if (TREE_CODE (fld) == FIELD_DECL)
{
tree ft = TREE_TYPE (fld);
@@ -848,7 +850,7 @@ completely_scalarize_record (tree base, tree decl, HOST_WIDE_INT offset)
{
tree fld, decl_type = TREE_TYPE (decl);
- for (fld = TYPE_FIELDS (decl_type); fld; fld = TREE_CHAIN (fld))
+ for (fld = TYPE_FIELDS (decl_type); fld; fld = DECL_CHAIN (fld))
if (TREE_CODE (fld) == FIELD_DECL)
{
HOST_WIDE_INT pos = offset + int_bit_position (fld);
@@ -885,15 +887,10 @@ completely_scalarize_record (tree base, tree decl, HOST_WIDE_INT offset)
static void
disqualify_base_of_expr (tree t, const char *reason)
{
- while (handled_component_p (t))
- t = TREE_OPERAND (t, 0);
-
- if (sra_mode == SRA_MODE_EARLY_IPA)
- {
- if (INDIRECT_REF_P (t))
- t = TREE_OPERAND (t, 0);
- t = get_ssa_base_param (t);
- }
+ t = get_base_address (t);
+ if (sra_mode == SRA_MODE_EARLY_IPA
+ && TREE_CODE (t) == MEM_REF)
+ t = get_ssa_base_param (TREE_OPERAND (t, 0));
if (t && DECL_P (t))
disqualify_candidate (t, reason);
@@ -935,8 +932,9 @@ build_access_from_expr_1 (tree expr, gimple stmt, bool write)
switch (TREE_CODE (expr))
{
- case INDIRECT_REF:
- if (sra_mode != SRA_MODE_EARLY_IPA)
+ case MEM_REF:
+ if (TREE_CODE (TREE_OPERAND (expr, 0)) != ADDR_EXPR
+ && sra_mode != SRA_MODE_EARLY_IPA)
return NULL;
/* fall through */
case VAR_DECL:
@@ -1285,7 +1283,21 @@ make_fancy_name_1 (tree expr)
break;
sprintf (buffer, HOST_WIDE_INT_PRINT_DEC, TREE_INT_CST_LOW (index));
obstack_grow (&name_obstack, buffer, strlen (buffer));
+ break;
+
+ case ADDR_EXPR:
+ make_fancy_name_1 (TREE_OPERAND (expr, 0));
+ break;
+ case MEM_REF:
+ make_fancy_name_1 (TREE_OPERAND (expr, 0));
+ if (!integer_zerop (TREE_OPERAND (expr, 1)))
+ {
+ obstack_1grow (&name_obstack, '$');
+ sprintf (buffer, HOST_WIDE_INT_PRINT_DEC,
+ TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)));
+ obstack_grow (&name_obstack, buffer, strlen (buffer));
+ }
break;
case BIT_FIELD_REF:
@@ -1308,7 +1320,11 @@ make_fancy_name (tree expr)
return XOBFINISH (&name_obstack, char *);
}
-/* Helper function for build_ref_for_offset. */
+/* Helper function for build_ref_for_offset.
+
+ FIXME: Eventually this should be rewritten to either re-use the
+ original access expression unshared (which is good for alias
+ analysis) or to build a MEM_REF expression. */
static bool
build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
@@ -1329,7 +1345,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
case UNION_TYPE:
case QUAL_UNION_TYPE:
case RECORD_TYPE:
- for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
+ for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
{
HOST_WIDE_INT pos, size;
tree expr, *expr_ptr;
@@ -1406,12 +1422,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
type TYPE at the given OFFSET of the type EXP_TYPE. If EXPR is NULL, the
function only determines whether it can build such a reference without
actually doing it, otherwise, the tree it points to is unshared first and
- then used as a base for furhter sub-references.
-
- FIXME: Eventually this should be replaced with
- maybe_fold_offset_to_reference() from tree-ssa-ccp.c but that requires a
- minor rewrite of fold_stmt.
- */
+ then used as a base for furhter sub-references. */
bool
build_ref_for_offset (tree *expr, tree type, HOST_WIDE_INT offset,
@@ -1426,7 +1437,7 @@ build_ref_for_offset (tree *expr, tree type, HOST_WIDE_INT offset,
{
type = TREE_TYPE (type);
if (expr)
- *expr = fold_build1_loc (loc, INDIRECT_REF, type, *expr);
+ *expr = build_simple_mem_ref_loc (loc, *expr);
}
return build_ref_for_offset_1 (expr, type, offset, exp_type);
@@ -2406,9 +2417,11 @@ handle_unscalarized_data_in_subtree (struct access *top_racc, tree lhs,
(sub)tree. If that is not possible, refresh the TOP_RACC base aggregate and
load the accesses from it. LEFT_OFFSET is the offset of the left whole
subtree being copied, RIGHT_OFFSET is the same thing for the right subtree.
- GSI is stmt iterator used for statement insertions. *REFRESHED is true iff
- the rhs top aggregate has already been refreshed by contents of its scalar
- reductions and is set to true if this function has to do it. */
+ NEW_GSI is stmt iterator used for statement insertions after the original
+ assignment, OLD_GSI is used to insert statements before the assignment.
+ *REFRESHED keeps the information whether we have needed to refresh
+ replacements of the LHS and from which side of the assignments this takes
+ place. */
static void
load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
@@ -2530,12 +2543,12 @@ sra_modify_constructor_assign (gimple *stmt, gimple_stmt_iterator *gsi)
}
}
-/* Create a new suitable default definition SSA_NAME and replace all uses of
- SSA with it, RACC is access describing the uninitialized part of an
- aggregate that is being loaded. */
+/* Create and return a new suitable default definition SSA_NAME for RACC which
+ is an access describing an uninitialized part of an aggregate that is being
+ loaded. */
-static void
-replace_uses_with_default_def_ssa_name (tree ssa, struct access *racc)
+static tree
+get_repl_default_def_ssa_name (struct access *racc)
{
tree repl, decl;
@@ -2548,7 +2561,7 @@ replace_uses_with_default_def_ssa_name (tree ssa, struct access *racc)
set_default_def (decl, repl);
}
- replace_uses_by (ssa, repl);
+ return repl;
}
/* Examine both sides of the assignment statement pointed to by STMT, replace
@@ -2712,9 +2725,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
&orig_gsi, gsi, &refreshed, lhs);
if (refreshed != SRA_UDH_RIGHT)
{
- if (*stmt == gsi_stmt (*gsi))
- gsi_next (gsi);
-
+ gsi_next (gsi);
unlink_stmt_vdef (*stmt);
gsi_remove (&orig_gsi, true);
sra_stats.deleted++;
@@ -2727,18 +2738,33 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
{
if (!racc->grp_to_be_replaced && !racc->grp_unscalarized_data)
{
- if (racc->first_child)
- generate_subtree_copies (racc->first_child, lhs,
- racc->offset, 0, 0, gsi,
- false, false);
- gcc_assert (*stmt == gsi_stmt (*gsi));
- if (TREE_CODE (lhs) == SSA_NAME)
- replace_uses_with_default_def_ssa_name (lhs, racc);
+ if (dump_file)
+ {
+ fprintf (dump_file, "Removing load: ");
+ print_gimple_stmt (dump_file, *stmt, 0, 0);
+ }
- unlink_stmt_vdef (*stmt);
- gsi_remove (gsi, true);
- sra_stats.deleted++;
- return SRA_AM_REMOVED;
+ if (TREE_CODE (lhs) == SSA_NAME)
+ {
+ rhs = get_repl_default_def_ssa_name (racc);
+ if (!useless_type_conversion_p (TREE_TYPE (lhs),
+ TREE_TYPE (rhs)))
+ rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR,
+ TREE_TYPE (lhs), rhs);
+ }
+ else
+ {
+ if (racc->first_child)
+ generate_subtree_copies (racc->first_child, lhs,
+ racc->offset, 0, 0, gsi,
+ false, false);
+
+ gcc_assert (*stmt == gsi_stmt (*gsi));
+ unlink_stmt_vdef (*stmt);
+ gsi_remove (gsi, true);
+ sra_stats.deleted++;
+ return SRA_AM_REMOVED;
+ }
}
else if (racc->first_child)
generate_subtree_copies (racc->first_child, lhs,
@@ -2765,11 +2791,13 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
}
/* Traverse the function body and all modifications as decided in
- analyze_all_variable_accesses. */
+ analyze_all_variable_accesses. Return true iff the CFG has been
+ changed. */
-static void
+static bool
sra_modify_function_body (void)
{
+ bool cfg_changed = false;
basic_block bb;
FOR_EACH_BB (bb)
@@ -2832,12 +2860,16 @@ sra_modify_function_body (void)
if (modified)
{
update_stmt (stmt);
- maybe_clean_eh_stmt (stmt);
+ if (maybe_clean_eh_stmt (stmt)
+ && gimple_purge_dead_eh_edges (gimple_bb (stmt)))
+ cfg_changed = true;
}
if (!deleted)
gsi_next (&gsi);
}
}
+
+ return cfg_changed;
}
/* Generate statements initializing scalar replacements of parts of function
@@ -2852,7 +2884,7 @@ initialize_parameter_reductions (void)
for (parm = DECL_ARGUMENTS (current_function_decl);
parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
{
VEC (access_p, heap) *access_vec;
struct access *access;
@@ -2897,7 +2929,10 @@ perform_intra_sra (void)
if (!analyze_all_variable_accesses ())
goto out;
- sra_modify_function_body ();
+ if (sra_modify_function_body ())
+ ret = TODO_update_ssa | TODO_cleanup_cfg;
+ else
+ ret = TODO_update_ssa;
initialize_parameter_reductions ();
statistics_counter_event (cfun, "Scalar replacements created",
@@ -2911,8 +2946,6 @@ perform_intra_sra (void)
statistics_counter_event (cfun, "Separate LHS and RHS handling",
sra_stats.separate_lhs_rhs_handling);
- ret = TODO_update_ssa;
-
out:
sra_deinitialize ();
return ret;
@@ -3026,8 +3059,11 @@ ptr_parm_has_direct_uses (tree parm)
tree lhs = gimple_get_lhs (stmt);
while (handled_component_p (lhs))
lhs = TREE_OPERAND (lhs, 0);
- if (INDIRECT_REF_P (lhs)
- && TREE_OPERAND (lhs, 0) == name)
+ if (TREE_CODE (lhs) == MEM_REF
+ && TREE_OPERAND (lhs, 0) == name
+ && integer_zerop (TREE_OPERAND (lhs, 1))
+ && types_compatible_p (TREE_TYPE (lhs),
+ TREE_TYPE (TREE_TYPE (name))))
uses_ok++;
}
if (gimple_assign_single_p (stmt))
@@ -3035,8 +3071,11 @@ ptr_parm_has_direct_uses (tree parm)
tree rhs = gimple_assign_rhs1 (stmt);
while (handled_component_p (rhs))
rhs = TREE_OPERAND (rhs, 0);
- if (INDIRECT_REF_P (rhs)
- && TREE_OPERAND (rhs, 0) == name)
+ if (TREE_CODE (rhs) == MEM_REF
+ && TREE_OPERAND (rhs, 0) == name
+ && integer_zerop (TREE_OPERAND (rhs, 1))
+ && types_compatible_p (TREE_TYPE (rhs),
+ TREE_TYPE (TREE_TYPE (name))))
uses_ok++;
}
else if (is_gimple_call (stmt))
@@ -3047,8 +3086,11 @@ ptr_parm_has_direct_uses (tree parm)
tree arg = gimple_call_arg (stmt, i);
while (handled_component_p (arg))
arg = TREE_OPERAND (arg, 0);
- if (INDIRECT_REF_P (arg)
- && TREE_OPERAND (arg, 0) == name)
+ if (TREE_CODE (arg) == MEM_REF
+ && TREE_OPERAND (arg, 0) == name
+ && integer_zerop (TREE_OPERAND (arg, 1))
+ && types_compatible_p (TREE_TYPE (arg),
+ TREE_TYPE (TREE_TYPE (name))))
uses_ok++;
}
}
@@ -3082,7 +3124,7 @@ find_param_candidates (void)
for (parm = DECL_ARGUMENTS (current_function_decl);
parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
{
tree type = TREE_TYPE (parm);
@@ -3574,7 +3616,7 @@ splice_all_param_accesses (VEC (access_p, heap) **representatives)
for (parm = DECL_ARGUMENTS (current_function_decl);
parm;
- parm = TREE_CHAIN (parm))
+ parm = DECL_CHAIN (parm))
{
if (is_unused_scalar_param (parm))
{
@@ -3659,7 +3701,7 @@ turn_representatives_into_adjustments (VEC (access_p, heap) *representatives,
parms = ipa_get_vector_of_formal_parms (current_function_decl);
adjustments = VEC_alloc (ipa_parm_adjustment_t, heap, adjustments_count);
parm = DECL_ARGUMENTS (current_function_decl);
- for (i = 0; i < func_param_count; i++, parm = TREE_CHAIN (parm))
+ for (i = 0; i < func_param_count; i++, parm = DECL_CHAIN (parm))
{
struct access *repr = VEC_index (access_p, representatives, i);
@@ -3917,8 +3959,11 @@ sra_ipa_modify_expr (tree *expr, bool convert,
if (!base || size == -1 || max_size == -1)
return false;
- if (INDIRECT_REF_P (base))
- base = TREE_OPERAND (base, 0);
+ if (TREE_CODE (base) == MEM_REF)
+ {
+ offset += mem_ref_offset (base).low * BITS_PER_UNIT;
+ base = TREE_OPERAND (base, 0);
+ }
base = get_ssa_base_param (base);
if (!base || TREE_CODE (base) != PARM_DECL)
@@ -3939,14 +3984,7 @@ sra_ipa_modify_expr (tree *expr, bool convert,
return false;
if (cand->by_ref)
- {
- tree folded;
- src = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (cand->reduction)),
- cand->reduction);
- folded = gimple_fold_indirect_ref (src);
- if (folded)
- src = folded;
- }
+ src = build_simple_mem_ref (cand->reduction);
else
src = cand->reduction;
@@ -4033,17 +4071,17 @@ sra_ipa_modify_assign (gimple *stmt_ptr, gimple_stmt_iterator *gsi,
}
/* Traverse the function body and all modifications as described in
- ADJUSTMENTS. */
+ ADJUSTMENTS. Return true iff the CFG has been changed. */
-static void
+static bool
ipa_sra_modify_function_body (ipa_parm_adjustment_vec adjustments)
{
+ bool cfg_changed = false;
basic_block bb;
FOR_EACH_BB (bb)
{
gimple_stmt_iterator gsi;
- bool bb_changed = false;
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
replace_removed_params_ssa_names (gsi_stmt (gsi), adjustments);
@@ -4105,15 +4143,16 @@ ipa_sra_modify_function_body (ipa_parm_adjustment_vec adjustments)
if (modified)
{
- bb_changed = true;
update_stmt (stmt);
- maybe_clean_eh_stmt (stmt);
+ if (maybe_clean_eh_stmt (stmt)
+ && gimple_purge_dead_eh_edges (gimple_bb (stmt)))
+ cfg_changed = true;
}
gsi_next (&gsi);
}
- if (bb_changed)
- gimple_purge_dead_eh_edges (bb);
}
+
+ return cfg_changed;
}
/* Call gimple_debug_bind_reset_value on all debug statements describing
@@ -4229,13 +4268,14 @@ convert_callers (struct cgraph_node *node, tree old_decl,
}
/* Perform all the modification required in IPA-SRA for NODE to have parameters
- as given in ADJUSTMENTS. */
+ as given in ADJUSTMENTS. Return true iff the CFG has been changed. */
-static void
+static bool
modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
{
struct cgraph_node *new_node;
struct cgraph_edge *cs;
+ bool cfg_changed;
VEC (cgraph_edge_p, heap) * redirect_callers;
int node_callers;
@@ -4256,11 +4296,11 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
push_cfun (DECL_STRUCT_FUNCTION (new_node->decl));
ipa_modify_formal_parameters (current_function_decl, adjustments, "ISRA");
- ipa_sra_modify_function_body (adjustments);
+ cfg_changed = ipa_sra_modify_function_body (adjustments);
sra_ipa_reset_debug_stmts (adjustments);
convert_callers (new_node, node->decl, adjustments);
cgraph_make_node_local (new_node);
- return;
+ return cfg_changed;
}
/* Return false the function is apparently unsuitable for IPA-SRA based on it's
@@ -4270,6 +4310,13 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
static bool
ipa_sra_preliminary_function_checks (struct cgraph_node *node)
{
+ if (!tree_versionable_function_p (current_function_decl))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Function isn't allowed to be versioned.\n");
+ return false;
+ }
+
if (!cgraph_node_can_be_local_p (node))
{
if (dump_file)
@@ -4280,7 +4327,7 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node)
if (!tree_versionable_function_p (node->decl))
{
if (dump_file)
- fprintf (dump_file, "Function not local to this compilation unit.\n");
+ fprintf (dump_file, "Function is not versionable.\n");
return false;
}
@@ -4377,9 +4424,11 @@ ipa_early_sra (void)
if (dump_file)
ipa_dump_param_adjustments (dump_file, adjustments, current_function_decl);
- modify_function (node, adjustments);
+ if (modify_function (node, adjustments))
+ ret = TODO_update_ssa | TODO_cleanup_cfg;
+ else
+ ret = TODO_update_ssa;
VEC_free (ipa_parm_adjustment_t, heap, adjustments);
- ret = TODO_update_ssa;
statistics_counter_event (cfun, "Unused parameters deleted",
sra_stats.deleted_unused_parameters);
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 3abfffe25ec..f49bf14caea 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -338,7 +338,7 @@ valid_mem_ref_p (enum machine_mode mode, addr_space_t as,
TARGET_MEM_REF. */
static tree
-create_mem_ref_raw (tree type, struct mem_address *addr)
+create_mem_ref_raw (tree type, tree alias_ptr_type, struct mem_address *addr)
{
if (!valid_mem_ref_p (TYPE_MODE (type), TYPE_ADDR_SPACE (type), addr))
return NULL_TREE;
@@ -349,6 +349,25 @@ create_mem_ref_raw (tree type, struct mem_address *addr)
if (addr->offset && integer_zerop (addr->offset))
addr->offset = NULL_TREE;
+ /* If possible use a plain MEM_REF instead of a TARGET_MEM_REF. */
+ if (alias_ptr_type
+ && !addr->index
+ && !addr->step
+ && (!addr->base || POINTER_TYPE_P (TREE_TYPE (addr->base))))
+ {
+ tree base, offset;
+ gcc_assert (!addr->symbol ^ !addr->base);
+ if (addr->symbol)
+ base = build_fold_addr_expr (addr->symbol);
+ else
+ base = addr->base;
+ if (addr->offset)
+ offset = fold_convert (alias_ptr_type, addr->offset);
+ else
+ offset = build_int_cst (alias_ptr_type, 0);
+ return fold_build2 (MEM_REF, type, base, offset);
+ }
+
return build6 (TARGET_MEM_REF, type,
addr->symbol, addr->base, addr->index,
addr->step, addr->offset, NULL);
@@ -628,8 +647,8 @@ gimplify_mem_ref_parts (gimple_stmt_iterator *gsi, struct mem_address *parts)
of created memory reference. */
tree
-create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
- tree base_hint, bool speed)
+create_mem_ref (gimple_stmt_iterator *gsi, tree type, tree alias_ptr_type,
+ aff_tree *addr, tree base_hint, bool speed)
{
tree mem_ref, tmp;
tree atype;
@@ -637,7 +656,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
addr_to_parts (type, addr, base_hint, &parts, speed);
gimplify_mem_ref_parts (gsi, &parts);
- mem_ref = create_mem_ref_raw (type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
if (mem_ref)
return mem_ref;
@@ -653,7 +672,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
true, NULL_TREE, true, GSI_SAME_STMT);
parts.step = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
if (mem_ref)
return mem_ref;
}
@@ -688,7 +707,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
parts.base = tmp;
parts.symbol = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
if (mem_ref)
return mem_ref;
}
@@ -709,7 +728,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
parts.base = parts.index;
parts.index = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
if (mem_ref)
return mem_ref;
}
@@ -731,7 +750,7 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
parts.offset = NULL_TREE;
- mem_ref = create_mem_ref_raw (type, &parts);
+ mem_ref = create_mem_ref_raw (type, alias_ptr_type, &parts);
if (mem_ref)
return mem_ref;
}
@@ -819,7 +838,7 @@ maybe_fold_tmr (tree ref)
if (!changed)
return NULL_TREE;
- ret = create_mem_ref_raw (TREE_TYPE (ref), &addr);
+ ret = create_mem_ref_raw (TREE_TYPE (ref), NULL_TREE, &addr);
if (!ret)
return NULL_TREE;
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 28b8fb779c2..a95d78caca1 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "langhooks.h"
#include "flags.h"
+#include "toplev.h"
#include "function.h"
#include "tree-pretty-print.h"
#include "tree-dump.h"
@@ -182,7 +183,8 @@ ptr_deref_may_alias_decl_p (tree ptr, tree decl)
{
tree base = get_base_address (TREE_OPERAND (ptr, 0));
if (base
- && INDIRECT_REF_P (base))
+ && (INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF))
ptr = TREE_OPERAND (base, 0);
else if (base
&& SSA_VAR_P (base))
@@ -238,7 +240,8 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2)
{
tree base = get_base_address (TREE_OPERAND (ptr1, 0));
if (base
- && INDIRECT_REF_P (base))
+ && (INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF))
ptr1 = TREE_OPERAND (base, 0);
else if (base
&& SSA_VAR_P (base))
@@ -250,7 +253,8 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2)
{
tree base = get_base_address (TREE_OPERAND (ptr2, 0));
if (base
- && INDIRECT_REF_P (base))
+ && (INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF))
ptr2 = TREE_OPERAND (base, 0);
else if (base
&& SSA_VAR_P (base))
@@ -299,7 +303,8 @@ ptr_deref_may_alias_ref_p_1 (tree ptr, ao_ref *ref)
{
tree base = ao_ref_base (ref);
- if (INDIRECT_REF_P (base))
+ if (INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
return ptr_derefs_may_alias_p (ptr, TREE_OPERAND (base, 0));
else if (SSA_VAR_P (base))
return ptr_deref_may_alias_decl_p (ptr, base);
@@ -470,12 +475,18 @@ ao_ref_base (ao_ref *ref)
/* Returns the base object alias set of the memory reference *REF. */
-static alias_set_type ATTRIBUTE_UNUSED
+static alias_set_type
ao_ref_base_alias_set (ao_ref *ref)
{
+ tree base_ref;
if (ref->base_alias_set != -1)
return ref->base_alias_set;
- ref->base_alias_set = get_alias_set (ao_ref_base (ref));
+ if (!ref->ref)
+ return 0;
+ base_ref = ref->ref;
+ while (handled_component_p (base_ref))
+ base_ref = TREE_OPERAND (base_ref, 0);
+ ref->base_alias_set = get_alias_set (base_ref);
return ref->base_alias_set;
}
@@ -505,7 +516,8 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size)
&ref->offset, &t1, &t2);
else
{
- ref->base = build1 (INDIRECT_REF, char_type_node, ptr);
+ ref->base = build2 (MEM_REF, char_type_node,
+ ptr, null_pointer_node);
ref->offset = 0;
}
if (size
@@ -665,33 +677,57 @@ decl_refs_may_alias_p (tree base1,
if non-NULL are the complete memory reference trees. */
static bool
-indirect_ref_may_alias_decl_p (tree ref1, tree ptr1,
- HOST_WIDE_INT offset1, HOST_WIDE_INT max_size1,
+indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1,
+ HOST_WIDE_INT offset1,
+ HOST_WIDE_INT max_size1 ATTRIBUTE_UNUSED,
alias_set_type ref1_alias_set,
alias_set_type base1_alias_set,
- tree ref2, tree base2,
+ tree ref2 ATTRIBUTE_UNUSED, tree base2,
HOST_WIDE_INT offset2, HOST_WIDE_INT max_size2,
alias_set_type ref2_alias_set,
- alias_set_type base2_alias_set)
+ alias_set_type base2_alias_set, bool tbaa_p)
{
+ tree ptr1 = TREE_OPERAND (base1, 0);
+ tree ptrtype1;
+ HOST_WIDE_INT offset1p = offset1, offset2p = offset2;
+
+ /* The offset embedded in MEM_REFs can be negative. Bias them
+ so that the resulting offset adjustment is positive. */
+ if (TREE_CODE (base1) == MEM_REF)
+ {
+ double_int moff = mem_ref_offset (base1);
+ moff = double_int_lshift (moff,
+ BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT, true);
+ if (double_int_negative_p (moff))
+ offset2p += double_int_neg (moff).low;
+ else
+ offset1p += moff.low;
+ }
+
/* If only one reference is based on a variable, they cannot alias if
the pointer access is beyond the extent of the variable access.
(the pointer base cannot validly point to an offset less than zero
of the variable).
They also cannot alias if the pointer may not point to the decl. */
- if (max_size2 != -1
- && !ranges_overlap_p (offset1, max_size1, 0, offset2 + max_size2))
+ if (!ranges_overlap_p (MAX (0, offset1p), -1, offset2p, max_size2))
return false;
if (!ptr_deref_may_alias_decl_p (ptr1, base2))
return false;
/* Disambiguations that rely on strict aliasing rules follow. */
- if (!flag_strict_aliasing)
+ if (!flag_strict_aliasing || !tbaa_p)
return true;
+ if (TREE_CODE (base1) == MEM_REF)
+ ptrtype1 = TREE_TYPE (TREE_OPERAND (base1, 1));
+ else
+ ptrtype1 = TREE_TYPE (ptr1);
+
/* If the alias set for a pointer access is zero all bets are off. */
if (base1_alias_set == -1)
- base1_alias_set = get_deref_alias_set (ptr1);
+ base1_alias_set = get_deref_alias_set (ptrtype1);
if (base1_alias_set == 0)
return true;
if (base2_alias_set == -1)
@@ -699,22 +735,52 @@ indirect_ref_may_alias_decl_p (tree ref1, tree ptr1,
/* If both references are through the same type, they do not alias
if the accesses do not overlap. This does extra disambiguation
- for mixed/pointer accesses but requires strict aliasing. */
- if (same_type_for_tbaa (TREE_TYPE (TREE_TYPE (ptr1)),
- TREE_TYPE (base2)) == 1)
+ for mixed/pointer accesses but requires strict aliasing.
+ For MEM_REFs we require that the component-ref offset we computed
+ is relative to the start of the type which we ensure by
+ comparing rvalue and access type and disregarding the constant
+ pointer offset. */
+ if ((TREE_CODE (base1) != MEM_REF
+ || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1)
+ && same_type_for_tbaa (TREE_TYPE (ptrtype1), TREE_TYPE (base2)) == 1)
return ranges_overlap_p (offset1, max_size1, offset2, max_size2);
- /* The only way to access a variable is through a pointer dereference
- of the same alias set or a subset of it. */
+ /* When we are trying to disambiguate an access with a pointer dereference
+ as base versus one with a decl as base we can use both the size
+ of the decl and its dynamic type for extra disambiguation.
+ ??? We do not know anything about the dynamic type of the decl
+ other than that its alias-set contains base2_alias_set as a subset
+ which does not help us here. */
+ /* As we know nothing useful about the dynamic type of the decl just
+ use the usual conflict check rather than a subset test.
+ ??? We could introduce -fvery-strict-aliasing when the language
+ does not allow decls to have a dynamic type that differs from their
+ static type. Then we can check
+ !alias_set_subset_of (base1_alias_set, base2_alias_set) instead. */
if (base1_alias_set != base2_alias_set
- && !alias_set_subset_of (base1_alias_set, base2_alias_set))
+ && !alias_sets_conflict_p (base1_alias_set, base2_alias_set))
+ return false;
+ /* If the size of the access relevant for TBAA through the pointer
+ is bigger than the size of the decl we can't possibly access the
+ decl via that pointer. */
+ if (DECL_SIZE (base2) && COMPLETE_TYPE_P (TREE_TYPE (ptrtype1))
+ && TREE_CODE (DECL_SIZE (base2)) == INTEGER_CST
+ && TREE_CODE (TYPE_SIZE (TREE_TYPE (ptrtype1))) == INTEGER_CST
+ /* ??? This in turn may run afoul when a decl of type T which is
+ a member of union type U is accessed through a pointer to
+ type U and sizeof T is smaller than sizeof U. */
+ && TREE_CODE (TREE_TYPE (ptrtype1)) != UNION_TYPE
+ && TREE_CODE (TREE_TYPE (ptrtype1)) != QUAL_UNION_TYPE
+ && tree_int_cst_lt (DECL_SIZE (base2), TYPE_SIZE (TREE_TYPE (ptrtype1))))
return false;
/* Do access-path based disambiguation. */
if (ref1 && ref2
&& handled_component_p (ref1)
- && handled_component_p (ref2))
- return aliasing_component_refs_p (ref1, TREE_TYPE (TREE_TYPE (ptr1)),
+ && handled_component_p (ref2)
+ && (TREE_CODE (base1) != MEM_REF
+ || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1))
+ return aliasing_component_refs_p (ref1, TREE_TYPE (ptrtype1),
ref1_alias_set, base1_alias_set,
offset1, max_size1,
ref2, TREE_TYPE (base2),
@@ -732,42 +798,88 @@ indirect_ref_may_alias_decl_p (tree ref1, tree ptr1,
if non-NULL are the complete memory reference trees. */
static bool
-indirect_refs_may_alias_p (tree ref1, tree ptr1,
+indirect_refs_may_alias_p (tree ref1 ATTRIBUTE_UNUSED, tree base1,
HOST_WIDE_INT offset1, HOST_WIDE_INT max_size1,
alias_set_type ref1_alias_set,
alias_set_type base1_alias_set,
- tree ref2, tree ptr2,
+ tree ref2 ATTRIBUTE_UNUSED, tree base2,
HOST_WIDE_INT offset2, HOST_WIDE_INT max_size2,
alias_set_type ref2_alias_set,
- alias_set_type base2_alias_set)
+ alias_set_type base2_alias_set, bool tbaa_p)
{
+ tree ptr1 = TREE_OPERAND (base1, 0);
+ tree ptr2 = TREE_OPERAND (base2, 0);
+ tree ptrtype1, ptrtype2;
+
/* If both bases are based on pointers they cannot alias if they may not
point to the same memory object or if they point to the same object
and the accesses do not overlap. */
- if (operand_equal_p (ptr1, ptr2, 0))
- return ranges_overlap_p (offset1, max_size1, offset2, max_size2);
+ if ((!cfun || gimple_in_ssa_p (cfun))
+ && operand_equal_p (ptr1, ptr2, 0))
+ {
+ /* The offset embedded in MEM_REFs can be negative. Bias them
+ so that the resulting offset adjustment is positive. */
+ if (TREE_CODE (base1) == MEM_REF)
+ {
+ double_int moff = mem_ref_offset (base1);
+ moff = double_int_lshift (moff,
+ BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT, true);
+ if (double_int_negative_p (moff))
+ offset2 += double_int_neg (moff).low;
+ else
+ offset1 += moff.low;
+ }
+ if (TREE_CODE (base2) == MEM_REF)
+ {
+ double_int moff = mem_ref_offset (base2);
+ moff = double_int_lshift (moff,
+ BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT, true);
+ if (double_int_negative_p (moff))
+ offset1 += double_int_neg (moff).low;
+ else
+ offset2 += moff.low;
+ }
+ return ranges_overlap_p (offset1, max_size1, offset2, max_size2);
+ }
if (!ptr_derefs_may_alias_p (ptr1, ptr2))
return false;
/* Disambiguations that rely on strict aliasing rules follow. */
- if (!flag_strict_aliasing)
+ if (!flag_strict_aliasing || !tbaa_p)
return true;
+ if (TREE_CODE (base1) == MEM_REF)
+ ptrtype1 = TREE_TYPE (TREE_OPERAND (base1, 1));
+ else
+ ptrtype1 = TREE_TYPE (ptr1);
+ if (TREE_CODE (base2) == MEM_REF)
+ ptrtype2 = TREE_TYPE (TREE_OPERAND (base2, 1));
+ else
+ ptrtype2 = TREE_TYPE (ptr2);
+
/* If the alias set for a pointer access is zero all bets are off. */
if (base1_alias_set == -1)
- base1_alias_set = get_deref_alias_set (ptr1);
+ base1_alias_set = get_deref_alias_set (ptrtype1);
if (base1_alias_set == 0)
return true;
if (base2_alias_set == -1)
- base2_alias_set = get_deref_alias_set (ptr2);
+ base2_alias_set = get_deref_alias_set (ptrtype2);
if (base2_alias_set == 0)
return true;
/* If both references are through the same type, they do not alias
if the accesses do not overlap. This does extra disambiguation
for mixed/pointer accesses but requires strict aliasing. */
- if (same_type_for_tbaa (TREE_TYPE (TREE_TYPE (ptr1)),
- TREE_TYPE (TREE_TYPE (ptr2))) == 1)
+ if ((TREE_CODE (base1) != MEM_REF
+ || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1)
+ && (TREE_CODE (base2) != MEM_REF
+ || same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1)
+ && same_type_for_tbaa (TREE_TYPE (ptrtype1),
+ TREE_TYPE (ptrtype2)) == 1)
return ranges_overlap_p (offset1, max_size1, offset2, max_size2);
/* Do type-based disambiguation. */
@@ -778,11 +890,15 @@ indirect_refs_may_alias_p (tree ref1, tree ptr1,
/* Do access-path based disambiguation. */
if (ref1 && ref2
&& handled_component_p (ref1)
- && handled_component_p (ref2))
- return aliasing_component_refs_p (ref1, TREE_TYPE (TREE_TYPE (ptr1)),
+ && handled_component_p (ref2)
+ && (TREE_CODE (base1) != MEM_REF
+ || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1)
+ && (TREE_CODE (base2) != MEM_REF
+ || same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1))
+ return aliasing_component_refs_p (ref1, TREE_TYPE (ptrtype1),
ref1_alias_set, base1_alias_set,
offset1, max_size1,
- ref2, TREE_TYPE (TREE_TYPE (ptr2)),
+ ref2, TREE_TYPE (ptrtype2),
ref2_alias_set, base2_alias_set,
offset2, max_size2, false);
@@ -798,19 +914,20 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
HOST_WIDE_INT offset1 = 0, offset2 = 0;
HOST_WIDE_INT max_size1 = -1, max_size2 = -1;
bool var1_p, var2_p, ind1_p, ind2_p;
- alias_set_type set;
gcc_checking_assert ((!ref1->ref
|| TREE_CODE (ref1->ref) == SSA_NAME
|| DECL_P (ref1->ref)
|| handled_component_p (ref1->ref)
|| INDIRECT_REF_P (ref1->ref)
+ || TREE_CODE (ref1->ref) == MEM_REF
|| TREE_CODE (ref1->ref) == TARGET_MEM_REF)
&& (!ref2->ref
|| TREE_CODE (ref2->ref) == SSA_NAME
|| DECL_P (ref2->ref)
|| handled_component_p (ref2->ref)
|| INDIRECT_REF_P (ref2->ref)
+ || TREE_CODE (ref2->ref) == MEM_REF
|| TREE_CODE (ref2->ref) == TARGET_MEM_REF));
/* Decompose the references into their base objects and the access. */
@@ -851,8 +968,9 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
return decl_refs_may_alias_p (base1, offset1, max_size1,
base2, offset2, max_size2);
- ind1_p = INDIRECT_REF_P (base1);
- ind2_p = INDIRECT_REF_P (base2);
+ ind1_p = INDIRECT_REF_P (base1) || (TREE_CODE (base1) == MEM_REF);
+ ind2_p = INDIRECT_REF_P (base2) || (TREE_CODE (base2) == MEM_REF);
+
/* Canonicalize the pointer-vs-decl case. */
if (ind1_p && var2_p)
{
@@ -869,59 +987,6 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
ind2_p = true;
}
- /* If we are about to disambiguate pointer-vs-decl try harder to
- see must-aliases and give leeway to some invalid cases.
- This covers a pretty minimal set of cases only and does not
- when called from the RTL oracle. It handles cases like
-
- int i = 1;
- return *(float *)&i;
-
- and also fixes gfortran.dg/lto/pr40725. */
- if (var1_p && ind2_p
- && cfun
- && gimple_in_ssa_p (cfun)
- && TREE_CODE (TREE_OPERAND (base2, 0)) == SSA_NAME)
- {
- gimple def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (base2, 0));
- while (is_gimple_assign (def_stmt)
- && (gimple_assign_rhs_code (def_stmt) == SSA_NAME
- || CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))))
- {
- tree rhs = gimple_assign_rhs1 (def_stmt);
- HOST_WIDE_INT offset, size, max_size;
-
- /* Look through SSA name copies and pointer conversions. */
- if (TREE_CODE (rhs) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (rhs)))
- {
- def_stmt = SSA_NAME_DEF_STMT (rhs);
- continue;
- }
- if (TREE_CODE (rhs) != ADDR_EXPR)
- break;
-
- /* If the pointer is defined as an address based on a decl
- use plain offset disambiguation and ignore TBAA. */
- rhs = TREE_OPERAND (rhs, 0);
- rhs = get_ref_base_and_extent (rhs, &offset, &size, &max_size);
- if (SSA_VAR_P (rhs))
- {
- base2 = rhs;
- offset2 += offset;
- if (size != max_size
- || max_size == -1)
- max_size2 = -1;
- return decl_refs_may_alias_p (base1, offset1, max_size1,
- base2, offset2, max_size2);
- }
-
- /* Do not continue looking through &p->x to limit time
- complexity. */
- break;
- }
- }
-
/* First defer to TBAA if possible. */
if (tbaa_p
&& flag_strict_aliasing
@@ -937,21 +1002,23 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
return true;
/* Dispatch to the pointer-vs-decl or pointer-vs-pointer disambiguators. */
- set = tbaa_p ? -1 : 0;
if (var1_p && ind2_p)
- return indirect_ref_may_alias_decl_p (ref2->ref, TREE_OPERAND (base2, 0),
+ return indirect_ref_may_alias_decl_p (ref2->ref, base2,
offset2, max_size2,
- ao_ref_alias_set (ref2), set,
+ ao_ref_alias_set (ref2), -1,
ref1->ref, base1,
offset1, max_size1,
- ao_ref_alias_set (ref1), set);
+ ao_ref_alias_set (ref1),
+ ao_ref_base_alias_set (ref1),
+ tbaa_p);
else if (ind1_p && ind2_p)
- return indirect_refs_may_alias_p (ref1->ref, TREE_OPERAND (base1, 0),
+ return indirect_refs_may_alias_p (ref1->ref, base1,
offset1, max_size1,
- ao_ref_alias_set (ref1), set,
- ref2->ref, TREE_OPERAND (base2, 0),
+ ao_ref_alias_set (ref1), -1,
+ ref2->ref, base2,
offset2, max_size2,
- ao_ref_alias_set (ref2), set);
+ ao_ref_alias_set (ref2), -1,
+ tbaa_p);
gcc_unreachable ();
}
@@ -1110,7 +1177,8 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
if (pt_solution_includes (gimple_call_use_set (call), base))
return true;
}
- else if (INDIRECT_REF_P (base)
+ else if ((INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
&& TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0));
@@ -1281,7 +1349,8 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
if (DECL_P (base)
&& !TREE_STATIC (base))
return true;
- else if (INDIRECT_REF_P (base)
+ else if ((INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
&& TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME
&& (pi = SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0))))
return pi->pt.anything || pi->pt.nonlocal;
@@ -1360,7 +1429,8 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
/* Check if the base variable is call-clobbered. */
if (DECL_P (base))
return pt_solution_includes (gimple_call_clobber_set (call), base);
- else if (INDIRECT_REF_P (base)
+ else if ((INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
&& TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0));
diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h
index a2b532747c6..499559d07e8 100644
--- a/gcc/tree-ssa-alias.h
+++ b/gcc/tree-ssa-alias.h
@@ -132,6 +132,8 @@ extern bool pt_solutions_same_restrict_base (struct pt_solution *,
struct pt_solution *);
extern void pt_solution_reset (struct pt_solution *);
extern void pt_solution_set (struct pt_solution *, bitmap, bool, bool);
+extern void pt_solution_set_var (struct pt_solution *, tree);
+
extern void dump_pta_stats (FILE *);
extern GTY(()) struct pt_solution ipa_escaped_pt;
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index be4509c237c..89ef5b3a7e4 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -205,6 +205,7 @@ along with GCC; see the file COPYING3. If not see
#include "value-prof.h"
#include "langhooks.h"
#include "target.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "dbgcnt.h"
@@ -300,7 +301,8 @@ get_default_value (tree var)
before being initialized. If VAR is a local variable, we
can assume initially that it is UNDEFINED, otherwise we must
consider it VARYING. */
- if (is_gimple_reg (sym) && TREE_CODE (sym) != PARM_DECL)
+ if (is_gimple_reg (sym)
+ && TREE_CODE (sym) == VAR_DECL)
val.lattice_val = UNDEFINED;
else
val.lattice_val = VARYING;
@@ -896,20 +898,22 @@ ccp_fold (gimple stmt)
base = &TREE_OPERAND (rhs, 0);
while (handled_component_p (*base))
base = &TREE_OPERAND (*base, 0);
- if (TREE_CODE (*base) == INDIRECT_REF
+ if (TREE_CODE (*base) == MEM_REF
&& TREE_CODE (TREE_OPERAND (*base, 0)) == SSA_NAME)
{
prop_value_t *val = get_value (TREE_OPERAND (*base, 0));
if (val->lattice_val == CONSTANT
- && TREE_CODE (val->value) == ADDR_EXPR
- && may_propagate_address_into_dereference
- (val->value, *base))
+ && TREE_CODE (val->value) == ADDR_EXPR)
{
+ tree ret, save = *base;
+ tree new_base;
+ new_base = fold_build2 (MEM_REF, TREE_TYPE (*base),
+ unshare_expr (val->value),
+ TREE_OPERAND (*base, 1));
/* We need to return a new tree, not modify the IL
or share parts of it. So play some tricks to
avoid manually building it. */
- tree ret, save = *base;
- *base = TREE_OPERAND (val->value, 0);
+ *base = new_base;
ret = unshare_expr (rhs);
recompute_tree_invariant_for_addr_expr (ret);
*base = save;
@@ -955,15 +959,19 @@ ccp_fold (gimple stmt)
TREE_CODE (rhs),
TREE_TYPE (rhs), val->value);
}
- else if (TREE_CODE (rhs) == INDIRECT_REF
+ else if (TREE_CODE (rhs) == MEM_REF
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
{
prop_value_t *val = get_value (TREE_OPERAND (rhs, 0));
if (val->lattice_val == CONSTANT
- && TREE_CODE (val->value) == ADDR_EXPR
- && useless_type_conversion_p (TREE_TYPE (rhs),
- TREE_TYPE (TREE_TYPE (val->value))))
- rhs = TREE_OPERAND (val->value, 0);
+ && TREE_CODE (val->value) == ADDR_EXPR)
+ {
+ tree tem = fold_build2 (MEM_REF, TREE_TYPE (rhs),
+ unshare_expr (val->value),
+ TREE_OPERAND (rhs, 1));
+ if (tem)
+ rhs = tem;
+ }
}
return fold_const_aggregate_ref (rhs);
}
@@ -987,16 +995,10 @@ ccp_fold (gimple stmt)
allowed places. */
if (CONVERT_EXPR_CODE_P (subcode)
&& POINTER_TYPE_P (TREE_TYPE (lhs))
- && POINTER_TYPE_P (TREE_TYPE (op0))
- /* Do not allow differences in volatile qualification
- as this might get us confused as to whether a
- propagation destination statement is volatile
- or not. See PR36988. */
- && (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (lhs)))
- == TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (op0)))))
+ && POINTER_TYPE_P (TREE_TYPE (op0)))
{
tree tem;
- /* Still try to generate a constant of correct type. */
+ /* Try to re-construct array references on-the-fly. */
if (!useless_type_conversion_p (TREE_TYPE (lhs),
TREE_TYPE (op0))
&& ((tem = maybe_fold_offset_to_address
@@ -1018,19 +1020,21 @@ ccp_fold (gimple stmt)
tree op0 = get_rhs_assign_op_for_ccp (stmt, 1);
tree op1 = get_rhs_assign_op_for_ccp (stmt, 2);
- /* Fold &foo + CST into an invariant reference if possible. */
+ /* Translate &x + CST into an invariant form suitable for
+ further propagation. */
if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
&& TREE_CODE (op0) == ADDR_EXPR
&& TREE_CODE (op1) == INTEGER_CST)
{
- tree tem = maybe_fold_offset_to_address
- (loc, op0, op1, TREE_TYPE (op0));
- if (tem != NULL_TREE)
- return tem;
+ tree off = fold_convert (ptr_type_node, op1);
+ return build_fold_addr_expr
+ (fold_build2 (MEM_REF,
+ TREE_TYPE (TREE_TYPE (op0)),
+ unshare_expr (op0), off));
}
return fold_binary_loc (loc, subcode,
- gimple_expr_type (stmt), op0, op1);
+ gimple_expr_type (stmt), op0, op1);
}
case GIMPLE_TERNARY_RHS:
@@ -1160,6 +1164,16 @@ fold_const_aggregate_ref (tree t)
base = TREE_OPERAND (t, 0);
switch (TREE_CODE (base))
{
+ case MEM_REF:
+ /* ??? We could handle this case. */
+ if (!integer_zerop (TREE_OPERAND (base, 1)))
+ return NULL_TREE;
+ base = get_base_address (base);
+ if (!base
+ || TREE_CODE (base) != VAR_DECL)
+ return NULL_TREE;
+
+ /* Fallthru. */
case VAR_DECL:
if (!TREE_READONLY (base)
|| TREE_CODE (TREE_TYPE (base)) != ARRAY_TYPE
@@ -1299,18 +1313,104 @@ fold_const_aggregate_ref (tree t)
break;
}
- case INDIRECT_REF:
- {
- tree base = TREE_OPERAND (t, 0);
- if (TREE_CODE (base) == SSA_NAME
- && (value = get_value (base))
- && value->lattice_val == CONSTANT
- && TREE_CODE (value->value) == ADDR_EXPR
- && useless_type_conversion_p (TREE_TYPE (t),
- TREE_TYPE (TREE_TYPE (value->value))))
- return fold_const_aggregate_ref (TREE_OPERAND (value->value, 0));
- break;
- }
+ case MEM_REF:
+ /* Get the base object we are accessing. */
+ base = TREE_OPERAND (t, 0);
+ if (TREE_CODE (base) == SSA_NAME
+ && (value = get_value (base))
+ && value->lattice_val == CONSTANT)
+ base = value->value;
+ if (TREE_CODE (base) != ADDR_EXPR)
+ return NULL_TREE;
+ base = TREE_OPERAND (base, 0);
+ switch (TREE_CODE (base))
+ {
+ case VAR_DECL:
+ if (DECL_P (base)
+ && !AGGREGATE_TYPE_P (TREE_TYPE (base))
+ && integer_zerop (TREE_OPERAND (t, 1)))
+ {
+ tree res = get_symbol_constant_value (base);
+ if (res
+ && !useless_type_conversion_p
+ (TREE_TYPE (t), TREE_TYPE (res)))
+ res = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (t), res);
+ return res;
+ }
+
+ if (!TREE_READONLY (base)
+ || TREE_CODE (TREE_TYPE (base)) != ARRAY_TYPE
+ || !targetm.binds_local_p (base))
+ return NULL_TREE;
+
+ ctor = DECL_INITIAL (base);
+ break;
+
+ case STRING_CST:
+ case CONSTRUCTOR:
+ ctor = base;
+ break;
+
+ default:
+ return NULL_TREE;
+ }
+
+ if (ctor == NULL_TREE
+ || (TREE_CODE (ctor) != CONSTRUCTOR
+ && TREE_CODE (ctor) != STRING_CST)
+ || !TREE_STATIC (ctor))
+ return NULL_TREE;
+
+ /* Get the byte offset. */
+ idx = TREE_OPERAND (t, 1);
+
+ /* Fold read from constant string. */
+ if (TREE_CODE (ctor) == STRING_CST)
+ {
+ if ((TYPE_MODE (TREE_TYPE (t))
+ == TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
+ && (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
+ == MODE_INT)
+ && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1
+ && compare_tree_int (idx, TREE_STRING_LENGTH (ctor)) < 0)
+ return build_int_cst_type (TREE_TYPE (t),
+ (TREE_STRING_POINTER (ctor)
+ [TREE_INT_CST_LOW (idx)]));
+ return NULL_TREE;
+ }
+
+ /* ??? Implement byte-offset indexing into a non-array CONSTRUCTOR. */
+ if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE
+ && (TYPE_MODE (TREE_TYPE (t))
+ == TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
+ && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t))) != 0
+ && integer_zerop
+ (int_const_binop
+ (TRUNC_MOD_EXPR, idx,
+ size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0)))
+ {
+ idx = int_const_binop (TRUNC_DIV_EXPR, idx,
+ size_int (GET_MODE_SIZE
+ (TYPE_MODE (TREE_TYPE (t)))), 0);
+ FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), cnt, cfield, cval)
+ if (tree_int_cst_equal (cfield, idx))
+ {
+ STRIP_NOPS (cval);
+ if (TREE_CODE (cval) == ADDR_EXPR)
+ {
+ tree base = get_base_address (TREE_OPERAND (cval, 0));
+ if (base && TREE_CODE (base) == VAR_DECL)
+ add_referenced_var (base);
+ }
+ if (useless_type_conversion_p (TREE_TYPE (t), TREE_TYPE (cval)))
+ return cval;
+ else if (CONSTANT_CLASS_P (cval))
+ return fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (t), cval);
+ else
+ return NULL_TREE;
+ }
+ }
+ break;
default:
break;
@@ -1498,7 +1598,7 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi)
{
tree rhs = unshare_expr (val->value);
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
- rhs = fold_convert (TREE_TYPE (lhs), rhs);
+ rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
gimple_assign_set_rhs_from_tree (gsi, rhs);
return true;
}
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index 2cdbceb2d3a..5e6854cbaad 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-dump.h"
#include "tree-ssa-live.h"
+#include "diagnostic-core.h"
#include "toplev.h"
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index cfbc26a7ee7..edec49d374f 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -499,6 +499,9 @@ ref_may_be_aliased (tree ref)
{
while (handled_component_p (ref))
ref = TREE_OPERAND (ref, 0);
+ if (TREE_CODE (ref) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (ref, 0)) == ADDR_EXPR)
+ ref = TREE_OPERAND (TREE_OPERAND (ref, 0), 0);
return !(DECL_P (ref)
&& !may_be_aliased (ref));
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 68338206a8a..4715592746c 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2559,6 +2559,20 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name
continue;
}
+ /* It's not ok to propagate into the definition stmt of RHS.
+ <bb 9>:
+ # prephitmp.12_36 = PHI <g_67.1_6(9)>
+ g_67.1_6 = prephitmp.12_36;
+ goto <bb 9>;
+ While this is strictly all dead code we do not want to
+ deal with this here. */
+ if (TREE_CODE (rhs) == SSA_NAME
+ && SSA_NAME_DEF_STMT (rhs) == use_stmt)
+ {
+ all = false;
+ continue;
+ }
+
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))
{
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index eb6c831f7c8..b6278045c85 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -628,9 +628,14 @@ forward_propagate_addr_into_variable_array_index (tree offset,
{
tree index, tunit;
gimple offset_def, use_stmt = gsi_stmt (*use_stmt_gsi);
- tree tmp;
+ tree new_rhs, tmp;
- tunit = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (def_rhs)));
+ if (TREE_CODE (TREE_OPERAND (def_rhs, 0)) == ARRAY_REF)
+ tunit = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (def_rhs)));
+ else if (TREE_CODE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))) == ARRAY_TYPE)
+ tunit = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (TREE_TYPE (def_rhs))));
+ else
+ return false;
if (!host_integerp (tunit, 1))
return false;
@@ -697,10 +702,28 @@ forward_propagate_addr_into_variable_array_index (tree offset,
/* Replace the pointer addition with array indexing. */
index = force_gimple_operand_gsi (use_stmt_gsi, index, true, NULL_TREE,
true, GSI_SAME_STMT);
- gimple_assign_set_rhs_from_tree (use_stmt_gsi, unshare_expr (def_rhs));
+ if (TREE_CODE (TREE_OPERAND (def_rhs, 0)) == ARRAY_REF)
+ {
+ new_rhs = unshare_expr (def_rhs);
+ TREE_OPERAND (TREE_OPERAND (new_rhs, 0), 1) = index;
+ }
+ else
+ {
+ new_rhs = build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (TREE_TYPE (def_rhs))),
+ unshare_expr (TREE_OPERAND (def_rhs, 0)),
+ index, integer_zero_node, NULL_TREE);
+ new_rhs = build_fold_addr_expr (new_rhs);
+ if (!useless_type_conversion_p (TREE_TYPE (gimple_assign_lhs (use_stmt)),
+ TREE_TYPE (new_rhs)))
+ {
+ new_rhs = force_gimple_operand_gsi (use_stmt_gsi, new_rhs, true,
+ NULL_TREE, true, GSI_SAME_STMT);
+ new_rhs = fold_convert (TREE_TYPE (gimple_assign_lhs (use_stmt)),
+ new_rhs);
+ }
+ }
+ gimple_assign_set_rhs_from_tree (use_stmt_gsi, new_rhs);
use_stmt = gsi_stmt (*use_stmt_gsi);
- TREE_OPERAND (TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 0), 1)
- = index;
/* That should have created gimple, so there is no need to
record information to undo the propagation. */
@@ -725,11 +748,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
bool single_use_p)
{
tree lhs, rhs, rhs2, array_ref;
- tree *rhsp, *lhsp;
gimple use_stmt = gsi_stmt (*use_stmt_gsi);
enum tree_code rhs_code;
bool res = true;
- bool addr_p = false;
gcc_assert (TREE_CODE (def_rhs) == ADDR_EXPR);
@@ -767,31 +788,118 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
return true;
}
+ /* Propagate through constant pointer adjustments. */
+ if (TREE_CODE (lhs) == SSA_NAME
+ && rhs_code == POINTER_PLUS_EXPR
+ && rhs == name
+ && TREE_CODE (gimple_assign_rhs2 (use_stmt)) == INTEGER_CST)
+ {
+ tree new_def_rhs;
+ /* As we come here with non-invariant addresses in def_rhs we need
+ to make sure we can build a valid constant offsetted address
+ for further propagation. Simply rely on fold building that
+ and check after the fact. */
+ new_def_rhs = fold_build2 (MEM_REF, TREE_TYPE (TREE_TYPE (rhs)),
+ def_rhs,
+ fold_convert (ptr_type_node,
+ gimple_assign_rhs2 (use_stmt)));
+ if (TREE_CODE (new_def_rhs) == MEM_REF
+ && !is_gimple_mem_ref_addr (TREE_OPERAND (new_def_rhs, 0)))
+ return false;
+ new_def_rhs = build_fold_addr_expr_with_type (new_def_rhs,
+ TREE_TYPE (rhs));
+
+ /* Recurse. If we could propagate into all uses of lhs do not
+ bother to replace into the current use but just pretend we did. */
+ if (TREE_CODE (new_def_rhs) == ADDR_EXPR
+ && forward_propagate_addr_expr (lhs, new_def_rhs))
+ return true;
+
+ if (useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (new_def_rhs)))
+ gimple_assign_set_rhs_with_ops (use_stmt_gsi, TREE_CODE (new_def_rhs),
+ new_def_rhs, NULL_TREE);
+ else if (is_gimple_min_invariant (new_def_rhs))
+ gimple_assign_set_rhs_with_ops (use_stmt_gsi, NOP_EXPR,
+ new_def_rhs, NULL_TREE);
+ else
+ return false;
+ gcc_assert (gsi_stmt (*use_stmt_gsi) == use_stmt);
+ update_stmt (use_stmt);
+ return true;
+ }
+
/* Now strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS.
ADDR_EXPR will not appear on the LHS. */
- lhsp = gimple_assign_lhs_ptr (use_stmt);
- while (handled_component_p (*lhsp))
- lhsp = &TREE_OPERAND (*lhsp, 0);
- lhs = *lhsp;
+ lhs = gimple_assign_lhs (use_stmt);
+ while (handled_component_p (lhs))
+ lhs = TREE_OPERAND (lhs, 0);
- /* Now see if the LHS node is an INDIRECT_REF using NAME. If so,
+ /* Now see if the LHS node is a MEM_REF using NAME. If so,
propagate the ADDR_EXPR into the use of NAME and fold the result. */
- if (TREE_CODE (lhs) == INDIRECT_REF
+ if (TREE_CODE (lhs) == MEM_REF
&& TREE_OPERAND (lhs, 0) == name)
{
- if (may_propagate_address_into_dereference (def_rhs, lhs)
- && (lhsp != gimple_assign_lhs_ptr (use_stmt)
- || useless_type_conversion_p
- (TREE_TYPE (TREE_OPERAND (def_rhs, 0)), TREE_TYPE (rhs))))
+ tree def_rhs_base;
+ HOST_WIDE_INT def_rhs_offset;
+ /* If the address is invariant we can always fold it. */
+ if ((def_rhs_base = get_addr_base_and_unit_offset (TREE_OPERAND (def_rhs, 0),
+ &def_rhs_offset)))
{
- *lhsp = unshare_expr (TREE_OPERAND (def_rhs, 0));
- fold_stmt_inplace (use_stmt);
+ double_int off = mem_ref_offset (lhs);
+ tree new_ptr;
+ off = double_int_add (off,
+ shwi_to_double_int (def_rhs_offset));
+ if (TREE_CODE (def_rhs_base) == MEM_REF)
+ {
+ off = double_int_add (off, mem_ref_offset (def_rhs_base));
+ new_ptr = TREE_OPERAND (def_rhs_base, 0);
+ }
+ else
+ new_ptr = build_fold_addr_expr (def_rhs_base);
+ TREE_OPERAND (lhs, 0) = new_ptr;
+ TREE_OPERAND (lhs, 1)
+ = double_int_to_tree (TREE_TYPE (TREE_OPERAND (lhs, 1)), off);
tidy_after_forward_propagate_addr (use_stmt);
-
/* Continue propagating into the RHS if this was not the only use. */
if (single_use_p)
return true;
}
+ /* If the LHS is a plain dereference and the value type is the same as
+ that of the pointed-to type of the address we can put the
+ dereferenced address on the LHS preserving the original alias-type. */
+ else if (gimple_assign_lhs (use_stmt) == lhs
+ && useless_type_conversion_p
+ (TREE_TYPE (TREE_OPERAND (def_rhs, 0)),
+ TREE_TYPE (gimple_assign_rhs1 (use_stmt))))
+ {
+ tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0);
+ tree new_offset, new_base, saved;
+ while (handled_component_p (*def_rhs_basep))
+ def_rhs_basep = &TREE_OPERAND (*def_rhs_basep, 0);
+ saved = *def_rhs_basep;
+ if (TREE_CODE (*def_rhs_basep) == MEM_REF)
+ {
+ new_base = TREE_OPERAND (*def_rhs_basep, 0);
+ new_offset
+ = int_const_binop (PLUS_EXPR, TREE_OPERAND (lhs, 1),
+ TREE_OPERAND (*def_rhs_basep, 1), 0);
+ }
+ else
+ {
+ new_base = build_fold_addr_expr (*def_rhs_basep);
+ new_offset = TREE_OPERAND (lhs, 1);
+ }
+ *def_rhs_basep = build2 (MEM_REF, TREE_TYPE (*def_rhs_basep),
+ new_base, new_offset);
+ gimple_assign_set_lhs (use_stmt,
+ unshare_expr (TREE_OPERAND (def_rhs, 0)));
+ *def_rhs_basep = saved;
+ tidy_after_forward_propagate_addr (use_stmt);
+ /* Continue propagating into the RHS if this was not the
+ only use. */
+ if (single_use_p)
+ return true;
+ }
else
/* We can have a struct assignment dereferencing our name twice.
Note that we didn't propagate into the lhs to not falsely
@@ -801,79 +909,76 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
/* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR
nodes from the RHS. */
- rhsp = gimple_assign_rhs1_ptr (use_stmt);
- if (TREE_CODE (*rhsp) == ADDR_EXPR)
- {
- rhsp = &TREE_OPERAND (*rhsp, 0);
- addr_p = true;
- }
- while (handled_component_p (*rhsp))
- rhsp = &TREE_OPERAND (*rhsp, 0);
- rhs = *rhsp;
+ rhs = gimple_assign_rhs1 (use_stmt);
+ if (TREE_CODE (rhs) == ADDR_EXPR)
+ rhs = TREE_OPERAND (rhs, 0);
+ while (handled_component_p (rhs))
+ rhs = TREE_OPERAND (rhs, 0);
- /* Now see if the RHS node is an INDIRECT_REF using NAME. If so,
+ /* Now see if the RHS node is a MEM_REF using NAME. If so,
propagate the ADDR_EXPR into the use of NAME and fold the result. */
- if (TREE_CODE (rhs) == INDIRECT_REF
- && TREE_OPERAND (rhs, 0) == name
- && may_propagate_address_into_dereference (def_rhs, rhs))
+ if (TREE_CODE (rhs) == MEM_REF
+ && TREE_OPERAND (rhs, 0) == name)
{
- *rhsp = unshare_expr (TREE_OPERAND (def_rhs, 0));
- fold_stmt_inplace (use_stmt);
- tidy_after_forward_propagate_addr (use_stmt);
- return res;
+ tree def_rhs_base;
+ HOST_WIDE_INT def_rhs_offset;
+ if ((def_rhs_base = get_addr_base_and_unit_offset (TREE_OPERAND (def_rhs, 0),
+ &def_rhs_offset)))
+ {
+ double_int off = mem_ref_offset (rhs);
+ tree new_ptr;
+ off = double_int_add (off,
+ shwi_to_double_int (def_rhs_offset));
+ if (TREE_CODE (def_rhs_base) == MEM_REF)
+ {
+ off = double_int_add (off, mem_ref_offset (def_rhs_base));
+ new_ptr = TREE_OPERAND (def_rhs_base, 0);
+ }
+ else
+ new_ptr = build_fold_addr_expr (def_rhs_base);
+ TREE_OPERAND (rhs, 0) = new_ptr;
+ TREE_OPERAND (rhs, 1)
+ = double_int_to_tree (TREE_TYPE (TREE_OPERAND (rhs, 1)), off);
+ fold_stmt_inplace (use_stmt);
+ tidy_after_forward_propagate_addr (use_stmt);
+ return res;
+ }
+ /* If the LHS is a plain dereference and the value type is the same as
+ that of the pointed-to type of the address we can put the
+ dereferenced address on the LHS preserving the original alias-type. */
+ else if (gimple_assign_rhs1 (use_stmt) == rhs
+ && useless_type_conversion_p
+ (TREE_TYPE (gimple_assign_lhs (use_stmt)),
+ TREE_TYPE (TREE_OPERAND (def_rhs, 0))))
+ {
+ tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0);
+ tree new_offset, new_base, saved;
+ while (handled_component_p (*def_rhs_basep))
+ def_rhs_basep = &TREE_OPERAND (*def_rhs_basep, 0);
+ saved = *def_rhs_basep;
+ if (TREE_CODE (*def_rhs_basep) == MEM_REF)
+ {
+ new_base = TREE_OPERAND (*def_rhs_basep, 0);
+ new_offset
+ = int_const_binop (PLUS_EXPR, TREE_OPERAND (rhs, 1),
+ TREE_OPERAND (*def_rhs_basep, 1), 0);
+ }
+ else
+ {
+ new_base = build_fold_addr_expr (*def_rhs_basep);
+ new_offset = TREE_OPERAND (rhs, 1);
+ }
+ *def_rhs_basep = build2 (MEM_REF, TREE_TYPE (*def_rhs_basep),
+ new_base, new_offset);
+ gimple_assign_set_rhs1 (use_stmt,
+ unshare_expr (TREE_OPERAND (def_rhs, 0)));
+ *def_rhs_basep = saved;
+ fold_stmt_inplace (use_stmt);
+ tidy_after_forward_propagate_addr (use_stmt);
+ return res;
+ }
}
- /* Now see if the RHS node is an INDIRECT_REF using NAME. If so,
- propagate the ADDR_EXPR into the use of NAME and try to
- create a VCE and fold the result. */
- if (TREE_CODE (rhs) == INDIRECT_REF
- && TREE_OPERAND (rhs, 0) == name
- && TYPE_SIZE (TREE_TYPE (rhs))
- && TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
- /* Function decls should not be used for VCE either as it could be a
- function descriptor that we want and not the actual function code. */
- && TREE_CODE (TREE_OPERAND (def_rhs, 0)) != FUNCTION_DECL
- /* We should not convert volatile loads to non volatile loads. */
- && !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)
- /* 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);
- if (TREE_CODE (new_rhs) != VIEW_CONVERT_EXPR)
- {
- /* If we have folded the VIEW_CONVERT_EXPR then the result is only
- valid if we can replace the whole rhs of the use statement. */
- if (rhs != gimple_assign_rhs1 (use_stmt))
- return false;
- new_rhs = force_gimple_operand_gsi (use_stmt_gsi, new_rhs, true, NULL,
- true, GSI_NEW_STMT);
- gimple_assign_set_rhs1 (use_stmt, new_rhs);
- tidy_after_forward_propagate_addr (use_stmt);
- return res;
- }
- /* If the defining rhs comes from an indirect reference, then do not
- convert into a VIEW_CONVERT_EXPR. Likewise if we'll end up taking
- the address of a V_C_E of a constant. */
- def_rhs_base = TREE_OPERAND (def_rhs, 0);
- while (handled_component_p (def_rhs_base))
- def_rhs_base = TREE_OPERAND (def_rhs_base, 0);
- if (!INDIRECT_REF_P (def_rhs_base)
- && (!addr_p
- || !is_gimple_min_invariant (def_rhs)))
- {
- /* We may have arbitrary VIEW_CONVERT_EXPRs in a nested component
- reference. Place it there and fold the thing. */
- *rhsp = new_rhs;
- fold_stmt_inplace (use_stmt);
- tidy_after_forward_propagate_addr (use_stmt);
- return res;
- }
- }
-
/* If the use of the ADDR_EXPR is not a POINTER_PLUS_EXPR, there
is nothing to do. */
if (gimple_assign_rhs_code (use_stmt) != POINTER_PLUS_EXPR
@@ -885,9 +990,10 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
element zero in an array. If that is not the case then there
is nothing to do. */
array_ref = TREE_OPERAND (def_rhs, 0);
- if (TREE_CODE (array_ref) != ARRAY_REF
- || TREE_CODE (TREE_TYPE (TREE_OPERAND (array_ref, 0))) != ARRAY_TYPE
- || TREE_CODE (TREE_OPERAND (array_ref, 1)) != INTEGER_CST)
+ if ((TREE_CODE (array_ref) != ARRAY_REF
+ || TREE_CODE (TREE_TYPE (TREE_OPERAND (array_ref, 0))) != ARRAY_TYPE
+ || TREE_CODE (TREE_OPERAND (array_ref, 1)) != INTEGER_CST)
+ && TREE_CODE (TREE_TYPE (array_ref)) != ARRAY_TYPE)
return false;
rhs2 = gimple_assign_rhs2 (use_stmt);
@@ -923,7 +1029,8 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
array elements, then the result is converted into the proper
type for the arithmetic. */
if (TREE_CODE (rhs2) == SSA_NAME
- && integer_zerop (TREE_OPERAND (array_ref, 1))
+ && (TREE_CODE (array_ref) != ARRAY_REF
+ || integer_zerop (TREE_OPERAND (array_ref, 1)))
&& useless_type_conversion_p (TREE_TYPE (name), TREE_TYPE (def_rhs))
/* Avoid problems with IVopts creating PLUS_EXPRs with a
different type than their operands. */
@@ -1289,8 +1396,11 @@ tree_ssa_forward_propagate_single_use_vars (void)
&& TREE_CODE (rhs) == ADDR_EXPR
&& POINTER_TYPE_P (TREE_TYPE (lhs))))
{
- STRIP_NOPS (rhs);
- if (!stmt_references_abnormal_ssa_name (stmt)
+ tree base = get_base_address (TREE_OPERAND (rhs, 0));
+ if ((!base
+ || !DECL_P (base)
+ || decl_address_invariant_p (base))
+ && !stmt_references_abnormal_ssa_name (stmt)
&& forward_propagate_addr_expr (lhs, rhs))
{
release_defs (stmt);
@@ -1300,13 +1410,35 @@ tree_ssa_forward_propagate_single_use_vars (void)
else
gsi_next (&gsi);
}
- else if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
- && is_gimple_min_invariant (rhs))
+ else if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
{
- /* Make sure to fold &a[0] + off_1 here. */
- fold_stmt_inplace (stmt);
- update_stmt (stmt);
- if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ if (TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST
+ /* ??? Better adjust the interface to that function
+ instead of building new trees here. */
+ && forward_propagate_addr_expr
+ (lhs,
+ build1 (ADDR_EXPR,
+ TREE_TYPE (rhs),
+ fold_build2 (MEM_REF,
+ TREE_TYPE (TREE_TYPE (rhs)),
+ rhs,
+ fold_convert
+ (ptr_type_node,
+ gimple_assign_rhs2 (stmt))))))
+ {
+ release_defs (stmt);
+ todoflags |= TODO_remove_unused_locals;
+ gsi_remove (&gsi, true);
+ }
+ else if (is_gimple_min_invariant (rhs))
+ {
+ /* Make sure to fold &a[0] + off_1 here. */
+ fold_stmt_inplace (stmt);
+ update_stmt (stmt);
+ if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ gsi_next (&gsi);
+ }
+ else
gsi_next (&gsi);
}
else if ((gimple_assign_rhs_code (stmt) == BIT_NOT_EXPR
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index ca1b985bb8e..e8194aa45ff 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -30,9 +30,11 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "tree-dump.h"
#include "tree-ssa-live.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "debug.h"
#include "flags.h"
+#include "gimple.h"
#ifdef ENABLE_CHECKING
static void verify_live_on_entry (tree_live_info_p);
@@ -382,6 +384,14 @@ mark_all_vars_used_1 (tree *tp, int *walk_subtrees, void *data)
}
set_is_used (t);
}
+ /* remove_unused_scope_block_p requires information about labels
+ which are not DECL_IGNORED_P to tell if they might be used in the IL. */
+ if (TREE_CODE (t) == LABEL_DECL)
+ /* Although the TREE_USED values that the frontend uses would be
+ acceptable (albeit slightly over-conservative) for our purposes,
+ init_vars_expansion clears TREE_USED for LABEL_DECLs too, so we
+ must re-compute it here. */
+ TREE_USED (t) = 1;
if (IS_TYPE_OR_DECL_P (t))
*walk_subtrees = 0;
@@ -426,7 +436,7 @@ remove_unused_scope_block_p (tree scope)
for (t = &BLOCK_VARS (scope); *t; t = next)
{
- next = &TREE_CHAIN (*t);
+ next = &DECL_CHAIN (*t);
/* Debug info of nested function refers to the block of the
function. We might stil call it even if all statements
@@ -450,7 +460,7 @@ remove_unused_scope_block_p (tree scope)
/* Remove everything we don't generate debug info for. */
else if (DECL_IGNORED_P (*t))
{
- *t = TREE_CHAIN (*t);
+ *t = DECL_CHAIN (*t);
next = t;
}
@@ -461,6 +471,19 @@ remove_unused_scope_block_p (tree scope)
else if ((ann = var_ann (*t)) != NULL
&& ann->used)
unused = false;
+ else if (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))
+ /* For labels that are still used in the IL, the decision to
+ preserve them must not depend DEBUG_INFO_LEVEL, otherwise we
+ risk having different ordering in debug vs. non-debug builds
+ during inlining or versioning.
+ A label appearing here (we have already checked DECL_IGNORED_P)
+ should not be used in the IL unless it has been explicitly used
+ before, so we use TREE_USED as an approximation. */
+ /* In principle, we should do the same here as for the debug case
+ below, however, when debugging, there might be additional nested
+ levels that keep an upper level with a label live, so we have to
+ force this block to be considered used, too. */
+ unused = false;
/* When we are not doing full debug info, we however can keep around
only the used variables for cfgexpand's memory packing saving quite
@@ -480,7 +503,7 @@ remove_unused_scope_block_p (tree scope)
;
else
{
- *t = TREE_CHAIN (*t);
+ *t = DECL_CHAIN (*t);
next = t;
}
}
@@ -603,7 +626,7 @@ dump_scope_block (FILE *file, int indent, tree scope, int flags)
}
}
fprintf (file, " \n");
- for (var = BLOCK_VARS (scope); var; var = TREE_CHAIN (var))
+ for (var = BLOCK_VARS (scope); var; var = DECL_CHAIN (var))
{
bool used = false;
var_ann_t ann;
@@ -663,10 +686,11 @@ void
remove_unused_locals (void)
{
basic_block bb;
- tree t, *cell;
+ tree var, t;
referenced_var_iterator rvi;
var_ann_t ann;
bitmap global_unused_vars = NULL;
+ unsigned srcidx, dstidx, num;
/* Removing declarations from lexical blocks when not optimizing is
not only a waste of time, it actually causes differences in stack
@@ -733,10 +757,10 @@ remove_unused_locals (void)
cfun->has_local_explicit_reg_vars = false;
/* Remove unmarked local vars from local_decls. */
- for (cell = &cfun->local_decls; *cell; )
+ num = VEC_length (tree, cfun->local_decls);
+ for (srcidx = 0, dstidx = 0; srcidx < num; srcidx++)
{
- tree var = TREE_VALUE (*cell);
-
+ var = VEC_index (tree, cfun->local_decls, srcidx);
if (TREE_CODE (var) != FUNCTION_DECL
&& (!(ann = var_ann (var))
|| !ann->used))
@@ -748,43 +772,47 @@ remove_unused_locals (void)
bitmap_set_bit (global_unused_vars, DECL_UID (var));
}
else
- {
- *cell = TREE_CHAIN (*cell);
- continue;
- }
+ continue;
}
else if (TREE_CODE (var) == VAR_DECL
&& DECL_HARD_REGISTER (var)
&& !is_global_var (var))
cfun->has_local_explicit_reg_vars = true;
- cell = &TREE_CHAIN (*cell);
+
+ if (srcidx != dstidx)
+ VEC_replace (tree, cfun->local_decls, dstidx, var);
+ dstidx++;
}
+ if (dstidx != num)
+ VEC_truncate (tree, cfun->local_decls, dstidx);
/* Remove unmarked global vars from local_decls. */
if (global_unused_vars != NULL)
{
- for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
- {
- tree var = TREE_VALUE (t);
-
- if (TREE_CODE (var) == VAR_DECL
- && is_global_var (var)
- && (ann = var_ann (var)) != NULL
- && ann->used)
- mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
- }
-
- for (cell = &cfun->local_decls; *cell; )
+ tree var;
+ unsigned ix;
+ FOR_EACH_LOCAL_DECL (cfun, ix, var)
+ if (TREE_CODE (var) == VAR_DECL
+ && is_global_var (var)
+ && (ann = var_ann (var)) != NULL
+ && ann->used)
+ mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
+
+ num = VEC_length (tree, cfun->local_decls);
+ for (srcidx = 0, dstidx = 0; srcidx < num; srcidx++)
{
- tree var = TREE_VALUE (*cell);
-
+ var = VEC_index (tree, cfun->local_decls, srcidx);
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
&& bitmap_bit_p (global_unused_vars, DECL_UID (var)))
- *cell = TREE_CHAIN (*cell);
- else
- cell = &TREE_CHAIN (*cell);
+ continue;
+
+ if (srcidx != dstidx)
+ VEC_replace (tree, cfun->local_decls, dstidx, var);
+ dstidx++;
}
+ if (dstidx != num)
+ VEC_truncate (tree, cfun->local_decls, dstidx);
BITMAP_FREE (global_unused_vars);
}
@@ -1169,6 +1197,96 @@ dump_live_info (FILE *f, tree_live_info_p live, int flag)
}
}
+struct GTY(()) numbered_tree_d
+{
+ tree t;
+ int num;
+};
+typedef struct numbered_tree_d numbered_tree;
+
+DEF_VEC_O (numbered_tree);
+DEF_VEC_ALLOC_O (numbered_tree, heap);
+
+/* Compare two declarations references by their DECL_UID / sequence number.
+ Called via qsort. */
+
+static int
+compare_decls_by_uid (const void *pa, const void *pb)
+{
+ const numbered_tree *nt_a = ((const numbered_tree *)pa);
+ const numbered_tree *nt_b = ((const numbered_tree *)pb);
+
+ if (DECL_UID (nt_a->t) != DECL_UID (nt_b->t))
+ return DECL_UID (nt_a->t) - DECL_UID (nt_b->t);
+ return nt_a->num - nt_b->num;
+}
+
+/* Called via walk_gimple_stmt / walk_gimple_op by dump_enumerated_decls. */
+static tree
+dump_enumerated_decls_push (tree *tp, int *walk_subtrees, void *data)
+{
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ VEC (numbered_tree, heap) **list = (VEC (numbered_tree, heap) **) &wi->info;
+ numbered_tree nt;
+
+ if (!DECL_P (*tp))
+ return NULL_TREE;
+ nt.t = *tp;
+ nt.num = VEC_length (numbered_tree, *list);
+ VEC_safe_push (numbered_tree, heap, *list, &nt);
+ *walk_subtrees = 0;
+ return NULL_TREE;
+}
+
+/* Find all the declarations used by the current function, sort them by uid,
+ and emit the sorted list. Each declaration is tagged with a sequence
+ number indicating when it was found during statement / tree walking,
+ so that TDF_NOUID comparisons of anonymous declarations are still
+ meaningful. Where a declaration was encountered more than once, we
+ emit only the sequence number of the first encounter.
+ FILE is the dump file where to output the list and FLAGS is as in
+ print_generic_expr. */
+void
+dump_enumerated_decls (FILE *file, int flags)
+{
+ basic_block bb;
+ struct walk_stmt_info wi;
+ VEC (numbered_tree, heap) *decl_list = VEC_alloc (numbered_tree, heap, 40);
+
+ wi.info = (void*) decl_list;
+ wi.pset = NULL;
+ FOR_EACH_BB (bb)
+ {
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ if (!is_gimple_debug (gsi_stmt (gsi)))
+ walk_gimple_stmt (&gsi, NULL, dump_enumerated_decls_push, &wi);
+ }
+ decl_list = (VEC (numbered_tree, heap) *) wi.info;
+ qsort (VEC_address (numbered_tree, decl_list),
+ VEC_length (numbered_tree, decl_list),
+ sizeof (numbered_tree), compare_decls_by_uid);
+ if (VEC_length (numbered_tree, decl_list))
+ {
+ unsigned ix;
+ numbered_tree *ntp;
+ tree last = NULL_TREE;
+
+ fprintf (file, "Declarations used by %s, sorted by DECL_UID:\n",
+ current_function_name ());
+ for (ix = 0; VEC_iterate (numbered_tree, decl_list, ix, ntp); ix++)
+ {
+ if (ntp->t == last)
+ continue;
+ fprintf (file, "%d: ", ntp->num);
+ print_generic_decl (file, ntp->t, flags);
+ fprintf (file, "\n");
+ last = ntp->t;
+ }
+ }
+ VEC_free (numbered_tree, heap, decl_list);
+}
#ifdef ENABLE_CHECKING
/* Verify that SSA_VAR is a non-virtual SSA_NAME. */
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index ce8bc34ebba..2e65d10db9a 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -273,8 +273,7 @@ for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data)
return cbck (*addr_p, addr_p, data);
case MISALIGNED_INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
- case INDIRECT_REF:
+ case MEM_REF:
nxt = &TREE_OPERAND (*addr_p, 0);
return cbck (*addr_p, nxt, data);
@@ -1984,12 +1983,15 @@ gen_lsm_tmp_name (tree ref)
switch (TREE_CODE (ref))
{
case MISALIGNED_INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
- case INDIRECT_REF:
+ case MEM_REF:
gen_lsm_tmp_name (TREE_OPERAND (ref, 0));
lsm_tmp_name_add ("_");
break;
+ case ADDR_EXPR:
+ gen_lsm_tmp_name (TREE_OPERAND (ref, 0));
+ break;
+
case BIT_FIELD_REF:
case VIEW_CONVERT_EXPR:
case ARRAY_RANGE_REF:
@@ -2150,7 +2152,8 @@ ref_always_accessed_p (struct loop *loop, mem_ref_p ref, bool stored_p)
tree base;
base = get_base_address (ref->mem);
- if (INDIRECT_REF_P (base))
+ if (INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
base = TREE_OPERAND (base, 0);
get_all_locs_in_loop (loop, ref, &locs);
@@ -2169,7 +2172,8 @@ ref_always_accessed_p (struct loop *loop, mem_ref_p ref, bool stored_p)
lhs = get_base_address (gimple_get_lhs (loc->stmt));
if (!lhs)
continue;
- if (INDIRECT_REF_P (lhs))
+ if (INDIRECT_REF_P (lhs)
+ || TREE_CODE (lhs) == MEM_REF)
lhs = TREE_OPERAND (lhs, 0);
if (lhs != base)
continue;
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 32b89352653..c7d534b1f5f 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -89,6 +89,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "tree-affine.h"
#include "target.h"
+#include "tree-ssa-propagate.h"
/* FIXME: Expressions are expanded to RTL in this pass to determine the
cost of different addressing modes. This should be moved to a TBD
@@ -259,6 +260,9 @@ struct ivopts_data
/* Are we optimizing for speed? */
bool speed;
+
+ /* Whether the loop body includes any function calls. */
+ bool body_includes_call;
};
/* An assignment of iv candidates to uses. */
@@ -813,7 +817,7 @@ determine_base_object (tree expr)
if (!base)
return expr;
- if (TREE_CODE (base) == INDIRECT_REF)
+ if (TREE_CODE (base) == MEM_REF)
return determine_base_object (TREE_OPERAND (base, 0));
return fold_convert (ptr_type_node,
@@ -1359,8 +1363,7 @@ idx_find_step (tree base, tree *idx, void *data)
tree step, iv_base, iv_step, lbound, off;
struct loop *loop = dta->ivopts_data->current_loop;
- if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF
- || TREE_CODE (base) == ALIGN_INDIRECT_REF)
+ if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
return false;
/* If base is a component ref, require that the offset of the reference
@@ -1415,7 +1418,7 @@ idx_find_step (tree base, tree *idx, void *data)
}
else
/* The step for pointer arithmetics already is 1 byte. */
- step = build_int_cst (sizetype, 1);
+ step = size_one_node;
iv_base = iv->base;
iv_step = iv->step;
@@ -1608,7 +1611,7 @@ may_be_nonaddressable_p (tree expr)
static void
find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p)
{
- tree base = *op_p, step = build_int_cst (sizetype, 0);
+ tree base = *op_p, step = size_zero_node;
struct iv *civ;
struct ifs_ivopts_data ifs_ivopts_data;
@@ -1666,13 +1669,12 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p
{
ifs_ivopts_data.ivopts_data = data;
ifs_ivopts_data.stmt = stmt;
- ifs_ivopts_data.step = build_int_cst (sizetype, 0);
+ ifs_ivopts_data.step = size_zero_node;
if (!for_each_index (&base, idx_find_step, &ifs_ivopts_data)
|| integer_zerop (ifs_ivopts_data.step))
goto fail;
step = ifs_ivopts_data.step;
- gcc_assert (TREE_CODE (base) != ALIGN_INDIRECT_REF);
gcc_assert (TREE_CODE (base) != MISALIGNED_INDIRECT_REF);
/* Check that the base expression is addressable. This needs
@@ -1694,9 +1696,11 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p
tree *ref = &TREE_OPERAND (base, 0);
while (handled_component_p (*ref))
ref = &TREE_OPERAND (*ref, 0);
- if (TREE_CODE (*ref) == INDIRECT_REF)
+ if (TREE_CODE (*ref) == MEM_REF)
{
- tree tem = gimple_fold_indirect_ref (TREE_OPERAND (*ref, 0));
+ tree tem = fold_binary (MEM_REF, TREE_TYPE (*ref),
+ TREE_OPERAND (*ref, 0),
+ TREE_OPERAND (*ref, 1));
if (tem)
*ref = tem;
}
@@ -2018,7 +2022,8 @@ strip_offset_1 (tree expr, bool inside_addr, bool top_compref,
expr = build_fold_addr_expr (op0);
return fold_convert (orig_type, expr);
- case INDIRECT_REF:
+ case MEM_REF:
+ /* ??? Offset operand? */
inside_addr = false;
break;
@@ -3889,7 +3894,7 @@ fallback:
return infinite_cost;
if (address_p)
- comp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (comp)), comp);
+ comp = build_simple_mem_ref (comp);
return new_cost (computation_cost (comp, speed), 0);
}
@@ -4429,7 +4434,8 @@ ivopts_global_cost_for_size (struct ivopts_data *data, unsigned size)
{
/* We add size to the cost, so that we prefer eliminating ivs
if possible. */
- return size + estimate_reg_pressure_cost (size, data->regs_used, data->speed);
+ return size + estimate_reg_pressure_cost (size, data->regs_used, data->speed,
+ data->body_includes_call);
}
/* For each size of the induction variable set determine the penalty. */
@@ -4444,30 +4450,11 @@ determine_set_costs (struct ivopts_data *data)
struct loop *loop = data->current_loop;
bitmap_iterator bi;
- /* We use the following model (definitely improvable, especially the
- cost function -- TODO):
-
- We estimate the number of registers available (using MD data), name it A.
-
- We estimate the number of registers used by the loop, name it U. This
- number is obtained as the number of loop phi nodes (not counting virtual
- registers and bivs) + the number of variables from outside of the loop.
-
- We set a reserve R (free regs that are used for temporary computations,
- etc.). For now the reserve is a constant 3.
-
- Let I be the number of induction variables.
-
- -- if U + I + R <= A, the cost is I * SMALL_COST (just not to encourage
- make a lot of ivs without a reason).
- -- if A - R < U + I <= A, the cost is I * PRES_COST
- -- if U + I > A, the cost is I * PRES_COST and
- number of uses * SPILL_COST * (U + I - A) / (U + I) is added. */
-
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Global costs:\n");
fprintf (dump_file, " target_avail_regs %d\n", target_avail_regs);
+ fprintf (dump_file, " target_clobbered_regs %d\n", target_clobbered_regs);
fprintf (dump_file, " target_reg_cost %d\n", target_reg_cost[data->speed]);
fprintf (dump_file, " target_spill_cost %d\n", target_spill_cost[data->speed]);
}
@@ -5087,11 +5074,13 @@ iv_ca_prune (struct ivopts_data *data, struct iv_ca *ivs,
}
/* Tries to extend the sets IVS in the best possible way in order
- to express the USE. */
+ to express the USE. If ORIGINALP is true, prefer candidates from
+ the original set of IVs, otherwise favor important candidates not
+ based on any memory object. */
static bool
try_add_cand_for (struct ivopts_data *data, struct iv_ca *ivs,
- struct iv_use *use)
+ struct iv_use *use, bool originalp)
{
comp_cost best_cost, act_cost;
unsigned i;
@@ -5110,7 +5099,8 @@ try_add_cand_for (struct ivopts_data *data, struct iv_ca *ivs,
iv_ca_set_no_cp (data, ivs, use);
}
- /* First try important candidates not based on any memory object. Only if
+ /* If ORIGINALP is true, try to find the original IV for the use. Otherwise
+ first try important candidates not based on any memory object. Only if
this fails, try the specific ones. Rationale -- in loops with many
variables the best choice often is to use just one generic biv. If we
added here many ivs specific to the uses, the optimization algorithm later
@@ -5122,7 +5112,10 @@ try_add_cand_for (struct ivopts_data *data, struct iv_ca *ivs,
{
cand = iv_cand (data, i);
- if (cand->iv->base_object != NULL_TREE)
+ if (originalp && cand->pos !=IP_ORIGINAL)
+ continue;
+
+ if (!originalp && cand->iv->base_object != NULL_TREE)
continue;
if (iv_ca_cand_used_p (ivs, cand))
@@ -5158,8 +5151,13 @@ try_add_cand_for (struct ivopts_data *data, struct iv_ca *ivs,
continue;
/* Already tried this. */
- if (cand->important && cand->iv->base_object == NULL_TREE)
- continue;
+ if (cand->important)
+ {
+ if (originalp && cand->pos == IP_ORIGINAL)
+ continue;
+ if (!originalp && cand->iv->base_object == NULL_TREE)
+ continue;
+ }
if (iv_ca_cand_used_p (ivs, cand))
continue;
@@ -5193,13 +5191,13 @@ try_add_cand_for (struct ivopts_data *data, struct iv_ca *ivs,
/* Finds an initial assignment of candidates to uses. */
static struct iv_ca *
-get_initial_solution (struct ivopts_data *data)
+get_initial_solution (struct ivopts_data *data, bool originalp)
{
struct iv_ca *ivs = iv_ca_new (data);
unsigned i;
for (i = 0; i < n_iv_uses (data); i++)
- if (!try_add_cand_for (data, ivs, iv_use (data, i)))
+ if (!try_add_cand_for (data, ivs, iv_use (data, i), originalp))
{
iv_ca_free (&ivs);
return NULL;
@@ -5271,14 +5269,12 @@ try_improve_iv_set (struct ivopts_data *data, struct iv_ca *ivs)
solution and remove the unused ivs while this improves the cost. */
static struct iv_ca *
-find_optimal_iv_set (struct ivopts_data *data)
+find_optimal_iv_set_1 (struct ivopts_data *data, bool originalp)
{
- unsigned i;
struct iv_ca *set;
- struct iv_use *use;
/* Get the initial solution. */
- set = get_initial_solution (data);
+ set = get_initial_solution (data, originalp);
if (!set)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -5301,11 +5297,46 @@ find_optimal_iv_set (struct ivopts_data *data)
}
}
+ return set;
+}
+
+static struct iv_ca *
+find_optimal_iv_set (struct ivopts_data *data)
+{
+ unsigned i;
+ struct iv_ca *set, *origset;
+ struct iv_use *use;
+ comp_cost cost, origcost;
+
+ /* Determine the cost based on a strategy that starts with original IVs,
+ and try again using a strategy that prefers candidates not based
+ on any IVs. */
+ origset = find_optimal_iv_set_1 (data, true);
+ set = find_optimal_iv_set_1 (data, false);
+
+ if (!origset && !set)
+ return NULL;
+
+ origcost = origset ? iv_ca_cost (origset) : infinite_cost;
+ cost = set ? iv_ca_cost (set) : infinite_cost;
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
- comp_cost cost = iv_ca_cost (set);
- fprintf (dump_file, "Final cost %d (complexity %d)\n\n", cost.cost, cost.complexity);
+ fprintf (dump_file, "Original cost %d (complexity %d)\n\n",
+ origcost.cost, origcost.complexity);
+ fprintf (dump_file, "Final cost %d (complexity %d)\n\n",
+ cost.cost, cost.complexity);
+ }
+
+ /* Choose the one with the best cost. */
+ if (compare_costs (origcost, cost) <= 0)
+ {
+ if (set)
+ iv_ca_free (&set);
+ set = origset;
}
+ else if (origset)
+ iv_ca_free (&origset);
for (i = 0; i < n_iv_uses (data); i++)
{
@@ -5478,12 +5509,22 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
gcc_unreachable ();
}
- op = force_gimple_operand_gsi (&bsi, comp, false, SSA_NAME_VAR (tgt),
- true, GSI_SAME_STMT);
+ if (!valid_gimple_rhs_p (comp)
+ || (gimple_code (use->stmt) != GIMPLE_PHI
+ /* We can't allow re-allocating the stmt as it might be pointed
+ to still. */
+ && (get_gimple_rhs_num_ops (TREE_CODE (comp))
+ >= gimple_num_ops (gsi_stmt (bsi)))))
+ {
+ comp = force_gimple_operand_gsi (&bsi, comp, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ if (POINTER_TYPE_P (TREE_TYPE (tgt)))
+ duplicate_ssa_name_ptr_info (comp, SSA_NAME_PTR_INFO (tgt));
+ }
if (gimple_code (use->stmt) == GIMPLE_PHI)
{
- ass = gimple_build_assign (tgt, op);
+ ass = gimple_build_assign (tgt, comp);
gsi_insert_before (&bsi, ass, GSI_SAME_STMT);
bsi = gsi_for_stmt (use->stmt);
@@ -5491,7 +5532,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
}
else
{
- gimple_assign_set_rhs_from_tree (&bsi, op);
+ gimple_assign_set_rhs_from_tree (&bsi, comp);
use->stmt = gsi_stmt (bsi);
}
}
@@ -5539,13 +5580,44 @@ unshare_and_remove_ssa_names (tree ref)
static void
copy_ref_info (tree new_ref, tree old_ref)
{
- if (TREE_CODE (old_ref) == TARGET_MEM_REF)
- copy_mem_ref_info (new_ref, old_ref);
- else
+ tree new_ptr_base = NULL_TREE;
+
+ if (TREE_CODE (old_ref) == TARGET_MEM_REF
+ && TREE_CODE (new_ref) == TARGET_MEM_REF)
+ TMR_ORIGINAL (new_ref) = TMR_ORIGINAL (old_ref);
+ else if (TREE_CODE (new_ref) == TARGET_MEM_REF)
+ TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref);
+
+ TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref);
+ TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref);
+
+ if (TREE_CODE (new_ref) == TARGET_MEM_REF)
+ new_ptr_base = TMR_BASE (new_ref);
+ else if (TREE_CODE (new_ref) == MEM_REF)
+ new_ptr_base = TREE_OPERAND (new_ref, 0);
+
+ /* We can transfer points-to information from an old pointer
+ or decl base to the new one. */
+ if (new_ptr_base
+ && TREE_CODE (new_ptr_base) == SSA_NAME
+ && POINTER_TYPE_P (TREE_TYPE (new_ptr_base))
+ && !SSA_NAME_PTR_INFO (new_ptr_base))
{
- TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref);
- TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref);
- TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref);
+ tree base = get_base_address (old_ref);
+ if (!base)
+ ;
+ else if ((INDIRECT_REF_P (base)
+ || TREE_CODE (base) == MEM_REF)
+ && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
+ duplicate_ssa_name_ptr_info
+ (new_ptr_base, SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0)));
+ else if (TREE_CODE (base) == VAR_DECL
+ || TREE_CODE (base) == PARM_DECL
+ || TREE_CODE (base) == RESULT_DECL)
+ {
+ struct ptr_info_def *pi = get_ptr_info (new_ptr_base);
+ pt_solution_set_var (&pi->pt, base);
+ }
}
}
@@ -5579,8 +5651,9 @@ rewrite_use_address (struct ivopts_data *data,
if (cand->iv->base_object)
base_hint = var_at_stmt (data->current_loop, cand, use->stmt);
- ref = create_mem_ref (&bsi, TREE_TYPE (*use->op_p), &aff, base_hint,
- data->speed);
+ ref = create_mem_ref (&bsi, TREE_TYPE (*use->op_p),
+ reference_alias_ptr_type (*use->op_p),
+ &aff, base_hint, data->speed);
copy_ref_info (ref, *use->op_p);
*use->op_p = ref;
}
@@ -5793,6 +5866,25 @@ tree_ssa_iv_optimize_finalize (struct ivopts_data *data)
VEC_free (iv_cand_p, heap, data->iv_candidates);
}
+/* Returns true if the loop body BODY includes any function calls. */
+
+static bool
+loop_body_includes_call (basic_block *body, unsigned num_nodes)
+{
+ gimple_stmt_iterator gsi;
+ unsigned i;
+
+ for (i = 0; i < num_nodes; i++)
+ for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (is_gimple_call (stmt)
+ && !is_inexpensive_builtin (gimple_call_fndecl (stmt)))
+ return true;
+ }
+ return false;
+}
+
/* Optimizes the LOOP. Returns true if anything changed. */
static bool
@@ -5824,6 +5916,7 @@ tree_ssa_iv_optimize_loop (struct ivopts_data *data, struct loop *loop)
}
body = get_loop_body (loop);
+ data->body_includes_call = loop_body_includes_call (body, loop->num_nodes);
renumber_gimple_stmt_uids_in_blocks (body, loop->num_nodes);
free (body);
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index c0c89113d41..6ec0575990d 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
#include "params.h"
#include "flags.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-inline.h"
#include "gmp.h"
@@ -2397,7 +2398,7 @@ derive_constant_upper_bound_ops (tree type, tree op0,
/* OP0 + CST. We need to check that
BND <= MAX (type) - CST. */
- mmax = double_int_add (max, double_int_neg (cst));
+ mmax = double_int_sub (max, cst);
if (double_int_ucmp (bnd, mmax) > 0)
return max;
@@ -2429,7 +2430,7 @@ derive_constant_upper_bound_ops (tree type, tree op0,
return max;
}
- bnd = double_int_add (bnd, double_int_neg (cst));
+ bnd = double_int_sub (bnd, cst);
}
return bnd;
@@ -2625,7 +2626,7 @@ array_at_struct_end_p (tree ref)
/* Unless the reference is through a pointer, the size of the array matches
its declaration. */
- if (!base || !INDIRECT_REF_P (base))
+ if (!base || (!INDIRECT_REF_P (base) && TREE_CODE (base) != MEM_REF))
return false;
for (;handled_component_p (ref); ref = parent)
@@ -2640,7 +2641,7 @@ array_at_struct_end_p (tree ref)
/* Unless the field is at the end of the struct, we are done. */
field = TREE_OPERAND (ref, 1);
- if (TREE_CHAIN (field))
+ if (DECL_CHAIN (field))
return false;
}
@@ -2651,7 +2652,6 @@ array_at_struct_end_p (tree ref)
Therefore, continue checking. */
}
- gcc_assert (INDIRECT_REF_P (ref));
return true;
}
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 65474898ad9..4840704be19 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-chrec.h"
#include "tree-scalar-evolution.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "params.h"
#include "langhooks.h"
@@ -109,19 +110,29 @@ along with GCC; see the file COPYING3. If not see
prefetch instructions with guards in cases where 5) was not sufficient
to satisfy the constraints?
- The function is_loop_prefetching_profitable() implements a cost model
- to determine if prefetching is profitable for a given loop. The cost
- model has two heuristcs:
- 1. A heuristic that determines whether the given loop has enough CPU
- ops that can be overlapped with cache missing memory ops.
- If not, the loop won't benefit from prefetching. This is implemented
- by requirung the ratio between the instruction count and the mem ref
- count to be above a certain minimum.
- 2. A heuristic that disables prefetching in a loop with an unknown trip
- count if the prefetching cost is above a certain limit. The relative
- prefetching cost is estimated by taking the ratio between the
- prefetch count and the total intruction count (this models the I-cache
- cost).
+ A cost model is implemented to determine whether or not prefetching is
+ profitable for a given loop. The cost model has three heuristics:
+
+ 1. Function trip_count_to_ahead_ratio_too_small_p implements a
+ heuristic that determines whether or not the loop has too few
+ iterations (compared to ahead). Prefetching is not likely to be
+ beneficial if the trip count to ahead ratio is below a certain
+ minimum.
+
+ 2. Function mem_ref_count_reasonable_p implements a heuristic that
+ determines whether the given loop has enough CPU ops that can be
+ overlapped with cache missing memory ops. If not, the loop
+ won't benefit from prefetching. In the implementation,
+ prefetching is not considered beneficial if the ratio between
+ the instruction count and the mem ref count is below a certain
+ minimum.
+
+ 3. Function insn_to_prefetch_ratio_too_small_p implements a
+ heuristic that disables prefetching in a loop if the prefetching
+ cost is above a certain limit. The relative prefetching cost is
+ estimated by taking the ratio between the prefetch count and the
+ total intruction count (this models the I-cache cost).
+
The limits used in these heuristics are defined as parameters with
reasonable default values. Machine-specific default values will be
added later.
@@ -237,6 +248,14 @@ struct mem_ref_group
#define PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO 4
#endif
+/* Some of the prefetch computations have quadratic complexity. We want to
+ avoid huge compile times and, therefore, want to limit the amount of
+ memory references per loop where we consider prefetching. */
+
+#ifndef PREFETCH_MAX_MEM_REFS_PER_LOOP
+#define PREFETCH_MAX_MEM_REFS_PER_LOOP 200
+#endif
+
/* The memory reference. */
struct mem_ref
@@ -404,8 +423,7 @@ idx_analyze_ref (tree base, tree *index, void *data)
HOST_WIDE_INT idelta = 0, imult = 1;
affine_iv iv;
- if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF
- || TREE_CODE (base) == ALIGN_INDIRECT_REF)
+ if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
return false;
if (!simple_iv (ar_data->loop, loop_containing_stmt (ar_data->stmt),
@@ -468,10 +486,18 @@ analyze_ref (struct loop *loop, tree *ref_p, tree *base,
*step = NULL_TREE;
*delta = 0;
- /* First strip off the component references. Ignore bitfields. */
- if (TREE_CODE (ref) == COMPONENT_REF
- && DECL_NONADDRESSABLE_P (TREE_OPERAND (ref, 1)))
- ref = TREE_OPERAND (ref, 0);
+ /* First strip off the component references. Ignore bitfields.
+ Also strip off the real and imagine parts of a complex, so that
+ they can have the same base. */
+ if (TREE_CODE (ref) == REALPART_EXPR
+ || TREE_CODE (ref) == IMAGPART_EXPR
+ || (TREE_CODE (ref) == COMPONENT_REF
+ && DECL_NONADDRESSABLE_P (TREE_OPERAND (ref, 1))))
+ {
+ if (TREE_CODE (ref) == IMAGPART_EXPR)
+ *delta += int_size_in_bytes (TREE_TYPE (ref));
+ ref = TREE_OPERAND (ref, 0);
+ }
*ref_p = ref;
@@ -640,22 +666,29 @@ ddown (HOST_WIDE_INT x, unsigned HOST_WIDE_INT by)
/* Given a CACHE_LINE_SIZE and two inductive memory references
with a common STEP greater than CACHE_LINE_SIZE and an address
difference DELTA, compute the probability that they will fall
- in different cache lines. DISTINCT_ITERS is the number of
- distinct iterations after which the pattern repeats itself.
+ in different cache lines. Return true if the computed miss rate
+ is not greater than the ACCEPTABLE_MISS_RATE. DISTINCT_ITERS is the
+ number of distinct iterations after which the pattern repeats itself.
ALIGN_UNIT is the unit of alignment in bytes. */
-static int
-compute_miss_rate (unsigned HOST_WIDE_INT cache_line_size,
+static bool
+is_miss_rate_acceptable (unsigned HOST_WIDE_INT cache_line_size,
HOST_WIDE_INT step, HOST_WIDE_INT delta,
unsigned HOST_WIDE_INT distinct_iters,
int align_unit)
{
unsigned align, iter;
- int total_positions, miss_positions, miss_rate;
+ int total_positions, miss_positions, max_allowed_miss_positions;
int address1, address2, cache_line1, cache_line2;
- total_positions = 0;
+ /* It always misses if delta is greater than or equal to the cache
+ line size. */
+ if (delta >= (HOST_WIDE_INT) cache_line_size)
+ return false;
+
miss_positions = 0;
+ total_positions = (cache_line_size / align_unit) * distinct_iters;
+ max_allowed_miss_positions = (ACCEPTABLE_MISS_RATE * total_positions) / 1000;
/* Iterate through all possible alignments of the first
memory reference within its cache line. */
@@ -668,12 +701,14 @@ compute_miss_rate (unsigned HOST_WIDE_INT cache_line_size,
address2 = address1 + delta;
cache_line1 = address1 / cache_line_size;
cache_line2 = address2 / cache_line_size;
- total_positions += 1;
if (cache_line1 != cache_line2)
- miss_positions += 1;
+ {
+ miss_positions += 1;
+ if (miss_positions > max_allowed_miss_positions)
+ return false;
+ }
}
- miss_rate = 1000 * miss_positions / total_positions;
- return miss_rate;
+ return true;
}
/* Prune the prefetch candidate REF using the reuse with BY.
@@ -689,7 +724,6 @@ prune_ref_by_group_reuse (struct mem_ref *ref, struct mem_ref *by,
HOST_WIDE_INT delta = delta_b - delta_r;
HOST_WIDE_INT hit_from;
unsigned HOST_WIDE_INT prefetch_before, prefetch_block;
- int miss_rate;
HOST_WIDE_INT reduced_step;
unsigned HOST_WIDE_INT reduced_prefetch_block;
tree ref_type;
@@ -788,9 +822,8 @@ prune_ref_by_group_reuse (struct mem_ref *ref, struct mem_ref *by,
delta %= step;
ref_type = TREE_TYPE (ref->mem);
align_unit = TYPE_ALIGN (ref_type) / 8;
- miss_rate = compute_miss_rate(prefetch_block, step, delta,
- reduced_prefetch_block, align_unit);
- if (miss_rate <= ACCEPTABLE_MISS_RATE)
+ if (is_miss_rate_acceptable (prefetch_block, step, delta,
+ reduced_prefetch_block, align_unit))
{
/* Do not reduce prefetch_before if we meet beyond cache size. */
if (prefetch_before > L2_CACHE_SIZE_BYTES / PREFETCH_BLOCK)
@@ -804,9 +837,8 @@ prune_ref_by_group_reuse (struct mem_ref *ref, struct mem_ref *by,
/* Try also the following iteration. */
prefetch_before++;
delta = step - delta;
- miss_rate = compute_miss_rate(prefetch_block, step, delta,
- reduced_prefetch_block, align_unit);
- if (miss_rate <= ACCEPTABLE_MISS_RATE)
+ if (is_miss_rate_acceptable (prefetch_block, step, delta,
+ reduced_prefetch_block, align_unit))
{
if (prefetch_before < ref->prefetch_before)
ref->prefetch_before = prefetch_before;
@@ -1059,7 +1091,7 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
addr_base = force_gimple_operand_gsi (&bsi, unshare_expr (addr_base),
true, NULL, true, GSI_SAME_STMT);
write_p = ref->write_p ? integer_one_node : integer_zero_node;
- local = build_int_cst (integer_type_node, nontemporal ? 0 : 3);
+ local = nontemporal ? integer_zero_node : integer_three_node;
for (ap = 0; ap < n_prefetches; ap++)
{
@@ -1130,7 +1162,7 @@ nontemporal_store_p (struct mem_ref *ref)
if (mode == BLKmode)
return false;
- code = optab_handler (storent_optab, mode)->insn_code;
+ code = optab_handler (storent_optab, mode);
return code != CODE_FOR_nothing;
}
@@ -1634,24 +1666,51 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
}
}
-/* Do a cost-benefit analysis to determine if prefetching is profitable
- for the current loop given the following parameters:
+/* Determine whether or not the trip count to ahead ratio is too small based
+ on prefitablility consideration.
AHEAD: the iteration ahead distance,
- EST_NITER: the estimated trip count,
+ EST_NITER: the estimated trip count. */
+
+static bool
+trip_count_to_ahead_ratio_too_small_p (unsigned ahead, HOST_WIDE_INT est_niter)
+{
+ /* Assume trip count to ahead ratio is big enough if the trip count could not
+ be estimated at compile time. */
+ if (est_niter < 0)
+ return false;
+
+ if (est_niter < (HOST_WIDE_INT) (TRIP_COUNT_TO_AHEAD_RATIO * ahead))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ "Not prefetching -- loop estimated to roll only %d times\n",
+ (int) est_niter);
+ return true;
+ }
+
+ return false;
+}
+
+/* Determine whether or not the number of memory references in the loop is
+ reasonable based on the profitablity and compilation time considerations.
NINSNS: estimated number of instructions in the loop,
- PREFETCH_COUNT: an estimate of the number of prefetches
MEM_REF_COUNT: total number of memory references in the loop. */
static bool
-is_loop_prefetching_profitable (unsigned ahead, HOST_WIDE_INT est_niter,
- unsigned ninsns, unsigned prefetch_count,
- unsigned mem_ref_count, unsigned unroll_factor)
+mem_ref_count_reasonable_p (unsigned ninsns, unsigned mem_ref_count)
{
- int insn_to_mem_ratio, insn_to_prefetch_ratio;
+ int insn_to_mem_ratio;
if (mem_ref_count == 0)
return false;
+ /* Miss rate computation (is_miss_rate_acceptable) and dependence analysis
+ (compute_all_dependences) have high costs based on quadratic complexity.
+ To avoid huge compilation time, we give up prefetching if mem_ref_count
+ is too large. */
+ if (mem_ref_count > PREFETCH_MAX_MEM_REFS_PER_LOOP)
+ return false;
+
/* Prefetching improves performance by overlapping cache missing
memory accesses with CPU operations. If the loop does not have
enough CPU operations to overlap with memory operations, prefetching
@@ -1672,6 +1731,21 @@ is_loop_prefetching_profitable (unsigned ahead, HOST_WIDE_INT est_niter,
return false;
}
+ return true;
+}
+
+/* Determine whether or not the instruction to prefetch ratio in the loop is
+ too small based on the profitablity consideration.
+ NINSNS: estimated number of instructions in the loop,
+ PREFETCH_COUNT: an estimate of the number of prefetches,
+ UNROLL_FACTOR: the factor to unroll the loop if prefetching. */
+
+static bool
+insn_to_prefetch_ratio_too_small_p (unsigned ninsns, unsigned prefetch_count,
+ unsigned unroll_factor)
+{
+ int insn_to_prefetch_ratio;
+
/* Prefetching most likely causes performance degradation when the instruction
to prefetch ratio is too small. Too many prefetch instructions in a loop
may reduce the I-cache performance.
@@ -1691,23 +1765,10 @@ is_loop_prefetching_profitable (unsigned ahead, HOST_WIDE_INT est_niter,
fprintf (dump_file,
"Not prefetching -- instruction to prefetch ratio (%d) too small\n",
insn_to_prefetch_ratio);
- return false;
+ return true;
}
- /* Could not do further estimation if the trip count is unknown. Just assume
- prefetching is profitable. Too aggressive??? */
- if (est_niter < 0)
- return true;
-
- if (est_niter < (HOST_WIDE_INT) (TRIP_COUNT_TO_AHEAD_RATIO * ahead))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Not prefetching -- loop estimated to roll only %d times\n",
- (int) est_niter);
- return false;
- }
- return true;
+ return false;
}
@@ -1732,9 +1793,31 @@ loop_prefetch_arrays (struct loop *loop)
return false;
}
+ /* FIXME: the time should be weighted by the probabilities of the blocks in
+ the loop body. */
+ time = tree_num_loop_insns (loop, &eni_time_weights);
+ if (time == 0)
+ return false;
+
+ ahead = (PREFETCH_LATENCY + time - 1) / time;
+ est_niter = estimated_loop_iterations_int (loop, false);
+
+ /* Prefetching is not likely to be profitable if the trip count to ahead
+ ratio is too small. */
+ if (trip_count_to_ahead_ratio_too_small_p (ahead, est_niter))
+ return false;
+
+ ninsns = tree_num_loop_insns (loop, &eni_size_weights);
+
/* Step 1: gather the memory references. */
refs = gather_memory_references (loop, &no_other_refs, &mem_ref_count);
+ /* Give up prefetching if the number of memory references in the
+ loop is not reasonable based on profitablity and compilation time
+ considerations. */
+ if (!mem_ref_count_reasonable_p (ninsns, mem_ref_count))
+ goto fail;
+
/* Step 2: estimate the reuse effects. */
prune_by_reuse (refs);
@@ -1743,15 +1826,7 @@ loop_prefetch_arrays (struct loop *loop)
determine_loop_nest_reuse (loop, refs, no_other_refs);
- /* Step 3: determine the ahead and unroll factor. */
-
- /* FIXME: the time should be weighted by the probabilities of the blocks in
- the loop body. */
- time = tree_num_loop_insns (loop, &eni_time_weights);
- ahead = (PREFETCH_LATENCY + time - 1) / time;
- est_niter = estimated_loop_iterations_int (loop, false);
-
- ninsns = tree_num_loop_insns (loop, &eni_size_weights);
+ /* Step 3: determine unroll factor. */
unroll_factor = determine_unroll_factor (loop, refs, ninsns, &desc,
est_niter);
@@ -1767,8 +1842,10 @@ loop_prefetch_arrays (struct loop *loop)
ahead, unroll_factor, est_niter,
ninsns, mem_ref_count, prefetch_count);
- if (!is_loop_prefetching_profitable (ahead, est_niter, ninsns, prefetch_count,
- mem_ref_count, unroll_factor))
+ /* Prefetching is not likely to be profitable if the instruction to prefetch
+ ratio is too small. */
+ if (insn_to_prefetch_ratio_too_small_p (ninsns, prefetch_count,
+ unroll_factor))
goto fail;
mark_nontemporal_stores (loop, refs);
@@ -1834,10 +1911,8 @@ tree_ssa_prefetch_arrays (void)
if (!built_in_decls[BUILT_IN_PREFETCH])
{
- tree type = build_function_type (void_type_node,
- tree_cons (NULL_TREE,
- const_ptr_type_node,
- NULL_TREE));
+ tree type = build_function_type_list (void_type_node,
+ const_ptr_type_node, NULL_TREE);
tree decl = add_builtin_function ("__builtin_prefetch", type,
BUILT_IN_PREFETCH, BUILT_IN_NORMAL,
NULL, NULL_TREE);
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index c9c5bbd0f0c..7a60144d004 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "tree-inline.h"
#include "tree-scalar-evolution.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-vectorizer.h"
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index c8c64928273..9b96a608827 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -474,7 +474,7 @@ execute_cse_reciprocals (void)
gcc_assert (!bb->aux);
#endif
- for (arg = DECL_ARGUMENTS (cfun->decl); arg; arg = TREE_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (cfun->decl); arg; arg = DECL_CHAIN (arg))
if (gimple_default_def (cfun, arg)
&& FLOAT_TYPE_P (TREE_TYPE (arg))
&& is_gimple_reg (arg))
@@ -1113,11 +1113,9 @@ execute_optimize_bswap (void)
return 0;
bswap32_p = (built_in_decls[BUILT_IN_BSWAP32]
- && optab_handler (bswap_optab, SImode)->insn_code !=
- CODE_FOR_nothing);
+ && optab_handler (bswap_optab, SImode) != CODE_FOR_nothing);
bswap64_p = (built_in_decls[BUILT_IN_BSWAP64]
- && (optab_handler (bswap_optab, DImode)->insn_code !=
- CODE_FOR_nothing
+ && (optab_handler (bswap_optab, DImode) != CODE_FOR_nothing
|| (bswap32_p && word_mode == SImode)));
if (!bswap32_p && !bswap64_p)
@@ -1262,93 +1260,127 @@ struct gimple_opt_pass pass_optimize_bswap =
}
};
-/* Process a single gimple statement STMT, which has a MULT_EXPR as
- its rhs, and try to convert it into a WIDEN_MULT_EXPR. The return
- value is true iff we converted the statement. */
+/* Return true if RHS is a suitable operand for a widening multiplication.
+ There are two cases:
+
+ - RHS makes some value twice as wide. Store that value in *NEW_RHS_OUT
+ if so, and store its type in *TYPE_OUT.
+
+ - RHS is an integer constant. Store that value in *NEW_RHS_OUT if so,
+ but leave *TYPE_OUT untouched. */
static bool
-convert_mult_to_widen (gimple stmt)
+is_widening_mult_rhs_p (tree rhs, tree *type_out, tree *new_rhs_out)
+{
+ gimple stmt;
+ tree type, type1, rhs1;
+ enum tree_code rhs_code;
+
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ type = TREE_TYPE (rhs);
+ stmt = SSA_NAME_DEF_STMT (rhs);
+ if (!is_gimple_assign (stmt))
+ return false;
+
+ rhs_code = gimple_assign_rhs_code (stmt);
+ if (TREE_CODE (type) == INTEGER_TYPE
+ ? !CONVERT_EXPR_CODE_P (rhs_code)
+ : rhs_code != FIXED_CONVERT_EXPR)
+ return false;
+
+ rhs1 = gimple_assign_rhs1 (stmt);
+ type1 = TREE_TYPE (rhs1);
+ if (TREE_CODE (type1) != TREE_CODE (type)
+ || TYPE_PRECISION (type1) * 2 != TYPE_PRECISION (type))
+ return false;
+
+ *new_rhs_out = rhs1;
+ *type_out = type1;
+ return true;
+ }
+
+ if (TREE_CODE (rhs) == INTEGER_CST)
+ {
+ *new_rhs_out = rhs;
+ *type_out = NULL;
+ return true;
+ }
+
+ return false;
+}
+
+/* Return true if STMT performs a widening multiplication. If so,
+ store the unwidened types of the operands in *TYPE1_OUT and *TYPE2_OUT
+ respectively. Also fill *RHS1_OUT and *RHS2_OUT such that converting
+ those operands to types *TYPE1_OUT and *TYPE2_OUT would give the
+ operands of the multiplication. */
+
+static bool
+is_widening_mult_p (gimple stmt,
+ tree *type1_out, tree *rhs1_out,
+ tree *type2_out, tree *rhs2_out)
{
- gimple rhs1_stmt = NULL, rhs2_stmt = NULL;
- tree type1 = NULL, type2 = NULL;
- tree rhs1, rhs2, rhs1_convop = NULL, rhs2_convop = NULL;
- enum tree_code rhs1_code, rhs2_code;
tree type;
type = TREE_TYPE (gimple_assign_lhs (stmt));
+ if (TREE_CODE (type) != INTEGER_TYPE
+ && TREE_CODE (type) != FIXED_POINT_TYPE)
+ return false;
- if (TREE_CODE (type) != INTEGER_TYPE)
+ if (!is_widening_mult_rhs_p (gimple_assign_rhs1 (stmt), type1_out, rhs1_out))
return false;
- rhs1 = gimple_assign_rhs1 (stmt);
- rhs2 = gimple_assign_rhs2 (stmt);
+ if (!is_widening_mult_rhs_p (gimple_assign_rhs2 (stmt), type2_out, rhs2_out))
+ return false;
- if (TREE_CODE (rhs1) == SSA_NAME)
+ if (*type1_out == NULL)
{
- rhs1_stmt = SSA_NAME_DEF_STMT (rhs1);
- if (!is_gimple_assign (rhs1_stmt))
- return false;
- rhs1_code = gimple_assign_rhs_code (rhs1_stmt);
- if (!CONVERT_EXPR_CODE_P (rhs1_code))
- return false;
- rhs1_convop = gimple_assign_rhs1 (rhs1_stmt);
- type1 = TREE_TYPE (rhs1_convop);
- if (TYPE_PRECISION (type1) * 2 != TYPE_PRECISION (type))
+ if (*type2_out == NULL || !int_fits_type_p (*rhs1_out, *type2_out))
return false;
+ *type1_out = *type2_out;
}
- else if (TREE_CODE (rhs1) != INTEGER_CST)
- return false;
- if (TREE_CODE (rhs2) == SSA_NAME)
+ if (*type2_out == NULL)
{
- rhs2_stmt = SSA_NAME_DEF_STMT (rhs2);
- if (!is_gimple_assign (rhs2_stmt))
- return false;
- rhs2_code = gimple_assign_rhs_code (rhs2_stmt);
- if (!CONVERT_EXPR_CODE_P (rhs2_code))
- return false;
- rhs2_convop = gimple_assign_rhs1 (rhs2_stmt);
- type2 = TREE_TYPE (rhs2_convop);
- if (TYPE_PRECISION (type2) * 2 != TYPE_PRECISION (type))
+ if (!int_fits_type_p (*rhs2_out, *type1_out))
return false;
+ *type2_out = *type1_out;
}
- else if (TREE_CODE (rhs2) != INTEGER_CST)
- return false;
- if (rhs1_stmt == NULL && rhs2_stmt == NULL)
- return false;
+ return true;
+}
- /* Verify that the machine can perform a widening multiply in this
- mode/signedness combination, otherwise this transformation is
- likely to pessimize code. */
- if ((rhs1_stmt == NULL || TYPE_UNSIGNED (type1))
- && (rhs2_stmt == NULL || TYPE_UNSIGNED (type2))
- && (optab_handler (umul_widen_optab, TYPE_MODE (type))
- ->insn_code == CODE_FOR_nothing))
- return false;
- else if ((rhs1_stmt == NULL || !TYPE_UNSIGNED (type1))
- && (rhs2_stmt == NULL || !TYPE_UNSIGNED (type2))
- && (optab_handler (smul_widen_optab, TYPE_MODE (type))
- ->insn_code == CODE_FOR_nothing))
- return false;
- else if (rhs1_stmt != NULL && rhs2_stmt != NULL
- && (TYPE_UNSIGNED (type1) != TYPE_UNSIGNED (type2))
- && (optab_handler (usmul_widen_optab, TYPE_MODE (type))
- ->insn_code == CODE_FOR_nothing))
+/* Process a single gimple statement STMT, which has a MULT_EXPR as
+ its rhs, and try to convert it into a WIDEN_MULT_EXPR. The return
+ value is true iff we converted the statement. */
+
+static bool
+convert_mult_to_widen (gimple stmt)
+{
+ tree lhs, rhs1, rhs2, type, type1, type2;
+ enum insn_code handler;
+
+ lhs = gimple_assign_lhs (stmt);
+ type = TREE_TYPE (lhs);
+ if (TREE_CODE (type) != INTEGER_TYPE)
return false;
- if ((rhs1_stmt == NULL && !int_fits_type_p (rhs1, type2))
- || (rhs2_stmt == NULL && !int_fits_type_p (rhs2, type1)))
+ if (!is_widening_mult_p (stmt, &type1, &rhs1, &type2, &rhs2))
return false;
- if (rhs1_stmt == NULL)
- gimple_assign_set_rhs1 (stmt, fold_convert (type2, rhs1));
+ if (TYPE_UNSIGNED (type1) && TYPE_UNSIGNED (type2))
+ handler = optab_handler (umul_widen_optab, TYPE_MODE (type));
+ else if (!TYPE_UNSIGNED (type1) && !TYPE_UNSIGNED (type2))
+ handler = optab_handler (smul_widen_optab, TYPE_MODE (type));
else
- gimple_assign_set_rhs1 (stmt, rhs1_convop);
- if (rhs2_stmt == NULL)
- gimple_assign_set_rhs2 (stmt, fold_convert (type1, rhs2));
- else
- gimple_assign_set_rhs2 (stmt, rhs2_convop);
+ handler = optab_handler (usmul_widen_optab, TYPE_MODE (type));
+
+ if (handler == CODE_FOR_nothing)
+ return false;
+
+ gimple_assign_set_rhs1 (stmt, fold_convert (type1, rhs1));
+ gimple_assign_set_rhs2 (stmt, fold_convert (type2, rhs2));
gimple_assign_set_rhs_code (stmt, WIDEN_MULT_EXPR);
update_stmt (stmt);
return true;
@@ -1365,7 +1397,7 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
enum tree_code code)
{
gimple rhs1_stmt = NULL, rhs2_stmt = NULL;
- tree type;
+ tree type, type1, type2;
tree lhs, rhs1, rhs2, mult_rhs1, mult_rhs2, add_rhs;
enum tree_code rhs1_code = ERROR_MARK, rhs2_code = ERROR_MARK;
optab this_optab;
@@ -1373,7 +1405,8 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
lhs = gimple_assign_lhs (stmt);
type = TREE_TYPE (lhs);
- if (TREE_CODE (type) != INTEGER_TYPE)
+ if (TREE_CODE (type) != INTEGER_TYPE
+ && TREE_CODE (type) != FIXED_POINT_TYPE)
return false;
if (code == MINUS_EXPR)
@@ -1385,8 +1418,7 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
accumulate in this mode/signedness combination, otherwise
this transformation is likely to pessimize code. */
this_optab = optab_for_tree_code (wmult_code, type, optab_default);
- if (optab_handler (this_optab, TYPE_MODE (type))->insn_code
- == CODE_FOR_nothing)
+ if (optab_handler (this_optab, TYPE_MODE (type)) == CODE_FOR_nothing)
return false;
rhs1 = gimple_assign_rhs1 (stmt);
@@ -1410,20 +1442,25 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
else
return false;
- if (rhs1_code == MULT_EXPR)
+ if (code == PLUS_EXPR && rhs1_code == MULT_EXPR)
{
- if (!convert_mult_to_widen (rhs1_stmt))
+ if (!is_widening_mult_p (rhs1_stmt, &type1, &mult_rhs1,
+ &type2, &mult_rhs2))
return false;
- rhs1_code = gimple_assign_rhs_code (rhs1_stmt);
+ mult_rhs1 = fold_convert (type1, mult_rhs1);
+ mult_rhs2 = fold_convert (type2, mult_rhs2);
+ add_rhs = rhs2;
}
- if (rhs2_code == MULT_EXPR)
+ else if (rhs2_code == MULT_EXPR)
{
- if (!convert_mult_to_widen (rhs2_stmt))
+ if (!is_widening_mult_p (rhs1_stmt, &type1, &mult_rhs1,
+ &type2, &mult_rhs2))
return false;
- rhs2_code = gimple_assign_rhs_code (rhs2_stmt);
+ mult_rhs1 = fold_convert (type1, mult_rhs1);
+ mult_rhs2 = fold_convert (type2, mult_rhs2);
+ add_rhs = rhs1;
}
-
- if (code == PLUS_EXPR && rhs1_code == WIDEN_MULT_EXPR)
+ else if (code == PLUS_EXPR && rhs1_code == WIDEN_MULT_EXPR)
{
mult_rhs1 = gimple_assign_rhs1 (rhs1_stmt);
mult_rhs2 = gimple_assign_rhs2 (rhs1_stmt);
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index b784a68b18e..5b17ce22427 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -127,6 +127,12 @@ static struct
clobbering sites like function calls or ASM_EXPRs. */
#define opf_implicit (1 << 2)
+/* Operand is in a place where address-taken does not imply addressable. */
+#define opf_non_addressable (1 << 3)
+
+/* Operand is in a place where opf_non_addressable does not apply. */
+#define opf_not_non_addressable (1 << 4)
+
/* Array for building all the def operands. */
static VEC(tree,heap) *build_defs;
@@ -693,15 +699,22 @@ mark_address_taken (tree ref)
be referenced using pointer arithmetic. See PR 21407 and the
ensuing mailing list discussion. */
var = get_base_address (ref);
- if (var && DECL_P (var))
- TREE_ADDRESSABLE (var) = 1;
+ if (var)
+ {
+ if (DECL_P (var))
+ TREE_ADDRESSABLE (var) = 1;
+ else if (TREE_CODE (var) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (var, 0)) == ADDR_EXPR
+ && DECL_P (TREE_OPERAND (TREE_OPERAND (var, 0), 0)))
+ TREE_ADDRESSABLE (TREE_OPERAND (TREE_OPERAND (var, 0), 0)) = 1;
+ }
}
-/* A subroutine of get_expr_operands to handle INDIRECT_REF,
- ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF.
+/* A subroutine of get_expr_operands to handle MEM_REF,
+ MISALIGNED_INDIRECT_REF.
- STMT is the statement being processed, EXPR is the INDIRECT_REF
+ STMT is the statement being processed, EXPR is the MEM_REF
that got us here.
FLAGS is as in get_expr_operands.
@@ -725,7 +738,8 @@ get_indirect_ref_operands (gimple stmt, tree expr, int flags,
/* If requested, add a USE operand for the base pointer. */
if (recurse_on_base)
get_expr_operands (stmt, pptr,
- opf_use | (flags & opf_no_vops));
+ opf_non_addressable | opf_use
+ | (flags & (opf_no_vops|opf_not_non_addressable)));
}
@@ -802,7 +816,7 @@ get_asm_expr_operands (gimple stmt)
if (!allows_reg && allows_mem)
mark_address_taken (TREE_VALUE (link));
- get_expr_operands (stmt, &TREE_VALUE (link), opf_def);
+ get_expr_operands (stmt, &TREE_VALUE (link), opf_def | opf_not_non_addressable);
}
/* Gather all input operands. */
@@ -818,7 +832,7 @@ get_asm_expr_operands (gimple stmt)
if (!allows_reg && allows_mem)
mark_address_taken (TREE_VALUE (link));
- get_expr_operands (stmt, &TREE_VALUE (link), 0);
+ get_expr_operands (stmt, &TREE_VALUE (link), opf_not_non_addressable);
}
/* Clobber all memory and addressable symbols for asm ("" : : : "memory"); */
@@ -862,7 +876,9 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
reference to it, but the fact that the statement takes its
address will be of interest to some passes (e.g. alias
resolution). */
- if (!is_gimple_debug (stmt))
+ if ((!(flags & opf_non_addressable)
+ || (flags & opf_not_non_addressable))
+ && !is_gimple_debug (stmt))
mark_address_taken (TREE_OPERAND (expr, 0));
/* If the address is invariant, there may be no interesting
@@ -876,7 +892,8 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
here are ARRAY_REF indices which will always be real operands
(GIMPLE does not allow non-registers as array indices). */
flags |= opf_no_vops;
- get_expr_operands (stmt, &TREE_OPERAND (expr, 0), flags);
+ get_expr_operands (stmt, &TREE_OPERAND (expr, 0),
+ flags | opf_not_non_addressable);
return;
case SSA_NAME:
@@ -897,8 +914,7 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), flags);
/* fall through */
- case ALIGN_INDIRECT_REF:
- case INDIRECT_REF:
+ case MEM_REF:
get_indirect_ref_operands (stmt, expr, flags, true);
return;
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 53ab31a15df..482f267a648 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -994,10 +994,10 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
/* Auxiliary functions to determine the set of memory accesses which
can't trap because they are preceded by accesses to the same memory
- portion. We do that for INDIRECT_REFs, so we only need to track
+ portion. We do that for MEM_REFs, so we only need to track
the SSA_NAME of the pointer indirectly referenced. The algorithm
simply is a walk over all instructions in dominator order. When
- we see an INDIRECT_REF we determine if we've already seen a same
+ we see an MEM_REF we determine if we've already seen a same
ref anywhere up to the root of the dominator tree. If we do the
current access can't trap. If we don't see any dominating access
the current access might trap, but might also make later accesses
@@ -1011,7 +1011,7 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
trap even if a store doesn't (write-only memory). This probably is
overly conservative. */
-/* A hash-table of SSA_NAMEs, and in which basic block an INDIRECT_REF
+/* A hash-table of SSA_NAMEs, and in which basic block an MEM_REF
through it was seen, which would constitute a no-trap region for
same accesses. */
struct name_to_bb
@@ -1024,7 +1024,7 @@ struct name_to_bb
/* The hash table for remembering what we've seen. */
static htab_t seen_ssa_names;
-/* The set of INDIRECT_REFs which can't trap. */
+/* The set of MEM_REFs which can't trap. */
static struct pointer_set_t *nontrap_set;
/* The hash function, based on the pointer to the pointer SSA_NAME. */
@@ -1047,7 +1047,7 @@ name_to_bb_eq (const void *p1, const void *p2)
}
/* We see the expression EXP in basic block BB. If it's an interesting
- expression (an INDIRECT_REF through an SSA_NAME) possibly insert the
+ expression (an MEM_REF through an SSA_NAME) possibly insert the
expression into the set NONTRAP or the hash table of seen expressions.
STORE is true if this expression is on the LHS, otherwise it's on
the RHS. */
@@ -1055,7 +1055,7 @@ static void
add_or_mark_expr (basic_block bb, tree exp,
struct pointer_set_t *nontrap, bool store)
{
- if (INDIRECT_REF_P (exp)
+ if (TREE_CODE (exp) == MEM_REF
&& TREE_CODE (TREE_OPERAND (exp, 0)) == SSA_NAME)
{
tree name = TREE_OPERAND (exp, 0);
@@ -1064,7 +1064,7 @@ add_or_mark_expr (basic_block bb, tree exp,
struct name_to_bb *n2bb;
basic_block found_bb = 0;
- /* Try to find the last seen INDIRECT_REF through the same
+ /* Try to find the last seen MEM_REF through the same
SSA_NAME, which can trap. */
map.ssa_name = name;
map.bb = 0;
@@ -1074,7 +1074,7 @@ add_or_mark_expr (basic_block bb, tree exp,
if (n2bb)
found_bb = n2bb->bb;
- /* If we've found a trapping INDIRECT_REF, _and_ it dominates EXP
+ /* If we've found a trapping MEM_REF, _and_ it dominates EXP
(it's in a basic block on the path from us to the dominator root)
then we can't trap. */
if (found_bb && found_bb->aux == (void *)1)
@@ -1135,7 +1135,7 @@ nt_fini_block (struct dom_walk_data *data ATTRIBUTE_UNUSED, basic_block bb)
/* This is the entry point of gathering non trapping memory accesses.
It will do a dominator walk over the whole function, and it will
make use of the bb->aux pointers. It returns a set of trees
- (the INDIRECT_REFs itself) which can't trap. */
+ (the MEM_REFs itself) which can't trap. */
static struct pointer_set_t *
get_non_trapping (void)
{
@@ -1200,7 +1200,8 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
locus = gimple_location (assign);
lhs = gimple_assign_lhs (assign);
rhs = gimple_assign_rhs1 (assign);
- if (!INDIRECT_REF_P (lhs))
+ if (TREE_CODE (lhs) != MEM_REF
+ || TREE_CODE (TREE_OPERAND (lhs, 0)) != SSA_NAME)
return false;
/* RHS is either a single SSA_NAME or a constant. */
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index dc1cb28f7c3..84f22b956ed 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -139,7 +139,7 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
edge e;
gcc_assert (is_gimple_assign (use_stmt)
- && gimple_assign_rhs_code (use_stmt) == INDIRECT_REF);
+ && gimple_assign_rhs_code (use_stmt) == MEM_REF);
/* Build a new PHI node to replace the definition of
the indirect reference lhs. */
@@ -187,10 +187,17 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
}
else
{
+ tree rhs = gimple_assign_rhs1 (use_stmt);
gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
- old_arg = TREE_OPERAND (old_arg, 0);
- new_var = create_tmp_reg (TREE_TYPE (old_arg), NULL);
- tmp = gimple_build_assign (new_var, unshare_expr (old_arg));
+ new_var = create_tmp_reg (TREE_TYPE (rhs), NULL);
+ if (!is_gimple_min_invariant (old_arg))
+ old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
+ else
+ old_arg = unshare_expr (old_arg);
+ tmp = gimple_build_assign (new_var,
+ fold_build2 (MEM_REF, TREE_TYPE (rhs),
+ old_arg,
+ TREE_OPERAND (rhs, 1)));
gcc_assert (is_gimple_reg (new_var));
add_referenced_var (new_var);
new_var = make_ssa_name (new_var, tmp);
@@ -246,6 +253,8 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
use_operand_p arg_p, use;
ssa_op_iter i;
bool phi_inserted;
+ tree type = NULL_TREE;
+ bool one_invariant = false;
if (!POINTER_TYPE_P (TREE_TYPE (ptr))
|| !is_gimple_reg_type (TREE_TYPE (TREE_TYPE (ptr))))
@@ -268,16 +277,29 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
return false;
arg = gimple_assign_rhs1 (def_stmt);
}
- if ((TREE_CODE (arg) != ADDR_EXPR
- /* Avoid to have to decay *&a to a[0] later. */
- || !is_gimple_reg_type (TREE_TYPE (TREE_OPERAND (arg, 0))))
+ if (TREE_CODE (arg) != ADDR_EXPR
&& !(TREE_CODE (arg) == SSA_NAME
&& SSA_NAME_VERSION (arg) < n
&& phivn[SSA_NAME_VERSION (arg)].value != NULL_TREE
+ && (!type
+ || types_compatible_p
+ (type, TREE_TYPE (phivn[SSA_NAME_VERSION (arg)].value)))
&& phivn_valid_p (phivn, arg, bb)))
return false;
+ if (!type
+ && TREE_CODE (arg) == SSA_NAME)
+ type = TREE_TYPE (phivn[SSA_NAME_VERSION (arg)].value);
+ if (TREE_CODE (arg) == ADDR_EXPR
+ && is_gimple_min_invariant (arg))
+ one_invariant = true;
}
+ /* If we neither have an address of a decl nor can reuse a previously
+ inserted load, do not hoist anything. */
+ if (!one_invariant
+ && !type)
+ return false;
+
/* Find a dereferencing use. First follow (single use) ssa
copy chains for ptr. */
while (single_imm_use (ptr, &use, &use_stmt)
@@ -295,8 +317,12 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
/* Check whether this is a load of *ptr. */
if (!(is_gimple_assign (use_stmt)
&& TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME
- && gimple_assign_rhs_code (use_stmt) == INDIRECT_REF
+ && gimple_assign_rhs_code (use_stmt) == MEM_REF
&& TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 0) == ptr
+ && integer_zerop (TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 1))
+ && (!type
+ || types_compatible_p
+ (TREE_TYPE (gimple_assign_lhs (use_stmt)), type))
/* We cannot replace a load that may throw or is volatile. */
&& !stmt_can_throw_internal (use_stmt)))
continue;
@@ -316,6 +342,7 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
if (!phi_inserted)
{
res = phiprop_insert_phi (bb, phi, use_stmt, phivn, n);
+ type = TREE_TYPE (res);
/* Remember the value we created for *ptr. */
phivn[SSA_NAME_VERSION (ptr)].value = res;
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index a62439f2af2..8293e978d67 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1629,12 +1629,28 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
newop.op0 = op0;
newop.op1 = op1;
newop.op2 = op2;
+ /* If it transforms a non-constant ARRAY_REF into a constant
+ one, adjust the constant offset. */
+ if (newop.opcode == ARRAY_REF
+ && newop.off == -1
+ && TREE_CODE (op0) == INTEGER_CST
+ && TREE_CODE (op1) == INTEGER_CST
+ && TREE_CODE (op2) == INTEGER_CST)
+ {
+ double_int off = tree_to_double_int (op0);
+ off = double_int_add (off,
+ double_int_neg
+ (tree_to_double_int (op1)));
+ off = double_int_mul (off, tree_to_double_int (op2));
+ if (double_int_fits_in_shwi_p (off))
+ newop.off = off.low;
+ }
VEC_replace (vn_reference_op_s, newoperands, j, &newop);
/* If it transforms from an SSA_NAME to an address, fold with
a preceding indirect reference. */
if (j > 0 && op0 && TREE_CODE (op0) == ADDR_EXPR
&& VEC_index (vn_reference_op_s,
- newoperands, j - 1)->opcode == INDIRECT_REF)
+ newoperands, j - 1)->opcode == MEM_REF)
vn_reference_fold_indirect (&newoperands, &j);
}
if (i != VEC_length (vn_reference_op_s, operands))
@@ -1661,6 +1677,7 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
{
unsigned int new_val_id;
pre_expr constant;
+ bool converted = false;
tree result = vn_reference_lookup_pieces (newvuse, ref->set,
ref->type,
@@ -1669,6 +1686,13 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
if (result)
VEC_free (vn_reference_op_s, heap, newoperands);
+ if (result
+ && !useless_type_conversion_p (ref->type, TREE_TYPE (result)))
+ {
+ result = fold_build1 (VIEW_CONVERT_EXPR, ref->type, result);
+ converted = true;
+ }
+
if (result && is_gimple_min_invariant (result))
{
gcc_assert (!newoperands);
@@ -1679,7 +1703,54 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
expr->kind = REFERENCE;
expr->id = 0;
- if (newref)
+ if (converted)
+ {
+ vn_nary_op_t nary;
+ tree nresult;
+
+ gcc_assert (CONVERT_EXPR_P (result)
+ || TREE_CODE (result) == VIEW_CONVERT_EXPR);
+
+ nresult = vn_nary_op_lookup_pieces (1, TREE_CODE (result),
+ TREE_TYPE (result),
+ TREE_OPERAND (result, 0),
+ NULL_TREE, NULL_TREE,
+ NULL_TREE,
+ &nary);
+ if (nresult && is_gimple_min_invariant (nresult))
+ return get_or_alloc_expr_for_constant (nresult);
+
+ expr->kind = NARY;
+ if (nary)
+ {
+ PRE_EXPR_NARY (expr) = nary;
+ constant = fully_constant_expression (expr);
+ if (constant != expr)
+ return constant;
+
+ new_val_id = nary->value_id;
+ get_or_alloc_expression_id (expr);
+ }
+ else
+ {
+ new_val_id = get_next_value_id ();
+ VEC_safe_grow_cleared (bitmap_set_t, heap,
+ value_expressions,
+ get_max_value_id() + 1);
+ nary = vn_nary_op_insert_pieces (1, TREE_CODE (result),
+ TREE_TYPE (result),
+ TREE_OPERAND (result, 0),
+ NULL_TREE, NULL_TREE,
+ NULL_TREE, NULL_TREE,
+ new_val_id);
+ PRE_EXPR_NARY (expr) = nary;
+ constant = fully_constant_expression (expr);
+ if (constant != expr)
+ return constant;
+ get_or_alloc_expression_id (expr);
+ }
+ }
+ else if (newref)
{
PRE_EXPR_REFERENCE (expr) = newref;
constant = fully_constant_expression (expr);
@@ -1884,7 +1955,10 @@ bitmap_find_leader (bitmap_set_t set, unsigned int val, gimple stmt)
gimple def_stmt = SSA_NAME_DEF_STMT (PRE_EXPR_NAME (val));
if (gimple_code (def_stmt) != GIMPLE_PHI
&& gimple_bb (def_stmt) == gimple_bb (stmt)
- && gimple_uid (def_stmt) >= gimple_uid (stmt))
+ /* PRE insertions are at the end of the basic-block
+ and have UID 0. */
+ && (gimple_uid (def_stmt) == 0
+ || gimple_uid (def_stmt) >= gimple_uid (stmt)))
continue;
}
return val;
@@ -2598,7 +2672,7 @@ can_PRE_operation (tree op)
return UNARY_CLASS_P (op)
|| BINARY_CLASS_P (op)
|| COMPARISON_CLASS_P (op)
- || TREE_CODE (op) == INDIRECT_REF
+ || TREE_CODE (op) == MEM_REF
|| TREE_CODE (op) == COMPONENT_REF
|| TREE_CODE (op) == VIEW_CONVERT_EXPR
|| TREE_CODE (op) == CALL_EXPR
@@ -2674,6 +2748,29 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
return folded;
}
break;
+ case MEM_REF:
+ {
+ tree baseop = create_component_ref_by_pieces_1 (block, ref, operand,
+ stmts, domstmt);
+ tree offset = currop->op0;
+ if (!baseop)
+ return NULL_TREE;
+ if (TREE_CODE (baseop) == ADDR_EXPR
+ && handled_component_p (TREE_OPERAND (baseop, 0)))
+ {
+ HOST_WIDE_INT off;
+ tree base;
+ base = get_addr_base_and_unit_offset (TREE_OPERAND (baseop, 0),
+ &off);
+ gcc_assert (base);
+ offset = int_const_binop (PLUS_EXPR, offset,
+ build_int_cst (TREE_TYPE (offset),
+ off), 0);
+ baseop = build_fold_addr_expr (base);
+ }
+ return fold_build2 (MEM_REF, currop->type, baseop, offset);
+ }
+ break;
case TARGET_MEM_REF:
{
vn_reference_op_t nextop = VEC_index (vn_reference_op_s, ref->operands,
@@ -2726,9 +2823,7 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
return folded;
}
break;
- case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
- case INDIRECT_REF:
{
tree folded;
tree genop1 = create_component_ref_by_pieces_1 (block, ref,
@@ -2880,7 +2975,7 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
}
/* For COMPONENT_REF's and ARRAY_REF's, we can't have any intermediates for the
- COMPONENT_REF or INDIRECT_REF or ARRAY_REF portion, because we'd end up with
+ COMPONENT_REF or MEM_REF or ARRAY_REF portion, because we'd end up with
trying to rename aggregates into ssa form directly, which is a no no.
Thus, this routine doesn't create temporaries, it just builds a
@@ -2928,9 +3023,10 @@ find_or_generate_expression (basic_block block, pre_expr expr,
}
/* If it's still NULL, it must be a complex expression, so generate
- it recursively. Not so for FRE though. */
+ it recursively. Not so if inserting expressions for values generated
+ by SCCVN. */
if (genop == NULL
- && !in_fre)
+ && !domstmt)
{
bitmap_set_t exprset;
unsigned int lookfor = get_expr_value_id (expr);
@@ -3131,7 +3227,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
VN_INFO (name)->value_id = value_id;
nameexpr = get_or_alloc_expr_for_name (name);
add_to_value (value_id, nameexpr);
- if (!in_fre)
+ if (NEW_SETS (block))
bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
bitmap_value_replace_in_set (AVAIL_OUT (block), nameexpr);
@@ -3310,6 +3406,8 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
}
}
+ else
+ avail[bprime->index] = get_or_alloc_expr_for_constant (builtexpr);
}
}
else if (eprime->kind == NAME)
@@ -4723,7 +4821,7 @@ execute_pre (bool do_fre)
if (!do_fre)
loop_optimizer_init (LOOPS_NORMAL);
- if (!run_scc_vn (do_fre))
+ if (!run_scc_vn ())
{
if (!do_fre)
loop_optimizer_finalize ();
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 5f2ecce08b6..6f50fc5453a 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -639,7 +639,7 @@ valid_gimple_rhs_p (tree expr)
as a single GIMPLE_CALL statement. If the arguments require
further gimplification, return false. */
-bool
+static bool
valid_gimple_call_p (tree expr)
{
unsigned i, nargs;
@@ -649,8 +649,17 @@ valid_gimple_call_p (tree expr)
nargs = call_expr_nargs (expr);
for (i = 0; i < nargs; i++)
- if (! is_gimple_operand (CALL_EXPR_ARG (expr, i)))
- return false;
+ {
+ tree arg = CALL_EXPR_ARG (expr, i);
+ if (is_gimple_reg_type (arg))
+ {
+ if (!is_gimple_val (arg))
+ return false;
+ }
+ else
+ if (!is_gimple_lvalue (arg))
+ return false;
+ }
return true;
}
diff --git a/gcc/tree-ssa-propagate.h b/gcc/tree-ssa-propagate.h
index 029d28a2650..c5bb9731c5e 100644
--- a/gcc/tree-ssa-propagate.h
+++ b/gcc/tree-ssa-propagate.h
@@ -116,7 +116,6 @@ typedef bool (*ssa_prop_fold_stmt_fn) (gimple_stmt_iterator *gsi);
/* In tree-ssa-propagate.c */
void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
bool valid_gimple_rhs_p (tree);
-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);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index caad908129b..6cd3cebfe86 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -2192,7 +2192,7 @@ init_reassoc (void)
/* Give each argument a distinct rank. */
for (param = DECL_ARGUMENTS (current_function_decl);
param;
- param = TREE_CHAIN (param))
+ param = DECL_CHAIN (param))
{
if (gimple_default_def (cfun, param) != NULL)
{
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index b27fe0c0bc5..c99c8a8f371 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -156,8 +156,6 @@ static unsigned int next_value_id;
static unsigned int next_dfs_num;
static VEC (tree, heap) *sccstack;
-static bool may_insert;
-
DEF_VEC_P(vn_ssa_aux_t);
DEF_VEC_ALLOC_P(vn_ssa_aux_t, heap);
@@ -431,9 +429,41 @@ vn_reference_compute_hash (const vn_reference_t vr1)
hashval_t result = 0;
int i;
vn_reference_op_t vro;
+ HOST_WIDE_INT off = -1;
+ bool deref = false;
for (i = 0; VEC_iterate (vn_reference_op_s, vr1->operands, i, vro); i++)
- result = vn_reference_op_compute_hash (vro, result);
+ {
+ if (vro->opcode == MEM_REF)
+ deref = true;
+ else if (vro->opcode != ADDR_EXPR)
+ deref = false;
+ if (vro->off != -1)
+ {
+ if (off == -1)
+ off = 0;
+ off += vro->off;
+ }
+ else
+ {
+ if (off != -1
+ && off != 0)
+ result = iterative_hash_hashval_t (off, result);
+ off = -1;
+ if (deref
+ && vro->opcode == ADDR_EXPR)
+ {
+ if (vro->op0)
+ {
+ tree op = TREE_OPERAND (vro->op0, 0);
+ result = iterative_hash_hashval_t (TREE_CODE (op), result);
+ result = iterative_hash_expr (op, result);
+ }
+ }
+ else
+ result = vn_reference_op_compute_hash (vro, result);
+ }
+ }
if (vr1->vuse)
result += SSA_NAME_VERSION (vr1->vuse);
@@ -446,8 +476,7 @@ vn_reference_compute_hash (const vn_reference_t vr1)
int
vn_reference_eq (const void *p1, const void *p2)
{
- int i;
- vn_reference_op_t vro;
+ unsigned i, j;
const_vn_reference_t const vr1 = (const_vn_reference_t) p1;
const_vn_reference_t const vr2 = (const_vn_reference_t) p2;
@@ -466,17 +495,73 @@ vn_reference_eq (const void *p1, const void *p2)
if (vr1->operands == vr2->operands)
return true;
- /* We require that address operands be canonicalized in a way that
- two memory references will have the same operands if they are
- equivalent. */
- if (VEC_length (vn_reference_op_s, vr1->operands)
- != VEC_length (vn_reference_op_s, vr2->operands))
+ if (!expressions_equal_p (TYPE_SIZE (vr1->type), TYPE_SIZE (vr2->type)))
return false;
- for (i = 0; VEC_iterate (vn_reference_op_s, vr1->operands, i, vro); i++)
- if (!vn_reference_op_eq (VEC_index (vn_reference_op_s, vr2->operands, i),
- vro))
- return false;
+ if (INTEGRAL_TYPE_P (vr1->type)
+ && INTEGRAL_TYPE_P (vr2->type))
+ {
+ if (TYPE_PRECISION (vr1->type) != TYPE_PRECISION (vr2->type))
+ return false;
+ }
+ else if (INTEGRAL_TYPE_P (vr1->type)
+ && (TYPE_PRECISION (vr1->type)
+ != TREE_INT_CST_LOW (TYPE_SIZE (vr1->type))))
+ return false;
+ else if (INTEGRAL_TYPE_P (vr2->type)
+ && (TYPE_PRECISION (vr2->type)
+ != TREE_INT_CST_LOW (TYPE_SIZE (vr2->type))))
+ return false;
+
+ i = 0;
+ j = 0;
+ do
+ {
+ HOST_WIDE_INT off1 = 0, off2 = 0;
+ vn_reference_op_t vro1, vro2;
+ vn_reference_op_s tem1, tem2;
+ bool deref1 = false, deref2 = false;
+ for (; VEC_iterate (vn_reference_op_s, vr1->operands, i, vro1); i++)
+ {
+ if (vro1->opcode == MEM_REF)
+ deref1 = true;
+ if (vro1->off == -1)
+ break;
+ off1 += vro1->off;
+ }
+ for (; VEC_iterate (vn_reference_op_s, vr2->operands, j, vro2); j++)
+ {
+ if (vro2->opcode == MEM_REF)
+ deref2 = true;
+ if (vro2->off == -1)
+ break;
+ off2 += vro2->off;
+ }
+ if (off1 != off2)
+ return false;
+ if (deref1 && vro1->opcode == ADDR_EXPR)
+ {
+ memset (&tem1, 0, sizeof (tem1));
+ tem1.op0 = TREE_OPERAND (vro1->op0, 0);
+ tem1.type = TREE_TYPE (tem1.op0);
+ tem1.opcode = TREE_CODE (tem1.op0);
+ vro1 = &tem1;
+ }
+ if (deref2 && vro2->opcode == ADDR_EXPR)
+ {
+ memset (&tem2, 0, sizeof (tem2));
+ tem2.op0 = TREE_OPERAND (vro2->op0, 0);
+ tem2.type = TREE_TYPE (tem2.op0);
+ tem2.opcode = TREE_CODE (tem2.op0);
+ vro2 = &tem2;
+ }
+ if (!vn_reference_op_eq (vro1, vro2))
+ return false;
+ ++j;
+ ++i;
+ }
+ while (VEC_length (vn_reference_op_s, vr1->operands) != i
+ || VEC_length (vn_reference_op_s, vr2->operands) != j);
return true;
}
@@ -494,7 +579,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
base = TMR_SYMBOL (ref) ? TMR_SYMBOL (ref) : TMR_BASE (ref);
if (!base)
- base = build_int_cst (ptr_type_node, 0);
+ base = null_pointer_node;
memset (&temp, 0, sizeof (temp));
/* We do not care for spurious type qualifications. */
@@ -503,6 +588,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
temp.op0 = TMR_INDEX (ref);
temp.op1 = TMR_STEP (ref);
temp.op2 = TMR_OFFSET (ref);
+ temp.off = -1;
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
memset (&temp, 0, sizeof (temp));
@@ -510,6 +596,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
temp.opcode = TREE_CODE (base);
temp.op0 = base;
temp.op1 = TMR_ORIGINAL (ref);
+ temp.off = -1;
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
return;
}
@@ -524,17 +611,19 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
/* We do not care for spurious type qualifications. */
temp.type = TYPE_MAIN_VARIANT (TREE_TYPE (ref));
temp.opcode = TREE_CODE (ref);
+ temp.off = -1;
switch (temp.opcode)
{
- case ALIGN_INDIRECT_REF:
- case INDIRECT_REF:
- /* The only operand is the address, which gets its own
- vn_reference_op_s structure. */
- break;
case MISALIGNED_INDIRECT_REF:
temp.op0 = TREE_OPERAND (ref, 1);
break;
+ case MEM_REF:
+ /* The base address gets its own vn_reference_op_s structure. */
+ temp.op0 = TREE_OPERAND (ref, 1);
+ if (host_integerp (TREE_OPERAND (ref, 1), 0))
+ temp.off = TREE_INT_CST_LOW (TREE_OPERAND (ref, 1));
+ break;
case BIT_FIELD_REF:
/* Record bits and position. */
temp.op0 = TREE_OPERAND (ref, 1);
@@ -547,17 +636,25 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
temp.type = NULL_TREE;
temp.op0 = TREE_OPERAND (ref, 1);
temp.op1 = TREE_OPERAND (ref, 2);
- /* If this is a reference to a union member, record the union
- member size as operand. Do so only if we are doing
- expression insertion (during FRE), as PRE currently gets
- confused with this. */
- if (may_insert
- && temp.op1 == NULL_TREE
- && TREE_CODE (DECL_CONTEXT (temp.op0)) == UNION_TYPE
- && integer_zerop (DECL_FIELD_OFFSET (temp.op0))
- && integer_zerop (DECL_FIELD_BIT_OFFSET (temp.op0))
- && host_integerp (DECL_SIZE (temp.op0), 0))
- temp.op0 = DECL_SIZE (temp.op0);
+ {
+ tree this_offset = component_ref_field_offset (ref);
+ if (this_offset
+ && TREE_CODE (this_offset) == INTEGER_CST)
+ {
+ tree bit_offset = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (ref, 1));
+ if (TREE_INT_CST_LOW (bit_offset) % BITS_PER_UNIT == 0)
+ {
+ double_int off
+ = double_int_add (tree_to_double_int (this_offset),
+ double_int_sdiv
+ (tree_to_double_int (bit_offset),
+ uhwi_to_double_int (BITS_PER_UNIT),
+ TRUNC_DIV_EXPR));
+ if (double_int_fits_in_shwi_p (off))
+ temp.off = off.low;
+ }
+ }
+ }
break;
case ARRAY_RANGE_REF:
case ARRAY_REF:
@@ -566,6 +663,18 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
/* Always record lower bounds and element size. */
temp.op1 = array_ref_low_bound (ref);
temp.op2 = array_ref_element_size (ref);
+ if (TREE_CODE (temp.op0) == INTEGER_CST
+ && TREE_CODE (temp.op1) == INTEGER_CST
+ && TREE_CODE (temp.op2) == INTEGER_CST)
+ {
+ double_int off = tree_to_double_int (temp.op0);
+ off = double_int_add (off,
+ double_int_neg
+ (tree_to_double_int (temp.op1)));
+ off = double_int_mul (off, tree_to_double_int (temp.op2));
+ if (double_int_fits_in_shwi_p (off))
+ temp.off = off.low;
+ }
break;
case STRING_CST:
case INTEGER_CST:
@@ -592,9 +701,13 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
ref in the chain of references (IE they require an
operand), so we don't have to put anything
for op* as it will be handled by the iteration */
- case IMAGPART_EXPR:
case REALPART_EXPR:
case VIEW_CONVERT_EXPR:
+ temp.off = 0;
+ break;
+ case IMAGPART_EXPR:
+ /* This is only interesting for its constant offset. */
+ temp.off = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (ref)));
break;
default:
gcc_unreachable ();
@@ -627,16 +740,12 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
HOST_WIDE_INT max_size;
HOST_WIDE_INT size = -1;
tree size_tree = NULL_TREE;
+ alias_set_type base_alias_set = -1;
/* First get the final access size from just the outermost expression. */
op = VEC_index (vn_reference_op_s, ops, 0);
if (op->opcode == COMPONENT_REF)
- {
- if (TREE_CODE (op->op0) == INTEGER_CST)
- size_tree = op->op0;
- else
- size_tree = DECL_SIZE (op->op0);
- }
+ size_tree = DECL_SIZE (op->op0);
else if (op->opcode == BIT_FIELD_REF)
size_tree = op->op0;
else
@@ -667,19 +776,39 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
{
/* These may be in the reference ops, but we cannot do anything
sensible with them here. */
- case CALL_EXPR:
case ADDR_EXPR:
+ /* Apart from ADDR_EXPR arguments to MEM_REF. */
+ if (base != NULL_TREE
+ && TREE_CODE (base) == MEM_REF
+ && op->op0
+ && DECL_P (TREE_OPERAND (op->op0, 0)))
+ {
+ vn_reference_op_t pop = VEC_index (vn_reference_op_s, ops, i-1);
+ base = TREE_OPERAND (op->op0, 0);
+ if (pop->off == -1)
+ {
+ max_size = -1;
+ offset = 0;
+ }
+ else
+ offset += pop->off * BITS_PER_UNIT;
+ op0_p = NULL;
+ break;
+ }
+ /* Fallthru. */
+ case CALL_EXPR:
return false;
/* Record the base objects. */
- case ALIGN_INDIRECT_REF:
- case INDIRECT_REF:
- *op0_p = build1 (op->opcode, op->type, NULL_TREE);
+ case MISALIGNED_INDIRECT_REF:
+ *op0_p = build2 (MISALIGNED_INDIRECT_REF, op->type,
+ NULL_TREE, op->op0);
op0_p = &TREE_OPERAND (*op0_p, 0);
break;
- case MISALIGNED_INDIRECT_REF:
- *op0_p = build2 (MISALIGNED_INDIRECT_REF, op->type,
+ case MEM_REF:
+ base_alias_set = get_deref_alias_set (op->op0);
+ *op0_p = build2 (MEM_REF, op->type,
NULL_TREE, op->op0);
op0_p = &TREE_OPERAND (*op0_p, 0);
break;
@@ -689,6 +818,7 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
case RESULT_DECL:
case SSA_NAME:
*op0_p = op->op0;
+ op0_p = NULL;
break;
/* And now the usual component-reference style ops. */
@@ -703,11 +833,8 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
cannot use component_ref_field_offset. Do the interesting
parts manually. */
- /* Our union trick, done for offset zero only. */
- if (TREE_CODE (field) == INTEGER_CST)
- ;
- else if (op->op1
- || !host_integerp (DECL_FIELD_OFFSET (field), 1))
+ if (op->op1
+ || !host_integerp (DECL_FIELD_OFFSET (field), 1))
max_size = -1;
else
{
@@ -768,7 +895,10 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
ref->size = size;
ref->max_size = max_size;
ref->ref_alias_set = set;
- ref->base_alias_set = -1;
+ if (base_alias_set != -1)
+ ref->base_alias_set = base_alias_set;
+ else
+ ref->base_alias_set = get_alias_set (base);
return true;
}
@@ -789,6 +919,7 @@ copy_reference_ops_from_call (gimple call,
temp.opcode = CALL_EXPR;
temp.op0 = gimple_call_fn (call);
temp.op1 = gimple_call_chain (call);
+ temp.off = -1;
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
/* Copy the call arguments. As they can be references as well,
@@ -830,62 +961,106 @@ void
vn_reference_fold_indirect (VEC (vn_reference_op_s, heap) **ops,
unsigned int *i_p)
{
- VEC(vn_reference_op_s, heap) *mem = NULL;
- vn_reference_op_t op;
unsigned int i = *i_p;
- unsigned int j;
-
- /* Get ops for the addressed object. */
- op = VEC_index (vn_reference_op_s, *ops, i);
- /* ??? If this is our usual typeof &ARRAY vs. &ARRAY[0] problem, work
- around it to avoid later ICEs. */
- if (TREE_CODE (TREE_TYPE (TREE_OPERAND (op->op0, 0))) == ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (TREE_TYPE (op->op0))) != ARRAY_TYPE)
- {
- vn_reference_op_s aref;
- tree dom;
- aref.type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (op->op0)));
- aref.opcode = ARRAY_REF;
- aref.op0 = integer_zero_node;
- if ((dom = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (op->op0, 0))))
- && TYPE_MIN_VALUE (dom))
- aref.op0 = TYPE_MIN_VALUE (dom);
- aref.op1 = aref.op0;
- aref.op2 = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (op->op0)));
- VEC_safe_push (vn_reference_op_s, heap, mem, &aref);
- }
- copy_reference_ops_from_ref (TREE_OPERAND (op->op0, 0), &mem);
-
- /* Do the replacement - we should have at least one op in mem now. */
- if (VEC_length (vn_reference_op_s, mem) == 1)
- {
- VEC_replace (vn_reference_op_s, *ops, i - 1,
- VEC_index (vn_reference_op_s, mem, 0));
- VEC_ordered_remove (vn_reference_op_s, *ops, i);
- i--;
- }
- else if (VEC_length (vn_reference_op_s, mem) == 2)
- {
- VEC_replace (vn_reference_op_s, *ops, i - 1,
- VEC_index (vn_reference_op_s, mem, 0));
- VEC_replace (vn_reference_op_s, *ops, i,
- VEC_index (vn_reference_op_s, mem, 1));
- }
- else if (VEC_length (vn_reference_op_s, mem) > 2)
- {
- VEC_replace (vn_reference_op_s, *ops, i - 1,
- VEC_index (vn_reference_op_s, mem, 0));
- VEC_replace (vn_reference_op_s, *ops, i,
- VEC_index (vn_reference_op_s, mem, 1));
- /* ??? There is no VEC_splice. */
- for (j = 2; VEC_iterate (vn_reference_op_s, mem, j, op); j++)
- VEC_safe_insert (vn_reference_op_s, heap, *ops, ++i, op);
+ vn_reference_op_t op = VEC_index (vn_reference_op_s, *ops, i);
+ vn_reference_op_t mem_op = VEC_index (vn_reference_op_s, *ops, i - 1);
+ tree addr_base;
+ HOST_WIDE_INT addr_offset;
+
+ /* The only thing we have to do is from &OBJ.foo.bar add the offset
+ from .foo.bar to the preceeding MEM_REF offset and replace the
+ address with &OBJ. */
+ addr_base = get_addr_base_and_unit_offset (TREE_OPERAND (op->op0, 0),
+ &addr_offset);
+ gcc_checking_assert (addr_base && TREE_CODE (addr_base) != MEM_REF);
+ if (addr_base != op->op0)
+ {
+ double_int off = tree_to_double_int (mem_op->op0);
+ off = double_int_sext (off, TYPE_PRECISION (TREE_TYPE (mem_op->op0)));
+ off = double_int_add (off, shwi_to_double_int (addr_offset));
+ mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off);
+ op->op0 = build_fold_addr_expr (addr_base);
+ if (host_integerp (mem_op->op0, 0))
+ mem_op->off = TREE_INT_CST_LOW (mem_op->op0);
+ else
+ mem_op->off = -1;
+ }
+}
+
+/* Fold *& at position *I_P in a vn_reference_op_s vector *OPS. Updates
+ *I_P to point to the last element of the replacement. */
+static void
+vn_reference_maybe_forwprop_address (VEC (vn_reference_op_s, heap) **ops,
+ unsigned int *i_p)
+{
+ unsigned int i = *i_p;
+ vn_reference_op_t op = VEC_index (vn_reference_op_s, *ops, i);
+ vn_reference_op_t mem_op = VEC_index (vn_reference_op_s, *ops, i - 1);
+ gimple def_stmt;
+ enum tree_code code;
+ double_int off;
+
+ def_stmt = SSA_NAME_DEF_STMT (op->op0);
+ if (!is_gimple_assign (def_stmt))
+ return;
+
+ code = gimple_assign_rhs_code (def_stmt);
+ if (code != ADDR_EXPR
+ && code != POINTER_PLUS_EXPR)
+ return;
+
+ off = tree_to_double_int (mem_op->op0);
+ off = double_int_sext (off, TYPE_PRECISION (TREE_TYPE (mem_op->op0)));
+
+ /* The only thing we have to do is from &OBJ.foo.bar add the offset
+ from .foo.bar to the preceeding MEM_REF offset and replace the
+ address with &OBJ. */
+ if (code == ADDR_EXPR)
+ {
+ tree addr, addr_base;
+ HOST_WIDE_INT addr_offset;
+
+ addr = gimple_assign_rhs1 (def_stmt);
+ addr_base = get_addr_base_and_unit_offset (TREE_OPERAND (addr, 0),
+ &addr_offset);
+ if (!addr_base
+ || TREE_CODE (addr_base) != MEM_REF)
+ return;
+
+ off = double_int_add (off, shwi_to_double_int (addr_offset));
+ off = double_int_add (off, mem_ref_offset (addr_base));
+ op->op0 = TREE_OPERAND (addr_base, 0);
}
else
- gcc_unreachable ();
+ {
+ tree ptr, ptroff;
+ ptr = gimple_assign_rhs1 (def_stmt);
+ ptroff = gimple_assign_rhs2 (def_stmt);
+ if (TREE_CODE (ptr) != SSA_NAME
+ || TREE_CODE (ptroff) != INTEGER_CST)
+ return;
+
+ off = double_int_add (off, tree_to_double_int (ptroff));
+ op->op0 = ptr;
+ }
- VEC_free (vn_reference_op_s, heap, mem);
- *i_p = i;
+ mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off);
+ if (host_integerp (mem_op->op0, 0))
+ mem_op->off = TREE_INT_CST_LOW (mem_op->op0);
+ else
+ mem_op->off = -1;
+ if (TREE_CODE (op->op0) == SSA_NAME)
+ {
+ op->op0 = SSA_VAL (op->op0);
+ if (TREE_CODE (op->op0) != SSA_NAME)
+ op->opcode = TREE_CODE (op->op0);
+ }
+
+ /* And recurse. */
+ if (TREE_CODE (op->op0) == SSA_NAME)
+ vn_reference_maybe_forwprop_address (ops, i_p);
+ else if (TREE_CODE (op->op0) == ADDR_EXPR)
+ vn_reference_fold_indirect (ops, i_p);
}
/* Optimize the reference REF to a constant if possible or return
@@ -978,20 +1153,40 @@ valueize_refs (VEC (vn_reference_op_s, heap) *orig)
the opcode. */
if (TREE_CODE (vro->op0) != SSA_NAME && vro->opcode == SSA_NAME)
vro->opcode = TREE_CODE (vro->op0);
- /* If it transforms from an SSA_NAME to an address, fold with
- a preceding indirect reference. */
- if (i > 0 && TREE_CODE (vro->op0) == ADDR_EXPR
- && VEC_index (vn_reference_op_s,
- orig, i - 1)->opcode == INDIRECT_REF)
- {
- vn_reference_fold_indirect (&orig, &i);
- continue;
- }
}
if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
vro->op1 = SSA_VAL (vro->op1);
if (vro->op2 && TREE_CODE (vro->op2) == SSA_NAME)
vro->op2 = SSA_VAL (vro->op2);
+ /* If it transforms from an SSA_NAME to an address, fold with
+ a preceding indirect reference. */
+ if (i > 0
+ && vro->op0
+ && TREE_CODE (vro->op0) == ADDR_EXPR
+ && VEC_index (vn_reference_op_s,
+ orig, i - 1)->opcode == MEM_REF)
+ vn_reference_fold_indirect (&orig, &i);
+ else if (i > 0
+ && vro->opcode == SSA_NAME
+ && VEC_index (vn_reference_op_s,
+ orig, i - 1)->opcode == MEM_REF)
+ vn_reference_maybe_forwprop_address (&orig, &i);
+ /* If it transforms a non-constant ARRAY_REF into a constant
+ one, adjust the constant offset. */
+ else if (vro->opcode == ARRAY_REF
+ && vro->off == -1
+ && TREE_CODE (vro->op0) == INTEGER_CST
+ && TREE_CODE (vro->op1) == INTEGER_CST
+ && TREE_CODE (vro->op2) == INTEGER_CST)
+ {
+ double_int off = tree_to_double_int (vro->op0);
+ off = double_int_add (off,
+ double_int_neg
+ (tree_to_double_int (vro->op1)));
+ off = double_int_mul (off, tree_to_double_int (vro->op2));
+ if (double_int_fits_in_shwi_p (off))
+ vro->off = off.low;
+ }
}
return orig;
@@ -1104,6 +1299,23 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
tree base;
HOST_WIDE_INT offset, maxsize;
+ /* First try to disambiguate after value-replacing in the definitions LHS. */
+ if (is_gimple_assign (def_stmt))
+ {
+ tree lhs = gimple_assign_lhs (def_stmt);
+ ao_ref ref1;
+ VEC (vn_reference_op_s, heap) *operands = NULL;
+ bool res = true;
+ copy_reference_ops_from_ref (lhs, &operands);
+ operands = valueize_refs (operands);
+ if (ao_ref_init_from_vn_reference (&ref1, get_alias_set (lhs),
+ TREE_TYPE (lhs), operands))
+ res = refs_may_alias_p_1 (ref, &ref1, true);
+ VEC_free (vn_reference_op_s, heap, operands);
+ if (!res)
+ return NULL;
+ }
+
base = ao_ref_base (ref);
offset = ref->offset;
maxsize = ref->max_size;
@@ -1172,7 +1384,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
the copy kills ref. */
else if (gimple_assign_single_p (def_stmt)
&& (DECL_P (gimple_assign_rhs1 (def_stmt))
- || INDIRECT_REF_P (gimple_assign_rhs1 (def_stmt))
+ || TREE_CODE (gimple_assign_rhs1 (def_stmt)) == MEM_REF
|| handled_component_p (gimple_assign_rhs1 (def_stmt))))
{
tree base2;
@@ -2092,9 +2304,9 @@ visit_reference_op_load (tree lhs, tree op, gimple stmt)
result = vn_nary_op_lookup (val, NULL);
/* If the expression is not yet available, value-number lhs to
a new SSA_NAME we create. */
- if (!result && may_insert)
+ if (!result)
{
- result = make_ssa_name (SSA_NAME_VAR (lhs), NULL);
+ result = make_ssa_name (SSA_NAME_VAR (lhs), gimple_build_nop ());
/* Initialize value-number information properly. */
VN_INFO_GET (result)->valnum = result;
VN_INFO (result)->value_id = get_next_value_id ();
@@ -3266,20 +3478,18 @@ set_hashtable_value_ids (void)
due to resource constraints. */
bool
-run_scc_vn (bool may_insert_arg)
+run_scc_vn (void)
{
size_t i;
tree param;
bool changed = true;
- may_insert = may_insert_arg;
-
init_scc_vn ();
current_info = valid_info;
for (param = DECL_ARGUMENTS (current_function_decl);
param;
- param = TREE_CHAIN (param))
+ param = DECL_CHAIN (param))
{
if (gimple_default_def (cfun, param) != NULL)
{
@@ -3297,7 +3507,6 @@ run_scc_vn (bool may_insert_arg)
if (!DFS (name))
{
free_scc_vn ();
- may_insert = false;
return false;
}
}
@@ -3359,7 +3568,6 @@ run_scc_vn (bool may_insert_arg)
}
}
- may_insert = false;
return true;
}
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index 8f93b0b2518..ba7fc5c3e49 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -72,6 +72,8 @@ typedef const struct vn_phi_s *const_vn_phi_t;
typedef struct vn_reference_op_struct
{
enum tree_code opcode;
+ /* Constant offset this op adds or -1 if it is variable. */
+ HOST_WIDE_INT off;
tree type;
tree op0;
tree op1;
@@ -167,7 +169,7 @@ typedef struct vn_ssa_aux
extern vn_ssa_aux_t VN_INFO (tree);
extern vn_ssa_aux_t VN_INFO_GET (tree);
tree vn_get_expr_for (tree);
-bool run_scc_vn (bool);
+bool run_scc_vn (void);
void free_scc_vn (void);
tree vn_nary_op_lookup (tree, vn_nary_op_t *);
tree vn_nary_op_lookup_stmt (gimple, vn_nary_op_t *);
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index ac31781e198..9deec26b11d 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -190,8 +190,11 @@ is_hidden_global_store (gimple stmt)
return true;
}
- else if (INDIRECT_REF_P (lhs))
+ else if (INDIRECT_REF_P (lhs)
+ || TREE_CODE (lhs) == MEM_REF)
return ptr_deref_may_alias_global_p (TREE_OPERAND (lhs, 0));
+ else if (CONSTANT_CLASS_P (lhs))
+ return true;
else
gcc_unreachable ();
}
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 05fd6d971f2..cf5815f67e5 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -32,6 +32,7 @@
#include "tree.h"
#include "tree-flow.h"
#include "tree-inline.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "gimple.h"
#include "hashtab.h"
@@ -2836,7 +2837,8 @@ get_constraint_for_ssa_var (tree t, VEC(ce_s, heap) **results, bool address_p)
/* For parameters, get at the points-to set for the actual parm
decl. */
if (TREE_CODE (t) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
+ && (TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL)
&& SSA_NAME_IS_DEFAULT_DEF (t))
{
get_constraint_for_ssa_var (SSA_NAME_VAR (t), results, address_p);
@@ -3107,7 +3109,8 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
&0->a.b */
forzero = t;
while (handled_component_p (forzero)
- || INDIRECT_REF_P (forzero))
+ || INDIRECT_REF_P (forzero)
+ || TREE_CODE (forzero) == MEM_REF)
forzero = TREE_OPERAND (forzero, 0);
if (CONSTANT_CLASS_P (forzero) && integer_zerop (forzero))
@@ -3174,13 +3177,19 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
cexpr.var = curr->id;
VEC_safe_push (ce_s, heap, *results, &cexpr);
}
- else
+ else if (VEC_length (ce_s, *results) == 0)
/* Assert that we found *some* field there. The user couldn't be
accessing *only* padding. */
/* Still the user could access one past the end of an array
embedded in a struct resulting in accessing *only* padding. */
- gcc_assert (VEC_length (ce_s, *results) >= 1
- || ref_contains_array_ref (orig_t));
+ /* Or accessing only padding via type-punning to a type
+ that has a filed just in padding space. */
+ {
+ cexpr.type = SCALAR;
+ cexpr.var = anything_id;
+ cexpr.offset = 0;
+ VEC_safe_push (ce_s, heap, *results, &cexpr);
+ }
}
else if (bitmaxsize == 0)
{
@@ -3334,9 +3343,10 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
{
switch (TREE_CODE (t))
{
- case INDIRECT_REF:
+ case MEM_REF:
{
- get_constraint_for_1 (TREE_OPERAND (t, 0), results, address_p);
+ get_constraint_for_ptr_offset (TREE_OPERAND (t, 0),
+ TREE_OPERAND (t, 1), results);
do_deref (results);
return;
}
@@ -3980,7 +3990,8 @@ get_fi_for_callee (gimple call)
if (TREE_CODE (decl) == SSA_NAME)
{
if (TREE_CODE (decl) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (decl)) == PARM_DECL
+ && (TREE_CODE (SSA_NAME_VAR (decl)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (decl)) == RESULT_DECL)
&& SSA_NAME_IS_DEFAULT_DEF (decl))
decl = SSA_NAME_VAR (decl);
return get_vi_for_tree (decl);
@@ -4393,6 +4404,14 @@ find_func_aliases (gimple origt)
if (gimple_assign_rhs_code (t) == POINTER_PLUS_EXPR)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
gimple_assign_rhs2 (t), &rhsc);
+ else if (gimple_assign_rhs_code (t) == BIT_AND_EXPR
+ && TREE_CODE (gimple_assign_rhs2 (t)) == INTEGER_CST)
+ {
+ /* Aligning a pointer via a BIT_AND_EXPR is offsetting
+ the pointer. Handle it by offsetting it by UNKNOWN. */
+ get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
+ NULL_TREE, &rhsc);
+ }
else if ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t))
&& !(POINTER_TYPE_P (gimple_expr_type (t))
&& !POINTER_TYPE_P (TREE_TYPE (rhsop))))
@@ -4572,7 +4591,11 @@ find_func_clobbers (gimple origt)
tem = TREE_OPERAND (tem, 0);
if ((DECL_P (tem)
&& !auto_var_in_fn_p (tem, cfun->decl))
- || INDIRECT_REF_P (tem))
+ || INDIRECT_REF_P (tem)
+ || (TREE_CODE (tem) == MEM_REF
+ && !(TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR
+ && auto_var_in_fn_p
+ (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), cfun->decl))))
{
struct constraint_expr lhsc, *rhsp;
unsigned i;
@@ -4596,7 +4619,11 @@ find_func_clobbers (gimple origt)
tem = TREE_OPERAND (tem, 0);
if ((DECL_P (tem)
&& !auto_var_in_fn_p (tem, cfun->decl))
- || INDIRECT_REF_P (tem))
+ || INDIRECT_REF_P (tem)
+ || (TREE_CODE (tem) == MEM_REF
+ && !(TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR
+ && auto_var_in_fn_p
+ (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), cfun->decl))))
{
struct constraint_expr lhs, *rhsp;
unsigned i;
@@ -4960,7 +4987,7 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (VEC_length (fieldoff_s, *fieldstack) > MAX_FIELDS_FOR_FIELD_SENSITIVE)
return false;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
bool push = false;
@@ -5038,7 +5065,7 @@ count_num_arguments (tree decl, bool *is_varargs)
/* Capture named arguments for K&R functions. They do not
have a prototype and thus no TYPE_ARG_TYPES. */
- for (t = DECL_ARGUMENTS (decl); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (decl); t; t = DECL_CHAIN (t))
++num;
/* Check if the function has variadic arguments. */
@@ -5196,7 +5223,7 @@ create_function_info_for (tree decl, const char *name)
if (arg)
{
insert_vi_for_tree (arg, argvi);
- arg = TREE_CHAIN (arg);
+ arg = DECL_CHAIN (arg);
}
}
@@ -5468,7 +5495,7 @@ intra_create_variable_infos (void)
/* For each incoming pointer argument arg, create the constraint ARG
= NONLOCAL or a dummy variable if it is a restrict qualified
passed-by-reference argument. */
- for (t = DECL_ARGUMENTS (current_function_decl); t; t = TREE_CHAIN (t))
+ for (t = DECL_ARGUMENTS (current_function_decl); t; t = DECL_CHAIN (t))
{
varinfo_t p;
@@ -5733,7 +5760,8 @@ find_what_p_points_to (tree p)
/* For parameters, get at the points-to set for the actual parm
decl. */
if (TREE_CODE (p) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL
+ && (TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL
+ || TREE_CODE (SSA_NAME_VAR (p)) == RESULT_DECL)
&& SSA_NAME_IS_DEFAULT_DEF (p))
lookup_p = SSA_NAME_VAR (p);
@@ -5799,6 +5827,17 @@ pt_solution_set (struct pt_solution *pt, bitmap vars,
pt->vars_contains_restrict = vars_contains_restrict;
}
+/* Set the points-to solution *PT to point only to the variable VAR. */
+
+void
+pt_solution_set_var (struct pt_solution *pt, tree var)
+{
+ memset (pt, 0, sizeof (struct pt_solution));
+ pt->vars = BITMAP_GGC_ALLOC ();
+ bitmap_set_bit (pt->vars, DECL_UID (var));
+ pt->vars_contains_global = is_global_var (var);
+}
+
/* Computes the union of the points-to solutions *DEST and *SRC and
stores the result in *DEST. This changes the points-to bitmap
of *DEST and thus may not be used if that might be shared.
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index 2f5b8305f74..a997f7884b0 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -616,6 +616,24 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
}
}
+ /* If the stmt does a memory store and the replacement
+ is a load aliasing it avoid creating overlapping
+ assignments which we cannot expand correctly. */
+ if (gimple_vdef (stmt)
+ && gimple_assign_single_p (stmt))
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (use);
+ while (is_gimple_assign (def_stmt)
+ && gimple_assign_rhs_code (def_stmt) == SSA_NAME)
+ def_stmt
+ = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (def_stmt));
+ if (gimple_vuse (def_stmt)
+ && gimple_assign_single_p (def_stmt)
+ && refs_may_alias_p (gimple_assign_lhs (stmt),
+ gimple_assign_rhs1 (def_stmt)))
+ same_root_var = true;
+ }
+
/* Mark expression as replaceable unless stmt is volatile or the
def variable has the same root variable as something in the
substitution list. */
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index 6d58f5b1631..16adde3b070 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-dump.h"
#include "tree-pass.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "timevar.h"
@@ -92,6 +93,12 @@ ssa_undefined_value_p (tree t)
if (TREE_CODE (var) == PARM_DECL)
return false;
+ /* When returning by reference the return address is actually a hidden
+ parameter. */
+ if (TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL
+ && DECL_BY_REFERENCE (SSA_NAME_VAR (t)))
+ return false;
+
/* Hard register variables get their initial value from the ether. */
if (TREE_CODE (var) == VAR_DECL && DECL_HARD_REGISTER (var))
return false;
@@ -483,17 +490,33 @@ collect_phi_def_edges (gimple phi, basic_block cd_root,
opnd_edge = gimple_phi_arg_edge (phi, i);
opnd = gimple_phi_arg_def (phi, i);
- if (TREE_CODE (opnd) != SSA_NAME
- || !ssa_undefined_value_p (opnd))
- VEC_safe_push (edge, heap, *edges, opnd_edge);
+ if (TREE_CODE (opnd) != SSA_NAME)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "\n[CHECK] Found def edge %d in ", (int)i);
+ print_gimple_stmt (dump_file, phi, 0, 0);
+ }
+ VEC_safe_push (edge, heap, *edges, opnd_edge);
+ }
else
{
gimple def = SSA_NAME_DEF_STMT (opnd);
+
if (gimple_code (def) == GIMPLE_PHI
&& dominated_by_p (CDI_DOMINATORS,
gimple_bb (def), cd_root))
collect_phi_def_edges (def, cd_root, edges,
visited_phis);
+ else if (!ssa_undefined_value_p (opnd))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "\n[CHECK] Found def edge %d in ", (int)i);
+ print_gimple_stmt (dump_file, phi, 0, 0);
+ }
+ VEC_safe_push (edge, heap, *edges, opnd_edge);
+ }
}
}
}
@@ -1523,7 +1546,7 @@ is_use_properly_guarded (gimple use_stmt,
if (dump_file)
dump_predicates (use_stmt, num_preds, preds,
- "Use in stmt ");
+ "\nUse in stmt ");
has_valid_preds = find_def_preds (&def_preds,
&num_def_preds, phi);
@@ -1608,15 +1631,26 @@ find_uninit_use (gimple phi, unsigned uninit_opnds,
}
pointer_set_destroy (visited_phis);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "[CHECK]: Found unguarded use: ");
+ print_gimple_stmt (dump_file, use_stmt, 0, 0);
+ }
/* Found one real use, return. */
if (gimple_code (use_stmt) != GIMPLE_PHI)
- return use_stmt;
+ return use_stmt;
/* Found a phi use that is not guarded,
add the phi to the worklist. */
if (!pointer_set_insert (added_to_worklist,
use_stmt))
{
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "[WORKLIST]: Update worklist with phi: ");
+ print_gimple_stmt (dump_file, use_stmt, 0, 0);
+ }
+
VEC_safe_push (gimple, heap, *worklist, use_stmt);
pointer_set_insert (possibly_undefined_names,
phi_result);
@@ -1651,6 +1685,12 @@ warn_uninitialized_phi (gimple phi, VEC(gimple, heap) **worklist,
if (MASK_EMPTY (uninit_opnds))
return;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "[CHECK]: examining phi: ");
+ print_gimple_stmt (dump_file, phi, 0, 0);
+ }
+
/* Now check if we have any use of the value without proper guard. */
uninit_use_stmt = find_uninit_use (phi, uninit_opnds,
worklist, added_to_worklist);
@@ -1710,6 +1750,11 @@ execute_late_warn_uninitialized (void)
{
VEC_safe_push (gimple, heap, worklist, phi);
pointer_set_insert (added_to_worklist, phi);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "[WORKLIST]: add to initial list: ");
+ print_gimple_stmt (dump_file, phi, 0, 0);
+ }
break;
}
}
@@ -1721,7 +1766,7 @@ execute_late_warn_uninitialized (void)
cur_phi = VEC_pop (gimple, worklist);
warn_uninitialized_phi (cur_phi, &worklist, added_to_worklist);
}
-
+
VEC_free (gimple, heap, worklist);
pointer_set_destroy (added_to_worklist);
pointer_set_destroy (possibly_undefined_names);
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 866ce6eb2b7..687c6393aaa 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -42,7 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-dump.h"
#include "tree-pass.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
/* Pointer map of variable mappings, keyed by edge. */
static struct pointer_map_t *edge_var_maps;
@@ -638,6 +638,13 @@ verify_def (basic_block bb, basic_block *definition_block, tree ssa_name,
if (verify_ssa_name (ssa_name, is_virtual))
goto err;
+ if (TREE_CODE (SSA_NAME_VAR (ssa_name)) == RESULT_DECL
+ && DECL_BY_REFERENCE (SSA_NAME_VAR (ssa_name)))
+ {
+ error ("RESULT_DECL should be read only when DECL_BY_REFERENCE is set.");
+ goto err;
+ }
+
if (definition_block[SSA_NAME_VERSION (ssa_name)])
{
error ("SSA_NAME created in two different blocks %i and %i",
@@ -1204,6 +1211,12 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
!= TYPE_ADDR_SPACE (TREE_TYPE (inner_type)))
return false;
+ /* Do not lose casts to restrict qualified pointers. */
+ if ((TYPE_RESTRICT (outer_type)
+ != TYPE_RESTRICT (inner_type))
+ && TYPE_RESTRICT (outer_type))
+ return false;
+
/* If the outer type is (void *) or a pointer to an incomplete
record type or a pointer to an unprototyped function,
then the conversion is not necessary. */
@@ -1216,12 +1229,6 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
&& useless_type_conversion_p (TREE_TYPE (TREE_TYPE (outer_type)),
TREE_TYPE (TREE_TYPE (inner_type)))))
return true;
-
- /* Do not lose casts to restrict qualified pointers. */
- if ((TYPE_RESTRICT (outer_type)
- != TYPE_RESTRICT (inner_type))
- && TYPE_RESTRICT (outer_type))
- return false;
}
/* From now on qualifiers on value types do not matter. */
@@ -1273,41 +1280,18 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
else if (POINTER_TYPE_P (inner_type)
&& POINTER_TYPE_P (outer_type))
{
- /* Don't lose casts between pointers to volatile and non-volatile
- qualified types. Doing so would result in changing the semantics
- of later accesses. For function types the volatile qualifier
- is used to indicate noreturn functions. */
- if (TREE_CODE (TREE_TYPE (outer_type)) != FUNCTION_TYPE
- && TREE_CODE (TREE_TYPE (outer_type)) != METHOD_TYPE
- && TREE_CODE (TREE_TYPE (inner_type)) != FUNCTION_TYPE
- && TREE_CODE (TREE_TYPE (inner_type)) != METHOD_TYPE
- && (TYPE_VOLATILE (TREE_TYPE (outer_type))
- != TYPE_VOLATILE (TREE_TYPE (inner_type)))
- && TYPE_VOLATILE (TREE_TYPE (outer_type)))
- return false;
-
- /* We require explicit conversions from incomplete target types. */
- if (!COMPLETE_TYPE_P (TREE_TYPE (inner_type))
- && COMPLETE_TYPE_P (TREE_TYPE (outer_type)))
- return false;
-
- /* Do not lose casts between pointers that when dereferenced access
- memory with different alias sets. */
- if (get_deref_alias_set (inner_type) != get_deref_alias_set (outer_type))
+ /* Do not lose casts to function pointer types. */
+ if ((TREE_CODE (TREE_TYPE (outer_type)) == FUNCTION_TYPE
+ || TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE)
+ && !useless_type_conversion_p (TREE_TYPE (outer_type),
+ TREE_TYPE (inner_type)))
return false;
/* We do not care for const qualification of the pointed-to types
as const qualification has no semantic value to the middle-end. */
- /* Otherwise pointers/references are equivalent if their pointed
- to types are effectively the same. We can strip qualifiers
- on pointed-to types for further comparison, which is done in
- the callee. Note we have to use true compatibility here
- because addresses are subject to propagation into dereferences
- and thus might get the original type exposed which is equivalent
- to a reverse conversion. */
- return types_compatible_p (TREE_TYPE (outer_type),
- TREE_TYPE (inner_type));
+ /* Otherwise pointers/references are equivalent. */
+ return true;
}
/* Recurse for complex types. */
@@ -1442,7 +1426,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
compared types. */
else if (AGGREGATE_TYPE_P (inner_type)
&& TREE_CODE (inner_type) == TREE_CODE (outer_type))
- return false;
+ return (in_lto_p
+ && gimple_types_compatible_p (outer_type, inner_type, GTC_DIAG));
return false;
}
@@ -1647,6 +1632,8 @@ warn_uninit (tree t, const char *gmsgid, void *data)
{
TREE_NO_WARNING (var) = 1;
+ if (location == DECL_SOURCE_LOCATION (var))
+ return;
if (xloc.file != floc.file
|| xloc.line < floc.line
|| xloc.line > LOCATION_LINE (cfun->function_end_locus))
@@ -1673,8 +1660,9 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
/* We do not care about LHS. */
if (wi->is_lhs)
{
- /* Except for operands of INDIRECT_REF. */
- if (!INDIRECT_REF_P (t))
+ /* Except for operands of dereferences. */
+ if (!INDIRECT_REF_P (t)
+ && TREE_CODE (t) != MEM_REF)
return NULL_TREE;
t = TREE_OPERAND (t, 0);
}
@@ -1822,18 +1810,136 @@ struct gimple_opt_pass pass_early_warn_uninitialized =
}
};
+
+/* If necessary, rewrite the base of the reference tree *TP from
+ a MEM_REF to a plain or converted symbol. */
+
+static void
+maybe_rewrite_mem_ref_base (tree *tp)
+{
+ tree sym;
+
+ while (handled_component_p (*tp))
+ tp = &TREE_OPERAND (*tp, 0);
+ if (TREE_CODE (*tp) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (*tp, 0)) == ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (*tp, 1))
+ && (sym = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0))
+ && DECL_P (sym)
+ && !TREE_ADDRESSABLE (sym)
+ && symbol_marked_for_renaming (sym))
+ {
+ if (!useless_type_conversion_p (TREE_TYPE (*tp),
+ TREE_TYPE (sym)))
+ *tp = build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (*tp), sym);
+ else
+ *tp = sym;
+ }
+}
+
+/* For a tree REF return its base if it is the base of a MEM_REF
+ that cannot be rewritten into SSA form. Otherwise return NULL_TREE. */
+
+static tree
+non_rewritable_mem_ref_base (tree ref)
+{
+ tree base = ref;
+
+ /* A plain decl does not need it set. */
+ if (DECL_P (ref))
+ return NULL_TREE;
+
+ while (handled_component_p (base))
+ base = TREE_OPERAND (base, 0);
+
+ /* But watch out for MEM_REFs we cannot lower to a
+ VIEW_CONVERT_EXPR. */
+ if (TREE_CODE (base) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (base, 0)) == ADDR_EXPR)
+ {
+ tree decl = TREE_OPERAND (TREE_OPERAND (base, 0), 0);
+ if (DECL_P (decl)
+ && (!integer_zerop (TREE_OPERAND (base, 1))
+ || (DECL_SIZE (decl)
+ != TYPE_SIZE (TREE_TYPE (base)))))
+ return decl;
+ }
+
+ return NULL_TREE;
+}
+
+/* When possible, clear ADDRESSABLE bit or set the REGISTER bit
+ and mark the variable VAR for conversion into SSA. Returns true
+ when updating stmts is required. */
+
+static bool
+maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
+{
+ bool update_vops = false;
+
+ /* Global Variables, result decls cannot be changed. */
+ if (is_global_var (var)
+ || TREE_CODE (var) == RESULT_DECL
+ || bitmap_bit_p (addresses_taken, DECL_UID (var)))
+ return false;
+
+ /* If the variable is not in the list of referenced vars then we
+ do not need to touch it nor can we rename it. */
+ if (!referenced_var_lookup (DECL_UID (var)))
+ return false;
+
+ if (TREE_ADDRESSABLE (var)
+ /* Do not change TREE_ADDRESSABLE if we need to preserve var as
+ a non-register. Otherwise we are confused and forget to
+ add virtual operands for it. */
+ && (!is_gimple_reg_type (TREE_TYPE (var))
+ || !bitmap_bit_p (not_reg_needs, DECL_UID (var))))
+ {
+ TREE_ADDRESSABLE (var) = 0;
+ if (is_gimple_reg (var))
+ mark_sym_for_renaming (var);
+ update_vops = true;
+ if (dump_file)
+ {
+ fprintf (dump_file, "No longer having address taken ");
+ print_generic_expr (dump_file, var, 0);
+ fprintf (dump_file, "\n");
+ }
+ }
+ if (!DECL_GIMPLE_REG_P (var)
+ && !bitmap_bit_p (not_reg_needs, DECL_UID (var))
+ && (TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE
+ || TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE)
+ && !TREE_THIS_VOLATILE (var)
+ && (TREE_CODE (var) != VAR_DECL || !DECL_HARD_REGISTER (var)))
+ {
+ DECL_GIMPLE_REG_P (var) = 1;
+ mark_sym_for_renaming (var);
+ update_vops = true;
+ if (dump_file)
+ {
+ fprintf (dump_file, "Decl is now a gimple register ");
+ print_generic_expr (dump_file, var, 0);
+ fprintf (dump_file, "\n");
+ }
+ }
+
+ return update_vops;
+}
+
/* Compute TREE_ADDRESSABLE and DECL_GIMPLE_REG_P for local variables. */
void
execute_update_addresses_taken (bool do_optimize)
{
tree var;
- referenced_var_iterator rvi;
gimple_stmt_iterator gsi;
basic_block bb;
bitmap addresses_taken = BITMAP_ALLOC (NULL);
bitmap not_reg_needs = BITMAP_ALLOC (NULL);
bool update_vops = false;
+ unsigned i;
/* Collect into ADDRESSES_TAKEN all variables whose address is taken within
the function body. */
@@ -1843,6 +1949,7 @@ execute_update_addresses_taken (bool do_optimize)
{
gimple stmt = gsi_stmt (gsi);
enum gimple_code code = gimple_code (stmt);
+ tree decl;
/* Note all addresses taken by the stmt. */
gimple_ior_addresses_taken (addresses_taken, stmt);
@@ -1853,19 +1960,59 @@ execute_update_addresses_taken (bool do_optimize)
{
tree lhs = gimple_get_lhs (stmt);
- /* We may not rewrite TMR_SYMBOL to SSA. */
- if (lhs && TREE_CODE (lhs) == TARGET_MEM_REF
- && TMR_SYMBOL (lhs))
- bitmap_set_bit (not_reg_needs, DECL_UID (TMR_SYMBOL (lhs)));
-
/* A plain decl does not need it set. */
- else if (lhs && handled_component_p (lhs))
- {
- var = get_base_address (lhs);
- if (DECL_P (var))
- bitmap_set_bit (not_reg_needs, DECL_UID (var));
+ if (lhs && !DECL_P (lhs))
+ {
+ if (handled_component_p (lhs))
+ lhs = get_base_address (lhs);
+
+ if (DECL_P (lhs))
+ bitmap_set_bit (not_reg_needs, DECL_UID (lhs));
+ else if (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR)
+ {
+ decl = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0);
+ if (DECL_P (decl)
+ && (!integer_zerop (TREE_OPERAND (lhs, 1))
+ || (DECL_SIZE (decl)
+ != TYPE_SIZE (TREE_TYPE (lhs)))))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
+ }
}
}
+
+ if (gimple_assign_single_p (stmt))
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+ if ((decl = non_rewritable_mem_ref_base (rhs)))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
+ }
+
+ else if (code == GIMPLE_CALL)
+ {
+ for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ {
+ tree arg = gimple_call_arg (stmt, i);
+ if ((decl = non_rewritable_mem_ref_base (arg)))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
+ }
+ }
+
+ else if (code == GIMPLE_ASM)
+ {
+ for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+ {
+ tree link = gimple_asm_output_op (stmt, i);
+ if ((decl = non_rewritable_mem_ref_base (TREE_VALUE (link))))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
+ }
+ for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
+ {
+ tree link = gimple_asm_input_op (stmt, i);
+ if ((decl = non_rewritable_mem_ref_base (TREE_VALUE (link))))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
+ }
+ }
}
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -1887,64 +2034,98 @@ execute_update_addresses_taken (bool do_optimize)
/* When possible, clear ADDRESSABLE bit or set the REGISTER bit
and mark variable for conversion into SSA. */
if (optimize && do_optimize)
- FOR_EACH_REFERENCED_VAR (var, rvi)
- {
- /* Global Variables, result decls cannot be changed. */
- if (is_global_var (var)
- || TREE_CODE (var) == RESULT_DECL
- || bitmap_bit_p (addresses_taken, DECL_UID (var)))
- continue;
-
- if (TREE_ADDRESSABLE (var)
- /* Do not change TREE_ADDRESSABLE if we need to preserve var as
- a non-register. Otherwise we are confused and forget to
- add virtual operands for it. */
- && (!is_gimple_reg_type (TREE_TYPE (var))
- || !bitmap_bit_p (not_reg_needs, DECL_UID (var))))
- {
- TREE_ADDRESSABLE (var) = 0;
- if (is_gimple_reg (var))
- mark_sym_for_renaming (var);
- update_vops = true;
- if (dump_file)
- {
- fprintf (dump_file, "No longer having address taken ");
- print_generic_expr (dump_file, var, 0);
- fprintf (dump_file, "\n");
- }
- }
- if (!DECL_GIMPLE_REG_P (var)
- && !bitmap_bit_p (not_reg_needs, DECL_UID (var))
- && (TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE
- || TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE)
- && !TREE_THIS_VOLATILE (var)
- && (TREE_CODE (var) != VAR_DECL || !DECL_HARD_REGISTER (var)))
- {
- DECL_GIMPLE_REG_P (var) = 1;
- mark_sym_for_renaming (var);
- update_vops = true;
- if (dump_file)
- {
- fprintf (dump_file, "Decl is now a gimple register ");
- print_generic_expr (dump_file, var, 0);
- fprintf (dump_file, "\n");
- }
- }
- }
+ {
+ /* We cannot iterate over all referenced vars as that can contain
+ unused vars from BLOCK trees which cause code generation
+ differences for -g vs. -g0. */
+ for (var = DECL_ARGUMENTS (cfun->decl); var; var = DECL_CHAIN (var))
+ update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
+ for (i = 0; VEC_iterate (tree, cfun->local_decls, i, var); ++i)
+ update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
+ }
/* Operand caches needs to be recomputed for operands referencing the updated
variables. */
if (update_vops)
{
FOR_EACH_BB (bb)
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
- if (gimple_references_memory_p (stmt)
- || is_gimple_debug (stmt))
- update_stmt (stmt);
- }
+ /* Re-write TARGET_MEM_REFs of symbols we want to
+ rewrite into SSA form. */
+ if (gimple_assign_single_p (stmt))
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs, *rhsp = gimple_assign_rhs1_ptr (stmt);
+ tree sym;
+
+ /* We shouldn't have any fancy wrapping of
+ component-refs on the LHS, but look through
+ VIEW_CONVERT_EXPRs as that is easy. */
+ while (TREE_CODE (lhs) == VIEW_CONVERT_EXPR)
+ lhs = TREE_OPERAND (lhs, 0);
+ if (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (lhs, 1))
+ && (sym = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0))
+ && DECL_P (sym)
+ && !TREE_ADDRESSABLE (sym)
+ && symbol_marked_for_renaming (sym))
+ lhs = sym;
+ else
+ lhs = gimple_assign_lhs (stmt);
+
+ /* Rewrite the RHS and make sure the resulting assignment
+ is validly typed. */
+ maybe_rewrite_mem_ref_base (rhsp);
+ rhs = gimple_assign_rhs1 (stmt);
+ if (gimple_assign_lhs (stmt) != lhs
+ && !useless_type_conversion_p (TREE_TYPE (lhs),
+ TREE_TYPE (rhs)))
+ rhs = fold_build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (lhs), rhs);
+
+ if (gimple_assign_lhs (stmt) != lhs)
+ gimple_assign_set_lhs (stmt, lhs);
+
+ if (gimple_assign_rhs1 (stmt) != rhs)
+ {
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+ gimple_assign_set_rhs_from_tree (&gsi, rhs);
+ }
+ }
+
+ else if (gimple_code (stmt) == GIMPLE_CALL)
+ {
+ unsigned i;
+ for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ {
+ tree *argp = gimple_call_arg_ptr (stmt, i);
+ maybe_rewrite_mem_ref_base (argp);
+ }
+ }
+
+ else if (gimple_code (stmt) == GIMPLE_ASM)
+ {
+ unsigned i;
+ for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+ {
+ tree link = gimple_asm_output_op (stmt, i);
+ maybe_rewrite_mem_ref_base (&TREE_VALUE (link));
+ }
+ for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
+ {
+ tree link = gimple_asm_input_op (stmt, i);
+ maybe_rewrite_mem_ref_base (&TREE_VALUE (link));
+ }
+ }
+
+ if (gimple_references_memory_p (stmt)
+ || is_gimple_debug (stmt))
+ update_stmt (stmt);
+ }
/* Update SSA form here, we are called as non-pass as well. */
update_ssa (TODO_update_ssa);
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 3bfbfc2dc19..5c9b35cd44d 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -512,7 +512,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
/* x = *ap_temp; */
- if (gimple_assign_rhs_code (stmt) == INDIRECT_REF
+ if (gimple_assign_rhs_code (stmt) == MEM_REF
&& TREE_OPERAND (rhs, 0) == use
&& TYPE_SIZE_UNIT (TREE_TYPE (rhs))
&& host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (rhs)), 1)
@@ -522,6 +522,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
tree access_size = TYPE_SIZE_UNIT (TREE_TYPE (rhs));
gpr_size = si->offsets[SSA_NAME_VERSION (use)]
+ + tree_low_cst (TREE_OPERAND (rhs, 1), 0)
+ tree_low_cst (access_size, 1);
if (gpr_size >= VA_LIST_MAX_GPR_SIZE)
cfun->va_list_gpr_size = VA_LIST_MAX_GPR_SIZE;
@@ -635,7 +636,6 @@ execute_optimize_stdarg (void)
break;
/* If old style builtins are used, don't optimize anything. */
case BUILT_IN_SAVEREGS:
- case BUILT_IN_ARGS_INFO:
case BUILT_IN_NEXT_ARG:
va_list_escapes = true;
continue;
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 5a6bd23ea42..65eaa40cedb 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -164,7 +164,7 @@ suitable_for_tail_call_opt_p (void)
but not in all cases. See PR15387 and PR19616. Revisit for 4.1. */
for (param = DECL_ARGUMENTS (current_function_decl);
param;
- param = TREE_CHAIN (param))
+ param = DECL_CHAIN (param))
if (TREE_ADDRESSABLE (param))
return false;
@@ -423,7 +423,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
for (param = DECL_ARGUMENTS (func), idx = 0;
param && idx < gimple_call_num_args (call);
- param = TREE_CHAIN (param), idx ++)
+ param = DECL_CHAIN (param), idx ++)
{
arg = gimple_call_arg (call, idx);
if (param != arg)
@@ -808,7 +808,7 @@ eliminate_tail_call (struct tailcall *t)
for (param = DECL_ARGUMENTS (current_function_decl),
idx = 0, gsi = gsi_start_phis (first);
param;
- param = TREE_CHAIN (param), idx++)
+ param = DECL_CHAIN (param), idx++)
{
if (!arg_needs_copy_p (param))
continue;
@@ -965,7 +965,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
/* Copy the args if needed. */
for (param = DECL_ARGUMENTS (current_function_decl);
param;
- param = TREE_CHAIN (param))
+ param = DECL_CHAIN (param))
if (arg_needs_copy_p (param))
{
tree name = gimple_default_def (cfun, param);
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 6002b090463..efd95a78acb 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-chrec.h"
#include "tree-scalar-evolution.h"
#include "tree-vectorizer.h"
+#include "diagnostic-core.h"
#include "toplev.h"
/* Need to include rtl.h, expr.h, etc. for optabs. */
@@ -810,7 +811,11 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
NOTE: This is the only change to the code we make during
the analysis phase, before deciding to vectorize the loop. */
if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "force alignment");
+ {
+ fprintf (vect_dump, "force alignment of ");
+ print_generic_expr (vect_dump, ref, TDF_SLIM);
+ }
+
DECL_ALIGN (base) = TYPE_ALIGN (vectype);
DECL_USER_ALIGN (base) = 1;
}
@@ -967,7 +972,7 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
|| !STMT_VINFO_VECTORIZABLE (stmt_info))
continue;
- supportable_dr_alignment = vect_supportable_dr_alignment (dr);
+ supportable_dr_alignment = vect_supportable_dr_alignment (dr, false);
if (!supportable_dr_alignment)
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
@@ -1061,6 +1066,189 @@ vector_alignment_reachable_p (struct data_reference *dr)
return true;
}
+
+/* Calculate the cost of the memory access represented by DR. */
+
+static void
+vect_get_data_access_cost (struct data_reference *dr,
+ unsigned int *inside_cost,
+ unsigned int *outside_cost)
+{
+ gimple stmt = DR_STMT (dr);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ int nunits = TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info));
+ loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
+ int ncopies = vf / nunits;
+ bool supportable_dr_alignment = vect_supportable_dr_alignment (dr, true);
+
+ if (!supportable_dr_alignment)
+ *inside_cost = VECT_MAX_COST;
+ else
+ {
+ if (DR_IS_READ (dr))
+ vect_get_load_cost (dr, ncopies, true, inside_cost, outside_cost);
+ else
+ vect_get_store_cost (dr, ncopies, inside_cost);
+ }
+
+ if (vect_print_dump_info (REPORT_COST))
+ fprintf (vect_dump, "vect_get_data_access_cost: inside_cost = %d, "
+ "outside_cost = %d.", *inside_cost, *outside_cost);
+}
+
+
+static hashval_t
+vect_peeling_hash (const void *elem)
+{
+ const struct _vect_peel_info *peel_info;
+
+ peel_info = (const struct _vect_peel_info *) elem;
+ return (hashval_t) peel_info->npeel;
+}
+
+
+static int
+vect_peeling_hash_eq (const void *elem1, const void *elem2)
+{
+ const struct _vect_peel_info *a, *b;
+
+ a = (const struct _vect_peel_info *) elem1;
+ b = (const struct _vect_peel_info *) elem2;
+ return (a->npeel == b->npeel);
+}
+
+
+/* Insert DR into peeling hash table with NPEEL as key. */
+
+static void
+vect_peeling_hash_insert (loop_vec_info loop_vinfo, struct data_reference *dr,
+ int npeel)
+{
+ struct _vect_peel_info elem, *slot;
+ void **new_slot;
+ bool supportable_dr_alignment = vect_supportable_dr_alignment (dr, true);
+
+ elem.npeel = npeel;
+ slot = (vect_peel_info) htab_find (LOOP_VINFO_PEELING_HTAB (loop_vinfo),
+ &elem);
+ if (slot)
+ slot->count++;
+ else
+ {
+ slot = XNEW (struct _vect_peel_info);
+ slot->npeel = npeel;
+ slot->dr = dr;
+ slot->count = 1;
+ new_slot = htab_find_slot (LOOP_VINFO_PEELING_HTAB (loop_vinfo), slot,
+ INSERT);
+ *new_slot = slot;
+ }
+
+ if (!supportable_dr_alignment && !flag_vect_cost_model)
+ slot->count += VECT_MAX_COST;
+}
+
+
+/* Traverse peeling hash table to find peeling option that aligns maximum
+ number of data accesses. */
+
+static int
+vect_peeling_hash_get_most_frequent (void **slot, void *data)
+{
+ vect_peel_info elem = (vect_peel_info) *slot;
+ vect_peel_extended_info max = (vect_peel_extended_info) data;
+
+ if (elem->count > max->peel_info.count)
+ {
+ max->peel_info.npeel = elem->npeel;
+ max->peel_info.count = elem->count;
+ max->peel_info.dr = elem->dr;
+ }
+
+ return 1;
+}
+
+
+/* Traverse peeling hash table and calculate cost for each peeling option. Find
+ one with the lowest cost. */
+
+static int
+vect_peeling_hash_get_lowest_cost (void **slot, void *data)
+{
+ vect_peel_info elem = (vect_peel_info) *slot;
+ vect_peel_extended_info min = (vect_peel_extended_info) data;
+ int save_misalignment, dummy;
+ unsigned int inside_cost = 0, outside_cost = 0, i;
+ gimple stmt = DR_STMT (elem->dr);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ VEC (data_reference_p, heap) *datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
+ struct data_reference *dr;
+
+ for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
+ {
+ stmt = DR_STMT (dr);
+ stmt_info = vinfo_for_stmt (stmt);
+ /* For interleaving, only the alignment of the first access
+ matters. */
+ if (STMT_VINFO_STRIDED_ACCESS (stmt_info)
+ && DR_GROUP_FIRST_DR (stmt_info) != stmt)
+ continue;
+
+ save_misalignment = DR_MISALIGNMENT (dr);
+ vect_update_misalignment_for_peel (dr, elem->dr, elem->npeel);
+ vect_get_data_access_cost (dr, &inside_cost, &outside_cost);
+ SET_DR_MISALIGNMENT (dr, save_misalignment);
+ }
+
+ outside_cost += vect_get_known_peeling_cost (loop_vinfo, elem->npeel, &dummy,
+ vect_get_single_scalar_iteraion_cost (loop_vinfo));
+
+ if (inside_cost < min->inside_cost
+ || (inside_cost == min->inside_cost && outside_cost < min->outside_cost))
+ {
+ min->inside_cost = inside_cost;
+ min->outside_cost = outside_cost;
+ min->peel_info.dr = elem->dr;
+ min->peel_info.npeel = elem->npeel;
+ }
+
+ return 1;
+}
+
+
+/* Choose best peeling option by traversing peeling hash table and either
+ choosing an option with the lowest cost (if cost model is enabled) or the
+ option that aligns as many accesses as possible. */
+
+static struct data_reference *
+vect_peeling_hash_choose_best_peeling (loop_vec_info loop_vinfo,
+ unsigned int *npeel)
+{
+ struct _vect_peel_extended_info res;
+
+ res.peel_info.dr = NULL;
+
+ if (flag_vect_cost_model)
+ {
+ res.inside_cost = INT_MAX;
+ res.outside_cost = INT_MAX;
+ htab_traverse (LOOP_VINFO_PEELING_HTAB (loop_vinfo),
+ vect_peeling_hash_get_lowest_cost, &res);
+ }
+ else
+ {
+ res.peel_info.count = 0;
+ htab_traverse (LOOP_VINFO_PEELING_HTAB (loop_vinfo),
+ vect_peeling_hash_get_most_frequent, &res);
+ }
+
+ *npeel = res.peel_info.npeel;
+ return res.peel_info.dr;
+}
+
+
/* Function vect_enhance_data_refs_alignment
This pass will use loop versioning and loop peeling in order to enhance
@@ -1158,15 +1346,21 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
VEC (data_reference_p, heap) *datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
enum dr_alignment_support supportable_dr_alignment;
- struct data_reference *dr0 = NULL;
+ struct data_reference *dr0 = NULL, *first_store = NULL;
struct data_reference *dr;
- unsigned int i;
+ unsigned int i, j;
bool do_peeling = false;
bool do_versioning = false;
bool stat;
gimple stmt;
stmt_vec_info stmt_info;
int vect_versioning_for_alias_required;
+ unsigned int npeel = 0;
+ bool all_misalignments_unknown = true;
+ unsigned int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
+ unsigned possible_npeel_number = 1;
+ tree vectype;
+ unsigned int nelements, mis, same_align_drs_max = 0;
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== vect_enhance_data_refs_alignment ===");
@@ -1201,12 +1395,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
- How many accesses will become unaligned due to the peeling,
and the cost of misaligned accesses.
- The cost of peeling (the extra runtime checks, the increase
- in code size).
-
- The scheme we use FORNOW: peel to force the alignment of the first
- unsupported misaligned access in the loop.
-
- TODO: Use a cost model. */
+ in code size). */
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
{
@@ -1219,15 +1408,108 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
&& DR_GROUP_FIRST_DR (stmt_info) != stmt)
continue;
- if (!DR_IS_READ (dr) && !aligned_access_p (dr))
+ supportable_dr_alignment = vect_supportable_dr_alignment (dr, true);
+ do_peeling = vector_alignment_reachable_p (dr);
+ if (do_peeling)
{
- do_peeling = vector_alignment_reachable_p (dr);
- if (do_peeling)
- dr0 = dr;
- if (!do_peeling && vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vector alignment may not be reachable");
- break;
- }
+ if (known_alignment_for_access_p (dr))
+ {
+ unsigned int npeel_tmp;
+
+ /* Save info about DR in the hash table. */
+ if (!LOOP_VINFO_PEELING_HTAB (loop_vinfo))
+ LOOP_VINFO_PEELING_HTAB (loop_vinfo) =
+ htab_create (1, vect_peeling_hash,
+ vect_peeling_hash_eq, free);
+
+ vectype = STMT_VINFO_VECTYPE (stmt_info);
+ nelements = TYPE_VECTOR_SUBPARTS (vectype);
+ mis = DR_MISALIGNMENT (dr) / GET_MODE_SIZE (TYPE_MODE (
+ TREE_TYPE (DR_REF (dr))));
+ npeel_tmp = (nelements - mis) % vf;
+
+ /* For multiple types, it is possible that the bigger type access
+ will have more than one peeling option. E.g., a loop with two
+ types: one of size (vector size / 4), and the other one of
+ size (vector size / 8). Vectorization factor will 8. If both
+ access are misaligned by 3, the first one needs one scalar
+ iteration to be aligned, and the second one needs 5. But the
+ the first one will be aligned also by peeling 5 scalar
+ iterations, and in that case both accesses will be aligned.
+ Hence, except for the immediate peeling amount, we also want
+ to try to add full vector size, while we don't exceed
+ vectorization factor.
+ We do this automtically for cost model, since we calculate cost
+ for every peeling option. */
+ if (!flag_vect_cost_model)
+ possible_npeel_number = vf /nelements;
+
+ /* Handle the aligned case. We may decide to align some other
+ access, making DR unaligned. */
+ if (DR_MISALIGNMENT (dr) == 0)
+ {
+ npeel_tmp = 0;
+ if (!flag_vect_cost_model)
+ possible_npeel_number++;
+ }
+
+ for (j = 0; j < possible_npeel_number; j++)
+ {
+ gcc_assert (npeel_tmp <= vf);
+ vect_peeling_hash_insert (loop_vinfo, dr, npeel_tmp);
+ npeel_tmp += nelements;
+ }
+
+ all_misalignments_unknown = false;
+ /* Data-ref that was chosen for the case that all the
+ misalignments are unknown is not relevant anymore, since we
+ have a data-ref with known alignment. */
+ dr0 = NULL;
+ }
+ else
+ {
+ /* If we don't know all the misalignment values, we prefer
+ peeling for data-ref that has maximum number of data-refs
+ with the same alignment, unless the target prefers to align
+ stores over load. */
+ if (all_misalignments_unknown)
+ {
+ if (same_align_drs_max < VEC_length (dr_p,
+ STMT_VINFO_SAME_ALIGN_REFS (stmt_info))
+ || !dr0)
+ {
+ same_align_drs_max = VEC_length (dr_p,
+ STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
+ dr0 = dr;
+ }
+
+ if (!first_store && !DR_IS_READ (dr))
+ first_store = dr;
+ }
+
+ /* If there are both known and unknown misaligned accesses in the
+ loop, we choose peeling amount according to the known
+ accesses. */
+
+
+ if (!supportable_dr_alignment)
+ {
+ dr0 = dr;
+ if (!first_store && !DR_IS_READ (dr))
+ first_store = dr;
+ }
+ }
+ }
+ else
+ {
+ if (!aligned_access_p (dr))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "vector alignment may not be reachable");
+
+ break;
+ }
+ }
}
vect_versioning_for_alias_required
@@ -1242,24 +1524,112 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
|| !slpeel_can_duplicate_loop_p (loop, single_exit (loop)))
do_peeling = false;
+ if (do_peeling && all_misalignments_unknown
+ && vect_supportable_dr_alignment (dr0, false))
+ {
+
+ /* Check if the target requires to prefer stores over loads, i.e., if
+ misaligned stores are more expensive than misaligned loads (taking
+ drs with same alignment into account). */
+ if (first_store && DR_IS_READ (dr0))
+ {
+ unsigned int load_inside_cost = 0, load_outside_cost = 0;
+ unsigned int store_inside_cost = 0, store_outside_cost = 0;
+ unsigned int load_inside_penalty = 0, load_outside_penalty = 0;
+ unsigned int store_inside_penalty = 0, store_outside_penalty = 0;
+
+ vect_get_data_access_cost (dr0, &load_inside_cost,
+ &load_outside_cost);
+ vect_get_data_access_cost (first_store, &store_inside_cost,
+ &store_outside_cost);
+
+ /* Calculate the penalty for leaving FIRST_STORE unaligned (by
+ aligning the load DR0). */
+ load_inside_penalty = store_inside_cost;
+ load_outside_penalty = store_outside_cost;
+ for (i = 0; VEC_iterate (dr_p, STMT_VINFO_SAME_ALIGN_REFS
+ (vinfo_for_stmt (DR_STMT (first_store))),
+ i, dr);
+ i++)
+ if (DR_IS_READ (dr))
+ {
+ load_inside_penalty += load_inside_cost;
+ load_outside_penalty += load_outside_cost;
+ }
+ else
+ {
+ load_inside_penalty += store_inside_cost;
+ load_outside_penalty += store_outside_cost;
+ }
+
+ /* Calculate the penalty for leaving DR0 unaligned (by
+ aligning the FIRST_STORE). */
+ store_inside_penalty = load_inside_cost;
+ store_outside_penalty = load_outside_cost;
+ for (i = 0; VEC_iterate (dr_p, STMT_VINFO_SAME_ALIGN_REFS
+ (vinfo_for_stmt (DR_STMT (dr0))),
+ i, dr);
+ i++)
+ if (DR_IS_READ (dr))
+ {
+ store_inside_penalty += load_inside_cost;
+ store_outside_penalty += load_outside_cost;
+ }
+ else
+ {
+ store_inside_penalty += store_inside_cost;
+ store_outside_penalty += store_outside_cost;
+ }
+
+ if (load_inside_penalty > store_inside_penalty
+ || (load_inside_penalty == store_inside_penalty
+ && load_outside_penalty > store_outside_penalty))
+ dr0 = first_store;
+ }
+
+ /* In case there are only loads with different unknown misalignments, use
+ peeling only if it may help to align other accesses in the loop. */
+ if (!first_store && !VEC_length (dr_p, STMT_VINFO_SAME_ALIGN_REFS
+ (vinfo_for_stmt (DR_STMT (dr0))))
+ && vect_supportable_dr_alignment (dr0, false)
+ != dr_unaligned_supported)
+ do_peeling = false;
+ }
+
+ if (do_peeling && !dr0)
+ {
+ /* Peeling is possible, but there is no data access that is not supported
+ unless aligned. So we try to choose the best possible peeling. */
+
+ /* We should get here only if there are drs with known misalignment. */
+ gcc_assert (!all_misalignments_unknown);
+
+ /* Choose the best peeling from the hash table. */
+ dr0 = vect_peeling_hash_choose_best_peeling (loop_vinfo, &npeel);
+ if (!dr0 || !npeel)
+ do_peeling = false;
+ }
+
if (do_peeling)
{
- int mis;
- int npeel = 0;
- gimple stmt = DR_STMT (dr0);
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- int nelements = TYPE_VECTOR_SUBPARTS (vectype);
+ stmt = DR_STMT (dr0);
+ stmt_info = vinfo_for_stmt (stmt);
+ vectype = STMT_VINFO_VECTYPE (stmt_info);
+ nelements = TYPE_VECTOR_SUBPARTS (vectype);
if (known_alignment_for_access_p (dr0))
{
- /* Since it's known at compile time, compute the number of iterations
- in the peeled loop (the peeling factor) for use in updating
- DR_MISALIGNMENT values. The peeling factor is the vectorization
- factor minus the misalignment as an element count. */
- mis = DR_MISALIGNMENT (dr0);
- mis /= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr0))));
- npeel = nelements - mis;
+ if (!npeel)
+ {
+ /* Since it's known at compile time, compute the number of
+ iterations in the peeled loop (the peeling factor) for use in
+ updating DR_MISALIGNMENT values. The peeling factor is the
+ vectorization factor minus the misalignment as an element
+ count. */
+ mis = DR_MISALIGNMENT (dr0);
+ mis /= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr0))));
+ npeel = nelements - mis;
+ }
/* For interleaved data access every iteration accesses all the
members of the group, therefore we divide the number of iterations
@@ -1290,7 +1660,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
save_misalignment = DR_MISALIGNMENT (dr);
vect_update_misalignment_for_peel (dr, dr0, npeel);
- supportable_dr_alignment = vect_supportable_dr_alignment (dr);
+ supportable_dr_alignment = vect_supportable_dr_alignment (dr, false);
SET_DR_MISALIGNMENT (dr, save_misalignment);
if (!supportable_dr_alignment)
@@ -1300,6 +1670,15 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
}
}
+ if (do_peeling && known_alignment_for_access_p (dr0) && npeel == 0)
+ {
+ stat = vect_verify_datarefs_alignment (loop_vinfo, NULL);
+ if (!stat)
+ do_peeling = false;
+ else
+ return stat;
+ }
+
if (do_peeling)
{
/* (1.2) Update the DR_MISALIGNMENT of each data reference DR_i.
@@ -1314,7 +1693,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
vect_update_misalignment_for_peel (dr, dr0, npeel);
LOOP_VINFO_UNALIGNED_DR (loop_vinfo) = dr0;
- LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo) = DR_MISALIGNMENT (dr0);
+ if (npeel)
+ LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo) = npeel;
+ else
+ LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo) = DR_MISALIGNMENT (dr0);
SET_DR_MISALIGNMENT (dr0, 0);
if (vect_print_dump_info (REPORT_ALIGNMENT))
fprintf (vect_dump, "Alignment of access forced using peeling.");
@@ -1358,7 +1740,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
&& DR_GROUP_FIRST_DR (stmt_info) != stmt))
continue;
- supportable_dr_alignment = vect_supportable_dr_alignment (dr);
+ supportable_dr_alignment = vect_supportable_dr_alignment (dr, false);
if (!supportable_dr_alignment)
{
@@ -1467,7 +1849,7 @@ vect_find_same_alignment_drs (struct data_dependence_relation *ddr,
if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
return;
- if ((DR_IS_READ (dra) && DR_IS_READ (drb)) || dra == drb)
+ if (dra == drb)
return;
if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
@@ -2398,18 +2780,15 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
data_ref_base, base_offset);
else
{
- if (TREE_CODE (DR_REF (dr)) == INDIRECT_REF)
- addr_base = unshare_expr (TREE_OPERAND (DR_REF (dr), 0));
- else
- addr_base = build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (DR_REF (dr))),
- unshare_expr (DR_REF (dr)));
+ addr_base = build1 (ADDR_EXPR,
+ build_pointer_type (TREE_TYPE (DR_REF (dr))),
+ unshare_expr (DR_REF (dr)));
}
vect_ptr_type = build_pointer_type (STMT_VINFO_VECTYPE (stmt_info));
base = get_base_address (DR_REF (dr));
if (base
- && INDIRECT_REF_P (base))
+ && TREE_CODE (base) == MEM_REF)
vect_ptr_type
= build_qualified_type (vect_ptr_type,
TYPE_QUALS (TREE_TYPE (TREE_OPERAND (base, 0))));
@@ -2421,6 +2800,10 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
vec_stmt = force_gimple_operand (vec_stmt, &seq, false, addr_expr);
gimple_seq_add_seq (new_stmt_list, seq);
+ if (DR_PTR_INFO (dr)
+ && TREE_CODE (vec_stmt) == SSA_NAME)
+ duplicate_ssa_name_ptr_info (vec_stmt, DR_PTR_INFO (dr));
+
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "created ");
@@ -2556,7 +2939,7 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
vect_ptr_type = build_pointer_type (vectype);
base = get_base_address (DR_REF (dr));
if (base
- && INDIRECT_REF_P (base))
+ && TREE_CODE (base) == MEM_REF)
vect_ptr_type
= build_qualified_type (vect_ptr_type,
TYPE_QUALS (TREE_TYPE (TREE_OPERAND (base, 0))));
@@ -2654,17 +3037,26 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
*initial_address = new_temp;
/* Create: p = (vectype *) initial_base */
- vec_stmt = gimple_build_assign (vect_ptr,
- fold_convert (vect_ptr_type, new_temp));
- vect_ptr_init = make_ssa_name (vect_ptr, vec_stmt);
- gimple_assign_set_lhs (vec_stmt, vect_ptr_init);
- if (pe)
+ if (TREE_CODE (new_temp) != SSA_NAME
+ || !useless_type_conversion_p (vect_ptr_type, TREE_TYPE (new_temp)))
{
- new_bb = gsi_insert_on_edge_immediate (pe, vec_stmt);
- gcc_assert (!new_bb);
+ vec_stmt = gimple_build_assign (vect_ptr,
+ fold_convert (vect_ptr_type, new_temp));
+ vect_ptr_init = make_ssa_name (vect_ptr, vec_stmt);
+ /* Copy the points-to information if it exists. */
+ if (DR_PTR_INFO (dr))
+ duplicate_ssa_name_ptr_info (vect_ptr_init, DR_PTR_INFO (dr));
+ gimple_assign_set_lhs (vec_stmt, vect_ptr_init);
+ if (pe)
+ {
+ new_bb = gsi_insert_on_edge_immediate (pe, vec_stmt);
+ gcc_assert (!new_bb);
+ }
+ else
+ gsi_insert_before (&gsi, vec_stmt, GSI_SAME_STMT);
}
else
- gsi_insert_before (&gsi, vec_stmt, GSI_SAME_STMT);
+ vect_ptr_init = new_temp;
/** (4) Handle the updating of the vector-pointer inside the loop.
This is needed when ONLY_INIT is false, and also when AT_LOOP
@@ -2673,12 +3065,7 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
/* No update in loop is required. */
if (only_init && (!loop_vinfo || at_loop == loop))
- {
- /* Copy the points-to information if it exists. */
- if (DR_PTR_INFO (dr))
- duplicate_ssa_name_ptr_info (vect_ptr_init, DR_PTR_INFO (dr));
- vptr = vect_ptr_init;
- }
+ vptr = vect_ptr_init;
else
{
/* The step of the vector pointer is the Vector Size. */
@@ -2857,9 +3244,9 @@ bool
vect_strided_store_supported (tree vectype)
{
optab interleave_high_optab, interleave_low_optab;
- int mode;
+ enum machine_mode mode;
- mode = (int) TYPE_MODE (vectype);
+ mode = TYPE_MODE (vectype);
/* Check that the operation is supported. */
interleave_high_optab = optab_for_tree_code (VEC_INTERLEAVE_HIGH_EXPR,
@@ -2873,10 +3260,8 @@ vect_strided_store_supported (tree vectype)
return false;
}
- if (optab_handler (interleave_high_optab, mode)->insn_code
- == CODE_FOR_nothing
- || optab_handler (interleave_low_optab, mode)->insn_code
- == CODE_FOR_nothing)
+ if (optab_handler (interleave_high_optab, mode) == CODE_FOR_nothing
+ || optab_handler (interleave_low_optab, mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "interleave op not supported by target.");
@@ -3081,6 +3466,7 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
edge pe;
tree scalar_dest = gimple_assign_lhs (stmt);
@@ -3181,7 +3567,17 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
vec_dest = vect_create_destination_var (scalar_dest, vectype);
ptr = vect_create_data_ref_ptr (stmt, loop_for_initial_load, NULL_TREE,
&init_addr, &inc, true, &inv_p);
- data_ref = build1 (ALIGN_INDIRECT_REF, vectype, ptr);
+ new_stmt = gimple_build_assign_with_ops
+ (BIT_AND_EXPR, NULL_TREE, ptr,
+ build_int_cst (TREE_TYPE (ptr),
+ -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
+ new_temp = make_ssa_name (SSA_NAME_VAR (ptr), new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);
+ gcc_assert (!new_bb);
+ data_ref
+ = build2 (MEM_REF, TREE_TYPE (vec_dest), new_temp,
+ build_int_cst (reference_alias_ptr_type (DR_REF (dr)), 0));
new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
@@ -3269,9 +3665,9 @@ bool
vect_strided_load_supported (tree vectype)
{
optab perm_even_optab, perm_odd_optab;
- int mode;
+ enum machine_mode mode;
- mode = (int) TYPE_MODE (vectype);
+ mode = TYPE_MODE (vectype);
perm_even_optab = optab_for_tree_code (VEC_EXTRACT_EVEN_EXPR, vectype,
optab_default);
@@ -3282,7 +3678,7 @@ vect_strided_load_supported (tree vectype)
return false;
}
- if (optab_handler (perm_even_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (perm_even_optab, mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "perm_even op not supported by target.");
@@ -3298,7 +3694,7 @@ vect_strided_load_supported (tree vectype)
return false;
}
- if (optab_handler (perm_odd_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (perm_odd_optab, mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "perm_odd op not supported by target.");
@@ -3561,13 +3957,16 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
return (alignment <= MAX_STACK_ALIGNMENT);
}
-/* Function vect_supportable_dr_alignment
- Return whether the data reference DR is supported with respect to its
+/* Return whether the data reference DR is supported with respect to its
+ alignment.
+ If CHECK_ALIGNED_ACCESSES is TRUE, check if the access is supported even
+ it is aligned, i.e., check if it is possible to vectorize it with different
alignment. */
enum dr_alignment_support
-vect_supportable_dr_alignment (struct data_reference *dr)
+vect_supportable_dr_alignment (struct data_reference *dr,
+ bool check_aligned_accesses)
{
gimple stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
@@ -3577,7 +3976,7 @@ vect_supportable_dr_alignment (struct data_reference *dr)
struct loop *vect_loop = NULL;
bool nested_in_vect_loop = false;
- if (aligned_access_p (dr))
+ if (aligned_access_p (dr) && !check_aligned_accesses)
return dr_aligned;
if (!loop_vinfo)
@@ -3655,8 +4054,7 @@ vect_supportable_dr_alignment (struct data_reference *dr)
bool is_packed = false;
tree type = (TREE_TYPE (DR_REF (dr)));
- if (optab_handler (vec_realign_load_optab, mode)->insn_code !=
- CODE_FOR_nothing
+ if (optab_handler (vec_realign_load_optab, mode) != CODE_FOR_nothing
&& (!targetm.vectorize.builtin_mask_for_load
|| targetm.vectorize.builtin_mask_for_load ()))
{
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 8b8a481992b..1fd29629e66 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -368,7 +368,7 @@ type_for_widest_vector_mode (enum machine_mode inner_mode, optab op, int satp)
for (; mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode))
if (GET_MODE_INNER (mode) == inner_mode
&& GET_MODE_NUNITS (mode) > best_nunits
- && optab_handler (op, mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (op, mode) != CODE_FOR_nothing)
best_mode = mode, best_nunits = GET_MODE_NUNITS (mode);
if (best_mode == VOIDmode)
@@ -443,8 +443,7 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
have a vector/vector shift */
op = optab_for_tree_code (code, type, optab_scalar);
if (!op
- || (op->handlers[(int) TYPE_MODE (type)].insn_code
- == CODE_FOR_nothing))
+ || optab_handler (op, TYPE_MODE (type)) == CODE_FOR_nothing)
op = optab_for_tree_code (code, type, optab_vector);
}
}
@@ -498,7 +497,7 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
|| GET_MODE_CLASS (compute_mode) == MODE_VECTOR_ACCUM
|| GET_MODE_CLASS (compute_mode) == MODE_VECTOR_UACCUM)
&& op != NULL
- && optab_handler (op, compute_mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (op, compute_mode) != CODE_FOR_nothing)
return;
else
/* There is no operation in hardware, so fall back to scalars. */
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index f8922a2308a..82f0a7867ac 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "cfgloop.h"
#include "cfglayout.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-scalar-evolution.h"
#include "tree-vectorizer.h"
@@ -1976,25 +1977,18 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters,
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int vectype_align = TYPE_ALIGN (vectype) / BITS_PER_UNIT;
tree niters_type = TREE_TYPE (loop_niters);
- int step = 1;
- int element_size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr))));
int nelements = TYPE_VECTOR_SUBPARTS (vectype);
- if (STMT_VINFO_STRIDED_ACCESS (stmt_info))
- step = DR_GROUP_SIZE (vinfo_for_stmt (DR_GROUP_FIRST_DR (stmt_info)));
-
pe = loop_preheader_edge (loop);
if (LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo) > 0)
{
- int byte_misalign = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
- int elem_misalign = byte_misalign / element_size;
+ int npeel = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "known alignment = %d.", byte_misalign);
+ fprintf (vect_dump, "known peeling = %d.", npeel);
- iters = build_int_cst (niters_type,
- (((nelements - elem_misalign) & (nelements - 1)) / step));
+ iters = build_int_cst (niters_type, npeel);
}
else
{
@@ -2017,7 +2011,8 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters,
/* Create: byte_misalign = addr & (vectype_size - 1) */
byte_misalign =
- fold_build2 (BIT_AND_EXPR, type, fold_convert (type, start_addr), vectype_size_minus_1);
+ fold_build2 (BIT_AND_EXPR, type, fold_convert (type, start_addr),
+ vectype_size_minus_1);
/* Create: elem_misalign = byte_misalign / element_size */
elem_misalign =
@@ -2323,7 +2318,8 @@ vect_vfa_segment_size (struct data_reference *dr, tree vect_factor)
tree segment_length = fold_build2 (MULT_EXPR, integer_type_node,
DR_STEP (dr), vect_factor);
- if (vect_supportable_dr_alignment (dr) == dr_explicit_realign_optimized)
+ if (vect_supportable_dr_alignment (dr, false)
+ == dr_explicit_realign_optimized)
{
tree vector_size = TYPE_SIZE_UNIT
(STMT_VINFO_VECTYPE (vinfo_for_stmt (DR_STMT (dr))));
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 3b387169408..49a8721c55d 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "optabs.h"
#include "params.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-chrec.h"
#include "tree-scalar-evolution.h"
@@ -132,7 +133,7 @@ along with GCC; see the file COPYING3. If not see
Since we only vectorize operations which vector form can be
expressed using existing tree codes, to verify that an operation is
supported, the vectorizer checks the relevant optab at the relevant
- machine_mode (e.g, optab_handler (add_optab, V8HImode)->insn_code). If
+ machine_mode (e.g, optab_handler (add_optab, V8HImode)). If
the value found is CODE_FOR_nothing, then there's no target support, and
we can't vectorize the stmt.
@@ -755,6 +756,7 @@ new_loop_vec_info (struct loop *loop)
LOOP_VINFO_REDUCTIONS (res) = VEC_alloc (gimple, heap, 10);
LOOP_VINFO_SLP_INSTANCES (res) = VEC_alloc (slp_instance, heap, 10);
LOOP_VINFO_SLP_UNROLLING_FACTOR (res) = 1;
+ LOOP_VINFO_PEELING_HTAB (res) = NULL;
return res;
}
@@ -845,6 +847,9 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
VEC_free (gimple, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo));
VEC_free (gimple, heap, LOOP_VINFO_REDUCTIONS (loop_vinfo));
+ if (LOOP_VINFO_PEELING_HTAB (loop_vinfo))
+ htab_delete (LOOP_VINFO_PEELING_HTAB (loop_vinfo));
+
free (loop_vinfo);
loop->aux = NULL;
}
@@ -1122,7 +1127,11 @@ vect_analyze_loop_form (struct loop *loop)
static inline
int vect_get_cost (enum vect_cost_for_stmt type_of_cost)
{
- return targetm.vectorize.builtin_vectorization_cost (type_of_cost);
+ tree dummy_type = NULL;
+ int dummy = 0;
+
+ return targetm.vectorize.builtin_vectorization_cost (type_of_cost,
+ dummy_type, dummy);
}
@@ -1498,17 +1507,6 @@ vect_analyze_loop (struct loop *loop)
return NULL;
}
- /* Check the SLP opportunities in the loop, analyze and build SLP trees. */
- ok = vect_analyze_slp (loop_vinfo, NULL);
- if (ok)
- {
- /* Decide which possible SLP instances to SLP. */
- vect_make_slp_decision (loop_vinfo);
-
- /* Find stmts that need to be both vectorized and SLPed. */
- vect_detect_hybrid_slp (loop_vinfo);
- }
-
/* This pass will decide on using loop versioning and/or loop peeling in
order to enhance the alignment of data references in the loop. */
@@ -1516,11 +1514,22 @@ vect_analyze_loop (struct loop *loop)
if (!ok)
{
if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "bad data alignment.");
+ fprintf (vect_dump, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo, true);
return NULL;
}
+ /* Check the SLP opportunities in the loop, analyze and build SLP trees. */
+ ok = vect_analyze_slp (loop_vinfo, NULL);
+ if (ok)
+ {
+ /* Decide which possible SLP instances to SLP. */
+ vect_make_slp_decision (loop_vinfo);
+
+ /* Find stmts that need to be both vectorized and SLPed. */
+ vect_detect_hybrid_slp (loop_vinfo);
+ }
+
/* Scan all the operations in the loop and make sure they are
vectorizable. */
@@ -2004,6 +2013,102 @@ vect_force_simple_reduction (loop_vec_info loop_info, gimple phi,
double_reduc, true);
}
+/* Calculate the cost of one scalar iteration of the loop. */
+int
+vect_get_single_scalar_iteraion_cost (loop_vec_info loop_vinfo)
+{
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
+ basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
+ int nbbs = loop->num_nodes, factor, scalar_single_iter_cost = 0;
+ int innerloop_iters, i, stmt_cost;
+
+ /* Count statements in scalar loop. Using this as scalar cost for a single
+ iteration for now.
+
+ TODO: Add outer loop support.
+
+ TODO: Consider assigning different costs to different scalar
+ statements. */
+
+ /* FORNOW. */
+ if (loop->inner)
+ innerloop_iters = 50; /* FIXME */
+
+ for (i = 0; i < nbbs; i++)
+ {
+ gimple_stmt_iterator si;
+ basic_block bb = bbs[i];
+
+ if (bb->loop_father == loop->inner)
+ factor = innerloop_iters;
+ else
+ factor = 1;
+
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
+ {
+ gimple stmt = gsi_stmt (si);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+
+ if (!is_gimple_assign (stmt) && !is_gimple_call (stmt))
+ continue;
+
+ /* Skip stmts that are not vectorized inside the loop. */
+ if (stmt_info
+ && !STMT_VINFO_RELEVANT_P (stmt_info)
+ && (!STMT_VINFO_LIVE_P (stmt_info)
+ || STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def))
+ continue;
+
+ if (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt)))
+ {
+ if (DR_IS_READ (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt))))
+ stmt_cost = vect_get_cost (scalar_load);
+ else
+ stmt_cost = vect_get_cost (scalar_store);
+ }
+ else
+ stmt_cost = vect_get_cost (scalar_stmt);
+
+ scalar_single_iter_cost += stmt_cost * factor;
+ }
+ }
+ return scalar_single_iter_cost;
+}
+
+/* Calculate cost of peeling the loop PEEL_ITERS_PROLOGUE times. */
+int
+vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
+ int *peel_iters_epilogue,
+ int scalar_single_iter_cost)
+{
+ int peel_guard_costs = 0;
+ int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
+
+ if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
+ {
+ *peel_iters_epilogue = vf/2;
+ if (vect_print_dump_info (REPORT_COST))
+ fprintf (vect_dump, "cost model: "
+ "epilogue peel iters set to vf/2 because "
+ "loop iterations are unknown .");
+
+ /* If peeled iterations are known but number of scalar loop
+ iterations are unknown, count a taken branch per peeled loop. */
+ peel_guard_costs = 2 * vect_get_cost (cond_branch_taken);
+ }
+ else
+ {
+ int niters = LOOP_VINFO_INT_NITERS (loop_vinfo);
+ peel_iters_prologue = niters < peel_iters_prologue ?
+ niters : peel_iters_prologue;
+ *peel_iters_epilogue = (niters - peel_iters_prologue) % vf;
+ }
+
+ return (peel_iters_prologue * scalar_single_iter_cost)
+ + (*peel_iters_epilogue * scalar_single_iter_cost)
+ + peel_guard_costs;
+}
+
/* Function vect_estimate_min_profitable_iters
Return the number of iterations required for the vector version of the
@@ -2028,7 +2133,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
int nbbs = loop->num_nodes;
- int byte_misalign = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
+ int npeel = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
int peel_guard_costs = 0;
int innerloop_iters = 0, factor;
VEC (slp_instance, heap) *slp_instances;
@@ -2099,7 +2204,6 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
&& (!STMT_VINFO_LIVE_P (stmt_info)
|| STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def))
continue;
- scalar_single_iter_cost += cost_for_stmt (stmt) * factor;
vec_inside_cost += STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info) * factor;
/* FIXME: for stmts in the inner-loop in outer-loop vectorization,
some of the "outside" costs are generated inside the outer-loop. */
@@ -2107,6 +2211,8 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
}
}
+ scalar_single_iter_cost = vect_get_single_scalar_iteraion_cost (loop_vinfo);
+
/* Add additional cost for the peeled instructions in prologue and epilogue
loop.
@@ -2116,7 +2222,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
TODO: Build an expression that represents peel_iters for prologue and
epilogue to be used in a run-time test. */
- if (byte_misalign < 0)
+ if (npeel < 0)
{
peel_iters_prologue = vf/2;
if (vect_print_dump_info (REPORT_COST))
@@ -2137,46 +2243,18 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
not known. Hence guards remain the same. */
peel_guard_costs += 2 * (vect_get_cost (cond_branch_taken)
+ vect_get_cost (cond_branch_not_taken));
+ vec_outside_cost += (peel_iters_prologue * scalar_single_iter_cost)
+ + (peel_iters_epilogue * scalar_single_iter_cost)
+ + peel_guard_costs;
}
else
{
- if (byte_misalign)
- {
- struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo);
- int element_size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr))));
- tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (DR_STMT (dr)));
- int nelements = TYPE_VECTOR_SUBPARTS (vectype);
-
- peel_iters_prologue = nelements - (byte_misalign / element_size);
- }
- else
- peel_iters_prologue = 0;
-
- if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
- {
- peel_iters_epilogue = vf/2;
- if (vect_print_dump_info (REPORT_COST))
- fprintf (vect_dump, "cost model: "
- "epilogue peel iters set to vf/2 because "
- "loop iterations are unknown .");
-
- /* If peeled iterations are known but number of scalar loop
- iterations are unknown, count a taken branch per peeled loop. */
- peel_guard_costs += 2 * vect_get_cost (cond_branch_taken);
- }
- else
- {
- int niters = LOOP_VINFO_INT_NITERS (loop_vinfo);
- peel_iters_prologue = niters < peel_iters_prologue ?
- niters : peel_iters_prologue;
- peel_iters_epilogue = (niters - peel_iters_prologue) % vf;
- }
+ peel_iters_prologue = npeel;
+ vec_outside_cost += vect_get_known_peeling_cost (loop_vinfo,
+ peel_iters_prologue, &peel_iters_epilogue,
+ scalar_single_iter_cost);
}
- vec_outside_cost += (peel_iters_prologue * scalar_single_iter_cost)
- + (peel_iters_epilogue * scalar_single_iter_cost)
- + peel_guard_costs;
-
/* FORNOW: The scalar outside cost is incremented in one of the
following ways:
@@ -2421,8 +2499,8 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, enum tree_code reduc_code,
/* We have a whole vector shift available. */
if (VECTOR_MODE_P (mode)
- && optab_handler (optab, mode)->insn_code != CODE_FOR_nothing
- && optab_handler (vec_shr_optab, mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (optab, mode) != CODE_FOR_nothing
+ && optab_handler (vec_shr_optab, mode) != CODE_FOR_nothing)
/* Final reduction via vector shifts and the reduction operator. Also
requires scalar extract. */
outer_cost += ((exact_log2(nelements) * 2)
@@ -2530,7 +2608,7 @@ get_initial_def_for_induction (gimple iv_phi)
if (INTEGRAL_TYPE_P (scalar_type))
step_expr = build_int_cst (scalar_type, 0);
else if (POINTER_TYPE_P (scalar_type))
- step_expr = build_int_cst (sizetype, 0);
+ step_expr = size_zero_node;
else
step_expr = build_real (scalar_type, dconst0);
@@ -3264,7 +3342,7 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
int vec_size_in_bits = tree_low_cst (TYPE_SIZE (vectype), 1);
tree vec_temp;
- if (optab_handler (vec_shr_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (vec_shr_optab, mode) != CODE_FOR_nothing)
shift_code = VEC_RSHIFT_EXPR;
else
have_whole_vector_shift = false;
@@ -3280,7 +3358,7 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
else
{
optab optab = optab_for_tree_code (code, vectype, optab_default);
- if (optab_handler (optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (optab, mode) == CODE_FOR_nothing)
have_whole_vector_shift = false;
}
@@ -3939,7 +4017,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
return false;
}
- if (optab_handler (optab, vec_mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (optab, vec_mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "op not supported by target.");
@@ -3987,11 +4065,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
2. The type (mode) we use to check available target support
for the vector operation to be created in the *epilog*, is
determined by the type of the reduction variable (in the example
- above we'd check this: plus_optab[vect_int_mode]).
+ above we'd check this: optab_handler (plus_optab, vect_int_mode])).
However the type (mode) we use to check available target support
for the vector operation to be created *inside the loop*, is
determined by the type of the other arguments to STMT (in the
- example we'd check this: widen_sum_optab[vect_short_mode]).
+ example we'd check this: optab_handler (widen_sum_optab,
+ vect_short_mode)).
This is contrary to "regular" reductions, in which the types of all
the arguments are the same as the type of the reduction variable.
@@ -4044,8 +4123,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
}
if (reduc_optab
- && optab_handler (reduc_optab, vec_mode)->insn_code
- == CODE_FOR_nothing)
+ && optab_handler (reduc_optab, vec_mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "reduc op not supported by target.");
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 5ba2fa508d6..19f0ae67a88 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
#include "tree-vectorizer.h"
#include "recog.h"
+#include "diagnostic-core.h"
#include "toplev.h"
/* Function prototypes */
@@ -714,8 +715,7 @@ vect_pattern_recog_1 (
optab = optab_for_tree_code (code, type_in, optab_default);
vec_mode = TYPE_MODE (type_in);
if (!optab
- || (icode = optab_handler (optab, vec_mode)->insn_code) ==
- CODE_FOR_nothing
+ || (icode = optab_handler (optab, vec_mode)) == CODE_FOR_nothing
|| (insn_data[icode].operand[0].mode != TYPE_MODE (type_out)))
return;
}
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 5f753a26935..6b377a8842a 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -421,8 +421,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
optab_vector);
if (!optab
- || (optab->handlers[(int) vec_mode].insn_code
- == CODE_FOR_nothing))
+ || optab_handler (optab, vec_mode) == CODE_FOR_nothing)
{
/* No vector/vector shift, try for a vector/scalar shift. */
optab = optab_for_tree_code (rhs_code, vectype,
@@ -434,7 +433,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
fprintf (vect_dump, "Build SLP failed: no optab.");
return false;
}
- icode = (int) optab->handlers[(int) vec_mode].insn_code;
+ icode = (int) optab_handler (optab, vec_mode);
if (icode == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_SLP))
@@ -560,7 +559,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (first_load == stmt)
{
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt));
- if (vect_supportable_dr_alignment (first_dr)
+ if (vect_supportable_dr_alignment (first_dr, false)
== dr_unaligned_unsupported)
{
if (vect_print_dump_info (REPORT_SLP))
@@ -646,7 +645,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
{
VEC_safe_push (slp_tree, heap, *loads, *node);
*inside_cost
- += targetm.vectorize.builtin_vectorization_cost (vec_perm)
+ += targetm.vectorize.builtin_vectorization_cost (vec_perm, NULL, 0)
* group_size;
}
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index eded879eb38..e0ae55904da 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "recog.h"
#include "optabs.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-vectorizer.h"
#include "langhooks.h"
@@ -545,6 +546,18 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
}
+/* Get cost by calling cost target builtin. */
+
+static inline
+int vect_get_stmt_cost (enum vect_cost_for_stmt type_of_cost)
+{
+ tree dummy_type = NULL;
+ int dummy = 0;
+
+ return targetm.vectorize.builtin_vectorization_cost (type_of_cost,
+ dummy_type, dummy);
+}
+
int
cost_for_stmt (gimple stmt)
{
@@ -553,9 +566,9 @@ cost_for_stmt (gimple stmt)
switch (STMT_VINFO_TYPE (stmt_info))
{
case load_vec_info_type:
- return targetm.vectorize.builtin_vectorization_cost (scalar_load);
+ return vect_get_stmt_cost (scalar_load);
case store_vec_info_type:
- return targetm.vectorize.builtin_vectorization_cost (scalar_store);
+ return vect_get_stmt_cost (scalar_store);
case op_vec_info_type:
case condition_vec_info_type:
case assignment_vec_info_type:
@@ -565,7 +578,7 @@ cost_for_stmt (gimple stmt)
case type_demotion_vec_info_type:
case type_conversion_vec_info_type:
case call_vec_info_type:
- return targetm.vectorize.builtin_vectorization_cost (scalar_stmt);
+ return vect_get_stmt_cost (scalar_stmt);
case undef_vec_info_type:
default:
gcc_unreachable ();
@@ -589,15 +602,13 @@ vect_model_simple_cost (stmt_vec_info stmt_info, int ncopies,
if (PURE_SLP_STMT (stmt_info))
return;
- inside_cost = ncopies
- * targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ inside_cost = ncopies * vect_get_stmt_cost (vector_stmt);
/* FORNOW: Assuming maximum 2 args per stmts. */
for (i = 0; i < 2; i++)
{
if (dt[i] == vect_constant_def || dt[i] == vect_external_def)
- outside_cost
- += targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ outside_cost += vect_get_stmt_cost (vector_stmt);
}
if (vect_print_dump_info (REPORT_COST))
@@ -638,22 +649,39 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
enum vect_def_type dt, slp_tree slp_node)
{
int group_size;
- int inside_cost = 0, outside_cost = 0;
+ unsigned int inside_cost = 0, outside_cost = 0;
+ struct data_reference *first_dr;
+ gimple first_stmt;
/* The SLP costs were already calculated during SLP tree build. */
if (PURE_SLP_STMT (stmt_info))
return;
if (dt == vect_constant_def || dt == vect_external_def)
- outside_cost
- = targetm.vectorize.builtin_vectorization_cost (scalar_to_vec);
+ outside_cost = vect_get_stmt_cost (scalar_to_vec);
/* Strided access? */
- if (DR_GROUP_FIRST_DR (stmt_info) && !slp_node)
- group_size = vect_cost_strided_group_size (stmt_info);
+ if (DR_GROUP_FIRST_DR (stmt_info))
+ {
+ if (slp_node)
+ {
+ first_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0);
+ group_size = 1;
+ }
+ else
+ {
+ first_stmt = DR_GROUP_FIRST_DR (stmt_info);
+ group_size = vect_cost_strided_group_size (stmt_info);
+ }
+
+ first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
+ }
/* Not a strided access. */
else
- group_size = 1;
+ {
+ group_size = 1;
+ first_dr = STMT_VINFO_DATA_REF (stmt_info);
+ }
/* Is this an access in a group of stores, which provide strided access?
If so, add in the cost of the permutes. */
@@ -661,7 +689,7 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
{
/* Uses a high and low interleave operation for each needed permute. */
inside_cost = ncopies * exact_log2(group_size) * group_size
- * targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ * vect_get_stmt_cost (vector_stmt);
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_model_store_cost: strided group_size = %d .",
@@ -670,8 +698,7 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
}
/* Costs of the stores. */
- inside_cost += ncopies
- * targetm.vectorize.builtin_vectorization_cost (vector_store);
+ vect_get_store_cost (first_dr, ncopies, &inside_cost);
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_model_store_cost: inside_cost = %d, "
@@ -683,6 +710,49 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
}
+/* Calculate cost of DR's memory access. */
+void
+vect_get_store_cost (struct data_reference *dr, int ncopies,
+ unsigned int *inside_cost)
+{
+ int alignment_support_scheme = vect_supportable_dr_alignment (dr, false);
+
+ switch (alignment_support_scheme)
+ {
+ case dr_aligned:
+ {
+ *inside_cost += ncopies * vect_get_stmt_cost (vector_store);
+
+ if (vect_print_dump_info (REPORT_COST))
+ fprintf (vect_dump, "vect_model_store_cost: aligned.");
+
+ break;
+ }
+
+ case dr_unaligned_supported:
+ {
+ gimple stmt = DR_STMT (dr);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+
+ /* Here, we assign an additional cost for the unaligned store. */
+ *inside_cost += ncopies
+ * targetm.vectorize.builtin_vectorization_cost (unaligned_store,
+ vectype, DR_MISALIGNMENT (dr));
+
+ if (vect_print_dump_info (REPORT_COST))
+ fprintf (vect_dump, "vect_model_store_cost: unaligned supported by "
+ "hardware.");
+
+ break;
+ }
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
+
/* Function vect_model_load_cost
Models cost for loads. In the case of strided accesses, the last access
@@ -695,10 +765,9 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
{
int group_size;
- int alignment_support_cheme;
gimple first_stmt;
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr;
- int inside_cost = 0, outside_cost = 0;
+ unsigned int inside_cost = 0, outside_cost = 0;
/* The SLP costs were already calculated during SLP tree build. */
if (PURE_SLP_STMT (stmt_info))
@@ -718,29 +787,47 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
first_dr = dr;
}
- alignment_support_cheme = vect_supportable_dr_alignment (first_dr);
-
/* Is this an access in a group of loads providing strided access?
If so, add in the cost of the permutes. */
if (group_size > 1)
{
/* Uses an even and odd extract operations for each needed permute. */
inside_cost = ncopies * exact_log2(group_size) * group_size
- * targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ * vect_get_stmt_cost (vector_stmt);
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_model_load_cost: strided group_size = %d .",
group_size);
-
}
/* The loads themselves. */
- switch (alignment_support_cheme)
+ vect_get_load_cost (first_dr, ncopies,
+ ((!DR_GROUP_FIRST_DR (stmt_info)) || group_size > 1 || slp_node),
+ &inside_cost, &outside_cost);
+
+ if (vect_print_dump_info (REPORT_COST))
+ fprintf (vect_dump, "vect_model_load_cost: inside_cost = %d, "
+ "outside_cost = %d .", inside_cost, outside_cost);
+
+ /* Set the costs either in STMT_INFO or SLP_NODE (if exists). */
+ stmt_vinfo_set_inside_of_loop_cost (stmt_info, slp_node, inside_cost);
+ stmt_vinfo_set_outside_of_loop_cost (stmt_info, slp_node, outside_cost);
+}
+
+
+/* Calculate cost of DR's memory access. */
+void
+vect_get_load_cost (struct data_reference *dr, int ncopies,
+ bool add_realign_cost, unsigned int *inside_cost,
+ unsigned int *outside_cost)
+{
+ int alignment_support_scheme = vect_supportable_dr_alignment (dr, false);
+
+ switch (alignment_support_scheme)
{
case dr_aligned:
{
- inside_cost += ncopies
- * targetm.vectorize.builtin_vectorization_cost (vector_load);
+ *inside_cost += ncopies * vect_get_stmt_cost (vector_load);
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_model_load_cost: aligned.");
@@ -749,10 +836,14 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
}
case dr_unaligned_supported:
{
- /* Here, we assign an additional cost for the unaligned load. */
- inside_cost += ncopies
- * targetm.vectorize.builtin_vectorization_cost (unaligned_load);
+ gimple stmt = DR_STMT (dr);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+ /* Here, we assign an additional cost for the unaligned load. */
+ *inside_cost += ncopies
+ * targetm.vectorize.builtin_vectorization_cost (unaligned_load,
+ vectype, DR_MISALIGNMENT (dr));
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_model_load_cost: unaligned supported by "
"hardware.");
@@ -761,16 +852,14 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
}
case dr_explicit_realign:
{
- inside_cost += ncopies * (2
- * targetm.vectorize.builtin_vectorization_cost (vector_load)
- + targetm.vectorize.builtin_vectorization_cost (vector_stmt));
+ *inside_cost += ncopies * (2 * vect_get_stmt_cost (vector_load)
+ + vect_get_stmt_cost (vector_stmt));
/* FIXME: If the misalignment remains fixed across the iterations of
the containing loop, the following cost should be added to the
outside costs. */
if (targetm.vectorize.builtin_mask_for_load)
- inside_cost
- += targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ *inside_cost += vect_get_stmt_cost (vector_stmt);
break;
}
@@ -787,32 +876,21 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
access in the group. Inside the loop, there is a load op
and a realignment op. */
- if ((!DR_GROUP_FIRST_DR (stmt_info)) || group_size > 1 || slp_node)
+ if (add_realign_cost)
{
- outside_cost = 2
- * targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ *outside_cost = 2 * vect_get_stmt_cost (vector_stmt);
if (targetm.vectorize.builtin_mask_for_load)
- outside_cost
- += targetm.vectorize.builtin_vectorization_cost (vector_stmt);
+ *outside_cost += vect_get_stmt_cost (vector_stmt);
}
- inside_cost += ncopies
- * (targetm.vectorize.builtin_vectorization_cost (vector_load)
- + targetm.vectorize.builtin_vectorization_cost (vector_stmt));
+ *inside_cost += ncopies * (vect_get_stmt_cost (vector_load)
+ + vect_get_stmt_cost (vector_stmt));
break;
}
default:
gcc_unreachable ();
}
-
- if (vect_print_dump_info (REPORT_COST))
- fprintf (vect_dump, "vect_model_load_cost: inside_cost = %d, "
- "outside_cost = %d .", inside_cost, outside_cost);
-
- /* Set the costs either in STMT_INFO or SLP_NODE (if exists). */
- stmt_vinfo_set_inside_of_loop_cost (stmt_info, slp_node, inside_cost);
- stmt_vinfo_set_outside_of_loop_cost (stmt_info, slp_node, outside_cost);
}
@@ -2104,8 +2182,7 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
{
optab = optab_for_tree_code (code, vectype, optab_scalar);
if (optab
- && (optab_handler (optab, TYPE_MODE (vectype))->insn_code
- != CODE_FOR_nothing))
+ && optab_handler (optab, TYPE_MODE (vectype)) != CODE_FOR_nothing)
{
scalar_shift_arg = true;
if (vect_print_dump_info (REPORT_DETAILS))
@@ -2115,7 +2192,7 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
{
optab = optab_for_tree_code (code, vectype, optab_vector);
if (optab
- && (optab_handler (optab, TYPE_MODE (vectype))->insn_code
+ && (optab_handler (optab, TYPE_MODE (vectype))
!= CODE_FOR_nothing))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -2149,7 +2226,7 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
return false;
}
vec_mode = TYPE_MODE (vectype);
- icode = (int) optab_handler (optab, vec_mode)->insn_code;
+ icode = (int) optab_handler (optab, vec_mode);
if (icode == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3026,7 +3103,8 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
&& TREE_CODE (scalar_dest) != INDIRECT_REF
&& TREE_CODE (scalar_dest) != COMPONENT_REF
&& TREE_CODE (scalar_dest) != IMAGPART_EXPR
- && TREE_CODE (scalar_dest) != REALPART_EXPR)
+ && TREE_CODE (scalar_dest) != REALPART_EXPR
+ && TREE_CODE (scalar_dest) != MEM_REF)
return false;
gcc_assert (gimple_assign_single_p (stmt));
@@ -3050,7 +3128,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
vec_mode = TYPE_MODE (vectype);
/* FORNOW. In some cases can vectorize even if data-type not supported
(e.g. - array initialization with 0). */
- if (optab_handler (mov_optab, (int)vec_mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (mov_optab, vec_mode) == CODE_FOR_nothing)
return false;
if (!STMT_VINFO_DATA_REF (stmt_info))
@@ -3141,7 +3219,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
dr_chain = VEC_alloc (tree, heap, group_size);
oprnds = VEC_alloc (tree, heap, group_size);
- alignment_support_scheme = vect_supportable_dr_alignment (first_dr);
+ alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
gcc_assert (alignment_support_scheme);
/* In case the vectorization factor (VF) is bigger than the number
@@ -3282,7 +3360,10 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
vec_oprnd = VEC_index (tree, result_chain, i);
if (aligned_access_p (first_dr))
- data_ref = build_fold_indirect_ref (dataref_ptr);
+ data_ref
+ = build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr,
+ build_int_cst (reference_alias_ptr_type
+ (DR_REF (first_dr)), 0));
else
{
int mis = DR_MISALIGNMENT (first_dr);
@@ -3291,11 +3372,6 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
data_ref = build2 (MISALIGNED_INDIRECT_REF, vectype, dataref_ptr, tmis);
}
- /* If accesses through a pointer to vectype do not alias the original
- memory reference we have a problem. This should never happen. */
- gcc_assert (alias_sets_conflict_p (get_alias_set (data_ref),
- get_alias_set (gimple_assign_lhs (stmt))));
-
/* Arguments are ready. Create the new vector stmt. */
new_stmt = gimple_build_assign (data_ref, vec_oprnd);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
@@ -3348,7 +3424,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree new_temp;
- int mode;
+ enum machine_mode mode;
gimple new_stmt = NULL;
tree dummy;
enum dr_alignment_support alignment_support_scheme;
@@ -3421,18 +3497,19 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
&& code != INDIRECT_REF
&& code != COMPONENT_REF
&& code != IMAGPART_EXPR
- && code != REALPART_EXPR)
+ && code != REALPART_EXPR
+ && code != MEM_REF)
return false;
if (!STMT_VINFO_DATA_REF (stmt_info))
return false;
scalar_type = TREE_TYPE (DR_REF (dr));
- mode = (int) TYPE_MODE (vectype);
+ mode = TYPE_MODE (vectype);
/* FORNOW. In some cases can vectorize even if data-type not supported
(e.g. - data copies). */
- if (optab_handler (mov_optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (mov_optab, mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "Aligned load, but unsupported type.");
@@ -3505,7 +3582,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
group_size = vec_num = 1;
}
- alignment_support_scheme = vect_supportable_dr_alignment (first_dr);
+ alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
gcc_assert (alignment_support_scheme);
/* In case the vectorization factor (VF) is bigger than the number
@@ -3659,7 +3736,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{
case dr_aligned:
gcc_assert (aligned_access_p (first_dr));
- data_ref = build_fold_indirect_ref (dataref_ptr);
+ data_ref
+ = build2 (MEM_REF, vectype, dataref_ptr,
+ build_int_cst (reference_alias_ptr_type
+ (DR_REF (first_dr)), 0));
break;
case dr_unaligned_supported:
{
@@ -3682,7 +3762,18 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
dr_explicit_realign,
dataref_ptr, NULL);
- data_ref = build1 (ALIGN_INDIRECT_REF, vectype, dataref_ptr);
+ new_stmt = gimple_build_assign_with_ops
+ (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
+ build_int_cst
+ (TREE_TYPE (dataref_ptr),
+ -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
+ ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
+ gimple_assign_set_lhs (new_stmt, ptr);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ data_ref
+ = build2 (MEM_REF, vectype, ptr,
+ build_int_cst (reference_alias_ptr_type
+ (DR_REF (first_dr)), 0));
vec_dest = vect_create_destination_var (scalar_dest, vectype);
new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
@@ -3695,19 +3786,37 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
bump = size_binop (MULT_EXPR, vs_minus_1,
TYPE_SIZE_UNIT (scalar_type));
ptr = bump_vector_ptr (dataref_ptr, NULL, gsi, stmt, bump);
- data_ref = build1 (ALIGN_INDIRECT_REF, vectype, ptr);
+ new_stmt = gimple_build_assign_with_ops
+ (BIT_AND_EXPR, NULL_TREE, ptr,
+ build_int_cst
+ (TREE_TYPE (ptr),
+ -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
+ ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
+ gimple_assign_set_lhs (new_stmt, ptr);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ data_ref
+ = build2 (MEM_REF, vectype, ptr,
+ build_int_cst (reference_alias_ptr_type
+ (DR_REF (first_dr)), 0));
break;
}
case dr_explicit_realign_optimized:
- data_ref = build1 (ALIGN_INDIRECT_REF, vectype, dataref_ptr);
+ new_stmt = gimple_build_assign_with_ops
+ (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
+ build_int_cst
+ (TREE_TYPE (dataref_ptr),
+ -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
+ new_temp = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ data_ref
+ = build2 (MEM_REF, vectype, new_temp,
+ build_int_cst (reference_alias_ptr_type
+ (DR_REF (first_dr)), 0));
break;
default:
gcc_unreachable ();
}
- /* If accesses through a pointer to vectype do not alias the original
- memory reference we have a problem. This should never happen. */
- gcc_assert (alias_sets_conflict_p (get_alias_set (data_ref),
- get_alias_set (gimple_assign_rhs1 (stmt))));
vec_dest = vect_create_destination_var (scalar_dest, vectype);
new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
@@ -4884,9 +4993,8 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
return false;
vec_mode = TYPE_MODE (vectype);
- if ((icode1 = optab_handler (optab1, vec_mode)->insn_code) == CODE_FOR_nothing
- || (icode2 = optab_handler (optab2, vec_mode)->insn_code)
- == CODE_FOR_nothing)
+ if ((icode1 = optab_handler (optab1, vec_mode)) == CODE_FOR_nothing
+ || (icode2 = optab_handler (optab2, vec_mode)) == CODE_FOR_nothing)
return false;
/* Check if it's a multi-step conversion that can be done using intermediate
@@ -4918,16 +5026,16 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
optab4 = optab_for_tree_code (c2, intermediate_type, optab_default);
if (!optab3 || !optab4
- || (icode1 = optab1->handlers[(int) prev_mode].insn_code)
- == CODE_FOR_nothing
+ || ((icode1 = optab_handler (optab1, prev_mode))
+ == CODE_FOR_nothing)
|| insn_data[icode1].operand[0].mode != intermediate_mode
- || (icode2 = optab2->handlers[(int) prev_mode].insn_code)
- == CODE_FOR_nothing
+ || ((icode2 = optab_handler (optab2, prev_mode))
+ == CODE_FOR_nothing)
|| insn_data[icode2].operand[0].mode != intermediate_mode
- || (icode1 = optab3->handlers[(int) intermediate_mode].insn_code)
- == CODE_FOR_nothing
- || (icode2 = optab4->handlers[(int) intermediate_mode].insn_code)
- == CODE_FOR_nothing)
+ || ((icode1 = optab_handler (optab3, intermediate_mode))
+ == CODE_FOR_nothing)
+ || ((icode2 = optab_handler (optab4, intermediate_mode))
+ == CODE_FOR_nothing))
return false;
VEC_quick_push (tree, *interm_types, intermediate_type);
@@ -5014,8 +5122,7 @@ supportable_narrowing_operation (enum tree_code code,
return false;
vec_mode = TYPE_MODE (vectype);
- if ((icode1 = optab_handler (optab1, vec_mode)->insn_code)
- == CODE_FOR_nothing)
+ if ((icode1 = optab_handler (optab1, vec_mode)) == CODE_FOR_nothing)
return false;
/* Check if it's a multi-step conversion that can be done using intermediate
@@ -5038,12 +5145,11 @@ supportable_narrowing_operation (enum tree_code code,
interm_optab = optab_for_tree_code (c1, intermediate_type,
optab_default);
if (!interm_optab
- || (icode1 = optab1->handlers[(int) prev_mode].insn_code)
- == CODE_FOR_nothing
+ || ((icode1 = optab_handler (optab1, prev_mode))
+ == CODE_FOR_nothing)
|| insn_data[icode1].operand[0].mode != intermediate_mode
- || (icode1
- = interm_optab->handlers[(int) intermediate_mode].insn_code)
- == CODE_FOR_nothing)
+ || ((icode1 = optab_handler (interm_optab, intermediate_mode))
+ == CODE_FOR_nothing))
return false;
VEC_quick_push (tree, *interm_types, intermediate_type);
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index bf6769c69a7..ed8ff58312a 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -170,6 +170,21 @@ DEF_VEC_ALLOC_P(slp_instance, heap);
#define SLP_TREE_OUTSIDE_OF_LOOP_COST(S) (S)->cost.outside_of_loop
#define SLP_TREE_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop
+
+typedef struct _vect_peel_info
+{
+ int npeel;
+ struct data_reference *dr;
+ unsigned int count;
+} *vect_peel_info;
+
+typedef struct _vect_peel_extended_info
+{
+ struct _vect_peel_info peel_info;
+ unsigned int inside_cost;
+ unsigned int outside_cost;
+} *vect_peel_extended_info;
+
/*-----------------------------------------------------------------*/
/* Info on vectorized loops. */
/*-----------------------------------------------------------------*/
@@ -245,6 +260,10 @@ typedef struct _loop_vec_info {
/* Reduction cycles detected in the loop. Used in loop-aware SLP. */
VEC (gimple, heap) *reductions;
+
+ /* Hash table used to choose the best peeling option. */
+ htab_t peeling_htab;
+
} *loop_vec_info;
/* Access Functions. */
@@ -270,6 +289,7 @@ typedef struct _loop_vec_info {
#define LOOP_VINFO_SLP_INSTANCES(L) (L)->slp_instances
#define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor
#define LOOP_VINFO_REDUCTIONS(L) (L)->reductions
+#define LOOP_VINFO_PEELING_HTAB(L) (L)->peeling_htab
#define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
VEC_length (gimple, (L)->may_misalign_stmts) > 0
@@ -543,6 +563,8 @@ typedef struct _stmt_vec_info {
#define PURE_SLP_STMT(S) ((S)->slp_type == pure_slp)
#define STMT_SLP_TYPE(S) (S)->slp_type
+#define VECT_MAX_COST 1000
+
/* The maximum number of intermediate steps required in multi-step type
conversion. */
#define MAX_INTERM_CVT_STEPS 3
@@ -743,11 +765,14 @@ extern void vect_remove_stores (gimple);
extern bool vect_analyze_stmt (gimple, bool *, slp_tree);
extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *,
tree, int);
+extern void vect_get_load_cost (struct data_reference *, int, bool,
+ unsigned int *, unsigned int *);
+extern void vect_get_store_cost (struct data_reference *, int, unsigned int *);
/* In tree-vect-data-refs.c. */
extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
extern enum dr_alignment_support vect_supportable_dr_alignment
- (struct data_reference *);
+ (struct data_reference *, bool);
extern tree vect_get_smallest_scalar_type (gimple, HOST_WIDE_INT *,
HOST_WIDE_INT *);
extern bool vect_analyze_data_ref_dependences (loop_vec_info, bb_vec_info,
@@ -795,7 +820,8 @@ extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *);
extern int vect_estimate_min_profitable_iters (loop_vec_info);
extern tree get_initial_def_for_reduction (gimple, tree, tree *);
extern int vect_min_worthwhile_factor (enum tree_code);
-
+extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, int);
+extern int vect_get_single_scalar_iteraion_cost (loop_vec_info);
/* In tree-vect-slp.c. */
extern void vect_free_slp_instance (slp_instance);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 3da2dc84e9d..fbb549febd5 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "tree-pretty-print.h"
#include "gimple-pretty-print.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "intl.h"
#include "cfgloop.h"
@@ -336,7 +337,7 @@ nonnull_arg_p (const_tree arg)
/* Get the position number for ARG in the function signature. */
for (arg_num = 1, t = DECL_ARGUMENTS (current_function_decl);
t;
- t = TREE_CHAIN (t), arg_num++)
+ t = DECL_CHAIN (t), arg_num++)
{
if (t == arg)
break;
@@ -987,7 +988,7 @@ vrp_stmt_computes_nonzero (gimple stmt, bool *strict_overflow_p)
tree base = get_base_address (TREE_OPERAND (expr, 0));
if (base != NULL_TREE
- && TREE_CODE (base) == INDIRECT_REF
+ && TREE_CODE (base) == MEM_REF
&& TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME)
{
value_range_t *vr = get_value_range (TREE_OPERAND (base, 0));
@@ -2063,6 +2064,60 @@ vrp_int_const_binop (enum tree_code code, tree val1, tree val2)
}
+/* For range VR compute two double_int bitmasks. In *MAY_BE_NONZERO
+ bitmask if some bit is unset, it means for all numbers in the range
+ the bit is 0, otherwise it might be 0 or 1. In *MUST_BE_NONZERO
+ bitmask if some bit is set, it means for all numbers in the range
+ the bit is 1, otherwise it might be 0 or 1. */
+
+static bool
+zero_nonzero_bits_from_vr (value_range_t *vr, double_int *may_be_nonzero,
+ double_int *must_be_nonzero)
+{
+ if (range_int_cst_p (vr))
+ {
+ if (range_int_cst_singleton_p (vr))
+ {
+ *may_be_nonzero = tree_to_double_int (vr->min);
+ *must_be_nonzero = *may_be_nonzero;
+ return true;
+ }
+ if (tree_int_cst_sgn (vr->min) >= 0)
+ {
+ double_int dmin = tree_to_double_int (vr->min);
+ double_int dmax = tree_to_double_int (vr->max);
+ double_int xor_mask = double_int_xor (dmin, dmax);
+ *may_be_nonzero = double_int_ior (dmin, dmax);
+ *must_be_nonzero = double_int_and (dmin, dmax);
+ if (xor_mask.high != 0)
+ {
+ unsigned HOST_WIDE_INT mask
+ = ((unsigned HOST_WIDE_INT) 1
+ << floor_log2 (xor_mask.high)) - 1;
+ may_be_nonzero->low = ALL_ONES;
+ may_be_nonzero->high |= mask;
+ must_be_nonzero->low = 0;
+ must_be_nonzero->high &= ~mask;
+ }
+ else if (xor_mask.low != 0)
+ {
+ unsigned HOST_WIDE_INT mask
+ = ((unsigned HOST_WIDE_INT) 1
+ << floor_log2 (xor_mask.low)) - 1;
+ may_be_nonzero->low |= mask;
+ must_be_nonzero->low &= ~mask;
+ }
+ return true;
+ }
+ }
+ may_be_nonzero->low = ALL_ONES;
+ may_be_nonzero->high = ALL_ONES;
+ must_be_nonzero->low = 0;
+ must_be_nonzero->high = 0;
+ return false;
+}
+
+
/* Extract range information from a binary expression EXPR based on
the ranges of each of its operands and the expression code. */
@@ -2188,15 +2243,30 @@ extract_range_from_binary_expr (value_range_t *vr,
return;
}
- gcc_assert (code == POINTER_PLUS_EXPR);
- /* For pointer types, we are really only interested in asserting
- whether the expression evaluates to non-NULL. */
- if (range_is_nonnull (&vr0) || range_is_nonnull (&vr1))
- set_value_range_to_nonnull (vr, expr_type);
- else if (range_is_null (&vr0) && range_is_null (&vr1))
- set_value_range_to_null (vr, expr_type);
+ if (code == POINTER_PLUS_EXPR)
+ {
+ /* For pointer types, we are really only interested in asserting
+ whether the expression evaluates to non-NULL. */
+ if (range_is_nonnull (&vr0) || range_is_nonnull (&vr1))
+ set_value_range_to_nonnull (vr, expr_type);
+ else if (range_is_null (&vr0) && range_is_null (&vr1))
+ set_value_range_to_null (vr, expr_type);
+ else
+ set_value_range_to_varying (vr);
+ }
+ else if (code == BIT_AND_EXPR)
+ {
+ /* For pointer types, we are really only interested in asserting
+ whether the expression evaluates to non-NULL. */
+ if (range_is_nonnull (&vr0) && range_is_nonnull (&vr1))
+ set_value_range_to_nonnull (vr, expr_type);
+ else if (range_is_null (&vr0) || range_is_null (&vr1))
+ set_value_range_to_null (vr, expr_type);
+ else
+ set_value_range_to_varying (vr);
+ }
else
- set_value_range_to_varying (vr);
+ gcc_unreachable ();
return;
}
@@ -2553,68 +2623,79 @@ extract_range_from_binary_expr (value_range_t *vr,
min = vrp_int_const_binop (code, vr0.min, vr1.max);
max = vrp_int_const_binop (code, vr0.max, vr1.min);
}
- else if (code == BIT_AND_EXPR)
+ else if (code == BIT_AND_EXPR || code == BIT_IOR_EXPR)
{
bool vr0_int_cst_singleton_p, vr1_int_cst_singleton_p;
+ bool int_cst_range0, int_cst_range1;
+ double_int may_be_nonzero0, may_be_nonzero1;
+ double_int must_be_nonzero0, must_be_nonzero1;
vr0_int_cst_singleton_p = range_int_cst_singleton_p (&vr0);
vr1_int_cst_singleton_p = range_int_cst_singleton_p (&vr1);
+ int_cst_range0 = zero_nonzero_bits_from_vr (&vr0, &may_be_nonzero0,
+ &must_be_nonzero0);
+ int_cst_range1 = zero_nonzero_bits_from_vr (&vr1, &may_be_nonzero1,
+ &must_be_nonzero1);
+ type = VR_RANGE;
if (vr0_int_cst_singleton_p && vr1_int_cst_singleton_p)
min = max = int_const_binop (code, vr0.max, vr1.max, 0);
- else if (vr0_int_cst_singleton_p
- && tree_int_cst_sgn (vr0.max) >= 0)
- {
- min = build_int_cst (expr_type, 0);
- max = vr0.max;
- }
- else if (vr1_int_cst_singleton_p
- && tree_int_cst_sgn (vr1.max) >= 0)
- {
- type = VR_RANGE;
- min = build_int_cst (expr_type, 0);
- max = vr1.max;
- }
- else
+ else if (!int_cst_range0 && !int_cst_range1)
{
set_value_range_to_varying (vr);
return;
}
- }
- else if (code == BIT_IOR_EXPR)
- {
- if (range_int_cst_p (&vr0)
- && range_int_cst_p (&vr1)
- && tree_int_cst_sgn (vr0.min) >= 0
- && tree_int_cst_sgn (vr1.min) >= 0)
- {
- double_int vr0_max = tree_to_double_int (vr0.max);
- double_int vr1_max = tree_to_double_int (vr1.max);
- double_int ior_max;
-
- /* Set all bits to the right of the most significant one to 1.
- For example, [0, 4] | [4, 4] = [4, 7]. */
- ior_max.low = vr0_max.low | vr1_max.low;
- ior_max.high = vr0_max.high | vr1_max.high;
- if (ior_max.high != 0)
+ else if (code == BIT_AND_EXPR)
+ {
+ min = double_int_to_tree (expr_type,
+ double_int_and (must_be_nonzero0,
+ must_be_nonzero1));
+ max = double_int_to_tree (expr_type,
+ double_int_and (may_be_nonzero0,
+ may_be_nonzero1));
+ if (TREE_OVERFLOW (min) || tree_int_cst_sgn (min) < 0)
+ min = NULL_TREE;
+ if (TREE_OVERFLOW (max) || tree_int_cst_sgn (max) < 0)
+ max = NULL_TREE;
+ if (int_cst_range0 && tree_int_cst_sgn (vr0.min) >= 0)
{
- ior_max.low = ~(unsigned HOST_WIDE_INT)0u;
- ior_max.high |= ((HOST_WIDE_INT) 1
- << floor_log2 (ior_max.high)) - 1;
+ if (min == NULL_TREE)
+ min = build_int_cst (expr_type, 0);
+ if (max == NULL_TREE || tree_int_cst_lt (vr0.max, max))
+ max = vr0.max;
+ }
+ if (int_cst_range1 && tree_int_cst_sgn (vr1.min) >= 0)
+ {
+ if (min == NULL_TREE)
+ min = build_int_cst (expr_type, 0);
+ if (max == NULL_TREE || tree_int_cst_lt (vr1.max, max))
+ max = vr1.max;
}
- else if (ior_max.low != 0)
- ior_max.low |= ((unsigned HOST_WIDE_INT) 1u
- << floor_log2 (ior_max.low)) - 1;
-
- /* Both of these endpoints are conservative. */
- min = vrp_int_const_binop (MAX_EXPR, vr0.min, vr1.min);
- max = double_int_to_tree (expr_type, ior_max);
}
- else
+ else if (!int_cst_range0
+ || !int_cst_range1
+ || tree_int_cst_sgn (vr0.min) < 0
+ || tree_int_cst_sgn (vr1.min) < 0)
{
set_value_range_to_varying (vr);
return;
}
+ else
+ {
+ min = double_int_to_tree (expr_type,
+ double_int_ior (must_be_nonzero0,
+ must_be_nonzero1));
+ max = double_int_to_tree (expr_type,
+ double_int_ior (may_be_nonzero0,
+ may_be_nonzero1));
+ if (TREE_OVERFLOW (min) || tree_int_cst_sgn (min) < 0)
+ min = vr0.min;
+ else
+ min = vrp_int_const_binop (MAX_EXPR, min, vr0.min);
+ if (TREE_OVERFLOW (max) || tree_int_cst_sgn (max) < 0)
+ max = NULL_TREE;
+ min = vrp_int_const_binop (MAX_EXPR, min, vr1.min);
+ }
}
else
gcc_unreachable ();
@@ -5075,8 +5156,7 @@ check_array_ref (location_t location, tree ref, bool ignore_off_by_one)
/* Accesses to trailing arrays via pointers may access storage
beyond the types array bounds. */
base = get_base_address (ref);
- if (base
- && INDIRECT_REF_P (base))
+ if (base && TREE_CODE (base) == MEM_REF)
{
tree cref, next = NULL_TREE;
@@ -5085,9 +5165,9 @@ check_array_ref (location_t location, tree ref, bool ignore_off_by_one)
cref = TREE_OPERAND (ref, 0);
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (cref, 0))) == RECORD_TYPE)
- for (next = TREE_CHAIN (TREE_OPERAND (cref, 1));
+ for (next = DECL_CHAIN (TREE_OPERAND (cref, 1));
next && TREE_CODE (next) != FIELD_DECL;
- next = TREE_CHAIN (next))
+ next = DECL_CHAIN (next))
;
/* If this is the last field in a struct type or a field in a
@@ -5175,6 +5255,51 @@ search_for_addr_array (tree t, location_t location)
t = TREE_OPERAND (t, 0);
}
while (handled_component_p (t));
+
+ if (TREE_CODE (t) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR
+ && !TREE_NO_WARNING (t))
+ {
+ tree tem = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
+ tree low_bound, up_bound, el_sz;
+ double_int idx;
+ if (TREE_CODE (TREE_TYPE (tem)) != ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (tem))) == ARRAY_TYPE
+ || !TYPE_DOMAIN (TREE_TYPE (tem)))
+ return;
+
+ low_bound = TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (tem)));
+ up_bound = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tem)));
+ el_sz = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (tem)));
+ if (!low_bound
+ || TREE_CODE (low_bound) != INTEGER_CST
+ || !up_bound
+ || TREE_CODE (up_bound) != INTEGER_CST
+ || !el_sz
+ || TREE_CODE (el_sz) != INTEGER_CST)
+ return;
+
+ idx = mem_ref_offset (t);
+ idx = double_int_sdiv (idx, tree_to_double_int (el_sz), TRUNC_DIV_EXPR);
+ if (double_int_scmp (idx, double_int_zero) < 0)
+ {
+ warning_at (location, OPT_Warray_bounds,
+ "array subscript is below array bounds");
+ TREE_NO_WARNING (t) = 1;
+ }
+ else if (double_int_scmp (idx,
+ double_int_add
+ (double_int_add
+ (tree_to_double_int (up_bound),
+ double_int_neg
+ (tree_to_double_int (low_bound))),
+ double_int_one)) > 0)
+ {
+ warning_at (location, OPT_Warray_bounds,
+ "array subscript is above array bounds");
+ TREE_NO_WARNING (t) = 1;
+ }
+ }
}
/* walk_tree() callback that checks if *TP is
@@ -5203,7 +5328,7 @@ check_array_bounds (tree *tp, int *walk_subtree, void *data)
if (TREE_CODE (t) == ARRAY_REF)
check_array_ref (location, t, false /*ignore_off_by_one*/);
- if (TREE_CODE (t) == INDIRECT_REF
+ if (TREE_CODE (t) == MEM_REF
|| (TREE_CODE (t) == RETURN_EXPR && TREE_OPERAND (t, 0)))
search_for_addr_array (TREE_OPERAND (t, 0), location);
@@ -6788,6 +6913,89 @@ simplify_abs_using_ranges (gimple stmt)
return false;
}
+/* Optimize away redundant BIT_AND_EXPR and BIT_IOR_EXPR.
+ If all the bits that are being cleared by & are already
+ known to be zero from VR, or all the bits that are being
+ set by | are already known to be one from VR, the bit
+ operation is redundant. */
+
+static bool
+simplify_bit_ops_using_ranges (gimple_stmt_iterator *gsi, gimple stmt)
+{
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
+ tree op = NULL_TREE;
+ value_range_t vr0 = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
+ value_range_t vr1 = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
+ double_int may_be_nonzero0, may_be_nonzero1;
+ double_int must_be_nonzero0, must_be_nonzero1;
+ double_int mask;
+
+ if (TREE_CODE (op0) == SSA_NAME)
+ vr0 = *(get_value_range (op0));
+ else if (is_gimple_min_invariant (op0))
+ set_value_range_to_value (&vr0, op0, NULL);
+ else
+ return false;
+
+ if (TREE_CODE (op1) == SSA_NAME)
+ vr1 = *(get_value_range (op1));
+ else if (is_gimple_min_invariant (op1))
+ set_value_range_to_value (&vr1, op1, NULL);
+ else
+ return false;
+
+ if (!zero_nonzero_bits_from_vr (&vr0, &may_be_nonzero0, &must_be_nonzero0))
+ return false;
+ if (!zero_nonzero_bits_from_vr (&vr1, &may_be_nonzero1, &must_be_nonzero1))
+ return false;
+
+ switch (gimple_assign_rhs_code (stmt))
+ {
+ case BIT_AND_EXPR:
+ mask = double_int_and (may_be_nonzero0,
+ double_int_not (must_be_nonzero1));
+ if (double_int_zero_p (mask))
+ {
+ op = op0;
+ break;
+ }
+ mask = double_int_and (may_be_nonzero1,
+ double_int_not (must_be_nonzero0));
+ if (double_int_zero_p (mask))
+ {
+ op = op1;
+ break;
+ }
+ break;
+ case BIT_IOR_EXPR:
+ mask = double_int_and (may_be_nonzero0,
+ double_int_not (must_be_nonzero1));
+ if (double_int_zero_p (mask))
+ {
+ op = op1;
+ break;
+ }
+ mask = double_int_and (may_be_nonzero1,
+ double_int_not (must_be_nonzero0));
+ if (double_int_zero_p (mask))
+ {
+ op = op0;
+ break;
+ }
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ if (op == NULL_TREE)
+ return false;
+
+ gimple_assign_set_rhs_with_ops (gsi, TREE_CODE (op), op, NULL);
+ update_stmt (gsi_stmt (*gsi));
+ return true;
+}
+
/* We are comparing trees OP0 and OP1 using COND_CODE. OP0 has
a known value range VR.
@@ -7073,6 +7281,15 @@ simplify_stmt_using_ranges (gimple_stmt_iterator *gsi)
return simplify_abs_using_ranges (stmt);
break;
+ case BIT_AND_EXPR:
+ case BIT_IOR_EXPR:
+ /* Optimize away BIT_AND_EXPR and BIT_IOR_EXPR
+ if all the bits being cleared are already cleared or
+ all the bits being set are already set. */
+ if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt))))
+ return simplify_bit_ops_using_ranges (gsi, stmt);
+ break;
+
default:
break;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index de83e64cea1..a33f22b40f5 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1049,14 +1049,9 @@ build_int_cst (tree type, HOST_WIDE_INT low)
tree
build_int_cst_type (tree type, HOST_WIDE_INT low)
{
- unsigned HOST_WIDE_INT low1;
- HOST_WIDE_INT hi;
-
gcc_assert (type);
- fit_double_type (low, low < 0 ? -1 : 0, &low1, &hi, type);
-
- return build_int_cst_wide (type, low1, hi);
+ return double_int_to_tree (type, shwi_to_double_int (low));
}
/* Constructs tree in type TYPE from with value given by CST. Signedness
@@ -1996,7 +1991,7 @@ chain_member (const_tree elem, const_tree chain)
{
if (elem == chain)
return 1;
- chain = TREE_CHAIN (chain);
+ chain = DECL_CHAIN (chain);
}
return 0;
@@ -2037,7 +2032,7 @@ fields_length (const_tree type)
tree t = TYPE_FIELDS (type);
int count = 0;
- for (; t; t = TREE_CHAIN (t))
+ for (; t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == FIELD_DECL)
++count;
@@ -2432,7 +2427,6 @@ staticp (tree arg)
return NULL;
case MISALIGNED_INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case INDIRECT_REF:
return TREE_CONSTANT (TREE_OPERAND (arg, 0)) ? arg : NULL;
@@ -2866,7 +2860,7 @@ type_contains_placeholder_1 (const_tree type)
{
tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& (CONTAINS_PLACEHOLDER_P (DECL_FIELD_OFFSET (field))
|| (TREE_CODE (type) == QUAL_UNION_TYPE
@@ -3564,7 +3558,8 @@ do { tree _node = (NODE); \
address is constant too. If it's a decl, its address is constant if the
decl is static. Everything else is not constant and, furthermore,
taking the address of a volatile variable is not volatile. */
- if (TREE_CODE (node) == INDIRECT_REF)
+ if (TREE_CODE (node) == INDIRECT_REF
+ || TREE_CODE (node) == MEM_REF)
UPDATE_FLAGS (TREE_OPERAND (node, 0));
else if (CONSTANT_CLASS_P (node))
;
@@ -3659,7 +3654,6 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
break;
case MISALIGNED_INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
case INDIRECT_REF:
/* Whether a dereference is readonly has nothing to do with whether
its operand is readonly. */
@@ -3878,6 +3872,61 @@ build6_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
return t;
}
+/* Build a simple MEM_REF tree with the sematics of a plain INDIRECT_REF
+ on the pointer PTR. */
+
+tree
+build_simple_mem_ref_loc (location_t loc, tree ptr)
+{
+ HOST_WIDE_INT offset = 0;
+ tree ptype = TREE_TYPE (ptr);
+ tree tem;
+ /* For convenience allow addresses that collapse to a simple base
+ and offset. */
+ if (TREE_CODE (ptr) == ADDR_EXPR
+ && (handled_component_p (TREE_OPERAND (ptr, 0))
+ || TREE_CODE (TREE_OPERAND (ptr, 0)) == MEM_REF))
+ {
+ ptr = get_addr_base_and_unit_offset (TREE_OPERAND (ptr, 0), &offset);
+ gcc_assert (ptr);
+ ptr = build_fold_addr_expr (ptr);
+ gcc_assert (is_gimple_reg (ptr) || is_gimple_min_invariant (ptr));
+ }
+ tem = build2 (MEM_REF, TREE_TYPE (ptype),
+ ptr, build_int_cst (ptype, offset));
+ SET_EXPR_LOCATION (tem, loc);
+ return tem;
+}
+
+/* Return the constant offset of a MEM_REF tree T. */
+
+double_int
+mem_ref_offset (const_tree t)
+{
+ tree toff = TREE_OPERAND (t, 1);
+ return double_int_sext (tree_to_double_int (toff),
+ TYPE_PRECISION (TREE_TYPE (toff)));
+}
+
+/* Return the pointer-type relevant for TBAA purposes from the
+ gimple memory reference tree T. This is the type to be used for
+ the offset operand of MEM_REF or TARGET_MEM_REF replacements of T. */
+
+tree
+reference_alias_ptr_type (const_tree t)
+{
+ const_tree base = t;
+ while (handled_component_p (base))
+ base = TREE_OPERAND (base, 0);
+ if (TREE_CODE (base) == MEM_REF)
+ return TREE_TYPE (TREE_OPERAND (base, 1));
+ else if (TREE_CODE (base) == TARGET_MEM_REF
+ || TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
+ return NULL_TREE;
+ else
+ return build_pointer_type (TYPE_MAIN_VARIANT (TREE_TYPE (base)));
+}
+
/* Similar except don't specify the TREE_TYPE
and leave the TREE_SIDE_EFFECTS as 0.
It is permissible for arguments to be null,
@@ -4449,6 +4498,7 @@ free_lang_data_in_decl (tree decl)
if (gimple_has_body_p (decl))
{
tree t;
+ unsigned ix;
struct pointer_set_t *locals;
/* If DECL has a gimple body, then the context for its
@@ -4465,14 +4515,13 @@ free_lang_data_in_decl (tree decl)
/* Collect all the symbols declared in DECL. */
locals = pointer_set_create ();
- t = DECL_STRUCT_FUNCTION (decl)->local_decls;
- for (; t; t = TREE_CHAIN (t))
+ FOR_EACH_LOCAL_DECL (DECL_STRUCT_FUNCTION (decl), ix, t)
{
- pointer_set_insert (locals, TREE_VALUE (t));
+ pointer_set_insert (locals, t);
/* All the local symbols should have DECL as their
context. */
- DECL_CONTEXT (TREE_VALUE (t)) = decl;
+ DECL_CONTEXT (t) = decl;
}
/* Get rid of any decl not in local_decls. */
@@ -4655,7 +4704,8 @@ find_decls_types_r (tree *tp, int *ws, void *data)
&& DECL_HAS_VALUE_EXPR_P (t))
fld_worklist_push (DECL_VALUE_EXPR (t), fld);
- if (TREE_CODE (t) != FIELD_DECL)
+ if (TREE_CODE (t) != FIELD_DECL
+ && TREE_CODE (t) != TYPE_DECL)
fld_worklist_push (TREE_CHAIN (t), fld);
*ws = 0;
}
@@ -4673,13 +4723,19 @@ find_decls_types_r (tree *tp, int *ws, void *data)
fld_worklist_push (TYPE_POINTER_TO (t), fld);
fld_worklist_push (TYPE_REFERENCE_TO (t), fld);
fld_worklist_push (TYPE_NAME (t), fld);
- fld_worklist_push (TYPE_MINVAL (t), fld);
+ /* Do not walk TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO. We do not stream
+ them and thus do not and want not to reach unused pointer types
+ this way. */
+ if (!POINTER_TYPE_P (t))
+ fld_worklist_push (TYPE_MINVAL (t), fld);
if (!RECORD_OR_UNION_TYPE_P (t))
fld_worklist_push (TYPE_MAXVAL (t), fld);
fld_worklist_push (TYPE_MAIN_VARIANT (t), fld);
- fld_worklist_push (TYPE_NEXT_VARIANT (t), fld);
+ /* Do not walk TYPE_NEXT_VARIANT. We do not stream it and thus
+ do not and want not to reach unused variants this way. */
fld_worklist_push (TYPE_CONTEXT (t), fld);
- fld_worklist_push (TYPE_CANONICAL (t), fld);
+ /* Do not walk TYPE_CANONICAL. We do not stream it and thus do not
+ and want not to reach unused types this way. */
if (RECORD_OR_UNION_TYPE_P (t) && TYPE_BINFO (t))
{
@@ -4824,6 +4880,7 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
{
basic_block bb;
struct function *fn;
+ unsigned ix;
tree t;
find_decls_types (n->decl, fld);
@@ -4836,8 +4893,8 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
fn = DECL_STRUCT_FUNCTION (n->decl);
/* Traverse locals. */
- for (t = fn->local_decls; t; t = TREE_CHAIN (t))
- find_decls_types (TREE_VALUE (t), fld);
+ FOR_EACH_LOCAL_DECL (fn, ix, t)
+ find_decls_types (t, fld);
/* Traverse EH regions in FN. */
{
@@ -6022,16 +6079,14 @@ type_hash_canon (unsigned int hashcode, tree type)
/* See if the data pointed to by the type hash table is marked. We consider
it marked if the type is marked or if a debug type number or symbol
- table entry has been made for the type. This reduces the amount of
- debugging output and eliminates that dependency of the debug output on
- the number of garbage collections. */
+ table entry has been made for the type. */
static int
type_hash_marked_p (const void *p)
{
const_tree const type = ((const struct type_hash *) p)->type;
- return ggc_marked_p (type) || TYPE_SYMTAB_POINTER (type);
+ return ggc_marked_p (type);
}
static void
@@ -7300,7 +7355,7 @@ build_function_type_skip_args (tree orig_type, bitmap args_to_skip)
if (TREE_CODE (orig_type) != METHOD_TYPE
|| !bitmap_bit_p (args_to_skip, 0))
{
- new_type = copy_node (orig_type);
+ new_type = build_distinct_type_copy (orig_type);
TYPE_ARG_TYPES (new_type) = new_reversed;
}
else
@@ -7846,10 +7901,10 @@ get_narrower (tree op, int *unsignedp_ptr)
return win;
}
-/* Nonzero if integer constant C has a value that is permissible
+/* Returns true if integer constant C has a value that is permissible
for type TYPE (an INTEGER_TYPE). */
-int
+bool
int_fits_type_p (const_tree c, const_tree type)
{
tree type_low_bound, type_high_bound;
@@ -7878,7 +7933,7 @@ retry:
/* If at least one bound of the type is a constant integer, we can check
ourselves and maybe make a decision. If no such decision is possible, but
this type is a subtype, try checking against that. Otherwise, use
- fit_double_type, which checks against the precision.
+ double_int_fits_to_tree_p, which checks against the precision.
Compute the status for each possibly constant bound, and return if we see
one does not match. Use ok_for_xxx_bound for this purpose, assigning -1
@@ -7899,12 +7954,12 @@ retry:
int t_neg = (unsc && double_int_negative_p (dd));
if (c_neg && !t_neg)
- return 0;
+ return false;
if ((c_neg || !t_neg) && double_int_ucmp (dc, dd) < 0)
- return 0;
+ return false;
}
else if (double_int_cmp (dc, dd, unsc) < 0)
- return 0;
+ return false;
ok_for_low_bound = true;
}
else
@@ -7924,12 +7979,12 @@ retry:
int t_neg = (unsc && double_int_negative_p (dd));
if (t_neg && !c_neg)
- return 0;
+ return false;
if ((t_neg || !c_neg) && double_int_ucmp (dc, dd) > 0)
- return 0;
+ return false;
}
else if (double_int_cmp (dc, dd, unsc) > 0)
- return 0;
+ return false;
ok_for_high_bound = true;
}
else
@@ -7937,17 +7992,17 @@ retry:
/* If the constant fits both bounds, the result is known. */
if (ok_for_low_bound && ok_for_high_bound)
- return 1;
+ return true;
/* Perform some generic filtering which may allow making a decision
even if the bounds are not constant. First, negative integers
never fit in unsigned types, */
if (TYPE_UNSIGNED (type) && !unsc && double_int_negative_p (dc))
- return 0;
+ return false;
/* Second, narrower types always fit in wider ones. */
if (TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (c)))
- return 1;
+ return true;
/* Third, unsigned integers with top bit set never fit signed types. */
if (! TYPE_UNSIGNED (type) && unsc)
@@ -7956,11 +8011,11 @@ retry:
if (prec < HOST_BITS_PER_WIDE_INT)
{
if (((((unsigned HOST_WIDE_INT) 1) << prec) & dc.low) != 0)
- return 0;
+ return false;
}
else if (((((unsigned HOST_WIDE_INT) 1)
<< (prec - HOST_BITS_PER_WIDE_INT)) & dc.high) != 0)
- return 0;
+ return false;
}
/* If we haven't been able to decide at this point, there nothing more we
@@ -7974,8 +8029,8 @@ retry:
goto retry;
}
- /* Or to fit_double_type, if nothing else. */
- return !fit_double_type (dc.low, dc.high, &dc.low, &dc.high, type);
+ /* Or to double_int_fits_to_tree_p, if nothing else. */
+ return double_int_fits_to_tree_p (type, dc);
}
/* Stores bounds of an integer TYPE in MIN and MAX. If TYPE has non-constant
@@ -8121,7 +8176,7 @@ variably_modified_type_p (tree type, tree fn)
definition we normally use, since that would produce infinite
recursion via pointers. */
/* This is variably modified if some field's type is. */
- for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t))
+ for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == FIELD_DECL)
{
RETURN_TRUE_IF_VAR (DECL_FIELD_OFFSET (t));
@@ -8921,9 +8976,10 @@ void
build_common_tree_nodes_2 (int short_double)
{
/* Define these next since types below may used them. */
- integer_zero_node = build_int_cst (NULL_TREE, 0);
- integer_one_node = build_int_cst (NULL_TREE, 1);
- integer_minus_one_node = build_int_cst (NULL_TREE, -1);
+ integer_zero_node = build_int_cst (integer_type_node, 0);
+ integer_one_node = build_int_cst (integer_type_node, 1);
+ integer_three_node = build_int_cst (integer_type_node, 3);
+ integer_minus_one_node = build_int_cst (integer_type_node, -1);
size_zero_node = size_int (0);
size_one_node = size_int (1);
@@ -9100,15 +9156,14 @@ local_define_builtin (const char *name, tree type, enum built_in_function code,
void
build_common_builtin_nodes (void)
{
- tree tmp, tmp2, ftype;
+ tree tmp, ftype;
if (built_in_decls[BUILT_IN_MEMCPY] == NULL
|| built_in_decls[BUILT_IN_MEMMOVE] == NULL)
{
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- ftype = build_function_type (ptr_type_node, tmp);
+ ftype = build_function_type_list (ptr_type_node,
+ ptr_type_node, const_ptr_type_node,
+ size_type_node, NULL_TREE);
if (built_in_decls[BUILT_IN_MEMCPY] == NULL)
local_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY,
@@ -9120,28 +9175,26 @@ build_common_builtin_nodes (void)
if (built_in_decls[BUILT_IN_MEMCMP] == NULL)
{
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp);
- tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp);
- ftype = build_function_type (integer_type_node, tmp);
+ ftype = build_function_type_list (integer_type_node, const_ptr_type_node,
+ const_ptr_type_node, size_type_node,
+ NULL_TREE);
local_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP,
"memcmp", ECF_PURE | ECF_NOTHROW);
}
if (built_in_decls[BUILT_IN_MEMSET] == NULL)
{
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, integer_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- ftype = build_function_type (ptr_type_node, tmp);
+ ftype = build_function_type_list (ptr_type_node,
+ ptr_type_node, integer_type_node,
+ size_type_node, NULL_TREE);
local_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET,
"memset", ECF_NOTHROW);
}
if (built_in_decls[BUILT_IN_ALLOCA] == NULL)
{
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- ftype = build_function_type (ptr_type_node, tmp);
+ ftype = build_function_type_list (ptr_type_node,
+ size_type_node, NULL_TREE);
local_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
"alloca", ECF_MALLOC | ECF_NOTHROW);
}
@@ -9150,60 +9203,53 @@ build_common_builtin_nodes (void)
if (flag_stack_check)
TREE_NOTHROW (built_in_decls[BUILT_IN_ALLOCA]) = 0;
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node,
+ ptr_type_node, ptr_type_node,
+ ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_init_trampoline", ftype,
BUILT_IN_INIT_TRAMPOLINE,
"__builtin_init_trampoline", ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- ftype = build_function_type (ptr_type_node, tmp);
+ ftype = build_function_type_list (ptr_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_adjust_trampoline", ftype,
BUILT_IN_ADJUST_TRAMPOLINE,
"__builtin_adjust_trampoline",
ECF_CONST | ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node,
+ ptr_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_nonlocal_goto", ftype,
BUILT_IN_NONLOCAL_GOTO,
"__builtin_nonlocal_goto",
ECF_NORETURN | ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node,
+ ptr_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_setjmp_setup", ftype,
BUILT_IN_SETJMP_SETUP,
"__builtin_setjmp_setup", ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- ftype = build_function_type (ptr_type_node, tmp);
+ ftype = build_function_type_list (ptr_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_setjmp_dispatcher", ftype,
BUILT_IN_SETJMP_DISPATCHER,
"__builtin_setjmp_dispatcher",
ECF_PURE | ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_setjmp_receiver", ftype,
BUILT_IN_SETJMP_RECEIVER,
"__builtin_setjmp_receiver", ECF_NOTHROW);
- ftype = build_function_type (ptr_type_node, void_list_node);
+ ftype = build_function_type_list (ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE,
"__builtin_stack_save", ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_stack_restore", ftype,
BUILT_IN_STACK_RESTORE,
"__builtin_stack_restore", ECF_NOTHROW);
- ftype = build_function_type (void_type_node, void_list_node);
+ ftype = build_function_type_list (void_type_node, NULL_TREE);
local_define_builtin ("__builtin_profile_func_enter", ftype,
BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter", 0);
local_define_builtin ("__builtin_profile_func_exit", ftype,
@@ -9213,14 +9259,13 @@ build_common_builtin_nodes (void)
alternate __cxa_end_cleanup node used to resume from C++ and Java. */
if (targetm.arm_eabi_unwinder)
{
- ftype = build_function_type (void_type_node, void_list_node);
+ ftype = build_function_type_list (void_type_node, NULL_TREE);
local_define_builtin ("__builtin_cxa_end_cleanup", ftype,
BUILT_IN_CXA_END_CLEANUP,
"__cxa_end_cleanup", ECF_NORETURN);
}
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
local_define_builtin ("__builtin_unwind_resume", ftype,
BUILT_IN_UNWIND_RESUME,
(USING_SJLJ_EXCEPTIONS
@@ -9233,19 +9278,19 @@ build_common_builtin_nodes (void)
landing pad. These functions are PURE instead of CONST to prevent
them from being hoisted past the exception edge that will initialize
its value in the landing pad. */
- tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
- ftype = build_function_type (ptr_type_node, tmp);
+ ftype = build_function_type_list (ptr_type_node,
+ integer_type_node, NULL_TREE);
local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER,
"__builtin_eh_pointer", ECF_PURE | ECF_NOTHROW);
- tmp2 = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0);
- ftype = build_function_type (tmp2, tmp);
+ tmp = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0);
+ ftype = build_function_type_list (tmp, integer_type_node, NULL_TREE);
local_define_builtin ("__builtin_eh_filter", ftype, BUILT_IN_EH_FILTER,
"__builtin_eh_filter", ECF_PURE | ECF_NOTHROW);
- tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, integer_type_node, tmp);
- ftype = build_function_type (void_type_node, tmp);
+ ftype = build_function_type_list (void_type_node,
+ integer_type_node, integer_type_node,
+ NULL_TREE);
local_define_builtin ("__builtin_eh_copy_values", ftype,
BUILT_IN_EH_COPY_VALUES,
"__builtin_eh_copy_values", ECF_NOTHROW);
@@ -9269,11 +9314,8 @@ build_common_builtin_nodes (void)
continue;
inner_type = TREE_TYPE (type);
- tmp = tree_cons (NULL_TREE, inner_type, void_list_node);
- tmp = tree_cons (NULL_TREE, inner_type, tmp);
- tmp = tree_cons (NULL_TREE, inner_type, tmp);
- tmp = tree_cons (NULL_TREE, inner_type, tmp);
- ftype = build_function_type (type, tmp);
+ ftype = build_function_type_list (type, inner_type, inner_type,
+ inner_type, inner_type, NULL_TREE);
mcode = ((enum built_in_function)
(BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
@@ -9543,27 +9585,6 @@ build_vl_exp_stat (enum tree_code code, int len MEM_STAT_DECL)
return t;
}
-
-/* Build a CALL_EXPR of class tcc_vl_exp with the indicated RETURN_TYPE
- and FN and a null static chain slot. ARGLIST is a TREE_LIST of the
- arguments. */
-
-tree
-build_call_list (tree return_type, tree fn, tree arglist)
-{
- tree t;
- int i;
-
- t = build_vl_exp (CALL_EXPR, list_length (arglist) + 3);
- TREE_TYPE (t) = return_type;
- CALL_EXPR_FN (t) = fn;
- CALL_EXPR_STATIC_CHAIN (t) = NULL_TREE;
- for (i = 0; arglist; arglist = TREE_CHAIN (arglist), i++)
- CALL_EXPR_ARG (t, i) = TREE_VALUE (arglist);
- process_call_operands (t);
- return t;
-}
-
/* Build a CALL_EXPR of class tcc_vl_exp with the indicated RETURN_TYPE and
FN and a null static chain slot. NARGS is the number of call arguments
which are specified as "..." arguments. */
@@ -9713,6 +9734,7 @@ needs_to_live_in_memory (const_tree t)
return (TREE_ADDRESSABLE (t)
|| is_global_var (t)
|| (TREE_CODE (t) == RESULT_DECL
+ && !DECL_BY_REFERENCE (t)
&& aggregate_value_p (t, current_function_decl)));
}
@@ -10229,7 +10251,7 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
case BIND_EXPR:
{
tree decl;
- for (decl = BIND_EXPR_VARS (*tp); decl; decl = TREE_CHAIN (decl))
+ for (decl = BIND_EXPR_VARS (*tp); decl; decl = DECL_CHAIN (decl))
{
/* Walk the DECL_INITIAL and DECL_SIZE. We don't want to walk
into declarations that are just mentioned, rather than
@@ -10344,7 +10366,7 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
tree field;
for (field = TYPE_FIELDS (*type_p); field;
- field = TREE_CHAIN (field))
+ field = DECL_CHAIN (field))
{
/* We'd like to look at the type of the field, but we can
easily get infinite recursion. So assume it's pointed
@@ -10860,7 +10882,7 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
if (TREE_CODE (type) != RECORD_TYPE)
return NULL_TREE;
- for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
+ for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
{
if (TREE_CODE (fld) != FIELD_DECL)
continue;
diff --git a/gcc/tree.def b/gcc/tree.def
index e09debf0cdd..493c75e79af 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -416,15 +416,11 @@ DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4)
/* The ordering of the following codes is optimized for the checking
macros in tree.h. Changing the order will degrade the speed of the
- compiler. INDIRECT_REF, ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF. */
+ compiler. INDIRECT_REF, MISALIGNED_INDIRECT_REF. */
/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */
DEFTREECODE (INDIRECT_REF, "indirect_ref", tcc_reference, 1)
-/* Like above, but aligns the referenced address (i.e, if the address
- in P is not aligned on TYPE_ALIGN boundary, then &(*P) != P). */
-DEFTREECODE (ALIGN_INDIRECT_REF, "align_indirect_ref", tcc_reference, 1)
-
/* Same as INDIRECT_REF, but also specifies the alignment of the referenced
address:
Operand 0 is the referenced address (a pointer);
@@ -970,6 +966,16 @@ DEFTREECODE (REALIGN_LOAD_EXPR, "realign_load", tcc_expression, 3)
DEFTREECODE (TARGET_MEM_REF, "target_mem_ref", tcc_reference, 6)
+/* Memory addressing. Operands are a pointer and a tree constant integer
+ byte offset of the pointer type that when dereferenced yields the
+ type of the base object the pointer points into and which is used for
+ TBAA purposes.
+ The type of the MEM_REF is the type the bytes at the memory location
+ are interpreted as.
+ MEM_REF <p, c> is equivalent to ((typeof(c))p)->x... where x... is a
+ chain of component references offsetting p by c. */
+DEFTREECODE (MEM_REF, "mem_ref", tcc_reference, 2)
+
/* The ordering of the codes between OMP_PARALLEL and OMP_CRITICAL is
exposed to TREE_RANGE_CHECK. */
/* OpenMP - #pragma omp parallel [clause1 ... clauseN]
diff --git a/gcc/tree.h b/gcc/tree.h
index dc00feafa57..e0c9868ed90 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -118,7 +118,6 @@ extern const enum tree_code_class tree_code_type[];
#define INDIRECT_REF_P(CODE)\
(TREE_CODE (CODE) == INDIRECT_REF \
- || TREE_CODE (CODE) == ALIGN_INDIRECT_REF \
|| TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF)
/* Nonzero if CODE represents a reference. */
@@ -388,8 +387,9 @@ struct GTY(()) tree_base {
unsigned visited : 1;
unsigned packed_flag : 1;
unsigned user_align : 1;
+ unsigned nameless_flag : 1;
- unsigned spare : 13;
+ unsigned spare : 12;
/* This field is only used with type nodes; the only reason it is present
in tree_base instead of tree_type is to save space. The size of the
@@ -839,17 +839,6 @@ enum tree_node_structure_enum {
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
-#define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \
-(*(rtx *) \
- ({__typeof (T) const __t = (T); \
- const int __i = (I); \
- if (TREE_CODE (__t) != (CODE)) \
- tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, (CODE), 0); \
- if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \
- tree_operand_check_failed (__i, __t, \
- __FILE__, __LINE__, __FUNCTION__); \
- &__t->exp.operands[__i]; }))
-
/* Nodes are chained together for many purposes.
Types are chained together to record them for being output to the debugger
(see the function `chain_type').
@@ -931,7 +920,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
-#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
@@ -1251,7 +1239,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
accessing the memory pointed to won't generate a trap. However,
this only applies to an object when used appropriately: it doesn't
mean that writing a READONLY mem won't trap. Similarly for
- ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF.
+ MISALIGNED_INDIRECT_REF.
In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
(or slice of the array) always belongs to the range of the array.
@@ -2193,6 +2181,9 @@ extern enum machine_mode vector_type_mode (const_tree);
the term. */
#define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
+/* If nonzero, type's name shouldn't be emitted into debug info. */
+#define TYPE_NAMELESS(NODE) (TYPE_CHECK (NODE)->base.nameless_flag)
+
/* The address space the type is in. */
#define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.address_space)
@@ -2495,6 +2486,7 @@ enum symbol_visibility
struct function;
+#define DECL_CHAIN(NODE) (TREE_CHAIN (DECL_MINIMAL_CHECK (NODE)))
/* This is the name of the object as written by the user.
It is an IDENTIFIER_NODE. */
@@ -2541,6 +2533,10 @@ struct function;
#define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
#define DECL_FIELD_CONTEXT(NODE) \
(FIELD_DECL_CHECK (NODE)->decl_minimal.context)
+
+/* If nonzero, decl's name shouldn't be emitted into debug info. */
+#define DECL_NAMELESS(NODE) (DECL_MINIMAL_CHECK (NODE)->base.nameless_flag)
+
struct GTY(()) tree_decl_minimal {
struct tree_common common;
location_t locus;
@@ -3013,6 +3009,11 @@ struct GTY(()) tree_parm_decl {
not be treated as replaceable so that use of C++ template
instantiations is not penalized.
+ In other respects, the condition is usually equivalent to whether
+ the function binds to the current module (shared library or executable).
+ However, weak functions can always be overridden by earlier TUs
+ in the same module, even if they bind locally to that module.
+
For example, DECL_REPLACEABLE is used to determine whether or not a
function (including a template instantiation) which is not
explicitly declared "inline" can be inlined. If the function is
@@ -3021,7 +3022,7 @@ struct GTY(()) tree_parm_decl {
function that is not DECL_REPLACEABLE can be inlined, since all
versions of the function will be functionally identical. */
#define DECL_REPLACEABLE_P(NODE) \
- (!DECL_COMDAT (NODE) && !targetm.binds_local_p (NODE))
+ (!DECL_COMDAT (NODE) && (DECL_WEAK (NODE) || !targetm.binds_local_p (NODE)))
/* The name of the object as the assembler will see it (but before any
translations made by ASM_OUTPUT_LABELREF). Often this is the same
@@ -3527,6 +3528,7 @@ enum tree_index
TI_INTEGER_ZERO,
TI_INTEGER_ONE,
+ TI_INTEGER_THREE,
TI_INTEGER_MINUS_ONE,
TI_NULL_POINTER,
@@ -3681,6 +3683,7 @@ extern GTY(()) tree global_trees[TI_MAX];
#define integer_zero_node global_trees[TI_INTEGER_ZERO]
#define integer_one_node global_trees[TI_INTEGER_ONE]
+#define integer_three_node global_trees[TI_INTEGER_THREE]
#define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
#define size_zero_node global_trees[TI_SIZE_ZERO]
#define size_one_node global_trees[TI_SIZE_ONE]
@@ -4053,7 +4056,6 @@ extern tree build_omp_clause (location_t, enum omp_clause_code);
extern tree build_vl_exp_stat (enum tree_code, int MEM_STAT_DECL);
#define build_vl_exp(c,n) build_vl_exp_stat (c,n MEM_STAT_INFO)
-extern tree build_call_list (tree, tree, tree);
extern tree build_call_nary (tree, tree, int, ...);
extern tree build_call_valist (tree, tree, int, va_list);
#define build_call_array(T1,T2,N,T3)\
@@ -4968,6 +4970,11 @@ extern tree build_fold_indirect_ref_loc (location_t, tree);
#define fold_indirect_ref(T)\
fold_indirect_ref_loc (UNKNOWN_LOCATION, T)
extern tree fold_indirect_ref_loc (location_t, tree);
+extern tree build_simple_mem_ref_loc (location_t, tree);
+#define build_simple_mem_ref(T)\
+ build_simple_mem_ref_loc (UNKNOWN_LOCATION, T)
+extern double_int mem_ref_offset (const_tree);
+extern tree reference_alias_ptr_type (const_tree);
extern tree constant_boolean_node (int, tree);
extern tree div_if_zero_remainder (enum tree_code, const_tree, const_tree);
@@ -5020,8 +5027,9 @@ extern tree fold_builtin_strncpy_chk (location_t, tree, tree, tree, tree, tree);
extern tree fold_builtin_snprintf_chk (location_t, tree, tree, enum built_in_function);
extern bool fold_builtin_next_arg (tree, bool);
extern enum built_in_function builtin_mathfn_code (const_tree);
-extern tree build_function_call_expr (location_t, tree, tree);
extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *);
+extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
+extern tree build_call_expr_loc_vec (location_t, tree, VEC(tree,gc) *);
extern tree build_call_expr_loc (location_t, tree, int, ...);
extern tree build_call_expr (tree, int, ...);
extern tree mathfn_built_in (tree, enum built_in_function fn);
@@ -5043,6 +5051,8 @@ extern tree build_range_check (location_t, tree, tree, int, tree, tree);
extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
tree, tree);
extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
+extern bool is_simple_builtin (tree);
+extern bool is_inexpensive_builtin (tree);
/* In convert.c */
extern tree strip_float_extensions (tree);
@@ -5051,7 +5061,7 @@ extern tree strip_float_extensions (tree);
extern int really_constant_p (const_tree);
extern bool decl_address_invariant_p (const_tree);
extern bool decl_address_ip_invariant_p (const_tree);
-extern int int_fits_type_p (const_tree, const_tree);
+extern bool int_fits_type_p (const_tree, const_tree);
#ifndef GENERATOR_FILE
extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
#endif
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index a90ca3884d9..3232fb75fb4 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -910,6 +910,16 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data)
return use_narrower_mode (SUBREG_REG (tem), GET_MODE (tem),
GET_MODE (SUBREG_REG (tem)));
return tem;
+ case ASM_OPERANDS:
+ /* Don't do any replacements in second and following
+ ASM_OPERANDS of inline-asm with multiple sets.
+ ASM_OPERANDS_INPUT_VEC, ASM_OPERANDS_INPUT_CONSTRAINT_VEC
+ and ASM_OPERANDS_LABEL_VEC need to be equal between
+ all the ASM_OPERANDs in the insn and adjust_insn will
+ fix this up. */
+ if (ASM_OPERANDS_OUTPUT_IDX (loc) != 0)
+ return loc;
+ break;
default:
break;
}
@@ -960,7 +970,54 @@ adjust_insn (basic_block bb, rtx insn)
note_stores (PATTERN (insn), adjust_mem_stores, &amd);
amd.store = false;
- note_uses (&PATTERN (insn), adjust_mem_uses, &amd);
+ if (GET_CODE (PATTERN (insn)) == PARALLEL
+ && asm_noperands (PATTERN (insn)) > 0
+ && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == SET)
+ {
+ rtx body, set0;
+ int i;
+
+ /* inline-asm with multiple sets is tiny bit more complicated,
+ because the 3 vectors in ASM_OPERANDS need to be shared between
+ all ASM_OPERANDS in the instruction. adjust_mems will
+ not touch ASM_OPERANDS other than the first one, asm_noperands
+ test above needs to be called before that (otherwise it would fail)
+ and afterwards this code fixes it up. */
+ note_uses (&PATTERN (insn), adjust_mem_uses, &amd);
+ body = PATTERN (insn);
+ set0 = XVECEXP (body, 0, 0);
+ gcc_checking_assert (GET_CODE (set0) == SET
+ && GET_CODE (SET_SRC (set0)) == ASM_OPERANDS
+ && ASM_OPERANDS_OUTPUT_IDX (SET_SRC (set0)) == 0);
+ for (i = 1; i < XVECLEN (body, 0); i++)
+ if (GET_CODE (XVECEXP (body, 0, i)) != SET)
+ break;
+ else
+ {
+ set = XVECEXP (body, 0, i);
+ gcc_checking_assert (GET_CODE (SET_SRC (set)) == ASM_OPERANDS
+ && ASM_OPERANDS_OUTPUT_IDX (SET_SRC (set))
+ == i);
+ if (ASM_OPERANDS_INPUT_VEC (SET_SRC (set))
+ != ASM_OPERANDS_INPUT_VEC (SET_SRC (set0))
+ || ASM_OPERANDS_INPUT_CONSTRAINT_VEC (SET_SRC (set))
+ != ASM_OPERANDS_INPUT_CONSTRAINT_VEC (SET_SRC (set0))
+ || ASM_OPERANDS_LABEL_VEC (SET_SRC (set))
+ != ASM_OPERANDS_LABEL_VEC (SET_SRC (set0)))
+ {
+ rtx newsrc = shallow_copy_rtx (SET_SRC (set));
+ ASM_OPERANDS_INPUT_VEC (newsrc)
+ = ASM_OPERANDS_INPUT_VEC (SET_SRC (set0));
+ ASM_OPERANDS_INPUT_CONSTRAINT_VEC (newsrc)
+ = ASM_OPERANDS_INPUT_CONSTRAINT_VEC (SET_SRC (set0));
+ ASM_OPERANDS_LABEL_VEC (newsrc)
+ = ASM_OPERANDS_LABEL_VEC (SET_SRC (set0));
+ validate_change (NULL_RTX, &SET_SRC (set), newsrc, true);
+ }
+ }
+ }
+ else
+ note_uses (&PATTERN (insn), adjust_mem_uses, &amd);
/* For read-only MEMs containing some constant, prefer those
constants. */
@@ -5187,16 +5244,19 @@ reverse_op (rtx val, const_rtx expr)
case XOR:
case NOT:
case NEG:
+ if (!REG_P (XEXP (src, 0)))
+ return NULL_RTX;
+ break;
case SIGN_EXTEND:
case ZERO_EXTEND:
+ if (!REG_P (XEXP (src, 0)) && !MEM_P (XEXP (src, 0)))
+ return NULL_RTX;
break;
default:
return NULL_RTX;
}
- if (!REG_P (XEXP (src, 0))
- || !SCALAR_INT_MODE_P (GET_MODE (src))
- || XEXP (src, 0) == cfa_base_rtx)
+ if (!SCALAR_INT_MODE_P (GET_MODE (src)) || XEXP (src, 0) == cfa_base_rtx)
return NULL_RTX;
v = cselib_lookup (XEXP (src, 0), GET_MODE (XEXP (src, 0)), 0);
@@ -5992,6 +6052,7 @@ vt_find_locations (void)
int htabmax = PARAM_VALUE (PARAM_MAX_VARTRACK_SIZE);
bool success = true;
+ timevar_push (TV_VAR_TRACKING_DATAFLOW);
/* Compute reverse completion order of depth first search of the CFG
so that the data-flow runs faster. */
rc_order = XNEWVEC (int, n_basic_blocks - NUM_FIXED_BLOCKS);
@@ -6027,6 +6088,7 @@ vt_find_locations (void)
{
bb = (basic_block) fibheap_extract_min (worklist);
RESET_BIT (in_worklist, bb->index);
+ gcc_assert (!TEST_BIT (visited, bb->index));
if (!TEST_BIT (visited, bb->index))
{
bool changed;
@@ -6179,6 +6241,7 @@ vt_find_locations (void)
sbitmap_free (in_worklist);
sbitmap_free (in_pending);
+ timevar_pop (TV_VAR_TRACKING_DATAFLOW);
return success;
}
@@ -7040,7 +7103,7 @@ vt_expand_loc (rtx loc, htab_t vars)
data.vars = vars;
data.dummy = false;
data.cur_loc_changed = false;
- loc = cselib_expand_value_rtx_cb (loc, scratch_regs, 5,
+ loc = cselib_expand_value_rtx_cb (loc, scratch_regs, 8,
vt_expand_loc_callback, &data);
if (loc && MEM_P (loc))
@@ -7061,7 +7124,7 @@ vt_expand_loc_dummy (rtx loc, htab_t vars, bool *pcur_loc_changed)
data.vars = vars;
data.dummy = true;
data.cur_loc_changed = false;
- ret = cselib_dummy_expand_value_rtx_cb (loc, scratch_regs, 5,
+ ret = cselib_dummy_expand_value_rtx_cb (loc, scratch_regs, 8,
vt_expand_loc_callback, &data);
*pcur_loc_changed = data.cur_loc_changed;
return ret;
@@ -7999,7 +8062,7 @@ vt_add_function_parameters (void)
tree parm;
for (parm = DECL_ARGUMENTS (current_function_decl);
- parm; parm = TREE_CHAIN (parm))
+ parm; parm = DECL_CHAIN (parm))
{
rtx decl_rtl = DECL_RTL_IF_SET (parm);
rtx incoming = DECL_INCOMING_RTL (parm);
@@ -8534,7 +8597,9 @@ variable_tracking_main_1 (void)
dump_flow_info (dump_file, dump_flags);
}
+ timevar_push (TV_VAR_TRACKING_EMIT);
vt_emit_notes ();
+ timevar_pop (TV_VAR_TRACKING_EMIT);
vt_finalize ();
vt_debug_insns_local (false);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 7a4291d2198..3f816babdb1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "regs.h"
#include "output.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "hashtab.h"
#include "ggc.h"
@@ -245,7 +246,7 @@ default_emutls_var_fields (tree type, tree *name ATTRIBUTE_UNUSED)
FIELD_DECL, get_identifier ("__offset"),
ptr_type_node);
DECL_CONTEXT (field) = type;
- TREE_CHAIN (field) = next_field;
+ DECL_CHAIN (field) = next_field;
next_field = field;
word_type_node = lang_hooks.types.type_for_mode (word_mode, 1);
@@ -253,13 +254,13 @@ default_emutls_var_fields (tree type, tree *name ATTRIBUTE_UNUSED)
FIELD_DECL, get_identifier ("__align"),
word_type_node);
DECL_CONTEXT (field) = type;
- TREE_CHAIN (field) = next_field;
+ DECL_CHAIN (field) = next_field;
next_field = field;
field = build_decl (UNKNOWN_LOCATION,
FIELD_DECL, get_identifier ("__size"), word_type_node);
DECL_CONTEXT (field) = type;
- TREE_CHAIN (field) = next_field;
+ DECL_CHAIN (field) = next_field;
return field;
}
@@ -428,7 +429,7 @@ static int
emutls_common_1 (void **loc, void *xstmts)
{
struct tree_map *h = *(struct tree_map **) loc;
- tree args, x, *pstmts = (tree *) xstmts;
+ tree x, *pstmts = (tree *) xstmts;
tree word_type_node;
if (! DECL_COMMON (h->base.from)
@@ -442,17 +443,14 @@ emutls_common_1 (void **loc, void *xstmts)
do this and there is an initializer, -fanchor_section loses,
because it would be too late to ensure the template is
output. */
- x = null_pointer_node;
- args = tree_cons (NULL, x, NULL);
- x = build_int_cst (word_type_node, DECL_ALIGN_UNIT (h->base.from));
- args = tree_cons (NULL, x, args);
- x = fold_convert (word_type_node, DECL_SIZE_UNIT (h->base.from));
- args = tree_cons (NULL, x, args);
- x = build_fold_addr_expr (h->to);
- args = tree_cons (NULL, x, args);
-
x = built_in_decls[BUILT_IN_EMUTLS_REGISTER_COMMON];
- x = build_function_call_expr (UNKNOWN_LOCATION, x, args);
+ x = build_call_expr (x, 4,
+ build_fold_addr_expr (h->to),
+ fold_convert (word_type_node,
+ DECL_SIZE_UNIT (h->base.from)),
+ build_int_cst (word_type_node,
+ DECL_ALIGN_UNIT (h->base.from)),
+ null_pointer_node);
append_to_statement_list (x, pstmts);
return 1;
@@ -1864,7 +1862,7 @@ assemble_start_function (tree decl, const char *fnname)
ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
#else
/* Standard thing is just output label for the function. */
- ASM_OUTPUT_LABEL (asm_out_file, fnname);
+ ASM_OUTPUT_FUNCTION_LABEL (asm_out_file, fnname, current_function_decl);
#endif /* ASM_DECLARE_FUNCTION_NAME */
}
@@ -2116,18 +2114,18 @@ default_emutls_var_init (tree to, tree decl, tree proxy)
elt->value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
elt->index = field;
elt->value = build_int_cst (TREE_TYPE (field),
DECL_ALIGN_UNIT (decl));
elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
elt->index = field;
elt->value = null_pointer_node;
elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
+ field = DECL_CHAIN (field);
elt->index = field;
elt->value = proxy;
@@ -2152,6 +2150,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
rtx decl_rtl, symbol;
section *sect;
+ /* This function is supposed to handle VARIABLES. Ensure we have one. */
+ gcc_assert (TREE_CODE (decl) == VAR_DECL);
+
if (! targetm.have_tls
&& TREE_CODE (decl) == VAR_DECL
&& DECL_THREAD_LOCAL_P (decl))
@@ -2190,12 +2191,6 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (DECL_EXTERNAL (decl))
return;
- /* Output no assembler code for a function declaration.
- Only definitions of functions output anything. */
-
- if (TREE_CODE (decl) == FUNCTION_DECL)
- return;
-
/* Do nothing for global register variables. */
if (DECL_RTL_SET_P (decl) && REG_P (DECL_RTL (decl)))
{
@@ -2328,7 +2323,7 @@ contains_pointers_p (tree type)
{
tree fields;
/* For a type that has fields, see if the fields have pointers. */
- for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
+ for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields))
if (TREE_CODE (fields) == FIELD_DECL
&& contains_pointers_p (TREE_TYPE (fields)))
return 1;
@@ -4913,7 +4908,7 @@ array_size_for_constructor (tree val)
tmp = TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (val)));
i = size_binop (MINUS_EXPR, fold_convert (sizetype, max_index),
fold_convert (sizetype, tmp));
- i = size_binop (PLUS_EXPR, i, build_int_cst (sizetype, 1));
+ i = size_binop (PLUS_EXPR, i, size_one_node);
/* Multiply by the array element unit size to find number of bytes. */
i = size_binop (MULT_EXPR, i, TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (val))));
@@ -5043,7 +5038,7 @@ output_constructor_regular_field (oc_local_state *local)
fieldsize = array_size_for_constructor (local->val);
/* Given a non-empty initialization, this field had
better be last. */
- gcc_assert (!fieldsize || !TREE_CHAIN (local->field));
+ gcc_assert (!fieldsize || !DECL_CHAIN (local->field));
}
else if (DECL_SIZE_UNIT (local->field))
{
@@ -5308,7 +5303,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
for (cnt = 0;
VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (exp), cnt, ce);
- cnt++, local.field = local.field ? TREE_CHAIN (local.field) : 0)
+ cnt++, local.field = local.field ? DECL_CHAIN (local.field) : 0)
{
local.val = ce->value;
local.index = NULL_TREE;
diff --git a/gcc/vec.c b/gcc/vec.c
index 078bcc63653..5b3b9a01fea 100644
--- a/gcc/vec.c
+++ b/gcc/vec.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "vec.h"
#include "coretypes.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "hashtab.h"
struct vec_prefix
diff --git a/gcc/vec.h b/gcc/vec.h
index 93a432df839..321b13fc2ce 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -190,6 +190,13 @@ along with GCC; see the file COPYING3. If not see
#define VEC_iterate(T,V,I,P) (VEC_OP(T,base,iterate)(VEC_BASE(V),I,&(P)))
+/* Convenience macro for reverse iteration. */
+
+#define FOR_EACH_VEC_ELT_REVERSE(T,V,I,P) \
+ for (I = VEC_length (T, (V)) - 1; \
+ VEC_iterate (T, (V), (I), (P)); \
+ (I)--)
+
/* Allocate new vector.
VEC(T,A) *VEC_T_A_alloc(int reserve);
@@ -259,6 +266,32 @@ along with GCC; see the file COPYING3. If not see
#define VEC_reserve_exact(T,A,V,R) \
(VEC_OP(T,A,reserve_exact)(&(V),R VEC_CHECK_INFO MEM_STAT_INFO))
+/* Copy elements with no reallocation
+ void VEC_T_splice (VEC(T) *dst, VEC(T) *src); // Integer
+ void VEC_T_splice (VEC(T) *dst, VEC(T) *src); // Pointer
+ void VEC_T_splice (VEC(T) *dst, VEC(T) *src); // Object
+
+ Copy the elements in SRC to the end of DST as if by memcpy. DST and
+ SRC need not be allocated with the same mechanism, although they most
+ often will be. DST is assumed to have sufficient headroom
+ available. */
+
+#define VEC_splice(T,DST,SRC) \
+ (VEC_OP(T,base,splice)(VEC_BASE(DST), VEC_BASE(SRC) VEC_CHECK_INFO))
+
+/* Copy elements with reallocation
+ void VEC_T_safe_splice (VEC(T,A) *&dst, VEC(T) *src); // Integer
+ void VEC_T_safe_splice (VEC(T,A) *&dst, VEC(T) *src); // Pointer
+ void VEC_T_safe_splice (VEC(T,A) *&dst, VEC(T) *src); // Object
+
+ Copy the elements in SRC to the end of DST as if by memcpy. DST and
+ SRC need not be allocated with the same mechanism, although they most
+ often will be. DST need not have sufficient headroom and will be
+ reallocated if needed. */
+
+#define VEC_safe_splice(T,A,DST,SRC) \
+ (VEC_OP(T,A,safe_splice)(&(DST), VEC_BASE(SRC) VEC_CHECK_INFO MEM_STAT_INFO))
+
/* Push object with no reallocation
T *VEC_T_quick_push (VEC(T) *v, T obj); // Integer
T *VEC_T_quick_push (VEC(T) *v, T obj); // Pointer
@@ -391,7 +424,7 @@ along with GCC; see the file COPYING3. If not see
void VEC_T_block_remove (VEC(T) *v, unsigned ix, unsigned len);
Remove LEN elements starting at the IXth. Ordering is retained.
- This is an O(1) operation. */
+ This is an O(N) operation due to memmove. */
#define VEC_block_remove(T,V,I,L) \
(VEC_OP(T,base,block_remove)(VEC_BASE(V),I,L VEC_CHECK_INFO))
@@ -589,6 +622,19 @@ static inline int VEC_OP (T,base,space) \
return vec_ ? vec_->alloc - vec_->num >= (unsigned)alloc_ : !alloc_; \
} \
\
+static inline void VEC_OP(T,base,splice) \
+ (VEC(T,base) *dst_, VEC(T,base) *src_ VEC_CHECK_DECL) \
+{ \
+ if (src_) \
+ { \
+ unsigned len_ = src_->num; \
+ VEC_ASSERT (dst_->num + len_ <= dst_->alloc, "splice", T, base); \
+ \
+ memcpy (&dst_->vec[dst_->num], &src_->vec[0], len_ * sizeof (T)); \
+ dst_->num += len_; \
+ } \
+} \
+ \
static inline T *VEC_OP (T,base,quick_push) \
(VEC(T,base) *vec_, T obj_ VEC_CHECK_DECL) \
{ \
@@ -796,6 +842,19 @@ static inline void VEC_OP (T,A,safe_grow_cleared) \
sizeof (T) * (size_ - oldsize)); \
} \
\
+static inline void VEC_OP(T,A,safe_splice) \
+ (VEC(T,A) **dst_, VEC(T,base) *src_ VEC_CHECK_DECL MEM_STAT_DECL) \
+{ \
+ if (src_) \
+ { \
+ VEC_OP (T,A,reserve_exact) (dst_, src_->num \
+ VEC_CHECK_PASS MEM_STAT_INFO); \
+ \
+ VEC_OP (T,base,splice) (VEC_BASE (*dst_), src_ \
+ VEC_CHECK_PASS); \
+ } \
+} \
+ \
static inline T *VEC_OP (T,A,safe_push) \
(VEC(T,A) **vec_, T obj_ VEC_CHECK_DECL MEM_STAT_DECL) \
{ \
@@ -881,6 +940,19 @@ static inline int VEC_OP (T,base,space) \
return vec_ ? vec_->alloc - vec_->num >= (unsigned)alloc_ : !alloc_; \
} \
\
+static inline void VEC_OP(T,base,splice) \
+ (VEC(T,base) *dst_, VEC(T,base) *src_ VEC_CHECK_DECL) \
+{ \
+ if (src_) \
+ { \
+ unsigned len_ = src_->num; \
+ VEC_ASSERT (dst_->num + len_ <= dst_->alloc, "splice", T, base); \
+ \
+ memcpy (&dst_->vec[dst_->num], &src_->vec[0], len_ * sizeof (T)); \
+ dst_->num += len_; \
+ } \
+} \
+ \
static inline T *VEC_OP (T,base,quick_push) \
(VEC(T,base) *vec_, const T *obj_ VEC_CHECK_DECL) \
{ \
@@ -1084,6 +1156,19 @@ static inline void VEC_OP (T,A,safe_grow_cleared) \
sizeof (T) * (size_ - oldsize)); \
} \
\
+static inline void VEC_OP(T,A,safe_splice) \
+ (VEC(T,A) **dst_, VEC(T,base) *src_ VEC_CHECK_DECL MEM_STAT_DECL) \
+{ \
+ if (src_) \
+ { \
+ VEC_OP (T,A,reserve_exact) (dst_, src_->num \
+ VEC_CHECK_PASS MEM_STAT_INFO); \
+ \
+ VEC_OP (T,base,splice) (VEC_BASE (*dst_), src_ \
+ VEC_CHECK_PASS); \
+ } \
+} \
+ \
static inline T *VEC_OP (T,A,safe_push) \
(VEC(T,A) **vec_, const T *obj_ VEC_CHECK_DECL MEM_STAT_DECL) \
{ \
@@ -1188,6 +1273,19 @@ static inline void VEC_OP (T,A,safe_grow_cleared) \
sizeof (T) * (size_ - oldsize)); \
} \
\
+static inline void VEC_OP(T,A,safe_splice) \
+ (VEC(T,A) **dst_, VEC(T,base) *src_ VEC_CHECK_DECL MEM_STAT_DECL) \
+{ \
+ if (src_) \
+ { \
+ VEC_OP (T,A,reserve_exact) (dst_, src_->num \
+ VEC_CHECK_PASS MEM_STAT_INFO); \
+ \
+ VEC_OP (T,base,splice) (VEC_BASE (*dst_), src_ \
+ VEC_CHECK_PASS); \
+ } \
+} \
+ \
static inline T *VEC_OP (T,A,safe_push) \
(VEC(T,A) **vec_, const T obj_ VEC_CHECK_DECL MEM_STAT_DECL) \
{ \
diff --git a/gcc/web.c b/gcc/web.c
index ff917333f59..42292972926 100644
--- a/gcc/web.c
+++ b/gcc/web.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index f00aee00e5e..fa889789e78 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "rtl.h"
#include "flags.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
diff --git a/include/ChangeLog b/include/ChangeLog
index a9fb359cd3d..3fc2fa5e224 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-06 Ken Werner <ken.werner@de.ibm.com>
+
+ * floatformat.h (floatformat_ieee_half_big): Add declaration.
+ (floatformat_ieee_half_little): Likewise.
+
2010-06-21 Rafael Espindola <espindola@google.com>
* plugin-api.h (ld_plugin_set_extra_library_path): New.
diff --git a/include/floatformat.h b/include/floatformat.h
index c5f60a3cd93..0fc8e75dc8b 100644
--- a/include/floatformat.h
+++ b/include/floatformat.h
@@ -96,6 +96,8 @@ struct floatformat
/* floatformats for IEEE single and double, big and little endian. */
+extern const struct floatformat floatformat_ieee_half_big;
+extern const struct floatformat floatformat_ieee_half_little;
extern const struct floatformat floatformat_ieee_single_big;
extern const struct floatformat floatformat_ieee_single_little;
extern const struct floatformat floatformat_ieee_double_big;
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 01a71a8cd5c..bccfef30349 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-07 Neil Roberts <neil@linux.intel.com>
+
+ * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to
+ 16-bytes.
+
+2010-07-02 Jakub Jelinek <jakub@redhat.com>
+
+ * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes.
+ * Makefile.in: Regenerated.
+
2010-05-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index 6e414de707d..ccbefe64da6 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -65,6 +65,7 @@ AM_MAKEFLAGS = \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
+ "mandir=$(mandir)" \
"prefix=$(prefix)" \
"AR=$(AR)" \
"AS=$(AS)" \
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
index 375567c593e..3ac6d29b877 100644
--- a/libffi/Makefile.in
+++ b/libffi/Makefile.in
@@ -444,6 +444,7 @@ AM_MAKEFLAGS = \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
+ "mandir=$(mandir)" \
"prefix=$(prefix)" \
"AR=$(AR)" \
"AS=$(AS)" \
diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S
index 2e5e3da57f0..f3b0bd5ac52 100644
--- a/libffi/src/x86/sysv.S
+++ b/libffi/src/x86/sysv.S
@@ -48,6 +48,9 @@ ffi_call_SYSV:
movl 16(%ebp),%ecx
subl %ecx,%esp
+ /* Align the stack pointer to 16-bytes */
+ andl $0xfffffff0, %esp
+
movl %esp,%eax
/* Place all of the ffi_prep_args in position */
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index a261a056f69..c907fe14137 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config.host (powerpc*-eabispe*): Set tmake_file.
+ (powerpc*-eabi*): Likewise.
+ * config/rs6000/t-ppccomm (EXTRA_PARTS): Add crtbegin, crtend,
+ crtbeginS, crtendS, crtbeginT.
+
2010-06-12 Kazu Hirata <kazu@codesourcery.com>
* config.host (mips64*-*-linux*, mips*-*-linux*): Add mips/t-crtfm
diff --git a/libgcc/config.host b/libgcc/config.host
index 6784147d6d7..35dd2509938 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -458,6 +458,7 @@ powerpc*-*-freebsd*)
powerpc-*-netbsd*)
;;
powerpc-*-eabispe*)
+ tmake_file="${tmake_file} rs6000/t-ppccomm"
;;
powerpc-*-eabisimaltivec*)
;;
@@ -468,6 +469,7 @@ powerpc-*-elf*)
powerpc-*-eabialtivec*)
;;
powerpc-*-eabi*)
+ tmake_file="${tmake_file} rs6000/t-ppccomm"
;;
powerpc-*-rtems*)
;;
diff --git a/libgcc/config/rs6000/t-ppccomm b/libgcc/config/rs6000/t-ppccomm
index 1a711ebdb53..4548cd76c17 100644
--- a/libgcc/config/rs6000/t-ppccomm
+++ b/libgcc/config/rs6000/t-ppccomm
@@ -15,7 +15,9 @@ LIB2ADD_ST += crtsavfpr.S crtresfpr.S \
e500crtsavg64gpr.S \
e500crtsavg64gprctr.S
-EXTRA_PARTS += ecrti$(objext) ecrtn$(objext) ncrti$(objext) ncrtn$(objext)
+EXTRA_PARTS += crtbegin$(objext) crtend$(objext) \
+ crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
+ ecrti$(objext) ecrtn$(objext) ncrti$(objext) ncrtn$(objext)
# We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
# end labels to all of the special sections used when we link using gcc.
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0e5eb36da5f..9252a90f46d 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,114 @@
+2010-07-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/44953
+ * io/unix.c (mem_alloc_w4): Return gfc_char4_t instead of char type
+ pointer. (mem_write4): Remove cast to gfc_char4_t.
+ * io/transfer.c (write_block): Use a gfc_char4_t pointer.
+ (memset4): New helper function. (next_record_w): Use new helper
+ function rather than sset for internal units. Don't attempt to pad
+ with spaces if it is not needed.
+ * io/unix.h: Update prototype for mem_alloc_w4.
+ * io/write.c (memset4): Use gfc_char4_t pointer and chracter type.
+ Don't use multiply by 4 to compute offset. (memcpy4): Likewise.
+ (write_default_char4): Use a gfc_char4_t pointer and update memset4
+ and memcpy calls. (write_a): Likewise. (write_l): Likewise.
+ (write_boz): Likewise. (write_decimal): Likewise. (write_x): Likewise.
+ (write_char): Add support for character(kind=4) internal units that
+ was previously missed. (write_integer): Use a gfc_char4_t pointer and
+ update memset4 and memcpy calls. (write_character): Likewise.
+ (write_separator): Add support for character(kind=4) internal units
+ that was previously missed.
+ * write_float.def (output_float): Use a gfc_char4_t pointer and
+ update memset4 and memcpy calls. (write_infnan): Likewise.
+ (output_float_FMT_G_): Likewise.
+
+2010-07-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/37077
+ * io/read.c (read_default_char4): Add support for reading into a
+ kind-4 character variable from a character(kind=4) internal unit.
+ * io/io.h (read_block_form4): Add prototype.
+ * io/unit.c (get_internal_unit): Add call to fbuf_init.
+ (free_internal_unit): Add call to fbuf_destroy. (get_unit): Fix
+ whitespace.
+ * io/transfer.c (read_sf_internal): Use fbuf_alloc to allocate a string
+ to recieve the wide characters translated to single byte chracters.
+ (read_block_form): Fix whitespace. (read_block_form4): New function to
+ read from a character(kind=4) internal unit into a character(kind=4)
+ variable. (read_block_direct): Fix whitespace. (write_block): Fix
+ whitespace. (formatted_transfer_scalar_read): Likewise.
+ (formatted_transfer_scalar_write): Likewise.
+ * io/write.c (write_character): Add support for list directed write of
+ a kind=1 character string to a character(kind=4) internal unit.
+
+2010-07-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/44934
+ * io/file_pos.c (st_endfile): Correctly set unit flags for form.
+ * io/transfer.c (data_transfer_init): Fix indentation of whitespace.
+
+2010-07-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/37077
+ * io/read.c: Fix comment.
+ * io/io.h (is_char4_unit): New macro.
+ * io/unit.c (get_internal_unit): Call new function open_internal4.
+ * io/unix.c (mem_alloc_r4): New function. (mem_alloc_w4): New function.
+ (mem_read4): New function, temporary stub. (mem_write4): New function.
+ (open_internal4): New function to set stream pointers to use the new
+ mem functions.
+ * io/transfer.c (write_block): Use new mem_alloc_w4 to access internal
+ units of kind=4.
+ * io/unix.h: Add prototypes for open_internal4, mem_alloc_w4, and
+ mem_alloc_r4.
+ * io/write.c (memset4): New helper function. (memcpy4): New helper
+ function. (write_default_char4): Use new helper functions.
+ (write_a): Likewise. (write_l): Likewise. (write_boz): Likewise.
+ (write_decimal): Likewise. (write_x): Likewise.
+ (write_integer): Likewise.
+ * io/write_float.def (output_float): Add code blocks to handle internal
+ unit kind=4 output utilizing gfc_char4_t pointers. (write_infnan): Use
+ new helper functions. (OUTPUT_FLOAT_FMT_G): Update this macro likewise.
+
+2010-07-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/fpu-387.h [__sun__ && __svr4__] Include <signal.h>,
+ <ucontext.h>.
+ (sigill_caught): New.
+ (sigill_hdlr): New function
+ (has_sse) [__sun__ && __svr4__]: Check if SSE instruction causes
+ SIGILL.
+
+2010-07-11 Kai Tietz <kai.tietz@onevision.com>
+
+ PR libfortran/44698
+ * io/unix.c (flush_buf): Add _commit for WIN32.
+
+2010-06-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/43298
+ * list_read.c (parse_real): Do not pass (..) on for NAN(..).
+ * read.c (convert_real): Fix comment about NAN/INF.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gfortran_use_symver): Only check for Sun-style symbol
+ versioning on Solaris 2.
+ * configure: Regenerate.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Check for Sun symbol versioning.
+ * configure: Regenerate.
+
+ * Makefile.am [LIBGFOR_USE_SYMVER]: Protect version_arg with
+ LIBGFOR_USE_SYMVER_GNU.
+ Add version_dep.
+ [LIBGFOR_USE_SYMVER_SUN]: Handle Sun symbol versioning.
+ [!LIBGFOR_USE_SYMVER]: Add version_dep.
+ (libgfortran_la_DEPENDENCIES): Set to $(version_dep).
+ * Makefile.in: Regenerate.
+
2010-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/43298
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index bd767a2e679..9940caf57ba 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -8,9 +8,26 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
## Symbol versioning (copied from libssp).
if LIBGFOR_USE_SYMVER
+if LIBGFOR_USE_SYMVER_GNU
version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+version_dep = $(srcdir)/gfortran.map
+endif
+if LIBGFOR_USE_SYMVER_SUN
+version_arg = -Wl,-M,gfortran.map-sun
+version_dep = gfortran.map-sun
+gfortran.map-sun : $(srcdir)/gfortran.map \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(srcdir)/gfortran.map \
+ $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+ `echo $(libgfortran_la_LIBADD) | \
+ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
else
version_arg =
+version_dep =
endif
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
@@ -19,6 +36,7 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
toolexeclib_LTLIBRARIES = libgfortran.la
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) -lm $(extra_ldflags_libgfortran) $(version_arg)
+libgfortran_la_DEPENDENCIES = $(version_dep)
myexeclib_LTLIBRARIES = libgfortranbegin.la
myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index 9c39ea25d2a..880d00de167 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -453,13 +453,18 @@ top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I .. -I ../config
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@LIBGFOR_USE_SYMVER_FALSE@version_arg =
-@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,-M,gfortran.map-sun
+@LIBGFOR_USE_SYMVER_FALSE@version_dep =
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = $(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.map-sun
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
-no-undefined -bindir "$(bindir)"
toolexeclib_LTLIBRARIES = libgfortran.la
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) -lm $(extra_ldflags_libgfortran) $(version_arg)
+libgfortran_la_DEPENDENCIES = $(version_dep)
myexeclib_LTLIBRARIES = libgfortranbegin.la
myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
libgfortranbegin_la_SOURCES = fmain.c
@@ -5472,6 +5477,15 @@ uninstall-am: uninstall-myexeclibLTLIBRARIES \
uninstall-myexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@gfortran.map-sun : $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ `echo $(libgfortran_la_LIBADD) | \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ > $@ || (rm -f $@ ; exit 1)
# Turn on vectorization and loop unrolling for matmul.
$(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ftree-vectorize -funroll-loops
diff --git a/libgfortran/config/fpu-387.h b/libgfortran/config/fpu-387.h
index 573fabcac6d..5fe51b2d209 100644
--- a/libgfortran/config/fpu-387.h
+++ b/libgfortran/config/fpu-387.h
@@ -1,5 +1,5 @@
/* FPU-related code for x86 and x86_64 processors.
- Copyright 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -27,6 +27,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "cpuid.h"
#endif
+#if defined(__sun__) && defined(__svr4__)
+#include <signal.h>
+#include <ucontext.h>
+
+static volatile sig_atomic_t sigill_caught;
+
+static void
+sigill_hdlr (int sig __attribute((unused)),
+ siginfo_t *sip __attribute__((unused)),
+ ucontext_t *ucp)
+{
+ sigill_caught = 1;
+ /* Set PC to the instruction after the faulting one to skip over it,
+ otherwise we enter an infinite loop. 4 is the size of the stmxcsr
+ instruction. */
+ ucp->uc_mcontext.gregs[EIP] += 4;
+ setcontext (ucp);
+}
+#endif
+
static int
has_sse (void)
{
@@ -36,6 +56,31 @@ has_sse (void)
if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
return 0;
+#if defined(__sun__) && defined(__svr4__)
+ /* Solaris 2 before Solaris 9 4/04 cannot execute SSE instructions even
+ if the CPU supports them. Programs receive SIGILL instead, so check
+ for that at runtime. */
+
+ if (edx & bit_SSE)
+ {
+ struct sigaction act, oact;
+ unsigned int cw_sse;
+
+ act.sa_handler = sigill_hdlr;
+ sigemptyset (&act.sa_mask);
+ /* Need to set SA_SIGINFO so a ucontext_t * is passed to the handler. */
+ act.sa_flags = SA_SIGINFO;
+ sigaction (SIGILL, &act, &oact);
+
+ asm volatile ("stmxcsr %0" : "=m" (cw_sse));
+
+ sigaction (SIGILL, &oact, NULL);
+
+ if (sigill_caught)
+ return 0;
+ }
+#endif /* __sun__ && __svr4__ */
+
return edx & bit_SSE;
#else
return 1;
diff --git a/libgfortran/configure b/libgfortran/configure
index 002bc497ca0..7038d1a0540 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -630,6 +630,10 @@ RANLIB
AR
AS
SECTION_FLAGS
+LIBGFOR_USE_SYMVER_SUN_FALSE
+LIBGFOR_USE_SYMVER_SUN_TRUE
+LIBGFOR_USE_SYMVER_GNU_FALSE
+LIBGFOR_USE_SYMVER_GNU_TRUE
LIBGFOR_USE_SYMVER_FALSE
LIBGFOR_USE_SYMVER_TRUE
AM_CFLAGS
@@ -4414,13 +4418,13 @@ fi
# Check for symbol versioning (copied from libssp).
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5
$as_echo_n "checking whether symbol versioning is supported... " >&6; }
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
cat > conftest.map <<EOF
FOO_1.0 {
global: *foo*; bar; local: *;
};
EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
if test x$gcc_no_link = xyes; then
as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
@@ -4437,16 +4441,51 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- gfortran_use_symver=yes
+ gfortran_use_symver=gnu
+else
+ gfortran_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test x$gfortran_use_symver = xno; then
+ case "$target_os" in
+ solaris2*)
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gfortran_use_symver=sun
else
gfortran_use_symver=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ ;;
+ esac
+fi
LDFLAGS="$save_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gfortran_use_symver" >&5
$as_echo "$gfortran_use_symver" >&6; }
- if test "x$gfortran_use_symver" = xyes; then
+ if test "x$gfortran_use_symver" != xno; then
LIBGFOR_USE_SYMVER_TRUE=
LIBGFOR_USE_SYMVER_FALSE='#'
else
@@ -4454,6 +4493,22 @@ else
LIBGFOR_USE_SYMVER_FALSE=
fi
+ if test "x$gfortran_use_symver" = xgnu; then
+ LIBGFOR_USE_SYMVER_GNU_TRUE=
+ LIBGFOR_USE_SYMVER_GNU_FALSE='#'
+else
+ LIBGFOR_USE_SYMVER_GNU_TRUE='#'
+ LIBGFOR_USE_SYMVER_GNU_FALSE=
+fi
+
+ if test "x$gfortran_use_symver" = xsun; then
+ LIBGFOR_USE_SYMVER_SUN_TRUE=
+ LIBGFOR_USE_SYMVER_SUN_FALSE='#'
+else
+ LIBGFOR_USE_SYMVER_SUN_TRUE='#'
+ LIBGFOR_USE_SYMVER_SUN_FALSE=
+fi
+
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
# similarly to how libstdc++ does it
@@ -11307,7 +11362,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11310 "configure"
+#line 11365 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11413,7 +11468,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11416 "configure"
+#line 11471 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -25091,6 +25146,14 @@ if test -z "${LIBGFOR_USE_SYMVER_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_FALSE}"
as_fn_error "conditional \"LIBGFOR_USE_SYMVER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${LIBGFOR_USE_SYMVER_GNU_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_GNU_FALSE}"; then
+ as_fn_error "conditional \"LIBGFOR_USE_SYMVER_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGFOR_USE_SYMVER_SUN_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_SUN_FALSE}"; then
+ as_fn_error "conditional \"LIBGFOR_USE_SYMVER_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index e7e34a6fec2..8b9ac74c16a 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -138,17 +138,34 @@ AC_SUBST(CFLAGS)
# Check for symbol versioning (copied from libssp).
AC_MSG_CHECKING([whether symbol versioning is supported])
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
cat > conftest.map <<EOF
FOO_1.0 {
global: *foo*; bar; local: *;
};
EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
-AC_TRY_LINK([int foo;],[],[gfortran_use_symver=yes],[gfortran_use_symver=no])
+AC_TRY_LINK([int foo;],[],[gfortran_use_symver=gnu],[gfortran_use_symver=no])
+if test x$gfortran_use_symver = xno; then
+ case "$target_os" in
+ solaris2*)
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ AC_TRY_LINK([int foo;],[],[gfortran_use_symver=sun],[gfortran_use_symver=no])
+ ;;
+ esac
+fi
LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($gfortran_use_symver)
-AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" = xyes])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun])
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
# similarly to how libstdc++ does it
diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c
index e7fbab4c8cc..6d88d501bda 100644
--- a/libgfortran/io/file_pos.c
+++ b/libgfortran/io/file_pos.c
@@ -338,7 +338,14 @@ st_endfile (st_parameter_filepos *fpp)
memset (&u_flags, '\0', sizeof (u_flags));
u_flags.access = ACCESS_SEQUENTIAL;
u_flags.action = ACTION_READWRITE;
- u_flags.form = FORM_UNSPECIFIED;
+
+ /* Is it unformatted? */
+ if (!(fpp->common.flags & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT
+ | IOPARM_DT_IONML_SET)))
+ u_flags.form = FORM_UNFORMATTED;
+ else
+ u_flags.form = FORM_UNSPECIFIED;
+
u_flags.delim = DELIM_UNSPECIFIED;
u_flags.blank = BLANK_UNSPECIFIED;
u_flags.pad = PAD_UNSPECIFIED;
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index acbec77e62a..99553486f8b 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -59,6 +59,8 @@ struct gfc_unit;
#define is_stream_io(dtp) ((dtp)->u.p.current_unit->flags.access == ACCESS_STREAM)
+#define is_char4_unit(dtp) ((dtp)->u.p.unit_is_internal && (dtp)->common.unit)
+
/* The array_loop_spec contains the variables for the loops over index ranges
that are encountered. Since the variables can be negative, ssize_t
is used. */
@@ -642,6 +644,9 @@ internal_proto(type_name);
extern void * read_block_form (st_parameter_dt *, int *);
internal_proto(read_block_form);
+extern void * read_block_form4 (st_parameter_dt *, int *);
+internal_proto(read_block_form4);
+
extern void *write_block (st_parameter_dt *, int);
internal_proto(write_block);
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 72016b73e29..c88edf69cb4 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1206,10 +1206,7 @@ parse_real (st_parameter_dt *dtp, void *buffer, int length)
for ( ; c != ')'; c = next_char (dtp))
if (is_separator (c))
goto bad;
- else
- push_char (dtp, c);
- push_char (dtp, ')');
c = next_char (dtp);
if (is_separator (c))
unget_char (dtp, c);
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index 873d26c4d83..357ee9f1e6a 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -40,7 +40,7 @@ typedef unsigned char uchar;
/* set_integer()-- All of the integer assignments come here to
- * actually place the value into memory. */
+ actually place the value into memory. */
void
set_integer (void *dest, GFC_INTEGER_LARGEST value, int length)
@@ -131,11 +131,10 @@ max_value (int length, int signed_flag)
/* convert_real()-- Convert a character representation of a floating
- * point number to the machine number. Returns nonzero if there is a
- * range problem during conversion. Note: many architectures
- * (e.g. IA-64, HP-PA) require that the storage pointed to by the dest
- * argument is properly aligned for the type in question. TODO:
- * handle not-a-numbers and infinities. */
+ point number to the machine number. Returns nonzero if there is a
+ range problem during conversion. Note: many architectures
+ (e.g. IA-64, HP-PA) require that the storage pointed to by the dest
+ argument is properly aligned for the type in question. */
int
convert_real (st_parameter_dt *dtp, void *dest, const char *buffer, int length)
@@ -384,26 +383,51 @@ read_utf8_char4 (st_parameter_dt *dtp, void *p, int len, int width)
static void
read_default_char4 (st_parameter_dt *dtp, char *p, int len, int width)
{
- char *s;
- gfc_char4_t *dest;
int m, n;
+ gfc_char4_t *dest;
- s = read_block_form (dtp, &width);
-
- if (s == NULL)
- return;
- if (width > len)
- s += (width - len);
+ if (is_char4_unit(dtp))
+ {
+ gfc_char4_t *s4;
- m = ((int) width > len) ? len : (int) width;
-
- dest = (gfc_char4_t *) p;
-
- for (n = 0; n < m; n++, dest++, s++)
- *dest = (unsigned char ) *s;
+ s4 = (gfc_char4_t *) read_block_form4 (dtp, &width);
+
+ if (s4 == NULL)
+ return;
+ if (width > len)
+ s4 += (width - len);
- for (n = 0; n < len - (int) width; n++, dest++)
- *dest = (unsigned char) ' ';
+ m = ((int) width > len) ? len : (int) width;
+
+ dest = (gfc_char4_t *) p;
+
+ for (n = 0; n < m; n++)
+ *dest++ = *s4++;
+
+ for (n = 0; n < len - (int) width; n++)
+ *dest++ = (gfc_char4_t) ' ';
+ }
+ else
+ {
+ char *s;
+
+ s = read_block_form (dtp, &width);
+
+ if (s == NULL)
+ return;
+ if (width > len)
+ s += (width - len);
+
+ m = ((int) width > len) ? len : (int) width;
+
+ dest = (gfc_char4_t *) p;
+
+ for (n = 0; n < m; n++, dest++, s++)
+ *dest = (unsigned char ) *s;
+
+ for (n = 0; n < len - (int) width; n++, dest++)
+ *dest = (unsigned char) ' ';
+ }
}
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index f44c02538a9..f750a568df4 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -177,18 +177,6 @@ current_mode (st_parameter_dt *dtp)
/* Mid level data transfer statements. */
-/* When reading sequential formatted records we have a problem. We
- don't know how long the line is until we read the trailing newline,
- and we don't want to read too much. If we read too much, we might
- have to do a physical seek backwards depending on how much data is
- present, and devices like terminals aren't seekable and would cause
- an I/O error.
-
- Given this, the solution is to read a byte at a time, stopping if
- we hit the newline. For small allocations, we use a static buffer.
- For larger allocations, we are forced to allocate memory on the
- heap. Hopefully this won't happen very often. */
-
/* Read sequential file - internal unit */
static char *
@@ -214,7 +202,18 @@ read_sf_internal (st_parameter_dt *dtp, int * length)
}
lorig = *length;
- base = mem_alloc_r (dtp->u.p.current_unit->s, length);
+ if (is_char4_unit(dtp))
+ {
+ int i;
+ gfc_char4_t *p = (gfc_char4_t *) mem_alloc_r4 (dtp->u.p.current_unit->s,
+ length);
+ base = fbuf_alloc (dtp->u.p.current_unit, lorig);
+ for (i = 0; i < *length; i++, p++)
+ base[i] = *p > 255 ? '?' : (unsigned char) *p;
+ }
+ else
+ base = mem_alloc_r (dtp->u.p.current_unit->s, length);
+
if (unlikely (lorig > *length))
{
hit_eof (dtp);
@@ -230,6 +229,18 @@ read_sf_internal (st_parameter_dt *dtp, int * length)
}
+/* When reading sequential formatted records we have a problem. We
+ don't know how long the line is until we read the trailing newline,
+ and we don't want to read too much. If we read too much, we might
+ have to do a physical seek backwards depending on how much data is
+ present, and devices like terminals aren't seekable and would cause
+ an I/O error.
+
+ Given this, the solution is to read a byte at a time, stopping if
+ we hit the newline. For small allocations, we use a static buffer.
+ For larger allocations, we are forced to allocate memory on the
+ heap. Hopefully this won't happen very often. */
+
/* Read sequential file - external unit */
static char *
@@ -429,7 +440,7 @@ read_block_form (st_parameter_dt *dtp, int * nbytes)
dtp->u.p.size_used += (GFC_IO_INT) *nbytes;
if (norig != *nbytes)
- {
+ {
/* Short read, this shouldn't happen. */
if (!dtp->u.p.current_unit->pad_status == PAD_YES)
{
@@ -444,6 +455,52 @@ read_block_form (st_parameter_dt *dtp, int * nbytes)
}
+/* Read a block from a character(kind=4) internal unit, to be transferred into
+ a character(kind=4) variable. Note: Portions of this code borrowed from
+ read_sf_internal. */
+void *
+read_block_form4 (st_parameter_dt *dtp, int * nbytes)
+{
+ static gfc_char4_t *empty_string[0];
+ gfc_char4_t *source;
+ int lorig;
+
+ if (dtp->u.p.current_unit->bytes_left < (gfc_offset) *nbytes)
+ *nbytes = dtp->u.p.current_unit->bytes_left;
+
+ /* Zero size array gives internal unit len of 0. Nothing to read. */
+ if (dtp->internal_unit_len == 0
+ && dtp->u.p.current_unit->pad_status == PAD_NO)
+ hit_eof (dtp);
+
+ /* If we have seen an eor previously, return a length of 0. The
+ caller is responsible for correctly padding the input field. */
+ if (dtp->u.p.sf_seen_eor)
+ {
+ *nbytes = 0;
+ /* Just return something that isn't a NULL pointer, otherwise the
+ caller thinks an error occured. */
+ return empty_string;
+ }
+
+ lorig = *nbytes;
+ source = (gfc_char4_t *) mem_alloc_r4 (dtp->u.p.current_unit->s, nbytes);
+
+ if (unlikely (lorig > *nbytes))
+ {
+ hit_eof (dtp);
+ return NULL;
+ }
+
+ dtp->u.p.current_unit->bytes_left -= *nbytes;
+
+ if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+ dtp->u.p.size_used += (GFC_IO_INT) *nbytes;
+
+ return source;
+}
+
+
/* Reads a block directly into application data space. This is for
unformatted files. */
@@ -560,7 +617,6 @@ read_block_direct (st_parameter_dt *dtp, void *buf, size_t nbytes)
have_read_record += have_read_subrecord;
if (unlikely (to_read_subrecord != have_read_subrecord))
-
{
/* Short read, e.g. if we hit EOF. This means the record
structure has been corrupted, or the trailing record
@@ -639,25 +695,37 @@ write_block (st_parameter_dt *dtp, int length)
if (is_internal_unit (dtp))
{
- dest = mem_alloc_w (dtp->u.p.current_unit->s, &length);
+ if (dtp->common.unit) /* char4 internel unit. */
+ {
+ gfc_char4_t *dest4;
+ dest4 = mem_alloc_w4 (dtp->u.p.current_unit->s, &length);
+ if (dest4 == NULL)
+ {
+ generate_error (&dtp->common, LIBERROR_END, NULL);
+ return NULL;
+ }
+ return dest4;
+ }
+ else
+ dest = mem_alloc_w (dtp->u.p.current_unit->s, &length);
- if (dest == NULL)
- {
- generate_error (&dtp->common, LIBERROR_END, NULL);
- return NULL;
- }
+ if (dest == NULL)
+ {
+ generate_error (&dtp->common, LIBERROR_END, NULL);
+ return NULL;
+ }
- if (unlikely (dtp->u.p.current_unit->endfile == AT_ENDFILE))
- generate_error (&dtp->common, LIBERROR_END, NULL);
+ if (unlikely (dtp->u.p.current_unit->endfile == AT_ENDFILE))
+ generate_error (&dtp->common, LIBERROR_END, NULL);
}
else
{
dest = fbuf_alloc (dtp->u.p.current_unit, length);
if (dest == NULL)
- {
- generate_error (&dtp->common, LIBERROR_OS, NULL);
- return NULL;
- }
+ {
+ generate_error (&dtp->common, LIBERROR_OS, NULL);
+ return NULL;
+ }
}
if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
@@ -1254,7 +1322,7 @@ formatted_transfer_scalar_read (st_parameter_dt *dtp, bt type, void *p, int kind
consume_data_flag = 0;
dtp->u.p.current_unit->decimal_status = DECIMAL_POINT;
break;
-
+
case FMT_RC:
consume_data_flag = 0;
dtp->u.p.current_unit->round_status = ROUND_COMPATIBLE;
@@ -1535,7 +1603,7 @@ formatted_transfer_scalar_write (st_parameter_dt *dtp, bt type, void *p, int kin
write_i (dtp, f, p, kind);
break;
case BT_LOGICAL:
- write_l (dtp, f, p, kind);
+ write_l (dtp, f, p, kind);
break;
case BT_CHARACTER:
if (kind == 4)
@@ -2132,49 +2200,49 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
dtp->u.p.current_unit = get_unit (dtp, 1);
if (dtp->u.p.current_unit->s == NULL)
- { /* Open the unit with some default flags. */
- st_parameter_open opp;
- unit_convert conv;
+ { /* Open the unit with some default flags. */
+ st_parameter_open opp;
+ unit_convert conv;
- if (dtp->common.unit < 0)
- {
- close_unit (dtp->u.p.current_unit);
- dtp->u.p.current_unit = NULL;
- generate_error (&dtp->common, LIBERROR_BAD_OPTION,
- "Bad unit number in statement");
- return;
- }
- memset (&u_flags, '\0', sizeof (u_flags));
- u_flags.access = ACCESS_SEQUENTIAL;
- u_flags.action = ACTION_READWRITE;
-
- /* Is it unformatted? */
- if (!(cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT
- | IOPARM_DT_IONML_SET)))
- u_flags.form = FORM_UNFORMATTED;
- else
- u_flags.form = FORM_UNSPECIFIED;
-
- u_flags.delim = DELIM_UNSPECIFIED;
- u_flags.blank = BLANK_UNSPECIFIED;
- u_flags.pad = PAD_UNSPECIFIED;
- u_flags.decimal = DECIMAL_UNSPECIFIED;
- u_flags.encoding = ENCODING_UNSPECIFIED;
- u_flags.async = ASYNC_UNSPECIFIED;
- u_flags.round = ROUND_UNSPECIFIED;
- u_flags.sign = SIGN_UNSPECIFIED;
-
- u_flags.status = STATUS_UNKNOWN;
-
- conv = get_unformatted_convert (dtp->common.unit);
-
- if (conv == GFC_CONVERT_NONE)
- conv = compile_options.convert;
-
- /* We use big_endian, which is 0 on little-endian machines
- and 1 on big-endian machines. */
- switch (conv)
- {
+ if (dtp->common.unit < 0)
+ {
+ close_unit (dtp->u.p.current_unit);
+ dtp->u.p.current_unit = NULL;
+ generate_error (&dtp->common, LIBERROR_BAD_OPTION,
+ "Bad unit number in statement");
+ return;
+ }
+ memset (&u_flags, '\0', sizeof (u_flags));
+ u_flags.access = ACCESS_SEQUENTIAL;
+ u_flags.action = ACTION_READWRITE;
+
+ /* Is it unformatted? */
+ if (!(cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT
+ | IOPARM_DT_IONML_SET)))
+ u_flags.form = FORM_UNFORMATTED;
+ else
+ u_flags.form = FORM_UNSPECIFIED;
+
+ u_flags.delim = DELIM_UNSPECIFIED;
+ u_flags.blank = BLANK_UNSPECIFIED;
+ u_flags.pad = PAD_UNSPECIFIED;
+ u_flags.decimal = DECIMAL_UNSPECIFIED;
+ u_flags.encoding = ENCODING_UNSPECIFIED;
+ u_flags.async = ASYNC_UNSPECIFIED;
+ u_flags.round = ROUND_UNSPECIFIED;
+ u_flags.sign = SIGN_UNSPECIFIED;
+
+ u_flags.status = STATUS_UNKNOWN;
+
+ conv = get_unformatted_convert (dtp->common.unit);
+
+ if (conv == GFC_CONVERT_NONE)
+ conv = compile_options.convert;
+
+ /* We use big_endian, which is 0 on little-endian machines
+ and 1 on big-endian machines. */
+ switch (conv)
+ {
case GFC_CONVERT_NATIVE:
case GFC_CONVERT_SWAP:
break;
@@ -2190,18 +2258,18 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
default:
internal_error (&opp.common, "Illegal value for CONVERT");
break;
- }
+ }
- u_flags.convert = conv;
+ u_flags.convert = conv;
- opp.common = dtp->common;
- opp.common.flags &= IOPARM_COMMON_MASK;
- dtp->u.p.current_unit = new_unit (&opp, dtp->u.p.current_unit, &u_flags);
- dtp->common.flags &= ~IOPARM_COMMON_MASK;
- dtp->common.flags |= (opp.common.flags & IOPARM_COMMON_MASK);
- if (dtp->u.p.current_unit == NULL)
- return;
- }
+ opp.common = dtp->common;
+ opp.common.flags &= IOPARM_COMMON_MASK;
+ dtp->u.p.current_unit = new_unit (&opp, dtp->u.p.current_unit, &u_flags);
+ dtp->common.flags &= ~IOPARM_COMMON_MASK;
+ dtp->common.flags |= (opp.common.flags & IOPARM_COMMON_MASK);
+ if (dtp->u.p.current_unit == NULL)
+ return;
+ }
/* Check the action. */
@@ -3027,6 +3095,14 @@ sset (stream * s, int c, ssize_t nbyte)
return nbyte - bytes_left;
}
+static inline void
+memset4 (gfc_char4_t *p, gfc_char4_t c, int k)
+{
+ int j;
+ for (j = 0; j < k; j++)
+ *p++ = c;
+}
+
/* Position to the next record in write mode. */
static void
@@ -3077,6 +3153,7 @@ next_record_w (st_parameter_dt *dtp, int done)
if (is_internal_unit (dtp))
{
+ char *p;
if (is_array_io (dtp))
{
int finished;
@@ -3101,11 +3178,17 @@ next_record_w (st_parameter_dt *dtp, int done)
length = (int) (dtp->u.p.current_unit->recl - max_pos);
}
- if (sset (dtp->u.p.current_unit->s, ' ', length) != length)
- {
- generate_error (&dtp->common, LIBERROR_END, NULL);
- return;
+ p = write_block (dtp, length);
+ if (p == NULL)
+ return;
+
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, ' ', length);
}
+ else
+ memset (p, ' ', length);
/* Now that the current record has been padded out,
determine where the next record in the array is. */
@@ -3150,11 +3233,19 @@ next_record_w (st_parameter_dt *dtp, int done)
else
length = (int) dtp->u.p.current_unit->bytes_left;
}
-
- if (sset (dtp->u.p.current_unit->s, ' ', length) != length)
+ if (length > 0)
{
- generate_error (&dtp->common, LIBERROR_END, NULL);
- return;
+ p = write_block (dtp, length);
+ if (p == NULL)
+ return;
+
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, (gfc_char4_t) ' ', length);
+ }
+ else
+ memset (p, ' ', length);
}
}
}
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index bbe112010ba..a0018dbb4f7 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -423,9 +423,16 @@ get_internal_unit (st_parameter_dt *dtp)
}
/* Set initial values for unit parameters. */
+ if (dtp->common.unit)
+ {
+ iunit->s = open_internal4 (dtp->internal_unit - start_record,
+ dtp->internal_unit_len, -start_record);
+ fbuf_init (iunit, 256);
+ }
+ else
+ iunit->s = open_internal (dtp->internal_unit - start_record,
+ dtp->internal_unit_len, -start_record);
- iunit->s = open_internal (dtp->internal_unit - start_record,
- dtp->internal_unit_len, -start_record);
iunit->bytes_left = iunit->recl;
iunit->last_record=0;
iunit->maxrec=0;
@@ -471,6 +478,9 @@ free_internal_unit (st_parameter_dt *dtp)
if (!is_internal_unit (dtp))
return;
+ if (unlikely (is_char4_unit (dtp)))
+ fbuf_destroy (dtp->u.p.current_unit);
+
if (dtp->u.p.current_unit != NULL)
{
if (dtp->u.p.current_unit->ls != NULL)
@@ -493,7 +503,7 @@ get_unit (st_parameter_dt *dtp, int do_create)
{
if ((dtp->common.flags & IOPARM_DT_HAS_INTERNAL_UNIT) != 0)
- return get_internal_unit(dtp);
+ return get_internal_unit (dtp);
/* Has to be an external unit. */
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index f0cd3b9b16c..3a795aef536 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -405,6 +405,10 @@ buf_flush (unix_stream * s)
if (s->ndirty != 0)
return -1;
+#ifdef _WIN32
+ _commit (s->fd);
+#endif
+
return 0;
}
@@ -594,7 +598,6 @@ buf_init (unix_stream * s)
*********************************************************************/
-
char *
mem_alloc_r (stream * strm, int * len)
{
@@ -616,6 +619,26 @@ mem_alloc_r (stream * strm, int * len)
char *
+mem_alloc_r4 (stream * strm, int * len)
+{
+ unix_stream * s = (unix_stream *) strm;
+ gfc_offset n;
+ gfc_offset where = s->logical_offset;
+
+ if (where < s->buffer_offset || where > s->buffer_offset + s->active)
+ return NULL;
+
+ n = s->buffer_offset + s->active - where;
+ if (*len > n)
+ *len = n;
+
+ s->logical_offset = where + *len;
+
+ return s->buffer + (where - s->buffer_offset) * 4;
+}
+
+
+char *
mem_alloc_w (stream * strm, int * len)
{
unix_stream * s = (unix_stream *) strm;
@@ -636,7 +659,28 @@ mem_alloc_w (stream * strm, int * len)
}
-/* Stream read function for internal units. */
+gfc_char4_t *
+mem_alloc_w4 (stream * strm, int * len)
+{
+ unix_stream * s = (unix_stream *) strm;
+ gfc_offset m;
+ gfc_offset where = s->logical_offset;
+ gfc_char4_t *result = (gfc_char4_t *) s->buffer;
+
+ m = where + *len;
+
+ if (where < s->buffer_offset)
+ return NULL;
+
+ if (m > s->file_length)
+ return NULL;
+
+ s->logical_offset = m;
+ return &result[where - s->buffer_offset];
+}
+
+
+/* Stream read function for character(kine=1) internal units. */
static ssize_t
mem_read (stream * s, void * buf, ssize_t nbytes)
@@ -655,9 +699,26 @@ mem_read (stream * s, void * buf, ssize_t nbytes)
}
-/* Stream write function for internal units. This is not actually used
- at the moment, as all internal IO is formatted and the formatted IO
- routines use mem_alloc_w_at. */
+/* Stream read function for chracter(kind=4) internal units. */
+
+static ssize_t
+mem_read4 (stream * s, void * buf, ssize_t nbytes)
+{
+ void *p;
+ int nb = nbytes;
+
+ p = mem_alloc_r (s, &nb);
+ if (p)
+ {
+ memcpy (buf, p, nb);
+ return (ssize_t) nb;
+ }
+ else
+ return 0;
+}
+
+
+/* Stream write function for character(kind=1) internal units. */
static ssize_t
mem_write (stream * s, const void * buf, ssize_t nbytes)
@@ -676,6 +737,26 @@ mem_write (stream * s, const void * buf, ssize_t nbytes)
}
+/* Stream write function for character(kind=4) internal units. */
+
+static ssize_t
+mem_write4 (stream * s, const void * buf, ssize_t nwords)
+{
+ gfc_char4_t *p;
+ int nw = nwords;
+
+ p = mem_alloc_w4 (s, &nw);
+ if (p)
+ {
+ while (nw--)
+ *p++ = (gfc_char4_t) *((char *) buf);
+ return nwords;
+ }
+ else
+ return 0;
+}
+
+
static gfc_offset
mem_seek (stream * strm, gfc_offset offset, int whence)
{
@@ -759,7 +840,8 @@ empty_internal_buffer(stream *strm)
memset(s->buffer, ' ', s->file_length);
}
-/* open_internal()-- Returns a stream structure from an internal file */
+/* open_internal()-- Returns a stream structure from a character(kind=1)
+ internal file */
stream *
open_internal (char *base, int length, gfc_offset offset)
@@ -786,6 +868,34 @@ open_internal (char *base, int length, gfc_offset offset)
return (stream *) s;
}
+/* open_internal4()-- Returns a stream structure from a character(kind=4)
+ internal file */
+
+stream *
+open_internal4 (char *base, int length, gfc_offset offset)
+{
+ unix_stream *s;
+
+ s = get_mem (sizeof (unix_stream));
+ memset (s, '\0', sizeof (unix_stream));
+
+ s->buffer = base;
+ s->buffer_offset = offset;
+
+ s->logical_offset = 0;
+ s->active = s->file_length = length;
+
+ s->st.close = (void *) mem_close;
+ s->st.seek = (void *) mem_seek;
+ s->st.tell = (void *) mem_tell;
+ s->st.trunc = (void *) mem_truncate;
+ s->st.read = (void *) mem_read4;
+ s->st.write = (void *) mem_write4;
+ s->st.flush = (void *) mem_flush;
+
+ return (stream *) s;
+}
+
/* fd_to_stream()-- Given an open file descriptor, build a stream
* around it. */
diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h
index c7f92a34c6f..3229d502547 100644
--- a/libgfortran/io/unix.h
+++ b/libgfortran/io/unix.h
@@ -94,12 +94,21 @@ internal_proto(open_external);
extern stream *open_internal (char *, int, gfc_offset);
internal_proto(open_internal);
+extern stream *open_internal4 (char *, int, gfc_offset);
+internal_proto(open_internal4);
+
extern char * mem_alloc_w (stream *, int *);
internal_proto(mem_alloc_w);
extern char * mem_alloc_r (stream *, int *);
internal_proto(mem_alloc_r);
+extern gfc_char4_t * mem_alloc_w4 (stream *, int *);
+internal_proto(mem_alloc_w4);
+
+extern char * mem_alloc_r4 (stream *, int *);
+internal_proto(mem_alloc_r4);
+
extern stream *input_stream (void);
internal_proto(input_stream);
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index ee2ce0c3915..775425d6d77 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -36,10 +36,32 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <errno.h>
#define star_fill(p, n) memset(p, '*', n)
-#include "write_float.def"
-
typedef unsigned char uchar;
+/* Helper functions for character(kind=4) internal units. These are needed
+ by write_float.def. */
+
+static inline void
+memset4 (gfc_char4_t *p, gfc_char4_t c, int k)
+{
+ int j;
+ for (j = 0; j < k; j++)
+ *p++ = c;
+}
+
+static inline void
+memcpy4 (gfc_char4_t *dest, const char *source, int k)
+{
+ int j;
+
+ const char *p = source;
+ for (j = 0; j < k; j++)
+ *dest++ = (gfc_char4_t) *p++;
+}
+
+/* This include contains the heart and soul of formatted floating point. */
+#include "write_float.def"
+
/* Write out default char4. */
static void
@@ -58,7 +80,13 @@ write_default_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
p = write_block (dtp, k);
if (p == NULL)
return;
- memset (p, ' ', k);
+ if (is_char4_unit (dtp))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, ' ', k);
+ }
+ else
+ memset (p, ' ', k);
}
/* Get ready to handle delimiters if needed. */
@@ -76,25 +104,48 @@ write_default_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
}
/* Now process the remaining characters, one at a time. */
- for (j = k; j < src_len; j++)
+ for (j = 0; j < src_len; j++)
{
c = source[j];
-
- /* Handle delimiters if any. */
- if (c == d && d != ' ')
+ if (is_char4_unit (dtp))
{
- p = write_block (dtp, 2);
- if (p == NULL)
- return;
- *p++ = (uchar) c;
+ gfc_char4_t *q;
+ /* Handle delimiters if any. */
+ if (c == d && d != ' ')
+ {
+ p = write_block (dtp, 2);
+ if (p == NULL)
+ return;
+ q = (gfc_char4_t *) p;
+ *q++ = c;
+ }
+ else
+ {
+ p = write_block (dtp, 1);
+ if (p == NULL)
+ return;
+ q = (gfc_char4_t *) p;
+ }
+ *q = c;
}
else
{
- p = write_block (dtp, 1);
- if (p == NULL)
- return;
+ /* Handle delimiters if any. */
+ if (c == d && d != ' ')
+ {
+ p = write_block (dtp, 2);
+ if (p == NULL)
+ return;
+ *p++ = (uchar) c;
+ }
+ else
+ {
+ p = write_block (dtp, 1);
+ if (p == NULL)
+ return;
+ }
+ *p = c > 255 ? '?' : (uchar) c;
}
- *p = c > 255 ? '?' : (uchar) c;
}
}
@@ -258,6 +309,19 @@ write_a (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
if (p == NULL)
return;
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ if (wlen < len)
+ memcpy4 (p4, source, wlen);
+ else
+ {
+ memset4 (p4, ' ', wlen - len);
+ memcpy4 (p4 + wlen - len, source, len);
+ }
+ return;
+ }
+
if (wlen < len)
memcpy (p, source, wlen);
else
@@ -478,8 +542,17 @@ write_l (st_parameter_dt *dtp, const fnode *f, char *source, int len)
if (p == NULL)
return;
- memset (p, ' ', wlen - 1);
n = extract_int (source, len);
+
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, ' ', wlen -1);
+ p4[wlen - 1] = (n) ? 'T' : 'F';
+ return;
+ }
+
+ memset (p, ' ', wlen -1);
p[wlen - 1] = (n) ? 'T' : 'F';
}
@@ -503,8 +576,13 @@ write_boz (st_parameter_dt *dtp, const fnode *f, const char *q, int n)
p = write_block (dtp, w);
if (p == NULL)
return;
-
- memset (p, ' ', w);
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, ' ', w);
+ }
+ else
+ memset (p, ' ', w);
goto done;
}
@@ -528,6 +606,35 @@ write_boz (st_parameter_dt *dtp, const fnode *f, const char *q, int n)
nblank = w - (nzero + digits);
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ if (nblank < 0)
+ {
+ memset4 (p4, '*', w);
+ return;
+ }
+
+ if (!dtp->u.p.no_leading_blank)
+ {
+ memset4 (p4, ' ', nblank);
+ q += nblank;
+ memset4 (p4, '0', nzero);
+ q += nzero;
+ memcpy4 (p4, q, digits);
+ }
+ else
+ {
+ memset4 (p4, '0', nzero);
+ q += nzero;
+ memcpy4 (p4, q, digits);
+ q += digits;
+ memset4 (p4, ' ', nblank);
+ dtp->u.p.no_leading_blank = 0;
+ }
+ return;
+ }
+
if (nblank < 0)
{
star_fill (p, w);
@@ -582,8 +689,13 @@ write_decimal (st_parameter_dt *dtp, const fnode *f, const char *source,
p = write_block (dtp, w);
if (p == NULL)
return;
-
- memset (p, ' ', w);
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, ' ', w);
+ }
+ else
+ memset (p, ' ', w);
goto done;
}
@@ -621,6 +733,37 @@ write_decimal (st_parameter_dt *dtp, const fnode *f, const char *source,
nblank = w - (nsign + nzero + digits);
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t * p4 = (gfc_char4_t *) p;
+ if (nblank < 0)
+ {
+ memset4 (p4, '*', w);
+ goto done;
+ }
+
+ memset4 (p4, ' ', nblank);
+ p4 += nblank;
+
+ switch (sign)
+ {
+ case S_PLUS:
+ *p4++ = '+';
+ break;
+ case S_MINUS:
+ *p4++ = '-';
+ break;
+ case S_NONE:
+ break;
+ }
+
+ memset4 (p4, '0', nzero);
+ p4 += nzero;
+
+ memcpy4 (p4, q, digits);
+ return;
+ }
+
if (nblank < 0)
{
star_fill (p, w);
@@ -1055,7 +1198,15 @@ write_x (st_parameter_dt *dtp, int len, int nspaces)
if (p == NULL)
return;
if (nspaces > 0 && len - nspaces >= 0)
- memset (&p[len - nspaces], ' ', nspaces);
+ {
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (&p4[len - nspaces], ' ', nspaces);
+ }
+ else
+ memset (&p[len - nspaces], ' ', nspaces);
+ }
}
@@ -1066,15 +1217,21 @@ write_x (st_parameter_dt *dtp, int len, int nspaces)
something goes wrong. */
static int
-write_char (st_parameter_dt *dtp, char c)
+write_char (st_parameter_dt *dtp, int c)
{
char *p;
p = write_block (dtp, 1);
if (p == NULL)
return 1;
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ *p4 = c;
+ return 0;
+ }
- *p = c;
+ *p = (uchar) c;
return 0;
}
@@ -1132,6 +1289,23 @@ write_integer (st_parameter_dt *dtp, const char *source, int length)
p = write_block (dtp, width);
if (p == NULL)
return;
+
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ if (dtp->u.p.no_leading_blank)
+ {
+ memcpy4 (p4, q, digits);
+ memset4 (p4 + digits, ' ', width - digits);
+ }
+ else
+ {
+ memset4 (p4, ' ', width - digits);
+ memcpy4 (p4 + width - digits, q, digits);
+ }
+ return;
+ }
+
if (dtp->u.p.no_leading_blank)
{
memcpy (p, q, digits);
@@ -1184,6 +1358,29 @@ write_character (st_parameter_dt *dtp, const char *source, int kind, int length)
if (p == NULL)
return;
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t d4 = (gfc_char4_t) d;
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+
+ if (d4 == ' ')
+ memcpy4 (p4, source, length);
+ else
+ {
+ *p4++ = d4;
+
+ for (i = 0; i < length; i++)
+ {
+ *p4++ = (gfc_char4_t) source[i];
+ if (source[i] == d)
+ *p4++ = d4;
+ }
+
+ *p4 = d4;
+ }
+ return;
+ }
+
if (d == ' ')
memcpy (p, source, length);
else
@@ -1316,8 +1513,13 @@ write_separator (st_parameter_dt *dtp)
p = write_block (dtp, options.separator_len);
if (p == NULL)
return;
-
- memcpy (p, options.separator, options.separator_len);
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memcpy4 (p4, options.separator, options.separator_len);
+ }
+ else
+ memcpy (p, options.separator, options.separator_len);
}
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 45c2a17a50d..776e5911993 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -127,6 +127,14 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
out = write_block (dtp, w);
if (out == NULL)
return;
+
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *out4 = (gfc_char4_t *) out;
+ *out4 = '0';
+ return;
+ }
+
*out = '0';
return;
}
@@ -430,6 +438,12 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
/* Check the value fits in the specified field width. */
if (nblanks < 0 || edigits == -1)
{
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *out4 = (gfc_char4_t *) out;
+ memset4 (out4, '*', w);
+ return;
+ }
star_fill (out, w);
return;
}
@@ -443,6 +457,105 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
else
leadzero = 0;
+ /* For internal character(kind=4) units, we duplicate the code used for
+ regular output slightly modified. This needs to be maintained
+ consistent with the regular code that follows this block. */
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *out4 = (gfc_char4_t *) out;
+ /* Pad to full field width. */
+
+ if ( ( nblanks > 0 ) && !dtp->u.p.no_leading_blank)
+ {
+ memset4 (out4, ' ', nblanks);
+ out4 += nblanks;
+ }
+
+ /* Output the initial sign (if any). */
+ if (sign == S_PLUS)
+ *(out4++) = '+';
+ else if (sign == S_MINUS)
+ *(out4++) = '-';
+
+ /* Output an optional leading zero. */
+ if (leadzero)
+ *(out4++) = '0';
+
+ /* Output the part before the decimal point, padding with zeros. */
+ if (nbefore > 0)
+ {
+ if (nbefore > ndigits)
+ {
+ i = ndigits;
+ memcpy4 (out4, digits, i);
+ ndigits = 0;
+ while (i < nbefore)
+ out4[i++] = '0';
+ }
+ else
+ {
+ i = nbefore;
+ memcpy4 (out4, digits, i);
+ ndigits -= i;
+ }
+
+ digits += i;
+ out4 += nbefore;
+ }
+
+ /* Output the decimal point. */
+ *(out4++) = dtp->u.p.current_unit->decimal_status
+ == DECIMAL_POINT ? '.' : ',';
+
+ /* Output leading zeros after the decimal point. */
+ if (nzero > 0)
+ {
+ for (i = 0; i < nzero; i++)
+ *(out4++) = '0';
+ }
+
+ /* Output digits after the decimal point, padding with zeros. */
+ if (nafter > 0)
+ {
+ if (nafter > ndigits)
+ i = ndigits;
+ else
+ i = nafter;
+
+ memcpy4 (out4, digits, i);
+ while (i < nafter)
+ out4[i++] = '0';
+
+ digits += i;
+ ndigits -= i;
+ out4 += nafter;
+ }
+
+ /* Output the exponent. */
+ if (expchar)
+ {
+ if (expchar != ' ')
+ {
+ *(out4++) = expchar;
+ edigits--;
+ }
+#if HAVE_SNPRINTF
+ snprintf (buffer, size, "%+0*d", edigits, e);
+#else
+ sprintf (buffer, "%+0*d", edigits, e);
+#endif
+ memcpy4 (out4, buffer, edigits);
+ }
+
+ if (dtp->u.p.no_leading_blank)
+ {
+ out4 += edigits;
+ memset4 (out4, ' ' , nblanks);
+ dtp->u.p.no_leading_blank = 0;
+ }
+ return;
+ } /* End of character(kind=4) internal unit code. */
+
/* Pad to full field width. */
if ( ( nblanks > 0 ) && !dtp->u.p.no_leading_blank)
@@ -549,66 +662,106 @@ write_infnan (st_parameter_dt *dtp, const fnode *f, int isnan_flag, int sign_bit
if (f->format != FMT_B && f->format != FMT_O && f->format != FMT_Z)
{
- nb = f->u.real.w;
-
- /* If the field width is zero, the processor must select a width
- not zero. 4 is chosen to allow output of '-Inf' or '+Inf' */
-
- if (nb == 0) nb = 4;
- p = write_block (dtp, nb);
- if (p == NULL)
- return;
- if (nb < 3)
+ nb = f->u.real.w;
+
+ /* If the field width is zero, the processor must select a width
+ not zero. 4 is chosen to allow output of '-Inf' or '+Inf' */
+
+ if (nb == 0) nb = 4;
+ p = write_block (dtp, nb);
+ if (p == NULL)
+ return;
+ if (nb < 3)
+ {
+ if (unlikely (is_char4_unit (dtp)))
{
- memset (p, '*',nb);
- return;
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, '*', nb);
}
+ else
+ memset (p, '*', nb);
+ return;
+ }
- memset(p, ' ', nb);
- if (!isnan_flag)
- {
- if (sign_bit)
- {
-
- /* If the sign is negative and the width is 3, there is
- insufficient room to output '-Inf', so output asterisks */
-
- if (nb == 3)
- {
- memset (p, '*',nb);
- return;
- }
-
- /* The negative sign is mandatory */
-
- fin = '-';
- }
- else
-
- /* The positive sign is optional, but we output it for
- consistency */
- fin = '+';
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, ' ', nb);
+ }
+ else
+ memset(p, ' ', nb);
+ if (!isnan_flag)
+ {
+ if (sign_bit)
+ {
+ /* If the sign is negative and the width is 3, there is
+ insufficient room to output '-Inf', so output asterisks */
+ if (nb == 3)
+ {
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memset4 (p4, '*', nb);
+ }
+ else
+ memset (p, '*', nb);
+ return;
+ }
+ /* The negative sign is mandatory */
+ fin = '-';
+ }
+ else
+ /* The positive sign is optional, but we output it for
+ consistency */
+ fin = '+';
+
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
if (nb > 8)
-
- /* We have room, so output 'Infinity' */
- memcpy(p + nb - 8, "Infinity", 8);
+ /* We have room, so output 'Infinity' */
+ memcpy4 (p4 + nb - 8, "Infinity", 8);
else
-
- /* For the case of width equals 8, there is not enough room
- for the sign and 'Infinity' so we go with 'Inf' */
- memcpy(p + nb - 3, "Inf", 3);
+ /* For the case of width equals 8, there is not enough room
+ for the sign and 'Infinity' so we go with 'Inf' */
+ memcpy4 (p4 + nb - 3, "Inf", 3);
if (nb < 9 && nb > 3)
- p[nb - 4] = fin; /* Put the sign in front of Inf */
+ /* Put the sign in front of Inf */
+ p4[nb - 4] = (gfc_char4_t) fin;
else if (nb > 8)
- p[nb - 9] = fin; /* Put the sign in front of Infinity */
+ /* Put the sign in front of Infinity */
+ p4[nb - 9] = (gfc_char4_t) fin;
+ return;
+ }
+
+ if (nb > 8)
+ /* We have room, so output 'Infinity' */
+ memcpy(p + nb - 8, "Infinity", 8);
+ else
+ /* For the case of width equals 8, there is not enough room
+ for the sign and 'Infinity' so we go with 'Inf' */
+ memcpy(p + nb - 3, "Inf", 3);
+
+ if (nb < 9 && nb > 3)
+ p[nb - 4] = fin; /* Put the sign in front of Inf */
+ else if (nb > 8)
+ p[nb - 9] = fin; /* Put the sign in front of Infinity */
+ }
+ else
+ {
+ if (unlikely (is_char4_unit (dtp)))
+ {
+ gfc_char4_t *p4 = (gfc_char4_t *) p;
+ memcpy4 (p4 + nb - 3, "NaN", 3);
}
else
memcpy(p + nb - 3, "NaN", 3);
- return;
}
+ return;
}
+}
/* Returns the value of 10**d. */
@@ -746,11 +899,17 @@ output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \
free (newf);\
\
if (nb > 0 && !dtp->u.p.g0_no_blanks)\
- { \
+ {\
p = write_block (dtp, nb);\
if (p == NULL)\
return;\
- memset (p, ' ', nb);\
+ if (unlikely (is_char4_unit (dtp)))\
+ {\
+ gfc_char4_t *p4 = (gfc_char4_t *) p;\
+ memset4 (p4, ' ', nb);\
+ }\
+ else\
+ memset (p, ' ', nb);\
}\
}\
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index e2127b02702..127b500b355 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,32 @@
+2010-07-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.tgt (*-*-solaris2.[56]*): Removed.
+
+2010-07-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Handle sun style.
+ Define LIBGOMP_BUILD_VERSIONED_SHLIB_GNU,
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SUN automake conditionals.
+ (HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT): Define unless
+ targetting solaris2*.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+ * Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB]: Protect
+ libgomp_version_script with LIBGOMP_BUILD_VERSIONED_SHLIB_GNU.
+ Add libgomp_version_dep.
+ [LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]: Handle Sun symbol
+ versioning.
+ [!LIBGOMP_BUILD_VERSIONED_SHLIB]: Add libgomp_version_dep.
+ (libgomp_la_DEPENDENCIES): Set to $(libgomp_version_dep).
+ * Makefile.in: Regenerate.
+
+ * libgomp.h (LIBGOMP_GNU_SYMBOL_VERSIONING): Undef unless
+ HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT.
+ * libgomp.map (OMP_1.0): Move symbols both in OMP_1.0 and OMP_3.0
+ to common block, protected by
+ HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT.
+
2010-06-10 Gerald Pfeifer <gerald@pfeifer.com>
* libgomp.texi: Move to GFDL version 1.3. Update copyright years.
diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am
index 3786bee4c13..2428e66ee7a 100644
--- a/libgomp/Makefile.am
+++ b/libgomp/Makefile.am
@@ -22,13 +22,39 @@ toolexeclib_LTLIBRARIES = libgomp.la
nodist_toolexeclib_HEADERS = libgomp.spec
if LIBGOMP_BUILD_VERSIONED_SHLIB
+if LIBGOMP_BUILD_VERSIONED_SHLIB_GNU
+if LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2
+libgomp_version_script = -Wl,--version-script,libgomp.map-sol2
+libgomp_version_dep = libgomp.map-sol2
+libgomp.map-sol2 : $(top_srcdir)/libgomp.map
+ sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
+ > $@ || (rm -f $@ ; exit 1)
+else
libgomp_version_script = -Wl,--version-script,$(top_srcdir)/libgomp.map
+libgomp_version_dep = $(top_srcdir)/libgomp.map
+endif
+endif
+if LIBGOMP_BUILD_VERSIONED_SHLIB_SUN
+libgomp_version_script = -Wl,-M,libgomp.map-sun
+libgomp_version_dep = libgomp.map-sun
+libgomp.map-sun : $(top_srcdir)/libgomp.map \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $(libgomp_la_OBJECTS) $(libgomp_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(top_srcdir)/libgomp.map \
+ $(libgomp_la_OBJECTS:%.lo=.libs/%.o) \
+ `echo $(libgomp_la_LIBADD) | \
+ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
else
libgomp_version_script =
+libgomp_version_dep =
endif
libgomp_version_info = -version-info $(libtool_VERSION)
libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
-no-undefined -bindir "$(bindir)"
+libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index c27d7a4c786..ee57f676075 100644
--- a/libgomp/Makefile.in
+++ b/libgomp/Makefile.in
@@ -297,11 +297,18 @@ AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
toolexeclib_LTLIBRARIES = libgomp.la
nodist_toolexeclib_HEADERS = libgomp.spec
@LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_script =
-@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,$(top_srcdir)/libgomp.map
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,$(top_srcdir)/libgomp.map
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,libgomp.map-sol2
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,-M,libgomp.map-sun
+@LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_dep =
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = $(top_srcdir)/libgomp.map
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.map-sol2
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.map-sun
libgomp_version_info = -version-info $(libtool_VERSION)
libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
-no-undefined -bindir "$(bindir)"
+libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
iter_ull.c loop.c loop_ull.c ordered.c parallel.c sections.c single.c \
@@ -1057,6 +1064,18 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
vpath % $(strip $(search_path))
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp.map-sol2 : $(top_srcdir)/libgomp.map
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1)
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp.map-sun : $(top_srcdir)/libgomp.map \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(libgomp_la_OBJECTS) $(libgomp_la_LIBADD)
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(top_srcdir)/libgomp.map \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(libgomp_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ `echo $(libgomp_la_LIBADD) | \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1)
omp_lib_kinds.mod: omp_lib.mod
:
diff --git a/libgomp/acinclude.m4 b/libgomp/acinclude.m4
index 0c671d4eb74..8d6d0e54a7b 100644
--- a/libgomp/acinclude.m4
+++ b/libgomp/acinclude.m4
@@ -223,16 +223,42 @@ AC_DEFUN([LIBGOMP_ENABLE_SYMVERS], [
LIBGOMP_ENABLE(symvers,yes,[=STYLE],
[enables symbol versioning of the shared library],
- [permit yes|no|gnu])
+ [permit yes|no|gnu|sun])
# If we never went through the LIBGOMP_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
AC_REQUIRE([LIBGOMP_CHECK_LINKER_FEATURES])
# FIXME The following test is too strict, in theory.
-if test $enable_shared = no ||
- test "x$LD" = x ||
- test x$libgomp_gnu_ld_version = x; then
+if test $enable_shared = no || test "x$LD" = x; then
enable_symvers=no
+else
+ if test $with_gnu_ld = yes ; then
+ enable_symvers=gnu
+ else
+ case ${target_os} in
+ # Sun symbol versioning exists since Solaris 2.5.
+ solaris2.[[5-9]]* | solaris2.1[[0-9]]*)
+ enable_symvers=sun ;;
+ *)
+ enable_symvers=no ;;
+ esac
+ fi
+fi
+
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+ case ${target_os} in
+ solaris2*)
+ # All fine.
+ ;;
+ *)
+ # Unlikely to work.
+ AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+ AC_MSG_WARN([=== you are not targetting Solaris 2.])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ ;;
+ esac
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
@@ -269,10 +295,8 @@ libgomp_min_gnu_ld_version=21400
# Check to see if unspecified "yes" value can win, given results above.
# Change "yes" into either "no" or a style name.
-if test $enable_symvers = yes; then
- if test $with_gnu_ld = yes &&
- test $libgomp_shared_libgcc = yes;
- then
+if test $enable_symvers != no && test $libgomp_shared_libgcc = yes; then
+ if test $with_gnu_ld = yes; then
if test $libgomp_gnu_ld_version -ge $libgomp_min_gnu_ld_version ; then
enable_symvers=gnu
elif test $libgomp_ld_is_gold = yes ; then
@@ -295,6 +319,8 @@ if test $enable_symvers = yes; then
enable_symvers=no
fi
fi
+ elif test $enable_symvers = sun; then
+ : All interesting versions of Sun ld support sun style symbol versioning.
else
# just fail for now
AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
@@ -316,5 +342,22 @@ if test $libgomp_cv_have_as_symver_directive = yes; then
fi
AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
+AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu)
+AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun)
AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
+
+if test $enable_symvers != no ; then
+ case ${target_os} in
+ # The Solaris 2 runtime linker doesn't support the GNU extension of
+ # binding the same symbol to different versions
+ solaris2*)
+ symvers_renaming=no ;;
+ # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+ *)
+ AC_DEFINE(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
+ [Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
+ symvers_renaming=yes ;;
+ esac
+fi
+AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2, test $symvers_renaming = no)
])
diff --git a/libgomp/config.h.in b/libgomp/config.h.in
index c88660a945e..14c7e2a9a1b 100644
--- a/libgomp/config.h.in
+++ b/libgomp/config.h.in
@@ -54,6 +54,10 @@
/* Define to 1 if you have the `strtoull' function. */
#undef HAVE_STRTOULL
+/* Define to 1 if the target runtime linker supports binding the same symbol
+ to different versions. */
+#undef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+
/* Define to 1 if the target supports __sync_*_compare_and_swap */
#undef HAVE_SYNC_BUILTINS
diff --git a/libgomp/configure b/libgomp/configure
index e9b3a656291..9074529aef5 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -619,6 +619,12 @@ link_gomp
XLDFLAGS
XCFLAGS
config_path
+LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE
+LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE
+LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE
+LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE
+LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE
+LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE
LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE
LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE
OPT_LDFLAGS
@@ -11083,7 +11089,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11086 "configure"
+#line 11092 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11189,7 +11195,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11192 "configure"
+#line 11198 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15754,7 +15760,7 @@ $as_echo "$ac_sectionLDflags" >&6; }
if test "${enable_symvers+set}" = set; then :
enableval=$enable_symvers;
case "$enableval" in
- yes|no|gnu) ;;
+ yes|no|gnu|sun) ;;
*) as_fn_error "Unknown argument to enable/disable symvers" "$LINENO" 5 ;;
esac
@@ -15768,10 +15774,39 @@ fi
# don't know enough about $LD to do tricks...
# FIXME The following test is too strict, in theory.
-if test $enable_shared = no ||
- test "x$LD" = x ||
- test x$libgomp_gnu_ld_version = x; then
+if test $enable_shared = no || test "x$LD" = x; then
enable_symvers=no
+else
+ if test $with_gnu_ld = yes ; then
+ enable_symvers=gnu
+ else
+ case ${target_os} in
+ # Sun symbol versioning exists since Solaris 2.5.
+ solaris2.[5-9]* | solaris2.1[0-9]*)
+ enable_symvers=sun ;;
+ *)
+ enable_symvers=no ;;
+ esac
+ fi
+fi
+
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+ case ${target_os} in
+ solaris2*)
+ # All fine.
+ ;;
+ *)
+ # Unlikely to work.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5
+$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5
+$as_echo "$as_me: WARNING: === you are not targetting Solaris 2." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+ enable_symvers=no
+ ;;
+ esac
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
@@ -15840,10 +15875,8 @@ libgomp_min_gnu_ld_version=21400
# Check to see if unspecified "yes" value can win, given results above.
# Change "yes" into either "no" or a style name.
-if test $enable_symvers = yes; then
- if test $with_gnu_ld = yes &&
- test $libgomp_shared_libgcc = yes;
- then
+if test $enable_symvers != no && test $libgomp_shared_libgcc = yes; then
+ if test $with_gnu_ld = yes; then
if test $libgomp_gnu_ld_version -ge $libgomp_min_gnu_ld_version ; then
enable_symvers=gnu
elif test $libgomp_ld_is_gold = yes ; then
@@ -15870,6 +15903,8 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
enable_symvers=no
fi
fi
+ elif test $enable_symvers = sun; then
+ : All interesting versions of Sun ld support sun style symbol versioning.
else
# just fail for now
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested some kind of symbol versioning, but" >&5
@@ -15924,9 +15959,48 @@ else
LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE=
fi
+ if test $enable_symvers = gnu; then
+ LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE=
+ LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE='#'
+else
+ LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE='#'
+ LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE=
+fi
+
+ if test $enable_symvers = sun; then
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE=
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE='#'
+else
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE='#'
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE=
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5
$as_echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
+if test $enable_symvers != no ; then
+ case ${target_os} in
+ # The Solaris 2 runtime linker doesn't support the GNU extension of
+ # binding the same symbol to different versions
+ solaris2*)
+ symvers_renaming=no ;;
+ # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+ *)
+
+$as_echo "#define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1" >>confdefs.h
+
+ symvers_renaming=yes ;;
+ esac
+fi
+ if test $symvers_renaming = no; then
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE=
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE='#'
+else
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE='#'
+ LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE=
+fi
+
+
if test $enable_symvers = gnu; then
@@ -16309,6 +16383,18 @@ if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${LIBGOMP_BUILD_V
as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE}"; then
+ as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE}"; then
+ as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE}"; then
+ as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${USE_FORTRAN_TRUE}" && test -z "${USE_FORTRAN_FALSE}"; then
as_fn_error "conditional \"USE_FORTRAN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index 427d8d3772d..16bb888862e 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -116,11 +116,6 @@ case "${target}" in
config_path="mingw32 posix"
;;
- *-*-solaris2.[56]*)
- config_path="posix95 posix"
- XLDFLAGS="${XLDFLAGS} -lposix4"
- ;;
-
*-*-darwin*)
config_path="bsd posix"
;;
diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h
index 1d21cc09cfe..edde1e97a1b 100644
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -514,7 +514,8 @@ gomp_work_share_init_done (void)
#if !defined (HAVE_ATTRIBUTE_VISIBILITY) \
|| !defined (HAVE_ATTRIBUTE_ALIAS) \
|| !defined (HAVE_AS_SYMVER_DIRECTIVE) \
- || !defined (PIC)
+ || !defined (PIC) \
+ || !defined (HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
# undef LIBGOMP_GNU_SYMBOL_VERSIONING
#endif
diff --git a/libgomp/libgomp.map b/libgomp/libgomp.map
index e6c12fa0019..d95693dbdde 100644
--- a/libgomp/libgomp.map
+++ b/libgomp/libgomp.map
@@ -10,6 +10,10 @@ OMP_1.0 {
omp_get_dynamic;
omp_set_nested;
omp_get_nested;
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+ # If the assembler used lacks the .symver directive or the linker
+ # doesn't support GNU symbol versioning, we have the same symbol in
+ # two versions, which Sun ld chokes on.
omp_init_lock;
omp_init_nest_lock;
omp_destroy_lock;
@@ -22,6 +26,15 @@ OMP_1.0 {
omp_test_nest_lock;
omp_destroy_lock_;
omp_destroy_nest_lock_;
+ omp_init_lock_;
+ omp_init_nest_lock_;
+ omp_set_lock_;
+ omp_set_nest_lock_;
+ omp_test_lock_;
+ omp_test_nest_lock_;
+ omp_unset_lock_;
+ omp_unset_nest_lock_;
+#endif
omp_get_dynamic_;
omp_get_max_threads_;
omp_get_nested_;
@@ -29,20 +42,12 @@ OMP_1.0 {
omp_get_num_threads_;
omp_get_thread_num_;
omp_in_parallel_;
- omp_init_lock_;
- omp_init_nest_lock_;
omp_set_dynamic_;
omp_set_dynamic_8_;
- omp_set_lock_;
- omp_set_nest_lock_;
omp_set_nested_;
omp_set_nested_8_;
omp_set_num_threads_;
omp_set_num_threads_8_;
- omp_test_lock_;
- omp_test_nest_lock_;
- omp_unset_lock_;
- omp_unset_nest_lock_;
local:
*;
};
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a16e393d027..0a31b0c4c45 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,12 @@
+2010-07-21 Pascal Obry <obry@adacore.com>
+
+ * make-temp-file.c (choose_tmpdir): Append a dot to P_tmpdir if needed.
+
+2010-07-06 Ken Werner <ken.werner@de.ibm.com>
+
+ * floatformat.c (floatformat_ieee_half_big): New variable.
+ (floatformat_ieee_half_little): Likewise.
+
2010-06-14 Gerald Pfeifer <gerald@pfeifer.com>
* libiberty.texi: Remove reference to GCC 3 and 2001 (thrice).
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index cbf13ea3406..4819507cbdd 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -77,7 +77,23 @@ floatformat_always_valid (const struct floatformat *fmt ATTRIBUTE_UNUSED,
a system header, what we do if not, etc. */
#define FLOATFORMAT_CHAR_BIT 8
-/* floatformats for IEEE single and double, big and little endian. */
+/* floatformats for IEEE half, single and double, big and little endian. */
+const struct floatformat floatformat_ieee_half_big =
+{
+ floatformat_big, 16, 0, 1, 5, 15, 31, 6, 10,
+ floatformat_intbit_no,
+ "floatformat_ieee_half_big",
+ floatformat_always_valid,
+ NULL
+};
+const struct floatformat floatformat_ieee_half_little =
+{
+ floatformat_little, 16, 0, 1, 5, 15, 31, 6, 10,
+ floatformat_intbit_no,
+ "floatformat_ieee_half_little",
+ floatformat_always_valid,
+ NULL
+};
const struct floatformat floatformat_ieee_single_big =
{
floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c
index 13e19256534..4e3876676e2 100644
--- a/libiberty/make-temp-file.c
+++ b/libiberty/make-temp-file.c
@@ -121,7 +121,12 @@ choose_tmpdir (void)
#endif
#ifdef P_tmpdir
- base = try_dir (P_tmpdir, base);
+ /* We really want a directory name here as if concatenated with say \dir
+ we do not end up with a double \\ which defines an UNC path. */
+ if (strcmp (P_tmpdir, "\\") == 0)
+ base = try_dir ("\\.", base);
+ else
+ base = try_dir (P_tmpdir, base);
#endif
/* Try /var/tmp, /usr/tmp, then /tmp. */
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index f90cd353ea0..7d01621d390 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,56 @@
+2010-07-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (*-*-solaris2.8): Use alternate thread library.
+ Add libthread.
+ (*-*-solaris2.9): Use libthread.
+ * configure: Regenerate.
+
+2010-07-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * include/sparc-signal.h: Renamed to ...
+ * include/solaris-signal.h: ... this.
+ * configure.ac: Use it on any *-*-solaris2* target.
+ * configure: Regenerate.
+ * configure.host (i?86-*-solaris2*): Set can_unwind_signal=yes.
+ * Makefile.am (prims.lo): Add -fno-omit-frame-pointer to AM_CXXFLAGS.
+ * Makefile.in: Regenerate.
+
+2010-07-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (ANONVERSCRIPT): Handle sun style.
+ Define ANONVERSCRIPT_GNU, ANONVERSCRIPT_SUN automake conditionals.
+ * configure: Regenerate.
+
+ * Makefile.am [ANONVERSCRIPT]: Protect GNU section with
+ ANONVERSCRIPT_GNU.
+ Introduce per-library $(lib)_la_version_arg, $(lib)_la_version_dep
+ variables.
+ [ANONVERSCRIPT_GNU] (version_arg): Default ld arg for version map.
+ (version_dep): Likewise for dependency.
+ Use them to set the per-library variables.
+ [!ANONVERSCRIPT]: Provide them vor the unversioned case.
+ [ANONVERSCRIPT_SUN]: Handle Sun symbol versioning.
+ (libgcj_la_DEPENDENCIES): Unconditionally use
+ $(libgcj_la_version_dep).
+ (libgcj_la_LINK): Add $(libgcj_la_version_arg).
+ (libgcj_noncore_la_DEPENDENCIES): Unconditionally use
+ $(libgcj_la_version_dep).
+ (libgcj_tools_la_LIBADD): Move -lm ...
+ (libgcj_tools_la_LDFLAGS): ... here.
+ (libgcj_tools_la_DEPENDENCIES): Add
+ $(libgcj_tools_la_version_dep).
+ (libgcj_tools_la_LINK): Add $(libgcj_tools_la_version_arg).
+ (lib_gnu_awt_xlib_la_DEPENDENCIES): Add
+ $(lib_gnu_awt_xlib_la_version_dep).
+ (lib_gnu_awt_xlib_la_LINK): Add
+ $(lib_gnu_awt_xlib_la_version_arg).
+ (libgcj_bc_la_DEPENDENCIES): Add $(libgcj_bc_la_version_dep).
+ (libgcj_bc_la_LINK): $(libgcj_bc_la_version_arg).
+ [ANONVERSCRIPT && ANONVERSCRIPT_SUN] (%.ver-sun): New pattern rule.
+ * Makefile.in: Regenerate.
+
+ * libgcj.ver: Reformat.
+
2010-06-10 Peter O'Gorman <peter@pogma.com>
* configure.ac: Set SYSTEMSPEC so that -allow_stack_execute is not
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 190c686e65e..7b67ed0e1e7 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -291,7 +291,45 @@ extra_ldflags_libjava = @extra_ldflags_libjava@
extra_ldflags = @extra_ldflags@
if ANONVERSCRIPT
-extra_ldflags_libjava += -Wl,--version-script=$(srcdir)/libgcj.ver
+if ANONVERSCRIPT_GNU
+version_arg = -Wl,--version-script=$(srcdir)/libgcj.ver
+libgcj_la_version_arg = $(version_arg)
+libgcj_tools_la_version_arg = $(version_arg)
+lib_gnu_awt_xlib_la_version_arg = $(version_arg)
+libgcj_bc_la_version_arg = $(version_arg)
+
+version_dep = $(srcdir)/libgcj.ver
+libgcj_la_version_dep = $(version_dep)
+libgcj_tools_la_version_dep = $(version_dep)
+lib_gnu_awt_xlib_la_version_dep = $(version_dep)
+libgcj_bc_la_version_dep = $(version_dep)
+endif
+if ANONVERSCRIPT_SUN
+libgcj_la_version_arg = -Wl,-M,libgcj.ver-sun
+libgcj_tools_la_version_arg = -Wl,-M,libgcj_tools.ver-sun
+lib_gnu_awt_xlib_la_version_arg = -Wl,-M,lib_gnu_awt_xlib.ver-sun
+libgcj_bc_la_version_arg = -Wl,-M,libgcj_bc.ver-sun
+
+libgcj_la_version_dep = libgcj.ver-sun
+libgcj_tools_la_version_dep = libgcj_tools.ver-sun
+lib_gnu_awt_xlib_la_version_dep = lib_gnu_awt_xlib.ver-sun
+libgcj_bc_la_version_dep = libgcj_bc.ver-sun
+
+# The pattern rule necessary to build the *.ver-sun mapfiles is at the end
+# of the file, see below.
+endif
+else
+version_arg =
+libgcj_la_version_arg = $(version_arg)
+libgcj_tools_la_version_arg = $(version_arg)
+lib_gnu_awt_xlib_la_version_arg = $(version_arg)
+libgcj_bc_la_version_arg = $(version_arg)
+
+version_dep =
+libgcj_la_version_dep = $(version_dep)
+libgcj_tools_la_version_dep = $(version_dep)
+lib_gnu_awt_xlib_la_version_dep = $(version_dep)
+libgcj_bc_la_version_dep = $(version_dep)
endif
LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
@@ -406,6 +444,8 @@ libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
## We need to compile at least the interpreter this way.
interpret.lo: AM_CXXFLAGS += -fwrapv
+## Necessary so EH works on 64-bit Solaris 2.
+prims.lo: AM_CXXFLAGS += -fno-omit-frame-pointer
if USING_BOEHMGC
libgcj_la_SOURCES += boehm.cc
@@ -463,11 +503,9 @@ libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
java/process-$(PLATFORM).lo \
$(ALL_PACKAGE_SOURCE_FILES_LO) \
$(LIBLTDL) $(libgcj_la_LIBADD) \
- $(LIBJAVA_CORE_EXTRA)
-if ANONVERSCRIPT
-libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver
-endif
-libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
+ $(LIBJAVA_CORE_EXTRA) \
+ $(libgcj_la_version_dep)
+libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS) $(libgcj_la_version_arg)
## A hack to make sure the various gcj-related macros, like
## LTGCJCOMPILE, are defined by automake. This is never actually
@@ -490,10 +528,7 @@ libgcj_noncore_la_SOURCES =
libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) 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_LIBADD) libgcj.la $(libgcj_la_version_dep)
libgcj_noncore_la_LINK = $(libgcj_la_LINK)
endif # BUILD_SUBLIBS
@@ -509,13 +544,15 @@ 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) $(LIBJAVA_LDFLAGS_NOUNDEF)
-libgcj_tools_la_LIBADD = libgcj.la -lm
-libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) -lm
+libgcj_tools_la_LIBADD = libgcj.la
+libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \
+ $(libgcj_tools_la_version_dep)
if BUILD_SUBLIBS
libgcj_tools_la_DEPENDENCIES += libgcj-noncore.la
endif
-libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS)
+libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) \
+ $(libgcj_tools_la_version_arg)
## libjvm.so
libjvm_la_SOURCES = jni-libjvm.cc
@@ -543,6 +580,7 @@ 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_version_dep) \
$(lib_gnu_awt_xlib_la_LIBADD)
if BUILD_SUBLIBS
lib_gnu_awt_xlib_la_DEPENDENCIES += libgcj-noncore.la
@@ -558,7 +596,8 @@ lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
-rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
-lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
+lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS) \
+ $(lib_gnu_awt_xlib_la_version_arg)
## Support for libgcj_bc: dummy shared library.
##
@@ -567,8 +606,9 @@ 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) $(LIBJAVA_LDFLAGS_NOUNDEF)
-libgcj_bc_la_DEPENDENCIES = libgcj.la
-libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
+libgcj_bc_la_DEPENDENCIES = libgcj.la $(libgcj_bc_la_version_dep)
+libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS) \
+ $(libgcj_bc_la_version_arg)
## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
## USE_LIBGCJ_BC shouldn't be set on other targets.
libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
@@ -1574,3 +1614,22 @@ distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
+
+if ANONVERSCRIPT
+if ANONVERSCRIPT_SUN
+# This must be at the end of the Makefile, otherwise .SECONDEXPANSION
+# causes expansion of filenames with $ in their names, which breaks the build.
+# .SECONDEXPANSION is necessary to allow the use of automatic variables ($@
+# in this case) in the requisites of pattern rules.
+.SECONDEXPANSION:
+
+%.ver-sun : $(srcdir)/libgcj.ver \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $$($$(basename $$@)_la_OBJECTS) $$($$(basename $$@)_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(srcdir)/libgcj.ver \
+ `echo $($(basename $@)_la_OBJECTS) $($(basename $@)_la_LIBADD) | \
+ sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
+endif
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index d53b4f395a0..9daa03e9486 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -49,22 +49,19 @@ target_triplet = @target@
@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_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
+@USING_GCC_TRUE@am__append_9 = $(WARNINGS)
+@BUILD_SUBLIBS_TRUE@am__append_10 = libgcj-noncore.la
+@USING_BOEHMGC_TRUE@am__append_11 = boehm.cc
+@USING_NOGC_TRUE@am__append_12 = nogc.cc
+@USING_POSIX_PLATFORM_TRUE@am__append_13 = posix.cc
+@USING_WIN32_PLATFORM_TRUE@am__append_14 = win32.cc
+@USING_DARWIN_CRT_TRUE@am__append_15 = darwin.cc
+@USING_POSIX_THREADS_TRUE@am__append_16 = posix-threads.cc
+@USING_WIN32_THREADS_TRUE@am__append_17 = win32-threads.cc
+@USING_NO_THREADS_TRUE@am__append_18 = no-threads.cc
+@BUILD_SUBLIBS_TRUE@am__append_19 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_20 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_21 = libgcj-noncore.la
DIST_COMMON = $(srcdir)/sources.am NEWS README ChangeLog THANKS \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
@@ -80,14 +77,14 @@ DIST_COMMON = $(srcdir)/sources.am NEWS README ChangeLog THANKS \
$(top_srcdir)/gnu/java/nio/natVMPipe${PLATFORM}.cc \
$(top_srcdir)/gnu/java/nio/natVMSelector${PLATFORM}.cc \
$(srcdir)/../depcomp
-@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)
+@MAINTAINER_MODE_TRUE@@NATIVE_TRUE@am__append_22 = gen-from-JIS
+@BUILD_SUBLIBS_TRUE@am__append_23 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_24 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@am__append_25 = libgcj-noncore.la
+@BUILD_SUBLIBS_TRUE@@NATIVE_TRUE@am__append_26 = libgcj-noncore.la
+@NATIVE_TRUE@@USE_LIBGCJ_BC_TRUE@am__append_27 = libgcj_bc.la
+@NATIVE_TRUE@@USE_LIBGCJ_BC_FALSE@am__append_28 = libgcj.la
+@XLIB_AWT_TRUE@am__append_29 = $(xlib_nat_headers)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libltdl/acinclude.m4 \
@@ -704,7 +701,7 @@ docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
extra_ldflags = @extra_ldflags@
-extra_ldflags_libjava = @extra_ldflags_libjava@ $(am__append_9)
+extra_ldflags_libjava = @extra_ldflags_libjava@
gcc_suffix = @gcc_suffix@
gcjsubdir = @gcjsubdir@
gxx_include_dir = @gxx_include_dir@
@@ -952,6 +949,37 @@ db_pathtail = $(gcjsubdir)/$(db_name)
bin_SCRIPTS = contrib/rebuild-gcj-db contrib/aot-compile \
$(am__append_8)
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
+
+# The pattern rule necessary to build the *.ver-sun mapfiles is at the end
+# of the file, see below.
+@ANONVERSCRIPT_FALSE@version_arg =
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@version_arg = -Wl,--version-script=$(srcdir)/libgcj.ver
+@ANONVERSCRIPT_FALSE@libgcj_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@libgcj_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@libgcj_la_version_arg = -Wl,-M,libgcj.ver-sun
+@ANONVERSCRIPT_FALSE@libgcj_tools_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@libgcj_tools_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@libgcj_tools_la_version_arg = -Wl,-M,libgcj_tools.ver-sun
+@ANONVERSCRIPT_FALSE@lib_gnu_awt_xlib_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@lib_gnu_awt_xlib_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@lib_gnu_awt_xlib_la_version_arg = -Wl,-M,lib_gnu_awt_xlib.ver-sun
+@ANONVERSCRIPT_FALSE@libgcj_bc_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@libgcj_bc_la_version_arg = $(version_arg)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@libgcj_bc_la_version_arg = -Wl,-M,libgcj_bc.ver-sun
+@ANONVERSCRIPT_FALSE@version_dep =
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@version_dep = $(srcdir)/libgcj.ver
+@ANONVERSCRIPT_FALSE@libgcj_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@libgcj_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@libgcj_la_version_dep = libgcj.ver-sun
+@ANONVERSCRIPT_FALSE@libgcj_tools_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@libgcj_tools_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@libgcj_tools_la_version_dep = libgcj_tools.ver-sun
+@ANONVERSCRIPT_FALSE@lib_gnu_awt_xlib_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@lib_gnu_awt_xlib_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@lib_gnu_awt_xlib_la_version_dep = lib_gnu_awt_xlib.ver-sun
+@ANONVERSCRIPT_FALSE@libgcj_bc_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_GNU_TRUE@@ANONVERSCRIPT_TRUE@libgcj_bc_la_version_dep = $(version_dep)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@libgcj_bc_la_version_dep = libgcj_bc.ver-sun
LTLDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
GCJLINK = $(LIBTOOL) --tag=GCJ $(LIBTOOLFLAGS) --mode=link $(GCJ) -L$(here) \
$(JC1FLAGS) $(LTLDFLAGS) -o $@
@@ -992,7 +1020,7 @@ AM_GCJFLAGS = \
--encoding=UTF-8 \
-Wno-deprecated -fbootstrap-classes
-AM_CFLAGS = @LIBGCJ_CFLAGS@ $(am__append_10)
+AM_CFLAGS = @LIBGCJ_CFLAGS@ $(am__append_9)
@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 =
@@ -1010,7 +1038,7 @@ AM_CPPFLAGS = -I$(top_srcdir) \
BOOTCLASSPATH = $(srcdir)/classpath/lib
libgij_la_SOURCES = gij.cc
-libgij_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_11)
+libgij_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_10)
libgij_la_LIBADD = -L$(here)/.libs libgcj.la
libgij_la_LDFLAGS = -rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
@@ -1020,9 +1048,9 @@ 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_12) $(am__append_13) \
- $(am__append_14) $(am__append_15) $(am__append_16) \
- $(am__append_17) $(am__append_18) $(am__append_19)
+ $(nat_source_files) $(am__append_11) $(am__append_12) \
+ $(am__append_13) $(am__append_14) $(am__append_15) \
+ $(am__append_16) $(am__append_17) $(am__append_18)
nat_files = $(nat_source_files:.cc=.lo)
xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
@@ -1041,20 +1069,24 @@ libgcj_la_LIBADD = \
$(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_PACKAGE_SOURCE_FILES_LO) $(LIBLTDL) $(libgcj_la_LIBADD) \
- $(LIBJAVA_CORE_EXTRA) $(am__append_20)
-libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
+libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
+ java/lang/Object.lo \
+ java/lang/Class.lo \
+ java/process-$(PLATFORM).lo \
+ $(ALL_PACKAGE_SOURCE_FILES_LO) \
+ $(LIBLTDL) $(libgcj_la_LIBADD) \
+ $(LIBJAVA_CORE_EXTRA) \
+ $(libgcj_la_version_dep)
+
+libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS) $(libgcj_la_version_arg)
EXTRA_libgcj_la_SOURCES = java/lang/Object.java
@BUILD_SUBLIBS_TRUE@DLL_VERSION = `expr \`grep -v '^\#' $(srcdir)/libtool-version | sed -e 's/\(.*\):\(.*\):.*/\1 + \2/'\``
@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) 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_DEPENDENCIES = libgcj-$(gcc_version).jar $(LIBLTDL) \
+@BUILD_SUBLIBS_TRUE@ $(libgcj_noncore_la_LIBADD) libgcj.la $(libgcj_la_version_dep)
+
@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LINK = $(libgcj_la_LINK)
# We compile libgcj_tools with -findirect-dispatch so that they can
@@ -1069,13 +1101,16 @@ 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) $(LIBJAVA_LDFLAGS_NOUNDEF)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) -lm
+
+libgcj_tools_la_LIBADD = libgcj.la
+libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \
+ $(libgcj_tools_la_version_dep) $(am__append_19)
+libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) \
+ $(libgcj_tools_la_version_arg)
-libgcj_tools_la_LIBADD = libgcj.la -lm
-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 $(am__append_23)
+libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_20)
libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC) \
$(LIBJAVA_LDFLAGS_NOUNDEF)
@@ -1084,7 +1119,8 @@ 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) $(am__append_24)
+ libgcj.spec $(lib_gnu_awt_xlib_la_version_dep) \
+ $(lib_gnu_awt_xlib_la_LIBADD) $(am__append_21)
lib_gnu_awt_xlib_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I../libstdc++-v3/include \
@@ -1096,13 +1132,17 @@ lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
-rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
-lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
+lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS) \
+ $(lib_gnu_awt_xlib_la_version_arg)
+
libgcj_bc_la_SOURCES = libgcj_bc.c
libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF)
-libgcj_bc_la_DEPENDENCIES = libgcj.la
-libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
+libgcj_bc_la_DEPENDENCIES = libgcj.la $(libgcj_bc_la_version_dep)
+libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS) \
+ $(libgcj_bc_la_version_arg)
+
libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
-fPIC -nostdlib
@@ -8362,7 +8402,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 $(am__append_26)
+jv_convert_DEPENDENCIES = libgcj.la libgcj.spec $(am__append_23)
gcj_dbtool_SOURCES = \
gnu/gcj/tools/gcj_dbtool/natMain.cc
@@ -8372,7 +8412,7 @@ 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 $(am__append_27)
+ libgcj.spec $(am__append_24)
gc_analyze_SOURCES =
gc_analyze_LDFLAGS = --main=gnu.gcj.tools.gc_analyze.MemoryAnalyze \
-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
@@ -8380,7 +8420,7 @@ gc_analyze_LDFLAGS = --main=gnu.gcj.tools.gc_analyze.MemoryAnalyze \
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 \
- $(am__append_28)
+ $(am__append_25)
gij_SOURCES =
gij_LDFLAGS = -rpath $(dbexecdir) -rpath $(toolexeclibdir) \
-shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
@@ -8399,10 +8439,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_31)
+@NATIVE_TRUE@ $(am__append_28)
@NATIVE_FALSE@ecjx_DEPENDENCIES =
@NATIVE_TRUE@ecjx_DEPENDENCIES = libgcj.la libgcj.spec \
-@NATIVE_TRUE@ $(am__append_29) $(am__append_30)
+@NATIVE_TRUE@ $(am__append_26) $(am__append_27)
gappletviewer_SOURCES =
gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
@@ -8619,7 +8659,7 @@ gnu/gcj/xlib/natXImage.cc \
gnu/gcj/xlib/natXUnmapEvent.cc
sourcesdir = $(jardir)
-headers_to_make = $(nat_headers) $(am__append_32)
+headers_to_make = $(nat_headers) $(am__append_29)
# 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
@@ -10495,6 +10535,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
interpret.lo: AM_CXXFLAGS += -fwrapv
+prims.lo: AM_CXXFLAGS += -fno-omit-frame-pointer
@BUILD_SUBLIBS_TRUE@libgcj-noncore-dummy.dll.a : $(srcdir)/libgcj-noncore-dummy.def
@BUILD_SUBLIBS_TRUE@ $(DLLTOOL) -d $^ -l $@ --dllname cyggcj-noncore-$(DLL_VERSION).dll
@@ -12681,6 +12722,21 @@ distclean-multi:
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
+# This must be at the end of the Makefile, otherwise .SECONDEXPANSION
+# causes expansion of filenames with $ in their names, which breaks the build.
+# .SECONDEXPANSION is necessary to allow the use of automatic variables ($@
+# in this case) in the requisites of pattern rules.
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@.SECONDEXPANSION:
+
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@%.ver-sun : $(srcdir)/libgcj.ver \
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ $$($$(basename $$@)_la_OBJECTS) $$($$(basename $$@)_la_LIBADD)
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ $(srcdir)/libgcj.ver \
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ `echo $($(basename $@)_la_OBJECTS) $($(basename $@)_la_LIBADD) | \
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+@ANONVERSCRIPT_SUN_TRUE@@ANONVERSCRIPT_TRUE@ > $@ || (rm -f $@ ; exit 1)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libjava/configure b/libjava/configure
index 7ca3dcfb5b3..8ccfa24cc12 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -632,6 +632,10 @@ python_mod_dir
here
LD_FINISH_STATIC_SPEC
LD_START_STATIC_SPEC
+ANONVERSCRIPT_SUN_FALSE
+ANONVERSCRIPT_SUN_TRUE
+ANONVERSCRIPT_GNU_FALSE
+ANONVERSCRIPT_GNU_TRUE
ANONVERSCRIPT_FALSE
ANONVERSCRIPT_TRUE
SYSDEP_SOURCES
@@ -13345,7 +13349,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13348 "configure"
+#line 13352 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13451,7 +13455,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13454 "configure"
+#line 13458 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19430,7 +19434,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then :
enableval=$enable_sjlj_exceptions; :
else
cat > conftest.$ac_ext << EOF
-#line 19433 "configure"
+#line 19437 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -20708,6 +20712,19 @@ case "$THREADS" in
THREADLIBS='-lpthread -lrt'
THREADSPEC='-lpthread -lrt'
;;
+ *-*-solaris2.8)
+ # Always use alternate thread library on Solaris 8. Need libthread
+ # for TLS support.
+ # Need -Wl,-R to get it through libtool ...
+ THREADLIBS='-L/usr/lib/lwp$(MULTISUBDIR) -Wl,-R -Wl,/usr/lib/lwp$(MULTISUBDIR) -lpthread -lthread'
+ # ... while ld only accepts -R.
+ THREADSPEC='-L/usr/lib/lwp%{m64:/64} -R/usr/lib/lwp%{m64:/64} -lpthread -lthread'
+ ;;
+ *-*-solaris2.9)
+ # As on Solaris 8, need libthread for TLS support.
+ THREADLIBS='-lpthread -lthread'
+ THREADSPEC='-lpthread -lthread'
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
@@ -24156,8 +24173,8 @@ case "${host}" in
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
- sparc*-sun-solaris*)
- SIGNAL_HANDLER=include/sparc-signal.h
+ *-*-solaris2*)
+ SIGNAL_HANDLER=include/solaris-signal.h
;;
# ia64-*)
# SYSDEP_SOURCES=sysdep/ia64.c
@@ -24380,7 +24397,7 @@ rm -f core conftest.err conftest.$ac_objext \
CFLAGS="$chktls_save_CFLAGS"
if test "X$thread_CFLAGS" != Xfailed; then
CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run test program while cross compiling
@@ -24488,7 +24505,8 @@ if test "${libjava_cv_anon_version_script+set}" = set; then :
else
save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
libjava_cv_anon_version_script=no
- CFLAGS="$CFLAGS -fPIC"; LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
+ CFLAGS="$CFLAGS -fPIC";
+ LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
echo '{ global: globalsymb*; local: *; };' > conftest.map
if test x$gcc_no_link = xyes; then
as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
@@ -24505,16 +24523,45 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- libjava_cv_anon_version_script=yes
+ libjava_cv_anon_version_script=gnu
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ if test x$libjava_cv_anon_version_script = xno; then
+ case "$target_os" in
+ solaris2*)
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared -Wl,-M,conftest.map"
+ # Sun ld doesn't understand wildcards here.
+ echo '{ global: globalsymbol; local: *; };' > conftest.map
+ 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. */
+void globalsymbol (void) {} void localsymbol (void) {}
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ libjava_cv_anon_version_script=sun
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ;;
+ esac
+ fi
CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libjava_cv_anon_version_script" >&5
$as_echo "$libjava_cv_anon_version_script" >&6; }
- if test "$libjava_cv_anon_version_script" = yes; then
+ if test "$libjava_cv_anon_version_script" != no; then
ANONVERSCRIPT_TRUE=
ANONVERSCRIPT_FALSE='#'
else
@@ -24522,6 +24569,22 @@ else
ANONVERSCRIPT_FALSE=
fi
+ if test "$libjava_cv_anon_version_script" = gnu; then
+ ANONVERSCRIPT_GNU_TRUE=
+ ANONVERSCRIPT_GNU_FALSE='#'
+else
+ ANONVERSCRIPT_GNU_TRUE='#'
+ ANONVERSCRIPT_GNU_FALSE=
+fi
+
+ if test "$libjava_cv_anon_version_script" = sun; then
+ ANONVERSCRIPT_SUN_TRUE=
+ ANONVERSCRIPT_SUN_FALSE='#'
+else
+ ANONVERSCRIPT_SUN_TRUE='#'
+ ANONVERSCRIPT_SUN_FALSE=
+fi
+
# Check if linker supports static linking on a per library basis
LD_START_STATIC_SPEC=
@@ -25061,6 +25124,14 @@ if test -z "${ANONVERSCRIPT_TRUE}" && test -z "${ANONVERSCRIPT_FALSE}"; then
as_fn_error "conditional \"ANONVERSCRIPT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ANONVERSCRIPT_GNU_TRUE}" && test -z "${ANONVERSCRIPT_GNU_FALSE}"; then
+ as_fn_error "conditional \"ANONVERSCRIPT_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ANONVERSCRIPT_SUN_TRUE}" && test -z "${ANONVERSCRIPT_SUN_FALSE}"; then
+ as_fn_error "conditional \"ANONVERSCRIPT_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${INSTALL_AOT_RPM_TRUE}" && test -z "${INSTALL_AOT_RPM_FALSE}"; then
as_fn_error "conditional \"INSTALL_AOT_RPM\" 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 f21ae91d18a..125e9ce9b46 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -1064,6 +1064,19 @@ case "$THREADS" in
THREADLIBS='-lpthread -lrt'
THREADSPEC='-lpthread -lrt'
;;
+ *-*-solaris2.8)
+ # Always use alternate thread library on Solaris 8. Need libthread
+ # for TLS support.
+ # Need -Wl,-R to get it through libtool ...
+ THREADLIBS='-L/usr/lib/lwp$(MULTISUBDIR) -Wl,-R -Wl,/usr/lib/lwp$(MULTISUBDIR) -lpthread -lthread'
+ # ... while ld only accepts -R.
+ THREADSPEC='-L/usr/lib/lwp%{m64:/64} -R/usr/lib/lwp%{m64:/64} -lpthread -lthread'
+ ;;
+ *-*-solaris2.9)
+ # As on Solaris 8, need libthread for TLS support.
+ THREADLIBS='-lpthread -lthread'
+ THREADSPEC='-lpthread -lthread'
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
@@ -1680,8 +1693,8 @@ case "${host}" in
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
- sparc*-sun-solaris*)
- SIGNAL_HANDLER=include/sparc-signal.h
+ *-*-solaris2*)
+ SIGNAL_HANDLER=include/solaris-signal.h
;;
# ia64-*)
# SYSDEP_SOURCES=sysdep/ia64.c
@@ -1767,13 +1780,28 @@ AC_CACHE_CHECK([whether ld supports anonymous version scripts],
[libjava_cv_anon_version_script],
[save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
libjava_cv_anon_version_script=no
- CFLAGS="$CFLAGS -fPIC"; LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
+ CFLAGS="$CFLAGS -fPIC";
+ LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
echo '{ global: globalsymb*; local: *; };' > conftest.map
AC_TRY_LINK(void globalsymbol (void) {} void localsymbol (void) {},,
- [libjava_cv_anon_version_script=yes], [])
+ [libjava_cv_anon_version_script=gnu], [])
+ if test x$libjava_cv_anon_version_script = xno; then
+ case "$target_os" in
+ solaris2*)
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared -Wl,-M,conftest.map"
+ # Sun ld doesn't understand wildcards here.
+ echo '{ global: globalsymbol; local: *; };' > conftest.map
+ AC_TRY_LINK(void globalsymbol (void) {} void localsymbol (void) {},,
+ [libjava_cv_anon_version_script=sun], [])
+ ;;
+ esac
+ fi
CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
])
-AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" = yes)
+AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" != no)
+AM_CONDITIONAL(ANONVERSCRIPT_GNU, test "$libjava_cv_anon_version_script" = gnu)
+AM_CONDITIONAL(ANONVERSCRIPT_SUN, test "$libjava_cv_anon_version_script" = sun)
# Check if linker supports static linking on a per library basis
LD_START_STATIC_SPEC=
diff --git a/libjava/configure.host b/libjava/configure.host
index 460ef2fab07..665fbe3c6a0 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -318,6 +318,9 @@ EOF
DIVIDESPEC=-fuse-divide-subroutine
CHECKREFSPEC=-fcheck-references
;;
+ i?86-*-solaris2*)
+ can_unwind_signal=yes
+ ;;
*-*-freebsd*)
slow_pthread_self=
;;
diff --git a/libjava/include/sparc-signal.h b/libjava/include/solaris-signal.h
index a936afe067f..a936afe067f 100644
--- a/libjava/include/sparc-signal.h
+++ b/libjava/include/solaris-signal.h
diff --git a/libjava/libgcj.ver b/libjava/libgcj.ver
index d2d189b5249..4e90d9d1f8e 100644
--- a/libjava/libgcj.ver
+++ b/libjava/libgcj.ver
@@ -2,6 +2,12 @@
# symbols in libgcj.so.
{
- global: Jv*; _Jv_*; __gcj_personality_v0; __gcj_personality_sj0; _Z*;
- local: *;
+ global:
+ Jv*;
+ _Jv_*;
+ __gcj_personality_v0;
+ __gcj_personality_sj0;
+ _Z*;
+ local:
+ *;
};
diff --git a/libssp/ChangeLog b/libssp/ChangeLog
index 1745d5b5f07..a3fda218d21 100644
--- a/libssp/ChangeLog
+++ b/libssp/ChangeLog
@@ -1,3 +1,25 @@
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (ssp_use_symver): Only check for Sun-style symbol
+ versioning on Solaris 2.
+ * configure: Regenerate.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Check for Sun symbol versioning.
+ Check for memmove.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+ * Makefile.am [LIBSSP_USE_SYMVER]: Protect version_arg,
+ version_dep with LIBSSP_USE_SYMVER_GNU.
+ [LIBSSP_USE_SYMVER_SUN]: Handle Sun symbol versioning.
+ * Makefile.in: Regenerate.
+
+ * ssp.map: Reformat.
+
+ * memmove-chk.c: Change guard to HAVE_MEMMOVE.
+
2010-05-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR other/43620
diff --git a/libssp/Makefile.am b/libssp/Makefile.am
index 7b6e9465084..e25bd8458ce 100644
--- a/libssp/Makefile.am
+++ b/libssp/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the toplevel directory of the libssp library.
##
-## Copyright (C) 2005
+## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
## Free Software Foundation, Inc.
##
@@ -12,8 +12,23 @@ MAINT_CHARSET = latin1
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
if LIBSSP_USE_SYMVER
+if LIBSSP_USE_SYMVER_GNU
version_arg = -Wl,--version-script=$(srcdir)/ssp.map
version_dep = $(srcdir)/ssp.map
+endif
+if LIBSSP_USE_SYMVER_SUN
+version_arg = -Wl,-M,ssp.map-sun
+version_dep = ssp.map-sun
+ssp.map-sun : $(srcdir)/ssp.map \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $(libssp_la_OBJECTS) $(libssp_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(srcdir)/ssp.map \
+ $(libssp_la_OBJECTS:%.lo=.libs/%.o) \
+ `echo $(libssp_la_LIBADD) | \
+ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
else
version_arg =
version_dep =
diff --git a/libssp/Makefile.in b/libssp/Makefile.in
index e70d622b3f6..d9f952fd50c 100644
--- a/libssp/Makefile.in
+++ b/libssp/Makefile.in
@@ -250,9 +250,11 @@ MAINT_CHARSET = latin1
# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@LIBSSP_USE_SYMVER_FALSE@version_arg =
-@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,-M,ssp.map-sun
@LIBSSP_USE_SYMVER_FALSE@version_dep =
-@LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = ssp.map-sun
AM_CFLAGS = -Wall
toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
@@ -694,6 +696,15 @@ uninstall-am: uninstall-nobase_libsubincludeHEADERS \
uninstall-am uninstall-nobase_libsubincludeHEADERS \
uninstall-toolexeclibLTLIBRARIES
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ssp.map-sun : $(srcdir)/ssp.map \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(libssp_la_OBJECTS) $(libssp_la_LIBADD)
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(srcdir)/ssp.map \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ $(libssp_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ `echo $(libssp_la_LIBADD) | \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@ > $@ || (rm -f $@ ; exit 1)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libssp/config.h.in b/libssp/config.h.in
index d55c0f18b86..2815ce7c4d5 100644
--- a/libssp/config.h.in
+++ b/libssp/config.h.in
@@ -21,6 +21,9 @@
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff --git a/libssp/configure b/libssp/configure
index d5e83844f01..50098d4409b 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -625,6 +625,10 @@ LIBTOOL
ssp_have_usable_vsnprintf
EGREP
GREP
+LIBSSP_USE_SYMVER_SUN_FALSE
+LIBSSP_USE_SYMVER_SUN_TRUE
+LIBSSP_USE_SYMVER_GNU_FALSE
+LIBSSP_USE_SYMVER_GNU_TRUE
LIBSSP_USE_SYMVER_FALSE
LIBSSP_USE_SYMVER_TRUE
CPP
@@ -4093,18 +4097,18 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5
$as_echo_n "checking whether symbol versioning is supported... " >&6; }
-cat > conftest.map <<EOF
-FOO_1.0 {
- global: *foo*; bar; local: *;
-};
-EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
if test x$gcc_no_link = xyes; then
# If we cannot link, we cannot build shared libraries, so do not use
# symbol versioning.
ssp_use_symver=no
else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: *foo*; bar; local: *;
+};
+EOF
if test x$gcc_no_link = xyes; then
as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
fi
@@ -4120,17 +4124,52 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ssp_use_symver=yes
+ ssp_use_symver=gnu
+else
+ ssp_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test x$ssp_use_symver = xno; then
+ case "$target_os" in
+ solaris2*)
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ssp_use_symver=sun
else
ssp_use_symver=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ ;;
+ esac
+ fi
+ LDFLAGS="$save_LDFLAGS"
fi
-LDFLAGS="$save_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ssp_use_symver" >&5
$as_echo "$ssp_use_symver" >&6; }
- if test "x$ssp_use_symver" = xyes; then
+ if test "x$ssp_use_symver" != xno; then
LIBSSP_USE_SYMVER_TRUE=
LIBSSP_USE_SYMVER_FALSE='#'
else
@@ -4138,6 +4177,22 @@ else
LIBSSP_USE_SYMVER_FALSE=
fi
+ if test "x$ssp_use_symver" = xgnu; then
+ LIBSSP_USE_SYMVER_GNU_TRUE=
+ LIBSSP_USE_SYMVER_GNU_FALSE='#'
+else
+ LIBSSP_USE_SYMVER_GNU_TRUE='#'
+ LIBSSP_USE_SYMVER_GNU_FALSE=
+fi
+
+ if test "x$ssp_use_symver" = xsun; then
+ LIBSSP_USE_SYMVER_SUN_TRUE=
+ LIBSSP_USE_SYMVER_SUN_FALSE='#'
+else
+ LIBSSP_USE_SYMVER_SUN_TRUE='#'
+ LIBSSP_USE_SYMVER_SUN_FALSE=
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
@@ -4423,7 +4478,7 @@ if test x$gcc_no_link = xyes; then
$as_echo "#define HAVE_STRNCAT 1" >>confdefs.h
else
- for ac_func in mempcpy strncpy strncat
+ for ac_func in memmove mempcpy strncpy strncat
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -10591,7 +10646,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10594 "configure"
+#line 10649 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10697,7 +10752,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10700 "configure"
+#line 10755 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11096,6 +11151,14 @@ if test -z "${LIBSSP_USE_SYMVER_TRUE}" && test -z "${LIBSSP_USE_SYMVER_FALSE}";
as_fn_error "conditional \"LIBSSP_USE_SYMVER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${LIBSSP_USE_SYMVER_GNU_TRUE}" && test -z "${LIBSSP_USE_SYMVER_GNU_FALSE}"; then
+ as_fn_error "conditional \"LIBSSP_USE_SYMVER_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBSSP_USE_SYMVER_SUN_TRUE}" && test -z "${LIBSSP_USE_SYMVER_SUN_FALSE}"; then
+ as_fn_error "conditional \"LIBSSP_USE_SYMVER_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
diff --git a/libssp/configure.ac b/libssp/configure.ac
index 8192167a32d..8181bed0067 100644
--- a/libssp/configure.ac
+++ b/libssp/configure.ac
@@ -72,23 +72,40 @@ if test x$ssp_hidden = xyes; then
fi
AC_MSG_CHECKING([whether symbol versioning is supported])
-cat > conftest.map <<EOF
-FOO_1.0 {
- global: *foo*; bar; local: *;
-};
-EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
if test x$gcc_no_link = xyes; then
# If we cannot link, we cannot build shared libraries, so do not use
# symbol versioning.
ssp_use_symver=no
else
- AC_TRY_LINK([int foo;],[],[ssp_use_symver=yes],[ssp_use_symver=no])
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: *foo*; bar; local: *;
+};
+EOF
+ AC_TRY_LINK([int foo;],[],[ssp_use_symver=gnu],[ssp_use_symver=no])
+ if test x$ssp_use_symver = xno; then
+ case "$target_os" in
+ solaris2*)
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ AC_TRY_LINK([int foo;],[],[ssp_use_symver=sun],[ssp_use_symver=no])
+ ;;
+ esac
+ fi
+ LDFLAGS="$save_LDFLAGS"
fi
-LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($ssp_use_symver)
-AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" = xyes])
+AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" != xno])
+AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu])
+AM_CONDITIONAL(LIBSSP_USE_SYMVER_SUN, [test "x$ssp_use_symver" = xsun])
AC_CHECK_HEADERS(alloca.h malloc.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h)
@@ -98,7 +115,7 @@ if test x$gcc_no_link = xyes; then
AC_DEFINE(HAVE_STRNCPY)
AC_DEFINE(HAVE_STRNCAT)
else
- AC_CHECK_FUNCS(mempcpy strncpy strncat)
+ AC_CHECK_FUNCS(memmove mempcpy strncpy strncat)
fi
AC_MSG_CHECKING([whether vsnprintf is usable])
diff --git a/libssp/memmove-chk.c b/libssp/memmove-chk.c
index 3e2904a3b0d..c28e1b59f2f 100644
--- a/libssp/memmove-chk.c
+++ b/libssp/memmove-chk.c
@@ -1,5 +1,5 @@
/* Checking memmove.
- Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -40,7 +40,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
extern void __chk_fail (void) __attribute__((__noreturn__));
-#ifdef HAVE_MEMPCPY
+#ifdef HAVE_MEMMOVE
void *
__memmove_chk (void *dest, const void *src, size_t len, size_t slen)
{
diff --git a/libssp/ssp.map b/libssp/ssp.map
index 76c233562a7..34de964e368 100644
--- a/libssp/ssp.map
+++ b/libssp/ssp.map
@@ -1,9 +1,22 @@
LIBSSP_1.0 {
global:
- __stack_chk_fail; __stack_chk_guard; __chk_fail;
- __gets_chk; __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk;
- __snprintf_chk; __sprintf_chk; __stpcpy_chk; __strcat_chk; __strcpy_chk;
- __strncat_chk; __strncpy_chk; __vsnprintf_chk; __vsprintf_chk;
+ __stack_chk_fail;
+ __stack_chk_guard;
+ __chk_fail;
+ __gets_chk;
+ __memcpy_chk;
+ __memmove_chk;
+ __mempcpy_chk;
+ __memset_chk;
+ __snprintf_chk;
+ __sprintf_chk;
+ __stpcpy_chk;
+ __strcat_chk;
+ __strcpy_chk;
+ __strncat_chk;
+ __strncpy_chk;
+ __vsnprintf_chk;
+ __vsprintf_chk;
local:
*;
};
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index dfb651e96a1..a5e61f78664 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,209 @@
+2010-07-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ DocBook 4.5 to 5.0 transition.
+ * doc/xml/authors.xml: Update markup to DocBook 5.0.
+ * doc/xml/faq.xml: Same.
+ * doc/xml/api.xml: Same.
+ * doc/xml/class.txml
+ * doc/xml/gnu/gpl-3.0.xml: Same.
+ * doc/xml/gnu/fdl-1.2.xml: Same.
+ * doc/xml/gnu/fdl-1.3.xml: Same.
+ * doc/xml/gnu/gpl-2.0.xml: Same.
+ * doc/xml/chapter.txml: Same.
+ * doc/xml/manual/mt_allocator.xml: Same.
+ * doc/xml/manual/allocator.xml: Same.
+ * doc/xml/manual/ctype.xml: Same.
+ * doc/xml/manual/numerics.xml: Same.
+ * doc/xml/manual/codecvt.xml: Same.
+ * doc/xml/manual/backwards_compatibility.xml: Same.
+ * doc/xml/manual/concurrency.xml: Same.
+ * doc/xml/manual/intro.xml: Same.
+ * doc/xml/manual/abi.xml: Same.
+ * doc/xml/manual/shared_ptr.xml: Same.
+ * doc/xml/manual/status_cxxtr1.xml: Same.
+ * doc/xml/manual/auto_ptr.xml: Same.
+ * doc/xml/manual/internals.xml: Same.
+ * doc/xml/manual/atomics.xml: Same.
+ * doc/xml/manual/parallel_mode.xml: Same.
+ * doc/xml/manual/status_cxx1998.xml: Same.
+ * doc/xml/manual/profile_mode.xml: Same.
+ * doc/xml/manual/containers.xml: Same.
+ * doc/xml/manual/io.xml: Same.
+ * doc/xml/manual/concurrency_extensions.xml: Same.
+ * doc/xml/manual/appendix_porting.xml: Same.
+ * doc/xml/manual/utilities.xml: Same.
+ * doc/xml/manual/support.xml: Same.
+ * doc/xml/manual/bitmap_allocator.xml: Same.
+ * doc/xml/manual/configure.xml: Same.
+ * doc/xml/manual/build_hacking.xml: Same.
+ * doc/xml/manual/evolution.xml: Same.
+ * doc/xml/manual/using.xml: Same.
+ * doc/xml/manual/using_exceptions.xml: Same.
+ * doc/xml/manual/debug.xml: Same.
+ * doc/xml/manual/localization.xml: Same.
+ * doc/xml/manual/strings.xml: Same.
+ * doc/xml/manual/debug_mode.xml: Same.
+ * doc/xml/manual/locale.xml: Same.
+ * doc/xml/manual/extensions.xml: Same.
+ * doc/xml/manual/appendix_contributing.xml: Same.
+ * doc/xml/manual/prerequisites.xml: Same.
+ * doc/xml/manual/messages.xml: Same.
+ * doc/xml/manual/diagnostics.xml: Same.
+ * doc/xml/manual/algorithms.xml: Same.
+ * doc/xml/manual/appendix_free.xml: Same.
+ * doc/xml/manual/iterators.xml: Same.
+ * doc/xml/manual/spine.xml: Same.
+ * doc/xml/manual/status_cxxtr24733.xml: Same.
+ * doc/xml/manual/status_cxx200x.xml: Same.
+ * doc/xml/manual/test.xml: Same.
+ * doc/xml/book.txml: Same.
+ * doc/xml/spine.xml: Same.
+ * doc/Makefile.am: Same.
+ * doc/Makefile.in: Regenerate.
+
+2010-07-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/xml/manual/appendix_contributing.xml: Update for new reality.
+ * doc/Makefile.am (doc-xml): New default rule for XML output.
+ (doc-xml-single-doxygen): Standardize output names.
+ * doc/Makefile.in: Regenerate.
+
+ * doc/doxygen/user.cfg.in: Tweak.
+
+2010-07-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * libsupc++/unwind-cxx.h: Minor formatting / stylistic tweaks.
+
+2010-07-20 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR libstdc++/44902
+ * libsupc++/unwind-cxx.h (__cxa_type_match): Correct prototype.
+ (__cxa_begin_cleanup): Likewise.
+
+2010-07-19 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/Makefile.am (doc-texinfo): New rule.
+ (doc-texinfo-docbook): New rule.
+ (DB2TEXI_FLAGS): New.
+ (doc-xml-single-docbook): Just the manual, not the set. Tweak flags.
+ * doc/Makefile.in: Regenerate.
+
+2010-07-14 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/shared_ptr.xml: Update.
+ * doc/html/*: Regenerate.
+
+2010-07-13 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/Makefile.am: Edit pdf rules.
+ (doc-man, doc-pdf, doc-html): Expand default rules.
+ * doc/Makefile.in: Regenerate.
+ * doc/doxygen/user.cfg.in: Update to Doxygen 1.7.1.
+
+2010-07-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/type_traits (is_convertible): Use SFINAE.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
+ dg-error line numbers.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
+ Likewise.
+ * testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
+
+2010-07-09 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/44875
+ * doc/xml/manual/status_cxx200x.xml: Corrections to status.
+ * doc/html/*: Regenerate.
+
+2010-07-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/stl_heap.h: Update markup.
+ * include/bits/move.h: Same.
+ * include/bits/algorithmfwd.h: Same.
+ * include/bits/regex.h: Same.
+ * include/bits/random.h: Same.
+ * doc/doxygen/doxygroups.cc: Same.
+ * doc/doxygen/user.cfg.in: Remove include/tr1_impl/regex from
+ input file list.
+ * doc/Makefile.am (doc-pdf-doxygen): Add comment, put generated
+ pdf in location consistent with docbook pdf generation.
+ * doc/Makefile.in: Regenerate.
+
+2010-07-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/status_cxx200x.xml: Add some missing features.
+ * doc/html/*: Regenerate.
+
+2010-07-03 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/bits/regex_compiler.h: Fix filename in doxygen comment.
+ * include/bits/regex_constants.h: Likewise.
+ * include/bits/regex_error.h: Likewise.
+ * include/bits/regex_grep_matcher.h: Likewise.
+ * include/bits/regex_grep_matcher.tcc: Likewise.
+ * include/bits/regex_nfa.tcc: Likewise.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * acinclude.m4 (symvers_renaming): Define
+ HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT instead of
+ _GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT.
+ Fix syntax error.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Handle sun style.
+ Require GCC_PROG_GNU_CXXFILT.
+ (_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT): Define
+ unless targetting solaris2*.
+ Include ../config/gc++filt.m4.
+ * configure.host (i?86-*-solaris2*): Set abi_baseline_pair.
+ (sparc-*-solaris2*): Likewise.
+ * src/Makefile.am [ENABLE_SYMVERS_SUN] (version_dep, version_arg):
+ New variables.
+ (libstdc++-symbols.ver-sun): New target.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+ * Makefile.in: Likewise.
+ * doc/Makefile.in: Likewise.
+ * include/Makefile.in: Likewise.
+ * libsupc++/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * python/Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * src/atomic.cc: Only define/use _GLIBCXX_ASM_SYMVER if
+ _GLIBCXX_HAVE_SYMVER_RENAMING_RUNTIME_SUPPORT.
+ * src/compatibility.cc: Likewise.
+ * testsuite/Makefile.am (baseline_subdir): Define.
+ (baseline_symbols): Use it.
+ (new-abi-baseline): Likewise.
+ * testsuite/Makefile.in: Regenerate.
+
+ * config/abi/pre/gnu.ver (GLIBCXX_3.4.5): Enclose duplicates in
+ #ifdef HAVE_SYMVER_RENAMING_RUNTIME_SUPPORT.
+ (GLIBCXX_3.4.6): Likewise.
+
+ * doc/xml/manual/configure.xml (--enable-symvers): Document sun
+ style.
+
+ * doc/xml/manual/abi.xml: Fix grammar.
+ (Symbol versioning on the libstdc++.so binary): Fix mapfile path.
+ (Incremental bumping of a library pre-defined macro): Fix
+ c++config path.
+ (Incremental bumping of a library pre-defined macro,
+ _GLIBCPP_VERSION): Likewise.
+ (Matching each specific C++ compiler release to a specific set of
+ C++ include files): Fix acinclude.m4 path.
+ (Prerequisites): Allow for Sun linker on Solaris 2.5+.
+ Use proper link to Configuring.
+ Fix acinclude.m4 path.
+ (Checking Active): Allow for additional symbol versioning styles.
+ Provide Solaris 2 example with pvs -r.
+ (Bibliography): Update Linker and Libraries Guide, C++ Migration
+ Guide entries.
+
2010-06-29 Jason Merrill <jason@redhat.com>
Enable implicitly declared move constructor/operator= (N3053).
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index fd89c02e982..f62595fc278 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -57,6 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -124,6 +125,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index db6323d64ae..6786cbcb9ea 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2812,11 +2812,14 @@ AC_DEFUN([GLIBCXX_ENABLE_SYMVERS], [
GLIBCXX_ENABLE(symvers,$1,[=STYLE],
[enables symbol versioning of the shared library],
- [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export])
+ [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun])
# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
+# Sun style symbol versions needs GNU c++filt for make_sunver.pl to work
+# with extern "C++" in version scripts.
+AC_REQUIRE([GCC_PROG_GNU_CXXFILT])
# Turn a 'yes' into a suitable default.
if test x$enable_symvers = xyes ; then
@@ -2834,6 +2837,20 @@ if test x$enable_symvers = xyes ; then
case ${target_os} in
darwin*)
enable_symvers=darwin ;;
+ # Sun symbol versioning exists since Solaris 2.5.
+ solaris2.[[5-9]]* | solaris2.1[[0-9]]*)
+ # make_sunver.pl needs GNU c++filt to support extern "C++" in
+ # version scripts, so disable symbol versioning if none can be
+ # found.
+ if test -z "$ac_cv_path_CXXFILT"; then
+ AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+ AC_MSG_WARN([=== no GNU c++filt could be found.])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ else
+ enable_symvers=sun
+ fi
+ ;;
*)
enable_symvers=no ;;
esac
@@ -2846,8 +2863,26 @@ if test x$enable_symvers = xdarwin-export ; then
enable_symvers=darwin
fi
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+ case ${target_os} in
+ solaris2*)
+ # All fine.
+ ;;
+ *)
+ # Unlikely to work.
+ AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+ AC_MSG_WARN([=== you are not targetting Solaris 2.])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ ;;
+ esac
+fi
+
# Check to see if 'gnu' can win.
-if test $enable_symvers = gnu || test $enable_symvers = gnu-versioned-namespace; then
+if test $enable_symvers = gnu ||
+ test $enable_symvers = gnu-versioned-namespace ||
+ test $enable_symvers = sun; then
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
AC_MSG_CHECKING([for shared libgcc])
ac_save_CFLAGS="$CFLAGS"
@@ -2883,6 +2918,8 @@ changequote([,])dnl
AC_MSG_WARN([=== you are not building a shared libgcc_s.])
AC_MSG_WARN([=== Symbol versioning will be disabled.])
enable_symvers=no
+ elif test $with_gnu_ld != yes && test $enable_symvers = sun; then
+ : All interesting versions of Sun ld support sun style symbol versioning.
elif test $with_gnu_ld != yes ; then
# just fail for now
AC_MSG_WARN([=== You have requested GNU symbol versioning, but])
@@ -2922,6 +2959,11 @@ case $enable_symvers in
AC_DEFINE(_GLIBCXX_SYMVER_DARWIN, 1,
[Define to use darwin versioning in the shared library.])
;;
+ sun)
+ SYMVER_FILE=config/abi/pre/gnu.ver
+ AC_DEFINE(_GLIBCXX_SYMVER_SUN, 1,
+ [Define to use Sun versioning in the shared library.])
+ ;;
esac
if test x$enable_symvers != xno ; then
@@ -2945,8 +2987,24 @@ GLIBCXX_CONDITIONAL(ENABLE_SYMVERS, test $enable_symvers != no)
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU, test $enable_symvers = gnu)
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU_NAMESPACE, test $enable_symvers = gnu-versioned-namespace)
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_DARWIN, test $enable_symvers = darwin)
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SUN, test $enable_symvers = sun)
AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
+if test $enable_symvers != no ; then
+ case ${target_os} in
+ # The Solaris 2 runtime linker doesn't support the GNU extension of
+ # binding the same symbol to different versions
+ solaris2*)
+ symvers_renaming=no ;;
+ # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+ *)
+ AC_DEFINE(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
+ [Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
+ symvers_renaming=yes ;;
+ esac
+fi
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SOL2, test $symvers_renaming = no)
+
# Now, set up compatibility support, if any.
# In addition, need this to deal with std::size_t mangling in
# src/compatibility.cc. In a perfect world, could use
@@ -3083,5 +3141,6 @@ AC_DEFUN([AC_LC_MESSAGES], [
])
# Macros from the top-level gcc directory.
+m4_include([../config/gc++filt.m4])
m4_include([../config/tls.m4])
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 55fa49e29d7..00aed69c388 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -349,6 +349,10 @@
/* Define if strxfrm_l is available in <string.h>. */
#undef HAVE_STRXFRM_L
+/* Define to 1 if the target runtime linker supports binding the same symbol
+ to different versions. */
+#undef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+
/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
@@ -724,6 +728,9 @@
/* Define to use GNU namespace versioning in the shared library. */
#undef _GLIBCXX_SYMVER_GNU_NAMESPACE
+/* Define to use Sun versioning in the shared library. */
+#undef _GLIBCXX_SYMVER_SUN
+
/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
<stdio.h>, and <stdlib.h> can be used or exposed. */
#undef _GLIBCXX_USE_C99
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 6375b88ff05..3a2856b7d9c 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -740,6 +740,7 @@ GLIBCXX_3.4 {
sqrtl;
copysignf;
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
# GLIBCXX_ABI compatibility only.
# std::string
_ZNKSs11_M_disjunctEPKc;
@@ -767,6 +768,7 @@ GLIBCXX_3.4 {
_ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;
_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;
+#endif
# std::locale::Impl _M_ members
_ZNSt6locale5_Impl16_M_install_facetEPKNS_2idEPKNS_5facetE;
@@ -875,7 +877,9 @@ GLIBCXX_3.4.6 {
_ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv;
+#endif
_ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv;
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 06504044fa0..90985426c50 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -623,6 +623,10 @@ GLIBCXX_LDBL_COMPAT_FALSE
GLIBCXX_LDBL_COMPAT_TRUE
ENABLE_VISIBILITY_FALSE
ENABLE_VISIBILITY_TRUE
+ENABLE_SYMVERS_SOL2_FALSE
+ENABLE_SYMVERS_SOL2_TRUE
+ENABLE_SYMVERS_SUN_FALSE
+ENABLE_SYMVERS_SUN_TRUE
ENABLE_SYMVERS_DARWIN_FALSE
ENABLE_SYMVERS_DARWIN_TRUE
ENABLE_SYMVERS_GNU_NAMESPACE_FALSE
@@ -633,6 +637,7 @@ ENABLE_SYMVERS_FALSE
ENABLE_SYMVERS_TRUE
port_specific_symbol_files
SYMVER_FILE
+CXXFILT
LTLIBICONV
LIBICONV
OPT_LDFLAGS
@@ -852,7 +857,8 @@ CXX
CXXFLAGS
CCC
CPP
-CXXCPP'
+CXXCPP
+CXXFILT'
# Initialize some variables set by options.
@@ -1553,6 +1559,8 @@ Some influential environment variables:
CXXFLAGS C++ compiler flags
CPP C preprocessor
CXXCPP C++ preprocessor
+ CXXFILT Location of GNU c++filt. Defaults to the first GNU version of
+ `c++filt', `gc++filt' on PATH.
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -11460,7 +11468,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11463 "configure"
+#line 11471 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11566,7 +11574,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11569 "configure"
+#line 11577 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14906,7 +14914,7 @@ fi
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 14909 "configure"
+#line 14917 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -15274,7 +15282,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15277 "configure"
+#line 15285 "configure"
int main()
{
typedef bool atomic_type;
@@ -15311,7 +15319,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15314 "configure"
+#line 15322 "configure"
int main()
{
typedef short atomic_type;
@@ -15348,7 +15356,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15351 "configure"
+#line 15359 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -15386,7 +15394,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15389 "configure"
+#line 15397 "configure"
int main()
{
typedef long long atomic_type;
@@ -15462,7 +15470,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15465 "configure"
+#line 15473 "configure"
int main()
{
_Decimal32 d1;
@@ -25538,7 +25546,7 @@ rm -f core conftest.err conftest.$ac_objext \
CFLAGS="$chktls_save_CFLAGS"
if test "X$thread_CFLAGS" != Xfailed; then
CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run test program while cross compiling
@@ -44476,7 +44484,7 @@ rm -f core conftest.err conftest.$ac_objext \
CFLAGS="$chktls_save_CFLAGS"
if test "X$thread_CFLAGS" != Xfailed; then
CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run test program while cross compiling
@@ -50561,7 +50569,7 @@ rm -f core conftest.err conftest.$ac_objext \
CFLAGS="$chktls_save_CFLAGS"
if test "X$thread_CFLAGS" != Xfailed; then
CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run test program while cross compiling
@@ -58082,12 +58090,53 @@ ac_config_commands="$ac_config_commands include/gstdint.h"
# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU c++filt" >&5
+$as_echo_n "checking for GNU c++filt... " >&6; }
+if test "${ac_cv_path_CXXFILT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$CXXFILT"; then
+ ac_path_CXXFILT_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in c++filt gc++filt; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_CXXFILT="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_CXXFILT" && $as_test_x "$ac_path_CXXFILT"; } || continue
+# Check for GNU $ac_path_CXXFILT
+case `"$ac_path_CXXFILT" --version 2>&1` in
+*GNU*)
+ ac_cv_path_CXXFILT=$ac_path_CXXFILT && ac_path_CXXFILT_found=:;;
+esac
+
+ $ac_path_CXXFILT_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_CXXFILT"; then
+ :
+ fi
+else
+ ac_cv_path_CXXFILT=$CXXFILT
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_CXXFILT" >&5
+$as_echo "$ac_cv_path_CXXFILT" >&6; }
+ CXXFILT=$ac_cv_path_CXXFILT
+
+
# Check whether --enable-symvers was given.
if test "${enable_symvers+set}" = set; then :
enableval=$enable_symvers;
case "$enableval" in
- yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export) ;;
+ yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun) ;;
*) as_fn_error "Unknown argument to enable/disable symvers" "$LINENO" 5 ;;
esac
@@ -58100,6 +58149,9 @@ fi
# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
+# Sun style symbol versions needs GNU c++filt for make_sunver.pl to work
+# with extern "C++" in version scripts.
+
# Turn a 'yes' into a suitable default.
if test x$enable_symvers = xyes ; then
@@ -58117,6 +58169,23 @@ if test x$enable_symvers = xyes ; then
case ${target_os} in
darwin*)
enable_symvers=darwin ;;
+ # Sun symbol versioning exists since Solaris 2.5.
+ solaris2.[5-9]* | solaris2.1[0-9]*)
+ # make_sunver.pl needs GNU c++filt to support extern "C++" in
+ # version scripts, so disable symbol versioning if none can be
+ # found.
+ if test -z "$ac_cv_path_CXXFILT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5
+$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === no GNU c++filt could be found." >&5
+$as_echo "$as_me: WARNING: === no GNU c++filt could be found." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+ enable_symvers=no
+ else
+ enable_symvers=sun
+ fi
+ ;;
*)
enable_symvers=no ;;
esac
@@ -58129,8 +58198,29 @@ if test x$enable_symvers = xdarwin-export ; then
enable_symvers=darwin
fi
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+ case ${target_os} in
+ solaris2*)
+ # All fine.
+ ;;
+ *)
+ # Unlikely to work.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5
+$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5
+$as_echo "$as_me: WARNING: === you are not targetting Solaris 2." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+ enable_symvers=no
+ ;;
+ esac
+fi
+
# Check to see if 'gnu' can win.
-if test $enable_symvers = gnu || test $enable_symvers = gnu-versioned-namespace; then
+if test $enable_symvers = gnu ||
+ test $enable_symvers = gnu-versioned-namespace ||
+ test $enable_symvers = sun; then
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared libgcc" >&5
$as_echo_n "checking for shared libgcc... " >&6; }
@@ -58207,6 +58297,8 @@ $as_echo "$as_me: WARNING: === you are not building a shared libgcc_s." >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
enable_symvers=no
+ elif test $with_gnu_ld != yes && test $enable_symvers = sun; then
+ : All interesting versions of Sun ld support sun style symbol versioning.
elif test $with_gnu_ld != yes ; then
# just fail for now
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested GNU symbol versioning, but" >&5
@@ -58257,6 +58349,12 @@ $as_echo "#define _GLIBCXX_SYMVER_GNU_NAMESPACE 1" >>confdefs.h
$as_echo "#define _GLIBCXX_SYMVER_DARWIN 1" >>confdefs.h
;;
+ sun)
+ SYMVER_FILE=config/abi/pre/gnu.ver
+
+$as_echo "#define _GLIBCXX_SYMVER_SUN 1" >>confdefs.h
+
+ ;;
esac
if test x$enable_symvers != xno ; then
@@ -58303,9 +58401,26 @@ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5
$as_echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
+if test $enable_symvers != no ; then
+ case ${target_os} in
+ # The Solaris 2 runtime linker doesn't support the GNU extension of
+ # binding the same symbol to different versions
+ solaris2*)
+ symvers_renaming=no ;;
+ # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+ *)
+
+$as_echo "#define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1" >>confdefs.h
+
+ symvers_renaming=yes ;;
+ esac
+fi
+
+
# Now, set up compatibility support, if any.
# In addition, need this to deal with std::size_t mangling in
# src/compatibility.cc. In a perfect world, could use
@@ -58911,6 +59026,24 @@ else
fi
+ if test $enable_symvers = sun; then
+ ENABLE_SYMVERS_SUN_TRUE=
+ ENABLE_SYMVERS_SUN_FALSE='#'
+else
+ ENABLE_SYMVERS_SUN_TRUE='#'
+ ENABLE_SYMVERS_SUN_FALSE=
+fi
+
+
+ if test $symvers_renaming = no; then
+ ENABLE_SYMVERS_SOL2_TRUE=
+ ENABLE_SYMVERS_SOL2_FALSE='#'
+else
+ ENABLE_SYMVERS_SOL2_TRUE='#'
+ ENABLE_SYMVERS_SOL2_FALSE=
+fi
+
+
if test $enable_visibility = yes; then
ENABLE_VISIBILITY_TRUE=
ENABLE_VISIBILITY_FALSE='#'
@@ -59324,6 +59457,14 @@ if test -z "${ENABLE_SYMVERS_DARWIN_TRUE}" && test -z "${ENABLE_SYMVERS_DARWIN_F
as_fn_error "conditional \"ENABLE_SYMVERS_DARWIN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ENABLE_SYMVERS_SUN_TRUE}" && test -z "${ENABLE_SYMVERS_SUN_FALSE}"; then
+ as_fn_error "conditional \"ENABLE_SYMVERS_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_SYMVERS_SOL2_TRUE}" && test -z "${ENABLE_SYMVERS_SOL2_FALSE}"; then
+ as_fn_error "conditional \"ENABLE_SYMVERS_SOL2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ENABLE_VISIBILITY_TRUE}" && test -z "${ENABLE_VISIBILITY_FALSE}"; then
as_fn_error "conditional \"ENABLE_VISIBILITY\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index 444f672e7be..06874d5cf0a 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -320,7 +320,13 @@ case "${host}" in
;;
esac
;;
+ i?86-*-solaris2*)
+ abi_baseline_pair=i386-solaris2
+ ;;
powerpc*-*-darwin*)
port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
;;
+ sparc*-*-solaris2*)
+ abi_baseline_pair=sparc-solaris2
+ ;;
esac
diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
index d48e7a30de8..06ce75a3095 100644
--- a/libstdc++-v3/doc/Makefile.am
+++ b/libstdc++-v3/doc/Makefile.am
@@ -25,26 +25,46 @@ include $(top_srcdir)/fragment.am
# Documentation Overview
#
# There are two main source materials for libstdc++ documentation.
-# The first is the doxygen markup in libstdc++ sources. And the second
-# is the docbook markup in doc/xml/. A third and more obscure option
-# deals with charting performance tests.
+# The first is the doxygen markup in libstdc++ sources, which is a
+# reference to the API. And the second is the docbook markup in
+# doc/xml/.
+#
+# A third and more obscure option deals with charting
+# performance tests, and should be considered experimental.
+
+# Default rules.
+#
+# Point to best sub-rule for the requested documentation target,
+# create, and then copy into toplevel directory with standardized names
+# and layouts.
+
+# HTML
+doc-html: doc-html-docbook doc-html-doxygen
+ cp -R ${docbook_outdir}/html ./libstdc++-manual.html
+ cp -R ${doxygen_outdir}/html ./libstdc++-api.html
-# Default, points to current best sub-rule that is the best conversion.
# MAN
doc-man: doc-man-doxygen
+ cp -R ${doxygen_outdir}/man ./libstdc++-api.man
# PDF
-doc-pdf: doc-pdf-docbook
+doc-pdf: doc-pdf-docbook doc-pdf-doxygen
+ cp ${docbook_outdir}/pdf/libstdc++-manual.pdf .
+ cp ${doxygen_outdir}/pdf/libstdc++-api.pdf .
-# HTML
-doc-html: doc-html-docbook
+# TEXINFO
+doc-texinfo: doc-texinfo-docbook
+
+# XML
+doc-xml: doc-xml-single-docbook doc-xml-single-doxygen
+ cp ${manual_xml} .
+ cp ${api_xml} .
# Doxygen configuration
# Assumes doxygen, graphviz (with dot), pdflatex installed
doxygen_script=${top_srcdir}/scripts/run_doxygen
doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
-doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
doc-html-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
@@ -64,10 +84,11 @@ doc-xml-doxygen:
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
-doc-xml-single-doxygen:
+api_xml = ${doxygen_outdir}/xml/libstdc++-api-single.xml
+doc-xml-single-doxygen: doc-xml-doxygen
@echo "Generating doxygen xml single file..."
$(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
- ${doxygen_outdir}/xml/index.xml > ${doxygen_outdir}/xml/api-spine.xml;
+ ${doxygen_outdir}/xml/index.xml > ${api_xml};
doc-latex-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
@@ -75,12 +96,23 @@ doc-latex-doxygen:
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=latex $${srcdir} $${builddir} NO)
-# Chance of loooooonnggg creation time on this rule.
-doc-pdf-doxygen: stamp-latex-doxygen
+# Chance of loooooonnggg creation time on this rule. Iff this fails,
+# look at refman.log and see if TeX's memory is exhausted. Symptoms
+# include asking a wizard to enlarge capacity. If this is the case,
+# find texmf.cnf and add a zero for pool_size, string_vacancies,
+# max_strings, and pool_free values.
+doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
+api_pdf = ${doxygen_outdir}/pdf/libstdc++-api.pdf
+
+${doxygen_outdir}/pdf:
+ mkdir -p ${doxygen_outdir}/pdf
+
+doc-pdf-doxygen: stamp-latex-doxygen ${doxygen_outdir}/pdf
-(cd ${doxygen_outdir}/latex && $(MAKE) -i pdf;)
echo "Generating doxygen pdf file...";
if [ -f ${doxygen_pdf} ]; then \
- echo "... ${doxygen_pdf}"; \
+ mv ${doxygen_pdf} ${api_pdf} ; \
+ echo ":: PDF file is ${api_pdf}"; \
else \
echo "... error"; \
exit 12; \
@@ -188,20 +220,23 @@ xml_noinst = \
XSLTPROC = xsltproc
XSLTPROC_FLAGS = --nonet --xinclude
-XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-stylesheets
+XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-ns-stylesheets
XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
#XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
+${docbook_outdir}/fo:
+ mkdir -p ${docbook_outdir}/fo
+
${docbook_outdir}/html:
mkdir -p ${docbook_outdir}/html
${docbook_outdir}/pdf:
mkdir -p ${docbook_outdir}/pdf
-${docbook_outdir}/fo:
- mkdir -p ${docbook_outdir}/fo
+${docbook_outdir}/texinfo:
+ mkdir -p ${docbook_outdir}/texinfo
${docbook_outdir}/xml:
mkdir -p ${docbook_outdir}/xml
@@ -210,18 +245,22 @@ ${docbook_outdir}/xml:
XMLLINT = xmllint
#LINT_FLAGS = --debug --nonet --xinclude --nsclean --postvalid --nowarning
#LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
-LINT_FLAGS = --postvalid --debug --xinclude --noent --noblanks --nonet --noout
-DTD_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
-XMLLINT_FLAGS = $(LINT_FLAGS) $(DTD_FLAGS)
+LINT_FLAGS = --debug --xinclude --noent --noblanks --nonet --noout
+#SCHEMA_FLAGS = --relaxng /usr/share/xml/docbook5/schema/rng/5.0/docbookxi.rng
+SCHEMA_FLAGS = --dtdvalid /usr/share/xml/docbook5/schema/dtd/5.0/docbook.dtd
+XMLLINT_FLAGS = $(LINT_FLAGS) $(SCHEMA_FLAGS)
doc-xml-validate-docbook: $(xml_sources)
@echo "Generating XML validation log..."
$(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
+# XML, all one page
+# Some info on canonicalization
+# http://www.mail-archive.com/help-texinfo@gnu.org/msg00864.html
+manual_xml = ${docbook_outdir}/xml/libstdc++-manual-single.xml
doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
@echo "Generating XML single..."
- $(XMLLINT) --xinclude --noent --noblanks \
- -o ${docbook_outdir}/xml/spine-single.xml \
- ${top_srcdir}/doc/xml/spine.xml
+ $(XMLLINT) --xinclude --noent --noblanks --nocdata --nsclean --c14n \
+ ${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml}
# HTML, index plus chapters
doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
@@ -230,9 +269,10 @@ doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
$(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
# HTML, all one page
+manual_html = ${docbook_outdir}/html/libstdc++-manual-single.html
doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html single file..."
- $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
+ $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${manual_html} \
$(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
# FO
@@ -241,52 +281,24 @@ doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
$(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
-# PDF 1
-# fop
-FOP = fop
-FOP_FLAGS = -d -r
-doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
- @echo "Generating pdf fop files from xml..."
- $(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
- -xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
-
-doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
- @echo "Generating pdf fop files from fo..."
- $(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
- -pdf ${docbook_outdir}/pdf/spine.pdf
-
-# PDF 2
-# xmlto
-XML2PDF = xmlto
-XML2PDF_FLAGS = -v pdf --skip-validation -o pdf
-doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
- @echo "Generating pdf xmlto files..."
- $(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
-
-# PDF 3
-# xmlroff
-XMLROFF = xmlroff
-XMLROFF_FLAGS = --format=pdf --backend=cairo --warn=1 --debug=1 --continue
-doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
- @echo "Generating pdf xmlroff files..."
- $(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
-
-# PDF 4
-# prince
-PRINCE = prince
-PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
-doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
- @echo "Generating pdf prince files..."
- $(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
-
-# PDF 5
-# dblatex
-DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
+# PDF, via dblatex
+manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
+DBLATEX_FLAGS = --dump --verbose --pdf -o ${manual_pdf}
+doc-pdf-docbook: doc-pdf-dblatex-docbook
+
doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf dblatex files..."
dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
-doc-pdf-docbook: doc-pdf-dblatex-docbook
+# Texinfo, via docbook2X
+DB2TEXI_FLAGS = \
+ --encoding=utf-8//TRANSLIT \
+ --string-param output-file="libstdc++-manual" \
+ --string-param directory-category="GNU C++ Library" \
+ --string-param explicit-node-names=true
+doc-texinfo-docbook: doc-xml-single-docbook ${docbook_outdir}/texinfo
+ @echo "Generating texinfo files..."
+ db2x_docbook2texi $(DB2TEXI_FLAGS) ${manual_xml}
# Performance doc and graph configuration.
@@ -308,4 +320,4 @@ CLEANFILES = *.log
# To remove directories.
clean-local:
- rm -rf man html pdf fo xml doxygen docbook stamp*
+ rm -rf man html pdf fo xml doxygen docbook stamp* ./libstdc++-* db2t*
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 482bbb1f614..005e1b8927b 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -99,6 +100,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
@@ -265,7 +267,15 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# Assumes doxygen, graphviz (with dot), pdflatex installed
doxygen_script = ${top_srcdir}/scripts/run_doxygen
doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
+api_xml = ${doxygen_outdir}/xml/libstdc++-api-single.xml
+
+# Chance of loooooonnggg creation time on this rule. Iff this fails,
+# look at refman.log and see if TeX's memory is exhausted. Symptoms
+# include asking a wizard to enlarge capacity. If this is the case,
+# find texmf.cnf and add a zero for pool_size, string_vacancies,
+# max_strings, and pool_free values.
doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
+api_pdf = ${doxygen_outdir}/pdf/libstdc++-api.pdf
# Docbook configuration.
# Assumes
@@ -349,7 +359,7 @@ xml_noinst = \
XSLTPROC = xsltproc
XSLTPROC_FLAGS = --nonet --xinclude
-XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-stylesheets
+XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-ns-stylesheets
XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
#XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
@@ -359,33 +369,30 @@ XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
XMLLINT = xmllint
#LINT_FLAGS = --debug --nonet --xinclude --nsclean --postvalid --nowarning
#LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
-LINT_FLAGS = --postvalid --debug --xinclude --noent --noblanks --nonet --noout
-DTD_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
-XMLLINT_FLAGS = $(LINT_FLAGS) $(DTD_FLAGS)
-
-# PDF 1
-# fop
-FOP = fop
-FOP_FLAGS = -d -r
-
-# PDF 2
-# xmlto
-XML2PDF = xmlto
-XML2PDF_FLAGS = -v pdf --skip-validation -o pdf
-
-# PDF 3
-# xmlroff
-XMLROFF = xmlroff
-XMLROFF_FLAGS = --format=pdf --backend=cairo --warn=1 --debug=1 --continue
-
-# PDF 4
-# prince
-PRINCE = prince
-PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
-
-# PDF 5
-# dblatex
-DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
+LINT_FLAGS = --debug --xinclude --noent --noblanks --nonet --noout
+#SCHEMA_FLAGS = --relaxng /usr/share/xml/docbook5/schema/rng/5.0/docbookxi.rng
+SCHEMA_FLAGS = --dtdvalid /usr/share/xml/docbook5/schema/dtd/5.0/docbook.dtd
+XMLLINT_FLAGS = $(LINT_FLAGS) $(SCHEMA_FLAGS)
+
+# XML, all one page
+# Some info on canonicalization
+# http://www.mail-archive.com/help-texinfo@gnu.org/msg00864.html
+manual_xml = ${docbook_outdir}/xml/libstdc++-manual-single.xml
+
+# HTML, all one page
+manual_html = ${docbook_outdir}/html/libstdc++-manual-single.html
+
+# PDF, via dblatex
+manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
+DBLATEX_FLAGS = --dump --verbose --pdf -o ${manual_pdf}
+
+# Texinfo, via docbook2X
+DB2TEXI_FLAGS = \
+ --encoding=utf-8//TRANSLIT \
+ --string-param output-file="libstdc++-manual" \
+ --string-param directory-category="GNU C++ Library" \
+ --string-param explicit-node-names=true
+
# Performance doc and graph configuration.
# Assumes pychart, beautiful soup installed.
@@ -552,19 +559,40 @@ uninstall-am:
# Documentation Overview
#
# There are two main source materials for libstdc++ documentation.
-# The first is the doxygen markup in libstdc++ sources. And the second
-# is the docbook markup in doc/xml/. A third and more obscure option
-# deals with charting performance tests.
+# The first is the doxygen markup in libstdc++ sources, which is a
+# reference to the API. And the second is the docbook markup in
+# doc/xml/.
+#
+# A third and more obscure option deals with charting
+# performance tests, and should be considered experimental.
+
+# Default rules.
+#
+# Point to best sub-rule for the requested documentation target,
+# create, and then copy into toplevel directory with standardized names
+# and layouts.
+
+# HTML
+doc-html: doc-html-docbook doc-html-doxygen
+ cp -R ${docbook_outdir}/html ./libstdc++-manual.html
+ cp -R ${doxygen_outdir}/html ./libstdc++-api.html
-# Default, points to current best sub-rule that is the best conversion.
# MAN
doc-man: doc-man-doxygen
+ cp -R ${doxygen_outdir}/man ./libstdc++-api.man
# PDF
-doc-pdf: doc-pdf-docbook
+doc-pdf: doc-pdf-docbook doc-pdf-doxygen
+ cp ${docbook_outdir}/pdf/libstdc++-manual.pdf .
+ cp ${doxygen_outdir}/pdf/libstdc++-api.pdf .
-# HTML
-doc-html: doc-html-docbook
+# TEXINFO
+doc-texinfo: doc-texinfo-docbook
+
+# XML
+doc-xml: doc-xml-single-docbook doc-xml-single-doxygen
+ cp ${manual_xml} .
+ cp ${api_xml} .
doc-html-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
@@ -583,11 +611,10 @@ doc-xml-doxygen:
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
-
-doc-xml-single-doxygen:
+doc-xml-single-doxygen: doc-xml-doxygen
@echo "Generating doxygen xml single file..."
$(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
- ${doxygen_outdir}/xml/index.xml > ${doxygen_outdir}/xml/api-spine.xml;
+ ${doxygen_outdir}/xml/index.xml > ${api_xml};
doc-latex-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
@@ -595,12 +622,15 @@ doc-latex-doxygen:
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=latex $${srcdir} $${builddir} NO)
-# Chance of loooooonnggg creation time on this rule.
-doc-pdf-doxygen: stamp-latex-doxygen
+${doxygen_outdir}/pdf:
+ mkdir -p ${doxygen_outdir}/pdf
+
+doc-pdf-doxygen: stamp-latex-doxygen ${doxygen_outdir}/pdf
-(cd ${doxygen_outdir}/latex && $(MAKE) -i pdf;)
echo "Generating doxygen pdf file...";
if [ -f ${doxygen_pdf} ]; then \
- echo "... ${doxygen_pdf}"; \
+ mv ${doxygen_pdf} ${api_pdf} ; \
+ echo ":: PDF file is ${api_pdf}"; \
else \
echo "... error"; \
exit 12; \
@@ -625,37 +655,36 @@ stamp-latex-doxygen:
fi
$(STAMP) stamp-latex-doxygen
+${docbook_outdir}/fo:
+ mkdir -p ${docbook_outdir}/fo
+
${docbook_outdir}/html:
mkdir -p ${docbook_outdir}/html
${docbook_outdir}/pdf:
mkdir -p ${docbook_outdir}/pdf
-${docbook_outdir}/fo:
- mkdir -p ${docbook_outdir}/fo
+${docbook_outdir}/texinfo:
+ mkdir -p ${docbook_outdir}/texinfo
${docbook_outdir}/xml:
mkdir -p ${docbook_outdir}/xml
doc-xml-validate-docbook: $(xml_sources)
@echo "Generating XML validation log..."
$(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
-
doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
@echo "Generating XML single..."
- $(XMLLINT) --xinclude --noent --noblanks \
- -o ${docbook_outdir}/xml/spine-single.xml \
- ${top_srcdir}/doc/xml/spine.xml
+ $(XMLLINT) --xinclude --noent --noblanks --nocdata --nsclean --c14n \
+ ${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml}
# HTML, index plus chapters
doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html files..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
$(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
-
-# HTML, all one page
doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html single file..."
- $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
+ $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${manual_html} \
$(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
# FO
@@ -663,29 +692,14 @@ doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
@echo "Generating FO files..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
$(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
-doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
- @echo "Generating pdf fop files from xml..."
- $(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
- -xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
-
-doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
- @echo "Generating pdf fop files from fo..."
- $(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
- -pdf ${docbook_outdir}/pdf/spine.pdf
-doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
- @echo "Generating pdf xmlto files..."
- $(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
-doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
- @echo "Generating pdf xmlroff files..."
- $(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
-doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
- @echo "Generating pdf prince files..."
- $(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
+doc-pdf-docbook: doc-pdf-dblatex-docbook
+
doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf dblatex files..."
dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
-
-doc-pdf-docbook: doc-pdf-dblatex-docbook
+doc-texinfo-docbook: doc-xml-single-docbook ${docbook_outdir}/texinfo
+ @echo "Generating texinfo files..."
+ db2x_docbook2texi $(DB2TEXI_FLAGS) ${manual_xml}
doc-html-performance:
-@(chmod + ${doc_performance_script}; \
${doc_performance_script} ${top_srcdir} \
@@ -697,7 +711,7 @@ doc-html-performance:
# To remove directories.
clean-local:
- rm -rf man html pdf fo xml doxygen docbook stamp*
+ rm -rf man html pdf fo xml doxygen docbook stamp* ./libstdc++-* db2t*
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libstdc++-v3/doc/doxygen/doxygroups.cc b/libstdc++-v3/doc/doxygen/doxygroups.cc
index e7c664a92fb..00175388301 100644
--- a/libstdc++-v3/doc/doxygen/doxygroups.cc
+++ b/libstdc++-v3/doc/doxygen/doxygroups.cc
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2001, 2002, 2005, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005, 2008, 2009, 2010
+ Free Software Foundation, Inc.
See license.html for license.
This just provides documentation for stuff that doesn't need to be in the
@@ -47,7 +48,7 @@
* Components generally useful that are not part of any standard.
*/
-/** @defgroup SGIextensions SGI STL extensions
+/** @defgroup SGIextensions SGI
* @ingroup extensions
Because libstdc++ based its implementation of the STL subsections of
the library on the SGI 3.3 implementation, we inherited their extensions
@@ -115,7 +116,7 @@ All sequences must meet certain requirements, summarized in
<a href="tables.html">tables</a>.
*/
-/** @defgroup associative_containers Associative Containers
+/** @defgroup associative_containers Associative
* @ingroup containers
Associative containers allow fast retrieval of data based on keys.
@@ -126,7 +127,7 @@ All associative containers must meet certain requirements, summarized in
<a href="tables.html">tables</a>.
*/
-/** @defgroup unordered_associative_containers Unordered Associative Containers
+/** @defgroup unordered_associative_containers Unordered Associative
* @ingroup containers
Unordered associative containers allow fast retrieval of data based on keys.
diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in
index 118f9e78975..c9e86a51884 100644
--- a/libstdc++-v3/doc/doxygen/user.cfg.in
+++ b/libstdc++-v3/doc/doxygen/user.cfg.in
@@ -1,4 +1,4 @@
-# Doxyfile 1.6.1
+# Doxyfile 1.7.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
@@ -180,7 +180,7 @@ TAB_SIZE = 4
# You can put \n's in the value part of an alias to insert newlines.
ALIASES = "doctodo=@todo\nDoc me! See doc/doxygen/TODO and http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more. " \
- "isiosfwd=One of the @link io I/O @endlink typedefs"
+ "isiosfwd=One of the @link io I/O @endlink typedefs"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
@@ -208,17 +208,15 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
-# Doxygen selects the parser to use depending on the extension of the
-# files it parses. With this tag you can assign which parser to use
-# for a given extension. Doxygen has a built-in mapping, but you can
-# override or extend it using this tag. The format is ext=language,
-# where ext is a file extension, and language is one of the parsers
-# supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f
-# files as C (default is Fortran), use: inc=Fortran f=C. Note that for
-# custom extensions you also need to set FILE_PATTERNS otherwise the
-# files are not read by doxygen.
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
@@ -236,63 +234,57 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip
-# sources only. Doxygen will parse them like normal C++ but will
-# assume all classes use public instead of private inheritance when no
-# explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to
-# indicate getter and setter methods for a property. Setting this
-# option to YES (the default) will make doxygen to replace the get and
-# set methods by a property in the documentation. This will only work
-# if the methods are indeed getting or setting a simple type. If this
-# is not the case, or you want to show the methods anyway, you should
-# set this option to NO.
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
-IDL_PROPERTY_SUPPORT = YES
+IDL_PROPERTY_SUPPORT = NO
-# If member grouping is used in the documentation and the
-# DISTRIBUTE_GROUP_DOC tag is set to YES, then doxygen will reuse the
-# documentation of the first member in the group (if any) for the
-# other members of the group. By default all members of a group must
-# be documented explicitly.
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = YES
-# Set the SUBGROUPING tag to YES (the default) to allow class member
-# groups of the same type (for instance a group of public functions)
-# to be put as a subgroup of that type (e.g. under the Public
-# Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
SUBGROUPING = YES
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union,
-# or enum is documented as struct, union, or enum with the name of the
-# typedef. So typedef struct TypeS {} TypeT, will appear in the
-# documentation as a struct with name TypeT. When disabled the typedef
-# will appear as a member of a file, namespace, or class. And the
-# struct will be named TypeS. This can typically be useful for C code
-# in case the coding convention dictates that all compound types are
-# typedef'ed and only the typedef is referenced, never the tag name.
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use
-# to determine which symbols to keep in memory and which to flush to
-# disk. When the cache is full, less often used symbols will be
-# written to disk. For small to medium size projects (<1000 input
-# files) the default value is probably good enough. For larger
-# projects a too small cache size can cause doxygen to be busy
-# swapping symbols to and from disk most of the time causing a
-# significant performance penality. If the system has enough physical
-# memory increasing the cache will improve the performance by keeping
-# more symbols in memory. Note that the value works on a logarithmic
-# scale so increasing the size by one will rougly double the memory
-# usage. The cache size is given by this formula:
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols
@@ -396,6 +388,12 @@ HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = NO
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
@@ -415,13 +413,13 @@ SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will
-# sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the
-# default) the constructors will appear in the respective orders
-# defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be
-# ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored
-# for detailed docs if SORT_MEMBER_DOCS is set to NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
SORT_MEMBERS_CTORS_1ST = YES
@@ -505,24 +503,22 @@ SHOW_FILES = YES
SHOW_NAMESPACES = YES
-# The FILE_VERSION_FILTER tag can be used to specify a program or
-# script that doxygen should invoke to get the current version for
-# each file (typically from the version control system). Doxygen will
-# invoke the program by executing (via popen()) the command <command>
-# <input-file>, where <command> is the value of the
-# FILE_VERSION_FILTER tag, and <input-file> is the name of an input
-# file provided by doxygen. Whatever the program writes to standard
-# output is used as the file version. See the manual for examples.
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
-# The LAYOUT_FILE tag can be used to specify a layout file which will
-# be parsed by doxygen. The layout file controls the global structure
-# of the generated output files in an output format independent
-# way. The create the layout file that represents doxygen's defaults,
-# run doxygen with the -l option. You can optionally specify a file
-# name after the option, if omitted DoxygenLayout.xml will be used as
-# the name of the layout file.
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
@@ -581,162 +577,161 @@ WARN_LOGFILE =
# configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories
-# that contain documented source files. You may enter file names like
-# "myfile.cpp" or directories like "/usr/src/myproject". Separate the
-# files or directories with spaces.
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
INPUT = @srcdir@/doc/doxygen/doxygroups.cc \
- @srcdir@/libsupc++/cxxabi.h \
- @srcdir@/libsupc++/cxxabi-forced.h \
- @srcdir@/libsupc++/exception \
- @srcdir@/libsupc++/exception_ptr.h \
- @srcdir@/libsupc++/initializer_list \
- @srcdir@/libsupc++/nested_exception.h \
- @srcdir@/libsupc++/new \
- @srcdir@/libsupc++/typeinfo \
- include/algorithm \
- include/array \
- include/atomic \
- include/bitset \
- include/chrono \
- include/complex \
- include/condition_variable \
- include/deque \
- include/fstream \
- include/functional \
- include/future \
- include/iomanip \
- include/ios \
- include/iosfwd \
- include/iostream \
- include/istream \
- include/iterator \
- include/limits \
- include/list \
- include/locale \
- include/map \
- include/memory \
- include/mutex \
- include/numeric \
- include/ostream \
- include/queue \
- include/random \
- include/ratio \
- include/regex \
- include/set \
- include/sstream \
- include/stack \
- include/stdexcept \
- include/streambuf \
- include/string \
- include/system_error \
- include/thread \
- include/tuple \
- include/type_traits \
- include/unordered_map \
- include/unordered_set \
- include/utility \
- include/valarray \
- include/vector \
- include/cassert \
- include/ccomplex \
- include/cctype \
- include/cerrno \
- include/cfenv \
- include/cfloat \
- include/cinttypes \
- include/ciso646 \
- include/climits \
- include/clocale \
- include/cmath \
- include/csetjmp \
- include/csignal \
- include/cstdarg \
- include/cstdbool \
- include/cstddef \
- include/cstdint \
- include/cstdio \
- include/cstdlib \
- include/cstring \
- include/ctgmath \
- include/ctime \
- include/cwchar \
- include/cwctype \
- include/backward/hash_map \
- include/backward/hash_set \
- include/backward/strstream \
- include/debug/bitset \
- include/debug/deque \
- include/debug/list \
- include/debug/map \
- include/debug/set \
- include/debug/string \
- include/debug/unordered_map \
- include/debug/unordered_set \
- include/debug/vector \
- include/profile/bitset \
- include/profile/deque \
- include/profile/list \
- include/profile/map \
- include/profile/set \
- include/profile/unordered_map \
- include/profile/unordered_set \
- include/profile/vector \
- include/ext/algorithm \
- include/ext/functional \
- include/ext/iterator \
- include/ext/memory \
- include/ext/numeric \
- include/ext/rb_tree \
- include/ext/rope \
- include/ext/slist \
- include/parallel/algorithm \
- include/parallel/numeric \
- include/tr1/ccomplex \
- include/tr1/cctype \
- include/tr1/cfenv \
- include/tr1/cfloat \
- include/tr1/cinttypes \
- include/tr1/climits \
- include/tr1/cmath \
- include/tr1/complex \
- include/tr1/cstdarg \
- include/tr1/cstdbool \
- include/tr1/cstdint \
- include/tr1/cstdio \
- include/tr1/cstdlib \
- include/tr1/ctgmath \
- include/tr1/ctime \
- include/tr1/cwchar \
- include/tr1/cwctype \
- include/tr1_impl/array \
- include/tr1_impl/cctype \
- include/tr1_impl/cfenv \
- include/tr1_impl/cinttypes \
- include/tr1_impl/cmath \
- include/tr1_impl/complex \
- include/tr1_impl/cstdint \
- include/tr1_impl/cstdio \
- include/tr1_impl/cstdlib \
- include/tr1_impl/cwchar \
- include/tr1_impl/cwctype \
- include/tr1_impl/regex \
- include/tr1_impl/type_traits \
- include/tr1_impl/utility \
- include/tr1_impl \
- include/decimal/decimal \
- include/ \
- include/@host_alias@/bits \
- include/backward \
- include/bits \
- include/debug \
- include/parallel \
- include/profile \
- include/profile/impl \
- include/ext \
- include/ext/pb_ds \
- include/ext/pb_ds/detail
+ @srcdir@/libsupc++/cxxabi.h \
+ @srcdir@/libsupc++/cxxabi-forced.h \
+ @srcdir@/libsupc++/exception \
+ @srcdir@/libsupc++/exception_ptr.h \
+ @srcdir@/libsupc++/initializer_list \
+ @srcdir@/libsupc++/nested_exception.h \
+ @srcdir@/libsupc++/new \
+ @srcdir@/libsupc++/typeinfo \
+ include/algorithm \
+ include/array \
+ include/atomic \
+ include/bitset \
+ include/chrono \
+ include/complex \
+ include/condition_variable \
+ include/deque \
+ include/fstream \
+ include/functional \
+ include/future \
+ include/iomanip \
+ include/ios \
+ include/iosfwd \
+ include/iostream \
+ include/istream \
+ include/iterator \
+ include/limits \
+ include/list \
+ include/locale \
+ include/map \
+ include/memory \
+ include/mutex \
+ include/numeric \
+ include/ostream \
+ include/queue \
+ include/random \
+ include/ratio \
+ include/regex \
+ include/set \
+ include/sstream \
+ include/stack \
+ include/stdexcept \
+ include/streambuf \
+ include/string \
+ include/system_error \
+ include/thread \
+ include/tuple \
+ include/type_traits \
+ include/unordered_map \
+ include/unordered_set \
+ include/utility \
+ include/valarray \
+ include/vector \
+ include/cassert \
+ include/ccomplex \
+ include/cctype \
+ include/cerrno \
+ include/cfenv \
+ include/cfloat \
+ include/cinttypes \
+ include/ciso646 \
+ include/climits \
+ include/clocale \
+ include/cmath \
+ include/csetjmp \
+ include/csignal \
+ include/cstdarg \
+ include/cstdbool \
+ include/cstddef \
+ include/cstdint \
+ include/cstdio \
+ include/cstdlib \
+ include/cstring \
+ include/ctgmath \
+ include/ctime \
+ include/cwchar \
+ include/cwctype \
+ include/backward/hash_map \
+ include/backward/hash_set \
+ include/backward/strstream \
+ include/debug/bitset \
+ include/debug/deque \
+ include/debug/list \
+ include/debug/map \
+ include/debug/set \
+ include/debug/string \
+ include/debug/unordered_map \
+ include/debug/unordered_set \
+ include/debug/vector \
+ include/profile/bitset \
+ include/profile/deque \
+ include/profile/list \
+ include/profile/map \
+ include/profile/set \
+ include/profile/unordered_map \
+ include/profile/unordered_set \
+ include/profile/vector \
+ include/ext/algorithm \
+ include/ext/functional \
+ include/ext/iterator \
+ include/ext/memory \
+ include/ext/numeric \
+ include/ext/rb_tree \
+ include/ext/rope \
+ include/ext/slist \
+ include/parallel/algorithm \
+ include/parallel/numeric \
+ include/tr1/ccomplex \
+ include/tr1/cctype \
+ include/tr1/cfenv \
+ include/tr1/cfloat \
+ include/tr1/cinttypes \
+ include/tr1/climits \
+ include/tr1/cmath \
+ include/tr1/complex \
+ include/tr1/cstdarg \
+ include/tr1/cstdbool \
+ include/tr1/cstdint \
+ include/tr1/cstdio \
+ include/tr1/cstdlib \
+ include/tr1/ctgmath \
+ include/tr1/ctime \
+ include/tr1/cwchar \
+ include/tr1/cwctype \
+ include/tr1_impl/array \
+ include/tr1_impl/cctype \
+ include/tr1_impl/cfenv \
+ include/tr1_impl/cinttypes \
+ include/tr1_impl/cmath \
+ include/tr1_impl/complex \
+ include/tr1_impl/cstdint \
+ include/tr1_impl/cstdio \
+ include/tr1_impl/cstdlib \
+ include/tr1_impl/cwchar \
+ include/tr1_impl/cwctype \
+ include/tr1_impl/type_traits \
+ include/tr1_impl/utility \
+ include/tr1_impl \
+ include/decimal/decimal \
+ include/ \
+ include/@host_alias@/bits \
+ include/backward \
+ include/bits \
+ include/debug \
+ include/parallel \
+ include/profile \
+ include/profile/impl \
+ include/ext \
+ include/ext/pb_ds \
+ include/ext/pb_ds/detail
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -754,8 +749,8 @@ INPUT_ENCODING = UTF-8
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS = *.h \
- *.hpp \
- *.tcc
+ *.hpp \
+ *.tcc
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -782,10 +777,10 @@ EXCLUDE_SYMLINKS = NO
# for example use the pattern */test/*
EXCLUDE_PATTERNS = stamp-* \
- *stdc++.h* \
- *stdtr1c++.h* \
- *extc++.h* \
- */.svn/*
+ *stdc++.h* \
+ *stdtr1c++.h* \
+ *extc++.h* \
+ */.svn/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -961,11 +956,6 @@ HTML_HEADER =
HTML_FOOTER =
-# If the HTML_TIMESTAMP tag is set to YES then the generated HTML
-# documentation will contain the timesstamp.
-
-HTML_TIMESTAMP = NO
-
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
@@ -975,6 +965,37 @@ HTML_TIMESTAMP = NO
HTML_STYLESHEET =
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = NO
+
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
@@ -991,14 +1012,14 @@ HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5
-# (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the
-# docset in that directory and running "make install" will install the
-# docset in ~/Library/Developer/Shared/Documentation/DocSets so that
-# Xcode will find it at startup. See
-# http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for
-# more information.
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
GENERATE_DOCSET = NO
@@ -1014,7 +1035,18 @@ DOCSET_FEEDNAME = "Doxygen generated docs"
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
# will append .docset to the name.
-DOCSET_BUNDLE_ID = org.doxygen.Project
+DOCSET_BUNDLE_ID = org.gnu.libstdc++
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should
+# uniquely identify the documentation publisher. This should be a
+# reverse domain-name style string,
+# e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.fsf
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = libstdc++
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
@@ -1061,10 +1093,9 @@ BINARY_TOC = NO
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be
-# generated that can be used as input for Qt's qhelpgenerator to
-# generate a Qt Compressed Help (.qch) of the generated HTML
-# documentation.
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
GENERATE_QHP = NO
@@ -1086,23 +1117,24 @@ QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom
-# filter to add. For more information please see
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
# http://doc.trolltech.com/qthelpproject.html#custom-filters
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of
-# the custom filter to add.For more information please see <a
-# href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt
-# Help Project / Custom Filters</a>.
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
QHP_CUST_FILTER_ATTRS =
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes
-# this project's filter section matches. <a
-# href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt
-# Help Project / Filter Attributes</a>.
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
QHP_SECT_FILTER_ATTRS =
@@ -1113,6 +1145,23 @@ QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
@@ -1145,6 +1194,11 @@ USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
@@ -1153,15 +1207,34 @@ TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
-# When the SEARCHENGINE tag is enable doxygen will generate a search
-# box for the HTML output. The underlying search engine uses
-# javascript and DHTML and should work on any modern browser. Note
-# that when using HTML help (GENERATE_HTMLHELP) or Qt help
-# (GENERATE_QHP) there is already a search function so this one should
-# typically be disabled.
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = NO
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
@@ -1179,6 +1252,9 @@ LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
@@ -1225,11 +1301,10 @@ PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the
-# \\batchmode. command to the generated LaTeX files. This will
-# instruct LaTeX to keep running if errors occur, instead of asking
-# the user for help. This option is also used when generating
-# formulas in HTML.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = YES
@@ -1239,10 +1314,10 @@ LATEX_BATCHMODE = YES
LATEX_HIDE_INDICES = YES
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output. Note that which
-# sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
LATEX_SOURCE_CODE = NO
@@ -1448,37 +1523,37 @@ INCLUDE_FILE_PATTERNS =
# instead of the = operator.
PREDEFINED = __cplusplus \
- __GTHREADS \
- _GLIBCXX_HAS_GTHREADS \
- __GXX_EXPERIMENTAL_CXX0X__ \
- _GLIBCXX_INCLUDE_AS_CXX0X \
- "_GLIBCXX_STD_P= " \
- "_GLIBCXX_STD_D= " \
- _GLIBCXX_STD=std \
- "_GLIBCXX_TR1= " \
- "_GLIBCXX_BEGIN_NAMESPACE_TR1= " \
- "_GLIBCXX_END_NAMESPACE_TR1= " \
- "_GLIBCXX_BEGIN_NAMESPACE(name)=namespace name { " \
- "_GLIBCXX_BEGIN_NESTED_NAMESPACE(name, unused)=namespace name { " \
- _GLIBCXX_END_NAMESPACE=} \
- _GLIBCXX_END_NESTED_NAMESPACE=} \
- "_GLIBCXX_TEMPLATE_ARGS=... " \
- _GLIBCXX_DEPRECATED \
- _GLIBCXX_USE_WCHAR_T \
- _GLIBCXX_USE_LONG_LONG \
- _GLIBCXX_USE_C99_STDINT_TR1 \
- _GLIBCXX_ATOMIC_BUILTINS_1 \
- _GLIBCXX_ATOMIC_BUILTINS_2 \
- _GLIBCXX_ATOMIC_BUILTINS_4 \
- _GLIBCXX_ATOMIC_BUILTINS_8 \
- _GLIBCXX_USE_SCHED_YIELD \
- _GLIBCXX_USE_NANOSLEEP \
- __GXX_RTTI \
- __glibcxx_function_requires=// \
- __glibcxx_class_requires=// \
- __glibcxx_class_requires2=// \
- __glibcxx_class_requires3=// \
- __glibcxx_class_requires4=//
+ __GTHREADS \
+ _GLIBCXX_HAS_GTHREADS \
+ __GXX_EXPERIMENTAL_CXX0X__ \
+ _GLIBCXX_INCLUDE_AS_CXX0X \
+ "_GLIBCXX_STD_P= " \
+ "_GLIBCXX_STD_D= " \
+ _GLIBCXX_STD=std \
+ "_GLIBCXX_TR1= " \
+ "_GLIBCXX_BEGIN_NAMESPACE_TR1= " \
+ "_GLIBCXX_END_NAMESPACE_TR1= " \
+ "_GLIBCXX_BEGIN_NAMESPACE(name)=namespace name { " \
+ "_GLIBCXX_BEGIN_NESTED_NAMESPACE(name, unused)=namespace name { " \
+ _GLIBCXX_END_NAMESPACE=} \
+ _GLIBCXX_END_NESTED_NAMESPACE=} \
+ "_GLIBCXX_TEMPLATE_ARGS=... " \
+ _GLIBCXX_DEPRECATED \
+ _GLIBCXX_USE_WCHAR_T \
+ _GLIBCXX_USE_LONG_LONG \
+ _GLIBCXX_USE_C99_STDINT_TR1 \
+ _GLIBCXX_ATOMIC_BUILTINS_1 \
+ _GLIBCXX_ATOMIC_BUILTINS_2 \
+ _GLIBCXX_ATOMIC_BUILTINS_4 \
+ _GLIBCXX_ATOMIC_BUILTINS_8 \
+ _GLIBCXX_USE_SCHED_YIELD \
+ _GLIBCXX_USE_NANOSLEEP \
+ __GXX_RTTI \
+ __glibcxx_function_requires=// \
+ __glibcxx_class_requires=// \
+ __glibcxx_class_requires2=// \
+ __glibcxx_class_requires3=// \
+ __glibcxx_class_requires4=//
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
@@ -1575,6 +1650,14 @@ HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
# By default doxygen will write a font called FreeSans.ttf to the
# output directory and reference it in all dot files that doxygen
# generates. This font does not include all possible unicode
@@ -1590,7 +1673,7 @@ DOT_FONTNAME = FreeSans
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
-DOT_FONTSIZE = 10
+DOT_FONTSIZE = 9
# By default doxygen will tell dot to use the output directory to look for the
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html
index 624339674bb..c9aab0adbfa 100644
--- a/libstdc++-v3/doc/html/api.html
+++ b/libstdc++-v3/doc/html/api.html
@@ -7,7 +7,7 @@
<a class="ulink" href="http://www.fsf.org/" target="_top">FSF
</a>
- </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id491737"></a><p>
+ </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id343928"></a><p>
<a class="link" href="manual/license.html" title="License">License
</a>
</p></div></div></div><hr /></div><p>
diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html
index 76f318c969d..db71bd0e065 100644
--- a/libstdc++-v3/doc/html/faq.html
+++ b/libstdc++-v3/doc/html/faq.html
@@ -4,7 +4,7 @@
2008
<a class="ulink" href="http://www.fsf.org" target="_top">FSF</a>
- </p></div></div><hr /></div><div class="qandaset" title="Frequently Asked Questions"><a id="id573102"></a><dl><dt>1. <a href="faq.html#faq.info">General Information</a></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what">
+ </p></div></div><hr /></div><div class="qandaset" title="Frequently Asked Questions"><a id="id460433"></a><dl><dt>1. <a href="faq.html#faq.info">General Information</a></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what">
What is libstdc++?
</a></dt><dt>1.2. <a href="faq.html#faq.why">
Why should I use libstdc++?
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html
index 051d83196d2..6aaacb98ccf 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -5,9 +5,9 @@
</th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="ABI Policy and Guidelines"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.abi"></a>ABI Policy and Guidelines</h2></div></div></div><p>
</p><div class="sect2" title="The C++ Interface"><div class="titlepage"><div><div><h3 class="title"><a id="abi.cxx_interface"></a>The C++ Interface</h3></div></div></div><p>
- C++ applications often dependent on specific language support
+ C++ applications often depend on specific language support
routines, say for throwing exceptions, or catching exceptions, and
- perhaps also dependent on features in the C++ Standard Library.
+ perhaps also depend on features in the C++ Standard Library.
</p><p>
The C++ Standard Library has many include files, types defined in
those include files, specific named functions, and other
@@ -65,7 +65,7 @@ as to give distinct versions to the C++ interface.
releases of library binaries the ability to add new symbols and add
functionality, all the while retaining compatibility with the previous
releases in the series. Thus, program binaries linked with the initial
-release of a library binary will still link correctly if the library
+release of a library binary will still run correctly if the library
binary is replaced by carefully-managed subsequent library
binaries. This is called forward compatibility.
</p><p>
@@ -99,7 +99,7 @@ compatible.
is not listed, it has the same version labels as the preceding
release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: GCC_3.0</p></li><li class="listitem"><p>gcc-3.3.0: GCC_3.3</p></li><li class="listitem"><p>gcc-3.3.1: GCC_3.3.1</p></li><li class="listitem"><p>gcc-3.3.2: GCC_3.3.2</p></li><li class="listitem"><p>gcc-3.3.4: GCC_3.3.4</p></li><li class="listitem"><p>gcc-3.4.0: GCC_3.4</p></li><li class="listitem"><p>gcc-3.4.2: GCC_3.4.2</p></li><li class="listitem"><p>gcc-3.4.4: GCC_3.4.4</p></li><li class="listitem"><p>gcc-4.0.0: GCC_4.0.0</p></li><li class="listitem"><p>gcc-4.1.0: GCC_4.1.0</p></li><li class="listitem"><p>gcc-4.2.0: GCC_4.2.0</p></li><li class="listitem"><p>gcc-4.3.0: GCC_4.3.0</p></li><li class="listitem"><p>gcc-4.4.0: GCC_4.4.0</p></li></ul></div></li><li class="listitem"><p>
Release versioning on the libstdc++.so binary, implemented in
- the same was as the libgcc_s.so binary above. Listed is the
+ the same way as the libgcc_s.so binary above. Listed is the
filename: <code class="constant">DT_SONAME</code> can be deduced from
the filename by removing the last two period-delimited numbers. For
example, filename <code class="filename">libstdc++.so.5.0.4</code>
@@ -117,9 +117,9 @@ compatible.
Note 3: This release (but not previous or subsequent) has one
known incompatibility, see <a class="ulink" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33678" target="_top">33678</a>
in the GCC bug database.
- </p></li><li class="listitem"><p>Symbol versioning on the libstdc++.so binary.</p><p>mapfile: libstdc++/config/linker-map.gnu</p><p>It is versioned with the following labels and version
+ </p></li><li class="listitem"><p>Symbol versioning on the libstdc++.so binary.</p><p>mapfile: libstdc++-v3/config/abi/pre/gnu.ver</p><p>It is versioned with the following labels and version
definitions, where the version definition is the maximum for a
- particular release. Note, only symbol which are newly introduced
+ particular release. Note, only symbols which are newly introduced
will use the maximum version definition. Thus, for release series
with the same label, but incremented version definitions, the later
release has both versions. (An example of this would be the
@@ -151,7 +151,7 @@ compatible.
was released, in compressed ISO date format, as an unsigned long.
</p><p>
This macro is defined in the file "c++config" in the
- "libstdc++/include/bits" directory. (Up to gcc-4.1.0, it was
+ "libstdc++-v3/include/bits" directory. (Up to gcc-4.1.0, it was
changed every night by an automated script. Since gcc-4.1.0, it is
the same value as gcc/DATESTAMP.)
</p><p>
@@ -164,7 +164,7 @@ compatible.
is called _GLIBCXX_VERSION).
</p><p>
This macro is defined in the file "c++config" in the
- "libstdc++/include/bits" directory and is generated
+ "libstdc++-v3/include/bits" directory and is generated
automatically by autoconf as part of the configure-time generation
of config.h.
</p><p>
@@ -177,7 +177,7 @@ compatible.
All C++ includes are installed in include/c++, then nest in a
directory hierarchy corresponding to the C++ compiler's released
version. This version corresponds to the variable "gcc_version" in
- "libstdc++/acinclude.m4," and more details can be found in that
+ "libstdc++-v3/acinclude.m4," and more details can be found in that
file's macro GLIBCXX_CONFIGURE (GLIBCPP_CONFIGURE before gcc-3.4.0).
</p><p>
C++ includes are versioned as follows:
@@ -190,7 +190,8 @@ compatible.
</p></div><div class="sect3" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.prereq"></a>Prerequisites</h4></div></div></div><p>
Minimum environment that supports a versioned ABI: A supported
dynamic linker, a GNU linker of sufficient vintage to understand
- demangled C++ name globbing (ld), a shared executable compiled
+ demangled C++ name globbing (ld) or the Sun linker, a shared
+ executable compiled
with g++, and shared libraries (libgcc_s, libstdc++) compiled by
a compiler (g++) with a compatible ABI. Phew.
</p><p>
@@ -200,7 +201,7 @@ compatible.
</p><p>
Most modern Linux and BSD versions, particularly ones using
gcc-3.1.x tools and more recent vintages, will meet the
- requirements above.
+ requirements above, as does Solaris 2.5 and up.
</p></div><div class="sect3" title="Configuring"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.config"></a>Configuring</h4></div></div></div><p>
It turns out that most of the configure options that change
default behavior will impact the mangled names of exported
@@ -208,12 +209,12 @@ compatible.
</p><p>
For more information on configure options, including ABI
impacts, see:
- http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html
+ <a class="link" href="configure.html" title="Configure">here</a>
</p><p>
There is one flag that explicitly deals with symbol versioning:
--enable-symvers.
</p><p>
- In particular, libstdc++/acinclude.m4 has a macro called
+ In particular, libstdc++-v3/acinclude.m4 has a macro called
GLIBCXX_ENABLE_SYMVERS that defaults to yes (or the argument
passed in via --enable-symvers=foo). At that point, the macro
attempts to make sure that all the requirement for symbol
@@ -228,6 +229,7 @@ compatible.
checking versioning on shared library symbols... gnu
</code>
</pre><p>
+ or another of the supported styles.
If you don't see this line in the configure output, or if this line
appears but the last word is 'no', then you are out of luck.
</p><p>
@@ -255,6 +257,17 @@ If you see symbols in the resulting output with "GLIBCXX_3" as part
of the name, then the executable is versioned. Here's an example:
</p><p>
<code class="code">U _ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4</code>
+</p><p>
+On Solaris 2, you can use <code class="code">pvs -r</code> instead:
+</p><pre class="programlisting">
+%g++ hello.cc -o hello.out
+
+%pvs -r hello.out
+ libstdc++.so.6 (GLIBCXX_3.4, GLIBCXX_3.4.12);
+ libgcc_s.so.1 (GCC_3.0);
+ libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
+</pre><p>
+<code class="code">ldd -v</code> works too, but is very verbose.
</p></div></div><div class="sect2" title="Allowed Changes"><div class="titlepage"><div><div><h3 class="title"><a id="abi.changes_allowed"></a>Allowed Changes</h3></div></div></div><p>
The following will cause the library minor version number to
increase, say from "libstdc++.so.3.0.4" to "libstdc++.so.3.0.5".
@@ -274,7 +287,7 @@ number to increase, say from "libstdc++.so.3.0.4" to
</p></li><li class="listitem"><p> Adding an explicit copy constructor or destructor to a
class that would otherwise have implicit versions. This will change
the way the compiler deals with this class in by-value return
-statements or parameters: instead of being passing instances of this
+statements or parameters: instead of passing instances of this
class in registers, the compiler will be forced to use memory. See <a class="ulink" href="http://www.codesourcery.com/cxx-abi/abi.html#calls" target="_top"> this part</a>
of the C++ ABI documentation for further details.
</p></li></ol></div></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="abi.impl"></a>Implementation</h3></div></div></div><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
@@ -358,7 +371,7 @@ http://gcc.gnu.org/ml/gcc/2002-08/msg00142.html
Two.
Use the 'make check-abi' rule in the libstdc++ Makefile.
</p><p>
-This is a proactive check the library ABI. Currently, exported symbol
+This is a proactive check of the library ABI. Currently, exported symbol
names that are either weak or defined are checked against a last known
good baseline. Currently, this baseline is keyed off of 3.4.0
binaries, as this was the last time the .so number was incremented. In
@@ -387,13 +400,13 @@ Another approach might be to use the -fdump-class-hierarchy flag to
get information. However, currently this approach gives insufficient
data for use in library testing, as class data members, their offsets,
and other detailed data is not displayed with this flag.
-(See g++/7470 on how this was used to find bugs.)
+(See PR g++/7470 on how this was used to find bugs.)
</p><p>
Perhaps there are other C++ ABI checkers. If so, please notify
us. We'd like to know about them!
</p></div><div class="sect3" title="Multiple ABI Testing"><div class="titlepage"><div><div><h4 class="title"><a id="abi.testing.multi"></a>Multiple ABI Testing</h4></div></div></div><p>
A "C" application, dynamically linked to two shared libraries, liba,
-libb. The dependent library liba is C++ shared library compiled with
+libb. The dependent library liba is a C++ shared library compiled with
gcc-3.3.x, and uses io, exceptions, locale, etc. The dependent library
libb is a C++ shared library compiled with gcc-3.4.x, and also uses io,
exceptions, locale, etc.
@@ -467,49 +480,49 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="ulink" href="http://gcc.gnu.org/PR24660" target="_top">24660: versioning weak symbols in libstdc++</a>
</p><p>
<a class="ulink" href="http://gcc.gnu.org/PR19664" target="_top">19664: libstdc++ headers should have pop/push of the visibility around the declarations</a>
-</p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id528502"></a><p><span class="biblioid">
+</p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id396917"></a><p><span class="biblioid">
<a class="ulink" href="http://abicheck.sourceforge.net/" target="_top">
<em class="citetitle">
ABIcheck, a vague idea of checking ABI compatibility
</em>
</a>
- . </span></p></div><div class="biblioentry"><a id="id528522"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id396937"></a><p><span class="biblioid">
<a class="ulink" href="http://www.codesourcery.com/public/cxx-abi/" target="_top">
<em class="citetitle">
C++ ABI Reference
</em>
</a>
- . </span></p></div><div class="biblioentry"><a id="id528541"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id396956"></a><p><span class="biblioid">
<a class="ulink" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" target="_top">
<em class="citetitle">
Intel Compilers for Linux Compatibility with the GNU Compilers
</em>
</a>
- . </span></p></div><div class="biblioentry"><a id="id528561"></a><p><span class="biblioid">
- <a class="ulink" href="http://docs.sun.com/app/docs/doc/817-1984" target="_top">
+ . </span></p></div><div class="biblioentry"><a id="id396976"></a><p><span class="biblioid">
+ <a class="ulink" href="http://docs.sun.com/app/docs/doc/819-0690" target="_top">
<em class="citetitle">
- Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)
+ Linker and Libraries Guide (document 819-0690)
</em>
</a>
- . </span></p></div><div class="biblioentry"><a id="id528581"></a><p><span class="biblioid">
- <a class="ulink" href="http://docs.sun.com/app/docs/doc/819-5266" target="_top">
+ . </span></p></div><div class="biblioentry"><a id="id396995"></a><p><span class="biblioid">
+ <a class="ulink" href="http://docs.sun.com/app/docs/doc/819-3689" target="_top">
<em class="citetitle">
- Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)
+ Sun Studio 11: C++ Migration Guide (document 819-3689)
</em>
</a>
- . </span></p></div><div class="biblioentry"><a id="id528600"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id397015"></a><p><span class="biblioid">
<a class="ulink" href="http://people.redhat.com/drepper/dsohowto.pdf" target="_top">
<em class="citetitle">
How to Write Shared Libraries
</em>
</a>
- . </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="id528631"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="id397046"></a><p><span class="biblioid">
<a class="ulink" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top">
<em class="citetitle">
C++ ABI for the ARM Architecture
</em>
</a>
- . </span></p></div><div class="biblioentry"><a id="id528651"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id397065"></a><p><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top">
<em class="citetitle">
Dynamic Shared Objects: Survey and Issues
@@ -517,7 +530,7 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
</a>
. </span><span class="subtitle">
ISO C++ J16/06-0046
- . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="id528685"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="id397100"></a><p><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" target="_top">
<em class="citetitle">
Versioning With Namespaces
@@ -525,7 +538,7 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
</a>
. </span><span class="subtitle">
ISO C++ J16/06-0083
- . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="id639657"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="id397135"></a><p><span class="biblioid">
<a class="ulink" href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf" target="_top">
<em class="citetitle">
Binary Compatibility of Shared Libraries Implemented in C++
diff --git a/libstdc++-v3/doc/html/manual/algorithms.html b/libstdc++-v3/doc/html/manual/algorithms.html
index 0ef261f85c9..d72518a6d70 100644
--- a/libstdc++-v3/doc/html/manual/algorithms.html
+++ b/libstdc++-v3/doc/html/manual/algorithms.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 11.  Algorithms"><div class="titlepage"><div><div><h2 class="title"><a id="std.algorithms"></a>Chapter 11. 
Algorithms
- <a id="id539624" class="indexterm"></a>
+ <a id="id511298" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="sect2"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt></dl></dd></dl></div><p>
The neatest accomplishment of the algorithms sect1 is that all the
work is done via iterators, not containers directly. This means two
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index 45b2b378b24..d53fa3ebb65 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -75,11 +75,11 @@ _Alloc_traits</code> have been removed.
<span class="type">__alloc</span> to select an underlying allocator that
satisfied memory allocation requests. The selection of this
underlying allocator was not user-configurable.
- </p><div class="table"><a id="id659684"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
+ </p><div class="table"><a id="id510444"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
of available allocators. All of these new allocators are
standard-style. The following table includes details, along with
the first released version of GCC that included the extension allocator.
- </p><div class="table"><a id="id651845"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id396448"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
Debug mode first appears.
</p><p>
Precompiled header support <acronym class="acronym">PCH</acronym> support.
diff --git a/libstdc++-v3/doc/html/manual/appendix_contributing.html b/libstdc++-v3/doc/html/manual/appendix_contributing.html
index 1864b97d84c..fff5258f25a 100644
--- a/libstdc++-v3/doc/html/manual/appendix_contributing.html
+++ b/libstdc++-v3/doc/html/manual/appendix_contributing.html
@@ -7,7 +7,7 @@
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix A.  Contributing"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.contrib"></a>Appendix A. 
Contributing
- <a id="id572634" class="indexterm"></a>
+ <a id="id431932" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="documentation_style.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="documentation_style.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="documentation_style.html#doc_style.docbook">Docbook</a></span></dt><dt><span class="sect2"><a href="documentation_style.html#doc_style.combines">Combines</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
The GNU C++ Library follows an open development model. Active
contributors are assigned maintainer-ship responsibility, and given
diff --git a/libstdc++-v3/doc/html/manual/appendix_free.html b/libstdc++-v3/doc/html/manual/appendix_free.html
index 15db4da3b0d..847d386aacb 100644
--- a/libstdc++-v3/doc/html/manual/appendix_free.html
+++ b/libstdc++-v3/doc/html/manual/appendix_free.html
@@ -7,7 +7,7 @@
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix C.  Free Software Needs Free Documentation"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.free"></a>Appendix C. 
Free Software Needs Free Documentation
- <a id="id536958" class="indexterm"></a>
+ <a id="id381354" class="indexterm"></a>
</h2></div></div></div><p>
The biggest deficiency in free operating systems is not in the
software--it is the lack of good free manuals that we can include in
diff --git a/libstdc++-v3/doc/html/manual/appendix_gpl.html b/libstdc++-v3/doc/html/manual/appendix_gpl.html
index e2258ccf2d3..9e5814957d8 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gpl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gpl.html
@@ -78,7 +78,7 @@
</p><p>
The precise terms and conditions for copying, distribution and modification
follow.
- </p><h2><a id="id537276"></a>
+ </p><h2><a id="id487484"></a>
TERMS AND CONDITIONS
</h2><h2><a id="gpl-3-definitions"></a>
0. Definitions.
@@ -619,7 +619,7 @@
waiver of all civil liability in connection with the Program, unless a
warranty or assumption of liability accompanies a copy of the Program in
return for a fee.
- </p><h2><a id="id566887"></a>
+ </p><h2><a id="id378663"></a>
END OF TERMS AND CONDITIONS
</h2><h2><a id="HowToApply"></a>
How to Apply These Terms to Your New Programs
diff --git a/libstdc++-v3/doc/html/manual/appendix_porting.html b/libstdc++-v3/doc/html/manual/appendix_porting.html
index 9a3e94b7ace..d53ccecf751 100644
--- a/libstdc++-v3/doc/html/manual/appendix_porting.html
+++ b/libstdc++-v3/doc/html/manual/appendix_porting.html
@@ -7,7 +7,7 @@
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix B.  Porting and Maintenance"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting"></a>Appendix B. 
Porting and Maintenance
- <a id="id549164" class="indexterm"></a>
+ <a id="id487054" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dt><span class="sect2"><a href="test.html#test.special">Special Topics</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></div><div class="sect1" title="Configure and Build Hacking"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.build_hacking"></a>Configure and Build Hacking</h2></div></div></div><div class="sect2" title="Prerequisites"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.prereq"></a>Prerequisites</h3></div></div></div><p>
As noted <a class="ulink" href="http://gcc.gnu.org/install/prerequisites.html" target="_top">previously</a>,
certain other tools are necessary for hacking on files that
diff --git a/libstdc++-v3/doc/html/manual/atomics.html b/libstdc++-v3/doc/html/manual/atomics.html
index 317d66fce72..31158a46c57 100644
--- a/libstdc++-v3/doc/html/manual/atomics.html
+++ b/libstdc++-v3/doc/html/manual/atomics.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 14.  Atomics"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics"></a>Chapter 14. 
Atomics
- <a id="id601538" class="indexterm"></a>
+ <a id="id379773" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></div><p>
Facilities for atomic operations.
</p><div class="sect1" title="API Reference"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.atomics.api"></a>API Reference</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html
index 02517c6cd94..27f3ccb783d 100644
--- a/libstdc++-v3/doc/html/manual/backwards.html
+++ b/libstdc++-v3/doc/html/manual/backwards.html
@@ -17,8 +17,8 @@ ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those
<span class="quote">“<span class="quote">obvious</span>â€</span> classes didn't get included.
-</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="id591781"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
-</p></div><div class="sect3" title="No cout in ostream.h, no cin in istream.h"><div class="titlepage"><div><div><h4 class="title"><a id="id591813"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
+</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="id509028"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
+</p></div><div class="sect3" title="No cout in ostream.h, no cin in istream.h"><div class="titlepage"><div><div><h4 class="title"><a id="id509060"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
In earlier versions of the standard,
<code class="filename">fstream.h</code>,
<code class="filename">ostream.h</code>
@@ -44,7 +44,7 @@ considered replaced and rewritten.
archived. The code is considered replaced and rewritten.
</p><p>
Portability notes and known implementation limitations are as follows.
-</p><div class="sect3" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="id659770"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
+</p><div class="sect3" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="id509158"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
Some care is required to support C++ compiler and or library
implementation that do not have the standard library in
<code class="code">namespace std</code>.
@@ -108,7 +108,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
fi
])
-</pre></div><div class="sect3" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="id659892"></a>Illegal iterator usage</h4></div></div></div><p>
+</pre></div><div class="sect3" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="id509280"></a>Illegal iterator usage</h4></div></div></div><p>
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
@@ -121,7 +121,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</p></li><li class="listitem"><p>
<code class="code">if (iterator)</code> won't work any more =&gt; use
<code class="code">if (iterator != iterator_type())</code>
- </p></li></ul></div></div><div class="sect3" title="isspace from cctype is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="id659954"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </p></li></ul></div></div><div class="sect3" title="isspace from cctype is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="id509341"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
</h4></div></div></div><p>
Glibc 2.0.x and 2.1.x define <code class="filename">ctype.h</code> functionality as macros
(isspace, isalpha etc.).
@@ -154,7 +154,7 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
(<code class="filename">ctype.h</code>) and the
definitions in namespace <code class="code">std::</code>
(<code class="code">&lt;cctype&gt;</code>).
-</p></div><div class="sect3" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="id660047"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
+</p></div><div class="sect3" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="id509434"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
One solution is to add an autoconf-test for this:
</p><pre class="programlisting">
AC_MSG_CHECKING(for container::at)
@@ -180,7 +180,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</pre><p>
If you are using other (non-GNU) compilers it might be a good idea
to check for <code class="code">string::at</code> separately.
-</p></div><div class="sect3" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="id660085"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
+</p></div><div class="sect3" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="id509472"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
Use some kind of autoconf test, plus this:
</p><pre class="programlisting">
#ifdef HAVE_CHAR_TRAITS
@@ -188,7 +188,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#else
#define CPP_EOF EOF
#endif
-</pre></div><div class="sect3" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="id660103"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
+</pre></div><div class="sect3" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="id509490"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
There are two functions for deleting the contents of a string:
<code class="code">clear</code> and <code class="code">erase</code> (the latter returns the
string).
@@ -206,12 +206,12 @@ erase(size_type __pos = 0, size_type __n = npos)
Unfortunately, <code class="code">clear</code> is not implemented in this
version, so you should use <code class="code">erase</code> (which is probably
faster than <code class="code">operator=(charT*)</code>).
-</p></div><div class="sect3" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="id660148"></a>
+</p></div><div class="sect3" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="id384734"></a>
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
</h4></div></div></div><p>
These are no longer supported. Please use stringstreams instead.
-</p></div><div class="sect3" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="id590365"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
+</p></div><div class="sect3" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="id384753"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
Although the ISO standard <code class="code">i/ostringstream</code>-classes are
provided, (<code class="filename">sstream</code>), for
compatibility with older implementations the pre-ISO
@@ -299,14 +299,14 @@ any = temp;
Another example of using stringstreams is in <a class="link" href="strings.html#strings.string.shrink" title="Shrink to Fit">this howto</a>.
</p><p> There is additional information in the libstdc++-v2 info files, in
particular <span class="quote">“<span class="quote">info iostream</span>â€</span>.
-</p></div><div class="sect3" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="id590515"></a>Little or no wide character support</h4></div></div></div><p>
+</p></div><div class="sect3" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="id384904"></a>Little or no wide character support</h4></div></div></div><p>
Classes <code class="classname">wstring</code> and
<code class="classname">char_traits&lt;wchar_t&gt;</code> are
not supported.
- </p></div><div class="sect3" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="id590534"></a>No templatized iostreams</h4></div></div></div><p>
+ </p></div><div class="sect3" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="id384923"></a>No templatized iostreams</h4></div></div></div><p>
Classes <code class="classname">wfilebuf</code> and
<code class="classname">wstringstream</code> are not supported.
- </p></div><div class="sect3" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="id590553"></a>Thread safety issues</h4></div></div></div><p>
+ </p></div><div class="sect3" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="id384942"></a>Thread safety issues</h4></div></div></div><p>
Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler
@@ -364,7 +364,7 @@ libstdc++-v3.
of the SGI STL (version 3.3), with extensive changes.
</p><p>A more formal description of the V3 goals can be found in the
official <a class="link" href="source_design_notes.html" title="Design Notes">design document</a>.
- </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="id590669"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
+ </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="id385058"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
(<code class="code">iostream.h</code>, <code class="code">defalloc.h</code> etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
@@ -436,7 +436,7 @@ like <code class="filename">vector.h</code> can be replaced with <code class="fi
directive <code class="code">using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
-</p></div><div class="sect3" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="id590752"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
+</p></div><div class="sect3" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="id385141"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
replaced by standardized libraries.
In particular, the unordered_map and unordered_set containers of TR1
are suitable replacement for the non-standard hash_map and hash_set
@@ -508,7 +508,7 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ])
fi
])
-</pre></div><div class="sect3" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="id532406"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
+</pre></div><div class="sect3" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="id385242"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
</h4></div></div></div><p> The existence of <code class="code">ios::nocreate</code> being used for
input-streams has been confirmed, most probably because the author
thought it would be more correct to specify nocreate explicitly. So
@@ -519,7 +519,7 @@ open the file for reading, check if it has been opened, and then
decide whether you want to create/replace or not. To my knowledge,
even older implementations support <code class="code">app</code>, <code class="code">ate</code>
and <code class="code">trunc</code> (except for <code class="code">app</code> ?).
-</p></div><div class="sect3" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="id532453"></a>
+</p></div><div class="sect3" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="id380988"></a>
No <code class="code">stream::attach(int fd)</code>
</h4></div></div></div><p>
Phil Edwards writes: It was considered and rejected for the ISO
@@ -542,7 +542,7 @@ No <code class="code">stream::attach(int fd)</code>
For another example of this, refer to
<a class="ulink" href="http://www.josuttis.com/cppcode/fdstream.html" target="_top">fdstream example</a>
by Nicolai Josuttis.
-</p></div><div class="sect3" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id532517"></a>
+</p></div><div class="sect3" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id381051"></a>
Support for C++98 dialect.
</h4></div></div></div><p>Check for complete library coverage of the C++1998/2003 standard.
</p><pre class="programlisting">
@@ -610,7 +610,7 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
fi
])
-</pre></div><div class="sect3" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id532545"></a>
+</pre></div><div class="sect3" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id381079"></a>
Support for C++TR1 dialect.
</h4></div></div></div><p>Check for library coverage of the TR1 standard.
</p><pre class="programlisting">
@@ -687,7 +687,7 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi
])
-</pre></div><div class="sect3" title="Support for C++0x dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id532588"></a>
+</pre></div><div class="sect3" title="Support for C++0x dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id381123"></a>
Support for C++0x dialect.
</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard.
</p><pre class="programlisting">
@@ -899,25 +899,25 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi
])
-</pre></div><div class="sect3" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="id532666"></a>
+</pre></div><div class="sect3" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="id381200"></a>
Container::iterator_type is not necessarily Container::value_type*
</h4></div></div></div><p>
This is a change in behavior from the previous version. Now, most
<span class="type">iterator_type</span> typedefs in container classes are POD
objects, not <span class="type">value_type</span> pointers.
-</p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id532695"></a><p><span class="biblioid">
+</p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id381229"></a><p><span class="biblioid">
<a class="ulink" href="http://www.kegel.com/gcc/gcc4.html" target="_top">
<em class="citetitle">
Migrating to GCC 4.1
</em>
</a>
- . </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="id532726"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="id381260"></a><p><span class="biblioid">
<a class="ulink" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top">
<em class="citetitle">
Building the Whole Debian Archive with GCC 4.1: A Summary
</em>
</a>
- . </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="id536896"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="id381292"></a><p><span class="biblioid">
<a class="ulink" href="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html" target="_top">
<em class="citetitle">
Migration guide for GCC-3.2
diff --git a/libstdc++-v3/doc/html/manual/bitmap_allocator.html b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
index aa81c34f038..2edd195696d 100644
--- a/libstdc++-v3/doc/html/manual/bitmap_allocator.html
+++ b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
@@ -103,7 +103,7 @@ else return false.</p></li></ol></div><p>
</p><p>
Consider a block of size 64 ints. In memory, it would look like this:
(assume a 32-bit system where, size_t is a 32-bit entity).
- </p><div class="table"><a id="id661907"></a><p class="title"><b>Table 20.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id376664"></a><p class="title"><b>Table 20.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
The first Column(268) represents the size of the Block in bytes as
seen by the Bitmap Allocator. Internally, a global free list is
used to keep track of the free blocks used and given back by the
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
index c7a65a08a7a..4a5cd00f07c 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
@@ -19,6 +19,6 @@
mode or with debug mode. The
following table provides the names and headers of the debugging
containers:
-</p><div class="table"><a id="id533025"></a><p class="title"><b>Table 17.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">&lt;debug/bitset&gt;</code></td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">&lt;debug/deque&gt;</code></td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">&lt;debug/list&gt;</code></td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">&lt;debug/vector&gt;</code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
+</p><div class="table"><a id="id419645"></a><p class="title"><b>Table 17.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">&lt;debug/bitset&gt;</code></td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">&lt;debug/deque&gt;</code></td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">&lt;debug/list&gt;</code></td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">&lt;debug/vector&gt;</code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
containers have additional debug capability.
-</p><div class="table"><a id="id661132"></a><p class="title"><b>Table 17.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id391116"></a><p class="title"><b>Table 17.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
index 848eb0f4cca..39c176c46ea 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
@@ -63,4 +63,4 @@ Then compile this code with the prerequisite compiler flags
flags for atomic operations.)
</p><p> The following table provides the names and headers of all the
parallel algorithms that can be used in a similar manner:
-</p><div class="table"><a id="id660606"></a><p class="title"><b>Table 18.1. Parallel Algorithms</b></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Algorithm</th><th align="left">Header</th><th align="left">Parallel algorithm</th><th align="left">Parallel header</th></tr></thead><tbody><tr><td align="left"><code class="function">std::accumulate</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::accumulate</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_difference</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::inner_product</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::inner_product</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::partial_sum</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::partial_sum</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::equal</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::equal</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_first_of</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_first_of</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::for_each</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::for_each</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::lexicographical_compare</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::mismatch</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::mismatch</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::transform</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::transform</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::max_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::max_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::merge</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::merge</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::min_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::min_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::nth_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::nth_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partial_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partial_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partition</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partition</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::random_shuffle</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::random_shuffle</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_union</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_union</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_intersection</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_intersection</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_symmetric_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::stable_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::stable_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::unique_copy</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::unique_copy</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id416292"></a><p class="title"><b>Table 18.1. Parallel Algorithms</b></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Algorithm</th><th align="left">Header</th><th align="left">Parallel algorithm</th><th align="left">Parallel header</th></tr></thead><tbody><tr><td align="left"><code class="function">std::accumulate</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::accumulate</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_difference</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::inner_product</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::inner_product</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::partial_sum</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::partial_sum</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::equal</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::equal</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_first_of</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_first_of</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::for_each</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::for_each</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::lexicographical_compare</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::mismatch</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::mismatch</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::transform</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::transform</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::max_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::max_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::merge</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::merge</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::min_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::min_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::nth_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::nth_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partial_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partial_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partition</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partition</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::random_shuffle</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::random_shuffle</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_union</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_union</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_intersection</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_intersection</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_symmetric_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::stable_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::stable_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::unique_copy</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::unique_copy</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
index 1bf9fcf5f42..f025729c10c 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="next" href="bk01pt03ch19s03.html" title="Extensions for Custom Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch19s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.design"></a>Design</h2></div></div></div><p>
-</p><div class="table"><a id="id556845"></a><p class="title"><b>Table 19.1. Profile Code Location</b></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Code Location</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><code class="code">libstdc++-v3/include/std/*</code></td><td align="left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/*</code></td><td align="left">Profile extension public headers (map, vector, ...).</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td align="left">Profile extension internals. Implementation files are
+</p><div class="table"><a id="id442414"></a><p class="title"><b>Table 19.1. Profile Code Location</b></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Code Location</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><code class="code">libstdc++-v3/include/std/*</code></td><td align="left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/*</code></td><td align="left">Profile extension public headers (map, vector, ...).</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td align="left">Profile extension internals. Implementation files are
only included from <code class="code">impl/profiler.h</code>, which is the only
file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break" /><p>
</p><div class="sect2" title="Wrapper Model"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"></a>Wrapper Model</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
index 7a81a561503..2f2ff5dff57 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
@@ -18,7 +18,7 @@
A high accuracy means that the diagnostic is unlikely to be wrong.
These grades are not perfect. They are just meant to guide users with
specific needs or time budgets.
- </p><div class="table"><a id="id501260"></a><p class="title"><b>Table 19.2. Profile Diagnostics</b></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Group</th><th align="left">Flag</th><th align="left">Benefit</th><th align="left">Cost</th><th align="left">Freq.</th><th align="left">Implemented</th><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.containers" target="_top">
+ </p><div class="table"><a id="id470044"></a><p class="title"><b>Table 19.2. Profile Diagnostics</b></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Group</th><th align="left">Flag</th><th align="left">Benefit</th><th align="left">Cost</th><th align="left">Freq.</th><th align="left">Implemented</th><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.containers" target="_top">
CONTAINERS</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_small" target="_top">
HASHTABLE_TOO_SMALL</a></td><td align="left">10</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_large" target="_top">
HASHTABLE_TOO_LARGE</a></td><td align="left">5</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.inefficient_hash" target="_top">
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03pr01.html b/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
index 80acbcf8755..e3ac3f7bfbd 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="extensions.html" title="Part III.  Extensions" /><link rel="next" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id644091"></a></h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id410049"></a></h2></div></div></div><p>
Here we will make an attempt at describing the non-Standard extensions to
the library. Some of these are from SGI's STL, some of these are GNU's,
and some just seemed to appear on the doorstep.
diff --git a/libstdc++-v3/doc/html/manual/concurrency.html b/libstdc++-v3/doc/html/manual/concurrency.html
index e65c5b3574f..8a51c7c5c17 100644
--- a/libstdc++-v3/doc/html/manual/concurrency.html
+++ b/libstdc++-v3/doc/html/manual/concurrency.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 15.  Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency"></a>Chapter 15. 
Concurrency
- <a id="id622379" class="indexterm"></a>
+ <a id="id387949" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></div><p>
Facilities for concurrent operation, and control thereof.
</p><div class="sect1" title="API Reference"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.concurrency.api"></a>API Reference</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
index 2b8c49a09b4..806cc973819 100644
--- a/libstdc++-v3/doc/html/manual/configure.html
+++ b/libstdc++-v3/doc/html/manual/configure.html
@@ -159,8 +159,8 @@
</p></dd><dt><span class="term"><code class="code">--enable-symvers[=style]</code></span></dt><dd><p>In 3.1 and later, tries to turn on symbol versioning in the
shared library (if a shared library has been
requested). Values for 'style' that are currently supported
- are 'gnu', 'gnu-versioned-namespace', 'darwin', and
- 'darwin-export'. Both gnu- options require that a recent
+ are 'gnu', 'gnu-versioned-namespace', 'darwin',
+ 'darwin-export', and 'sun'. Both gnu- options require that a recent
version of the GNU linker be in use. Both darwin options are
equivalent. With no style given, the configure script will try
to guess correct defaults for the host system, probe to see if
diff --git a/libstdc++-v3/doc/html/manual/containers.html b/libstdc++-v3/doc/html/manual/containers.html
index 185fa96bb60..bdf518c024f 100644
--- a/libstdc++-v3/doc/html/manual/containers.html
+++ b/libstdc++-v3/doc/html/manual/containers.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 9.  Containers"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers"></a>Chapter 9. 
Containers
- <a id="id538555" class="indexterm"></a>
+ <a id="id479957" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="sect2"><a href="containers.html#containers.sequences.list">list</a></span></dt><dt><span class="sect2"><a href="containers.html#containers.sequences.vector">vector</a></span></dt></dl></dd><dt><span class="sect1"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="sect2"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect2"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt></dl></dd><dt><span class="sect1"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="sect2"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="sect1" title="Sequences"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="sect2" title="list"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="sect3" title="list::size() is O(n)"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"></a>list::size() is O(n)</h4></div></div></div><p>
Yes it is, and that's okay. This is a decision that we preserved
when we imported SGI's STL implementation. The following is
diff --git a/libstdc++-v3/doc/html/manual/diagnostics.html b/libstdc++-v3/doc/html/manual/diagnostics.html
index 77f99ec3bdd..eac71964898 100644
--- a/libstdc++-v3/doc/html/manual/diagnostics.html
+++ b/libstdc++-v3/doc/html/manual/diagnostics.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch05s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 5.  Diagnostics"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics"></a>Chapter 5. 
Diagnostics
- <a id="id564773" class="indexterm"></a>
+ <a id="id392593" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="sect2"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></div><div class="sect1" title="Exceptions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.diagnostics.exceptions"></a>Exceptions</h2></div></div></div><div class="sect2" title="API Reference"><div class="titlepage"><div><div><h3 class="title"><a id="std.diagnostics.exceptions.api"></a>API Reference</h3></div></div></div><p>
All exception objects are defined in one of the standard header
files: <code class="filename">exception</code>,
diff --git a/libstdc++-v3/doc/html/manual/documentation_style.html b/libstdc++-v3/doc/html/manual/documentation_style.html
index 3ff11d186d2..cc233580612 100644
--- a/libstdc++-v3/doc/html/manual/documentation_style.html
+++ b/libstdc++-v3/doc/html/manual/documentation_style.html
@@ -108,7 +108,7 @@
writing Doxygen comments. Single and double quotes, and
separators in filenames are two common trouble spots. When in
doubt, consult the following table.
- </p><div class="table"><a id="id640202"></a><p class="title"><b>Table A.1. HTML to Doxygen Markup Comparison</b></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Doxygen</th></tr></thead><tbody><tr><td align="left">\</td><td align="left">\\</td></tr><tr><td align="left">"</td><td align="left">\"</td></tr><tr><td align="left">'</td><td align="left">\'</td></tr><tr><td align="left">&lt;i&gt;</td><td align="left">@a word</td></tr><tr><td align="left">&lt;b&gt;</td><td align="left">@b word</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">@c word</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">@a word</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="sect2" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.docbook"></a>Docbook</h3></div></div></div><div class="sect3" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><p>
+ </p><div class="table"><a id="id419590"></a><p class="title"><b>Table A.1. HTML to Doxygen Markup Comparison</b></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Doxygen</th></tr></thead><tbody><tr><td align="left">\</td><td align="left">\\</td></tr><tr><td align="left">"</td><td align="left">\"</td></tr><tr><td align="left">'</td><td align="left">\'</td></tr><tr><td align="left">&lt;i&gt;</td><td align="left">@a word</td></tr><tr><td align="left">&lt;b&gt;</td><td align="left">@b word</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">@c word</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">@a word</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="sect2" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.docbook"></a>Docbook</h3></div></div></div><div class="sect3" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><p>
Editing the DocBook sources requires an XML editor. Many
exist: some notable options
include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>,
@@ -238,11 +238,11 @@ xmllint --noout --valid <code class="filename">xml/index.xml</code>
<a class="ulink" href="http://www.docbook.org/tdg/en/html/part2.html" target="_top">online</a>.
An incomplete reference for HTML to Docbook conversion is
detailed in the table below.
- </p><div class="table"><a id="id542838"></a><p class="title"><b>Table A.2. HTML to Docbook XML Markup Comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Docbook</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
+ </p><div class="table"><a id="id502132"></a><p class="title"><b>Table A.2. HTML to Docbook XML Markup Comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Docbook</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
&lt;literallayout&gt;</td></tr><tr><td align="left">&lt;ul&gt;</td><td align="left">&lt;itemizedlist&gt;</td></tr><tr><td align="left">&lt;ol&gt;</td><td align="left">&lt;orderedlist&gt;</td></tr><tr><td align="left">&lt;il&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;dl&gt;</td><td align="left">&lt;variablelist&gt;</td></tr><tr><td align="left">&lt;dt&gt;</td><td align="left">&lt;term&gt;</td></tr><tr><td align="left">&lt;dd&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;a href=""&gt;</td><td align="left">&lt;ulink url=""&gt;</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td align="left">&lt;strong&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">"</td><td align="left">&lt;quote&gt;</td></tr></tbody></table></div></div><br class="table-break" /><p>
And examples of detailed markup for which there are no real HTML
equivalents are listed in the table below.
-</p><div class="table"><a id="id535867"></a><p class="title"><b>Table A.3. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left">
+</p><div class="table"><a id="id502333"></a><p class="title"><b>Table A.3. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left">
<p>&lt;function&gt;clear()&lt;/function&gt;</p>
<p>&lt;function&gt;fs.clear()&lt;/function&gt;</p>
</td></tr><tr><td align="left">&lt;type&gt;</td><td align="left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td align="left">&lt;varname&gt;</td><td align="left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td align="left">&lt;literal&gt;</td><td align="left">
diff --git a/libstdc++-v3/doc/html/manual/extensions.html b/libstdc++-v3/doc/html/manual/extensions.html
index 18c4401b0d5..33f854a19f5 100644
--- a/libstdc++-v3/doc/html/manual/extensions.html
+++ b/libstdc++-v3/doc/html/manual/extensions.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03pr01.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part III.  Extensions"><div class="titlepage"><div><div><h1 class="title"><a id="manual.ext"></a>Part III. 
Extensions
- <a id="id568141" class="indexterm"></a>
+ <a id="id468288" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt03pr01.html"></a></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="sect2"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">20. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">21. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch21s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch21s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">22. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">23. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">24. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">25. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">26. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">27. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">28. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch28s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt03ch28s03.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt03pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Facets </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/facets.html b/libstdc++-v3/doc/html/manual/facets.html
index 00758626fac..ee52b350618 100644
--- a/libstdc++-v3/doc/html/manual/facets.html
+++ b/libstdc++-v3/doc/html/manual/facets.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Facets</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Chapter 8.  Localization" /><link rel="prev" href="localization.html" title="Chapter 8.  Localization" /><link rel="next" href="containers.html" title="Chapter 9.  Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Facets</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Chapter 8. 
Localization
-</th><td width="20%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr /></div><div class="section" title="Facets"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.facet"></a>Facets</h2></div></div></div><div class="section" title="ctype"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"></a>ctype</h3></div></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"></a>Implementation</h4></div></div></div><div class="section" title="Specializations"><div class="titlepage"><div><div><h5 class="title"><a id="id628428"></a>Specializations</h5></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr /></div><div class="section" title="Facets"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.facet"></a>Facets</h2></div></div></div><div class="section" title="ctype"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"></a>ctype</h3></div></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"></a>Implementation</h4></div></div></div><div class="section" title="Specializations"><div class="titlepage"><div><div><h5 class="title"><a id="id422690"></a>Specializations</h5></div></div></div><p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
@@ -50,26 +50,26 @@ characters.
</p></li><li class="listitem"><p>
Rename abstract base class. See if just smash-overriding is a
better approach. Clarify, add sanity to naming.
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id663422"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id442703"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry" title="Correspondence"><a id="id557724"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry" title="Correspondence"><a id="id426343"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id628256"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id468198"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id628275"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id468216"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id651486"></a><p><span class="biblioid">
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id398382"></a><p><span class="biblioid">
<a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
<em class="citetitle">
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</em>
</a>
. </span><span class="copyright">Copyright © 1999
- The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id546468"></a><p><span class="title"><i>
+ The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id398412"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id648185"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id395406"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
@@ -412,17 +412,17 @@ codecvt usage.
</p></li><li class="listitem"><p>
wchar_t/char internal buffers and conversions between
internal/external buffers?
- </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id651424"></a><p><span class="title"><i>
+ </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id388454"></a><p><span class="title"><i>
The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">
Chapters 6 Character Set Handling and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id622952"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id387509"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id616285"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id387538"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id616304"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id406312"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id616322"></a><p><span class="biblioid">
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id406331"></a><p><span class="biblioid">
<a class="ulink" href="http://www.opengroup.org/austin" target="_top">
<em class="citetitle">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
@@ -431,29 +431,29 @@ codecvt usage.
. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id658821"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id408136"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id592168"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id393924"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id554048"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id446609"></a><p><span class="biblioid">
<a class="ulink" href="http://www.lysator.liu.se/c/na1.html" target="_top">
<em class="citetitle">
A brief description of Normative Addendum 1
</em>
</a>
- . </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry"><a id="id569562"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry"><a id="id331499"></a><p><span class="biblioid">
<a class="ulink" href="http://tldp.org/HOWTO/Unicode-HOWTO.html" target="_top">
<em class="citetitle">
The Unicode HOWTO
</em>
</a>
- . </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="id652216"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="id331529"></a><p><span class="biblioid">
<a class="ulink" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top">
<em class="citetitle">
UTF-8 and Unicode FAQ for Unix/Linux
@@ -700,16 +700,16 @@ void test01()
model. As of this writing, it is unknown how to query to see
if a specified message catalog exists using the gettext
package.
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id502869"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id504136"></a><p><span class="title"><i>
The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id538908"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id416147"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id533345"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id416175"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id533363"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id456221"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id654168"></a><p><span class="biblioid">
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id456239"></a><p><span class="biblioid">
<a class="ulink" href="http://www.opengroup.org/austin" target="_top">
<em class="citetitle">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
@@ -718,17 +718,17 @@ void test01()
. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id571065"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id445827"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id571106"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id455920"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id576320"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id467395"></a><p><span class="biblioid">
<a class="ulink" href="http://java.sun.com/reference/api/index.html" target="_top">
<em class="citetitle">
API Specifications, Java Platform
@@ -736,7 +736,7 @@ void test01()
</a>
. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle
- . </span></p></div><div class="biblioentry"><a id="id576344"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id467417"></a><p><span class="biblioid">
<a class="ulink" href="http://www.gnu.org/software/gettext/" target="_top">
<em class="citetitle">
GNU gettext tools, version 0.10.38, Native Language Support
diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html
index eaf97bc2255..ecdb0653316 100644
--- a/libstdc++-v3/doc/html/manual/intro.html
+++ b/libstdc++-v3/doc/html/manual/intro.html
@@ -5,5 +5,5 @@
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="status.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part I.  Introduction"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"></a>Part I. 
Introduction
- <a id="id611766" class="indexterm"></a>
+ <a id="id460662" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="sect1"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="sect1"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_macros.html">Macros</a></span></dt><dt><span class="sect1"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="sect2"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="sect2"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/io.html b/libstdc++-v3/doc/html/manual/io.html
index 9825e4cf206..d089bccc4cb 100644
--- a/libstdc++-v3/doc/html/manual/io.html
+++ b/libstdc++-v3/doc/html/manual/io.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 13.  Input and Output"><div class="titlepage"><div><div><h2 class="title"><a id="std.io"></a>Chapter 13. 
Input and Output
- <a id="id647716" class="indexterm"></a>
+ <a id="id404072" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="sect1"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="sect2"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect2"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="sect1"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect2"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="sect1"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="sect2"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect2"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="sect1"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="sect2"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect2"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></div><div class="sect1" title="Iostream Objects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.objects"></a>Iostream Objects</h2></div></div></div><p>To minimize the time you have to wait on the compiler, it's good to
only include the headers you really need. Many people simply include
&lt;iostream&gt; when they don't need to -- and that can <span class="emphasis"><em>penalize
diff --git a/libstdc++-v3/doc/html/manual/iterators.html b/libstdc++-v3/doc/html/manual/iterators.html
index 8e0680bc6f1..ee37ef7c713 100644
--- a/libstdc++-v3/doc/html/manual/iterators.html
+++ b/libstdc++-v3/doc/html/manual/iterators.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 10.  Iterators"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators"></a>Chapter 10. 
Iterators
- <a id="id573150" class="indexterm"></a>
+ <a id="id376166" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="sect2"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect2"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></div><div class="sect1" title="Predefined"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.iterators.predefined"></a>Predefined</h2></div></div></div><div class="sect2" title="Iterators vs. Pointers"><div class="titlepage"><div><div><h3 class="title"><a id="iterators.predefined.vs_pointers"></a>Iterators vs. Pointers</h3></div></div></div><p>
The following
FAQ <a class="link" href="../faq.html#faq.iterator_as_pod" title="7.1.">entry</a> points out that
diff --git a/libstdc++-v3/doc/html/manual/localization.html b/libstdc++-v3/doc/html/manual/localization.html
index e8ee2189cad..fa1d5f39945 100644
--- a/libstdc++-v3/doc/html/manual/localization.html
+++ b/libstdc++-v3/doc/html/manual/localization.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 8.  Localization"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization"></a>Chapter 8. 
Localization
- <a id="id601252" class="indexterm"></a>
+ <a id="id492578" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt></dl></dd></dl></div><div class="section" title="Locales"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.locales"></a>Locales</h2></div></div></div><div class="section" title="locale"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"></a>locale</h3></div></div></div><p>
Describes the basic locale object, including nested
classes id, facet, and the reference-counted implementation object,
@@ -403,18 +403,18 @@ global locale" (emphasis Paolo), that is:
What should non-required facet instantiations do? If the
generic implementation is provided, then how to end-users
provide specializations?
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id541662"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id469670"></a><p><span class="title"><i>
The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">
Chapters 6 Character Set Handling and 7 Locales and
Internationalization
- . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id567498"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id506284"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id628132"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id404778"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id602622"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id404796"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id602640"></a><p><span class="biblioid">
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id415109"></a><p><span class="biblioid">
<a class="ulink" href="http://www.opengroup.org/austin" target="_top">
<em class="citetitle">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
@@ -423,11 +423,11 @@ global locale" (emphasis Paolo), that is:
. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id551395"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id376691"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id560241"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id349259"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/memory.html b/libstdc++-v3/doc/html/manual/memory.html
index 90899d16a29..92e8b7f471e 100644
--- a/libstdc++-v3/doc/html/manual/memory.html
+++ b/libstdc++-v3/doc/html/manual/memory.html
@@ -93,7 +93,7 @@
or loading and unloading shared objects in memory. As such, using
caching allocators on systems that do not support
<code class="function">abi::__cxa_atexit</code> is not recommended.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"></a>Implementation</h4></div></div></div><div class="section" title="Interface Design"><div class="titlepage"><div><div><h5 class="title"><a id="id585444"></a>Interface Design</h5></div></div></div><p>
+ </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"></a>Implementation</h4></div></div></div><div class="section" title="Interface Design"><div class="titlepage"><div><div><h5 class="title"><a id="id377805"></a>Interface Design</h5></div></div></div><p>
The only allocator interface that
is supported is the standard C++ interface. As such, all STL
containers have been adjusted, and all external allocators have
@@ -106,7 +106,7 @@
</p><p>
The base class that <code class="classname">allocator</code> is derived from
may not be user-configurable.
-</p></div><div class="section" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id571671"></a>Selecting Default Allocation Policy</h5></div></div></div><p>
+</p></div><div class="section" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id406368"></a>Selecting Default Allocation Policy</h5></div></div></div><p>
It's difficult to pick an allocation strategy that will provide
maximum utility, without excessively penalizing some behavior. In
fact, it's difficult just deciding which typical actions to measure
@@ -143,7 +143,7 @@
The current default choice for
<code class="classname">allocator</code> is
<code class="classname">__gnu_cxx::new_allocator</code>.
- </p></div><div class="section" title="Disabling Memory Caching"><div class="titlepage"><div><div><h5 class="title"><a id="id594539"></a>Disabling Memory Caching</h5></div></div></div><p>
+ </p></div><div class="section" title="Disabling Memory Caching"><div class="titlepage"><div><div><h5 class="title"><a id="id394979"></a>Disabling Memory Caching</h5></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specified strategies and
heuristics. Because of this, every call to an allocator object's
@@ -308,11 +308,11 @@
A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own
documentation, found <a class="link" href="bitmap_allocator.html" title="bitmap_allocator">here</a>.
- </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id577136"></a><p><span class="title"><i>
+ </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id399256"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
</i>. </span>
isoc++_1998
- <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id577150"></a><p><span class="biblioid">
+ <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id399271"></a><p><span class="biblioid">
<a class="ulink" href="http://www.drdobbs.com/cpp/184403759" target="_top">
<em class="citetitle">
The Standard Librarian: What Are Allocators Good For?
@@ -320,19 +320,19 @@
</a>
. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
- . </span></span></p></div><div class="biblioentry"><a id="id621845"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id405510"></a><p><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/hoard/" target="_top">
<em class="citetitle">
The Hoard Memory Allocator
</em>
</a>
- . </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="id553878"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="id451188"></a><p><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top">
<em class="citetitle">
Reconsidering Custom Memory Allocation
</em>
</a>
- . </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span></p></div><div class="biblioentry"><a id="id576265"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span></p></div><div class="biblioentry"><a id="id387032"></a><p><span class="biblioid">
<a class="ulink" href="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html" target="_top">
<em class="citetitle">
Allocator Types
@@ -340,9 +340,9 @@
</a>
. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
- . </span></span></p></div><div class="biblioentry" title="The C++ Programming Language"><a id="id564944"></a><p><span class="title"><i>The C++ Programming Language</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
+ . </span></span></p></div><div class="biblioentry" title="The C++ Programming Language"><a id="id392077"></a><p><span class="title"><i>The C++ Programming Language</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry" title="Yalloc: A Recycling C++ Allocator"><a id="id564390"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section" title="auto_ptr"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"></a>auto_ptr</h3></div></div></div><div class="section" title="Limitations"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"></a>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
+ . </span></span></p></div><div class="biblioentry" title="Yalloc: A Recycling C++ Allocator"><a id="id443714"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section" title="auto_ptr"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"></a>auto_ptr</h3></div></div></div><div class="section" title="Limitations"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"></a>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
happen with misuse of the <code class="classname">auto_ptr</code> class
template (called <acronym class="acronym">AP</acronym> here) would take some
time. Suffice it to say that the use of <acronym class="acronym">AP</acronym>
@@ -458,7 +458,7 @@ drops to zero.
Derived classes override those functions to destroy resources in a context
where the correct dynamic type is known. This is an application of the
technique known as type erasure.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"></a>Implementation</h4></div></div></div><div class="section" title="Class Hierarchy"><div class="titlepage"><div><div><h5 class="title"><a id="id536213"></a>Class Hierarchy</h5></div></div></div><p>
+ </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"></a>Implementation</h4></div></div></div><div class="section" title="Class Hierarchy"><div class="titlepage"><div><div><h5 class="title"><a id="id389991"></a>Class Hierarchy</h5></div></div></div><p>
A <code class="classname">shared_ptr&lt;T&gt;</code> contains a pointer of
type <span class="type">T*</span> and an object of type
<code class="classname">__shared_count</code>. The shared_count contains a
@@ -466,7 +466,7 @@ pointer of type <span class="type">_Sp_counted_base*</span> which points to the
object that maintains the reference-counts and destroys the managed
resource.
</p><div class="variablelist"><dl><dt><span class="term"><code class="classname">_Sp_counted_base&lt;Lp&gt;</code></span></dt><dd><p>
-The base of the hierarchy is parameterized on the lock policy alone.
+The base of the hierarchy is parameterized on the lock policy (see below.)
_Sp_counted_base doesn't depend on the type of pointer being managed,
it only maintains the reference counts and calls virtual functions when
the counts drop to zero. The managed object is destroyed when the last
@@ -500,15 +500,7 @@ be forwarded to <span class="type">Tp</span>'s constructor.
Unlike the other <code class="classname">_Sp_counted_*</code> classes, this one is parameterized on the
type of object, not the type of pointer; this is purely a convenience
that simplifies the implementation slightly.
- </p></dd></dl></div></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h5 class="title"><a id="id622537"></a>Thread Safety</h5></div></div></div><p>
-The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++0x
-with support for rvalue-references and the other features from
-N2351. As with other libstdc++ headers shared by TR1 and C++0x,
-boost_shared_ptr.h uses conditional compilation, based on the macros
-<code class="constant">_GLIBCXX_INCLUDE_AS_CXX0X</code> and
-<code class="constant">_GLIBCXX_INCLUDE_AS_TR1</code>, to enable and disable
-features.
- </p><p>
+ </p></dd></dl></div></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h5 class="title"><a id="id388735"></a>Thread Safety</h5></div></div></div><p>
C++0x-only features are: rvalue-ref/move support, allocator support,
aliasing constructor, make_shared &amp; allocate_shared. Additionally,
the constructors taking <code class="classname">auto_ptr</code> parameters are
@@ -558,7 +550,7 @@ compiler, standard library, platform etc. For the version of
shared_ptr in libstdc++ the compiler and library are fixed, which
makes things much simpler: we have an atomic CAS or we don't, see Lock
Policy below for details.
-</p></div><div class="section" title="Selecting Lock Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id574548"></a>Selecting Lock Policy</h5></div></div></div><p>
+</p></div><div class="section" title="Selecting Lock Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id480578"></a>Selecting Lock Policy</h5></div></div></div><p>
</p><p>
There is a single <code class="classname">_Sp_counted_base</code> class,
which is a template parameterized on the enum
@@ -599,18 +591,24 @@ used when libstdc++ is built without <code class="literal">--enable-threads</cod
<code class="filename">ext/atomicity.h</code>, which detect if the program
is multi-threaded. If only one thread of execution exists in
the program then less expensive non-atomic operations are used.
- </p></div><div class="section" title="Dual C++0x and TR1 Implementation"><div class="titlepage"><div><div><h5 class="title"><a id="id552414"></a>Dual C++0x and TR1 Implementation</h5></div></div></div><p>
+ </p></div><div class="section" title="Dual C++0x and TR1 Implementation"><div class="titlepage"><div><div><h5 class="title"><a id="id399352"></a>Dual C++0x and TR1 Implementation</h5></div></div></div><p>
+The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++0x
+with support for rvalue-references and the other features from N2351.
+The <code class="classname">_Sp_counted_base</code> base class is implemented in
+<code class="filename">tr1/boost_sp_shared_count.h</code> and is common to the TR1
+and C++0x versions of <code class="classname">shared_ptr</code>.
+</p><p>
The classes derived from <code class="classname">_Sp_counted_base</code> (see Class Hierarchy
-below) and <code class="classname">__shared_count</code> are implemented separately for C++0x
-and TR1, in <code class="filename">bits/boost_sp_shared_count.h</code> and
-<code class="filename">tr1/boost_sp_shared_count.h</code> respectively. All other classes
-including <code class="classname">_Sp_counted_base</code> are shared by both implementations.
+above) and <code class="classname">__shared_count</code> are implemented separately for C++0x
+and TR1, in <code class="filename">bits/shared_ptr.h</code> and
+<code class="filename">tr1/shared_ptr.h</code> respectively.
</p><p>
The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
C++0x and TR1 modes needs to diverge further then it might be necessary to
-duplicate additional classes and only make changes to the C++0x versions.
-</p></div><div class="section" title="Related functions and classes"><div class="titlepage"><div><div><h5 class="title"><a id="id530167"></a>Related functions and classes</h5></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
+duplicate <code class="classname">_Sp_counted_base</code> and only make changes to
+the C++0x version.
+</p></div><div class="section" title="Related functions and classes"><div class="titlepage"><div><div><h5 class="title"><a id="id404250"></a>Related functions and classes</h5></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
<code class="code">const_pointer_cast</code></span></dt><dd><p>
As noted in N2351, these functions can be implemented non-intrusively using
the alias constructor. However the aliasing constructor is only available
@@ -643,15 +641,15 @@ is called. Users should not try to use this.
As well as the extra constructors, this implementation also needs some
members of _Sp_counted_deleter to be protected where they could otherwise
be private.
- </p></dd></dl></div></div></div><div class="section" title="Use"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"></a>Use</h4></div></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h5 class="title"><a id="id558154"></a>Examples</h5></div></div></div><p>
+ </p></dd></dl></div></div></div><div class="section" title="Use"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"></a>Use</h4></div></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h5 class="title"><a id="id478086"></a>Examples</h5></div></div></div><p>
Examples of use can be found in the testsuite, under
- <code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>.
- </p></div><div class="section" title="Unresolved Issues"><div class="titlepage"><div><div><h5 class="title"><a id="id558170"></a>Unresolved Issues</h5></div></div></div><p>
- The resolution to C++ Standard Library issue <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#674" target="_top">674</a>,
- "shared_ptr interface changes for consistency with N1856" will
- need to be implemented after it is accepted into the working
- paper. Issue <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#743" target="_top">743</a>
- might also require changes.
+ <code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>,
+ <code class="filename">testsuite/20_util/shared_ptr</code>
+ and
+ <code class="filename">testsuite/20_util/weak_ptr</code>.
+ </p></div><div class="section" title="Unresolved Issues"><div class="titlepage"><div><div><h5 class="title"><a id="id397929"></a>Unresolved Issues</h5></div></div></div><p>
+ The <span class="emphasis"><em><code class="classname">shared_ptr</code> atomic access</em></span>
+ clause in the C++0x working draft is not implemented in GCC.
</p><p>
The <span class="type">_S_single</span> policy uses atomics when used in MT
code, because it uses the same dispatcher functions that check
@@ -685,16 +683,12 @@ be private.
</p><p>
tr1::_Sp_deleter could be a private member of tr1::__shared_count but it
would alter the ABI.
- </p><p>
- Exposing the alias constructor in TR1 mode could simplify the
- *_pointer_cast functions. Constructor could be private in TR1
- mode, with the cast functions as friends.
</p></div></div><div class="section" title="Acknowledgments"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.ack"></a>Acknowledgments</h4></div></div></div><p>
The original authors of the Boost shared_ptr, which is really nice
code to work with, Peter Dimov in particular for his help and
invaluable advice on thread safety. Phillip Jordan and Paolo
Carlini for the lock policy implementation.
- </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id569700"></a><p><span class="biblioid">
+ </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id444231"></a><p><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" target="_top">
<em class="citetitle">
Improving shared_ptr for C++0x, Revision 2
@@ -702,7 +696,7 @@ be private.
</a>
. </span><span class="subtitle">
N2351
- . </span></p></div><div class="biblioentry"><a id="id552965"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id444254"></a><p><span class="biblioid">
<a class="ulink" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html" target="_top">
<em class="citetitle">
C++ Standard Library Active Issues List
@@ -710,7 +704,7 @@ be private.
</a>
. </span><span class="subtitle">
N2456
- . </span></p></div><div class="biblioentry"><a id="id552988"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id400755"></a><p><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf" target="_top">
<em class="citetitle">
Working Draft, Standard for Programming Language C++
@@ -718,7 +712,7 @@ be private.
</a>
. </span><span class="subtitle">
N2461
- . </span></p></div><div class="biblioentry"><a id="id554228"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id424141"></a><p><span class="biblioid">
<a class="ulink" href="http://boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">shared_ptr
<em class="citetitle">
Boost C++ Libraries documentation, shared_ptr
diff --git a/libstdc++-v3/doc/html/manual/numerics.html b/libstdc++-v3/doc/html/manual/numerics.html
index ea8ab1558dd..faeaf995ab0 100644
--- a/libstdc++-v3/doc/html/manual/numerics.html
+++ b/libstdc++-v3/doc/html/manual/numerics.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 12.  Numerics"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics"></a>Chapter 12. 
Numerics
- <a id="id528822" class="indexterm"></a>
+ <a id="id415325" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="sect2"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="sect1"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="sect1"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="sect2"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect2"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="sect1" title="Complex"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.numerics.complex"></a>Complex</h2></div></div></div><p>
</p><div class="sect2" title="complex Processing"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.complex.processing"></a>complex Processing</h3></div></div></div><p>
</p><p>Using <code class="code">complex&lt;&gt;</code> becomes even more comple- er, sorry,
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode.html b/libstdc++-v3/doc/html/manual/parallel_mode.html
index 7e42ddce272..bcfd91c19a2 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode.html
@@ -13,11 +13,11 @@ explicit source declaration or by compiling existing sources with a
specific compiler flag.
</p><div class="sect1" title="Intro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.intro"></a>Intro</h2></div></div></div><p>The following library components in the include
<code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="function">std::accumulate</code></p></li><li class="listitem"><p><code class="function">std::adjacent_difference</code></p></li><li class="listitem"><p><code class="function">std::inner_product</code></p></li><li class="listitem"><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include
-<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry" title="Parallelization of Bulk Operations for STL Dictionaries"><a id="id563790"></a><p><span class="title"><i>
+<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry" title="Parallelization of Bulk Operations for STL Dictionaries"><a id="id503217"></a><p><span class="title"><i>
Parallelization of Bulk Operations for STL Dictionaries
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
- . </span></span></p></div><div class="biblioentry" title="The Multi-Core Standard Template Library"><a id="id536431"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry" title="The Multi-Core Standard Template Library"><a id="id503264"></a><p><span class="title"><i>
The Multi-Core Standard Template Library
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Euro-Par 2007: Parallel Processing. (LNCS 4641)
diff --git a/libstdc++-v3/doc/html/manual/profile_mode.html b/libstdc++-v3/doc/html/manual/profile_mode.html
index 81c732621e0..6c6bea00103 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode.html
@@ -138,7 +138,7 @@ vector-size: improvement = 3: call stack = 0x804842c ...
call context.
(Environment variable not supported.)
</p></li></ul></div><p>
- </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry" title="Perflint: A Context Sensitive Performance Advisor for C++ Programs"><a id="id653695"></a><p><span class="title"><i>
+ </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry" title="Perflint: A Context Sensitive Performance Advisor for C++ Programs"><a id="id486510"></a><p><span class="title"><i>
Perflint: A Context Sensitive Performance Advisor for C++ Programs
</i>. </span><span class="author"><span class="firstname">Lixia</span> <span class="surname">Liu</span>. </span><span class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span>. </span><span class="copyright">Copyright © 2009 . </span><span class="publisher"><span class="publishername">
Proceedings of the 2009 International Symposium on Code Generation
diff --git a/libstdc++-v3/doc/html/manual/spine.html b/libstdc++-v3/doc/html/manual/spine.html
index 81745a9563e..f34706d805a 100644
--- a/libstdc++-v3/doc/html/manual/spine.html
+++ b/libstdc++-v3/doc/html/manual/spine.html
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="next" href="intro.html" title="Part I.  Introduction" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr /></div><div class="book" title="The GNU C++ Library"><div class="titlepage"><div><div><h1 class="title"><a id="manual-index"></a>The GNU C++ Library</h1></div><div><p class="copyright">Copyright © 2009, 2010
<a class="ulink" href="http://www.fsf.org" target="_top">FSF</a>
- </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id603935"></a><p>
+ </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id451847"></a><p>
<a class="link" href="license.html" title="License">License</a>
</p></div></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="part"><a href="intro.html">I.
Introduction
@@ -61,7 +61,7 @@
</a></span></dt><dt><span class="appendix"><a href="appendix_gpl.html">D.
<acronym class="acronym">GNU</acronym> General Public License version 3
- </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="status.html#id616155">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id545724">C++ 200x Implementation Status</a></dt><dt>1.3. <a href="status.html#id563255">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#id621410">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#id536642">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#id616437">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#id530054">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#id575199">C++ 200x Library Headers</a></dt><dt>3.5. <a href="using_headers.html#id549895">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#id561380">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#id605097">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#id543860">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#id599870">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#id576171">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#id563137">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#id553282">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#id550322">Extension Parallel Headers</a></dt><dt>17.1. <a href="bk01pt03ch17s03.html#id533025">Debugging Containers</a></dt><dt>17.2. <a href="bk01pt03ch17s03.html#id661132">Debugging Containers C++0x</a></dt><dt>18.1. <a href="bk01pt03ch18s03.html#id660606">Parallel Algorithms</a></dt><dt>19.1. <a href="bk01pt03ch19s02.html#id556845">Profile Code Location</a></dt><dt>19.2. <a href="bk01pt03ch19s07.html#id501260">Profile Diagnostics</a></dt><dt>20.1. <a href="bitmap_allocator.html#id661907">Bitmap Allocator Memory Map</a></dt><dt>A.1. <a href="documentation_style.html#id640202">HTML to Doxygen Markup Comparison</a></dt><dt>A.2. <a href="documentation_style.html#id542838">HTML to Docbook XML Markup Comparison</a></dt><dt>A.3. <a href="documentation_style.html#id535867">Docbook XML Element Use</a></dt><dt>B.1. <a href="api.html#id659684">Extension Allocators</a></dt><dt>B.2. <a href="api.html#id651845">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library Documentation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. 
+ </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="status.html#id475774">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id399969">C++ 200x Implementation Status</a></dt><dt>1.3. <a href="status.html#id449588">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#id471043">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#id444212">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#id470920">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#id349475">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#id477183">C++ 200x Library Headers</a></dt><dt>3.5. <a href="using_headers.html#id463447">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#id387306">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#id479735">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#id400127">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#id401869">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#id467180">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#id403996">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#id403404">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#id477245">Extension Parallel Headers</a></dt><dt>17.1. <a href="bk01pt03ch17s03.html#id419645">Debugging Containers</a></dt><dt>17.2. <a href="bk01pt03ch17s03.html#id391116">Debugging Containers C++0x</a></dt><dt>18.1. <a href="bk01pt03ch18s03.html#id416292">Parallel Algorithms</a></dt><dt>19.1. <a href="bk01pt03ch19s02.html#id442414">Profile Code Location</a></dt><dt>19.2. <a href="bk01pt03ch19s07.html#id470044">Profile Diagnostics</a></dt><dt>20.1. <a href="bitmap_allocator.html#id376664">Bitmap Allocator Memory Map</a></dt><dt>A.1. <a href="documentation_style.html#id419590">HTML to Doxygen Markup Comparison</a></dt><dt>A.2. <a href="documentation_style.html#id502132">HTML to Docbook XML Markup Comparison</a></dt><dt>A.3. <a href="documentation_style.html#id502333">Docbook XML Element Use</a></dt><dt>B.1. <a href="api.html#id510444">Extension Allocators</a></dt><dt>B.2. <a href="api.html#id396448">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library Documentation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. 
Introduction
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html
index 6603fafb45d..fa780af4e20 100644
--- a/libstdc++-v3/doc/html/manual/status.html
+++ b/libstdc++-v3/doc/html/manual/status.html
@@ -8,7 +8,7 @@ This status table is based on the table of contents of ISO/IEC 14882:2003.
</p><p>
This page describes the C++ support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id616155"></a><p class="title"><b>Table 1.1. C++ 1998/2003 Implementation Status</b></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
+</p><div class="table"><a id="id475774"></a><p class="title"><b>Table 1.1. C++ 1998/2003 Implementation Status</b></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Language support</em></span>
@@ -157,7 +157,7 @@ presence of the required flag.
</p><p>
This page describes the C++0x support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id545724"></a><p class="title"><b>Table 1.2. C++ 200x Implementation Status</b></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
+</p><div class="table"><a id="id399969"></a><p class="title"><b>Table 1.2. C++ 200x Implementation Status</b></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Language support</em></span>
@@ -202,7 +202,7 @@ particular release.
<span class="emphasis"><em>27</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Input/output library</em></span>
- </td></tr><tr><td align="left">27.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.2</td><td align="left">Iostreams requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.2.1</td><td align="left">Imbue Limitations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.2.2</td><td align="left">Positioning Type Limitations</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">27.2.3</td><td align="left">Thread safety</td><td align="left">Partial</td><td align="left"> </td></tr><tr><td align="left">27.3</td><td align="left">Forward declarations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.4</td><td align="left">Standard iostream objects</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.4.1</td><td align="left">Narrow stream objects</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.4.2</td><td align="left">Wide stream objects</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.5</td><td align="left">Iostreams base classes</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.6</td><td align="left">Stream buffers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.7</td><td align="left">Formatting and manipulators</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.8</td><td align="left">String-based streams</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.9</td><td align="left">File-based streams</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">
+ </td></tr><tr><td align="left">27.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.2</td><td align="left">Iostreams requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.2.1</td><td align="left">Imbue Limitations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.2.2</td><td align="left">Positioning Type Limitations</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">27.2.3</td><td align="left">Thread safety</td><td align="left">Partial</td><td align="left"> </td></tr><tr><td align="left">27.3</td><td align="left">Forward declarations</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.4</td><td align="left">Standard iostream objects</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.4.1</td><td align="left">Narrow stream objects</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">27.4.2</td><td align="left">Wide stream objects</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">27.5</td><td align="left">Iostreams base classes</td><td align="left">Partial</td><td align="left">Missing move and swap operations</td></tr><tr><td align="left">27.6</td><td align="left">Stream buffers</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">27.7</td><td align="left">Formatting and manipulators</td><td align="left">Partial</td><td align="left">Missing move and swap operations</td></tr><tr bgcolor="#B0B0B0"><td align="left">27.8</td><td align="left">String-based streams</td><td align="left">Partial</td><td align="left">Missing move and swap operations</td></tr><tr bgcolor="#B0B0B0"><td align="left">27.9</td><td align="left">File-based streams</td><td align="left">Partial</td><td align="left">Missing move and swap operations</td></tr><tr><td align="left">
<span class="emphasis"><em>28</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Regular expressions</em></span>
@@ -214,7 +214,7 @@ particular release.
<span class="emphasis"><em>30</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Thread support</em></span>
- </td></tr><tr><td align="left">30.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.2</td><td align="left">Requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.3</td><td align="left">Threads</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.3.1</td><td align="left">Class <code class="code">thread</code></td><td align="left">Partial</td><td align="left"><code class="code">thread::id</code> is not trivially copyable</td></tr><tr><td align="left">30.3.2</td><td align="left">Namespace <code class="code">this_thread</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4</td><td align="left">Mutual exclusion</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.1</td><td align="left">Mutex requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.1.1</td><td align="left">Class <code class="code">mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.1.2</td><td align="left">Class <code class="code">recursive_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.2</td><td align="left">Timed mutex requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.2.1</td><td align="left">Class <code class="code">timed_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.2.2</td><td align="left">Class <code class="code">recursive_timed_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.3</td><td align="left">Locks</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.3.1</td><td align="left">Class template <code class="code">lock_guard</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.3.2</td><td align="left">Class template <code class="code">unique_lock</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.4</td><td align="left">Generic locking algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.5</td><td align="left">Call once</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.5.1</td><td align="left"><code class="code">once_flag</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">30.4.5.2</td><td align="left"><code class="code">call_once</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.5</td><td align="left">Condition variables</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.5.1</td><td align="left">Class <code class="code">condition_variable</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.5.2</td><td align="left">Class <code class="code">condition_variable_any</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.6</td><td align="left">Futures</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.6.1</td><td align="left">Overview</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.6.2</td><td align="left">Error handling</td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">30.6.3</td><td align="left">Class <code class="code">future_error</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.6.4</td><td align="left">Associated asynchronous state</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.6.5</td><td align="left">Class template <code class="code">promise</code></td><td align="left">Partial</td><td align="left">Missing <code class="code">allocator_arg_t</code></td></tr><tr><td align="left">30.6.6</td><td align="left">Class template <code class="code">future</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.6.7</td><td align="left">Class template <code class="code">shared_future</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">30.6.8</td><td align="left">Class template <code class="code">atomic_future</code></td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">30.6.9</td><td align="left">Function template <code class="code">async</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.6.10</td><td align="left">Class template <code class="code">packaged_task</code></td><td align="left">Partial</td><td align="left">Missing <code class="code">allocator_arg_t</code></td></tr><tr><td align="left">
+ </td></tr><tr><td align="left">30.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.2</td><td align="left">Requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.3</td><td align="left">Threads</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.3.1</td><td align="left">Class <code class="code">thread</code></td><td align="left">Partial</td><td align="left"><code class="code">thread::id</code> is not trivially copyable</td></tr><tr><td align="left">30.3.2</td><td align="left">Namespace <code class="code">this_thread</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4</td><td align="left">Mutual exclusion</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.1</td><td align="left">Mutex requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.1.1</td><td align="left">Class <code class="code">mutex</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">30.4.1.2</td><td align="left">Class <code class="code">recursive_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.2</td><td align="left">Timed mutex requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.2.1</td><td align="left">Class <code class="code">timed_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.2.2</td><td align="left">Class <code class="code">recursive_timed_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.3</td><td align="left">Locks</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.3.1</td><td align="left">Class template <code class="code">lock_guard</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.3.2</td><td align="left">Class template <code class="code">unique_lock</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.4</td><td align="left">Generic locking algorithms</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.5</td><td align="left">Call once</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.4.5.1</td><td align="left"><code class="code">once_flag</code></td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">30.4.5.2</td><td align="left"><code class="code">call_once</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.5</td><td align="left">Condition variables</td><td align="left">Partial</td><td align="left">Missing notify_all_at_thread_exit</td></tr><tr><td align="left">30.5.1</td><td align="left">Class <code class="code">condition_variable</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.5.2</td><td align="left">Class <code class="code">condition_variable_any</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.6</td><td align="left">Futures</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.6.1</td><td align="left">Overview</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">30.6.2</td><td align="left">Error handling</td><td align="left">Y</td><td align="left">Missing constexpr</td></tr><tr><td align="left">30.6.3</td><td align="left">Class <code class="code">future_error</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.6.4</td><td align="left">Associated asynchronous state</td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.6.5</td><td align="left">Class template <code class="code">promise</code></td><td align="left">Partial</td><td align="left">Missing <code class="code">allocator_arg_t</code> and set_*_at_thread_exit</td></tr><tr bgcolor="#B0B0B0"><td align="left">30.6.6</td><td align="left">Class template <code class="code">future</code></td><td align="left">Partial</td><td align="left">Missing future_status</td></tr><tr bgcolor="#B0B0B0"><td align="left">30.6.7</td><td align="left">Class template <code class="code">shared_future</code></td><td align="left">Partial</td><td align="left">Missing future_status</td></tr><tr bgcolor="#C8B0B0"><td align="left">30.6.8</td><td align="left">Class template <code class="code">atomic_future</code></td><td align="left">N</td><td align="left"> </td></tr><tr><td align="left">30.6.9</td><td align="left">Function template <code class="code">async</code></td><td align="left">Y</td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.6.10</td><td align="left">Class template <code class="code">packaged_task</code></td><td align="left">Partial</td><td align="left">Missing <code class="code">allocator_arg_t</code> and make_ready_at_thread_exit</td></tr><tr><td align="left">
<span class="emphasis"><em>Appendix D</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Compatibility features</em></span>
@@ -229,7 +229,7 @@ In this implementation the header names are prefixed by
</p><p>
This page describes the TR1 support in mainline GCC SVN, not in any particular
release.
-</p><div class="table"><a id="id563255"></a><p class="title"><b>Table 1.3. C++ TR1 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>2</em></span></td><td colspan="3" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">2.1</td><td align="left">Reference wrappers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.1</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2</td><td align="left">Smart pointers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.1</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.2</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.3</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left"> </td><td align="left">
+</p><div class="table"><a id="id449588"></a><p class="title"><b>Table 1.3. C++ TR1 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>2</em></span></td><td colspan="3" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">2.1</td><td align="left">Reference wrappers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.1</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.1.2.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2</td><td align="left">Smart pointers</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.1</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.2</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">2.2.3</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left"> </td><td align="left">
<p>
Uses code from
<a class="ulink" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">boost::shared_ptr</a>.
@@ -242,7 +242,7 @@ decimal floating-point arithmetic
</p><p>
This page describes the TR 24733 support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id621410"></a><p class="title"><b>Table 1.4. C++ TR 24733 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
+</p><div class="table"><a id="id471043"></a><p class="title"><b>Table 1.4. C++ TR 24733 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
<span class="emphasis"><em>0</em></span>
</td><td colspan="3" align="left">
<span class="emphasis"><em>Introduction</em></span>
diff --git a/libstdc++-v3/doc/html/manual/strings.html b/libstdc++-v3/doc/html/manual/strings.html
index 3c3e7f6044d..79ee89bf305 100644
--- a/libstdc++-v3/doc/html/manual/strings.html
+++ b/libstdc++-v3/doc/html/manual/strings.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 7.  Strings"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings"></a>Chapter 7. 
Strings
- <a id="id624894" class="indexterm"></a>
+ <a id="id471606" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="sect2"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect2"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="sect2"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="sect2"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="sect2"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="sect2"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></div><div class="sect1" title="String Classes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.strings.string"></a>String Classes</h2></div></div></div><div class="sect2" title="Simple Transformations"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.simple"></a>Simple Transformations</h3></div></div></div><p>
Here are Standard, simple, and portable ways to perform common
transformations on a <code class="code">string</code> instance, such as
diff --git a/libstdc++-v3/doc/html/manual/support.html b/libstdc++-v3/doc/html/manual/support.html
index 5a7897bd8c0..f514c97aade 100644
--- a/libstdc++-v3/doc/html/manual/support.html
+++ b/libstdc++-v3/doc/html/manual/support.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 4.  Support"><div class="titlepage"><div><div><h2 class="title"><a id="std.support"></a>Chapter 4. 
Support
- <a id="id593549" class="indexterm"></a>
+ <a id="id402698" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="sect2"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect2"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="sect2"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="sect1"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="sect1"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="sect2"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect2"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></div><p>
This part deals with the functions called and objects created
automatically during the course of a program's existence.
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 920a2f16126..d4379d3449f 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -493,7 +493,7 @@ only default variables.
reporting functions including:
</p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p>time_counter</p></li><li class="listitem"><p>resource_counter</p></li><li class="listitem"><p>report_performance</p></li></ul></div></li></ul></div></div></div><div class="sect2" title="Special Topics"><div class="titlepage"><div><div><h3 class="title"><a id="test.special"></a>Special Topics</h3></div></div></div><div class="sect3" title="Qualifying Exception Safety Guarantees"><div class="titlepage"><div><div><h4 class="title"><a id="test.exception.safety"></a>
Qualifying Exception Safety Guarantees
- <a id="id638697" class="indexterm"></a>
+ <a id="id503957" class="indexterm"></a>
</h4></div></div></div><div class="sect4" title="Overview"><div class="titlepage"><div><div><h5 class="title"><a id="test.exception.safety.overview"></a>Overview</h5></div></div></div><p>
Testing is composed of running a particular test sequence,
and looking at what happens to the surrounding code when
diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
index 2d438bcc9ad..ae98c9b881d 100644
--- a/libstdc++-v3/doc/html/manual/using.html
+++ b/libstdc++-v3/doc/html/manual/using.html
@@ -11,5 +11,5 @@
enumerated and detailed in the table below.
</p><p>
By default, <span class="command"><strong>g++</strong></span> is equivalent to <span class="command"><strong>g++ -std=gnu++98</strong></span>. The standard library also defaults to this dialect.
- </p><div class="table"><a id="id536642"></a><p class="title"><b>Table 3.1. C++ Command Options</b></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Option Flags</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="literal">-std=c++98</code></td><td align="left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td align="left"><code class="literal">-std=gnu++98</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-std=c++0x</code></td><td align="left">Use the working draft of the upcoming ISO C++0x standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++0x</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-fexceptions</code></td><td align="left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td align="left"><code class="literal">-frtti</code></td><td align="left">As above, but RTTI-free dialect.</td></tr><tr><td align="left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td align="left">For ISO C++0x &lt;thread&gt;, &lt;future&gt;,
+ </p><div class="table"><a id="id444212"></a><p class="title"><b>Table 3.1. C++ Command Options</b></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Option Flags</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="literal">-std=c++98</code></td><td align="left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td align="left"><code class="literal">-std=gnu++98</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-std=c++0x</code></td><td align="left">Use the working draft of the upcoming ISO C++0x standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++0x</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-fexceptions</code></td><td align="left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td align="left"><code class="literal">-frtti</code></td><td align="left">As above, but RTTI-free dialect.</td></tr><tr><td align="left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td align="left">For ISO C++0x &lt;thread&gt;, &lt;future&gt;,
&lt;mutex&gt;, or &lt;condition_variable&gt;.</td></tr><tr><td align="left"><code class="literal">-fopenmp</code></td><td align="left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html
index 1a6be8fcdc4..925d732cffd 100644
--- a/libstdc++-v3/doc/html/manual/using_exceptions.html
+++ b/libstdc++-v3/doc/html/manual/using_exceptions.html
@@ -266,7 +266,7 @@ is called.
}
catch(...)
{ this-&gt;_M_setstate(ios_base::badbit); }
-</pre></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id557334"></a><p><span class="biblioid">
+</pre></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id417334"></a><p><span class="biblioid">
<a class="ulink" href="http://www.opengroup.org/austin" target="_top">
<em class="citetitle">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
@@ -277,7 +277,7 @@ is called.
. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id564741"></a><p><span class="biblioid">
+ . </span></p></div><div class="biblioentry"><a id="id444298"></a><p><span class="biblioid">
<a class="ulink" href="http://www.boost.org/community/error_handling.html" target="_top">
<em class="citetitle">
Error and Exception Handling
@@ -285,7 +285,7 @@ is called.
</a>
. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams </span>. </span><span class="publisher"><span class="publishername">
Boost
- . </span></span></p></div><div class="biblioentry"><a id="id549572"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id390281"></a><p><span class="biblioid">
<a class="ulink" href="http://www.boost.org/community/exception_safety.html" target="_top">
<em class="citetitle">
Exception-Safety in Generic Components
@@ -293,7 +293,7 @@ is called.
</a>
. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams</span>. </span><span class="publisher"><span class="publishername">
Boost
- . </span></span></p></div><div class="biblioentry"><a id="id534395"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id404291"></a><p><span class="biblioid">
<a class="ulink" href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf" target="_top">
<em class="citetitle">
Standard Library Exception Policy
@@ -301,7 +301,7 @@ is called.
</a>
. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
WG21 N1077
- . </span></span></p></div><div class="biblioentry"><a id="id621209"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id443907"></a><p><span class="biblioid">
<a class="ulink" href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html" target="_top">
<em class="citetitle">
ia64 c++ abi exception handling
@@ -309,17 +309,17 @@ is called.
</a>
. </span><span class="author"><span class="firstname">Richard</span> <span class="surname">Henderson</span>. </span><span class="publisher"><span class="publishername">
GNU
- . </span></span></p></div><div class="biblioentry"><a id="id555169"></a><p><span class="biblioid">
+ . </span></span></p></div><div class="biblioentry"><a id="id444623"></a><p><span class="biblioid">
<a class="ulink" href="http://www.research.att.com/~bs/3rd_safe.pdf" target="_top">
<em class="citetitle">
Appendix E: Standard-Library Exception Safety
</em>
</a>
- . </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry" title="Exceptional C++"><a id="id540372"></a><p><span class="title"><i>
+ . </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry" title="Exceptional C++"><a id="id444488"></a><p><span class="title"><i>
Exceptional C++
</i>. </span><span class="pagenums">
Exception-Safety Issues and Techniques
- . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="id546269"></a><p><span class="biblioid">
+ . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="id403652"></a><p><span class="biblioid">
<a class="ulink" href="http://gcc.gnu.org/PR25191" target="_top">
<em class="citetitle">
GCC Bug 25191: exception_defines.h #defines try/catch
diff --git a/libstdc++-v3/doc/html/manual/using_headers.html b/libstdc++-v3/doc/html/manual/using_headers.html
index 8aba28b50c2..99fe52334fc 100644
--- a/libstdc++-v3/doc/html/manual/using_headers.html
+++ b/libstdc++-v3/doc/html/manual/using_headers.html
@@ -20,19 +20,19 @@
upcoming 200x standard.
</p><p>
C++98/03 include files. These are available in the default compilation mode, i.e. <code class="code">-std=c++98</code> or <code class="code">-std=gnu++98</code>.
- </p><div class="table"><a id="id616437"></a><p class="title"><b>Table 3.2. C++ 1998 Library Headers</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">iosfwd</code></td></tr><tr><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td></tr><tr><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id530054"></a><p class="title"><b>Table 3.3. C++ 1998 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">ciso646</code></td></tr><tr><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td></tr><tr><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstring</code></td></tr><tr><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cwchar</code></td><td align="left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id470920"></a><p class="title"><b>Table 3.2. C++ 1998 Library Headers</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">iosfwd</code></td></tr><tr><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td></tr><tr><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id349475"></a><p class="title"><b>Table 3.3. C++ 1998 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">ciso646</code></td></tr><tr><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td></tr><tr><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstring</code></td></tr><tr><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cwchar</code></td><td align="left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
C++0x include files. These are only available in C++0x compilation
mode, i.e. <code class="literal">-std=c++0x</code> or <code class="literal">-std=gnu++0x</code>.
-</p><p></p><div class="table"><a id="id575199"></a><p class="title"><b>Table 3.4. C++ 200x Library Headers</b></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">array</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">chrono</code></td><td align="left"><code class="filename">complex</code></td></tr><tr><td align="left"><code class="filename">condition_variable</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">forward_list</code></td><td align="left"><code class="filename">fstream</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">future</code></td><td align="left"><code class="filename">initalizer_list</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td></tr><tr><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td></tr><tr><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">mutex</code></td></tr><tr><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">random</code></td></tr><tr><td align="left"><code class="filename">ratio</code></td><td align="left"><code class="filename">regex</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">system_error</code></td><td align="left"><code class="filename">thread</code></td></tr><tr><td align="left"><code class="filename">tuple</code></td><td align="left"><code class="filename">type_traits</code></td><td align="left"><code class="filename">typeinfo</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id549895"></a><p class="title"><b>Table 3.5. C++ 200x Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">ccomplex</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cfenv</code></td></tr><tr><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cinttypes</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td></tr><tr><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstdbool</code></td></tr><tr><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdint</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cstring</code></td></tr><tr><td align="left"><code class="filename">ctgmath</code></td><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cuchar</code></td><td align="left"><code class="filename">cwchar</code></td><td align="left"><code class="filename">cwctype</code></td></tr><tr><td align="left"><code class="filename">stdatomic.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><p></p><div class="table"><a id="id477183"></a><p class="title"><b>Table 3.4. C++ 200x Library Headers</b></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">array</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">chrono</code></td><td align="left"><code class="filename">complex</code></td></tr><tr><td align="left"><code class="filename">condition_variable</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">forward_list</code></td><td align="left"><code class="filename">fstream</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">future</code></td><td align="left"><code class="filename">initalizer_list</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">ios</code></td></tr><tr><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">limits</code></td></tr><tr><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">mutex</code></td></tr><tr><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">random</code></td></tr><tr><td align="left"><code class="filename">ratio</code></td><td align="left"><code class="filename">regex</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">stack</code></td></tr><tr><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">system_error</code></td><td align="left"><code class="filename">thread</code></td></tr><tr><td align="left"><code class="filename">tuple</code></td><td align="left"><code class="filename">type_traits</code></td><td align="left"><code class="filename">typeinfo</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="filename">utility</code></td><td align="left"><code class="filename">valarray</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id463447"></a><p class="title"><b>Table 3.5. C++ 200x Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">ccomplex</code></td><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">cfenv</code></td></tr><tr><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cinttypes</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">clocale</code></td></tr><tr><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstdbool</code></td></tr><tr><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">cstdint</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cstring</code></td></tr><tr><td align="left"><code class="filename">ctgmath</code></td><td align="left"><code class="filename">ctime</code></td><td align="left"><code class="filename">cuchar</code></td><td align="left"><code class="filename">cwchar</code></td><td align="left"><code class="filename">cwctype</code></td></tr><tr><td align="left"><code class="filename">stdatomic.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
In addition, TR1 includes as:
-</p><div class="table"><a id="id561380"></a><p class="title"><b>Table 3.6. C++ TR 1 Library Headers</b></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/array</code></td><td align="left"><code class="filename">tr1/complex</code></td><td align="left"><code class="filename">tr1/memory</code></td><td align="left"><code class="filename">tr1/functional</code></td><td align="left"><code class="filename">tr1/random</code></td></tr><tr><td align="left"><code class="filename">tr1/regex</code></td><td align="left"><code class="filename">tr1/tuple</code></td><td align="left"><code class="filename">tr1/type_traits</code></td><td align="left"><code class="filename">tr1/unordered_map</code></td><td align="left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td align="left"><code class="filename">tr1/utility</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id605097"></a><p class="title"><b>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/ccomplex</code></td><td align="left"><code class="filename">tr1/cfenv</code></td><td align="left"><code class="filename">tr1/cfloat</code></td><td align="left"><code class="filename">tr1/cmath</code></td><td align="left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td align="left"><code class="filename">tr1/climits</code></td><td align="left"><code class="filename">tr1/cstdarg</code></td><td align="left"><code class="filename">tr1/cstdbool</code></td><td align="left"><code class="filename">tr1/cstdint</code></td><td align="left"><code class="filename">tr1/cstdio</code></td></tr><tr><td align="left"><code class="filename">tr1/cstdlib</code></td><td align="left"><code class="filename">tr1/ctgmath</code></td><td align="left"><code class="filename">tr1/ctime</code></td><td align="left"><code class="filename">tr1/cwchar</code></td><td align="left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break" /><p>Decimal floating-point arithmetic is available if the C++
+</p><div class="table"><a id="id387306"></a><p class="title"><b>Table 3.6. C++ TR 1 Library Headers</b></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/array</code></td><td align="left"><code class="filename">tr1/complex</code></td><td align="left"><code class="filename">tr1/memory</code></td><td align="left"><code class="filename">tr1/functional</code></td><td align="left"><code class="filename">tr1/random</code></td></tr><tr><td align="left"><code class="filename">tr1/regex</code></td><td align="left"><code class="filename">tr1/tuple</code></td><td align="left"><code class="filename">tr1/type_traits</code></td><td align="left"><code class="filename">tr1/unordered_map</code></td><td align="left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td align="left"><code class="filename">tr1/utility</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id479735"></a><p class="title"><b>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/ccomplex</code></td><td align="left"><code class="filename">tr1/cfenv</code></td><td align="left"><code class="filename">tr1/cfloat</code></td><td align="left"><code class="filename">tr1/cmath</code></td><td align="left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td align="left"><code class="filename">tr1/climits</code></td><td align="left"><code class="filename">tr1/cstdarg</code></td><td align="left"><code class="filename">tr1/cstdbool</code></td><td align="left"><code class="filename">tr1/cstdint</code></td><td align="left"><code class="filename">tr1/cstdio</code></td></tr><tr><td align="left"><code class="filename">tr1/cstdlib</code></td><td align="left"><code class="filename">tr1/ctgmath</code></td><td align="left"><code class="filename">tr1/ctime</code></td><td align="left"><code class="filename">tr1/cwchar</code></td><td align="left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break" /><p>Decimal floating-point arithmetic is available if the C++
compiler supports scalar decimal floating-point types defined via
<code class="code">__attribute__((mode(SD|DD|LD)))</code>.
-</p><div class="table"><a id="id543860"></a><p class="title"><b>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</b></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">decimal/decimal</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id400127"></a><p class="title"><b>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</b></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">decimal/decimal</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
Also included are files for the C++ ABI interface:
-</p><div class="table"><a id="id599870"></a><p class="title"><b>Table 3.9. C++ ABI Headers</b></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cxxabi.h</code></td><td align="left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id401869"></a><p class="title"><b>Table 3.9. C++ ABI Headers</b></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cxxabi.h</code></td><td align="left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
And a large variety of extensions.
-</p><div class="table"><a id="id576171"></a><p class="title"><b>Table 3.10. Extension Headers</b></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">ext/algorithm</code></td><td align="left"><code class="filename">ext/atomicity.h</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"><code class="filename">ext/cast.h</code></td></tr><tr><td align="left"><code class="filename">ext/codecvt_specializations.h</code></td><td align="left"><code class="filename">ext/concurrence.h</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="filename">ext/enc_filebuf.h</code></td><td align="left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/functional</code></td><td align="left"><code class="filename">ext/iterator</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="filename">ext/memory</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="filename">ext/numeric</code></td><td align="left"><code class="filename">ext/numeric_traits.h</code></td><td align="left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td align="left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td align="left"><code class="filename">ext/pod_char_traits.h</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="filename">ext/rb_tree</code></td><td align="left"><code class="filename">ext/rope</code></td><td align="left"><code class="filename">ext/slist</code></td></tr><tr><td align="left"><code class="filename">ext/stdio_filebuf.h</code></td><td align="left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left"><code class="filename">ext/typelist.h</code></td><td align="left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td align="left"><code class="filename">ext/vstring.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id563137"></a><p class="title"><b>Table 3.11. Extension Debug Headers</b></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">debug/bitset</code></td><td align="left"><code class="filename">debug/deque</code></td><td align="left"><code class="filename">debug/list</code></td><td align="left"><code class="filename">debug/map</code></td><td align="left"><code class="filename">debug/set</code></td></tr><tr><td align="left"><code class="filename">debug/string</code></td><td align="left"><code class="filename">debug/unordered_map</code></td><td align="left"><code class="filename">debug/unordered_set</code></td><td align="left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id553282"></a><p class="title"><b>Table 3.12. Extension Profile Headers</b></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">profile/bitset</code></td><td align="left"><code class="filename">profile/deque</code></td><td align="left"><code class="filename">profile/list</code></td><td align="left"><code class="filename">profile/map</code></td></tr><tr><td align="left"><code class="filename">profile/set</code></td><td align="left"><code class="filename">profile/unordered_map</code></td><td align="left"><code class="filename">profile/unordered_set</code></td><td align="left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id550322"></a><p class="title"><b>Table 3.13. Extension Parallel Headers</b></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">parallel/algorithm</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" title="Mixing Headers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"></a>Mixing Headers</h3></div></div></div><p> A few simple rules.
+</p><div class="table"><a id="id467180"></a><p class="title"><b>Table 3.10. Extension Headers</b></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">ext/algorithm</code></td><td align="left"><code class="filename">ext/atomicity.h</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"><code class="filename">ext/cast.h</code></td></tr><tr><td align="left"><code class="filename">ext/codecvt_specializations.h</code></td><td align="left"><code class="filename">ext/concurrence.h</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="filename">ext/enc_filebuf.h</code></td><td align="left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/functional</code></td><td align="left"><code class="filename">ext/iterator</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="filename">ext/memory</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="filename">ext/numeric</code></td><td align="left"><code class="filename">ext/numeric_traits.h</code></td><td align="left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td align="left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td align="left"><code class="filename">ext/pod_char_traits.h</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="filename">ext/rb_tree</code></td><td align="left"><code class="filename">ext/rope</code></td><td align="left"><code class="filename">ext/slist</code></td></tr><tr><td align="left"><code class="filename">ext/stdio_filebuf.h</code></td><td align="left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left"><code class="filename">ext/typelist.h</code></td><td align="left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td align="left"><code class="filename">ext/vstring.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id403996"></a><p class="title"><b>Table 3.11. Extension Debug Headers</b></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">debug/bitset</code></td><td align="left"><code class="filename">debug/deque</code></td><td align="left"><code class="filename">debug/list</code></td><td align="left"><code class="filename">debug/map</code></td><td align="left"><code class="filename">debug/set</code></td></tr><tr><td align="left"><code class="filename">debug/string</code></td><td align="left"><code class="filename">debug/unordered_map</code></td><td align="left"><code class="filename">debug/unordered_set</code></td><td align="left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id403404"></a><p class="title"><b>Table 3.12. Extension Profile Headers</b></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">profile/bitset</code></td><td align="left"><code class="filename">profile/deque</code></td><td align="left"><code class="filename">profile/list</code></td><td align="left"><code class="filename">profile/map</code></td></tr><tr><td align="left"><code class="filename">profile/set</code></td><td align="left"><code class="filename">profile/unordered_map</code></td><td align="left"><code class="filename">profile/unordered_set</code></td><td align="left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id477245"></a><p class="title"><b>Table 3.13. Extension Parallel Headers</b></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">parallel/algorithm</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" title="Mixing Headers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"></a>Mixing Headers</h3></div></div></div><p> A few simple rules.
</p><p>First, mixing different dialects of the standard headers is not
possible. It's an all-or-nothing affair. Thus, code like
</p><pre class="programlisting">
diff --git a/libstdc++-v3/doc/html/manual/utilities.html b/libstdc++-v3/doc/html/manual/utilities.html
index 86537fbfd19..ecc1498d80c 100644
--- a/libstdc++-v3/doc/html/manual/utilities.html
+++ b/libstdc++-v3/doc/html/manual/utilities.html
@@ -7,7 +7,7 @@
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 6.  Utilities"><div class="titlepage"><div><div><h2 class="title"><a id="std.util"></a>Chapter 6. 
Utilities
- <a id="id533234" class="indexterm"></a>
+ <a id="id410153" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section" title="Functors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.util.functors"></a>Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
diff --git a/libstdc++-v3/doc/xml/api.xml b/libstdc++-v3/doc/xml/api.xml
index 3073ed8ba6f..4518f23d3db 100644
--- a/libstdc++-v3/doc/xml/api.xml
+++ b/libstdc++-v3/doc/xml/api.xml
@@ -1,15 +1,10 @@
-<?xml version='1.0'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
+<book xmlns="http://docbook.org/ns/docbook" version="5.0">
-<book>
-
-<article id="api" xreflabel="API">
+<article xml:id="api" xreflabel="API">
<?dbhtml filename="api.html"?>
-<articleinfo>
- <title>API Documentation</title>
+<info><title>API Documentation</title>
+
<copyright>
<year>
2008
@@ -18,8 +13,8 @@
2010
</year>
<holder>
- <ulink url="http://www.fsf.org/">FSF
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org/">FSF
+ </link>
</holder>
</copyright>
<legalnotice>
@@ -28,7 +23,7 @@
</link>
</para>
</legalnotice>
-</articleinfo>
+</info>
<para>
The GNU C++ library sources have been specially formatted so that
@@ -47,38 +42,38 @@
<itemizedlist>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.4/index.html">for the 3.4 release
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.4/index.html">for the 3.4 release
+ </link>
</para>
</listitem>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.1/index.html">for the 4.1 release
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.1/index.html">for the 4.1 release
+ </link>
</para>
</listitem>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/index.html">for the 4.2 release
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/index.html">for the 4.2 release
+ </link>
</para>
</listitem>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/index.html">for the 4.3 release
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/index.html">for the 4.3 release
+ </link>
</para>
</listitem>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/index.html">for the 4.4 release
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/index.html">for the 4.4 release
+ </link>
</para>
</listitem>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html">&quot;the latest collection&quot;
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html">"the latest collection"
+ </link>
(For the main development tree; see the date on the first page.)
</para>
</listitem>
@@ -89,7 +84,7 @@
gcc.org site in a directory located at
<literal>&lt;URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/&gt;</literal>.
You will almost certainly need to use one of the
- <ulink url="http://gcc.gnu.org/mirrors.html">mirror sites</ulink> to download
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/mirrors.html">mirror sites</link> to download
the tarball. After unpacking, simply load libstdc++-html-*/index.html
into a browser.
</para>
diff --git a/libstdc++-v3/doc/xml/authors.xml b/libstdc++-v3/doc/xml/authors.xml
index 5d7909f8b14..1f26f63fbc6 100644
--- a/libstdc++-v3/doc/xml/authors.xml
+++ b/libstdc++-v3/doc/xml/authors.xml
@@ -1,4 +1,4 @@
-<authorgroup>
+<authorgroup xmlns="http://docbook.org/ns/docbook" version="5.0">
<!--
<author>
@@ -20,176 +20,101 @@
</author>
-->
- <author>
- <firstname></firstname>
- <surname></surname>
-
- <authorblurb>
+ <author><personname><firstname/><surname/></personname><personblurb>
<para>
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Paolo</firstname>
- <surname>Carlini</surname>
-
- <authorblurb>
+ <author><personname><firstname>Paolo</firstname><surname>Carlini</surname></personname><personblurb>
<para>
TR1, LWG Active, Closed, Defects lists.
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Phil</firstname>
- <surname>Edwards</surname>
-
- <authorblurb>
+ <author><personname><firstname>Phil</firstname><surname>Edwards</surname></personname><personblurb>
<para>
Originating author, started HOWTO and FAQ, worked on sections
Demangling, Macros, Strings, Iterators, Backwards
Compatibility, SGI Extensions, Configure, Build, Install.
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Doug</firstname>
- <surname>Gregor</surname>
-
- <authorblurb>
+ <author><personname><firstname>Doug</firstname><surname>Gregor</surname></personname><personblurb>
<para>
Debug Mode, TR1 function objects
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Benjamin</firstname>
- <surname>Kosnik</surname>
-
- <authorblurb>
+ <author><personname><firstname>Benjamin</firstname><surname>Kosnik</surname></personname><personblurb>
<para>
Allocators, ABI, API evolution and deprecation history,
Backwards Compatibility, Thread, Debug Support, Locales,
Facets, Parallel Mode, Headers, Namespaces, Construction and
Structure, Using Exceptions, DocBook conversion and layout.
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Dhruv</firstname>
- <surname>Matani</surname>
-
- <authorblurb>
+ <author><personname><firstname>Dhruv</firstname><surname>Matani</surname></personname><personblurb>
<para>
bitmap_allocator
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Jason</firstname>
- <surname>Merrill</surname>
-
- <authorblurb>
+ <author><personname><firstname>Jason</firstname><surname>Merrill</surname></personname><personblurb>
<para>
License, __verbose_terminate_handler
</para>
- </authorblurb>
- </author>
-
- <author>
- <firstname>Mark</firstname>
- <surname>Mitchell</surname>
+ </personblurb></author>
- <authorblurb>
+ <author><personname><firstname>Mark</firstname><surname>Mitchell</surname></personname><personblurb>
<para>
Porting
</para>
- </authorblurb>
- </author>
-
- <author>
- <firstname>Nathan</firstname>
- <surname>Myers</surname>
+ </personblurb></author>
- <authorblurb>
+ <author><personname><firstname>Nathan</firstname><surname>Myers</surname></personname><personblurb>
<para>
Referenced counted string, C++1998 implementation status.
</para>
- </authorblurb>
- </author>
-
- <author>
- <firstname>Felix</firstname>
- <surname>Natter</surname>
+ </personblurb></author>
- <authorblurb>
+ <author><personname><firstname>Felix</firstname><surname>Natter</surname></personname><personblurb>
<para>
Namespace composition, Backwards Compatibility.
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Stefan</firstname>
- <surname>Olsson</surname>
-
- <authorblurb>
+ <author><personname><firstname>Stefan</firstname><surname>Olsson</surname></personname><personblurb>
<para>
mt_allocator
</para>
- </authorblurb>
- </author>
-
- <author>
- <firstname>Silvius</firstname>
- <surname>Rus</surname>
+ </personblurb></author>
- <authorblurb>
+ <author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname><personblurb>
<para>
Profile mode
</para>
- </authorblurb>
- </author>
-
- <author>
- <firstname>Johannes</firstname>
- <surname>Singler</surname>
+ </personblurb></author>
- <authorblurb>
+ <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb>
<para>
Parallel mode
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Ami</firstname>
- <surname>Tavory</surname>
-
- <authorblurb>
+ <author><personname><firstname>Ami</firstname><surname>Tavory</surname></personname><personblurb>
<para>
Policy Based Data Structures, Associative Containers, Unordered
Containers.
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
- <author>
- <firstname>Jonathan</firstname>
- <surname>Wakely</surname>
-
- <authorblurb>
+ <author><personname><firstname>Jonathan</firstname><surname>Wakely</surname></personname><personblurb>
<para>
shared_ptr, markup editing and styling
</para>
- </authorblurb>
- </author>
+ </personblurb></author>
</authorgroup>
diff --git a/libstdc++-v3/doc/xml/book.txml b/libstdc++-v3/doc/xml/book.txml
index a77690d0d32..55b050271a5 100644
--- a/libstdc++-v3/doc/xml/book.txml
+++ b/libstdc++-v3/doc/xml/book.txml
@@ -1,32 +1,29 @@
-<?xml version='1.0'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
+<!-- Converted by db4-upgrade version 1.0 -->
+
+<book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="api" xreflabel="Source Level Documentation">
-<book id="api" xreflabel="Source Level Documentation">
-<title>Source Level Documentation</title>
-<bookinfo>
+<info>
<copyright>
<year>2007</year>
<holder>
- <ulink url="www.fsf.org">FSF
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="www.fsf.org">FSF
+ </link>
</holder>
</copyright>
<legalnotice>
<para>
- <ulink url="17_intro/license.html">License
- </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="17_intro/license.html">License
+ </link>
</para>
</legalnotice>
-</bookinfo>
+</info>
+
+<part><info><title/></info>
-<part>
-<title></title>
- <chapter>
- <title></title>
- <para></para>
+ <chapter><info><title/></info>
+
+ <para/>
</chapter>
</part>
diff --git a/libstdc++-v3/doc/xml/chapter.txml b/libstdc++-v3/doc/xml/chapter.txml
index 9cf5b74e855..85323e73baa 100644
--- a/libstdc++-v3/doc/xml/chapter.txml
+++ b/libstdc++-v3/doc/xml/chapter.txml
@@ -1,11 +1,8 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
+<!-- Converted by db4-upgrade version 1.0 -->
-<chapter id="manual.intro" xreflabel="Introduction">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="manual.intro" xreflabel="Introduction">
-<chapterinfo>
+<info><title>Introduction</title>
<keywordset>
<keyword>
ISO C++
@@ -14,41 +11,41 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
-<title>Introduction</title>
-<sect1 id="manual.intro.status" xreflabel="Status">
- <title>Status</title>
+
+<section xml:id="manual.intro.status" xreflabel="Status"><info><title>Status</title></info>
+
<para>
The GNU C++ ...
</para>
-</sect1>
+</section>
-<sect1 id="manual.intro.setup" xreflabel="Setup">
- <title>Setup</title>
+<section xml:id="manual.intro.setup" xreflabel="Setup"><info><title>Setup</title></info>
+
<para>
The GNU C++ ...
</para>
- <sect2 id="manual.intro.setup.next1" xreflabel="Next1">
- <title>Next1</title>
+ <section xml:id="manual.intro.setup.next1" xreflabel="Next1"><info><title>Next1</title></info>
+
<para>
The GNU C++ ...
</para>
- </sect2>
- <sect2 id="manual.intro.setup.next2" xreflabel="Next2">
- <title>Next2</title>
+ </section>
+ <section xml:id="manual.intro.setup.next2" xreflabel="Next2"><info><title>Next2</title></info>
+
<para>
The GNU C++ ...
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
-<sect1 id="manual.intro.using" xreflabel="Using">
- <title>Using</title>
+<section xml:id="manual.intro.using" xreflabel="Using"><info><title>Using</title></info>
+
<para>
The GNU C++ ...
</para>
-</sect1>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/class.txml b/libstdc++-v3/doc/xml/class.txml
index 83497db3720..26c9acf97f1 100644
--- a/libstdc++-v3/doc/xml/class.txml
+++ b/libstdc++-v3/doc/xml/class.txml
@@ -1,7 +1,9 @@
-<sect1 id="manual.util.memory.allocator" xreflabel="allocator">
+<!-- Converted by db4-upgrade version 1.0 -->
+
+<section xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="manual.util.memory.allocator" xreflabel="allocator">
<?dbhtml filename="allocator.html"?>
-<sect1info>
+<info><title>allocator</title>
<keywordset>
<keyword>
ISO C++
@@ -10,15 +12,15 @@
allocator
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>allocator</title>
<para>
</para>
-<sect2 id="allocator.req" xreflabel="allocator.req">
-<title>Requirements</title>
+<section xml:id="allocator.req" xreflabel="allocator.req"><info><title>Requirements</title></info>
+
<para>
</para>
@@ -35,33 +37,33 @@
<para>
</para>
-</sect2>
+</section>
+
+<section xml:id="allocator.design_issues" xreflabel="allocator.design_issues"><info><title>Design Issues</title></info>
-<sect2 id="allocator.design_issues" xreflabel="allocator.design_issues">
-<title>Design Issues</title>
<para>
</para>
<para>
</para>
-</sect2>
+</section>
+
+<section xml:id="allocator.impl" xreflabel="allocator.impl"><info><title>Implementation</title></info>
-<sect2 id="allocator.impl" xreflabel="allocator.impl">
-<title>Implementation</title>
- <sect3>
- <title>Interface Design</title>
+ <section><info><title>Interface Design</title></info>
+
<para>
</para>
<para>
</para>
- </sect3>
+ </section>
- <sect3>
- <title>Selecting Default Allocation Strategy</title>
+ <section><info><title>Selecting Default Allocation Strategy</title></info>
+
<para>
</para>
@@ -76,38 +78,38 @@
<listitem>
</listitem>
</orderedlist>
- </sect3>
+ </section>
- <sect3>
- <title>Disabling Memory Caching</title>
+ <section><info><title>Disabling Memory Caching</title></info>
+
<para>
</para>
<para>
</para>
- </sect3>
-</sect2>
+ </section>
+</section>
+
+<section xml:id="allocator.using" xreflabel="allocator.using"><info><title>Using</title></info>
-<sect2 id="allocator.using" xreflabel="allocator.using">
-<title>Using</title>
<para>
</para>
-</sect2>
+</section>
+
+<section xml:id="allocator.custom" xreflabel="allocator.custom"><info><title>Custom Allocators</title></info>
-<sect2 id="allocator.custom" xreflabel="allocator.custom">
-<title>Custom Allocators</title>
<para>
</para>
<para>
</para>
-</sect2>
+</section>
+
+<bibliography xml:id="allocator.biblio" xreflabel="allocator.biblio"><info><title>Bibliography</title></info>
-<bibliography id="allocator.biblio" xreflabel="allocator.biblio">
-<title>Bibliography</title>
<!--
<biblioentry>
@@ -116,11 +118,11 @@
<biblioid class="uri">
<ulink url="http://about:blank">
- <citetitle>
- The Title
- </citetitle>
</ulink>
</biblioid>
+ <citetitle>
+ The Title
+ </citetitle>
<editor>
<firstname></firstname>
@@ -151,4 +153,4 @@
</bibliography>
-</sect1> \ No newline at end of file
+</section>
diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml
index 5ed2777337c..f8e6312386a 100644
--- a/libstdc++-v3/doc/xml/faq.xml
+++ b/libstdc++-v3/doc/xml/faq.xml
@@ -1,39 +1,34 @@
-<?xml version='1.0'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
+<book xmlns="http://docbook.org/ns/docbook" version="5.0">
-<book>
-
-<article id="faq" xreflabel="Frequently Asked Questions">
+<article xml:id="faq" xreflabel="Frequently Asked Questions">
<?dbhtml filename="faq.html"?>
-<articleinfo>
- <title>Frequently Asked Questions</title>
+<info><title>Frequently Asked Questions</title>
+
<copyright>
<year>
- 2008
+ 2008, 2010
</year>
<holder>
- <ulink url="http://www.fsf.org">FSF</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">FSF</link>
</holder>
</copyright>
-</articleinfo>
+</info>
<!-- FAQ starts here -->
<qandaset>
<!-- General Information -->
-<qandadiv id="faq.info" xreflabel="General Information">
-<title>General Information</title>
+<qandadiv xml:id="faq.info" xreflabel="General Information">
+
-<qandaentry id="faq.what">
- <question id="faq.what.q">
+<qandaentry xml:id="faq.what">
+ <question xml:id="faq.what.q">
<para>
What is libstdc++?
</para>
</question>
- <answer id="faq.what.a">
+ <answer xml:id="faq.what.a">
<para>
The GNU Standard C++ Library v3 is an ongoing project to
implement the ISO 14882 Standard C++ library as described in
@@ -41,18 +36,18 @@
exactly how far the project has come, or just want the latest
bleeding-edge code, the up-to-date source is available over
anonymous SVN, and can even be browsed over
- the <ulink url="http://gcc.gnu.org/svn.html">web</ulink>.
+ the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/svn.html">web</link>.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.why">
- <question id="q-why">
+<qandaentry xml:id="faq.why">
+ <question xml:id="q-why">
<para>
Why should I use libstdc++?
</para>
</question>
- <answer id="a-why">
+ <answer xml:id="a-why">
<para>
The completion of the ISO C++ standardization gave the C++
community a powerful set of reuseable tools in the form of the C++
@@ -66,9 +61,9 @@
(<command>gcc</command>, <command>g++</command>, etc) is widely
considered to be one of the leading compilers in the world. Its
development is overseen by the
- <ulink url="http://gcc.gnu.org/">GCC team</ulink>. All of
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/">GCC team</link>. All of
the rapid development and near-legendary
- <ulink url="http://gcc.gnu.org/buildstat.html">portability</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/buildstat.html">portability</link>
that are the hallmarks of an open-source project are being
applied to libstdc++.
</para>
@@ -83,13 +78,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.who">
- <question id="q-who">
+<qandaentry xml:id="faq.who">
+ <question xml:id="q-who">
<para>
Who's in charge of it?
</para>
</question>
- <answer id="a-who">
+ <answer xml:id="a-who">
<para>
The libstdc++ project is contributed to by several developers
all over the world, in the same way as GCC or Linux.
@@ -101,19 +96,19 @@
Development and discussion is held on the libstdc++ mailing
list. Subscribing to the list, or searching the list
archives, is open to everyone. You can read instructions for
- doing so on the <ulink url="http://gcc.gnu.org/libstdc++/">homepage</ulink>.
+ doing so on the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/libstdc++/">homepage</link>.
If you have questions, ideas, code, or are just curious, sign up!
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.when">
- <question id="q-when">
+<qandaentry xml:id="faq.when">
+ <question xml:id="q-when">
<para>
When is libstdc++ going to be finished?
</para>
</question>
- <answer id="a-when">
+ <answer xml:id="a-when">
<para>
Nathan Myers gave the best of all possible answers, responding to
a Usenet article asking this question: <emphasis>Sooner, if you
@@ -122,13 +117,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.how">
- <question id="q-how">
+<qandaentry xml:id="faq.how">
+ <question xml:id="q-how">
<para>
How do I contribute to the effort?
</para>
</question>
- <answer id="a-how">
+ <answer xml:id="a-how">
<para>
Here is <link linkend="appendix.contrib">a page devoted to
this topic</link>. Subscribing to the mailing list (see above, or
@@ -142,13 +137,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.whereis_old">
- <question id="q-whereis_old">
+<qandaentry xml:id="faq.whereis_old">
+ <question xml:id="q-whereis_old">
<para>
What happened to the older libg++? I need that!
</para>
</question>
- <answer id="a-whereis_old">
+ <answer xml:id="a-whereis_old">
<para>
The most recent libg++ README states that libg++ is no longer
being actively maintained. It should not be used for new
@@ -160,13 +155,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.more_questions">
- <question id="q-more_questions">
+<qandaentry xml:id="faq.more_questions">
+ <question xml:id="q-more_questions">
<para>
What if I have more questions?
</para>
</question>
- <answer id="a-more_questions">
+ <answer xml:id="a-more_questions">
<para>
If you have read the README file, and your question remains
unanswered, then just ask the mailing list. At present, you do not
@@ -187,16 +182,16 @@
</qandadiv>
<!-- License -->
-<qandadiv id="faq.license" xreflabel="License QA">
-<title>License</title>
+<qandadiv xml:id="faq.license" xreflabel="License QA">
-<qandaentry id="faq.license.what">
- <question id="q-license.what">
+
+<qandaentry xml:id="faq.license.what">
+ <question xml:id="q-license.what">
<para>
What are the license terms for libstdc++?
</para>
</question>
- <answer id="a-license.what">
+ <answer xml:id="a-license.what">
<para>
See <link linkend="manual.intro.status.license">our license description</link>
for these and related questions.
@@ -204,13 +199,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.license.any_program">
- <question id="q-license.any_program">
+<qandaentry xml:id="faq.license.any_program">
+ <question xml:id="q-license.any_program">
<para>
So any program which uses libstdc++ falls under the GPL?
</para>
</question>
- <answer id="a-license.any_program">
+ <answer xml:id="a-license.any_program">
<para>
No. The special exception permits use of the library in
proprietary applications.
@@ -219,13 +214,13 @@
</qandaentry>
-<qandaentry id="faq.license.lgpl">
- <question id="q-license.lgpl">
+<qandaentry xml:id="faq.license.lgpl">
+ <question xml:id="q-license.lgpl">
<para>
How is that different from the GNU {Lesser,Library} GPL?
</para>
</question>
- <answer id="a-license.lgpl">
+ <answer xml:id="a-license.lgpl">
<para>
The LGPL requires that users be able to replace the LGPL code with a
modified version; this is trivial if the library in question is a C
@@ -238,13 +233,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.license.what_restrictions">
- <question id="q-license.what_restrictions">
+<qandaentry xml:id="faq.license.what_restrictions">
+ <question xml:id="q-license.what_restrictions">
<para>
I see. So, what restrictions are there on programs that use the library?
</para>
</question>
- <answer id="a-license.what_restrictions">
+ <answer xml:id="a-license.what_restrictions">
<para>
None. We encourage such programs to be released as open source,
but we won't punish you or sue you if you choose otherwise.
@@ -255,15 +250,15 @@
</qandadiv>
<!-- Installation -->
-<qandadiv id="faq.installation" xreflabel="Installation">
-<title>Installation</title>
+<qandadiv xml:id="faq.installation" xreflabel="Installation">
+
-<qandaentry id="faq.how_to_install">
- <question id="q-how_to_install">
+<qandaentry xml:id="faq.how_to_install">
+ <question xml:id="q-how_to_install">
<para>How do I install libstdc++?
</para>
</question>
- <answer id="a-how_to_install">
+ <answer xml:id="a-how_to_install">
<para>
Often libstdc++ comes pre-installed as an integral part of many
existing Linux and Unix systems, as well as many embedded
@@ -281,17 +276,17 @@
</answer>
</qandaentry>
-<qandaentry id="faq.how_to_get_sources">
- <question id="q-how_to_get_sources">
+<qandaentry xml:id="faq.how_to_get_sources">
+ <question xml:id="q-how_to_get_sources">
<para>How does one get current libstdc++ sources?
</para>
</question>
- <answer id="a-how_to_get_sources">
+ <answer xml:id="a-how_to_get_sources">
<para>
Libstdc++ sources for all official releases can be obtained as
part of the GCC sources, available from various sites and
- mirrors. A full <ulink url="http://gcc.gnu.org/mirrors.html">list of
- download sites</ulink> is provided on the main GCC site.
+ mirrors. A full <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/mirrors.html">list of
+ download sites</link> is provided on the main GCC site.
</para>
<para>
Current libstdc++ sources can always be checked out of the main
@@ -303,8 +298,8 @@
<application>Subversion</application>, or <acronym>SVN</acronym>, is
one of several revision control packages. It was selected for GNU
projects because it's free (speech), free (beer), and very high
- quality. The <ulink url="http://subversion.tigris.org"> Subversion
- home page</ulink> has a better description.
+ quality. The <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://subversion.tigris.org"> Subversion
+ home page</link> has a better description.
</para>
<para>
The <quote>anonymous client checkout</quote> feature of SVN is
@@ -313,24 +308,24 @@
</para>
<para>
For more information
- see <ulink url="http://gcc.gnu.org/svn.html"><acronym>SVN</acronym>
- details</ulink>.
+ see <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/svn.html"><acronym>SVN</acronym>
+ details</link>.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.how_to_test">
- <question id="q-how_to_test">
+<qandaentry xml:id="faq.how_to_test">
+ <question xml:id="q-how_to_test">
<para>How do I know if it works?
</para>
</question>
- <answer id="a-how_to_test">
+ <answer xml:id="a-how_to_test">
<para>
Libstdc++ comes with its own validation testsuite, which includes
conformance testing, regression testing, ABI testing, and
performance testing. Please consult the
- <ulink url="http://gcc.gnu.org/install/test.html">testing
- documentation</ulink> for more details.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/test.html">testing
+ documentation</link> for more details.
</para>
<para>
If you find bugs in the testsuite programs themselves, or if you
@@ -340,12 +335,12 @@
</answer>
</qandaentry>
-<qandaentry id="faq.how_to_set_paths">
- <question id="q-how_to_set_paths">
+<qandaentry xml:id="faq.how_to_set_paths">
+ <question xml:id="q-how_to_set_paths">
<para>How do I insure that the dynamically linked library will be found?
</para>
</question>
- <answer id="a-how_to_set_paths">
+ <answer xml:id="a-how_to_set_paths">
<para>
Depending on your platform and library version, the error message might
be similar to one of the following:
@@ -388,20 +383,19 @@
is usually called something such as <filename>ld.so/rtld/dld.so</filename>.
</para>
<para>
- Using LD_LIBRARY_PATH is not always the best solution, <link
- linkend="manual.intro.using.linkage.dynamic">Finding Dynamic or Shared
+ Using LD_LIBRARY_PATH is not always the best solution, <link linkend="manual.intro.using.linkage.dynamic">Finding Dynamic or Shared
Libraries</link> in the manual gives some alternatives.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.what_is_libsupcxx">
- <question id="q-what_is_libsupcxx">
+<qandaentry xml:id="faq.what_is_libsupcxx">
+ <question xml:id="q-what_is_libsupcxx">
<para>
What's libsupc++?
</para>
</question>
- <answer id="a-what_is_libsupcxx">
+ <answer xml:id="a-what_is_libsupcxx">
<para>
If the only functions from <filename>libstdc++.a</filename>
which you need are language support functions (those listed in
@@ -421,13 +415,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.size">
- <question id="q-size">
+<qandaentry xml:id="faq.size">
+ <question xml:id="q-size">
<para>
This library is HUGE!
</para>
</question>
- <answer id="a-size">
+ <answer xml:id="a-size">
<para>
Usually the size of libraries on disk isn't noticeable. When a
link editor (or simply <quote>linker</quote>) pulls things from a
@@ -467,16 +461,16 @@
<!-- Platform-Specific Issues -->
-<qandadiv id="faq.platform-specific" xreflabel="Platform-Specific Issues">
-<title>Platform-Specific Issues</title>
+<qandadiv xml:id="faq.platform-specific" xreflabel="Platform-Specific Issues">
-<qandaentry id="faq.other_compilers">
- <question id="q-other_compilers">
+
+<qandaentry xml:id="faq.other_compilers">
+ <question xml:id="q-other_compilers">
<para>
Can libstdc++ be used with non-GNU compilers?
</para>
</question>
- <answer id="a-other_compilers">
+ <answer xml:id="a-other_compilers">
<para>
Perhaps.
</para>
@@ -503,13 +497,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.solaris_long_long">
- <question id="q-solaris_long_long">
+<qandaentry xml:id="faq.solaris_long_long">
+ <question xml:id="q-solaris_long_long">
<para>
No 'long long' type on Solaris?
</para>
</question>
- <answer id="a-solaris_long_long">
+ <answer xml:id="a-solaris_long_long">
<para>
By default we try to support the C99 <type>long long</type> type.
This requires that certain functions from your C library be present.
@@ -526,13 +520,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.predefined">
- <question id="q-predefined">
+<qandaentry xml:id="faq.predefined">
+ <question xml:id="q-predefined">
<para>
<constant>_XOPEN_SOURCE</constant> and <constant>_GNU_SOURCE</constant> are always defined?
</para>
</question>
- <answer id="a-predefined">
+ <answer xml:id="a-predefined">
<para>On Solaris, g++ (but not gcc) always defines the preprocessor
macro <constant>_XOPEN_SOURCE</constant>. On GNU/Linux, the same happens
with <constant>_GNU_SOURCE</constant>. (This is not an exhaustive list;
@@ -558,11 +552,11 @@
<para>To see which symbols are defined, look for CPLUSPLUS_CPP_SPEC in
the gcc config headers for your target (and try changing them to
see what happens when building complicated code). You can also run
- <command>g++ -E -dM - &lt; /dev/null&quot;</command> to display
+ <command>g++ -E -dM - &lt; /dev/null"</command> to display
a list of predefined macros for any particular installation.
</para>
<para>This has been discussed on the mailing lists
- <ulink url="http://gcc.gnu.org/cgi-bin/htsearch?method=and&amp;format=builtin-long&amp;sort=score&amp;words=_XOPEN_SOURCE+Solaris">quite a bit</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/cgi-bin/htsearch?method=and&amp;format=builtin-long&amp;sort=score&amp;words=_XOPEN_SOURCE+Solaris">quite a bit</link>.
</para>
<para>This method is something of a wart. We'd like to find a cleaner
solution, but nobody yet has contributed the time.
@@ -571,29 +565,29 @@
</answer>
</qandaentry>
-<qandaentry id="faq.darwin_ctype">
- <question id="q-darwin_ctype">
+<qandaentry xml:id="faq.darwin_ctype">
+ <question xml:id="q-darwin_ctype">
<para>
Mac OS X <filename class="headerfile">ctype.h</filename> is broken! How can I fix it?
</para>
</question>
- <answer id="a-darwin_ctype">
+ <answer xml:id="a-darwin_ctype">
<para>This is a long-standing bug in the OS X support. Fortunately,
the patch is quite simple, and well-known.
- <ulink url="http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html"> Here's a
- link to the solution</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html"> Here's a
+ link to the solution</link>.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.threads_i386">
- <question id="q-threads_i386">
+<qandaentry xml:id="faq.threads_i386">
+ <question xml:id="q-threads_i386">
<para>
Threading is broken on i386?
</para>
</question>
- <answer id="a-threads_i386">
+ <answer xml:id="a-threads_i386">
<para>
</para>
<para>Support for atomic integer operations is/was broken on i386
@@ -609,13 +603,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.atomic_mips">
- <question id="q-atomic_mips">
+<qandaentry xml:id="faq.atomic_mips">
+ <question xml:id="q-atomic_mips">
<para>
MIPS atomic operations
</para>
</question>
- <answer id="a-atomic_mips">
+ <answer xml:id="a-atomic_mips">
<para>
The atomic locking routines for MIPS targets requires MIPS II
and later. A patch went in just after the 3.3 release to
@@ -629,13 +623,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.linux_glibc">
- <question id="q-linux_glibc">
+<qandaentry xml:id="faq.linux_glibc">
+ <question xml:id="q-linux_glibc">
<para>
Recent GNU/Linux glibc required?
</para>
</question>
- <answer id="a-linux_glibc">
+ <answer xml:id="a-linux_glibc">
<para>When running on GNU/Linux, libstdc++ 3.2.1 (shared library version
5.0.1) and later uses localization and formatting code from the system
C library (glibc) version 2.2.5 which contains necessary bugfixes.
@@ -651,13 +645,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.freebsd_wchar">
- <question id="q-freebsd_wchar">
+<qandaentry xml:id="faq.freebsd_wchar">
+ <question xml:id="q-freebsd_wchar">
<para>
Can't use wchar_t/wstring on FreeBSD
</para>
</question>
- <answer id="a-freebsd_wchar">
+ <answer xml:id="a-freebsd_wchar">
<para>
Older versions of FreeBSD's C library do not have sufficient
support for wide character functions, and as a result the
@@ -678,16 +672,16 @@
<!-- Known Bugs -->
-<qandadiv id="faq.known_bugs" xreflabel="Known Bugs">
-<title>Known Bugs</title>
+<qandadiv xml:id="faq.known_bugs" xreflabel="Known Bugs">
+
-<qandaentry id="faq.what_works">
- <question id="q-what_works">
+<qandaentry xml:id="faq.what_works">
+ <question xml:id="q-what_works">
<para>
What works already?
</para>
</question>
- <answer id="a-what_works">
+ <answer xml:id="a-what_works">
<para>
Short answer: Pretty much everything <emphasis>works</emphasis>
except for some corner cases. Support for localization
@@ -705,13 +699,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.standard_bugs">
- <question id="q-standard_bugs">
+<qandaentry xml:id="faq.standard_bugs">
+ <question xml:id="q-standard_bugs">
<para>
Bugs in the ISO C++ language or library specification
</para>
</question>
- <answer id="a-standard_bugs">
+ <answer xml:id="a-standard_bugs">
<para>
Unfortunately, there are some.
</para>
@@ -719,7 +713,7 @@
For those people who are not part of the ISO Library Group
(i.e., nearly all of us needing to read this page in the first
place), a public list of the library defects is occasionally
- published <ulink url="http://www.open-std.org/jtc1/sc22/wg21/">here</ulink>.
+ published <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/">here</link>.
Some of these issues have resulted in code changes in libstdc++.
</para>
<para>
@@ -731,13 +725,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.compiler_bugs">
- <question id="q-compiler_bugs">
+<qandaentry xml:id="faq.compiler_bugs">
+ <question xml:id="q-compiler_bugs">
<para>
Bugs in the compiler (gcc/g++) and not libstdc++
</para>
</question>
- <answer id="a-compiler_bugs">
+ <answer xml:id="a-compiler_bugs">
<para>
On occasion, the compiler is wrong. Please be advised that this
happens much less often than one would think, and avoid jumping to
@@ -751,7 +745,7 @@
</para>
<para>
Before reporting a bug, please examine the
- <ulink url="http://gcc.gnu.org/bugs.html">bugs database</ulink> with the
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugs.html">bugs database</link> with the
category set to <quote>g++</quote>.
</para>
</answer>
@@ -760,21 +754,21 @@
</qandadiv>
<!-- Known Non-Bugs -->
-<qandadiv id="faq.known_non-bugs" xreflabel="Known Non-Bugs">
-<title>Known Non-Bugs</title>
+<qandadiv xml:id="faq.known_non-bugs" xreflabel="Known Non-Bugs">
-<qandaentry id="faq.stream_reopening_fails">
- <question id="q-stream_reopening_fails">
+
+<qandaentry xml:id="faq.stream_reopening_fails">
+ <question xml:id="q-stream_reopening_fails">
<para>
Reopening a stream fails
</para>
</question>
- <answer id="a-stream_reopening_fails">
+ <answer xml:id="a-stream_reopening_fails">
<para>
One of the most-reported non-bug reports. Executing a sequence like:
</para>
- <literallayout>
+ <literallayout class="normal">
#include &lt;fstream&gt;
...
std::fstream fs(<quote>a_file</quote>);
@@ -803,13 +797,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.wefcxx_verbose">
- <question id="q-wefcxx_verbose">
+<qandaentry xml:id="faq.wefcxx_verbose">
+ <question xml:id="q-wefcxx_verbose">
<para>
-Weffc++ complains too much
</para>
</question>
- <answer id="a-wefcxx_verbose">
+ <answer xml:id="a-wefcxx_verbose">
<para>
Many warnings are emitted when <literal>-Weffc++</literal> is used. Making
libstdc++ <literal>-Weffc++</literal>-clean is not a goal of the project,
@@ -825,13 +819,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.ambiguous_overloads">
- <question id="q-ambiguous_overloads">
+<qandaentry xml:id="faq.ambiguous_overloads">
+ <question xml:id="q-ambiguous_overloads">
<para>
Ambiguous overloads after including an old-style header
</para>
</question>
- <answer id="a-ambiguous_overloads">
+ <answer xml:id="a-ambiguous_overloads">
<para>
Another problem is the <literal>rel_ops</literal> namespace and the template
comparison operator functions contained therein. If they become
@@ -839,27 +833,27 @@
(e.g., <quote>using</quote> them and the &lt;iterator&gt; header),
then you will suddenly be faced with huge numbers of ambiguity
errors. This was discussed on the -v3 list; Nathan Myers
- <ulink url="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
- things up here</ulink>. The collisions with vector/string iterator
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
+ things up here</link>. The collisions with vector/string iterator
types have been fixed for 3.1.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.v2_headers">
- <question id="q-v2_headers">
+<qandaentry xml:id="faq.v2_headers">
+ <question xml:id="q-v2_headers">
<para>
The g++-3 headers are <emphasis>not ours</emphasis>
</para>
</question>
- <answer id="a-v2_headers">
+ <answer xml:id="a-v2_headers">
<para>
If you have found an extremely broken header file which is
causing problems for you, look carefully before submitting a
- &quot;high&quot; priority bug report (which you probably
+ "high" priority bug report (which you probably
shouldn't do anyhow; see the last paragraph of the page
- describing <ulink url="http://gcc.gnu.org/bugs.html">the GCC
- bug database</ulink>).
+ describing <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugs.html">the GCC
+ bug database</link>).
</para>
<para>
If the headers are in <filename>${prefix}/include/g++-3</filename>, or
@@ -881,14 +875,14 @@
</answer>
</qandaentry>
-<qandaentry id="faq.boost_concept_checks">
- <question id="q-boost_concept_checks">
+<qandaentry xml:id="faq.boost_concept_checks">
+ <question xml:id="q-boost_concept_checks">
<para>
Errors about <emphasis>*Concept</emphasis> and
<emphasis>constraints</emphasis> in the STL
</para>
</question>
- <answer id="a-boost_concept_checks">
+ <answer xml:id="a-boost_concept_checks">
<para>
If you see compilation errors containing messages about
<errortext>foo Concept </errortext>and something to do with a
@@ -908,21 +902,21 @@
</answer>
</qandaentry>
-<qandaentry id="faq.dlopen_crash">
- <question id="q-dlopen_crash">
+<qandaentry xml:id="faq.dlopen_crash">
+ <question xml:id="q-dlopen_crash">
<para>
Program crashes when using library code in a
dynamically-loaded library
</para>
</question>
- <answer id="a-dlopen_crash">
+ <answer xml:id="a-dlopen_crash">
<para>
If you are using the C++ library across dynamically-loaded
objects, make certain that you are passing the correct options
when compiling and linking:
</para>
- <literallayout>
+ <literallayout class="normal">
// compile your library components
g++ -fPIC -c a.cc
g++ -fPIC -c b.cc
@@ -938,17 +932,17 @@
</answer>
</qandaentry>
-<qandaentry id="faq.memory_leaks">
- <question id="q-memory_leaks">
+<qandaentry xml:id="faq.memory_leaks">
+ <question xml:id="q-memory_leaks">
<para>
<quote>Memory leaks</quote> in containers
</para>
</question>
- <answer id="a-memory_leaks">
+ <answer xml:id="a-memory_leaks">
<para>
A few people have reported that the standard containers appear
to leak memory when tested with memory checkers such as
- <ulink url="http://valgrind.org/">valgrind</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://valgrind.org/">valgrind</link>.
The library's default allocators keep free memory in a pool
for later reuse, rather than returning it to the OS. Although
this memory is always reachable by the library and is never
@@ -960,13 +954,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.list_size_on">
- <question id="q-list_size_on">
+<qandaentry xml:id="faq.list_size_on">
+ <question xml:id="q-list_size_on">
<para>
list::size() is O(n)!
</para>
</question>
- <answer id="a-list_size_on">
+ <answer xml:id="a-list_size_on">
<para>
See
the <link linkend="std.containers">Containers</link>
@@ -975,18 +969,18 @@
</answer>
</qandaentry>
-<qandaentry id="faq.easy_to_fix">
- <question id="q-easy_to_fix">
+<qandaentry xml:id="faq.easy_to_fix">
+ <question xml:id="q-easy_to_fix">
<para>
Aw, that's easy to fix!
</para>
</question>
- <answer id="a-easy_to_fix">
+ <answer xml:id="a-easy_to_fix">
<para>
If you have found a bug in the library and you think you have
a working fix, then send it in! The main GCC site has a page
- on <ulink url="http://gcc.gnu.org/contribute.html">submitting
- patches</ulink> that covers the procedure, but for libstdc++ you
+ on <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/contribute.html">submitting
+ patches</link> that covers the procedure, but for libstdc++ you
should also send the patch to our mailing list in addition to
the GCC patches mailing list. The libstdc++
<link linkend="appendix.contrib">contributors' page</link>
@@ -995,10 +989,10 @@
<para>
In addition to the description, the patch, and the ChangeLog
entry, it is a Good Thing if you can additionally create a small
- test program to test for the presence of the bug that your
- patch fixes. Bugs have a way of being reintroduced; if an old
- bug creeps back in, it will be caught immediately by the
- <ulink url="#2_4">testsuite</ulink> -- but only if such a test exists.
+ test program to test for the presence of the bug that your patch
+ fixes. Bugs have a way of being reintroduced; if an old bug
+ creeps back in, it will be caught immediately by the testsuite -
+ but only if such a test exists.
</para>
</answer>
</qandaentry>
@@ -1007,16 +1001,16 @@
<!-- Miscellaneous -->
-<qandadiv id="faq.misc" xreflabel="Miscellaneous">
-<title>Miscellaneous</title>
+<qandadiv xml:id="faq.misc" xreflabel="Miscellaneous">
+
-<qandaentry id="faq.iterator_as_pod">
- <question id="faq.iterator_as_pod_q">
+<qandaentry xml:id="faq.iterator_as_pod">
+ <question xml:id="faq.iterator_as_pod_q">
<para>
string::iterator is not char*; vector&lt;T&gt;::iterator is not T*
</para>
</question>
- <answer id="faq.iterator_as_pod_a">
+ <answer xml:id="faq.iterator_as_pod_a">
<para>
If you have code that depends on container&lt;T&gt; iterators
being implemented as pointer-to-T, your code is broken. It's
@@ -1040,13 +1034,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.what_is_next">
- <question id="q-what_is_next">
+<qandaentry xml:id="faq.what_is_next">
+ <question xml:id="q-what_is_next">
<para>
What's next after libstdc++?
</para>
</question>
- <answer id="a-what_is_next">
+ <answer xml:id="a-what_is_next">
<para>
Hopefully, not much. The goal of libstdc++ is to produce a
fully-compliant, fully-portable Standard Library. After that,
@@ -1057,21 +1051,21 @@
There is an effort underway to add significant extensions to
the standard library specification. The latest version of
this effort is described in
- <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">
- The C++ Library Technical Report 1</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">
+ The C++ Library Technical Report 1</link>.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.sgi_stl">
- <question id="q-sgi_stl">
+<qandaentry xml:id="faq.sgi_stl">
+ <question xml:id="q-sgi_stl">
<para>
What about the STL from SGI?
</para>
</question>
- <answer id="a-sgi_stl">
+ <answer xml:id="a-sgi_stl">
<para>
- The <ulink url="http://www.sgi.com/tech/stl/">STL from SGI</ulink>,
+ The <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/">STL from SGI</link>,
version 3.3, was the final merge of the STL codebase. The
code in libstdc++ contains many fixes and changes, and
the SGI code is no longer under active
@@ -1079,7 +1073,7 @@
</para>
<para>
In particular, <classname>string</classname> is not from SGI and makes no
- use of their &quot;rope&quot; class (which is included as an
+ use of their "rope" class (which is included as an
optional extension), nor is <classname>valarray</classname> and some others.
Classes like <classname>vector&lt;&gt;</classname> are, but have been
extensively modified.
@@ -1098,50 +1092,48 @@
</answer>
</qandaentry>
-<qandaentry id="faq.extensions_and_backwards_compat">
- <question id="q-extensions_and_backwards_compat">
+<qandaentry xml:id="faq.extensions_and_backwards_compat">
+ <question xml:id="q-extensions_and_backwards_compat">
<para>
Extensions and Backward Compatibility
</para>
</question>
- <answer id="a-extensions_and_backwards_compat">
+ <answer xml:id="a-extensions_and_backwards_compat">
<para>
See the <link linkend="manual.appendix.porting.backwards">link</link> on backwards compatibility and <link linkend="appendix.porting.api">link</link> on evolution.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.tr1_support">
- <question id="q-tr1_support">
+<qandaentry xml:id="faq.tr1_support">
+ <question xml:id="q-tr1_support">
<para>
Does libstdc++ support TR1?
</para>
</question>
- <answer id="a-tr1_support">
+ <answer xml:id="a-tr1_support">
<para>
Yes.
</para>
<para>
The C++ Standard Library Technical Report adds many new features to
the library. The latest version of this effort is described in
- <ulink url=
- "http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">
- Technical Report 1</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">
+ Technical Report 1</link>.
</para>
<para>
- The implementation status of TR1 in libstdc++ can be tracked <link
- linkend="status.iso.tr1">on the TR1 status
+ The implementation status of TR1 in libstdc++ can be tracked <link linkend="status.iso.tr1">on the TR1 status
page</link>.
</para>
</answer>
</qandaentry>
-<qandaentry id="faq.get_iso_cxx">
- <question id="q-get_iso_cxx">
+<qandaentry xml:id="faq.get_iso_cxx">
+ <question xml:id="q-get_iso_cxx">
<para>How do I get a copy of the ISO C++ Standard?
</para>
</question>
- <answer id="a-get_iso_cxx">
+ <answer xml:id="a-get_iso_cxx">
<para>
Copies of the full ISO 14882 standard are available on line via
the ISO mirror site for committee members. Non-members, or those
@@ -1150,14 +1142,14 @@
get a copy of the standard from their respective national
standards organization. In the USA, this national standards
organization is ANSI and their website is
- right <ulink url="http://www.ansi.org">here</ulink>. (And if
+ right <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.ansi.org">here</link>. (And if
you've already registered with them, clicking this link will take
you to directly to the place where you can
- <ulink url="http://webstore.ansi.org/RecordDetail.aspx?sku=ISO%2FIEC+14882:2003">buy the standard on-line</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://webstore.ansi.org/RecordDetail.aspx?sku=ISO%2FIEC+14882:2003">buy the standard on-line</link>.
</para>
<para>
Who is your country's member body? Visit the
- <ulink url="http://www.iso.ch/">ISO homepage</ulink> and find out!
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.iso.ch/">ISO homepage</link> and find out!
</para>
<para>
The 2003 version of the standard (the 1998 version plus TC1) is
@@ -1166,13 +1158,13 @@
</answer>
</qandaentry>
-<qandaentry id="faq.what_is_abi">
- <question id="q-what_is_abi">
+<qandaentry xml:id="faq.what_is_abi">
+ <question xml:id="q-what_is_abi">
<para>
What's an ABI and why is it so messy?
</para>
</question>
- <answer id="a-what_is_abi">
+ <answer xml:id="a-what_is_abi">
<para>
<acronym>ABI</acronym> stands for <quote>Application Binary
Interface</quote>. Conventionally, it refers to a great
@@ -1226,19 +1218,19 @@
</answer>
</qandaentry>
-<qandaentry id="faq.size_equals_capacity">
- <question id="q-size_equals_capacity">
+<qandaentry xml:id="faq.size_equals_capacity">
+ <question xml:id="q-size_equals_capacity">
<para>
How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
</para>
</question>
- <answer id="a-size_equals_capacity">
+ <answer xml:id="a-size_equals_capacity">
<para>
The standard idiom for deallocating a <classname>vector&lt;T&gt;</classname>'s
unused memory is to create a temporary copy of the vector and swap their
contents, e.g. for <classname>vector&lt;T&gt; v</classname>
</para>
- <literallayout>
+ <literallayout class="normal">
std::vector&lt;T&gt;(v).swap(v);
</literallayout>
<para>
diff --git a/libstdc++-v3/doc/xml/gnu/fdl-1.2.xml b/libstdc++-v3/doc/xml/gnu/fdl-1.2.xml
index 8ad3a41c964..ebf54f4a21b 100644
--- a/libstdc++-v3/doc/xml/gnu/fdl-1.2.xml
+++ b/libstdc++-v3/doc/xml/gnu/fdl-1.2.xml
@@ -1,15 +1,16 @@
-<appendix id="appendix.gfdl-1.2">
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.gfdl-1.2">
+<info><title>GNU Free Documentation License</title></info>
<?dbhtml filename="appendix_gfdl.html"?>
- <title>GNU Free Documentation License</title>
+
<para>
Copyright (C) 2000, 2001, 2002 Free Software Foundation,
<abbrev>Inc.</abbrev> 51 Franklin <abbrev>St</abbrev>, Fifth Floor,
- Boston, <abbrev>MA</abbrev> 02110-1301 <abbrev
- role="initialism">USA</abbrev>. Everyone is permitted to copy and
+ Boston, <abbrev>MA</abbrev> 02110-1301 <abbrev role="initialism">USA</abbrev>. Everyone is permitted to copy and
distribute verbatim copies of this license document, but changing it is
not allowed.
</para>
- <bridgehead id="fdl-1-preamble" renderas="sect1">
+ <bridgehead xml:id="fdl-1-preamble" renderas="sect1">
0. PREAMBLE
</bridgehead>
<para>
@@ -35,7 +36,7 @@
for any textual work, regardless of subject matter or whether it is
published as a printed book. We recommend this License principally for
works whose purpose is instruction or reference.</para>
- <bridgehead id="fdl-1-definitions" renderas="sect1">
+ <bridgehead xml:id="fdl-1-definitions" renderas="sect1">
1. APPLICABILITY AND DEFINITIONS
</bridgehead>
<para>
@@ -131,7 +132,7 @@
these Warranty Disclaimers may have is void and has no effect on the
meaning of this License.
</para>
- <bridgehead id="VerbatimCopying" renderas="sect1">
+ <bridgehead xml:id="VerbatimCopying" renderas="sect1">
2. VERBATIM COPYING
</bridgehead>
<para>
@@ -149,7 +150,7 @@
You may also lend copies, under the same conditions stated above, and you
may publicly display copies.
</para>
- <bridgehead id="QuantityCopying" renderas="sect1">
+ <bridgehead xml:id="QuantityCopying" renderas="sect1">
3. COPYING IN QUANTITY
</bridgehead>
<para>
@@ -190,7 +191,7 @@
them a chance to provide you with an updated version of the
Document.
</para>
- <bridgehead id="Modifications" renderas="sect1">
+ <bridgehead xml:id="Modifications" renderas="sect1">
4. MODIFICATIONS
</bridgehead>
<para>
@@ -340,7 +341,7 @@
permission to use their names for publicity for or to assert or imply
endorsement of any Modified Version.
</para>
- <bridgehead id="Combining" renderas="sect1">
+ <bridgehead xml:id="Combining" renderas="sect1">
5. COMBINING DOCUMENTS
</bridgehead>
<para>
@@ -368,7 +369,7 @@
sections Entitled "Dedications". You must delete all sections Entitled
"Endorsements".
</para>
- <bridgehead id="Collections" renderas="sect1">
+ <bridgehead xml:id="Collections" renderas="sect1">
6. COLLECTIONS OF DOCUMENTS
</bridgehead>
<para>
@@ -384,7 +385,7 @@
License into the extracted document, and follow this License in all other
respects regarding verbatim copying of that document.
</para>
- <bridgehead id="Aggregation" renderas="sect1">
+ <bridgehead xml:id="Aggregation" renderas="sect1">
7. AGGREGATION WITH INDEPENDENT WORKS
</bridgehead>
<para>
@@ -405,7 +406,7 @@
if the Document is in electronic form. Otherwise they must appear on
printed covers that bracket the whole aggregate.
</para>
- <bridgehead id="Translation" renderas="sect1">
+ <bridgehead xml:id="Translation" renderas="sect1">
8. TRANSLATION
</bridgehead>
<para>
@@ -426,7 +427,7 @@
"Dedications", or "History", the requirement (section 4) to Preserve its
Title (section 1) will typically require changing the actual title.
</para>
- <bridgehead id="fdl-1-termination" renderas="sect1">
+ <bridgehead xml:id="fdl-1-termination" renderas="sect1">
9. TERMINATION
</bridgehead>
<para>
@@ -438,15 +439,14 @@
have their licenses terminated so long as such parties remain in full
compliance.
</para>
- <bridgehead id="FutureRevisions" renderas="sect1">
+ <bridgehead xml:id="FutureRevisions" renderas="sect1">
10. FUTURE REVISIONS OF THIS LICENSE
</bridgehead>
<para>
The Free Software Foundation may publish new, revised versions of the GNU
Free Documentation License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to
- address new problems or concerns. See <ulink
- url="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</ulink>.
+ address new problems or concerns. See <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</link>.
</para>
<para>
Each version of the License is given a distinguishing version number. If
@@ -458,7 +458,7 @@
License, you may choose any version ever published (not as a draft) by the
Free Software Foundation.
</para>
- <bridgehead id="HowToUse" renderas="sect1">
+ <bridgehead xml:id="HowToUse" renderas="sect1">
ADDENDUM: How to use this License for your documents
</bridgehead>
<para>
diff --git a/libstdc++-v3/doc/xml/gnu/fdl-1.3.xml b/libstdc++-v3/doc/xml/gnu/fdl-1.3.xml
index 4abbd1d779f..9500e11fe2e 100644
--- a/libstdc++-v3/doc/xml/gnu/fdl-1.3.xml
+++ b/libstdc++-v3/doc/xml/gnu/fdl-1.3.xml
@@ -1,21 +1,23 @@
-<appendix id="appendix.gfdl-1.3">
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.gfdl-1.3">
+<info><title>GNU Free Documentation License</title></info>
<?dbhtml filename="appendix_gfdl.html"?>
- <title>GNU Free Documentation License</title>
+
<simpara>Version 1.3, 3 November 2008</simpara>
<simpara>
- Copyright &#169; 2000, 2001, 2002, 2007, 2008
- <ulink url="http://www.fsf.org/">Free Software Foundation, Inc.</ulink>
+ Copyright © 2000, 2001, 2002, 2007, 2008
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org/">Free Software Foundation, Inc.</link>
</simpara>
<simpara>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
</simpara>
- <bridgehead id="fdl-1-section0" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section0" renderas="sect2">
0. PREAMBLE
</bridgehead>
<simpara>
The purpose of this License is to make a manual, textbook, or other
- functional and useful document &#8220;free&#8221; in the sense of freedom:
+ functional and useful document “free†in the sense of freedom:
to assure everyone the effective freedom to copy and redistribute it, with
or without modifying it, either commercially or
noncommercially. Secondarily, this License preserves for the author and
@@ -23,7 +25,7 @@
responsible for modifications made by others.
</simpara>
<simpara>
- This License is a kind of &#8220;copyleft&#8221;, which means that
+ This License is a kind of “copyleftâ€, which means that
derivative works of the document must themselves be free in the same
sense. It complements the GNU General Public License, which is a copyleft
license designed for free software.
@@ -37,7 +39,7 @@
published as a printed book. We recommend this License principally for
works whose purpose is instruction or reference.
</simpara>
- <bridgehead id="fdl-1-section1" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section1" renderas="sect2">
1. APPLICABILITY AND DEFINITIONS
</bridgehead>
<simpara>
@@ -45,21 +47,21 @@
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that work
- under the conditions stated herein. The &#8220;Document&#8221;, below,
+ under the conditions stated herein. The “Documentâ€, below,
refers to any such manual or work. Any member of the public is a licensee,
- and is addressed as &#8220;you&#8221;. You accept the license if you copy,
+ and is addressed as “youâ€. You accept the license if you copy,
modify or distribute the work in a way requiring permission under
copyright law.
</simpara>
<simpara>
- A &#8220;Modified Version&#8221; of the Document means any work containing
+ A “Modified Version†of the Document means any work containing
the Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
</simpara>
<simpara>
- A &#8220;Secondary Section&#8221; is a named appendix or a front-matter
+ A “Secondary Section†is a named appendix or a front-matter
section of the Document that deals exclusively with the relationship of
- the publishers or authors of the Document to the Document&#x2019;s overall
+ the publishers or authors of the Document to the Document’s overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
@@ -68,7 +70,7 @@
philosophical, ethical or political position regarding them.
</simpara>
<simpara>
- The &#8220;Invariant Sections&#8221; are certain Secondary Sections whose
+ The “Invariant Sections†are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a section
does not fit the above definition of Secondary then it is not allowed to
@@ -77,13 +79,13 @@
there are none.
</simpara>
<simpara>
- The &#8220;Cover Texts&#8221; are certain short passages of text that are
+ The “Cover Texts†are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says
that the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
</simpara>
<simpara>
- A &#8220;Transparent&#8221; copy of the Document means a machine-readable
+ A “Transparent†copy of the Document means a machine-readable
copy, represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
@@ -94,7 +96,7 @@
markup, or absence of markup, has been arranged to thwart or discourage
subsequent modification by readers is not Transparent. An image format is
not Transparent if used for any substantial amount of text. A copy that is
- not &#8220;Transparent&#8221; is called &#8220;Opaque&#8221;.
+ not “Transparent†is called “Opaqueâ€.
</simpara>
<simpara>
Examples of suitable formats for Transparent copies include plain ASCII
@@ -108,26 +110,26 @@
some word processors for output purposes only.
</simpara>
<simpara>
- The &#8220;Title Page&#8221; means, for a printed book, the title page
+ The “Title Page†means, for a printed book, the title page
itself, plus such following pages as are needed to hold, legibly, the
material this License requires to appear in the title page. For works in
- formats which do not have any title page as such, &#8220;Title Page&#8221;
- means the text near the most prominent appearance of the work&#x2019;s
+ formats which do not have any title page as such, “Title Pageâ€
+ means the text near the most prominent appearance of the work’s
title, preceding the beginning of the body of the text.
</simpara>
<simpara>
- The &#8220;publisher&#8221; means any person or entity that distributes
+ The “publisher†means any person or entity that distributes
copies of the Document to the public.
</simpara>
<simpara>
- A section &#8220;Entitled XYZ&#8221; means a named subunit of the Document
+ A section “Entitled XYZ†means a named subunit of the Document
whose title either is precisely XYZ or contains XYZ in parentheses
following text that translates XYZ in another language. (Here XYZ stands
for a specific section name mentioned below, such as
- &#8220;Acknowledgements&#8221;, &#8220;Dedications&#8221;,
- &#8220;Endorsements&#8221;, or &#8220;History&#8221;.) To &#8220;Preserve
- the Title&#8221; of such a section when you modify the Document means that
- it remains a section &#8220;Entitled XYZ&#8221; according to this
+ “Acknowledgementsâ€, “Dedicationsâ€,
+ “Endorsementsâ€, or “Historyâ€.) To “Preserve
+ the Title†of such a section when you modify the Document means that
+ it remains a section “Entitled XYZ†according to this
definition.
</simpara>
<simpara>
@@ -138,7 +140,7 @@
these Warranty Disclaimers may have is void and has no effect on the
meaning of this License.
</simpara>
- <bridgehead id="fdl-1-section2" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section2" renderas="sect2">
2. VERBATIM COPYING
</bridgehead>
<simpara>
@@ -156,13 +158,13 @@
You may also lend copies, under the same conditions stated above, and you
may publicly display copies.
</simpara>
- <bridgehead id="fdl-1-section3" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section3" renderas="sect2">
3. COPYING IN QUANTITY
</bridgehead>
<simpara>
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
- Document&#x2019;s license notice requires Cover Texts, you must enclose
+ Document’s license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the
back cover. Both covers must also clearly and legibly identify you as the
@@ -195,7 +197,7 @@
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
</simpara>
- <bridgehead id="fdl-1-section4" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section4" renderas="sect2">
4. MODIFICATIONS
</bridgehead>
<simpara>
@@ -252,7 +254,7 @@
<listitem>
<simpara>
Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document&#x2019;s license
+ and required Cover Texts given in the Document’s license
notice.
</simpara>
</listitem>
@@ -263,10 +265,10 @@
</listitem>
<listitem>
<simpara>
- Preserve the section Entitled &#8220;History&#8221;, Preserve its
+ Preserve the section Entitled “Historyâ€, Preserve its
Title, and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the Title
- Page. If there is no section Entitled &#8220;History&#8221; in the
+ Page. If there is no section Entitled “History†in the
Document, create one stating the title, year, authors, and publisher
of the Document as given on its Title Page, then add an item
describing the Modified Version as stated in the previous sentence.
@@ -277,7 +279,7 @@
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise the
network locations given in the Document for previous versions it was
- based on. These may be placed in the &#8220;History&#8221;
+ based on. These may be placed in the “Historyâ€
section. You may omit a network location for a work that was published
at least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@@ -285,8 +287,8 @@
</listitem>
<listitem>
<simpara>
- For any section Entitled &#8220;Acknowledgements&#8221; or
- &#8220;Dedications&#8221;, Preserve the Title of the section, and
+ For any section Entitled “Acknowledgements†or
+ “Dedicationsâ€, Preserve the Title of the section, and
preserve in the section all the substance and tone of each of the
contributor acknowledgements and/or dedications given therein.
</simpara>
@@ -300,14 +302,14 @@
</listitem>
<listitem>
<simpara>
- Delete any section Entitled &#8220;Endorsements&#8221;. Such a section
+ Delete any section Entitled “Endorsementsâ€. Such a section
may not be included in the Modified Version.
</simpara>
</listitem>
<listitem>
<simpara>
Do not retitle any existing section to be Entitled
- &#8220;Endorsements&#8221; or to conflict in title with any Invariant
+ “Endorsements†or to conflict in title with any Invariant
Section.
</simpara>
</listitem>
@@ -322,13 +324,13 @@
that qualify as Secondary Sections and contain no material copied from the
Document, you may at your option designate some or all of these sections
as invariant. To do this, add their titles to the list of Invariant
- Sections in the Modified Version&#x2019;s license notice. These titles
+ Sections in the Modified Version’s license notice. These titles
must be distinct from any other section titles.
</simpara>
<simpara>
- You may add a section Entitled &#8220;Endorsements&#8221;, provided it
+ You may add a section Entitled “Endorsementsâ€, provided it
contains nothing but endorsements of your Modified Version by various
- parties &#8212; for example, statements of peer review or that the text
+ parties — for example, statements of peer review or that the text
has been approved by an organization as the authoritative definition of a
standard.
</simpara>
@@ -348,7 +350,7 @@
permission to use their names for publicity for or to assert or imply
endorsement of any Modified Version.
</simpara>
- <bridgehead id="fdl-1-section5" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section5" renderas="sect2">
5. COMBINING DOCUMENTS
</bridgehead>
<simpara>
@@ -371,13 +373,13 @@
</simpara>
<simpara>
In the combination, you must combine any sections Entitled
- &#8220;History&#8221; in the various original documents, forming one
- section Entitled &#8220;History&#8221;; likewise combine any sections
- Entitled &#8220;Acknowledgements&#8221;, and any sections Entitled
- &#8220;Dedications&#8221;. You must delete all sections Entitled
- &#8220;Endorsements&#8221;.
+ “History†in the various original documents, forming one
+ section Entitled “Historyâ€; likewise combine any sections
+ Entitled “Acknowledgementsâ€, and any sections Entitled
+ “Dedicationsâ€. You must delete all sections Entitled
+ “Endorsementsâ€.
</simpara>
- <bridgehead id="fdl-1-section6" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section6" renderas="sect2">
6. COLLECTIONS OF DOCUMENTS
</bridgehead>
<simpara>
@@ -393,15 +395,15 @@
License into the extracted document, and follow this License in all other
respects regarding verbatim copying of that document.
</simpara>
- <bridgehead id="fdl-1-section7" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section7" renderas="sect2">
7. AGGREGATION WITH INDEPENDENT WORKS
</bridgehead>
<simpara>
A compilation of the Document or its derivatives with other separate and
independent documents or works, in or on a volume of a storage or
- distribution medium, is called an &#8220;aggregate&#8221; if the copyright
+ distribution medium, is called an “aggregate†if the copyright
resulting from the compilation is not used to limit the legal rights of
- the compilation&#x2019;s users beyond what the individual works
+ the compilation’s users beyond what the individual works
permit. When the Document is included in an aggregate, this License does
not apply to the other works in the aggregate which are not themselves
derivative works of the Document.
@@ -409,12 +411,12 @@
<simpara>
If the Cover Text requirement of section 3 is applicable to these copies
of the Document, then if the Document is less than one half of the entire
- aggregate, the Document&#x2019;s Cover Texts may be placed on covers that
+ aggregate, the Document’s Cover Texts may be placed on covers that
bracket the Document within the aggregate, or the electronic equivalent of
covers if the Document is in electronic form. Otherwise they must appear
on printed covers that bracket the whole aggregate.
</simpara>
- <bridgehead id="fdl-1-section8" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section8" renderas="sect2">
8. TRANSLATION
</bridgehead>
<simpara>
@@ -431,12 +433,12 @@
License or a notice or disclaimer, the original version will prevail.
</simpara>
<simpara>
- If a section in the Document is Entitled &#8220;Acknowledgements&#8221;,
- &#8220;Dedications&#8221;, or &#8220;History&#8221;, the requirement
+ If a section in the Document is Entitled “Acknowledgementsâ€,
+ “Dedicationsâ€, or “Historyâ€, the requirement
(section 4) to Preserve its Title (section 1) will typically require
changing the actual title.
</simpara>
- <bridgehead id="fdl-1-section9" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section9" renderas="sect2">
9. TERMINATION
</bridgehead>
<simpara>
@@ -467,7 +469,7 @@
reinstated, receipt of a copy of some or all of the same material does not
give you any rights to use it.
</simpara>
- <bridgehead id="fdl-1-section10" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section10" renderas="sect2">
10. FUTURE REVISIONS OF THIS LICENSE
</bridgehead>
<simpara>
@@ -475,46 +477,46 @@
Free Documentation License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to
address new problems or concerns. See
- <ulink url="http://www.gnu.org/copyleft/">Copyleft</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/copyleft/">Copyleft</link>.
</simpara>
<simpara>
Each version of the License is given a distinguishing version number. If
the Document specifies that a particular numbered version of this License
- &#8220;or any later version&#8221; applies to it, you have the option of
+ “or any later version†applies to it, you have the option of
following the terms and conditions either of that specified version or of
any later version that has been published (not as a draft) by the Free
Software Foundation. If the Document does not specify a version number of
this License, you may choose any version ever published (not as a draft)
by the Free Software Foundation. If the Document specifies that a proxy
can decide which future versions of this License can be used, that
- proxy&#x2019;s public statement of acceptance of a version permanently
+ proxy’s public statement of acceptance of a version permanently
authorizes you to choose that version for the Document.
</simpara>
- <bridgehead id="fdl-1-section11" renderas="sect2">
+ <bridgehead xml:id="fdl-1-section11" renderas="sect2">
11. RELICENSING
</bridgehead>
<simpara>
- &#8220;Massive Multiauthor Collaboration Site&#8221; (or &#8220;MMC
- Site&#8221;) means any World Wide Web server that publishes copyrightable
+ “Massive Multiauthor Collaboration Site†(or “MMC
+ Siteâ€) means any World Wide Web server that publishes copyrightable
works and also provides prominent facilities for anybody to edit those
works. A public wiki that anybody can edit is an example of such a
- server. A &#8220;Massive Multiauthor Collaboration&#8221; (or
- &#8220;MMC&#8221;) contained in the site means any set of copyrightable
+ server. A “Massive Multiauthor Collaboration†(or
+ “MMCâ€) contained in the site means any set of copyrightable
works thus published on the MMC site.
</simpara>
<simpara>
- &#8220;CC-BY-SA&#8221; means the Creative Commons Attribution-Share Alike
+ “CC-BY-SA†means the Creative Commons Attribution-Share Alike
3.0 license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license published
by that same organization.
</simpara>
<simpara>
- &#8220;Incorporate&#8221; means to publish or republish a Document, in
+ “Incorporate†means to publish or republish a Document, in
whole or in part, as part of another Document.
</simpara>
<simpara>
- An MMC is &#8220;eligible for relicensing&#8221; if it is licensed under
+ An MMC is “eligible for relicensing†if it is licensed under
this License, and if all works that were first published under this
License somewhere other than this MMC, and subsequently incorporated in
whole or in part into the MMC, (1) had no cover texts or invariant
@@ -525,7 +527,7 @@
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
</simpara>
- <bridgehead id="fdl-1-addendum" renderas="sect2">
+ <bridgehead xml:id="fdl-1-addendum" renderas="sect2">
ADDENDUM: How to use this License for your documents
</bridgehead>
<simpara>
@@ -533,16 +535,16 @@
License in the document and put the following copyright and license
notices just after the title page:
</simpara>
- <screen>Copyright &#169; YEAR YOUR NAME
+ <screen>Copyright © YEAR YOUR NAME
Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU Free Documentation License, Version 1.3 or any later version
published by the Free Software Foundation; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in
-the section entitled &#8220;GNU Free Documentation License&#8221;.</screen>
+the section entitled “GNU Free Documentation Licenseâ€.</screen>
<simpara>
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
- replace the &#8220;with&#8230; Texts.&#8221; line with this:
+ replace the “with… Texts.†line with this:
</simpara>
<screen>with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts
being LIST, and with the Back-Cover Texts being LIST.</screen>
diff --git a/libstdc++-v3/doc/xml/gnu/gpl-2.0.xml b/libstdc++-v3/doc/xml/gnu/gpl-2.0.xml
index 151a9523f07..cf012ec960b 100644
--- a/libstdc++-v3/doc/xml/gnu/gpl-2.0.xml
+++ b/libstdc++-v3/doc/xml/gnu/gpl-2.0.xml
@@ -1,15 +1,13 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<appendix id="appendix.gpl-2.0">
- <appendixinfo>
- <title>GNU General Public License</title>
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.gpl-2.0">
+ <info><title>GNU General Public License</title>
+
<pubdate>Version 2, June 1991</pubdate>
<copyright>
<year>1989, 1991</year>
<holder>Free Software Foundation, Inc.</holder>
</copyright>
- <legalnotice id="gpl-legalnotice">
+ <legalnotice xml:id="gpl-legalnotice">
<para>
<address>Free Software Foundation, Inc.
<street>51 Franklin Street, Fifth Floor</street>,
@@ -20,16 +18,16 @@
<para>Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</para>
</legalnotice>
<releaseinfo>Version 2, June 1991</releaseinfo>
- </appendixinfo>
- <title>GNU General Public License</title>
- <section id="gpl-1">
- <title>Preamble</title>
+ </info>
+
+ <section xml:id="gpl-1"><info><title>Preamble</title></info>
+
<para>The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public License is
intended to guarantee your freedom to share and change
free software - to make sure the software is free for all its users.
This General Public License applies to most of the Free Software
- Foundation&apos;s software and to any other program whose authors commit
+ Foundation's software and to any other program whose authors commit
to using it. (Some other Free Software Foundation software is covered
by the GNU Library General Public License instead.) You can apply it
to your programs, too.</para>
@@ -52,7 +50,7 @@
must show them these terms so they know their rights.</para>
<para>We protect your rights with two steps:
- <orderedlist>
+ <orderedlist inheritnum="ignore" continuation="restarts">
<listitem>
<para>copyright the software, and</para>
</listitem>
@@ -63,26 +61,26 @@
</orderedlist>
</para>
- <para>Also, for each author&apos;s protection and ours, we want to make certain that
+ <para>Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its
recipients to know that what they have is not the original, so that any
- problems introduced by others will not reflect on the original authors&apos;
+ problems introduced by others will not reflect on the original authors'
reputations.</para>
<para>Finally, any free program is threatened constantly by software patents.
We wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent must be
- licensed for everyone&apos;s free use or not licensed at all.</para>
+ licensed for everyone's free use or not licensed at all.</para>
<para>The precise terms and conditions for copying, distribution and modification
follow.</para>
</section>
- <section id="gpl-2">
- <title>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</title>
- <section id="gpl-2-0">
- <title>Section 0</title>
+ <section xml:id="gpl-2"><info><title>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</title></info>
+
+ <section xml:id="gpl-2-0"><info><title>Section 0</title></info>
+
<para>This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms
of this General Public License. The <quote>Program</quote>, below, refers to any such
@@ -100,9 +98,9 @@
constitute a work based on the Program (independent of having been made by running
the Program). Whether that is true depends on what the Program does.</para>
</section>
- <section id="gpl-2-1">
- <title>Section 1</title>
- <para>You may copy and distribute verbatim copies of the Program&apos;s source code as you
+ <section xml:id="gpl-2-1"><info><title>Section 1</title></info>
+
+ <para>You may copy and distribute verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence of any
@@ -112,14 +110,14 @@
<para>You may charge a fee for the physical act of transferring a copy, and you may at
your option offer warranty protection in exchange for a fee.</para>
</section>
- <section id="gpl-2-2">
- <title>Section 2</title>
+ <section xml:id="gpl-2-2"><info><title>Section 2</title></info>
+
<para>You may modify your copy or copies of the Program or any portion of it, thus
forming a work based on the Program, and copy and distribute such modifications
or work under the terms of
<link linkend="gpl-2-1">Section 1</link> above, provided
that you also meet all of these conditions:
- <orderedlist numeration="loweralpha">
+ <orderedlist numeration="loweralpha" inheritnum="ignore" continuation="restarts">
<listitem>
<para>You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.</para>
@@ -161,13 +159,13 @@
(or with a work based on the Program) on a volume of a storage or distribution medium
does not bring the other work under the scope of this License.</para>
</section>
- <section id="gpl-2-3">
- <title>Section 3</title>
+ <section xml:id="gpl-2-3"><info><title>Section 3</title></info>
+
<para>You may copy and distribute the Program (or a work based on it, under
<link linkend="gpl-2-2">Section 2</link> in object code or executable form under the terms of
<link linkend="gpl-2-1">Sections 1</link> and
<link linkend="gpl-2-2">2</link> above provided that you also do one of the following:
- <orderedlist numeration="loweralpha">
+ <orderedlist numeration="loweralpha" inheritnum="ignore" continuation="restarts">
<listitem>
<para>Accompany it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a medium
@@ -202,16 +200,16 @@
counts as distribution of the source code, even though third parties are not compelled to
copy the source along with the object code.</para>
</section>
- <section id="gpl-2-4">
- <title>Section 4</title>
+ <section xml:id="gpl-2-4"><info><title>Section 4</title></info>
+
<para>You may not copy, modify, sublicense, or distribute the Program except as expressly provided
under this License. Any attempt otherwise to copy, modify, sublicense or distribute the
Program is void, and will automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this License will not have their
licenses terminated so long as such parties remain in full compliance.</para>
</section>
- <section id="gpl-2-5">
- <title>Section 5</title>
+ <section xml:id="gpl-2-5"><info><title>Section 5</title></info>
+
<para>You are not required to accept this License, since you have not signed it. However, nothing
else grants you permission to modify or distribute the Program or its derivative works.
These actions are prohibited by law if you do not accept this License. Therefore, by modifying
@@ -219,16 +217,16 @@
of this License to do so, and all its terms and conditions for copying, distributing or
modifying the Program or works based on it.</para>
</section>
- <section id="gpl-2-6">
- <title>Section 6</title>
+ <section xml:id="gpl-2-6"><info><title>Section 6</title></info>
+
<para>Each time you redistribute the Program (or any work based on the Program), the recipient
automatically receives a license from the original licensor to copy, distribute or modify
the Program subject to these terms and conditions. You may not impose any further restrictions
- on the recipients&apos; exercise of the rights granted herein. You are not responsible for enforcing
+ on the recipients' exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.</para>
</section>
- <section id="gpl-2-7">
- <title>Section 7</title>
+ <section xml:id="gpl-2-7"><info><title>Section 7</title></info>
+
<para>If, as a consequence of a court judgment or allegation of patent infringement or for any other
reason (not limited to patent issues), conditions are imposed on you (whether by court order,
agreement or otherwise) that contradict the conditions of this License, they do not excuse you
@@ -254,16 +252,16 @@
<para>This section is intended to make thoroughly clear what is believed to be a consequence of the
rest of this License.</para>
</section>
- <section id="gpl-2-8">
- <title>Section 8</title>
+ <section xml:id="gpl-2-8"><info><title>Section 8</title></info>
+
<para>If the distribution and/or use of the Program is restricted in certain countries either by patents
or by copyrighted interfaces, the original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding those countries, so that
distribution is permitted only in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.</para>
</section>
- <section id="gpl-2-9">
- <title>Section 9</title>
+ <section xml:id="gpl-2-9"><info><title>Section 9</title></info>
+
<para>The Free Software Foundation may publish revised and/or new versions of the General Public License
from time to time. Such new versions will be similar in spirit to the present version, but may differ
in detail to address new problems or concerns.</para>
@@ -274,16 +272,16 @@
Foundation. If the Program does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.</para>
</section>
- <section id="gpl-2-10">
- <title>Section 10</title>
+ <section xml:id="gpl-2-10"><info><title>Section 10</title></info>
+
<para>If you wish to incorporate parts of the Program into other free programs whose distribution
conditions are different, write to the author to ask for permission. For software which is copyrighted
by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free status of all
derivatives of our free software and of promoting the sharing and reuse of software generally.</para>
</section>
- <section id="gpl-2-11">
- <title>NO WARRANTY Section 11</title>
+ <section xml:id="gpl-2-11"><info><title>NO WARRANTY Section 11</title></info>
+
<para>BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM <quote>AS IS</quote> WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
@@ -291,8 +289,8 @@
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</para>
</section>
- <section id="gpl-2-12">
- <title>Section 12</title>
+ <section xml:id="gpl-2-12"><info><title>Section 12</title></info>
+
<para>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
@@ -304,8 +302,8 @@
<para>END OF TERMS AND CONDITIONS</para>
</section>
</section>
- <section id="gpl-3">
- <title>How to Apply These Terms to Your New Programs</title>
+ <section xml:id="gpl-3"><info><title>How to Apply These Terms to Your New Programs</title></info>
+
<para>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.</para>
@@ -315,7 +313,7 @@
convey the exclusion of warranty; and each file should have at least
the <quote>copyright</quote> line and a pointer to where the full notice is found.</para>
- <para>&lt;one line to give the program&apos;s name and a brief idea of what it does.&gt;
+ <para>&lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;</para>
<para>This program is free software; you can redistribute it and/or modify
diff --git a/libstdc++-v3/doc/xml/gnu/gpl-3.0.xml b/libstdc++-v3/doc/xml/gnu/gpl-3.0.xml
index 90fa18be431..d5a5eae203b 100644
--- a/libstdc++-v3/doc/xml/gnu/gpl-3.0.xml
+++ b/libstdc++-v3/doc/xml/gnu/gpl-3.0.xml
@@ -1,23 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<appendix id="appendix.gpl-3.0">
- <?dbhtml filename="appendix_gpl.html"?>
- <title>
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.gpl-3.0"><info><title>
<acronym>GNU</acronym> General Public License version 3
- </title>
+ </title></info>
+ <?dbhtml filename="appendix_gpl.html"?>
+
<para>
Version 3, 29 June 2007
</para>
<para>
- Copyright &copy; 2007 Free Software Foundation, Inc.
- <ulink url="http://www.fsf.org/">http://www.fsf.org/</ulink>
+ Copyright © 2007 Free Software Foundation, Inc.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org/">http://www.fsf.org/</link>
</para>
<para>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
</para>
- <bridgehead id="gpl-3-preamble" renderas="sect1">
+ <bridgehead xml:id="gpl-3-preamble" renderas="sect1">
Preamble
</bridgehead>
<para>
@@ -28,7 +26,7 @@
The licenses for most software and other practical works are designed to
take away your freedom to share and change the works. By contrast, the
<acronym>GNU</acronym> General Public License is intended to guarantee your
- freedom to share and change all versions of a program&mdash;to make sure it
+ freedom to share and change all versions of a program—to make sure it
remains free software for all its users. We, the Free Software Foundation,
use the <acronym>GNU</acronym> General Public License for most of our
software; it applies also to any other work released this way by its
@@ -61,9 +59,9 @@
distribute and/or modify it.
</para>
<para>
- For the developers&rsquo; and authors&rsquo; protection, the
+ For the developers’ and authors’ protection, the
<acronym>GPL</acronym> clearly explains that there is no warranty for this
- free software. For both users&rsquo; and authors&rsquo; sake, the
+ free software. For both users’ and authors’ sake, the
<acronym>GPL</acronym> requires that modified versions be marked as changed,
so that their problems will not be attributed erroneously to authors of
previous versions.
@@ -71,7 +69,7 @@
<para>
Some devices are designed to deny users access to install or run modified
versions of the software inside them, although the manufacturer can do so.
- This is fundamentally incompatible with the aim of protecting users&rsquo;
+ This is fundamentally incompatible with the aim of protecting users’
freedom to change the software. The systematic pattern of such abuse occurs
in the area of products for individuals to use, which is precisely where it
is most unacceptable. Therefore, we have designed this version of the
@@ -95,36 +93,36 @@
<bridgehead>
TERMS AND CONDITIONS
</bridgehead>
- <bridgehead id="gpl-3-definitions" renderas="sect1">
+ <bridgehead xml:id="gpl-3-definitions" renderas="sect1">
0. Definitions.
</bridgehead>
<para>
- &ldquo;This License&rdquo; refers to version 3 of the <acronym>GNU</acronym>
+ “This License†refers to version 3 of the <acronym>GNU</acronym>
General Public License.
</para>
<para>
- &ldquo;Copyright&rdquo; also means copyright-like laws that apply to other
+ “Copyright†also means copyright-like laws that apply to other
kinds of works, such as semiconductor masks.
</para>
<para>
- &ldquo;The Program&rdquo; refers to any copyrightable work licensed under
- this License. Each licensee is addressed as &ldquo;you&rdquo;.
- &ldquo;Licensees&rdquo; and &ldquo;recipients&rdquo; may be individuals or
+ “The Program†refers to any copyrightable work licensed under
+ this License. Each licensee is addressed as “youâ€.
+ “Licensees†and “recipients†may be individuals or
organizations.
</para>
<para>
- To &ldquo;modify&rdquo; a work means to copy from or adapt all or part of
+ To “modify†a work means to copy from or adapt all or part of
the work in a fashion requiring copyright permission, other than the making
- of an exact copy. The resulting work is called a &ldquo;modified
- version&rdquo; of the earlier work or a work &ldquo;based on&rdquo; the
+ of an exact copy. The resulting work is called a “modified
+ version†of the earlier work or a work “based on†the
earlier work.
</para>
<para>
- A &ldquo;covered work&rdquo; means either the unmodified Program or a work
+ A “covered work†means either the unmodified Program or a work
based on the Program.
</para>
<para>
- To &ldquo;propagate&rdquo; a work means to do anything with it that, without
+ To “propagate†a work means to do anything with it that, without
permission, would make you directly or secondarily liable for infringement
under applicable copyright law, except executing it on a computer or
modifying a private copy. Propagation includes copying, distribution (with
@@ -132,13 +130,13 @@
countries other activities as well.
</para>
<para>
- To &ldquo;convey&rdquo; a work means any kind of propagation that enables
+ To “convey†a work means any kind of propagation that enables
other parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not conveying.
</para>
<para>
- An interactive user interface displays &ldquo;Appropriate Legal
- Notices&rdquo; to the extent that it includes a convenient and prominently
+ An interactive user interface displays “Appropriate Legal
+ Notices†to the extent that it includes a convenient and prominently
visible feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the extent
that warranties are provided), that licensees may convey the work under this
@@ -146,37 +144,37 @@
a list of user commands or options, such as a menu, a prominent item in the
list meets this criterion.
</para>
- <bridgehead id="SourceCode" renderas="sect1">
+ <bridgehead xml:id="SourceCode" renderas="sect1">
1. Source Code.
</bridgehead>
<para>
- The &ldquo;source code&rdquo; for a work means the preferred form of the
- work for making modifications to it. &ldquo;Object code&rdquo; means any
+ The “source code†for a work means the preferred form of the
+ work for making modifications to it. “Object code†means any
non-source form of a work.
</para>
<para>
- A &ldquo;Standard Interface&rdquo; means an interface that either is an
+ A “Standard Interface†means an interface that either is an
official standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that is
widely used among developers working in that language.
</para>
<para>
- The &ldquo;System Libraries&rdquo; of an executable work include anything,
+ The “System Libraries†of an executable work include anything,
other than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major Component,
and (b) serves only to enable use of the work with that Major Component, or
to implement a Standard Interface for which an implementation is available
- to the public in source code form. A &ldquo;Major Component&rdquo;, in this
+ to the public in source code form. A “Major Componentâ€, in this
context, means a major essential component (kernel, window system, and so
on) of the specific operating system (if any) on which the executable work
runs, or a compiler used to produce the work, or an object code interpreter
used to run it.
</para>
<para>
- The &ldquo;Corresponding Source&rdquo; for a work in object code form means
+ The “Corresponding Source†for a work in object code form means
all the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
- control those activities. However, it does not include the work&rsquo;s
+ control those activities. However, it does not include the work’s
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but which
are not part of the work. For example, Corresponding Source includes
@@ -193,7 +191,7 @@
<para>
The Corresponding Source for a work in source code form is that same work.
</para>
- <bridgehead id="BasicPermissions" renderas="sect1">
+ <bridgehead xml:id="BasicPermissions" renderas="sect1">
2. Basic Permissions.
</bridgehead>
<para>
@@ -222,8 +220,8 @@
conditions stated below. Sublicensing is not allowed; section 10 makes it
unnecessary.
</para>
- <bridgehead id="Protecting" renderas="sect1">
- 3. Protecting Users&rsquo; Legal Rights From Anti-Circumvention Law.
+ <bridgehead xml:id="Protecting" renderas="sect1">
+ 3. Protecting Users’ Legal Rights From Anti-Circumvention Law.
</bridgehead>
<para>
No covered work shall be deemed part of an effective technological measure
@@ -236,15 +234,15 @@
circumvention of technological measures to the extent such circumvention is
effected by exercising rights under this License with respect to the covered
work, and you disclaim any intention to limit operation or modification of
- the work as a means of enforcing, against the work&rsquo;s users, your or
- third parties&rsquo; legal rights to forbid circumvention of technological
+ the work as a means of enforcing, against the work’s users, your or
+ third parties’ legal rights to forbid circumvention of technological
measures.
</para>
- <bridgehead id="ConveyingVerbatim" renderas="sect1">
+ <bridgehead xml:id="ConveyingVerbatim" renderas="sect1">
4. Conveying Verbatim Copies.
</bridgehead>
<para>
- You may convey verbatim copies of the Program&rsquo;s source code as you
+ You may convey verbatim copies of the Program’s source code as you
receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice; keep intact all
notices stating that this License and any non-permissive terms added in
@@ -256,7 +254,7 @@
You may charge any price or no price for each copy that you convey, and you
may offer support or warranty protection for a fee.
</para>
- <bridgehead id="ConveyingModified" renderas="sect1">
+ <bridgehead xml:id="ConveyingModified" renderas="sect1">
5. Conveying Modified Source Versions.
</bridgehead>
<para>
@@ -264,7 +262,7 @@
it from the Program, in the form of source code under the terms of section
4, provided that you also meet all of these conditions:
</para>
- <orderedlist numeration="loweralpha">
+ <orderedlist numeration="loweralpha" inheritnum="ignore" continuation="restarts">
<listitem>
<para>
The work must carry prominent notices stating that you modified it, and
@@ -275,8 +273,8 @@
<para>
The work must carry prominent notices stating that it is released under
this License and any conditions added under section 7. This requirement
- modifies the requirement in section 4 to &ldquo;keep intact all
- notices&rdquo;.
+ modifies the requirement in section 4 to “keep intact all
+ noticesâ€.
</para>
</listitem>
<listitem>
@@ -303,13 +301,13 @@
A compilation of a covered work with other separate and independent works,
which are not by their nature extensions of the covered work, and which are
not combined with it such as to form a larger program, in or on a volume of
- a storage or distribution medium, is called an &ldquo;aggregate&rdquo; if
+ a storage or distribution medium, is called an “aggregate†if
the compilation and its resulting copyright are not used to limit the access
- or legal rights of the compilation&rsquo;s users beyond what the individual works
+ or legal rights of the compilation’s users beyond what the individual works
permit. Inclusion of a covered work in an aggregate does not cause
this License to apply to the other parts of the aggregate.
</para>
- <bridgehead id="ConveyingNonSource" renderas="sect1">
+ <bridgehead xml:id="ConveyingNonSource" renderas="sect1">
6. Conveying Non-Source Forms.
</bridgehead>
<para>
@@ -317,7 +315,7 @@
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these ways:
</para>
- <orderedlist numeration="loweralpha">
+ <orderedlist numeration="loweralpha" inheritnum="ignore" continuation="restarts">
<listitem>
<para>
Convey the object code in, or embodied in, a physical product (including
@@ -379,13 +377,13 @@
conveying the object code work.
</para>
<para>
- A &ldquo;User Product&rdquo; is either (1) a &ldquo;consumer product&rdquo;,
+ A “User Product†is either (1) a “consumer productâ€,
which means any tangible personal property which is normally used for
personal, family, or household purposes, or (2) anything designed or sold
for incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of coverage.
- For a particular product received by a particular user, &ldquo;normally
- used&rdquo; refers to a typical or common use of that class of product,
+ For a particular product received by a particular user, “normally
+ used†refers to a typical or common use of that class of product,
regardless of the status of the particular user or of the way in which the
particular user actually uses, or expects or is expected to use, the
product. A product is a consumer product regardless of whether the product
@@ -393,7 +391,7 @@
uses represent the only significant mode of use of the product.
</para>
<para>
- &ldquo;Installation Information&rdquo; for a User Product means any methods,
+ “Installation Information†for a User Product means any methods,
procedures, authorization keys, or other information required to install and
execute modified versions of a covered work in that User Product from a
modified version of its Corresponding Source. The information must suffice
@@ -429,11 +427,11 @@
and must require no special password or key for unpacking, reading or
copying.
</para>
- <bridgehead id="AdditionalTerms" renderas="sect1">
+ <bridgehead xml:id="AdditionalTerms" renderas="sect1">
7. Additional Terms.
</bridgehead>
<para>
- &ldquo;Additional permissions&rdquo; are terms that supplement the terms of
+ “Additional permissions†are terms that supplement the terms of
this License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall be
treated as though they were included in this License, to the extent that
@@ -455,7 +453,7 @@
to a covered work, you may (if authorized by the copyright holders of that
material) supplement the terms of this License with terms:
</para>
- <orderedlist numeration="loweralpha">
+ <orderedlist numeration="loweralpha" inheritnum="ignore" continuation="restarts">
<listitem>
<para>
Disclaiming warranty or limiting liability differently from the terms
@@ -499,8 +497,8 @@
</listitem>
</orderedlist>
<para>
- All other non-permissive additional terms are considered &ldquo;further
- restrictions&rdquo; within the meaning of section 10. If the Program as
+ All other non-permissive additional terms are considered “further
+ restrictions†within the meaning of section 10. If the Program as
you received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further restriction,
you may remove that term. If a license document contains a further
@@ -520,7 +518,7 @@
of a separately written license, or stated as exceptions; the above
requirements apply either way.
</para>
- <bridgehead id="gpl-3-termination" renderas="sect1">
+ <bridgehead xml:id="gpl-3-termination" renderas="sect1">
8. Termination.
</bridgehead>
<para>
@@ -551,7 +549,7 @@
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
</para>
- <bridgehead id="AcceptanceNotRequired" renderas="sect1">
+ <bridgehead xml:id="AcceptanceNotRequired" renderas="sect1">
9. Acceptance Not Required for Having Copies.
</bridgehead>
<para>
@@ -564,7 +562,7 @@
Therefore, by modifying or propagating a covered work, you indicate your
acceptance of this License to do so.
</para>
- <bridgehead id="AutomaticDownstream" renderas="sect1">
+ <bridgehead xml:id="AutomaticDownstream" renderas="sect1">
10. Automatic Licensing of Downstream Recipients.
</bridgehead>
<para>
@@ -574,12 +572,12 @@
compliance by third parties with this License.
</para>
<para>
- An &ldquo;entity transaction&rdquo; is a transaction transferring control
+ An “entity transaction†is a transaction transferring control
of an organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered work
results from an entity transaction, each party to that transaction who
receives a copy of the work also receives whatever licenses to the work the
- party&rsquo;s predecessor in interest had or could give under the previous
+ party’s predecessor in interest had or could give under the previous
paragraph, plus a right to possession of the Corresponding Source of the
work from the predecessor in interest, if the predecessor has it or can get
it with reasonable efforts.
@@ -593,36 +591,36 @@
by making, using, selling, offering for sale, or importing the Program or
any portion of it.
</para>
- <bridgehead id="Patents" renderas="sect1">
+ <bridgehead xml:id="Patents" renderas="sect1">
11. Patents.
</bridgehead>
<para>
- A &ldquo;contributor&rdquo; is a copyright holder who authorizes use under
+ A “contributor†is a copyright holder who authorizes use under
this License of the Program or a work on which the Program is based. The
- work thus licensed is called the contributor&rsquo;s &ldquo;contributor
- version&rdquo;.
+ work thus licensed is called the contributor’s “contributor
+ versionâ€.
</para>
<para>
- A contributor&rsquo;s &ldquo;essential patent claims&rdquo; are all patent
+ A contributor’s “essential patent claims†are all patent
claims owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted by
this License, of making, using, or selling its contributor version, but do
not include claims that would be infringed only as a consequence of further
modification of the contributor version. For purposes of this definition,
- &ldquo;control&rdquo; includes the right to grant patent sublicenses in a
+ “control†includes the right to grant patent sublicenses in a
manner consistent with the requirements of this License.
</para>
<para>
Each contributor grants you a non-exclusive, worldwide, royalty-free patent
- license under the contributor&rsquo;s essential patent claims, to make, use,
+ license under the contributor’s essential patent claims, to make, use,
sell, offer for sale, import and otherwise run, modify and propagate the
contents of its contributor version.
</para>
<para>
- In the following three paragraphs, a &ldquo;patent license&rdquo; is any
+ In the following three paragraphs, a “patent license†is any
express agreement or commitment, however denominated, not to enforce a
patent (such as an express permission to practice a patent or covenant not
- to sue for patent infringement). To &ldquo;grant&rdquo; such a patent
+ to sue for patent infringement). To “grant†such a patent
license to a party means to make such an agreement or commitment not to
enforce a patent against the party.
</para>
@@ -634,10 +632,10 @@
cause the Corresponding Source to be so available, or (2) arrange to deprive
yourself of the benefit of the patent license for this particular work, or
(3) arrange, in a manner consistent with the requirements of this License,
- to extend the patent license to downstream recipients. &ldquo;Knowingly
- relying&rdquo; means you have actual knowledge that, but for the patent
+ to extend the patent license to downstream recipients. “Knowingly
+ relying†means you have actual knowledge that, but for the patent
license, your conveying the covered work in a country, or your
- recipient&rsquo;s use of the covered work in a country, would infringe one
+ recipient’s use of the covered work in a country, would infringe one
or more identifiable patents in that country that you have reason to believe
are valid.
</para>
@@ -650,7 +648,7 @@
all recipients of the covered work and works based on it.
</para>
<para>
- A patent license is &ldquo;discriminatory&rdquo; if it does not include
+ A patent license is “discriminatory†if it does not include
within the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered work
@@ -669,8 +667,8 @@
implied license or other defenses to infringement that may otherwise be
available to you under applicable patent law.
</para>
- <bridgehead id="NoSurrender" renderas="sect1">
- 12. No Surrender of Others&rsquo; Freedom.
+ <bridgehead xml:id="NoSurrender" renderas="sect1">
+ 12. No Surrender of Others’ Freedom.
</bridgehead>
<para>
If conditions are imposed on you (whether by court order, agreement or
@@ -683,7 +681,7 @@
Program, the only way you could satisfy both those terms and this License
would be to refrain entirely from conveying the Program.
</para>
- <bridgehead id="UsedWithAGPL" renderas="sect1">
+ <bridgehead xml:id="UsedWithAGPL" renderas="sect1">
13. Use with the <acronym>GNU</acronym> Affero General Public License.
</bridgehead>
<para>
@@ -696,7 +694,7 @@
section 13, concerning interaction through a network will apply to the
combination as such.
</para>
- <bridgehead id="RevisedVersions" renderas="sect1">
+ <bridgehead xml:id="RevisedVersions" renderas="sect1">
14. Revised Versions of this License.
</bridgehead>
<para>
@@ -708,7 +706,7 @@
<para>
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the <acronym>GNU</acronym>
- General Public License &ldquo;or any later version&rdquo; applies to it, you
+ General Public License “or any later version†applies to it, you
have the option of following the terms and conditions either of that
numbered version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
@@ -718,7 +716,7 @@
<para>
If the Program specifies that a proxy can decide which future versions of
the <acronym>GNU</acronym> General Public License can be used, that
- proxy&rsquo;s public statement of acceptance of a version permanently
+ proxy’s public statement of acceptance of a version permanently
authorizes you to choose that version for the Program.
</para>
<para>
@@ -726,20 +724,20 @@
However, no additional obligations are imposed on any author or copyright
holder as a result of your choosing to follow a later version.
</para>
- <bridgehead id="WarrantyDisclaimer" renderas="sect1">
+ <bridgehead xml:id="WarrantyDisclaimer" renderas="sect1">
15. Disclaimer of Warranty.
</bridgehead>
<para>
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
- OTHER PARTIES PROVIDE THE PROGRAM &ldquo;AS IS&rdquo; WITHOUT WARRANTY OF
+ OTHER PARTIES PROVIDE THE PROGRAM “AS IS†WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
</para>
- <bridgehead id="LiabilityLimitation" renderas="sect1">
+ <bridgehead xml:id="LiabilityLimitation" renderas="sect1">
16. Limitation of Liability.
</bridgehead>
<para>
@@ -753,7 +751,7 @@
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
</para>
- <bridgehead id="InterpretationSecs1516" renderas="sect1">
+ <bridgehead xml:id="InterpretationSecs1516" renderas="sect1">
17. Interpretation of Sections 15 and 16.
</bridgehead>
<para>
@@ -767,7 +765,7 @@
<bridgehead>
END OF TERMS AND CONDITIONS
</bridgehead>
- <bridgehead id="HowToApply" renderas="sect1">
+ <bridgehead xml:id="HowToApply" renderas="sect1">
How to Apply These Terms to Your New Programs
</bridgehead>
<para>
@@ -779,11 +777,11 @@
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively state the
exclusion of warranty; and each file should have at least the
- &ldquo;copyright&rdquo; line and a pointer to where the full notice is
+ “copyright†line and a pointer to where the full notice is
found.
</para>
<screen>
-<replaceable>one line to give the program&rsquo;s name and a brief idea of what it does.</replaceable>
+<replaceable>one line to give the program’s name and a brief idea of what it does.</replaceable>
Copyright (C) <replaceable>year</replaceable> <replaceable>name of author</replaceable>
This program is free software: you can redistribute it and/or modify
@@ -797,7 +795,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<acronym>GNU</acronym> General Public License for more details.
You should have received a copy of the <acronym>GNU</acronym> General Public License
-along with this program. If not, see <ulink url="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</ulink>.
+along with this program. If not, see <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</link>.
</screen>
<para>
Also add information on how to contact you by electronic and paper mail.
@@ -808,22 +806,22 @@ along with this program. If not, see <ulink url="http://www.gnu.org/licenses/">
</para>
<screen>
<replaceable>program</replaceable> Copyright (C) <replaceable>year</replaceable> <replaceable>name of author</replaceable>
-This program comes with ABSOLUTELY NO WARRANTY; for details type &lsquo;<literal>show w</literal>&rsquo;.
+This program comes with ABSOLUTELY NO WARRANTY; for details type ‘<literal>show w</literal>’.
This is free software, and you are welcome to redistribute it
-under certain conditions; type &lsquo;<literal>show c</literal>&rsquo; for details.
+under certain conditions; type ‘<literal>show c</literal>’ for details.
</screen>
<para>
- The hypothetical commands &lsquo;<literal>show w</literal>&rsquo; and
- &lsquo;<literal>show c</literal>&rsquo; should show the appropriate parts of
- the General Public License. Of course, your program&rsquo;s commands might be
- different; for a GUI interface, you would use an &ldquo;about box&rdquo;.
+ The hypothetical commands ‘<literal>show w</literal>’ and
+ ‘<literal>show c</literal>’ should show the appropriate parts of
+ the General Public License. Of course, your program’s commands might be
+ different; for a GUI interface, you would use an “about boxâ€.
</para>
<para>
You should also get your employer (if you work as a programmer) or school,
- if any, to sign a &ldquo;copyright disclaimer&rdquo; for the program, if
+ if any, to sign a “copyright disclaimer†for the program, if
necessary. For more information on this, and how to apply and follow the
<acronym>GNU</acronym> <acronym>GPL</acronym>, see
- <ulink url="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</link>.
</para>
<para>
The <acronym>GNU</acronym> General Public License does not permit
@@ -831,7 +829,6 @@ under certain conditions; type &lsquo;<literal>show c</literal>&rsquo; for detai
subroutine library, you may consider it more useful to permit linking
proprietary applications with the library. If this is what you want to do,
use the <acronym>GNU</acronym> Lesser General Public License instead of this
- License. But first, please read <ulink
- url="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</ulink>.
+ License. But first, please read <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</link>.
</para>
</appendix>
diff --git a/libstdc++-v3/doc/xml/manual/abi.xml b/libstdc++-v3/doc/xml/manual/abi.xml
index 8777bc72e6d..268f0a69199 100644
--- a/libstdc++-v3/doc/xml/manual/abi.xml
+++ b/libstdc++-v3/doc/xml/manual/abi.xml
@@ -1,7 +1,8 @@
-<sect1 id="appendix.porting.abi" xreflabel="abi">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.porting.abi" xreflabel="abi">
<?dbhtml filename="abi.html"?>
-<sect1info>
+<info><title>ABI Policy and Guidelines</title>
<keywordset>
<keyword>
C++
@@ -22,20 +23,20 @@
compatibility
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>ABI Policy and Guidelines</title>
<para>
</para>
-<sect2 id="abi.cxx_interface">
-<title>The C++ Interface</title>
+<section xml:id="abi.cxx_interface"><info><title>The C++ Interface</title></info>
+
<para>
- C++ applications often dependent on specific language support
+ C++ applications often depend on specific language support
routines, say for throwing exceptions, or catching exceptions, and
- perhaps also dependent on features in the C++ Standard Library.
+ perhaps also depend on features in the C++ Standard Library.
</para>
<para>
@@ -53,9 +54,8 @@
virtual functions, etc. These details are defined as the compiler
Application Binary Interface, or ABI. The GNU C++ compiler uses an
industry-standard C++ ABI starting with version 3. Details can be
- found in the <ulink
- url="http://www.codesourcery.com/cxx-abi/abi.html"> ABI
- specification</ulink>.
+ found in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.codesourcery.com/cxx-abi/abi.html"> ABI
+ specification</link>.
</para>
<para>
@@ -65,8 +65,8 @@
g++ command line options may change the ABI as a side-effect of
use. Such flags include <code>-fpack-struct</code> and
<code>-fno-exceptions</code>, but include others: see the complete
- list in the GCC manual under the heading <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code%20Gen%20Options">Options
- for Code Generation Conventions</ulink>.
+ list in the GCC manual under the heading <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code%20Gen%20Options">Options
+ for Code Generation Conventions</link>.
</para>
<para>
@@ -105,24 +105,24 @@ given compiler ABI. In a nutshell:
implements the C++ ABI in question.
</para>
-</sect2>
+</section>
+
+<section xml:id="abi.versioning"><info><title>Versioning</title></info>
-<sect2 id="abi.versioning">
-<title>Versioning</title>
<para> The C++ interface has evolved throughout the history of the GNU
C++ toolchain. With each release, various details have been changed so
as to give distinct versions to the C++ interface.
</para>
- <sect3 id="abi.versioning.goals">
- <title>Goals</title>
+ <section xml:id="abi.versioning.goals"><info><title>Goals</title></info>
+
<para>Extending existing, stable ABIs. Versioning gives subsequent
releases of library binaries the ability to add new symbols and add
functionality, all the while retaining compatibility with the previous
releases in the series. Thus, program binaries linked with the initial
-release of a library binary will still link correctly if the library
+release of a library binary will still run correctly if the library
binary is replaced by carefully-managed subsequent library
binaries. This is called forward compatibility.
</para>
@@ -136,10 +136,10 @@ compatible.
<para>Allows multiple, incompatible ABIs to coexist at the same time.
</para>
- </sect3>
+ </section>
- <sect3 id="abi.versioning.history">
- <title>History</title>
+ <section xml:id="abi.versioning.history"><info><title>History</title></info>
+
<para>
How can this complexity be managed? What does C++ versioning mean?
@@ -232,7 +232,7 @@ compatible.
<listitem>
<para>
Release versioning on the libstdc++.so binary, implemented in
- the same was as the libgcc_s.so binary above. Listed is the
+ the same way as the libgcc_s.so binary above. Listed is the
filename: <constant>DT_SONAME</constant> can be deduced from
the filename by removing the last two period-delimited numbers. For
example, filename <filename>libstdc++.so.5.0.4</filename>
@@ -298,18 +298,17 @@ compatible.
</para>
<para>
Note 3: This release (but not previous or subsequent) has one
- known incompatibility, see <ulink
- url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33678">33678</ulink>
+ known incompatibility, see <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33678">33678</link>
in the GCC bug database.
</para>
</listitem>
<listitem><para>Symbol versioning on the libstdc++.so binary.</para>
- <para>mapfile: libstdc++/config/linker-map.gnu</para>
+ <para>mapfile: libstdc++-v3/config/abi/pre/gnu.ver</para>
<para>It is versioned with the following labels and version
definitions, where the version definition is the maximum for a
- particular release. Note, only symbol which are newly introduced
+ particular release. Note, only symbols which are newly introduced
will use the maximum version definition. Thus, for release series
with the same label, but incremented version definitions, the later
release has both versions. (An example of this would be the
@@ -379,7 +378,7 @@ compatible.
<listitem><para>gcc-3.4.x, gcc-4.[0-5].x: 1000 + n (when n&gt;1) </para></listitem>
<listitem><para>gcc-3.4.x, gcc-4.[0-5].x: 999999 (when n=0)</para></listitem>
</itemizedlist>
- <para></para>
+ <para/>
</listitem>
<listitem>
@@ -396,7 +395,7 @@ compatible.
<listitem><para>gcc-3.3.x: <code>-fabi-version=1</code></para></listitem>
<listitem><para>gcc-3.4.x, gcc-4.[0-5].x: <code>-fabi-version=2</code> <emphasis>(Incompatible with previous)</emphasis></para></listitem>
</itemizedlist>
- <para></para>
+ <para/>
</listitem>
<listitem>
@@ -410,7 +409,7 @@ compatible.
<para>
This macro is defined in the file "c++config" in the
- "libstdc++/include/bits" directory. (Up to gcc-4.1.0, it was
+ "libstdc++-v3/include/bits" directory. (Up to gcc-4.1.0, it was
changed every night by an automated script. Since gcc-4.1.0, it is
the same value as gcc/DATESTAMP.)
</para>
@@ -460,7 +459,7 @@ compatible.
<listitem><para>gcc-4.4.1: 20090722</para></listitem>
<listitem><para>gcc-4.4.2: 20091015</para></listitem>
</itemizedlist>
- <para></para>
+ <para/>
</listitem>
<listitem>
@@ -474,7 +473,7 @@ compatible.
<para>
This macro is defined in the file "c++config" in the
- "libstdc++/include/bits" directory and is generated
+ "libstdc++-v3/include/bits" directory and is generated
automatically by autoconf as part of the configure-time generation
of config.h.
</para>
@@ -501,7 +500,7 @@ compatible.
<listitem><para>gcc-3.4.x: "version-unused"</para></listitem>
<listitem><para>gcc-4.[0-5].x: "version-unused"</para></listitem>
</itemizedlist>
- <para></para>
+ <para/>
</listitem>
<listitem>
@@ -514,7 +513,7 @@ compatible.
All C++ includes are installed in include/c++, then nest in a
directory hierarchy corresponding to the C++ compiler's released
version. This version corresponds to the variable "gcc_version" in
- "libstdc++/acinclude.m4," and more details can be found in that
+ "libstdc++-v3/acinclude.m4," and more details can be found in that
file's macro GLIBCXX_CONFIGURE (GLIBCPP_CONFIGURE before gcc-3.4.0).
</para>
<para>
@@ -564,7 +563,7 @@ compatible.
<listitem><para>gcc-4.4.2: include/c++/4.4.2</para></listitem>
<listitem><para>gcc-4.5.0: include/c++/4.5.0</para></listitem>
</itemizedlist>
- <para></para>
+ <para/>
</listitem>
</orderedlist>
@@ -577,14 +576,15 @@ compatible.
</para>
- </sect3>
+ </section>
- <sect3 id="abi.versioning.prereq">
- <title>Prerequisites</title>
+ <section xml:id="abi.versioning.prereq"><info><title>Prerequisites</title></info>
+
<para>
Minimum environment that supports a versioned ABI: A supported
dynamic linker, a GNU linker of sufficient vintage to understand
- demangled C++ name globbing (ld), a shared executable compiled
+ demangled C++ name globbing (ld) or the Sun linker, a shared
+ executable compiled
with g++, and shared libraries (libgcc_s, libstdc++) compiled by
a compiler (g++) with a compatible ABI. Phew.
</para>
@@ -598,12 +598,12 @@ compatible.
<para>
Most modern Linux and BSD versions, particularly ones using
gcc-3.1.x tools and more recent vintages, will meet the
- requirements above.
+ requirements above, as does Solaris 2.5 and up.
</para>
- </sect3>
+ </section>
- <sect3 id="abi.versioning.config">
- <title>Configuring</title>
+ <section xml:id="abi.versioning.config"><info><title>Configuring</title></info>
+
<para>
It turns out that most of the configure options that change
@@ -614,7 +614,7 @@ compatible.
<para>
For more information on configure options, including ABI
impacts, see:
- http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html
+ <link linkend="manual.intro.setup.configure">here</link>
</para>
<para>
@@ -623,17 +623,17 @@ compatible.
</para>
<para>
- In particular, libstdc++/acinclude.m4 has a macro called
+ In particular, libstdc++-v3/acinclude.m4 has a macro called
GLIBCXX_ENABLE_SYMVERS that defaults to yes (or the argument
passed in via --enable-symvers=foo). At that point, the macro
attempts to make sure that all the requirement for symbol
versioning are in place. For more information, please consult
acinclude.m4.
</para>
- </sect3>
+ </section>
- <sect3 id="abi.versioning.active">
- <title>Checking Active</title>
+ <section xml:id="abi.versioning.active"><info><title>Checking Active</title></info>
+
<para>
When the GNU C++ library is being built with symbol versioning
@@ -648,6 +648,7 @@ compatible.
</screen>
<para>
+ or another of the supported styles.
If you don't see this line in the configure output, or if this line
appears but the last word is 'no', then you are out of luck.
</para>
@@ -685,11 +686,28 @@ of the name, then the executable is versioned. Here's an example:
<code>U _ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4</code>
</para>
- </sect3>
-</sect2>
+<para>
+On Solaris 2, you can use <code>pvs -r</code> instead:
+</para>
+
+<programlisting>
+%g++ hello.cc -o hello.out
+
+%pvs -r hello.out
+ libstdc++.so.6 (GLIBCXX_3.4, GLIBCXX_3.4.12);
+ libgcc_s.so.1 (GCC_3.0);
+ libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
+</programlisting>
+
+<para>
+<code>ldd -v</code> works too, but is very verbose.
+</para>
+
+ </section>
+</section>
+
+<section xml:id="abi.changes_allowed"><info><title>Allowed Changes</title></info>
-<sect2 id="abi.changes_allowed">
-<title>Allowed Changes</title>
<para>
The following will cause the library minor version number to
@@ -704,10 +722,10 @@ increase, say from "libstdc++.so.3.0.4" to "libstdc++.so.3.0.5".
Other allowed changes are possible.
</para>
-</sect2>
+</section>
+
+<section xml:id="abi.changes_no"><info><title>Prohibited Changes</title></info>
-<sect2 id="abi.changes_no">
-<title>Prohibited Changes</title>
<para>
The following non-exhaustive list will cause the library major version
@@ -735,19 +753,19 @@ number to increase, say from "libstdc++.so.3.0.4" to
<listitem><para> Adding an explicit copy constructor or destructor to a
class that would otherwise have implicit versions. This will change
the way the compiler deals with this class in by-value return
-statements or parameters: instead of being passing instances of this
-class in registers, the compiler will be forced to use memory. See <ulink url="http://www.codesourcery.com/cxx-abi/abi.html#calls"> this part</ulink>
+statements or parameters: instead of passing instances of this
+class in registers, the compiler will be forced to use memory. See <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.codesourcery.com/cxx-abi/abi.html#calls"> this part</link>
of the C++ ABI documentation for further details.
</para></listitem>
</orderedlist>
-</sect2>
+</section>
-<sect2 id="abi.impl">
-<title>Implementation</title>
+<section xml:id="abi.impl"><info><title>Implementation</title></info>
+
<orderedlist>
<listitem>
@@ -861,13 +879,13 @@ standard includes.</para>
</listitem>
</orderedlist>
-</sect2>
+</section>
+
+<section xml:id="abi.testing"><info><title>Testing</title></info>
-<sect2 id="abi.testing">
-<title>Testing</title>
- <sect3 id="abi.testing.single">
- <title>Single ABI Testing</title>
+ <section xml:id="abi.testing.single"><info><title>Single ABI Testing</title></info>
+
<para>
Testing for GNU C++ ABI changes is composed of two distinct
@@ -920,7 +938,7 @@ Use the 'make check-abi' rule in the libstdc++ Makefile.
</para>
<para>
-This is a proactive check the library ABI. Currently, exported symbol
+This is a proactive check of the library ABI. Currently, exported symbol
names that are either weak or defined are checked against a last known
good baseline. Currently, this baseline is keyed off of 3.4.0
binaries, as this was the last time the .so number was incremented. In
@@ -955,7 +973,7 @@ Another approach might be to use the -fdump-class-hierarchy flag to
get information. However, currently this approach gives insufficient
data for use in library testing, as class data members, their offsets,
and other detailed data is not displayed with this flag.
-(See g++/7470 on how this was used to find bugs.)
+(See PR g++/7470 on how this was used to find bugs.)
</para>
<para>
@@ -963,12 +981,12 @@ Perhaps there are other C++ ABI checkers. If so, please notify
us. We'd like to know about them!
</para>
- </sect3>
- <sect3 id="abi.testing.multi">
- <title>Multiple ABI Testing</title>
+ </section>
+ <section xml:id="abi.testing.multi"><info><title>Multiple ABI Testing</title></info>
+
<para>
A "C" application, dynamically linked to two shared libraries, liba,
-libb. The dependent library liba is C++ shared library compiled with
+libb. The dependent library liba is a C++ shared library compiled with
gcc-3.3.x, and uses io, exceptions, locale, etc. The dependent library
libb is a C++ shared library compiled with gcc-3.4.x, and also uses io,
exceptions, locale, etc.
@@ -1050,11 +1068,11 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
code from both liba, and the dependent libstdc++.so.6, and libb,
with the dependent libstdc++.so.5.
</para>
- </sect3>
-</sect2>
+ </section>
+</section>
+
+<section xml:id="abi.issues"><info><title>Outstanding Issues</title></info>
-<sect2 id="abi.issues">
-<title>Outstanding Issues</title>
<para>
Some features in the C++ language make versioning especially
@@ -1070,149 +1088,119 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
</para>
<para>
-<ulink url="http://gcc.gnu.org/PR24660">24660: versioning weak symbols in libstdc++</ulink>
+<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/PR24660">24660: versioning weak symbols in libstdc++</link>
</para>
<para>
-<ulink url="http://gcc.gnu.org/PR19664">19664: libstdc++ headers should have pop/push of the visibility around the declarations</ulink>
+<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/PR19664">19664: libstdc++ headers should have pop/push of the visibility around the declarations</link>
</para>
-</sect2>
+</section>
+
+<bibliography xml:id="abi.biblio"><info><title>Bibliography</title></info>
-<bibliography id="abi.biblio">
-<title>Bibliography</title>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://abicheck.sourceforge.net/">
- <citetitle>
- ABIcheck, a vague idea of checking ABI compatibility
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://abicheck.sourceforge.net/" class="uri">
+ </biblioid>
+ <citetitle>
+ ABIcheck, a vague idea of checking ABI compatibility
+ </citetitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.codesourcery.com/public/cxx-abi/">
- <citetitle>
- C++ ABI Reference
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.codesourcery.com/public/cxx-abi/" class="uri">
</biblioid>
+ <citetitle>
+ C++ ABI Reference
+ </citetitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm">
- <citetitle>
- Intel Compilers for Linux Compatibility with the GNU Compilers
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" class="uri">
+ </biblioid>
+ <citetitle>
+ Intel Compilers for Linux Compatibility with the GNU Compilers
+ </citetitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://docs.sun.com/app/docs/doc/817-1984">
- <citetitle>
- Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://docs.sun.com/app/docs/doc/819-0690" class="uri">
+ </biblioid>
+ <citetitle>
+ Linker and Libraries Guide (document 819-0690)
+ </citetitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://docs.sun.com/app/docs/doc/819-5266">
- <citetitle>
- Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://docs.sun.com/app/docs/doc/819-3689" class="uri">
</biblioid>
+ <citetitle>
+ Sun Studio 11: C++ Migration Guide (document 819-3689)
+ </citetitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://people.redhat.com/drepper/dsohowto.pdf">
- <citetitle>
- How to Write Shared Libraries
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://people.redhat.com/drepper/dsohowto.pdf" class="uri">
</biblioid>
+ <citetitle>
+ How to Write Shared Libraries
+ </citetitle>
<author>
- <firstname>Ulrich</firstname>
- <surname>Drepper</surname>
+ <personname>
+ <firstname>Ulrich</firstname><surname>Drepper</surname>
+ </personname>
</author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.arm.com/miscPDFs/8033.pdf">
- <citetitle>
- C++ ABI for the ARM Architecture
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.arm.com/miscPDFs/8033.pdf" class="uri">
</biblioid>
+ <citetitle>
+ C++ ABI for the ARM Architecture
+ </citetitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html">
- <citetitle>
- Dynamic Shared Objects: Survey and Issues
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" class="uri">
</biblioid>
+ <citetitle>
+ Dynamic Shared Objects: Survey and Issues
+ </citetitle>
<subtitle>
ISO C++ J16/06-0046
</subtitle>
- <author>
- <firstname>Benjamin</firstname>
- <surname>Kosnik</surname>
- </author>
+ <author><personname><firstname>Benjamin</firstname><surname>Kosnik</surname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html">
- <citetitle>
- Versioning With Namespaces
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" class="uri">
+ </biblioid>
+ <citetitle>
+ Versioning With Namespaces
+ </citetitle>
<subtitle>
ISO C++ J16/06-0083
</subtitle>
- <author>
- <firstname>Benjamin</firstname>
- <surname>Kosnik</surname>
- </author>
+ <author><personname><firstname>Benjamin</firstname><surname>Kosnik</surname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf">
- <citetitle>
- Binary Compatibility of Shared Libraries Implemented in C++
- on GNU/Linux Systems
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf" class="uri">
</biblioid>
+ <citetitle>
+ Binary Compatibility of Shared Libraries Implemented in C++
+ on GNU/Linux Systems
+ </citetitle>
+
<subtitle>
SYRCoSE 2009
</subtitle>
- <author>
- <firstname>Pavel</firstname>
- <surname>Shved</surname>
- </author>
- <author>
- <firstname>Denis</firstname>
- <surname>Silakov</surname>
- </author>
+ <author><personname><firstname>Pavel</firstname><surname>Shved</surname></personname></author>
+ <author><personname><firstname>Denis</firstname><surname>Silakov</surname></personname></author>
</biblioentry>
</bibliography>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/algorithms.xml b/libstdc++-v3/doc/xml/manual/algorithms.xml
index 008fd0286ed..831fe5fe602 100644
--- a/libstdc++-v3/doc/xml/manual/algorithms.xml
+++ b/libstdc++-v3/doc/xml/manual/algorithms.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.algorithms" xreflabel="Algorithms">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.algorithms" xreflabel="Algorithms">
<?dbhtml filename="algorithms.html"?>
-<chapterinfo>
+<info><title>
+ Algorithms
+ <indexterm><primary>Algorithms</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -18,19 +17,16 @@
algorithm
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Algorithms
- <indexterm><primary>Algorithms</primary></indexterm>
-</title>
<para>
The neatest accomplishment of the algorithms sect1 is that all the
work is done via iterators, not containers directly. This means two
important things:
</para>
-<orderedlist>
+<orderedlist inheritnum="ignore" continuation="restarts">
<listitem>
<para>
Anything that behaves like an iterator can be used in one of
@@ -63,7 +59,7 @@
<para>
The single thing that trips people up the most is the definition
of <emphasis>range</emphasis> used with iterators; the famous
- &quot;past-the-end&quot; rule that everybody loves to hate. The
+ "past-the-end" rule that everybody loves to hate. The
<link linkend="std.iterators">iterators sect1</link> of this
document has a complete explanation of this simple rule that seems
to cause so much confusion. Once you
@@ -74,14 +70,14 @@
<!-- Sect1 01 : Non Modifying -->
<!-- Sect1 02 : Mutating -->
-<sect1 id="std.algorithms.mutating" xreflabel="Mutating">
- <title>Mutating</title>
+<section xml:id="std.algorithms.mutating" xreflabel="Mutating"><info><title>Mutating</title></info>
+
- <sect2 id="algorithms.mutating.swap" xreflabel="swap">
- <title><function>swap</function></title>
+ <section xml:id="algorithms.mutating.swap" xreflabel="swap"><info><title><function>swap</function></title></info>
+
- <sect3 id="algorithms.swap.specializations" xreflabel="Specializations">
- <title>Specializations</title>
+ <section xml:id="algorithms.swap.specializations" xreflabel="Specializations"><info><title>Specializations</title></info>
+
<para>If you call <code> std::swap(x,y); </code> where x and y are standard
containers, then the call will automatically be replaced by a call to
@@ -89,16 +85,16 @@
</para>
<para>This allows member functions of each container class to take over, and
containers' swap functions should have O(1) complexity according to
- the standard. (And while &quot;should&quot; allows implementations to
+ the standard. (And while "should" allows implementations to
behave otherwise and remain compliant, this implementation does in
fact use constant-time swaps.) This should not be surprising, since
for two containers of the same type to swap contents, only some
internal pointers to storage need to be exchanged.
</para>
- </sect3>
- </sect2>
-</sect1>
+ </section>
+ </section>
+</section>
<!-- Sect1 03 : Sorting -->
diff --git a/libstdc++-v3/doc/xml/manual/allocator.xml b/libstdc++-v3/doc/xml/manual/allocator.xml
index ca1c8cb8609..b73554eb90e 100644
--- a/libstdc++-v3/doc/xml/manual/allocator.xml
+++ b/libstdc++-v3/doc/xml/manual/allocator.xml
@@ -1,7 +1,8 @@
-<section id="std.util.memory.allocator" xreflabel="Allocator">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.util.memory.allocator" xreflabel="Allocator">
<?dbhtml filename="allocator.html"?>
-<sectioninfo>
+<info><title>Allocators</title>
<keywordset>
<keyword>
ISO C++
@@ -10,9 +11,9 @@
allocator
</keyword>
</keywordset>
-</sectioninfo>
+</info>
+
-<title>Allocators</title>
<para>
Memory management for Standard Library entities is encapsulated in a
@@ -24,8 +25,8 @@
management classes.
</para>
-<section id="allocator.req">
-<title>Requirements</title>
+<section xml:id="allocator.req"><info><title>Requirements</title></info>
+
<para>
The C++ standard only gives a few directives in this area:
@@ -87,15 +88,14 @@
</section>
-<section id="allocator.design_issues">
-<title>Design Issues</title>
+<section xml:id="allocator.design_issues"><info><title>Design Issues</title></info>
+
<para>
The easiest way of fulfilling the requirements is to call
<function>operator new</function> each time a container needs
memory, and to call <function>operator delete</function> each time
- the container releases memory. This method may be <ulink
- url="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00105.html">slower</ulink>
+ the container releases memory. This method may be <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00105.html">slower</link>
than caching the allocations and re-using previously-allocated
memory, but has the advantage of working correctly across a wide
variety of hardware and operating systems, including large
@@ -138,11 +138,11 @@
</section>
-<section id="allocator.impl">
-<title>Implementation</title>
+<section xml:id="allocator.impl"><info><title>Implementation</title></info>
- <section>
- <title>Interface Design</title>
+
+ <section><info><title>Interface Design</title></info>
+
<para>
The only allocator interface that
@@ -165,8 +165,8 @@
</section>
- <section>
- <title>Selecting Default Allocation Policy</title>
+ <section><info><title>Selecting Default Allocation Policy</title></info>
+
<para>
It's difficult to pick an allocation strategy that will provide
@@ -189,8 +189,8 @@
Over multiple iterations, various STL container
objects have elements inserted to some maximum amount. A variety
of allocators are tested.
- Test source for <ulink url="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/sequence.cc?view=markup">sequence</ulink>
- and <ulink url="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/associative.cc?view=markup">associative</ulink>
+ Test source for <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/sequence.cc?view=markup">sequence</link>
+ and <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/associative.cc?view=markup">associative</link>
containers.
</para>
@@ -205,7 +205,7 @@
on a per-thread basis, as well as measuring thread contention
for memory resources.
Test source
- <ulink url="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert_erase/associative.cc?view=markup">here</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert_erase/associative.cc?view=markup">here</link>.
</para>
</listitem>
@@ -215,9 +215,9 @@
</para>
<para>
Test source for
- <ulink url="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc?view=markup">sequence</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc?view=markup">sequence</link>
and
- <ulink url="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc?view=markup">associative</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc?view=markup">associative</link>
containers.
</para>
</listitem>
@@ -231,8 +231,8 @@
</section>
- <section>
- <title>Disabling Memory Caching</title>
+ <section><info><title>Disabling Memory Caching</title></info>
+
<para>
In use, <classname>allocator</classname> may allocate and
@@ -285,8 +285,8 @@
</section>
-<section id="allocator.using">
-<title>Using a Specific Allocator</title>
+<section xml:id="allocator.using"><info><title>Using a Specific Allocator</title></info>
+
<para>
You can specify different memory management schemes on a
@@ -305,8 +305,8 @@
</programlisting>
</section>
-<section id="allocator.custom">
-<title>Custom Allocators</title>
+<section xml:id="allocator.custom"><info><title>Custom Allocators</title></info>
+
<para>
Writing a portable C++ allocator would dictate that the interface
@@ -323,8 +323,8 @@
</section>
-<section id="allocator.ext">
-<title>Extension Allocators</title>
+<section xml:id="allocator.ext"><info><title>Extension Allocators</title></info>
+
<para>
Several other allocators are provided as part of this
@@ -472,8 +472,7 @@
<para>
A high-performance fixed-size allocator with
exponentially-increasing allocations. It has its own
- documentation, found <link
- linkend="manual.ext.allocator.mt">here</link>.
+ documentation, found <link linkend="manual.ext.allocator.mt">here</link>.
</para>
</listitem>
@@ -484,21 +483,20 @@
<para>
A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own
- documentation, found <link
- linkend="manual.ext.allocator.bitmap">here</link>.
+ documentation, found <link linkend="manual.ext.allocator.bitmap">here</link>.
</para>
</listitem>
</orderedlist>
</section>
-<bibliography id="allocator.biblio">
-<title>Bibliography</title>
+<bibliography xml:id="allocator.biblio"><info><title>Bibliography</title></info>
+
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 14882:1998 Programming languages - C++
- </title>
+ </citetitle>
<abbrev>
isoc++_1998
</abbrev>
@@ -506,17 +504,13 @@
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.drdobbs.com/cpp/184403759">
- <citetitle>
- The Standard Librarian: What Are Allocators Good For?
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.drdobbs.com/cpp/184403759" class="uri">
</biblioid>
- <author>
- <firstname>Matt</firstname>
- <surname>Austern</surname>
- </author>
+ <citetitle>
+ The Standard Librarian: What Are Allocators Good For?
+ </citetitle>
+
+ <author><personname><firstname>Matt</firstname><surname>Austern</surname></personname></author>
<publisher>
<publishername>
C/C++ Users Journal
@@ -525,39 +519,25 @@
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.cs.umass.edu/~emery/hoard/">
- <citetitle>
- The Hoard Memory Allocator
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.cs.umass.edu/~emery/hoard/" class="uri">
</biblioid>
- <author>
- <firstname>Emery</firstname>
- <surname>Berger</surname>
- </author>
+ <citetitle>
+ The Hoard Memory Allocator
+ </citetitle>
+
+ <author><personname><firstname>Emery</firstname><surname>Berger</surname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf">
- <citetitle>
- Reconsidering Custom Memory Allocation
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" class="uri">
</biblioid>
- <author>
- <firstname>Emery</firstname>
- <surname>Berger</surname>
- </author>
- <author>
- <firstname>Ben</firstname>
- <surname>Zorn</surname>
- </author>
- <author>
- <firstname>Kathryn</firstname>
- <surname>McKinley</surname>
- </author>
+ <citetitle>
+ Reconsidering Custom Memory Allocation
+ </citetitle>
+
+ <author><personname><firstname>Emery</firstname><surname>Berger</surname></personname></author>
+ <author><personname><firstname>Ben</firstname><surname>Zorn</surname></personname></author>
+ <author><personname><firstname>Kathryn</firstname><surname>McKinley</surname></personname></author>
<copyright>
<year>2002</year>
<holder>OOPSLA</holder>
@@ -566,21 +546,14 @@
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html">
- <citetitle>
- Allocator Types
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html" class="uri">
</biblioid>
- <author>
- <firstname>Klaus</firstname>
- <surname>Kreft</surname>
- </author>
- <author>
- <firstname>Angelika</firstname>
- <surname>Langer</surname>
- </author>
+ <citetitle>
+ Allocator Types
+ </citetitle>
+
+ <author><personname><firstname>Klaus</firstname><surname>Kreft</surname></personname></author>
+ <author><personname><firstname>Angelika</firstname><surname>Langer</surname></personname></author>
<publisher>
<publishername>
C/C++ Users Journal
@@ -589,14 +562,11 @@
</biblioentry>
<biblioentry>
- <title>The C++ Programming Language</title>
- <author>
- <firstname>Bjarne</firstname>
- <surname>Stroustrup</surname>
- </author>
+ <citetitle>The C++ Programming Language</citetitle>
+ <author><personname><firstname>Bjarne</firstname><surname>Stroustrup</surname></personname></author>
<copyright>
<year>2000</year>
- <holder></holder>
+ <holder/>
</copyright>
<pagenums>19.4 Allocators</pagenums>
<publisher>
@@ -607,11 +577,8 @@
</biblioentry>
<biblioentry>
- <title>Yalloc: A Recycling C++ Allocator</title>
- <author>
- <firstname>Felix</firstname>
- <surname>Yen</surname>
- </author>
+ <citetitle>Yalloc: A Recycling C++ Allocator</citetitle>
+ <author><personname><firstname>Felix</firstname><surname>Yen</surname></personname></author>
</biblioentry>
</bibliography>
diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
index b73b8f4c3fb..7dfe8e0ddf4 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
@@ -1,12 +1,14 @@
-<?xml version='1.0'?>
-<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<appendix id="appendix.contrib" xreflabel="Contributing">
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.contrib" xreflabel="Contributing">
<?dbhtml filename="appendix_contributing.html"?>
-<appendixinfo>
+<info><title>
+ Contributing
+ <indexterm>
+ <primary>Appendix</primary>
+ <secondary>Contributing</secondary>
+ </indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,15 +17,9 @@
library
</keyword>
</keywordset>
-</appendixinfo>
+</info>
+
-<title>
- Contributing
- <indexterm>
- <primary>Appendix</primary>
- <secondary>Contributing</secondary>
- </indexterm>
-</title>
<para>
The GNU C++ Library follows an open development model. Active
@@ -32,11 +28,11 @@
should follow this procedure:
</para>
-<sect1 id="contrib.list" xreflabel="Contributor Checklist">
- <title>Contributor Checklist</title>
+<section xml:id="contrib.list" xreflabel="Contributor Checklist"><info><title>Contributor Checklist</title></info>
+
- <sect2 id="list.reading">
- <title>Reading</title>
+ <section xml:id="list.reading"><info><title>Reading</title></info>
+
<itemizedlist>
<listitem>
@@ -50,9 +46,9 @@
the standard from their respective national standards
organization. In the USA, this national standards
organization is ANSI and their web-site is right
- <ulink url="http://www.ansi.org">here.</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.ansi.org">here.</link>
(And if you've already registered with them, clicking this link will take you to directly to the place where you can
- <ulink url="http://webstore.ansi.org/RecordDetail.aspx?sku=ISO%2FIEC+14882:2003">buy the standard on-line</ulink>.)
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://webstore.ansi.org/RecordDetail.aspx?sku=ISO%2FIEC+14882:2003">buy the standard on-line</link>.)
</para>
</listitem>
@@ -60,7 +56,7 @@
<para>
The library working group bugs, and known defects, can
be obtained here:
- <ulink url="http://www.open-std.org/jtc1/sc22/wg21/">http://www.open-std.org/jtc1/sc22/wg21 </ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/">http://www.open-std.org/jtc1/sc22/wg21 </link>
</para>
</listitem>
@@ -69,16 +65,16 @@
The newsgroup dedicated to standardization issues is
comp.std.c++: this FAQ for this group is quite useful and
can be
- found <ulink url="http://www.comeaucomputing.com/csc/faq.html">
- here </ulink>.
+ found <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.comeaucomputing.com/csc/faq.html">
+ here </link>.
</para>
</listitem>
<listitem>
<para>
Peruse
- the <ulink url="http://www.gnu.org/prep/standards">GNU
- Coding Standards</ulink>, and chuckle when you hit the part
+ the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/prep/standards">GNU
+ Coding Standards</link>, and chuckle when you hit the part
about <quote>Using Languages Other Than C</quote>.
</para>
</listitem>
@@ -100,9 +96,9 @@
</listitem>
</itemizedlist>
- </sect2>
- <sect2 id="list.copyright">
- <title>Assignment</title>
+ </section>
+ <section xml:id="list.copyright"><info><title>Assignment</title></info>
+
<para>
Small changes can be accepted without a copyright assignment form on
file. New code and additions to the library need completed copyright
@@ -129,8 +125,8 @@
<para>
For more information about getting a copyright assignment, please see
- <ulink url="http://www.gnu.org/prep/maintain/html_node/Legal-Matters.html">Legal
- Matters</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/prep/maintain/html_node/Legal-Matters.html">Legal
+ Matters</link>.
</para>
<para>
@@ -141,18 +137,18 @@
<email>mailto:assign@gnu.org</email>, please cc the libstdc++
maintainer above so that progress can be monitored.
</para>
- </sect2>
+ </section>
- <sect2 id="list.getting">
- <title>Getting Sources</title>
+ <section xml:id="list.getting"><info><title>Getting Sources</title></info>
+
<para>
- <ulink url="http://gcc.gnu.org/svnwrite.html">Getting write access
- (look for &quot;Write after approval&quot;)</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/svnwrite.html">Getting write access
+ (look for "Write after approval")</link>
</para>
- </sect2>
+ </section>
- <sect2 id="list.patches">
- <title>Submitting Patches</title>
+ <section xml:id="list.patches"><info><title>Submitting Patches</title></info>
+
<para>
Every patch must have several pieces of information before it can be
@@ -195,8 +191,8 @@
else, use <command>diff -cp OLD NEW</command> ... If your
version of diff does not support these options, then get the
latest version of GNU
- diff. The <ulink url="http://gcc.gnu.org/wiki/SvnTricks">SVN
- Tricks</ulink> wiki page has information on customising the
+ diff. The <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/wiki/SvnTricks">SVN
+ Tricks</link> wiki page has information on customising the
output of <code>svn diff</code>.
</para>
</listitem>
@@ -211,20 +207,20 @@
</listitem>
</itemizedlist>
- </sect2>
+ </section>
-</sect1>
+</section>
-<sect1 id="contrib.organization" xreflabel="Source Organization">
+<section xml:id="contrib.organization" xreflabel="Source Organization"><info><title>Directory Layout and Source Conventions</title></info>
<?dbhtml filename="source_organization.html"?>
- <title>Directory Layout and Source Conventions</title>
+
<para>
The unpacked source directory of libstdc++ contains the files
needed to create the GNU C++ Library.
</para>
- <literallayout>
+ <literallayout class="normal">
It has subdirectories:
doc
@@ -311,20 +307,20 @@ a bug or incompletely-implemented feature. Lines marked "XXX MT"
indicate a place that may require attention for multi-thread safety.
</literallayout>
-</sect1>
+</section>
-<sect1 id="contrib.coding_style" xreflabel="Coding Style">
+<section xml:id="contrib.coding_style" xreflabel="Coding Style"><info><title>Coding Style</title></info>
<?dbhtml filename="source_code_style.html"?>
- <title>Coding Style</title>
+
<para>
</para>
- <sect2 id="coding_style.bad_identifiers">
- <title>Bad Identifiers</title>
+ <section xml:id="coding_style.bad_identifiers"><info><title>Bad Identifiers</title></info>
+
<para>
Identifiers that conflict and should be avoided.
</para>
- <literallayout>
+ <literallayout class="normal">
This is the list of names <quote>reserved to the
implementation</quote> that have been claimed by certain
compilers and system headers of interest, and should not be used
@@ -511,22 +507,22 @@ indicate a place that may require attention for multi-thread safety.
// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00060.html
__opr
</literallayout>
- </sect2>
+ </section>
- <sect2 id="coding_style.example">
- <title>By Example</title>
- <literallayout>
+ <section xml:id="coding_style.example"><info><title>By Example</title></info>
+
+ <literallayout class="normal">
This library is written to appropriate C++ coding standards. As such,
it is intended to precede the recommendations of the GNU Coding
Standard, which can be referenced in full here:
- <ulink url="http://www.gnu.org/prep/standards/standards.html#Formatting">http://www.gnu.org/prep/standards/standards.html#Formatting</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/prep/standards/standards.html#Formatting">http://www.gnu.org/prep/standards/standards.html#Formatting</link>
The rest of this is also interesting reading, but skip the "Design
Advice" part.
The GCC coding conventions are here, and are also useful:
- <ulink url="http://gcc.gnu.org/codingconventions.html">http://gcc.gnu.org/codingconventions.html</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/codingconventions.html">http://gcc.gnu.org/codingconventions.html</link>
In addition, because it doesn't seem to be stated explicitly anywhere
else, there is an 80 column source limit.
@@ -941,21 +937,21 @@ indicate a place that may require attention for multi-thread safety.
} // namespace std
</code>
</literallayout>
- </sect2>
-</sect1>
+ </section>
+</section>
-<sect1 id="contrib.doc_style" xreflabel="Documentation Style">
+<section xml:id="contrib.doc_style" xreflabel="Documentation Style"><info><title>Documentation Style</title></info>
<?dbhtml filename="documentation_style.html"?>
- <title>Documentation Style</title>
- <sect2 id="doc_style.doxygen">
- <title>Doxygen</title>
- <sect3 id="doxygen.prereq">
- <title>Prerequisites</title>
+
+ <section xml:id="doc_style.doxygen"><info><title>Doxygen</title></info>
+
+ <section xml:id="doxygen.prereq"><info><title>Prerequisites</title></info>
+
<para>
Prerequisite tools are Bash 2.0 or later,
- <ulink url="http://www.doxygen.org/">Doxygen</ulink>, and
- the <ulink url="http://www.gnu.org/software/coreutils/">GNU
- coreutils</ulink>. (GNU versions of find, xargs, and possibly
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.doxygen.org/">Doxygen</link>, and
+ the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/software/coreutils/">GNU
+ coreutils</link>. (GNU versions of find, xargs, and possibly
sed and grep are used, just because the GNU versions make
things very easy.)
</para>
@@ -963,18 +959,18 @@ indicate a place that may require attention for multi-thread safety.
<para>
To generate the pretty pictures and hierarchy
graphs, the
- <ulink url="http://www.graphviz.org">Graphviz</ulink> package
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.graphviz.org">Graphviz</link> package
will need to be installed. For PDF
- output, <ulink url="http://www.tug.org/applications/pdftex/">
- pdflatex</ulink> is required.
+ output, <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.tug.org/applications/pdftex/">
+ pdflatex</link> is required.
</para>
- </sect3>
+ </section>
- <sect3 id="doxygen.rules">
- <title>Generating the Doxygen Files</title>
+ <section xml:id="doxygen.rules"><info><title>Generating the Doxygen Files</title></info>
+
<para>
The following Makefile rules run Doxygen to generate HTML
- docs, XML docs, PDF docs, and the man pages.
+ docs, XML docs, XML docs as a single file, PDF docs, and the man pages.
</para>
<para>
@@ -986,6 +982,10 @@ indicate a place that may require attention for multi-thread safety.
</para>
<para>
+ <screen><userinput>make doc-xml-single-doxygen</userinput></screen>
+ </para>
+
+ <para>
<screen><userinput>make doc-pdf-doxygen</userinput></screen>
</para>
@@ -994,6 +994,13 @@ indicate a place that may require attention for multi-thread safety.
</para>
<para>
+ Generated files are output into separate sub directores of
+ <filename class="directory">doc/doxygen/</filename> in the
+ build directory, based on the output format. For instance, the
+ HTML docs will be in <filename class="directory">doc/doxygen/html</filename>.
+ </para>
+
+ <para>
Careful observers will see that the Makefile rules simply call
a script from the source tree, <filename>run_doxygen</filename>, which
does the actual work of running Doxygen and then (most
@@ -1008,10 +1015,10 @@ indicate a place that may require attention for multi-thread safety.
library hackers are written in triple-# comments.
</para>
- </sect3>
+ </section>
- <sect3 id="doxygen.markup">
- <title>Markup</title>
+ <section xml:id="doxygen.markup"><info><title>Markup</title></info>
+
<para>
In general, libstdc++ files should be formatted according to
@@ -1025,7 +1032,7 @@ indicate a place that may require attention for multi-thread safety.
Adding Doxygen markup to a file (informally called
<quote>doxygenating</quote>) is very simple. The Doxygen manual can be
found
- <ulink url="http://www.stack.nl/~dimitri/doxygen/download.html#latestman">here</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.stack.nl/~dimitri/doxygen/download.html#latestman">here</link>.
We try to use a very-recent version of Doxygen.
</para>
@@ -1041,12 +1048,12 @@ indicate a place that may require attention for multi-thread safety.
<para>
Some commentary to accompany
- the first list in the <ulink url="http://www.stack.nl/~dimitri/doxygen/docblocks.html">Special
- Documentation Blocks</ulink> section of
+ the first list in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.stack.nl/~dimitri/doxygen/docblocks.html">Special
+ Documentation Blocks</link> section of
the Doxygen manual:
</para>
- <orderedlist>
+ <orderedlist inheritnum="ignore" continuation="restarts">
<listitem>
<para>For longer comments, use the Javadoc style...</para>
</listitem>
@@ -1104,7 +1111,7 @@ indicate a place that may require attention for multi-thread safety.
</para>
<para>
-<literallayout>
+<literallayout class="normal">
/**
* @brief A model of a linear congruential random number generator.
*
@@ -1122,11 +1129,12 @@ indicate a place that may require attention for multi-thread safety.
doubt, consult the following table.
</para>
-<table frame='all'>
+<table frame="all">
<title>HTML to Doxygen Markup Comparison</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<thead>
<row>
@@ -1142,12 +1150,12 @@ indicate a place that may require attention for multi-thread safety.
</row>
<row>
- <entry>&quot;</entry>
+ <entry>"</entry>
<entry>\"</entry>
</row>
<row>
- <entry>&apos;</entry>
+ <entry>'</entry>
<entry>\'</entry>
</row>
@@ -1181,15 +1189,15 @@ indicate a place that may require attention for multi-thread safety.
</table>
- </sect3>
+ </section>
- </sect2>
+ </section>
- <sect2 id="doc_style.docbook">
- <title>Docbook</title>
+ <section xml:id="doc_style.docbook"><info><title>Docbook</title></info>
+
- <sect3 id="docbook.prereq">
- <title>Prerequisites</title>
+ <section xml:id="docbook.prereq"><info><title>Prerequisites</title></info>
+
<para>
Editing the DocBook sources requires an XML editor. Many
exist: some notable options
@@ -1210,16 +1218,16 @@ indicate a place that may require attention for multi-thread safety.
</para>
<para>
- Access to the DocBook stylesheets and DTD is required. The
+ Access to the DocBook 5.0 stylesheets and schema is required. The
stylesheets are usually packaged by vendor, in something
- like <filename>docbook-style-xsl</filename>. To exactly match
+ like <filename>docbook5-style-xsl</filename>. To exactly match
generated output, please use a version of the stylesheets
equivalent
- to <filename>docbook-style-xsl-1.74.0-5</filename>. The
+ to <filename>docbook5-style-xsl-1.75.2-3</filename>. The
installation directory for this package corresponds to
the <literal>XSL_STYLE_DIR</literal>
in <filename>doc/Makefile.am</filename> and defaults
- to <filename class="directory">/usr/share/sgml/docbook/xsl-stylesheets</filename>.
+ to <filename class="directory">/usr/share/sgml/docbook/xsl-ns-stylesheets</filename>.
</para>
<para>
@@ -1231,26 +1239,30 @@ indicate a place that may require attention for multi-thread safety.
<para>
For validating the XML document, you'll need
something like <command>xmllint</command> and access to the
- DocBook DTD. These are provided
- by a vendor package like <filename>libxml2</filename>.
+ relevant DocBook schema. These are provided
+ by a vendor package like <filename>libxml2</filename> and <filename>docbook5-schemas-5.0-4</filename>
</para>
<para>
- For PDF output, something that transforms valid XML to PDF is
- required. Possible solutions include
- <ulink url="http://dblatex.sourceforge.net">dblatex</ulink>,
- <command>xmlto</command>, or <command>prince</command>. Other
- options are listed on the DocBook
- web <ulink url="http://wiki.docbook.org/topic/DocBookPublishingTools">pages</ulink>. Please
+ For PDF output, something that transforms valid Docbook XML to PDF is
+ required. Possible solutions include <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://dblatex.sourceforge.net">dblatex</link>,
+ <command>xmlto</command>, or <command>prince</command>. Of
+ these, <command>dblatex</command> is the default. Other
+ options are listed on the DocBook web <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://wiki.docbook.org/topic/DocBookPublishingTools">pages</link>. Please
consult the <email>libstdc++@gcc.gnu.org</email> list when
preparing printed manuals for current best practice and
suggestions.
</para>
<para>
- Make sure that the XML documentation and markup is valid for
- any change. This can be done easily, with the validation rules
- in the <filename>Makefile</filename>, which is equivalent to doing:
+ For Texinfo output, something that transforms valid Docbook
+ XML to Texinfo is required. The default choice is <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://docbook2x.sourceforge.net/">docbook2X</link>.
+ </para>
+
+ <para>
+ Please make sure that the XML documentation and markup is valid for
+ any change. This can be done easily, with the validation rule
+ detailed below, which is equivalent to doing:
</para>
<screen>
@@ -1258,10 +1270,10 @@ indicate a place that may require attention for multi-thread safety.
xmllint --noout --valid <filename>xml/index.xml</filename>
</userinput>
</screen>
- </sect3>
+ </section>
- <sect3 id="docbook.rules">
- <title>Generating the DocBook Files</title>
+ <section xml:id="docbook.rules"><info><title>Generating the DocBook Files</title></info>
+
<para>
The following Makefile rules generate (in order): an HTML
@@ -1286,12 +1298,18 @@ xmllint --noout --valid <filename>xml/index.xml</filename>
<screen><userinput>make doc-xml-validate-docbook</userinput></screen>
</para>
- </sect3>
+ <para>
+ Generated files are output into separate sub directores of
+ <filename class="directory">doc/docbook/</filename> in the
+ build directory, based on the output format. For instance, the
+ HTML docs will be in <filename class="directory">doc/docbook/html</filename>.
+ </para>
+ </section>
- <sect3 id="docbook.examples">
- <title>File Organization and Basics</title>
+ <section xml:id="docbook.examples"><info><title>File Organization and Basics</title></info>
+
- <literallayout>
+ <literallayout class="normal">
<emphasis>Which files are important</emphasis>
All Docbook files are in the directory
@@ -1352,24 +1370,25 @@ xmllint --noout --valid <filename>xml/index.xml</filename>
&lt;/set&gt;
</literallayout>
- </sect3>
+ </section>
- <sect3 id="docbook.markup">
- <title>Markup By Example</title>
+ <section xml:id="docbook.markup"><info><title>Markup By Example</title></info>
+
<para>
Complete details on Docbook markup can be found in the DocBook
Element Reference,
- <ulink url="http://www.docbook.org/tdg/en/html/part2.html">online</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.docbook.org/tdg/en/html/part2.html">online</link>.
An incomplete reference for HTML to Docbook conversion is
detailed in the table below.
</para>
-<table frame='all'>
+<table frame="all">
<title>HTML to Docbook XML Markup Comparison</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<thead>
<row>
@@ -1430,7 +1449,7 @@ xmllint --noout --valid <filename>xml/index.xml</filename>
<entry>&lt;emphasis&gt;</entry>
</row>
<row>
- <entry>&quot;</entry>
+ <entry>"</entry>
<entry>&lt;quote&gt;</entry>
</row>
</tbody>
@@ -1442,11 +1461,12 @@ xmllint --noout --valid <filename>xml/index.xml</filename>
equivalents are listed in the table below.
</para>
-<table frame='all'>
+<table frame="all">
<title>Docbook XML Element Use</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<thead>
<row>
@@ -1513,42 +1533,112 @@ xmllint --noout --valid <filename>xml/index.xml</filename>
</tgroup>
</table>
- </sect3>
- </sect2>
+ </section>
+ </section>
- <sect2 id="doc_style.combines">
- <title>Combines</title>
+ <section xml:id="doc_style.combines"><info><title>Combines</title></info>
+
- <sect3 id="combines.rules">
- <title>Generating Combines and Assemblages</title>
+ <section xml:id="combines.rules"><info><title>Generating Combines and Assemblages</title></info>
+
<para>
The following Makefile rules are defaults, and are usually
- aliased to variable rules.
+ aliased to more detailed rules. They are shortcuts for
+ generating HTML, PDF, Texinfo, XML, or man files and then collecting
+ the generated files into the build directory's doc directory.
</para>
+<variablelist>
+
+<varlistentry><term>
+ <emphasis>make doc-html</emphasis>
+ </term>
+<listitem>
+ <para>
+ Generates multi-page HTML documentation in the following directories:
+ </para>
<para>
- <screen><userinput>make doc-html</userinput></screen>
+ <filename class="directory">doc/libstdc++-api.html</filename>
</para>
+ <para>
+ <filename class="directory">doc/libstdc++-manual.html</filename>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term>
+ <emphasis>make doc-man</emphasis>
+ </term>
+<listitem>
+ <para>
+ Generates man pages in the following directory:
+ </para>
<para>
- <screen><userinput>make doc-man</userinput></screen>
+ <filename class="directory">doc/libstdc++-api.man</filename>
</para>
+</listitem>
+</varlistentry>
+<varlistentry><term>
+ <emphasis>make doc-pdf</emphasis>
+ </term>
+<listitem>
+ <para>
+ Generates indexed PDF documentation in the following files:
+ </para>
<para>
- <screen><userinput>make doc-pdf</userinput></screen>
+ <filename>doc/libstdc++-api.pdf</filename>
</para>
- </sect3>
- </sect2>
-</sect1>
+ <para>
+ <filename>doc/libstdc++-manual.pdf</filename>
+ </para>
+</listitem>
+</varlistentry>
+
+<varlistentry><term>
+ <emphasis>make doc-texinfo</emphasis>
+ </term>
+<listitem>
+ <para>
+ Generates Texinfo documentation in the following files:
+ </para>
+ <para>
+ <filename>doc/libstdc++-manual.texinfo</filename>
+ </para>
+</listitem>
+</varlistentry>
+
+<varlistentry><term>
+ <emphasis>make doc-xml</emphasis>
+ </term>
+<listitem>
+ <para>
+ Generates single-file XML documentation in the following files:
+ </para>
+ <para>
+ <filename>doc/libstdc++-api.xml</filename>
+ </para>
+ <para>
+ <filename>doc/libstdc++-manual.xml</filename>
+ </para>
+</listitem>
+</varlistentry>
+
+</variablelist>
+
+
+ </section>
+ </section>
+</section>
-<sect1 id="contrib.design_notes" xreflabel="Design Notes">
+<section xml:id="contrib.design_notes" xreflabel="Design Notes"><info><title>Design Notes</title></info>
<?dbhtml filename="source_design_notes.html"?>
- <title>Design Notes</title>
+
<para>
</para>
- <literallayout>
+ <literallayout class="normal">
The Library
-----------
@@ -2402,6 +2492,6 @@ xmllint --noout --valid <filename>xml/index.xml</filename>
include them via "&lt;backward/hash_map.h&gt;" or "&lt;ext/hash_map&gt;" than
to search the subdirectory itself via a "-I" directive.
</literallayout>
-</sect1>
+</section>
</appendix>
diff --git a/libstdc++-v3/doc/xml/manual/appendix_free.xml b/libstdc++-v3/doc/xml/manual/appendix_free.xml
index 61df179eb3a..86d503c9452 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_free.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_free.xml
@@ -1,12 +1,14 @@
-<?xml version='1.0'?>
-<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<appendix id="appendix.free" xreflabel="Free">
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.free" xreflabel="Free">
<?dbhtml filename="appendix_free.html"?>
-<appendixinfo>
+<info><title>
+ Free Software Needs Free Documentation
+ <indexterm>
+ <primary>Appendix</primary>
+ <secondary>Free Documentation</secondary>
+ </indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,15 +17,9 @@
library
</keyword>
</keywordset>
-</appendixinfo>
+</info>
+
-<title>
- Free Software Needs Free Documentation
- <indexterm>
- <primary>Appendix</primary>
- <secondary>Free Documentation</secondary>
- </indexterm>
-</title>
<para>
The biggest deficiency in free operating systems is not in the
@@ -68,7 +64,7 @@ can ill afford to lose manuals this way.
Free documentation, like free software, is a matter of freedom,
not price. The problem with these manuals was not that O'Reilly
Associates charged a price for printed copies--that in itself is fine.
-(The Free Software Foundation <ulink url="http://www.gnu.org/doc/doc.html">sells printed copies</ulink> of
+(The Free Software Foundation <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/doc/doc.html">sells printed copies</link> of
free GNU manuals, too.) But GNU manuals are available in source code
form, while these manuals are available only on paper. GNU manuals
come with permission to copy and modify; the Perl manuals do not.
@@ -167,8 +163,8 @@ check the distribution terms of a manual before you buy it, and
prefer copylefted manuals to non-copylefted ones.
</para>
<para>
-[Note: We now maintain a <ulink url="http://www.fsf.org/licensing/doc/other-free-books.html">web page
-that lists free books available from other publishers</ulink>].
+[Note: We now maintain a <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org/licensing/doc/other-free-books.html">web page
+that lists free books available from other publishers</link>].
</para>
<para>Copyright © 2004, 2005, 2006, 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA</para>
diff --git a/libstdc++-v3/doc/xml/manual/appendix_porting.xml b/libstdc++-v3/doc/xml/manual/appendix_porting.xml
index 80884533fab..dc29a35353f 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_porting.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_porting.xml
@@ -1,12 +1,14 @@
-<?xml version='1.0'?>
-<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<appendix id="appendix.porting" xreflabel="Porting">
+<appendix xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.porting" xreflabel="Porting">
<?dbhtml filename="appendix_porting.html"?>
-<appendixinfo>
+<info><title>
+ Porting and Maintenance
+ <indexterm>
+ <primary>Appendix</primary>
+ <secondary>Porting and Maintenance</secondary>
+ </indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,44 +17,32 @@
library
</keyword>
</keywordset>
-</appendixinfo>
+</info>
+
-<title>
- Porting and Maintenance
- <indexterm>
- <primary>Appendix</primary>
- <secondary>Porting and Maintenance</secondary>
- </indexterm>
-</title>
<!-- Hacking the Build System -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="build_hacking.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="build_hacking.xml">
</xi:include>
<!-- Internals: Porting to New Hardware or Operating Systems -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="internals.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="internals.xml">
</xi:include>
<!-- Test -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="test.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="test.xml">
</xi:include>
<!-- ABI Policy and Guidelines -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="abi.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="abi.xml">
</xi:include>
<!-- API Evolution and Deprecation History -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="evolution.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="evolution.xml">
</xi:include>
<!-- Backwards Compatibility -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="backwards_compatibility.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="backwards_compatibility.xml">
</xi:include>
</appendix>
diff --git a/libstdc++-v3/doc/xml/manual/atomics.xml b/libstdc++-v3/doc/xml/manual/atomics.xml
index 345b2b7f6c1..ddeea0185d5 100644
--- a/libstdc++-v3/doc/xml/manual/atomics.xml
+++ b/libstdc++-v3/doc/xml/manual/atomics.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.atomics" xreflabel="Atomics">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.atomics" xreflabel="Atomics">
<?dbhtml filename="atomics.html"?>
-<chapterinfo>
+<info><title>
+ Atomics
+ <indexterm><primary>Atomics</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -18,20 +17,17 @@
atomic
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Atomics
- <indexterm><primary>Atomics</primary></indexterm>
-</title>
<para>
Facilities for atomic operations.
</para>
<!-- Sect1 01 : API -->
-<sect1 id="std.atomics.api">
- <title>API Reference</title>
+<section xml:id="std.atomics.api"><info><title>API Reference</title></info>
+
<para>
All items are declared in the standard header
@@ -56,6 +52,6 @@
<!-- Doxygen XML: api/group__atomics.xml -->
-</sect1>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/auto_ptr.xml b/libstdc++-v3/doc/xml/manual/auto_ptr.xml
index 6c49a5567f3..f62d8f472b4 100644
--- a/libstdc++-v3/doc/xml/manual/auto_ptr.xml
+++ b/libstdc++-v3/doc/xml/manual/auto_ptr.xml
@@ -1,7 +1,8 @@
-<section id="std.util.memory.auto_ptr" xreflabel="auto_ptr">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.util.memory.auto_ptr" xreflabel="auto_ptr">
<?dbhtml filename="auto_ptr.html"?>
-<sectioninfo>
+<info><title>auto_ptr</title>
<keywordset>
<keyword>
ISO C++
@@ -10,12 +11,12 @@
auto_ptr
</keyword>
</keywordset>
-</sectioninfo>
+</info>
-<title>auto_ptr</title>
-<section id="auto_ptr.limitations">
-<title>Limitations</title>
+
+<section xml:id="auto_ptr.limitations"><info><title>Limitations</title></info>
+
<para>Explaining all of the fun and delicious things that can
happen with misuse of the <classname>auto_ptr</classname> class
@@ -81,8 +82,8 @@
</para>
</section>
-<section id="auto_ptr.using">
-<title>Use in Containers</title>
+<section xml:id="auto_ptr.using"><info><title>Use in Containers</title></info>
+
<para>
</para>
diff --git a/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml b/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
index c6135530c18..1f7348a0e90 100644
--- a/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
+++ b/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.appendix.porting.backwards" xreflabel="backwards">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.appendix.porting.backwards" xreflabel="backwards">
<?dbhtml filename="backwards.html"?>
-<sect1info>
+<info><title>Backwards Compatibility</title>
<keywordset>
<keyword>
ISO C++
@@ -10,12 +11,12 @@
backwards
</keyword>
</keywordset>
-</sect1info>
+</info>
-<title>Backwards Compatibility</title>
-<sect2 id="backwards.first">
-<title>First</title>
+
+<section xml:id="backwards.first"><info><title>First</title></info>
+
<para>The first generation GNU C++ library was called libg++. It was a
separate GNU project, although reliably paired with GCC. Rumors imply
@@ -41,15 +42,15 @@ Committee couldn't include everything, and so a lot of those
<para>Portability notes and known implementation limitations are as follows.</para>
-<sect3>
- <title>No <code>ios_base</code></title>
+<section><info><title>No <code>ios_base</code></title></info>
+
<para> At least some older implementations don't have <code>std::ios_base</code>, so you should use <code>std::ios::badbit</code>, <code>std::ios::failbit</code> and <code>std::ios::eofbit</code> and <code>std::ios::goodbit</code>.
</para>
-</sect3>
+</section>
+
+<section><info><title>No <code>cout</code> in <code>ostream.h</code>, no <code>cin</code> in <code>istream.h</code></title></info>
-<sect3>
-<title>No <code>cout</code> in <code>ostream.h</code>, no <code>cin</code> in <code>istream.h</code></title>
<para>
In earlier versions of the standard,
@@ -65,15 +66,15 @@ Committee couldn't include everything, and so a lot of those
<para>This project is no longer maintained or supported, and the sources
archived. For the desperate,
-the <ulink url="http://gcc.gnu.org/extensions.html">GCC extensions
-page</ulink> describes where to find the last libg++ source. The code is
+the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/extensions.html">GCC extensions
+page</link> describes where to find the last libg++ source. The code is
considered replaced and rewritten.
</para>
-</sect3>
-</sect2>
+</section>
+</section>
+
+<section xml:id="backwards.second"><info><title>Second</title></info>
-<sect2 id="backwards.second">
-<title>Second</title>
<para>
The second generation GNU C++ library was called libstdc++, or
@@ -95,8 +96,8 @@ considered replaced and rewritten.
Portability notes and known implementation limitations are as follows.
</para>
-<sect3>
- <title>Namespace <code>std::</code> not supported</title>
+<section><info><title>Namespace <code>std::</code> not supported</title></info>
+
<para>
Some care is required to support C++ compiler and or library
@@ -179,10 +180,10 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
fi
])
</programlisting>
-</sect3>
+</section>
+
+<section><info><title>Illegal iterator usage</title></info>
-<sect3>
-<title>Illegal iterator usage</title>
<para>
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
@@ -209,15 +210,14 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</para>
</listitem>
</itemizedlist>
-</sect3>
+</section>
-<sect3>
- <title><code>isspace</code> from <filename class="headerfile">cctype</filename> is a macro
- </title>
+<section><info><title><code>isspace</code> from <filename class="headerfile">cctype</filename> is a macro
+ </title></info>
+
<para>
- Glibc 2.0.x and 2.1.x define <filename
- class="headerfile">ctype.h</filename> functionality as macros
+ Glibc 2.0.x and 2.1.x define <filename class="headerfile">ctype.h</filename> functionality as macros
(isspace, isalpha etc.).
</para>
@@ -259,17 +259,16 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
<para>
Another problem arises if you put a <code>using namespace
- std;</code> declaration at the top, and include <filename
- class="headerfile">ctype.h</filename>. This will result in
+ std;</code> declaration at the top, and include <filename class="headerfile">ctype.h</filename>. This will result in
ambiguities between the definitions in the global namespace
(<filename class="headerfile">ctype.h</filename>) and the
definitions in namespace <code>std::</code>
(<code>&lt;cctype&gt;</code>).
</para>
-</sect3>
+</section>
+
+<section><info><title>No <code>vector::at</code>, <code>deque::at</code>, <code>string::at</code></title></info>
-<sect3>
-<title>No <code>vector::at</code>, <code>deque::at</code>, <code>string::at</code></title>
<para>
One solution is to add an autoconf-test for this:
@@ -303,10 +302,10 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
to check for <code>string::at</code> separately.
</para>
-</sect3>
+</section>
+
+<section><info><title>No <code>std::char_traits&lt;char&gt;::eof</code></title></info>
-<sect3>
-<title>No <code>std::char_traits&lt;char&gt;::eof</code></title>
<para>
Use some kind of autoconf test, plus this:
@@ -320,10 +319,10 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#endif
</programlisting>
-</sect3>
+</section>
+
+<section><info><title>No <code>string::clear</code></title></info>
-<sect3>
-<title>No <code>string::clear</code></title>
<para>
There are two functions for deleting the contents of a string:
@@ -350,28 +349,27 @@ erase(size_type __pos = 0, size_type __n = npos)
version, so you should use <code>erase</code> (which is probably
faster than <code>operator=(charT*)</code>).
</para>
-</sect3>
+</section>
-<sect3>
-<title>
+<section><info><title>
Removal of <code>ostream::form</code> and <code>istream::scan</code>
extensions
-</title>
+</title></info>
+
<para>
These are no longer supported. Please use stringstreams instead.
</para>
-</sect3>
+</section>
+
+<section><info><title>No <code>basic_stringbuf</code>, <code>basic_stringstream</code></title></info>
-<sect3>
-<title>No <code>basic_stringbuf</code>, <code>basic_stringstream</code></title>
<para>
Although the ISO standard <code>i/ostringstream</code>-classes are
provided, (<filename class="headerfile">sstream</filename>), for
compatibility with older implementations the pre-ISO
- <code>i/ostrstream</code> (<filename
- class="headerfile">strstream</filename>) interface is also provided,
+ <code>i/ostrstream</code> (<filename class="headerfile">strstream</filename>) interface is also provided,
with these caveats:
</para>
@@ -484,34 +482,33 @@ any = temp;
</programlisting>
<para>
- Another example of using stringstreams is in <link
- linkend="strings.string.shrink">this howto</link>.
+ Another example of using stringstreams is in <link linkend="strings.string.shrink">this howto</link>.
</para>
<para> There is additional information in the libstdc++-v2 info files, in
particular <quote>info iostream</quote>.
</para>
-</sect3>
+</section>
-<sect3>
- <title>Little or no wide character support</title>
+<section><info><title>Little or no wide character support</title></info>
+
<para>
Classes <classname>wstring</classname> and
<classname>char_traits&lt;wchar_t&gt;</classname> are
not supported.
</para>
-</sect3>
+</section>
-<sect3>
- <title>No templatized iostreams</title>
+<section><info><title>No templatized iostreams</title></info>
+
<para>
Classes <classname>wfilebuf</classname> and
<classname>wstringstream</classname> are not supported.
</para>
-</sect3>
+</section>
+
+<section><info><title>Thread safety issues</title></info>
-<sect3>
-<title>Thread safety issues</title>
<para>
Earlier GCC releases had a somewhat different approach to
@@ -541,10 +538,9 @@ particular <quote>info iostream</quote>.
written against per-CPU-architecture spinlocks and other parts
against the gthr.h abstraction layer which is provided by gcc. A
minor problem that pops up every so often is different
- interpretations of what &quot;thread-safe&quot; means for a
- library (not a general program). We currently use the <ulink
- url="http://www.sgi.com/tech/stl/thread_safety.html">same
- definition that SGI</ulink> uses for their STL subset. However,
+ interpretations of what "thread-safe" means for a
+ library (not a general program). We currently use the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/thread_safety.html">same
+ definition that SGI</link> uses for their STL subset. However,
the exception for read-only containers only applies to the STL
components. This definition is widely-used and something similar
will be used in the next version of the C++ standard library.
@@ -554,23 +550,22 @@ particular <quote>info iostream</quote>.
Here is a small link farm to threads (no pun) in the mail
archives that discuss the threading problem. Each link is to the
first relevant message in the thread; from there you can use
- &quot;Thread Next&quot; to move down the thread. This farm is in
+ "Thread Next" to move down the thread. This farm is in
latest-to-oldest order.
</para>
<itemizedlist>
<listitem>
<para>
- Our threading expert Loren gives a breakdown of <ulink
- url="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html">the
- six situations involving threads</ulink> for the 3.0
+ Our threading expert Loren gives a breakdown of <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html">the
+ six situations involving threads</link> for the 3.0
release series.
</para>
</listitem>
<listitem>
<para>
- <ulink url="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html">
- This message</ulink> inspired a recent updating of issues with
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html">
+ This message</link> inspired a recent updating of issues with
threading and the SGI STL library. It also contains some
example POSIX-multithreaded STL code.
</para>
@@ -584,12 +579,12 @@ particular <quote>info iostream</quote>.
with work to restore them. Many of the points have been
superseded anyhow.)
</para>
-</sect3>
+</section>
+
+</section>
-</sect2>
+<section xml:id="backwards.third"><info><title>Third</title></info>
-<sect2 id="backwards.third">
-<title>Third</title>
<para> The third generation GNU C++ library is called libstdc++, or
libstdc++-v3.
@@ -606,8 +601,8 @@ libstdc++-v3.
<para>Portability notes and known implementation limitations are as follows.</para>
-<sect3>
-<title>Pre-ISO headers moved to backwards or removed</title>
+<section><info><title>Pre-ISO headers moved to backwards or removed</title></info>
+
<para> The pre-ISO C++ headers
(<code>iostream.h</code>, <code>defalloc.h</code> etc.) are
@@ -621,8 +616,8 @@ libstdc++-v3.
</para>
<para>For those of you new to ISO C++ (welcome, time travelers!), no,
that isn't a typo. Yes, the headers really have new names.
- Marshall Cline's C++ FAQ Lite has a good explanation in <ulink url="http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.4">item
- [27.4]</ulink>.
+ Marshall Cline's C++ FAQ Lite has a good explanation in <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.4">item
+ [27.4]</link>.
</para>
<para> Some include adjustment may be required. What follows is an
@@ -691,10 +686,10 @@ directive <code>using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
</para>
-</sect3>
+</section>
+
+<section><info><title>Extension headers hash_map, hash_set moved to ext or backwards</title></info>
-<sect3>
-<title>Extension headers hash_map, hash_set moved to ext or backwards</title>
<para>At this time most of the features of the SGI STL extension have been
replaced by standardized libraries.
@@ -781,11 +776,11 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
fi
])
</programlisting>
-</sect3>
+</section>
+
+<section><info><title>No <code>ios::nocreate/ios::noreplace</code>.
+</title></info>
-<sect3>
-<title>No <code>ios::nocreate/ios::noreplace</code>.
-</title>
<para> The existence of <code>ios::nocreate</code> being used for
input-streams has been confirmed, most probably because the author
@@ -800,12 +795,12 @@ decide whether you want to create/replace or not. To my knowledge,
even older implementations support <code>app</code>, <code>ate</code>
and <code>trunc</code> (except for <code>app</code> ?).
</para>
-</sect3>
+</section>
-<sect3>
-<title>
+<section><info><title>
No <code>stream::attach(int fd)</code>
-</title>
+</title></info>
+
<para>
Phil Edwards writes: It was considered and rejected for the ISO
@@ -825,22 +820,22 @@ No <code>stream::attach(int fd)</code>
<para>
An extension is available that implements this.
<filename class="headerfile">ext/stdio_filebuf.h</filename> contains a derived class called
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></link>.
This class can be constructed from a C <code>FILE*</code> or a file
descriptor, and provides the <code>fd()</code> function.
</para>
<para>
For another example of this, refer to
- <ulink url="http://www.josuttis.com/cppcode/fdstream.html">fdstream example</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.josuttis.com/cppcode/fdstream.html">fdstream example</link>
by Nicolai Josuttis.
</para>
-</sect3>
+</section>
-<sect3>
-<title>
+<section><info><title>
Support for C++98 dialect.
-</title>
+</title></info>
+
<para>Check for complete library coverage of the C++1998/2003 standard.
</para>
@@ -911,12 +906,12 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
fi
])
</programlisting>
-</sect3>
+</section>
-<sect3>
-<title>
+<section><info><title>
Support for C++TR1 dialect.
-</title>
+</title></info>
+
<para>Check for library coverage of the TR1 standard.
</para>
@@ -1002,13 +997,13 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
fi
])
</programlisting>
-</sect3>
+</section>
-<sect3>
-<title>
+<section><info><title>
Support for C++0x dialect.
-</title>
+</title></info>
+
<para>Check for baseline language coverage in the compiler for the C++0xstandard.
</para>
@@ -1234,63 +1229,54 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
fi
])
</programlisting>
-</sect3>
+</section>
-<sect3>
-<title>
+<section><info><title>
Container::iterator_type is not necessarily Container::value_type*
-</title>
+</title></info>
+
<para>
This is a change in behavior from the previous version. Now, most
<type>iterator_type</type> typedefs in container classes are POD
objects, not <type>value_type</type> pointers.
</para>
-</sect3>
+</section>
+
+</section>
-</sect2>
+<bibliography xml:id="backwards.biblio"><info><title>Bibliography</title></info>
-<bibliography id="backwards.biblio">
-<title>Bibliography</title>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.kegel.com/gcc/gcc4.html">
- <citetitle>
- Migrating to GCC 4.1
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.kegel.com/gcc/gcc4.html" class="uri">
</biblioid>
- <author>
- <firstname>Dan</firstname>
- <surname>Kegel</surname>
- </author>
+ <citetitle>
+ Migrating to GCC 4.1
+ </citetitle>
+
+ <author><personname><firstname>Dan</firstname><surname>Kegel</surname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://lists.debian.org/debian-gcc/2006/03/msg00405.html">
- <citetitle>
- Building the Whole Debian Archive with GCC 4.1: A Summary
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" class="uri">
</biblioid>
- <author>
- <firstname>Martin</firstname>
- <surname>Michlmayr</surname>
- </author>
+ <citetitle>
+ Building the Whole Debian Archive with GCC 4.1: A Summary
+ </citetitle>
+
+ <author><personname><firstname>Martin</firstname><surname>Michlmayr</surname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html">
- <citetitle>
- Migration guide for GCC-3.2
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html" class="uri">
</biblioid>
+ <citetitle>
+ Migration guide for GCC-3.2
+ </citetitle>
+
</biblioentry>
</bibliography>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml b/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml
index 7b90e3a1d55..19b190661f0 100644
--- a/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml
+++ b/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.ext.allocator.bitmap" xreflabel="bitmap_allocator">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext.allocator.bitmap" xreflabel="bitmap_allocator">
<?dbhtml filename="bitmap_allocator.html"?>
-<sect1info>
+<info><title>bitmap_allocator</title>
<keywordset>
<keyword>
ISO C++
@@ -10,15 +11,15 @@
allocator
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>bitmap_allocator</title>
<para>
</para>
-<sect2 id="allocator.bitmap.design">
-<title>Design</title>
+<section xml:id="allocator.bitmap.design"><info><title>Design</title></info>
+
<para>
As this name suggests, this allocator uses a bit-map to keep track
@@ -53,13 +54,13 @@
layer.
</para>
-</sect2>
+</section>
-<sect2 id="allocator.bitmap.impl">
-<title>Implementation</title>
+<section xml:id="allocator.bitmap.impl"><info><title>Implementation</title></info>
-<sect3 id="bitmap.impl.free_list_store" xreflabel="Free List Store">
- <title>Free List Store</title>
+
+<section xml:id="bitmap.impl.free_list_store" xreflabel="Free List Store"><info><title>Free List Store</title></info>
+
<para>
The Free List Store (referred to as FLS for the remaining part of this
@@ -121,10 +122,10 @@ else return false.</para></listitem>
Currently, (3) is being used with a value of 36% Maximum wastage per
Super Block.
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.super_block" xreflabel="Super Block">
- <title>Super Block</title>
+<section xml:id="bitmap.impl.super_block" xreflabel="Super Block"><info><title>Super Block</title></info>
+
<para>
A super block is the block of memory acquired from the FLS from
@@ -144,10 +145,10 @@ else return false.</para></listitem>
getting / returning Super Bocks to and from the OS using operator new
as defined by the C++ standard.
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.super_block_data" xreflabel="Super Block Data">
- <title>Super Block Data Layout</title>
+<section xml:id="bitmap.impl.super_block_data" xreflabel="Super Block Data"><info><title>Super Block Data Layout</title></info>
+
<para>
Each Super Block will be of some size that is a multiple of the
number of Bits Per Block. Typically, this value is chosen as
@@ -165,14 +166,15 @@ else return false.</para></listitem>
(assume a 32-bit system where, size_t is a 32-bit entity).
</para>
-<table frame='all'>
+<table frame="all">
<title>Bitmap Allocator Memory Map</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
@@ -219,10 +221,10 @@ else return false.</para></listitem>
x 2,
which is 8-bytes, or 2 x sizeof(size_t).
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.max_wasted" xreflabel="Max Wasted Percentage">
- <title>Maximum Wasted Percentage</title>
+<section xml:id="bitmap.impl.max_wasted" xreflabel="Max Wasted Percentage"><info><title>Maximum Wasted Percentage</title></info>
+
<para>
This has nothing to do with the algorithm per-se,
@@ -260,10 +262,10 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
create a function that returns the Max_Wastage_Percentage for us to use.
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.allocate" xreflabel="Allocate">
- <title><function>allocate</function></title>
+<section xml:id="bitmap.impl.allocate" xreflabel="Allocate"><info><title><function>allocate</function></title></info>
+
<para>
The allocate function is specialized for single object allocation
@@ -366,10 +368,10 @@ combination of the next-fit and first-fit algorithm optimized ONLY for
single object allocations.
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.deallocate" xreflabel="Deallocate">
- <title><function>deallocate</function></title>
+<section xml:id="bitmap.impl.deallocate" xreflabel="Deallocate"><info><title><function>deallocate</function></title></info>
+
<para>
The deallocate function again is specialized for single objects ONLY.
For all n belonging to &gt; 1, the operator delete is called without
@@ -410,13 +412,13 @@ single object allocations.
invariant is maintained by making sure that _S_last_request and
_S_last_dealloc_index point to valid locations within the vector.
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.questions" xreflabel="Questions">
- <title>Questions</title>
+<section xml:id="bitmap.impl.questions" xreflabel="Questions"><info><title>Questions</title></info>
+
- <sect4 id="bitmap.impl.question.1" xreflabel="Question 1">
- <title>1</title>
+ <section xml:id="bitmap.impl.question.1" xreflabel="Question 1"><info><title>1</title></info>
+
<para>
Q1) The "Data Layout" section is
cryptic. I have no idea of what you are trying to say. Layout of what?
@@ -429,10 +431,10 @@ general formula for calculating the size of a super block is
32 x sizeof(value_type) x 2^n, where n ranges from 0 to 32 for 32-bit
systems.
</para>
- </sect4>
+ </section>
- <sect4 id="bitmap.impl.question.2" xreflabel="Question 2">
- <title>2</title>
+ <section xml:id="bitmap.impl.question.2" xreflabel="Question 2"><info><title>2</title></info>
+
<para>
And since I just mentioned the
term `each bitmap', what in the world is meant by it? What does each
@@ -452,10 +454,10 @@ Block a bitmap as well?
whose exact number for a super-block of a given size I have just
mentioned.
</para>
- </sect4>
+ </section>
- <sect4 id="bitmap.impl.question.3" xreflabel="Question 3">
- <title>3</title>
+ <section xml:id="bitmap.impl.question.3" xreflabel="Question 3"><info><title>3</title></info>
+
<para>
How do the allocate and deallocate functions work in regard to
bitmaps?
@@ -492,11 +494,11 @@ Block a bitmap as well?
The bit-map now looks like this:
1111111111111111111111111111111111111111111111111111111111111110
</para>
- </sect4>
-</sect3>
+ </section>
+</section>
-<sect3 id="bitmap.impl.locality" xreflabel="Locality">
- <title>Locality</title>
+<section xml:id="bitmap.impl.locality" xreflabel="Locality"><info><title>Locality</title></info>
+
<para>
Another issue would be whether to keep the all bitmaps in a
separate area in memory, or to keep them near the actual blocks
@@ -522,10 +524,10 @@ equivalent.</para></listitem>
single object allocations, though it preserves the locality of blocks
very well when they are returned back to the allocator.
</para>
-</sect3>
+</section>
-<sect3 id="bitmap.impl.grow_policy" xreflabel="Grow Policy">
- <title>Overhead and Grow Policy</title>
+<section xml:id="bitmap.impl.grow_policy" xreflabel="Grow Policy"><info><title>Overhead and Grow Policy</title></info>
+
<para>
Expected overhead per block would be 1 bit in memory. Also, once
the address of the free list has been found, the cost for
@@ -552,8 +554,8 @@ equivalent.</para></listitem>
which can fit exactly in a CPU register. Hence, the term given is
exponential growth of the internal pool.
</para>
-</sect3>
+</section>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/build_hacking.xml b/libstdc++-v3/doc/xml/manual/build_hacking.xml
index fd134bdea45..0746392a2b5 100644
--- a/libstdc++-v3/doc/xml/manual/build_hacking.xml
+++ b/libstdc++-v3/doc/xml/manual/build_hacking.xml
@@ -1,7 +1,8 @@
-<sect1 id="appendix.porting.build_hacking" xreflabel="Build Hacking">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.porting.build_hacking" xreflabel="Build Hacking">
<?dbhtml filename="build_hacking.html"?>
-<sect1info>
+<info><title>Configure and Build Hacking</title>
<keywordset>
<keyword>
C++
@@ -19,15 +20,14 @@
shared
</keyword>
</keywordset>
-</sect1info>
+</info>
-<title>Configure and Build Hacking</title>
-<sect2 id="build_hacking.prereq">
- <title>Prerequisites</title>
+
+<section xml:id="build_hacking.prereq"><info><title>Prerequisites</title></info>
+
<para>
- As noted <ulink
- url="http://gcc.gnu.org/install/prerequisites.html">previously</ulink>,
+ As noted <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/prerequisites.html">previously</link>,
certain other tools are necessary for hacking on files that
control configure (<code>configure.ac</code>,
<code>acinclude.m4</code>) and make
@@ -38,10 +38,10 @@
the auto-tools used, so please try to play nicely with the
neighbors.
</para>
-</sect2>
+</section>
-<sect2 id="build_hacking.map">
- <title>Overview: What Comes from Where</title>
+<section xml:id="build_hacking.map"><info><title>Overview: What Comes from Where</title></info>
+
<screen>
<inlinemediaobject>
@@ -61,14 +61,14 @@
<code>"aclocal-1.11 &amp;&amp; autoconf-2.64 &amp;&amp;
autoheader-2.64 &amp;&amp; automake-1.11"</code> The version
numbers may be absent entirely or otherwise vary depending on
- <ulink url="http://gcc.gnu.org/install/prerequisites.html">the
- current requirements</ulink> and your vendor's choice of
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/prerequisites.html">the
+ current requirements</link> and your vendor's choice of
installation names.
</para>
-</sect2>
+</section>
-<sect2 id="build_hacking.scripts">
- <title>Storing Information in non-AC files (like configure.host)</title>
+<section xml:id="build_hacking.scripts"><info><title>Storing Information in non-AC files (like configure.host)</title></info>
+
<para>
Until that glorious day when we can use AC_TRY_LINK with a
@@ -97,10 +97,10 @@
to properly find them all when generating configure. I would
discourage that.
</para>
-</sect2>
+</section>
-<sect2 id="build_hacking.conventions">
- <title>Coding and Commenting Conventions</title>
+<section xml:id="build_hacking.conventions"><info><title>Coding and Commenting Conventions</title></info>
+
<para>
Most comments should use {octothorpes, shibboleths, hash marks,
@@ -122,10 +122,10 @@
<code>$target_alias</code>. The single exception is in
configure.ac, for automake+dejagnu's sake.
</para>
-</sect2>
+</section>
-<sect2 id="build_hacking.acinclude">
- <title>The acinclude.m4 layout</title>
+<section xml:id="build_hacking.acinclude"><info><title>The acinclude.m4 layout</title></info>
+
<para>
The nice thing about acinclude.m4/aclocal.m4 is that macros aren't
actually performed/called/expanded/whatever here, just loaded. So
@@ -213,10 +213,10 @@
present otherwise stuff magically goes wonky.
</para>
-</sect2>
+</section>
-<sect2 id="build_hacking.enable">
- <title><constant>GLIBCXX_ENABLE</constant>, the <literal>--enable</literal> maker</title>
+<section xml:id="build_hacking.enable"><info><title><constant>GLIBCXX_ENABLE</constant>, the <literal>--enable</literal> maker</title></info>
+
<para>
All the GLIBCXX_ENABLE_FOO macros use a common helper,
@@ -304,8 +304,7 @@
<para>
If you're wondering what that line noise in the last example was,
that's how you embed autoconf special characters in output text.
- They're called <ulink
- url="http://www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs"><emphasis>quadrigraphs</emphasis></ulink>
+ They're called <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs"><emphasis>quadrigraphs</emphasis></link>
and you should use them whenever necessary.
</para>
</listitem>
@@ -349,6 +348,6 @@
message.
</para>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/codecvt.xml b/libstdc++-v3/doc/xml/manual/codecvt.xml
index a2a90cfdb5b..0c642f9f904 100644
--- a/libstdc++-v3/doc/xml/manual/codecvt.xml
+++ b/libstdc++-v3/doc/xml/manual/codecvt.xml
@@ -1,7 +1,8 @@
-<section id="std.localization.facet.codecvt" xreflabel="codecvt">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.localization.facet.codecvt" xreflabel="codecvt">
<?dbhtml filename="codecvt.html"?>
-<sectioninfo>
+<info><title>codecvt</title>
<keywordset>
<keyword>
ISO C++
@@ -10,9 +11,9 @@
codecvt
</keyword>
</keywordset>
-</sectioninfo>
+</info>
+
-<title>codecvt</title>
<para>
The standard class codecvt attempts to address conversions between
@@ -30,8 +31,8 @@ specializations for wide and narrow characters and the
implementation-provided extended functionality are given.
</para>
-<section id="facet.codecvt.req">
-<title>Requirements</title>
+<section xml:id="facet.codecvt.req"><info><title>Requirements</title></info>
+
<para>
Around page 425 of the C++ Standard, this charming heading comes into view:
@@ -110,11 +111,11 @@ template parameter, imply an implementation strategy that is mostly
mcsrtombs and wcsrtombs in particular.</para>
</section>
-<section id="facet.codecvt.design">
-<title>Design</title>
+<section xml:id="facet.codecvt.design"><info><title>Design</title></info>
+
-<section id="codecvt.design.wchar_t_size">
- <title><type>wchar_t</type> Size</title>
+<section xml:id="codecvt.design.wchar_t_size"><info><title><type>wchar_t</type> Size</title></info>
+
<para>
The simple implementation detail of wchar_t's size seems to
@@ -133,11 +134,11 @@ mcsrtombs and wcsrtombs in particular.</para>
</para>
</section>
-<section id="codecvt.design.unicode">
- <title>Support for Unicode</title>
+<section xml:id="codecvt.design.unicode"><info><title>Support for Unicode</title></info>
+
<para>
Probably the most frequently asked question about code conversion
- is: &quot;So dudes, what's the deal with Unicode strings?&quot;
+ is: "So dudes, what's the deal with Unicode strings?"
The dude part is optional, but apparently the usefulness of
Unicode strings is pretty widely appreciated. Sadly, this specific
encoding (And other useful encodings like UTF8, UCS4, ISO 8859-10,
@@ -190,7 +191,7 @@ UTF-16, UTF8, UTF16).
<para>
For iconv-based implementations, string literals for each of the
-encodings (i.e. &quot;UCS-2&quot; and &quot;UTF-8&quot;) are necessary,
+encodings (i.e. "UCS-2" and "UTF-8") are necessary,
although for other,
non-iconv implementations a table of enumerated values or some other
mechanism may be required.
@@ -204,14 +205,14 @@ mechanism may be required.
<listitem><para>
Some encodings require explicit endian-ness. As such, some kind
of endian marker or other byte-order marker will be necessary. See
- &quot;Footnotes for C/C++ developers&quot; in Haible for more information on
+ "Footnotes for C/C++ developers" in Haible for more information on
UCS-2/Unicode endian issues. (Summary: big endian seems most likely,
however implementations, most notably Microsoft, vary.)
</para></listitem>
<listitem><para>
Types representing the conversion state, for conversions involving
- the machinery in the &quot;C&quot; library, or the conversion descriptor, for
+ the machinery in the "C" library, or the conversion descriptor, for
conversions using iconv (such as the type iconv_t.) Note that the
conversion descriptor encodes more information than a simple encoding
state type.
@@ -238,13 +239,13 @@ mechanism may be required.
</itemizedlist>
</section>
-<section id="codecvt.design.issues">
- <title>Other Issues</title>
+<section xml:id="codecvt.design.issues"><info><title>Other Issues</title></info>
+
<para>
In addition, multi-threaded and multi-locale environments also impact
the design and requirements for code conversions. In particular, they
affect the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt;
-when implemented using standard &quot;C&quot; functions.
+when implemented using standard "C" functions.
</para>
<para>
@@ -267,7 +268,7 @@ incorrect. Yikes!
<para>
The last, and fundamental problem, is the assumption of a global
-locale for all the &quot;C&quot; functions referenced above. For something like
+locale for all the "C" functions referenced above. For something like
C++ iostreams (where codecvt is explicitly used) the notion of
multiple locales is fundamental. In practice, most users may not run
into this limitation. However, as a quality of implementation issue,
@@ -288,8 +289,8 @@ LC_CTYPE category implements.
</section>
-<section id="facet.codecvt.impl">
-<title>Implementation</title>
+<section xml:id="facet.codecvt.impl"><info><title>Implementation</title></info>
+
<para>
The two required specializations are implemented as follows:
@@ -434,8 +435,8 @@ codecvt usage.
</section>
-<section id="facet.codecvt.use">
-<title>Use</title>
+<section xml:id="facet.codecvt.use"><info><title>Use</title></info>
+
<para>A conversions involving string literal.</para>
<programlisting>
@@ -479,8 +480,8 @@ codecvt usage.
</section>
-<section id="facet.codecvt.future">
-<title>Future</title>
+<section xml:id="facet.codecvt.future"><info><title>Future</title></info>
+
<itemizedlist>
<listitem>
<para>
@@ -521,7 +522,7 @@ codecvt usage.
</para></listitem>
<listitem><para>
- how to synchronize the &quot;C&quot; and &quot;C++&quot;
+ how to synchronize the "C" and "C++"
conversion information?
</para></listitem>
@@ -535,21 +536,15 @@ codecvt usage.
</section>
-<bibliography id="facet.codecvt.biblio">
-<title>Bibliography</title>
+<bibliography xml:id="facet.codecvt.biblio"><info><title>Bibliography</title></info>
+
<biblioentry>
- <title>
+ <citetitle>
The GNU C Library
- </title>
- <author>
- <surname>McGrath</surname>
- <firstname>Roland</firstname>
- </author>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2007</year>
<holder>FSF</holder>
@@ -560,23 +555,20 @@ codecvt usage.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Correspondence
- </title>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2002</year>
- <holder></holder>
+ <holder/>
</copyright>
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 14882:1998 Programming languages - C++
- </title>
+ </citetitle>
<copyright>
<year>1998</year>
<holder>ISO</holder>
@@ -584,9 +576,9 @@ codecvt usage.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 9899:1999 Programming languages - C
- </title>
+ </citetitle>
<copyright>
<year>1999</year>
<holder>ISO</holder>
@@ -594,13 +586,11 @@ codecvt usage.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.opengroup.org/austin">
- <citetitle>
- System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin" class="uri">
</biblioid>
+ <citetitle>
+ System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </citetitle>
<copyright>
<year>2008</year>
<holder>
@@ -611,13 +601,10 @@ codecvt usage.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
The C++ Programming Language, Special Edition
- </title>
- <author>
- <surname>Stroustrup</surname>
- <firstname>Bjarne</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley, Inc.</holder>
@@ -632,20 +619,14 @@ codecvt usage.
<biblioentry>
- <title>
+ <citetitle>
Standard C++ IOStreams and Locales
- </title>
+ </citetitle>
<subtitle>
Advanced Programmer's Guide and Reference
</subtitle>
- <author>
- <surname>Langer</surname>
- <firstname>Angelika</firstname>
- </author>
- <author>
- <surname>Kreft</surname>
- <firstname>Klaus</firstname>
- </author>
+ <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
+ <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley Longman, Inc.</holder>
@@ -658,46 +639,34 @@ codecvt usage.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.lysator.liu.se/c/na1.html">
- <citetitle>
- A brief description of Normative Addendum 1
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.lysator.liu.se/c/na1.html" class="uri">
</biblioid>
- <author>
- <surname>Feather</surname>
- <firstname>Clive</firstname>
- </author>
+ <citetitle>
+ A brief description of Normative Addendum 1
+ </citetitle>
+
+ <author><personname><surname>Feather</surname><firstname>Clive</firstname></personname></author>
<pagenums>Extended Character Sets</pagenums>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://tldp.org/HOWTO/Unicode-HOWTO.html">
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://tldp.org/HOWTO/Unicode-HOWTO.html" class="uri">
+ </biblioid>
<citetitle>
The Unicode HOWTO
</citetitle>
- </ulink>
- </biblioid>
- <author>
- <surname>Haible</surname>
- <firstname>Bruno</firstname>
- </author>
+
+ <author><personname><surname>Haible</surname><firstname>Bruno</firstname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">
- <citetitle>
- UTF-8 and Unicode FAQ for Unix/Linux
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" class="uri">
</biblioid>
- <author>
- <surname>Khun</surname>
- <firstname>Markus</firstname>
- </author>
+ <citetitle>
+ UTF-8 and Unicode FAQ for Unix/Linux
+ </citetitle>
+
+ <author><personname><surname>Khun</surname><firstname>Markus</firstname></personname></author>
</biblioentry>
</bibliography>
diff --git a/libstdc++-v3/doc/xml/manual/concurrency.xml b/libstdc++-v3/doc/xml/manual/concurrency.xml
index f6a7366ff0d..e3dd9b9468a 100644
--- a/libstdc++-v3/doc/xml/manual/concurrency.xml
+++ b/libstdc++-v3/doc/xml/manual/concurrency.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.concurrency" xreflabel="Concurrency">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.concurrency" xreflabel="Concurrency">
<?dbhtml filename="concurrency.html"?>
-<chapterinfo>
+<info><title>
+ Concurrency
+ <indexterm><primary>Concurrency</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -27,12 +26,9 @@
condition_variable
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Concurrency
- <indexterm><primary>Concurrency</primary></indexterm>
-</title>
<para>
Facilities for concurrent operation, and control thereof.
@@ -40,8 +36,8 @@
<!-- Sect1 01 : API -->
-<sect1 id="std.concurrency.api">
- <title>API Reference</title>
+<section xml:id="std.concurrency.api"><info><title>API Reference</title></info>
+
<para>
All items are declared in one of four standard header files.
@@ -80,6 +76,6 @@
<!-- Doxygen XML: api/group__concurrency.xml -->
-</sect1>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml b/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
index 2b4a09ad8ea..9092c8def61 100644
--- a/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
+++ b/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
@@ -1,12 +1,8 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="manual.ext.concurrency" xreflabel="Concurrency Extensions">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext.concurrency" xreflabel="Concurrency Extensions">
<?dbhtml filename="ext_concurrency.html"?>
-<chapterinfo>
+<info><title>Concurrency</title>
<keywordset>
<keyword>
ISO C++
@@ -15,15 +11,15 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>Concurrency</title>
-<sect1 id="manual.ext.concurrency.design" xreflabel="Design">
- <title>Design</title>
+<section xml:id="manual.ext.concurrency.design" xreflabel="Design"><info><title>Design</title></info>
+
- <sect2 id="manual.ext.concurrency.design.threads" xreflabel="Threads API">
- <title>Interface to Locks and Mutexes</title>
+ <section xml:id="manual.ext.concurrency.design.threads" xreflabel="Threads API"><info><title>Interface to Locks and Mutexes</title></info>
+
<para>The file &lt;ext/concurrence.h&gt; contains all the higher-level
constructs for playing with threads. In contrast to the atomics layer,
@@ -78,10 +74,10 @@ locks it during construction of <code>__scoped_locke</code> and
unlocks it during destruction. This is an efficient way of locking
critical sections, while retaining exception-safety.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.ext.concurrency.design.atomics" xreflabel="Atomic API">
- <title>Interface to Atomic Functions</title>
+ <section xml:id="manual.ext.concurrency.design.atomics" xreflabel="Atomic API"><info><title>Interface to Atomic Functions</title></info>
+
<para>
@@ -186,15 +182,15 @@ _GLIBCXX_WRITE_MEM_BARRIER
Which expand to the appropriate write and read barrier required by the
host hardware and operating system.
</para>
- </sect2>
+ </section>
-</sect1>
+</section>
-<sect1 id="manual.ext.concurrency.impl" xreflabel="Implementation">
- <title>Implementation</title>
- <sect2 id="manual.ext.concurrency.impl.atomic_fallbacks" xreflabel="Atomic F">
- <title>Using Builtin Atomic Functions</title>
+<section xml:id="manual.ext.concurrency.impl" xreflabel="Implementation"><info><title>Implementation</title></info>
+
+ <section xml:id="manual.ext.concurrency.impl.atomic_fallbacks" xreflabel="Atomic F"><info><title>Using Builtin Atomic Functions</title></info>
+
<para>The functions for atomic operations described above are either
implemented via compiler intrinsics (if the underlying host is
@@ -253,16 +249,16 @@ hardware, hand-crafted assembly is selected. This is the case for the following
<para>And for the rest, a simulated atomic lock via pthreads.
</para>
-<para> Detailed information about compiler intrinsics for atomic operations can be found in the GCC <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html"> documentation</ulink>.
+<para> Detailed information about compiler intrinsics for atomic operations can be found in the GCC <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html"> documentation</link>.
</para>
<para> More details on the library fallbacks from the porting <link linkend="internals.thread_safety">section</link>.
</para>
- </sect2>
- <sect2 id="manual.ext.concurrency.impl.thread" xreflabel="Pthread">
- <title>Thread Abstraction</title>
+ </section>
+ <section xml:id="manual.ext.concurrency.impl.thread" xreflabel="Pthread"><info><title>Thread Abstraction</title></info>
+
<para>A thin layer above IEEE 1003.1 (i.e. pthreads) is used to abstract
the thread interface for GCC. This layer is called "gthread," and is
@@ -276,7 +272,7 @@ the current host. In libstdc++ implementation files,
</para>
<para>Within libstdc++ sources, all calls to underlying thread functionality
-use this layer. More detail as to the specific interface can be found in the source <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00883_source.html">documentation</ulink>.
+use this layer. More detail as to the specific interface can be found in the source <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00883_source.html">documentation</link>.
</para>
<para>By design, the gthread layer is interoperable with the types,
@@ -285,12 +281,12 @@ including <code>pthread_t</code>, <code>pthread_once_t</code>, <code>pthread_cre
etc.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
-<sect1 id="manual.ext.concurrency.use" xreflabel="Use">
+<section xml:id="manual.ext.concurrency.use" xreflabel="Use"><info><title>Use</title></info>
- <title>Use</title>
+
<para>Typical usage of the last two constructs is demonstrated as follows:
</para>
@@ -332,6 +328,6 @@ and <code>__concurrence_broadcast_error</code>.
</para>
-</sect1>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
index 26af74582c9..4c983a4fd2d 100644
--- a/libstdc++-v3/doc/xml/manual/configure.xml
+++ b/libstdc++-v3/doc/xml/manual/configure.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.intro.setup.configure" xreflabel="Configuring">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.intro.setup.configure" xreflabel="Configuring">
<?dbhtml filename="configure.html"?>
-<sect1info>
+<info><title>Configure</title>
<keywordset>
<keyword>
ISO C++
@@ -13,9 +14,9 @@
options
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>Configure</title>
<para>
When configuring libstdc++, you'll have to configure the entire
@@ -29,8 +30,8 @@
Here are all of the configure options specific to libstdc++. Keep
in mind that
<!-- This SECnn should be the "Choosing Package Options" section. -->
- <ulink url="http://sourceware.org/autobook/autobook/autobook_14.html">they
- all have opposite forms as well</ulink> (enable/disable and
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://sourceware.org/autobook/autobook/autobook_14.html">they
+ all have opposite forms as well</link> (enable/disable and
with/without). The defaults are for the <emphasis>current
development sources</emphasis>, which may be different than those
for released versions.
@@ -43,8 +44,8 @@
<variablelist>
<varlistentry><term><code>--enable-multilib</code>[default]</term>
<listitem><para>This is part of the generic multilib support for building cross
- compilers. As such, targets like &quot;powerpc-elf&quot; will have
- libstdc++ built many different ways: &quot;-msoft-float&quot;
+ compilers. As such, targets like "powerpc-elf" will have
+ libstdc++ built many different ways: "-msoft-float"
and not, etc. A different libstdc++ will be built for each of
the different multilib versions. This option is on by default.
</para>
@@ -68,15 +69,15 @@
libstdc++'s include files will be installed in
<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
unless you also specify
- <literal>--with-gxx-include-dir=<filename class="directory">dirname</filename></literal> during configuration.
+ <literal>--with-gxx-include-dir=</literal><filename class="directory">dirname</filename> during configuration.
</para>
</listitem></varlistentry>
<varlistentry><term><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></term>
<listitem><para>Adds support for named libstdc++ include directory. For instance,
the following puts all the libstdc++ headers into a directory
- called &quot;4.4-20090404&quot; instead of the usual
- &quot;c++/(version)&quot;.
+ called "4.4-20090404" instead of the usual
+ "c++/(version)".
</para>
<programlisting>
--with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/4.4-20090404</programlisting> </listitem></varlistentry>
@@ -89,7 +90,7 @@
<varlistentry><term><code>--enable-cstdio=OPTION</code></term>
<listitem><para>Select a target-specific I/O package. At the moment, the only
- choice is to use 'stdio', a generic &quot;C&quot; abstraction.
+ choice is to use 'stdio', a generic "C" abstraction.
The default is 'stdio'. This option can change the library ABI.
</para>
</listitem></varlistentry>
@@ -105,9 +106,9 @@
choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
(IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
'gnu' to specify a model based on functionality from the GNU C
- library (langinfo/iconv/gettext) (from <ulink url="http://sources.redhat.com/glibc/">glibc</ulink>, the GNU C
- library), or 'generic' to use a generic &quot;C&quot;
- abstraction which consists of &quot;C&quot; locale info.
+ library (langinfo/iconv/gettext) (from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://sources.redhat.com/glibc/">glibc</link>, the GNU C
+ library), or 'generic' to use a generic "C"
+ abstraction which consists of "C" locale info.
</para>
<para>If not explicitly specified, the configure proccess tries
@@ -154,8 +155,8 @@
<varlistentry><term><code>--enable-threads=OPTION</code></term>
<listitem><para>Select a threading library. A full description is
given in the
- general <ulink url="http://gcc.gnu.org/install/configure.html">compiler
- configuration instructions</ulink>. This option can change the
+ general <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/configure.html">compiler
+ configuration instructions</link>. This option can change the
library ABI.
</para>
</listitem></varlistentry>
@@ -218,13 +219,13 @@
</listitem></varlistentry>
<varlistentry><term><code>--enable-c99</code></term>
- <listitem><para>The &quot;long long&quot; type was introduced in C99, along
+ <listitem><para>The "long long" type was introduced in C99, along
with many other functions for wide characters, and math
classification macros, etc. If enabled, all C99 functions not
specified by the C++ standard will be put into <code>namespace
__gnu_cxx</code>, and then all these names will
be injected into namespace std, so that C99 functions can be
- used &quot;as if&quot; they were in the C++ standard (as they
+ used "as if" they were in the C++ standard (as they
will eventually be in some future revision of the standard,
without a doubt). By default, C99 support is on, assuming the
configure probes find all the necessary functions and bits
@@ -233,7 +234,7 @@
</listitem></varlistentry>
<varlistentry><term><code>--enable-wchar_t</code>[default]</term>
- <listitem><para>Template specializations for the &quot;wchar_t&quot; type are
+ <listitem><para>Template specializations for the "wchar_t" type are
required for wide character conversion support. Disabling
wide character specializations may be expedient for initial
porting efforts, but builds only a subset of what is required by
@@ -243,14 +244,14 @@
</listitem></varlistentry>
<varlistentry><term><code>--enable-long-long </code></term>
- <listitem><para>The &quot;long long&quot; type was introduced in C99. It is
+ <listitem><para>The "long long" type was introduced in C99. It is
provided as a GNU extension to C++98 in g++. This flag builds
- support for &quot;long long&quot; into the library (specialized
+ support for "long long" into the library (specialized
templates and the like for iostreams). This option is on by default:
- if enabled, users will have to either use the new-style &quot;C&quot;
+ if enabled, users will have to either use the new-style "C"
headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
or add appropriate compile-time flags to all compile lines to
- allow &quot;C&quot; visibility of this feature (on GNU/Linux,
+ allow "C" visibility of this feature (on GNU/Linux,
the flag is -D_ISOC99_SOURCE, which is added automatically via
CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
This option can change the library ABI.
@@ -279,8 +280,8 @@
<listitem><para>In 3.1 and later, tries to turn on symbol versioning in the
shared library (if a shared library has been
requested). Values for 'style' that are currently supported
- are 'gnu', 'gnu-versioned-namespace', 'darwin', and
- 'darwin-export'. Both gnu- options require that a recent
+ are 'gnu', 'gnu-versioned-namespace', 'darwin',
+ 'darwin-export', and 'sun'. Both gnu- options require that a recent
version of the GNU linker be in use. Both darwin options are
equivalent. With no style given, the configure script will try
to guess correct defaults for the host system, probe to see if
@@ -347,4 +348,4 @@
</variablelist>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/containers.xml b/libstdc++-v3/doc/xml/manual/containers.xml
index 3b4fb4baa07..377b1a2ee6f 100644
--- a/libstdc++-v3/doc/xml/manual/containers.xml
+++ b/libstdc++-v3/doc/xml/manual/containers.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.containers" xreflabel="Containers">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.containers" xreflabel="Containers">
<?dbhtml filename="containers.html"?>
-<chapterinfo>
+<info><title>
+ Containers
+ <indexterm><primary>Containers</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,28 +14,24 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Containers
- <indexterm><primary>Containers</primary></indexterm>
-</title>
<!-- Sect1 01 : Sequences -->
-<sect1 id="std.containers.sequences" xreflabel="Sequences">
+<section xml:id="std.containers.sequences" xreflabel="Sequences"><info><title>Sequences</title></info>
<?dbhtml filename="sequences.html"?>
- <title>Sequences</title>
+
-<sect2 id="containers.sequences.list" xreflabel="list">
+<section xml:id="containers.sequences.list" xreflabel="list"><info><title>list</title></info>
<?dbhtml filename="list.html"?>
- <title>list</title>
- <sect3 id="sequences.list.size" xreflabel="list::size() is O(n)">
- <title>list::size() is O(n)</title>
+
+ <section xml:id="sequences.list.size" xreflabel="list::size() is O(n)"><info><title>list::size() is O(n)</title></info>
+
<para>
Yes it is, and that's okay. This is a decision that we preserved
when we imported SGI's STL implementation. The following is
- quoted from <ulink
- url="http://www.sgi.com/tech/stl/FAQ.html">their FAQ</ulink>:
+ quoted from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/FAQ.html">their FAQ</link>:
</para>
<blockquote>
<para>
@@ -78,41 +73,38 @@
...
</programlisting>
</blockquote>
- </sect3>
-</sect2>
+ </section>
+</section>
-<sect2 id="containers.sequences.vector" xreflabel="vector">
+<section xml:id="containers.sequences.vector" xreflabel="vector"><info><title>vector</title></info>
<?dbhtml filename="vector.html"?>
- <title>vector</title>
+
<para>
</para>
- <sect3 id="sequences.vector.management" xreflabel="Space Overhead Management">
- <title>Space Overhead Management</title>
+ <section xml:id="sequences.vector.management" xreflabel="Space Overhead Management"><info><title>Space Overhead Management</title></info>
+
<para>
- In <ulink
- url="http://gcc.gnu.org/ml/libstdc++/2002-04/msg00105.html">this
- message to the list</ulink>, Daniel Kostecky announced work on an
+ In <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-04/msg00105.html">this
+ message to the list</link>, Daniel Kostecky announced work on an
alternate form of <code>std::vector</code> that would support
hints on the number of elements to be over-allocated. The design
was also described, along with possible implementation choices.
</para>
<para>
- The first two alpha releases were announced <ulink
- url="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00048.html">here</ulink>
- and <ulink
- url="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00111.html">here</ulink>.
+ The first two alpha releases were announced <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00048.html">here</link>
+ and <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00111.html">here</link>.
</para>
- </sect3></sect2>
-</sect1>
+ </section></section>
+</section>
<!-- Sect1 02 : Associative -->
-<sect1 id="std.containers.associative" xreflabel="Associative">
+<section xml:id="std.containers.associative" xreflabel="Associative"><info><title>Associative</title></info>
<?dbhtml filename="associative.html"?>
- <title>Associative</title>
+
- <sect2 id="containers.associative.insert_hints" xreflabel="Insertion Hints">
- <title>Insertion Hints</title>
+ <section xml:id="containers.associative.insert_hints" xreflabel="Insertion Hints"><info><title>Insertion Hints</title></info>
+
<para>
Section [23.1.2], Table 69, of the C++ standard lists this
function for all of the associative containers (map, set, etc):
@@ -125,8 +117,7 @@
item to insert. The standard says that <quote><code>t</code> is
inserted as close as possible to the position just prior to
<code>p</code>.</quote> (Library DR #233 addresses this topic,
- referring to <ulink
- url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html">N1780</ulink>.
+ referring to <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html">N1780</link>.
Since version 4.2 GCC implements the resolution to DR 233, so
that insertions happen as close as possible to the hint. For
earlier releases the hint was only used as described below.
@@ -216,14 +207,14 @@
point to the correct place, then no further local searching is
done; the search begins from scratch in logarithmic time.
</para>
- </sect2>
+ </section>
- <sect2 id="containers.associative.bitset" xreflabel="bitset">
+ <section xml:id="containers.associative.bitset" xreflabel="bitset"><info><title>bitset</title></info>
<?dbhtml filename="bitset.html"?>
- <title>bitset</title>
- <sect3 id="associative.bitset.size_variable" xreflabel="Variable">
- <title>Size Variable</title>
+
+ <section xml:id="associative.bitset.size_variable" xreflabel="Variable"><info><title>Size Variable</title></info>
+
<para>
No, you cannot write code of the form
</para>
@@ -254,7 +245,7 @@
</itemizedlist>
<para>
<emphasis>A very large N in
- <code>bitset&lt;N&gt;</code>.&nbsp;&nbsp;</emphasis> It has been
+ <code>bitset&lt;N&gt;</code>.  </emphasis> It has been
pointed out a few times in newsgroups that N bits only takes up
(N/8) bytes on most systems, and division by a factor of eight is
pretty impressive when speaking of memory. Half a megabyte given
@@ -276,7 +267,7 @@
space overhead, but it's all allocated inside the object.)
</para>
<para>
- <emphasis>A container&lt;bool&gt;.&nbsp;&nbsp;</emphasis> The
+ <emphasis>A container&lt;bool&gt;.  </emphasis> The
Committee made provision for the space savings possible with that
(N/8) usage previously mentioned, so that you don't have to do
wasteful things like <code>Container&lt;char&gt;</code> or
@@ -297,7 +288,7 @@
than that of vector).
</para>
<para>
- <emphasis>Extremely weird solutions.&nbsp;&nbsp;</emphasis> If
+ <emphasis>Extremely weird solutions.  </emphasis> If
you have access to the compiler and linker at runtime, you can do
something insane, like figuring out just how many bits you need,
then writing a temporary source code file. That file contains an
@@ -329,9 +320,9 @@
<link linkend="manual.ext.containers.sgi">some extensions</link>.
</para>
- </sect3>
- <sect3 id="associative.bitset.type_string" xreflabel="Type String">
- <title>Type String</title>
+ </section>
+ <section xml:id="associative.bitset.type_string" xreflabel="Type String"><info><title>Type String</title></info>
+
<para>
</para>
<para>
@@ -357,18 +348,18 @@
<programlisting>
std::bitset&lt;5&gt; b ( <quote>10110</quote> ); // invalid
</programlisting>
- </sect3>
- </sect2>
+ </section>
+ </section>
-</sect1>
+</section>
<!-- Sect1 03 : Interacting with C -->
-<sect1 id="std.containers.c" xreflabel="Interacting with C">
+<section xml:id="std.containers.c" xreflabel="Interacting with C"><info><title>Interacting with C</title></info>
<?dbhtml filename="containers_and_c.html"?>
- <title>Interacting with C</title>
+
- <sect2 id="containers.c.vs_array" xreflabel="Containers vs. Arrays">
- <title>Containers vs. Arrays</title>
+ <section xml:id="containers.c.vs_array" xreflabel="Containers vs. Arrays"><info><title>Containers vs. Arrays</title></info>
+
<para>
You're writing some code and can't decide whether to use builtin
arrays or some kind of container. There are compelling reasons
@@ -464,8 +455,8 @@ template&lt;typename T, unsigned int sz&gt;
<para>
looks just weird! Hint: unused parameters can be left nameless.
</para>
- </sect2>
+ </section>
-</sect1>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/ctype.xml b/libstdc++-v3/doc/xml/manual/ctype.xml
index 9cc4603667d..afca9be5475 100644
--- a/libstdc++-v3/doc/xml/manual/ctype.xml
+++ b/libstdc++-v3/doc/xml/manual/ctype.xml
@@ -1,7 +1,8 @@
-<section id="std.localization.facet.ctype" xreflabel="ctype">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.localization.facet.ctype" xreflabel="ctype">
<?dbhtml filename="ctype.html"?>
-<sectioninfo>
+<info><title>ctype</title>
<keywordset>
<keyword>
ISO C++
@@ -10,15 +11,15 @@
ctype
</keyword>
</keywordset>
-</sectioninfo>
+</info>
-<title>ctype</title>
-<section id="facet.ctype.impl">
-<title>Implementation</title>
- <section>
- <title>Specializations</title>
+<section xml:id="facet.ctype.impl"><info><title>Implementation</title></info>
+
+
+ <section><info><title>Specializations</title></info>
+
<para>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
@@ -60,8 +61,8 @@ characters.
</section>
</section>
-<section id="facet.ctype.future">
-<title>Future</title>
+<section xml:id="facet.ctype.future"><info><title>Future</title></info>
+
<itemizedlist>
@@ -117,21 +118,15 @@ characters.
</section>
-<bibliography id="facet.ctype.biblio">
-<title>Bibliography</title>
+<bibliography xml:id="facet.ctype.biblio"><info><title>Bibliography</title></info>
+
<biblioentry>
- <title>
+ <citetitle>
The GNU C Library
- </title>
- <author>
- <surname>McGrath</surname>
- <firstname>Roland</firstname>
- </author>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2007</year>
<holder>FSF</holder>
@@ -140,23 +135,20 @@ characters.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Correspondence
- </title>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2002</year>
- <holder></holder>
+ <holder/>
</copyright>
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 14882:1998 Programming languages - C++
- </title>
+ </citetitle>
<copyright>
<year>1998</year>
<holder>ISO</holder>
@@ -164,9 +156,9 @@ characters.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 9899:1999 Programming languages - C
- </title>
+ </citetitle>
<copyright>
<year>1999</year>
<holder>ISO</holder>
@@ -174,13 +166,12 @@ characters.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.unix.org/version3/ieee_std.html">
- <citetitle>
- The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.unix.org/version3/ieee_std.html" class="uri">
+ </biblioid>
+ <citetitle>
+ The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
+ </citetitle>
+
<copyright>
<year>1999</year>
<holder>
@@ -189,13 +180,10 @@ characters.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
The C++ Programming Language, Special Edition
- </title>
- <author>
- <surname>Stroustrup</surname>
- <firstname>Bjarne</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley, Inc.</holder>
@@ -209,20 +197,14 @@ characters.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Standard C++ IOStreams and Locales
- </title>
+ </citetitle>
<subtitle>
Advanced Programmer's Guide and Reference
</subtitle>
- <author>
- <surname>Langer</surname>
- <firstname>Angelika</firstname>
- </author>
- <author>
- <surname>Kreft</surname>
- <firstname>Klaus</firstname>
- </author>
+ <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
+ <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley Longman, Inc.</holder>
diff --git a/libstdc++-v3/doc/xml/manual/debug.xml b/libstdc++-v3/doc/xml/manual/debug.xml
index 5f97867de2e..9772c368885 100644
--- a/libstdc++-v3/doc/xml/manual/debug.xml
+++ b/libstdc++-v3/doc/xml/manual/debug.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.intro.using.debug" xreflabel="Debugging Support">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.intro.using.debug" xreflabel="Debugging Support">
<?dbhtml filename="debug.html"?>
-<sect1info>
+<info><title>Debugging Support</title>
<keywordset>
<keyword>
C++
@@ -10,9 +11,9 @@
debug
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>Debugging Support</title>
<para>
There are numerous things that can be done to improve the ease with
@@ -20,8 +21,8 @@
are some of them.
</para>
-<sect2 id="debug.compiler">
-<title>Using <command>g++</command></title>
+<section xml:id="debug.compiler"><info><title>Using <command>g++</command></title></info>
+
<para>
Compiler flags determine how debug information is transmitted
between compilation and debug or analysis tools.
@@ -52,15 +53,14 @@
</para>
<para>
- Many other options are available: please see <ulink
- url="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging%20Options">"Options
- for Debugging Your Program"</ulink> in Using the GNU Compiler
+ Many other options are available: please see <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging%20Options">"Options
+ for Debugging Your Program"</link> in Using the GNU Compiler
Collection (GCC) for a complete list.
</para>
-</sect2>
+</section>
+
+<section xml:id="debug.req"><info><title>Debug Versions of Library Binary Files</title></info>
-<sect2 id="debug.req">
-<title>Debug Versions of Library Binary Files</title>
<para>
If you would like debug symbols in libstdc++, there are two ways to
@@ -79,8 +79,7 @@
debug build will persist, without having to specify
<code>CXXFLAGS</code>, and the debug library will be installed in a
separate directory tree, in <code>(prefix)/lib/debug</code>. For
- more information, look at the <link
- linkend="manual.intro.setup.configure">configuration</link> section.
+ more information, look at the <link linkend="manual.intro.setup.configure">configuration</link> section.
</para>
<para>
@@ -94,10 +93,10 @@
This quick and dirty approach is often sufficient for quick
debugging tasks, when you cannot or don't want to recompile your
application to use the <link linkend="manual.ext.debug_mode">debug mode</link>.</para>
-</sect2>
+</section>
+
+<section xml:id="debug.memory"><info><title>Memory Leak Hunting</title></info>
-<sect2 id="debug.memory">
-<title>Memory Leak Hunting</title>
<para>
There are various third party memory tracing and debug utilities
@@ -116,8 +115,7 @@
thing of great importance to keep in mind when debugging C++ code
that uses <code>new</code> and <code>delete</code>: there are
different kinds of allocation schemes that can be used by <code>
- std::allocator </code>. For implementation details, see the <link
- linkend="manual.ext.allocator.mt">mt allocator</link> documentation and
+ std::allocator </code>. For implementation details, see the <link linkend="manual.ext.allocator.mt">mt allocator</link> documentation and
look specifically for <code>GLIBCXX_FORCE_NEW</code>.
</para>
@@ -189,17 +187,16 @@
valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out
</programlisting>
-</sect2>
+</section>
+
+<section xml:id="debug.gdb"><info><title>Using <command>gdb</command></title></info>
-<sect2 id="debug.gdb">
-<title>Using <command>gdb</command></title>
<para>
</para>
<para>
- Many options are available for gdb itself: please see <ulink
- url="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC125">
- "GDB features for C++" </ulink> in the gdb documentation. Also
+ Many options are available for gdb itself: please see <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC125">
+ "GDB features for C++" </link> in the gdb documentation. Also
recommended: the other parts of this manual.
</para>
@@ -258,47 +255,47 @@
<para>
For additional information on STL support and GDB please visit:
- <ulink url="http://sourceware.org/gdb/wiki/STLSupport"> "GDB Support
- for STL" </ulink> in the GDB wiki. Additionally, in-depth
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://sourceware.org/gdb/wiki/STLSupport"> "GDB Support
+ for STL" </link> in the GDB wiki. Additionally, in-depth
documentation and discussion of the pretty printing feature can be
found in "Pretty Printing" node in the GDB manual. You can find
on-line versions of the GDB user manual in GDB's homepage, at
- <ulink url="http://sourceware.org/gdb/"> "GDB: The GNU Project
- Debugger" </ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://sourceware.org/gdb/"> "GDB: The GNU Project
+ Debugger" </link>.
</para>
-</sect2>
+</section>
+
+<section xml:id="debug.exceptions"><info><title>Tracking uncaught exceptions</title></info>
-<sect2 id="debug.exceptions">
-<title>Tracking uncaught exceptions</title>
<para>
The <link linkend="support.termination.verbose">verbose
termination handler</link> gives information about uncaught
exceptions which are killing the program. It is described in the
linked-to page.
</para>
-</sect2>
+</section>
+
+<section xml:id="debug.debug_mode"><info><title>Debug Mode</title></info>
-<sect2 id="debug.debug_mode">
-<title>Debug Mode</title>
<para> The <link linkend="manual.ext.debug_mode">Debug Mode</link>
has compile and run-time checks for many containers.
</para>
-</sect2>
+</section>
+
+<section xml:id="debug.compile_time_checks"><info><title>Compile Time Checking</title></info>
-<sect2 id="debug.compile_time_checks">
-<title>Compile Time Checking</title>
<para> The <link linkend="manual.ext.compile_checks">Compile-Time
Checks</link> Extension has compile-time checks for many algorithms.
</para>
-</sect2>
+</section>
+
+<section xml:id="debug.profile_mode" xreflabel="debug.profile_mode"><info><title>Profile-based Performance Analysis</title></info>
-<sect2 id="debug.profile_mode" xreflabel="debug.profile_mode">
-<title>Profile-based Performance Analysis</title>
<para> The <link linkend="manual.ext.profile_mode">Profile-based
Performance Analysis</link> Extension has performance checks for many
algorithms.
</para>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/debug_mode.xml b/libstdc++-v3/doc/xml/manual/debug_mode.xml
index c3b3b57859d..f0ab4992846 100644
--- a/libstdc++-v3/doc/xml/manual/debug_mode.xml
+++ b/libstdc++-v3/doc/xml/manual/debug_mode.xml
@@ -1,12 +1,8 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="manual.ext.debug_mode" xreflabel="Debug Mode">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext.debug_mode" xreflabel="Debug Mode">
<?dbhtml filename="debug_mode.html"?>
-<chapterinfo>
+<info><title>Debug Mode</title>
<keywordset>
<keyword>
C++
@@ -18,12 +14,12 @@
debug
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>Debug Mode</title>
-<sect1 id="manual.ext.debug_mode.intro" xreflabel="Intro">
- <title>Intro</title>
+<section xml:id="manual.ext.debug_mode.intro" xreflabel="Intro"><info><title>Intro</title></info>
+
<para>
By default, libstdc++ is built with efficiency in mind, and
therefore performs little or no error checking that is not
@@ -65,10 +61,10 @@
different predicate.</para></listitem>
</itemizedlist>
-</sect1>
+</section>
-<sect1 id="manual.ext.debug_mode.semantics" xreflabel="Semantics">
- <title>Semantics</title>
+<section xml:id="manual.ext.debug_mode.semantics" xreflabel="Semantics"><info><title>Semantics</title></info>
+
<para>
</para>
@@ -146,14 +142,14 @@ guaranteed to work. For full debug-mode support you can use the
which always works correctly.
</para>
-</sect1>
+</section>
-<sect1 id="manual.ext.debug_mode.using" xreflabel="Using">
- <title>Using</title>
+<section xml:id="manual.ext.debug_mode.using" xreflabel="Using"><info><title>Using</title></info>
+
<para>
</para>
-<sect2 id="debug_mode.using.mode" xreflabel="Using Mode">
- <title>Using the Debug Mode</title>
+<section xml:id="debug_mode.using.mode" xreflabel="Using Mode"><info><title>Using the Debug Mode</title></info>
+
<para>To use the libstdc++ debug mode, compile your application with the
compiler flag <code>-D_GLIBCXX_DEBUG</code>. Note that this flag
@@ -168,10 +164,10 @@ which always works correctly.
<code>GLIBCXX_DEBUG_MESSAGE_LENGTH</code> can be used to request a
different length.</para>
-</sect2>
+</section>
-<sect2 id="debug_mode.using.specific" xreflabel="Using Specific">
- <title>Using a Specific Debug Container</title>
+<section xml:id="debug_mode.using.specific" xreflabel="Using Specific"><info><title>Using a Specific Debug Container</title></info>
+
<para>When it is not feasible to recompile your entire application, or
only specific containers need checking, debugging containers are
available as GNU extensions. These debugging containers are
@@ -183,13 +179,14 @@ which always works correctly.
containers:
</para>
-<table frame='all'>
+<table frame="all">
<title>Debugging Containers</title>
-<tgroup cols='4' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
@@ -274,13 +271,14 @@ which always works correctly.
containers have additional debug capability.
</para>
-<table frame='all'>
+<table frame="all">
<title>Debugging Containers C++0x</title>
-<tgroup cols='4' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
@@ -318,15 +316,15 @@ containers have additional debug capability.
</tbody>
</tgroup>
</table>
-</sect2>
-</sect1>
+</section>
+</section>
-<sect1 id="manual.ext.debug_mode.design" xreflabel="Design">
- <title>Design</title>
+<section xml:id="manual.ext.debug_mode.design" xreflabel="Design"><info><title>Design</title></info>
+
<para>
</para>
- <sect2 id="debug_mode.design.goals" xreflabel="Goals">
- <title>Goals</title>
+ <section xml:id="debug_mode.design.goals" xreflabel="Goals"><info><title>Goals</title></info>
+
<para>
</para>
<para> The libstdc++ debug mode replaces unsafe (but efficient) standard
@@ -376,7 +374,7 @@ containers have additional debug capability.
higher-numbered conformance levels are more usable (i.e., require
less recompilation) but are more complicated to implement than
the lower-numbered conformance levels.
- <orderedlist>
+ <orderedlist inheritnum="ignore" continuation="restarts">
<listitem><para><emphasis>Full recompilation</emphasis>: The user must recompile his or
her entire application and all C++ libraries it depends on,
including the C++ standard library that ships with the
@@ -438,18 +436,18 @@ containers have additional debug capability.
</orderedlist>
</para></listitem>
</itemizedlist>
- </sect2>
+ </section>
- <sect2 id="debug_mode.design.methods" xreflabel="Methods">
- <title>Methods</title>
+ <section xml:id="debug_mode.design.methods" xreflabel="Methods"><info><title>Methods</title></info>
+
<para>
</para>
<para>This section provides an overall view of the design of the
libstdc++ debug mode and details the relationship between design
decisions and the stated design goals.</para>
- <sect3 id="debug_mode.design.methods.wrappers" xreflabel="Method Wrapper">
- <title>The Wrapper Model</title>
+ <section xml:id="debug_mode.design.methods.wrappers" xreflabel="Method Wrapper"><info><title>The Wrapper Model</title></info>
+
<para>The libstdc++ debug mode uses a wrapper model where the
debugging versions of library components (e.g., iterators and
containers) form a layer on top of the release versions of the
@@ -471,8 +469,8 @@ containers have additional debug capability.
past-the-end iterators or inserting into a container using an
iterator from a different container.</para>
- <sect4 id="debug_mode.design.methods.safe_iter" xreflabel="Method Safe Iter">
- <title>Safe Iterators</title>
+ <section xml:id="debug_mode.design.methods.safe_iter" xreflabel="Method Safe Iter"><info><title>Safe Iterators</title></info>
+
<para>Iterator wrappers provide a debugging layer over any iterator that
is attached to a particular container, and will manage the
information detailing the iterator's state (singular,
@@ -492,10 +490,10 @@ containers have additional debug capability.
whose <code>iterator</code> or <code>const_iterator</code> typedef
is the type of the safe iterator.</para></listitem>
</itemizedlist>
- </sect4>
+ </section>
- <sect4 id="debug_mode.design.methods.safe_seq" xreflabel="Method Safe Seq">
- <title>Safe Sequences (Containers)</title>
+ <section xml:id="debug_mode.design.methods.safe_seq" xreflabel="Method Safe Seq"><info><title>Safe Sequences (Containers)</title></info>
+
<para>Container wrappers provide a debugging layer over a particular
container type. Because containers vary greatly in the member
@@ -540,11 +538,11 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
// duplicate std::list interface with debugging semantics
};
</programlisting>
- </sect4>
- </sect3>
+ </section>
+ </section>
- <sect3 id="debug_mode.design.methods.precond" xreflabel="Precondition check">
- <title>Precondition Checking</title>
+ <section xml:id="debug_mode.design.methods.precond" xreflabel="Precondition check"><info><title>Precondition Checking</title></info>
+
<para>The debug mode operates primarily by checking the preconditions of
all standard library operations that it supports. Preconditions that
are always checked (regardless of whether or not we are in debug
@@ -575,10 +573,10 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
check macro that supports more advance formulation of error
messages, <code>_GLIBCXX_DEBUG_VERIFY</code>. These macros are
documented more thoroughly in the debug mode source code.</para>
- </sect3>
+ </section>
- <sect3 id="debug_mode.design.methods.coexistence" xreflabel="Coexistence">
- <title>Release- and debug-mode coexistence</title>
+ <section xml:id="debug_mode.design.methods.coexistence" xreflabel="Coexistence"><info><title>Release- and debug-mode coexistence</title></info>
+
<para>The libstdc++ debug mode is the first debug mode we know of that
is able to provide the "Per-use recompilation" (4) guarantee, that
allows release-compiled and debug-compiled code to be linked and
@@ -591,16 +589,16 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
<para>Achieving link- and run-time coexistence is not a trivial
implementation task. To achieve this goal we required a small
extension to the GNU C++ compiler (since incorporated into the C++0x language specification, described in the GCC Manual for the C++ language as
- <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html#Namespace-Association">namespace
- association</ulink>), and a complex organization of debug- and
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html#Namespace-Association">namespace
+ association</link>), and a complex organization of debug- and
release-modes. The end result is that we have achieved per-use
recompilation but have had to give up some checking of the
<code>std::basic_string</code> class template (namely, safe
iterators).
</para>
- <sect4 id="methods.coexistence.compile" xreflabel="Compile">
- <title>Compile-time coexistence of release- and debug-mode components</title>
+ <section xml:id="methods.coexistence.compile" xreflabel="Compile"><info><title>Compile-time coexistence of release- and debug-mode components</title></info>
+
<para>Both the release-mode components and the debug-mode
components need to exist within a single translation unit so that
@@ -665,11 +663,11 @@ namespace std
inline namespace __debug { }
}
</programlisting>
- </sect4>
+ </section>
- <sect4 id="methods.coexistence.link" xreflabel="Link">
- <title>Link- and run-time coexistence of release- and
- debug-mode components</title>
+ <section xml:id="methods.coexistence.link" xreflabel="Link"><info><title>Link- and run-time coexistence of release- and
+ debug-mode components</title></info>
+
<para>Because each component has a distinct and separate release and
debug implementation, there is no issue with link-time
@@ -730,7 +728,7 @@ test02()
debug/release containers, we must note two things about locale
facets:</para>
-<orderedlist>
+<orderedlist inheritnum="ignore" continuation="restarts">
<listitem><para>They exist as shared state: one can create a facet in one
translation unit and access the facet via the same type name in a
different translation unit. This means that we cannot have two
@@ -752,10 +750,10 @@ test02()
simple alternatives (e.g., <code>__gnu_debug::basic_string</code>),
and the usability benefit we gain from the ability to mix debug- and
release-compiled translation units is enormous.</para>
- </sect4>
+ </section>
+
+ <section xml:id="methods.coexistence.alt" xreflabel="Alternatives"><info><title>Alternatives for Coexistence</title></info>
- <sect4 id="methods.coexistence.alt" xreflabel="Alternatives">
-<title>Alternatives for Coexistence</title>
<para>The coexistence scheme above was chosen over many alternatives,
including language-only solutions and solutions that also required
@@ -805,8 +803,8 @@ test02()
<listitem><para><emphasis> Use implementation-specific properties of anonymous
namespaces. </emphasis>
- See <ulink url="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00004.html"> this post
- </ulink>
+ See <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00004.html"> this post
+ </link>
This method fails the <emphasis>correctness</emphasis> criteria.</para></listitem>
<listitem><para><emphasis>Extension: allow reopening on namespaces</emphasis>: This would
@@ -832,8 +830,8 @@ test02()
functions taking no arguments in mixed-mode settings resulting in
equivalent link names, <code> vector::push_back() </code> being
one example.
- See <ulink url="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00177.html">link
- name</ulink> </para></listitem>
+ See <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00177.html">link
+ name</link> </para></listitem>
</itemizedlist>
<para>Other options may exist for implementing the debug mode, many of
@@ -848,12 +846,12 @@ test02()
added as we are able to identify other typical problem cases. These
test cases will serve as a benchmark by which we can compare debug
mode implementations.</para>
- </sect4>
- </sect3>
- </sect2>
+ </section>
+ </section>
+ </section>
- <sect2 id="debug_mode.design.other" xreflabel="Other">
- <title>Other Implementations</title>
+ <section xml:id="debug_mode.design.other" xreflabel="Other"><info><title>Other Implementations</title></info>
+
<para>
</para>
<para> There are several existing implementations of debug modes for C++
@@ -861,15 +859,15 @@ test02()
supports debugging for programs using libstdc++. The existing
implementations include:</para>
<itemizedlist>
- <listitem><para><ulink url="http://www.mathcs.sjsu.edu/faculty/horstman/safestl.html">SafeSTL</ulink>:
+ <listitem><para><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.mathcs.sjsu.edu/faculty/horstman/safestl.html">SafeSTL</link>:
SafeSTL was the original debugging version of the Standard Template
Library (STL), implemented by Cay S. Horstmann on top of the
Hewlett-Packard STL. Though it inspired much work in this area, it
has not been kept up-to-date for use with modern compilers or C++
standard library implementations.</para></listitem>
- <listitem><para><ulink url="http://www.stlport.org/">STLport</ulink>: STLport is a free
- implementation of the C++ standard library derived from the <ulink url="http://www.sgi.com/tech/stl/">SGI implementation</ulink>, and
+ <listitem><para><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.stlport.org/">STLport</link>: STLport is a free
+ implementation of the C++ standard library derived from the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/">SGI implementation</link>, and
ported to many other platforms. It includes a debug mode that uses a
wrapper model (that in some ways inspired the libstdc++ debug mode
design), although at the time of this writing the debug mode is
@@ -885,7 +883,7 @@ test02()
guarantee.</para></listitem>
</itemizedlist>
- </sect2>
-</sect1>
+ </section>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/diagnostics.xml b/libstdc++-v3/doc/xml/manual/diagnostics.xml
index 271477e3712..b9a7048716f 100644
--- a/libstdc++-v3/doc/xml/manual/diagnostics.xml
+++ b/libstdc++-v3/doc/xml/manual/diagnostics.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.diagnostics" xreflabel="Diagnostics">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.diagnostics" xreflabel="Diagnostics">
<?dbhtml filename="diagnostics.html"?>
-<chapterinfo>
+<info><title>
+ Diagnostics
+ <indexterm><primary>Diagnostics</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,19 +14,16 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Diagnostics
- <indexterm><primary>Diagnostics</primary></indexterm>
-</title>
-<sect1 id="std.diagnostics.exceptions" xreflabel="Exceptions">
+<section xml:id="std.diagnostics.exceptions" xreflabel="Exceptions"><info><title>Exceptions</title></info>
<?dbhtml filename="exceptions.html"?>
- <title>Exceptions</title>
+
- <sect2 id="std.diagnostics.exceptions.api">
- <title>API Reference</title>
+ <section xml:id="std.diagnostics.exceptions.api"><info><title>API Reference</title></info>
+
<para>
All exception objects are defined in one of the standard header
files: <filename>exception</filename>,
@@ -53,9 +49,9 @@
<!-- Doxygen XML: api/group__exceptions.xml -->
- </sect2>
- <sect2 id="std.diagnostics.exceptions.data" xreflabel="Adding Data to Exceptions">
- <title>Adding Data to <classname>exception</classname></title>
+ </section>
+ <section xml:id="std.diagnostics.exceptions.data" xreflabel="Adding Data to Exceptions"><info><title>Adding Data to <classname>exception</classname></title></info>
+
<para>
The standard exception classes carry with them a single string as
data (usually describing what went wrong or where the 'throw' took
@@ -76,11 +72,11 @@
};
</programlisting>
- </sect2>
-</sect1>
+ </section>
+</section>
-<sect1 id="std.diagnostics.concept_checking" xreflabel="Concept Checking">
- <title>Concept Checking</title>
+<section xml:id="std.diagnostics.concept_checking" xreflabel="Concept Checking"><info><title>Concept Checking</title></info>
+
<para>
In 1999, SGI added <quote>concept checkers</quote> to their
implementation of the STL: code which checked the template
@@ -88,7 +84,7 @@
that the parameters being used met the requirements of the
standard. For example, the Standard requires that types passed as
template parameters to <classname>vector</classname> be
- &quot;Assignable&quot; (which means what you think it means). The
+ "Assignable" (which means what you think it means). The
checking was done during compilation, and none of the code was
executed at runtime.
</para>
@@ -101,8 +97,8 @@
The primary author of the checking code, Jeremy Siek, had already
started work on a replacement implementation. The new code has been
formally reviewed and accepted into
- <ulink url="http://www.boost.org/libs/concept_check/concept_check.htm">the
- Boost libraries</ulink>, and we are pleased to incorporate it into the
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.boost.org/libs/concept_check/concept_check.htm">the
+ Boost libraries</link>, and we are pleased to incorporate it into the
GNU C++ library.
</para>
<para>
@@ -126,6 +122,6 @@
checking described above.
</para>
-</sect1>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/evolution.xml b/libstdc++-v3/doc/xml/manual/evolution.xml
index eda00060a66..08876deb18a 100644
--- a/libstdc++-v3/doc/xml/manual/evolution.xml
+++ b/libstdc++-v3/doc/xml/manual/evolution.xml
@@ -1,7 +1,8 @@
-<sect1 id="appendix.porting.api" xreflabel="api">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.porting.api" xreflabel="api">
<?dbhtml filename="api.html"?>
-<sect1info>
+<info><title>API Evolution and Deprecation History</title>
<keywordset>
<keyword>ISO C++</keyword>
<keyword>api</keyword>
@@ -9,16 +10,16 @@
<keyword>deprecation</keyword>
<keyword>history</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>API Evolution and Deprecation History</title>
<para>
A list of user-visible changes, in chronological order
</para>
-<sect2 id="api.rel_300">
-<title><constant>3.0</constant></title>
+<section xml:id="api.rel_300"><info><title><constant>3.0</constant></title></info>
+
<para>
Extensions moved to <filename class="directory">include/ext</filename>.
@@ -39,10 +40,10 @@ deactivates the warning.)
-</sect2>
+</section>
+
+<section xml:id="api.rel_310"><info><title><constant>3.1</constant></title></info>
-<sect2 id="api.rel_310">
-<title><constant>3.1</constant></title>
<para>
</para>
@@ -65,10 +66,10 @@ Extensions to tree data structures added in <filename class="headerfile">ext/rb_
Removal of <filename class="headerfile">ext/tree</filename>, moved to <filename class="headerfile">backward/tree.h</filename>.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_320"><info><title><constant>3.2</constant></title></info>
-<sect2 id="api.rel_320">
-<title><constant>3.2</constant></title>
<para>
</para>
<para>Symbol versioning introduced for shared library.</para>
@@ -89,16 +90,16 @@ Removal of <filename class="headerfile">ext/tree</filename>, moved to <filename
<para>Error handling in iostreams cleaned up, made consistent. </para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_330"><info><title><constant>3.3</constant></title></info>
-<sect2 id="api.rel_330">
-<title><constant>3.3</constant></title>
<para>
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_340"><info><title><constant>3.4</constant></title></info>
-<sect2 id="api.rel_340">
-<title><constant>3.4</constant></title>
<para>
</para>
<para>
@@ -161,13 +162,14 @@ _Alloc_traits</code> have been removed.
underlying allocator was not user-configurable.
</para>
-<table frame='all'>
+<table frame="all">
<title>Extension Allocators</title>
-<tgroup cols='4' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
@@ -225,12 +227,13 @@ _Alloc_traits</code> have been removed.
the first released version of GCC that included the extension allocator.
</para>
-<table frame='all'>
+<table frame="all">
<title>Extension Allocators Continued</title>
-<tgroup cols='3' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
+
+<tgroup cols="3" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
<thead>
<row>
@@ -277,10 +280,10 @@ Extension <filename class="headerfile">ext/demangle.h</filename> added.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_400"><info><title><constant>4.0</constant></title></info>
-<sect2 id="api.rel_400">
-<title><constant>4.0</constant></title>
<para>
</para>
<para>
@@ -300,10 +303,10 @@ Removal of <filename class="headerfile">ext/demangle.h</filename>.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_410"><info><title><constant>4.1</constant></title></info>
-<sect2 id="api.rel_410">
-<title><constant>4.1</constant></title>
<para>
</para>
@@ -324,10 +327,10 @@ types, namespace <code>pb_assoc</code>.
<para> Extension for policy-based <code>basic_string</code> first added: <code>__gnu_cxx::__versa_string</code> in <filename class="headerfile">ext/vstring.h</filename>.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_420"><info><title><constant>4.2</constant></title></info>
-<sect2 id="api.rel_420">
-<title><constant>4.2</constant></title>
<para>
</para>
@@ -360,10 +363,10 @@ __gnu_cxx::__debug</code>.</para>
and <filename class="headerfile">ext/throw_allocator.h</filename>.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_430"><info><title><constant>4.3</constant></title></info>
-<sect2 id="api.rel_430">
-<title><constant>4.3</constant></title>
<para>
</para>
@@ -448,11 +451,11 @@ PCH binary files no longer installed. Instead, the source files are installed.
Namespace pb_ds moved to __gnu_pb_ds.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_440"><info><title><constant>4.4</constant></title></info>
-<sect2 id="api.rel_440">
-<title><constant>4.4</constant></title>
<para>
</para>
@@ -558,10 +561,10 @@ for non-standard pointer types has been added
to <classname>vector</classname>
and <classname>forward_list</classname>.
</para>
-</sect2>
+</section>
+
+<section xml:id="api.rel_450"><info><title><constant>4.5</constant></title></info>
-<sect2 id="api.rel_450">
-<title><constant>4.5</constant></title>
<para>
</para>
@@ -623,6 +626,6 @@ now defaults to zero.
<para> Extensions modified: <filename class="headerfile">ext/throw_allocator.h</filename>.
</para>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/extensions.xml b/libstdc++-v3/doc/xml/manual/extensions.xml
index 7fa9a5e36e4..b93c61f1be2 100644
--- a/libstdc++-v3/doc/xml/manual/extensions.xml
+++ b/libstdc++-v3/doc/xml/manual/extensions.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<part id="manual.ext" xreflabel="Extensions">
+<part xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext" xreflabel="Extensions">
<?dbhtml filename="extensions.html"?>
-<partinfo>
+<info><title>
+ Extensions
+ <indexterm><primary>Extensions</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,15 +14,12 @@
library
</keyword>
</keywordset>
-</partinfo>
+</info>
+
-<title>
- Extensions
- <indexterm><primary>Extensions</primary></indexterm>
-</title>
-<preface>
- <title></title>
+<preface><info><title/></info>
+
<para>
Here we will make an attempt at describing the non-Standard extensions to
the library. Some of these are from SGI's STL, some of these are GNU's,
@@ -32,7 +28,7 @@
<para><emphasis>Before</emphasis> you leap in and use any of these
extensions, be aware of two things:
</para>
-<orderedlist>
+<orderedlist inheritnum="ignore" continuation="restarts">
<listitem>
<para>
Non-Standard means exactly that.
@@ -55,9 +51,9 @@ extensions, be aware of two things:
</preface>
<!-- Chapter 01 : Compile Time Checks -->
-<chapter id="manual.ext.compile_checks" xreflabel="Compile Time Checks">
+<chapter xml:id="manual.ext.compile_checks" xreflabel="Compile Time Checks"><info><title>Compile Time Checks</title></info>
<?dbhtml filename="ext_compile_checks.html"?>
- <title>Compile Time Checks</title>
+
<para>
Also known as concept checking.
</para>
@@ -77,8 +73,8 @@ extensions, be aware of two things:
<para>The primary author of the checking code, Jeremy Siek, had already
started work on a replacement implementation. The new code has been
formally reviewed and accepted into
- <ulink url="http://www.boost.org/libs/concept_check/concept_check.htm">the
- Boost libraries</ulink>, and we are pleased to incorporate it into the
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.boost.org/libs/concept_check/concept_check.htm">the
+ Boost libraries</link>, and we are pleased to incorporate it into the
GNU C++ library.
</para>
<para>The new version imposes a much smaller space overhead on the generated
@@ -104,54 +100,48 @@ extensions, be aware of two things:
</chapter>
<!-- Chapter 02 : Debug Mode -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="debug_mode.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="debug_mode.xml">
</xi:include>
<!-- Chapter 03 : Parallel Mode -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="parallel_mode.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="parallel_mode.xml">
</xi:include>
<!-- Chapter 04 : Profile Mode -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="profile_mode.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="profile_mode.xml">
</xi:include>
<!-- Chapter 05 : Allocators -->
-<chapter id="manual.ext.allocator" xreflabel="Allocators">
+<chapter xml:id="manual.ext.allocator" xreflabel="Allocators"><info><title>Allocators</title></info>
<?dbhtml filename="ext_allocators.html"?>
- <title>Allocators</title>
+
<!-- Section 01 : __mt_alloc -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="mt_allocator.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="mt_allocator.xml">
</xi:include>
<!-- Section 02 : bitmap_allocator -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="bitmap_allocator.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="bitmap_allocator.xml">
</xi:include>
</chapter>
<!-- Chapter 06 : Containers -->
-<chapter id="manual.ext.containers" xreflabel="Containers">
+<chapter xml:id="manual.ext.containers" xreflabel="Containers"><info><title>Containers</title></info>
<?dbhtml filename="ext_containers.html"?>
- <title>Containers</title>
+
<para>
</para>
- <sect1 id="manual.ext.containers.pbds" xreflabel="Policy Based Data Structures">
- <title>Policy Based Data Structures</title>
+ <section xml:id="manual.ext.containers.pbds" xreflabel="Policy Based Data Structures"><info><title>Policy Based Data Structures</title></info>
+
<para>
- <ulink
- url="http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html">More details here</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html">More details here</link>.
</para>
- </sect1>
+ </section>
- <sect1 id="manual.ext.containers.sgi" xreflabel="SGI ext">
- <title>HP/SGI</title>
+ <section xml:id="manual.ext.containers.sgi" xreflabel="SGI ext"><info><title>HP/SGI</title></info>
+
<para>
</para>
@@ -173,7 +163,7 @@ extensions, be aware of two things:
<para>There are
versions of single-bit test, set, reset, and flip member functions which
do no range-checking. If we call them member functions of an instantiation
- of &quot;bitset&lt;N&gt;,&quot; then their names and signatures are:
+ of "bitset&lt;N&gt;," then their names and signatures are:
</para>
<programlisting>
bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos);
@@ -196,19 +186,19 @@ extensions, be aware of two things:
resolution calls for range-checking to be done. We'll just wait and see...
</para>
<para>Finally, two additional searching functions have been added. They return
- the index of the first &quot;on&quot; bit, and the index of the first
- &quot;on&quot; bit that is after <code>prev</code>, respectively:
+ the index of the first "on" bit, and the index of the first
+ "on" bit that is after <code>prev</code>, respectively:
</para>
<programlisting>
size_t _Find_first() const;
size_t _Find_next (size_t prev) const;</programlisting>
<para>The same caveat given for the _Unchecked_* functions applies here also.
</para>
- </sect1>
+ </section>
- <sect1 id="manual.ext.containers.deprecated_sgi" xreflabel="SGI ext dep">
- <title>Deprecated HP/SGI</title>
+ <section xml:id="manual.ext.containers.deprecated_sgi" xreflabel="SGI ext dep"><info><title>Deprecated HP/SGI</title></info>
+
<para>
The SGI hashing classes <classname>hash_set</classname> and
@@ -230,8 +220,8 @@ extensions, be aware of two things:
<code>&lt;hash_map&gt;</code> and <code>&lt;hash_set&gt;</code>
are deprecated but available as backwards-compatible extensions,
as discussed further below. <code>&lt;rope&gt;</code> is the
- SGI specialization for large strings (&quot;rope,&quot;
- &quot;large strings,&quot; get it? Love that geeky humor.)
+ SGI specialization for large strings ("rope,"
+ "large strings," get it? Love that geeky humor.)
<code>&lt;slist&gt;</code> is a singly-linked list, for when the
doubly-linked <code>list&lt;&gt;</code> is too much space
overhead, and <code>&lt;rb_tree&gt;</code> exposes the red-black
@@ -240,12 +230,12 @@ extensions, be aware of two things:
</para>
<para>Each of the associative containers map, multimap, set, and multiset
have a counterpart which uses a
- <ulink url="http://www.sgi.com/tech/stl/HashFunction.html">hashing
- function</ulink> to do the arranging, instead of a strict weak ordering
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/HashFunction.html">hashing
+ function</link> to do the arranging, instead of a strict weak ordering
function. The classes take as one of their template parameters a
function object that will return the hash value; by default, an
instantiation of
- <ulink url="http://www.sgi.com/tech/stl/hash.html">hash</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/hash.html">hash</link>.
You should specialize this functor for your class, or define your own,
before trying to use one of the hashing classes.
</para>
@@ -269,13 +259,13 @@ extensions, be aware of two things:
</para>
</blockquote>
- </sect1>
+ </section>
</chapter>
<!-- Chapter 07 : Utilities -->
-<chapter id="manual.ext.util" xreflabel="Utilities">
+<chapter xml:id="manual.ext.util" xreflabel="Utilities"><info><title>Utilities</title></info>
<?dbhtml filename="ext_utilities.html"?>
- <title>Utilities</title>
+
<para>
The &lt;functional&gt; header contains many additional functors
and helper functions, extending section 20.3. They are
@@ -343,9 +333,9 @@ get_temporary_buffer(5, (int*)0);
</chapter>
<!-- Chapter 08 : Algorithms -->
-<chapter id="manual.ext.algorithms" xreflabel="Algorithms">
+<chapter xml:id="manual.ext.algorithms" xreflabel="Algorithms"><info><title>Algorithms</title></info>
<?dbhtml filename="ext_algorithms.html"?>
- <title>Algorithms</title>
+
<para>25.1.6 (count, count_if) is extended with two more versions of count
and count_if. The standard versions return their results. The
additional signatures return void, but take a final parameter by
@@ -381,34 +371,34 @@ get_temporary_buffer(5, (int*)0);
</chapter>
<!-- Chapter 09 : Numerics -->
-<chapter id="manual.ext.numerics" xreflabel="Numerics">
+<chapter xml:id="manual.ext.numerics" xreflabel="Numerics"><info><title>Numerics</title></info>
<?dbhtml filename="ext_numerics.html"?>
- <title>Numerics</title>
+
<para>26.4, the generalized numeric operations such as accumulate, are extended
with the following functions:
</para>
<programlisting>
power (x, n);
power (x, n, moniod_operation);</programlisting>
-<para>Returns, in FORTRAN syntax, &quot;x ** n&quot; where n&gt;=0. In the
+<para>Returns, in FORTRAN syntax, "x ** n" where n&gt;=0. In the
case of n == 0, returns the identity element for the
monoid operation. The two-argument signature uses multiplication (for
- a true &quot;power&quot; implementation), but addition is supported as well.
+ a true "power" implementation), but addition is supported as well.
The operation functor must be associative.
</para>
<para>The <code>iota</code> function wins the award for Extension With the
- Coolest Name. It &quot;assigns sequentially increasing values to a range.
+ Coolest Name. It "assigns sequentially increasing values to a range.
That is, it assigns value to *first, value + 1 to *(first + 1) and so
- on.&quot; Quoted from SGI documentation.
+ on." Quoted from SGI documentation.
</para>
<programlisting>
void iota(_ForwardIter first, _ForwardIter last, _Tp value);</programlisting>
</chapter>
<!-- Chapter 10 : Iterators -->
-<chapter id="manual.ext.iterators" xreflabel="Iterators">
+<chapter xml:id="manual.ext.iterators" xreflabel="Iterators"><info><title>Iterators</title></info>
<?dbhtml filename="ext_iterators.html"?>
- <title>Iterators</title>
+
<para>24.3.2 describes <code>struct iterator</code>, which didn't exist in the
original HP STL implementation (the language wasn't rich enough at the
time). For backwards compatibility, base classes are provided which
@@ -430,17 +420,17 @@ get_temporary_buffer(5, (int*)0);
</chapter>
<!-- Chapter 11 : IO -->
-<chapter id="manual.ext.io" xreflabel="IO">
+<chapter xml:id="manual.ext.io" xreflabel="IO"><info><title>Input and Output</title></info>
<?dbhtml filename="ext_io.html"?>
- <title>Input and Output</title>
+
<para>
Extensions allowing <code>filebuf</code>s to be constructed from
"C" types like FILE*s and file descriptors.
</para>
- <sect1 id="manual.ext.io.filebuf_derived" xreflabel="Derived filebufs">
- <title>Derived filebufs</title>
+ <section xml:id="manual.ext.io.filebuf_derived" xreflabel="Derived filebufs"><info><title>Derived filebufs</title></info>
+
<para>The v2 library included non-standard extensions to construct
<code>std::filebuf</code>s from C stdio types such as
@@ -483,7 +473,7 @@ get_temporary_buffer(5, (int*)0);
the <code>fd()</code> function were removed from the standard
filebuf. Instead, <code>&lt;ext/stdio_filebuf.h&gt;</code> contains
a derived class called
- <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></link>.
This class can be constructed from a C <code>FILE*</code> or a file
descriptor, and provides the <code>fd()</code> function.
</para></listitem>
@@ -496,22 +486,21 @@ get_temporary_buffer(5, (int*)0);
<para>
</para>
- </sect1>
+ </section>
</chapter>
<!-- Chapter 12 : Demangling -->
-<chapter id="manual.ext.demangle" xreflabel="Demangling">
+<chapter xml:id="manual.ext.demangle" xreflabel="Demangling"><info><title>Demangling</title></info>
<?dbhtml filename="ext_demangling.html"?>
- <title>Demangling</title>
+
<para>
Transforming C++ ABI identifiers (like RTTI symbols) into the
original C++ source identifiers is called
<quote>demangling.</quote>
</para>
<para>
- If you have read the <ulink
- url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01115.html">source
- documentation for <code>namespace abi</code></ulink> then you are
+ If you have read the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01115.html">source
+ documentation for <code>namespace abi</code></link> then you are
aware of the cross-vendor C++ ABI in use by GCC. One of the
exposed functions is used for demangling,
<code>abi::__cxa_demangle</code>.
@@ -586,8 +575,7 @@ int main()
</chapter>
<!-- Chapter 13 : Concurrency -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="concurrency_extensions.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="concurrency_extensions.xml">
</xi:include>
</part>
diff --git a/libstdc++-v3/doc/xml/manual/internals.xml b/libstdc++-v3/doc/xml/manual/internals.xml
index 63664cea3f1..72af0b835c8 100644
--- a/libstdc++-v3/doc/xml/manual/internals.xml
+++ b/libstdc++-v3/doc/xml/manual/internals.xml
@@ -1,7 +1,8 @@
-<sect1 id="appendix.porting.internals" xreflabel="Portin Internals">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="appendix.porting.internals" xreflabel="Portin Internals">
<?dbhtml filename="internals.html"?>
-<sect1info>
+<info><title>Porting to New Hardware or Operating Systems</title>
<keywordset>
<keyword>
ISO C++
@@ -10,9 +11,9 @@
internals
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>Porting to New Hardware or Operating Systems</title>
<para>
</para>
@@ -45,8 +46,8 @@ a "host." The comment at the top of <code>configure.ac</code> explains why.)
</para>
-<sect2 id="internals.os">
-<title>Operating System</title>
+<section xml:id="internals.os"><info><title>Operating System</title></info>
+
<para>If you are porting to a new operating system (as opposed to a new chip
using an existing operating system), you will need to create a new
@@ -151,11 +152,11 @@ this:
<para>We recommend copying an existing <code>os_defines.h</code> to use as a
starting point.
</para>
-</sect2>
+</section>
-<sect2 id="internals.cpu">
-<title>CPU</title>
+<section xml:id="internals.cpu"><info><title>CPU</title></info>
+
<para>If you are porting to a new chip (as opposed to a new operating system
running on an existing chip), you will need to create a new directory in the
@@ -183,11 +184,11 @@ example, <code>alpha</code>, <code>alphaev5</code>, and <code>alphaev6</code> al
appropriate for your chip.
</para>
-</sect2>
+</section>
+
+<section xml:id="internals.char_types"><info><title>Character Types</title></info>
-<sect2 id="internals.char_types">
-<title>Character Types</title>
<para>The library requires that you provide three header files to implement
character classification, analogous to that provided by the C libraries
@@ -399,11 +400,11 @@ from <code>__low</code> up until <code>__high</code> into the vector given by
}
</programlisting>
-</sect2>
+</section>
-<sect2 id="internals.thread_safety">
-<title>Thread Safety</title>
+<section xml:id="internals.thread_safety"><info><title>Thread Safety</title></info>
+
<para>The C++ library string functionality requires a couple of atomic
operations to provide thread-safety. If you don't take any special
@@ -482,11 +483,11 @@ must be equivalent to those provided here, but using atomic operations:
}
</programlisting>
-</sect2>
+</section>
+
+<section xml:id="internals.numeric_limits"><info><title>Numeric Limits</title></info>
-<sect2 id="internals.numeric_limits">
-<title>Numeric Limits</title>
<para>The C++ library requires information about the fundamental data types,
such as the minimum and maximum representable values of each type.
@@ -504,11 +505,11 @@ To take that approach, create a new file called <code>cpu_limits.h</code> in
your CPU configuration directory (see <link linkend="internals.cpu">CPU</link>).
</para>
-</sect2>
+</section>
+
+<section xml:id="internals.libtool"><info><title>Libtool</title></info>
-<sect2 id="internals.libtool">
-<title>Libtool</title>
<para>The C++ library is compiled, archived and linked with libtool.
Explaining the full workings of libtool is beyond the scope of this
@@ -543,6 +544,6 @@ operating system.
</para>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml
index a6dff4daf15..705119b6d3e 100644
--- a/libstdc++-v3/doc/xml/manual/intro.xml
+++ b/libstdc++-v3/doc/xml/manual/intro.xml
@@ -1,12 +1,10 @@
-<?xml version='1.0'?>
-<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<part id="manual.intro" xreflabel="Introduction">
+<part xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="manual.intro" xreflabel="Introduction">
<?dbhtml filename="intro.html"?>
-<partinfo>
+<info><title>
+ Introduction
+ <indexterm><primary>Introduction</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,75 +13,65 @@
library
</keyword>
</keywordset>
-</partinfo>
+</info>
+
-<title>
- Introduction
- <indexterm><primary>Introduction</primary></indexterm>
-</title>
<!-- Chapter 01 : Status -->
-<chapter id="manual.intro.status" xreflabel="Status">
+<chapter xml:id="manual.intro.status" xreflabel="Status"><info><title>Status</title></info>
<?dbhtml filename="status.html"?>
- <title>Status</title>
+
<!-- Section 01 : Implementation Status -->
- <sect1 id="manual.intro.status.iso" xreflabel="Status">
- <title>Implementation Status</title>
+ <section xml:id="manual.intro.status.iso" xreflabel="Status"><info><title>Implementation Status</title></info>
+
<!-- Section 01.1 : Status C++ 1998 -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="status_cxx1998.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx1998.xml">
</xi:include>
<!-- Section 01.2 : Status C++ 200x -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="status_cxx200x.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxx200x.xml">
</xi:include>
<!-- Section 01.3 : Status C++ TR1 -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="status_cxxtr1.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxxtr1.xml">
</xi:include>
<!-- Section 01.4 : Status C++ TR24733 -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="status_cxxtr24733.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="status_cxxtr24733.xml">
</xi:include>
- </sect1>
+ </section>
<!-- Section 02 : License -->
- <sect1 id="manual.intro.status.license" xreflabel="License">
+ <section xml:id="manual.intro.status.license" xreflabel="License"><info><title>License</title></info>
<?dbhtml filename="license.html"?>
- <title>License</title>
+
<para>
There are two licenses affecting GNU libstdc++: one for the code,
and one for the documentation.
</para>
<para>
- There is a license section in the FAQ regarding common <link
- linkend="faq.license">questions</link>. If you have more
- questions, ask the FSF or the <ulink
- url="http://gcc.gnu.org/lists.html">gcc mailing list</ulink>.
+ There is a license section in the FAQ regarding common <link linkend="faq.license">questions</link>. If you have more
+ questions, ask the FSF or the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/lists.html">gcc mailing list</link>.
</para>
- <sect2 id="manual.intro.status.license.gpl" xreflabel="License GPL">
- <title>The Code: GPL</title>
+ <section xml:id="manual.intro.status.license.gpl" xreflabel="License GPL"><info><title>The Code: GPL</title></info>
+
<para>
- The source code is distributed under the <link
- linkend="appendix.gpl-3.0">GNU General Public License version 3</link>,
+ The source code is distributed under the <link linkend="appendix.gpl-3.0">GNU General Public License version 3</link>,
with the addition under section 7 of an exception described in
the <quote>GCC Runtime Library Exception, version 3.1</quote>
as follows (or see the file COPYING.RUNTIME):
</para>
- <literallayout>
+ <literallayout class="normal">
GCC RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
-Copyright (C) 2009 <ulink url="http://www.fsf.org">Free Software Foundation, Inc.</ulink>
+Copyright (C) 2009 <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">Free Software Foundation, Inc.</link>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@@ -157,10 +145,10 @@ requirements of the license of GCC.
Hopefully that text is self-explanatory. If it isn't, you need to speak
to your lawyer, or the Free Software Foundation.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.status.license.fdl" xreflabel="License FDL">
- <title>The Documentation: GPL, FDL</title>
+ <section xml:id="manual.intro.status.license.fdl" xreflabel="License FDL"><info><title>The Documentation: GPL, FDL</title></info>
+
<para>
The documentation shipped with the library and made available over
@@ -182,27 +170,26 @@ requirements of the license of GCC.
If you plan on making copies of the documentation, please let us know.
We can probably offer suggestions.
</para>
- </sect2>
+ </section>
- </sect1>
+ </section>
<!-- Section 03 : Known Bugs -->
- <sect1 id="manual.intro.status.bugs" xreflabel="Bugs">
+ <section xml:id="manual.intro.status.bugs" xreflabel="Bugs"><info><title>Bugs</title></info>
<?dbhtml filename="bugs.html"?>
- <title>Bugs</title>
+
- <sect2 id="manual.intro.status.bugs.impl" xreflabel="Bugs impl">
- <title>Implementation Bugs</title>
+ <section xml:id="manual.intro.status.bugs.impl" xreflabel="Bugs impl"><info><title>Implementation Bugs</title></info>
+
<para>
Information on known bugs, details on efforts to fix them, and
- fixed bugs are all available as part of the <ulink
- url="http://gcc.gnu.org/bugs/">GCC bug tracking system</ulink>,
+ fixed bugs are all available as part of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugs/">GCC bug tracking system</link>,
with the category set to <literal>libstdc++</literal>.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.status.bugs.iso" xreflabel="Bugs iso">
- <title>Standard Bugs</title>
+ <section xml:id="manual.intro.status.bugs.iso" xreflabel="Bugs iso"><info><title>Standard Bugs</title></info>
+
<para>
Everybody's got issues. Even the C++ Standard Library.
</para>
@@ -216,10 +203,10 @@ requirements of the license of GCC.
Here are the issues which have resulted in code changes to the library.
The links are to the specific defect reports from a <emphasis>partial
copy</emphasis> of the Issues List. You can read the full version online
- at the <ulink url="http://www.open-std.org/jtc1/sc22/wg21/">ISO C++
- Committee homepage</ulink>, linked to on the
- <ulink url="http://gcc.gnu.org/readings.html">GCC &quot;Readings&quot;
- page</ulink>. If
+ at the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/">ISO C++
+ Committee homepage</link>, linked to on the
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/readings.html">GCC "Readings"
+ page</link>. If
you spend a lot of time reading the issues, we recommend downloading
the ZIP file and reading them locally.
</para>
@@ -237,116 +224,116 @@ requirements of the license of GCC.
and src directories for appearances of
<constant>_GLIBCXX_RESOLVE_LIB_DEFECTS</constant> for examples
of style. Note that we usually do not make changes to the
- code until an issue has reached <ulink url="../ext/lwg-active.html#DR">DR</ulink> status.
+ code until an issue has reached <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-active.html#DR">DR</link> status.
</para>
<variablelist>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#5">5</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#5">5</link>:
<emphasis>string::compare specification questionable</emphasis>
</term>
<listitem><para>This should be two overloaded functions rather than a single function.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#17">17</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#17">17</link>:
<emphasis>Bad bool parsing</emphasis>
</term>
<listitem><para>Apparently extracting Boolean values was messed up...
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#19">19</ulink>:
- <emphasis>&quot;Noconv&quot; definition too vague</emphasis>
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#19">19</link>:
+ <emphasis>"Noconv" definition too vague</emphasis>
</term>
<listitem><para>If <code>codecvt::do_in</code> returns <code>noconv</code> there are
no changes to the values in <code>[to, to_limit)</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#22">22</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#22">22</link>:
<emphasis>Member open vs flags</emphasis>
</term>
<listitem><para>Re-opening a file stream does <emphasis>not</emphasis> clear the state flags.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#23">23</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#23">23</link>:
<emphasis>Num_get overflow result</emphasis>
</term>
<listitem><para>Implement the proposed resolution.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#25">25</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#25">25</link>:
<emphasis>String operator&lt;&lt; uses width() value wrong</emphasis>
</term>
<listitem><para>Padding issues.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#48">48</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#48">48</link>:
<emphasis>Use of non-existent exception constructor</emphasis>
</term>
<listitem><para>An instance of <code>ios_base::failure</code> is constructed instead.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#49">49</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#49">49</link>:
<emphasis>Underspecification of ios_base::sync_with_stdio</emphasis>
</term>
<listitem><para>The return type is the <emphasis>previous</emphasis> state of synchronization.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#50">50</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#50">50</link>:
<emphasis>Copy constructor and assignment operator of ios_base</emphasis>
</term>
<listitem><para>These members functions are declared <code>private</code> and are
thus inaccessible. Specifying the correct semantics of
- &quot;copying stream state&quot; was deemed too complicated.
+ "copying stream state" was deemed too complicated.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#60">60</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#60">60</link>:
<emphasis>What is a formatted input function?</emphasis>
</term>
<listitem><para>This DR made many widespread changes to <code>basic_istream</code>
and <code>basic_ostream</code> all of which have been implemented.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#63">63</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#63">63</link>:
<emphasis>Exception-handling policy for unformatted output</emphasis>
</term>
<listitem><para>Make the policy consistent with that of formatted input, unformatted
input, and formatted output.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#68">68</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#68">68</link>:
<emphasis>Extractors for char* should store null at end</emphasis>
</term>
<listitem><para>And they do now. An editing glitch in the last item in the list of
[27.6.1.2.3]/7.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#74">74</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#74">74</link>:
<emphasis>Garbled text for codecvt::do_max_length</emphasis>
</term>
<listitem><para>The text of the standard was gibberish. Typos gone rampant.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#75">75</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#75">75</link>:
<emphasis>Contradiction in codecvt::length's argument types</emphasis>
</term>
<listitem><para>Change the first parameter to <code>stateT&amp;</code> and implement
the new effects paragraph.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#83">83</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#83">83</link>:
<emphasis>string::npos vs. string::max_size()</emphasis>
</term>
<listitem><para>Safety checks on the size of the string should test against
<code>max_size()</code> rather than <code>npos</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#90">90</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#90">90</link>:
<emphasis>Incorrect description of operator&gt;&gt; for strings</emphasis>
</term>
<listitem><para>The effect contain <code>isspace(c,getloc())</code> which must be
replaced by <code>isspace(c,is.getloc())</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#91">91</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#91">91</link>:
<emphasis>Description of operator&gt;&gt; and getline() for string&lt;&gt;
might cause endless loop</emphasis>
</term>
@@ -355,7 +342,7 @@ requirements of the license of GCC.
not required to set <code>gcount</code>).
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#103">103</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#103">103</link>:
<emphasis>set::iterator is required to be modifiable, but this allows
modification of keys.</emphasis>
</term>
@@ -364,14 +351,14 @@ requirements of the license of GCC.
</code> are constant iterators.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#109">109</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#109">109</link>:
<emphasis>Missing binders for non-const sequence elements</emphasis>
</term>
<listitem><para>The <code>binder1st</code> and <code>binder2nd</code> didn't have an
<code>operator()</code> taking a non-const parameter.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#110">110</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#110">110</link>:
<emphasis>istreambuf_iterator::equal not const</emphasis>
</term>
<listitem><para>This was not a const member function. Note that the DR says to
@@ -379,31 +366,31 @@ requirements of the license of GCC.
overloaded version with identical contents.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#117">117</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#117">117</link>:
<emphasis>basic_ostream uses nonexistent num_put member functions</emphasis>
</term>
<listitem><para><code>num_put::put()</code> was overloaded on the wrong types.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#118">118</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#118">118</link>:
<emphasis>basic_istream uses nonexistent num_get member functions</emphasis>
</term>
<listitem><para>Same as 117, but for <code>num_get::get()</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#129">129</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#129">129</link>:
<emphasis>Need error indication from seekp() and seekg()</emphasis>
</term>
<listitem><para>These functions set <code>failbit</code> on error now.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#130">130</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#130">130</link>:
<emphasis>Return type of container::erase(iterator) differs for associative containers</emphasis>
</term>
<listitem><para>Make member <code>erase</code> return iterator for <code>set</code>, <code>multiset</code>, <code>map</code>, <code>multimap</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#136">136</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#136">136</link>:
<emphasis>seekp, seekg setting wrong streams?</emphasis>
</term>
<listitem><para><code>seekp</code> should only set the output stream, and
@@ -417,46 +404,46 @@ requirements of the license of GCC.
should probably not be calling <code>underflow()</code>.
</para></listitem></varlistentry> -->
- <varlistentry><term><ulink url="../ext/lwg-defects.html#167">167</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#167">167</link>:
<emphasis>Improper use of traits_type::length()</emphasis>
</term>
<listitem><para><code>op&lt;&lt;</code> with a <code>const char*</code> was
calculating an incorrect number of characters to write.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#169">169</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#169">169</link>:
<emphasis>Bad efficiency of overflow() mandated</emphasis>
</term>
<listitem><para>Grow efficiently the internal array object.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#171">171</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#171">171</link>:
<emphasis>Strange seekpos() semantics due to joint position</emphasis>
</term>
<listitem><para>Quite complex to summarize...
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#181">181</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#181">181</link>:
<emphasis>make_pair() unintended behavior</emphasis>
</term>
<listitem><para>This function used to take its arguments as reference-to-const, now
it copies them (pass by value).
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#195">195</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#195">195</link>:
<emphasis>Should basic_istream::sentry's constructor ever set eofbit?</emphasis>
</term>
<listitem><para>Yes, it can, specifically if EOF is reached while skipping whitespace.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#211">211</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#211">211</link>:
<emphasis>operator&gt;&gt;(istream&amp;, string&amp;) doesn't set failbit</emphasis>
</term>
<listitem><para>If nothing is extracted into the string, <code>op&gt;&gt;</code> now
sets <code>failbit</code> (which can cause an exception, etc., etc.).
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#214">214</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#214">214</link>:
<emphasis>set::find() missing const overload</emphasis>
</term>
<listitem><para>Both <code>set</code> and <code>multiset</code> were missing
@@ -464,47 +451,47 @@ requirements of the license of GCC.
for const instances.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#231">231</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#231">231</link>:
<emphasis>Precision in iostream?</emphasis>
</term>
<listitem><para>For conversion from a floating-point type, <code>str.precision()</code>
is specified in the conversion specification.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#233">233</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#233">233</link>:
<emphasis>Insertion hints in associative containers</emphasis>
</term>
<listitem><para>Implement N1780, first check before then check after, insert as close
to hint as possible.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#235">235</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#235">235</link>:
<emphasis>No specification of default ctor for reverse_iterator</emphasis>
</term>
<listitem><para>The declaration of <code>reverse_iterator</code> lists a default constructor.
However, no specification is given what this constructor should do.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#241">241</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#241">241</link>:
<emphasis>Does unique_copy() require CopyConstructible and Assignable?</emphasis>
</term>
<listitem><para>Add a helper for forward_iterator/output_iterator, fix the existing
one for input_iterator/output_iterator to not rely on Assignability.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#243">243</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#243">243</link>:
<emphasis>get and getline when sentry reports failure</emphasis>
</term>
<listitem><para>Store a null character only if the character array has a non-zero size.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#251">251</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#251">251</link>:
<emphasis>basic_stringbuf missing allocator_type</emphasis>
</term>
<listitem><para>This nested typedef was originally not specified.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#253">253</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#253">253</link>:
<emphasis>valarray helper functions are almost entirely useless</emphasis>
</term>
<listitem><para>Make the copy constructor and copy-assignment operator declarations
@@ -512,60 +499,60 @@ requirements of the license of GCC.
definitions.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#265">265</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#265">265</link>:
<emphasis>std::pair::pair() effects overly restrictive</emphasis>
</term>
<listitem><para>The default ctor would build its members from copies of temporaries;
now it simply uses their respective default ctors.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#266">266</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#266">266</link>:
<emphasis>bad_exception::~bad_exception() missing Effects clause</emphasis>
</term>
<listitem><para>The <code>bad_</code>* classes no longer have destructors (they
are trivial), since no description of them was ever given.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#271">271</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#271">271</link>:
<emphasis>basic_iostream missing typedefs</emphasis>
</term>
<listitem><para>The typedefs it inherits from its base classes can't be used, since
(for example) <code>basic_iostream&lt;T&gt;::traits_type</code> is ambiguous.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#275">275</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#275">275</link>:
<emphasis>Wrong type in num_get::get() overloads</emphasis>
</term>
<listitem><para>Similar to 118.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#280">280</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#280">280</link>:
<emphasis>Comparison of reverse_iterator to const reverse_iterator</emphasis>
</term>
<listitem><para>Add global functions with two template parameters.
(NB: not added for now a templated assignment operator)
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#292">292</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#292">292</link>:
<emphasis>Effects of a.copyfmt (a)</emphasis>
</term>
<listitem><para>If <code>(this == &amp;rhs)</code> do nothing.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#300">300</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#300">300</link>:
<emphasis>List::merge() specification incomplete</emphasis>
</term>
<listitem><para>If <code>(this == &amp;x)</code> do nothing.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#303">303</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#303">303</link>:
<emphasis>Bitset input operator underspecified</emphasis>
</term>
<listitem><para>Basically, compare the input character to
<code>is.widen(0)</code> and <code>is.widen(1)</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#305">305</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#305">305</link>:
<emphasis>Default behavior of codecvt&lt;wchar_t, char,
mbstate_t&gt;::length()</emphasis>
</term>
@@ -573,20 +560,20 @@ requirements of the license of GCC.
mbstate_t&gt;::do_length</code> must return.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#328">328</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#328">328</link>:
<emphasis>Bad sprintf format modifier in
money_put&lt;&gt;::do_put()</emphasis>
</term>
- <listitem><para>Change the format string to &quot;%.0Lf&quot;.
+ <listitem><para>Change the format string to "%.0Lf".
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#365">365</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#365">365</link>:
<emphasis>Lack of const-qualification in clause 27</emphasis>
</term>
<listitem><para>Add const overloads of <code>is_open</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#387">387</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#387">387</link>:
<emphasis>std::complex over-encapsulated</emphasis>
</term>
<listitem><para>Add the <code>real(T)</code> and <code>imag(T)</code>
@@ -595,26 +582,26 @@ requirements of the license of GCC.
free functions.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#389">389</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#389">389</link>:
<emphasis>Const overload of valarray::operator[] returns
by value</emphasis>
</term>
<listitem><para>Change it to return a <code>const T&amp;</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#396">396</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#396">396</link>:
<emphasis>what are characters zero and one</emphasis>
</term>
<listitem><para>Implement the proposed resolution.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#402">402</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#402">402</link>:
<emphasis>Wrong new expression in [some_]allocator::construct</emphasis>
</term>
- <listitem><para>Replace &quot;new&quot; with &quot;::new&quot;.
+ <listitem><para>Replace "new" with "::new".
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-active.html#408">408</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-active.html#408">408</link>:
<emphasis>
Is vector&lt;reverse_iterator&lt;char*&gt; &gt; forbidden?
</emphasis>
@@ -622,76 +609,76 @@ requirements of the license of GCC.
<listitem><para>Tweak the debug-mode checks in _Safe_iterator.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#409">409</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#409">409</link>:
<emphasis>Closing an fstream should clear the error state</emphasis>
</term>
<listitem><para>Have <code>open</code> clear the error flags.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-closed.html#431">431</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#431">431</link>:
<emphasis>Swapping containers with unequal allocators</emphasis>
</term>
<listitem><para>Implement Option 3, as per N1599.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#432">432</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#432">432</link>:
<emphasis>stringbuf::overflow() makes only one write position
available</emphasis>
</term>
<listitem><para>Implement the resolution, beyond DR 169.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#434">434</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#434">434</link>:
<emphasis>bitset::to_string() hard to use</emphasis>
</term>
<listitem><para>Add three overloads, taking fewer template arguments.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#438">438</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#438">438</link>:
<emphasis>Ambiguity in the "do the right thing" clause</emphasis>
</term>
<listitem><para>Implement the resolution, basically cast less.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#453">453</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#453">453</link>:
<emphasis>basic_stringbuf::seekoff need not always fail for an empty stream</emphasis>
</term>
<listitem><para>Don't fail if the next pointer is null and newoff is zero.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#455">455</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#455">455</link>:
<emphasis>cerr::tie() and wcerr::tie() are overspecified</emphasis>
</term>
<listitem><para>Initialize cerr tied to cout and wcerr tied to wcout.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#464">464</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#464">464</link>:
<emphasis>Suggestion for new member functions in standard containers</emphasis>
</term>
<listitem><para>Add <code>data()</code> to <code>std::vector</code> and
<code>at(const key_type&amp;)</code> to <code>std::map</code>.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#508">508</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#508">508</link>:
<emphasis>Bad parameters for ranlux64_base_01</emphasis>
</term>
<listitem><para>Fix the parameters.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-closed.html#512">512</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#512">512</link>:
<emphasis>Seeding subtract_with_carry_01 from a single unsigned long</emphasis>
</term>
<listitem><para>Construct a <code>linear_congruential</code> engine and seed with it.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-closed.html#526">526</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-closed.html#526">526</link>:
<emphasis>Is it undefined if a function in the standard changes in
parameters?</emphasis>
</term>
<listitem><para>Use &amp;value.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#538">538</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#538">538</link>:
<emphasis>241 again: Does unique_copy() require CopyConstructible
and Assignable?</emphasis>
</term>
@@ -699,7 +686,7 @@ requirements of the license of GCC.
input_iterator' value_type.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-active.html#539">539</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-active.html#539">539</link>:
<emphasis>partial_sum and adjacent_difference should mention
requirements</emphasis>
</term>
@@ -707,116 +694,116 @@ requirements of the license of GCC.
in adjacent_difference.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#541">541</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#541">541</link>:
<emphasis>shared_ptr template assignment and void</emphasis>
</term>
<listitem><para>Add an auto_ptr&lt;void&gt; specialization.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#543">543</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#543">543</link>:
<emphasis>valarray slice default constructor</emphasis>
</term>
<listitem><para>Follow the straightforward proposed resolution.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#550">550</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#550">550</link>:
<emphasis>What should the return type of pow(float,int) be?</emphasis>
</term>
<listitem><para>In C++0x mode, remove the pow(float,int), etc., signatures.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#586">586</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#586">586</link>:
<emphasis>string inserter not a formatted function</emphasis>
</term>
<listitem><para>Change it to be a formatted output function (i.e. catch exceptions).
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#596">596</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#596">596</link>:
<emphasis>27.8.1.3 Table 112 omits "a+" and "a+b" modes</emphasis>
</term>
<listitem><para>Add the missing modes to fopen_mode.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#630">630</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#630">630</link>:
<emphasis>arrays of valarray</emphasis>
</term>
<listitem><para>Implement the simple resolution.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#660">660</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#660">660</link>:
<emphasis>Missing bitwise operations</emphasis>
</term>
<listitem><para>Add the missing operations.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#691">691</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#691">691</link>:
<emphasis>const_local_iterator cbegin, cend missing from TR1</emphasis>
</term>
<listitem><para>In C++0x mode add cbegin(size_type) and cend(size_type)
to the unordered containers.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#693">693</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#693">693</link>:
<emphasis>std::bitset::all() missing</emphasis>
</term>
<listitem><para>Add it, consistently with the discussion.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#695">695</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#695">695</link>:
<emphasis>ctype&lt;char&gt;::classic_table() not accessible</emphasis>
</term>
<listitem><para>Make the member functions table and classic_table public.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#696">696</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#696">696</link>:
<emphasis>istream::operator&gt;&gt;(int&amp;) broken</emphasis>
</term>
<listitem><para>Implement the straightforward resolution.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#761">761</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#761">761</link>:
<emphasis>unordered_map needs an at() member function</emphasis>
</term>
<listitem><para>In C++0x mode, add at() and at() const.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#775">775</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#775">775</link>:
<emphasis>Tuple indexing should be unsigned?</emphasis>
</term>
- <listitem><para>Implement the int -> size_t replacements.
+ <listitem><para>Implement the int -&gt; size_t replacements.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#776">776</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#776">776</link>:
<emphasis>Undescribed assign function of std::array</emphasis>
</term>
<listitem><para>In C++0x mode, remove assign, add fill.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#781">781</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#781">781</link>:
<emphasis>std::complex should add missing C99 functions</emphasis>
</term>
<listitem><para>In C++0x mode, add std::proj.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#809">809</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#809">809</link>:
<emphasis>std::swap should be overloaded for array types</emphasis>
</term>
<listitem><para>Add the overload.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#844">844</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#844">844</link>:
<emphasis>complex pow return type is ambiguous</emphasis>
</term>
<listitem><para>In C++0x mode, remove the pow(complex&lt;T&gt;, int) signature.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-defects.html#853">853</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#853">853</link>:
<emphasis>to_string needs updating with zero and one</emphasis>
</term>
<listitem><para>Update / add the signatures.
</para></listitem></varlistentry>
- <varlistentry><term><ulink url="../ext/lwg-active.html#865">865</ulink>:
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-active.html#865">865</link>:
<emphasis>More algorithms that throw away information</emphasis>
</term>
<listitem><para>The traditional HP / SGI return type and value is blessed
@@ -824,15 +811,15 @@ requirements of the license of GCC.
</para></listitem></varlistentry>
</variablelist>
- </sect2>
- </sect1>
+ </section>
+ </section>
</chapter>
<!-- Chapter 02 : Setup -->
-<chapter id="manual.intro.setup" xreflabel="Setup">
+<chapter xml:id="manual.intro.setup" xreflabel="Setup"><info><title>Setup</title></info>
<?dbhtml filename="setup.html"?>
- <title>Setup</title>
+
<para>To transform libstdc++ sources into installed include files
and properly built binaries useful for linking to other software is
@@ -859,22 +846,20 @@ requirements of the license of GCC.
</para>
<!-- Section 01 : Prerequisites -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="prerequisites.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="prerequisites.xml">
</xi:include>
<!-- Section 02 : Configure -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="configure.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="configure.xml">
</xi:include>
<!-- Section 03 : Make -->
-<sect1 id="manual.intro.setup.make" xreflabel="Make">
+<section xml:id="manual.intro.setup.make" xreflabel="Make"><info><title>Make</title></info>
<?dbhtml filename="make.html"?>
-<title>Make</title>
+
<para>If you have never done this before, you should read the basic
- <ulink url="http://gcc.gnu.org/install/">GCC Installation
- Instructions</ulink> first. Read <emphasis>all of them</emphasis>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/">GCC Installation
+ Instructions</link> first. Read <emphasis>all of them</emphasis>.
<emphasis>Twice.</emphasis>
</para>
@@ -882,13 +867,12 @@ requirements of the license of GCC.
started to build.
</para>
-</sect1>
+</section>
</chapter>
<!-- Chapter 03 : Using -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="using.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="using.xml">
</xi:include>
</part>
diff --git a/libstdc++-v3/doc/xml/manual/io.xml b/libstdc++-v3/doc/xml/manual/io.xml
index 13a1d7a47d2..6378313b593 100644
--- a/libstdc++-v3/doc/xml/manual/io.xml
+++ b/libstdc++-v3/doc/xml/manual/io.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.io" xreflabel="Input and Output">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.io" xreflabel="Input and Output">
<?dbhtml filename="io.html"?>
-<chapterinfo>
+<info><title>
+ Input and Output
+ <indexterm><primary>Input and Output</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,17 +14,14 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Input and Output
- <indexterm><primary>Input and Output</primary></indexterm>
-</title>
<!-- Sect1 01 : Iostream Objects -->
-<sect1 id="std.io.objects" xreflabel="IO Objects">
+<section xml:id="std.io.objects" xreflabel="IO Objects"><info><title>Iostream Objects</title></info>
<?dbhtml filename="iostream_objects.html"?>
- <title>Iostream Objects</title>
+
<para>To minimize the time you have to wait on the compiler, it's good to
only include the headers you really need. Many people simply include
@@ -35,10 +31,10 @@
</para>
<para><emphasis>&lt;iosfwd&gt;</emphasis> should be included whenever you simply
need the <emphasis>name</emphasis> of an I/O-related class, such as
- &quot;ofstream&quot; or &quot;basic_streambuf&quot;. Like the name
+ "ofstream" or "basic_streambuf". Like the name
implies, these are forward declarations. (A word to all you fellow
old school programmers: trying to forward declare classes like
- &quot;class istream;&quot; won't work. Look in the iosfwd header if
+ "class istream;" won't work. Look in the iosfwd header if
you'd like to know why.) For example,
</para>
<programlisting>
@@ -93,9 +89,9 @@
the various concrete implementations. If you are only using the
interfaces, then you only need to use the appropriate interface header.
</para>
- <para><emphasis>&lt;iomanip&gt;</emphasis> provides &quot;extractors and inserters
+ <para><emphasis>&lt;iomanip&gt;</emphasis> provides "extractors and inserters
that alter information maintained by class ios_base and its derived
- classes,&quot; such as std::setprecision and std::setw. If you need
+ classes," such as std::setprecision and std::setw. If you need
to write expressions like <code>os &lt;&lt; setw(3);</code> or
<code>is &gt;&gt; setbase(8);</code>, you must include &lt;iomanip&gt;.
</para>
@@ -157,24 +153,24 @@
compile times will go down when there's less parsing work to do.
</para>
-</sect1>
+</section>
<!-- Sect1 02 : Stream Buffers -->
-<sect1 id="std.io.streambufs" xreflabel="Stream Buffers">
+<section xml:id="std.io.streambufs" xreflabel="Stream Buffers"><info><title>Stream Buffers</title></info>
<?dbhtml filename="streambufs.html"?>
- <title>Stream Buffers</title>
+
- <sect2 id="io.streambuf.derived" xreflabel="Derived streambuf Classes">
- <title>Derived streambuf Classes</title>
+ <section xml:id="io.streambuf.derived" xreflabel="Derived streambuf Classes"><info><title>Derived streambuf Classes</title></info>
+
<para>
</para>
<para>Creating your own stream buffers for I/O can be remarkably easy.
If you are interested in doing so, we highly recommend two very
excellent books:
- <ulink url="http://www.angelikalanger.com/iostreams.html">Standard C++
- IOStreams and Locales</ulink> by Langer and Kreft, ISBN 0-201-18395-1, and
- <ulink url="http://www.josuttis.com/libbook/">The C++ Standard Library</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.angelikalanger.com/iostreams.html">Standard C++
+ IOStreams and Locales</link> by Langer and Kreft, ISBN 0-201-18395-1, and
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.josuttis.com/libbook/">The C++ Standard Library</link>
by Nicolai Josuttis, ISBN 0-201-37926-0. Both are published by
Addison-Wesley, who isn't paying us a cent for saying that, honest.
</para>
@@ -223,14 +219,14 @@
</programlisting>
<para>Try it yourself! More examples can be found in 3.1.x code, in
<code>include/ext/*_filebuf.h</code>, and in this article by James Kanze:
- <ulink url="http://kanze.james.neuf.fr/articles/fltrsbf1.html">Filtering
- Streambufs</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://kanze.james.neuf.fr/articles/fltrsbf1.html">Filtering
+ Streambufs</link>.
</para>
- </sect2>
+ </section>
- <sect2 id="io.streambuf.buffering" xreflabel="Buffering">
- <title>Buffering</title>
+ <section xml:id="io.streambuf.buffering" xreflabel="Buffering"><info><title>Buffering</title></info>
+
<para>First, are you sure that you understand buffering? Chaptericularly
the fact that C++ may not, in fact, have anything to do with it?
</para>
@@ -241,8 +237,8 @@
when the output stream is, in fact, a terminal and not a file
or some other device -- and <emphasis>that</emphasis> may not even be true
since C++ says nothing about files nor terminals. All of that is
- system-dependent. (The &quot;newline-buffer-flushing only occurring
- on terminals&quot; thing is mostly true on Unix systems, though.)
+ system-dependent. (The "newline-buffer-flushing only occurring
+ on terminals" thing is mostly true on Unix systems, though.)
</para>
<para>Some people also believe that sending <code>endl</code> down an
output stream only writes a newline. This is incorrect; after a
@@ -252,17 +248,17 @@
wasted when doing this to a file:
</para>
<programlisting>
- output &lt;&lt; &quot;a line of text&quot; &lt;&lt; endl;
+ output &lt;&lt; "a line of text" &lt;&lt; endl;
output &lt;&lt; some_data_variable &lt;&lt; endl;
- output &lt;&lt; &quot;another line of text&quot; &lt;&lt; endl; </programlisting>
+ output &lt;&lt; "another line of text" &lt;&lt; endl; </programlisting>
<para>The proper thing to do in this case to just write the data out
and let the libraries and the system worry about the buffering.
If you need a newline, just write a newline:
</para>
<programlisting>
- output &lt;&lt; &quot;a line of text\n&quot;
+ output &lt;&lt; "a line of text\n"
&lt;&lt; some_data_variable &lt;&lt; '\n'
- &lt;&lt; &quot;another line of text\n&quot;; </programlisting>
+ &lt;&lt; "another line of text\n"; </programlisting>
<para>I have also joined the output statements into a single statement.
You could make the code prettier by moving the single newline to
the start of the quoted text on the last line, for example.
@@ -289,10 +285,10 @@
os.rdbuf()-&gt;pubsetbuf(0,0);
is.rdbuf()-&gt;pubsetbuf(0,0);
- os.open(&quot;/foo/bar/baz&quot;);
- is.open(&quot;/qux/quux/quuux&quot;);
+ os.open("/foo/bar/baz");
+ is.open("/qux/quux/quuux");
...
- os &lt;&lt; &quot;this data is written immediately\n&quot;;
+ os &lt;&lt; "this data is written immediately\n";
is &gt;&gt; i; // and this will probably cause a disk read </programlisting>
<para>Since all aspects of buffering are handled by a streambuf-derived
member, it is necessary to get at that member with <code>rdbuf()</code>.
@@ -303,8 +299,8 @@
<para>A great deal of this is implementation-dependent. For example,
<code>streambuf</code> does not specify any actions for its own
<code>setbuf()</code>-ish functions; the classes derived from
- <code>streambuf</code> each define behavior that &quot;makes
- sense&quot; for that class: an argument of (0,0) turns off buffering
+ <code>streambuf</code> each define behavior that "makes
+ sense" for that class: an argument of (0,0) turns off buffering
for <code>filebuf</code> but does nothing at all for its siblings
<code>stringbuf</code> and <code>strstreambuf</code>, and specifying
anything other than (0,0) has varying effects.
@@ -320,15 +316,15 @@
changing those are system-dependent.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
<!-- Sect1 03 : Memory-based Streams -->
-<sect1 id="std.io.memstreams" xreflabel="Memory Streams">
+<section xml:id="std.io.memstreams" xreflabel="Memory Streams"><info><title>Memory Based Streams</title></info>
<?dbhtml filename="stringstreams.html"?>
- <title>Memory Based Streams</title>
- <sect2 id="std.io.memstreams.compat" xreflabel="Compatibility strstream">
- <title>Compatibility With strstream</title>
+
+ <section xml:id="std.io.memstreams.compat" xreflabel="Compatibility strstream"><info><title>Compatibility With strstream</title></info>
+
<para>
</para>
<para>Stringstreams (defined in the header <code>&lt;sstream&gt;</code>)
@@ -360,23 +356,23 @@
<para>If you are a user of the strstream classes, you need to update
your code. You don't have to explicitly append <code>ends</code> to
terminate the C-style character array, you don't have to mess with
- &quot;freezing&quot; functions, and you don't have to manage the
+ "freezing" functions, and you don't have to manage the
memory yourself. The strstreams have been officially deprecated,
which means that 1) future revisions of the C++ Standard won't
support them, and 2) if you use them, people will laugh at you.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
<!-- Sect1 04 : File-based Streams -->
-<sect1 id="std.io.filestreams" xreflabel="File Streams">
+<section xml:id="std.io.filestreams" xreflabel="File Streams"><info><title>File Based Streams</title></info>
<?dbhtml filename="fstreams.html"?>
- <title>File Based Streams</title>
+
- <sect2 id="std.io.filestreams.copying_a_file" xreflabel="Copying a File">
- <title>Copying a File</title>
+ <section xml:id="std.io.filestreams.copying_a_file" xreflabel="Copying a File"><info><title>Copying a File</title></info>
+
<para>
</para>
@@ -395,13 +391,13 @@
OUT &lt;&lt; IN;</programlisting>
<para>For those of you who don't already know why this doesn't work
(probably from having done it before), I invite you to quickly
- create a simple text file called &quot;input_file&quot; containing
+ create a simple text file called "input_file" containing
the sentence
</para>
<programlisting>
The quick brown fox jumped over the lazy dog.</programlisting>
<para>surrounded by blank lines. Code it up and try it. The contents
- of &quot;output_file&quot; may surprise you.
+ of "output_file" may surprise you.
</para>
<para>Seriously, go do it. Get surprised, then come back. It's worth it.
</para>
@@ -411,7 +407,7 @@
handled by the <code>basic_streambuf</code> family. Fortunately, the
<code>operator&lt;&lt;</code> is overloaded to take an ostream and
a pointer-to-streambuf, in order to help with just this kind of
- &quot;dump the data verbatim&quot; situation.
+ "dump the data verbatim" situation.
</para>
<para>Why a <emphasis>pointer</emphasis> to streambuf and not just a streambuf? Well,
the [io]streams hold pointers (or references, depending on the
@@ -427,7 +423,7 @@
behavior, since that chaptericular &lt;&lt; isn't defined by the Standard.
I have seen instances where it is implemented, but the character
extraction process removes all the whitespace, leaving you with no
- blank lines and only &quot;Thequickbrownfox...&quot;. With
+ blank lines and only "Thequickbrownfox...". With
libraries that do not define that operator, IN (or one of IN's
member pointers) sometimes gets converted to a void*, and the output
file then contains a perfect text representation of a hexadecimal
@@ -439,10 +435,10 @@
descendants.
</para>
- </sect2>
+ </section>
- <sect2 id="std.io.filestreams.binary" xreflabel="Binary Input and Output">
- <title>Binary Input and Output</title>
+ <section xml:id="std.io.filestreams.binary" xreflabel="Binary Input and Output"><info><title>Binary Input and Output</title></info>
+
<para>
</para>
<para>The first and most important thing to remember about binary I/O is
@@ -454,7 +450,7 @@
<para>Sorry. Them's the breaks.
</para>
<para>This isn't going to try and be a complete tutorial on reading and
- writing binary files (because &quot;binary&quot;
+ writing binary files (because "binary"
covers a lot of ground), but we will try and clear
up a couple of misconceptions and common errors.
</para>
@@ -481,7 +477,7 @@
</para>
<para>Third, using the <code>get()</code> and <code>put()/write()</code> member
functions still aren't guaranteed to help you. These are
- &quot;unformatted&quot; I/O functions, but still character-based.
+ "unformatted" I/O functions, but still character-based.
(This may or may not be what you want, see below.)
</para>
<para>Notice how all the problems here are due to the inappropriate use
@@ -558,9 +554,9 @@
<para>
An instructive thread from comp.lang.c++.moderated delved off into
this topic starting more or less at
- <ulink url="http://groups.google.com/group/comp.std.c++/browse_thread/thread/f87b4abd7954a87/946a3eb9921e382d?q=comp.std.c%2B%2B+binary+iostream#946a3eb9921e382d">this</ulink>
- post and continuing to the end of the thread. (The subject heading is &quot;binary iostreams&quot; on both comp.std.c++
- and comp.lang.c++.moderated.) Take special note of the replies by James Kanze and Dietmar K&uuml;hl.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://groups.google.com/group/comp.std.c++/browse_thread/thread/f87b4abd7954a87/946a3eb9921e382d?q=comp.std.c%2B%2B+binary+iostream#946a3eb9921e382d">this</link>
+ post and continuing to the end of the thread. (The subject heading is "binary iostreams" on both comp.std.c++
+ and comp.lang.c++.moderated.) Take special note of the replies by James Kanze and Dietmar Kühl.
</para>
<para>Briefly, the problems of byte ordering and type sizes mean that
the unformatted functions like <code>ostream::put()</code> and
@@ -569,28 +565,28 @@
invocation of a program to another invocation of the same program
on a different platform, etc.
</para>
- </sect2>
+ </section>
-</sect1>
+</section>
<!-- Sect1 03 : Interacting with C -->
-<sect1 id="std.io.c" xreflabel="Interacting with C">
+<section xml:id="std.io.c" xreflabel="Interacting with C"><info><title>Interacting with C</title></info>
<?dbhtml filename="io_and_c.html"?>
- <title>Interacting with C</title>
+
- <sect2 id="std.io.c.FILE" xreflabel="Using FILE* and file descriptors">
- <title>Using FILE* and file descriptors</title>
+ <section xml:id="std.io.c.FILE" xreflabel="Using FILE* and file descriptors"><info><title>Using FILE* and file descriptors</title></info>
+
<para>
See the <link linkend="manual.ext.io">extensions</link> for using
<type>FILE</type> and <type>file descriptors</type> with
<classname>ofstream</classname> and
<classname>ifstream</classname>.
</para>
- </sect2>
+ </section>
- <sect2 id="std.io.c.sync" xreflabel="Performance Issues">
- <title>Performance</title>
+ <section xml:id="std.io.c.sync" xreflabel="Performance Issues"><info><title>Performance</title></info>
+
<para>
Pathetic Performance? Ditch C.
</para>
@@ -604,9 +600,9 @@
#include &lt;iostream&gt;
#include &lt;cstdio&gt;
- std::cout &lt;&lt; &quot;Hel&quot;;
- std::printf (&quot;lo, worl&quot;);
- std::cout &lt;&lt; &quot;d!\n&quot;;
+ std::cout &lt;&lt; "Hel";
+ std::printf ("lo, worl");
+ std::cout &lt;&lt; "d!\n";
</programlisting>
<para>This must do what you think it does.
</para>
@@ -647,7 +643,7 @@
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/iterators.xml b/libstdc++-v3/doc/xml/manual/iterators.xml
index 86b92a4f54b..bcfa30cd5f9 100644
--- a/libstdc++-v3/doc/xml/manual/iterators.xml
+++ b/libstdc++-v3/doc/xml/manual/iterators.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.iterators" xreflabel="Iterators">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.iterators" xreflabel="Iterators">
<?dbhtml filename="iterators.html"?>
-<chapterinfo>
+<info><title>
+ Iterators
+ <indexterm><primary>Iterators</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,19 +14,16 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Iterators
- <indexterm><primary>Iterators</primary></indexterm>
-</title>
<!-- Sect1 01 : Predefined -->
-<sect1 id="std.iterators.predefined" xreflabel="Predefined">
- <title>Predefined</title>
+<section xml:id="std.iterators.predefined" xreflabel="Predefined"><info><title>Predefined</title></info>
+
- <sect2 id="iterators.predefined.vs_pointers" xreflabel="Versus Pointers">
- <title>Iterators vs. Pointers</title>
+ <section xml:id="iterators.predefined.vs_pointers" xreflabel="Versus Pointers"><info><title>Iterators vs. Pointers</title></info>
+
<para>
The following
FAQ <link linkend="faq.iterator_as_pod">entry</link> points out that
@@ -63,7 +59,7 @@ classes.
How much overhead <emphasis>is</emphasis> there when using an
iterator class? Very little. Most of the layering classes
contain nothing but typedefs, and typedefs are
- &quot;meta-information&quot; that simply tell the compiler some
+ "meta-information" that simply tell the compiler some
nicknames; they don't create code. That information gets passed
down through inheritance, so while the compiler has to do work
looking up all the names, your runtime code does not. (This has
@@ -71,10 +67,10 @@ classes.
</para>
- </sect2>
+ </section>
- <sect2 id="iterators.predefined.end" xreflabel="end() Is One Past the End">
- <title>One Past the End</title>
+ <section xml:id="iterators.predefined.end" xreflabel="end() Is One Past the End"><info><title>One Past the End</title></info>
+
<para>This starts off sounding complicated, but is actually very easy,
especially towards the end. Trust me.
@@ -88,7 +84,7 @@ classes.
C and C++ for builtin arrays. The following rules have always been
true for both languages:
</para>
- <orderedlist>
+ <orderedlist inheritnum="ignore" continuation="restarts">
<listitem>
<para>You can point anywhere in the array, <emphasis>or to the first element
past the end of the array</emphasis>. A pointer that points to one
@@ -145,9 +141,9 @@ classes.
</para>
<para>Now think back to your junior-high school algebra course, when you
were learning how to draw graphs. Remember that a graph terminating
- with a solid dot meant, &quot;Everything up through this point,&quot;
- and a graph terminating with an open dot meant, &quot;Everything up
- to, but not including, this point,&quot; respectively called closed
+ with a solid dot meant, "Everything up through this point,"
+ and a graph terminating with an open dot meant, "Everything up
+ to, but not including, this point," respectively called closed
and open ranges? Remember how closed ranges were written with
brackets, <emphasis>[a,b]</emphasis>, and open ranges were written with parentheses,
<emphasis>(a,b)</emphasis>?
@@ -181,8 +177,8 @@ classes.
<para>Just don't dereference <code>end()</code>.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
<!-- Sect1 02 : Stream -->
diff --git a/libstdc++-v3/doc/xml/manual/locale.xml b/libstdc++-v3/doc/xml/manual/locale.xml
index 234439ae355..dcdd1032284 100644
--- a/libstdc++-v3/doc/xml/manual/locale.xml
+++ b/libstdc++-v3/doc/xml/manual/locale.xml
@@ -1,6 +1,7 @@
-<section id="std.localization.locales.locale" xreflabel="Locale">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.localization.locales.locale" xreflabel="Locale">
-<sectioninfo>
+<info><title>locale</title>
<keywordset>
<keyword>
ISO C++
@@ -9,9 +10,9 @@
locale
</keyword>
</keywordset>
-</sectioninfo>
+</info>
+
-<title>locale</title>
<para>
Describes the basic locale object, including nested
@@ -19,8 +20,8 @@ classes id, facet, and the reference-counted implementation object,
class _Impl.
</para>
-<section id="locales.locale.req">
-<title>Requirements</title>
+<section xml:id="locales.locale.req"><info><title>Requirements</title></info>
+
<para>
Class locale is non-templatized and has two distinct types nested
@@ -89,8 +90,8 @@ Provides an index for looking up specific facets.
</para>
</section>
-<section id="locales.locale.design">
-<title>Design</title>
+<section xml:id="locales.locale.design"><info><title>Design</title></info>
+
<para>
The major design challenge is fitting an object-orientated and
@@ -105,11 +106,11 @@ portability is an issue.
</section>
-<section id="locales.locale.impl">
-<title>Implementation</title>
+<section xml:id="locales.locale.impl"><info><title>Implementation</title></info>
- <section id="locale.impl.c">
- <title>Interacting with &quot;C&quot; locales</title>
+
+ <section xml:id="locale.impl.c"><info><title>Interacting with "C" locales</title></info>
+
<itemizedlist>
<listitem>
@@ -470,8 +471,8 @@ global locale" (emphasis Paolo), that is:
</section>
</section>
-<section id="locales.locale.future">
-<title>Future</title>
+<section xml:id="locales.locale.future"><info><title>Future</title></info>
+
<itemizedlist>
<listitem>
@@ -510,21 +511,15 @@ global locale" (emphasis Paolo), that is:
</itemizedlist>
</section>
-<bibliography id="locales.locale.biblio">
-<title>Bibliography</title>
+<bibliography xml:id="locales.locale.biblio"><info><title>Bibliography</title></info>
+
<biblioentry>
- <title>
+ <citetitle>
The GNU C Library
- </title>
- <author>
- <surname>McGrath</surname>
- <firstname>Roland</firstname>
- </author>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2007</year>
<holder>FSF</holder>
@@ -536,23 +531,20 @@ global locale" (emphasis Paolo), that is:
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Correspondence
- </title>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2002</year>
- <holder></holder>
+ <holder/>
</copyright>
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 14882:1998 Programming languages - C++
- </title>
+ </citetitle>
<copyright>
<year>1998</year>
<holder>ISO</holder>
@@ -560,9 +552,9 @@ global locale" (emphasis Paolo), that is:
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 9899:1999 Programming languages - C
- </title>
+ </citetitle>
<copyright>
<year>1999</year>
<holder>ISO</holder>
@@ -570,13 +562,11 @@ global locale" (emphasis Paolo), that is:
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.opengroup.org/austin">
- <citetitle>
- System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin" class="uri">
</biblioid>
+ <citetitle>
+ System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </citetitle>
<copyright>
<year>2008</year>
<holder>
@@ -587,13 +577,10 @@ global locale" (emphasis Paolo), that is:
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
The C++ Programming Language, Special Edition
- </title>
- <author>
- <surname>Stroustrup</surname>
- <firstname>Bjarne</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley, Inc.</holder>
@@ -607,20 +594,14 @@ global locale" (emphasis Paolo), that is:
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Standard C++ IOStreams and Locales
- </title>
+ </citetitle>
<subtitle>
Advanced Programmer's Guide and Reference
</subtitle>
- <author>
- <surname>Langer</surname>
- <firstname>Angelika</firstname>
- </author>
- <author>
- <surname>Kreft</surname>
- <firstname>Klaus</firstname>
- </author>
+ <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
+ <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley Longman, Inc.</holder>
diff --git a/libstdc++-v3/doc/xml/manual/localization.xml b/libstdc++-v3/doc/xml/manual/localization.xml
index 70898546776..b46e707fc4e 100644
--- a/libstdc++-v3/doc/xml/manual/localization.xml
+++ b/libstdc++-v3/doc/xml/manual/localization.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.localization" xreflabel="Localization">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.localization" xreflabel="Localization">
<?dbhtml filename="localization.html"?>
-<chapterinfo>
+<info><title>
+ Localization
+ <indexterm><primary>Localization</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,42 +14,35 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Localization
- <indexterm><primary>Localization</primary></indexterm>
-</title>
<!-- Section 01 : Locale -->
-<section id="std.localization.locales" xreflabel="Locales">
+<section xml:id="std.localization.locales" xreflabel="Locales"><info><title>Locales</title></info>
<?dbhtml filename="locales.html"?>
- <title>Locales</title>
+
<!-- Section 01 : locale -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="locale.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="locale.xml">
</xi:include>
</section>
<!-- Section 02 : Facet -->
-<section id="std.localization.facet" xreflabel="Facets">
+<section xml:id="std.localization.facet" xreflabel="Facets"><info><title>Facets</title></info>
<?dbhtml filename="facets.html"?>
- <title>Facets</title>
+
<!-- Section 01 : ctype -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="ctype.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="ctype.xml">
</xi:include>
<!-- Section 02 : codecvt -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="codecvt.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="codecvt.xml">
</xi:include>
<!-- Section 03 : messages -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="messages.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="messages.xml">
</xi:include>
</section>
diff --git a/libstdc++-v3/doc/xml/manual/messages.xml b/libstdc++-v3/doc/xml/manual/messages.xml
index f0428d43781..d834e27d7a8 100644
--- a/libstdc++-v3/doc/xml/manual/messages.xml
+++ b/libstdc++-v3/doc/xml/manual/messages.xml
@@ -1,7 +1,8 @@
-<section id="manual.localization.facet.messages" xreflabel="Messages">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.localization.facet.messages" xreflabel="Messages">
<?dbhtml filename="messages.html"?>
-<sectioninfo>
+<info><title>messages</title>
<keywordset>
<keyword>
ISO C++
@@ -10,9 +11,9 @@
messages
</keyword>
</keywordset>
-</sectioninfo>
+</info>
+
-<title>messages</title>
<para>
The std::messages facet implements message retrieval functionality
@@ -20,8 +21,8 @@ equivalent to Java's java.text.MessageFormat .using either GNU gettext
or IEEE 1003.1-200 functions.
</para>
-<section id="facet.messages.req">
-<title>Requirements</title>
+<section xml:id="facet.messages.req"><info><title>Requirements</title></info>
+
<para>
The std::messages facet is probably the most vaguely defined facet in
@@ -108,8 +109,8 @@ be found, returns dfault.
</section>
-<section id="facet.messages.design">
-<title>Design</title>
+<section xml:id="facet.messages.design"><info><title>Design</title></info>
+
<para>
A couple of notes on the standard.
@@ -157,11 +158,11 @@ other, explicitly named locales.
</section>
-<section id="facet.messages.impl">
-<title>Implementation</title>
+<section xml:id="facet.messages.impl"><info><title>Implementation</title></info>
- <section id="messages.impl.models">
- <title>Models</title>
+
+ <section xml:id="messages.impl.models"><info><title>Models</title></info>
+
<para>
This is a relatively simple class, on the face of it. The standard
specifies very little in concrete terms, so generic
@@ -228,8 +229,8 @@ model.
</section>
- <section id="messages.impl.gnu">
- <title>The GNU Model</title>
+ <section xml:id="messages.impl.gnu"><info><title>The GNU Model</title></info>
+
<para>
The messages facet, because it is retrieving and converting
@@ -321,8 +322,8 @@ model.
</section>
</section>
-<section id="facet.messages.use">
-<title>Use</title>
+<section xml:id="facet.messages.use"><info><title>Use</title></info>
+
<para>
A simple example using the GNU model of message conversion.
</para>
@@ -351,8 +352,8 @@ void test01()
</section>
-<section id="facet.messages.future">
-<title>Future</title>
+<section xml:id="facet.messages.future"><info><title>Future</title></info>
+
<itemizedlist>
<listitem>
@@ -438,21 +439,15 @@ void test01()
</section>
-<bibliography id="facet.messages.biblio">
-<title>Bibliography</title>
+<bibliography xml:id="facet.messages.biblio"><info><title>Bibliography</title></info>
+
<biblioentry>
- <title>
+ <citetitle>
The GNU C Library
- </title>
- <author>
- <surname>McGrath</surname>
- <firstname>Roland</firstname>
- </author>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2007</year>
<holder>FSF</holder>
@@ -462,23 +457,20 @@ void test01()
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Correspondence
- </title>
- <author>
- <surname>Drepper</surname>
- <firstname>Ulrich</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2002</year>
- <holder></holder>
+ <holder/>
</copyright>
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 14882:1998 Programming languages - C++
- </title>
+ </citetitle>
<copyright>
<year>1998</year>
<holder>ISO</holder>
@@ -486,9 +478,9 @@ void test01()
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
ISO/IEC 9899:1999 Programming languages - C
- </title>
+ </citetitle>
<copyright>
<year>1999</year>
@@ -497,13 +489,11 @@ void test01()
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.opengroup.org/austin">
- <citetitle>
- System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin" class="uri">
</biblioid>
+ <citetitle>
+ System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </citetitle>
<copyright>
<year>2008</year>
<holder>
@@ -514,13 +504,10 @@ void test01()
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
The C++ Programming Language, Special Edition
- </title>
- <author>
- <surname>Stroustrup</surname>
- <firstname>Bjarne</firstname>
- </author>
+ </citetitle>
+ <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley, Inc.</holder>
@@ -534,20 +521,14 @@ void test01()
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Standard C++ IOStreams and Locales
- </title>
+ </citetitle>
<subtitle>
Advanced Programmer's Guide and Reference
</subtitle>
- <author>
- <surname>Langer</surname>
- <firstname>Angelika</firstname>
- </author>
- <author>
- <surname>Kreft</surname>
- <firstname>Klaus</firstname>
- </author>
+ <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
+ <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley Longman, Inc.</holder>
@@ -560,27 +541,24 @@ void test01()
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://java.sun.com/reference/api/index.html">
- <citetitle>
- API Specifications, Java Platform
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://java.sun.com/reference/api/index.html" class="uri">
+ </biblioid>
+ <citetitle>
+ API Specifications, Java Platform
+ </citetitle>
+
<pagenums>java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle
</pagenums>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.gnu.org/software/gettext/">
- <citetitle>
- GNU gettext tools, version 0.10.38, Native Language Support
-Library and Tools.
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gnu.org/software/gettext/" class="uri">
</biblioid>
+ <citetitle>
+ GNU gettext tools, version 0.10.38, Native Language Support
+ Library and Tools.
+ </citetitle>
</biblioentry>
</bibliography>
diff --git a/libstdc++-v3/doc/xml/manual/mt_allocator.xml b/libstdc++-v3/doc/xml/manual/mt_allocator.xml
index ba93b10fa68..b31b593bc29 100644
--- a/libstdc++-v3/doc/xml/manual/mt_allocator.xml
+++ b/libstdc++-v3/doc/xml/manual/mt_allocator.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.ext.allocator.mt" xreflabel="mt allocator">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext.allocator.mt" xreflabel="mt allocator">
<?dbhtml filename="mt_allocator.html"?>
-<sect1info>
+<info><title>mt_allocator</title>
<keywordset>
<keyword>
ISO C++
@@ -10,15 +11,15 @@
allocator
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>mt_allocator</title>
<para>
</para>
-<sect2 id="allocator.mt.intro">
-<title>Intro</title>
+<section xml:id="allocator.mt.intro"><info><title>Intro</title></info>
+
<para>
The mt allocator [hereinafter referred to simply as "the allocator"]
@@ -40,14 +41,14 @@
view - the "inner workings" of the allocator.
</para>
-</sect2>
+</section>
+
+<section xml:id="allocator.mt.design_issues"><info><title>Design Issues</title></info>
-<sect2 id="allocator.mt.design_issues">
-<title>Design Issues</title>
-<sect3 id="allocator.mt.overview">
-<title>Overview</title>
+<section xml:id="allocator.mt.overview"><info><title>Overview</title></info>
+
<para> There are three general components to the allocator: a datum
@@ -104,15 +105,15 @@ classes, namely member functions <code>allocate</code> and
<code>deallocate</code>, plus others.
</para>
-</sect3>
-</sect2>
+</section>
+</section>
+
+<section xml:id="allocator.mt.impl"><info><title>Implementation</title></info>
-<sect2 id="allocator.mt.impl">
-<title>Implementation</title>
-<sect3 id="allocator.mt.tune">
-<title>Tunable Parameters</title>
+<section xml:id="allocator.mt.tune"><info><title>Tunable Parameters</title></info>
+
<para>Certain allocation parameters can be modified, or tuned. There
exists a nested <code>struct __pool_base::_Tune</code> that contains all
@@ -166,10 +167,10 @@ int main()
}
</programlisting>
-</sect3>
+</section>
+
+<section xml:id="allocator.mt.init"><info><title>Initialization</title></info>
-<sect3 id="allocator.mt.init">
-<title>Initialization</title>
<para>
The static variables (pointers to freelists, tuning parameters etc)
@@ -276,10 +277,10 @@ The _S_initialize() function:
a thread decides to return some blocks to the global freelist.
</para>
-</sect3>
+</section>
+
+<section xml:id="allocator.mt.deallocation"><info><title>Deallocation Notes</title></info>
-<sect3 id="allocator.mt.deallocation">
-<title>Deallocation Notes</title>
<para> Notes about deallocation. This allocator does not explicitly
release memory. Because of this, memory debugging programs like
@@ -308,16 +309,16 @@ containers, this works, as an instance of the allocator is constructed
as part of a container's constructor. However, this assumption is
implementation-specific, and subject to change. For an example of a
pool that frees memory, see the following
- <ulink url="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc?view=markup">
- example.</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc?view=markup">
+ example.</link>
</para>
-</sect3>
+</section>
-</sect2>
+</section>
+
+<section xml:id="allocator.mt.example_single"><info><title>Single Thread Example</title></info>
-<sect2 id="allocator.mt.example_single">
-<title>Single Thread Example</title>
<para>
Let's start by describing how the data on a freelist is laid out in memory.
@@ -408,10 +409,10 @@ after a set of performance measurements that showed that this is roughly 10%
faster than maintaining a set of "last pointers" as well.
</para>
-</sect2>
+</section>
+
+<section xml:id="allocator.mt.example_multi"><info><title>Multiple Thread Example</title></info>
-<sect2 id="allocator.mt.example_multi">
-<title>Multiple Thread Example</title>
<para>
In the ST example we never used the thread_id variable present in each block.
@@ -549,6 +550,6 @@ be improved to further reduce the risk of blocks being "bounced back
and forth" between freelists.
</para>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/numerics.xml b/libstdc++-v3/doc/xml/manual/numerics.xml
index 379e83cf56d..a9e866e78c8 100644
--- a/libstdc++-v3/doc/xml/manual/numerics.xml
+++ b/libstdc++-v3/doc/xml/manual/numerics.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.numerics" xreflabel="Numerics">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.numerics" xreflabel="Numerics">
<?dbhtml filename="numerics.html"?>
-<chapterinfo>
+<info><title>
+ Numerics
+ <indexterm><primary>Numerics</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,21 +14,18 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Numerics
- <indexterm><primary>Numerics</primary></indexterm>
-</title>
<!-- Sect1 01 : Complex -->
-<sect1 id="std.numerics.complex" xreflabel="complex">
+<section xml:id="std.numerics.complex" xreflabel="complex"><info><title>Complex</title></info>
<?dbhtml filename="complex.html"?>
- <title>Complex</title>
+
<para>
</para>
- <sect2 id="numerics.complex.processing" xreflabel="complex Processing">
- <title>complex Processing</title>
+ <section xml:id="numerics.complex.processing" xreflabel="complex Processing"><info><title>complex Processing</title></info>
+
<para>
</para>
<para>Using <code>complex&lt;&gt;</code> becomes even more comple- er, sorry,
@@ -38,7 +34,7 @@
compiled a list of C++98 and C99 conflict points; his description of
C's new type versus those of C++ and how to get them playing together
nicely is
-<ulink url="http://david.tribble.com/text/cdiffs.htm#C99-complex">here</ulink>.
+<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://david.tribble.com/text/cdiffs.htm#C99-complex">here</link>.
</para>
<para><code>complex&lt;&gt;</code> is intended to be instantiated with a
floating-point type. As long as you meet that and some other basic
@@ -49,13 +45,13 @@
<code>(u)</code>, and <code>(u,v)</code>.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
<!-- Sect1 02 : Generalized Operations -->
-<sect1 id="std.numerics.generalized_ops" xreflabel="Generalized Ops">
+<section xml:id="std.numerics.generalized_ops" xreflabel="Generalized Ops"><info><title>Generalized Operations</title></info>
<?dbhtml filename="generalized_numeric_operations.html"?>
- <title>Generalized Operations</title>
+
<para>
</para>
@@ -93,15 +89,15 @@
<para>The other three functions have similar dual-signature forms.
</para>
-</sect1>
+</section>
<!-- Sect1 03 : Interacting with C -->
-<sect1 id="std.numerics.c" xreflabel="Interacting with C">
+<section xml:id="std.numerics.c" xreflabel="Interacting with C"><info><title>Interacting with C</title></info>
<?dbhtml filename="numerics_and_c.html"?>
- <title>Interacting with C</title>
+
- <sect2 id="numerics.c.array" xreflabel="Numerics vs. Arrays">
- <title>Numerics vs. Arrays</title>
+ <section xml:id="numerics.c.array" xreflabel="Numerics vs. Arrays"><info><title>Numerics vs. Arrays</title></info>
+
<para>One of the major reasons why FORTRAN can chew through numbers so well
is that it is defined to be free of pointer aliasing, an assumption
@@ -112,7 +108,7 @@
as an extension).
</para>
<para>That library solution is a set of two classes, five template classes,
- and &quot;a whole bunch&quot; of functions. The classes are required
+ and "a whole bunch" of functions. The classes are required
to be free of pointer aliasing, so compilers can optimize the
daylights out of them the same way that they have been for FORTRAN.
They are collectively called <code>valarray</code>, although strictly
@@ -121,10 +117,10 @@
libraries before.
</para>
- </sect2>
+ </section>
- <sect2 id="numerics.c.c99" xreflabel="C99">
- <title>C99</title>
+ <section xml:id="numerics.c.c99" xreflabel="C99"><info><title>C99</title></info>
+
<para>In addition to the other topics on this page, we'll note here some
of the C99 features that appear in libstdc++.
@@ -143,7 +139,7 @@
<code>wcstoll</code>.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/parallel_mode.xml b/libstdc++-v3/doc/xml/manual/parallel_mode.xml
index fbc2ed1dbec..ec0faf9c71d 100644
--- a/libstdc++-v3/doc/xml/manual/parallel_mode.xml
+++ b/libstdc++-v3/doc/xml/manual/parallel_mode.xml
@@ -1,12 +1,8 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="manual.ext.parallel_mode" xreflabel="Parallel Mode">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext.parallel_mode" xreflabel="Parallel Mode">
<?dbhtml filename="parallel_mode.html"?>
-<chapterinfo>
+<info><title>Parallel Mode</title>
<keywordset>
<keyword>
C++
@@ -18,9 +14,9 @@
parallel
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>Parallel Mode</title>
<para> The libstdc++ parallel mode is an experimental parallel
implementation of many algorithms the C++ Standard Library.
@@ -35,8 +31,8 @@ specific compiler flag.
</para>
-<sect1 id="manual.ext.parallel_mode.intro" xreflabel="Intro">
- <title>Intro</title>
+<section xml:id="manual.ext.parallel_mode.intro" xreflabel="Intro"><info><title>Intro</title></info>
+
<para>The following library components in the include
<filename class="headerfile">numeric</filename> are included in the parallel mode:</para>
@@ -83,10 +79,10 @@ specific compiler flag.
<listitem><para><function>std::unique_copy</function></para></listitem>
</itemizedlist>
-</sect1>
+</section>
-<sect1 id="manual.ext.parallel_mode.semantics" xreflabel="Semantics">
- <title>Semantics</title>
+<section xml:id="manual.ext.parallel_mode.semantics" xreflabel="Semantics"><info><title>Semantics</title></info>
+
<para> The parallel mode STL algorithms are currently not exception-safe,
i.e. user-defined functors must not throw exceptions.
@@ -100,13 +96,13 @@ it is not possible to call parallel STL algorithm in
concurrent threads, either.
It might work with other compilers, though.</para>
-</sect1>
+</section>
-<sect1 id="manual.ext.parallel_mode.using" xreflabel="Using">
- <title>Using</title>
+<section xml:id="manual.ext.parallel_mode.using" xreflabel="Using"><info><title>Using</title></info>
+
-<sect2 id="parallel_mode.using.prereq_flags">
- <title>Prerequisite Compiler Flags</title>
+<section xml:id="parallel_mode.using.prereq_flags"><info><title>Prerequisite Compiler Flags</title></info>
+
<para>
Any use of parallel functionality requires additional compiler
@@ -114,7 +110,7 @@ It might work with other compilers, though.</para>
not difficult: just compile your application with the compiler
flag <literal>-fopenmp</literal>. This will link
in <code>libgomp</code>, the GNU
- OpenMP <ulink url="http://gcc.gnu.org/onlinedocs/libgomp">implementation</ulink>,
+ OpenMP <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libgomp">implementation</link>,
whose presence is mandatory.
</para>
@@ -129,10 +125,10 @@ In addition, hardware that supports atomic operations and a compiler
the GCC manual for more information.
</para>
-</sect2>
+</section>
-<sect2 id="parallel_mode.using.parallel_mode">
- <title>Using Parallel Mode</title>
+<section xml:id="parallel_mode.using.parallel_mode"><info><title>Using Parallel Mode</title></info>
+
<para>
To use the libstdc++ parallel mode, compile your application with
@@ -154,10 +150,10 @@ In addition, hardware that supports atomic operations and a compiler
translation units. Parallel mode functionality has distinct linkage,
and cannot be confused with normal mode symbols.
</para>
-</sect2>
+</section>
-<sect2 id="parallel_mode.using.specific">
- <title>Using Specific Parallel Components</title>
+<section xml:id="parallel_mode.using.specific"><info><title>Using Specific Parallel Components</title></info>
+
<para>When it is not feasible to recompile your entire application, or
only specific algorithms need to be parallel-aware, individual
@@ -199,13 +195,14 @@ flags for atomic operations.)
parallel algorithms that can be used in a similar manner:
</para>
-<table frame='all'>
+<table frame="all">
<title>Parallel Algorithms</title>
-<tgroup cols='4' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
@@ -461,16 +458,16 @@ flags for atomic operations.)
</tgroup>
</table>
-</sect2>
+</section>
-</sect1>
+</section>
-<sect1 id="manual.ext.parallel_mode.design" xreflabel="Design">
- <title>Design</title>
+<section xml:id="manual.ext.parallel_mode.design" xreflabel="Design"><info><title>Design</title></info>
+
<para>
</para>
-<sect2 id="parallel_mode.design.intro" xreflabel="Intro">
- <title>Interface Basics</title>
+<section xml:id="parallel_mode.design.intro" xreflabel="Intro"><info><title>Interface Basics</title></info>
+
<para>
All parallel algorithms are intended to have signatures that are
@@ -536,14 +533,14 @@ overload is therefore missing.
</para>
-</sect2>
+</section>
-<sect2 id="parallel_mode.design.tuning" xreflabel="Tuning">
- <title>Configuration and Tuning</title>
+<section xml:id="parallel_mode.design.tuning" xreflabel="Tuning"><info><title>Configuration and Tuning</title></info>
+
-<sect3 id="parallel_mode.design.tuning.omp" xreflabel="OpenMP Environment">
- <title>Setting up the OpenMP Environment</title>
+<section xml:id="parallel_mode.design.tuning.omp" xreflabel="OpenMP Environment"><info><title>Setting up the OpenMP Environment</title></info>
+
<para>
Several aspects of the overall runtime environment can be manipulated
@@ -585,10 +582,10 @@ nested parallelism (<function>omp_set_nested</function>), schedule kind
documentation for more information.
</para>
-</sect3>
+</section>
-<sect3 id="parallel_mode.design.tuning.compile" xreflabel="Compile Switches">
- <title>Compile Time Switches</title>
+<section xml:id="parallel_mode.design.tuning.compile" xreflabel="Compile Switches"><info><title>Compile Time Switches</title></info>
+
<para>
To force an algorithm to execute sequentially, even though parallelism
@@ -662,10 +659,10 @@ Multiway mergesort comes with the two splitting strategies for multi-way
merging. The quicksort options cannot be used for <code>stable_sort</code>.
</para>
-</sect3>
+</section>
-<sect3 id="parallel_mode.design.tuning.settings" xreflabel="_Settings">
- <title>Run Time Settings and Defaults</title>
+<section xml:id="parallel_mode.design.tuning.settings" xreflabel="_Settings"><info><title>Run Time Settings and Defaults</title></info>
+
<para>
The default parallelization strategy, the choice of specific algorithm
@@ -729,8 +726,8 @@ i. e. it is a singleton. It can be read and written by calling
<code>__gnu_parallel::_Settings::set</code>, respectively.
Please note that the first call return a const object, so direct manipulation
is forbidden.
-See <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01005.html">
- <filename class="headerfile">settings.h</filename></ulink>
+See <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01005.html">
+ <filename class="headerfile">settings.h</filename></link>
for complete details.
</para>
@@ -754,12 +751,12 @@ int main()
}
</programlisting>
-</sect3>
+</section>
-</sect2>
+</section>
-<sect2 id="parallel_mode.design.impl" xreflabel="Impl">
- <title>Implementation Namespaces</title>
+<section xml:id="parallel_mode.design.impl" xreflabel="Impl"><info><title>Implementation Namespaces</title></info>
+
<para> One namespace contain versions of code that are always
explicitly sequential:
@@ -787,12 +784,12 @@ related to the parallel mode on a per-namespace basis, can be found in
the generated source documentation.
</para>
-</sect2>
+</section>
-</sect1>
+</section>
-<sect1 id="manual.ext.parallel_mode.test" xreflabel="Testing">
- <title>Testing</title>
+<section xml:id="manual.ext.parallel_mode.test" xreflabel="Testing"><info><title>Testing</title></info>
+
<para>
Both the normal conformance and regression tests and the
@@ -830,28 +827,22 @@ the generated source documentation.
file, and can be generated by using the <code>make
doc-performance</code> rule in the testsuite's Makefile.
</para>
-</sect1>
+</section>
+
+<bibliography xml:id="parallel_mode.biblio"><info><title>Bibliography</title></info>
-<bibliography id="parallel_mode.biblio">
-<title>Bibliography</title>
<biblioentry>
- <title>
+ <citetitle>
Parallelization of Bulk Operations for STL Dictionaries
- </title>
+ </citetitle>
- <author>
- <firstname>Johannes</firstname>
- <surname>Singler</surname>
- </author>
- <author>
- <firstname>Leonor</firstname>
- <surname>Frias</surname>
- </author>
+ <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname></author>
+ <author><personname><firstname>Leonor</firstname><surname>Frias</surname></personname></author>
<copyright>
<year>2007</year>
- <holder></holder>
+ <holder/>
</copyright>
<publisher>
@@ -862,26 +853,17 @@ the generated source documentation.
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
The Multi-Core Standard Template Library
- </title>
-
- <author>
- <firstname>Johannes</firstname>
- <surname>Singler</surname>
- </author>
- <author>
- <firstname>Peter</firstname>
- <surname>Sanders</surname>
- </author>
- <author>
- <firstname>Felix</firstname>
- <surname>Putze</surname>
- </author>
+ </citetitle>
+
+ <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname></author>
+ <author><personname><firstname>Peter</firstname><surname>Sanders</surname></personname></author>
+ <author><personname><firstname>Felix</firstname><surname>Putze</surname></personname></author>
<copyright>
<year>2007</year>
- <holder></holder>
+ <holder/>
</copyright>
<publisher>
diff --git a/libstdc++-v3/doc/xml/manual/prerequisites.xml b/libstdc++-v3/doc/xml/manual/prerequisites.xml
index e85020f2563..5a51b9986e5 100644
--- a/libstdc++-v3/doc/xml/manual/prerequisites.xml
+++ b/libstdc++-v3/doc/xml/manual/prerequisites.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.intro.setup.prereq" xreflabel="Prerequisites">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.intro.setup.prereq" xreflabel="Prerequisites">
<?dbhtml filename="prerequisites.html"?>
-<sect1info>
+<info><title>Prerequisites</title>
<keywordset>
<keyword>
ISO C++
@@ -10,17 +11,17 @@
Prerequisites
</keyword>
</keywordset>
-</sect1info>
+</info>
+
-<title>Prerequisites</title>
<para>
Because libstdc++ is part of GCC, the primary source for
installation instructions is
- <ulink url="http://gcc.gnu.org/install/">the GCC install page</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/">the GCC install page</link>.
In particular, list of prerequisite software needed to build the library
- <ulink url="http://gcc.gnu.org/install/prerequisites.html">
- starts with those requirements.</ulink> The same pages also list
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/prerequisites.html">
+ starts with those requirements.</link> The same pages also list
the tools you will need if you wish to modify the source.
</para>
@@ -31,8 +32,8 @@
<para>As of GCC 4.0.1 the minimum version of binutils required to build
libstdc++ is <code>2.15.90.0.1.1</code>. You can get snapshots
(as well as releases) of binutils from
- <ulink url="ftp://sources.redhat.com/pub/binutils/">
- ftp://sources.redhat.com/pub/binutils</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="ftp://sources.redhat.com/pub/binutils/">
+ ftp://sources.redhat.com/pub/binutils</link>.
Older releases of libstdc++ do not require such a recent version,
but to take full advantage of useful space-saving features and
bug-fixes you should use a recent binutils whenever possible.
@@ -156,4 +157,4 @@ zh_TW BIG5
</varlistentry>
</variablelist>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/profile_mode.xml b/libstdc++-v3/doc/xml/manual/profile_mode.xml
index 5665d4e6477..cb4db6732a5 100644
--- a/libstdc++-v3/doc/xml/manual/profile_mode.xml
+++ b/libstdc++-v3/doc/xml/manual/profile_mode.xml
@@ -1,12 +1,8 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="manual.ext.profile_mode" xreflabel="Profile Mode">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.ext.profile_mode" xreflabel="Profile Mode">
<?dbhtml filename="profile_mode.html"?>
-<chapterinfo>
+<info><title>Profile Mode</title>
<keywordset>
<keyword>
C++
@@ -18,13 +14,13 @@
profile
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>Profile Mode</title>
-<sect1 id="manual.ext.profile_mode.intro" xreflabel="Intro">
- <title>Intro</title>
+<section xml:id="manual.ext.profile_mode.intro" xreflabel="Intro"><info><title>Intro</title></info>
+
<para>
<emphasis>Goal: </emphasis>Give performance improvement advice based on
recognition of suboptimal usage patterns of the standard library.
@@ -36,8 +32,8 @@
various components at interesting entry/exit points to/from the standard
library. Process trace, recognize suboptimal patterns, give advice.
For details, see
- <ulink url="http://dx.doi.org/10.1109/CGO.2009.36">paper presented at
- CGO 2009</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://dx.doi.org/10.1109/CGO.2009.36">paper presented at
+ CGO 2009</link>.
</para>
<para>
<emphasis>Strengths: </emphasis>
@@ -71,8 +67,8 @@
</para>
-<sect2 id="manual.ext.profile_mode.using" xreflabel="Using">
- <title>Using the Profile Mode</title>
+<section xml:id="manual.ext.profile_mode.using" xreflabel="Using"><info><title>Using the Profile Mode</title></info>
+
<para>
This is the anticipated common workflow for program <code>foo.cc</code>:
@@ -155,10 +151,10 @@ vector-size: improvement = 3: call stack = 0x804842c ...
at a higher abstraction level.
</para>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.tuning" xreflabel="Tuning">
- <title>Tuning the Profile Mode</title>
+<section xml:id="manual.ext.profile_mode.tuning" xreflabel="Tuning"><info><title>Tuning the Profile Mode</title></info>
+
<para>Compile time switches and environment variables (see also file
profiler.h). Unless specified otherwise, they can be set at compile time
@@ -214,21 +210,22 @@ vector-size: improvement = 3: call stack = 0x804842c ...
</itemizedlist>
</para>
-</sect2>
+</section>
-</sect1>
+</section>
-<sect1 id="manual.ext.profile_mode.design" xreflabel="Design">
- <title>Design</title>
+<section xml:id="manual.ext.profile_mode.design" xreflabel="Design"><info><title>Design</title></info>
+
<para>
</para>
-<table frame='all'>
+<table frame="all">
<title>Profile Code Location</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<thead>
<row>
@@ -258,9 +255,8 @@ vector-size: improvement = 3: call stack = 0x804842c ...
<para>
</para>
-<sect2 id="manual.ext.profile_mode.design.wrapper"
- xreflabel="Wrapper">
-<title>Wrapper Model</title>
+<section xml:id="manual.ext.profile_mode.design.wrapper" xreflabel="Wrapper"><info><title>Wrapper Model</title></info>
+
<para>
In order to get our instrumented library version included instead of the
release one,
@@ -285,12 +281,11 @@ vector-size: improvement = 3: call stack = 0x804842c ...
not allowed. Mixing them at compile time will result in preprocessor errors.
Mixing them at link time is undefined.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.design.instrumentation" xreflabel="Instrumentation"><info><title>Instrumentation</title></info>
-<sect2 id="manual.ext.profile_mode.design.instrumentation"
- xreflabel="Instrumentation">
-<title>Instrumentation</title>
<para>
Instead of instrumenting every public entry and exit point,
we chose to add instrumentation on demand, as needed
@@ -313,12 +308,11 @@ vector-size: improvement = 3: call stack = 0x804842c ...
All the instrumentation on/off compile time switches live in
<code>include/profile/profiler.h</code>.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.design.rtlib" xreflabel="Run Time Behavior"><info><title>Run Time Behavior</title></info>
-<sect2 id="manual.ext.profile_mode.design.rtlib"
- xreflabel="Run Time Behavior">
-<title>Run Time Behavior</title>
<para>
For practical reasons, the instrumentation library processes the trace
partially
@@ -339,15 +333,14 @@ vector-size: improvement = 3: call stack = 0x804842c ...
<para>
For details, see
- <ulink url="http://dx.doi.org/10.1109/CGO.2009.36">paper presented at
- CGO 2009</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://dx.doi.org/10.1109/CGO.2009.36">paper presented at
+ CGO 2009</link>.
</para>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.design.analysis"
- xreflabel="Analysis and Diagnostics">
-<title>Analysis and Diagnostics</title>
+<section xml:id="manual.ext.profile_mode.design.analysis" xreflabel="Analysis and Diagnostics"><info><title>Analysis and Diagnostics</title></info>
+
<para>
Final analysis takes place offline, and it is based entirely on the
generated trace and debugging info in the application binary.
@@ -357,12 +350,11 @@ vector-size: improvement = 3: call stack = 0x804842c ...
The input to the analysis is a table indexed by profile type and call stack.
The data type for each entry depends on the profile type.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.design.cost-model" xreflabel="Cost Model"><info><title>Cost Model</title></info>
-<sect2 id="manual.ext.profile_mode.design.cost-model"
- xreflabel="Cost Model">
-<title>Cost Model</title>
<para>
While it is likely that cost models become complex as we get into
more sophisticated analysis, we will try to follow a simple set of rules
@@ -399,12 +391,11 @@ vector-size: improvement = 3: call stack = 0x804842c ...
care require a sorted container.</para></listitem>
</itemizedlist>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.design.reports" xreflabel="Reports"><info><title>Reports</title></info>
-<sect2 id="manual.ext.profile_mode.design.reports"
- xreflabel="Reports">
-<title>Reports</title>
<para>
There are two types of reports. First, if we recognize a pattern for which
we have a substitute that is likely to give better performance, we print
@@ -419,12 +410,11 @@ which have the worst data locality in actual traversals.
Although this does not offer a solution,
it helps the user focus on the key problems and ignore the uninteresting ones.
</para>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.design.testing"
- xreflabel="Testing">
-<title>Testing</title>
+<section xml:id="manual.ext.profile_mode.design.testing" xreflabel="Testing"><info><title>Testing</title></info>
+
<para>
First, we want to make sure we preserve the behavior of the release mode.
You can just type <code>"make check-profile"</code>, which
@@ -436,13 +426,12 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
Each diagnostic must come with at least two tests, one for false positives
and one for false negatives.
</para>
-</sect2>
+</section>
+
+</section>
-</sect1>
+<section xml:id="manual.ext.profile_mode.api" xreflabel="API"><info><title>Extensions for Custom Containers</title></info>
-<sect1 id="manual.ext.profile_mode.api"
- xreflabel="API">
-<title>Extensions for Custom Containers</title>
<para>
Many large projects use their own data structures instead of the ones in the
@@ -453,12 +442,11 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
<code>profiler.h</code> (look for "Instrumentation hooks").
</para>
-</sect1>
+</section>
+
+<section xml:id="manual.ext.profile_mode.cost_model" xreflabel="Cost Model"><info><title>Empirical Cost Model</title></info>
-<sect1 id="manual.ext.profile_mode.cost_model"
- xreflabel="Cost Model">
-<title>Empirical Cost Model</title>
<para>
Currently, the cost model uses formulas with predefined relative weights
@@ -479,17 +467,15 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
generic parameters.
</para>
-</sect1>
+</section>
-<sect1 id="manual.ext.profile_mode.implementation"
- xreflabel="Implementation">
-<title>Implementation Issues</title>
+<section xml:id="manual.ext.profile_mode.implementation" xreflabel="Implementation"><info><title>Implementation Issues</title></info>
-<sect2 id="manual.ext.profile_mode.implementation.stack"
- xreflabel="Stack Traces">
-<title>Stack Traces</title>
+
+<section xml:id="manual.ext.profile_mode.implementation.stack" xreflabel="Stack Traces"><info><title>Stack Traces</title></info>
+
<para>
Accurate stack traces are needed during profiling since we group events by
call context and dynamic instance. Without accurate traces, diagnostics
@@ -503,12 +489,11 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
to 0 if you are willing to give up call context information, or to a small
positive value to reduce run time overhead.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.implementation.symbols" xreflabel="Symbolization"><info><title>Symbolization of Instruction Addresses</title></info>
-<sect2 id="manual.ext.profile_mode.implementation.symbols"
- xreflabel="Symbolization">
-<title>Symbolization of Instruction Addresses</title>
<para>
The profiling and analysis phases use only instruction addresses.
An external utility such as addr2line is needed to postprocess the result.
@@ -516,12 +501,11 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
This would require access to symbol tables, debug information tables,
external programs or libraries and other system dependent information.
</para>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.implementation.concurrency"
- xreflabel="Concurrency">
-<title>Concurrency</title>
+<section xml:id="manual.ext.profile_mode.implementation.concurrency" xreflabel="Concurrency"><info><title>Concurrency</title></info>
+
<para>
Our current model is simplistic, but precise.
We cannot afford to approximate because some of our diagnostics require
@@ -529,24 +513,22 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
During profiling, we keep a single information table per diagnostic.
There is a single lock per information table.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.implementation.stdlib-in-proflib" xreflabel="Using the Standard Library in the Runtime Library"><info><title>Using the Standard Library in the Instrumentation Implementation</title></info>
-<sect2 id="manual.ext.profile_mode.implementation.stdlib-in-proflib"
- xreflabel="Using the Standard Library in the Runtime Library">
-<title>Using the Standard Library in the Instrumentation Implementation</title>
<para>
As much as we would like to avoid uses of libstdc++ within our
instrumentation library, containers such as unordered_map are very
appealing. We plan to use them as long as they are named properly
to avoid ambiguity.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.implementation.malloc-hooks" xreflabel="Malloc Hooks"><info><title>Malloc Hooks</title></info>
-<sect2 id="manual.ext.profile_mode.implementation.malloc-hooks"
- xreflabel="Malloc Hooks">
-<title>Malloc Hooks</title>
<para>
User applications/libraries can provide malloc hooks.
When the implementation of the malloc hooks uses stdlibc++, there can
@@ -563,12 +545,11 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
XXX: A definitive solution to this problem would be for the profile extension
to use a custom allocator internally, and perhaps not to use libstdc++.
</para>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.implementation.construction-destruction"
- xreflabel="Construction and Destruction of Global Objects">
-<title>Construction and Destruction of Global Objects</title>
+<section xml:id="manual.ext.profile_mode.implementation.construction-destruction" xreflabel="Construction and Destruction of Global Objects"><info><title>Construction and Destruction of Global Objects</title></info>
+
<para>
The profiling library state is initialized at the first call to a profiling
method. This allows us to record the construction of all global objects.
@@ -576,18 +557,16 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
by a function registered by <code>atexit</code>, thus invoked by
<code>exit</code>.
</para>
-</sect2>
+</section>
+
+</section>
+
-</sect1>
+<section xml:id="manual.ext.profile_mode.developer" xreflabel="Developer Information"><info><title>Developer Information</title></info>
-<sect1 id="manual.ext.profile_mode.developer"
- xreflabel="Developer Information">
-<title>Developer Information</title>
+<section xml:id="manual.ext.profile_mode.developer.bigpic" xreflabel="Big Picture"><info><title>Big Picture</title></info>
-<sect2 id="manual.ext.profile_mode.developer.bigpic"
- xreflabel="Big Picture">
-<title>Big Picture</title>
<para>The profile mode headers are included with
<code>-D_GLIBCXX_PROFILE</code> through preprocessor directives in
@@ -609,11 +588,10 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
<code>-D_GLIBCXX_PROFILE_...</code> compiler option.
</para>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.developer.howto" xreflabel="How To Add A Diagnostic"><info><title>How To Add A Diagnostic</title></info>
-<sect2 id="manual.ext.profile_mode.developer.howto"
- xreflabel="How To Add A Diagnostic">
-<title>How To Add A Diagnostic</title>
<para>Let's say the diagnostic name is "magic".
</para>
@@ -684,11 +662,11 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
<para>Add documentation in file <code>doc/xml/manual/profile_mode.xml</code>.
</para>
-</sect2>
-</sect1>
+</section>
+</section>
+
+<section xml:id="manual.ext.profile_mode.diagnostics"><info><title>Diagnostics</title></info>
-<sect1 id="manual.ext.profile_mode.diagnostics">
-<title>Diagnostics</title>
<para>
The table below presents all the diagnostics we intend to implement.
@@ -712,16 +690,17 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
specific needs or time budgets.
</para>
-<table frame='all'>
+<table frame="all">
<title>Profile Diagnostics</title>
-<tgroup cols='7' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
-<colspec colname='c6'></colspec>
-<colspec colname='c7'></colspec>
+
+<tgroup cols="7" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
+<colspec colname="c6"/>
+<colspec colname="c7"/>
<thead>
<row>
@@ -735,145 +714,145 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
</thead>
<tbody>
<row>
- <entry><ulink url="#manual.ext.profile_mode.analysis.containers">
- CONTAINERS</ulink></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.hashtable_too_small">
- HASHTABLE_TOO_SMALL</ulink></entry>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.containers">
+ CONTAINERS</link></entry>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.hashtable_too_small">
+ HASHTABLE_TOO_SMALL</link></entry>
<entry>10</entry>
<entry>1</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>yes</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.hashtable_too_large">
- HASHTABLE_TOO_LARGE</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.hashtable_too_large">
+ HASHTABLE_TOO_LARGE</link></entry>
<entry>5</entry>
<entry>1</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>yes</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.inefficient_hash">
- INEFFICIENT_HASH</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.inefficient_hash">
+ INEFFICIENT_HASH</link></entry>
<entry>7</entry>
<entry>3</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>yes</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.vector_too_small">
- VECTOR_TOO_SMALL</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.vector_too_small">
+ VECTOR_TOO_SMALL</link></entry>
<entry>8</entry>
<entry>1</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>yes</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.vector_too_large">
- VECTOR_TOO_LARGE</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.vector_too_large">
+ VECTOR_TOO_LARGE</link></entry>
<entry>5</entry>
<entry>1</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>yes</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.vector_to_hashtable">
- VECTOR_TO_HASHTABLE</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.vector_to_hashtable">
+ VECTOR_TO_HASHTABLE</link></entry>
<entry>7</entry>
<entry>7</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>no</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.hashtable_to_vector">
- HASHTABLE_TO_VECTOR</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.hashtable_to_vector">
+ HASHTABLE_TO_VECTOR</link></entry>
<entry>7</entry>
<entry>7</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>no</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.vector_to_list">
- VECTOR_TO_LIST</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.vector_to_list">
+ VECTOR_TO_LIST</link></entry>
<entry>8</entry>
<entry>5</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>yes</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.list_to_vector">
- LIST_TO_VECTOR</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.list_to_vector">
+ LIST_TO_VECTOR</link></entry>
<entry>10</entry>
<entry>5</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>no</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.assoc_ord_to_unord">
- ORDERED_TO_UNORDERED</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.assoc_ord_to_unord">
+ ORDERED_TO_UNORDERED</link></entry>
<entry>10</entry>
<entry>5</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>only map/unordered_map</entry>
</row>
<row>
- <entry><ulink url="#manual.ext.profile_mode.analysis.algorithms">
- ALGORITHMS</ulink></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.algorithms.sort">
- SORT</ulink></entry>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.algorithms">
+ ALGORITHMS</link></entry>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.algorithms.sort">
+ SORT</link></entry>
<entry>7</entry>
<entry>8</entry>
- <entry></entry>
+ <entry/>
<entry>7</entry>
<entry>no</entry>
</row>
<row>
- <entry><ulink url="#manual.ext.profile_mode.analysis.locality">
- LOCALITY</ulink></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.locality.sw_prefetch">
- SOFTWARE_PREFETCH</ulink></entry>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.locality">
+ LOCALITY</link></entry>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.locality.sw_prefetch">
+ SOFTWARE_PREFETCH</link></entry>
<entry>8</entry>
<entry>8</entry>
- <entry></entry>
+ <entry/>
<entry>5</entry>
<entry>no</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.locality.linked">
- RBTREE_LOCALITY</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.locality.linked">
+ RBTREE_LOCALITY</link></entry>
<entry>4</entry>
<entry>8</entry>
- <entry></entry>
+ <entry/>
<entry>5</entry>
<entry>no</entry>
</row>
<row>
- <entry></entry>
- <entry><ulink url="#manual.ext.profile_mode.analysis.mthread.false_share">
- FALSE_SHARING</ulink></entry>
+ <entry/>
+ <entry><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#manual.ext.profile_mode.analysis.mthread.false_share">
+ FALSE_SHARING</link></entry>
<entry>8</entry>
<entry>10</entry>
- <entry></entry>
+ <entry/>
<entry>10</entry>
<entry>no</entry>
</row>
@@ -881,9 +860,8 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
</tgroup>
</table>
-<sect2 id="manual.ext.profile_mode.analysis.template"
- xreflabel="Template">
-<title>Diagnostic Template</title>
+<section xml:id="manual.ext.profile_mode.analysis.template" xreflabel="Template"><info><title>Diagnostic Template</title></info>
+
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
@@ -912,21 +890,19 @@ advice sample
</programlisting>
</para></listitem>
</itemizedlist>
-</sect2>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.containers" xreflabel="Containers"><info><title>Containers</title></info>
-<sect2 id="manual.ext.profile_mode.analysis.containers"
- xreflabel="Containers">
-<title>Containers</title>
<para>
<emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_CONTAINERS</code>.
</para>
-<sect3 id="manual.ext.profile_mode.analysis.hashtable_too_small"
- xreflabel="Hashtable Too Small">
-<title>Hashtable Too Small</title>
+<section xml:id="manual.ext.profile_mode.analysis.hashtable_too_small" xreflabel="Hashtable Too Small"><info><title>Hashtable Too Small</title></info>
+
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL</code>.
@@ -964,12 +940,11 @@ foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
-<sect3 id="manual.ext.profile_mode.analysis.hashtable_too_large"
- xreflabel="Hashtable Too Large">
-<title>Hashtable Too Large</title>
+<section xml:id="manual.ext.profile_mode.analysis.hashtable_too_large" xreflabel="Hashtable Too Large"><info><title>Hashtable Too Large</title></info>
+
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE</code>.
@@ -1010,11 +985,10 @@ bytes of memory and M iteration steps.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.inefficient_hash" xreflabel="Inefficient Hash"><info><title>Inefficient Hash</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.inefficient_hash"
- xreflabel="Inefficient Hash">
-<title>Inefficient Hash</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_INEFFICIENT_HASH</code>.
@@ -1057,11 +1031,10 @@ class dumb_hash {
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.vector_too_small" xreflabel="Vector Too Small"><info><title>Vector Too Small</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.vector_too_small"
- xreflabel="Vector Too Small">
-<title>Vector Too Small</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_VECTOR_TOO_SMALL</code>.
@@ -1098,11 +1071,10 @@ copying 4000000 bytes and 20 memory allocations and deallocations.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.vector_too_large" xreflabel="Vector Too Large"><info><title>Vector Too Large</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.vector_too_large"
- xreflabel="Vector Too Large">
-<title>Vector Too Large</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_VECTOR_TOO_LARGE</code>
@@ -1140,11 +1112,10 @@ bytes of memory and may reduce the number of cache and TLB misses.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.vector_to_hashtable" xreflabel="Vector to Hashtable"><info><title>Vector to Hashtable</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.vector_to_hashtable"
- xreflabel="Vector to Hashtable">
-<title>Vector to Hashtable</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_VECTOR_TO_HASHTABLE</code>.
@@ -1187,11 +1158,10 @@ comparisons.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.hashtable_to_vector" xreflabel="Hashtable to Vector"><info><title>Hashtable to Vector</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.hashtable_to_vector"
- xreflabel="Hashtable to Vector">
-<title>Hashtable to Vector</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_HASHTABLE_TO_VECTOR</code>.
@@ -1232,11 +1202,10 @@ indirections and may achieve better data locality.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.vector_to_list" xreflabel="Vector to List"><info><title>Vector to List</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.vector_to_list"
- xreflabel="Vector to List">
-<title>Vector to List</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_VECTOR_TO_LIST</code>.
@@ -1278,11 +1247,10 @@ operations.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.list_to_vector" xreflabel="List to Vector"><info><title>List to Vector</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.list_to_vector"
- xreflabel="List to Vector">
-<title>List to Vector</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_LIST_TO_VECTOR</code>.
@@ -1321,11 +1289,10 @@ memory references.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.list_to_slist" xreflabel="List to Forward List"><info><title>List to Forward List (Slist)</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.list_to_slist"
- xreflabel="List to Forward List">
-<title>List to Forward List (Slist)</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_LIST_TO_SLIST</code>.
@@ -1367,11 +1334,10 @@ foo.cc:1: advice: Change "list" to "forward_list".
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.assoc_ord_to_unord" xreflabel="Ordered to Unordered Associative Container"><info><title>Ordered to Unordered Associative Container</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.assoc_ord_to_unord"
- xreflabel="Ordered to Unordered Associative Container">
-<title>Ordered to Unordered Associative Container</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_ORDERED_TO_UNORDERED</code>.
@@ -1410,23 +1376,21 @@ foo.cc:1: advice: Change "list" to "forward_list".
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+</section>
-</sect2>
+<section xml:id="manual.ext.profile_mode.analysis.algorithms" xreflabel="Algorithms"><info><title>Algorithms</title></info>
-<sect2 id="manual.ext.profile_mode.analysis.algorithms"
- xreflabel="Algorithms">
-<title>Algorithms</title>
<para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_ALGORITHMS</code>.
</para>
-<sect3 id="manual.ext.profile_mode.analysis.algorithms.sort"
- xreflabel="Sorting">
-<title>Sort Algorithm Performance</title>
+<section xml:id="manual.ext.profile_mode.analysis.algorithms.sort" xreflabel="Sorting"><info><title>Sort Algorithm Performance</title></info>
+
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_SORT</code>.
@@ -1437,10 +1401,10 @@ foo.cc:1: advice: Change "list" to "forward_list".
</para></listitem>
<listitem><para><emphasis>Fundamentals:</emphasis>
See papers:
- <ulink url="http://portal.acm.org/citation.cfm?doid=1065944.1065981">
- A framework for adaptive algorithm selection in STAPL</ulink> and
- <ulink url="http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=4228227">
- Optimizing Sorting with Machine Learning Algorithms</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://portal.acm.org/citation.cfm?doid=1065944.1065981">
+ A framework for adaptive algorithm selection in STAPL</link> and
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=4228227">
+ Optimizing Sorting with Machine Learning Algorithms</link>.
</para></listitem>
<listitem><para><emphasis>Sample runtime reduction:</emphasis>60%.
</para></listitem>
@@ -1459,22 +1423,20 @@ foo.cc:1: advice: Change "list" to "forward_list".
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.analysis.locality"
- xreflabel="Data Locality">
-<title>Data Locality</title>
+<section xml:id="manual.ext.profile_mode.analysis.locality" xreflabel="Data Locality"><info><title>Data Locality</title></info>
+
<para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_LOCALITY</code>.
</para>
-<sect3 id="manual.ext.profile_mode.analysis.locality.sw_prefetch"
- xreflabel="Need Software Prefetch">
-<title>Need Software Prefetch</title>
+<section xml:id="manual.ext.profile_mode.analysis.locality.sw_prefetch" xreflabel="Need Software Prefetch"><info><title>Need Software Prefetch</title></info>
+
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_SOFTWARE_PREFETCH</code>.
@@ -1532,11 +1494,10 @@ foo.cc:7: advice: Insert prefetch instruction.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.locality.linked" xreflabel="Linked Structure Locality"><info><title>Linked Structure Locality</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.locality.linked"
- xreflabel="Linked Structure Locality">
-<title>Linked Structure Locality</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_RBTREE_LOCALITY</code>.
@@ -1548,8 +1509,8 @@ foo.cc:7: advice: Insert prefetch instruction.
<listitem><para><emphasis>Fundamentals:</emphasis>Allocation can be tuned
to a specific traversal pattern, to result in better data locality.
See paper:
- <ulink url="http://www.springerlink.com/content/8085744l00x72662/">
- Custom Memory Allocation for Free</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.springerlink.com/content/8085744l00x72662/">
+ Custom Memory Allocation for Free</link>.
</para></listitem>
<listitem><para><emphasis>Sample runtime reduction:</emphasis>30%.
</para></listitem>
@@ -1593,14 +1554,13 @@ the allocation sequence or switching to a structure conscious allocator.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.analysis.mthread"
- xreflabel="Multithreaded Data Access">
-<title>Multithreaded Data Access</title>
+<section xml:id="manual.ext.profile_mode.analysis.mthread" xreflabel="Multithreaded Data Access"><info><title>Multithreaded Data Access</title></info>
+
<para>
The diagnostics in this group are not meant to be implemented short term.
@@ -1612,9 +1572,8 @@ the allocation sequence or switching to a structure conscious allocator.
<code>_GLIBCXX_PROFILE_MULTITHREADED</code>.
</para>
-<sect3 id="manual.ext.profile_mode.analysis.mthread.ddtest"
- xreflabel="Dependence Violations at Container Level">
-<title>Data Dependence Violations at Container Level</title>
+<section xml:id="manual.ext.profile_mode.analysis.mthread.ddtest" xreflabel="Dependence Violations at Container Level"><info><title>Data Dependence Violations at Container Level</title></info>
+
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_DDTEST</code>.
@@ -1638,9 +1597,9 @@ the allocation sequence or switching to a structure conscious allocator.
Keep a shadow for each container. Record iterator dereferences and
container member accesses. Issue advice for elements referenced by
multiple threads.
- See paper: <ulink url="http://portal.acm.org/citation.cfm?id=207110.207148">
+ See paper: <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://portal.acm.org/citation.cfm?id=207110.207148">
The LRPD test: speculative run-time parallelization of loops with
- privatization and reduction parallelization</ulink>.
+ privatization and reduction parallelization</link>.
</para></listitem>
<listitem><para><emphasis>Cost model:</emphasis>
Number of accesses to elements referenced from multiple threads
@@ -1650,11 +1609,10 @@ the allocation sequence or switching to a structure conscious allocator.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
+
+<section xml:id="manual.ext.profile_mode.analysis.mthread.false_share" xreflabel="False Sharing"><info><title>False Sharing</title></info>
-<sect3 id="manual.ext.profile_mode.analysis.mthread.false_share"
- xreflabel="False Sharing">
-<title>False Sharing</title>
<itemizedlist>
<listitem><para><emphasis>Switch:</emphasis>
<code>_GLIBCXX_PROFILE_FALSE_SHARING</code>.
@@ -1699,14 +1657,13 @@ sharing in multithreaded access at foo.cc:4. Detected N shared cache lines.
</programlisting>
</para></listitem>
</itemizedlist>
-</sect3>
+</section>
-</sect2>
+</section>
-<sect2 id="manual.ext.profile_mode.analysis.statistics"
- xreflabel="Statistics">
-<title>Statistics</title>
+<section xml:id="manual.ext.profile_mode.analysis.statistics" xreflabel="Statistics"><info><title>Statistics</title></info>
+
<para>
<emphasis>Switch:</emphasis>
@@ -1726,32 +1683,26 @@ sharing in multithreaded access at foo.cc:4. Detected N shared cache lines.
of each operation actually performed on the container.
</para>
-</sect2>
+</section>
+
+</section>
-</sect1>
+<bibliography xml:id="profile_mode.biblio"><info><title>Bibliography</title></info>
-<bibliography id="profile_mode.biblio">
-<title>Bibliography</title>
<biblioentry>
- <title>
+ <citetitle>
Perflint: A Context Sensitive Performance Advisor for C++ Programs
- </title>
+ </citetitle>
- <author>
- <firstname>Lixia</firstname>
- <surname>Liu</surname>
- </author>
- <author>
- <firstname>Silvius</firstname>
- <surname>Rus</surname>
- </author>
+ <author><personname><firstname>Lixia</firstname><surname>Liu</surname></personname></author>
+ <author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname></author>
<copyright>
<year>2009</year>
- <holder></holder>
+ <holder/>
</copyright>
<publisher>
diff --git a/libstdc++-v3/doc/xml/manual/shared_ptr.xml b/libstdc++-v3/doc/xml/manual/shared_ptr.xml
index 70e000dcc5b..4ef5f72b6a6 100644
--- a/libstdc++-v3/doc/xml/manual/shared_ptr.xml
+++ b/libstdc++-v3/doc/xml/manual/shared_ptr.xml
@@ -1,7 +1,8 @@
-<section id="std.util.memory.shared_ptr" xreflabel="shared_ptr">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.util.memory.shared_ptr" xreflabel="shared_ptr">
<?dbhtml filename="shared_ptr.html"?>
-<sectioninfo>
+<info><title>shared_ptr</title>
<keywordset>
<keyword>
ISO C++
@@ -10,17 +11,17 @@
shared_ptr
</keyword>
</keywordset>
-</sectioninfo>
+</info>
+
-<title>shared_ptr</title>
<para>
The shared_ptr class template stores a pointer, usually obtained via new,
and implements shared ownership semantics.
</para>
-<section id="shared_ptr.req">
-<title>Requirements</title>
+<section xml:id="shared_ptr.req"><info><title>Requirements</title></info>
+
<para>
</para>
@@ -43,8 +44,8 @@ and implements shared ownership semantics.
</para>
</section>
-<section id="shared_ptr.design_issues">
-<title>Design Issues</title>
+<section xml:id="shared_ptr.design_issues"><info><title>Design Issues</title></info>
+
<para>
@@ -67,11 +68,11 @@ technique known as type erasure.
</section>
-<section id="shared_ptr.impl">
-<title>Implementation</title>
+<section xml:id="shared_ptr.impl"><info><title>Implementation</title></info>
- <section>
- <title>Class Hierarchy</title>
+
+ <section><info><title>Class Hierarchy</title></info>
+
<para>
A <classname>shared_ptr&lt;T&gt;</classname> contains a pointer of
@@ -88,7 +89,7 @@ resource.
<term><classname>_Sp_counted_base&lt;Lp&gt;</classname></term>
<listitem>
<para>
-The base of the hierarchy is parameterized on the lock policy alone.
+The base of the hierarchy is parameterized on the lock policy (see below.)
_Sp_counted_base doesn't depend on the type of pointer being managed,
it only maintains the reference counts and calls virtual functions when
the counts drop to zero. The managed object is destroyed when the last
@@ -158,18 +159,8 @@ that simplifies the implementation slightly.
</section>
- <section>
- <title>Thread Safety</title>
-
- <para>
-The interface of <classname>tr1::shared_ptr</classname> was extended for C++0x
-with support for rvalue-references and the other features from
-N2351. As with other libstdc++ headers shared by TR1 and C++0x,
-boost_shared_ptr.h uses conditional compilation, based on the macros
-<constant>_GLIBCXX_INCLUDE_AS_CXX0X</constant> and
-<constant>_GLIBCXX_INCLUDE_AS_TR1</constant>, to enable and disable
-features.
- </para>
+ <section><info><title>Thread Safety</title></info>
+
<para>
C++0x-only features are: rvalue-ref/move support, allocator support,
@@ -180,8 +171,8 @@ deprecated in C++0x mode.
<para>
The
-<ulink url="http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety">Thread
-Safety</ulink> section of the Boost shared_ptr documentation says "shared_ptr
+<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety">Thread
+Safety</link> section of the Boost shared_ptr documentation says "shared_ptr
objects offer the same level of thread safety as built-in types."
The implementation must ensure that concurrent updates to separate shared_ptr
instances are correct even when those instances share a reference count e.g.
@@ -234,8 +225,8 @@ Policy below for details.
</section>
- <section>
- <title>Selecting Lock Policy</title>
+ <section><info><title>Selecting Lock Policy</title></info>
+
<para>
</para>
@@ -264,8 +255,8 @@ available policies are:
</para>
<para>
Selected when GCC supports a builtin atomic compare-and-swap operation
-on the target processor (see <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html">Atomic
-Builtins</ulink>.) The reference counts are maintained using a lock-free
+on the target processor (see <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html">Atomic
+Builtins</link>.) The reference counts are maintained using a lock-free
algorithm and GCC's atomic builtins, which provide the required memory
synchronisation.
</para>
@@ -302,27 +293,35 @@ used when libstdc++ is built without <literal>--enable-threads</literal>.
</para>
</section>
- <section>
- <title>Dual C++0x and TR1 Implementation</title>
+ <section><info><title>Dual C++0x and TR1 Implementation</title></info>
+
+
+<para>
+The interface of <classname>tr1::shared_ptr</classname> was extended for C++0x
+with support for rvalue-references and the other features from N2351.
+The <classname>_Sp_counted_base</classname> base class is implemented in
+<filename>tr1/boost_sp_shared_count.h</filename> and is common to the TR1
+and C++0x versions of <classname>shared_ptr</classname>.
+</para>
<para>
The classes derived from <classname>_Sp_counted_base</classname> (see Class Hierarchy
-below) and <classname>__shared_count</classname> are implemented separately for C++0x
-and TR1, in <filename>bits/boost_sp_shared_count.h</filename> and
-<filename>tr1/boost_sp_shared_count.h</filename> respectively. All other classes
-including <classname>_Sp_counted_base</classname> are shared by both implementations.
+above) and <classname>__shared_count</classname> are implemented separately for C++0x
+and TR1, in <filename>bits/shared_ptr.h</filename> and
+<filename>tr1/shared_ptr.h</filename> respectively.
</para>
<para>
The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
C++0x and TR1 modes needs to diverge further then it might be necessary to
-duplicate additional classes and only make changes to the C++0x versions.
+duplicate <classname>_Sp_counted_base</classname> and only make changes to
+the C++0x version.
</para>
</section>
-<section>
-<title>Related functions and classes</title>
+<section><info><title>Related functions and classes</title></info>
+
<variablelist>
@@ -414,25 +413,25 @@ the following types, depending on how the shared_ptr is constructed.
</listitem>
-->
-<section id="shared_ptr.using">
-<title>Use</title>
+<section xml:id="shared_ptr.using"><info><title>Use</title></info>
+
- <section>
- <title>Examples</title>
+ <section><info><title>Examples</title></info>
+
<para>
Examples of use can be found in the testsuite, under
- <filename class="directory">testsuite/tr1/2_general_utilities/shared_ptr</filename>.
+ <filename class="directory">testsuite/tr1/2_general_utilities/shared_ptr</filename>,
+ <filename class="directory">testsuite/20_util/shared_ptr</filename>
+ and
+ <filename class="directory">testsuite/20_util/weak_ptr</filename>.
</para>
</section>
- <section>
- <title>Unresolved Issues</title>
+ <section><info><title>Unresolved Issues</title></info>
+
<para>
- The resolution to C++ Standard Library issue <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#674">674</ulink>,
- "shared_ptr interface changes for consistency with N1856" will
- need to be implemented after it is accepted into the working
- paper. Issue <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#743">743</ulink>
- might also require changes.
+ The <emphasis><classname>shared_ptr</classname> atomic access</emphasis>
+ clause in the C++0x working draft is not implemented in GCC.
</para>
<para>
@@ -476,17 +475,12 @@ the following types, depending on how the shared_ptr is constructed.
would alter the ABI.
</para>
- <para>
- Exposing the alias constructor in TR1 mode could simplify the
- *_pointer_cast functions. Constructor could be private in TR1
- mode, with the cast functions as friends.
- </para>
</section>
</section>
-<section id="shared_ptr.ack">
-<title>Acknowledgments</title>
+<section xml:id="shared_ptr.ack"><info><title>Acknowledgments</title></info>
+
<para>
The original authors of the Boost shared_ptr, which is really nice
@@ -497,56 +491,48 @@ the following types, depending on how the shared_ptr is constructed.
</section>
-<bibliography id="shared_ptr.biblio">
-<title>Bibliography</title>
+<bibliography xml:id="shared_ptr.biblio"><info><title>Bibliography</title></info>
+
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm">
- <citetitle>
- Improving shared_ptr for C++0x, Revision 2
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" class="uri">
</biblioid>
+ <citetitle>
+ Improving shared_ptr for C++0x, Revision 2
+ </citetitle>
<subtitle>
N2351
</subtitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html">
- <citetitle>
- C++ Standard Library Active Issues List
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html" class="uri">
</biblioid>
+ <citetitle>
+ C++ Standard Library Active Issues List
+ </citetitle>
<subtitle>
N2456
</subtitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf">
- <citetitle>
- Working Draft, Standard for Programming Language C++
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf" class="uri">
</biblioid>
+ <citetitle>
+ Working Draft, Standard for Programming Language C++
+ </citetitle>
<subtitle>
N2461
</subtitle>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr
- <citetitle>
- Boost C++ Libraries documentation, shared_ptr
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://boost.org/libs/smart_ptr/shared_ptr.htm" class="uri">shared_ptr
</biblioid>
+ <citetitle>
+ Boost C++ Libraries documentation, shared_ptr
+ </citetitle>
<subtitle>
N2461
</subtitle>
diff --git a/libstdc++-v3/doc/xml/manual/spine.xml b/libstdc++-v3/doc/xml/manual/spine.xml
index edb650c879c..2ff83bd8e57 100644
--- a/libstdc++-v3/doc/xml/manual/spine.xml
+++ b/libstdc++-v3/doc/xml/manual/spine.xml
@@ -1,19 +1,14 @@
-<?xml version='1.0'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<book id="manual-index">
+<book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="manual-index">
<?dbhtml dir="manual"?>
<?dbhtml filename="spine.html"?>
-<title>The GNU C++ Library</title>
-<bookinfo>
+
+<info>
<copyright>
<year>2009</year>
<year>2010</year>
<holder>
- <ulink url="http://www.fsf.org">FSF</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">FSF</link>
</holder>
</copyright>
<legalnotice>
@@ -21,117 +16,98 @@
<link linkend="manual.intro.status.license">License</link>
</para>
</legalnotice>
-</bookinfo>
+</info>
<!-- Part 01 : Intro -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="intro.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="intro.xml">
</xi:include>
<!-- Part 02 : Standard Contents -->
-<part id="manual.std" xreflabel="Standard Contents">
-<title>
+<part xml:id="manual.std" xreflabel="Standard Contents"><info><title>
Standard Contents
-</title>
+</title></info>
+
<!-- Chapter 01 : Support -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="support.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="support.xml">
</xi:include>
<!-- Chapter 02 : Diagnostics -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="diagnostics.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="diagnostics.xml">
</xi:include>
<!-- Chapter 03 : Utilities -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="utilities.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="utilities.xml">
</xi:include>
<!-- Chapter 04 : Strings -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="strings.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="strings.xml">
</xi:include>
<!-- Chapter 05 : Localization -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="localization.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="localization.xml">
</xi:include>
<!-- Chapter 06 : Containers -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="containers.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="containers.xml">
</xi:include>
<!-- Chapter 07 : Iterators -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="iterators.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="iterators.xml">
</xi:include>
<!-- Chapter 08 : Algorithms -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="algorithms.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="algorithms.xml">
</xi:include>
<!-- Chapter 09 : Numerics -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="numerics.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="numerics.xml">
</xi:include>
<!-- Chapter 10 : Input Output -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="io.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="io.xml">
</xi:include>
<!-- Chapter 11 : Atomics -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="atomics.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="atomics.xml">
</xi:include>
<!-- Chapter 12 : Concurrency -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="concurrency.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="concurrency.xml">
</xi:include>
</part>
<!-- Part 03 : Extensions -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="extensions.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="extensions.xml">
</xi:include>
<!-- Part 04 : Appendices -->
-<part id="appendix" xreflabel="Appendices">
-<title>
+<part xml:id="appendix" xreflabel="Appendices"><info><title>
Appendices
-</title>
+</title></info>
+
<!-- Appendix A -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="appendix_contributing.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="appendix_contributing.xml">
</xi:include>
<!-- Appendix B -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="appendix_porting.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="appendix_porting.xml">
</xi:include>
<!-- Appendix C -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="appendix_free.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="appendix_free.xml">
</xi:include>
<!-- Appendix D -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="../gnu/gpl-3.0.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="../gnu/gpl-3.0.xml">
</xi:include>
<!-- Appendix E -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="../gnu/fdl-1.3.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="../gnu/fdl-1.3.xml">
</xi:include>
</part>
diff --git a/libstdc++-v3/doc/xml/manual/status_cxx1998.xml b/libstdc++-v3/doc/xml/manual/status_cxx1998.xml
index c5e63fa977e..67f6f891df0 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx1998.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx1998.xml
@@ -1,7 +1,8 @@
-<sect2 id="status.iso.1998" xreflabel="ISO C++ 1998">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="status.iso.1998" xreflabel="ISO C++ 1998">
<?dbhtml filename="status_iso_cxx1998.html"?>
-<sect2info>
+<info><title>C++ 1998/2003</title>
<keywordset>
<keyword>
ISO C++
@@ -10,12 +11,11 @@
1998
</keyword>
</keywordset>
-</sect2info>
+</info>
-<title>C++ 1998/2003</title>
-<sect3 id="iso.1998.status" xreflabel="Implementation Status">
- <title>Implementation Status</title>
+<section xml:id="iso.1998.status" xreflabel="Implementation Status">
+<info><title>Implementation Status</title></info>
<para>
This status table is based on the table of contents of ISO/IEC 14882:2003.
@@ -35,13 +35,14 @@ particular release.
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
-->
-<table frame='all'>
-<title>C++ 1998/2003 Implementation Status</title>
-<tgroup cols='4' align='left' colsep='0' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+<table frame="all">
+ <title>C++ 1998/2003 Implementation Status</title>
+
+<tgroup cols="4" align="left" colsep="0" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
<entry>Section</entry>
@@ -65,25 +66,25 @@ particular release.
<entry>18.1</entry>
<entry>Types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.2</entry>
<entry>Implementation properties</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.2.1</entry>
<entry>Numeric Limits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.2.1.1</entry>
<entry>Class template <code>numeric_limits</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.2.1.2</entry>
@@ -104,85 +105,85 @@ particular release.
<entry>18.2.1.5</entry>
<entry><code>numeric_limits</code> specializations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.2.2</entry>
<entry>C Library</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.3</entry>
<entry>Start and termination</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.4</entry>
<entry>Dynamic memory management</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.5</entry>
<entry>Type identification</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.5.1</entry>
<entry>Class type_info</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.5.2</entry>
<entry>Class bad_cast</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.5.3</entry>
<entry>Class bad_typeid</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.6</entry>
<entry>Exception handling</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.6.1</entry>
<entry>Class exception</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.6.2</entry>
<entry>Violation exception-specifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.6.3</entry>
<entry>Abnormal termination</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.6.4</entry>
<entry><code>uncaught_exception</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.7</entry>
<entry>Other runtime support</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -196,19 +197,19 @@ particular release.
<entry>19.1</entry>
<entry>Exception classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.2</entry>
<entry>Assertions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.3</entry>
<entry>Error numbers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -222,139 +223,139 @@ particular release.
<entry>20.1</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.2</entry>
<entry>Utility components</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.2.1</entry>
<entry>Operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.2.2</entry>
<entry><code>pair</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3</entry>
<entry>Function objects</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.3.1</entry>
<entry>Base</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.2</entry>
<entry>Arithmetic operation</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.3</entry>
<entry>Comparisons</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.4</entry>
<entry>Logical operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.5</entry>
<entry>Negators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.6</entry>
<entry>Binders</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.7</entry>
<entry>Adaptors for pointers to functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.8</entry>
<entry>Adaptors for pointers to members</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4</entry>
<entry>Memory</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.4.1</entry>
<entry>The default allocator</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.2</entry>
<entry>Raw storage iterator</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.3</entry>
<entry>Temporary buffers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.4</entry>
<entry>Specialized algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.4.1</entry>
<entry><code>uninitialized_copy</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.4.2</entry>
<entry><code>uninitialized_fill</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.4.3</entry>
<entry><code>uninitialized_fill_n</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.5</entry>
<entry>Class template <code>auto_ptr</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4.6</entry>
<entry>C library</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -367,50 +368,50 @@ particular release.
<row>
<entry>21.1</entry>
<entry>Character traits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>21.1.1</entry>
<entry>Character traits requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.1.2</entry>
<entry>traits typedef</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.1.3</entry>
<entry><code>char_traits</code> specializations</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>21.1.3.1</entry>
<entry>struct <code>char_traits&lt;char&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.1.3.2</entry>
<entry>struct <code>char_traits&lt;wchar_t&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.2</entry>
<entry>String classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.3</entry>
<entry>Class template <code>basic_string</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.4</entry>
@@ -429,158 +430,158 @@ particular release.
<row>
<entry>22.1</entry>
<entry>Locales</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.1.1</entry>
<entry>Class <code>locale</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.1.2</entry>
<entry><code>locale</code> globals</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.1.3</entry>
<entry>Convenience interfaces</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.1.3.1</entry>
<entry>Character classification</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.1.3.2</entry>
<entry>Character conversions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2</entry>
<entry>Standard locale categories</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.2.1</entry>
<entry><code>ctype</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.2</entry>
<entry>Numeric</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.2.2.1</entry>
<entry><code>num_get</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.2.2</entry>
<entry><code>num_put</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.3</entry>
<entry><code>num_punct</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.4</entry>
<entry><code>collate</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.5</entry>
<entry>Time</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.2.5.1</entry>
<entry><code>time_get</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.5.2</entry>
<entry><code>time_get_byname</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.5.3</entry>
<entry><code>time_put</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.5.3</entry>
<entry><code>time_put_byname</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.6</entry>
<entry>Monetary</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.2.6.1</entry>
<entry><code>money_get</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.6.2</entry>
<entry><code>money_put</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.6.3</entry>
<entry><code>money_punct</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.6.4</entry>
<entry><code>money_punct_byname</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.7</entry>
<entry><code>messages</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2.8</entry>
<entry>Program-defined facets</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.3</entry>
<entry>C Library Locales</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -594,91 +595,91 @@ particular release.
<entry>23.1</entry>
<entry>Container requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2</entry>
<entry>Sequence containers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.2.1</entry>
<entry>Class template <code>deque</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.2</entry>
<entry>Class template <code>list</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.3</entry>
<entry>Adaptors</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.2.3.1</entry>
<entry>Class template <code>queue</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.3.2</entry>
<entry>Class template <code>priority_queue</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.3.3</entry>
<entry>Class template <code>stack</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.4</entry>
<entry>Class template <code>vector</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.5</entry>
<entry>Class <code>vector&lt;bool&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3</entry>
<entry>Associative containers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.3.1</entry>
<entry>Class template <code>map</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.2</entry>
<entry>Class template <code>multimap</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.3</entry>
<entry>Class template <code>set</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.4</entry>
<entry>Class template <code>multiset</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -692,67 +693,67 @@ particular release.
<entry>24.1</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.2</entry>
<entry>Header <code>&lt;iterator&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.3</entry>
<entry>Iterator primitives</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.4</entry>
<entry>Predefined iterators and Iterator adaptors</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>24.4.1</entry>
<entry>Reverse iterators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.4.2</entry>
<entry>Insert iterators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5</entry>
<entry>Stream iterators</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>24.5.1</entry>
<entry>Class template <code>istream_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5.2</entry>
<entry>Class template <code>ostream_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5.3</entry>
<entry>Class template <code>istreambuf_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5.4</entry>
<entry>Class template <code>ostreambuf_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -766,25 +767,25 @@ particular release.
<entry>25.1</entry>
<entry>Non-modifying sequence operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>25.2</entry>
<entry>Mutating sequence operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>25.3</entry>
<entry>Sorting and related operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>25.4</entry>
<entry>C library algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -798,115 +799,115 @@ particular release.
<entry>26.1</entry>
<entry>Numeric type requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.2</entry>
<entry>Complex numbers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3</entry>
<entry>Numeric arrays</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.3.1</entry>
<entry>Header <code>&lt;valarray&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.2</entry>
<entry>Class template <code>valarray</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.3</entry>
<entry><code>valarray</code> non-member operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.4</entry>
<entry>Class <code>slice</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.5</entry>
<entry>Class template <code>slice_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.6</entry>
<entry>Class <code>gslice</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.7</entry>
<entry>Class template <code>gslice_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.8</entry>
<entry>Class template <code>mask_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3.9</entry>
<entry>Class template <code>indirect_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.4</entry>
<entry>Generalized numeric operations</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.4.1</entry>
<entry><code>accumulate</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.4.2</entry>
<entry><code>inner_product</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.4.3</entry>
<entry><code>partial_sum</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.4.4</entry>
<entry><code>adjacent_difference</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.4.5</entry>
<entry>iota</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5</entry>
<entry>C Library</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -920,61 +921,61 @@ particular release.
<entry>27.1</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.2</entry>
<entry>Forward declarations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.3</entry>
<entry>Standard iostream objects</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.3.1</entry>
<entry>Narrow stream objects</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.3.2</entry>
<entry>Wide stream objects</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.4</entry>
<entry>Iostreams base classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.5</entry>
<entry>Stream buffers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.6</entry>
<entry>Formatting and manipulators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.7</entry>
<entry>String-based streams</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.8</entry>
<entry>File-based streams</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -987,53 +988,53 @@ particular release.
<row>
<entry>D.1</entry>
<entry>Increment operator with bool operand</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.2</entry>
<entry><code>static</code> keyword</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.3</entry>
<entry>Access declarations</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.4</entry>
<entry>Implicit conversion from const strings</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.5</entry>
<entry>C standard library headers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.6</entry>
<entry>Old iostreams members</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.7</entry>
<entry>char* streams</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
</tbody>
</tgroup>
</table>
-</sect3>
+</section>
-<sect3 id="iso.1998.specific" xreflabel="Implementation Specific">
- <title>Implementation Specific Behavior</title>
+<section xml:id="iso.1998.specific" xreflabel="Implementation Specific"><info><title>Implementation Specific Behavior</title></info>
+
<para>
The ISO standard defines the following phrase:
@@ -1056,8 +1057,8 @@ particular release.
</blockquote>
<para>
We do so here, for the C++ library only. Behavior of the
- compiler, linker, runtime loader, and other elements of &quot;the
- implementation&quot; are documented elsewhere. Everything listed
+ compiler, linker, runtime loader, and other elements of "the
+ implementation" are documented elsewhere. Everything listed
in Annex B, Implementation Qualities, are also part of the
compiler, not the library.
</para>
@@ -1104,13 +1105,13 @@ particular release.
<code>std::type_info::name()</code> is the mangled type name (see the
previous entry for more).
</para>
- <para><emphasis>[20.1.5]/5</emphasis> <emphasis>&quot;Implementors are encouraged to
+ <para><emphasis>[20.1.5]/5</emphasis> <emphasis>"Implementors are encouraged to
supply libraries that can accept allocators that encapsulate more
general memory models and that support non-equal instances. In such
implementations, any requirements imposed on allocators by containers
beyond those requirements that appear in Table 32, and the semantics
of containers and algorithms when allocator instances compare
- non-equal, are implementation-defined.&quot;</emphasis> As yet we don't
+ non-equal, are implementation-defined."</emphasis> As yet we don't
have any allocators which compare non-equal, so we can't describe how
they behave.
</para>
@@ -1158,6 +1159,6 @@ particular release.
a get area exists will... whatever <code>fflush()</code> does, I think.
</para>
-</sect3>
+</section>
-</sect2>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/status_cxx200x.xml b/libstdc++-v3/doc/xml/manual/status_cxx200x.xml
index 718e47bb098..4a74ea7aa46 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx200x.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx200x.xml
@@ -1,7 +1,8 @@
-<sect2 id="status.iso.200x" xreflabel="Status C++ 200x">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="status.iso.200x" xreflabel="Status C++ 200x">
<?dbhtml filename="status_iso_cxx200x.html"?>
-<sect2info>
+<info><title>C++ 200x</title>
<keywordset>
<keyword>
ISO C++
@@ -10,9 +11,7 @@
200x
</keyword>
</keywordset>
-</sect2info>
-
-<title>C++ 200x</title>
+</info>
<para>
This table is based on the table of contents of ISO/IEC
@@ -44,13 +43,14 @@ particular release.
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
-->
-<table frame='all'>
+<table frame="all">
<title>C++ 200x Implementation Status</title>
-<tgroup cols='4' align='left' colsep='0' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="0" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
<entry>Section</entry>
@@ -75,7 +75,7 @@ particular release.
<entry>18.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -87,21 +87,21 @@ particular release.
<row>
<entry>18.3</entry>
<entry>Implementation properties</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.3.1</entry>
<entry>Numeric Limits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.3.1.1</entry>
<entry>Class template <code>numeric_limits</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -115,40 +115,40 @@ particular release.
<entry>18.3.1.3</entry>
<entry><code>float_round_style</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>18.3.1.4</entry>
<entry><code>float_denorm_style</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.3.1.5</entry>
<entry><code>numeric_limits</code> specializations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.3.2</entry>
<entry>C Library</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.4</entry>
<entry>Integer types</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.4.1</entry>
<entry>Header <code>&lt;cstdint&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -161,104 +161,104 @@ particular release.
<entry>18.6</entry>
<entry>Dynamic memory management</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.7</entry>
<entry>Type identification</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.7.1</entry>
<entry>Class type_info</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.7.2</entry>
<entry>Class bad_cast</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.7.3</entry>
<entry>Class bad_typeid</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.8</entry>
<entry>Exception handling</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.8.1</entry>
<entry>Class exception</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.8.2</entry>
<entry>Violating exception-specifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.8.3</entry>
<entry>Abnormal termination</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.8.4</entry>
<entry><code>uncaught_exception</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.8.5</entry>
<entry>Exception Propagation</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.8.6</entry>
<entry><code>nested_exception</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.9</entry>
<entry>Initializer lists</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>18.9.1</entry>
<entry>Initializer list constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.9.2</entry>
<entry>Initializer list access</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>18.9.3</entry>
<entry>Initializer list range access</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>18.10</entry>
<entry>Other runtime support</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -272,61 +272,61 @@ particular release.
<entry>19.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.2</entry>
<entry>Exception classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.3</entry>
<entry>Assertions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.4</entry>
<entry>Error numbers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.5</entry>
<entry>System error support</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>19.5.1</entry>
<entry>Class <code>error_category</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.5.2</entry>
<entry>Class <code>error_code</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.5.3</entry>
<entry>Class <code>error_condition</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.5.4</entry>
<entry>Comparison operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>19.5.5</entry>
<entry>Class <code>system_error</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -339,56 +339,56 @@ particular release.
<row>
<entry>20.1</entry>
<entry>General</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.2</entry>
<entry>Requirements</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.3</entry>
<entry>Utility components</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.3.1</entry>
<entry>Operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.2</entry>
<entry>Swap</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.3</entry>
<entry><code>forward</code> and <code>move</code> helpers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.4</entry>
<entry>Function template <code>declval</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.3.5</entry>
<entry>Pairs</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.3.5.1</entry>
<entry>In general</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -401,33 +401,33 @@ particular release.
<entry>20.3.5.3</entry>
<entry>Tuple-like access to <code>pair</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.3.5.4</entry>
<entry><code>pair</code> range access</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.3.5.5</entry>
<entry>Piecewise construction</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.4</entry>
<entry>Tuples</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.4.1</entry>
<entry>In general</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -445,74 +445,74 @@ particular release.
<row>
<entry>20.6</entry>
<entry>Compile-time rational arithmetic</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.6.1</entry>
<entry>Class template <code>ratio</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.6.2</entry>
<entry>Arithmetic on <code>ratio</code> types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.6.3</entry>
<entry>Comparison of <code>ratio</code> types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.6.4</entry>
<entry>SI types for <code>ratio</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7</entry>
<entry>Metaprogramming and type traits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.7.1</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.2</entry>
<entry>Header <code>&lt;type_traits&gt;</code> synopsis</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.7.3</entry>
<entry>Helper classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.4</entry>
<entry>Unary Type Traits</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.4.1</entry>
<entry>Primary type categories</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.4.2</entry>
<entry>Composite type traits</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -525,7 +525,7 @@ particular release.
<entry>20.7.5</entry>
<entry>Relationships between types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -538,274 +538,274 @@ particular release.
<entry>20.7.6.1</entry>
<entry>Const-volatile modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.6.2</entry>
<entry>Reference modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.6.3</entry>
<entry>Sign modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.6.4</entry>
<entry>Array modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.6.5</entry>
<entry>Pointer modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.7.6.6</entry>
<entry>Other transformations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8</entry>
<entry>Function objects</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.8.1</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.2</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.3</entry>
<entry>Base</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.4</entry>
<entry>Class template <code>reference_wrapper</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.5</entry>
<entry>Arithmetic operation</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.6</entry>
<entry>Comparisons</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.7</entry>
<entry>Logical operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.8</entry>
<entry>Bitwise operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.9</entry>
<entry>Negators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.10</entry>
<entry>Function template <code>bind</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.11</entry>
<entry>Adaptors for pointers to functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.12</entry>
<entry>Adaptors for pointers to members</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.13</entry>
<entry>Function template <code>mem_fn</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.14</entry>
<entry>Polymorphic function wrappers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.8.14.1</entry>
<entry>Class <code>bad_function_call</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.14.2</entry>
<entry>Class template <code>function</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.8.15</entry>
<entry>Class template <code>hash</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9</entry>
<entry>Memory</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.1</entry>
<entry>Allocator argument tag</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.2</entry>
<entry><code>uses_allocator</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.3</entry>
<entry>Pointer traits</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.4</entry>
<entry>Allocator traits</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.5</entry>
<entry>The default allocator</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.6</entry>
<entry>Scoped allocator adaptor</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.6.1</entry>
<entry>Scoped allocator adaptor member types</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.6.2</entry>
<entry>Scoped allocator adaptor constructors</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.6.3</entry>
<entry>Scoped allocator adaptor members</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.7</entry>
<entry>Raw storage iterator</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.8</entry>
<entry>Temporary buffers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.9</entry>
<entry>Specialized algorithms</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.9.1</entry>
<entry><code>addressof</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.9.2</entry>
<entry><code>uninitialized_copy</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.9.3</entry>
<entry><code>uninitialized_fill</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.9.4</entry>
<entry><code>uninitialized_fill_n</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.10</entry>
<entry>Class template <code>unique_ptr</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.11</entry>
<entry>Smart pointers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.9.11.1</entry>
<entry>Class <code>bad_weak_ptr</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.11.2</entry>
@@ -814,7 +814,7 @@ particular release.
<entry>
<para>
Uses code from
- <ulink url="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</link>.
</para>
</entry>
</row>
@@ -822,70 +822,70 @@ particular release.
<entry>20.9.11.3</entry>
<entry>Class template <code>weak_ptr</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.11.4</entry>
<entry>Class template <code>emable_shared_from_this</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>20.9.11.5</entry>
<entry><code>shared_ptr</code> atomic access</entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.11.6</entry>
<entry>Hash support</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>20.9.12</entry>
<entry>Pointer safety</entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.9.13</entry>
<entry>Align</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.9.16</entry>
<entry>C library</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.10</entry>
<entry>Time utilities</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.10.1</entry>
<entry>Clock requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.10.2</entry>
<entry>Time-related traits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.10.2.1</entry>
<entry><code>treat_as_floating_point</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.10.2.2</entry>
@@ -897,7 +897,7 @@ particular release.
<entry>20.10.2.3</entry>
<entry>Specializations of <code>common_type</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.10.3</entry>
@@ -914,39 +914,39 @@ particular release.
<row>
<entry>20.10.5</entry>
<entry>Clocks</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>20.10.5.1</entry>
<entry>Class <code>system_clock</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.10.5.2</entry>
<entry>Class <code>monotonic_clock</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.10.5.3</entry>
<entry>Class <code>high_resolution_clock</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>20.11</entry>
<entry>Date and time functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>20.12</entry>
<entry>Class <code>type_index</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -960,31 +960,31 @@ particular release.
<entry>21.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.2</entry>
<entry>Character traits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>21.2.1</entry>
<entry>Character traits requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.2.2</entry>
<entry>traits typedefs</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.2.3</entry>
<entry><code>char_traits</code> specializations</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>21.2.3.1</entry>
@@ -1014,25 +1014,25 @@ particular release.
<entry>21.3</entry>
<entry>String classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.4</entry>
<entry>Class template <code>basic_string</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.5</entry>
<entry>Numeric Conversions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.6</entry>
<entry>Hash support</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>21.7</entry>
@@ -1052,196 +1052,196 @@ particular release.
<entry>22.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.2</entry>
<entry>Header <code>&lt;locale&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.3</entry>
<entry>Locales</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.3.1</entry>
<entry>Class <code>locale</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.3.2</entry>
<entry><code>locale</code> globals</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.3.3</entry>
<entry>Convenience interfaces</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.3.3.1</entry>
<entry>Character classification</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.3.3.2</entry>
<entry>Conversions</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.3.3.2.1</entry>
<entry>Character conversions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>22.3.3.2.2</entry>
<entry><code>string</code> conversions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>22.3.3.2.3</entry>
<entry>Buffer conversions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4</entry>
<entry>Standard <code>locale</code> categories</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.4.1</entry>
<entry>The <code>ctype</code> category</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.2</entry>
<entry>The numeric category</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.4.2.1</entry>
<entry><code>num_get</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.2.2</entry>
<entry><code>num_put</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.3</entry>
<entry>The numeric punctuation facet</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.4</entry>
<entry>The collate category</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.5</entry>
<entry>The time category</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.4.5.1</entry>
<entry>Class template <code>time_get</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.5.2</entry>
<entry>Class template <code>time_get_byname</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.5.3</entry>
<entry>Class template <code>time_put</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.5.3</entry>
<entry>Class template <code>time_put_byname</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.6</entry>
<entry>The monetary category</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>22.4.6.1</entry>
<entry>Class template <code>money_get</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.6.2</entry>
<entry>Class template <code>money_put</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.6.3</entry>
<entry>Class template <code>money_punct</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.6.4</entry>
<entry>Class template <code>money_punct_byname</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.7</entry>
<entry>The message retrieval category</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.4.8</entry>
<entry>Program-defined facets</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>22.5</entry>
<entry>Standard code conversion facets</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>22.6</entry>
<entry>C Library Locales</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -1254,50 +1254,50 @@ particular release.
<row>
<entry>23.1</entry>
<entry>General</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.2</entry>
<entry>Container requirements</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.2.1</entry>
<entry>General container requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.2</entry>
<entry>Data races</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.3</entry>
<entry>Sequence containers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.4</entry>
<entry>Associative containers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.2.5</entry>
<entry>Unordered associative containers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3</entry>
<entry>Sequence containers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.3.1</entry>
@@ -1309,115 +1309,115 @@ particular release.
<entry>23.3.2</entry>
<entry>Class template <code>deque</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.3</entry>
<entry>Class template <code>forward_list</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.4</entry>
<entry>Class template <code>list</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.5</entry>
<entry>Container adaptors</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.3.5.1</entry>
<entry>Class template <code>queue</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.5.2</entry>
<entry>Class template <code>priority_queue</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.5.3</entry>
<entry>Class template <code>stack</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.6</entry>
<entry>Class template <code>vector</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.3.7</entry>
<entry>Class <code>vector&lt;bool&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.4</entry>
<entry>Associative containers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.4.1</entry>
<entry>Class template <code>map</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.4.2</entry>
<entry>Class template <code>multimap</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.4.3</entry>
<entry>Class template <code>set</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.4.4</entry>
<entry>Class template <code>multiset</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.5</entry>
<entry>Unordered associative containers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>23.5.1</entry>
<entry>Class template <code>unordered_map</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.5.2</entry>
<entry>Class template <code>unordered_multimap</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.5.3</entry>
<entry>Class template <code>unordered_set</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>23.5.4</entry>
<entry>Class template <code>unordered_multiset</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -1431,86 +1431,86 @@ particular release.
<entry>24.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.2</entry>
<entry>Iterator requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.3</entry>
<entry>Header <code>&lt;iterator&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.4</entry>
<entry>Iterator primitives</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5</entry>
<entry>Iterator adaptors</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>24.5.1</entry>
<entry>Reverse iterators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5.2</entry>
<entry>Insert iterators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.5.3</entry>
<entry>Move iterators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.6</entry>
<entry>Stream iterators</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>24.6.1</entry>
<entry>Class template <code>istream_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.6.2</entry>
<entry>Class template <code>ostream_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.6.3</entry>
<entry>Class template <code>istreambuf_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>24.6.4</entry>
<entry>Class template <code>ostreambuf_iterator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>24.6.5</entry>
<entry>range access</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -1523,32 +1523,32 @@ particular release.
<row>
<entry>25.1</entry>
<entry>General</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>25.2</entry>
<entry>Non-modifying sequence operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>25.3</entry>
<entry>Mutating sequence operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>25.4</entry>
<entry>Sorting and related operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>25.5</entry>
<entry>C library algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -1562,19 +1562,19 @@ particular release.
<entry>26.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.2</entry>
<entry>Numeric type requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.3</entry>
<entry>The floating-point environment</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.4</entry>
@@ -1585,26 +1585,26 @@ particular release.
<row>
<entry>26.5</entry>
<entry>Random number generation</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.1</entry>
<entry>Requirements</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.2</entry>
<entry>Header <code>&lt;random&gt;</code> synopsis</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.3</entry>
<entry>Random number engine class templates</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.3.1</entry>
@@ -1627,8 +1627,8 @@ particular release.
<row>
<entry>26.5.4</entry>
<entry>Random number engine adaptor class templates</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.4.1</entry>
@@ -1652,7 +1652,7 @@ particular release.
<entry>26.5.5</entry>
<entry>Engines and engine adaptors with predefined parameters</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.6</entry>
@@ -1663,285 +1663,285 @@ particular release.
<row>
<entry>26.5.7</entry>
<entry>Utilities</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.7.1</entry>
<entry>Class <code>seed_seq</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.7.2</entry>
<entry>Function template <code>generate_canonical</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8</entry>
<entry>Random number distribution class templates</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.8.1</entry>
<entry>Uniform distributions</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.8.1.1</entry>
<entry>Class template <code>uniform_int_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.1.2</entry>
<entry>Class template <code>uniform_real_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.2</entry>
<entry>Bernoulli distributions</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.8.2.1</entry>
<entry>Class <code>bernoulli_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.2.2</entry>
<entry>Class template <code>binomial_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.2.3</entry>
<entry>Class template <code>geometric_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.2.4</entry>
<entry>Class template <code>negative_binomial_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.3</entry>
<entry>Poisson distributions</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.8.3.1</entry>
<entry>Class template <code>poisson_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.3.2</entry>
<entry>Class template <code>exponential_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.3.3</entry>
<entry>Class template <code>gamma_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.3.4</entry>
<entry>Class template <code>weibull_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.3.5</entry>
<entry>Class template <code>extreme_value_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.4</entry>
<entry>Normal distributions</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.8.4.1</entry>
<entry>Class template <code>normal_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.4.2</entry>
<entry>Class template <code>lognormal_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.4.3</entry>
<entry>Class template <code>chi_squared_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.4.4</entry>
<entry>Class template <code>cauchy_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.4.5</entry>
<entry>Class template <code>fisher_f_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.4.6</entry>
<entry>Class template <code>student_t_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.5</entry>
<entry>Sampling distributions</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.5.8.5.1</entry>
<entry>Class template <code>discrete_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.5.2</entry>
<entry>Class template <code>piecewise_constant_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.5.8.5.3</entry>
<entry>Class template <code>piecewise_linear_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6</entry>
<entry>Numeric arrays</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.6.1</entry>
<entry>Header <code>&lt;valarray&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.2</entry>
<entry>Class template <code>valarray</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.3</entry>
<entry><code>valarray</code> non-member operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.4</entry>
<entry>Class <code>slice</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.5</entry>
<entry>Class template <code>slice_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.6</entry>
<entry>The <code>gslice</code> class</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.7</entry>
<entry>Class template <code>gslice_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.8</entry>
<entry>Class template <code>mask_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.6.9</entry>
<entry>Class template <code>indirect_array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>26.6.10</entry>
<entry><code>valarray</code> range access</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.7</entry>
<entry>Generalized numeric operations</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>26.7.1</entry>
<entry><code>accumulate</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.7.2</entry>
<entry><code>inner_product</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.7.3</entry>
<entry><code>partial_sum</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.7.4</entry>
<entry><code>adjacent_difference</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.7.5</entry>
<entry>iota</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>26.8</entry>
<entry>C Library</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -1955,86 +1955,90 @@ particular release.
<entry>27.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.2</entry>
<entry>Iostreams requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.2.1</entry>
<entry>Imbue Limitations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.2.2</entry>
<entry>Positioning Type Limitations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>27.2.3</entry>
<entry>Thread safety</entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.3</entry>
<entry>Forward declarations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.4</entry>
<entry>Standard iostream objects</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.4.1</entry>
<entry>Narrow stream objects</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>27.4.2</entry>
<entry>Wide stream objects</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>27.5</entry>
<entry>Iostreams base classes</entry>
- <entry>Y</entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing move and swap operations</entry>
</row>
<row>
<entry>27.6</entry>
<entry>Stream buffers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>27.7</entry>
<entry>Formatting and manipulators</entry>
- <entry>Y</entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing move and swap operations</entry>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>27.8</entry>
<entry>String-based streams</entry>
- <entry>Y</entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing move and swap operations</entry>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>27.9</entry>
<entry>File-based streams</entry>
- <entry>Y</entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing move and swap operations</entry>
</row>
<row>
<entry>
@@ -2049,89 +2053,89 @@ particular release.
<entry>28.1</entry>
<entry>General</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>28.2</entry>
<entry>Definitions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>28.3</entry>
<entry>Requirements</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>28.4</entry>
<entry>Header <code>&lt;regex&gt;</code> synopsis</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>28.5</entry>
<entry>Namespace <code>std::regex_constants</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>28.6</entry>
<entry>Class <code>regex_error</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>28.7</entry>
<entry>Class template <code>regex_traits</code></entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>28.8</entry>
<entry>Class template <code>basic_regex</code></entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>28.9</entry>
<entry>Class template <code>sub_match</code></entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>28.10</entry>
<entry>Class template <code>match_results</code></entry>
<entry>Partial</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>28.11</entry>
<entry>Regular expression algorithms</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>28.12</entry>
<entry>Regular expression Iterators</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>28.13</entry>
<entry>Modified ECMAScript regular expression grammar</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -2145,20 +2149,20 @@ particular release.
<entry>29.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>29.2</entry>
<entry>Header <code>&lt;atomic&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>29.3</entry>
<entry>Order and consistency</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>29.4</entry>
@@ -2169,8 +2173,8 @@ particular release.
<row>
<entry>29.5</entry>
<entry>Atomic types</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>29.5.1</entry>
@@ -2194,20 +2198,20 @@ particular release.
<entry>29.6</entry>
<entry>Operations on atomic types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>29.7</entry>
<entry>Flag Type and operations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>29.8</entry>
<entry>Fences</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>
@@ -2221,19 +2225,19 @@ particular release.
<entry>30.1</entry>
<entry>General</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.2</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.3</entry>
<entry>Threads</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -2246,79 +2250,79 @@ particular release.
<entry>30.3.2</entry>
<entry>Namespace <code>this_thread</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4</entry>
<entry>Mutual exclusion</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.4.1</entry>
<entry>Mutex requirements</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.4.1.1</entry>
<entry>Class <code>mutex</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry>Missing constexpr</entry>
</row>
<row>
<entry>30.4.1.2</entry>
<entry>Class <code>recursive_mutex</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4.2</entry>
<entry>Timed mutex requirements</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.4.2.1</entry>
<entry>Class <code>timed_mutex</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4.2.2</entry>
<entry>Class <code>recursive_timed_mutex</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4.3</entry>
<entry>Locks</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.4.3.1</entry>
<entry>Class template <code>lock_guard</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4.3.2</entry>
<entry>Class template <code>unique_lock</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4.4</entry>
<entry>Generic locking algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.4.5</entry>
<entry>Call once</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.4.5.1</entry>
@@ -2330,37 +2334,38 @@ particular release.
<entry>30.4.5.2</entry>
<entry><code>call_once</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>30.5</entry>
<entry>Condition variables</entry>
- <entry></entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing notify_all_at_thread_exit</entry>
</row>
<row>
<entry>30.5.1</entry>
<entry>Class <code>condition_variable</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.5.2</entry>
<entry>Class <code>condition_variable_any</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.6</entry>
<entry>Futures</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.6.1</entry>
<entry>Overview</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>30.6.2</entry>
@@ -2372,52 +2377,54 @@ particular release.
<entry>30.6.3</entry>
<entry>Class <code>future_error</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.6.4</entry>
<entry>Associated asynchronous state</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>30.6.5</entry>
<entry>Class template <code>promise</code></entry>
<entry>Partial</entry>
- <entry>Missing <code>allocator_arg_t</code></entry>
+ <entry>Missing <code>allocator_arg_t</code> and set_*_at_thread_exit</entry>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>30.6.6</entry>
<entry>Class template <code>future</code></entry>
- <entry>Y</entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing future_status</entry>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>30.6.7</entry>
<entry>Class template <code>shared_future</code></entry>
- <entry>Y</entry>
- <entry></entry>
+ <entry>Partial</entry>
+ <entry>Missing future_status</entry>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>30.6.8</entry>
<entry>Class template <code>atomic_future</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>30.6.9</entry>
<entry>Function template <code>async</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>30.6.10</entry>
<entry>Class template <code>packaged_task</code></entry>
<entry>Partial</entry>
- <entry>Missing <code>allocator_arg_t</code></entry>
+ <entry>Missing <code>allocator_arg_t</code> and make_ready_at_thread_exit</entry>
</row>
<row>
<entry>
@@ -2430,62 +2437,62 @@ particular release.
<row>
<entry>D.1</entry>
<entry>Increment operator with <code>bool</code> operand</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.2</entry>
<entry><code>static</code> keyword</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.3</entry>
<entry>Access declarations</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.4</entry>
<entry><code>register</code> keyword</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.5</entry>
<entry>Dynamic exception specifications</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.6</entry>
<entry>C standard library headers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.7</entry>
<entry>Old iostreams members</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.8</entry>
<entry>char* streams</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.9</entry>
<entry>Binders</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>D.10</entry>
<entry><code>auto_ptr</code></entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
</tbody>
@@ -2493,4 +2500,4 @@ particular release.
</table>
-</sect2>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml b/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml
index 4d3650167e6..321c4ba269c 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml
@@ -1,7 +1,8 @@
-<sect2 id="status.iso.tr1" xreflabel="Status C++ TR1">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="status.iso.tr1" xreflabel="Status C++ TR1">
<?dbhtml filename="status_iso_cxxtr1.html"?>
-<sect2info>
+<info><title>C++ TR1</title>
<keywordset>
<keyword>
ISO C++
@@ -10,9 +11,7 @@
tr1
</keyword>
</keywordset>
-</sect2info>
-
-<title>C++ TR1</title>
+</info>
<para>
This table is based on the table of contents of ISO/IEC DTR 19768
@@ -40,13 +39,14 @@ release.
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
-->
-<table frame='all'>
+<table frame="all">
<title>C++ TR1 Implementation Status</title>
-<tgroup cols='4' align='left' colsep='0' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="0" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
@@ -64,77 +64,77 @@ release.
<row>
<entry>2.1</entry>
<entry>Reference wrappers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>2.1.1</entry>
<entry>Additions to header <code>&lt;functional&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.1.2</entry>
<entry>Class template <code>reference_wrapper</code></entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>2.1.2.1</entry>
<entry><code>reference_wrapper</code> construct/copy/destroy</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.1.2.2</entry>
<entry><code>reference_wrapper</code> assignment</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.1.2.3</entry>
<entry><code>reference_wrapper</code> access</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.1.2.4</entry>
<entry><code>reference_wrapper</code> invocation</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.1.2.5</entry>
<entry><code>reference_wrapper</code> helper functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2</entry>
<entry>Smart pointers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>2.2.1</entry>
<entry>Additions to header <code>&lt;memory&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.2</entry>
<entry>Class <code>bad_weak_ptr</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3</entry>
<entry>Class template <code>shared_ptr</code></entry>
- <entry></entry>
+ <entry/>
<entry>
<para>
Uses code from
- <ulink url="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</link>.
</para>
</entry>
</row>
@@ -142,115 +142,115 @@ release.
<entry>2.2.3.1</entry>
<entry><code>shared_ptr</code> constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.2</entry>
<entry><code>shared_ptr</code> destructor</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.3</entry>
<entry><code>shared_ptr</code> assignment</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.4</entry>
<entry><code>shared_ptr</code> modifiers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.5</entry>
<entry><code>shared_ptr</code> observers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.6</entry>
<entry><code>shared_ptr</code> comparison</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.7</entry>
<entry><code>shared_ptr</code> I/O</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.8</entry>
<entry><code>shared_ptr</code> specialized algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.9</entry>
<entry><code>shared_ptr</code> casts</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.3.10</entry>
<entry><code>get_deleter</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4</entry>
<entry>Class template <code>weak_ptr</code></entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>2.2.4.1</entry>
<entry><code>weak_ptr</code> constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4.2</entry>
<entry><code>weak_ptr</code> destructor</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4.3</entry>
<entry><code>weak_ptr</code> assignment</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4.4</entry>
<entry><code>weak_ptr</code> modifiers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4.5</entry>
<entry><code>weak_ptr</code> observers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4.6</entry>
<entry><code>weak_ptr</code> comparison</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.4.7</entry>
<entry><code>weak_ptr</code> specialized algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>2.2.5</entry>
<entry>Class template <code>enable_shared_from_this</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry><emphasis>3</emphasis></entry>
@@ -260,133 +260,133 @@ release.
<entry>3.1</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.2</entry>
<entry>Additions to <code>&lt;functional&gt; synopsis</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.3</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4</entry>
<entry>Function return types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.5</entry>
<entry>Function template <code>mem_fn</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.6</entry>
<entry>Function object binders</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>3.6.1</entry>
<entry>Class template <code>is_bind_expression</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.6.2</entry>
<entry>Class template <code>is_placeholder</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.6.3</entry>
<entry>Function template <code>bind</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.6.4</entry>
<entry>Placeholders</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7</entry>
<entry>Polymorphic function wrappers</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>3.7.1</entry>
- <entry>Class <code>bad_function_call<code></code></code></entry>
+ <entry>Class <code>bad_function_call</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.1.1</entry>
<entry><code>bad_function_call</code> constructor</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2</entry>
<entry>Class template <code>function</code></entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>3.7.2.1</entry>
<entry><code>function</code> construct/copy/destroy</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.2</entry>
<entry><code>function</code> modifiers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.3</entry>
<entry><code>function</code> capacity</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.4</entry>
<entry><code>function</code> invocation</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.5</entry>
<entry><code>function</code> target access</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.6</entry>
<entry>undefined operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.7</entry>
<entry>null pointer comparison operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.7.2.8</entry>
<entry>specialized algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry><emphasis>4</emphasis></entry>
@@ -396,97 +396,97 @@ release.
<entry>4.1</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.2</entry>
<entry>Header <code>&lt;type_traits&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.3</entry>
<entry>Helper classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.4</entry>
<entry>General Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.5</entry>
<entry>Unary Type Traits</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>4.5.1</entry>
<entry>Primary Type Categories</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.5.2</entry>
<entry>Composite type traits</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.5.3</entry>
<entry>Type properties</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.6</entry>
<entry>Relationships between types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.7</entry>
<entry>Transformations between types</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>4.7.1</entry>
<entry>Const-volatile modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.7.2</entry>
<entry>Reference modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.7.3</entry>
<entry>Array modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.7.4</entry>
<entry>Pointer modifications</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.8</entry>
<entry>Other transformations</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>4.9</entry>
<entry>Implementation requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry><emphasis>5</emphasis></entry>
@@ -495,62 +495,62 @@ release.
<row>
<entry>5.1</entry>
<entry>Random number generation</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>5.1.1</entry>
<entry>Requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.2</entry>
<entry>Header <code>&lt;random&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.3</entry>
<entry>Class template <code>variate_generator</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4</entry>
<entry>Random number engine class templates</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4.1</entry>
<entry>Class template <code>linear_congruential</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4.2</entry>
<entry>Class template <code>mersenne_twister</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4.3</entry>
<entry>Class template <code>subtract_with_carry</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4.4</entry>
<entry>Class template <code>subtract_with_carry_01</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4.5</entry>
<entry>Class template <code>discard_block</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.4.6</entry>
@@ -562,229 +562,229 @@ release.
<entry>5.1.5</entry>
<entry>Engines with predefined parameters</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.6</entry>
<entry>Class <code>random_device</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7</entry>
<entry>Random distribution class templates</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.1</entry>
<entry>Class template <code>uniform_int</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.2</entry>
<entry>Class <code>bernoulli_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.3</entry>
<entry>Class template <code>geometric_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.4</entry>
<entry>Class template <code>poisson_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.5</entry>
<entry>Class template <code>binomial_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.6</entry>
<entry>Class template <code>uniform_real</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.7</entry>
<entry>Class template <code>exponential_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.8</entry>
<entry>Class template <code>normal_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.1.7.9</entry>
<entry>Class template <code>gamma_distribution</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2</entry>
<entry>Mathematical special functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1</entry>
<entry>Additions to header <code>&lt;cmath&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.1</entry>
<entry>associated Laguerre polynomials</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.2</entry>
<entry>associated Legendre functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.3</entry>
<entry>beta function</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.4</entry>
<entry>(complete) elliptic integral of the first kind</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.5</entry>
<entry>(complete) elliptic integral of the second kind</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.6</entry>
<entry>(complete) elliptic integral of the third kind</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.7</entry>
<entry>confluent hypergeometric functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.8</entry>
<entry>regular modified cylindrical Bessel functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.9</entry>
<entry>cylindrical Bessel functions (of the first kind)</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.10</entry>
<entry>irregular modified cylindrical Bessel functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.11</entry>
<entry>cylindrical Neumann functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.12</entry>
<entry>(incomplete) elliptic integral of the first kind</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.13</entry>
<entry>(incomplete) elliptic integral of the second kind</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.14</entry>
<entry>(incomplete) elliptic integral of the third kind</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.15</entry>
<entry>exponential integral</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.16</entry>
<entry>Hermite polynomials</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.17</entry>
<entry>hypergeometric functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.18</entry>
<entry>Laguerre polynomials</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.19</entry>
<entry>Legendre polynomials</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.20</entry>
<entry>Riemann zeta function</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.21</entry>
<entry>spherical Bessel functions (of the first kind)</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.22</entry>
<entry>spherical associated Legendre functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.1.23</entry>
<entry>spherical Neumann functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>5.2.2</entry>
<entry>Additions to header <code>&lt;math.h&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry><emphasis>6</emphasis></entry>
@@ -794,236 +794,236 @@ release.
<entry>6.1</entry>
<entry>Tuple types</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.1</entry>
<entry>Header <code>&lt;tuple&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.2</entry>
<entry>Additions to header <code>&lt;utility&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.3</entry>
<entry>Class template <code>tuple</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.3.1</entry>
<entry>Construction</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.3.2</entry>
<entry>Tuple creation functions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.3.3</entry>
<entry>Tuple helper classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.3.4</entry>
<entry>Element access</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.3.5</entry>
<entry>Relational operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.1.4</entry>
<entry>Pairs</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2</entry>
<entry>Fixed size array</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.1</entry>
<entry>Header <code>&lt;array&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.2</entry>
<entry>Class template <code>array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.2.1</entry>
<entry><code>array</code> constructors, copy, and assignment</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.2.2</entry>
<entry><code>array</code> specialized algorithms</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.2.3</entry>
<entry><code>array</code> size</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.2.4</entry>
<entry>Zero sized <code>array</code>s</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.2.2.5</entry>
<entry>Tuple interface to class template <code>array</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3</entry>
<entry>Unordered associative containers</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.1</entry>
<entry>Unordered associative container requirements</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.1.1</entry>
<entry>Exception safety guarantees</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.2</entry>
<entry>Additions to header <code>&lt;functional&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.3</entry>
<entry>Class template <code>hash</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4</entry>
<entry>Unordered associative container classes</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.1</entry>
<entry>Header <code>&lt;unordered_set&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.2</entry>
<entry>Header <code>&lt;unordered_map&gt;</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.3</entry>
<entry>Class template <code>unordered_set</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.3.1</entry>
<entry><code>unordered_set</code> constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.3.2</entry>
<entry><code>unordered_set</code> swap</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.4</entry>
<entry>Class template <code>unordered_map</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.4.1</entry>
<entry><code>unordered_map</code> constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.4.2</entry>
<entry><code>unordered_map</code> element access</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.4.3</entry>
<entry><code>unordered_map</code> swap</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.5</entry>
- <entry>Class template <code>unordered_multiset<code></code></code></entry>
+ <entry>Class template <code>unordered_multiset</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.5.1</entry>
<entry><code>unordered_multiset</code> constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.5.2</entry>
<entry><code>unordered_multiset</code> swap</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.6</entry>
<entry>Class template <code>unordered_multimap</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.6.1</entry>
<entry><code>unordered_multimap</code> constructors</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>6.3.4.6.2</entry>
<entry><code>unordered_multimap</code> swap</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry><emphasis>7</emphasis></entry>
@@ -1034,322 +1034,322 @@ release.
<entry>7.1</entry>
<entry>Definitions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.2</entry>
<entry>Requirements</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.3</entry>
<entry>Regular expressions summary</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.4</entry>
<entry>Header <code>&lt;regex&gt;</code> synopsis</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.5</entry>
<entry>Namespace <code>tr1::regex_constants</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.5.1</entry>
<entry>Bitmask Type <code>syntax_option_type</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.5.2</entry>
<entry>Bitmask Type <code>regex_constants::match_flag_type</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.5.3</entry>
<entry>Implementation defined <code>error_type</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.6</entry>
<entry>Class <code>regex_error</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.7</entry>
<entry>Class template <code>regex_traits</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8</entry>
<entry>Class template <code>basic_regex</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.1</entry>
<entry><code>basic_regex</code> constants</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.2</entry>
<entry><code>basic_regex</code> constructors</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.3</entry>
<entry><code>basic_regex</code> assign</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.4</entry>
<entry><code>basic_regex</code> constant operations</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.5</entry>
<entry><code>basic_regex</code> locale</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.6</entry>
<entry><code>basic_regex</code> swap</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.7</entry>
<entry><code>basic_regex</code> non-member functions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.8.7.1</entry>
<entry><code>basic_regex</code> non-member swap</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.9</entry>
<entry>Class template <code>sub_match</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.9.1</entry>
<entry><code>sub_match</code> members</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.9.2</entry>
<entry><code>sub_match</code> non-member operators</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10</entry>
<entry>Class template <code>match_results</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10.1</entry>
<entry><code>match_results</code> constructors</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10.2</entry>
<entry><code>match_results</code> size</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10.3</entry>
<entry><code>match_results</code> element access</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10.4</entry>
<entry><code>match_results</code> formatting</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10.5</entry>
<entry><code>match_results</code> allocator</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.10.6</entry>
<entry><code>match_results</code> swap</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.11</entry>
<entry>Regular expression algorithms</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.11.1</entry>
<entry>exceptions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.11.2</entry>
<entry><code>regex_match</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.11.3</entry>
<entry><code>regex_search</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.11.4</entry>
<entry><code>regex_replace</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12</entry>
<entry>Regular expression Iterators</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.1</entry>
<entry>Class template <code>regex_iterator</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.1.1</entry>
<entry><code>regex_iterator</code> constructors</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.1.2</entry>
<entry><code>regex_iterator</code> comparisons</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.1.3</entry>
<entry><code>regex_iterator</code> dereference</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.1.4</entry>
<entry><code>regex_iterator</code> increment</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.2</entry>
<entry>Class template <code>regex_token_iterator</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.2.1</entry>
<entry><code>regex_token_iterator</code> constructors</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.2.2</entry>
<entry><code>regex_token_iterator</code> comparisons</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.2.3</entry>
<entry><code>regex_token_iterator</code> dereference</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.12.2.4</entry>
<entry><code>regex_token_iterator</code> increment</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>7.13</entry>
<entry>Modified ECMAScript regular expression grammar</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry><emphasis>8</emphasis></entry>
@@ -1359,61 +1359,61 @@ release.
<entry>8.1</entry>
<entry>Additions to header <code>&lt;complex&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.2</entry>
<entry>Function <code>acos</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.3</entry>
<entry>Function <code>asin</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.4</entry>
<entry>Function <code>atan</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.5</entry>
<entry>Function <code>acosh</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.6</entry>
<entry>Function <code>asinh</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.7</entry>
<entry>Function <code>atanh</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.8</entry>
<entry>Function <code>fabs</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.1.9</entry>
<entry>Additional Overloads</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
@@ -1433,88 +1433,88 @@ release.
<entry>8.4</entry>
<entry>Additions to header <code>&lt;cctype&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.4.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.4.2</entry>
<entry>Function <code>isblank</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.5</entry>
<entry>Additions to header <code>&lt;ctype.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.6</entry>
<entry>Header <code>&lt;cfenv&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.6.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.6.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.7</entry>
<entry>Header <code>&lt;fenv.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.8</entry>
<entry>Additions to header <code>&lt;cfloat&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.9</entry>
<entry>Additions to header <code>&lt;float.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>8.10</entry>
<entry>Additions to header <code>&lt;ios&gt;</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>8.10.1</entry>
<entry>Synopsis</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>8.10.2</entry>
<entry>Function <code>hexfloat</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.11</entry>
<entry>Header <code>&lt;cinttypes&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.11.1</entry>
@@ -1526,56 +1526,56 @@ release.
<entry>8.11.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.12</entry>
<entry>Header <code>&lt;inttypes.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.13</entry>
<entry>Additions to header <code>&lt;climits&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.14</entry>
<entry>Additions to header <code>&lt;limits.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>8.15</entry>
<entry>Additions to header <code>&lt;locale&gt;</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.16</entry>
<entry>Additions to header <code>&lt;cmath&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.16.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.16.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.16.3</entry>
<entry>Function template definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.16.4</entry>
@@ -1587,73 +1587,73 @@ release.
<entry>8.17</entry>
<entry>Additions to header <code>&lt;math.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.18</entry>
<entry>Additions to header <code>&lt;cstdarg&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.19</entry>
<entry>Additions to header <code>&lt;stdarg.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.20</entry>
<entry>The header <code>&lt;cstdbool&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.21</entry>
<entry>The header <code>&lt;stdbool.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.22</entry>
<entry>The header <code>&lt;cstdint&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.22.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.22.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.23</entry>
<entry>The header <code>&lt;stdint.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.24</entry>
<entry>Additions to header <code>&lt;cstdio&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.24.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.24.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.24.3</entry>
@@ -1665,43 +1665,43 @@ release.
<entry>8.24.4</entry>
<entry>Additions to header <code>&lt;stdio.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.25</entry>
<entry>Additions to header <code>&lt;cstdlib&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.25.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.25.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.25.3</entry>
<entry>Function <code>abs</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.25.4</entry>
<entry>Function <code>div</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.26</entry>
<entry>Additions to header <code>&lt;stdlib.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.27</entry>
@@ -1725,19 +1725,19 @@ release.
<entry>8.30</entry>
<entry>Additions to header <code>&lt;cwchar&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.30.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.30.2</entry>
<entry>Definitions</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.30.3</entry>
@@ -1749,34 +1749,34 @@ release.
<entry>8.31</entry>
<entry>Additions to header <code>&lt;wchar.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.32</entry>
<entry>Additions to header <code>&lt;cwctype&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.32.1</entry>
<entry>Synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.32.2</entry>
<entry>Function <code>iswblank</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>8.33</entry>
<entry>Additions to header <code>&lt;wctype.h&gt;</code></entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
</tbody>
</tgroup>
</table>
-</sect2>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml b/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml
index f3b29b9bf36..997e76be18f 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml
@@ -1,15 +1,14 @@
-<sect2 id="status.iso.tr24733" xreflabel="Status C++ TR24733">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="status.iso.tr24733" xreflabel="Status C++ TR24733">
<?dbhtml filename="status_iso_cxxtr24733.html"?>
-<sect2info>
+<info><title>C++ TR 24733</title>
<keywordset>
<keyword>
TR 24733
</keyword>
</keywordset>
-</sect2info>
-
-<title>C++ TR 24733</title>
+</info>
<para>
This table is based on the table of contents of
@@ -32,13 +31,14 @@ particular release.
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
-->
-<table frame='all'>
+<table frame="all">
<title>C++ TR 24733 Implementation Status</title>
-<tgroup cols='4' align='left' colsep='0' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="0" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<thead>
<row>
<entry>Section</entry>
@@ -88,14 +88,14 @@ particular release.
<row>
<entry>3.1</entry>
<entry>Characteristics of decimal floating-point types</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>3.2</entry>
<entry>Decimal Types</entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
@@ -129,157 +129,157 @@ particular release.
<entry>3.2.5</entry>
<entry>Initialization from coefficient and exponent</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.2.6</entry>
<entry>Conversion to generic floating-point type</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.2.7</entry>
<entry>Unary arithmetic operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.2.8</entry>
<entry>Binary arithmetic operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.2.9</entry>
<entry>Comparison operators</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.2.10</entry>
<entry>Formatted input</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.2.11</entry>
<entry>Formatted output</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.3</entry>
<entry>Additions to header <code>limits</code></entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4</entry>
<entry>Headers <code>cfloat</code> and <code>float.h</code></entry>
- <entry></entry>
- <entry></entry>
+ <entry/>
+ <entry/>
</row>
<row>
<entry>3.4.2</entry>
<entry>Additions to header <code>cfloat</code> synopsis</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#B0B0B0" ?>
<entry>3.4.3</entry>
<entry>Additions to header <code>float.h</code> synopsis</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4.4</entry>
<entry>Maximum finite value</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4.5</entry>
<entry>Epsilon</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4.6</entry>
<entry>Minimum positive normal value</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4.7</entry>
<entry>Minimum positive subnormal value</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<entry>3.4.8</entry>
<entry>Evaluation format</entry>
<entry>Y</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.5</entry>
<entry>Additions to <code>cfenv</code> and <code>fenv.h</code></entry>
<entry>Outside the scope of GCC</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.6</entry>
<entry>Additions to <code>cmath</code> and <code>math.h</code></entry>
<entry>Outside the scope of GCC</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.7</entry>
<entry>Additions to <code>cstdio</code> and <code>stdio.h</code></entry>
<entry>Outside the scope of GCC</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.8</entry>
<entry>Additions to <code>cstdlib</code> and <code>stdlib.h</code></entry>
<entry>Outside the scope of GCC</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.9</entry>
<entry>Additions to <code>cwchar</code> and <code>wchar.h</code></entry>
<entry>Outside the scope of GCC</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.10</entry>
<entry>Facets</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.11</entry>
<entry>Type traits</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry>3.12</entry>
<entry>Hash functions</entry>
<entry>N</entry>
- <entry></entry>
+ <entry/>
</row>
<row>
@@ -296,4 +296,4 @@ particular release.
</table>
-</sect2>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/strings.xml b/libstdc++-v3/doc/xml/manual/strings.xml
index 8eb9b49a1be..4d9fc64f766 100644
--- a/libstdc++-v3/doc/xml/manual/strings.xml
+++ b/libstdc++-v3/doc/xml/manual/strings.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.strings" xreflabel="Strings">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.strings" xreflabel="Strings">
<?dbhtml filename="strings.html"?>
-<chapterinfo>
+<info><title>
+ Strings
+ <indexterm><primary>Strings</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,25 +14,20 @@
library
</keyword>
</keywordset>
-</chapterinfo>
-
-<title>
- Strings
- <indexterm><primary>Strings</primary></indexterm>
-</title>
+</info>
<!-- Sect1 01 : Character Traits -->
<!-- Sect1 02 : String Classes -->
-<sect1 id="std.strings.string" xreflabel="string">
- <title>String Classes</title>
+<section xml:id="std.strings.string" xreflabel="string"><info><title>String Classes</title></info>
+
- <sect2 id="strings.string.simple" xreflabel="Simple Transformations">
- <title>Simple Transformations</title>
+ <section xml:id="strings.string.simple" xreflabel="Simple Transformations"><info><title>Simple Transformations</title></info>
+
<para>
Here are Standard, simple, and portable ways to perform common
transformations on a <code>string</code> instance, such as
- &quot;convert to all upper case.&quot; The word transformations
+ "convert to all upper case." The word transformations
is especially apt, because the standard template function
<code>transform&lt;&gt;</code> is used.
</para>
@@ -90,8 +84,8 @@
are overloaded names (declared in <code>&lt;cctype&gt;</code> and
<code>&lt;locale&gt;</code>) so the template-arguments for
<code>transform&lt;&gt;</code> cannot be deduced, as explained in
- <ulink url="http://gcc.gnu.org/ml/libstdc++/2002-11/msg00180.html">this
- message</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-11/msg00180.html">this
+ message</link>.
<!-- section 14.8.2.4 clause 16 in ISO 14882:1998 -->
At minimum, you can write short wrappers like
</para>
@@ -122,14 +116,14 @@
optimize named temporaries out of existence.
</para>
- </sect2>
- <sect2 id="strings.string.case" xreflabel="Case Sensitivity">
- <title>Case Sensitivity</title>
+ </section>
+ <section xml:id="strings.string.case" xreflabel="Case Sensitivity"><info><title>Case Sensitivity</title></info>
+
<para>
</para>
<para>The well-known-and-if-it-isn't-well-known-it-ought-to-be
- <ulink url="http://www.gotw.ca/gotw/">Guru of the Week</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gotw.ca/gotw/">Guru of the Week</link>
discussions held on Usenet covered this topic in January of 1998.
Briefly, the challenge was, <quote>write a 'ci_string' class which
is identical to the standard 'string' class, but is
@@ -149,34 +143,33 @@
<para>The solution is surprisingly easy. The original answer was
posted on Usenet, and a revised version appears in Herb Sutter's
- book <emphasis>Exceptional C++</emphasis> and on his website as <ulink url="http://www.gotw.ca/gotw/029.htm">GotW 29</ulink>.
+ book <emphasis>Exceptional C++</emphasis> and on his website as <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.gotw.ca/gotw/029.htm">GotW 29</link>.
</para>
<para>See? Told you it was easy!</para>
<para>
<emphasis>Added June 2000:</emphasis> The May 2000 issue of C++
- Report contains a fascinating <ulink
- url="http://lafstern.org/matt/col2_new.pdf"> article</ulink> by
+ Report contains a fascinating <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://lafstern.org/matt/col2_new.pdf"> article</link> by
Matt Austern (yes, <emphasis>the</emphasis> Matt Austern) on why
case-insensitive comparisons are not as easy as they seem, and
why creating a class is the <emphasis>wrong</emphasis> way to go
about it in production code. (The GotW answer mentions one of
the principle difficulties; his article mentions more.)
</para>
- <para>Basically, this is &quot;easy&quot; only if you ignore some things,
+ <para>Basically, this is "easy" only if you ignore some things,
things which may be too important to your program to ignore. (I chose
to ignore them when originally writing this entry, and am surprised
that nobody ever called me on it...) The GotW question and answer
remain useful instructional tools, however.
</para>
<para><emphasis>Added September 2000:</emphasis> James Kanze provided a link to a
- <ulink url="http://www.unicode.org/reports/tr21/tr21-5.html">Unicode
- Technical Report discussing case handling</ulink>, which provides some
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.unicode.org/reports/tr21/tr21-5.html">Unicode
+ Technical Report discussing case handling</link>, which provides some
very good information.
</para>
- </sect2>
- <sect2 id="strings.string.character_types" xreflabel="Arbitrary Characters">
- <title>Arbitrary Character Types</title>
+ </section>
+ <section xml:id="strings.string.character_types" xreflabel="Arbitrary Characters"><info><title>Arbitrary Character Types</title></info>
+
<para>
</para>
@@ -231,24 +224,24 @@
built-in types.
</para>
<para>If you want to use your own special character class, then you have
- <ulink url="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00163.html">a lot
- of work to do</ulink>, especially if you with to use i18n features
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00163.html">a lot
+ of work to do</link>, especially if you with to use i18n features
(facets require traits information but don't have a traits argument).
</para>
- <para>Another example of how to specialize char_traits was given <ulink url="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00260.html">on the
- mailing list</ulink> and at a later date was put into the file <code>
+ <para>Another example of how to specialize char_traits was given <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00260.html">on the
+ mailing list</link> and at a later date was put into the file <code>
include/ext/pod_char_traits.h</code>. We agree
that the way it's used with basic_string (scroll down to main())
- doesn't look nice, but that's because <ulink url="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00236.html">the
- nice-looking first attempt</ulink> turned out to <ulink url="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00242.html">not
- be conforming C++</ulink>, due to the rule that CharT must be a POD.
+ doesn't look nice, but that's because <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00236.html">the
+ nice-looking first attempt</link> turned out to <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00242.html">not
+ be conforming C++</link>, due to the rule that CharT must be a POD.
(See how tricky this is?)
</para>
- </sect2>
+ </section>
- <sect2 id="strings.string.token" xreflabel="Tokenizing">
- <title>Tokenizing</title>
+ <section xml:id="strings.string.token" xreflabel="Tokenizing"><info><title>Tokenizing</title></info>
+
<para>
</para>
<para>The Standard C (and C++) function <code>strtok()</code> leaves a lot to
@@ -256,7 +249,7 @@
destroys the character string on which it operates, and it requires
you to handle all the memory problems. But it does let the client
code decide what to use to break the string into pieces; it allows
- you to choose the &quot;whitespace,&quot; so to speak.
+ you to choose the "whitespace," so to speak.
</para>
<para>A C++ implementation lets us keep the good things and fix those
annoyances. The implementation here is more intuitive (you only
@@ -345,9 +338,9 @@ stringtok(Container &amp;container, string const &amp;in,
</para>
- </sect2>
- <sect2 id="strings.string.shrink" xreflabel="Shrink to Fit">
- <title>Shrink to Fit</title>
+ </section>
+ <section xml:id="strings.string.shrink" xreflabel="Shrink to Fit"><info><title>Shrink to Fit</title></info>
+
<para>
</para>
<para>From GCC 3.4 calling <code>s.reserve(res)</code> on a
@@ -372,10 +365,10 @@ stringtok(Container &amp;container, string const &amp;in,
</para>
- </sect2>
+ </section>
- <sect2 id="strings.string.Cstring" xreflabel="CString (MFC)">
- <title>CString (MFC)</title>
+ <section xml:id="strings.string.Cstring" xreflabel="CString (MFC)"><info><title>CString (MFC)</title></info>
+
<para>
</para>
@@ -387,8 +380,8 @@ stringtok(Container &amp;container, string const &amp;in,
are relying on special functions offered by the CString class.
</para>
<para>Things are not as bad as they seem. In
- <ulink url="http://gcc.gnu.org/ml/gcc/1999-04n/msg00236.html">this
- message</ulink>, Joe Buck points out a few very important things:
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/gcc/1999-04n/msg00236.html">this
+ message</link>, Joe Buck points out a few very important things:
</para>
<itemizedlist>
<listitem><para>The Standard <code>string</code> supports all the operations
@@ -485,8 +478,8 @@ stringtok(Container &amp;container, string const &amp;in,
</para></listitem>
</itemizedlist>
- </sect2>
-</sect1>
+ </section>
+</section>
<!-- Sect1 03 : Interacting with C -->
diff --git a/libstdc++-v3/doc/xml/manual/support.xml b/libstdc++-v3/doc/xml/manual/support.xml
index 8035efc38f6..2cb7205bd44 100644
--- a/libstdc++-v3/doc/xml/manual/support.xml
+++ b/libstdc++-v3/doc/xml/manual/support.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.support" xreflabel="Support">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.support" xreflabel="Support">
<?dbhtml filename="support.html"?>
-<chapterinfo>
+<info><title>
+ Support
+ <indexterm><primary>Support</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,12 +14,7 @@
library
</keyword>
</keywordset>
-</chapterinfo>
-
-<title>
- Support
- <indexterm><primary>Support</primary></indexterm>
-</title>
+</info>
<para>
This part deals with the functions called and objects created
@@ -34,11 +28,11 @@
kind of support a C++ program gets from the Standard Library.
</para>
-<sect1 id="std.support.types" xreflabel="Types">
+<section xml:id="std.support.types" xreflabel="Types"><info><title>Types</title></info>
<?dbhtml filename="fundamental_types.html"?>
- <title>Types</title>
- <sect2 id="std.support.types.fundamental" xreflabel="Fundamental Types">
- <title>Fundamental Types</title>
+
+ <section xml:id="std.support.types.fundamental" xreflabel="Fundamental Types"><info><title>Fundamental Types</title></info>
+
<para>
C++ has the following builtin types:
</para>
@@ -98,9 +92,9 @@
instead, use a POD.
</para>
- </sect2>
- <sect2 id="std.support.types.numeric_limits" xreflabel="Numeric Properties">
- <title>Numeric Properties</title>
+ </section>
+ <section xml:id="std.support.types.numeric_limits" xreflabel="Numeric Properties"><info><title>Numeric Properties</title></info>
+
<para>
@@ -108,8 +102,7 @@
traits classes to give access to various implementation
defined-aspects of the fundamental types. The traits classes --
fourteen in total -- are all specializations of the template class
- <classname>numeric_limits</classname>, documented <ulink
- url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00593.html">here</ulink>
+ <classname>numeric_limits</classname>, documented <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00593.html">here</link>
and defined as follows:
</para>
@@ -153,10 +146,10 @@
static const float_round_style round_style;
};
</programlisting>
- </sect2>
+ </section>
- <sect2 id="std.support.types.null" xreflabel="NULL">
- <title>NULL</title>
+ <section xml:id="std.support.types.null" xreflabel="NULL"><info><title>NULL</title></info>
+
<para>
The only change that might affect people is the type of
<constant>NULL</constant>: while it is required to be a macro,
@@ -180,25 +173,24 @@
<constant>NULL</constant> is always a pointer.)
</para>
- <para>In his book <ulink
- url="http://www.awprofessional.com/titles/0-201-92488-9/"><emphasis>Effective
- C++</emphasis></ulink>, Scott Meyers points out that the best way
+ <para>In his book <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.awprofessional.com/titles/0-201-92488-9/"><emphasis>Effective
+ C++</emphasis></link>, Scott Meyers points out that the best way
to solve this problem is to not overload on pointer-vs-integer
types to begin with. He also offers a way to make your own magic
<constant>NULL</constant> that will match pointers before it
matches integers.
</para>
<para>See
- <ulink url="http://www.awprofessional.com/titles/0-201-31015-5/">the
- Effective C++ CD example</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.awprofessional.com/titles/0-201-31015-5/">the
+ Effective C++ CD example</link>
</para>
- </sect2>
+ </section>
-</sect1>
+</section>
-<sect1 id="std.support.memory" xreflabel="Dynamic Memory">
+<section xml:id="std.support.memory" xreflabel="Dynamic Memory"><info><title>Dynamic Memory</title></info>
<?dbhtml filename="dynamic_memory.html"?>
- <title>Dynamic Memory</title>
+
<para>
There are six flavors each of <function>new</function> and
<function>delete</function>, so make certain that you're using the right
@@ -211,7 +203,7 @@
people are used to using
</para></listitem>
<listitem><para>
- Single object &quot;nothrow&quot; form, returning NULL on errors
+ Single object "nothrow" form, returning NULL on errors
</para></listitem>
<listitem><para>
Array <function>new</function>, throwing
@@ -276,16 +268,15 @@
<classname>bad_alloc</classname> is derived from the base <classname>exception</classname>
class defined in Sect1 19.
</para>
-</sect1>
+</section>
-<sect1 id="std.support.termination" xreflabel="Termination">
+<section xml:id="std.support.termination" xreflabel="Termination"><info><title>Termination</title></info>
<?dbhtml filename="termination.html"?>
- <title>Termination</title>
- <sect2 id="support.termination.handlers" xreflabel="Termination Handlers">
- <title>Termination Handlers</title>
+
+ <section xml:id="support.termination.handlers" xreflabel="Termination Handlers"><info><title>Termination Handlers</title></info>
+
<para>
- Not many changes here to <filename
- class="headerfile">cstdlib</filename>. You should note that the
+ Not many changes here to <filename class="headerfile">cstdlib</filename>. You should note that the
<function>abort()</function> function does not call the
destructors of automatic nor static objects, so if you're
depending on those to do cleanup, it isn't going to happen.
@@ -298,7 +289,7 @@
funky, too, until you look closer. Basically, three points to
remember are:
</para>
- <orderedlist>
+ <orderedlist inheritnum="ignore" continuation="restarts">
<listitem>
<para>
Static objects are destroyed in reverse order of their creation.
@@ -342,11 +333,11 @@
those slots. If you think you may run out, we recommend using
the <function>xatexit</function>/<function>xexit</function> combination from <literal>libiberty</literal>, which has no such limit.
</para>
- </sect2>
+ </section>
- <sect2 id="support.termination.verbose" xreflabel="Verbose Terminate Handler">
+ <section xml:id="support.termination.verbose" xreflabel="Verbose Terminate Handler"><info><title>Verbose Terminate Handler</title></info>
<?dbhtml filename="verbose_termination.html"?>
- <title>Verbose Terminate Handler</title>
+
<para>
If you are having difficulty with uncaught exceptions and want a
little bit of help debugging the causes of the core dumps, you can
@@ -446,7 +437,7 @@ int main(int argc)
an unspecified manner.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/test.xml b/libstdc++-v3/doc/xml/manual/test.xml
index 6c0f266d349..006ff332086 100644
--- a/libstdc++-v3/doc/xml/manual/test.xml
+++ b/libstdc++-v3/doc/xml/manual/test.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.intro.setup.test" xreflabel="Testing">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.intro.setup.test" xreflabel="Testing">
<?dbhtml filename="test.html"?>
-<sect1info>
+<info><title>Test</title>
<keywordset>
<keyword>
ISO C++
@@ -25,20 +26,18 @@
exception safety
</keyword>
</keywordset>
-</sect1info>
-
-<title>Test</title>
+</info>
<para>
The libstdc++ testsuite includes testing for standard conformance,
regressions, ABI, and performance.
</para>
-<sect2 id="test.organization" xreflabel="Test Organization">
-<title>Organization</title>
+<section xml:id="test.organization" xreflabel="Test Organization"><info><title>Organization</title></info>
+
+
+<section xml:id="test.organization.layout" xreflabel="Directory Layout"><info><title>Directory Layout</title></info>
-<sect3 id="test.organization.layout" xreflabel="Directory Layout">
-<title>Directory Layout</title>
<para>
The directory <emphasis>libsrcdir/testsuite</emphasis> contains the
@@ -131,11 +130,11 @@ util Files for libtestc++, utilities and testing routines.
All new tests should be written with the policy of one test
case, one file in mind.
</para>
-</sect3>
+</section>
+
+<section xml:id="test.organization.naming" xreflabel="Naming Conventions"><info><title>Naming Conventions</title></info>
-<sect3 id="test.organization.naming" xreflabel="Naming Conventions">
-<title>Naming Conventions</title>
<para>
In addition, there are some special names and suffixes that are
@@ -225,15 +224,15 @@ cat 27_io/objects/char/3_xin.in | a.out
</listitem>
</itemizedlist>
-</sect3>
-</sect2>
+</section>
+</section>
-<sect2 id="test.run" xreflabel="Running the Testsuite">
-<title>Running the Testsuite</title>
+<section xml:id="test.run" xreflabel="Running the Testsuite"><info><title>Running the Testsuite</title></info>
- <sect3 id="test.run.basic">
- <title>Basic</title>
+
+ <section xml:id="test.run.basic"><info><title>Basic</title></info>
+
<para>
You can check the status of the build without installing it
@@ -259,18 +258,16 @@ cat 27_io/objects/char/3_xin.in | a.out
<para>
Archives of test results for various versions and platforms are
- available on the GCC website in the <ulink
- url="http://gcc.gnu.org/gcc-4.3/buildstat.html">build
- status</ulink> section of each individual release, and are also
- archived on a daily basis on the <ulink
- url="http://gcc.gnu.org/ml/gcc-testresults/current">gcc-testresults</ulink>
+ available on the GCC website in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/gcc-4.3/buildstat.html">build
+ status</link> section of each individual release, and are also
+ archived on a daily basis on the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/gcc-testresults/current">gcc-testresults</link>
mailing list. Please check either of these places for a similar
combination of source version, operating system, and host CPU.
</para>
- </sect3>
+ </section>
- <sect3 id="test.run.variations">
- <title>Variations</title>
+ <section xml:id="test.run.variations"><info><title>Variations</title></info>
+
<para>
There are several options for running tests, including testing
the regression tests, testing a subset of the regression tests,
@@ -470,13 +467,12 @@ runtest --tool libstdc++ --srcdir=/path/to/gcc/libstdc++-v3/testsuite
please email the main libstdc++ mailing list if you see
something odd or have questions.
</para>
- </sect3>
+ </section>
- <sect3 id="test.run.permutations">
- <title>Permutations</title>
+ <section xml:id="test.run.permutations"><info><title>Permutations</title></info>
+
<para>
- To run the libstdc++ test suite under the <link
- linkend="manual.ext.debug_mode">debug mode</link>, edit
+ To run the libstdc++ test suite under the <link linkend="manual.ext.debug_mode">debug mode</link>, edit
<filename>libstdc++-v3/scripts/testsuite_flags</filename> to add the
compile-time flag <constant>-D_GLIBCXX_DEBUG</constant> to the
result printed by the <literal>--build-cxx</literal>
@@ -500,11 +496,11 @@ runtest --tool libstdc++ --srcdir=/path/to/gcc/libstdc++-v3/testsuite
set to <constant>-D_GLIBCXX_DEBUG</constant> or
<constant>-D_GLIBCXX_PARALLEL</constant>.
</para>
- </sect3>
-</sect2>
+ </section>
+</section>
+
+<section xml:id="test.new_tests"><info><title>Writing a new test case</title></info>
-<sect2 id="test.new_tests">
-<title>Writing a new test case</title>
<para>
The first step in making a new test case is to choose the correct
@@ -632,14 +628,14 @@ up in the normal.exp file.
<para>
More examples can be found in the libstdc++-v3/testsuite/*/*.cc files.
</para>
-</sect2>
+</section>
+
+<section xml:id="test.harness" xreflabel="Test Harness and Utilities"><info><title>Test Harness and Utilities</title></info>
-<sect2 id="test.harness" xreflabel="Test Harness and Utilities">
-<title>Test Harness and Utilities</title>
-<sect3 id="test.harness.dejagnu">
-<title>Dejagnu Harness Details</title>
+<section xml:id="test.harness.dejagnu"><info><title>Dejagnu Harness Details</title></info>
+
<para>
Underlying details of testing for conformance and regressions are
abstracted via the GNU Dejagnu package. This is similar to the
@@ -682,10 +678,10 @@ board" information unique to this library. This is currently unused and sets
only default variables.
</para>
-</sect3>
+</section>
+
+<section xml:id="test.harness.utils"><info><title>Utilities</title></info>
-<sect3 id="test.harness.utils">
-<title>Utilities</title>
<para>
</para>
<para>
@@ -800,24 +796,24 @@ only default variables.
</itemizedlist>
</listitem>
</itemizedlist>
-</sect3>
+</section>
-</sect2>
+</section>
-<sect2 id="test.special">
-<title>Special Topics</title>
+<section xml:id="test.special"><info><title>Special Topics</title></info>
-<sect3 id="test.exception.safety">
-<title>
+
+<section xml:id="test.exception.safety"><info><title>
Qualifying Exception Safety Guarantees
<indexterm>
<primary>Test</primary>
<secondary>Exception Safety</secondary>
</indexterm>
-</title>
+</title></info>
+
+
+<section xml:id="test.exception.safety.overview"><info><title>Overview</title></info>
-<sect4 id="test.exception.safety.overview">
-<title>Overview</title>
<para>
Testing is composed of running a particular test sequence,
@@ -856,13 +852,13 @@ only default variables.
potential error paths have been exercised in a sequential
manner.
</para>
-</sect4>
+</section>
-<sect4 id="test.exception.safety.status">
-<title>
+<section xml:id="test.exception.safety.status"><info><title>
Existing tests
-</title>
+</title></info>
+
<itemizedlist>
<listitem>
@@ -924,13 +920,13 @@ as the allocator type.
</para>
</listitem>
</itemizedlist>
-</sect4>
+</section>
-<sect4 id="test.exception.safety.containers">
-<title>
+<section xml:id="test.exception.safety.containers"><info><title>
C++0x Requirements Test Sequence Descriptions
-</title>
+</title></info>
+
<itemizedlist>
<listitem>
@@ -1030,10 +1026,10 @@ C++0x Requirements Test Sequence Descriptions
</listitem>
</itemizedlist>
-</sect4>
+</section>
-</sect3>
+</section>
-</sect2>
+</section>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index bb6077c4e19..e3400a678c1 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -1,21 +1,15 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="manual.intro.using" xreflabel="Using">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.intro.using" xreflabel="Using">
+ <info><title>Using</title></info>
<?dbhtml filename="using.html"?>
-<title>Using</title>
-
-
- <sect1 id="manual.intro.using.flags" xreflabel="Flags">
- <title>Command Options</title>
+ <section xml:id="manual.intro.using.flags" xreflabel="Flags"><info><title>Command Options</title></info>
+
<para>
The set of features available in the GNU C++ library is shaped
by
- several <ulink url="http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Invoking-GCC.html">GCC
- Command Options</ulink>. Options that impact libstdc++ are
+ several <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Invoking-GCC.html">GCC
+ Command Options</link>. Options that impact libstdc++ are
enumerated and detailed in the table below.
</para>
@@ -23,11 +17,12 @@
By default, <command>g++</command> is equivalent to <command>g++ -std=gnu++98</command>. The standard library also defaults to this dialect.
</para>
- <table frame='all'>
+ <table frame="all">
<title>C++ Command Options</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<thead>
<row>
@@ -82,19 +77,19 @@
</tgroup>
</table>
- </sect1>
+ </section>
- <sect1 id="manual.intro.using.headers" xreflabel="Headers">
+ <section xml:id="manual.intro.using.headers" xreflabel="Headers"><info><title>Headers</title></info>
<?dbhtml filename="using_headers.html"?>
- <title>Headers</title>
+
- <sect2 id="manual.intro.using.headers.all" xreflabel="Header Files">
- <title>Header Files</title>
+ <section xml:id="manual.intro.using.headers.all" xreflabel="Header Files"><info><title>Header Files</title></info>
+
<para>
The C++ standard specifies the entire set of header files that
must be available to all hosted implementations. Actually, the
- word &quot;files&quot; is a misnomer, since the contents of the
+ word "files" is a misnomer, since the contents of the
headers don't necessarily have to be in any kind of external
file. The only rule is that when one <code>#include</code>'s a
header, the contents of that header become available, no matter
@@ -121,14 +116,15 @@
C++98/03 include files. These are available in the default compilation mode, i.e. <code>-std=c++98</code> or <code>-std=gnu++98</code>.
</para>
-<table frame='all'>
+<table frame="all">
<title>C++ 1998 Library Headers</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
<entry><filename class="headerfile">algorithm</filename></entry>
@@ -180,15 +176,16 @@
</tgroup>
</table>
-<para></para>
-<table frame='all'>
+<para/>
+<table frame="all">
<title>C++ 1998 Library Headers for C Library Facilities</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
<entry><filename class="headerfile">cassert</filename></entry>
@@ -225,15 +222,16 @@ C++0x include files. These are only available in C++0x compilation
mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
</para>
-<para></para>
-<table frame='all'>
+<para/>
+<table frame="all">
<title>C++ 200x Library Headers</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
@@ -309,16 +307,17 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
</tgroup>
</table>
-<para></para>
+<para/>
-<table frame='all'>
+<table frame="all">
<title>C++ 200x Library Headers for C Library Facilities</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
<entry><filename class="headerfile">cassert</filename></entry>
@@ -368,14 +367,15 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
In addition, TR1 includes as:
</para>
-<table frame='all'>
+<table frame="all">
<title>C++ TR 1 Library Headers</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
@@ -400,17 +400,18 @@ mode, i.e. <literal>-std=c++0x</literal> or <literal>-std=gnu++0x</literal>.
</tgroup>
</table>
-<para></para>
+<para/>
-<table frame='all'>
+<table frame="all">
<title>C++ TR 1 Library Headers for C Library Facilities</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
@@ -445,10 +446,11 @@ compiler supports scalar decimal floating-point types defined via
<code>__attribute__((mode(SD|DD|LD)))</code>.
</para>
-<table frame='all'>
+<table frame="all">
<title>C++ TR 24733 Decimal Floating-Point Header</title>
-<tgroup cols='1' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
+
+<tgroup cols="1" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
<tbody>
<row>
<entry><filename class="headerfile">decimal/decimal</filename></entry>
@@ -461,11 +463,12 @@ compiler supports scalar decimal floating-point types defined via
Also included are files for the C++ ABI interface:
</para>
-<table frame='all'>
+<table frame="all">
<title>C++ ABI Headers</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<tbody>
<row><entry><filename class="headerfile">cxxabi.h</filename></entry><entry><filename class="headerfile">cxxabi_forced.h</filename></entry></row>
</tbody>
@@ -476,14 +479,15 @@ compiler supports scalar decimal floating-point types defined via
And a large variety of extensions.
</para>
-<table frame='all'>
+<table frame="all">
<title>Extension Headers</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
@@ -536,16 +540,17 @@ compiler supports scalar decimal floating-point types defined via
</tgroup>
</table>
-<para></para>
+<para/>
-<table frame='all'>
+<table frame="all">
<title>Extension Debug Headers</title>
-<tgroup cols='5' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
-<colspec colname='c5'></colspec>
+
+<tgroup cols="5" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
+<colspec colname="c5"/>
<tbody>
<row>
@@ -567,15 +572,16 @@ compiler supports scalar decimal floating-point types defined via
</tgroup>
</table>
-<para></para>
+<para/>
-<table frame='all'>
+<table frame="all">
<title>Extension Profile Headers</title>
-<tgroup cols='4' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
-<colspec colname='c3'></colspec>
-<colspec colname='c4'></colspec>
+
+<tgroup cols="4" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
+<colspec colname="c3"/>
+<colspec colname="c4"/>
<tbody>
<row>
@@ -596,13 +602,14 @@ compiler supports scalar decimal floating-point types defined via
</tgroup>
</table>
-<para></para>
+<para/>
-<table frame='all'>
+<table frame="all">
<title>Extension Parallel Headers</title>
-<tgroup cols='2' align='left' colsep='1' rowsep='1'>
-<colspec colname='c1'></colspec>
-<colspec colname='c2'></colspec>
+
+<tgroup cols="2" align="left" colsep="1" rowsep="1">
+<colspec colname="c1"/>
+<colspec colname="c2"/>
<tbody>
<row>
<entry><filename class="headerfile">parallel/algorithm</filename></entry>
@@ -612,10 +619,10 @@ compiler supports scalar decimal floating-point types defined via
</tgroup>
</table>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.headers.mixing" xreflabel="Mixing Headers">
- <title>Mixing Headers</title>
+ <section xml:id="manual.intro.using.headers.mixing" xreflabel="Mixing Headers"><info><title>Mixing Headers</title></info>
+
<para> A few simple rules.
</para>
@@ -655,10 +662,10 @@ same translation unit:
<para> Several parts of C++0x diverge quite substantially from TR1 predecessors.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.headers.cheaders" xreflabel="C Headers and">
- <title>The C Headers and <code>namespace std</code></title>
+ <section xml:id="manual.intro.using.headers.cheaders" xreflabel="C Headers and"><info><title>The C Headers and <code>namespace std</code></title></info>
+
<para>
The standard specifies that if one includes the C-style header
@@ -682,10 +689,10 @@ used uniformly, instead of a combination
of <code>std::sinf</code>, <code>std::sin</code>,
and <code>std::sinl</code>.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.headers.pre" xreflabel="Precompiled Headers">
- <title>Precompiled Headers</title>
+ <section xml:id="manual.intro.using.headers.pre" xreflabel="Precompiled Headers"><info><title>Precompiled Headers</title></info>
+
<para>There are three base header files that are provided. They can be
@@ -754,18 +761,18 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
</programlisting>
<para>The exclamation point to the left of the <code>stdc++.h.gch</code> listing means that the generated PCH file was used, and thus the </para>
-<para></para>
+<para/>
-<para> Detailed information about creating precompiled header files can be found in the GCC <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html">documentation</ulink>.
+<para> Detailed information about creating precompiled header files can be found in the GCC <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html">documentation</link>.
</para>
- </sect2>
- </sect1>
+ </section>
+ </section>
- <sect1 id="manual.intro.using.macros" xreflabel="Macros">
+ <section xml:id="manual.intro.using.macros" xreflabel="Macros"><info><title>Macros</title></info>
<?dbhtml filename="using_macros.html"?>
- <title>Macros</title>
+
<para>
All library macros begin with <code>_GLIBCXX_</code>.
@@ -863,8 +870,7 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
<code>--enable-concept-checks</code>. When defined, performs
compile-time checking on certain template instantiations to
detect violations of the requirements of the standard. This
- is described in more detail <link
- linkend="manual.ext.compile_checks">here</link>.
+ is described in more detail <link linkend="manual.ext.compile_checks">here</link>.
</para>
</listitem></varlistentry>
@@ -901,14 +907,14 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
</listitem></varlistentry>
</variablelist>
- </sect1>
+ </section>
- <sect1 id="manual.intro.using.namespaces" xreflabel="Namespaces">
+ <section xml:id="manual.intro.using.namespaces" xreflabel="Namespaces"><info><title>Namespaces</title></info>
<?dbhtml filename="using_namespaces.html"?>
- <title>Namespaces</title>
+
- <sect2 id="manual.intro.using.namespaces.all" xreflabel="Available Namespaces">
- <title>Available Namespaces</title>
+ <section xml:id="manual.intro.using.namespaces.all" xreflabel="Available Namespaces"><info><title>Available Namespaces</title></info>
+
@@ -937,14 +943,14 @@ and <code>__gnu_pbds</code>.
</para></listitem>
</itemizedlist>
-<para> A complete list of implementation namespaces (including namespace contents) is available in the generated source <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html">documentation</ulink>.
+<para> A complete list of implementation namespaces (including namespace contents) is available in the generated source <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html">documentation</link>.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.namespaces.std" xreflabel="namespace std">
- <title>namespace std</title>
+ <section xml:id="manual.intro.using.namespaces.std" xreflabel="namespace std"><info><title>namespace std</title></info>
+
<para>
@@ -967,10 +973,10 @@ cases where the qualified verbiage becomes unwieldy.)
</listitem>
</itemizedlist>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.namespaces.comp" xreflabel="Using Namespace Composition">
- <title>Using Namespace Composition</title>
+ <section xml:id="manual.intro.using.namespaces.comp" xreflabel="Using Namespace Composition"><info><title>Using Namespace Composition</title></info>
+
<para>
Best practice in programming suggests sequestering new data or
@@ -1005,22 +1011,22 @@ namespace gtk
<code>std::string</code> does not get imported into
the global namespace. Additionally, a more elaborate arrangement can be made for backwards compatibility and portability, whereby the
<code>using</code>-declarations can wrapped in macros that
- are set based on autoconf-tests to either &quot;&quot; or i.e. <code>using
+ are set based on autoconf-tests to either "" or i.e. <code>using
std::string;</code> (depending on whether the system has
libstdc++ in <code>std::</code> or not). (ideas from
Llewelly and Karl Nelson)
</para>
- </sect2>
- </sect1>
+ </section>
+ </section>
- <sect1 id="manual.intro.using.linkage" xreflabel="Linkage">
+ <section xml:id="manual.intro.using.linkage" xreflabel="Linkage"><info><title>Linking</title></info>
<?dbhtml filename="using_dynamic_or_shared.html"?>
- <title>Linking</title>
+
- <sect2 id="manual.intro.using.linkage.freestanding" xreflabel="Freestanding">
- <title>Almost Nothing</title>
+ <section xml:id="manual.intro.using.linkage.freestanding" xreflabel="Freestanding"><info><title>Almost Nothing</title></info>
+
<para>
Or as close as it gets: freestanding. This is a minimal
configuration, with only partial support for the standard
@@ -1121,10 +1127,10 @@ namespace gtk
identified above is actually used at compile time. Violations
are diagnosed as undefined symbols at link time.
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.linkage.dynamic" xreflabel="Dynamic and Shared">
- <title>Finding Dynamic or Shared Libraries</title>
+ <section xml:id="manual.intro.using.linkage.dynamic" xreflabel="Dynamic and Shared"><info><title>Finding Dynamic or Shared Libraries</title></info>
+
<para>
If the only library built is the static library
@@ -1139,10 +1145,10 @@ namespace gtk
</para>
<para>
A quick read of the relevant part of the GCC
- manual, <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Invoking-G_002b_002b.html#Invoking-G_002b_002b">Compiling
- C++ Programs</ulink>, specifies linking against a C++
+ manual, <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Invoking-G_002b_002b.html#Invoking-G_002b_002b">Compiling
+ C++ Programs</link>, specifies linking against a C++
library. More details from the
- GCC <ulink url="http://gcc.gnu.org/faq.html#rpath">FAQ</ulink>,
+ GCC <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/faq.html#rpath">FAQ</link>,
which states <emphasis>GCC does not, by default, specify a
location so that the dynamic linker can find dynamic libraries at
runtime.</emphasis>
@@ -1177,19 +1183,19 @@ A quick read of the relevant part of the GCC
<listitem>
<para>
GNU ld (default on Linux):
- <literal>-Wl,-rpath,<filename class="directory">destdir</filename>/lib</literal>
+ <literal>-Wl,-rpath,</literal><filename class="directory">destdir/lib</filename>
</para>
</listitem>
<listitem>
<para>
IRIX ld:
- <literal>-Wl,-rpath,<filename class="directory">destdir</filename>/lib</literal>
+ <literal>-Wl,-rpath,</literal><filename class="directory">destdir/lib</filename>
</para>
</listitem>
<listitem>
<para>
Solaris ld:
- <literal>-Wl,-R<filename class="directory">destdir</filename>/lib</literal>
+ <literal>-Wl,-R</literal><filename class="directory">destdir/lib</filename>
</para>
</listitem>
</itemizedlist>
@@ -1225,13 +1231,13 @@ A quick read of the relevant part of the GCC
create your executables, these details are taken care of for
you.
</para>
- </sect2>
- </sect1>
+ </section>
+ </section>
- <sect1 id="manual.intro.using.concurrency" xreflabel="Concurrency">
+ <section xml:id="manual.intro.using.concurrency" xreflabel="Concurrency"><info><title>Concurrency</title></info>
<?dbhtml filename="using_concurrency.html"?>
- <title>Concurrency</title>
+
<para>This section discusses issues surrounding the proper compilation
of multithreaded applications which use the Standard C++
@@ -1239,8 +1245,8 @@ A quick read of the relevant part of the GCC
standard does not address matters of multithreaded applications.
</para>
- <sect2 id="manual.intro.using.concurrency.prereq" xreflabel="Thread Prereq">
- <title>Prerequisites</title>
+ <section xml:id="manual.intro.using.concurrency.prereq" xreflabel="Thread Prereq"><info><title>Prerequisites</title></info>
+
<para>All normal disclaimers aside, multithreaded C++ application are
only supported when libstdc++ and all user code was built with
@@ -1274,14 +1280,14 @@ A quick read of the relevant part of the GCC
in ``gcc -dumpspecs'' (look at lib and cpp entries).
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.concurrency.thread_safety" xreflabel="Thread Safety">
- <title>Thread Safety</title>
+ <section xml:id="manual.intro.using.concurrency.thread_safety" xreflabel="Thread Safety"><info><title>Thread Safety</title></info>
+
<para>
-We currently use the <ulink url="http://www.sgi.com/tech/stl/thread_safety.html">SGI STL</ulink> definition of thread safety.
+We currently use the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/thread_safety.html">SGI STL</link> definition of thread safety.
</para>
@@ -1315,9 +1321,8 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
Requisite command-line flags are used for atomic operations
and threading. Examples of this include <code>-pthread</code>
and <code>-march=native</code>, although specifics vary
- depending on the host environment. See <ulink
- url="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html">Machine
- Dependent Options</ulink>.
+ depending on the host environment. See <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html">Machine
+ Dependent Options</link>.
</para>
</listitem>
<listitem>
@@ -1366,20 +1371,20 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
</para>
- </sect2>
- <sect2 id="manual.intro.using.concurrency.atomics" xreflabel="Atomics">
- <title>Atomics</title>
+ </section>
+ <section xml:id="manual.intro.using.concurrency.atomics" xreflabel="Atomics"><info><title>Atomics</title></info>
+
<para>
</para>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.concurrency.io" xreflabel="IO">
- <title>IO</title>
+ <section xml:id="manual.intro.using.concurrency.io" xreflabel="IO"><info><title>IO</title></info>
+
<para>This gets a bit tricky. Please read carefully, and bear with me.
</para>
- <sect3 id="concurrency.io.structure" xreflabel="Structure">
- <title>Structure</title>
+ <section xml:id="concurrency.io.structure" xreflabel="Structure"><info><title>Structure</title></info>
+
<para>A wrapper
type called <code>__basic_file</code> provides our abstraction layer
for the <code>std::filebuf</code> classes. Nearly all decisions dealing
@@ -1390,18 +1395,18 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
level is akin to providing locking within containers, and is not done
for the same reasons (see the links above).
</para>
- </sect3>
+ </section>
- <sect3 id="concurrency.io.defaults" xreflabel="Defaults">
- <title>Defaults</title>
+ <section xml:id="concurrency.io.defaults" xreflabel="Defaults"><info><title>Defaults</title></info>
+
<para>The __basic_file type is simply a collection of small wrappers around
the C stdio layer (again, see the link under Structure). We do no
locking ourselves, but simply pass through to calls to <code>fopen</code>,
<code>fwrite</code>, and so forth.
</para>
- <para>So, for 3.0, the question of &quot;is multithreading safe for I/O&quot;
- must be answered with, &quot;is your platform's C library threadsafe
- for I/O?&quot; Some are by default, some are not; many offer multiple
+ <para>So, for 3.0, the question of "is multithreading safe for I/O"
+ must be answered with, "is your platform's C library threadsafe
+ for I/O?" Some are by default, some are not; many offer multiple
implementations of the C library with varying tradeoffs of threadsafety
and efficiency. You, the programmer, are always required to take care
with multiple threads.
@@ -1420,10 +1425,10 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
inside an <code>std::ofstream</code>), you need to guard such accesses
like any other critical shared resource.
</para>
- </sect3>
+ </section>
- <sect3 id="concurrency.io.future" xreflabel="Future">
- <title>Future</title>
+ <section xml:id="concurrency.io.future" xreflabel="Future"><info><title>Future</title></info>
+
<para> A
second choice may be available for I/O implementations: libio. This is
disabled by default, and in fact will not currently work due to other
@@ -1434,11 +1439,11 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
type is basically derived from FILE. (The real situation is more
complex than that... it's derived from an internal type used to
implement FILE. See libio/libioP.h to see scary things done with
- vtbls.) The result is that there is no &quot;layer&quot; of C stdio
+ vtbls.) The result is that there is no "layer" of C stdio
to go through; the filebuf makes calls directly into the same
functions used to implement <code>fread</code>, <code>fwrite</code>,
and so forth, using internal data structures. (And when I say
- &quot;makes calls directly,&quot; I mean the function is literally
+ "makes calls directly," I mean the function is literally
replaced by a jump into an internal function. Fast but frightening.
*grin*)
</para>
@@ -1453,20 +1458,20 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
installed. For other platforms, a copy of the libio subsection will
be built and included in libstdc++.
</para>
- </sect3>
+ </section>
- <sect3 id="concurrency.io.alt" xreflabel="Alt">
- <title>Alternatives</title>
+ <section xml:id="concurrency.io.alt" xreflabel="Alt"><info><title>Alternatives</title></info>
+
<para>Don't forget that other cstdio implementations are possible. You could
easily write one to perform your own forms of locking, to solve your
- &quot;interesting&quot; problems.
+ "interesting" problems.
</para>
- </sect3>
+ </section>
- </sect2>
+ </section>
- <sect2 id="manual.intro.using.concurrency.containers" xreflabel="Containers">
- <title>Containers</title>
+ <section xml:id="manual.intro.using.concurrency.containers" xreflabel="Containers"><info><title>Containers</title></info>
+
<para>This section discusses issues surrounding the design of
multithreaded applications which use Standard C++ containers.
@@ -1481,10 +1486,10 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
</para>
<para>Two excellent pages to read when working with the Standard C++
containers and threads are
- <ulink url="http://www.sgi.com/tech/stl/thread_safety.html">SGI's
- http://www.sgi.com/tech/stl/thread_safety.html</ulink> and
- <ulink url="http://www.sgi.com/tech/stl/Allocators.html">SGI's
- http://www.sgi.com/tech/stl/Allocators.html</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/thread_safety.html">SGI's
+ http://www.sgi.com/tech/stl/thread_safety.html</link> and
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/Allocators.html">SGI's
+ http://www.sgi.com/tech/stl/Allocators.html</link>.
</para>
<para><emphasis>However, please ignore all discussions about the user-level
configuration of the lock implementation inside the STL
@@ -1528,17 +1533,15 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
options and capabilities.
</para>
- </sect2>
-</sect1>
+ </section>
+</section>
<!-- Section 0x : Exception policies, expectations, topics -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="using_exceptions.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="using_exceptions.xml">
</xi:include>
<!-- Section 0x : Debug -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="debug.xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="debug.xml">
</xi:include>
</chapter>
diff --git a/libstdc++-v3/doc/xml/manual/using_exceptions.xml b/libstdc++-v3/doc/xml/manual/using_exceptions.xml
index d6f52a572a1..afc38734ae8 100644
--- a/libstdc++-v3/doc/xml/manual/using_exceptions.xml
+++ b/libstdc++-v3/doc/xml/manual/using_exceptions.xml
@@ -1,7 +1,8 @@
-<sect1 id="manual.intro.using.exceptions" xreflabel="Using Exceptions">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual.intro.using.exceptions" xreflabel="Using Exceptions">
<?dbhtml filename="using_exceptions.html"?>
-<sect1info>
+<info><title>Exceptions</title>
<keywordset>
<keyword>
C++
@@ -25,9 +26,7 @@
-fno-exceptions
</keyword>
</keywordset>
-</sect1info>
-
-<title>Exceptions</title>
+</info>
<para>
The C++ language provides language support for stack unwinding
@@ -48,8 +47,8 @@ exception neutrality and exception safety.
</para>
-<sect2 id="intro.using.exception.safety" xreflabel="Exception Safety">
-<title>Exception Safety</title>
+<section xml:id="intro.using.exception.safety" xreflabel="Exception Safety"><info><title>Exception Safety</title></info>
+
<para>
What is exception-safe code?
@@ -121,11 +120,11 @@ exception neutrality and exception safety.
</listitem>
</itemizedlist>
-</sect2>
+</section>
-<sect2 id="intro.using.exception.propagating" xreflabel="Exceptions Neutrality">
-<title>Exception Neutrality</title>
+<section xml:id="intro.using.exception.propagating" xreflabel="Exceptions Neutrality"><info><title>Exception Neutrality</title></info>
+
<para>
Simply put, once thrown an exception object should continue in
flight unless handled explicitly. In practice, this means
@@ -201,10 +200,10 @@ exception neutrality and exception safety.
</listitem>
</itemizedlist>
-</sect2>
+</section>
+
+<section xml:id="intro.using.exception.no" xreflabel="-fno-exceptions"><info><title>Doing without</title></info>
-<sect2 id="intro.using.exception.no" xreflabel="-fno-exceptions">
-<title>Doing without</title>
<para>
C++ is a language that strives to be as efficient as is possible
in delivering features. As such, considerable care is used by both
@@ -217,7 +216,7 @@ exception neutrality and exception safety.
support <literal>try</literal> and <literal>catch</literal> blocks
and thrown objects. (Language support
for <literal>-fno-exceptions</literal> is documented in the GNU
- GCC <ulink url="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options">manual</ulink>.)
+ GCC <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options">manual</link>.)
</para>
<para>Before detailing the library support
@@ -353,13 +352,13 @@ exception neutrality and exception safety.
</para>
-</sect2>
+</section>
-<sect2 id="intro.using.exception.compat">
-<title>Compatibility</title>
+<section xml:id="intro.using.exception.compat"><info><title>Compatibility</title></info>
+
+
+<section xml:id="using.exception.compat.c"><info><title>With <literal>C</literal></title></info>
-<sect3 id="using.exception.compat.c">
-<title>With <literal>C</literal></title>
<para>
C language code that is expecting to interoperate with C++ should be
compiled with <literal>-fexceptions</literal>. This will make
@@ -381,10 +380,10 @@ is called.
with <literal>-fexceptions</literal>.
</para>
-</sect3>
+</section>
+
+<section xml:id="using.exception.compat.posix"><info><title>With <literal>POSIX</literal> thread cancellation</title></info>
-<sect3 id="using.exception.compat.posix">
-<title>With <literal>POSIX</literal> thread cancellation</title>
<para>
GNU systems re-use some of the exception handling mechanisms to
@@ -424,28 +423,27 @@ is called.
<programlisting>
catch(const __cxxabiv1::__forced_unwind&amp;)
{
- this->_M_setstate(ios_base::badbit);
+ this-&gt;_M_setstate(ios_base::badbit);
throw;
}
catch(...)
- { this->_M_setstate(ios_base::badbit); }
+ { this-&gt;_M_setstate(ios_base::badbit); }
</programlisting>
-</sect3>
-</sect2>
+</section>
+</section>
+
+<bibliography xml:id="using.exceptions.biblio"><info><title>Bibliography</title></info>
-<bibliography id="using.exceptions.biblio">
-<title>Bibliography</title>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.opengroup.org/austin">
- <citetitle>
- System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </citetitle>
- </ulink>
- </biblioid>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.opengroup.org/austin" class="uri">
+ </biblioid>
+ <citetitle>
+ System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </citetitle>
+
<pagenums>
2.9.5 Thread Cancellation
</pagenums>
@@ -459,17 +457,13 @@ is called.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.boost.org/community/error_handling.html">
- <citetitle>
- Error and Exception Handling
- </citetitle>
- </ulink>
- </biblioid>
- <author>
- <firstname>David</firstname>
- <surname>Abrahams </surname>
- </author>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.boost.org/community/error_handling.html" class="uri">
+ </biblioid>
+ <citetitle>
+ Error and Exception Handling
+ </citetitle>
+
+ <author><personname><firstname>David</firstname><surname>Abrahams </surname></personname></author>
<publisher>
<publishername>
Boost
@@ -479,17 +473,13 @@ is called.
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.boost.org/community/exception_safety.html">
- <citetitle>
- Exception-Safety in Generic Components
- </citetitle>
- </ulink>
- </biblioid>
- <author>
- <firstname>David</firstname>
- <surname>Abrahams</surname>
- </author>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.boost.org/community/exception_safety.html" class="uri">
+ </biblioid>
+ <citetitle>
+ Exception-Safety in Generic Components
+ </citetitle>
+
+ <author><personname><firstname>David</firstname><surname>Abrahams</surname></personname></author>
<publisher>
<publishername>
Boost
@@ -498,17 +488,12 @@ is called.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf">
- <citetitle>
- Standard Library Exception Policy
- </citetitle>
- </ulink>
- </biblioid>
- <author>
- <firstname>Matt</firstname>
- <surname>Austern</surname>
- </author>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf" class="uri">
+ </biblioid>
+ <citetitle>
+ Standard Library Exception Policy
+ </citetitle>
+ <author><personname><firstname>Matt</firstname><surname>Austern</surname></personname></author>
<publisher>
<publishername>
WG21 N1077
@@ -517,17 +502,13 @@ is called.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html">
- <citetitle>
- ia64 c++ abi exception handling
- </citetitle>
- </ulink>
- </biblioid>
- <author>
- <firstname>Richard</firstname>
- <surname>Henderson</surname>
- </author>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html" class="uri">
+ </biblioid>
+ <citetitle>
+ ia64 c++ abi exception handling
+ </citetitle>
+
+ <author><personname><firstname>Richard</firstname><surname>Henderson</surname></personname></author>
<publisher>
<publishername>
GNU
@@ -536,42 +517,32 @@ is called.
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://www.research.att.com/~bs/3rd_safe.pdf">
- <citetitle>
- Appendix E: Standard-Library Exception Safety
- </citetitle>
- </ulink>
- </biblioid>
- <author>
- <firstname>Bjarne</firstname>
- <surname>Stroustrup</surname>
- </author>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.research.att.com/~bs/3rd_safe.pdf" class="uri">
+ </biblioid>
+ <citetitle>
+ Appendix E: Standard-Library Exception Safety
+ </citetitle>
+ <author><personname><firstname>Bjarne</firstname><surname>Stroustrup</surname></personname></author>
</biblioentry>
<biblioentry>
- <title>
+ <citetitle>
Exceptional C++
- </title>
+ </citetitle>
<pagenums>
Exception-Safety Issues and Techniques
</pagenums>
- <author>
- <firstname>Herb</firstname>
- <surname>Sutter</surname>
- </author>
+ <author><personname><firstname>Herb</firstname><surname>Sutter</surname></personname></author>
</biblioentry>
<biblioentry>
- <biblioid class="uri">
- <ulink url="http://gcc.gnu.org/PR25191">
- <citetitle>
- GCC Bug 25191: exception_defines.h #defines try/catch
- </citetitle>
- </ulink>
+ <biblioid xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/PR25191" class="uri">
</biblioid>
+ <citetitle>
+ GCC Bug 25191: exception_defines.h #defines try/catch
+ </citetitle>
</biblioentry>
</bibliography>
-</sect1>
+</section>
diff --git a/libstdc++-v3/doc/xml/manual/utilities.xml b/libstdc++-v3/doc/xml/manual/utilities.xml
index ef118f5ccc4..5c3a8fd4864 100644
--- a/libstdc++-v3/doc/xml/manual/utilities.xml
+++ b/libstdc++-v3/doc/xml/manual/utilities.xml
@@ -1,12 +1,11 @@
-<?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[ ]>
-
-<chapter id="std.util" xreflabel="Utilities">
+<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="std.util" xreflabel="Utilities">
<?dbhtml filename="utilities.html"?>
-<chapterinfo>
+<info><title>
+ Utilities
+ <indexterm><primary>Utilities</primary></indexterm>
+</title>
<keywordset>
<keyword>
ISO C++
@@ -15,30 +14,27 @@
library
</keyword>
</keywordset>
-</chapterinfo>
+</info>
+
-<title>
- Utilities
- <indexterm><primary>Utilities</primary></indexterm>
-</title>
<!-- Section 01 : Functors -->
-<section id="std.util.functors" xreflabel="Functors">
+<section xml:id="std.util.functors" xreflabel="Functors"><info><title>Functors</title></info>
<?dbhtml filename="functors.html"?>
- <title>Functors</title>
+
<para>If you don't know what functors are, you're not alone. Many people
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
concept written by SGI as chapter of their STL, in
- <ulink url="http://www.sgi.com/tech/stl/functors.html">their
- http://www.sgi.com/tech/stl/functors.html</ulink>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/functors.html">their
+ http://www.sgi.com/tech/stl/functors.html</link>.
</para>
</section>
<!-- Section 02 : Pairs -->
-<section id="std.util.pairs" xreflabel="Pairs">
+<section xml:id="std.util.pairs" xreflabel="Pairs"><info><title>Pairs</title></info>
<?dbhtml filename="pairs.html"?>
- <title>Pairs</title>
+
<para>The <code>pair&lt;T1,T2&gt;</code> is a simple and handy way to
carry around a pair of objects. One is of type T1, and another of
type T2; they may be the same type, but you don't get anything
@@ -92,9 +88,9 @@
</section>
<!-- Section 03 : Memory -->
-<section id="std.util.memory" xreflabel="Memory">
+<section xml:id="std.util.memory" xreflabel="Memory"><info><title>Memory</title></info>
<?dbhtml filename="memory.html"?>
- <title>Memory</title>
+
<para>
Memory contains three general areas. First, function and operator
calls via <function>new</function> and <function>delete</function>
@@ -104,26 +100,23 @@
</para>
<!-- Section 01 : allocator -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="allocator.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="allocator.xml">
</xi:include>
<!-- Section 02 : auto_ptr -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="auto_ptr.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="auto_ptr.xml">
</xi:include>
<!-- Section 03 : shared_ptr -->
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="shared_ptr.xml">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml" href="shared_ptr.xml">
</xi:include>
</section>
<!-- Section 04 : Traits -->
-<section id="std.util.traits" xreflabel="Traits">
+<section xml:id="std.util.traits" xreflabel="Traits"><info><title>Traits</title></info>
<?dbhtml filename="traits.html"?>
- <title>Traits</title>
+
<para>
</para>
</section>
diff --git a/libstdc++-v3/doc/xml/spine.xml b/libstdc++-v3/doc/xml/spine.xml
index 27d0d8ab3c4..726966bc78c 100644
--- a/libstdc++-v3/doc/xml/spine.xml
+++ b/libstdc++-v3/doc/xml/spine.xml
@@ -1,15 +1,9 @@
-<?xml version='1.0'?>
-<!DOCTYPE set PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
-[
-<!ENTITY authors SYSTEM "authors.xml">
-]>
-
-<set id="set-index" xreflabel="The GNU C++ Library Documentation">
+<set xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="set-index"
+ xreflabel="The GNU C++ Library Documentation">
<?dbhtml filename="spine.html"?>
-<title>The GNU C++ Library Documentation</title>
-<setinfo>
+<info>
<copyright>
<year>2000</year>
<year>2001</year>
@@ -23,26 +17,144 @@
<year>2009</year>
<year>2010</year>
<holder>
- <ulink url="http://www.fsf.org">FSF</ulink>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">FSF</link>
</holder>
</copyright>
- &authors;
-</setinfo>
+
+<authorgroup version="5.0">
+
+<!--
+ <author>
+ <firstname>Benjamin</firstname>
+ <surname>Kosnik</surname>
+
+ <affiliation>
+ <shortaffil>Red Hat</shortaffil>
+ <orgname>Red Hat, Inc.</orgname>
+ <address>
+ <email>libstdc++@gcc.gnu.org</email>
+ </address>
+ </affiliation>
+
+ <authorblurb>
+ <para>
+ </para>
+ </authorblurb>
+ </author>
+-->
+
+ <author><personname><firstname/><surname/></personname><personblurb>
+ <para>
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Paolo</firstname><surname>Carlini</surname></personname><personblurb>
+ <para>
+ TR1, LWG Active, Closed, Defects lists.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Phil</firstname><surname>Edwards</surname></personname><personblurb>
+ <para>
+ Originating author, started HOWTO and FAQ, worked on sections
+ Demangling, Macros, Strings, Iterators, Backwards
+ Compatibility, SGI Extensions, Configure, Build, Install.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Doug</firstname><surname>Gregor</surname></personname><personblurb>
+ <para>
+ Debug Mode, TR1 function objects
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Benjamin</firstname><surname>Kosnik</surname></personname><personblurb>
+ <para>
+ Allocators, ABI, API evolution and deprecation history,
+ Backwards Compatibility, Thread, Debug Support, Locales,
+ Facets, Parallel Mode, Headers, Namespaces, Construction and
+ Structure, Using Exceptions, DocBook conversion and layout.
+ </para>
+ </personblurb></author>
+
+
+ <author><personname><firstname>Dhruv</firstname><surname>Matani</surname></personname><personblurb>
+ <para>
+ bitmap_allocator
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Jason</firstname><surname>Merrill</surname></personname><personblurb>
+ <para>
+ License, __verbose_terminate_handler
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Mark</firstname><surname>Mitchell</surname></personname><personblurb>
+ <para>
+ Porting
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Nathan</firstname><surname>Myers</surname></personname><personblurb>
+ <para>
+ Referenced counted string, C++1998 implementation status.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Felix</firstname><surname>Natter</surname></personname><personblurb>
+ <para>
+ Namespace composition, Backwards Compatibility.
+ </para>
+ </personblurb></author>
+
+
+ <author><personname><firstname>Stefan</firstname><surname>Olsson</surname></personname><personblurb>
+ <para>
+ mt_allocator
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname><personblurb>
+ <para>
+ Profile mode
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb>
+ <para>
+ Parallel mode
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Ami</firstname><surname>Tavory</surname></personname><personblurb>
+ <para>
+ Policy Based Data Structures, Associative Containers, Unordered
+ Containers.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Jonathan</firstname><surname>Wakely</surname></personname><personblurb>
+ <para>
+ shared_ptr, markup editing and styling
+ </para>
+ </personblurb></author>
+
+</authorgroup>
+
+</info>
<!-- User Manual -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="manual/spine.xml" parse="xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="manual/spine.xml" parse="xml">
</xi:include>
<!-- Source Level Documentation-->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="api.xml" parse="xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="api.xml" parse="xml">
</xi:include>
<!-- FAQ -->
-<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="faq.xml" parse="xml">
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="faq.xml" parse="xml">
</xi:include>
</set>
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 631561c585e..430f85a252a 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -56,6 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -101,6 +102,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h
index 645d8830fd8..cbd7f6fe20e 100644
--- a/libstdc++-v3/include/bits/algorithmfwd.h
+++ b/libstdc++-v3/include/bits/algorithmfwd.h
@@ -134,22 +134,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
/**
- * @defgroup mutating_algorithms Mutating Algorithms
+ * @defgroup mutating_algorithms Mutating
* @ingroup algorithms
*/
/**
- * @defgroup non_mutating_algorithms Non-Mutating Algorithms
+ * @defgroup non_mutating_algorithms Non-Mutating
* @ingroup algorithms
*/
/**
- * @defgroup sorting_algorithms Sorting Algorithms
+ * @defgroup sorting_algorithms Sorting
* @ingroup algorithms
*/
/**
- * @defgroup set_algorithms Set Operation Algorithms
+ * @defgroup set_algorithms Set Operation
* @ingroup sorting_algorithms
*
* These algorithms are common set operations performed on sequences
@@ -158,7 +158,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
/**
- * @defgroup binary_search_algorithms Binary Search Algorithms
+ * @defgroup binary_search_algorithms Binary Search
* @ingroup sorting_algorithms
*
* These algorithms are variations of a classic binary search, and
diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h
index 98755dc7e57..09b9c85b07f 100644
--- a/libstdc++-v3/include/bits/move.h
+++ b/libstdc++-v3/include/bits/move.h
@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
move(_Tp&& __t)
{ return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
- /// declval, defined in <type_traits>.
+ /// declval, from type_traits.
/**
* @brief Returns the actual address of the object or function
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index cc950f03ae2..aa21a10ca55 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -1614,7 +1614,7 @@ namespace std
*/
/**
- * @addtogroup random_distributions_uniform Uniform Distributions
+ * @addtogroup random_distributions_uniform Uniform
* @ingroup random_distributions
* @{
*/
@@ -1972,7 +1972,7 @@ namespace std
/* @} */ // group random_distributions_uniform
/**
- * @addtogroup random_distributions_normal Normal Distributions
+ * @addtogroup random_distributions_normal Normal
* @ingroup random_distributions
* @{
*/
@@ -3226,7 +3226,7 @@ namespace std
/* @} */ // group random_distributions_normal
/**
- * @addtogroup random_distributions_bernoulli Bernoulli Distributions
+ * @addtogroup random_distributions_bernoulli Bernoulli
* @ingroup random_distributions
* @{
*/
@@ -3957,7 +3957,7 @@ namespace std
/* @} */ // group random_distributions_bernoulli
/**
- * @addtogroup random_distributions_poisson Poisson Distributions
+ * @addtogroup random_distributions_poisson Poisson
* @ingroup random_distributions
* @{
*/
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index f035fd4ade4..bbec88cb7ff 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file bits/regex
+ * @file bits/regex.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h
index 0bc362dc77e..b15807aa762 100644
--- a/libstdc++-v3/include/bits/regex_compiler.h
+++ b/libstdc++-v3/include/bits/regex_compiler.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file bits/regex_parser.h
+ * @file bits/regex_compiler.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h
index 787b88b8cd4..ae462b3234f 100644
--- a/libstdc++-v3/include/bits/regex_constants.h
+++ b/libstdc++-v3/include/bits/regex_constants.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file bits/regex_constants
+ * @file bits/regex_constants.h
* @brief Constant definitions for the std regex library.
*
* This is an internal header file, included by other library headers.
diff --git a/libstdc++-v3/include/bits/regex_error.h b/libstdc++-v3/include/bits/regex_error.h
index 56bfae4cc66..283eabfd9fb 100644
--- a/libstdc++-v3/include/bits/regex_error.h
+++ b/libstdc++-v3/include/bits/regex_error.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file bits/regex_error
+ * @file bits/regex_error.h
* @brief Error and exception objects for the std regex library.
*
* This is an internal header file, included by other library headers.
diff --git a/libstdc++-v3/include/bits/regex_grep_matcher.h b/libstdc++-v3/include/bits/regex_grep_matcher.h
index f243c92406b..33890e4257c 100644
--- a/libstdc++-v3/include/bits/regex_grep_matcher.h
+++ b/libstdc++-v3/include/bits/regex_grep_matcher.h
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file bits/regex_executor.h
+ * @file bits/regex_grep_matcher.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
diff --git a/libstdc++-v3/include/bits/regex_grep_matcher.tcc b/libstdc++-v3/include/bits/regex_grep_matcher.tcc
index 17d1e6449dc..6964592ab1d 100644
--- a/libstdc++-v3/include/bits/regex_grep_matcher.tcc
+++ b/libstdc++-v3/include/bits/regex_grep_matcher.tcc
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file regex_grep_matcher.cc
+ * @file bits/regex_grep_matcher.tcc
*/
#include <regex>
diff --git a/libstdc++-v3/include/bits/regex_nfa.tcc b/libstdc++-v3/include/bits/regex_nfa.tcc
index 38ab7e0b2ae..2a1a4d07679 100644
--- a/libstdc++-v3/include/bits/regex_nfa.tcc
+++ b/libstdc++-v3/include/bits/regex_nfa.tcc
@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>.
/**
- * @file regex_nfa.cc
+ * @file bits/regex_nfa.tcc
*/
#include <regex>
diff --git a/libstdc++-v3/include/bits/stl_heap.h b/libstdc++-v3/include/bits/stl_heap.h
index 9348fe9702f..b52fa7a91e0 100644
--- a/libstdc++-v3/include/bits/stl_heap.h
+++ b/libstdc++-v3/include/bits/stl_heap.h
@@ -62,7 +62,7 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
/**
- * @defgroup heap_algorithms Heap Algorithms
+ * @defgroup heap_algorithms Heap
* @ingroup sorting_algorithms
*/
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 42a462e53a5..f4d0b267759 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -307,21 +307,27 @@ namespace std
{ };
template<typename _From, typename _To,
- bool = (is_void<_From>::value || is_void<_To>::value
- || is_function<_To>::value || is_array<_To>::value)>
+ bool = (is_void<_From>::value || is_function<_To>::value
+ || is_array<_To>::value)>
struct __is_convertible_helper
- { static const bool __value = (is_void<_From>::value
- && is_void<_To>::value); };
+ { static const bool __value = is_void<_To>::value; };
template<typename _From, typename _To>
class __is_convertible_helper<_From, _To, false>
: public __sfinae_types
{
- static __one __test(_To);
- static __two __test(...);
+ template<typename _To1>
+ static void __test_aux(_To1);
+
+ template<typename _From1, typename _To1>
+ static decltype(__test_aux<_To1>(std::declval<_From1>()), __one())
+ __test(int);
+
+ template<typename, typename>
+ static __two __test(...);
public:
- static const bool __value = sizeof(__test(declval<_From>())) == 1;
+ static const bool __value = sizeof(__test<_From, _To>(0)) == 1;
};
/// is_convertible
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 171a35a647c..7c00b672608 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -56,6 +56,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -158,6 +159,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
index 6033caf1705..e62ea7c38be 100644
--- a/libstdc++-v3/libsupc++/unwind-cxx.h
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of GCC.
@@ -148,8 +148,10 @@ struct __cxa_eh_globals
// either of the following functions. The "fast" version assumes at least
// one prior call of __cxa_get_globals has been made from the current
// thread, so no initialization is necessary.
-extern "C" __cxa_eh_globals *__cxa_get_globals () throw() __attribute__ ((__const__));
-extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw() __attribute__ ((__const__));
+extern "C" __cxa_eh_globals *__cxa_get_globals () throw()
+ __attribute__ ((__const__));
+extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw()
+ __attribute__ ((__const__));
// Allocate memory for the primary exception plus the thrown object.
extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw();
@@ -169,13 +171,14 @@ __cxa_free_dependent_exception(__cxa_dependent_exception *ex) throw();
extern "C" void __cxa_throw (void *thrown_exception,
std::type_info *tinfo,
void (*dest) (void *))
- __attribute__((noreturn));
+ __attribute__((__noreturn__));
// Used to implement exception handlers.
-extern "C" void *__cxa_get_exception_ptr (void *) throw() __attribute__ ((__pure__));
+extern "C" void *__cxa_get_exception_ptr (void *) throw()
+ __attribute__ ((__pure__));
extern "C" void *__cxa_begin_catch (void *) throw();
extern "C" void __cxa_end_catch ();
-extern "C" void __cxa_rethrow () __attribute__((noreturn));
+extern "C" void __cxa_rethrow () __attribute__((__noreturn__));
// These facilitate code generation for recurring situations.
extern "C" void __cxa_bad_cast () __attribute__((__noreturn__));
@@ -186,8 +189,9 @@ extern "C" void __cxa_bad_typeid () __attribute__((__noreturn__));
// Handles re-checking the exception specification if unexpectedHandler
// throws, and if bad_exception needs to be thrown. Called from the
// compiler.
-extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
-extern "C" void __cxa_call_terminate (_Unwind_Exception*) throw () __attribute__((noreturn));
+extern "C" void __cxa_call_unexpected (void *) __attribute__((__noreturn__));
+extern "C" void __cxa_call_terminate (_Unwind_Exception*) throw ()
+ __attribute__((__noreturn__));
#ifdef __ARM_EABI_UNWINDER__
// Arm EABI specified routines.
@@ -196,16 +200,19 @@ typedef enum {
ctm_succeeded = 1,
ctm_succeeded_with_ptr_to_base = 2
} __cxa_type_match_result;
-extern "C" bool __cxa_type_match(_Unwind_Exception*, const std::type_info*,
- bool, void**);
-extern "C" void __cxa_begin_cleanup (_Unwind_Exception*);
+extern "C" __cxa_type_match_result __cxa_type_match(_Unwind_Exception*,
+ const std::type_info*,
+ bool, void**);
+extern "C" bool __cxa_begin_cleanup (_Unwind_Exception*);
extern "C" void __cxa_end_cleanup (void);
#endif
// Invokes given handler, dying appropriately if the user handler was
// so inconsiderate as to return.
-extern void __terminate(std::terminate_handler) throw () __attribute__((__noreturn__));
-extern void __unexpected(std::unexpected_handler) __attribute__((noreturn));
+extern void __terminate(std::terminate_handler) throw ()
+ __attribute__((__noreturn__));
+extern void __unexpected(std::unexpected_handler)
+ __attribute__((__noreturn__));
// The current installed user handlers.
extern std::terminate_handler __terminate_handler;
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index ffffed2d518..d70589472d3 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -99,6 +100,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
index 35ee1e910c6..d42eccac31e 100644
--- a/libstdc++-v3/python/Makefile.in
+++ b/libstdc++-v3/python/Makefile.in
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -123,6 +124,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 0533deaf158..fe278d6dfd7 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#import gdb
+import gdb
import itertools
import re
@@ -77,8 +77,7 @@ class StdListPrinter:
elif self.typename == "std::__debug::list":
nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
else:
- #raise ValueError, "Cannot cast list node for list printer."
- raise "Cannot cast list node for list printer."
+ raise ValueError, "Cannot cast list node for list printer."
return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
def to_string(self):
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 1cf9030d332..5499bd2f0ed 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -45,14 +45,38 @@ libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \
fi; \
fi
+CLEANFILES = libstdc++-symbols.ver
+
if ENABLE_SYMVERS_GNU
+if ENABLE_SYMVERS_SOL2
+version_arg = -Wl,--version-script,libstdc++-symbols.ver-sol2
+version_dep = libstdc++-symbols.ver-sol2
+libstdc++-symbols.ver-sol2 : libstdc++-symbols.ver
+ sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
+ > $@ || (rm -f $@ ; exit 1)
+else
version_arg = -Wl,--version-script=libstdc++-symbols.ver
version_dep = libstdc++-symbols.ver
endif
+endif
if ENABLE_SYMVERS_GNU_NAMESPACE
version_arg = -Wl,--version-script=libstdc++-symbols.ver
version_dep = libstdc++-symbols.ver
endif
+if ENABLE_SYMVERS_SUN
+version_arg = -Wl,-M,libstdc++-symbols.ver-sun
+version_dep = libstdc++-symbols.ver-sun
+libstdc++-symbols.ver-sun : libstdc++-symbols.ver \
+ $(toplevel_srcdir)/contrib/make_sunver.pl \
+ $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
+ CXXFILT="$(CXXFILT)"; export CXXFILT; \
+ perl $(toplevel_srcdir)/contrib/make_sunver.pl \
+ libstdc++-symbols.ver \
+ $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
+ `echo $(libstdc___la_LIBADD) | \
+ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
if ENABLE_SYMVERS_DARWIN
version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist
version_dep = libstdc++-symbols.explist
@@ -66,6 +90,8 @@ libstdc++-symbols.explist : libstdc++-symbols.ver \
sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
> $@ || (rm -f $@ ; exit 1)
endif
+
+CLEANFILES += $(version_dep)
else
version_arg =
version_dep =
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index f46d7a68fa4..75a97bd9901 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -55,6 +55,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -157,6 +158,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
@@ -321,14 +323,19 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# Cross compiler support.
toolexeclib_LTLIBRARIES = libstdc++.la
+@ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep)
@ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist
@ENABLE_SYMVERS_FALSE@version_arg =
@ENABLE_SYMVERS_GNU_NAMESPACE_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,--version-script=libstdc++-symbols.ver
-@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,--version-script=libstdc++-symbols.ver
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_FALSE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,--version-script=libstdc++-symbols.ver
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,--version-script,libstdc++-symbols.ver-sol2
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,-M,libstdc++-symbols.ver-sun
@ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@version_dep = libstdc++-symbols.explist
@ENABLE_SYMVERS_FALSE@version_dep =
@ENABLE_SYMVERS_GNU_NAMESPACE_TRUE@@ENABLE_SYMVERS_TRUE@version_dep = libstdc++-symbols.ver
-@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_TRUE@version_dep = libstdc++-symbols.ver
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_FALSE@@ENABLE_SYMVERS_TRUE@version_dep = libstdc++-symbols.ver
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_TRUE@@ENABLE_SYMVERS_TRUE@version_dep = libstdc++-symbols.ver-sol2
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@version_dep = libstdc++-symbols.ver-sun
# Source files linked in via configuration/make substitution for a
# particular host.
@@ -649,6 +656,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -760,6 +768,19 @@ uninstall-am: uninstall-toolexeclibLTLIBRARIES
@ENABLE_SYMVERS_TRUE@ rm tmp.top tmp.bottom; \
@ENABLE_SYMVERS_TRUE@ fi; \
@ENABLE_SYMVERS_TRUE@ fi
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_TRUE@@ENABLE_SYMVERS_TRUE@libstdc++-symbols.ver-sol2 : libstdc++-symbols.ver
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_TRUE@@ENABLE_SYMVERS_TRUE@ sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
+@ENABLE_SYMVERS_GNU_TRUE@@ENABLE_SYMVERS_SOL2_TRUE@@ENABLE_SYMVERS_TRUE@ > $@ || (rm -f $@ ; exit 1)
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@libstdc++-symbols.ver-sun : libstdc++-symbols.ver \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ $(toplevel_srcdir)/contrib/make_sunver.pl \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ CXXFILT="$(CXXFILT)"; export CXXFILT; \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ perl $(toplevel_srcdir)/contrib/make_sunver.pl \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ libstdc++-symbols.ver \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ `echo $(libstdc___la_LIBADD) | \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ > $@ || (rm -f $@ ; exit 1)
@ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@libstdc++-symbols.explist : libstdc++-symbols.ver \
@ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@ ${glibcxx_srcdir}/scripts/make_exports.pl \
@ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@ $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
diff --git a/libstdc++-v3/src/atomic.cc b/libstdc++-v3/src/atomic.cc
index 7ec08c5d7c0..906b0884e2c 100644
--- a/libstdc++-v3/src/atomic.cc
+++ b/libstdc++-v3/src/atomic.cc
@@ -1,6 +1,6 @@
// Support for atomic operations -*- C++ -*-
-// Copyright (C) 2008, 2009
+// Copyright (C) 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -127,7 +127,8 @@ namespace std
// _GLIBCXX_*_SYMVER macros in this file.
#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
- && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+ && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
+ && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
#define _GLIBCXX_ASM_SYMVER(cur, old, version) \
asm (".symver " #cur "," #old "@@" #version);
diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc
index ccbeaa1b2ba..7dcd95cb171 100644
--- a/libstdc++-v3/src/compatibility.cc
+++ b/libstdc++-v3/src/compatibility.cc
@@ -26,7 +26,8 @@
#include <bits/c++config.h>
#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
- && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+ && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)\
+ && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
#define istreambuf_iterator istreambuf_iteratorXX
#define basic_fstream basic_fstreamXX
#define basic_ifstream basic_ifstreamXX
@@ -201,7 +202,8 @@ _GLIBCXX_END_NAMESPACE
// NB: These symbols renames should go into the shared library only,
// and only those shared libraries that support versioning.
#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
- && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+ && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
+ && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
/* gcc-3.4.4
_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
index 115c3236839..f0c65468909 100644
--- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
@@ -19,7 +19,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-error "static assertion failed" "" { target *-*-* } 676 }
+// { dg-error "static assertion failed" "" { target *-*-* } 682 }
#include <utility>
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index 8953dac16d4..8a09c65d84b 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -48,5 +48,5 @@ void test01()
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 639 }
-// { dg-error "declaration of" "" { target *-*-* } 603 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 645 }
+// { dg-error "declaration of" "" { target *-*-* } 609 }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index e06005dca6c..ba684144fc7 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -48,5 +48,5 @@ void test01()
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 562 }
-// { dg-error "declaration of" "" { target *-*-* } 526 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 568 }
+// { dg-error "declaration of" "" { target *-*-* } 532 }
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
index f13f51d2e1b..43d0ed39557 100644
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -69,8 +69,10 @@ site.exp: Makefile
extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
+baseline_subdir := $(shell $(CXX) --print-multi-dir)
+
baseline_symbols:
- -@(output=${baseline_dir}/baseline_symbols.txt; \
+ -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
if test ! -f $${output}; then \
echo "Baseline file doesn't exist."; \
echo "Try 'make new-abi-baseline' to create it."; \
@@ -78,8 +80,8 @@ baseline_symbols:
fi; true)
new-abi-baseline:
- -@$(mkinstalldirs) ${baseline_dir}
- -@(output=${baseline_dir}/baseline_symbols.txt; \
+ -@$(mkinstalldirs) ${baseline_dir}${baseline_subdir}
+ -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
if test -f $${output}; then \
output=$${output}.new; \
t=`echo $${output} | sed 's=.*config/abi/=='`; \
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index 8eb34e97d84..ef177f6ebdb 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/gc++filt.m4 \
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
@@ -99,6 +100,7 @@ CTIME_CC = @CTIME_CC@
CTIME_H = @CTIME_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXFILT = @CXXFILT@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
@@ -272,6 +274,7 @@ lists_of_files = \
testsuite_files_performance
extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
+baseline_subdir := $(shell $(CXX) --print-multi-dir)
check_DEJAGNU_normal_targets = $(patsubst %,check-DEJAGNUnormal%,0 1 2 3)
# Runs the testsuite, but in compile only mode.
@@ -495,7 +498,7 @@ site.exp: Makefile
@mv site.tmp site.exp
baseline_symbols:
- -@(output=${baseline_dir}/baseline_symbols.txt; \
+ -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
if test ! -f $${output}; then \
echo "Baseline file doesn't exist."; \
echo "Try 'make new-abi-baseline' to create it."; \
@@ -503,8 +506,8 @@ baseline_symbols:
fi; true)
new-abi-baseline:
- -@$(mkinstalldirs) ${baseline_dir}
- -@(output=${baseline_dir}/baseline_symbols.txt; \
+ -@$(mkinstalldirs) ${baseline_dir}${baseline_subdir}
+ -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
if test -f $${output}; then \
output=$${output}.new; \
t=`echo $${output} | sed 's=.*config/abi/=='`; \
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 82d76634130..e3e965371c4 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,31 @@
+2010-07-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/45042
+ * lto-plugin.c (translate): Cast to unsigned long.
+
+2010-07-23 Andi Kleen <ak@linux.intel.com>
+
+ PR lto/44992
+ * lto-plugin.c (sym_aux): Add.
+ (plugin_symtab): Remove slots. Add aux and id.
+ (parse_table_entry): Change to use aux instead of slots.
+ (LTO_SECTION_PREFIX): Add.
+ (translate): Improve buffer allocation. Change to append
+ symbols to existing out buffer.
+ (get_section): Remove.
+ (process_symtab): Add.
+ (free_2): Free symtab->aux.
+ (write_resolution): Handle aux instead of slots.
+ Print sub id to resolution file.
+ (claim_file_handler): Clear lto_file. Replace get_symtab/translate
+ calls with call to process_symtab.
+
+2010-07-22 Richard Guenther <rguenther@suse.de>
+
+ * Makefile.am: New copy_lto_plugin rule to install the plugin
+ into ../gcc.
+ * Makefile.in: Regenerated.
+
2010-05-21 Richard Guenther <rguenther@suse.de>
* lto-plugin.c (write_resolution): Do not assert syms is non-NULL.
diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
index 665ce190988..da74e1c778c 100644
--- a/lto-plugin/Makefile.am
+++ b/lto-plugin/Makefile.am
@@ -18,3 +18,9 @@ libexecsub_LTLIBRARIES = liblto_plugin.la
liblto_plugin_la_SOURCES = lto-plugin.c
liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
+
+all: copy_lto_plugin
+
+copy_lto_plugin: all-am
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $(libexecsub_LTLIBRARIES) `pwd`/../gcc/
+
diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in
index ead2e7b906d..2f58f9bbe36 100644
--- a/lto-plugin/Makefile.in
+++ b/lto-plugin/Makefile.in
@@ -495,6 +495,11 @@ uninstall-am: uninstall-libexecsubLTLIBRARIES
tags uninstall uninstall-am uninstall-libexecsubLTLIBRARIES
+all: copy_lto_plugin
+
+copy_lto_plugin: all-am
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $(libexecsub_LTLIBRARIES) `pwd`/../gcc/
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index c82f50d97f9..f2ca90ccf74 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -55,11 +55,18 @@ along with this program; see the file COPYING3. If not see
must keep SYMS until all_symbols_read is called to give the linker time to
copy the symbol information. */
+struct sym_aux
+{
+ uint32_t slot;
+ unsigned id;
+};
+
struct plugin_symtab
{
int nsyms;
- uint32_t *slots;
+ struct sym_aux *aux;
struct ld_plugin_symbol *syms;
+ unsigned id;
};
/* All that we have to remember about a file. */
@@ -120,7 +127,8 @@ check (bool gate, enum ld_plugin_level level, const char *text)
Returns the address of the next entry. */
static char *
-parse_table_entry (char *p, struct ld_plugin_symbol *entry, uint32_t *slot)
+parse_table_entry (char *p, struct ld_plugin_symbol *entry,
+ struct sym_aux *aux)
{
unsigned char t;
enum ld_plugin_symbol_kind translate_kind[] =
@@ -170,7 +178,7 @@ parse_table_entry (char *p, struct ld_plugin_symbol *entry, uint32_t *slot)
entry->size = *(uint64_t *) p;
p += 8;
- *slot = *(uint32_t *) p;
+ aux->slot = *(uint32_t *) p;
p += 4;
entry->resolution = LDPR_UNKNOWN;
@@ -178,16 +186,52 @@ parse_table_entry (char *p, struct ld_plugin_symbol *entry, uint32_t *slot)
return p;
}
-/* Return the section in ELF that is named NAME. */
+#define LTO_SECTION_PREFIX ".gnu.lto_.symtab"
+
+/* Translate the IL symbol table SYMTAB. Append the slots and symbols to OUT. */
+
+static void
+translate (Elf_Data *symtab, struct plugin_symtab *out)
+{
+ struct sym_aux *aux;
+ char *data = symtab->d_buf;
+ char *end = data + symtab->d_size;
+ struct ld_plugin_symbol *syms = NULL;
+ int n, len;
+
+ /* This overestimates the output buffer sizes, but at least
+ the algorithm is O(1) now. */
+
+ len = (end - data)/8 + out->nsyms + 1;
+ syms = xrealloc (out->syms, len * sizeof (struct ld_plugin_symbol));
+ aux = xrealloc (out->aux, len * sizeof (struct sym_aux));
+
+ for (n = out->nsyms; data < end; n++)
+ {
+ aux[n].id = out->id;
+ data = parse_table_entry (data, &syms[n], &aux[n]);
+ }
+
+ fprintf (stderr, "n = %d len = %d end-data=%lu\n", n, len,
+ (unsigned long) (end - data));
+ assert(n < len);
+
+ out->nsyms = n;
+ out->syms = syms;
+ out->aux = aux;
+}
+
+/* Process all lto symtabs of file ELF. */
-static Elf_Scn *
-get_section (Elf *elf, const char *name)
+static int
+process_symtab (Elf *elf, struct plugin_symtab *out)
{
+ int found = 0;
Elf_Scn *section = 0;
GElf_Ehdr header;
GElf_Ehdr *t = gelf_getehdr (elf, &header);
if (t == NULL)
- return NULL;
+ return 0;
assert (t == &header);
while ((section = elf_nextscn(elf, section)) != 0)
@@ -198,51 +242,16 @@ get_section (Elf *elf, const char *name)
assert (tshdr == &shdr);
t = elf_strptr (elf, header.e_shstrndx, shdr.sh_name);
assert (t != NULL);
- if (strcmp (t, name) == 0)
- return section;
- }
- return NULL;
-}
-
-/* Returns the IL symbol table of file ELF. */
-
-static Elf_Data *
-get_symtab (Elf *elf)
-{
- Elf_Data *data = 0;
- Elf_Scn *section = get_section (elf, ".gnu.lto_.symtab");
- if (!section)
- return NULL;
-
- data = elf_getdata (section, data);
- assert (data);
- return data;
-}
-
-/* Translate the IL symbol table SYMTAB. Write the slots and symbols in OUT. */
-
-static void
-translate (Elf_Data *symtab, struct plugin_symtab *out)
-{
- uint32_t *slots = NULL;
- char *data = symtab->d_buf;
- char *end = data + symtab->d_size;
- struct ld_plugin_symbol *syms = NULL;
- int n = 0;
-
- while (data < end)
- {
- n++;
- syms = xrealloc (syms, n * sizeof (struct ld_plugin_symbol));
- check (syms, LDPL_FATAL, "could not allocate memory");
- slots = xrealloc (slots, n * sizeof (uint32_t));
- check (slots, LDPL_FATAL, "could not allocate memory");
- data = parse_table_entry (data, &syms[n - 1], &slots[n - 1]);
+ if (strncmp (t, LTO_SECTION_PREFIX, strlen (LTO_SECTION_PREFIX)) == 0)
+ {
+ char *s = strrchr (t, '.');
+ if (s)
+ sscanf (s, ".%x", &out->id);
+ translate (elf_getdata (section, NULL), out);
+ found = 1;
+ }
}
-
- out->nsyms = n;
- out->syms = syms;
- out->slots = slots;
+ return found;
}
/* Free all memory that is no longer needed after writing the symbol
@@ -279,7 +288,7 @@ free_2 (void)
{
struct plugin_file_info *info = &claimed_files[i];
struct plugin_symtab *symtab = &info->symtab;
- free (symtab->slots);
+ free (symtab->aux);
free (info->name);
}
@@ -323,9 +332,10 @@ write_resolution (void)
for (j = 0; j < info->symtab.nsyms; j++)
{
- uint32_t slot = symtab->slots[j];
+ uint32_t slot = symtab->aux[j].slot;
unsigned int resolution = syms[j].resolution;
- fprintf (f, "%d %s %s\n", slot, lto_resolution_str[resolution], syms[j].name);
+ fprintf (f, "%d %x %s %s\n", slot, symtab->aux[j].id,
+ lto_resolution_str[resolution], syms[j].name);
}
}
fclose (f);
@@ -551,7 +561,8 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
enum ld_plugin_status status;
Elf *elf;
struct plugin_file_info lto_file;
- Elf_Data *symtab;
+
+ memset (&lto_file, 0, sizeof (struct plugin_file_info));
if (file->offset != 0)
{
@@ -588,15 +599,9 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
*claimed = 0;
- if (!elf)
+ if (!elf || !process_symtab (elf, &lto_file.symtab))
goto err;
- symtab = get_symtab (elf);
- if (!symtab)
- goto err;
-
- translate (symtab, &lto_file.symtab);
-
status = add_symbols (file->handle, lto_file.symtab.nsyms,
lto_file.symtab.syms);
check (status == LDPS_OK, LDPL_FATAL, "could not add symbols");