summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2013-04-19 06:23:16 -0500
committerAldy Hernandez <aldyh@redhat.com>2013-04-19 06:23:16 -0500
commitcd7cb45fc78ae9a62968372eae37da08444da8ca (patch)
tree034e6313862f8ff73c460181d06785834ef5f25a
parente2d763ab505e4e070c7661d2373c2c9b43f45cb1 (diff)
parent52108848ca6e017bc3ca0efeef67a450d7e32e56 (diff)
downloadgcc-cd7cb45fc78ae9a62968372eae37da08444da8ca.tar.gz
Merge remote-tracking branch 'origin/cilkplus' into cilkplus-simd-rewrite
-rw-r--r--ChangeLog4
-rw-r--r--MAINTAINERS5
-rw-r--r--boehm-gc/include/private/gcconfig.h38
-rw-r--r--gcc/ChangeLog1120
-rw-r--r--gcc/ChangeLog-201278
-rw-r--r--gcc/ChangeLog.cilkplus20
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in14
-rw-r--r--gcc/ada/ChangeLog1374
-rw-r--r--gcc/ada/a-btgbso.adb730
-rw-r--r--gcc/ada/a-cbdlli.adb610
-rw-r--r--gcc/ada/a-cbdlli.ads24
-rw-r--r--gcc/ada/a-cbhama.adb17
-rw-r--r--gcc/ada/a-cbhama.ads17
-rw-r--r--gcc/ada/a-cbhase.adb17
-rw-r--r--gcc/ada/a-cbhase.ads17
-rw-r--r--gcc/ada/a-cborma.adb24
-rw-r--r--gcc/ada/a-cborma.ads25
-rw-r--r--gcc/ada/a-cborse.adb151
-rw-r--r--gcc/ada/a-cborse.ads25
-rw-r--r--gcc/ada/a-cdlili.adb854
-rw-r--r--gcc/ada/a-cdlili.ads22
-rw-r--r--gcc/ada/a-cfdlli.adb496
-rw-r--r--gcc/ada/a-cfdlli.ads90
-rw-r--r--gcc/ada/a-cidlli.adb928
-rw-r--r--gcc/ada/a-cidlli.ads22
-rw-r--r--gcc/ada/a-cihama.adb16
-rw-r--r--gcc/ada/a-cihama.ads16
-rw-r--r--gcc/ada/a-cihase.adb16
-rw-r--r--gcc/ada/a-cihase.ads16
-rw-r--r--gcc/ada/a-ciorma.adb22
-rw-r--r--gcc/ada/a-ciorma.ads22
-rw-r--r--gcc/ada/a-ciormu.adb22
-rw-r--r--gcc/ada/a-ciormu.ads22
-rw-r--r--gcc/ada/a-ciorse.adb152
-rw-r--r--gcc/ada/a-ciorse.ads22
-rw-r--r--gcc/ada/a-cobove.adb397
-rw-r--r--gcc/ada/a-cobove.ads24
-rw-r--r--gcc/ada/a-cohama.adb16
-rw-r--r--gcc/ada/a-cohama.ads16
-rw-r--r--gcc/ada/a-cohase.adb13
-rw-r--r--gcc/ada/a-cohase.ads13
-rw-r--r--gcc/ada/a-coinve.adb623
-rw-r--r--gcc/ada/a-coinve.ads22
-rw-r--r--gcc/ada/a-convec.adb515
-rw-r--r--gcc/ada/a-coorma.adb22
-rw-r--r--gcc/ada/a-coorma.ads22
-rw-r--r--gcc/ada/a-coormu.adb22
-rw-r--r--gcc/ada/a-coormu.ads22
-rw-r--r--gcc/ada/a-coorse.adb153
-rw-r--r--gcc/ada/a-coorse.ads22
-rw-r--r--gcc/ada/a-crbtgk.adb303
-rw-r--r--gcc/ada/a-crbtgo.adb41
-rw-r--r--gcc/ada/a-rbtgbo.adb41
-rw-r--r--gcc/ada/a-rbtgso.adb691
-rw-r--r--gcc/ada/adabkend.adb11
-rw-r--r--gcc/ada/adaint.c75
-rw-r--r--gcc/ada/adaint.h7
-rw-r--r--gcc/ada/ali-util.adb6
-rw-r--r--gcc/ada/ali.adb8
-rw-r--r--gcc/ada/aspects.adb127
-rw-r--r--gcc/ada/aspects.ads55
-rw-r--r--gcc/ada/atree.adb14
-rw-r--r--gcc/ada/atree.ads8
-rw-r--r--gcc/ada/atree.h88
-rw-r--r--gcc/ada/back_end.adb14
-rw-r--r--gcc/ada/back_end.ads32
-rw-r--r--gcc/ada/bcheck.adb6
-rw-r--r--gcc/ada/checks.adb41
-rw-r--r--gcc/ada/cio.c16
-rw-r--r--gcc/ada/clean.adb1
-rw-r--r--gcc/ada/cstand.adb164
-rw-r--r--gcc/ada/ctrl_c.c34
-rw-r--r--gcc/ada/debug.adb40
-rw-r--r--gcc/ada/einfo.adb258
-rw-r--r--gcc/ada/einfo.ads125
-rw-r--r--gcc/ada/elists.adb24
-rw-r--r--gcc/ada/elists.ads6
-rw-r--r--gcc/ada/errout.ads4
-rw-r--r--gcc/ada/exp_aggr.adb199
-rw-r--r--gcc/ada/exp_attr.adb44
-rw-r--r--gcc/ada/exp_cg.adb8
-rw-r--r--gcc/ada/exp_ch11.adb69
-rw-r--r--gcc/ada/exp_ch11.ads4
-rw-r--r--gcc/ada/exp_ch13.adb25
-rw-r--r--gcc/ada/exp_ch2.adb13
-rw-r--r--gcc/ada/exp_ch3.adb237
-rw-r--r--gcc/ada/exp_ch3.ads2
-rw-r--r--gcc/ada/exp_ch4.adb444
-rw-r--r--gcc/ada/exp_ch5.adb2
-rw-r--r--gcc/ada/exp_ch6.adb66
-rw-r--r--gcc/ada/exp_ch9.adb44
-rw-r--r--gcc/ada/exp_disp.adb224
-rw-r--r--gcc/ada/exp_disp.ads12
-rw-r--r--gcc/ada/exp_dist.adb31
-rw-r--r--gcc/ada/exp_dist.ads4
-rw-r--r--gcc/ada/exp_intr.adb16
-rw-r--r--gcc/ada/exp_prag.adb5
-rw-r--r--gcc/ada/exp_util.adb95
-rw-r--r--gcc/ada/exp_util.ads14
-rw-r--r--gcc/ada/expander.adb5
-rw-r--r--gcc/ada/freeze.adb31
-rw-r--r--gcc/ada/g-socket.adb73
-rw-r--r--gcc/ada/g-socket.ads6
-rw-r--r--gcc/ada/g-spipat.ads4
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in1196
-rw-r--r--gcc/ada/gcc-interface/Makefile.in2
-rw-r--r--gcc/ada/gcc-interface/decl.c9
-rw-r--r--gcc/ada/get_targ.adb268
-rw-r--r--gcc/ada/get_targ.ads122
-rw-r--r--gcc/ada/gnat1drv.adb77
-rw-r--r--gcc/ada/gnat_rm.texi230
-rw-r--r--gcc/ada/gnat_ugn.texi1576
-rw-r--r--gcc/ada/gnatbind.adb16
-rw-r--r--gcc/ada/gnatlink.adb48
-rw-r--r--gcc/ada/gnatname.adb10
-rw-r--r--gcc/ada/hostparm.ads7
-rw-r--r--gcc/ada/i-cstrea.ads10
-rw-r--r--gcc/ada/impunit.adb13
-rw-r--r--gcc/ada/init.c143
-rw-r--r--gcc/ada/lib-writ.adb90
-rw-r--r--gcc/ada/lib-writ.ads20
-rw-r--r--gcc/ada/lib-xref.adb35
-rw-r--r--gcc/ada/make.adb70
-rw-r--r--gcc/ada/makeutl.adb116
-rw-r--r--gcc/ada/namet.adb96
-rw-r--r--gcc/ada/namet.ads61
-rw-r--r--gcc/ada/nlists.adb17
-rw-r--r--gcc/ada/nlists.ads10
-rw-r--r--gcc/ada/opt.adb18
-rw-r--r--gcc/ada/opt.ads108
-rw-r--r--gcc/ada/output.adb4
-rw-r--r--gcc/ada/par-ch11.adb36
-rw-r--r--gcc/ada/par-ch2.adb101
-rw-r--r--gcc/ada/par-ch4.adb14
-rw-r--r--gcc/ada/par-ch6.adb11
-rw-r--r--gcc/ada/par-ch7.adb4
-rw-r--r--gcc/ada/par-prag.adb6
-rw-r--r--gcc/ada/par-util.adb5
-rw-r--r--gcc/ada/par.adb3
-rw-r--r--gcc/ada/prj-attr.adb3
-rw-r--r--gcc/ada/prj-env.adb67
-rw-r--r--gcc/ada/prj-makr.adb85
-rw-r--r--gcc/ada/prj-nmsc.adb68
-rw-r--r--gcc/ada/prj.adb11
-rw-r--r--gcc/ada/prj.ads19
-rw-r--r--gcc/ada/projects.texi2230
-rw-r--r--gcc/ada/repinfo.adb120
-rw-r--r--gcc/ada/repinfo.ads7
-rw-r--r--gcc/ada/restrict.adb128
-rw-r--r--gcc/ada/restrict.ads25
-rw-r--r--gcc/ada/rtsfind.adb14
-rw-r--r--gcc/ada/rtsfind.ads40
-rw-r--r--gcc/ada/s-crtl.ads8
-rw-r--r--gcc/ada/s-fileio.adb288
-rw-r--r--gcc/ada/s-os_lib.ads3
-rw-r--r--gcc/ada/s-osprim-mingw.adb33
-rw-r--r--gcc/ada/s-rident.ads166
-rw-r--r--gcc/ada/sem.adb32
-rw-r--r--gcc/ada/sem.ads21
-rw-r--r--gcc/ada/sem_attr.adb171
-rw-r--r--gcc/ada/sem_aux.adb12
-rw-r--r--gcc/ada/sem_case.adb609
-rw-r--r--gcc/ada/sem_ch10.adb23
-rw-r--r--gcc/ada/sem_ch11.adb56
-rw-r--r--gcc/ada/sem_ch11.ads3
-rw-r--r--gcc/ada/sem_ch12.adb21
-rw-r--r--gcc/ada/sem_ch13.adb697
-rw-r--r--gcc/ada/sem_ch3.adb72
-rw-r--r--gcc/ada/sem_ch3.ads8
-rw-r--r--gcc/ada/sem_ch4.adb168
-rw-r--r--gcc/ada/sem_ch5.adb135
-rw-r--r--gcc/ada/sem_ch6.adb665
-rw-r--r--gcc/ada/sem_ch7.adb7
-rw-r--r--gcc/ada/sem_ch8.adb420
-rw-r--r--gcc/ada/sem_disp.adb32
-rw-r--r--gcc/ada/sem_elab.adb15
-rw-r--r--gcc/ada/sem_eval.adb242
-rw-r--r--gcc/ada/sem_eval.ads24
-rw-r--r--gcc/ada/sem_intr.adb73
-rw-r--r--gcc/ada/sem_mech.adb12
-rw-r--r--gcc/ada/sem_prag.adb2377
-rw-r--r--gcc/ada/sem_prag.ads55
-rw-r--r--gcc/ada/sem_res.adb344
-rw-r--r--gcc/ada/sem_type.adb34
-rw-r--r--gcc/ada/sem_util.adb262
-rw-r--r--gcc/ada/sem_util.ads54
-rw-r--r--gcc/ada/sem_warn.adb19
-rwxr-xr-xgcc/ada/set_targ.adb839
-rwxr-xr-xgcc/ada/set_targ.ads141
-rw-r--r--gcc/ada/sinfo.adb66
-rw-r--r--gcc/ada/sinfo.ads173
-rw-r--r--gcc/ada/snames.ads-tmpl14
-rw-r--r--gcc/ada/sprint.adb27
-rw-r--r--gcc/ada/stand.ads23
-rw-r--r--gcc/ada/switch-c.adb177
-rw-r--r--gcc/ada/tbuild.adb7
-rw-r--r--gcc/ada/tree_io.ads5
-rw-r--r--gcc/ada/treepr.adb23
-rw-r--r--gcc/ada/treepr.ads23
-rw-r--r--gcc/ada/ttypes.ads141
-rw-r--r--gcc/ada/types.ads6
-rw-r--r--gcc/ada/ug_words1
-rw-r--r--gcc/ada/urealp.ads6
-rw-r--r--gcc/ada/usage.adb33
-rw-r--r--gcc/ada/xgnatugn.adb413
-rw-r--r--gcc/alias.c16
-rw-r--r--gcc/asan.c3
-rw-r--r--gcc/basic-block.h16
-rw-r--r--gcc/bb-reorder.c4
-rw-r--r--gcc/bt-load.c5
-rw-r--r--gcc/builtins.c6
-rw-r--r--gcc/c-family/ChangeLog14
-rw-r--r--gcc/c-family/c-common.c6
-rw-r--r--gcc/c-family/c-format.c18
-rw-r--r--gcc/c-family/c-pragma.c2
-rw-r--r--gcc/c/ChangeLog8
-rw-r--r--gcc/c/c-array-notation.c277
-rw-r--r--gcc/c/c-parser.c17
-rw-r--r--gcc/cfg.c1
-rw-r--r--gcc/cfgbuild.c6
-rw-r--r--gcc/cfgcleanup.c8
-rw-r--r--gcc/cfgexpand.c2
-rw-r--r--gcc/cfgloopmanip.c35
-rw-r--r--gcc/cfgrtl.c4
-rw-r--r--gcc/cgraph.c6
-rw-r--r--gcc/cgraph.h2
-rw-r--r--gcc/cgraphclones.c2
-rw-r--r--gcc/cif-code.def2
-rw-r--r--gcc/cilk.c1
-rw-r--r--gcc/combine-stack-adj.c3
-rw-r--r--gcc/combine.c8
-rw-r--r--gcc/common.opt35
-rw-r--r--gcc/compare-elim.c3
-rw-r--r--gcc/config.gcc2
-rw-r--r--gcc/config.in15
-rw-r--r--gcc/config/aarch64/aarch64-protos.h1
-rw-r--r--gcc/config/aarch64/aarch64-simd.md34
-rw-r--r--gcc/config/aarch64/aarch64.c42
-rw-r--r--gcc/config/aarch64/aarch64.h2
-rw-r--r--gcc/config/aarch64/aarch64.md38
-rw-r--r--gcc/config/aarch64/constraints.md16
-rw-r--r--gcc/config/aarch64/iterators.md3
-rw-r--r--gcc/config/arm/arm-arches.def2
-rw-r--r--gcc/config/arm/arm-cores.def1
-rw-r--r--gcc/config/arm/arm-protos.h2
-rw-r--r--gcc/config/arm/arm-tables.opt3
-rw-r--r--gcc/config/arm/arm-tune.md2
-rw-r--r--gcc/config/arm/arm.c621
-rw-r--r--gcc/config/arm/arm.h2
-rw-r--r--gcc/config/arm/arm.md805
-rw-r--r--gcc/config/arm/arm_neon_builtins.def210
-rw-r--r--gcc/config/arm/bpabi.h2
-rw-r--r--gcc/config/arm/constraints.md11
-rw-r--r--gcc/config/arm/cortex-a53.md296
-rw-r--r--gcc/config/arm/ldrdstrd.md260
-rw-r--r--gcc/config/arm/neon.md25
-rw-r--r--gcc/config/arm/predicates.md28
-rw-r--r--gcc/config/arm/t-arm5
-rw-r--r--gcc/config/arm/uclinux-elf.h2
-rw-r--r--gcc/config/arm/unspecs.md2
-rw-r--r--gcc/config/arm/vfp.md4
-rw-r--r--gcc/config/epiphany/constraints.md5
-rw-r--r--gcc/config/epiphany/epiphany.c90
-rw-r--r--gcc/config/epiphany/epiphany.h1
-rw-r--r--gcc/config/epiphany/epiphany.md163
-rw-r--r--gcc/config/epiphany/predicates.md2
-rw-r--r--gcc/config/i386/cygming.h3
-rw-r--r--gcc/config/i386/cygwin.h2
-rw-r--r--gcc/config/i386/i386-opts.h5
-rw-r--r--gcc/config/i386/i386-protos.h1
-rw-r--r--gcc/config/i386/i386.c242
-rw-r--r--gcc/config/i386/i386.h10
-rw-r--r--gcc/config/i386/i386.md51
-rw-r--r--gcc/config/i386/i386.opt14
-rw-r--r--gcc/config/i386/winnt.c58
-rw-r--r--gcc/config/pa/pa.c4
-rw-r--r--gcc/config/rs6000/rs6000.c129
-rw-r--r--gcc/config/rs6000/rs6000.h3
-rw-r--r--gcc/config/s390/s390.c3
-rw-r--r--gcc/config/sh/sh.c4
-rw-r--r--gcc/config/sol2.h5
-rw-r--r--gcc/config/sparc/predicates.md5
-rw-r--r--gcc/config/sparc/sparc.c293
-rw-r--r--gcc/config/sparc/sparc.h2
-rw-r--r--gcc/config/sparc/sparc.md301
-rw-r--r--gcc/config/sparc/t-sparc2
-rw-r--r--gcc/config/spu/spu.c13
-rw-r--r--gcc/config/v850/v850.md22
-rwxr-xr-xgcc/configure25
-rw-r--r--gcc/configure.ac17
-rw-r--r--gcc/cp/ChangeLog247
-rw-r--r--gcc/cp/ChangeLog.cilkplus19
-rw-r--r--gcc/cp/call.c113
-rw-r--r--gcc/cp/class.c32
-rw-r--r--gcc/cp/cp-array-notation.c187
-rw-r--r--gcc/cp/cp-cilk.c1
-rwxr-xr-xgcc/cp/cp-pragma-simd.c2
-rw-r--r--gcc/cp/cp-tree.h55
-rw-r--r--gcc/cp/cvt.c12
-rw-r--r--gcc/cp/cxx-pretty-print.h2
-rw-r--r--gcc/cp/decl.c121
-rw-r--r--gcc/cp/decl2.c40
-rw-r--r--gcc/cp/error.c67
-rw-r--r--gcc/cp/friend.c3
-rw-r--r--gcc/cp/init.c1
-rw-r--r--gcc/cp/mangle.c45
-rw-r--r--gcc/cp/parser.c178
-rw-r--r--gcc/cp/pt.c300
-rw-r--r--gcc/cp/rtti.c12
-rw-r--r--gcc/cp/semantics.c26
-rw-r--r--gcc/cp/tree.c98
-rw-r--r--gcc/cp/typeck.c167
-rw-r--r--gcc/cp/typeck2.c31
-rw-r--r--gcc/cprop.c2
-rw-r--r--gcc/cse.c5
-rw-r--r--gcc/dce.c6
-rw-r--r--gcc/df-core.c6
-rw-r--r--gcc/df-scan.c11
-rw-r--r--gcc/diagnostic-color.c307
-rw-r--r--gcc/diagnostic-color.h66
-rw-r--r--gcc/diagnostic-core.h2
-rw-r--r--gcc/diagnostic.c42
-rw-r--r--gcc/diagnostic.def26
-rw-r--r--gcc/doc/invoke.texi85
-rw-r--r--gcc/doc/rtl.texi52
-rw-r--r--gcc/doc/standards.texi9
-rw-r--r--gcc/doc/tm.texi11
-rw-r--r--gcc/doc/tm.texi.in9
-rw-r--r--gcc/dse.c6
-rw-r--r--gcc/dwarf2out.c1
-rw-r--r--gcc/emit-rtl.c45
-rw-r--r--gcc/expmed.c2
-rw-r--r--gcc/final.c5
-rw-r--r--gcc/fold-const.c91
-rw-r--r--gcc/fortran/ChangeLog145
-rw-r--r--gcc/fortran/arith.c15
-rw-r--r--gcc/fortran/array.c355
-rw-r--r--gcc/fortran/check.c3766
-rw-r--r--gcc/fortran/class.c96
-rw-r--r--gcc/fortran/cpp.c6
-rw-r--r--gcc/fortran/cpp.h2
-rw-r--r--gcc/fortran/data.c24
-rw-r--r--gcc/fortran/data.h2
-rw-r--r--gcc/fortran/decl.c683
-rw-r--r--gcc/fortran/dependency.c6
-rw-r--r--gcc/fortran/error.c10
-rw-r--r--gcc/fortran/expr.c663
-rw-r--r--gcc/fortran/f95-lang.c2
-rw-r--r--gcc/fortran/frontend-passes.c13
-rw-r--r--gcc/fortran/gfortran.h255
-rw-r--r--gcc/fortran/gfortran.texi163
-rw-r--r--gcc/fortran/interface.c325
-rw-r--r--gcc/fortran/intrinsic.c175
-rw-r--r--gcc/fortran/intrinsic.h368
-rw-r--r--gcc/fortran/intrinsic.texi49
-rw-r--r--gcc/fortran/io.c317
-rw-r--r--gcc/fortran/iresolve.c5
-rw-r--r--gcc/fortran/match.c196
-rw-r--r--gcc/fortran/match.h8
-rw-r--r--gcc/fortran/module.c26
-rw-r--r--gcc/fortran/openmp.c19
-rw-r--r--gcc/fortran/parse.c69
-rw-r--r--gcc/fortran/parse.h2
-rw-r--r--gcc/fortran/primary.c125
-rw-r--r--gcc/fortran/resolve.c2020
-rw-r--r--gcc/fortran/scanner.c26
-rw-r--r--gcc/fortran/simplify.c37
-rw-r--r--gcc/fortran/symbol.c523
-rw-r--r--gcc/fortran/trans-array.c14
-rw-r--r--gcc/fortran/trans-decl.c34
-rw-r--r--gcc/fortran/trans-expr.c18
-rw-r--r--gcc/fortran/trans-intrinsic.c10
-rw-r--r--gcc/fortran/trans-openmp.c10
-rw-r--r--gcc/fortran/trans-stmt.c18
-rw-r--r--gcc/fortran/trans-types.c6
-rw-r--r--gcc/fortran/trans.h1
-rw-r--r--gcc/function.c5
-rw-r--r--gcc/gcc.c5
-rw-r--r--gcc/gcov-dump.c44
-rw-r--r--gcc/gcov-io.c107
-rw-r--r--gcc/gcov-io.h22
-rw-r--r--gcc/gcse.c4
-rw-r--r--gcc/gdbinit.in2
-rw-r--r--gcc/gimple-pretty-print.c1
-rw-r--r--gcc/gimple-ssa-strength-reduction.c12
-rw-r--r--gcc/gimple-streamer-in.c4
-rw-r--r--gcc/gimple.c13
-rw-r--r--gcc/gimplify.c7
-rw-r--r--gcc/haifa-sched.c2
-rw-r--r--gcc/hwint.c32
-rw-r--r--gcc/hwint.h72
-rw-r--r--gcc/ifcvt.c10
-rw-r--r--gcc/ipa-cp.c21
-rw-r--r--gcc/ipa-inline-analysis.c12
-rw-r--r--gcc/ipa-inline.c4
-rw-r--r--gcc/ipa.c69
-rw-r--r--gcc/ira-costs.c7
-rw-r--r--gcc/ira.c4
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/expr.c2
-rw-r--r--gcc/java/gcj.texi9
-rw-r--r--gcc/langhooks.c8
-rw-r--r--gcc/loop-init.c2
-rw-r--r--gcc/loop-unswitch.c2
-rw-r--r--gcc/lower-subreg.c2
-rw-r--r--gcc/lra-spills.c2
-rw-r--r--gcc/lto-cgraph.c31
-rw-r--r--gcc/lto-streamer-in.c4
-rw-r--r--gcc/modulo-sched.c3
-rw-r--r--gcc/omp-low.c70
-rw-r--r--gcc/opts.c18
-rw-r--r--gcc/params.def6
-rw-r--r--gcc/passes.c15
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/de.po708
-rw-r--r--gcc/postreload-gcse.c2
-rw-r--r--gcc/predict.c17
-rw-r--r--gcc/pretty-print.c46
-rw-r--r--gcc/pretty-print.h6
-rw-r--r--gcc/profile.c109
-rw-r--r--gcc/profile.h2
-rw-r--r--gcc/ree.c6
-rw-r--r--gcc/reg-notes.def5
-rw-r--r--gcc/reg-stack.c3
-rw-r--r--gcc/regmove.c3
-rw-r--r--gcc/reorg.c150
-rw-r--r--gcc/resource.c5
-rw-r--r--gcc/rtl.def55
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/sched-deps.c6
-rw-r--r--gcc/sched-int.h4
-rw-r--r--gcc/sched-rgn.c8
-rw-r--r--gcc/sched-vis.c31
-rw-r--r--gcc/sel-sched-ir.c27
-rw-r--r--gcc/sese.c41
-rw-r--r--gcc/sese.h11
-rw-r--r--gcc/simplify-rtx.c94
-rw-r--r--gcc/stmt.c4
-rw-r--r--gcc/stor-layout.c26
-rw-r--r--gcc/store-motion.c2
-rw-r--r--gcc/target.def10
-rw-r--r--gcc/target.h1
-rw-r--r--gcc/targhooks.c9
-rw-r--r--gcc/targhooks.h1
-rw-r--r--gcc/testsuite/ChangeLog495
-rw-r--r--gcc/testsuite/ChangeLog-201260
-rw-r--r--gcc/testsuite/ada/acats/ada95.lst31
-rwxr-xr-xgcc/testsuite/ada/acats/run_all.sh6
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr56883.c57
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle62.C11
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle62a.C11
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/cilkplus_AN_cpp_errors.exp25
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/fp_triplet_values.cc4
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/parser_errors.cc4
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit.cc4
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit2.cc4
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec.cc22
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.cc25
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_reduce_max_min_ind.cc4
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/tst_lngth.cc39
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/multiple_insert_check.cc17
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc26
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.cc28
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/cilk_keywords_test/compile/c++-cilk-for.cc12
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/cilkplus_PS_cpp_compile.exp24
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/tst1.cc52
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/cilkplus_PS_cpp_errors.exp24
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/for_body_errors.cc6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype-call3.C132
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum25.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum26.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist68.C20
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto2.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/range-for24.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual-mangle1.C37
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual-multi-neg.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual1.C30
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual2.C75
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual3.C29
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual4.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual5.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual6.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual7.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual8.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae44.C26
-rw-r--r--gcc/testsuite/g++.dg/debug/pr56294.C1
-rw-r--r--gcc/testsuite/g++.dg/debug/pr56819.C27
-rw-r--r--gcc/testsuite/g++.dg/ext/pr56790-1.C16
-rw-r--r--gcc/testsuite/g++.dg/gomp/for-19.C4
-rw-r--r--gcc/testsuite/g++.dg/opt/vt2.C24
-rw-r--r--gcc/testsuite/g++.dg/opt/vt3.C43
-rw-r--r--gcc/testsuite/g++.dg/opt/vt4.C31
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid10.C36
-rw-r--r--gcc/testsuite/g++.dg/template/abstract-dr337.C4
-rw-r--r--gcc/testsuite/g++.dg/template/arrow3.C38
-rw-r--r--gcc/testsuite/g++.dg/template/arrow4.C19
-rw-r--r--gcc/testsuite/g++.dg/template/non-deducible1.C8
-rw-r--r--gcc/testsuite/g++.dg/template/nontype25.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr56768.C41
-rw-r--r--gcc/testsuite/g++.dg/torture/pr56817.C38
-rw-r--r--gcc/testsuite/g++.dg/torture/pr56837.C20
-rw-r--r--gcc/testsuite/g++.dg/torture/pr56854.C24
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C2
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr56812.cc21
-rw-r--r--gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/mangle1.C1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr56745.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr19449.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr56799.c43
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr56837.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr56899.c47
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr56962.c30
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c27
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/tst_lngth.c19
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.c18
-rw-r--r--gcc/testsuite/gcc.dg/fold-cstvecshift.c13
-rw-r--r--gcc/testsuite/gcc.dg/pr48186.c5
-rw-r--r--gcc/testsuite/gcc.dg/pr55702.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr56809.c32
-rw-r--r--gcc/testsuite/gcc.dg/pr56837.c67
-rw-r--r--gcc/testsuite/gcc.dg/pr56890-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr56890-2.c19
-rw-r--r--gcc/testsuite/gcc.dg/stack-usage-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55964-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr56407.c48
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr56501.c27
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr56778.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c43
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-11.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c1
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/sra-13.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp87.c82
-rw-r--r--gcc/testsuite/gcc.dg/vect/O3-pr36098.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-31.c12
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr56826.c41
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr56918.c31
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr56920.c21
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr56933.c40
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-39.c25
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-123.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c25
-rw-r--r--gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c25
-rw-r--r--gcc/testsuite/gcc.target/aarch64/negs.c108
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c16
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-d.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-f.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-d.c3
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-f.c3
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-d.c3
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-f.c3
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect-fcm.x14
-rw-r--r--gcc/testsuite/gcc.target/arm/anddi3-opt.c11
-rw-r--r--gcc/testsuite/gcc.target/arm/anddi3-opt2.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/minmax_minus.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/negdi-1.c17
-rw-r--r--gcc/testsuite/gcc.target/arm/negdi-2.c16
-rw-r--r--gcc/testsuite/gcc.target/arm/negdi-3.c17
-rw-r--r--gcc/testsuite/gcc.target/arm/negdi-4.c16
-rw-r--r--gcc/testsuite/gcc.target/arm/peep-ldrd-1.c11
-rw-r--r--gcc/testsuite/gcc.target/arm/peep-strd-1.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb1-far-jump-1.c34
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb1-far-jump-2.c57
-rw-r--r--gcc/testsuite/gcc.target/arm/vect-rounding-btruncf.c18
-rw-r--r--gcc/testsuite/gcc.target/arm/vect-rounding-ceilf.c18
-rw-r--r--gcc/testsuite/gcc.target/arm/vect-rounding-floorf.c18
-rw-r--r--gcc/testsuite/gcc.target/arm/vect-rounding-roundf.c18
-rw-r--r--gcc/testsuite/gcc.target/epiphany/fnma-1.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-vpblendd128-1.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/merge-1.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/pr56903.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-1.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-3.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-4.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/recip-5.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/sd-pwr6.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/sd-vsx.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/setcc-4.c44
-rw-r--r--gcc/testsuite/gcc.target/sparc/setcc-5.c42
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_5.f9049
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_7.f902
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_8.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_44.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/assumed_rank_4.f904
-rw-r--r--gcc/testsuite/gfortran.dg/auto_char_len_4.f906
-rw-r--r--gcc/testsuite/gfortran.dg/block_11.f902
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_test_19.f902
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_test_21.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_10.f034
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_11.f034
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_16.f904
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_4.f034
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_14.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_15.f9028
-rw-r--r--gcc/testsuite/gfortran.dg/coarray/alloc_comp_2.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_lib_alloc_3.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/function_types_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/global_references_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/import2.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/import6.f903
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_actual_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/invalid_interface_assignment.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_82.f9033
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_18.f902
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_2.f906
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_9.f902
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_40.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/read_repeat_2.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_5.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_33.f0343
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_28.f0330
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_29.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f2
-rw-r--r--gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f901
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_16.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_17.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_18.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_20.f034
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_7.f902
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_associated.f902
-rw-r--r--gcc/testsuite/gnat.dg/array23.adb10
-rw-r--r--gcc/testsuite/gnat.dg/array23_pkg1.ads13
-rw-r--r--gcc/testsuite/gnat.dg/array23_pkg2.ads11
-rw-r--r--gcc/testsuite/gnat.dg/array23_pkg3.ads5
-rw-r--r--gcc/testsuite/lib/target-supports.exp69
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-13.mm6
-rw-r--r--gcc/tree-cfg.c4
-rw-r--r--gcc/tree-cfgcleanup.c3
-rw-r--r--gcc/tree-complex.c10
-rw-r--r--gcc/tree-eh.c67
-rw-r--r--gcc/tree-emutls.c2
-rw-r--r--gcc/tree-flow-inline.h8
-rw-r--r--gcc/tree-flow.h1
-rw-r--r--gcc/tree-inline.c142
-rw-r--r--gcc/tree-loop-distribution.c79
-rw-r--r--gcc/tree-nested.c4
-rw-r--r--gcc/tree-nrv.c2
-rw-r--r--gcc/tree-optimize.c22
-rw-r--r--gcc/tree-pass.h2
-rw-r--r--gcc/tree-sra.c18
-rw-r--r--gcc/tree-ssa-alias.c46
-rw-r--r--gcc/tree-ssa-ccp.c17
-rw-r--r--gcc/tree-ssa-copy.c5
-rw-r--r--gcc/tree-ssa-dom.c11
-rw-r--r--gcc/tree-ssa-dse.c14
-rw-r--r--gcc/tree-ssa-forwprop.c9
-rw-r--r--gcc/tree-ssa-ifcombine.c3
-rw-r--r--gcc/tree-ssa-live.c16
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c91
-rw-r--r--gcc/tree-ssa-loop-ivopts.c48
-rw-r--r--gcc/tree-ssa-loop-manip.c31
-rw-r--r--gcc/tree-ssa-loop.c15
-rw-r--r--gcc/tree-ssa-math-opts.c18
-rw-r--r--gcc/tree-ssa-phiopt.c6
-rw-r--r--gcc/tree-ssa-phiprop.c3
-rw-r--r--gcc/tree-ssa-pre.c4
-rw-r--r--gcc/tree-ssa-reassoc.c3
-rw-r--r--gcc/tree-ssa-sink.c3
-rw-r--r--gcc/tree-ssa-strlen.c3
-rw-r--r--gcc/tree-switch-conversion.c2
-rw-r--r--gcc/tree-vect-data-refs.c233
-rw-r--r--gcc/tree-vect-loop-manip.c6
-rw-r--r--gcc/tree-vect-loop.c40
-rw-r--r--gcc/tree-vect-slp.c483
-rw-r--r--gcc/tree-vect-stmts.c25
-rw-r--r--gcc/tree-vectorizer.c3
-rw-r--r--gcc/tree-vectorizer.h18
-rw-r--r--gcc/tree-vrp.c42
-rw-r--r--gcc/tree.c59
-rw-r--r--gcc/tree.h16
-rw-r--r--gcc/tsan.c3
-rw-r--r--gcc/value-prof.c12
-rw-r--r--gcc/varpool.c2
-rw-r--r--include/ChangeLog7
-rw-r--r--include/demangle.h6
-rw-r--r--libcpp/ChangeLog6
-rwxr-xr-xlibcpp/configure1
-rw-r--r--libcpp/configure.ac1
-rw-r--r--libgcc/ChangeLog18
-rw-r--r--libgcc/config/arm/bpabi.S8
-rw-r--r--libgcc/config/arm/linux-atomic.c64
-rw-r--r--libgcc/config/t-slibgcc-hpux1
-rw-r--r--libgfortran/ChangeLog29
-rw-r--r--libgfortran/intrinsics/system_clock.c62
-rw-r--r--libgfortran/intrinsics/time_1.h2
-rw-r--r--libgfortran/io/list_read.c29
-rw-r--r--libiberty/ChangeLog17
-rw-r--r--libiberty/cp-demangle.c182
-rw-r--r--libiberty/testsuite/demangle-expected16
-rw-r--r--libitm/ChangeLog9
-rw-r--r--libstdc++-v3/ChangeLog105
-rw-r--r--libstdc++-v3/acinclude.m432
-rw-r--r--libstdc++-v3/config.h.in2
-rw-r--r--libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt16
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver13
-rwxr-xr-xlibstdc++-v3/configure66
-rw-r--r--libstdc++-v3/configure.ac3
-rw-r--r--libstdc++-v3/doc/html/api.html4
-rw-r--r--libstdc++-v3/doc/html/bk02.html2
-rw-r--r--libstdc++-v3/doc/html/bk03.html2
-rw-r--r--libstdc++-v3/doc/html/faq.html4
-rw-r--r--libstdc++-v3/doc/html/index.html8
-rw-r--r--libstdc++-v3/doc/html/manual/abi.html18
-rw-r--r--libstdc++-v3/doc/html/manual/algorithms.html6
-rw-r--r--libstdc++-v3/doc/html/manual/api.html6
-rw-r--r--libstdc++-v3/doc/html/manual/appendix.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_contributing.html33
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_free.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gfdl.html2
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gpl.html6
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_porting.html8
-rw-r--r--libstdc++-v3/doc/html/manual/associative.html2
-rw-r--r--libstdc++-v3/doc/html/manual/atomics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/backwards.html8
-rw-r--r--libstdc++-v3/doc/html/manual/bitmap_allocator.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bitmap_allocator_impl.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bugs.html2
-rw-r--r--libstdc++-v3/doc/html/manual/concept_checking.html2
-rw-r--r--libstdc++-v3/doc/html/manual/concurrency.html6
-rw-r--r--libstdc++-v3/doc/html/manual/configure.html2
-rw-r--r--libstdc++-v3/doc/html/manual/containers.html6
-rw-r--r--libstdc++-v3/doc/html/manual/containers_and_c.html2
-rw-r--r--libstdc++-v3/doc/html/manual/debug.html4
-rw-r--r--libstdc++-v3/doc/html/manual/debug_mode.html4
-rw-r--r--libstdc++-v3/doc/html/manual/debug_mode_design.html4
-rw-r--r--libstdc++-v3/doc/html/manual/debug_mode_semantics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/debug_mode_using.html6
-rw-r--r--libstdc++-v3/doc/html/manual/diagnostics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/documentation_hacking.html15
-rw-r--r--libstdc++-v3/doc/html/manual/dynamic_memory.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_algorithms.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_compile_checks.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_concurrency.html4
-rw-r--r--libstdc++-v3/doc/html/manual/ext_concurrency_impl.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_concurrency_use.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_containers.html4
-rw-r--r--libstdc++-v3/doc/html/manual/ext_demangling.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_io.html4
-rw-r--r--libstdc++-v3/doc/html/manual/ext_iterators.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_numerics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_preface.html4
-rw-r--r--libstdc++-v3/doc/html/manual/ext_sgi.html2
-rw-r--r--libstdc++-v3/doc/html/manual/ext_utilities.html2
-rw-r--r--libstdc++-v3/doc/html/manual/extensions.html6
-rw-r--r--libstdc++-v3/doc/html/manual/facets.html58
-rw-r--r--libstdc++-v3/doc/html/manual/fstreams.html2
-rw-r--r--libstdc++-v3/doc/html/manual/generalized_numeric_operations.html2
-rw-r--r--libstdc++-v3/doc/html/manual/index.html24
-rw-r--r--libstdc++-v3/doc/html/manual/internals.html2
-rw-r--r--libstdc++-v3/doc/html/manual/intro.html6
-rw-r--r--libstdc++-v3/doc/html/manual/io.html6
-rw-r--r--libstdc++-v3/doc/html/manual/io_and_c.html2
-rw-r--r--libstdc++-v3/doc/html/manual/iterators.html6
-rw-r--r--libstdc++-v3/doc/html/manual/license.html2
-rw-r--r--libstdc++-v3/doc/html/manual/localization.html20
-rw-r--r--libstdc++-v3/doc/html/manual/make.html2
-rw-r--r--libstdc++-v3/doc/html/manual/memory.html46
-rw-r--r--libstdc++-v3/doc/html/manual/mt_allocator.html4
-rw-r--r--libstdc++-v3/doc/html/manual/mt_allocator_design.html2
-rw-r--r--libstdc++-v3/doc/html/manual/mt_allocator_ex_multi.html2
-rw-r--r--libstdc++-v3/doc/html/manual/mt_allocator_ex_single.html2
-rw-r--r--libstdc++-v3/doc/html/manual/mt_allocator_impl.html2
-rw-r--r--libstdc++-v3/doc/html/manual/numerics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/numerics_and_c.html2
-rw-r--r--libstdc++-v3/doc/html/manual/pairs.html2
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode.html8
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode_design.html2
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode_semantics.html2
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode_test.html2
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode_using.html4
-rw-r--r--libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html2
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures.html20
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_ack.html5
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_design.html68
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_using.html4
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode.html6
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode_api.html2
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode_cost_model.html2
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode_design.html4
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode_devel.html2
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode_diagnostics.html8
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode_impl.html2
-rw-r--r--libstdc++-v3/doc/html/manual/setup.html4
-rw-r--r--libstdc++-v3/doc/html/manual/source_code_style.html2
-rw-r--r--libstdc++-v3/doc/html/manual/source_design_notes.html2
-rw-r--r--libstdc++-v3/doc/html/manual/source_organization.html2
-rw-r--r--libstdc++-v3/doc/html/manual/status.html12
-rw-r--r--libstdc++-v3/doc/html/manual/std_contents.html8
-rw-r--r--libstdc++-v3/doc/html/manual/streambufs.html2
-rw-r--r--libstdc++-v3/doc/html/manual/strings.html6
-rw-r--r--libstdc++-v3/doc/html/manual/stringstreams.html2
-rw-r--r--libstdc++-v3/doc/html/manual/support.html6
-rw-r--r--libstdc++-v3/doc/html/manual/termination.html2
-rw-r--r--libstdc++-v3/doc/html/manual/test.html4
-rw-r--r--libstdc++-v3/doc/html/manual/traits.html2
-rw-r--r--libstdc++-v3/doc/html/manual/unordered_associative.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using.html6
-rw-r--r--libstdc++-v3/doc/html/manual/using_concurrency.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using_exceptions.html18
-rw-r--r--libstdc++-v3/doc/html/manual/using_headers.html14
-rw-r--r--libstdc++-v3/doc/html/manual/using_macros.html2
-rw-r--r--libstdc++-v3/doc/html/manual/using_namespaces.html2
-rw-r--r--libstdc++-v3/doc/html/manual/utilities.html6
-rw-r--r--libstdc++-v3/doc/xml/manual/appendix_contributing.xml31
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxx2011.xml19
-rw-r--r--libstdc++-v3/include/Makefile.am1
-rw-r--r--libstdc++-v3/include/Makefile.in1
-rw-r--r--libstdc++-v3/include/bits/forward_list.h25
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h11
-rw-r--r--libstdc++-v3/include/debug/array6
-rw-r--r--libstdc++-v3/include/ext/aligned_buffer.h73
-rw-r--r--libstdc++-v3/include/profile/array6
-rw-r--r--libstdc++-v3/include/std/functional32
-rw-r--r--libstdc++-v3/include/std/future17
-rw-r--r--libstdc++-v3/include/std/type_traits127
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am42
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in42
-rw-r--r--libstdc++-v3/libsupc++/eh_ptr.cc4
-rw-r--r--libstdc++-v3/libsupc++/eh_terminate.cc55
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc4
-rw-r--r--libstdc++-v3/libsupc++/exception10
-rw-r--r--libstdc++-v3/libsupc++/new5
-rw-r--r--libstdc++-v3/libsupc++/new_handler.cc36
-rw-r--r--libstdc++-v3/libsupc++/new_op.cc4
-rw-r--r--libstdc++-v3/libsupc++/new_opnt.cc3
-rw-r--r--libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc3
-rw-r--r--libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc2
-rw-r--r--libstdc++-v3/testsuite/18_support/new_handler.cc39
-rw-r--r--libstdc++-v3/testsuite/18_support/terminate_handler.cc40
-rw-r--r--libstdc++-v3/testsuite/18_support/unexpected_handler.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/bind/ref_neg.cc8
-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/20_util/reference_wrapper/typedefs-3.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc1
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_abi.cc3
-rw-r--r--maintainer-scripts/ChangeLog11
-rw-r--r--maintainer-scripts/crontab1
-rwxr-xr-xmaintainer-scripts/update_version_svn2
-rwxr-xr-xmaintainer-scripts/update_web_docs_libstdcxx_svn9
859 files changed, 38348 insertions, 18690 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ddd4fd3ae2..2c74fe5887d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-10 Chung-Ju Wu <jasonwucj@gmail.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
2013-03-30 Matthias Klose <doko@ubuntu.com>
* Makefile.def (target_modules): Don't install libffi.
diff --git a/MAINTAINERS b/MAINTAINERS
index 8fd35c46484..1a79b1d4a4f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -342,7 +342,7 @@ Gabriel Charette gchare@google.com
Chandra Chavva cchavva@redhat.com
Fabien Chêne fabien@gcc.gnu.org
Bin Cheng bin.cheng@arm.com
-Harshit Chopra harshit@google.com
+Harshit Chopra harshit@google.com
William Cohen wcohen@redhat.com
Josh Conner jconner@apple.com
R. Kelley Cook kcook@gcc.gnu.org
@@ -501,7 +501,7 @@ Ira Rosen irar@il.ibm.com
Maciej W. Rozycki macro@linux-mips.org
Silvius Rus rus@google.com
Matthew Sachs msachs@apple.com
-Hariharan Sandanagobalane hariharan.gcc@gmail.com
+Hariharan Sandanagobalane hariharan.gcc@gmail.com
Iain Sandoe iain@codesourcery.com
Duncan Sands baldrick@gcc.gnu.org
William Schmidt wschmidt@linux.vnet.ibm.com
@@ -548,6 +548,7 @@ Edmar Wienskoski edmar@freescale.com
Ollie Wild aaw@google.com
Kevin Williams kevin.williams@inria.fr
Carlo Wood carlo@alinoe.com
+Chung-Ju Wu jasonwucj@gmail.com
Le-Chun Wu lcwu@google.com
Mingjie Xing mingjie.xing@gmail.com
Canqun Yang canqun@nudt.edu.cn
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index 9420c7caf8f..475bb2c191a 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -60,6 +60,13 @@
# endif
/* Determine the machine type: */
+#if defined(__aarch64__)
+# define AARCH64
+# if !defined(LINUX)
+# define NOSYS
+# define mach_type_known
+# endif
+# endif
# if defined(__arm__) || defined(__thumb__)
# define ARM32
# if !defined(LINUX) && !defined(NETBSD)
@@ -239,6 +246,10 @@
# define IA64
# define mach_type_known
# endif
+# if defined(LINUX) && defined(__aarch64__)
+# define AARCH64
+# define mach_type_known
+# endif
# if defined(LINUX) && defined(__arm__)
# define ARM32
# define mach_type_known
@@ -500,6 +511,7 @@
/* running Amdahl UTS4 */
/* S390 ==> 390-like machine */
/* running LINUX */
+ /* AARCH64 ==> ARM AArch64 */
/* ARM32 ==> Intel StrongARM */
/* IA64 ==> Intel IPF */
/* (e.g. Itanium) */
@@ -1833,6 +1845,32 @@
# define HEURISTIC1
# endif
+# ifdef AARCH64
+# define CPP_WORDSZ 64
+# define MACH_TYPE "AARCH64"
+# define ALIGNMENT 8
+# ifndef HBLKSIZE
+# define HBLKSIZE 4096
+# endif
+# ifdef LINUX
+# define OS_TYPE "LINUX"
+# define LINUX_STACKBOTTOM
+# define USE_GENERIC_PUSH_REGS
+# define DYNAMIC_LOADING
+ extern int __data_start[];
+# define DATASTART ((ptr_t)__data_start)
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# endif
+# ifdef NOSYS
+ /* __data_start is usually defined in the target linker script. */
+ extern int __data_start[];
+# define DATASTART ((ptr_t)__data_start)
+ extern void *__stack_base__;
+# define STACKBOTTOM ((ptr_t)__stack_base__)
+# endif
+# endif
+
# ifdef ARM32
# define CPP_WORDSZ 32
# define MACH_TYPE "ARM32"
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7c7db0c3080..58f811efd80 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,1093 @@
+2013-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56962
+ * gimple-ssa-strength-reduction.c (record_increment): Only set
+ initializer if gimple_assign_rhs_code is {,POINTER_}PLUS_EXPR and
+ either rhs1 or rhs2 is equal to c->base_expr.
+
+2013-04-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56933
+ * tree-vectorizer.h (struct _stmt_vec_info): Remove read_write_dep
+ member.
+ (GROUP_READ_WRITE_DEPENDENCE): Remove.
+ (STMT_VINFO_GROUP_READ_WRITE_DEPENDENCE): Likewise.
+ * tree-vect-data-refs.c (vect_analyze_group_access): Move
+ dependence check ...
+ vect_analyze_data_ref_dependence (vect_analyze_data_ref_dependence):
+ ... here.
+ * tree-vect-stmts.c (new_stmt_vec_info): Do not initialize
+ GROUP_READ_WRITE_DEPENDENCE.
+
+2013-04-15 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * emit-rtl.c (reset_all_used_flags): New function.
+ (verify_rtl_sharing): Call reset_all_used_flags before and after
+ performing the checks.
+
+2013-04-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm.c (const_ok_for_dimode_op): Handle AND case.
+ * config/arm/arm.md (*anddi3_insn): Change to insn_and_split.
+ * config/arm/constraints.md (De): New constraint.
+ * config/arm/neon.md (anddi3_neon): Delete.
+ (neon_vand<mode>): Expand to standard anddi3 pattern.
+ * config/arm/predicates.md (imm_for_neon_inv_logic_operand):
+ Move earlier in the file.
+ (neon_inv_logic_op2): Likewise.
+ (arm_anddi_operand_neon): New predicate.
+
+2013-04-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gcc_cv_ld_as_needed): Set
+ gcc_cv_ld_as_needed_option, gcc_cv_no_as_needed_option.
+ Use -z ignore, -z record on *-*-solaris2*.
+ (HAVE_LD_AS_NEEDED): Update comment.
+ (LD_AS_NEEDED_OPTION, LD_NO_AS_NEEDED_OPTION): Define.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * gcc.c (init_gcc_specs) [USE_LD_AS_NEEDED]: Use
+ LD_AS_NEEDED_OPTION, LD_NO_AS_NEEDED_OPTION.
+ * config/sol2.h [HAVE_LD_AS_NEEDED] (USE_LD_AS_NEEDED): Define.
+ * doc/tm.texi.in (USE_LD_AS_NEEDED): Allow for --as-needed
+ equivalents. Fix markup.
+ * doc/tm.texi: Regenerate.
+
+2013-04-15 Andrew Hsieh <andrewhsieh.google.com>
+
+ * config/i386/i386.opt: New option mstack-protector-guard=.
+ * config/i386/i386-opts.h: Add enum stack_protector_guard.
+ * config/i386/i386.h: Define TARGET_SSP_GLOBAL_GUARD and
+ TARGET_SSP_TLS_GUARD.
+ * config/i386/i386.c (ix86_option_override_internal): Set
+ ix86_stack_protector_guard.
+ * config/i386/i386.md (stack_protect_set): Enable for
+ TARGET_SSP_TLS_GUARD only.
+ (stack_protect_set_<mode>): Ditto.
+ (stack_protect_test): Ditto.
+ (stack_protect_test_<mode>): Ditto.
+ * doc/invoke.texi (i386 Option): Document.
+
+2013-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/56890
+ * config/sparc/sparc.c (enum sparc_mode_class): Add H_MODE value.
+ (S_MODES): Set H_MODE bit.
+ (SF_MODES): Set only S_MODE and SF_MODE bits.
+ (DF_MODES): Set SF_MODES and only D_MODE and DF_MODE bits.
+ (sparc_init_modes) <MODE_INT>: Set H_MODE bit for sub-word modes.
+ <MODE_VECTOR_INT>: Do not set SF_MODE for sub-word modes.
+ <MODE_FLOAT>: Likewise.
+
+2013-04-15 Joey Ye <joey.ye@arm.com>
+
+ * config/arm/arm.c (thumb_far_jump_used_p): Fix typo in comments.
+
+2013-04-15 Joey Ye <joey.ye@arm.com>
+
+ * config/arm/arm.c (thumb1_final_prescan_insn): Assert lr save
+ for real far jump.
+ (thumb_far_jump_used_p): Count instruction size and set
+ far_jump_used.
+
+2013-04-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * reorg.c (fill_simple_delay_slots): Reindent block of code.
+ * resource.c (mark_target_live_regs): Reformat conditional block.
+
+2013-04-13 Steven Bosscher <steven@gcc.gnu.org>
+
+ * sched-deps.c (deps_analyze_insn): Do not check for EH_REGION insn
+ notes, they are emitted only just before final.
+ * sched-int.h: Include insn-attr.h before checking INSN_SCHEDULING.
+
+2013-04-13 Steven Bosscher <steven@gcc.gnu.org>
+
+ * emit-rtl.c (remove_insn): Do not call df_insn_delete here.
+ * cfgrtl.c (delete_insn): Call it here instead.
+ * lra-spills.c (lra_final_code_change): Use delete_insn.
+ * haifa-sched.c (sched_remove_insn): Likewise.
+ * sel-sched-ir.c (return_nop_to_pool): Clear INSN_DELETED_P for nops
+ returning to the nop pool.
+ (sel_remove_insn): Simplify the only_disconnect case via remove_insn,
+ use delete_insn for definitive removal. Clear BLOCK_FOR_INSN.
+
+2013-04-12 Steven Bosscher <steven@gcc.gnu.org>
+
+ * doc/tm.texi.in (LOOP_ALIGN): Remove loop note references.
+ * doc/tm.texi: Regenerated.
+
+2013-04-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_hard_regno_mode_ok): Use ANY_QI_REGNO_P in
+ QImode checks.
+
+2013-04-12 Steven Bosscher <steven@gcc.gnu.org>
+
+ * df-core.c (df_find_def): Compare register numbers.
+ (df_find_use): Likewise.
+
+2013-04-12 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR target/56903
+ * config/i386/i386.c (ix86_hard_regno_mode_ok): Add
+ lra_in_progress for return.
+
+2013-04-12 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (mov_scc,mov_negscc,mov_notscc): Convert
+ define_insn into define_insn_and_split and emit movsicc patterns.
+
+2013-04-12 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.c (gen_operands_ldrd_strd): Initialize "base".
+
+2013-04-12 Richard Biener <rguenther@suse.de>
+
+ * tree-pass.h (TODO_do_not_ggc_collect): New.
+ * passes.c (execute_one_ipa_transform_pass): Honor
+ TODO_do_not_ggc_collect.
+ (execute_one_pass): Likewise.
+
+ Revert
+ 2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * passes.c (init_optimization_passes): Remove reload pass.
+ * ira.c (do_reload): Merge into ...
+ (ira): ... this.
+ (rest_of_handle_reload): Remove.
+ (pass_reload): Likewise.
+ * config/i386/i386.c (ix86_option_override): Refer to ira instead
+ of reload for vzeroupper pass placement.
+
+2013-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56918
+ PR tree-optimization/56920
+ * fold-const.c (int_const_binop_1): Use op1.mul_with_sign (op2, ...)
+ instead of op1 - op2. Pass 2 * TYPE_PRECISION (type) as second
+ argument to rshift method. For 2 * HOST_BITS_PER_WIDE_INT precision
+ use wide_mul_with_sign method.
+
+2013-04-12 Richard Biener <rguenther@suse.de>
+
+ * gimple.c (is_gimple_constant): Vector CONSTRUCTORs should
+ not be considered a gimple constant.
+
+2013-04-12 Marc Glisse <marc.glisse@inria.fr>
+
+ * fold-const.c (const_binop): Handle vector shifts by a scalar.
+ (fold_binary_loc): Call const_binop also for mixed vector-scalar
+ operations.
+
+2013-04-12 Manuel López-Ibáñez <manu@gcc.gnu.org>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * opts.c: Include diagnostic-color.h.
+ (common_handle_option): Handle OPT_fdiagnostics_color_.
+ * Makefile.in (OBJS-libcommon): Add diagnostic-color.o.
+ (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h.
+ (diagnostic-color.o): New.
+ * common.opt (fdiagnostics-color, fdiagnostics-color=): New options.
+ (diagnostic_color_rule): New enum.
+ * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*.
+ * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around
+ the location string.
+ * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros,
+ either NULL, or color kind.
+ * diagnostic-color.c: New file.
+ * diagnostic-color.h: New file.
+ * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3
+ arguments.
+ * doc/invoke.texi (-fdiagnostics-color): Document.
+ * pretty-print.h (pp_show_color): Define.
+ (struct pretty_print_info): Add show_color field.
+ * diagnostic.c: Include diagnostic-color.h.
+ (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND
+ macros. Colorize error:, warning: etc. strings and also the location
+ string.
+ (diagnostic_show_locus): Colorize the caret line.
+ * pretty-print.c: Include diagnostic-color.h.
+ (pp_base_format): Handle %r and %R format specifiers. Colorize strings
+ inside of %< %> quotes or quoted through q format modifier.
+
+2013-04-12 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * ifcvt.c (end_ifcvt_sequence): Mark a and b for unsharing as well.
+
+2013-04-11 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
+
+ * config/aarch64/aarch64.c (aarch64_select_cc_mode): Allow NEG
+ code in CC_NZ mode.
+ * config/aarch64/aarch64.md (*neg_<shift><mode>3_compare0): New
+ pattern.
+
+2013-04-11 Marek Polacek <polacek@redhat.com>
+
+ PR tree-optimization/48184
+ * params.def (PARAM_ALIGN_THRESHOLD): Increase the minimum value to 1.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * stor-layout.c (skip_simple_constant_arithmetic): Move to...
+ * tree.c (skip_simple_constant_arithmetic): ...here and make public.
+ (skip_simple_arithmetic): Tidy up.
+ * tree.h (skip_simple_constant_arithmetic): Declare.
+
+2013-04-11 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
+
+ * config/aarch64/aarch64.h (REVERSIBLE_CC_MODE): Define.
+
+2013-04-11 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-loop.c (get_initial_def_for_induction): Properly
+ generate vector constants.
+
+2013-04-11 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56878
+ * tree-flow.h (outermost_invariant_loop_for_expr): Declare.
+ * tree-ssa-loop-ivopts.c (outermost_invariant_loop_for_expr):
+ New function.
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Prefer to align the DR with the most invariant base address.
+
+2013-04-11 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ * opts.c (common_handle_option): Fix formatting and add FALLTHRU
+ comment.
+
+2013-04-11 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * config/aarch64/aarch64-simd.md (aarch64_vcond_internal): Fix
+ floating-point vector comparisons against 0.
+
+2013-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56899
+ * fold-const.c (extract_muldiv_1): Apply distributive law
+ only if TYPE_OVERFLOW_WRAPS (ctype).
+
+2013-04-11 Bin Cheng <bin.cheng@arm.com>
+
+ PR target/56124
+ * ira-costs.c (scan_one_insn): Check whether the source rtx of
+ loading has side effect.
+
+2013-04-10 Steven Bosscher <steven@gcc.gnu.org>
+
+ * config/sparc/sparc.c: Include tree-pass.h.
+ (TARGET_MACHINE_DEPENDENT_REORG): Do not redefine.
+ (sparc_reorg): Rename to sparc_do_work_around_errata. Move to
+ head of file. Change return type. Split off gate function.
+ (sparc_gate_work_around_errata): New function.
+ (pass_work_around_errata): New pass definition.
+ (insert_pass_work_around_errata) New pass insert definition to
+ insert pass_work_around_errata just after delayed-branch scheduling.
+ (sparc_option_override): Insert the pass.
+ * config/sparc/t-sparc (sparc.o): Add TREE_PASS_H dependence.
+
+2013-04-10 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.h (ASM_CPU_SPEC): Pass -Av8 if -mcpu=supersparc
+ or -mcpu=hypersparc.
+
+ * target.def (cstore_mode): New hook.
+ * target.h: Include insn-codes.h
+ * targhooks.c: Likewise.
+ (default_cstore_mode): New function.
+ * targhooks.h: Declare it.
+ * doc/tm.texi.in: New hook slot for TARGET_CSTORE_MODE.
+ * doc/tm.texi: Rebuild.
+ * expmed.c (emit_cstore): Obtain cstore boolean result mode using
+ target hook, rather than inspecting the insn_data.
+ * config/sparc/sparc.c (sparc_cstore_mode): New function.
+ (TARGET_CSTORE_MODE): Redefine.
+ (emit_scc_insn): When TARGET_ARCH64, emit new 64-bit boolean
+ result patterns.
+ * config/sparc/predicates.md (cstore_result_operand): New special
+ predicate.
+ * config/sparc/sparc.md (cstoresi4, cstoredi4, cstore<F:mode>4):
+ Use it for operand 0.
+ (*seqsi_special): Rewrite using 'P' mode iterator on operand 0.
+ (*snesi_special): Likewise.
+ (*snesi_zero): Likewise.
+ (*seqsi_zero): Likewise.
+ (*sltu_insn): Likewise.
+ (*sgeu_insn): Likewise.
+ (*seqdi_special): Make operand 0 and comparison operation be of
+ DImode.
+ (*snedi_special): Likewise.
+ (*snedi_special_vis3): Likewise.
+ (*neg_snesi_zero): Rename to *neg_snesisi_zero.
+ (*neg_snesi_sign_extend): Rename to *neg_snesidi_zero.
+ (*snesi_zero_extend): Delete, covered by 'P' mode iterator.
+ (*neg_seqsi_zero): Rename to *neg_seqsisi_zero.
+ (*neg_seqsi_sign_extend): Rename to *neg_seqsidi_zero.
+ (*seqsi_zero_extend): Delete, covered by 'P' mode iterator.
+ (*sltu_extend_sp64): Likewise.
+ (*neg_sltu_insn): Rename to *neg_sltusi_insn.
+ (*neg_sltu_extend_sp64): Rename to *neg_sltudi_insn.
+ (*sgeu_extend_sp64): Delete, covered by 'P' mode iterator.
+ (*neg_sgeu_insn): Rename to *neg_sgeusi_insn.
+ (*neg_sgeu_extend_sp64): Rename to *neg_sgeudi_insn.
+
+2013-04-10 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * config/aarch64/aarch64.c (aarch64_print_extension): New function.
+ (aarch64_start_file): Use the new function.
+
+2013-04-10 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+ Jason Merrill <jason@redhat.com>
+
+ * common.opt: Add -gdwarf.
+ * opts.c (common_handle_option): Handle it.
+ * gcc.c (ASM_DEBUG_SPEC): Don't expect "-2" for DWARF.
+
+2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * passes.c (execute_todo): Do not call ggc_collect conditional here.
+ (execute_one_ipa_transform_pass): But unconditionally here.
+ (execute_one_pass): And here.
+ (init_optimization_passes): Remove reload pass.
+ * tree-pass.h (TODO_ggc_collect): Remove.
+ (pass_reload): Likewise.
+ * ira.c (do_reload): Merge into ...
+ (ira): ... this.
+ (rest_of_handle_reload): Remove.
+ (pass_reload): Likewise.
+ * config/i386/i386.c (ix86_option_override): Refer to ira instead
+ of reload for vzeroupper pass placement.
+ * <everywhere>: Remove TODO_ggc_collect from todo_flags_start
+ and todo_flags_finish of all passes.
+
+2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * tree-vectorizer.h (struct _slp_oprnd_info): Remove
+ first_const_oprnd field, rename first_def_type to first_op_type.
+ * tree-vect-slp.c (vect_create_oprnd_info): Adjust.
+ (vect_get_and_check_slp_defs): Always use the type of the
+ operand. Allow mixed vect_external_def, vect_constant_def types.
+ (vect_get_constant_vectors): Handle mixed vect_external_def,
+ vect_constant_def types.
+
+2013-04-10 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR tree-optimization/55524
+ * tree-ssa-math-opts.c
+ (convert_mult_to_fma): Don't use an fms construct
+ when we don't have an fms operation, but fnma, and it looks
+ likely that we'll be able to use the latter.
+
+2013-04-10 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+
+ * cif-code.def (OVERWRITABLE): Correct the comment for overwritable
+ function.
+ * ipa-inline.c (can_inline_edge_p): Let dump mechanism report the
+ inline fail caused by overwritable functions.
+
+2013-04-10 Chung-Ju Wu <jasonwucj@gmail.com>
+
+ * combine.c (simplify_compare_const): Use GET_MODE_MASK to filter out
+ unnecessary bits in the constant power of two case.
+
+2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-slp.c (vect_get_and_check_slp_defs): Remove
+ broken code swapping operands.
+ (vect_build_slp_tree): Do not compute load permutations here.
+ (vect_analyze_slp_instance): Compute load permutations here,
+ after building the SLP tree.
+
+2013-04-09 Christian Bruel <christian.bruel@st.com>
+
+ * config/sh/sh.md (barrier_align): Use next/prev_active_insn instead
+ of next/prev_real_insn.
+
+2013-04-09 Jan Hubicka <jh@suse.cz>
+
+ * ipa.c (cgraph_externally_visible_p, varpool_externally_visible_p):
+ Drop aliased parameter.
+ (function_and_variable_visibility): Do not handle alias pairs.
+ * cgraph.c (varpool_externally_visible_p): Update prototype.
+ * varpool.c (varpool_add_new_variable): Update.
+
+2013-04-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm.md (minmax_arithsi_non_canon): New pattern.
+
+2013-04-09 Steven Bosscher <steven@gcc.gnu.org>
+
+ * sched-vis.c (print_pattern): Print SEQUENCE of insns as insns.
+
+ * config/sparc/sparc.md: Use define_c_enum for "unspec" and "unspecv".
+
+2013-04-09 Marek Polacek <polacek@redhat.com>
+
+ PR tree-optimization/48762
+ * params.def (PARAM_MAX_CSE_INSNS): Increase the minimum value to 1.
+
+2013-04-09 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-slp.c (vect_get_and_check_slp_defs): Remove code
+ dealing with cost.
+ (vect_build_slp_tree): Likewise.
+ (vect_analyze_slp_cost_1, vect_analyze_slp_cost): New functions
+ calculating the cost of a SLP instance.
+ (vect_analyze_slp_instance): Use it from here, after building
+ the SLP tree.
+
+2013-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/56883
+ * omp-low.c (expand_omp_for_generic, expand_omp_for_static_nochunk,
+ expand_omp_for_static_chunk): Use simple_p = true in
+ force_gimple_operand_gsi calls when assigning to addressable decls.
+
+2013-04-09 Jeff Law <law@redhat.com>
+
+ * tree-vrp.c (simplify_cond_using_ranges): Simplify test of boolean
+ when the boolean was created by converting a wider object which
+ had a boolean range.
+
+2013-04-09 Richard Biener <rguenther@suse.de>
+
+ * tree-vectorizer.h (slp_void_p): Remove.
+ (slp_tree): Typedef before _slp_tree declaration.
+ (struct _slp_tree): Use a vector of slp_tree as children.
+ (vect_get_place_in_interleaving_chain): Remove.
+ * tree-vect-data-refs.c (vect_get_place_in_interleaving_chain):
+ Move ...
+ * tree-vect-slp.c (vect_get_place_in_interleaving_chain): ... here
+ and make static.
+ (vect_free_slp_tree, vect_print_slp_tree, vect_mark_slp_stmts,
+ vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts,
+ vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations,
+ vect_schedule_slp_instance, vect_remove_slp_scalar_calls):
+ Use slp_node instead of slp_void_p and adjust.
+
+2013-04-09 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Avoid
+ work that is not necessary.
+
+2013-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56854
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Don't
+ forward into clobber stmts if it would change MEM_REF lhs into
+ non-MEM_REF.
+
+2013-04-09 Maxim Kuvyrkov <maxim@kugelworks.com>
+
+ * tree.c (type_hash_lookup, type_hash_add): Make static.
+ * tree.h (type_hash_lookup, type_hash_add): Remove global declarations.
+
+2013-04-09 Richard Biener <rguenther@suse.de>
+
+ * tree.h (unsave_expr_now): Remove.
+ * tree-inline.c (mark_local_for_remap_r): Remove.
+ (unsave_expr_1): Likewise.
+ (unsave_r): Likewise.
+ (unsave_expr_now): Likewise.
+ * tree-ssa-copy.c (replace_exp_1): Use unshare_expr.
+ (propagate_tree_value): Likewise.
+
+2013-04-08 Steven Bosscher <steven@gcc.gnu.org>
+
+ * doc/rtl.texi (sequence): Rewrite documentation to match the
+ current use of SEQUENCE rtl objects.
+ * rtl.def (SEQUENCE): Likewise.
+
+ * doc/rtl.texi (NOTE_INSN_EH_REGION_BEG, NOTE_INSN_EH_REGION_END):
+ Update documentation.
+ (NOTE_INSN_LOOP_BEG, NOTE_INSN_LOOP_END, NOTE_INSN_LOOP_CONT,
+ NOTE_INSN_LOOP_VTOP): Remove documentation for non-existing notes.
+
+ * reg-notes.def (REG_EH_CONTEXT): Remove unused note.
+
+2013-04-08 Teresa Johnson <tejohnson@google.com>
+
+ * basic-block.h (GCOV_COMPUTE_SCALE): Define.
+ * ipa-inline-analysis.c (param_change_prob): Use helper rounding divide
+ methods.
+ (estimate_edge_size_and_time): Add comment to suggest using rounding
+ methods.
+ (estimate_node_size_and_time): Ditto.
+ (remap_edge_change_prob): Use helper rounding divide methods.
+ * value-prof.c (gimple_divmod_fixed_value_transform): Ditto.
+ (gimple_mod_pow2_value_transform): Ditto.
+ (gimple_mod_subtract_transform): Ditto.
+ (gimple_ic_transform): Ditto.
+ (gimple_stringops_transform): Ditto.
+ * stmt.c (conditional_probability): Ditto.
+ (emit_case_dispatch_table): Ditto.
+ * lto-cgraph.c (merge_profile_summaries): Ditto.
+ * tree-optimize.c (execute_fixup_cfg): Ditto.
+ * cfgcleanup.c (try_forward_edges): Ditto.
+ * cfgloopmanip.c (scale_loop_profile): Ditto.
+ (loopify): Ditto.
+ (duplicate_loop_to_header_edge): Ditto.
+ (lv_adjust_loop_entry_edge): Ditto.
+ * tree-vect-loop.c (vect_transform_loop): Ditto.
+ * profile.c (compute_branch_probabilities): Ditto.
+ * cfgbuild.c (compute_outgoing_frequencies): Ditto.
+ * lto-streamer-in.c (input_cfg): Ditto.
+ * gimple-streamer-in.c (input_bb): Ditto.
+ * ipa-cp.c (update_profiling_info): Ditto.
+ (update_specialized_profile): Ditto.
+ * tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Ditto.
+ * cfg.c (update_bb_profile_for_threading): Add comment to suggest using
+ rounding methods.
+ * sched-rgn.c (compute_dom_prob_ps): Ditto.
+ (compute_trg_info): Ditto.
+ * cfgrtl.c (force_nonfallthru_and_redirect): Ditto.
+ (purge_dead_edges): Ditto.
+ * loop-unswitch.c (unswitch_loop): Ditto.
+ * cgraphclones.c (cgraph_clone_edge): Ditto.
+ (cgraph_clone_node): Ditto.
+ * tree-inline.c (copy_bb): Ditto.
+ (copy_edges_for_bb): Ditto.
+ (initialize_cfun): Ditto.
+ (copy_cfg_body): Ditto.
+ (expand_call_inline): Ditto.
+
+2013-04-08 Kai Tietz <ktietz@redhat.com>
+
+ * config/i386/cygwin.h (EXTRA_OS_CPP_BUILTINS): Replaced
+ TARGET_CYGWIN64 by TARGET_64BIT.
+
+2013-04-08 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * config/epiphany/epiphany.md (GPR_1): New constant.
+ (define_expand "mov<mode>cc): FAIL if gen_compare_reg returned 0.
+ * config/epiphany/epiphany.c (gen_compare_reg):
+ For flag_finite_math_only, avoid swapping operands when r0 and/or r1
+ is already in place.
+ Use GPR_0 / GPR_1 instead of 0/1 for r0/r1 register numbers.
+ Don't require being called during rtl expansion; If y operlaps r0,
+ return 0.
+ (epiphany_compute_frame_size, epiphany_expand_prologue): Use GPR_1.
+ (epiphany_expand_epilogue): Likewise.
+
+ * config/epiphany/epiphany.c (epiphany_select_cc_mode):
+ Don't use CC_FPmode for ORDERED / UNORDERED.
+ * config/epiphany/epiphany.md (cmpsf_ord): Make pattern unconditional.
+
+ * config/epiphany/constraints.md (CnL): New constraint.
+ * config/epiphany/epiphany.md (addsi3_i): Add r/r/CnL alternative.
+ * config/epiphany/predicates.md (add_operand): Allow 1024.
+
+ * config/epiphany/epiphany.md (logical_op): New code iterator.
+ (op_mnc): New code attribute.
+ (<op_mnc>_f, mov_f, cstoresi4): New patterns.
+ (mov_f+1, mov_f+2): New peephole2 patterns.
+
+ * config/epiphany/epiphany.md (mov_f+2): New peephole2 pattern.
+ (cstoresi4): Also allow re-use of zero result when doing a NE
+ comparison to a non-zero operand.
+ Use (clobber (scratch)) for first insn if the gpr output is not needed.
+
+ * config/epiphany/epiphany.md (<insn_opname>v2si3):
+ Use gen_addsi3_i / gen_subsi3_i.
+
+2013-04-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/34949
+ PR c++/50243
+ * tree-eh.c (optimize_clobbers): Only remove clobbers if bb doesn't
+ contain anything but clobbers, at most one __builtin_stack_restore,
+ optionally debug stmts and final resx, and if it has at least one
+ incoming EH edge. Don't check for SSA_NAME on LHS of a clobber.
+ (sink_clobbers): Don't check for SSA_NAME on LHS of a clobber.
+ Instead of moving clobbers with MEM_REF LHS with SSA_NAME address
+ which isn't defaut definition, remove them.
+ (unsplit_eh, cleanup_empty_eh): Use single_{pred,succ}_{p,edge}
+ instead of EDGE_COUNT comparisons or EDGE_{PRED,SUCC}.
+ * tree-ssa-ccp.c (execute_fold_all_builtins): Remove clobbers
+ with MEM_REF LHS with SSA_NAME address.
+
+2013-04-08 Jeff Law <law@redhat.com>
+
+ * gimple.c (canonicalize_cond_expr_cond): Rewrite x ^ y into x != y.
+
+2013-04-08 Richard Biener <rguenther@suse.de>
+
+ * gimple-pretty-print.c (debug_gimple_stmt): Do not print
+ extra newline.
+ * tree-vect-loop.c (vect_determine_vectorization_factor): Dump
+ determined vector type.
+ (vect_analyze_data_refs): Likewise.
+ (vect_get_new_vect_var): Adjust.
+ (vect_create_destination_var): Preserve SSA name versions.
+ * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Do
+ not dump anything here.
+
+2013-04-08 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * config/epiphany/epiphany.h (struct GTY (()) machine_function):
+ Add member lr_slot_known.
+ * config/epiphany/epiphany.md (reload_insi_ra): Compute lr_slot_offs
+ if necessary.
+ * config/epiphany/epiphany.c (epiphany_compute_frame_size):
+ Remove code that sets lr_slot_offset according to what a previous
+ version of epiphany_emit_save_restore used to do.
+ (epiphany_emit_save_restore): When doing an lr save or restore,
+ set/verify lr_slot_known and lr_slot_offset.
+
+2013-04-08 Xinyu Qi <xyqi@marvell.com>
+
+ PR target/54338
+ * config/arm/arm.h (REG_CLASS_CONTENTS): Include IWMMXT_GR_REGS
+ in ALL_REGS.
+
+2013-04-08 Richard Biener <rguenther@suse.de>
+
+ * alias.c (find_base_term): Fix thinko in previous change.
+
+2013-04-08 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-loop-distribution.c (const_with_all_bytes_same): New function.
+ (generate_memset_builtin): Only handle integer_all_onesp as -1 val if
+ TYPE_PRECISION is equal to mode bitsize. Use const_with_all_bytes_same
+ if possible to compute val.
+ (classify_partition): Verify CONSTRUCTOR doesn't have any elts.
+ For QImode integers don't require anything about precision. Use
+ const_with_all_bytes_same to find out if the constant doesn't have
+ repeated bytes in it.
+
+2013-04-08 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_expand_insv): Only accept insertions
+ within mode size.
+
+2013-04-08 Marek Polacek <polacek@redhat.com>
+
+ PR rtl-optimization/48182
+ * params.def (PARAM_MIN_CROSSJUMP_INSNS): Increase the minimum
+ value to 1.
+
+2013-04-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/55487
+ * config/pa/pa.c (legitimize_pic_address): Before incrementing label
+ nuses, make sure we have a label.
+
+2013-04-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/56843
+ * config/rs6000/rs6000.c (rs6000_emit_swdiv_high_precision): Remove.
+ (rs6000_emit_swdiv_low_precision): Remove.
+ (rs6000_emit_swdiv): Rewrite to handle between one and four
+ iterations of Newton-Raphson generally; modify required number of
+ iterations for some cases.
+ * config/rs6000/rs6000.h (RS6000_RECIP_HIGH_PRECISION_P): Remove.
+
+2013-04-05 Steven Bosscher <steven@gcc.gnu.org>
+
+ * bb-reorder.c (fix_crossing_unconditional_branches): Remove a
+ set-but-unused variable.
+
+ * cgraph.c (cgraph_release_function_body): Clear cfun->cfg to make
+ basic blocks of released function bodies garbage-collectable.
+
+ * ree.c (find_and_remove_re): Do not call df_finish_pass here.
+ (struct rtl_opt_pass): Add TODO_df_finish.
+
+ * rtl.def (DEFINE_SUBST, DEFINE_SUBST_ATTR): Add documentation.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/constraints.md (q): New constraint.
+ * config/arm/ldrdstrd.md: New file.
+ * config/arm/arm.md (ldrdstrd.md) New include.
+ (arm_movdi): Use "q" instead of "r" constraint
+ for double-word memory access.
+ (movdf_soft_insn): Likewise.
+ * config/arm/vfp.md (movdi_vfp): Likewise.
+ * config/arm/t-arm (MD_INCLUDES): Add ldrdstrd.md.
+ * config/arm/arm-protos.h (gen_operands_ldrd_strd): New declaration.
+ * config/arm/arm.c (gen_operands_ldrd_strd): New function.
+ (mem_ok_for_ldrd_strd): Likewise.
+ (output_move_double): Update assertion.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md: Comment on splitting Thumb1 patterns.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (arm_smax_insn): Convert define_insn into
+ define_insn_and_split.
+ (arm_smin_insn,arm_umaxsi3,arm_uminsi3): Likewise.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (arm_ashldi3_1bit): Convert define_insn into
+ define_insn_and_split.
+ (arm_ashrdi3_1bit,arm_lshrdi3_1bit): Likewise.
+ (shiftsi3_compare): New pattern.
+ (rrx): New pattern.
+ * config/arm/unspecs.md (UNSPEC_RRX): New.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (negdi_extendsidi): New pattern.
+ (negdi_zero_extendsidi): Likewise.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (andsi_iorsi3_notsi): Convert define_insn into
+ define_insn_and_split.
+ (arm_negdi2,arm_abssi2,arm_neg_abssi2): Likewise.
+ (arm_cmpdi_insn,arm_cmpdi_unsigned): Likewise.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (arm_subdi3): Convert define_insn into
+ define_insn_and_split.
+ (subdi_di_zesidi,subdi_di_sesidi): Likewise.
+ (subdi_zesidi_di,subdi_sesidi_di,subdi_zesidi_zesidi): Likewise.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (subsi3_carryin): New pattern.
+ (subsi3_carryin_const): Likewise.
+ (subsi3_carryin_compare,subsi3_carryin_compare_const): Likewise.
+ (subsi3_carryin_shift,rsbsi3_carryin_shift): Likewise.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (incscc,arm_incscc,decscc,arm_decscc): Delete.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * config/arm/arm.md (addsi3_carryin_<optab>): Set attribute predicable.
+ (addsi3_carryin_alt2_<optab>,addsi3_carryin_shift_<optab>): Likewise.
+
+2013-04-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm.c (arm_expand_builtin): Change fcode
+ type to unsigned int.
+
+2013-04-05 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * doc/invoke.texi (ARM Options): Document cortex-a53 support.
+
+2013-04-04 Ian Lance Taylor <iant@google.com>
+
+ * doc/standards.texi (Standards): The Go frontend supports the Go 1
+ language standard.
+
+2013-04-04 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR middle-end/56729
+ * df-scan.c (df_insn_delete): Disable failing assert.
+
+2013-04-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm-protos.h (arm_builtin_vectorized_function):
+ New function prototype.
+ * config/arm/arm.c (TARGET_VECTORIZE_BUILTINS): Define.
+ (TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Likewise.
+ (arm_builtin_vectorized_function): New function.
+
+2013-04-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm_neon_builtins.def: New file.
+ * config/arm/arm.c (neon_builtin_data): Move contents to
+ arm_neon_builtins.def.
+ (enum arm_builtins): Include neon builtin definitions.
+ (ARM_BUILTIN_NEON_BASE): Move from enum to macro.
+ * config/arm/t-arm (arm.o): Add dependency on arm_neon_builtins.def.
+
+2013-04-04 Marek Polacek <polacek@redhat.com>
+
+ PR tree-optimization/48186
+ * predict.c (maybe_hot_frequency_p): Return false if
+ HOT_BB_FREQUENCY_FRACTION is 0.
+ (cgraph_maybe_hot_edge_p): Likewise.
+
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56826
+ * tree-vect-slp.c (vect_build_slp_tree): Compute ncopies
+ more accurately.
+
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56213
+ * tree-vect-data-refs.c (vect_check_strided_load): Remove.
+ (vect_analyze_data_refs): Allow all non-nested loads as strided loads.
+
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56837
+ * tree-loop-distribution.c (classify_partition): For non-zero
+ values require that the value has the same precision as its
+ mode to be useful as memset value.
+
+2013-04-03 Nick Clifton <nickc@redhat.com>
+
+ * config/v850/v850e3v5.md (fmasf4): Use fmaf.s on E3V5 architectures.
+ (fmssf4): Use fmsf.s on E3V5 architectures.
+ (fnmasf4): Use fnmaf.s on E3V5 architectures.
+ (fnmssf4): Use fnmsf.s on E3V5 architectures.
+
+2013-04-03 Jeff Law <law@redhat.com>
+
+ * Makefile.in (lra-constraints.o): Depend on $(OPTABS_H).
+ (lra-eliminations.o): Likewise.
+
+2013-04-03 Teresa Johnson <tejohnson@google.com>
+
+ * gcov-io.c (compute_working_sets): Moved most of body of old
+ compute_working_sets here from profile.c.
+ * gcov-io.h (NUM_GCOV_WORKING_SETS): Moved here from profile.c.
+ (gcov_working_set_t): Moved typedef here from basic-block.h
+ (compute_working_set): Declare.
+ * profile.c (NUM_GCOV_WORKING_SETS): Moved to gcov-io.h.
+ (get_working_sets): Renamed from compute_working_set,
+ replace most of body with call to new compute_working_sets.
+ (get_exec_counts): Replace call to compute_working_sets
+ to get_working_sets.
+ * profile.h (get_working_sets): Renamed from compute_working_set.
+ * lto-cgraph.c (input_symtab): Replace call to compute_working_sets
+ to get_working_sets.
+ * basic-block.h (gcov_working_set_t): Moved to gcov-io.h.
+ * gcov-dump.c (dump_working_sets): New function.
+
+2013-04-03 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * hwint.c (sext_hwi, zext_hwi): New functions.
+ * hwint.h (HOST_BITS_PER_HALF_WIDE_INT, HOST_HALF_WIDE_INT,
+ HOST_HALF_WIDE_INT_PRINT, HOST_HALF_WIDE_INT_PRINT_C,
+ HOST_HALF_WIDE_INT_PRINT_DEC, HOST_HALF_WIDE_INT_PRINT_DEC_C,
+ HOST_HALF_WIDE_INT_PRINT_UNSIGNED, HOST_HALF_WIDE_INT_PRINT_HEX,
+ HOST_HALF_WIDE_INT_PRINT_HEX_PURE): New symbols.
+ (sext_hwi, zext_hwi): New functions.
+
+2013-04-03 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/56799
+ * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Bring
+ back test for widening conversion erroneously dropped in prior change.
+
+2013-04-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/56809
+ * config/aarch64/aarch64.c (is_jump_table): Use next_active_insn
+ instead of next_real_insn.
+
+2013-04-03 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/55702
+ * tsan.c (instrument_func_exit): Allow BUILT_IN_RETURN functions.
+
+2013-04-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/56809
+ * config/arm/arm.c (is_jump_table): Use next_active_insn instead of
+ next_real_insn.
+ (thumb1_output_casesi): Likewise.
+ (thumb2_output_casesi): Likewise.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56817
+ * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely):
+ Split out ...
+ (tree_unroll_loops_completely_1): ... new function to manually
+ walk the loop tree, properly defering outer loops of unrolled
+ loops to later iterations.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ * tree-vect-stmts.c (vectorizable_store): Accept BIT_FIELD_REF.
+ (vectorizable_load): Likewise.
+ * tree-vect-slp.c (vect_build_slp_tree): Likewise.
+ * tree-vect-data-refs.c (vect_create_data_ref_ptr): Handle VECTOR_TYPE.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ * tree-flow-inline.h (get_addr_base_and_unit_offset_1): Handle
+ BIT_FIELD_REF.
+
+2013-04-03 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (emit_nop_for_insn): Handle JUMP_TABLE_DATA.
+
+2013-04-03 Bin Cheng <bin.cheng@arm.com>
+
+ * rtl.h (AUTO_INC_DEC): Fix typo of HAVE_POST_MODIFY_DISP.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/56790
+ * fold-const.c (fold_ternary_loc) <VEC_COND_EXPR>: Add constant
+ folding.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ * simplify-rtx.c (simplify_binary_operation_1) <VEC_SELECT>:
+ Handle VEC_MERGE.
+ (simplify_ternary_operation) <VEC_MERGE>: Use unsigned HOST_WIDE_INT
+ for masks. Test for side effects. Handle nested VEC_MERGE. Handle
+ equal arguments.
+
+2013-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/19449
+ * tree.h (force_folding_builtin_constant_p): New decl.
+ * builtins.c (force_folding_builtin_constant_p): New variable.
+ (fold_builtin_constant_p): Fold immediately also if
+ force_folding_builtin_constant_p.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56812
+ * tree-vect-data-refs.c (vect_slp_analyze_data_ref_dependence):
+ DRs of the same interleaving chain are independent.
+
+2013-04-02 Jason Merrill <jason@redhat.com>
+
+ * gdbinit.in (pbb): Use debug fn.
+
+2013-04-02 Lawrence Crowl <crowl@google.com>
+
+ * sese.h (struct ivtype_map_elt_s): Remove unused.
+ (extern debug_ivtype_map): Remove unused.
+ (extern eq_ivtype_map_elts): Remove unused.
+ * sese.c (debug_ivtype_map): Removed unused.
+ (debug_ivtype_map_1): Removed unused.
+ (debug_ivtype_elt): Remove unused.
+ (eq_ivtype_map_elts): Remove unused.
+
+
+2013-04-02 Kai Tietz <ktietz@redhat.com>
+
+ PR target/52790
+ * config/i386/cygming.h (SUB_TARGET_RECORD_STUB): New sub-target macro.
+ * config/i386/i386-protos.h (i386_pe_record_stub): Add new prototype.
+ * config/i386/i386.c (legitimize_pe_coff_extern_decl): New static
+ function.
+ (legitimize_pe_coff_symbol): Likewise.
+ (is_imported_p): New helper-function.
+ (ix86_option_override_internal): Make MEDIUM_PIC the default code-model
+ for Windows x64 targets.
+ (ix86_expand_prologue): Optimize for pe-coff targets.
+ (ix86_expand_split_stack_prologue): Adjust for pe-coff targets.
+ (legitimate_pic_address_disp_p): Adjust for x64 pe-coff to support
+ medium/large code-model.
+ (legitimize_pic_address): Likewise.
+ (legitimize_tls_address): Likewise.
+ (ix86_expand_call): Likewise.
+ (x86_output_mi_thunk): Likewise.
+ (get_dllimport_decl): Add new beimport argument.
+ (construct_plt_address): Don't assert for x64 pe-coff targets.
+ * config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Adjust for x64 pe-coff
+ targets.
+ (SYMBOL_FLAG_STUBVAR): New macro.
+ (SYMBOL_REF_STUBVAR_P): Likewise.
+ * config/i386/winnt.c (stub_list): New structure.
+ (stub_head): New local variable.
+ (i386_pe_record_stub): New function.
+ (i386_pe_file_end): Emit refptr-stubs.
+
+2013-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/56745
+ * ifcvt.c (cond_exec_find_if_block): Don't try to optimize
+ if then_bb has no successors and else_bb is EXIT_BLOCK_PTR.
+
+ PR c++/34949
+ * tree-ssa-alias.c (stmt_kills_ref_p_1): If base != ref->base
+ and both of them are MEM_REFs, just compare first argument for
+ equality and attempt to deal even with differing offsets.
+
+ PR c++/34949
+ * tree-cfg.c (verify_gimple_assign_single): Allow lhs
+ of gimple_clobber_p to be MEM_REF.
+ * gimplify.c (gimplify_modify_expr): Gimplify *to_p of
+ an assignment from TREE_CLOBBER_P. Allow it to be MEM_REF
+ after gimplification.
+ * asan.c (get_mem_ref_of_assignment): Don't instrument
+ gimple_clobber_p stmts.
+ * tree-ssa-dse.c (dse_optimize_stmt): Allow DSE of
+ gimple_clobber_p stmt if they have MEM_REF lhs and
+ are dead because of another gimple_clobber_p stmt.
+ * tree-ssa-live.c (clear_unused_block_pointer): Treat
+ gimple_clobber_p stmts like debug stmts.
+ (remove_unused_locals): Remove clobbers with MEM_REF lhs
+ that refer to unused VAR_DECLs or uninitialized values.
+ * tree-sra.c (sra_ipa_reset_debug_stmts): Also remove
+ gimple_clobber_p stmts if they refer to removed parameters.
+ (get_repl_default_def_ssa_name, sra_ipa_modify_expr): Fix up
+ formatting.
+
+2013-04-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*testqi_ext_3): Merge with *testqi_ext_3_rex64
+ using SWI48 mode attribute.
+
+2013-04-02 Wei Mi <wmi@google.com>
+
+ * config/i386/i386.c (ix86_rtx_costs): Set proper rtx cost for
+ ashl<mode>3_mask, *<shift_insn><mode>3_mask and
+ *<rotate_insn><mode>3_mask in i386.md.
+
+2013-04-02 Alexander Ivchenko <alexander.ivchenko@intel.com>
+
+ * config.gcc (arm*-*-linux-*): Remove duplicate t-linux-android.
+
+2013-04-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56778
+ * tree-vect-data-refs.c (vect_analyze_data_ref_dependence):
+ Runtime alias tests are not supported for gather loads.
+ * tree-vect-loop-manip.c (vect_loop_versioning): Insert
+ stmts referenced from SSA operands before updating SSA form.
+
+2013-04-02 Ian Caulfield <ian.caulfield@arm.com>
+ Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/arm-arches.def (armv8-a): Default to cortex-a53.
+ * config/arm/t-arm (MD_INCLUDES): Depend on cortex-a53.md.
+ * config/arm/cortex-a53.md: New file.
+ * config/arm/bpabi.h (BE8_LINK_SPEC): Handle cortex-a53.
+ * config/arm/arm.md (generic_sched, generic_vfp): Handle cortex-a53.
+ * config/arm/arm.c (arm_issue_rate): Likewise.
+ * config/arm/arm-tune.md: Regenerate
+ * config/arm/arm-tables.opt: Regenerate.
+ * config/arm/arm-cores.def: Add cortex-a53.
+
+2013-04-02 Zhenqiang Chen <zhenqiang.chen@arm.com>
+
+ * config/arm/uclinux-elf.h: Add %L to LINK_GCC_C_SEQUENCE_SPEC for
+ non-static link.
+
+2013-04-02 Sofiane Naci <sofiane.naci@arm.com>
+
+ * config/aarch64/aarch64.md (*mov<mode>_aarch64): Add variants for
+ scalar load/store operations using B/H registers.
+ (*zero_extend<SHORT:mode><GPI:mode>2_aarch64): Likewise.
+
+2013-04-02 Sofiane Naci <sofiane.naci@arm.com>
+
+ * config/aarch64/aarch64.md (*mov<mode>_aarch64): Add alternatives for
+ scalar move.
+ * config/aarch64/aarch64.c
+ (aarch64_simd_scalar_immediate_valid_for_move): New.
+ * config/aarch64/aarch64-protos.h
+ (aarch64_simd_scalar_immediate_valid_for_move): New.
+ * config/aarch64/constraints.md (Dh, Dq): New.
+ * config/aarch64/iterators.md (hq): New.
+
+2013-04-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * reorg.c (get_branch_condition): Deal with conditional returns.
+ (fill_simple_delay_slots): Remove dead code dealing with jumps.
+
2013-04-01 Wei Mi <wmi@google.com>
* config/i386/i386.md (*ashl<mode>3_mask): Rewrite as define_insn.
@@ -147,7 +1237,8 @@
(ipa_profile_write_summary): New function.
(ipa_profile_read_summary): New function.
(ipa_profile): Decide on threshold.
- (pass_ipa_profile): Add ipa_profile_write_summary and ipa_profile_read_summary.
+ (pass_ipa_profile): Add ipa_profile_write_summary and
+ ipa_profile_read_summary.
* Makefile.in (ipa.o): Update dependencies.
* lto-streamer.h (LTO_section_ipa_profile): New section.
@@ -407,7 +1498,7 @@
* config/i386/i386.md (*vec_extract2vdi_1): Merge with
*vec_extractv2di_1_rex64. Use x64 isa attribute.
-2013-03-28 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
+2013-03-28 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
* config/aarch64/aarch64.md (*and<mode>3_compare0): New pattern.
(*andsi3_compare0_uxtw): New pattern.
@@ -439,15 +1530,15 @@
(input_gimple_stmt): Input histograms.
(input_bb): Update profile streaming.
-2013-03-28 Kenneth Zadeck <zadeck@naturalbridge.com>
+2013-03-28 Kenneth Zadeck <zadeck@naturalbridge.com>
- * genmodes.c (emit_max_int): New function.
+ * genmodes.c (emit_max_int): New function.
(emit_insn_modes_h): Added call to emit_max_function.
* doc/rtl.texi (MAX_BITSIZE_MODE_ANY_INT, MAX_BITSIZE_MODE_ANY_MODE):
Added doc.
* machmode.def: Fixed comment.
-2013-03-28 Kenneth Zadeck <zadeck@naturalbridge.com>
+2013-03-28 Kenneth Zadeck <zadeck@naturalbridge.com>
* combine.c (try_combine): Removed useless assert.
* cselib.c (rtx_equal_for_cselib_1): Removed unnecessary parens.
@@ -578,14 +1669,12 @@
2013-03-27 Walter Lee <walt@tilera.com>
- * config/tilegx/tilegx.h (ASM_OUTPUT_ADDR_VEC_ELT): Delete
- extra tab.
+ * config/tilegx/tilegx.h (ASM_OUTPUT_ADDR_VEC_ELT): Delete extra tab.
(ASM_OUTPUT_ADDR_DIFF_ELT): Ditto.
2013-03-27 Walter Lee <walt@tilera.com>
- * config/tilegx/tilegx.md (*sibcall_insn): Fix type atribute
- for jr.
+ * config/tilegx/tilegx.md (*sibcall_insn): Fix type atribute for jr.
(*sibcall_value): Ditto.
2013-03-27 Walter Lee <walt@tilera.com>
@@ -662,8 +1751,8 @@
2013-03-26 Xinyu Qi <xyqi@marvell.com>
* config/arm/arm.h (FIRST_IWMMXT_GR_REGNUM): Add comment.
- * config/arm/iwmmxt.md (WCGR0): Update.
- (WCGR1, WCGR2, WCGR3): Likewise.
+ * config/arm/iwmmxt.md (WCGR0): Update.
+ (WCGR1, WCGR2, WCGR3): Likewise.
2013-03-26 Uros Bizjak <ubizjak@gmail.com>
@@ -683,8 +1772,9 @@
* config/tilegx/tilepro.h (PROFILE_BEFORE_PROLOGUE): Define.
2013-03-25 Jeff Law <law@redhat.com>
- * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Add missing
- check for INTEGRAL_TYPE_P that was missing due to checking in
+
+ * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Add missing
+ check for INTEGRAL_TYPE_P that was missing due to checking in
wrong version of prior patch.
2013-03-25 Walter Lee <walt@tilera.com>
@@ -1626,7 +2716,7 @@
* config/mips/mips.md (multimem): New type.
(length): Differentiate between 17-bit and 18-bit branch offsets.
(MOVEP1, MOVEP2): New mode iterator.
- (mov_<load>l): Use ZC constraint.
+ (mov_<load>l): Use ZC constraint.
(mov_<load>r): Likewise.
(mov_<store>l): Likewise.
(mov_<store>r): Likewise.
@@ -1680,7 +2770,7 @@
(mips_attribute_table): Add micromips, nomicromips and nocompression.
(mips_mips16_decl_p): Delete.
(mips_nomips16_decl_p): Delete.
- (mips_get_compress_on_flags): New function.
+ (mips_get_compress_on_flags): New function.
(mips_get_compress_off_flags): New function.
(mips_get_compress_mode): New function.
(mips_get_compress_on_name): New function.
diff --git a/gcc/ChangeLog-2012 b/gcc/ChangeLog-2012
index ee4c57444c3..ad72535e28d 100644
--- a/gcc/ChangeLog-2012
+++ b/gcc/ChangeLog-2012
@@ -4535,17 +4535,17 @@
* config/i386/i386.c (ix86_function_ok_for_sibcall): Put back exception
to make a sibcall if one of the functions has void return type.
-2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
* doc/invoke.texi (Wformat): Update.
-2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
* optc-gen.awk: Factor code out to...
* opt-functions.awk (lang_enabled_by): ... this new function.
-2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
* common.opt (Wswitch,Wswitch-default,Wswitch-enum): Move to c.opt.
@@ -5673,7 +5673,7 @@
* expmed.c (store_bit_field_1): Remove test for BLKmode values.
-2012-10-31 Ralf Corsépius <ralf.corsepius@rtems.org>,
+2012-10-31 Ralf Corsépius <ralf.corsepius@rtems.org>,
Joel Sherrill <joel.sherrill@oarcorp.com>
* config/sparc/t-rtems: New (Custom multilibs).
@@ -5886,7 +5886,7 @@
* lra-spills.c: Likewise.
* lra.c: Likewise.
-2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53066
* tree.h (FUNCTION_POINTER_TYPE_P): New.
@@ -6197,7 +6197,7 @@
* config/i386/x86intrin.h: Include
xsaveintrin.h, fxsrintrin.h, xsaveoptintrin.h.
-2012-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
+2012-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
* config/avr/t-rtems: Revert previous commit.
@@ -6253,7 +6253,7 @@
* lra-constraints.c (check_and_process_move): Remove #if
ENABLE_ASSERT_CHECKING.
-2012-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
+2012-10-26 Ralf Corsépius <ralf.corsepius@rtems.org>
* config/avr/rtems.h (TARGET_OS_CPP_BUILTINS): Remove
__USE_INIT_FINI__.
@@ -6308,7 +6308,7 @@
* lra-assigns.c (assign_by_spills): Add non-reload pseudos
assigned to hard register to changed_pseudo_bitmap.
-2012-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>
+2012-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>
* config.gcc (microblaze*-*-rtems*): New target.
* config/microblaze/rtems.h: New.
@@ -6362,7 +6362,7 @@
* config/rs6000/rs6000.c (rs6000_density_test): Use dump_enabled_p
instead of dump_kind_p.
-2012-10-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/54928
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc):
@@ -7023,7 +7023,7 @@
* loop-iv.c (iv_number_of_iterations): Record the upper bound
only if there are no further conditions on it.
-2012-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
PR c/40989
@@ -7660,7 +7660,7 @@
out of ...
(forwarder_block_p): ... here.
-2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
PR c/40989
@@ -7671,7 +7671,7 @@
* opts.c (finish_options): Do not handle them explicitly.
* opt-functions.awk (search_var_name): New.
-2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
PR c/40989
@@ -11075,7 +11075,7 @@
and -meb.
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
- Manuel López-Ibáñez <manu@gcc.gnu.org>
+ Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53210
* doc/invoke.texi ([Winit-self]): Document as enabled by -Wall in C++.
@@ -18313,7 +18313,7 @@
(ASM_SPEC): Pass mcu options to the assembler.
* doc/invoke.texi (MIPS Options): Document -mmcu and -mno-mcu.
-2012-07-18 Ralf Corsépius <ralf.corsepius@rtems.org>
+2012-07-18 Ralf Corsépius <ralf.corsepius@rtems.org>
* config.gcc (v850-*-rtems*): New target.
* config/v850/rtems.h: New.
@@ -22797,7 +22797,7 @@
(generate_code_for_partition): Generate code according
to partition classification.
-2012-06-01 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-06-01 Manuel López-Ibáñez <manu@gcc.gnu.org>
Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/50134
@@ -24303,7 +24303,7 @@
(decide_is_variable_needed): Handle externals.
(varpool_remove_unreferenced_decls): Likewise.
-2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
* opts.c (common_handle_option): -pedantic-errors enables -Wpedantic.
(enable_warning_as_error): Do not special case Wuninitialized.
@@ -24631,7 +24631,7 @@
strided loads.
* tree-vect-stmts.c (vect_model_load_cost): Handle strided loads.
-2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 53063
* doc/options.texi: (LangEnabledBy): Document it.
@@ -24705,7 +24705,7 @@
* config/pa/pa.md: Use define_c_enum for "unspec" and "unspecv".
-2012-05-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
* common.opt (Wtype-limits): Use EnabledBy.
@@ -24739,7 +24739,7 @@
(*<code><mode>3): Ditto.
(<code>tf3): Ditto.
-2012-05-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
* optc-gen.awk: Error instead of warning for conflicting help.
@@ -24786,7 +24786,7 @@
(delete_tree_ssa): Do not call fini_phinodes.
* tree-flow.h (init_phinodes, fini_phinodes): Remove.
-2012-05-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 53063
* doc/options.texi (EnabledBy): Document
@@ -24986,14 +24986,14 @@
(xop_mulv2div2di3_low): Remove insn_and_split pattern.
(xop_mulv2div2di3_high): Ditto.
-2012-05-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53289
* diagnostic.h (diagnostic_context): Add last_location.
* diagnostic.c (diagnostic_initialize): Initialize it.
(diagnostic_show_locus): Use it.
-2012-05-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
* doc/extend.texi (Function Attributes): Point xref to section
about Pragmas.
@@ -25807,13 +25807,13 @@
Same stands for reloads with type RELOAD_FOR_OUTPUT_ADDRESS and
RELOAD_FOR_OUTADDR_ADDRESS.
-2012-05-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/24985
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Show caret
for macro expansion.
-2012-05-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
* flags.h (flag_permissive): Do not declare.
* diagnostic.c (diagnostic_report_diagnostic): Handle fpermissive
@@ -26743,7 +26743,7 @@
* config/i386/i386.c (ix86_handle_struct_attribute): Use the proper
predicate to discriminate types.
-2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
* doc/invoke.texi (Wmissing-format-attribute): Document as an
alias of Wsuggest-attribute=format.
@@ -26751,7 +26751,7 @@
Wmissing-format-attribute with Wsuggest-attribute=format.
(digest_init): Likewise.
-2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
* opts.c (finish_options): Do not handle -Wmissing-noreturn here.
* common.opt (Wmissing-noreturn): Alias of
@@ -26839,7 +26839,7 @@
PR middle-end/27139
* tree-ssa-forwprop.c (combine_conversions): Handle INT->FP->INT.
-2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53130
* c-typeck.c (pop_init_level): Use %qD instead of %qT.
@@ -27001,7 +27001,7 @@
* reload.c (find_reloads): Change the loop nesting when trying an
alternative with swapped operands.
-2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix
comment. Delete unused parameter first_exp_point_map.
@@ -27135,7 +27135,7 @@
set_nonincremental_init_from_string): Pass true instead of false
as IMPLICIT to add_pending_init.
-2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-typeck.c (pop_init_level): Improve diagnostics.
@@ -27252,7 +27252,7 @@
* config/vxworks.c (vxworks_override_options): Default to strict-dwarf
and dwarf_version 2.
-2012-04-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree-pretty-print.h (default_tree_printer): Do not declare.
* tree-diagnostic.c: Include tree-pretty-print.h, tree-pass.h and
@@ -27536,7 +27536,7 @@
Likewise.
* tree-switch-conversion.c (build_one_array): Likewise.
-2012-04-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/44774
* doc/invoke.texi (pedantic): Rename to Wpedantic.
@@ -27624,7 +27624,7 @@
* fold-const.c (fold_checksum_tree): Fix VECTOR_CST case.
-2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 35441
* c-typeck.c (inform_declaration): New.
@@ -27811,7 +27811,7 @@
* config/arm/sync.md (sync_optab): Change ior attribute to "or".
-2012-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/52283/37985
* stmt.c (warn_if_unused_value): Skip NOP_EXPR.
@@ -28041,7 +28041,7 @@
* varpoo.c (varpool_node_name): Remove.
(dump_varpool_node): Use dump_symtab_base; reformat.
-2012-04-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
* doc/invoke.texi (Language Independent Options): @item should be
before @opindex.
@@ -28908,7 +28908,7 @@
* doc/extend.texi (Type Attributes): Move paragraph.
-2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 24985
* diagnostic.h (show_caret): Declare.
@@ -28943,7 +28943,7 @@
manipulation code we are threading through a loop header
to an exit destination.
-2012-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree.h (warn_if_unused_value): Move declaration from here.
* stmt.c (warn_if_unused_value): Move definition from here.
@@ -29083,7 +29083,7 @@
comment block.
(Sr0): Remove unused memory constraint.
-2012-04-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree-pretty-print.h: Update comment.
@@ -30605,7 +30605,7 @@
* tree-data-ref.c (subscript_dependence_tester_1): Check
all dimensions for non-conflicting access functions.
-2012-03-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-03-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/44783
* doc/invoke.texi [C++ Language Options]: Document
@@ -31556,7 +31556,7 @@
in new variable 'empty'. Increase issue_rate only for
non-empty insns.
-2012-03-07 Ralf Corsépius <ralf.corsepius@rtems.org>
+2012-03-07 Ralf Corsépius <ralf.corsepius@rtems.org>
PR target/51417
* Makefile.in: Let install-gcc-ar depend on installdirs,
diff --git a/gcc/ChangeLog.cilkplus b/gcc/ChangeLog.cilkplus
index 8603c1af300..b973bae1e35 100644
--- a/gcc/ChangeLog.cilkplus
+++ b/gcc/ChangeLog.cilkplus
@@ -1,3 +1,23 @@
+2013-04-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c/c-array-notation.c (fix_builtin_array_notation_fn): Added a check
+ for array notation functions inside array notations. If so, return an
+ error.
+ (build_array_notation_expr): Fixed a bug and popped a statement list.
+
+2013-04-17 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c/c-array-notation.c (build_array_notation_expr): Added a check for
+ length mismatch. Also changed loading array_list so that array refs can
+ be used with array notations. Finally, store array notation components
+ into variable only if it is not a INTEGER constant.
+ (find_rank): Changed the computation method so that array ref can be
+ used with array notations.
+ (length_mismatch_in_expr_p): New function.
+ (fix_builtin_array_notation_fn): Added a check to see if max/min value
+ is available for the type. If so, set it as the starting point for
+ min and max reduction functions.
+
2013-04-14 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c/Make-lang.in (C_AND_OBJC_OBJS): Added c/c-pragma-simd.o.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 79c60ad0bfa..4990d6d2eaa 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20130401
+20130415
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 6eab50e5b3c..148e06e4937 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1470,7 +1470,7 @@ OBJS = \
# Objects in libcommon.a, potentially used by all host binaries and with
# no target dependencies.
-OBJS-libcommon = diagnostic.o pretty-print.o intl.o input.o version.o
+OBJS-libcommon = diagnostic.o diagnostic-color.o pretty-print.o intl.o input.o version.o
# Objects in libcommon-target.a, used by drivers and by the core
# compiler and containing target-dependent code.
@@ -2673,11 +2673,12 @@ fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GIMPLE_H) realmpfr.h $(TREE_FLOW_H)
diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
version.h $(DEMANGLE_H) $(INPUT_H) intl.h $(BACKTRACE_H) $(DIAGNOSTIC_H) \
- diagnostic.def
+ diagnostic.def diagnostic-color.h
+diagnostic-color.o : diagnostic-color.c $(CONFIG_H) $(SYSTEM_H) diagnostic-color.h
opts.o : opts.c $(OPTS_H) $(OPTIONS_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(DUMPFILE_H) $(TM_H) \
$(DIAGNOSTIC_H) insn-attr-common.h intl.h $(COMMON_TARGET_H) \
- $(FLAGS_H) $(PARAMS_H) opts-diagnostic.h
+ $(FLAGS_H) $(PARAMS_H) opts-diagnostic.h diagnostic-color.h
opts-global.o : opts-global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_H) $(OPTS_H) $(FLAGS_H) $(GGC_H) $(TREE_H) langhooks.h \
$(TM_H) $(RTL_H) $(DBGCNT_H) debug.h $(LTO_STREAMER_H) output.h \
@@ -3306,12 +3307,12 @@ lra-constraints.o : lra-constraints.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) insn-config.h insn-codes.h $(DF_H) \
$(RECOG_H) output.h addresses.h $(REGS_H) hard-reg-set.h $(FLAGS_H) \
$(FUNCTION_H) $(EXPR_H) $(BASIC_BLOCK_H) $(TM_P_H) $(EXCEPT_H) \
- ira.h rtl-error.h $(LRA_INT_H)
+ ira.h rtl-error.h $(LRA_INT_H) $(OPTABS_H)
lra-eliminations.o : lra-eliminations.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) insn-config.h $(DF_H) \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
$(EXPR_H) $(BASIC_BLOCK_H) $(TM_P_H) $(EXCEPT_H) ira.h \
- rtl-error.h $(LRA_INT_H)
+ rtl-error.h $(LRA_INT_H) $(OPTABS_H)
lra-lives.o : lra-lives.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) insn-config.h $(DF_H) \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
@@ -3439,7 +3440,8 @@ params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(COMMON_TARGET_H) \
$(PARAMS_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)
+pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H) \
+ diagnostic-color.h
errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h
dbgcnt.o: dbgcnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DUMPFILE_H) \
$(DIAGNOSTIC_CORE_H) $(DBGCNT_H)
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3ec3e291cae..e3661882299 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,1377 @@
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * makeutl.adb, prj-nmsc.adb: Minor reformatting.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * exp_util.adb (Make_Invariant_Call): Use Check_Kind instead
+ of Check_Enabled.
+ * gnat_rm.texi (Check_Policy): Update documentation for new
+ Check_Policy syntax.
+ * sem_prag.adb (Check_Kind): Replaces Check_Enabled
+ (Analyze_Pragma, case Check_Policy): Rework to accomodate new
+ syntax (like Assertion_Policy).
+ * sem_prag.ads (Check_Kind): Replaces Check_Enabled.
+
+2013-04-12 Doug Rupp <rupp@adacore.com>
+
+ * init.c (SS$_CONTROLC, SS$_CONTINUE) [VMS]: New macros.
+ (__gnat_handle_vms_condition) [VMS]: Dispatch on the Crtl/C user
+ handler if installed.
+ * ctrl_c.c (__gnat_install_int_handler)
+ [VMS]: Install a dummy sigaction handler to trigger the real
+ user handler dispatch in init.c/__gnat_handle_vms_condition.
+ (__gnat_uninstall_int_handler) [VMS]: Likewise.
+
+2013-04-12 Vincent Celier <celier@adacore.com>
+
+ * clean.adb (Parse_Cmd_Line): Set Directories_Must_Exist_In_Projects
+ to False if switch is specified.
+ * makeutl.adb (Initialize_Source_Record): Do not look for the
+ object file if there is no object directory.
+ * opt.ads (Directories_Must_Exist_In_Projects): New Boolean
+ variable, defaulted to True.
+ * prj-nmsc.adb (Check_Library_Attributes): Do not fail if library
+ directory does not exist when Directories_Must_Exist_In_Projects is
+ False.
+ (Get_Directories): Do not fail when the object or the exec directory
+ do not exist when Directories_Must_Exist_In_Projects is False.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * namet.adb, namet.ads: Minor addition (7 arg version of Nam_In).
+ * exp_prag.adb, sem_ch3.adb, sem_intr.adb, sem_type.adb, exp_util.adb,
+ sem_aux.adb, exp_ch9.adb, sem_ch7.adb, sem_ch10.adb, sem_prag.adb,
+ par-ch2.adb, tbuild.adb, rtsfind.adb, freeze.adb, sem_util.adb,
+ sem_res.adb, sem_attr.adb, exp_ch2.adb, prj-makr.adb, sem_elab.adb,
+ exp_ch4.adb, sem_ch4.adb, sem_mech.adb, sem_ch6.adb, par-prag.adb,
+ prj-nmsc.adb, exp_disp.adb, sem_ch8.adb, sem_warn.adb, par-util.adb,
+ sem_eval.adb, exp_intr.adb, sem_ch13.adb, exp_cg.adb, lib-xref.adb,
+ sem_disp.adb, exp_ch3.adb: Minor code reorganization (use Nam_In).
+
+2013-04-12 Doug Rupp <rupp@adacore.com>
+
+ * init.c: Don't clobber condition code on VMS.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * exp_aggr.adb: Minor reformatting.
+ * namet.ads, namet.adb (Nam_In): New functions.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * einfo.adb (Has_Dynamic_Predicate_Aspect): New flag.
+ (Has_Static_Predicate_Aspect): New flag.
+ * einfo.ads (Has_Dynamic_Predicate_Aspect): New flag.
+ (Has_Static_Predicate_Aspect): New flag.
+ * exp_ch9.adb: Minor reformatting.
+ * exp_util.adb (Make_Invariant_Call): Check_Enabled now handles
+ synonyms.
+ * gnat1drv.adb: Remove setting of Debug_Pragmas_Enabled,
+ since this switch is gone and control of Debug is done with
+ Assertions_Enabled.
+ * gnat_rm.texi: Update documentation for Assertion_Policy and
+ Check_Policy pragmas.
+ * opt.adb (Debug_Pragmas_Disabled[_Config]): Removed
+ (Debug_Pragmas_Enabled[_Config]): Removed Since debug now
+ controlled by Assertion_Enabled.
+ * opt.ads (Debug_Pragmas_Disabled[_Config]): Removed
+ (Debug_Pragmas_Enabled[_Config]): Removed Since debug now
+ controlled by Assertion_Enabled.
+ * par-ch2.adb (Scan_Pragma_Argument_Association): Allow new
+ 'Class forms.
+ * sem_attr.adb: Minor reformatting.
+ * sem_ch13.adb (Analyze_Aspect_Specification): Disable aspect
+ if DISABLE policy applies.
+ * sem_ch6.adb (Grab_PPC): Check original name of aspect for
+ aspect from pragma (Process_PPCs): Properly check assertion policy.
+ * sem_prag.adb (Check_Enabled): Rewritten for new Assertion_Policy
+ (Check_Appicable_Policy): New procedure.
+ (Is_Valid_Assertion_Kind): New function.
+ (Rewrite_Assertion_Kind): New procedure.
+ (Analyze_Pragma): Handle case of disabled assertion pragma.
+ (Analyze_Pragma, case Assertion_Policy): Rewritten for Ada 2012.
+ (Analyze_Pragma, case Check): Deal with 'Class possibilities.
+ (Analyze_Pragma, case Check_Policy): Deal with 'Class possibilities.
+ (Analyze_Pragma, case Contract_Class): New handling of ignored pragma.
+ (Analyze_Pragma, case Debug): New control with Assertion_Policy.
+ (Analyze_Pragma, case Debug_Policy): Now consistent with
+ Assertion_Policy.
+ (Analyze_Pragma, case Loop_Invariant): New handling of ignored
+ pragma.
+ (Analyze_Pragma, case Loop_Variant): New handling of ignored pragma.
+ (Analyze_Pragma, case Precondition): Use proper name for Check pragma.
+ (Analyze_Pragma, case Check_Enabled): Rewritten for new policy stuff.
+ * sem_prag.ads (Check_Enabled): Rewritten for new
+ Assertion_Policy stuff.
+ (Check_Appicable_Policy): New procedure.
+ * sinfo.adb (Is_Disabled): New flag.
+ (Is_Ignored): New flag.
+ * sinfo.ads (Is_Disabled): New flag.
+ (Is_Ignored): New flag.
+ (N_Pragma_Argument_Association): New 'Class forms.
+ * snames.ads-tmpl: New names Name_uPre, Name_uPost,
+ Name_uType_Invariant, Name_uInvariant.
+ * switch-c.adb: Remove setting of Debug_Pragmas_Enabled for -gnata.
+ * tree_io.ads (ASIS_Version_Number): Updated (remove
+ read write of obsolete flags Debug_Pragmas_Disabled and
+ Debug_Pragmas_Enabled.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Get_Explicit_Discriminant_Value): Subsidiary
+ of Build_Record_Aggr_Code, used to retrieve explicit values
+ for inherited discriminants in an extension aggregate, when the
+ ancestor type is unconstrained.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb (Check_Stream_Attribute): If restriction
+ No_Default_Stream_Attributes is active, it is illegal to use a
+ predefined elementary type stream attribute either by itself,
+ or more importantly as part of the attribute subprogram for a
+ composite type. However, if the broader restriction No_Streams
+ is active, then stream operations are not generated, and there
+ is no error.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * gnatbind.adb: Minor reformatting.
+
+2013-04-12 Bob Duff <duff@adacore.com>
+
+ * sem_attr.adb (Analyze_Access_Attribute): Treat P'Access like a
+ call only in the static elaboration model.
+
+2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Analyze_Input_List): Detect an illegal dependency
+ clause where both input and output lists are null.
+ (Analyze_Pragma): Update the grammar of pragma Depends.
+
+2013-04-12 Vincent Celier <celier@adacore.com>
+
+ * gnatbind.adb (No_Restriction_List): Exclude restrictions that
+ take a parameter value, not a count.
+ * prj.ads, prj.adb (Remove_All_Restricted_Languages): New procedure.
+ * projects.texi: Complete documentation of attribute Roots.
+
+2013-04-12 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch3.adb, exp_util.ads, checks.adb, freeze.adb, sem_attr.adb,
+ sem_ch3.adb: Minor reformatting.
+ * exp_ch4.adb (Size_In_Storage_Elements): Minor documentation
+ improvement: note that the computation is pessimistic for bit
+ packed arrays.
+ * gnat_rm.texi (Range_Length): Fix minor error in description
+ of attribute.
+
+2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * aspects.adb (Find_Aspect): New routine.
+ (Find_Value_Of_Aspect): New routine.
+ (Has_Aspect): Reimplemented.
+ * aspects.ads (Find_Aspect): New routine.
+ (Find_Value_Of_Aspect): New routine, previously known as Find_Aspect.
+ * exp_ch5.adb (Expand_Iterator_Loop): Update the call to Find_Aspect.
+ * exp_util.adb (Is_Iterated_Container): Update the call to Find_Aspect.
+ * sem_ch4.adb (Try_Container_Indexing): Update calls to Find_Aspect.
+ * sem_ch5.adb (Analyze_Iterator_Specification): Update
+ the call to Find_Aspect. Use function Has_Aspect for better
+ readability.
+ (Preanalyze_Range): Use function Has_Aspect for better readability.
+ * sem_ch13.adb (Check_One_Function): Update the call to Find_Aspect.
+ * sem_prag.adb (Analyze_Pragma): There is no longer need to
+ look at the parent to extract the corresponding pragma for
+ aspect Global.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * checks.adb, sem_elab.adb, repinfo.adb, sem_ch4.adb, restrict.adb,
+ restrict.ads: Minor reformatting.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * lib-xref.adb: Retrieve original name of classwide type if any.
+
+2013-04-12 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch11.ads: Minor reformatting.
+
+2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * aspects.adb: Alphabetize subprogram bodies in this unit. Add
+ an entry for Aspect_Ghost in the table of canonical aspects.
+ (Has_Aspect): New routine.
+ * aspects.ads: Add Aspect_Ghost to all relevant
+ tables. Alphabetize subprograms in this unit.
+ (Has_Aspect): New routine.
+ * einfo.adb: Add with and use clauses for Aspects.
+ (Is_Ghost_Function): New routine.
+ * einfo.ads: Add new synthesized attribute Is_Ghost_Function and
+ update the structure of the related nodes.
+ (Is_Ghost_Function): New routine.
+ * exp_ch4.adb (Find_Enclosing_Context): Use routine
+ Is_Body_Or_Package_Declaration to terminate a search.
+ (Is_Body_Or_Unit): Removed.
+ * exp_util.adb (Within_Case_Or_If_Expression): Use routine
+ Is_Body_Or_Package_Declaration to terminate a search.
+ * par-prag.adb: Add pragma Ghost to the list of pragmas that do
+ not need special processing by the parser.
+ * sem_attr.adb (Analyze_Access_Attribute): Detect an
+ illegal use of 'Access where the prefix is a ghost function.
+ (Analyze_Attribute): Use routine Is_Body_Or_Package_Declaration
+ to terminate a search. (Check_References_In_Prefix): Use routine
+ Is_Body_Or_Package_Declaration to terminate a search.
+ * sem_ch4.adb (Analyze_Call): Mark a function when it appears
+ inside an assertion expression. Verify the legality of a call
+ to a ghost function.
+ (Check_Ghost_Function_Call): New routine.
+ * sem_ch6.adb (Analyze_Function_Call): Code reformatting. Move
+ the setting of attribute In_Assertion_Expression to Analyze_Call.
+ (Check_Overriding_Indicator): Detect an illegal attempt to
+ override a function with a ghost function.
+ * sem_ch12.adb (Preanalyze_Actuals): Detect an illegal use of
+ a ghost function as a generic actual.
+ * sem_elab.adb (Check_Internal_Call_Continue): Update the call
+ to In_Assertion.
+ * sem_prag.adb: Add an entry for pragma Ghost in the table
+ of significant arguments.
+ (Analyze_Pragma): Do not analyze
+ an "others" case guard. Add processing for pragma Ghost. Use
+ Preanalyze_Assert_Expression when analyzing the expression of
+ pragmas Loop_Invariant and Loop_Variant.
+ * sem_util.adb (Get_Subprogram_Entity): Reimplemented.
+ (Is_Body_Or_Package_Declaration): New routine.
+ * sem_util.ads: Alphabetize subprotrams in this unit.
+ (Is_Body_Or_Package_Declaration): New routine.
+ * sinfo.adb (In_Assertion): Rename to In_Assertion_Expression.
+ (Set_In_Assertion): Rename to Set_In_Assertion_Expression.
+ * sinfo.ads: Rename flag In_Assertion to In_Assertion_Expression
+ to better reflect its use. Update all places that mention the flag.
+ (In_Assertion): Rename to In_Assertion_Expression. Update
+ related pragma Inline. (Set_In_Assertion): Rename to
+ Set_In_Assertion_Expression. Update related pragma Inline.
+ * snames.ads-tmpl: Add new predefined name Ghost. Add new pragma
+ id Pragma_Ghost.
+
+2013-04-12 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_prag.adb (Set_Imported): Do not generate error for multiple
+ Import in CodePeer mode.
+ * s-rident.ads: Fix minor typo.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * checks.adb (Insert_Valid_Check): Do not insert validity check
+ in the body of the generated predicate function, to prevent
+ infinite recursion.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * s-rident.ads: Add various missing Ada 2012 restrictions:
+ No_Access_Parameter_Allocators, No_Coextensions,
+ No_Use_Of_Attribute, No_Use_Of_Pragma.
+ * snames.ads-tmpl: Add corresponding names.
+ * restrict.ads restrict.adb: Subprograms and data structures to
+ handle aspects No_Use_Of_Attribute and No_Use_Of_Pragma.
+ * sem_ch4.adb: Correct name of restrictions is
+ No_Standard_Allocators_After_Elaboration.
+ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Check
+ violation of restriction No_Use_Of_Attribute.
+ * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
+ Set restrictions No_Use_Of_Pragma and No_Use_Of_Attribute.
+ (Analyze_Pragma): Check violation of restriction No_Use_Of_Pragma.
+ * sem_res.adb: Check restrictions No_Access_Parameter_Allocators
+ and No_Coextensions.
+ * bcheck.adb: Correct name of restrictions is
+ No_Standard_Allocators_After_Elaboration.
+ * gnatbind.adb: Correct name of restrictions is
+ No_Standard_Allocators_After_Elaboration.
+
+2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, (Check_Mode_Restriction_In_Function):
+ Correct error message format.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * sem_attr.adb: Minor reformatting.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_elab.adb (Within_Elaborate_All): Do not examine a context
+ item that has not been analyzed, because the unit may have errors,
+ or the context item may come from a proper unit inserted at the
+ point of a stub and not analyzed yet.
+
+2013-04-12 Thomas Quinot <quinot@adacore.com>
+
+ * gnat1drv.adb, repinfo.adb, repinfo.ads (Repinfo.List_Array_Info,
+ List_Record_Info): Also include scalar storage order information in
+ output.
+
+2013-04-12 Yannick Moy <moy@adacore.com>
+
+ * sem_ch6.adb (Process_Contract_Cases): Update code to apply to
+ Contract_Cases instead of Contract_Case pragma.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * a-cfdlli.ads, g-socket.adb, s-fileio.adb: Minor reformatting.
+
+2013-04-12 Yannick Moy <moy@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute): Update analyse of
+ Attribute_Old and Attribute_Result so they are allowed in the
+ right-hand-side of an association in a Contract_Cases pragma.
+ * sem_prag.adb (Analyze_CTC_In_Decl_Part): Add pre-analysis of
+ the expressions in a Contract_Cases pragma.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * sem.ads, opt.ads: Minor comment edits.
+ * sem_warn.adb, sem_ch6.adb: Minor reformatting.
+
+2013-04-12 Claire Dross <dross@adacore.com>
+
+ * a-cfdlli.adb a-cfdlli.ads (List, Not_No_Element, Iterate,
+ Reverse_Iterate, Query_Element, Update_Element, Read, Write): Removed,
+ not suitable for formal analysis.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Abstract_State): Use Defining entity
+ to locate package entity, which may be a child unit.
+
+2013-04-12 Thomas Quinot <quinot@adacore.com>
+
+ * g-socket.adb, g-socket.ads (Connect_Socket, version with timeout): If
+ the specified timeout is 0, do not attempt to determine whether the
+ connection succeeded.
+
+2013-04-12 Doug Rupp <rupp@adacore.com>
+
+ * s-fileio.adb (Form_RMS Context_Key): Fix some thinkos.
+
+2013-04-12 Doug Rupp <rupp@adacore.com>
+
+ * s-fileio.adb: Minor reformatting.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_warn.adb (Check_Infinite_Loop_Warning): Do not warn if
+ the last statement in the analyzed loop is an unconditional
+ exit statement.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * opt.ads (Style_Check_Main): New switch.
+ * sem.adb (Semantics): Set Style_Check flag properly for new
+ unit to be analyzed.
+ * sem_ch10.adb (Analyze_With_Clause): Don't reset Style_Check,
+ the proper setting of this flag is now part of the Semantics
+ procedure.
+ * switch-c.adb (Scan_Front_End_Switches): Set Style_Check_Main
+ for -gnatg and -gnaty
+
+2013-04-12 Doug Rupp <rupp@adacore.com>
+
+ * s-crtl.ads (fopen, freopen): Add vms_form parameter
+ * i-cstrea.ads (fopen, freopen): Likewise.
+ * adaint.h (__gnat_fopen, __gnat_freopen): Likewise.
+ * adaint.c (__gnat_fopen, __gnat_freopen): Likewise.
+ [VMS]: Split out RMS keys and call CRTL function appropriately.
+ * s-fileio.adb (Form_VMS_RMS_Keys, Form_RMS_Context_Key): New
+ subprograms.
+ (Open, Reset): Call Form_VMS_RMS_Keys. Call fopen,freopen with
+ vms_form
+ * gnat_rm.texi: Document implemented RMS keys.
+
+2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch13.adb (Analyze_Aspect_Specifications):
+ Insert the corresponding pragma for aspect Abstract_State at
+ the top of the visible declarations of the related package.
+ Previously this was only done when the package is a compilation
+ unit.
+
+2013-04-12 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat_ugn.texi: Further menu clean ups.
+ * sem_prag.adb, opt.ads: Minor reformatting.
+ * sem_util.ads: Minor comment fix.
+
+2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect
+ Depends is now a delayed aspect. The delay is required
+ due to the interplay between aspects Depends and Global.
+ (Check_Aspect_At_Freeze_Point): Add an entry for aspect Depends.
+ * sem_prag.adb: Reformat various error messages.
+ (Add_Item): New subsidiary routine.
+ (Analyze_Pragma): Add new variables
+ Global_Seen, Result_Seen, Subp_Inputs and Subp_Outputs. The
+ analysis of pragma Depends now has the capability to check
+ the proper mode and usage of subprogram inputs and outputs.
+ (Appears_In): New routine.
+ (Check_Function_Return): New routine.
+ (Check_Mode): New routine.
+ (Check_Usage): New routine.
+ (Collect_Subprogram_Inputs_Outputs): New routine.
+
+2013-04-12 Bob Duff <duff@adacore.com>
+
+ * par-ch7.adb (P_Package): Initialize Sloc in the newly-pushed scope
+ stack entry.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * switch-c.adb: Minor fix to wording of error message for
+ -gnatet/eT.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * impunit.adb: Add s-multip and s-mudido to list of impl defined
+ system units.
+ * gnat_rm.texi: Add documentation for
+ System.Multiprocessors[.Dispatching_Domains].
+
+2013-04-12 Ben Brosgol <brosgol@adacore.com>
+
+ * gnat_ugn.texi: Completion of menu cleanups.
+
+2013-04-12 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_prag.adb (Diagnose_Multiple_Pragmas): Relax the rules
+ in Relaxed_RM_Semantics.
+
+2013-04-12 Arnaud Charlet <charlet@adacore.com>
+
+ * set_targ.adb (elab code): Add support for non gcc back-ends
+ where save_argv is null.
+
+2013-04-12 Robert Dewar <dewar@adacore.com>
+
+ * gnat1drv.adb (Gnat1drv): Test Target_Dependent_Info_Write_Name.
+ * opt.ads (Target_Dependent_Info_Read): Add _Name, now an access
+ type (Target_Dependent_Info_Write): Add _Name, now an access type.
+ * set_targ.adb (Write_Target_Dependent_Values): Use name
+ from -gnatet switch stored in Target_Dependent_Info_Write_Name
+ (Read_Target_Dependent_Values): Use name from -gnateT switch
+ stored in Target_Dependent_Info_Read_Name.
+ * switch-c.adb: New form of -gnatet and -gnateT switches.
+ * usage.adb: New form of -gnatet and -gnateT switches with
+ file name.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (elaborate_expression_1): Skip only constant
+ arithmetics when looking for a read-only variable in the expression.
+
+2013-04-11 Javier Miranda <miranda@adacore.com>
+
+ * check.ads, exp_ch6.adb (Install_Null_Excluding_Check): No check in
+ interface thunks since it is performed at the caller side.
+ (Expand_Simple_Function_Return): No accessibility check needed in thunks
+ since the check is done by the target routine.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Priority): pre-analyze
+ expression with type Any_Priority.
+ * exp_ch9.adb (Initialize_Protection): Check that the value
+ of the priority expression is within the bounds of the proper
+ priority type.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb, prj-env.adb: Minor reformatting.
+
+2013-04-11 Ben Brosgol <brosgol@adacore.com>
+
+ * gnat_ugn.texi: Clean ups.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * set_targ.adb: Minor comment update.
+
+2013-04-11 Pascal Obry <obry@adacore.com>
+
+ * gnat_ugn.texi: Remove obsolete comment about DLL calling
+ convention.
+
+2013-04-11 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch6.adb (Expand_Call): For the call to the target primitive
+ of an interface thunks do not compute the extra actuals; just
+ propagate the extra actuals received by the thunk.
+ * exp_disp.adb (Expand_Interface_Thunk): Decorate new attribute
+ Thunk_Entity.
+ * sem_ch6.adb (Create_Extra_Formals): Do not generate extra
+ formals in interface thunks whose target primitive has no extra
+ formals.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma): Detect
+ a renaming by looking at the Renamed_Object attribute.
+ (Is_Renaming): Removed.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * prj-env.adb (Initialize_Default_Project_Path): Take
+ into account a project path file, specified by environment
+ variable GPR_PROJECT_PATH_FILE, before taking into account
+ GPR_PROJECT_PATH.
+ * projects.texi: Add documentation for GPR_PROJECT_PATH_FILE
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * a-cdlili.adb, a-cdlili.ads, a-cihama.adb, a-cihama.ads, a-coinve.adb,
+ a-coinve.ads, a-ciorse.adb, a-ciorse.ads, a-coorma.adb, a-coorma.ads,
+ a-cfdlli.adb, a-cfdlli.ads, a-cborma.adb, a-cborma.ads, a-cidlli.adb,
+ a-cidlli.ads, a-ciormu.adb, a-ciormu.ads, a-cihase.adb, a-cihase.ads,
+ a-cohama.adb, a-cohama.ads, a-coorse.adb, a-coorse.ads, a-cbhama.adb,
+ a-cbhama.ads, a-cborse.adb, a-cborse.ads, a-ciorma.adb, a-cobove.adb,
+ a-ciorma.ads, a-cobove.ads, a-coormu.adb, a-coormu.ads, a-cohase.adb,
+ a-cohase.ads, a-cbdlli.adb, a-cbdlli.ads, a-cbhase.adb, a-cbhase.ads:
+ Move Iterator operations from body to private part of spec.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ttypes.ads, get_targ.ads: More minor rewording of comments.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * debug.adb: Document use of switch -gnatd.Z.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma): Both pragma Depends and Global can now
+ support renamings of entire objects. Legal renamings are replaced by
+ the object they rename.
+ (Is_Renaming): New routine.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * set_targ.adb, opt.ads: Minor changes in comments.
+
+2013-04-11 Ben Brosgol <brosgol@adacore.com>
+
+ * gnat_ugn.texi: Minor clean ups.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * nlists.ads, nlists.adb, treepr.adb, treepr.ads: Move debugging
+ function p from Nlists to Treepr.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_disp.adb (Check_Dispatching_Context): If the context is
+ a contract for a null procedure defer error reporting until
+ postcondition body is created.
+ * exp_ch13.adb (Expand_N_Freeze_Entity): If the entity is a
+ null procedure, complete the analysis of its contracts so that
+ calls within classwide conditions are properly rewritten as
+ dispatching calls.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch10.adb, sem_ch12.adb: Minor reformatting.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_attr.adb, sem_res.adb, sem_attr.adb: Minor reformatting.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * atree.adb, atree.ads (Node31): New function.
+ (Set_Node31): New procedure.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * errout.ads: Minor typo correction.
+
+2013-04-11 Javier Miranda <miranda@adacore.com>
+
+ * einfo.ad[sb] (Thunk_Entity/Set_Thunk_Entity): New attribute.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * back_end.adb (Register_Back_End_Types): Moved to Get_Targ
+ * back_end.ads (C_String): Moved to Get_Targ
+ (Register_Type_Proc): Moved to Get_Targ (Register_Back_End_Types):
+ Moved to Get_Targ.
+ * cstand.adb (Register_Float_Type): New interface
+ (Create_Back_End_Float_Types): Use entries in FPT_Mode_Table.
+ * get_targ.adb (Register_Back_End_Types): Moved here from
+ Back_End.
+ * get_targ.ads (C_String): Moved here from Back_End
+ (Register_Type_Proc): Moved here from Back_End
+ (Register_Back_End_Types): here from Back_End.
+ * gnat1drv.adb (GGnat11drv): Add call to
+ Write_Target_Dependent_Values;
+ * lib-writ.ads, lib-writ.adb (Write_ALI): Remove section writing
+ obsolete target dependent info.
+ * opt.ads (Generate_Target_Dependent_Info):
+ Removed (Target_Dependent_Info_Read): New flag
+ (Target_Dependent_Info_Write): New flag
+ * output.adb: Minor comment change
+ * s-os_lib.ads: Minor reformatting
+ * set_targ.ads, set_targ.adb: Minor reformatting.
+ * switch-c.adb (Scan_Switches.First_Ptr): New variable
+ (Scan_Front_End_Switches): Check -gnatd.b, -gnateT come first
+ (Scan_Front_End_Switches): Handle -gnatet, -gnateT
+ * ttypes.ads: Remove documentation section on target dependent
+ info in ali file Remove four letter codes, no longer used Instead
+ of using Get_Targ.Get_xxx, we use Set_Targ.xxx
+ * usage.adb: Add usage lines for -gnatet/-gnateT
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch4.adb: Update documentation.
+ * sinfo.ads (N_Expression_With_Actions): Ditto.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch13.adb (Analyze_Aspect_Specifications):
+ Add a guard to prevent the double insertion of the same aspect
+ into a rep item list. This previously led to a circularity.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb (Eval_Attribute, case 'Access): Reject attribute
+ reference if the prefix is the dereference of an anonymous access
+ to subprogram type.
+ * exp_attr.adb (Expand_N_Attribute_Reference, Access_Cases): Handle
+ properly a reference to the current instance of a protected type
+ from within a protected subprogram.
+ * sem_res.adb (Find_Unique_Access_Type): Treat
+ Attribute_Access_Type like Allocator_Type when resolving an
+ equality operator.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * xgnatugn.adb: Remove obsolete comments.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * back_end.ads, back_end.adb: Minor reformatting.
+ * set_targ.ads, set_targ.adb: New files.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_case.adb (Check_Against_Predicate): New routine.
+ (Check_Choices): When the type covered by the list of choices
+ is a static subtype with a static predicate, check all choices
+ agains the predicate.
+ (Issue_Msg): All versions removed.
+ (Missing_Choice): New routines.
+ * sem_ch4.adb: Code and comment reformatting.
+ (Analyze_Case_Expression): Do not check the choices when the case
+ expression is being preanalyzed and the type of the expression
+ is a subtype with a static predicate.
+ (Has_Static_Predicate): New routine.
+ * sem_ch13.adb: Code and comment reformatting. (Build_Range):
+ Always build a range even if the low and hi bounds denote the
+ same value. This is needed by the machinery in Check_Choices.
+ (Build_Static_Predicate): Always build a range even if the low and
+ hi bounds denote the same value. This is needed by the machinery
+ in Check_Choices.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * einfo.ads, sem_util.adb, exp_ch6.adb, xgnatugn.adb: Minor
+ reformatting.
+
+2013-04-11 Doug Rupp <rupp@adacore.com>
+
+ * gnatlink.adb: Fold program basename to lower case on VMS for
+ consistency.
+
+2013-04-11 Matthew Heaney <heaney@adacore.com>
+
+ * a-rbtgbo.adb (Generic_Equal): Initialize Result variable before
+ entering loop.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * xgnatugn.adb: Remove dead code (handling of @ifset/@ifclear).
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat_ugn.texi: Remove some use of ifset in menus. Not strictly
+ needed, and seems to confuse some versions of makeinfo.
+
+2013-04-11 Javier Miranda <miranda@adacore.com>
+
+ * einfo.adb (Is_Thunk): Remove assertion.
+ (Set_Is_Thunk): Add assertion.
+ * einfo.ads (Is_Thunk): Complete documentation.
+ * exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Code cleanup.
+ * exp_ch3.ad[sb] (Is_Variable_Size_Array): Moved to sem_util
+ (Is_Variable_Size_Record): Moved to sem_util
+ * exp_ch6.adb (Expand_Call): Code cleanup.
+ (Expand_N_Extended_Return_Statement): Code cleanup.
+ (Expand_Simple_Function_Return): Code cleanup.
+ * exp_disp.adb Remove dependency on exp_ch3
+ (Expand_Interface_Thunk): Add minimum decoration needed to set
+ attribute Is_Thunk.
+ * sem_ch3.ad[sb] (Is_Constant_Bound): moved to sem_util
+ * sem_util.ad[sb] (Is_Constant_Bound): Moved from
+ sem_ch3 (Is_Variable_Size_Array): Moved from exp_ch3
+ (Is_Variable_Size_Record): Moved from exp_ch3
+
+2013-04-11 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Do
+ not add cleanup actions in thunks associated with interface types.
+ * exp_ch3.ad[sb] (Is_Variable_Size_Record): Move declaration to
+ the package spec.
+ * exp_ch4.adb (Tagged_Conversion): Update call to
+ Expand_Interface_Conversion since the parameter Is_Static is no
+ longer needed.
+ * exp_ch6.adb (Expand_N_Extended_Return_Statement): Adding
+ assertion to ensure that interface thunks are never handled by
+ this routine.
+ (Expand_N_Simple_Function_Return): Do not rewrite this statement
+ as an extended return statement in interface thunks, and do not
+ perform copy in the secondary stack if the return statement is
+ located in a thunk.
+ * exp_disp.adb (Expand_Dispatching_Call): No longer displace
+ the pointer to the returned object in functions returning interface
+ types.
+ (Expand_Interface_Thunk): For functions returning interface types
+ displace the pointer to the returned object.
+ (Expand_Interface_Conversion): Remove formal
+ Is_Static since this subprogram can now evaluate it locally.
+ * sem_ch3.adb (Add_Internal_Interface_Entities): For functions
+ propagate the type returned by the covered interface primitive to
+ the internal interface entity. Needed by the thunk to generate
+ the code which displaces "this" to reference the corresponding
+ secondary dispatch table.
+ * sem_disp.adb (Propagate_Tag): Update call to
+ Expand_Interface_Conversion since the parameter Is_Static is no
+ longer needed.
+ * sem_res.adb (Resolve_Type_Conversion): Update calls to
+ Expand_Interface_Conversion since the parameter Is_Static is no
+ longer needed plus code cleanup.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * init.c (RETURN_ADDR_OFFSET): Delete as unused.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * a-crbtgk.adb, a-ciorse.adb, a-crbtgo.adb, a-coorse.adb, a-rbtgbo.adb,
+ a-cborse.adb, a-rbtgso.adb, exp_ch3.adb: Minor reformatting.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Selected_Component): Do not expand
+ discriminant check for Unchecked_Union.
+ * sem_res.adb (Resolve_Selected_Component): Set flag
+ Do_Discriminant_Check even when expansion is not performed.
+ * sinfo.ads (Do_Discriminant_Check): Update documentation for the case
+ of Unchecked_Union.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch13.adb (Same_Representation): Two types with different scalar
+ storage order never have the same representation.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * xgnatugn.adb (Push_Conditional): Simplify handling,
+ no longer need to keep track of "excluding" sections.
+ (Currently_Excluding): Removed.
+ (Process_Source_File):
+ Set unw/vms flag so that texinfo can do the whole handling of
+ @ifset/@ifclear sections. Fix handling of nested @ifset/@ifclear
+ sections.
+ * gnat_ugn.texi: Add a section on performing unassisted install
+ on Windows.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * debug.adb: Document usage of -gnatd.Q switch.
+
+2013-04-11 Matthew Heaney <heaney@adacore.com>
+
+ * a-crbtgk.adb (Ceiling, Find, Floor): Adjust locks
+ before element comparisons.
+ (Generic_Conditional_Insert, Generic_Conditional_Insert_With_Hint):
+ Ditto.
+ * a-crbtgo.adb, a-rbtgbo.adb (Generic_Equal): Adjust locks before
+ element comparisons.
+ * a-rbtgso.adb (Difference, Intersection): Adjust locks
+ before element comparisons.
+ (Is_Subset, Overlap): Ditto
+ (Symmetric_Difference, Union): Ditto
+ * a-btgbso.adb (Set_Difference, Set_Intersection): Adjust locks
+ before element comparisons.
+ (Set_Subset, Set_Overlap): Ditto
+ (Set_Symmetric_Difference, Set_Union): Ditto
+ * a-coorse.adb, a-ciorse.adb, a-cborse.adb
+ (Update_Element_Preserving_Key): Adjust locks before element
+ comparisons (Replace_Element): Ditto
+
+2013-04-11 Pascal Obry <obry@adacore.com>
+
+ * prj-attr.adb, projects.texi, snames.ads-tmpl: Remove Build_Slaves
+ attribute.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch3.adb (Build_Equivalent_Aggregate): Subsidiary of
+ Expand_N_Object_Declaration, used to construct an aggregate
+ with static components whenever possible, so that objects of a
+ discriminated type can be initialized without calling the init.
+ proc for the type.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * prj-makr.adb (Process_Directory): On VMS, always delete,
+ then recreate the temporary file with Create_Output_Text_File,
+ otherwise the output redirection does not work properly.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * urealp.ads: Fix minor typo.
+
+2013-04-11 Fabien Chouteau <chouteau@adacore.com>
+
+ * cio.c (mktemp): Don't use tmpnam function from the
+ system on VxWorks in kernel mode.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Compile): Clarify the error message reported
+ when gnatmake refuses to compile a runtime source.
+ (Start_Compile_If_Possible): Ditto.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Add documentation about -gnatc and gnatmake.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * switch-c.adb: Document internal switches.
+ * usage.adb: Remove lines for internal switches: -gnatea, -gnateO,
+ -gnatez and -gnateO.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * par-ch6.adb (P_Subprogram): Attach aspects to subprogram stub.
+ * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Allow aspects on
+ subprogram stubs.
+ * sem_ch13.adb (Analyze_Aspect_Specifications): Analyze generated
+ pre/post pragmas at once before analyzing the proper body.
+ * sem_prag.adb (Chain_PPC): Handle pragma that comes from an
+ aspect on a subprogram stub.
+ * aspects.adb: Aspect specifications can appear on a
+ subprogram_Body_Stub.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnatname.adb: Minor comment fix.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * prj-makr.adb (Process_Directory): Create a new temporary
+ file for each invocation of the compiler, in directory pointed
+ by environment variable TMPDIR if it exists.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat_ugn.texi: Minor editing/clean ups.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Null_Procedure): New subprogram, mostly
+ extracted from Analyze_Subprogram_Declaration, to handle null
+ procedure declarations that in ada 2012 can be completions of
+ previous declarations.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Entity_Of): Moved to Exp_Util.
+ * exp_util.ads, exp_util.adb (Entity_Of): New routine.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * g-spipat.ads: Minor comment fix.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb, sem_util.adb, sem_res.adb, exp_ch4.adb: Minor
+ reformatting.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * exp_util.ads (Fully_Qualified_Name_String): Document that the
+ constructed literal is the entity name in all upper case.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * sem_util.adb (Set_Entity_With_Style_Check): Fix logic of
+ check for implementation defined identifiers.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * checks.adb (Apply_Type_Conversion_Checks): Add an explanation
+ of why range check and length are put on different nodes.
+ * exp_ch4.adb (Apply_Type_Conversion_Checks): Remove check marks
+ when doing their expansion.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.ads, sem_util.adb (Get_Incomplete_View_Of_Ancestor):
+ New function to implement the notion introduced in RM 7.3.1
+ (5.2/3): in a child unit, a derived type is within the derivation
+ class of an ancestor declared in a parent unit, even if there
+ is an intermediate derivation that does not see the full view
+ of that ancestor.
+ * sem_res.adb (Valid_Conversion): if all else fails, examine if an
+ incomplete view of an ancestor makes a numeric conversion legal.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb: in Ada2012 operators can only have in
+ parameters.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * makeutl.adb (Create_Binder_Mapping_File): Do not put into
+ the mapping file ALI files of sources that have been replaced.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * projects.texi: Add subsection Duplicate Sources in Projects.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Add documentation for gnatmake switch -droot_dir/**
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * init.c (__gnat_install_handler): Only set up an alternate
+ stack when installing a signal handler for SIGSEGV.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * g-socket.adb (Connect_Socket, timeout version): Call
+ underlying connect operation directly, not through the 2-argument
+ Connect_Socket thick binding, in order to avoid raising a junk
+ exception for the EINPROGRESS return.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * a-cdlili.adb: Minor addition of pragma Warnings (Off).
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * hostparm.ads: Minor reformatting.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * aspects.ads, aspects.adb: Add Aspect_Depends to all the relevant
+ tables.
+ * elists.ads, elists.adb (Contains): New routine.
+ * par-prag.adb: Pragma Depends does not need any special treatment
+ by the parser.
+ * sem_ch13.adb (Analyze_Aspect_Specifications):
+ Transform aspect Depends into a corresponding pragma.
+ (Check_Aspect_At_Freeze_Point): Aspect Depends does not need
+ inspection at its freeze point.
+ * sem_prag.adb (Analyze_Pragma): Perform analysis and
+ normalization of pragma Depends. Remove the use of function
+ Is_Duplicate_Item. Use End_Scope to uninstalle the formal
+ parameters of a subprogram. Add a value for pragma Depends in
+ table Sig_Flags.
+ (Is_Duplicate_Item): Removed.
+ * snames.ads-tmpl: Add predefined name for Depends as well as
+ a pragma identifier.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat1drv.adb: Minor code clean up.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * debug.adb, sem_ch13.adb (Analyze_Enumeration_Representation_Clause):
+ Ignore enumeration rep clauses by default in CodePeer mode, unless
+ -gnatd.I is specified.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.adb (Safe_To_Capture_Value): If the node belongs to
+ an expression that has been attached to the else_actions of an
+ if-expression, the capture is not safe.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * checks.adb (Apply_Type_Conversion_Checks): Put check mark on type
+ conversion for arrays.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb: Minor reformatting.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * adabkend.adb: Minor comment addition.
+
+2013-04-11 Matthew Heaney <heaney@adacore.com>
+
+ * a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb ("="): Increment
+ lock counts before entering loop.
+ (Find): Ditto.
+ (Is_Sorted, Merge, Sort): Ditto.
+ (Reverse_Find): Ditto.
+ (Splice_Internal): Internal operation to refactor splicing logic.
+ (Splice): Some logic moved into Splice_Internal.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * adabkend.adb (Scan_Compiler_Arguments): Do not call
+ Set_Output_Object_File_Name in Alfa_Mode
+ * gnat1drv.adb (Adjust_Global_Switches): Take Alfa_Mode into account.
+ * opt.ads: Fix documentation.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * sem_res.adb: Minor code reorganization and comment fixes.
+ * sem_type.adb: Minor reformatting.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch4.adb (Process_Transient_Object): Add new
+ local variable Fin_Call. Remove and explain ??? comment. Use the
+ Actions of logical operators "and then" and "or else" to insert
+ the generated finalization call.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat_rm.texi: Fix typo.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb: Minor reformatting.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * atree.h: Add declarations for Flag255-Flag289 Fix declaration
+ of Field30 (was wrong, but no effect, since not yet referenced by
+ back end) Add declarations for Field31-Field35 Add declarations
+ for Node31-Node35.
+ * einfo.ads, einfo.adb (Has_Invariants): No longer applies to
+ procedures.
+ (Has_Predicates): No longer applies to functions.
+ (Is_Predicate_Function): New flag.
+ (Is_Predicate_Function_M): New flag.
+ (Is_Invariant_Procedure): New flag.
+ (Predicate_Function_M): New function.
+ (Set_Predicate_Function_M): New procedure.
+ * exp_ch11.adb (Expand_N_Raise_Expression): Take care of special
+ case of appearing in predicate used for membership test.
+ * exp_ch3.adb (Insert_Component_Invariant_Checks): Set
+ Is_Invariant_Procedure flag.
+ * exp_ch4.adb (Expand_Op_In): Call special predicate function
+ that takes care of raise_expression nodes in the predicate.
+ * exp_util.ads, exp_util.adb (Make_Predicate_Call): Add argument Mem for
+ membership case.
+ * sem_ch13.adb (Build_Predicate_Functions): New name for
+ Build_Predicate_Function. Major rewrite to take care of raise
+ expression in predicate for membership tests.
+ * sem_res.adb (Resolve_Actuals): Include both predicate functions
+ in defense against infinite predicate function loops.
+ * sinfo.ads, sinfo.adb (Convert_To_Return_False): New flag.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb: Minor reformatting.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * lib-xref.adb: Generate reference for component of anonymous
+ access type.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * stand.ads: Minor reformatting.
+
+2013-04-11 Matthew Heaney <heaney@adacore.com>
+
+ * a-convec.adb, a-coinve.adb, a-cobove.adb ("="): Increment lock
+ counts before entering loop.
+ (Find, Find_Index): Ditto.
+ (Is_Sorted, Merge, Sort): Ditto.
+ (Reverse_Find, Reverse_Find_Index): Ditto.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch11.ads, exp_ch11.adb (Expand_N_Raise_Expression): New procedure.
+ * exp_util.adb (Insert_Actions): Add entry for N_Raise_Expression.
+ * expander.adb: Add call to Expand_N_Raise_Expression.
+ * par-ch11.adb (P_Raise_Expression): New procedure.
+ * par-ch4.adb (P_Relation): Handle Raise_Expression.
+ * par.adb (P_Raise_Expression): New procedure.
+ * sem.adb: Add handling for N_Raise_Expression.
+ * sem_ch11.ads, sem_ch11.adb (Analyze_Raise_Expression): New procedure.
+ * sem_res.adb (Resolve): Add handling for N_Raise_Expression.
+ * sinfo.ads, sinfo.adb (N_Raise_Expression): New node.
+ * sprint.adb (Sprint_Node_Actual): Add handling for N_Raise_Expression.
+ * stand.ads (Any_Type): Document use with N_Raise_Expression.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Remove section "The Development Environments"
+ now that all predefined attributes are documented, including
+ those in package IDE.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb: Preserve parent link in copy of expression.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * projects.texi: Complete rewrite of the subsection Attributes
+ in section "Project file Reference".
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb: Minor reformatting.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb (Expand_Concatenate): Remove wrapping in
+ expression-with-actions node. No longer needed given fix to
+ sem_prag and caused loss of some useful warnings.
+ * sem.ads: Minor reformatting.
+ * sem_prag.adb (Check_Disabled): Removed, to be replaced by not
+ Check_Enabled. These two routines were curiously incompatible
+ causing confusion.
+ (Analyze_Pragma, case Check): Make sure we do
+ not expand the string argument if the check is disabled. Avoid
+ use of Check_Disabled, which resulted in missing analysis in
+ some cases.
+ * sem_prag.ads (Check_Disabled): Removed, to be replaced by not
+ Check_Enabled. These two routines were curiously incompatible
+ causing confusion.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch4.adb (Process_Transient_Object): Use
+ an unchecked conversion when associating a transient controlled
+ object with its "hook".
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case
+ Preelaborable_Initialization): The pragma is legal if it comes
+ from an aspect on the private view of the type, even though its
+ analysis point takes place later at the freeze point.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch6.adb: Minor reformatting.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * ali-util.adb (Read_Withed_ALIs): Do not consider it an error to
+ read ALI files with No_Object=True in Alfa mode.
+ * gnat1drv.adb: Set appropriately Back_End_Mode in Alfa mode, whether
+ this is during frame condition generation of translation to Why.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb: Minor code reorganization
+ * types.ads: Minor reformatting.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * opt.ads New global boolean Frame_Condition_Mode to avoid
+ referring to command line switch.
+ * gnat1drv.adb (Gnat1drv) set frame condition mode when -gnatd.G
+ is present, and disable Code generation in that case. Disable
+ ALI file generation when switch is *not* present.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Expression_Function): Perform the
+ pre-analysis on a copy of the expression, to prevent downstream
+ visbility issues involving operators and instantiations.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * debug.adb: Reservation and documentation for -gnatd.G switch.
+ * gnat1drv.adb (Adjust_Global_Switches) Take into account -gnatd.G
+ switch, and set ALI file generation accordingly.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb, exp_dist.adb: Minor reformatting.
+ * gnat_rm.texi, gnat_ugn.texi: -020 Add documentation clarifying that
+ check names introduced with pragma Check_Name are suppressed by -gnatp.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi, projects.texi: Move chapter "Tools Supporting Project
+ Files" from projects.texi to gnat_ugn.texi.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2013-04-11 Yannick Moy <moy@adacore.com>
+
+ * gnat1drv.adb (Adjust_Global_Switches): Allow missing body in Alfa
+ mode.
+
+2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Allocator): Detect the
+ allocation of an anonymous controlled object where the type of
+ the context is named. Use the pool and finalization master of
+ the named access type to allocate the object.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Remove most mentions of gprbuild.
+ * projects.texi: Remove all mentions of asociative array
+ attributes.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb, sem_attr.adb, gnat1drv.adb, prj-makr.adb,
+ opt.ads, sem_ch13.adb: Minor reformatting.
+ * debug.adb: Minor comment fix (remove junk .I doc).
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * rtsfind.ads, exp_dist.adb, exp_dist.ads (Rtsfind.PCS_Version, case
+ PolyORB): Bump to 6.
+ (Exp_Dist.PolyORB_Support): Replace TC_Build with
+ Build_Complex_TC.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * debug.adb, sem_prag.adb, par-ch2.adb, sem_attr.adb, gnat1drv.adb,
+ exp_disp.adb, opt.ads, sem_ch13.adb (Relaxed_RM_Semantics): New flag.
+ Enable this flag in CodePeer mode, and also via -gnatd.M.
+ Replace some uses of CodePeer_Mode by Relaxed_RM_Semantics.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Check_Constrained_Object): If a subtype is created
+ from the renamed object in an object renaming declaration with
+ an unconstrained nominal subtype, freeze the created subtype at
+ once, to prevent order of elaboration issues in the backend.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_aggr.adb (Aggr_Size_OK): Refine setting of Max_Aggr_Size
+ in particular in CodePeer mode.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Add documentation for backup copies of project
+ files for gnatname.
+
+2013-04-11 Tristan Gingold <gingold@adacore.com>
+
+ * gnat_rm.texi: Add Detect_BLocking in the ravenscar profile
+ pragma list.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnatname.adb (Scan_Args): Recognize new switch --no-backup
+ (Usage): Add line for --no-backup.
+ * opt.ads (No_Backup): New Boolean variable, initialized to False.
+ (Ada_Version_Default): Switch to Ada 2012 by default.
+ * prj-makr.adb (Initialize): Create a backup for an existing
+ project file if gnatname is not invoked with --no-backup.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch4.adb: Minor code improvement: replace various calls to
+ Make_If_Statement in expansion with Make_Implicit_If_Statement.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ali.adb: Fix minor typo.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch4.adb (Find_Enclosing_Context): Add missing case of
+ N_Procedure_Call_Statement.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * debug.adb: Minor comment fix.
+
+2013-04-11 Johannes Kanig <kanig@adacore.com>
+
+ * debug.adb: Remove comment for -gnatd.G.
+
+2013-04-11 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch4.adb (Expand_Record_Equality.Suitable_Element):
+ Remove recursive routine, replace with...
+ (Expand_Record_Equality.Element_To_Compare): New subroutine,
+ implement iterative search for next element to compare.
+ Add explanatory comment in the tagged case.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb: remove spurious warning from non-empty loop.
+ * sem_ch8.adb (Enclosing_Instance): Make public to other routines
+ in the package, in order to suppress redundant semantic checks
+ on subprogram renamings in nested instantiations.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * errout.ads: Minor reformatting.
+ * sem_eval.adb (Why_Not_Static): Now issues continuation messages
+ (Why_Not_Static): Test for aggregates behind string literals.
+ * sem_eval.ads (Why_Not_Static): Now issues continuation messages.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb (Expand_Concatenation): Wrap expansion in
+ Expressions_With_Actions.
+
+2013-04-11 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Base_Types_Match): For an actual type in an
+ instance, the base type may itself be a subtype, so find true
+ base type to determine compatibility.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * s-osprim-mingw.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb.
+ makeutl.adb, sem_ch8.adb: Minor reformatting.
+
+2013-04-11 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Minor fixes for VMS.
+ * ug_words: Minor addition: -gnato? => /OVERFLOW_CHECKS=?.
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * usage.adb (Usage): Minor edit to -gnatW message
+
+2013-04-11 Robert Dewar <dewar@adacore.com>
+
+ * exp_aggr.adb (Expand_N_Aggregate): Add circuit for handling
+ others for string literal case. Also add big ??? comment about
+ this new code, which should be redundant, but is not.
+ * sem_eval.adb (Eval_Concatenation): Handle non-static case
+ properly (Eval_String_Literal): Handle non-static literal properly
+
2013-03-20 Tobias Burnus <burnus@net-b.de>
* i-fortra.ads: Update comment, add Ada 2012's optional
diff --git a/gcc/ada/a-btgbso.adb b/gcc/ada/a-btgbso.adb
index b62007aafb3..2aef270f64d 100644
--- a/gcc/ada/a-btgbso.adb
+++ b/gcc/ada/a-btgbso.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -53,11 +53,19 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
----------------
procedure Set_Difference (Target : in out Set_Type; Source : Set_Type) is
+ BT : Natural renames Target.Busy;
+ LT : Natural renames Target.Lock;
+
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
Tgt, Src : Count_Type;
TN : Nodes_Type renames Target.Nodes;
SN : Nodes_Type renames Source.Nodes;
+ Compare : Integer;
+
begin
if Target'Address = Source'Address then
if Target.Busy > 0 then
@@ -82,17 +90,51 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
Src := Source.First;
loop
if Tgt = 0 then
- return;
+ exit;
end if;
if Src = 0 then
- return;
+ exit;
end if;
- if Is_Less (TN (Tgt), SN (Src)) then
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ begin
+ BT := BT + 1;
+ LT := LT + 1;
+
+ BS := BS + 1;
+ LS := LS + 1;
+
+ if Is_Less (TN (Tgt), SN (Src)) then
+ Compare := -1;
+ elsif Is_Less (SN (Src), TN (Tgt)) then
+ Compare := 1;
+ else
+ Compare := 0;
+ end if;
+
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+ exception
+ when others =>
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
+
+ if Compare < 0 then
Tgt := Tree_Operations.Next (Target, Tgt);
- elsif Is_Less (SN (Src), TN (Tgt)) then
+ elsif Compare > 0 then
Src := Tree_Operations.Next (Source, Src);
else
@@ -111,12 +153,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
end Set_Difference;
function Set_Difference (Left, Right : Set_Type) return Set_Type is
- L_Node : Count_Type;
- R_Node : Count_Type;
-
- Dst_Node : Count_Type;
- pragma Warnings (Off, Dst_Node);
-
begin
if Left'Address = Right'Address then
return S : Set_Type (0); -- Empty set
@@ -131,15 +167,51 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
end if;
return Result : Set_Type (Left.Length) do
- L_Node := Left.First;
- R_Node := Right.First;
- loop
- if L_Node = 0 then
- return;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if R_Node = 0 then
- while L_Node /= 0 loop
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ L_Node : Count_Type;
+ R_Node : Count_Type;
+
+ Dst_Node : Count_Type;
+ pragma Warnings (Off, Dst_Node);
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = 0 then
+ exit;
+ end if;
+
+ if R_Node = 0 then
+ while L_Node /= 0 loop
+ Insert_With_Hint
+ (Dst_Set => Result,
+ Dst_Hint => 0,
+ Src_Node => Left.Nodes (L_Node),
+ Dst_Node => Dst_Node);
+
+ L_Node := Tree_Operations.Next (Left, L_Node);
+ end loop;
+
+ exit;
+ end if;
+
+ if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
Insert_With_Hint
(Dst_Set => Result,
Dst_Hint => 0,
@@ -147,28 +219,31 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
Dst_Node => Dst_Node);
L_Node := Tree_Operations.Next (Left, L_Node);
- end loop;
- return;
- end if;
+ elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
+ R_Node := Tree_Operations.Next (Right, R_Node);
- if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
- Insert_With_Hint
- (Dst_Set => Result,
- Dst_Hint => 0,
- Src_Node => Left.Nodes (L_Node),
- Dst_Node => Dst_Node);
+ else
+ L_Node := Tree_Operations.Next (Left, L_Node);
+ R_Node := Tree_Operations.Next (Right, R_Node);
+ end if;
+ end loop;
- L_Node := Tree_Operations.Next (Left, L_Node);
+ BL := BL - 1;
+ LL := LL - 1;
- elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
- R_Node := Tree_Operations.Next (Right, R_Node);
+ BR := BR - 1;
+ LR := LR - 1;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
- else
- L_Node := Tree_Operations.Next (Left, L_Node);
- R_Node := Tree_Operations.Next (Right, R_Node);
- end if;
- end loop;
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end return;
end Set_Difference;
@@ -180,9 +255,17 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
(Target : in out Set_Type;
Source : Set_Type)
is
+ BT : Natural renames Target.Busy;
+ LT : Natural renames Target.Lock;
+
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
Tgt : Count_Type;
Src : Count_Type;
+ Compare : Integer;
+
begin
if Target'Address = Source'Address then
return;
@@ -203,7 +286,41 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
while Tgt /= 0
and then Src /= 0
loop
- if Is_Less (Target.Nodes (Tgt), Source.Nodes (Src)) then
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ begin
+ BT := BT + 1;
+ LT := LT + 1;
+
+ BS := BS + 1;
+ LS := LS + 1;
+
+ if Is_Less (Target.Nodes (Tgt), Source.Nodes (Src)) then
+ Compare := -1;
+ elsif Is_Less (Source.Nodes (Src), Target.Nodes (Tgt)) then
+ Compare := 1;
+ else
+ Compare := 0;
+ end if;
+
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+ exception
+ when others =>
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
+
+ if Compare < 0 then
declare
X : constant Count_Type := Tgt;
begin
@@ -213,7 +330,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
Tree_Operations.Free (Target, X);
end;
- elsif Is_Less (Source.Nodes (Src), Target.Nodes (Tgt)) then
+ elsif Compare > 0 then
Src := Tree_Operations.Next (Source, Src);
else
@@ -235,46 +352,80 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
end Set_Intersection;
function Set_Intersection (Left, Right : Set_Type) return Set_Type is
- L_Node : Count_Type;
- R_Node : Count_Type;
-
- Dst_Node : Count_Type;
- pragma Warnings (Off, Dst_Node);
-
begin
if Left'Address = Right'Address then
return Copy (Left);
end if;
return Result : Set_Type (Count_Type'Min (Left.Length, Right.Length)) do
- L_Node := Left.First;
- R_Node := Right.First;
- loop
- if L_Node = 0 then
- return;
- end if;
- if R_Node = 0 then
- return;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
- L_Node := Tree_Operations.Next (Left, L_Node);
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
- elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
- R_Node := Tree_Operations.Next (Right, R_Node);
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
- else
- Insert_With_Hint
- (Dst_Set => Result,
- Dst_Hint => 0,
- Src_Node => Left.Nodes (L_Node),
- Dst_Node => Dst_Node);
+ L_Node : Count_Type;
+ R_Node : Count_Type;
- L_Node := Tree_Operations.Next (Left, L_Node);
- R_Node := Tree_Operations.Next (Right, R_Node);
- end if;
- end loop;
+ Dst_Node : Count_Type;
+ pragma Warnings (Off, Dst_Node);
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = 0 then
+ exit;
+ end if;
+
+ if R_Node = 0 then
+ exit;
+ end if;
+
+ if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
+ L_Node := Tree_Operations.Next (Left, L_Node);
+
+ elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
+ R_Node := Tree_Operations.Next (Right, R_Node);
+
+ else
+ Insert_With_Hint
+ (Dst_Set => Result,
+ Dst_Hint => 0,
+ Src_Node => Left.Nodes (L_Node),
+ Dst_Node => Dst_Node);
+
+ L_Node := Tree_Operations.Next (Left, L_Node);
+ R_Node := Tree_Operations.Next (Right, R_Node);
+ end if;
+ end loop;
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end return;
end Set_Intersection;
@@ -286,9 +437,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
(Subset : Set_Type;
Of_Set : Set_Type) return Boolean
is
- Subset_Node : Count_Type;
- Set_Node : Count_Type;
-
begin
if Subset'Address = Of_Set'Address then
return True;
@@ -298,28 +446,75 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
return False;
end if;
- Subset_Node := Subset.First;
- Set_Node := Of_Set.First;
- loop
- if Set_Node = 0 then
- return Subset_Node = 0;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if Subset_Node = 0 then
- return True;
- end if;
+ declare
+ BL : Natural renames Subset'Unrestricted_Access.Busy;
+ LL : Natural renames Subset'Unrestricted_Access.Lock;
- if Is_Less (Subset.Nodes (Subset_Node), Of_Set.Nodes (Set_Node)) then
- return False;
- end if;
+ BR : Natural renames Of_Set'Unrestricted_Access.Busy;
+ LR : Natural renames Of_Set'Unrestricted_Access.Lock;
- if Is_Less (Of_Set.Nodes (Set_Node), Subset.Nodes (Subset_Node)) then
- Set_Node := Tree_Operations.Next (Of_Set, Set_Node);
- else
- Set_Node := Tree_Operations.Next (Of_Set, Set_Node);
- Subset_Node := Tree_Operations.Next (Subset, Subset_Node);
- end if;
- end loop;
+ Subset_Node : Count_Type;
+ Set_Node : Count_Type;
+
+ Result : Boolean;
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ Subset_Node := Subset.First;
+ Set_Node := Of_Set.First;
+ loop
+ if Set_Node = 0 then
+ Result := Subset_Node = 0;
+ exit;
+ end if;
+
+ if Subset_Node = 0 then
+ Result := True;
+ exit;
+ end if;
+
+ if Is_Less (Subset.Nodes (Subset_Node),
+ Of_Set.Nodes (Set_Node))
+ then
+ Result := False;
+ exit;
+ end if;
+
+ if Is_Less (Of_Set.Nodes (Set_Node),
+ Subset.Nodes (Subset_Node))
+ then
+ Set_Node := Tree_Operations.Next (Of_Set, Set_Node);
+ else
+ Set_Node := Tree_Operations.Next (Of_Set, Set_Node);
+ Subset_Node := Tree_Operations.Next (Subset, Subset_Node);
+ end if;
+ end loop;
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end Set_Subset;
-------------
@@ -327,33 +522,72 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
-------------
function Set_Overlap (Left, Right : Set_Type) return Boolean is
- L_Node : Count_Type;
- R_Node : Count_Type;
-
begin
if Left'Address = Right'Address then
return Left.Length /= 0;
end if;
- L_Node := Left.First;
- R_Node := Right.First;
- loop
- if L_Node = 0
- or else R_Node = 0
- then
- return False;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
- L_Node := Tree_Operations.Next (Left, L_Node);
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
- elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
- R_Node := Tree_Operations.Next (Right, R_Node);
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
- else
- return True;
- end if;
- end loop;
+ L_Node : Count_Type;
+ R_Node : Count_Type;
+
+ Result : Boolean;
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = 0
+ or else R_Node = 0
+ then
+ Result := False;
+ exit;
+ end if;
+
+ if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
+ L_Node := Tree_Operations.Next (Left, L_Node);
+
+ elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
+ R_Node := Tree_Operations.Next (Right, R_Node);
+
+ else
+ Result := True;
+ exit;
+ end if;
+ end loop;
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end Set_Overlap;
--------------------------
@@ -364,18 +598,21 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
(Target : in out Set_Type;
Source : Set_Type)
is
+ BT : Natural renames Target.Busy;
+ LT : Natural renames Target.Lock;
+
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
Tgt : Count_Type;
Src : Count_Type;
New_Tgt_Node : Count_Type;
pragma Warnings (Off, New_Tgt_Node);
- begin
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors (container is busy)";
- end if;
+ Compare : Integer;
+ begin
if Target'Address = Source'Address then
Tree_Operations.Clear_Tree (Target);
return;
@@ -402,10 +639,44 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
return;
end if;
- if Is_Less (Target.Nodes (Tgt), Source.Nodes (Src)) then
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ begin
+ BT := BT + 1;
+ LT := LT + 1;
+
+ BS := BS + 1;
+ LS := LS + 1;
+
+ if Is_Less (Target.Nodes (Tgt), Source.Nodes (Src)) then
+ Compare := -1;
+ elsif Is_Less (Source.Nodes (Src), Target.Nodes (Tgt)) then
+ Compare := 1;
+ else
+ Compare := 0;
+ end if;
+
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+ exception
+ when others =>
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
+
+ if Compare < 0 then
Tgt := Tree_Operations.Next (Target, Tgt);
- elsif Is_Less (Source.Nodes (Src), Target.Nodes (Tgt)) then
+ elsif Compare > 0 then
Insert_With_Hint
(Dst_Set => Target,
Dst_Hint => Tgt,
@@ -432,12 +703,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
function Set_Symmetric_Difference
(Left, Right : Set_Type) return Set_Type
is
- L_Node : Count_Type;
- R_Node : Count_Type;
-
- Dst_Node : Count_Type;
- pragma Warnings (Off, Dst_Node);
-
begin
if Left'Address = Right'Address then
return S : Set_Type (0); -- Empty set
@@ -452,25 +717,62 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
end if;
return Result : Set_Type (Left.Length + Right.Length) do
- L_Node := Left.First;
- R_Node := Right.First;
- loop
- if L_Node = 0 then
- while R_Node /= 0 loop
- Insert_With_Hint
- (Dst_Set => Result,
- Dst_Hint => 0,
- Src_Node => Right.Nodes (R_Node),
- Dst_Node => Dst_Node);
- R_Node := Tree_Operations.Next (Right, R_Node);
- end loop;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- return;
- end if;
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
- if R_Node = 0 then
- while L_Node /= 0 loop
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ L_Node : Count_Type;
+ R_Node : Count_Type;
+
+ Dst_Node : Count_Type;
+ pragma Warnings (Off, Dst_Node);
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = 0 then
+ while R_Node /= 0 loop
+ Insert_With_Hint
+ (Dst_Set => Result,
+ Dst_Hint => 0,
+ Src_Node => Right.Nodes (R_Node),
+ Dst_Node => Dst_Node);
+
+ R_Node := Tree_Operations.Next (Right, R_Node);
+ end loop;
+
+ exit;
+ end if;
+
+ if R_Node = 0 then
+ while L_Node /= 0 loop
+ Insert_With_Hint
+ (Dst_Set => Result,
+ Dst_Hint => 0,
+ Src_Node => Left.Nodes (L_Node),
+ Dst_Node => Dst_Node);
+
+ L_Node := Tree_Operations.Next (Left, L_Node);
+ end loop;
+
+ exit;
+ end if;
+
+ if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
Insert_With_Hint
(Dst_Set => Result,
Dst_Hint => 0,
@@ -478,34 +780,37 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
Dst_Node => Dst_Node);
L_Node := Tree_Operations.Next (Left, L_Node);
- end loop;
- return;
- end if;
+ elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
+ Insert_With_Hint
+ (Dst_Set => Result,
+ Dst_Hint => 0,
+ Src_Node => Right.Nodes (R_Node),
+ Dst_Node => Dst_Node);
- if Is_Less (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
- Insert_With_Hint
- (Dst_Set => Result,
- Dst_Hint => 0,
- Src_Node => Left.Nodes (L_Node),
- Dst_Node => Dst_Node);
+ R_Node := Tree_Operations.Next (Right, R_Node);
- L_Node := Tree_Operations.Next (Left, L_Node);
+ else
+ L_Node := Tree_Operations.Next (Left, L_Node);
+ R_Node := Tree_Operations.Next (Right, R_Node);
+ end if;
+ end loop;
- elsif Is_Less (Right.Nodes (R_Node), Left.Nodes (L_Node)) then
- Insert_With_Hint
- (Dst_Set => Result,
- Dst_Hint => 0,
- Src_Node => Right.Nodes (R_Node),
- Dst_Node => Dst_Node);
+ BL := BL - 1;
+ LL := LL - 1;
- R_Node := Tree_Operations.Next (Right, R_Node);
+ BR := BR - 1;
+ LR := LR - 1;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
- else
- L_Node := Tree_Operations.Next (Left, L_Node);
- R_Node := Tree_Operations.Next (Right, R_Node);
- end if;
- end loop;
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end return;
end Set_Symmetric_Difference;
@@ -541,17 +846,34 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
return;
end if;
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors (container is busy)";
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- -- Note that there's no way to decide a priori whether the target has
- -- enough capacity for the union with source. We cannot simply compare
- -- the sum of the existing lengths to the capacity of the target,
- -- because equivalent items from source are not included in the union.
+ declare
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
- Iterate (Source);
+ begin
+ BS := BS + 1;
+ LS := LS + 1;
+
+ -- Note that there's no way to decide a priori whether the target has
+ -- enough capacity for the union with source. We cannot simply
+ -- compare the sum of the existing lengths to the capacity of the
+ -- target, because equivalent items from source are not included in
+ -- the union.
+
+ Iterate (Source);
+
+ BS := BS - 1;
+ LS := LS - 1;
+ exception
+ when others =>
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
end Set_Union;
function Set_Union (Left, Right : Set_Type) return Set_Type is
@@ -569,35 +891,65 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations is
end if;
return Result : Set_Type (Left.Length + Right.Length) do
- Assign (Target => Result, Source => Left);
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
- Insert_Right : declare
- Hint : Count_Type := 0;
+ BR := BR + 1;
+ LR := LR + 1;
- procedure Process (Node : Count_Type);
- pragma Inline (Process);
+ Assign (Target => Result, Source => Left);
- procedure Iterate is
- new Tree_Operations.Generic_Iteration (Process);
+ Insert_Right : declare
+ Hint : Count_Type := 0;
- -------------
- -- Process --
- -------------
+ procedure Process (Node : Count_Type);
+ pragma Inline (Process);
+
+ procedure Iterate is
+ new Tree_Operations.Generic_Iteration (Process);
+
+ -------------
+ -- Process --
+ -------------
+
+ procedure Process (Node : Count_Type) is
+ begin
+ Insert_With_Hint
+ (Dst_Set => Result,
+ Dst_Hint => Hint,
+ Src_Node => Right.Nodes (Node),
+ Dst_Node => Hint);
+ end Process;
+
+ -- Start of processing for Insert_Right
- procedure Process (Node : Count_Type) is
begin
- Insert_With_Hint
- (Dst_Set => Result,
- Dst_Hint => Hint,
- Src_Node => Right.Nodes (Node),
- Dst_Node => Hint);
- end Process;
+ Iterate (Right);
+ end Insert_Right;
- -- Start of processing for Insert_Right
+ BL := BL - 1;
+ LL := LL - 1;
- begin
- Iterate (Right);
- end Insert_Right;
+ BR := BR - 1;
+ LR := LR - 1;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end return;
end Set_Union;
diff --git a/gcc/ada/a-cbdlli.adb b/gcc/ada/a-cbdlli.adb
index 5db2d58f3d7..36b9b81e83b 100644
--- a/gcc/ada/a-cbdlli.adb
+++ b/gcc/ada/a-cbdlli.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -27,32 +27,10 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Finalization; use Ada.Finalization;
-
with System; use type System.Address;
package body Ada.Containers.Bounded_Doubly_Linked_Lists is
- type Iterator is new Limited_Controlled and
- List_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : List_Access;
- Node : Count_Type;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -80,6 +58,18 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Before : Count_Type;
New_Node : Count_Type);
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Count_Type;
+ Source : in out List);
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Count_Type;
+ Source : in out List;
+ Src_Pos : Count_Type;
+ Tgt_Pos : out Count_Type);
+
function Vet (Position : Cursor) return Boolean;
-- Checks invariants of the cursor and its designated container, as a
-- simple way of detecting dangling references (see operation Free for a
@@ -92,10 +82,19 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
---------
function "=" (Left, Right : List) return Boolean is
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
LN : Node_Array renames Left.Nodes;
RN : Node_Array renames Right.Nodes;
- LI, RI : Count_Type;
+ LI : Count_Type;
+ RI : Count_Type;
+
+ Result : Boolean;
begin
if Left'Address = Right'Address then
@@ -106,18 +105,45 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
LI := Left.First;
RI := Right.First;
+ Result := True;
for J in 1 .. Left.Length loop
if LN (LI).Element /= RN (RI).Element then
- return False;
+ Result := False;
+ exit;
end if;
LI := LN (LI).Next;
RI := RN (RI).Next;
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end "=";
--------------
@@ -312,20 +338,20 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
- declare
- N : Node_Type renames Container.Nodes (Position.Node);
- begin
- return (Element => N.Element'Access);
- end;
+ declare
+ N : Node_Type renames Container.Nodes (Position.Node);
+ begin
+ return (Element => N.Element'Access);
+ end;
+ end if;
end Constant_Reference;
--------------
@@ -350,10 +376,8 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Capacity = 0 then
C := Source.Length;
-
elsif Capacity >= Source.Length then
C := Capacity;
-
else
raise Capacity_Error with "Capacity value too small";
end if;
@@ -461,7 +485,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- for I in 1 .. Count loop
+ for J in 1 .. Count loop
X := Container.First;
pragma Assert (N (N (X).Next).Prev = Container.First);
@@ -500,7 +524,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- for I in 1 .. Count loop
+ for J in 1 .. Count loop
X := Container.Last;
pragma Assert (N (N (X).Prev).Next = Container.Last);
@@ -522,11 +546,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
if Position.Node = 0 then
raise Constraint_Error with
"Position cursor has no element";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Element");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Element");
- return Position.Container.Nodes (Position.Node).Element;
+ return Position.Container.Nodes (Position.Node).Element;
+ end if;
end Element;
--------------
@@ -538,7 +563,6 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
if Object.Container /= null then
declare
B : Natural renames Object.Container.all.Busy;
-
begin
B := B - 1;
end;
@@ -570,15 +594,44 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
pragma Assert (Vet (Position), "bad cursor in Find");
end if;
- while Node /= 0 loop
- if Nodes (Node).Element = Item then
- return Cursor'(Container'Unrestricted_Access, Node);
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- Node := Nodes (Node).Next;
- end loop;
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Count_Type;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := 0;
+ while Node /= 0 loop
+ if Nodes (Node).Element = Item then
+ Result := Node;
+ exit;
+ end if;
- return No_Element;
+ Node := Nodes (Node).Next;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = 0 then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Find;
-----------
@@ -589,9 +642,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.First = 0 then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Container.First);
end First;
function First (Object : Iterator) return Cursor is
@@ -624,9 +677,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.First = 0 then
raise Constraint_Error with "list is empty";
+ else
+ return Container.Nodes (Container.First).Element;
end if;
-
- return Container.Nodes (Container.First).Element;
end First_Element;
----------
@@ -753,19 +806,42 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
---------------
function Is_Sorted (Container : List) return Boolean is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
Nodes : Node_Array renames Container.Nodes;
- Node : Count_Type := Container.First;
+ Node : Count_Type;
+
+ Result : Boolean;
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Node := Container.First;
+ Result := True;
for J in 2 .. Container.Length loop
if Nodes (Nodes (Node).Next).Element < Nodes (Node).Element then
- return False;
+ Result := False;
+ exit;
end if;
Node := Nodes (Node).Next;
end loop;
- return True;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Is_Sorted;
-----------
@@ -776,12 +852,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
(Target : in out List;
Source : in out List)
is
- LN : Node_Array renames Target.Nodes;
- RN : Node_Array renames Source.Nodes;
- LI, RI : Cursor;
-
begin
-
-- The semantics of Merge changed slightly per AI05-0021. It was
-- originally the case that if Target and Source denoted the same
-- container object, then the GNAT implementation of Merge did
@@ -799,6 +870,14 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"Target and Source denote same non-empty container";
end if;
+ if Target.Length > Count_Type'Last - Source.Length then
+ raise Constraint_Error with "new length exceeds maximum";
+ end if;
+
+ if Target.Length + Source.Length > Target.Capacity then
+ raise Capacity_Error with "new length exceeds target capacity";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
@@ -809,34 +888,70 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors of Source (list is busy)";
end if;
- LI := First (Target);
- RI := First (Source);
- while RI.Node /= 0 loop
- pragma Assert (RN (RI.Node).Next = 0
- or else not (RN (RN (RI.Node).Next).Element <
- RN (RI.Node).Element));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if LI.Node = 0 then
- Splice (Target, No_Element, Source);
- return;
- end if;
+ declare
+ TB : Natural renames Target.Busy;
+ TL : Natural renames Target.Lock;
- pragma Assert (LN (LI.Node).Next = 0
- or else not (LN (LN (LI.Node).Next).Element <
- LN (LI.Node).Element));
+ SB : Natural renames Source.Busy;
+ SL : Natural renames Source.Lock;
- if RN (RI.Node).Element < LN (LI.Node).Element then
- declare
- RJ : Cursor := RI;
- begin
- RI.Node := RN (RI.Node).Next;
- Splice (Target, LI, Source, RJ);
- end;
+ LN : Node_Array renames Target.Nodes;
+ RN : Node_Array renames Source.Nodes;
- else
- LI.Node := LN (LI.Node).Next;
- end if;
- end loop;
+ LI, LJ, RI, RJ : Count_Type;
+
+ begin
+ TB := TB + 1;
+ TL := TL + 1;
+
+ SB := SB + 1;
+ SL := SL + 1;
+
+ LI := Target.First;
+ RI := Source.First;
+ while RI /= 0 loop
+ pragma Assert (RN (RI).Next = 0
+ or else not (RN (RN (RI).Next).Element <
+ RN (RI).Element));
+
+ if LI = 0 then
+ Splice_Internal (Target, 0, Source);
+ exit;
+ end if;
+
+ pragma Assert (LN (LI).Next = 0
+ or else not (LN (LN (LI).Next).Element <
+ LN (LI).Element));
+
+ if RN (RI).Element < LN (LI).Element then
+ RJ := RI;
+ RI := RN (RI).Next;
+ Splice_Internal (Target, LI, Source, RJ, LJ);
+
+ else
+ LI := LN (LI).Next;
+ end if;
+ end loop;
+
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ exception
+ when others =>
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ raise;
+ end;
end Merge;
----------
@@ -926,7 +1041,28 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- Sort (Front => 0, Back => 0);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Sort (Front => 0, Back => 0);
+
+ B := B - 1;
+ L := L - 1;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
@@ -1132,7 +1268,6 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Container.Nodes (Node).Next;
end loop;
-
exception
when others =>
B := B - 1;
@@ -1160,9 +1295,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
-- for a reverse iterator, Container.Last is the beginning.
return It : constant Iterator :=
- Iterator'(Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => 0)
+ Iterator'(Limited_Controlled with
+ Container => Container'Unrestricted_Access,
+ Node => 0)
do
B := B + 1;
end return;
@@ -1225,9 +1360,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.Last = 0 then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Container.Last);
end Last;
function Last (Object : Iterator) return Cursor is
@@ -1260,9 +1395,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.Last = 0 then
raise Constraint_Error with "list is empty";
+ else
+ return Container.Nodes (Container.Last).Element;
end if;
-
- return Container.Nodes (Container.Last).Element;
end Last_Element;
------------
@@ -1381,13 +1516,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
declare
Nodes : Node_Array renames Position.Container.Nodes;
Node : constant Count_Type := Nodes (Position.Node).Next;
-
begin
if Node = 0 then
return No_Element;
+ else
+ return Cursor'(Position.Container, Node);
end if;
-
- return Cursor'(Position.Container, Node);
end;
end Next;
@@ -1398,14 +1532,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
+ else
+ return Next (Position);
end if;
-
- return Next (Position);
end Next;
-------------
@@ -1444,9 +1576,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Node = 0 then
return No_Element;
+ else
+ return Cursor'(Position.Container, Node);
end if;
-
- return Cursor'(Position.Container, Node);
end;
end Previous;
@@ -1457,14 +1589,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
+ else
+ return Previous (Position);
end if;
-
- return Previous (Position);
end Previous;
-------------------
@@ -1525,20 +1655,19 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
if N < 0 then
raise Program_Error with "bad list length (corrupt stream)";
- end if;
- if N = 0 then
+ elsif N = 0 then
return;
- end if;
- if N > Item.Capacity then
+ elsif N > Item.Capacity then
raise Constraint_Error with "length exceeds capacity";
- end if;
- for Idx in 1 .. N loop
- Allocate (Item, Stream, New_Node => X);
- Insert_Internal (Item, Before => 0, New_Node => X);
- end loop;
+ else
+ for Idx in 1 .. N loop
+ Allocate (Item, Stream, New_Node => X);
+ Insert_Internal (Item, Before => 0, New_Node => X);
+ end loop;
+ end if;
end Read;
procedure Read
@@ -1576,20 +1705,20 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad cursor in function Reference");
+ else
+ pragma Assert (Vet (Position), "bad cursor in function Reference");
- declare
- N : Node_Type renames Container.Nodes (Position.Node);
- begin
- return (Element => N.Element'Access);
- end;
+ declare
+ N : Node_Type renames Container.Nodes (Position.Node);
+ begin
+ return (Element => N.Element'Access);
+ end;
+ end if;
end Reference;
---------------------
@@ -1604,21 +1733,20 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unchecked_Access then
+ elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- if Container.Lock > 0 then
+ elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (list is locked)";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Replace_Element");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Replace_Element");
- Container.Nodes (Position.Node).Element := New_Item;
+ Container.Nodes (Position.Node).Element := New_Item;
+ end if;
end Replace_Element;
----------------------
@@ -1733,15 +1861,44 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
end if;
- while Node /= 0 loop
- if Container.Nodes (Node).Element = Item then
- return Cursor'(Container'Unrestricted_Access, Node);
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- Node := Container.Nodes (Node).Prev;
- end loop;
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Count_Type;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := 0;
+ while Node /= 0 loop
+ if Container.Nodes (Node).Element = Item then
+ Result := Node;
+ exit;
+ end if;
- return No_Element;
+ Node := Container.Nodes (Node).Prev;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = 0 then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Reverse_Find;
---------------------
@@ -1765,7 +1922,6 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Container.Nodes (Node).Prev;
end loop;
-
exception
when others =>
B := B - 1;
@@ -1794,37 +1950,26 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
- if Target'Address = Source'Address
- or else Source.Length = 0
- then
+ if Target'Address = Source'Address or else Source.Length = 0 then
return;
- end if;
-
- pragma Assert (Source.Nodes (Source.First).Prev = 0);
- pragma Assert (Source.Nodes (Source.Last).Next = 0);
- if Target.Length > Count_Type'Last - Source.Length then
+ elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
- end if;
- if Target.Length + Source.Length > Target.Capacity then
+ elsif Target.Length + Source.Length > Target.Capacity then
raise Capacity_Error with "new length exceeds target capacity";
- end if;
- if Target.Busy > 0 then
+ elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
- end if;
- if Source.Busy > 0 then
+ elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
- end if;
- while not Is_Empty (Source) loop
- Insert (Target, Before, Source.Nodes (Source.First).Element);
- Delete_First (Source);
- end loop;
+ else
+ Splice_Internal (Target, Before.Node, Source);
+ end if;
end Splice;
procedure Splice
@@ -1937,7 +2082,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Source : in out List;
Position : in out Cursor)
is
- Target_Position : Cursor;
+ Target_Position : Count_Type;
begin
if Target'Address = Source'Address then
@@ -1979,16 +2124,139 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors of Source (list is busy)";
end if;
- Insert
- (Container => Target,
- Before => Before,
- New_Item => Source.Nodes (Position.Node).Element,
- Position => Target_Position);
+ Splice_Internal
+ (Target => Target,
+ Before => Before.Node,
+ Source => Source,
+ Src_Pos => Position.Node,
+ Tgt_Pos => Target_Position);
- Delete (Source, Position);
- Position := Target_Position;
+ Position := Cursor'(Target'Unrestricted_Access, Target_Position);
end Splice;
+ ---------------------
+ -- Splice_Internal --
+ ---------------------
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Count_Type;
+ Source : in out List)
+ is
+ N : Node_Array renames Source.Nodes;
+ X : Count_Type;
+
+ begin
+ -- This implements the corresponding Splice operation, after the
+ -- parameters have been vetted, and corner-cases disposed of.
+
+ pragma Assert (Target'Address /= Source'Address);
+ pragma Assert (Source.Length > 0);
+ pragma Assert (Source.First /= 0);
+ pragma Assert (N (Source.First).Prev = 0);
+ pragma Assert (Source.Last /= 0);
+ pragma Assert (N (Source.Last).Next = 0);
+ pragma Assert (Target.Length <= Count_Type'Last - Source.Length);
+ pragma Assert (Target.Length + Source.Length <= Target.Capacity);
+
+ while Source.Length > 1 loop
+ -- Copy first element of Source onto Target
+
+ Allocate (Target, N (Source.First).Element, New_Node => X);
+ Insert_Internal (Target, Before => Before, New_Node => X);
+
+ -- Unlink the first node from Source
+
+ X := Source.First;
+ pragma Assert (N (N (X).Next).Prev = X);
+
+ Source.First := N (X).Next;
+ N (Source.First).Prev := 0;
+
+ Source.Length := Source.Length - 1;
+
+ -- Return the Source node to its free store
+
+ Free (Source, X);
+ end loop;
+
+ -- Copy first (and only remaining) element of Source onto Target
+
+ Allocate (Target, N (Source.First).Element, New_Node => X);
+ Insert_Internal (Target, Before => Before, New_Node => X);
+
+ -- Unlink the node from Source
+
+ X := Source.First;
+ pragma Assert (X = Source.Last);
+
+ Source.First := 0;
+ Source.Last := 0;
+
+ Source.Length := 0;
+
+ -- Return the Source node to its free store
+
+ Free (Source, X);
+ end Splice_Internal;
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Count_Type; -- node of Target
+ Source : in out List;
+ Src_Pos : Count_Type; -- node of Source
+ Tgt_Pos : out Count_Type)
+ is
+ N : Node_Array renames Source.Nodes;
+
+ begin
+ -- This implements the corresponding Splice operation, after the
+ -- parameters have been vetted, and corner-cases handled.
+
+ pragma Assert (Target'Address /= Source'Address);
+ pragma Assert (Target.Length < Target.Capacity);
+ pragma Assert (Source.Length > 0);
+ pragma Assert (Source.First /= 0);
+ pragma Assert (N (Source.First).Prev = 0);
+ pragma Assert (Source.Last /= 0);
+ pragma Assert (N (Source.Last).Next = 0);
+ pragma Assert (Src_Pos /= 0);
+
+ Allocate (Target, N (Src_Pos).Element, New_Node => Tgt_Pos);
+ Insert_Internal (Target, Before => Before, New_Node => Tgt_Pos);
+
+ if Source.Length = 1 then
+ pragma Assert (Source.First = Source.Last);
+ pragma Assert (Src_Pos = Source.First);
+
+ Source.First := 0;
+ Source.Last := 0;
+
+ elsif Src_Pos = Source.First then
+ pragma Assert (N (N (Src_Pos).Next).Prev = Src_Pos);
+
+ Source.First := N (Src_Pos).Next;
+ N (Source.First).Prev := 0;
+
+ elsif Src_Pos = Source.Last then
+ pragma Assert (N (N (Src_Pos).Prev).Next = Src_Pos);
+
+ Source.Last := N (Src_Pos).Prev;
+ N (Source.Last).Next := 0;
+
+ else
+ pragma Assert (Source.Length >= 3);
+ pragma Assert (N (N (Src_Pos).Next).Prev = Src_Pos);
+ pragma Assert (N (N (Src_Pos).Prev).Next = Src_Pos);
+
+ N (N (Src_Pos).Next).Prev := N (Src_Pos).Prev;
+ N (N (Src_Pos).Prev).Next := N (Src_Pos).Next;
+ end if;
+
+ Source.Length := Source.Length - 1;
+ Free (Source, Src_Pos);
+ end Splice_Internal;
+
----------
-- Swap --
----------
@@ -2283,7 +2551,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
pragma Assert (N (Position.Node).Prev /= 0);
- -- ELiminate another possibility
+ -- Eliminate another possibility
if Position.Node = L.Last then
return True;
diff --git a/gcc/ada/a-cbdlli.ads b/gcc/ada/a-cbdlli.ads
index a8a6ee228f1..291c1e0eb72 100644
--- a/gcc/ada/a-cbdlli.ads
+++ b/gcc/ada/a-cbdlli.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -34,6 +34,7 @@
with Ada.Iterator_Interfaces;
private with Ada.Streams;
+private with Ada.Finalization;
generic
type Element_Type is private;
@@ -248,6 +249,7 @@ private
pragma Inline (Previous);
use Ada.Streams;
+ use Ada.Finalization;
type Node_Type is record
Prev : Count_Type'Base;
@@ -334,4 +336,24 @@ private
No_Element : constant Cursor := Cursor'(null, 0);
+ type Iterator is new Limited_Controlled and
+ List_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : List_Access;
+ Node : Count_Type;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Bounded_Doubly_Linked_Lists;
diff --git a/gcc/ada/a-cbhama.adb b/gcc/ada/a-cbhama.adb
index 314bed6142d..f4a953c1401 100644
--- a/gcc/ada/a-cbhama.adb
+++ b/gcc/ada/a-cbhama.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -34,26 +34,11 @@ with Ada.Containers.Hash_Tables.Generic_Bounded_Keys;
pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Bounded_Keys);
with Ada.Containers.Prime_Numbers; use Ada.Containers.Prime_Numbers;
-with Ada.Finalization; use Ada.Finalization;
with System; use type System.Address;
package body Ada.Containers.Bounded_Hashed_Maps is
- type Iterator is new Limited_Controlled and
- Map_Iterator_Interfaces.Forward_Iterator with
- record
- Container : Map_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/a-cbhama.ads b/gcc/ada/a-cbhama.ads
index 71ec0e3d956..076fac240e1 100644
--- a/gcc/ada/a-cbhama.ads
+++ b/gcc/ada/a-cbhama.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,6 +35,7 @@ with Ada.Iterator_Interfaces;
private with Ada.Containers.Hash_Tables;
private with Ada.Streams;
+private with Ada.Finalization;
generic
type Key_Type is private;
@@ -339,6 +340,7 @@ private
use HT_Types;
use Ada.Streams;
+ use Ada.Finalization;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
@@ -412,5 +414,18 @@ private
(Hash_Table_Type with Capacity => 0, Modulus => 0);
No_Element : constant Cursor := (Container => null, Node => 0);
+ type Iterator is new Limited_Controlled and
+ Map_Iterator_Interfaces.Forward_Iterator with
+ record
+ Container : Map_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
end Ada.Containers.Bounded_Hashed_Maps;
diff --git a/gcc/ada/a-cbhase.adb b/gcc/ada/a-cbhase.adb
index cc60762ed15..99efc1dcf79 100644
--- a/gcc/ada/a-cbhase.adb
+++ b/gcc/ada/a-cbhase.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -34,26 +34,11 @@ with Ada.Containers.Hash_Tables.Generic_Bounded_Keys;
pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Bounded_Keys);
with Ada.Containers.Prime_Numbers; use Ada.Containers.Prime_Numbers;
-with Ada.Finalization; use Ada.Finalization;
with System; use type System.Address;
package body Ada.Containers.Bounded_Hashed_Sets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Forward_Iterator with
- record
- Container : Set_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/a-cbhase.ads b/gcc/ada/a-cbhase.ads
index ed47b798683..5de5d2832ec 100644
--- a/gcc/ada/a-cbhase.ads
+++ b/gcc/ada/a-cbhase.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,6 +35,7 @@ with Ada.Iterator_Interfaces;
private with Ada.Containers.Hash_Tables;
private with Ada.Streams;
+private with Ada.Finalization; use Ada.Finalization;
generic
type Element_Type is private;
@@ -537,4 +538,18 @@ private
No_Element : constant Cursor := (Container => null, Node => 0);
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Forward_Iterator with
+ record
+ Container : Set_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Bounded_Hashed_Sets;
diff --git a/gcc/ada/a-cborma.adb b/gcc/ada/a-cborma.adb
index 8fca6495dc5..f508fc5642c 100644
--- a/gcc/ada/a-cborma.adb
+++ b/gcc/ada/a-cborma.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -35,32 +35,10 @@ with Ada.Containers.Red_Black_Trees.Generic_Bounded_Keys;
pragma Elaborate_All
(Ada.Containers.Red_Black_Trees.Generic_Bounded_Keys);
-with Ada.Finalization; use Ada.Finalization;
-
with System; use type System.Address;
package body Ada.Containers.Bounded_Ordered_Maps is
- type Iterator is new Limited_Controlled and
- Map_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Map_Access;
- Node : Count_Type;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------------
-- Node Access Subprograms --
-----------------------------
diff --git a/gcc/ada/a-cborma.ads b/gcc/ada/a-cborma.ads
index 6ade3e6c474..2c2a8a50e1b 100644
--- a/gcc/ada/a-cborma.ads
+++ b/gcc/ada/a-cborma.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,6 +35,7 @@ with Ada.Iterator_Interfaces;
private with Ada.Containers.Red_Black_Trees;
private with Ada.Streams;
+private with Ada.Finalization;
generic
type Key_Type is private;
@@ -315,4 +316,26 @@ private
No_Element : constant Cursor := Cursor'(null, 0);
+ use Ada.Finalization;
+
+ type Iterator is new Limited_Controlled and
+ Map_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Map_Access;
+ Node : Count_Type;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Bounded_Ordered_Maps;
diff --git a/gcc/ada/a-cborse.adb b/gcc/ada/a-cborse.adb
index 3131de13700..eacd3eb7442 100644
--- a/gcc/ada/a-cborse.adb
+++ b/gcc/ada/a-cborse.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,32 +38,10 @@ with Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations;
pragma Elaborate_All
(Ada.Containers.Red_Black_Trees.Generic_Bounded_Set_Operations);
-with Ada.Finalization; use Ada.Finalization;
-
with System; use type System.Address;
package body Ada.Containers.Bounded_Ordered_Sets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Set_Access;
- Node : Count_Type;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
------------------------------
-- Access to Fields of Node --
------------------------------
@@ -979,6 +957,9 @@ package body Ada.Containers.Bounded_Ordered_Sets is
pragma Assert (Vet (Container, Position.Node),
"bad cursor in Update_Element_Preserving_Key");
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
N : Node_Type renames Container.Nodes (Position.Node);
E : Element_Type renames N.Element;
@@ -987,12 +968,15 @@ package body Ada.Containers.Bounded_Ordered_Sets is
B : Natural renames Container.Busy;
L : Natural renames Container.Lock;
+ Eq : Boolean;
+
begin
B := B + 1;
L := L + 1;
begin
Process (E);
+ Eq := Equivalent_Keys (K, Key (E));
exception
when others =>
L := L - 1;
@@ -1003,7 +987,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
L := L - 1;
B := B - 1;
- if Equivalent_Keys (K, Key (E)) then
+ if Eq then
return;
end if;
end;
@@ -1727,16 +1711,54 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Hint : Count_Type;
Result : Count_Type;
Inserted : Boolean;
+ Compare : Boolean;
+
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
-- Start of processing for Replace_Element
begin
- if Item < Node.Element
- or else Node.Element < Item
- then
- null;
+ -- Replace_Element assigns value Item to the element designated by Node,
+ -- per certain semantic constraints, described as follows.
+
+ -- If Item is equivalent to the element, then element is replaced and
+ -- there's nothing else to do. This is the easy case.
+
+ -- If Item is not equivalent, then the node will (possibly) have to move
+ -- to some other place in the tree. This is slighly more complicated,
+ -- because we must ensure that Item is not equivalent to some other
+ -- element in the tree (in which case, the replacement is not allowed).
+
+ -- Determine whether Item is equivalent to element on the specified
+ -- node.
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := (if Item < Node.Element then False
+ elsif Node.Element < Item then False
+ else True);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
+
+ -- Item is equivalent to the node's element, so we will not have to
+ -- move the node.
- else
if Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (set is locked)";
@@ -1746,12 +1768,67 @@ package body Ada.Containers.Bounded_Ordered_Sets is
return;
end if;
+ -- The replacement Item is not equivalent to the element on the
+ -- specified node, which means that it will need to be re-inserted in a
+ -- different position in the tree. We must now determine whether Item is
+ -- equivalent to some other element in the tree (which would prohibit
+ -- the assignment and hence the move).
+
+ -- Ceiling returns the smallest element equivalent or greater than the
+ -- specified Item; if there is no such element, then it returns 0.
+
Hint := Element_Keys.Ceiling (Container, Item);
- if Hint = 0 then
- null;
+ if Hint /= 0 then -- Item <= Nodes (Hint).Element
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Item < Nodes (Hint).Element;
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ -- Item is equivalent to Nodes (Hint).Element
+
+ if not Compare then
+
+ -- Ceiling returns an element that is equivalent or greater than
+ -- Item. If Item is "not less than" the element, then by
+ -- elimination we know that Item is equivalent to the element.
+
+ -- But this means that it is not possible to assign the value of
+ -- Item to the specified element (on Node), because a different
+ -- element (on Hint) equivalent to Item already exsits. (Were we
+ -- to change Node's element value, we would have to move Node, but
+ -- we would be unable to move the Node, because its new position
+ -- in the tree is already occupied by an equivalent element.)
+
+ raise Program_Error with "attempt to replace existing element";
+ end if;
+
+ -- Item is not equivalent to any other element in the tree
+ -- (specifically, it is less then Nodes (Hint).Element), so it is
+ -- safe to assign the value of Item to Node.Element. This means that
+ -- the node will have to move to a different position in the tree
+ -- (because its element will have a different value).
+
+ -- The nearest (greater) neighbor of Item is Hint. This will be the
+ -- insertion position of Node (because its element will have Item as
+ -- its new value).
+
+ -- If Node equals Hint, the relative position of Node does not
+ -- change. This allows us to perform an optimization: we need not
+ -- remove Node from the tree and then reinsert it with its new value,
+ -- because it would only be placed in the exact same position.
- elsif Item < Nodes (Hint).Element then
if Hint = Index then
if Container.Lock > 0 then
raise Program_Error with
@@ -1761,12 +1838,14 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Node.Element := Item;
return;
end if;
-
- else
- pragma Assert (not (Nodes (Hint).Element < Item));
- raise Program_Error with "attempt to replace existing element";
end if;
+ -- If we get here, it is because Item was greater than all elements in
+ -- the tree (Hint = 0), or because Item was less than some element at a
+ -- different place in the tree (Item < Nodes (Hint).Element and Hint /=
+ -- Index). In either case, we remove Node from the tree and then insert
+ -- Item into the tree, onto the same Node.
+
Tree_Operations.Delete_Node_Sans_Free (Container, Index);
Local_Insert_With_Hint
diff --git a/gcc/ada/a-cborse.ads b/gcc/ada/a-cborse.ads
index 16263577389..d22ef54b21b 100644
--- a/gcc/ada/a-cborse.ads
+++ b/gcc/ada/a-cborse.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,6 +35,7 @@ with Ada.Iterator_Interfaces;
private with Ada.Containers.Red_Black_Trees;
private with Ada.Streams;
+private with Ada.Finalization;
generic
type Element_Type is private;
@@ -374,4 +375,26 @@ private
No_Element : constant Cursor := Cursor'(null, 0);
+ use Ada.Finalization;
+
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Set_Access;
+ Node : Count_Type;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Bounded_Ordered_Sets;
diff --git a/gcc/ada/a-cdlili.adb b/gcc/ada/a-cdlili.adb
index 8234f327eb1..9bd8899e2dd 100644
--- a/gcc/ada/a-cdlili.adb
+++ b/gcc/ada/a-cdlili.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -33,26 +33,6 @@ with System; use type System.Address;
package body Ada.Containers.Doubly_Linked_Lists is
- type Iterator is new Limited_Controlled and
- List_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : List_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -64,6 +44,17 @@ package body Ada.Containers.Doubly_Linked_Lists is
Before : Node_Access;
New_Node : Node_Access);
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access;
+ Source : in out List);
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access;
+ Source : in out List;
+ Position : Node_Access);
+
function Vet (Position : Cursor) return Boolean;
-- Checks invariants of the cursor and its designated container, as a
-- simple way of detecting dangling references (see operation Free for a
@@ -76,8 +67,15 @@ package body Ada.Containers.Doubly_Linked_Lists is
---------
function "=" (Left, Right : List) return Boolean is
- L : Node_Access := Left.First;
- R : Node_Access := Right.First;
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ L : Node_Access;
+ R : Node_Access;
+ Result : Boolean;
begin
if Left'Address = Right'Address then
@@ -88,16 +86,45 @@ package body Ada.Containers.Doubly_Linked_Lists is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L := Left.First;
+ R := Right.First;
+ Result := True;
for J in 1 .. Left.Length loop
if L.Element /= R.Element then
- return False;
+ Result := False;
+ exit;
end if;
L := L.Next;
R := R.Next;
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end "=";
------------
@@ -358,6 +385,8 @@ package body Ada.Containers.Doubly_Linked_Lists is
Free (X);
end loop;
+ -- The following comment is unacceptable, more detail needed ???
+
Position := No_Element; -- Post-York behavior
end Delete;
@@ -386,7 +415,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- for I in 1 .. Count loop
+ for J in 1 .. Count loop
X := Container.First;
pragma Assert (X.Next.Prev = Container.First);
@@ -424,7 +453,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- for I in 1 .. Count loop
+ for J in 1 .. Count loop
X := Container.Last;
pragma Assert (X.Prev.Next = Container.Last);
@@ -446,11 +475,11 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Position.Node = null then
raise Constraint_Error with
"Position cursor has no element";
- end if;
-
- pragma Assert (Vet (Position), "bad cursor in Element");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Element");
- return Position.Node.Element;
+ return Position.Node.Element;
+ end if;
end Element;
--------------
@@ -503,20 +532,55 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
+ else
+ pragma Assert (Vet (Position), "bad cursor in Find");
end if;
-
- pragma Assert (Vet (Position), "bad cursor in Find");
end if;
- while Node /= null loop
- if Node.Element = Item then
- return Cursor'(Container'Unrestricted_Access, Node);
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- Node := Node.Next;
- end loop;
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Node_Access;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ pragma Warnings (Off);
+ -- Deal with junk infinite loop warning from below loop
+
+ Result := null;
+ while Node /= null loop
+ if Node.Element = Item then
+ Result := Node;
+ exit;
+ else
+ Node := Node.Next;
+ end if;
+ end loop;
+
+ pragma Warnings (On);
+ -- End of section dealing with junk infinite loop warning
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = null then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
- return No_Element;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Find;
-----------
@@ -527,9 +591,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.First = null then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Container.First);
end First;
function First (Object : Iterator) return Cursor is
@@ -562,9 +626,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.First = null then
raise Constraint_Error with "list is empty";
+ else
+ return Container.First.Element;
end if;
-
- return Container.First.Element;
end First_Element;
----------
@@ -573,7 +637,8 @@ package body Ada.Containers.Doubly_Linked_Lists is
procedure Free (X : in out Node_Access) is
procedure Deallocate is
- new Ada.Unchecked_Deallocation (Node_Type, Node_Access);
+ new Ada.Unchecked_Deallocation (Node_Type, Node_Access);
+
begin
-- While a node is in use, as an active link in a list, its Previous and
-- Next components must be null, or designate a different node; this is
@@ -606,18 +671,40 @@ package body Ada.Containers.Doubly_Linked_Lists is
---------------
function Is_Sorted (Container : List) return Boolean is
- Node : Node_Access := Container.First;
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Node : Node_Access;
+ Result : Boolean;
begin
- for I in 2 .. Container.Length loop
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Node := Container.First;
+ Result := True;
+ for Idx in 2 .. Container.Length loop
if Node.Next.Element < Node.Element then
- return False;
+ Result := False;
+ exit;
end if;
Node := Node.Next;
end loop;
- return True;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Is_Sorted;
-----------
@@ -628,10 +715,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
(Target : in out List;
Source : in out List)
is
- LI, RI : Cursor;
-
begin
-
-- The semantics of Merge changed slightly per AI05-0021. It was
-- originally the case that if Target and Source denoted the same
-- container object, then the GNAT implementation of Merge did
@@ -649,6 +733,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
"Target and Source denote same non-empty container";
end if;
+ if Target.Length > Count_Type'Last - Source.Length then
+ raise Constraint_Error with "new length exceeds maximum";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
@@ -659,35 +747,65 @@ package body Ada.Containers.Doubly_Linked_Lists is
"attempt to tamper with cursors of Source (list is busy)";
end if;
- LI := First (Target);
- RI := First (Source);
- while RI.Node /= null loop
- pragma Assert (RI.Node.Next = null
- or else not (RI.Node.Next.Element <
- RI.Node.Element));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if LI.Node = null then
- Splice (Target, No_Element, Source);
- return;
- end if;
+ declare
+ TB : Natural renames Target.Busy;
+ TL : Natural renames Target.Lock;
- pragma Assert (LI.Node.Next = null
- or else not (LI.Node.Next.Element <
- LI.Node.Element));
+ SB : Natural renames Source.Busy;
+ SL : Natural renames Source.Lock;
- if RI.Node.Element < LI.Node.Element then
- declare
- RJ : Cursor := RI;
- pragma Warnings (Off, RJ);
- begin
- RI.Node := RI.Node.Next;
- Splice (Target, LI, Source, RJ);
- end;
+ LI, RI, RJ : Node_Access;
- else
- LI.Node := LI.Node.Next;
- end if;
- end loop;
+ begin
+ TB := TB + 1;
+ TL := TL + 1;
+
+ SB := SB + 1;
+ SL := SL + 1;
+
+ LI := Target.First;
+ RI := Source.First;
+ while RI /= null loop
+ pragma Assert (RI.Next = null
+ or else not (RI.Next.Element < RI.Element));
+
+ if LI = null then
+ Splice_Internal (Target, null, Source);
+ exit;
+ end if;
+
+ pragma Assert (LI.Next = null
+ or else not (LI.Next.Element < LI.Element));
+
+ if RI.Element < LI.Element then
+ RJ := RI;
+ RI := RI.Next;
+ Splice_Internal (Target, LI, Source, RJ);
+
+ else
+ LI := LI.Next;
+ end if;
+ end loop;
+
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ exception
+ when others =>
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ raise;
+ end;
end Merge;
----------
@@ -705,9 +823,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
---------------
procedure Partition (Pivot : Node_Access; Back : Node_Access) is
- Node : Node_Access := Pivot.Next;
+ Node : Node_Access;
begin
+ Node := Pivot.Next;
while Node /= Back loop
if Node.Element < Pivot.Element then
declare
@@ -773,7 +892,28 @@ package body Ada.Containers.Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- Sort (Front => null, Back => null);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Sort (Front => null, Back => null);
+
+ B := B - 1;
+ L := L - 1;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
pragma Assert (Container.First.Prev = null);
pragma Assert (Container.Last.Next = null);
@@ -809,34 +949,33 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong list";
+ else
+ pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
-
- pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
if Count = 0 then
Position := Before;
return;
- end if;
- if Container.Length > Count_Type'Last - Count then
+ elsif Container.Length > Count_Type'Last - Count then
raise Constraint_Error with "new length exceeds maximum";
- end if;
- if Container.Busy > 0 then
+ elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
- end if;
-
- New_Node := new Node_Type'(New_Item, null, null);
- Insert_Internal (Container, Before.Node, New_Node);
- Position := Cursor'(Container'Unchecked_Access, New_Node);
-
- for J in Count_Type'(2) .. Count loop
+ else
New_Node := new Node_Type'(New_Item, null, null);
Insert_Internal (Container, Before.Node, New_Node);
- end loop;
+
+ Position := Cursor'(Container'Unchecked_Access, New_Node);
+
+ for J in 2 .. Count loop
+ New_Node := new Node_Type'(New_Item, null, null);
+ Insert_Internal (Container, Before.Node, New_Node);
+ end loop;
+ end if;
end Insert;
procedure Insert
@@ -864,9 +1003,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong list";
+ else
+ pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
-
- pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
if Count = 0 then
@@ -876,22 +1015,22 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Container.Length > Count_Type'Last - Count then
raise Constraint_Error with "new length exceeds maximum";
- end if;
- if Container.Busy > 0 then
+ elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
- end if;
- New_Node := new Node_Type;
- Insert_Internal (Container, Before.Node, New_Node);
-
- Position := Cursor'(Container'Unchecked_Access, New_Node);
-
- for J in Count_Type'(2) .. Count loop
+ else
New_Node := new Node_Type;
Insert_Internal (Container, Before.Node, New_Node);
- end loop;
+
+ Position := Cursor'(Container'Unchecked_Access, New_Node);
+
+ for J in 2 .. Count loop
+ New_Node := new Node_Type;
+ Insert_Internal (Container, Before.Node, New_Node);
+ end loop;
+ end if;
end Insert;
---------------------
@@ -996,9 +1135,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
-- for a reverse iterator, Container.Last is the beginning.
return It : constant Iterator :=
- Iterator'(Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => null)
+ Iterator'(Limited_Controlled with
+ Container => Container'Unrestricted_Access,
+ Node => null)
do
B := B + 1;
end return;
@@ -1024,31 +1163,31 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Start = No_Element then
raise Constraint_Error with
"Start position for iterator equals No_Element";
- end if;
- if Start.Container /= Container'Unrestricted_Access then
+ elsif Start.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Start cursor of Iterate designates wrong list";
- end if;
- pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
-
- -- The value of the Node component influences the behavior of the First
- -- and Last selector functions of the iterator object. When the Node
- -- component is non-null (as is the case here), it means that this
- -- is a partial iteration, over a subset of the complete sequence of
- -- items. The iterator object was constructed with a start expression,
- -- indicating the position from which the iteration begins. Note that
- -- the start position has the same value irrespective of whether this
- -- is a forward or reverse iteration.
-
- return It : constant Iterator :=
- Iterator'(Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => Start.Node)
- do
- B := B + 1;
- end return;
+ else
+ pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
+
+ -- The value of the Node component influences the behavior of the
+ -- First and Last selector functions of the iterator object. When
+ -- the Node component is non-null (as is the case here), it means
+ -- that this is a partial iteration, over a subset of the complete
+ -- sequence of items. The iterator object was constructed with
+ -- a start expression, indicating the position from which the
+ -- iteration begins. Note that the start position has the same value
+ -- irrespective of whether this is a forward or reverse iteration.
+
+ return It : constant Iterator :=
+ Iterator'(Limited_Controlled with
+ Container => Container'Unrestricted_Access,
+ Node => Start.Node)
+ do
+ B := B + 1;
+ end return;
+ end if;
end Iterate;
----------
@@ -1059,9 +1198,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.Last = null then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Container.Last);
end Last;
function Last (Object : Iterator) return Cursor is
@@ -1094,9 +1233,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.Last = null then
raise Constraint_Error with "list is empty";
+ else
+ return Container.Last.Element;
end if;
-
- return Container.Last.Element;
end Last_Element;
------------
@@ -1119,23 +1258,23 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Target'Address = Source'Address then
return;
- end if;
- if Source.Busy > 0 then
+ elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
- end if;
- Clear (Target);
+ else
+ Clear (Target);
- Target.First := Source.First;
- Source.First := null;
+ Target.First := Source.First;
+ Source.First := null;
- Target.Last := Source.Last;
- Source.Last := null;
+ Target.Last := Source.Last;
+ Source.Last := null;
- Target.Length := Source.Length;
- Source.Length := 0;
+ Target.Length := Source.Length;
+ Source.Length := 0;
+ end if;
end Move;
----------
@@ -1151,20 +1290,20 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
- end if;
-
- pragma Assert (Vet (Position), "bad cursor in Next");
-
- declare
- Next_Node : constant Node_Access := Position.Node.Next;
- begin
- if Next_Node = null then
- return No_Element;
- end if;
+ else
+ pragma Assert (Vet (Position), "bad cursor in Next");
- return Cursor'(Position.Container, Next_Node);
- end;
+ declare
+ Next_Node : constant Node_Access := Position.Node.Next;
+ begin
+ if Next_Node = null then
+ return No_Element;
+ else
+ return Cursor'(Position.Container, Next_Node);
+ end if;
+ end;
+ end if;
end Next;
function Next
@@ -1174,14 +1313,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
+ else
+ return Next (Position);
end if;
-
- return Next (Position);
end Next;
-------------
@@ -1210,20 +1347,20 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
- end if;
-
- pragma Assert (Vet (Position), "bad cursor in Previous");
- declare
- Prev_Node : constant Node_Access := Position.Node.Prev;
-
- begin
- if Prev_Node = null then
- return No_Element;
- end if;
+ else
+ pragma Assert (Vet (Position), "bad cursor in Previous");
- return Cursor'(Position.Container, Prev_Node);
- end;
+ declare
+ Prev_Node : constant Node_Access := Position.Node.Prev;
+ begin
+ if Prev_Node = null then
+ return No_Element;
+ else
+ return Cursor'(Position.Container, Prev_Node);
+ end if;
+ end;
+ end if;
end Previous;
function Previous
@@ -1233,14 +1370,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
+ else
+ return Previous (Position);
end if;
-
- return Previous (Position);
end Previous;
-------------------
@@ -1369,28 +1504,28 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unchecked_Access then
+ elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad cursor in function Reference");
+ else
+ pragma Assert (Vet (Position), "bad cursor in function Reference");
- declare
- C : List renames Position.Container.all;
- B : Natural renames C.Busy;
- L : Natural renames C.Lock;
- begin
- return R : constant Reference_Type :=
- (Element => Position.Node.Element'Access,
- Control => (Controlled with Position.Container))
- do
- B := B + 1;
- L := L + 1;
- end return;
- end;
+ declare
+ C : List renames Position.Container.all;
+ B : Natural renames C.Busy;
+ L : Natural renames C.Lock;
+ begin
+ return R : constant Reference_Type :=
+ (Element => Position.Node.Element'Access,
+ Control => (Controlled with Position.Container))
+ do
+ B := B + 1;
+ L := L + 1;
+ end return;
+ end;
+ end if;
end Reference;
---------------------
@@ -1405,21 +1540,20 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unchecked_Access then
+ elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- if Container.Lock > 0 then
+ elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (list is locked)";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Replace_Element");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Replace_Element");
- Position.Node.Element := New_Item;
+ Position.Node.Element := New_Item;
+ end if;
end Replace_Element;
----------------------
@@ -1528,20 +1662,49 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
+ else
+ pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
end if;
-
- pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
end if;
- while Node /= null loop
- if Node.Element = Item then
- return Cursor'(Container'Unrestricted_Access, Node);
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- Node := Node.Prev;
- end loop;
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Node_Access;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := null;
+ while Node /= null loop
+ if Node.Element = Item then
+ Result := Node;
+ exit;
+ end if;
+
+ Node := Node.Prev;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
- return No_Element;
+ if Result = null then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Reverse_Find;
---------------------
@@ -1565,7 +1728,6 @@ package body Ada.Containers.Doubly_Linked_Lists is
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Node.Prev;
end loop;
-
exception
when others =>
B := B - 1;
@@ -1589,73 +1751,28 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
+ else
+ pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
-
- pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
- if Target'Address = Source'Address
- or else Source.Length = 0
- then
+ if Target'Address = Source'Address or else Source.Length = 0 then
return;
- end if;
-
- pragma Assert (Source.First.Prev = null);
- pragma Assert (Source.Last.Next = null);
- if Target.Length > Count_Type'Last - Source.Length then
+ elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
- end if;
- if Target.Busy > 0 then
+ elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
- end if;
- if Source.Busy > 0 then
+ elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
- end if;
-
- if Target.Length = 0 then
- pragma Assert (Target.First = null);
- pragma Assert (Target.Last = null);
- pragma Assert (Before = No_Element);
-
- Target.First := Source.First;
- Target.Last := Source.Last;
-
- elsif Before.Node = null then
- pragma Assert (Target.Last.Next = null);
-
- Target.Last.Next := Source.First;
- Source.First.Prev := Target.Last;
-
- Target.Last := Source.Last;
-
- elsif Before.Node = Target.First then
- pragma Assert (Target.First.Prev = null);
-
- Source.Last.Next := Target.First;
- Target.First.Prev := Source.Last;
-
- Target.First := Source.First;
else
- pragma Assert (Target.Length >= 2);
-
- Before.Node.Prev.Next := Source.First;
- Source.First.Prev := Before.Node.Prev;
-
- Before.Node.Prev := Source.Last;
- Source.Last.Next := Before.Node;
+ Splice_Internal (Target, Before.Node, Source);
end if;
-
- Source.First := null;
- Source.Last := null;
-
- Target.Length := Target.Length + Source.Length;
- Source.Length := 0;
end Splice;
procedure Splice
@@ -1668,9 +1785,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Container'Unchecked_Access then
raise Program_Error with
"Before cursor designates wrong container";
+ else
+ pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
-
- pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
if Position.Node = null then
@@ -1776,40 +1893,124 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
+ else
+ pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
-
- pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
if Position.Node = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Source'Unrestricted_Access then
+ elsif Position.Container /= Source'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad Position cursor in Splice");
+ else
+ pragma Assert (Vet (Position), "bad Position cursor in Splice");
- if Target.Length = Count_Type'Last then
- raise Constraint_Error with "Target is full";
- end if;
+ if Target.Length = Count_Type'Last then
+ raise Constraint_Error with "Target is full";
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Target (list is busy)";
+ elsif Target.Busy > 0 then
+ raise Program_Error with
+ "attempt to tamper with cursors of Target (list is busy)";
+
+ elsif Source.Busy > 0 then
+ raise Program_Error with
+ "attempt to tamper with cursors of Source (list is busy)";
+
+ else
+ Splice_Internal (Target, Before.Node, Source, Position.Node);
+ Position.Container := Target'Unchecked_Access;
+ end if;
end if;
+ end Splice;
- if Source.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Source (list is busy)";
+ ---------------------
+ -- Splice_Internal --
+ ---------------------
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access;
+ Source : in out List)
+ is
+ begin
+ -- This implements the corresponding Splice operation, after the
+ -- parameters have been vetted, and corner-cases disposed of.
+
+ pragma Assert (Target'Address /= Source'Address);
+ pragma Assert (Source.Length > 0);
+ pragma Assert (Source.First /= null);
+ pragma Assert (Source.First.Prev = null);
+ pragma Assert (Source.Last /= null);
+ pragma Assert (Source.Last.Next = null);
+ pragma Assert (Target.Length <= Count_Type'Last - Source.Length);
+
+ if Target.Length = 0 then
+ pragma Assert (Target.First = null);
+ pragma Assert (Target.Last = null);
+ pragma Assert (Before = null);
+
+ Target.First := Source.First;
+ Target.Last := Source.Last;
+
+ elsif Before = null then
+ pragma Assert (Target.Last.Next = null);
+
+ Target.Last.Next := Source.First;
+ Source.First.Prev := Target.Last;
+
+ Target.Last := Source.Last;
+
+ elsif Before = Target.First then
+ pragma Assert (Target.First.Prev = null);
+
+ Source.Last.Next := Target.First;
+ Target.First.Prev := Source.Last;
+
+ Target.First := Source.First;
+
+ else
+ pragma Assert (Target.Length >= 2);
+
+ Before.Prev.Next := Source.First;
+ Source.First.Prev := Before.Prev;
+
+ Before.Prev := Source.Last;
+ Source.Last.Next := Before;
end if;
- if Position.Node = Source.First then
- Source.First := Position.Node.Next;
+ Source.First := null;
+ Source.Last := null;
+
+ Target.Length := Target.Length + Source.Length;
+ Source.Length := 0;
+ end Splice_Internal;
- if Position.Node = Source.Last then
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access; -- node of Target
+ Source : in out List;
+ Position : Node_Access) -- node of Source
+ is
+ begin
+ -- This implements the corresponding Splice operation, after the
+ -- parameters have been vetted.
+
+ pragma Assert (Target'Address /= Source'Address);
+ pragma Assert (Target.Length < Count_Type'Last);
+ pragma Assert (Source.Length > 0);
+ pragma Assert (Source.First /= null);
+ pragma Assert (Source.First.Prev = null);
+ pragma Assert (Source.Last /= null);
+ pragma Assert (Source.Last.Next = null);
+ pragma Assert (Position /= null);
+
+ if Position = Source.First then
+ Source.First := Position.Next;
+
+ if Position = Source.Last then
pragma Assert (Source.First = null);
pragma Assert (Source.Length = 1);
Source.Last := null;
@@ -1818,58 +2019,56 @@ package body Ada.Containers.Doubly_Linked_Lists is
Source.First.Prev := null;
end if;
- elsif Position.Node = Source.Last then
+ elsif Position = Source.Last then
pragma Assert (Source.Length >= 2);
- Source.Last := Position.Node.Prev;
+ Source.Last := Position.Prev;
Source.Last.Next := null;
else
pragma Assert (Source.Length >= 3);
- Position.Node.Prev.Next := Position.Node.Next;
- Position.Node.Next.Prev := Position.Node.Prev;
+ Position.Prev.Next := Position.Next;
+ Position.Next.Prev := Position.Prev;
end if;
if Target.Length = 0 then
pragma Assert (Target.First = null);
pragma Assert (Target.Last = null);
- pragma Assert (Before = No_Element);
+ pragma Assert (Before = null);
- Target.First := Position.Node;
- Target.Last := Position.Node;
+ Target.First := Position;
+ Target.Last := Position;
Target.First.Prev := null;
Target.Last.Next := null;
- elsif Before.Node = null then
+ elsif Before = null then
pragma Assert (Target.Last.Next = null);
- Target.Last.Next := Position.Node;
- Position.Node.Prev := Target.Last;
+ Target.Last.Next := Position;
+ Position.Prev := Target.Last;
- Target.Last := Position.Node;
+ Target.Last := Position;
Target.Last.Next := null;
- elsif Before.Node = Target.First then
+ elsif Before = Target.First then
pragma Assert (Target.First.Prev = null);
- Target.First.Prev := Position.Node;
- Position.Node.Next := Target.First;
+ Target.First.Prev := Position;
+ Position.Next := Target.First;
- Target.First := Position.Node;
+ Target.First := Position;
Target.First.Prev := null;
else
pragma Assert (Target.Length >= 2);
- Before.Node.Prev.Next := Position.Node;
- Position.Node.Prev := Before.Node.Prev;
+ Before.Prev.Next := Position;
+ Position.Prev := Before.Prev;
- Before.Node.Prev := Position.Node;
- Position.Node.Next := Before.Node;
+ Before.Prev := Position;
+ Position.Next := Before;
end if;
Target.Length := Target.Length + 1;
Source.Length := Source.Length - 1;
-
- Position.Container := Target'Unchecked_Access;
- end Splice;
+ end Splice_Internal;
----------
-- Swap --
@@ -1995,35 +2194,35 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Node = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unchecked_Access then
+ elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Update_Element");
-
- declare
- B : Natural renames Container.Busy;
- L : Natural renames Container.Lock;
+ else
+ pragma Assert (Vet (Position), "bad cursor in Update_Element");
- begin
- B := B + 1;
- L := L + 1;
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
begin
- Process (Position.Node.Element);
- exception
- when others =>
- L := L - 1;
- B := B - 1;
- raise;
- end;
+ B := B + 1;
+ L := L + 1;
- L := L - 1;
- B := B - 1;
- end;
+ begin
+ Process (Position.Node.Element);
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ L := L - 1;
+ B := B - 1;
+ end;
+ end if;
end Update_Element;
---------
@@ -2090,8 +2289,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
end if;
pragma Assert
- (Position.Node.Prev /= null
- or else Position.Node = L.First);
+ (Position.Node.Prev /= null or else Position.Node = L.First);
if Position.Node.Next = null and then Position.Node /= L.Last then
return False;
diff --git a/gcc/ada/a-cdlili.ads b/gcc/ada/a-cdlili.ads
index d1707c757a2..c99e7350afc 100644
--- a/gcc/ada/a-cdlili.ads
+++ b/gcc/ada/a-cdlili.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -358,4 +358,24 @@ private
No_Element : constant Cursor := Cursor'(null, null);
+ type Iterator is new Limited_Controlled and
+ List_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : List_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Doubly_Linked_Lists;
diff --git a/gcc/ada/a-cfdlli.adb b/gcc/ada/a-cfdlli.adb
index ee9484077de..34668bdd2d5 100644
--- a/gcc/ada/a-cfdlli.adb
+++ b/gcc/ada/a-cfdlli.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2010-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -26,30 +26,9 @@
------------------------------------------------------------------------------
with System; use type System.Address;
-with Ada.Finalization;
package body Ada.Containers.Formal_Doubly_Linked_Lists is
- type Iterator is new Ada.Finalization.Limited_Controlled and
- List_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : List_Access;
- Node : Count_Type;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -197,8 +176,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
if Container.Length = 0 then
pragma Assert (Container.First = 0);
pragma Assert (Container.Last = 0);
- pragma Assert (Container.Busy = 0);
- pragma Assert (Container.Lock = 0);
return;
end if;
@@ -207,11 +184,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
while Container.Length > 1 loop
X := Container.First;
@@ -318,11 +290,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return;
end if;
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
for Index in 1 .. Count loop
pragma Assert (Container.Length >= 2);
@@ -371,11 +338,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return;
end if;
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
for J in 1 .. Count loop
X := Container.First;
pragma Assert (N (N (X).Next).Prev = Container.First);
@@ -410,11 +372,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return;
end if;
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
for J in 1 .. Count loop
X := Container.Last;
pragma Assert (N (N (X).Prev).Next = Container.Last);
@@ -445,21 +402,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return Container.Nodes (Position.Node).Element;
end Element;
- --------------
- -- Finalize --
- --------------
-
- procedure Finalize (Object : in out Iterator) is
- begin
- if Object.Container /= null then
- declare
- B : Natural renames Object.Container.all.Busy;
- begin
- B := B - 1;
- end;
- end if;
- end Finalize;
-
----------
-- Find --
----------
@@ -511,28 +453,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return (Node => Container.First);
end First;
- function First (Object : Iterator) return Cursor is
- begin
- -- The value of the iterator object's Node component influences the
- -- behavior of the First (and Last) selector function.
-
- -- When the Node component is null, this means the iterator object was
- -- constructed without a start expression, in which case the (forward)
- -- iteration starts from the (logical) beginning of the entire sequence
- -- of items (corresponding to Container.First, for a forward iterator).
-
- -- Otherwise, this is iteration over a partial sequence of items. When
- -- the Node component is non-null, the iterator object was constructed
- -- with a start expression, that specifies the position from which the
- -- (forward) partial iteration begins.
-
- if Object.Node = 0 then
- return First (Object.Container.all);
- else
- return (Node => Object.Node);
- end if;
- end First;
-
-------------------
-- First_Element --
-------------------
@@ -634,16 +554,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return;
end if;
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Target (list is busy)";
- end if;
-
- if Source.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Source (list is busy)";
- end if;
-
LI := First (Target);
RI := First (Source);
while RI.Node /= 0 loop
@@ -760,11 +670,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
Sort (Front => 0, Back => 0);
pragma Assert (N (Container.First).Prev = 0);
@@ -813,11 +718,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
raise Constraint_Error with "new length exceeds capacity";
end if;
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
Allocate (Container, New_Item, New_Node => J);
Insert_Internal (Container, Before.Node, New_Node => J);
Position := (Node => J);
@@ -861,11 +761,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
raise Constraint_Error with "new length exceeds capacity";
end if;
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
Allocate (Container, New_Node => J);
Insert_Internal (Container, Before.Node, New_Node => J);
Position := (Node => J);
@@ -940,103 +835,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return Length (Container) = 0;
end Is_Empty;
- -------------
- -- Iterate --
- -------------
-
- procedure Iterate
- (Container : List;
- Process :
- not null access procedure (Container : List; Position : Cursor))
- is
- C : List renames Container'Unrestricted_Access.all;
- B : Natural renames C.Busy;
- Node : Count_Type;
-
- begin
- B := B + 1;
-
- begin
- Node := Container.First;
- while Node /= 0 loop
- Process (Container, (Node => Node));
- Node := Container.Nodes (Node).Next;
- end loop;
-
- exception
- when others =>
- B := B - 1;
- raise;
- end;
-
- B := B - 1;
- end Iterate;
-
- function Iterate (Container : List)
- return List_Iterator_Interfaces.Reversible_Iterator'Class
- is
- B : Natural renames Container'Unrestricted_Access.all.Busy;
-
- begin
- -- The value of the Node component influences the behavior of the First
- -- and Last selector functions of the iterator object. When the Node
- -- component is null (as is the case here), this means the iterator
- -- object was constructed without a start expression. This is a
- -- complete iterator, meaning that the iteration starts from the
- -- (logical) beginning of the sequence of items.
-
- -- Note: For a forward iterator, Container.First is the beginning, and
- -- for a reverse iterator, Container.Last is the beginning.
-
- return It : constant Iterator :=
- Iterator'(Ada.Finalization.Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => 0)
- do
- B := B + 1;
- end return;
- end Iterate;
-
- function Iterate (Container : List; Start : Cursor)
- return List_Iterator_Interfaces.Reversible_Iterator'Class
- is
- B : Natural renames Container'Unrestricted_Access.all.Busy;
-
- begin
- -- It was formerly the case that when Start = No_Element, the partial
- -- iterator was defined to behave the same as for a complete iterator,
- -- and iterate over the entire sequence of items. However, those
- -- semantics were unintuitive and arguably error-prone (it is too easy
- -- to accidentally create an endless loop), and so they were changed,
- -- per the ARG meeting in Denver on 2011/11. However, there was no
- -- consensus about what positive meaning this corner case should have,
- -- and so it was decided to simply raise an exception. This does imply,
- -- however, that it is not possible to use a partial iterator to specify
- -- an empty sequence of items.
-
- if not Has_Element (Container, Start) then
- raise Constraint_Error with
- "Start position for iterator is not a valid cursor";
- end if;
-
- -- The value of the Node component influences the behavior of the First
- -- and Last selector functions of the iterator object. When the Node
- -- component is non-null (as is the case here), it means that this
- -- is a partial iteration, over a subset of the complete sequence of
- -- items. The iterator object was constructed with a start expression,
- -- indicating the position from which the iteration begins. Note that
- -- the start position has the same value irrespective of whether this
- -- is a forward or reverse iteration.
-
- return It : constant Iterator :=
- Iterator'(Ada.Finalization.Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => Start.Node)
- do
- B := B + 1;
- end return;
- end Iterate;
-
----------
-- Last --
----------
@@ -1049,28 +847,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return (Node => Container.Last);
end Last;
- function Last (Object : Iterator) return Cursor is
- begin
- -- The value of the iterator object's Node component influences the
- -- behavior of the Last (and First) selector function.
-
- -- When the Node component is null, this means the iterator object was
- -- constructed without a start expression, in which case the (reverse)
- -- iteration starts from the (logical) beginning of the entire sequence
- -- (corresponding to Container.Last, for a reverse iterator).
-
- -- Otherwise, this is iteration over a partial sequence of items. When
- -- the Node component is non-null, the iterator object was constructed
- -- with a start expression, that specifies the position from which the
- -- (reverse) partial iteration begins.
-
- if Object.Node = 0 then
- return Last (Object.Container.all);
- else
- return (Node => Object.Node);
- end if;
- end Last;
-
------------------
-- Last_Element --
------------------
@@ -1142,11 +918,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
"Source length exceeds Target capacity";
end if;
- if Source.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Source (list is busy)";
- end if;
-
Clear (Target);
while Source.Length > 1 loop
@@ -1229,23 +1000,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return (Node => Container.Nodes (Position.Node).Next);
end Next;
- function Next
- (Object : Iterator;
- Position : Cursor) return Cursor
- is
- begin
- return Next (Object.Container.all, Position);
- end Next;
-
- --------------------
- -- Not_No_Element --
- --------------------
-
- function Not_No_Element (Position : Cursor) return Boolean is
- begin
- return Position /= No_Element;
- end Not_No_Element;
-
-------------
-- Prepend --
-------------
@@ -1281,106 +1035,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return (Node => Container.Nodes (Position.Node).Prev);
end Previous;
- function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor
- is
- begin
- return Previous (Object.Container.all, Position);
- end Previous;
-
- -------------------
- -- Query_Element --
- -------------------
-
- procedure Query_Element
- (Container : List; Position : Cursor;
- Process : not null access procedure (Element : Element_Type))
- is
- C : List renames Container'Unrestricted_Access.all;
- B : Natural renames C.Busy;
- L : Natural renames C.Lock;
-
- begin
- if not Has_Element (Container, Position) then
- raise Constraint_Error with
- "Position cursor has no element";
- end if;
-
- B := B + 1;
- L := L + 1;
-
- declare
- N : Node_Type renames C.Nodes (Position.Node);
- begin
- Process (N.Element);
- exception
- when others =>
- L := L - 1;
- B := B - 1;
- raise;
- end;
-
- L := L - 1;
- B := B - 1;
- end Query_Element;
-
- ----------
- -- Read --
- ----------
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out List)
- is
- N : Count_Type'Base;
-
- begin
- Clear (Item);
-
- Count_Type'Base'Read (Stream, N);
-
- if N < 0 then
- raise Program_Error with "bad list length";
- end if;
-
- if N = 0 then
- return;
- end if;
-
- if N > Item.Capacity then
- raise Constraint_Error with "length exceeds capacity";
- end if;
-
- for J in 1 .. N loop
- Item.Append (Element_Type'Input (Stream)); -- ???
- end loop;
- end Read;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Cursor)
- is
- begin
- raise Program_Error with "attempt to stream list cursor";
- end Read;
-
- ---------------
- -- Reference --
- ---------------
-
- function Constant_Reference
- (Container : List;
- Position : Cursor) return Constant_Reference_Type
- is
- begin
- if not Has_Element (Container, Position) then
- raise Constraint_Error with "Position cursor has no element";
- end if;
-
- return (Element => Container.Nodes (Position.Node).Element'Access);
- end Constant_Reference;
-
---------------------
-- Replace_Element --
---------------------
@@ -1395,11 +1049,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
raise Constraint_Error with "Position cursor has no element";
end if;
- if Container.Lock > 0 then
- raise Program_Error with
- "attempt to tamper with cursors (list is locked)";
- end if;
-
pragma Assert
(Vet (Container, Position), "bad cursor in Replace_Element");
@@ -1465,11 +1114,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
pragma Assert (N (Container.First).Prev = 0);
pragma Assert (N (Container.Last).Next = 0);
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
Container.First := J;
Container.Last := I;
loop
@@ -1524,39 +1168,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return No_Element;
end Reverse_Find;
- ---------------------
- -- Reverse_Iterate --
- ---------------------
-
- procedure Reverse_Iterate
- (Container : List;
- Process :
- not null access procedure (Container : List; Position : Cursor))
- is
- C : List renames Container'Unrestricted_Access.all;
- B : Natural renames C.Busy;
-
- Node : Count_Type;
-
- begin
- B := B + 1;
-
- begin
- Node := Container.Last;
- while Node /= 0 loop
- Process (Container, (Node => Node));
- Node := Container.Nodes (Node).Prev;
- end loop;
-
- exception
- when others =>
- B := B - 1;
- raise;
- end;
-
- B := B - 1;
- end Reverse_Iterate;
-
-----------
-- Right --
-----------
@@ -1618,16 +1229,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
raise Constraint_Error;
end if;
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Target (list is busy)";
- end if;
-
- if Source.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Source (list is busy)";
- end if;
-
loop
Insert (Target, Before, SN (Source.Last).Element);
Delete_Last (Source);
@@ -1659,16 +1260,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
raise Constraint_Error;
end if;
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Target (list is busy)";
- end if;
-
- if Source.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors of Source (list is busy)";
- end if;
-
Insert
(Container => Target,
Before => Before,
@@ -1707,11 +1298,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
pragma Assert (Container.Length >= 2);
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
if Before.Node = 0 then
pragma Assert (Position.Node /= Container.Last);
@@ -1821,11 +1407,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return;
end if;
- if Container.Lock > 0 then
- raise Program_Error with
- "attempt to tamper with cursors (list is locked)";
- end if;
-
pragma Assert (Vet (Container, I), "bad I cursor in Swap");
pragma Assert (Vet (Container, J), "bad J cursor in Swap");
@@ -1865,11 +1446,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return;
end if;
- if Container.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with elements (list is busy)";
- end if;
-
pragma Assert (Vet (Container, I), "bad I cursor in Swap_Links");
pragma Assert (Vet (Container, J), "bad J cursor in Swap_Links");
@@ -1892,47 +1468,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
end if;
end Swap_Links;
- --------------------
- -- Update_Element --
- --------------------
-
- procedure Update_Element
- (Container : in out List;
- Position : Cursor;
- Process : not null access procedure (Element : in out Element_Type))
- is
- begin
- if Position.Node = 0 then
- raise Constraint_Error with "Position cursor has no element";
- end if;
-
- pragma Assert
- (Vet (Container, Position), "bad cursor in Update_Element");
-
- declare
- B : Natural renames Container.Busy;
- L : Natural renames Container.Lock;
-
- begin
- B := B + 1;
- L := L + 1;
-
- declare
- N : Node_Type renames Container.Nodes (Position.Node);
- begin
- Process (N.Element);
- exception
- when others =>
- L := L - 1;
- B := B - 1;
- raise;
- end;
-
- L := L - 1;
- B := B - 1;
- end;
- end Update_Element;
-
---------
-- Vet --
---------
@@ -2068,33 +1603,4 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
return True;
end Vet;
- -----------
- -- Write --
- -----------
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : List)
- is
- N : Node_Array renames Item.Nodes;
- Node : Count_Type;
-
- begin
- Count_Type'Base'Write (Stream, Item.Length);
-
- Node := Item.First;
- while Node /= 0 loop
- Element_Type'Write (Stream, N (Node).Element);
- Node := N (Node).Next;
- end loop;
- end Write;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Cursor)
- is
- begin
- raise Program_Error with "attempt to stream list cursor";
- end Write;
-
end Ada.Containers.Formal_Doubly_Linked_Lists;
diff --git a/gcc/ada/a-cfdlli.ads b/gcc/ada/a-cfdlli.ads
index 67ff3af8f48..1078c1f5a34 100644
--- a/gcc/ada/a-cfdlli.ads
+++ b/gcc/ada/a-cfdlli.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -49,11 +49,7 @@
-- function Left (Container : List; Position : Cursor) return List;
-- function Right (Container : List; Position : Cursor) return List;
--- See detailed specifications for these subprograms
-
-private with Ada.Streams;
-with Ada.Containers;
-with Ada.Iterator_Interfaces;
+-- See subprogram specifications that follow for details
generic
type Element_Type is private;
@@ -64,11 +60,8 @@ generic
package Ada.Containers.Formal_Doubly_Linked_Lists is
pragma Pure;
- type List (Capacity : Count_Type) is tagged private with
- Constant_Indexing => Constant_Reference,
- Default_Iterator => Iterate,
- Iterator_Element => Element_Type;
- -- pragma Preelaborable_Initialization (List);
+ type List (Capacity : Count_Type) is private;
+ pragma Preelaborable_Initialization (List);
type Cursor is private;
pragma Preelaborable_Initialization (Cursor);
@@ -77,17 +70,6 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is
No_Element : constant Cursor;
- function Not_No_Element (Position : Cursor) return Boolean;
-
- package List_Iterator_Interfaces is new
- Ada.Iterator_Interfaces (Cursor => Cursor, Has_Element => Not_No_Element);
-
- function Iterate (Container : List; Start : Cursor)
- return List_Iterator_Interfaces.Reversible_Iterator'Class;
-
- function Iterate (Container : List)
- return List_Iterator_Interfaces.Reversible_Iterator'Class;
-
function "=" (Left, Right : List) return Boolean;
function Length (Container : List) return Count_Type;
@@ -107,15 +89,6 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is
Position : Cursor;
New_Item : Element_Type);
- procedure Query_Element
- (Container : List; Position : Cursor;
- Process : not null access procedure (Element : Element_Type));
-
- procedure Update_Element
- (Container : in out List;
- Position : Cursor;
- Process : not null access procedure (Element : in out Element_Type));
-
procedure Move (Target : in out List; Source : in out List);
procedure Insert
@@ -218,16 +191,6 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is
function Has_Element (Container : List; Position : Cursor) return Boolean;
- procedure Iterate
- (Container : List;
- Process :
- not null access procedure (Container : List; Position : Cursor));
-
- procedure Reverse_Iterate
- (Container : List;
- Process :
- not null access procedure (Container : List; Position : Cursor));
-
generic
with function "<" (Left, Right : Element_Type) return Boolean is <>;
package Generic_Sorting is
@@ -240,15 +203,6 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is
end Generic_Sorting;
- type Constant_Reference_Type
- (Element : not null access constant Element_Type) is private
- with
- Implicit_Dereference => Element;
-
- function Constant_Reference
- (Container : List; -- SHOULD BE ALIASED ???
- Position : Cursor) return Constant_Reference_Type;
-
function Strict_Equal (Left, Right : List) return Boolean;
-- Strict_Equal returns True if the containers are physically equal, i.e.
-- they are structurally equal (function "=" returns True) and that they
@@ -268,7 +222,7 @@ private
type Node_Type is record
Prev : Count_Type'Base := -1;
Next : Count_Type;
- Element : aliased Element_Type;
+ Element : Element_Type;
end record;
function "=" (L, R : Node_Type) return Boolean is abstract;
@@ -279,49 +233,15 @@ private
type List (Capacity : Count_Type) is tagged record
Nodes : Node_Array (1 .. Capacity) := (others => <>);
Free : Count_Type'Base := -1;
- Busy : Natural := 0;
- Lock : Natural := 0;
Length : Count_Type := 0;
First : Count_Type := 0;
Last : Count_Type := 0;
end record;
- use Ada.Streams;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out List);
-
- for List'Read use Read;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : List);
-
- for List'Write use Write;
-
- type List_Access is access all List;
- for List_Access'Storage_Size use 0;
-
type Cursor is record
Node : Count_Type := 0;
end record;
- type Constant_Reference_Type
- (Element : not null access constant Element_Type) is null record;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Cursor);
-
- for Cursor'Read use Read;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Cursor);
-
- for Cursor'Write use Write;
-
Empty_List : constant List := (0, others => <>);
No_Element : constant Cursor := (Node => 0);
diff --git a/gcc/ada/a-cidlli.adb b/gcc/ada/a-cidlli.adb
index 7d5e22ee80e..04d0597a22c 100644
--- a/gcc/ada/a-cidlli.adb
+++ b/gcc/ada/a-cidlli.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -36,26 +36,6 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
procedure Free is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
- type Iterator is new Limited_Controlled and
- List_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : List_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -67,6 +47,17 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Before : Node_Access;
New_Node : Node_Access);
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access;
+ Source : in out List);
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access;
+ Source : in out List;
+ Position : Node_Access);
+
function Vet (Position : Cursor) return Boolean;
-- Checks invariants of the cursor and its designated container, as a
-- simple way of detecting dangling references (see operation Free for a
@@ -79,8 +70,15 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
---------
function "=" (Left, Right : List) return Boolean is
- L : Node_Access;
- R : Node_Access;
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ L : Node_Access;
+ R : Node_Access;
+ Result : Boolean;
begin
if Left'Address = Right'Address then
@@ -91,18 +89,45 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
L := Left.First;
R := Right.First;
+ Result := True;
for J in 1 .. Left.Length loop
if L.Element.all /= R.Element.all then
- return False;
+ Result := False;
+ exit;
end if;
L := L.Next;
R := R.Next;
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end "=";
------------
@@ -203,15 +228,16 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Target'Address = Source'Address then
return;
- end if;
- Target.Clear;
+ else
+ Target.Clear;
- Node := Source.First;
- while Node /= null loop
- Target.Append (Node.Element.all);
- Node := Node.Next;
- end loop;
+ Node := Source.First;
+ while Node /= null loop
+ Target.Append (Node.Element.all);
+ Node := Node.Next;
+ end loop;
+ end if;
end Assign;
-----------
@@ -272,32 +298,30 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
-
- if Position.Node.Element = null then
+ elsif Position.Node.Element = null then
raise Program_Error with "Node has no element";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
- declare
- C : List renames Position.Container.all;
- B : Natural renames C.Busy;
- L : Natural renames C.Lock;
- begin
- return R : constant Constant_Reference_Type :=
- (Element => Position.Node.Element.all'Access,
- Control => (Controlled with Position.Container))
- do
- B := B + 1;
- L := L + 1;
- end return;
- end;
+ declare
+ C : List renames Position.Container.all;
+ B : Natural renames C.Busy;
+ L : Natural renames C.Lock;
+ begin
+ return R : constant Constant_Reference_Type :=
+ (Element => Position.Node.Element.all'Access,
+ Control => (Controlled with Position.Container))
+ do
+ B := B + 1;
+ L := L + 1;
+ end return;
+ end;
+ end if;
end Constant_Reference;
--------------
@@ -390,6 +414,8 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Free (X);
end loop;
+ -- Fix this junk comment ???
+
Position := No_Element; -- Post-York behavior
end Delete;
@@ -407,28 +433,27 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Count >= Container.Length then
Clear (Container);
return;
- end if;
- if Count = 0 then
+ elsif Count = 0 then
return;
- end if;
- if Container.Busy > 0 then
+ elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
- end if;
- for I in 1 .. Count loop
- X := Container.First;
- pragma Assert (X.Next.Prev = Container.First);
+ else
+ for J in 1 .. Count loop
+ X := Container.First;
+ pragma Assert (X.Next.Prev = Container.First);
- Container.First := X.Next;
- Container.First.Prev := null;
+ Container.First := X.Next;
+ Container.First.Prev := null;
- Container.Length := Container.Length - 1;
+ Container.Length := Container.Length - 1;
- Free (X);
- end loop;
+ Free (X);
+ end loop;
+ end if;
end Delete_First;
-----------------
@@ -445,28 +470,27 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Count >= Container.Length then
Clear (Container);
return;
- end if;
- if Count = 0 then
+ elsif Count = 0 then
return;
- end if;
- if Container.Busy > 0 then
+ elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
- end if;
- for I in 1 .. Count loop
- X := Container.Last;
- pragma Assert (X.Prev.Next = Container.Last);
+ else
+ for J in 1 .. Count loop
+ X := Container.Last;
+ pragma Assert (X.Prev.Next = Container.Last);
- Container.Last := X.Prev;
- Container.Last.Next := null;
+ Container.Last := X.Prev;
+ Container.Last.Next := null;
- Container.Length := Container.Length - 1;
+ Container.Length := Container.Length - 1;
- Free (X);
- end loop;
+ Free (X);
+ end loop;
+ end if;
end Delete_Last;
-------------
@@ -478,16 +502,16 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Position.Node = null then
raise Constraint_Error with
"Position cursor has no element";
- end if;
- if Position.Node.Element = null then
+ elsif Position.Node.Element = null then
raise Program_Error with
"Position cursor has no element";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Element");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Element");
- return Position.Node.Element.all;
+ return Position.Node.Element.all;
+ end if;
end Element;
--------------
@@ -539,25 +563,54 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
else
if Node.Element = null then
raise Program_Error;
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Find");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Find");
+ end if;
end if;
- while Node /= null loop
- if Node.Element.all = Item then
- return Cursor'(Container'Unrestricted_Access, Node);
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- Node := Node.Next;
- end loop;
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Node_Access;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := null;
+ while Node /= null loop
+ if Node.Element.all = Item then
+ Result := Node;
+ exit;
+ end if;
- return No_Element;
+ Node := Node.Next;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = null then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Find;
-----------
@@ -568,9 +621,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.First = null then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Container.First);
end First;
function First (Object : Iterator) return Cursor is
@@ -603,9 +656,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.First = null then
raise Constraint_Error with "list is empty";
+ else
+ return Container.First.Element.all;
end if;
-
- return Container.First.Element.all;
end First_Element;
----------
@@ -660,18 +713,40 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
---------------
function Is_Sorted (Container : List) return Boolean is
- Node : Node_Access := Container.First;
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Node : Node_Access;
+ Result : Boolean;
begin
- for I in 2 .. Container.Length loop
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Node := Container.First;
+ Result := True;
+ for J in 2 .. Container.Length loop
if Node.Next.Element.all < Node.Element.all then
- return False;
+ Result := False;
+ exit;
end if;
Node := Node.Next;
end loop;
- return True;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Is_Sorted;
-----------
@@ -682,10 +757,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
(Target : in out List;
Source : in out List)
is
- LI, RI : Cursor;
-
begin
-
-- The semantics of Merge changed slightly per AI05-0021. It was
-- originally the case that if Target and Source denoted the same
-- container object, then the GNAT implementation of Merge did
@@ -696,52 +768,81 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Source.Is_Empty then
return;
- end if;
- if Target'Address = Source'Address then
+ elsif Target'Address = Source'Address then
raise Program_Error with
"Target and Source denote same non-empty container";
- end if;
- if Target.Busy > 0 then
+ elsif Target.Length > Count_Type'Last - Source.Length then
+ raise Constraint_Error with "new length exceeds maximum";
+
+ elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
- end if;
- if Source.Busy > 0 then
+ elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
- LI := First (Target);
- RI := First (Source);
- while RI.Node /= null loop
- pragma Assert (RI.Node.Next = null
- or else not (RI.Node.Next.Element.all <
- RI.Node.Element.all));
+ declare
+ TB : Natural renames Target.Busy;
+ TL : Natural renames Target.Lock;
- if LI.Node = null then
- Splice (Target, No_Element, Source);
- return;
- end if;
+ SB : Natural renames Source.Busy;
+ SL : Natural renames Source.Lock;
- pragma Assert (LI.Node.Next = null
- or else not (LI.Node.Next.Element.all <
- LI.Node.Element.all));
+ LI, RI, RJ : Node_Access;
- if RI.Node.Element.all < LI.Node.Element.all then
- declare
- RJ : Cursor := RI;
- pragma Warnings (Off, RJ);
- begin
- RI.Node := RI.Node.Next;
- Splice (Target, LI, Source, RJ);
- end;
+ begin
+ TB := TB + 1;
+ TL := TL + 1;
+
+ SB := SB + 1;
+ SL := SL + 1;
+
+ LI := Target.First;
+ RI := Source.First;
+ while RI /= null loop
+ pragma Assert (RI.Next = null
+ or else not (RI.Next.Element.all <
+ RI.Element.all));
+
+ if LI = null then
+ Splice_Internal (Target, null, Source);
+ exit;
+ end if;
- else
- LI.Node := LI.Node.Next;
- end if;
- end loop;
+ pragma Assert (LI.Next = null
+ or else not (LI.Next.Element.all <
+ LI.Element.all));
+
+ if RI.Element.all < LI.Element.all then
+ RJ := RI;
+ RI := RI.Next;
+ Splice_Internal (Target, LI, Source, RJ);
+
+ else
+ LI := LI.Next;
+ end if;
+ end loop;
+
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ exception
+ when others =>
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ raise;
+ end;
end Merge;
----------
@@ -750,22 +851,26 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
procedure Sort (Container : in out List) is
procedure Partition (Pivot : Node_Access; Back : Node_Access);
+ -- Comment ???
procedure Sort (Front, Back : Node_Access);
+ -- Comment??? Confusing name??? change name???
---------------
-- Partition --
---------------
procedure Partition (Pivot : Node_Access; Back : Node_Access) is
- Node : Node_Access := Pivot.Next;
+ Node : Node_Access;
begin
+ Node := Pivot.Next;
while Node /= Back loop
if Node.Element.all < Pivot.Element.all then
declare
Prev : constant Node_Access := Node.Prev;
Next : constant Node_Access := Node.Next;
+
begin
Prev.Next := Next;
@@ -825,7 +930,27 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
- Sort (Front => null, Back => null);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Sort (Front => null, Back => null);
+
+ B := B - 1;
+ L := L - 1;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
pragma Assert (Container.First.Prev = null);
pragma Assert (Container.Last.Next = null);
@@ -861,16 +986,14 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Before.Container /= Container'Unrestricted_Access then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
- end if;
- if Before.Node = null
- or else Before.Node.Element = null
- then
+ elsif Before.Node = null or else Before.Node.Element = null then
raise Program_Error with
"Before cursor has no element";
- end if;
- pragma Assert (Vet (Before), "bad cursor in Insert");
+ else
+ pragma Assert (Vet (Before), "bad cursor in Insert");
+ end if;
end if;
if Count = 0 then
@@ -910,8 +1033,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Insert_Internal (Container, Before.Node, New_Node);
Position := Cursor'(Container'Unchecked_Access, New_Node);
- for J in Count_Type'(2) .. Count loop
-
+ for J in 2 .. Count loop
declare
Element : Element_Access := new Element_Type'(New_Item);
begin
@@ -1041,9 +1163,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
-- for a reverse iterator, Container.Last is the beginning.
return It : constant Iterator :=
- Iterator'(Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => null)
+ Iterator'(Limited_Controlled with
+ Container => Container'Unrestricted_Access,
+ Node => null)
do
B := B + 1;
end return;
@@ -1071,31 +1193,31 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Start = No_Element then
raise Constraint_Error with
"Start position for iterator equals No_Element";
- end if;
- if Start.Container /= Container'Unrestricted_Access then
+ elsif Start.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Start cursor of Iterate designates wrong list";
- end if;
-
- pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
-
- -- The value of the Node component influences the behavior of the First
- -- and Last selector functions of the iterator object. When the Node
- -- component is non-null (as is the case here), it means that this
- -- is a partial iteration, over a subset of the complete sequence of
- -- items. The iterator object was constructed with a start expression,
- -- indicating the position from which the iteration begins. Note that
- -- the start position has the same value irrespective of whether this
- -- is a forward or reverse iteration.
- return It : constant Iterator :=
- Iterator'(Limited_Controlled with
- Container => Container'Unrestricted_Access,
- Node => Start.Node)
- do
- B := B + 1;
- end return;
+ else
+ pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
+
+ -- The value of the Node component influences the behavior of the
+ -- First and Last selector functions of the iterator object. When
+ -- the Node component is non-null (as is the case here), it means
+ -- that this is a partial iteration, over a subset of the complete
+ -- sequence of items. The iterator object was constructed with
+ -- a start expression, indicating the position from which the
+ -- iteration begins. Note that the start position has the same value
+ -- irrespective of whether this is a forward or reverse iteration.
+
+ return It : constant Iterator :=
+ Iterator'(Limited_Controlled with
+ Container => Container'Unrestricted_Access,
+ Node => Start.Node)
+ do
+ B := B + 1;
+ end return;
+ end if;
end Iterate;
----------
@@ -1106,9 +1228,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.Last = null then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Container.Last);
end Last;
function Last (Object : Iterator) return Cursor is
@@ -1141,9 +1263,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.Last = null then
raise Constraint_Error with "list is empty";
+ else
+ return Container.Last.Element.all;
end if;
-
- return Container.Last.Element.all;
end Last_Element;
------------
@@ -1163,23 +1285,23 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Target'Address = Source'Address then
return;
- end if;
- if Source.Busy > 0 then
+ elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
- end if;
- Clear (Target);
+ else
+ Clear (Target);
- Target.First := Source.First;
- Source.First := null;
+ Target.First := Source.First;
+ Source.First := null;
- Target.Last := Source.Last;
- Source.Last := null;
+ Target.Last := Source.Last;
+ Source.Last := null;
- Target.Length := Source.Length;
- Source.Length := 0;
+ Target.Length := Source.Length;
+ Source.Length := 0;
+ end if;
end Move;
----------
@@ -1195,33 +1317,32 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
- end if;
-
- pragma Assert (Vet (Position), "bad cursor in Next");
- declare
- Next_Node : constant Node_Access := Position.Node.Next;
- begin
- if Next_Node = null then
- return No_Element;
- end if;
+ else
+ pragma Assert (Vet (Position), "bad cursor in Next");
- return Cursor'(Position.Container, Next_Node);
- end;
+ declare
+ Next_Node : constant Node_Access := Position.Node.Next;
+ begin
+ if Next_Node = null then
+ return No_Element;
+ else
+ return Cursor'(Position.Container, Next_Node);
+ end if;
+ end;
+ end if;
end Next;
function Next (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
+ else
+ return Next (Position);
end if;
-
- return Next (Position);
end Next;
-------------
@@ -1250,33 +1371,32 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
- end if;
-
- pragma Assert (Vet (Position), "bad cursor in Previous");
- declare
- Prev_Node : constant Node_Access := Position.Node.Prev;
- begin
- if Prev_Node = null then
- return No_Element;
- end if;
+ else
+ pragma Assert (Vet (Position), "bad cursor in Previous");
- return Cursor'(Position.Container, Prev_Node);
- end;
+ declare
+ Prev_Node : constant Node_Access := Position.Node.Prev;
+ begin
+ if Prev_Node = null then
+ return No_Element;
+ else
+ return Cursor'(Position.Container, Prev_Node);
+ end if;
+ end;
+ end if;
end Previous;
function Previous (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
+ else
+ return Previous (Position);
end if;
-
- return Previous (Position);
end Previous;
-------------------
@@ -1291,36 +1411,36 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Position.Node = null then
raise Constraint_Error with
"Position cursor has no element";
- end if;
- if Position.Node.Element = null then
+ elsif Position.Node.Element = null then
raise Program_Error with
"Position cursor has no element";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Query_Element");
-
- declare
- C : List renames Position.Container.all'Unrestricted_Access.all;
- B : Natural renames C.Busy;
- L : Natural renames C.Lock;
+ else
+ pragma Assert (Vet (Position), "bad cursor in Query_Element");
- begin
- B := B + 1;
- L := L + 1;
+ declare
+ C : List renames Position.Container.all'Unrestricted_Access.all;
+ B : Natural renames C.Busy;
+ L : Natural renames C.Lock;
begin
- Process (Position.Node.Element.all);
- exception
- when others =>
- L := L - 1;
- B := B - 1;
- raise;
- end;
+ B := B + 1;
+ L := L + 1;
- L := L - 1;
- B := B - 1;
- end;
+ begin
+ Process (Position.Node.Element.all);
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ L := L - 1;
+ B := B - 1;
+ end;
+ end if;
end Query_Element;
----------
@@ -1345,7 +1465,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
declare
Element : Element_Access :=
- new Element_Type'(Element_Type'Input (Stream));
+ new Element_Type'(Element_Type'Input (Stream));
begin
Dst := new Node_Type'(Element, null, null);
exception
@@ -1361,7 +1481,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
while Item.Length < N loop
declare
Element : Element_Access :=
- new Element_Type'(Element_Type'Input (Stream));
+ new Element_Type'(Element_Type'Input (Stream));
begin
Dst := new Node_Type'(Element, Next => null, Prev => Item.Last);
exception
@@ -1411,32 +1531,31 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- if Position.Node.Element = null then
+ elsif Position.Node.Element = null then
raise Program_Error with "Node has no element";
- end if;
- pragma Assert (Vet (Position), "bad cursor in function Reference");
+ else
+ pragma Assert (Vet (Position), "bad cursor in function Reference");
- declare
- C : List renames Position.Container.all;
- B : Natural renames C.Busy;
- L : Natural renames C.Lock;
- begin
- return R : constant Reference_Type :=
- (Element => Position.Node.Element.all'Access,
- Control => (Controlled with Position.Container))
- do
- B := B + 1;
- L := L + 1;
- end return;
- end;
+ declare
+ C : List renames Position.Container.all;
+ B : Natural renames C.Busy;
+ L : Natural renames C.Lock;
+ begin
+ return R : constant Reference_Type :=
+ (Element => Position.Node.Element.all'Access,
+ Control => (Controlled with Position.Container))
+ do
+ B := B + 1;
+ L := L + 1;
+ end return;
+ end;
+ end if;
end Reference;
---------------------
@@ -1451,38 +1570,36 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unchecked_Access then
+ elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- if Container.Lock > 0 then
+ elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (list is locked)";
- end if;
- if Position.Node.Element = null then
+ elsif Position.Node.Element = null then
raise Program_Error with
"Position cursor has no element";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Replace_Element");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Replace_Element");
- declare
- -- The element allocator may need an accessibility check in the case
- -- the actual type is class-wide or has access discriminants (see
- -- RM 4.8(10.1) and AI12-0035).
+ declare
+ -- The element allocator may need an accessibility check in the
+ -- case the actual type is class-wide or has access discriminants
+ -- (see RM 4.8(10.1) and AI12-0035).
- pragma Unsuppress (Accessibility_Check);
+ pragma Unsuppress (Accessibility_Check);
- X : Element_Access := Position.Node.Element;
+ X : Element_Access := Position.Node.Element;
- begin
- Position.Node.Element := new Element_Type'(New_Item);
- Free (X);
- end;
+ begin
+ Position.Node.Element := new Element_Type'(New_Item);
+ Free (X);
+ end;
+ end if;
end Replace_Element;
----------------------
@@ -1590,25 +1707,54 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
else
if Node.Element = null then
raise Program_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
- end if;
- pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
+ else
+ pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
+ end if;
end if;
- while Node /= null loop
- if Node.Element.all = Item then
- return Cursor'(Container'Unrestricted_Access, Node);
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- Node := Node.Prev;
- end loop;
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Node_Access;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := null;
+ while Node /= null loop
+ if Node.Element.all = Item then
+ Result := Node;
+ exit;
+ end if;
+
+ Node := Node.Prev;
+ end loop;
- return No_Element;
+ B := B - 1;
+ L := L - 1;
+
+ if Result = null then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Reverse_Find;
---------------------
@@ -1655,79 +1801,33 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
- end if;
- if Before.Node = null
- or else Before.Node.Element = null
- then
+ elsif Before.Node = null or else Before.Node.Element = null then
raise Program_Error with
"Before cursor has no element";
- end if;
- pragma Assert (Vet (Before), "bad cursor in Splice");
+ else
+ pragma Assert (Vet (Before), "bad cursor in Splice");
+ end if;
end if;
- if Target'Address = Source'Address
- or else Source.Length = 0
- then
+ if Target'Address = Source'Address or else Source.Length = 0 then
return;
- end if;
- pragma Assert (Source.First.Prev = null);
- pragma Assert (Source.Last.Next = null);
-
- if Target.Length > Count_Type'Last - Source.Length then
+ elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
- end if;
- if Target.Busy > 0 then
+ elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
- end if;
- if Source.Busy > 0 then
+ elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
- end if;
-
- if Target.Length = 0 then
- pragma Assert (Before = No_Element);
- pragma Assert (Target.First = null);
- pragma Assert (Target.Last = null);
-
- Target.First := Source.First;
- Target.Last := Source.Last;
-
- elsif Before.Node = null then
- pragma Assert (Target.Last.Next = null);
-
- Target.Last.Next := Source.First;
- Source.First.Prev := Target.Last;
-
- Target.Last := Source.Last;
-
- elsif Before.Node = Target.First then
- pragma Assert (Target.First.Prev = null);
-
- Source.Last.Next := Target.First;
- Target.First.Prev := Source.Last;
-
- Target.First := Source.First;
else
- pragma Assert (Target.Length >= 2);
- Before.Node.Prev.Next := Source.First;
- Source.First.Prev := Before.Node.Prev;
-
- Before.Node.Prev := Source.Last;
- Source.Last.Next := Before.Node;
+ Splice_Internal (Target, Before.Node, Source);
end if;
-
- Source.First := null;
- Source.Last := null;
-
- Target.Length := Target.Length + Source.Length;
- Source.Length := 0;
end Splice;
procedure Splice
@@ -1740,16 +1840,14 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Before.Container /= Container'Unchecked_Access then
raise Program_Error with
"Before cursor designates wrong container";
- end if;
- if Before.Node = null
- or else Before.Node.Element = null
- then
+ elsif Before.Node = null or else Before.Node.Element = null then
raise Program_Error with
"Before cursor has no element";
- end if;
- pragma Assert (Vet (Before), "bad Before cursor in Splice");
+ else
+ pragma Assert (Vet (Before), "bad Before cursor in Splice");
+ end if;
end if;
if Position.Node = null then
@@ -1901,10 +1999,94 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
"attempt to tamper with cursors of Source (list is busy)";
end if;
- if Position.Node = Source.First then
- Source.First := Position.Node.Next;
+ Splice_Internal (Target, Before.Node, Source, Position.Node);
+ Position.Container := Target'Unchecked_Access;
+ end Splice;
- if Position.Node = Source.Last then
+ ---------------------
+ -- Splice_Internal --
+ ---------------------
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access;
+ Source : in out List)
+ is
+ begin
+ -- This implements the corresponding Splice operation, after the
+ -- parameters have been vetted, and corner-cases disposed of.
+
+ pragma Assert (Target'Address /= Source'Address);
+ pragma Assert (Source.Length > 0);
+ pragma Assert (Source.First /= null);
+ pragma Assert (Source.First.Prev = null);
+ pragma Assert (Source.Last /= null);
+ pragma Assert (Source.Last.Next = null);
+ pragma Assert (Target.Length <= Count_Type'Last - Source.Length);
+
+ if Target.Length = 0 then
+ pragma Assert (Before = null);
+ pragma Assert (Target.First = null);
+ pragma Assert (Target.Last = null);
+
+ Target.First := Source.First;
+ Target.Last := Source.Last;
+
+ elsif Before = null then
+ pragma Assert (Target.Last.Next = null);
+
+ Target.Last.Next := Source.First;
+ Source.First.Prev := Target.Last;
+
+ Target.Last := Source.Last;
+
+ elsif Before = Target.First then
+ pragma Assert (Target.First.Prev = null);
+
+ Source.Last.Next := Target.First;
+ Target.First.Prev := Source.Last;
+
+ Target.First := Source.First;
+
+ else
+ pragma Assert (Target.Length >= 2);
+ Before.Prev.Next := Source.First;
+ Source.First.Prev := Before.Prev;
+
+ Before.Prev := Source.Last;
+ Source.Last.Next := Before;
+ end if;
+
+ Source.First := null;
+ Source.Last := null;
+
+ Target.Length := Target.Length + Source.Length;
+ Source.Length := 0;
+ end Splice_Internal;
+
+ procedure Splice_Internal
+ (Target : in out List;
+ Before : Node_Access; -- node of Target
+ Source : in out List;
+ Position : Node_Access) -- node of Source
+ is
+ begin
+ -- This implements the corresponding Splice operation, after the
+ -- parameters have been vetted.
+
+ pragma Assert (Target'Address /= Source'Address);
+ pragma Assert (Target.Length < Count_Type'Last);
+ pragma Assert (Source.Length > 0);
+ pragma Assert (Source.First /= null);
+ pragma Assert (Source.First.Prev = null);
+ pragma Assert (Source.Last /= null);
+ pragma Assert (Source.Last.Next = null);
+ pragma Assert (Position /= null);
+
+ if Position = Source.First then
+ Source.First := Position.Next;
+
+ if Position = Source.Last then
pragma Assert (Source.First = null);
pragma Assert (Source.Length = 1);
Source.Last := null;
@@ -1913,58 +2095,56 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Source.First.Prev := null;
end if;
- elsif Position.Node = Source.Last then
+ elsif Position = Source.Last then
pragma Assert (Source.Length >= 2);
- Source.Last := Position.Node.Prev;
+ Source.Last := Position.Prev;
Source.Last.Next := null;
else
pragma Assert (Source.Length >= 3);
- Position.Node.Prev.Next := Position.Node.Next;
- Position.Node.Next.Prev := Position.Node.Prev;
+ Position.Prev.Next := Position.Next;
+ Position.Next.Prev := Position.Prev;
end if;
if Target.Length = 0 then
- pragma Assert (Before = No_Element);
+ pragma Assert (Before = null);
pragma Assert (Target.First = null);
pragma Assert (Target.Last = null);
- Target.First := Position.Node;
- Target.Last := Position.Node;
+ Target.First := Position;
+ Target.Last := Position;
Target.First.Prev := null;
Target.Last.Next := null;
- elsif Before.Node = null then
+ elsif Before = null then
pragma Assert (Target.Last.Next = null);
- Target.Last.Next := Position.Node;
- Position.Node.Prev := Target.Last;
+ Target.Last.Next := Position;
+ Position.Prev := Target.Last;
- Target.Last := Position.Node;
+ Target.Last := Position;
Target.Last.Next := null;
- elsif Before.Node = Target.First then
+ elsif Before = Target.First then
pragma Assert (Target.First.Prev = null);
- Target.First.Prev := Position.Node;
- Position.Node.Next := Target.First;
+ Target.First.Prev := Position;
+ Position.Next := Target.First;
- Target.First := Position.Node;
+ Target.First := Position;
Target.First.Prev := null;
else
pragma Assert (Target.Length >= 2);
- Before.Node.Prev.Next := Position.Node;
- Position.Node.Prev := Before.Node.Prev;
+ Before.Prev.Next := Position;
+ Position.Prev := Before.Prev;
- Before.Node.Prev := Position.Node;
- Position.Node.Next := Before.Node;
+ Before.Prev := Position;
+ Position.Next := Before;
end if;
Target.Length := Target.Length + 1;
Source.Length := Source.Length - 1;
-
- Position.Container := Target'Unchecked_Access;
- end Splice;
+ end Splice_Internal;
----------
-- Swap --
diff --git a/gcc/ada/a-cidlli.ads b/gcc/ada/a-cidlli.ads
index af57af11ae9..a7e133c303d 100644
--- a/gcc/ada/a-cidlli.ads
+++ b/gcc/ada/a-cidlli.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -352,4 +352,24 @@ private
No_Element : constant Cursor := Cursor'(null, null);
+ type Iterator is new Limited_Controlled and
+ List_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : List_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Doubly_Linked_Lists;
diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb
index 2d889cdfb1b..e3e3d5ee43d 100644
--- a/gcc/ada/a-cihama.adb
+++ b/gcc/ada/a-cihama.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -45,20 +45,6 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
procedure Free_Element is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
- type Iterator is new Limited_Controlled and
- Map_Iterator_Interfaces.Forward_Iterator with
- record
- Container : Map_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/a-cihama.ads b/gcc/ada/a-cihama.ads
index feef181b65b..6e2df212a22 100644
--- a/gcc/ada/a-cihama.ads
+++ b/gcc/ada/a-cihama.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -418,4 +418,18 @@ private
No_Element : constant Cursor := (Container => null, Node => null);
+ type Iterator is new Limited_Controlled and
+ Map_Iterator_Interfaces.Forward_Iterator with
+ record
+ Container : Map_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Hashed_Maps;
diff --git a/gcc/ada/a-cihase.adb b/gcc/ada/a-cihase.adb
index bae3ecc3897..7a70bf65a87 100644
--- a/gcc/ada/a-cihase.adb
+++ b/gcc/ada/a-cihase.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -41,20 +41,6 @@ with System; use type System.Address;
package body Ada.Containers.Indefinite_Hashed_Sets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Forward_Iterator with
- record
- Container : Set_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/a-cihase.ads b/gcc/ada/a-cihase.ads
index b300186f6db..2c4dec59996 100644
--- a/gcc/ada/a-cihase.ads
+++ b/gcc/ada/a-cihase.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -541,4 +541,18 @@ private
No_Element : constant Cursor := (Container => null, Node => null);
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Forward_Iterator with
+ record
+ Container : Set_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Hashed_Sets;
diff --git a/gcc/ada/a-ciorma.adb b/gcc/ada/a-ciorma.adb
index 7f2b2491eeb..b836dc69fd0 100644
--- a/gcc/ada/a-ciorma.adb
+++ b/gcc/ada/a-ciorma.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -40,26 +40,6 @@ with System; use type System.Address;
package body Ada.Containers.Indefinite_Ordered_Maps is
pragma Suppress (All_Checks);
- type Iterator is new Limited_Controlled and
- Map_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Map_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------------
-- Node Access Subprograms --
-----------------------------
diff --git a/gcc/ada/a-ciorma.ads b/gcc/ada/a-ciorma.ads
index 5c3a776c4aa..e414d39cf71 100644
--- a/gcc/ada/a-ciorma.ads
+++ b/gcc/ada/a-ciorma.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -353,4 +353,24 @@ private
No_Element : constant Cursor := Cursor'(null, null);
+ type Iterator is new Limited_Controlled and
+ Map_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Map_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Ordered_Maps;
diff --git a/gcc/ada/a-ciormu.adb b/gcc/ada/a-ciormu.adb
index 4fce4754c78..2bc1200014b 100644
--- a/gcc/ada/a-ciormu.adb
+++ b/gcc/ada/a-ciormu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -42,26 +42,6 @@ with System; use type System.Address;
package body Ada.Containers.Indefinite_Ordered_Multisets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Set_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------------
-- Node Access Subprograms --
-----------------------------
diff --git a/gcc/ada/a-ciormu.ads b/gcc/ada/a-ciormu.ads
index cfd1676aa5f..575d5d8321e 100644
--- a/gcc/ada/a-ciormu.ads
+++ b/gcc/ada/a-ciormu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -508,4 +508,24 @@ private
Busy => 0,
Lock => 0));
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Set_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Ordered_Multisets;
diff --git a/gcc/ada/a-ciorse.adb b/gcc/ada/a-ciorse.adb
index a6538665a1b..2f8820cb952 100644
--- a/gcc/ada/a-ciorse.adb
+++ b/gcc/ada/a-ciorse.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -42,26 +42,6 @@ with System; use type System.Address;
package body Ada.Containers.Indefinite_Ordered_Sets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Set_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -494,14 +474,13 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
procedure Delete (Container : in out Set; Item : Element_Type) is
X : Node_Access := Element_Keys.Find (Container.Tree, Item);
-
begin
if X = null then
raise Constraint_Error with "attempt to delete element not in set";
+ else
+ Tree_Operations.Delete_Node_Sans_Free (Container.Tree, X);
+ Free (X);
end if;
-
- Tree_Operations.Delete_Node_Sans_Free (Container.Tree, X);
- Free (X);
end Delete;
------------------
@@ -1088,12 +1067,15 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
B : Natural renames Tree.Busy;
L : Natural renames Tree.Lock;
+ Eq : Boolean;
+
begin
B := B + 1;
L := L + 1;
begin
Process (E);
+ Eq := Equivalent_Keys (K, Key (E));
exception
when others =>
L := L - 1;
@@ -1104,7 +1086,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
L := L - 1;
B := B - 1;
- if Equivalent_Keys (K, Key (E)) then
+ if Eq then
return;
end if;
end;
@@ -1884,16 +1866,55 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Hint : Node_Access;
Result : Node_Access;
Inserted : Boolean;
+ Compare : Boolean;
X : Element_Access := Node.Element;
- -- Start of processing for Replace_Element
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+
+ -- Start of processing for Replace_Element
begin
- if Item < Node.Element.all or else Node.Element.all < Item then
- null;
+ -- Replace_Element assigns value Item to the element designated by Node,
+ -- per certain semantic constraints, described as follows.
+
+ -- If Item is equivalent to the element, then element is replaced and
+ -- there's nothing else to do. This is the easy case.
+
+ -- If Item is not equivalent, then the node will (possibly) have to move
+ -- to some other place in the tree. This is slighly more complicated,
+ -- because we must ensure that Item is not equivalent to some other
+ -- element in the tree (in which case, the replacement is not allowed).
+
+ -- Determine whether Item is equivalent to element on the specified
+ -- node.
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := (if Item < Node.Element.all then False
+ elsif Node.Element.all < Item then False
+ else True);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
+ -- Item is equivalent to the node's element, so we will not have to
+ -- move the node.
- else
if Tree.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (set is locked)";
@@ -1914,12 +1935,66 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
return;
end if;
+ -- The replacement Item is not equivalent to the element on the
+ -- specified node, which means that it will need to be re-inserted in a
+ -- different position in the tree. We must now determine whether Item is
+ -- equivalent to some other element in the tree (which would prohibit
+ -- the assignment and hence the move).
+
+ -- Ceiling returns the smallest element equivalent or greater than the
+ -- specified Item; if there is no such element, then it returns null.
+
Hint := Element_Keys.Ceiling (Tree, Item);
- if Hint = null then
- null;
+ if Hint /= null then
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Item < Hint.Element.all;
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ -- Item >= Hint.Element
+
+ if not Compare then
+
+ -- Ceiling returns an element that is equivalent or greater
+ -- than Item. If Item is "not less than" the element, then
+ -- by elimination we know that Item is equivalent to the element.
+
+ -- But this means that it is not possible to assign the value of
+ -- Item to the specified element (on Node), because a different
+ -- element (on Hint) equivalent to Item already exsits. (Were we
+ -- to change Node's element value, we would have to move Node, but
+ -- we would be unable to move the Node, because its new position
+ -- in the tree is already occupied by an equivalent element.)
+
+ raise Program_Error with "attempt to replace existing element";
+ end if;
+
+ -- Item is not equivalent to any other element in the tree, so it is
+ -- safe to assign the value of Item to Node.Element. This means that
+ -- the node will have to move to a different position in the tree
+ -- (because its element will have a different value).
+
+ -- The nearest (greater) neighbor of Item is Hint. This will be the
+ -- insertion position of Node (because its element will have Item as
+ -- its new value).
+
+ -- If Node equals Hint, the relative position of Node does not
+ -- change. This allows us to perform an optimization: we need not
+ -- remove Node from the tree and then reinsert it with its new value,
+ -- because it would only be placed in the exact same position.
- elsif Item < Hint.Element.all then
if Hint = Node then
if Tree.Lock > 0 then
raise Program_Error with
@@ -1940,12 +2015,15 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
return;
end if;
-
- else
- pragma Assert (not (Hint.Element.all < Item));
- raise Program_Error with "attempt to replace existing element";
end if;
+ -- If we get here, it is because Item was greater than all elements in
+ -- the tree (Hint = null), or because Item was less than some element at
+ -- a different place in the tree (Item < Hint.Element.all). In either
+ -- case, we remove Node from the tree (without actually deallocating
+ -- it), and then insert Item into the tree, onto the same Node (so no
+ -- new node is actually allocated).
+
Tree_Operations.Delete_Node_Sans_Free (Tree, Node); -- Checks busy-bit
Local_Insert_With_Hint
diff --git a/gcc/ada/a-ciorse.ads b/gcc/ada/a-ciorse.ads
index 87ba353e9e8..0dba13e42ed 100644
--- a/gcc/ada/a-ciorse.ads
+++ b/gcc/ada/a-ciorse.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -416,4 +416,24 @@ private
No_Element : constant Cursor := Cursor'(null, null);
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Set_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Ordered_Sets;
diff --git a/gcc/ada/a-cobove.adb b/gcc/ada/a-cobove.adb
index 8ca958f0b71..c2790517e01 100644
--- a/gcc/ada/a-cobove.adb
+++ b/gcc/ada/a-cobove.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -28,32 +28,11 @@
------------------------------------------------------------------------------
with Ada.Containers.Generic_Array_Sort;
-with Ada.Finalization; use Ada.Finalization;
with System; use type System.Address;
package body Ada.Containers.Bounded_Vectors is
- type Iterator is new Limited_Controlled and
- Vector_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Vector_Access;
- Index : Index_Type'Base;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -112,8 +91,8 @@ package body Ada.Containers.Bounded_Vectors is
raise Constraint_Error with "new length is out of range";
end if;
- -- It is now safe compute the length of the new vector, without fear of
- -- overflow.
+ -- It is now safe to compute the length of the new vector, without fear
+ -- of overflow.
N := LN + RN;
@@ -122,6 +101,7 @@ package body Ada.Containers.Bounded_Vectors is
-- Count_Type'Base as the type for intermediate values.
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
+
-- We perform a two-part test. First we determine whether the
-- computed Last value lies in the base range of the type, and then
-- determine whether it lies in the range of the index (sub)type.
@@ -150,6 +130,7 @@ package body Ada.Containers.Bounded_Vectors is
end if;
elsif Index_Type'First <= 0 then
+
-- Here we can compute Last directly, in the normal way. We know that
-- No_Index is less than 0, so there is no danger of overflow when
-- adding the (positive) value of length.
@@ -280,6 +261,14 @@ package body Ada.Containers.Bounded_Vectors is
---------
overriding function "=" (Left, Right : Vector) return Boolean is
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ Result : Boolean;
+
begin
if Left'Address = Right'Address then
return True;
@@ -289,13 +278,40 @@ package body Ada.Containers.Bounded_Vectors is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ Result := True;
for J in Count_Type range 1 .. Left.Length loop
if Left.Elements (J) /= Right.Elements (J) then
- return False;
+ Result := False;
+ exit;
end if;
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end "=";
------------
@@ -543,7 +559,6 @@ package body Ada.Containers.Bounded_Vectors is
if Count_Type'Base'Last >= Index_Type'Pos (Index_Type'Base'Last) then
Count2 := Count_Type'Base (Old_Last) - Count_Type'Base (Index) + 1;
-
else
Count2 := Count_Type'Base (Old_Last - Index + 1);
end if;
@@ -567,7 +582,6 @@ package body Ada.Containers.Bounded_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Off := Count_Type'Base (Index - Index_Type'First);
New_Last := Old_Last - Index_Type'Base (Count);
-
else
Off := Count_Type'Base (Index) - Count_Type'Base (Index_Type'First);
New_Last := Index_Type'Base (Count_Type'Base (Old_Last) - Count);
@@ -579,7 +593,6 @@ package body Ada.Containers.Bounded_Vectors is
declare
EA : Elements_Array renames Container.Elements;
Idx : constant Count_Type := EA'First + Off;
-
begin
EA (Idx .. Old_Len - Count) := EA (Idx + Count .. Old_Len);
Container.Last := New_Last;
@@ -621,14 +634,14 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Count = 0 then
return;
- end if;
- if Count >= Length (Container) then
+ elsif Count >= Length (Container) then
Clear (Container);
return;
- end if;
- Delete (Container, Index_Type'First, Count);
+ else
+ Delete (Container, Index_Type'First, Count);
+ end if;
end Delete_First;
-----------------
@@ -738,13 +751,42 @@ package body Ada.Containers.Bounded_Vectors is
end if;
end if;
- for J in Position.Index .. Container.Last loop
- if Container.Elements (To_Array_Index (J)) = Item then
- return (Container'Unrestricted_Access, J);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
+ for J in Position.Index .. Container.Last loop
+ if Container.Elements (To_Array_Index (J)) = Item then
+ Result := J;
+ exit;
+ end if;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = No_Index then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
end if;
- end loop;
- return No_Element;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Find;
----------------
@@ -756,14 +798,36 @@ package body Ada.Containers.Bounded_Vectors is
Item : Element_Type;
Index : Index_Type := Index_Type'First) return Extended_Index
is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
for Indx in Index .. Container.Last loop
if Container.Elements (To_Array_Index (Indx)) = Item then
- return Indx;
+ Result := Indx;
+ exit;
end if;
end loop;
- return No_Index;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Find_Index;
-----------
@@ -841,17 +905,40 @@ package body Ada.Containers.Bounded_Vectors is
return True;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
EA : Elements_Array renames Container.Elements;
+
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Boolean;
+
begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := True;
for J in 1 .. Container.Length - 1 loop
if EA (J + 1) < EA (J) then
- return False;
+ Result := False;
+ exit;
end if;
end loop;
- end;
- return True;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Is_Sorted;
-----------
@@ -862,7 +949,6 @@ package body Ada.Containers.Bounded_Vectors is
I, J : Count_Type;
begin
-
-- The semantics of Merge changed slightly per AI05-0021. It was
-- originally the case that if Target and Source denoted the same
-- container object, then the GNAT implementation of Merge did
@@ -893,21 +979,35 @@ package body Ada.Containers.Bounded_Vectors is
I := Target.Length;
Target.Set_Length (I + Source.Length);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
TA : Elements_Array renames Target.Elements;
SA : Elements_Array renames Source.Elements;
+ TB : Natural renames Target.Busy;
+ TL : Natural renames Target.Lock;
+
+ SB : Natural renames Source.Busy;
+ SL : Natural renames Source.Lock;
+
begin
+ TB := TB + 1;
+ TL := TL + 1;
+
+ SB := SB + 1;
+ SL := SL + 1;
+
J := Target.Length;
while not Source.Is_Empty loop
pragma Assert (Source.Length <= 1
- or else not (SA (Source.Length) <
- SA (Source.Length - 1)));
+ or else not (SA (Source.Length) < SA (Source.Length - 1)));
if I = 0 then
TA (1 .. J) := SA (1 .. Source.Length);
Source.Last := No_Index;
- return;
+ exit;
end if;
pragma Assert (I <= 1
@@ -924,6 +1024,22 @@ package body Ada.Containers.Bounded_Vectors is
J := J - 1;
end loop;
+
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ exception
+ when others =>
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ raise;
end;
end Merge;
@@ -960,7 +1076,28 @@ package body Ada.Containers.Bounded_Vectors is
"attempt to tamper with cursors (vector is busy)";
end if;
- Sort (Container.Elements (1 .. Container.Length));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Sort (Container.Elements (1 .. Container.Length));
+
+ B := B - 1;
+ L := L - 1;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Sort;
end Generic_Sorting;
@@ -1056,10 +1193,12 @@ package body Ada.Containers.Bounded_Vectors is
-- acceptable, then we compute the new last index from that.
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
+
-- We have to handle the case when there might be more values in the
-- range of Index_Type than in the range of Count_Type.
if Index_Type'First <= 0 then
+
-- We know that No_Index (the same as Index_Type'First - 1) is
-- less than 0, so it is safe to compute the following sum without
-- fear of overflow.
@@ -1067,6 +1206,7 @@ package body Ada.Containers.Bounded_Vectors is
Index := No_Index + Index_Type'Base (Count_Type'Last);
if Index <= Index_Type'Last then
+
-- We have determined that range of Index_Type has at least as
-- many values as in Count_Type, so Count_Type'Last is the
-- maximum number of items that are allowed.
@@ -1091,6 +1231,7 @@ package body Ada.Containers.Bounded_Vectors is
end if;
elsif Index_Type'First <= 0 then
+
-- We know that No_Index (the same as Index_Type'First - 1) is less
-- than 0, so it is safe to compute the following sum without fear of
-- overflow.
@@ -1098,6 +1239,7 @@ package body Ada.Containers.Bounded_Vectors is
J := Count_Type'Base (No_Index) + Count_Type'Last;
if J <= Count_Type'Base (Index_Type'Last) then
+
-- We have determined that range of Index_Type has at least as
-- many values as in Count_Type, so Count_Type'Last is the maximum
-- number of items that are allowed.
@@ -1151,6 +1293,7 @@ package body Ada.Containers.Bounded_Vectors is
J := To_Array_Index (Before);
if Before > Container.Last then
+
-- The new items are being appended to the vector, so no
-- sliding of existing elements is required.
@@ -1508,10 +1651,12 @@ package body Ada.Containers.Bounded_Vectors is
-- acceptable, then we compute the new last index from that.
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
+
-- We have to handle the case when there might be more values in the
-- range of Index_Type than in the range of Count_Type.
if Index_Type'First <= 0 then
+
-- We know that No_Index (the same as Index_Type'First - 1) is
-- less than 0, so it is safe to compute the following sum without
-- fear of overflow.
@@ -1519,6 +1664,7 @@ package body Ada.Containers.Bounded_Vectors is
Index := No_Index + Index_Type'Base (Count_Type'Last);
if Index <= Index_Type'Last then
+
-- We have determined that range of Index_Type has at least as
-- many values as in Count_Type, so Count_Type'Last is the
-- maximum number of items that are allowed.
@@ -1543,6 +1689,7 @@ package body Ada.Containers.Bounded_Vectors is
end if;
elsif Index_Type'First <= 0 then
+
-- We know that No_Index (the same as Index_Type'First - 1) is less
-- than 0, so it is safe to compute the following sum without fear of
-- overflow.
@@ -1550,6 +1697,7 @@ package body Ada.Containers.Bounded_Vectors is
J := Count_Type'Base (No_Index) + Count_Type'Last;
if J <= Count_Type'Base (Index_Type'Last) then
+
-- We have determined that range of Index_Type has at least as
-- many values as in Count_Type, so Count_Type'Last is the maximum
-- number of items that are allowed.
@@ -1608,6 +1756,7 @@ package body Ada.Containers.Bounded_Vectors is
-- unused storage for the new items.
if Before <= Container.Last then
+
-- The space is being inserted before some existing elements,
-- so we must slide the existing elements up to their new home.
@@ -1927,36 +2076,30 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Index < Position.Container.Last then
+ elsif Position.Index < Position.Container.Last then
return (Position.Container, Position.Index + 1);
+ else
+ return No_Element;
end if;
-
- return No_Element;
end Next;
function Next (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong vector";
+ else
+ return Next (Position);
end if;
-
- return Next (Position);
end Next;
procedure Next (Position : in out Cursor) is
begin
if Position.Container = null then
return;
- end if;
-
- if Position.Index < Position.Container.Last then
+ elsif Position.Index < Position.Container.Last then
Position.Index := Position.Index + 1;
else
Position := No_Element;
@@ -1992,9 +2135,7 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Position.Container = null then
return;
- end if;
-
- if Position.Index > Index_Type'First then
+ elsif Position.Index > Index_Type'First then
Position.Index := Position.Index - 1;
else
Position := No_Element;
@@ -2005,27 +2146,23 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Index > Index_Type'First then
+ elsif Position.Index > Index_Type'First then
return (Position.Container, Position.Index - 1);
+ else
+ return No_Element;
end if;
-
- return No_Element;
end Previous;
function Previous (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong vector";
+ else
+ return Previous (Position);
end if;
-
- return Previous (Position);
end Previous;
-------------------
@@ -2069,9 +2206,9 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
+ else
+ Query_Element (Position.Container.all, Position.Index, Process);
end if;
-
- Query_Element (Position.Container.all, Position.Index, Process);
end Query_Element;
----------
@@ -2146,9 +2283,9 @@ package body Ada.Containers.Bounded_Vectors is
declare
A : Elements_Array renames Container.Elements;
- I : constant Count_Type := To_Array_Index (Position.Index);
+ J : constant Count_Type := To_Array_Index (Position.Index);
begin
- return (Element => A (I)'Access);
+ return (Element => A (J)'Access);
end;
end Reference;
@@ -2163,9 +2300,9 @@ package body Ada.Containers.Bounded_Vectors is
declare
A : Elements_Array renames Container.Elements;
- I : constant Count_Type := To_Array_Index (Index);
+ J : constant Count_Type := To_Array_Index (Index);
begin
- return (Element => A (I)'Access);
+ return (Element => A (J)'Access);
end;
end Reference;
@@ -2181,14 +2318,12 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Index > Container.Last then
raise Constraint_Error with "Index is out of range";
- end if;
-
- if Container.Lock > 0 then
+ elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (vector is locked)";
+ else
+ Container.Elements (To_Array_Index (Index)) := New_Item;
end if;
-
- Container.Elements (To_Array_Index (Index)) := New_Item;
end Replace_Element;
procedure Replace_Element
@@ -2199,22 +2334,20 @@ package body Ada.Containers.Bounded_Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with "Position cursor denotes wrong container";
- end if;
- if Position.Index > Container.Last then
+ elsif Position.Index > Container.Last then
raise Constraint_Error with "Position cursor is out of range";
- end if;
- if Container.Lock > 0 then
+ elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (vector is locked)";
- end if;
- Container.Elements (To_Array_Index (Position.Index)) := New_Item;
+ else
+ Container.Elements (To_Array_Index (Position.Index)) := New_Item;
+ end if;
end Replace_Element;
----------------------
@@ -2300,13 +2433,41 @@ package body Ada.Containers.Bounded_Vectors is
then Container.Last
else Position.Index);
- for Indx in reverse Index_Type'First .. Last loop
- if Container.Elements (To_Array_Index (Indx)) = Item then
- return (Container'Unrestricted_Access, Indx);
- end if;
- end loop;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
+ for Indx in reverse Index_Type'First .. Last loop
+ if Container.Elements (To_Array_Index (Indx)) = Item then
+ Result := Indx;
+ exit;
+ end if;
+ end loop;
- return No_Element;
+ B := B - 1;
+ L := L - 1;
+
+ if Result = No_Index then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
+ end if;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Reverse_Find;
------------------------
@@ -2318,17 +2479,39 @@ package body Ada.Containers.Bounded_Vectors is
Item : Element_Type;
Index : Index_Type := Index_Type'Last) return Extended_Index
is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
Last : constant Index_Type'Base :=
Index_Type'Min (Container.Last, Index);
+ Result : Index_Type'Base;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
for Indx in reverse Index_Type'First .. Last loop
if Container.Elements (To_Array_Index (Indx)) = Item then
- return Indx;
+ Result := Indx;
+ exit;
end if;
end loop;
- return No_Index;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Reverse_Find_Index;
---------------------
@@ -2375,10 +2558,8 @@ package body Ada.Containers.Bounded_Vectors is
if Count >= 0 then
Container.Delete_Last (Count);
-
elsif Container.Last >= Index_Type'Last then
raise Constraint_Error with "vector is already at its maximum length";
-
else
Container.Insert_Space (Container.Last + 1, -Count);
end if;
@@ -2451,11 +2632,11 @@ package body Ada.Containers.Bounded_Vectors is
-- hence we also know that
-- Index - Index_Type'First >= 0
- -- The issue is that even though 0 is guaranteed to be a value
- -- in the type Index_Type'Base, there's no guarantee that the
- -- difference is a value in that type. To prevent overflow we
- -- use the wider of Count_Type'Base and Index_Type'Base to
- -- perform intermediate calculations.
+ -- The issue is that even though 0 is guaranteed to be a value in
+ -- the type Index_Type'Base, there's no guarantee that the difference
+ -- is a value in that type. To prevent overflow we use the wider
+ -- of Count_Type'Base and Index_Type'Base to perform intermediate
+ -- calculations.
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Offset := Count_Type'Base (Index - Index_Type'First);
diff --git a/gcc/ada/a-cobove.ads b/gcc/ada/a-cobove.ads
index 932aafb886b..267c64de425 100644
--- a/gcc/ada/a-cobove.ads
+++ b/gcc/ada/a-cobove.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -34,6 +34,7 @@
with Ada.Iterator_Interfaces;
private with Ada.Streams;
+private with Ada.Finalization;
generic
type Index_Type is range <>;
@@ -364,6 +365,7 @@ private
pragma Inline (Previous);
use Ada.Streams;
+ use Ada.Finalization;
type Elements_Array is array (Count_Type range <>) of aliased Element_Type;
function "=" (L, R : Elements_Array) return Boolean is abstract;
@@ -441,4 +443,24 @@ private
No_Element : constant Cursor := Cursor'(null, Index_Type'First);
+ type Iterator is new Limited_Controlled and
+ Vector_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Vector_Access;
+ Index : Index_Type'Base;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Bounded_Vectors;
diff --git a/gcc/ada/a-cohama.adb b/gcc/ada/a-cohama.adb
index 5eee4b302c1..6af16eec227 100644
--- a/gcc/ada/a-cohama.adb
+++ b/gcc/ada/a-cohama.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -39,20 +39,6 @@ with System; use type System.Address;
package body Ada.Containers.Hashed_Maps is
- type Iterator is new Limited_Controlled and
- Map_Iterator_Interfaces.Forward_Iterator with
- record
- Container : Map_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/a-cohama.ads b/gcc/ada/a-cohama.ads
index 98b2cb3c5a8..540e24af19d 100644
--- a/gcc/ada/a-cohama.ads
+++ b/gcc/ada/a-cohama.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -424,4 +424,18 @@ private
No_Element : constant Cursor := (Container => null, Node => null);
+ type Iterator is new Limited_Controlled and
+ Map_Iterator_Interfaces.Forward_Iterator with
+ record
+ Container : Map_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Hashed_Maps;
diff --git a/gcc/ada/a-cohase.adb b/gcc/ada/a-cohase.adb
index 6180168a1da..f9e1b2aa8c0 100644
--- a/gcc/ada/a-cohase.adb
+++ b/gcc/ada/a-cohase.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -41,17 +41,6 @@ with System; use type System.Address;
package body Ada.Containers.Hashed_Sets is
- type Iterator is limited new
- Set_Iterator_Interfaces.Forward_Iterator with record
- Container : Set_Access;
- end record;
-
- overriding function First (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/a-cohase.ads b/gcc/ada/a-cohase.ads
index de62cd96a5f..2931800aaf8 100644
--- a/gcc/ada/a-cohase.ads
+++ b/gcc/ada/a-cohase.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -543,4 +543,15 @@ private
No_Element : constant Cursor := (Container => null, Node => null);
+ type Iterator is limited new
+ Set_Iterator_Interfaces.Forward_Iterator with record
+ Container : Set_Access;
+ end record;
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Hashed_Sets;
diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb
index 5b59c019da5..cff3a286edb 100644
--- a/gcc/ada/a-coinve.adb
+++ b/gcc/ada/a-coinve.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -40,26 +40,6 @@ package body Ada.Containers.Indefinite_Vectors is
procedure Free is
new Ada.Unchecked_Deallocation (Element_Type, Element_Access);
- type Iterator is new Limited_Controlled and
- Vector_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Vector_Access;
- Index : Index_Type'Base;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
---------
-- "&" --
---------
@@ -117,7 +97,6 @@ package body Ada.Containers.Indefinite_Vectors is
return (Controlled with Elements, Right.Last, 0, 0);
end;
-
end if;
if RN = 0 then
@@ -243,7 +222,6 @@ package body Ada.Containers.Indefinite_Vectors is
declare
LE : Elements_Array renames
Left.Elements.EA (Index_Type'First .. Left.Last);
-
RE : Elements_Array renames
Right.Elements.EA (Index_Type'First .. Right.Last);
@@ -514,6 +492,14 @@ package body Ada.Containers.Indefinite_Vectors is
---------
overriding function "=" (Left, Right : Vector) return Boolean is
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ Result : Boolean;
+
begin
if Left'Address = Right'Address then
return True;
@@ -523,21 +509,49 @@ package body Ada.Containers.Indefinite_Vectors is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ Result := True;
for J in Index_Type'First .. Left.Last loop
if Left.Elements.EA (J) = null then
if Right.Elements.EA (J) /= null then
- return False;
+ Result := False;
+ exit;
end if;
elsif Right.Elements.EA (J) = null then
- return False;
+ Result := False;
+ exit;
elsif Left.Elements.EA (J).all /= Right.Elements.EA (J).all then
- return False;
+ Result := False;
+ exit;
end if;
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end "=";
------------
@@ -564,12 +578,12 @@ package body Ada.Containers.Indefinite_Vectors is
Container.Elements := new Elements_Type (L);
- for I in E'Range loop
- if E (I) /= null then
- Container.Elements.EA (I) := new Element_Type'(E (I).all);
+ for J in E'Range loop
+ if E (J) /= null then
+ Container.Elements.EA (J) := new Element_Type'(E (J).all);
end if;
- Container.Last := I;
+ Container.Last := J;
end loop;
end;
end Adjust;
@@ -596,16 +610,11 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Is_Empty (New_Item) then
return;
- end if;
-
- if Container.Last = Index_Type'Last then
+ elsif Container.Last = Index_Type'Last then
raise Constraint_Error with "vector is already at its maximum length";
+ else
+ Insert (Container, Container.Last + 1, New_Item);
end if;
-
- Insert
- (Container,
- Container.Last + 1,
- New_Item);
end Append;
procedure Append
@@ -616,17 +625,11 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Count = 0 then
return;
- end if;
-
- if Container.Last = Index_Type'Last then
+ elsif Container.Last = Index_Type'Last then
raise Constraint_Error with "vector is already at its maximum length";
+ else
+ Insert (Container, Container.Last + 1, New_Item, Count);
end if;
-
- Insert
- (Container,
- Container.Last + 1,
- New_Item,
- Count);
end Append;
------------
@@ -637,10 +640,10 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Target'Address = Source'Address then
return;
+ else
+ Target.Clear;
+ Target.Append (Source);
end if;
-
- Target.Clear;
- Target.Append (Source);
end Assign;
--------------
@@ -651,9 +654,9 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Container.Elements = null then
return 0;
+ else
+ return Container.Elements.EA'Length;
end if;
-
- return Container.Elements.EA'Length;
end Capacity;
-----------
@@ -665,17 +668,18 @@ package body Ada.Containers.Indefinite_Vectors is
if Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (vector is busy)";
- end if;
- while Container.Last >= Index_Type'First loop
- declare
- X : Element_Access := Container.Elements.EA (Container.Last);
- begin
- Container.Elements.EA (Container.Last) := null;
- Container.Last := Container.Last - 1;
- Free (X);
- end;
- end loop;
+ else
+ while Container.Last >= Index_Type'First loop
+ declare
+ X : Element_Access := Container.Elements.EA (Container.Last);
+ begin
+ Container.Elements.EA (Container.Last) := null;
+ Container.Last := Container.Last - 1;
+ Free (X);
+ end;
+ end loop;
+ end if;
end Clear;
------------------------
@@ -840,9 +844,9 @@ package body Ada.Containers.Indefinite_Vectors is
if Index > Old_Last then
if Index > Old_Last + 1 then
raise Constraint_Error with "Index is out of range (too large)";
+ else
+ return;
end if;
-
- return;
end if;
-- Here and elsewhere we treat deleting 0 items from the container as a
@@ -934,7 +938,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
New_Last := Old_Last - Index_Type'Base (Count);
J := Index + Index_Type'Base (Count);
-
else
New_Last := Index_Type'Base (Count_Type'Base (Old_Last) - Count);
J := Index_Type'Base (Count_Type'Base (Index) + Count);
@@ -987,19 +990,17 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with "Position cursor denotes wrong container";
- end if;
- if Position.Index > Container.Last then
+ elsif Position.Index > Container.Last then
raise Program_Error with "Position index is out of range";
- end if;
- Delete (Container, Position.Index, Count);
-
- Position := No_Element;
+ else
+ Delete (Container, Position.Index, Count);
+ Position := No_Element;
+ end if;
end Delete;
------------------
@@ -1013,14 +1014,14 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Count = 0 then
return;
- end if;
- if Count >= Length (Container) then
+ elsif Count >= Length (Container) then
Clear (Container);
return;
- end if;
- Delete (Container, Index_Type'First, Count);
+ else
+ Delete (Container, Index_Type'First, Count);
+ end if;
end Delete_First;
-----------------
@@ -1110,13 +1111,12 @@ package body Ada.Containers.Indefinite_Vectors is
declare
EA : constant Element_Access := Container.Elements.EA (Index);
-
begin
if EA = null then
raise Constraint_Error with "element is empty";
+ else
+ return EA.all;
end if;
-
- return EA.all;
end;
end Element;
@@ -1132,14 +1132,13 @@ package body Ada.Containers.Indefinite_Vectors is
declare
EA : constant Element_Access :=
- Position.Container.Elements.EA (Position.Index);
-
+ Position.Container.Elements.EA (Position.Index);
begin
if EA = null then
raise Constraint_Error with "element is empty";
+ else
+ return EA.all;
end if;
-
- return EA.all;
end;
end Element;
@@ -1201,15 +1200,44 @@ package body Ada.Containers.Indefinite_Vectors is
end if;
end if;
- for J in Position.Index .. Container.Last loop
- if Container.Elements.EA (J) /= null
- and then Container.Elements.EA (J).all = Item
- then
- return (Container'Unrestricted_Access, J);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
+ for J in Position.Index .. Container.Last loop
+ if Container.Elements.EA (J) /= null
+ and then Container.Elements.EA (J).all = Item
+ then
+ Result := J;
+ exit;
+ end if;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = No_Index then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
end if;
- end loop;
- return No_Element;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Find;
----------------
@@ -1221,16 +1249,38 @@ package body Ada.Containers.Indefinite_Vectors is
Item : Element_Type;
Index : Index_Type := Index_Type'First) return Extended_Index
is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
for Indx in Index .. Container.Last loop
if Container.Elements.EA (Indx) /= null
and then Container.Elements.EA (Indx).all = Item
then
- return Indx;
+ Result := Indx;
+ exit;
end if;
end loop;
- return No_Index;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Find_Index;
-----------
@@ -1281,14 +1331,13 @@ package body Ada.Containers.Indefinite_Vectors is
declare
EA : constant Element_Access :=
- Container.Elements.EA (Index_Type'First);
-
+ Container.Elements.EA (Index_Type'First);
begin
if EA = null then
raise Constraint_Error with "first element is empty";
+ else
+ return EA.all;
end if;
-
- return EA.all;
end;
end First_Element;
@@ -1340,17 +1389,40 @@ package body Ada.Containers.Indefinite_Vectors is
return True;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
E : Elements_Array renames Container.Elements.EA;
+
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Boolean;
+
begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := True;
for I in Index_Type'First .. Container.Last - 1 loop
if Is_Less (E (I + 1), E (I)) then
- return False;
+ Result := False;
+ exit;
end if;
end loop;
- end;
- return True;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Is_Sorted;
-----------
@@ -1361,7 +1433,6 @@ package body Ada.Containers.Indefinite_Vectors is
I, J : Index_Type'Base;
begin
-
-- The semantics of Merge changed slightly per AI05-0021. It was
-- originally the case that if Target and Source denoted the same
-- container object, then the GNAT implementation of Merge did
@@ -1392,53 +1463,86 @@ package body Ada.Containers.Indefinite_Vectors is
I := Target.Last; -- original value (before Set_Length)
Target.Set_Length (Length (Target) + Length (Source));
- J := Target.Last; -- new value (after Set_Length)
- while Source.Last >= Index_Type'First loop
- pragma Assert
- (Source.Last <= Index_Type'First
- or else not (Is_Less
- (Source.Elements.EA (Source.Last),
- Source.Elements.EA (Source.Last - 1))));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ TA : Elements_Array renames Target.Elements.EA;
+ SA : Elements_Array renames Source.Elements.EA;
+
+ TB : Natural renames Target.Busy;
+ TL : Natural renames Target.Lock;
+
+ SB : Natural renames Source.Busy;
+ SL : Natural renames Source.Lock;
+
+ begin
+ TB := TB + 1;
+ TL := TL + 1;
+
+ SB := SB + 1;
+ SL := SL + 1;
+
+ J := Target.Last; -- new value (after Set_Length)
+ while Source.Last >= Index_Type'First loop
+ pragma Assert
+ (Source.Last <= Index_Type'First
+ or else not (Is_Less (SA (Source.Last),
+ SA (Source.Last - 1))));
+
+ if I < Index_Type'First then
+ declare
+ Src : Elements_Array renames
+ SA (Index_Type'First .. Source.Last);
+ begin
+ TA (Index_Type'First .. J) := Src;
+ Src := (others => null);
+ end;
+
+ Source.Last := No_Index;
+ exit;
+ end if;
+
+ pragma Assert
+ (I <= Index_Type'First
+ or else not (Is_Less (TA (I), TA (I - 1))));
- if I < Index_Type'First then
declare
- Src : Elements_Array renames
- Source.Elements.EA (Index_Type'First .. Source.Last);
+ Src : Element_Access renames SA (Source.Last);
+ Tgt : Element_Access renames TA (I);
begin
- Target.Elements.EA (Index_Type'First .. J) := Src;
- Src := (others => null);
+ if Is_Less (Src, Tgt) then
+ Target.Elements.EA (J) := Tgt;
+ Tgt := null;
+ I := I - 1;
+
+ else
+ Target.Elements.EA (J) := Src;
+ Src := null;
+ Source.Last := Source.Last - 1;
+ end if;
end;
- Source.Last := No_Index;
- return;
- end if;
+ J := J - 1;
+ end loop;
- pragma Assert
- (I <= Index_Type'First
- or else not (Is_Less
- (Target.Elements.EA (I),
- Target.Elements.EA (I - 1))));
+ TB := TB - 1;
+ TL := TL - 1;
- declare
- Src : Element_Access renames Source.Elements.EA (Source.Last);
- Tgt : Element_Access renames Target.Elements.EA (I);
+ SB := SB - 1;
+ SL := SL - 1;
- begin
- if Is_Less (Src, Tgt) then
- Target.Elements.EA (J) := Tgt;
- Tgt := null;
- I := I - 1;
+ exception
+ when others =>
+ TB := TB - 1;
+ TL := TL - 1;
- else
- Target.Elements.EA (J) := Src;
- Src := null;
- Source.Last := Source.Last - 1;
- end if;
- end;
+ SB := SB - 1;
+ SL := SL - 1;
- J := J - 1;
- end loop;
+ raise;
+ end;
end Merge;
----------
@@ -1475,7 +1579,28 @@ package body Ada.Containers.Indefinite_Vectors is
"attempt to tamper with cursors (vector is busy)";
end if;
- Sort (Container.Elements.EA (Index_Type'First .. Container.Last));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Sort (Container.Elements.EA (Index_Type'First .. Container.Last));
+
+ B := B - 1;
+ L := L - 1;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Sort;
end Generic_Sorting;
@@ -1488,9 +1613,9 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
return False;
+ else
+ return Position.Index <= Position.Container.Last;
end if;
-
- return Position.Index <= Position.Container.Last;
end Has_Element;
------------
@@ -1663,7 +1788,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
New_Last := No_Index + Index_Type'Base (New_Length);
-
else
New_Last := Index_Type'Base (Count_Type'Base (No_Index) + New_Length);
end if;
@@ -1859,7 +1983,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Dst_Last := No_Index + Index_Type'Base (New_Capacity);
-
else
Dst_Last :=
Index_Type'Base (Count_Type'Base (No_Index) + New_Capacity);
@@ -1888,9 +2011,8 @@ package body Ada.Containers.Indefinite_Vectors is
-- The new items are being appended to the vector, so no
-- sliding of existing elements is required.
- -- We have copied the elements from to the old, source array to
- -- the new, destination array, so we can now deallocate the old
- -- array.
+ -- We have copied the elements from to the old source array to the
+ -- new destination array, so we can now deallocate the old array.
Container.Elements := Dst;
Free (Src);
@@ -1899,11 +2021,11 @@ package body Ada.Containers.Indefinite_Vectors is
for Idx in Before .. New_Last loop
- -- In order to preserve container invariants, we always
- -- attempt the element allocation first, before setting the
- -- Last index value, in case the allocation fails (either
- -- because there is no storage available, or because element
- -- initialization fails).
+ -- In order to preserve container invariants, we always attempt
+ -- the element allocation first, before setting the Last index
+ -- value, in case the allocation fails (either because there
+ -- is no storage available, or because element initialization
+ -- fails).
declare
-- The element allocator may need an accessibility check in
@@ -1928,24 +2050,21 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Index := Before + Index_Type'Base (Count);
-
else
Index := Index_Type'Base (Count_Type'Base (Before) + Count);
end if;
Dst.EA (Index .. New_Last) := Src.EA (Before .. Container.Last);
- -- We have copied the elements from to the old, source array to
- -- the new, destination array, so we can now deallocate the old
- -- array.
+ -- We have copied the elements from to the old source array to the
+ -- new destination array, so we can now deallocate the old array.
Container.Elements := Dst;
Container.Last := New_Last;
Free (Src);
-- The new array has a range in the middle containing null access
- -- values. We now fill in that partition of the array with the new
- -- items.
+ -- values. Fill in that partition of the array with the new items.
for Idx in Before .. Index - 1 loop
@@ -2081,7 +2200,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
J := Before + Index_Type'Base (N);
-
else
J := Index_Type'Base (Count_Type'Base (Before) + N);
end if;
@@ -2105,7 +2223,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Dst_Index := J - Index_Type'Base (Src'Length);
-
else
Dst_Index := Index_Type'Base (Count_Type'Base (J) - Src'Length);
end if;
@@ -2138,9 +2255,7 @@ package body Ada.Containers.Indefinite_Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -2172,9 +2287,7 @@ package body Ada.Containers.Indefinite_Vectors is
end if;
if Is_Empty (New_Item) then
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
Position := No_Element;
else
Position := (Container'Unrestricted_Access, Before.Index);
@@ -2183,9 +2296,7 @@ package body Ada.Containers.Indefinite_Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -2221,9 +2332,7 @@ package body Ada.Containers.Indefinite_Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -2266,9 +2375,7 @@ package body Ada.Containers.Indefinite_Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -2330,9 +2437,7 @@ package body Ada.Containers.Indefinite_Vectors is
-- deeper flaw in the caller's algorithm, so that case is treated as a
-- proper error.)
- if Before > Container.Last
- and then Before > Container.Last + 1
- then
+ if Before > Container.Last and then Before > Container.Last + 1 then
raise Constraint_Error with
"Before index is out of range (too large)";
end if;
@@ -2453,7 +2558,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
New_Last := No_Index + Index_Type'Base (New_Length);
-
else
New_Last := Index_Type'Base (Count_Type'Base (No_Index) + New_Length);
end if;
@@ -2490,7 +2594,8 @@ package body Ada.Containers.Indefinite_Vectors is
end if;
if New_Length <= Container.Elements.EA'Length then
- -- In this case, we're inserting elements into a vector that has
+
+ -- In this case, we are inserting elements into a vector that has
-- already allocated an internal array, and the existing array has
-- enough unused storage for the new items.
@@ -2501,13 +2606,12 @@ package body Ada.Containers.Indefinite_Vectors is
if Before <= Container.Last then
-- The new space is being inserted before some existing
- -- elements, so we must slide the existing elements up to their
- -- new home. We use the wider of Index_Type'Base and
+ -- elements, so we must slide the existing elements up to
+ -- their new home. We use the wider of Index_Type'Base and
-- Count_Type'Base as the type for intermediate index values.
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Index := Before + Index_Type'Base (Count);
-
else
Index := Index_Type'Base (Count_Type'Base (Before) + Count);
end if;
@@ -2554,7 +2658,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Dst_Last := No_Index + Index_Type'Base (New_Capacity);
-
else
Dst_Last :=
Index_Type'Base (Count_Type'Base (No_Index) + New_Capacity);
@@ -2585,7 +2688,6 @@ package body Ada.Containers.Indefinite_Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Index := Before + Index_Type'Base (Count);
-
else
Index := Index_Type'Base (Count_Type'Base (Before) + Count);
end if;
@@ -2619,9 +2721,7 @@ package body Ada.Containers.Indefinite_Vectors is
end if;
if Count = 0 then
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
Position := No_Element;
else
Position := (Container'Unrestricted_Access, Before.Index);
@@ -2810,14 +2910,13 @@ package body Ada.Containers.Indefinite_Vectors is
declare
EA : constant Element_Access :=
- Container.Elements.EA (Container.Last);
-
+ Container.Elements.EA (Container.Last);
begin
if EA = null then
raise Constraint_Error with "last element is empty";
+ else
+ return EA.all;
end if;
-
- return EA.all;
end;
end Last_Element;
@@ -2903,36 +3002,30 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Index < Position.Container.Last then
+ elsif Position.Index < Position.Container.Last then
return (Position.Container, Position.Index + 1);
+ else
+ return No_Element;
end if;
-
- return No_Element;
end Next;
function Next (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong vector";
+ else
+ return Next (Position);
end if;
-
- return Next (Position);
end Next;
procedure Next (Position : in out Cursor) is
begin
if Position.Container = null then
return;
- end if;
-
- if Position.Index < Position.Container.Last then
+ elsif Position.Index < Position.Container.Last then
Position.Index := Position.Index + 1;
else
Position := No_Element;
@@ -2954,10 +3047,7 @@ package body Ada.Containers.Indefinite_Vectors is
Count : Count_Type := 1)
is
begin
- Insert (Container,
- Index_Type'First,
- New_Item,
- Count);
+ Insert (Container, Index_Type'First, New_Item, Count);
end Prepend;
--------------
@@ -2968,9 +3058,7 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
return;
- end if;
-
- if Position.Index > Index_Type'First then
+ elsif Position.Index > Index_Type'First then
Position.Index := Position.Index - 1;
else
Position := No_Element;
@@ -2981,27 +3069,23 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Index > Index_Type'First then
+ elsif Position.Index > Index_Type'First then
return (Position.Container, Position.Index - 1);
+ else
+ return No_Element;
end if;
-
- return No_Element;
end Previous;
function Previous (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong vector";
+ else
+ return Previous (Position);
end if;
-
- return Previous (Position);
end Previous;
-------------------
@@ -3049,9 +3133,9 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
+ else
+ Query_Element (Position.Container.all, Position.Index, Process);
end if;
-
- Query_Element (Position.Container.all, Position.Index, Process);
end Query_Element;
----------
@@ -3064,8 +3148,7 @@ package body Ada.Containers.Indefinite_Vectors is
is
Length : Count_Type'Base;
Last : Index_Type'Base := Index_Type'Pred (Index_Type'First);
-
- B : Boolean;
+ B : Boolean;
begin
Clear (Container);
@@ -3616,23 +3699,50 @@ package body Ada.Containers.Indefinite_Vectors is
raise Program_Error with "Position cursor denotes wrong container";
end if;
- if Position.Container = null
- or else Position.Index > Container.Last
- then
+ if Position.Container = null or else Position.Index > Container.Last then
Last := Container.Last;
else
Last := Position.Index;
end if;
- for Indx in reverse Index_Type'First .. Last loop
- if Container.Elements.EA (Indx) /= null
- and then Container.Elements.EA (Indx).all = Item
- then
- return (Container'Unrestricted_Access, Indx);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
+ for Indx in reverse Index_Type'First .. Last loop
+ if Container.Elements.EA (Indx) /= null
+ and then Container.Elements.EA (Indx).all = Item
+ then
+ Result := Indx;
+ exit;
+ end if;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = No_Index then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
end if;
- end loop;
- return No_Element;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Reverse_Find;
------------------------
@@ -3644,18 +3754,41 @@ package body Ada.Containers.Indefinite_Vectors is
Item : Element_Type;
Index : Index_Type := Index_Type'Last) return Extended_Index
is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
Last : constant Index_Type'Base :=
(if Index > Container.Last then Container.Last else Index);
+
+ Result : Index_Type'Base;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
for Indx in reverse Index_Type'First .. Last loop
if Container.Elements.EA (Indx) /= null
and then Container.Elements.EA (Indx).all = Item
then
- return Indx;
+ Result := Indx;
+ exit;
end if;
end loop;
- return No_Index;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Reverse_Find_Index;
---------------------
@@ -3800,13 +3933,11 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
return No_Index;
- end if;
-
- if Position.Index <= Position.Container.Last then
+ elsif Position.Index <= Position.Container.Last then
return Position.Index;
+ else
+ return No_Index;
end if;
-
- return No_Index;
end To_Index;
---------------
@@ -4072,13 +4203,13 @@ package body Ada.Containers.Indefinite_Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with "Position cursor denotes wrong container";
- end if;
- Update_Element (Container, Position.Index, Process);
+ else
+ Update_Element (Container, Position.Index, Process);
+ end if;
end Update_Element;
-----------
diff --git a/gcc/ada/a-coinve.ads b/gcc/ada/a-coinve.ads
index c9a64989be5..2c841671af4 100644
--- a/gcc/ada/a-coinve.ads
+++ b/gcc/ada/a-coinve.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -463,4 +463,24 @@ private
No_Element : constant Cursor := Cursor'(null, Index_Type'First);
+ type Iterator is new Limited_Controlled and
+ Vector_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Vector_Access;
+ Index : Index_Type'Base;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Indefinite_Vectors;
diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb
index a67c156c2bc..5b722fe8a72 100644
--- a/gcc/ada/a-convec.adb
+++ b/gcc/ada/a-convec.adb
@@ -84,12 +84,10 @@ package body Ada.Containers.Vectors is
end if;
declare
- RE : Elements_Array renames
- Right.Elements.EA (Index_Type'First .. Right.Last);
-
+ RE : Elements_Array renames
+ Right.Elements.EA (Index_Type'First .. Right.Last);
Elements : constant Elements_Access :=
- new Elements_Type'(Right.Last, RE);
-
+ new Elements_Type'(Right.Last, RE);
begin
return (Controlled with Elements, Right.Last, 0, 0);
end;
@@ -97,12 +95,10 @@ package body Ada.Containers.Vectors is
if RN = 0 then
declare
- LE : Elements_Array renames
- Left.Elements.EA (Index_Type'First .. Left.Last);
-
+ LE : Elements_Array renames
+ Left.Elements.EA (Index_Type'First .. Left.Last);
Elements : constant Elements_Access :=
- new Elements_Type'(Left.Last, LE);
-
+ new Elements_Type'(Left.Last, LE);
begin
return (Controlled with Elements, Left.Last, 0, 0);
end;
@@ -197,15 +193,12 @@ package body Ada.Containers.Vectors is
end if;
declare
- LE : Elements_Array renames
- Left.Elements.EA (Index_Type'First .. Left.Last);
-
- RE : Elements_Array renames
- Right.Elements.EA (Index_Type'First .. Right.Last);
-
+ LE : Elements_Array renames
+ Left.Elements.EA (Index_Type'First .. Left.Last);
+ RE : Elements_Array renames
+ Right.Elements.EA (Index_Type'First .. Right.Last);
Elements : constant Elements_Access :=
- new Elements_Type'(Last, LE & RE);
-
+ new Elements_Type'(Last, LE & RE);
begin
return (Controlled with Elements, Last, 0, 0);
end;
@@ -247,14 +240,11 @@ package body Ada.Containers.Vectors is
end if;
declare
- Last : constant Index_Type := Left.Last + 1;
-
- LE : Elements_Array renames
- Left.Elements.EA (Index_Type'First .. Left.Last);
-
+ Last : constant Index_Type := Left.Last + 1;
+ LE : Elements_Array renames
+ Left.Elements.EA (Index_Type'First .. Left.Last);
Elements : constant Elements_Access :=
- new Elements_Type'(Last => Last, EA => LE & Right);
-
+ new Elements_Type'(Last => Last, EA => LE & Right);
begin
return (Controlled with Elements, Last, 0, 0);
end;
@@ -275,7 +265,6 @@ package body Ada.Containers.Vectors is
new Elements_Type'
(Last => Index_Type'First,
EA => (others => Left));
-
begin
return (Controlled with Elements, Index_Type'First, 0, 0);
end;
@@ -346,6 +335,14 @@ package body Ada.Containers.Vectors is
---------
overriding function "=" (Left, Right : Vector) return Boolean is
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ Result : Boolean;
+
begin
if Left'Address = Right'Address then
return True;
@@ -355,13 +352,40 @@ package body Ada.Containers.Vectors is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ Result := True;
for J in Index_Type range Index_Type'First .. Left.Last loop
if Left.Elements.EA (J) /= Right.Elements.EA (J) then
- return False;
+ Result := False;
+ exit;
end if;
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end "=";
------------
@@ -418,16 +442,11 @@ package body Ada.Containers.Vectors is
begin
if Is_Empty (New_Item) then
return;
- end if;
-
- if Container.Last = Index_Type'Last then
+ elsif Container.Last = Index_Type'Last then
raise Constraint_Error with "vector is already at its maximum length";
+ else
+ Insert (Container, Container.Last + 1, New_Item);
end if;
-
- Insert
- (Container,
- Container.Last + 1,
- New_Item);
end Append;
procedure Append
@@ -438,17 +457,11 @@ package body Ada.Containers.Vectors is
begin
if Count = 0 then
return;
- end if;
-
- if Container.Last = Index_Type'Last then
+ elsif Container.Last = Index_Type'Last then
raise Constraint_Error with "vector is already at its maximum length";
+ else
+ Insert (Container, Container.Last + 1, New_Item, Count);
end if;
-
- Insert
- (Container,
- Container.Last + 1,
- New_Item,
- Count);
end Append;
------------
@@ -459,10 +472,10 @@ package body Ada.Containers.Vectors is
begin
if Target'Address = Source'Address then
return;
+ else
+ Target.Clear;
+ Target.Append (Source);
end if;
-
- Target.Clear;
- Target.Append (Source);
end Assign;
--------------
@@ -638,9 +651,9 @@ package body Ada.Containers.Vectors is
if Index > Old_Last then
if Index > Old_Last + 1 then
raise Constraint_Error with "Index is out of range (too large)";
+ else
+ return;
end if;
-
- return;
end if;
-- Here and elsewhere we treat deleting 0 items from the container as a
@@ -668,7 +681,6 @@ package body Ada.Containers.Vectors is
if Count_Type'Base'Last >= Index_Type'Pos (Index_Type'Base'Last) then
Count2 := Count_Type'Base (Old_Last) - Count_Type'Base (Index) + 1;
-
else
Count2 := Count_Type'Base (Old_Last - Index + 1);
end if;
@@ -694,7 +706,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
New_Last := Old_Last - Index_Type'Base (Count);
J := Index + Index_Type'Base (Count);
-
else
New_Last := Index_Type'Base (Count_Type'Base (Old_Last) - Count);
J := Index_Type'Base (Count_Type'Base (Index) + Count);
@@ -708,7 +719,6 @@ package body Ada.Containers.Vectors is
declare
EA : Elements_Array renames Container.Elements.EA;
-
begin
EA (Index .. New_Last) := EA (J .. Old_Last);
Container.Last := New_Last;
@@ -725,18 +735,17 @@ package body Ada.Containers.Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with "Position cursor denotes wrong container";
- end if;
- if Position.Index > Container.Last then
+ elsif Position.Index > Container.Last then
raise Program_Error with "Position index is out of range";
- end if;
- Delete (Container, Position.Index, Count);
- Position := No_Element;
+ else
+ Delete (Container, Position.Index, Count);
+ Position := No_Element;
+ end if;
end Delete;
------------------
@@ -750,14 +759,14 @@ package body Ada.Containers.Vectors is
begin
if Count = 0 then
return;
- end if;
- if Count >= Length (Container) then
+ elsif Count >= Length (Container) then
Clear (Container);
return;
- end if;
- Delete (Container, Index_Type'First, Count);
+ else
+ Delete (Container, Index_Type'First, Count);
+ end if;
end Delete_First;
-----------------
@@ -823,9 +832,9 @@ package body Ada.Containers.Vectors is
begin
if Index > Container.Last then
raise Constraint_Error with "Index is out of range";
+ else
+ return Container.Elements.EA (Index);
end if;
-
- return Container.Elements.EA (Index);
end Element;
function Element (Position : Cursor) return Element_Type is
@@ -850,11 +859,12 @@ package body Ada.Containers.Vectors is
if Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (vector is busy)";
- end if;
- Container.Elements := null;
- Container.Last := No_Index;
- Free (X);
+ else
+ Container.Elements := null;
+ Container.Last := No_Index;
+ Free (X);
+ end if;
end Finalize;
procedure Finalize (Object : in out Iterator) is
@@ -899,13 +909,42 @@ package body Ada.Containers.Vectors is
end if;
end if;
- for J in Position.Index .. Container.Last loop
- if Container.Elements.EA (J) = Item then
- return (Container'Unrestricted_Access, J);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
+ for J in Position.Index .. Container.Last loop
+ if Container.Elements.EA (J) = Item then
+ Result := J;
+ exit;
+ end if;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = No_Index then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
end if;
- end loop;
- return No_Element;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Find;
----------------
@@ -917,14 +956,36 @@ package body Ada.Containers.Vectors is
Item : Element_Type;
Index : Index_Type := Index_Type'First) return Extended_Index
is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
for Indx in Index .. Container.Last loop
if Container.Elements.EA (Indx) = Item then
- return Indx;
+ Result := Indx;
+ exit;
end if;
end loop;
- return No_Index;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Find_Index;
-----------
@@ -1002,17 +1063,40 @@ package body Ada.Containers.Vectors is
return True;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
EA : Elements_Array renames Container.Elements.EA;
+
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Boolean;
+
begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := True;
for J in Index_Type'First .. Container.Last - 1 loop
if EA (J + 1) < EA (J) then
- return False;
+ Result := False;
+ exit;
end if;
end loop;
- end;
- return True;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Is_Sorted;
-----------
@@ -1053,23 +1137,38 @@ package body Ada.Containers.Vectors is
Target.Set_Length (Length (Target) + Length (Source));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
TA : Elements_Array renames Target.Elements.EA;
SA : Elements_Array renames Source.Elements.EA;
+ TB : Natural renames Target.Busy;
+ TL : Natural renames Target.Lock;
+
+ SB : Natural renames Source.Busy;
+ SL : Natural renames Source.Lock;
+
begin
+ TB := TB + 1;
+ TL := TL + 1;
+
+ SB := SB + 1;
+ SL := SL + 1;
+
J := Target.Last;
while Source.Last >= Index_Type'First loop
pragma Assert (Source.Last <= Index_Type'First
- or else not (SA (Source.Last) <
- SA (Source.Last - 1)));
+ or else not (SA (Source.Last) <
+ SA (Source.Last - 1)));
if I < Index_Type'First then
TA (Index_Type'First .. J) :=
SA (Index_Type'First .. Source.Last);
Source.Last := No_Index;
- return;
+ exit;
end if;
pragma Assert (I <= Index_Type'First
@@ -1086,6 +1185,22 @@ package body Ada.Containers.Vectors is
J := J - 1;
end loop;
+
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ exception
+ when others =>
+ TB := TB - 1;
+ TL := TL - 1;
+
+ SB := SB - 1;
+ SL := SL - 1;
+
+ raise;
end;
end Merge;
@@ -1122,7 +1237,28 @@ package body Ada.Containers.Vectors is
"attempt to tamper with cursors (vector is busy)";
end if;
- Sort (Container.Elements.EA (Index_Type'First .. Container.Last));
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container.Busy;
+ L : Natural renames Container.Lock;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Sort (Container.Elements.EA (Index_Type'First .. Container.Last));
+
+ B := B - 1;
+ L := L - 1;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Sort;
end Generic_Sorting;
@@ -1182,9 +1318,7 @@ package body Ada.Containers.Vectors is
-- deeper flaw in the caller's algorithm, so that case is treated as a
-- proper error.)
- if Before > Container.Last
- and then Before > Container.Last + 1
- then
+ if Before > Container.Last and then Before > Container.Last + 1 then
raise Constraint_Error with
"Before index is out of range (too large)";
end if;
@@ -1374,7 +1508,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Index := Before + Index_Type'Base (Count);
-
else
Index := Index_Type'Base (Count_Type'Base (Before) + Count);
end if;
@@ -1402,9 +1535,9 @@ package body Ada.Containers.Vectors is
if New_Capacity > Count_Type'Last / 2 then
New_Capacity := Count_Type'Last;
exit;
+ else
+ New_Capacity := 2 * New_Capacity;
end if;
-
- New_Capacity := 2 * New_Capacity;
end loop;
if New_Capacity > Max_Length then
@@ -1421,7 +1554,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Dst_Last := No_Index + Index_Type'Base (New_Capacity);
-
else
Dst_Last :=
Index_Type'Base (Count_Type'Base (No_Index) + New_Capacity);
@@ -1455,7 +1587,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Index := Before + Index_Type'Base (Count);
-
else
Index := Index_Type'Base (Count_Type'Base (Before) + Count);
end if;
@@ -1475,6 +1606,7 @@ package body Ada.Containers.Vectors is
declare
X : Elements_Access := Container.Elements;
+
begin
-- We first isolate the old internal array, removing it from the
-- container and replacing it with the new internal array, before we
@@ -1518,7 +1650,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
J := (Before - 1) + Index_Type'Base (N);
-
else
J := Index_Type'Base (Count_Type'Base (Before - 1) + N);
end if;
@@ -1549,7 +1680,7 @@ package body Ada.Containers.Vectors is
Index_Type'First .. L;
Src : Elements_Array renames
- Container.Elements.EA (Src_Index_Subtype);
+ Container.Elements.EA (Src_Index_Subtype);
K : Index_Type'Base;
@@ -1562,7 +1693,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
K := L + Index_Type'Base (Src'Length);
-
else
K := Index_Type'Base (Count_Type'Base (L) + Src'Length);
end if;
@@ -1594,7 +1724,7 @@ package body Ada.Containers.Vectors is
F .. Container.Last;
Src : Elements_Array renames
- Container.Elements.EA (Src_Index_Subtype);
+ Container.Elements.EA (Src_Index_Subtype);
K : Index_Type'Base;
@@ -1606,7 +1736,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
K := F - Index_Type'Base (Src'Length);
-
else
K := Index_Type'Base (Count_Type'Base (F) - Src'Length);
end if;
@@ -1633,9 +1762,7 @@ package body Ada.Containers.Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -1666,9 +1793,7 @@ package body Ada.Containers.Vectors is
end if;
if Is_Empty (New_Item) then
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
Position := No_Element;
else
Position := (Container'Unrestricted_Access, Before.Index);
@@ -1677,9 +1802,7 @@ package body Ada.Containers.Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -1715,9 +1838,7 @@ package body Ada.Containers.Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -1749,9 +1870,7 @@ package body Ada.Containers.Vectors is
end if;
if Count = 0 then
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
Position := No_Element;
else
Position := (Container'Unrestricted_Access, Before.Index);
@@ -1760,9 +1879,7 @@ package body Ada.Containers.Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -1799,7 +1916,6 @@ package body Ada.Containers.Vectors is
is
New_Item : Element_Type; -- Default-initialized value
pragma Warnings (Off, New_Item);
-
begin
Insert (Container, Before, New_Item, Position, Count);
end Insert;
@@ -1849,9 +1965,7 @@ package body Ada.Containers.Vectors is
-- deeper flaw in the caller's algorithm, so that case is treated as a
-- proper error.)
- if Before > Container.Last
- and then Before > Container.Last + 1
- then
+ if Before > Container.Last and then Before > Container.Last + 1 then
raise Constraint_Error with
"Before index is out of range (too large)";
end if;
@@ -1973,7 +2087,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
New_Last := No_Index + Index_Type'Base (New_Length);
-
else
New_Last := Index_Type'Base (Count_Type'Base (No_Index) + New_Length);
end if;
@@ -2081,7 +2194,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Dst_Last := No_Index + Index_Type'Base (New_Capacity);
-
else
Dst_Last :=
Index_Type'Base (Count_Type'Base (No_Index) + New_Capacity);
@@ -2113,7 +2225,6 @@ package body Ada.Containers.Vectors is
if Index_Type'Base'Last >= Count_Type'Pos (Count_Type'Last) then
Index := Before + Index_Type'Base (Count);
-
else
Index := Index_Type'Base (Count_Type'Base (Before) + Count);
end if;
@@ -2166,9 +2277,7 @@ package body Ada.Containers.Vectors is
end if;
if Count = 0 then
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
Position := No_Element;
else
Position := (Container'Unrestricted_Access, Before.Index);
@@ -2177,9 +2286,7 @@ package body Ada.Containers.Vectors is
return;
end if;
- if Before.Container = null
- or else Before.Index > Container.Last
- then
+ if Before.Container = null or else Before.Index > Container.Last then
if Container.Last = Index_Type'Last then
raise Constraint_Error with
"vector is already at its maximum length";
@@ -2250,9 +2357,9 @@ package body Ada.Containers.Vectors is
-- for a reverse iterator, Container.Last is the beginning.
return It : constant Iterator :=
- (Limited_Controlled with
- Container => V,
- Index => No_Index)
+ (Limited_Controlled with
+ Container => V,
+ Index => No_Index)
do
B := B + 1;
end return;
@@ -2303,9 +2410,9 @@ package body Ada.Containers.Vectors is
-- is a forward or reverse iteration.
return It : constant Iterator :=
- (Limited_Controlled with
- Container => V,
- Index => Start.Index)
+ (Limited_Controlled with
+ Container => V,
+ Index => Start.Index)
do
B := B + 1;
end return;
@@ -2455,14 +2562,12 @@ package body Ada.Containers.Vectors is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong vector";
+ else
+ return Next (Position);
end if;
-
- return Next (Position);
end Next;
procedure Next (Position : in out Cursor) is
@@ -2491,10 +2596,7 @@ package body Ada.Containers.Vectors is
Count : Count_Type := 1)
is
begin
- Insert (Container,
- Index_Type'First,
- New_Item,
- Count);
+ Insert (Container, Index_Type'First, New_Item, Count);
end Prepend;
--------------
@@ -2516,14 +2618,12 @@ package body Ada.Containers.Vectors is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Container /= Object.Container then
+ elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong vector";
+ else
+ return Previous (Position);
end if;
-
- return Previous (Position);
end Previous;
procedure Previous (Position : in out Cursor) is
@@ -2578,9 +2678,9 @@ package body Ada.Containers.Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
+ else
+ Query_Element (Position.Container.all, Position.Index, Process);
end if;
-
- Query_Element (Position.Container.all, Position.Index, Process);
end Query_Element;
----------
@@ -2677,6 +2777,7 @@ package body Ada.Containers.Vectors is
begin
if Index > Container.Last then
raise Constraint_Error with "Index is out of range";
+
else
declare
C : Vector renames Container'Unrestricted_Access.all;
@@ -2706,14 +2807,12 @@ package body Ada.Containers.Vectors is
begin
if Index > Container.Last then
raise Constraint_Error with "Index is out of range";
- end if;
-
- if Container.Lock > 0 then
+ elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (vector is locked)";
+ else
+ Container.Elements.EA (Index) := New_Item;
end if;
-
- Container.Elements.EA (Index) := New_Item;
end Replace_Element;
procedure Replace_Element
@@ -2724,22 +2823,21 @@ package body Ada.Containers.Vectors is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
- end if;
- if Position.Container /= Container'Unrestricted_Access then
+ elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with "Position cursor denotes wrong container";
- end if;
- if Position.Index > Container.Last then
+ elsif Position.Index > Container.Last then
raise Constraint_Error with "Position cursor is out of range";
- end if;
- if Container.Lock > 0 then
- raise Program_Error with
- "attempt to tamper with elements (vector is locked)";
- end if;
+ else
+ if Container.Lock > 0 then
+ raise Program_Error with
+ "attempt to tamper with elements (vector is locked)";
+ end if;
- Container.Elements.EA (Position.Index) := New_Item;
+ Container.Elements.EA (Position.Index) := New_Item;
+ end if;
end Replace_Element;
----------------------
@@ -3126,13 +3224,42 @@ package body Ada.Containers.Vectors is
then Container.Last
else Position.Index);
- for Indx in reverse Index_Type'First .. Last loop
- if Container.Elements.EA (Indx) = Item then
- return (Container'Unrestricted_Access, Indx);
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
+ Result : Index_Type'Base;
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
+ for Indx in reverse Index_Type'First .. Last loop
+ if Container.Elements.EA (Indx) = Item then
+ Result := Indx;
+ exit;
+ end if;
+ end loop;
+
+ B := B - 1;
+ L := L - 1;
+
+ if Result = No_Index then
+ return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Result);
end if;
- end loop;
- return No_Element;
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
+ end;
end Reverse_Find;
------------------------
@@ -3144,17 +3271,39 @@ package body Ada.Containers.Vectors is
Item : Element_Type;
Index : Index_Type := Index_Type'Last) return Extended_Index
is
+ B : Natural renames Container'Unrestricted_Access.Busy;
+ L : Natural renames Container'Unrestricted_Access.Lock;
+
Last : constant Index_Type'Base :=
Index_Type'Min (Container.Last, Index);
+ Result : Index_Type'Base;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
+ Result := No_Index;
for Indx in reverse Index_Type'First .. Last loop
if Container.Elements.EA (Indx) = Item then
- return Indx;
+ Result := Indx;
+ exit;
end if;
end loop;
- return No_Index;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Reverse_Find_Index;
---------------------
@@ -3245,21 +3394,19 @@ package body Ada.Containers.Vectors is
begin
if I.Container = null then
raise Constraint_Error with "I cursor has no element";
- end if;
- if J.Container = null then
+ elsif J.Container = null then
raise Constraint_Error with "J cursor has no element";
- end if;
- if I.Container /= Container'Unrestricted_Access then
+ elsif I.Container /= Container'Unrestricted_Access then
raise Program_Error with "I cursor denotes wrong container";
- end if;
- if J.Container /= Container'Unrestricted_Access then
+ elsif J.Container /= Container'Unrestricted_Access then
raise Program_Error with "J cursor denotes wrong container";
- end if;
- Swap (Container, I.Index, J.Index);
+ else
+ Swap (Container, I.Index, J.Index);
+ end if;
end Swap;
---------------
@@ -3286,13 +3433,11 @@ package body Ada.Containers.Vectors is
begin
if Position.Container = null then
return No_Index;
- end if;
-
- if Position.Index <= Position.Container.Last then
+ elsif Position.Index <= Position.Container.Last then
return Position.Index;
+ else
+ return No_Index;
end if;
-
- return No_Index;
end To_Index;
---------------
diff --git a/gcc/ada/a-coorma.adb b/gcc/ada/a-coorma.adb
index aa8fa91a8c5..52025bb5c2c 100644
--- a/gcc/ada/a-coorma.adb
+++ b/gcc/ada/a-coorma.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -39,26 +39,6 @@ with System; use type System.Address;
package body Ada.Containers.Ordered_Maps is
- type Iterator is new Limited_Controlled and
- Map_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Map_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------------
-- Node Access Subprograms --
-----------------------------
diff --git a/gcc/ada/a-coorma.ads b/gcc/ada/a-coorma.ads
index d9281faccc3..2a642ac47cb 100644
--- a/gcc/ada/a-coorma.ads
+++ b/gcc/ada/a-coorma.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -354,4 +354,24 @@ private
No_Element : constant Cursor := Cursor'(null, null);
+ type Iterator is new Limited_Controlled and
+ Map_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Map_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Ordered_Maps;
diff --git a/gcc/ada/a-coormu.adb b/gcc/ada/a-coormu.adb
index 2cc76319747..a3c5ab5c97e 100644
--- a/gcc/ada/a-coormu.adb
+++ b/gcc/ada/a-coormu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -42,26 +42,6 @@ with System; use type System.Address;
package body Ada.Containers.Ordered_Multisets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Set_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
-----------------------------
-- Node Access Subprograms --
-----------------------------
diff --git a/gcc/ada/a-coormu.ads b/gcc/ada/a-coormu.ads
index a832cac77f0..8d684741e94 100644
--- a/gcc/ada/a-coormu.ads
+++ b/gcc/ada/a-coormu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -512,4 +512,24 @@ private
Busy => 0,
Lock => 0));
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Set_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Ordered_Multisets;
diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb
index f92760f573d..e7ac52b2325 100644
--- a/gcc/ada/a-coorse.adb
+++ b/gcc/ada/a-coorse.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -42,26 +42,6 @@ with System; use type System.Address;
package body Ada.Containers.Ordered_Sets is
- type Iterator is new Limited_Controlled and
- Set_Iterator_Interfaces.Reversible_Iterator with
- record
- Container : Set_Access;
- Node : Node_Access;
- end record;
-
- overriding procedure Finalize (Object : in out Iterator);
-
- overriding function First (Object : Iterator) return Cursor;
- overriding function Last (Object : Iterator) return Cursor;
-
- overriding function Next
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
- overriding function Previous
- (Object : Iterator;
- Position : Cursor) return Cursor;
-
------------------------------
-- Access to Fields of Node --
------------------------------
@@ -987,12 +967,15 @@ package body Ada.Containers.Ordered_Sets is
B : Natural renames Tree.Busy;
L : Natural renames Tree.Lock;
+ Eq : Boolean;
+
begin
B := B + 1;
L := L + 1;
begin
Process (E);
+ Eq := Equivalent_Keys (K, Key (E));
exception
when others =>
L := L - 1;
@@ -1003,7 +986,7 @@ package body Ada.Containers.Ordered_Sets is
L := L - 1;
B := B - 1;
- if Equivalent_Keys (K, Key (E)) then
+ if Eq then
return;
end if;
end;
@@ -1716,17 +1699,56 @@ package body Ada.Containers.Ordered_Sets is
return Node;
end New_Node;
- Hint : Node_Access;
- Result : Node_Access;
- Inserted : Boolean;
+ Hint : Node_Access;
+ Result : Node_Access;
+ Inserted : Boolean;
+ Compare : Boolean;
+
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- -- Start of processing for Replace_Element
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+
+ -- Start of processing for Replace_Element
begin
- if Item < Node.Element or else Node.Element < Item then
- null;
+ -- Replace_Element assigns value Item to the element designated by Node,
+ -- per certain semantic constraints.
+
+ -- If Item is equivalent to the element, then element is replaced and
+ -- there's nothing else to do. This is the easy case.
+
+ -- If Item is not equivalent, then the node will (possibly) have to move
+ -- to some other place in the tree. This is slighly more complicated,
+ -- because we must ensure that Item is not equivalent to some other
+ -- element in the tree (in which case, the replacement is not allowed).
+
+ -- Determine whether Item is equivalent to element on the specified
+ -- node.
+
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := (if Item < Node.Element then False
+ elsif Node.Element < Item then False
+ else True);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
+ -- Item is equivalent to the node's element, so we will not have to
+ -- move the node.
- else
if Tree.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (set is locked)";
@@ -1736,12 +1758,66 @@ package body Ada.Containers.Ordered_Sets is
return;
end if;
+ -- The replacement Item is not equivalent to the element on the
+ -- specified node, which means that it will need to be re-inserted in a
+ -- different position in the tree. We must now determine whether Item is
+ -- equivalent to some other element in the tree (which would prohibit
+ -- the assignment and hence the move).
+
+ -- Ceiling returns the smallest element equivalent or greater than the
+ -- specified Item; if there is no such element, then it returns null.
+
Hint := Element_Keys.Ceiling (Tree, Item);
- if Hint = null then
- null;
+ if Hint /= null then
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Item < Hint.Element;
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ -- Item >= Hint.Element
+
+ if not Compare then
+
+ -- Ceiling returns an element that is equivalent or greater
+ -- than Item. If Item is "not less than" the element, then
+ -- by elimination we know that Item is equivalent to the element.
+
+ -- But this means that it is not possible to assign the value of
+ -- Item to the specified element (on Node), because a different
+ -- element (on Hint) equivalent to Item already exsits. (Were we
+ -- to change Node's element value, we would have to move Node, but
+ -- we would be unable to move the Node, because its new position
+ -- in the tree is already occupied by an equivalent element.)
+
+ raise Program_Error with "attempt to replace existing element";
+ end if;
+
+ -- Item is not equivalent to any other element in the tree, so it is
+ -- safe to assign the value of Item to Node.Element. This means that
+ -- the node will have to move to a different position in the tree
+ -- (because its element will have a different value).
+
+ -- The nearest (greater) neighbor of Item is Hint. This will be the
+ -- insertion position of Node (because its element will have Item as
+ -- its new value).
+
+ -- If Node equals Hint, the relative position of Node does not
+ -- change. This allows us to perform an optimization: we need not
+ -- remove Node from the tree and then reinsert it with its new value,
+ -- because it would only be placed in the exact same position.
- elsif Item < Hint.Element then
if Hint = Node then
if Tree.Lock > 0 then
raise Program_Error with
@@ -1751,15 +1827,18 @@ package body Ada.Containers.Ordered_Sets is
Node.Element := Item;
return;
end if;
-
- else
- pragma Assert (not (Hint.Element < Item));
- raise Program_Error with "attempt to replace existing element";
end if;
+ -- If we get here, it is because Item was greater than all elements in
+ -- the tree (Hint = null), or because Item was less than some element at
+ -- a different place in the tree (Item < Hint.Element). In either case,
+ -- we remove Node from the tree (without actually deallocating it), and
+ -- then insert Item into the tree, onto the same Node (so no new node is
+ -- actually allocated).
+
Tree_Operations.Delete_Node_Sans_Free (Tree, Node); -- Checks busy-bit
- Local_Insert_With_Hint
+ Local_Insert_With_Hint -- use unconditional insert here instead???
(Tree => Tree,
Position => Hint,
Key => Item,
diff --git a/gcc/ada/a-coorse.ads b/gcc/ada/a-coorse.ads
index e28a71bc299..cf0110c74c2 100644
--- a/gcc/ada/a-coorse.ads
+++ b/gcc/ada/a-coorse.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -399,4 +399,24 @@ private
No_Element : constant Cursor := Cursor'(null, null);
+ type Iterator is new Limited_Controlled and
+ Set_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Set_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding procedure Finalize (Object : in out Iterator);
+
+ overriding function First (Object : Iterator) return Cursor;
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
end Ada.Containers.Ordered_Sets;
diff --git a/gcc/ada/a-crbtgk.adb b/gcc/ada/a-crbtgk.adb
index 713e5426948..f1762f8be83 100644
--- a/gcc/ada/a-crbtgk.adb
+++ b/gcc/ada/a-crbtgk.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,10 +38,19 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
-- AKA Lower_Bound
function Ceiling (Tree : Tree_Type; Key : Key_Type) return Node_Access is
+ B : Natural renames Tree'Unrestricted_Access.Busy;
+ L : Natural renames Tree'Unrestricted_Access.Lock;
+
Y : Node_Access;
X : Node_Access;
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
X := Tree.Root;
while X /= null loop
if Is_Greater_Key_Node (Key, X) then
@@ -52,18 +61,38 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
end if;
end loop;
+ B := B - 1;
+ L := L - 1;
+
return Y;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Ceiling;
----------
-- Find --
----------
- function Find (Tree : Tree_Type; Key : Key_Type) return Node_Access is
+ function Find (Tree : Tree_Type; Key : Key_Type) return Node_Access is
+ B : Natural renames Tree'Unrestricted_Access.Busy;
+ L : Natural renames Tree'Unrestricted_Access.Lock;
+
Y : Node_Access;
X : Node_Access;
+ Result : Node_Access;
+
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
X := Tree.Root;
while X /= null loop
if Is_Greater_Key_Node (Key, X) then
@@ -75,25 +104,45 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
end loop;
if Y = null then
- return null;
- end if;
+ Result := null;
+
+ elsif Is_Less_Key_Node (Key, Y) then
+ Result := null;
- if Is_Less_Key_Node (Key, Y) then
- return null;
+ else
+ Result := Y;
end if;
- return Y;
+ B := B - 1;
+ L := L - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Find;
-----------
-- Floor --
-----------
- function Floor (Tree : Tree_Type; Key : Key_Type) return Node_Access is
+ function Floor (Tree : Tree_Type; Key : Key_Type) return Node_Access is
+ B : Natural renames Tree'Unrestricted_Access.Busy;
+ L : Natural renames Tree'Unrestricted_Access.Lock;
+
Y : Node_Access;
X : Node_Access;
begin
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B := B + 1;
+ L := L + 1;
+
X := Tree.Root;
while X /= null loop
if Is_Less_Key_Node (Key, X) then
@@ -104,7 +153,16 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
end if;
end loop;
+ B := B - 1;
+ L := L - 1;
+
return Y;
+
+ exception
+ when others =>
+ B := B - 1;
+ L := L - 1;
+ raise;
end Floor;
--------------------------------
@@ -117,8 +175,16 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
Node : out Node_Access;
Inserted : out Boolean)
is
- Y : Node_Access := null;
- X : Node_Access := Tree.Root;
+ X : Node_Access;
+ Y : Node_Access;
+
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+
+ Compare : Boolean;
begin
-- This is a "conditional" insertion, meaning that the insertion request
@@ -136,12 +202,28 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
-- either the smallest node greater than Key (Inserted is True), or the
-- largest node less or equivalent to Key (Inserted is False).
- Inserted := True;
- while X /= null loop
- Y := X;
- Inserted := Is_Less_Key_Node (Key, X);
- X := (if Inserted then Ops.Left (X) else Ops.Right (X));
- end loop;
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ X := Tree.Root;
+ Y := null;
+ Inserted := True;
+ while X /= null loop
+ Y := X;
+ Inserted := Is_Less_Key_Node (Key, X);
+ X := (if Inserted then Ops.Left (X) else Ops.Right (X));
+ end loop;
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
if Inserted then
@@ -172,7 +254,23 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
-- Key is equivalent to or greater than Node. We must resolve which is
-- the case, to determine whether the conditional insertion succeeds.
- if Is_Greater_Key_Node (Key, Node) then
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Is_Greater_Key_Node (Key, Node);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
-- Key is strictly greater than Node, which means that Key is not
-- equivalent to Node. In this case, the insertion succeeds, and we
@@ -201,6 +299,15 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
Node : out Node_Access;
Inserted : out Boolean)
is
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ B : Natural renames Tree.Busy;
+ L : Natural renames Tree.Lock;
+
+ Test : Node_Access;
+ Compare : Boolean;
+
begin
-- The purpose of a hint is to avoid a search from the root of
-- tree. If we have it hint it means we only need to traverse the
@@ -215,9 +322,24 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
-- done; otherwise the hint was "wrong" and we must search.
if Position = null then -- largest
- if Tree.Last = null
- or else Is_Greater_Key_Node (Key, Tree.Last)
- then
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare :=
+ Tree.Last = null or else Is_Greater_Key_Node (Key, Tree.Last);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
Insert_Post (Tree, Tree.Last, False, Node);
Inserted := True;
else
@@ -246,68 +368,131 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
-- then its neighbor must be anterior and so we insert before the
-- hint.
- if Is_Less_Key_Node (Key, Position) then
- declare
- Before : constant Node_Access := Ops.Previous (Position);
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Is_Less_Key_Node (Key, Position);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
+ Test := Ops.Previous (Position); -- "before"
+
+ if Test = null then -- new first node
+ Insert_Post (Tree, Tree.First, True, Node);
+
+ Inserted := True;
+ return;
+ end if;
begin
- if Before = null then
- Insert_Post (Tree, Tree.First, True, Node);
- Inserted := True;
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Is_Greater_Key_Node (Key, Test);
- elsif Is_Greater_Key_Node (Key, Before) then
- if Ops.Right (Before) = null then
- Insert_Post (Tree, Before, False, Node);
- else
- Insert_Post (Tree, Position, True, Node);
- end if;
+ L := L - 1;
+ B := B - 1;
- Inserted := True;
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+ if Compare then
+ if Ops.Right (Test) = null then
+ Insert_Post (Tree, Test, False, Node);
else
- Conditional_Insert_Sans_Hint (Tree, Key, Node, Inserted);
+ Insert_Post (Tree, Position, True, Node);
end if;
- end;
+
+ Inserted := True;
+
+ else
+ Conditional_Insert_Sans_Hint (Tree, Key, Node, Inserted);
+ end if;
return;
end if;
- -- We know that Key isn't less than the hint so we try again,
- -- this time to see if it's greater than the hint. If so we
- -- compare Key to the node that follows the hint. If Key is both
- -- greater than the hint and less than the hint's next neighbor,
- -- then we're done; otherwise we must search.
+ -- We know that Key isn't less than the hint so we try again, this time
+ -- to see if it's greater than the hint. If so we compare Key to the
+ -- node that follows the hint. If Key is both greater than the hint and
+ -- less than the hint's next neighbor, then we're done; otherwise we
+ -- must search.
- if Is_Greater_Key_Node (Key, Position) then
- declare
- After : constant Node_Access := Ops.Next (Position);
+ begin
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Is_Greater_Key_Node (Key, Position);
+
+ L := L - 1;
+ B := B - 1;
+
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+
+ if Compare then
+ Test := Ops.Next (Position); -- "after"
+
+ if Test = null then -- new last node
+ Insert_Post (Tree, Tree.Last, False, Node);
+
+ Inserted := True;
+ return;
+ end if;
begin
- if After = null then
- Insert_Post (Tree, Tree.Last, False, Node);
- Inserted := True;
+ B := B + 1;
+ L := L + 1;
+
+ Compare := Is_Less_Key_Node (Key, Test);
- elsif Is_Less_Key_Node (Key, After) then
- if Ops.Right (Position) = null then
- Insert_Post (Tree, Position, False, Node);
- else
- Insert_Post (Tree, After, True, Node);
- end if;
+ L := L - 1;
+ B := B - 1;
- Inserted := True;
+ exception
+ when others =>
+ L := L - 1;
+ B := B - 1;
+ raise;
+ end;
+ if Compare then
+ if Ops.Right (Position) = null then
+ Insert_Post (Tree, Position, False, Node);
else
- Conditional_Insert_Sans_Hint (Tree, Key, Node, Inserted);
+ Insert_Post (Tree, Test, True, Node);
end if;
- end;
+
+ Inserted := True;
+
+ else
+ Conditional_Insert_Sans_Hint (Tree, Key, Node, Inserted);
+ end if;
return;
end if;
- -- We know that Key is neither less than the hint nor greater
- -- than the hint, and that's the definition of equivalence.
- -- There's nothing else we need to do, since a search would just
- -- reach the same conclusion.
+ -- We know that Key is neither less than the hint nor greater than the
+ -- hint, and that's the definition of equivalence. There's nothing else
+ -- we need to do, since a search would just reach the same conclusion.
Node := Position;
Inserted := False;
diff --git a/gcc/ada/a-crbtgo.adb b/gcc/ada/a-crbtgo.adb
index c8ddcff02a5..6cce55d25ab 100644
--- a/gcc/ada/a-crbtgo.adb
+++ b/gcc/ada/a-crbtgo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -626,9 +626,17 @@ package body Ada.Containers.Red_Black_Trees.Generic_Operations is
-------------------
function Generic_Equal (Left, Right : Tree_Type) return Boolean is
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
L_Node : Node_Access;
R_Node : Node_Access;
+ Result : Boolean;
+
begin
if Left'Address = Right'Address then
return True;
@@ -638,18 +646,45 @@ package body Ada.Containers.Red_Black_Trees.Generic_Operations is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
L_Node := Left.First;
R_Node := Right.First;
+ Result := True;
while L_Node /= null loop
if not Is_Equal (L_Node, R_Node) then
- return False;
+ Result := False;
+ exit;
end if;
L_Node := Next (L_Node);
R_Node := Next (R_Node);
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end Generic_Equal;
-----------------------
diff --git a/gcc/ada/a-rbtgbo.adb b/gcc/ada/a-rbtgbo.adb
index d66571396c7..d6df756e363 100644
--- a/gcc/ada/a-rbtgbo.adb
+++ b/gcc/ada/a-rbtgbo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -606,9 +606,17 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
-------------------
function Generic_Equal (Left, Right : Tree_Type'Class) return Boolean is
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
L_Node : Count_Type;
R_Node : Count_Type;
+ Result : Boolean;
+
begin
if Left'Address = Right'Address then
return True;
@@ -618,18 +626,45 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
L_Node := Left.First;
R_Node := Right.First;
+ Result := True;
while L_Node /= 0 loop
if not Is_Equal (Left.Nodes (L_Node), Right.Nodes (R_Node)) then
- return False;
+ Result := False;
+ exit;
end if;
L_Node := Next (Left, L_Node);
R_Node := Next (Right, R_Node);
end loop;
- return True;
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end Generic_Equal;
-----------------------
diff --git a/gcc/ada/a-rbtgso.adb b/gcc/ada/a-rbtgso.adb
index 2b9b5402435..06a78e922c3 100644
--- a/gcc/ada/a-rbtgso.adb
+++ b/gcc/ada/a-rbtgso.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -84,8 +84,16 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
----------------
procedure Difference (Target : in out Tree_Type; Source : Tree_Type) is
- Tgt : Node_Access := Target.First;
- Src : Node_Access := Source.First;
+ BT : Natural renames Target.Busy;
+ LT : Natural renames Target.Lock;
+
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
+ Tgt : Node_Access;
+ Src : Node_Access;
+
+ Compare : Integer;
begin
if Target'Address = Source'Address then
@@ -107,19 +115,56 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
"attempt to tamper with cursors (container is busy)";
end if;
+ Tgt := Target.First;
+ Src := Source.First;
loop
if Tgt = null then
- return;
+ exit;
end if;
if Src = null then
- return;
+ exit;
end if;
- if Is_Less (Tgt, Src) then
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ begin
+ BT := BT + 1;
+ LT := LT + 1;
+
+ BS := BS + 1;
+ LS := LS + 1;
+
+ if Is_Less (Tgt, Src) then
+ Compare := -1;
+ elsif Is_Less (Src, Tgt) then
+ Compare := 1;
+ else
+ Compare := 0;
+ end if;
+
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ exception
+ when others =>
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
+
+ if Compare < 0 then
Tgt := Tree_Operations.Next (Tgt);
- elsif Is_Less (Src, Tgt) then
+ elsif Compare > 0 then
Src := Tree_Operations.Next (Src);
else
@@ -137,34 +182,66 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
end Difference;
function Difference (Left, Right : Tree_Type) return Tree_Type is
- Tree : Tree_Type;
-
- L_Node : Node_Access := Left.First;
- R_Node : Node_Access := Right.First;
-
- Dst_Node : Node_Access;
- pragma Warnings (Off, Dst_Node);
-
begin
if Left'Address = Right'Address then
- return Tree; -- Empty set
+ return Tree_Type'(others => <>); -- Empty set
end if;
if Left.Length = 0 then
- return Tree; -- Empty set
+ return Tree_Type'(others => <>); -- Empty set
end if;
if Right.Length = 0 then
return Copy (Left);
end if;
- loop
- if L_Node = null then
- return Tree;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
- if R_Node = null then
- while L_Node /= null loop
+ Tree : Tree_Type;
+
+ L_Node : Node_Access;
+ R_Node : Node_Access;
+
+ Dst_Node : Node_Access;
+ pragma Warnings (Off, Dst_Node);
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = null then
+ exit;
+ end if;
+
+ if R_Node = null then
+ while L_Node /= null loop
+ Insert_With_Hint
+ (Dst_Tree => Tree,
+ Dst_Hint => null,
+ Src_Node => L_Node,
+ Dst_Node => Dst_Node);
+
+ L_Node := Tree_Operations.Next (L_Node);
+ end loop;
+
+ exit;
+ end if;
+
+ if Is_Less (L_Node, R_Node) then
Insert_With_Hint
(Dst_Tree => Tree,
Dst_Hint => null,
@@ -173,33 +250,34 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
L_Node := Tree_Operations.Next (L_Node);
- end loop;
+ elsif Is_Less (R_Node, L_Node) then
+ R_Node := Tree_Operations.Next (R_Node);
- return Tree;
- end if;
+ else
+ L_Node := Tree_Operations.Next (L_Node);
+ R_Node := Tree_Operations.Next (R_Node);
+ end if;
+ end loop;
- if Is_Less (L_Node, R_Node) then
- Insert_With_Hint
- (Dst_Tree => Tree,
- Dst_Hint => null,
- Src_Node => L_Node,
- Dst_Node => Dst_Node);
+ BL := BL - 1;
+ LL := LL - 1;
- L_Node := Tree_Operations.Next (L_Node);
+ BR := BR - 1;
+ LR := LR - 1;
- elsif Is_Less (R_Node, L_Node) then
- R_Node := Tree_Operations.Next (R_Node);
+ return Tree;
- else
- L_Node := Tree_Operations.Next (L_Node);
- R_Node := Tree_Operations.Next (R_Node);
- end if;
- end loop;
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
- exception
- when others =>
- Delete_Tree (Tree.Root);
- raise;
+ BR := BR - 1;
+ LR := LR - 1;
+
+ Delete_Tree (Tree.Root);
+ raise;
+ end;
end Difference;
------------------
@@ -210,8 +288,16 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
(Target : in out Tree_Type;
Source : Tree_Type)
is
- Tgt : Node_Access := Target.First;
- Src : Node_Access := Source.First;
+ BT : Natural renames Target.Busy;
+ LT : Natural renames Target.Lock;
+
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
+ Tgt : Node_Access;
+ Src : Node_Access;
+
+ Compare : Integer;
begin
if Target'Address = Source'Address then
@@ -228,10 +314,47 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
return;
end if;
+ Tgt := Target.First;
+ Src := Source.First;
while Tgt /= null
and then Src /= null
loop
- if Is_Less (Tgt, Src) then
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ begin
+ BT := BT + 1;
+ LT := LT + 1;
+
+ BS := BS + 1;
+ LS := LS + 1;
+
+ if Is_Less (Tgt, Src) then
+ Compare := -1;
+ elsif Is_Less (Src, Tgt) then
+ Compare := 1;
+ else
+ Compare := 0;
+ end if;
+
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ exception
+ when others =>
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
+
+ if Compare < 0 then
declare
X : Node_Access := Tgt;
begin
@@ -240,7 +363,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
Free (X);
end;
- elsif Is_Less (Src, Tgt) then
+ elsif Compare > 0 then
Src := Tree_Operations.Next (Src);
else
@@ -261,50 +384,84 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
end Intersection;
function Intersection (Left, Right : Tree_Type) return Tree_Type is
- Tree : Tree_Type;
-
- L_Node : Node_Access := Left.First;
- R_Node : Node_Access := Right.First;
-
- Dst_Node : Node_Access;
- pragma Warnings (Off, Dst_Node);
-
begin
if Left'Address = Right'Address then
return Copy (Left);
end if;
- loop
- if L_Node = null then
- return Tree;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if R_Node = null then
- return Tree;
- end if;
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
- if Is_Less (L_Node, R_Node) then
- L_Node := Tree_Operations.Next (L_Node);
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
- elsif Is_Less (R_Node, L_Node) then
- R_Node := Tree_Operations.Next (R_Node);
+ Tree : Tree_Type;
- else
- Insert_With_Hint
- (Dst_Tree => Tree,
- Dst_Hint => null,
- Src_Node => L_Node,
- Dst_Node => Dst_Node);
+ L_Node : Node_Access;
+ R_Node : Node_Access;
- L_Node := Tree_Operations.Next (L_Node);
- R_Node := Tree_Operations.Next (R_Node);
- end if;
- end loop;
+ Dst_Node : Node_Access;
+ pragma Warnings (Off, Dst_Node);
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = null then
+ exit;
+ end if;
- exception
- when others =>
- Delete_Tree (Tree.Root);
- raise;
+ if R_Node = null then
+ exit;
+ end if;
+
+ if Is_Less (L_Node, R_Node) then
+ L_Node := Tree_Operations.Next (L_Node);
+
+ elsif Is_Less (R_Node, L_Node) then
+ R_Node := Tree_Operations.Next (R_Node);
+
+ else
+ Insert_With_Hint
+ (Dst_Tree => Tree,
+ Dst_Hint => null,
+ Src_Node => L_Node,
+ Dst_Node => Dst_Node);
+
+ L_Node := Tree_Operations.Next (L_Node);
+ R_Node := Tree_Operations.Next (R_Node);
+ end if;
+ end loop;
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Tree;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ Delete_Tree (Tree.Root);
+ raise;
+ end;
end Intersection;
---------------
@@ -324,22 +481,44 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
return False;
end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
declare
- Subset_Node : Node_Access := Subset.First;
- Set_Node : Node_Access := Of_Set.First;
+ BL : Natural renames Subset'Unrestricted_Access.Busy;
+ LL : Natural renames Subset'Unrestricted_Access.Lock;
+
+ BR : Natural renames Of_Set'Unrestricted_Access.Busy;
+ LR : Natural renames Of_Set'Unrestricted_Access.Lock;
+
+ Subset_Node : Node_Access;
+ Set_Node : Node_Access;
+
+ Result : Boolean;
begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ Subset_Node := Subset.First;
+ Set_Node := Of_Set.First;
loop
if Set_Node = null then
- return Subset_Node = null;
+ Result := Subset_Node = null;
+ exit;
end if;
if Subset_Node = null then
- return True;
+ Result := True;
+ exit;
end if;
if Is_Less (Subset_Node, Set_Node) then
- return False;
+ Result := False;
+ exit;
end if;
if Is_Less (Set_Node, Subset_Node) then
@@ -349,6 +528,24 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
Subset_Node := Tree_Operations.Next (Subset_Node);
end if;
end loop;
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
end;
end Is_Subset;
@@ -357,31 +554,73 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
-------------
function Overlap (Left, Right : Tree_Type) return Boolean is
- L_Node : Node_Access := Left.First;
- R_Node : Node_Access := Right.First;
-
begin
if Left'Address = Right'Address then
return Left.Length /= 0;
end if;
- loop
- if L_Node = null
- or else R_Node = null
- then
- return False;
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
- if Is_Less (L_Node, R_Node) then
- L_Node := Tree_Operations.Next (L_Node);
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
- elsif Is_Less (R_Node, L_Node) then
- R_Node := Tree_Operations.Next (R_Node);
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
- else
- return True;
- end if;
- end loop;
+ L_Node : Node_Access;
+ R_Node : Node_Access;
+
+ Result : Boolean;
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = null
+ or else R_Node = null
+ then
+ Result := False;
+ exit;
+ end if;
+
+ if Is_Less (L_Node, R_Node) then
+ L_Node := Tree_Operations.Next (L_Node);
+
+ elsif Is_Less (R_Node, L_Node) then
+ R_Node := Tree_Operations.Next (R_Node);
+
+ else
+ Result := True;
+ exit;
+ end if;
+ end loop;
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ return Result;
+
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
+ raise;
+ end;
end Overlap;
--------------------------
@@ -392,23 +631,28 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
(Target : in out Tree_Type;
Source : Tree_Type)
is
- Tgt : Node_Access := Target.First;
- Src : Node_Access := Source.First;
+ BT : Natural renames Target.Busy;
+ LT : Natural renames Target.Lock;
+
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
+ Tgt : Node_Access;
+ Src : Node_Access;
New_Tgt_Node : Node_Access;
pragma Warnings (Off, New_Tgt_Node);
- begin
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors (container is busy)";
- end if;
+ Compare : Integer;
+ begin
if Target'Address = Source'Address then
Clear (Target);
return;
end if;
+ Tgt := Target.First;
+ Src := Source.First;
loop
if Tgt = null then
while Src /= null loop
@@ -428,10 +672,45 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
return;
end if;
- if Is_Less (Tgt, Src) then
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ begin
+ BT := BT + 1;
+ LT := LT + 1;
+
+ BS := BS + 1;
+ LS := LS + 1;
+
+ if Is_Less (Tgt, Src) then
+ Compare := -1;
+ elsif Is_Less (Src, Tgt) then
+ Compare := 1;
+ else
+ Compare := 0;
+ end if;
+
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ exception
+ when others =>
+ BT := BT - 1;
+ LT := LT - 1;
+
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
+
+ if Compare < 0 then
Tgt := Tree_Operations.Next (Tgt);
- elsif Is_Less (Src, Tgt) then
+ elsif Compare > 0 then
Insert_With_Hint
(Dst_Tree => Target,
Dst_Hint => Tgt,
@@ -455,17 +734,9 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
end Symmetric_Difference;
function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type is
- Tree : Tree_Type;
-
- L_Node : Node_Access := Left.First;
- R_Node : Node_Access := Right.First;
-
- Dst_Node : Node_Access;
- pragma Warnings (Off, Dst_Node);
-
begin
if Left'Address = Right'Address then
- return Tree; -- Empty set
+ return Tree_Type'(others => <>); -- Empty set
end if;
if Right.Length = 0 then
@@ -476,70 +747,111 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
return Copy (Right);
end if;
- loop
- if L_Node = null then
- while R_Node /= null loop
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
+ Tree : Tree_Type;
+
+ L_Node : Node_Access;
+ R_Node : Node_Access;
+
+ Dst_Node : Node_Access;
+ pragma Warnings (Off, Dst_Node);
+
+ begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
+ L_Node := Left.First;
+ R_Node := Right.First;
+ loop
+ if L_Node = null then
+ while R_Node /= null loop
+ Insert_With_Hint
+ (Dst_Tree => Tree,
+ Dst_Hint => null,
+ Src_Node => R_Node,
+ Dst_Node => Dst_Node);
+ R_Node := Tree_Operations.Next (R_Node);
+ end loop;
+
+ exit;
+ end if;
+
+ if R_Node = null then
+ while L_Node /= null loop
+ Insert_With_Hint
+ (Dst_Tree => Tree,
+ Dst_Hint => null,
+ Src_Node => L_Node,
+ Dst_Node => Dst_Node);
+
+ L_Node := Tree_Operations.Next (L_Node);
+ end loop;
+
+ exit;
+ end if;
+
+ if Is_Less (L_Node, R_Node) then
Insert_With_Hint
(Dst_Tree => Tree,
Dst_Hint => null,
- Src_Node => R_Node,
+ Src_Node => L_Node,
Dst_Node => Dst_Node);
- R_Node := Tree_Operations.Next (R_Node);
- end loop;
- return Tree;
- end if;
+ L_Node := Tree_Operations.Next (L_Node);
- if R_Node = null then
- while L_Node /= null loop
+ elsif Is_Less (R_Node, L_Node) then
Insert_With_Hint
(Dst_Tree => Tree,
Dst_Hint => null,
- Src_Node => L_Node,
+ Src_Node => R_Node,
Dst_Node => Dst_Node);
- L_Node := Tree_Operations.Next (L_Node);
- end loop;
+ R_Node := Tree_Operations.Next (R_Node);
- return Tree;
- end if;
+ else
+ L_Node := Tree_Operations.Next (L_Node);
+ R_Node := Tree_Operations.Next (R_Node);
+ end if;
+ end loop;
- if Is_Less (L_Node, R_Node) then
- Insert_With_Hint
- (Dst_Tree => Tree,
- Dst_Hint => null,
- Src_Node => L_Node,
- Dst_Node => Dst_Node);
+ BL := BL - 1;
+ LL := LL - 1;
- L_Node := Tree_Operations.Next (L_Node);
+ BR := BR - 1;
+ LR := LR - 1;
- elsif Is_Less (R_Node, L_Node) then
- Insert_With_Hint
- (Dst_Tree => Tree,
- Dst_Hint => null,
- Src_Node => R_Node,
- Dst_Node => Dst_Node);
+ return Tree;
- R_Node := Tree_Operations.Next (R_Node);
+ exception
+ when others =>
+ BL := BL - 1;
+ LL := LL - 1;
- else
- L_Node := Tree_Operations.Next (L_Node);
- R_Node := Tree_Operations.Next (R_Node);
- end if;
- end loop;
+ BR := BR - 1;
+ LR := LR - 1;
- exception
- when others =>
- Delete_Tree (Tree.Root);
- raise;
+ Delete_Tree (Tree.Root);
+ raise;
+ end;
end Symmetric_Difference;
-----------
-- Union --
-----------
- procedure Union (Target : in out Tree_Type; Source : Tree_Type)
- is
+ procedure Union (Target : in out Tree_Type; Source : Tree_Type) is
Hint : Node_Access;
procedure Process (Node : Node_Access);
@@ -555,7 +867,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
begin
Insert_With_Hint
(Dst_Tree => Target,
- Dst_Hint => Hint,
+ Dst_Hint => Hint, -- use node most recently inserted as hint
Src_Node => Node,
Dst_Node => Hint);
end Process;
@@ -567,12 +879,29 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
return;
end if;
- if Target.Busy > 0 then
- raise Program_Error with
- "attempt to tamper with cursors (container is busy)";
- end if;
+ -- Per AI05-0022, the container implementation is required to detect
+ -- element tampering by a generic actual subprogram.
+
+ declare
+ BS : Natural renames Source'Unrestricted_Access.Busy;
+ LS : Natural renames Source'Unrestricted_Access.Lock;
+
+ begin
+ BS := BS + 1;
+ LS := LS + 1;
+
+ Iterate (Source);
- Iterate (Source);
+ BS := BS - 1;
+ LS := LS - 1;
+
+ exception
+ when others =>
+ BS := BS - 1;
+ LS := LS - 1;
+
+ raise;
+ end;
end Union;
function Union (Left, Right : Tree_Type) return Tree_Type is
@@ -590,6 +919,12 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
end if;
declare
+ BL : Natural renames Left'Unrestricted_Access.Busy;
+ LL : Natural renames Left'Unrestricted_Access.Lock;
+
+ BR : Natural renames Right'Unrestricted_Access.Busy;
+ LR : Natural renames Right'Unrestricted_Access.Lock;
+
Tree : Tree_Type := Copy (Left);
Hint : Node_Access;
@@ -608,7 +943,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
begin
Insert_With_Hint
(Dst_Tree => Tree,
- Dst_Hint => Hint,
+ Dst_Hint => Hint, -- use node most recently inserted as hint
Src_Node => Node,
Dst_Node => Hint);
end Process;
@@ -616,15 +951,33 @@ package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
-- Start of processing for Union
begin
+ BL := BL + 1;
+ LL := LL + 1;
+
+ BR := BR + 1;
+ LR := LR + 1;
+
Iterate (Right);
+
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
return Tree;
exception
when others =>
+ BL := BL - 1;
+ LL := LL - 1;
+
+ BR := BR - 1;
+ LR := LR - 1;
+
Delete_Tree (Tree.Root);
raise;
end;
-
end Union;
end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
diff --git a/gcc/ada/adabkend.adb b/gcc/ada/adabkend.adb
index 96bd00d99df..6588b4f3f9c 100644
--- a/gcc/ada/adabkend.adb
+++ b/gcc/ada/adabkend.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2011, AdaCore --
+-- Copyright (C) 2001-2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -234,6 +234,15 @@ package body Adabkend is
then
if Is_Switch (Argv) then
Fail ("Object file name missing after -gnatO");
+
+ -- In Alfa_Mode, such an object file is never written, and the
+ -- call to Set_Output_Object_File_Name may fail (e.g. when the
+ -- object file name does not have the expected suffix). So we
+ -- skip that call when Alfa_Mode is set.
+
+ elsif Alfa_Mode then
+ Output_File_Name_Seen := True;
+
else
Set_Output_Object_File_Name (Argv);
Output_File_Name_Seen := True;
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index dc94d63d556..c4bb7540c52 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -213,6 +213,8 @@ struct vstring
#define SYI$_ACTIVECPU_CNT 0x111e
extern int LIB$GETSYI (int *, unsigned int *);
+extern unsigned int LIB$CALLG_64
+ ( unsigned long long argument_list [], int (*user_procedure)(void));
#else
#include <utime.h>
@@ -820,7 +822,8 @@ __gnat_rmdir (char *path)
}
FILE *
-__gnat_fopen (char *path, char *mode, int encoding ATTRIBUTE_UNUSED)
+__gnat_fopen (char *path, char *mode, int encoding ATTRIBUTE_UNUSED,
+ char *vms_form ATTRIBUTE_UNUSED)
{
#if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS)
TCHAR wpath[GNAT_MAX_PATH_LEN];
@@ -837,7 +840,37 @@ __gnat_fopen (char *path, char *mode, int encoding ATTRIBUTE_UNUSED)
return _tfopen (wpath, wmode);
#elif defined (VMS)
- return decc$fopen (path, mode);
+ if (vms_form == 0)
+ return decc$fopen (path, mode);
+ else
+ {
+ char *local_form = (char *) alloca (strlen (vms_form) + 1);
+ /* Allocate an argument list of guaranteed ample length. */
+ unsigned long long *arg_list =
+ (unsigned long long *) alloca (strlen (vms_form) + 3);
+ char *ptrb, *ptre;
+ int i;
+
+ arg_list [1] = (unsigned long long) path;
+ arg_list [2] = (unsigned long long) mode;
+ strcpy (local_form, vms_form);
+
+ /* Given a string such as "\"rfm=udf\",\"rat=cr\""
+ Split it into an argument list as "rfm=udf","rat=cr". */
+ ptrb = local_form;
+ for (i = 0; *ptrb; i++)
+ {
+ ptrb = strchr (ptrb, '"');
+ ptre = strchr (ptrb + 1, '"');
+ *ptre = 0;
+ arg_list [i + 3] = (unsigned long long) (ptrb + 1);
+ ptrb = ptre + 1;
+ }
+ arg_list [0] = i + 2;
+ /* CALLG_64 returns int , fortunately (FILE *) on VMS is a
+ always a 32bit pointer. */
+ return LIB$CALLG_64 (arg_list, &decc$fopen);
+ }
#else
return GNAT_FOPEN (path, mode);
#endif
@@ -847,7 +880,8 @@ FILE *
__gnat_freopen (char *path,
char *mode,
FILE *stream,
- int encoding ATTRIBUTE_UNUSED)
+ int encoding ATTRIBUTE_UNUSED,
+ char *vms_form ATTRIBUTE_UNUSED)
{
#if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS)
TCHAR wpath[GNAT_MAX_PATH_LEN];
@@ -864,7 +898,38 @@ __gnat_freopen (char *path,
return _tfreopen (wpath, wmode, stream);
#elif defined (VMS)
- return decc$freopen (path, mode, stream);
+ if (vms_form == 0)
+ return decc$freopen (path, mode, stream);
+ else
+ {
+ char *local_form = (char *) alloca (strlen (vms_form) + 1);
+ /* Allocate an argument list of guaranteed ample length. */
+ unsigned long long *arg_list =
+ (unsigned long long *) alloca (strlen (vms_form) + 4);
+ char *ptrb, *ptre;
+ int i;
+
+ arg_list [1] = (unsigned long long) path;
+ arg_list [2] = (unsigned long long) mode;
+ arg_list [3] = (unsigned long long) stream;
+ strcpy (local_form, vms_form);
+
+ /* Given a string such as "\"rfm=udf\",\"rat=cr\""
+ Split it into an argument list as "rfm=udf","rat=cr". */
+ ptrb = local_form;
+ for (i = 0; *ptrb; i++)
+ {
+ ptrb = strchr (ptrb, '"');
+ ptre = strchr (ptrb + 1, '"');
+ *ptre = 0;
+ arg_list [i + 4] = (unsigned long long) (ptrb + 1);
+ ptrb = ptre + 1;
+ }
+ arg_list [0] = i + 3;
+ /* CALLG_64 returns int , fortunately (FILE *) on VMS is a
+ always a 32bit pointer. */
+ return LIB$CALLG_64 (arg_list, &decc$freopen);
+ }
#else
return freopen (path, mode, stream);
#endif
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 7956e27a709..78af57c9dae 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -128,9 +128,10 @@ extern int __gnat_rename (char *, char *);
extern int __gnat_chdir (char *);
extern int __gnat_rmdir (char *);
-extern FILE *__gnat_fopen (char *, char *, int);
+extern FILE *__gnat_fopen (char *, char *, int,
+ char *);
extern FILE *__gnat_freopen (char *, char *, FILE *,
- int);
+ int, char *);
extern int __gnat_open_read (char *, int);
extern int __gnat_open_rw (char *, int);
extern int __gnat_open_create (char *, int);
diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb
index 0c2e87d5111..d8b12adf47b 100644
--- a/gcc/ada/ali-util.adb
+++ b/gcc/ada/ali-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -272,7 +272,11 @@ package body ALI.Util is
Error_Msg ("{ had errors, must be fixed, and recompiled");
Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+ -- In formal verification mode, object files are never
+ -- generated, so No_Object=True is not considered an error.
+
elsif ALIs.Table (Idread).No_Object
+ and then not Alfa_Mode
and then not Ignore_Errors
then
Error_Msg_File_1 := Withs.Table (W).Sfile;
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index 0386c05fe5a..bea2b10c95b 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1331,9 +1331,9 @@ package body ALI is
when Constraint_Error =>
-- A constraint error comes from the
- -- additionh. We reset to the maximum
- -- and indicate that the real value is
- -- now unknown.
+ -- addition. We reset to the maximum
+ -- and indicate that the real value
+ -- is now unknown.
Cumulative_Restrictions.Value (R) :=
Integer'Last;
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 523deaaa0ac..364f8572476 100644
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2010-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -110,65 +110,113 @@ package body Aspects is
end if;
end Aspect_Specifications;
- -------------------
- -- Get_Aspect_Id --
- -------------------
-
- function Get_Aspect_Id (Name : Name_Id) return Aspect_Id is
- begin
- return Aspect_Id_Hash_Table.Get (Name);
- end Get_Aspect_Id;
-
-----------------
-- Find_Aspect --
-----------------
- function Find_Aspect (Ent : Entity_Id; A : Aspect_Id) return Node_Id is
- Ritem : Node_Id;
- Typ : Entity_Id;
+ function Find_Aspect (Id : Entity_Id; A : Aspect_Id) return Node_Id is
+ Decl : Node_Id;
+ Item : Node_Id;
+ Owner : Entity_Id;
+ Spec : Node_Id;
begin
+ Owner := Id;
- -- If the aspect is an inherited one and the entity is a class-wide
- -- type, use the aspect of the specific type. If the type is a base
- -- aspect, examine the rep. items of the base type.
+ -- Handle various cases of base or inherited aspects for types
- if Is_Type (Ent) then
+ if Is_Type (Id) then
if Base_Aspect (A) then
- Typ := Base_Type (Ent);
- else
- Typ := Ent;
+ Owner := Base_Type (Owner);
end if;
- if Is_Class_Wide_Type (Typ)
- and then Inherited_Aspect (A)
- then
- Ritem := First_Rep_Item (Etype (Typ));
- else
- Ritem := First_Rep_Item (Typ);
+ if Is_Class_Wide_Type (Owner) and then Inherited_Aspect (A) then
+ Owner := Root_Type (Owner);
end if;
-
- else
- Ritem := First_Rep_Item (Ent);
end if;
- while Present (Ritem) loop
- if Nkind (Ritem) = N_Aspect_Specification
- and then Get_Aspect_Id (Chars (Identifier (Ritem))) = A
+ -- Search the representation items for the desired aspect
+
+ Item := First_Rep_Item (Owner);
+ while Present (Item) loop
+ if Nkind (Item) = N_Aspect_Specification
+ and then Get_Aspect_Id (Chars (Identifier (Item))) = A
then
- if A = Aspect_Default_Iterator then
- return Expression (Aspect_Rep_Item (Ritem));
- else
- return Expression (Ritem);
- end if;
+ return Item;
end if;
- Next_Rep_Item (Ritem);
+ Next_Rep_Item (Item);
end loop;
+ -- Note that not all aspects are added to the chain of representation
+ -- items. In such cases, search the list of aspect specifications. First
+ -- find the declaration node where the aspects reside. This is usually
+ -- the parent or the parent of the parent.
+
+ Decl := Parent (Owner);
+ if not Permits_Aspect_Specifications (Decl) then
+ Decl := Parent (Decl);
+ end if;
+
+ -- Search the list of aspect specifications for the desired aspect
+
+ if Permits_Aspect_Specifications (Decl) then
+ Spec := First (Aspect_Specifications (Decl));
+ while Present (Spec) loop
+ if Get_Aspect_Id (Chars (Identifier (Spec))) = A then
+ return Spec;
+ end if;
+
+ Next (Spec);
+ end loop;
+ end if;
+
+ -- The entity does not carry any aspects or the desired aspect was not
+ -- found.
+
return Empty;
end Find_Aspect;
+ --------------------------
+ -- Find_Value_Of_Aspect --
+ --------------------------
+
+ function Find_Value_Of_Aspect
+ (Id : Entity_Id;
+ A : Aspect_Id) return Node_Id
+ is
+ Spec : constant Node_Id := Find_Aspect (Id, A);
+
+ begin
+ if Present (Spec) then
+ if A = Aspect_Default_Iterator then
+ return Expression (Aspect_Rep_Item (Spec));
+ else
+ return Expression (Spec);
+ end if;
+ end if;
+
+ return Empty;
+ end Find_Value_Of_Aspect;
+
+ -------------------
+ -- Get_Aspect_Id --
+ -------------------
+
+ function Get_Aspect_Id (Name : Name_Id) return Aspect_Id is
+ begin
+ return Aspect_Id_Hash_Table.Get (Name);
+ end Get_Aspect_Id;
+
+ ----------------
+ -- Has_Aspect --
+ ----------------
+
+ function Has_Aspect (Id : Entity_Id; A : Aspect_Id) return Boolean is
+ begin
+ return Present (Find_Aspect (Id, A));
+ end Has_Aspect;
+
------------------
-- Move_Aspects --
------------------
@@ -220,6 +268,7 @@ package body Aspects is
N_Subprogram_Body => True,
N_Subprogram_Declaration => True,
N_Subprogram_Renaming_Declaration => True,
+ N_Subprogram_Body_Stub => True,
N_Subtype_Declaration => True,
N_Task_Body => True,
N_Task_Type_Declaration => True,
@@ -259,6 +308,7 @@ package body Aspects is
Aspect_Default_Component_Value => Aspect_Default_Component_Value,
Aspect_Default_Iterator => Aspect_Default_Iterator,
Aspect_Default_Value => Aspect_Default_Value,
+ Aspect_Depends => Aspect_Depends,
Aspect_Dimension => Aspect_Dimension,
Aspect_Dimension_System => Aspect_Dimension_System,
Aspect_Discard_Names => Aspect_Discard_Names,
@@ -269,6 +319,7 @@ package body Aspects is
Aspect_External_Name => Aspect_External_Name,
Aspect_External_Tag => Aspect_External_Tag,
Aspect_Favor_Top_Level => Aspect_Favor_Top_Level,
+ Aspect_Ghost => Aspect_Ghost,
Aspect_Global => Aspect_Global,
Aspect_Implicit_Dereference => Aspect_Implicit_Dereference,
Aspect_Import => Aspect_Import,
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index c3199cc0d4b..2194eb33834 100644
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2010-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -88,6 +88,7 @@ package Aspects is
Aspect_Default_Component_Value,
Aspect_Default_Iterator,
Aspect_Default_Value,
+ Aspect_Depends, -- GNAT
Aspect_Dimension, -- GNAT
Aspect_Dimension_System, -- GNAT
Aspect_Dispatching_Domain,
@@ -160,6 +161,7 @@ package Aspects is
Aspect_Discard_Names,
Aspect_Export,
Aspect_Favor_Top_Level, -- GNAT
+ Aspect_Ghost, -- GNAT
Aspect_Independent,
Aspect_Independent_Components,
Aspect_Import,
@@ -229,9 +231,11 @@ package Aspects is
Aspect_Compiler_Unit => True,
Aspect_Contract_Case => True,
Aspect_Contract_Cases => True,
+ Aspect_Depends => True,
Aspect_Dimension => True,
Aspect_Dimension_System => True,
Aspect_Favor_Top_Level => True,
+ Aspect_Ghost => True,
Aspect_Global => True,
Aspect_Inline_Always => True,
Aspect_Invariant => True,
@@ -325,6 +329,7 @@ package Aspects is
Aspect_Default_Component_Value => Expression,
Aspect_Default_Iterator => Name,
Aspect_Default_Value => Expression,
+ Aspect_Depends => Expression,
Aspect_Dimension => Expression,
Aspect_Dimension_System => Expression,
Aspect_Dispatching_Domain => Expression,
@@ -399,6 +404,7 @@ package Aspects is
Aspect_Default_Iterator => Name_Default_Iterator,
Aspect_Default_Value => Name_Default_Value,
Aspect_Default_Component_Value => Name_Default_Component_Value,
+ Aspect_Depends => Name_Depends,
Aspect_Dimension => Name_Dimension,
Aspect_Dimension_System => Name_Dimension_System,
Aspect_Discard_Names => Name_Discard_Names,
@@ -409,6 +415,7 @@ package Aspects is
Aspect_External_Tag => Name_External_Tag,
Aspect_Export => Name_Export,
Aspect_Favor_Top_Level => Name_Favor_Top_Level,
+ Aspect_Ghost => Name_Ghost,
Aspect_Global => Name_Global,
Aspect_Implicit_Dereference => Name_Implicit_Dereference,
Aspect_Import => Name_Import,
@@ -496,11 +503,6 @@ package Aspects is
-- implemented internally with a hash table in the body, that provides
-- access to aspect specifications.
- function Permits_Aspect_Specifications (N : Node_Id) return Boolean;
- -- Returns True if the node N is a declaration node that permits aspect
- -- specifications in the grammar. It is possible for other nodes to have
- -- aspect specifications as a result of Rewrite or Replace calls.
-
function Aspect_Specifications (N : Node_Id) return List_Id;
-- Given a node N, returns the list of N_Aspect_Specification nodes that
-- are attached to this declaration node. If the node is in the class of
@@ -515,18 +517,18 @@ package Aspects is
-- Replace calls, and this function may be used to retrieve the aspect
-- specifications for the original rewritten node in such cases.
- procedure Set_Aspect_Specifications (N : Node_Id; L : List_Id);
- -- The node N must be in the class of declaration nodes that permit aspect
- -- specifications and the Has_Aspects flag must be False on entry. L must
- -- be a non-empty list of N_Aspect_Specification nodes. This procedure sets
- -- the Has_Aspects flag to True, and makes an entry that can be retrieved
- -- by a subsequent Aspect_Specifications call. It is an error to call this
- -- procedure with a node that does not permit aspect specifications, or a
- -- node that has its Has_Aspects flag set True on entry, or with L being an
- -- empty list or No_List.
+ function Find_Aspect (Id : Entity_Id; A : Aspect_Id) return Node_Id;
+ -- Find the aspect specification of aspect A associated with entity I.
+ -- Return Empty if Id does not have the requested aspect.
+
+ function Find_Value_Of_Aspect
+ (Id : Entity_Id;
+ A : Aspect_Id) return Node_Id;
+ -- Find the value of aspect A associated with entity Id. Return Empty if
+ -- Id does not have the requested aspect.
- function Find_Aspect (Ent : Entity_Id; A : Aspect_Id) return Node_Id;
- -- Find value of a given aspect from aspect list of entity
+ function Has_Aspect (Id : Entity_Id; A : Aspect_Id) return Boolean;
+ -- Determine whether entity Id has aspect A
procedure Move_Aspects (From : Node_Id; To : Node_Id);
-- Moves aspects from 'From' node to 'To' node. Has_Aspects (To) must be
@@ -534,15 +536,30 @@ package Aspects is
-- Otherwise the aspects are moved and on return Has_Aspects (To) is True,
-- and Has_Aspects (From) is False.
+ function Permits_Aspect_Specifications (N : Node_Id) return Boolean;
+ -- Returns True if the node N is a declaration node that permits aspect
+ -- specifications in the grammar. It is possible for other nodes to have
+ -- aspect specifications as a result of Rewrite or Replace calls.
+
function Same_Aspect (A1 : Aspect_Id; A2 : Aspect_Id) return Boolean;
-- Returns True if A1 and A2 are (essentially) the same aspect. This is not
-- a simple equality test because e.g. Post and Postcondition are the same.
-- This is used for detecting duplicate aspects.
- procedure Tree_Write;
- -- Writes contents of Aspect_Specifications hash table to the tree file
+ procedure Set_Aspect_Specifications (N : Node_Id; L : List_Id);
+ -- The node N must be in the class of declaration nodes that permit aspect
+ -- specifications and the Has_Aspects flag must be False on entry. L must
+ -- be a non-empty list of N_Aspect_Specification nodes. This procedure sets
+ -- the Has_Aspects flag to True, and makes an entry that can be retrieved
+ -- by a subsequent Aspect_Specifications call. It is an error to call this
+ -- procedure with a node that does not permit aspect specifications, or a
+ -- node that has its Has_Aspects flag set True on entry, or with L being an
+ -- empty list or No_List.
procedure Tree_Read;
-- Reads contents of Aspect_Specifications hash table from the tree file
+ procedure Tree_Write;
+ -- Writes contents of Aspect_Specifications hash table to the tree file
+
end Aspects;
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index b287b57302d..40a27a1fb74 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -2526,6 +2526,12 @@ package body Atree is
return Node_Id (Nodes.Table (N + 5).Field6);
end Node30;
+ function Node31 (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (Nkind (N) in N_Entity);
+ return Node_Id (Nodes.Table (N + 5).Field7);
+ end Node31;
+
function List1 (N : Node_Id) return List_Id is
begin
pragma Assert (N <= Nodes.Last);
@@ -5231,6 +5237,12 @@ package body Atree is
Nodes.Table (N + 5).Field6 := Union_Id (Val);
end Set_Node30;
+ procedure Set_Node31 (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (Nkind (N) in N_Entity);
+ Nodes.Table (N + 5).Field7 := Union_Id (Val);
+ end Set_Node31;
+
procedure Set_List1 (N : Node_Id; Val : List_Id) is
begin
pragma Assert (N <= Nodes.Last);
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index fc60293d65b..07e8e512a57 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1171,6 +1171,9 @@ package Atree is
function Node30 (N : Node_Id) return Node_Id;
pragma Inline (Node30);
+ function Node31 (N : Node_Id) return Node_Id;
+ pragma Inline (Node31);
+
function List1 (N : Node_Id) return List_Id;
pragma Inline (List1);
@@ -2453,6 +2456,9 @@ package Atree is
procedure Set_Node30 (N : Node_Id; Val : Node_Id);
pragma Inline (Set_Node30);
+ procedure Set_Node31 (N : Node_Id; Val : Node_Id);
+ pragma Inline (Set_Node31);
+
procedure Set_List1 (N : Node_Id; Val : List_Id);
pragma Inline (Set_List1);
diff --git a/gcc/ada/atree.h b/gcc/ada/atree.h
index 7d88c4d102c..c9fd5e0481b 100644
--- a/gcc/ada/atree.h
+++ b/gcc/ada/atree.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -259,6 +259,45 @@ struct Flag_Word4
Boolean flag215 : 1;
};
+/* Structure used for extra flags in sixth component overlaying Field12 */
+struct Flag_Word5
+{
+ Boolean flag255 : 1;
+ Boolean flag256 : 1;
+ Boolean flag257 : 1;
+ Boolean flag258 : 1;
+ Boolean flag259 : 1;
+ Boolean flag260 : 1;
+ Boolean flag261 : 1;
+ Boolean flag262 : 1;
+
+ Boolean flag263 : 1;
+ Boolean flag264 : 1;
+ Boolean flag265 : 1;
+ Boolean flag266 : 1;
+ Boolean flag267 : 1;
+ Boolean flag268 : 1;
+ Boolean flag269 : 1;
+ Boolean flag270 : 1;
+
+ Boolean flag271 : 1;
+ Boolean flag272 : 1;
+ Boolean flag273 : 1;
+ Boolean flag274 : 1;
+ Boolean flag275 : 1;
+ Boolean flag276 : 1;
+ Boolean flag277 : 1;
+ Boolean flag278 : 1;
+
+ Boolean flag279 : 1;
+ Boolean flag280 : 1;
+ Boolean flag281 : 1;
+ Boolean flag282 : 1;
+ Boolean flag283 : 1;
+ Boolean flag284 : 1;
+ Boolean flag285 : 1;
+ Boolean flag286 : 1;
+};
struct Non_Extended
{
Source_Ptr sloc;
@@ -290,6 +329,7 @@ struct Extended
struct Flag_Word fw;
struct Flag_Word2 fw2;
struct Flag_Word4 fw4;
+ struct Flag_Word5 fw5;
} U;
};
@@ -387,7 +427,12 @@ extern Node_Id Current_Error_Node;
#define Field27(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field9)
#define Field28(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field10)
#define Field29(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.field11)
-#define Field30(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field6)
+#define Field30(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.field6)
+#define Field31(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.field7)
+#define Field32(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.field8)
+#define Field33(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.field9)
+#define Field34(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.field10)
+#define Field35(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.X.field11)
#define Node1(N) Field1 (N)
#define Node2(N) Field2 (N)
@@ -419,6 +464,12 @@ extern Node_Id Current_Error_Node;
#define Node28(N) Field28 (N)
#define Node29(N) Field29 (N)
#define Node30(N) Field30 (N)
+#define Node31(N) Field31 (N)
+#define Node32(N) Field32 (N)
+#define Node33(N) Field33 (N)
+#define Node34(N) Field34 (N)
+#define Node35(N) Field35 (N)
+#define Node36(N) Field36 (N)
#define List1(N) Field1 (N)
#define List2(N) Field2 (N)
@@ -742,6 +793,39 @@ extern Node_Id Current_Error_Node;
#define Flag253(N) (Nodes_Ptr[(N) - First_Node_Id + 4].U.NK.flag71)
#define Flag254(N) (Nodes_Ptr[(N) - First_Node_Id + 4].U.NK.flag72)
+#define Flag255(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag255)
+#define Flag256(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag256)
+#define Flag257(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag257)
+#define Flag258(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag258)
+#define Flag259(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag259)
+#define Flag260(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag260)
+#define Flag261(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag261)
+#define Flag262(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag262)
+#define Flag263(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag263)
+#define Flag264(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag264)
+#define Flag265(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag265)
+#define Flag266(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag266)
+#define Flag267(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag267)
+#define Flag268(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag268)
+#define Flag269(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag269)
+#define Flag270(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag270)
+#define Flag271(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag271)
+#define Flag272(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag272)
+#define Flag273(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag273)
+#define Flag274(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag274)
+#define Flag275(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag275)
+#define Flag276(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag276)
+#define Flag277(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag277)
+#define Flag278(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag278)
+#define Flag279(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag279)
+#define Flag280(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag280)
+#define Flag281(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag281)
+#define Flag282(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag282)
+#define Flag283(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag283)
+#define Flag284(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag284)
+#define Flag285(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag285)
+#define Flag286(N) (Nodes_Ptr[(N) - First_Node_Id + 5].V.EX.U.fw5.flag286)
+
#ifdef __cplusplus
}
#endif
diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb
index f23230ecf9d..577d004c719 100644
--- a/gcc/ada/back_end.adb
+++ b/gcc/ada/back_end.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -340,18 +340,6 @@ package body Back_End is
end loop;
end Scan_Compiler_Arguments;
- -----------------------------
- -- Register_Back_End_Types --
- -----------------------------
-
- procedure Register_Back_End_Types (Call_Back : Register_Type_Proc) is
- procedure Enumerate_Modes (Call_Back : Register_Type_Proc);
- pragma Import (C, Enumerate_Modes, "enumerate_modes");
-
- begin
- Enumerate_Modes (Call_Back);
- end Register_Back_End_Types;
-
-------------------------------
-- Gen_Or_Update_Object_File --
-------------------------------
diff --git a/gcc/ada/back_end.ads b/gcc/ada/back_end.ads
index bfa2eb5b440..ba25a83fb7e 100644
--- a/gcc/ada/back_end.ads
+++ b/gcc/ada/back_end.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -23,10 +23,7 @@
-- --
------------------------------------------------------------------------------
--- Call the back end with all the information needed. Also contains other
--- back-end specific interfaces required by the front end.
-
-with Einfo; use Einfo;
+-- Call the back end with all the information needed
package Back_End is
@@ -46,30 +43,11 @@ package Back_End is
pragma Convention (C, Back_End_Mode_Type);
for Back_End_Mode_Type use (0, 1, 2);
- type C_String is array (0 .. 255) of aliased Character;
- pragma Convention (C, C_String);
-
- type Register_Type_Proc is access procedure
- (C_Name : C_String; -- Nul-terminated string with name of type
- Digs : Natural; -- Nr or digits for floating point, 0 otherwise
- Complex : Boolean; -- True iff type has real and imaginary parts
- Count : Natural; -- Number of elements in vector, 0 otherwise
- Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
- Size : Positive; -- Size of representation in bits
- Alignment : Natural); -- Required alignment in bits
- pragma Convention (C, Register_Type_Proc);
- -- Call back procedure for Register_Back_End_Types. This is to be used by
- -- Create_Standard to create predefined types for all types supported by
- -- the back end.
-
- procedure Register_Back_End_Types (Call_Back : Register_Type_Proc);
- -- Calls the Call_Back function with information for each supported type.
-
procedure Call_Back_End (Mode : Back_End_Mode_Type);
-- Call back end, i.e. make call to driver traversing the tree and
- -- outputting code. This call is made with all tables locked.
- -- The back end is responsible for unlocking any tables it may need
- -- to change, and locking them again before returning.
+ -- outputting code. This call is made with all tables locked. The back
+ -- end is responsible for unlocking any tables it may need to change,
+ -- and locking them again before returning.
procedure Scan_Compiler_Arguments;
-- Acquires command-line parameters passed to the compiler and processes
diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb
index 09354ecbcbb..7c81df9ffe6 100644
--- a/gcc/ada/bcheck.adb
+++ b/gcc/ada/bcheck.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -923,9 +923,9 @@ package body Bcheck is
and then ALIs.Table (ALIs.First).Allocator_In_Body
then
Cumulative_Restrictions.Violated
- (No_Allocators_After_Elaboration) := True;
+ (No_Standard_Allocators_After_Elaboration) := True;
ALIs.Table (ALIs.First).Restrictions.Violated
- (No_Allocators_After_Elaboration) := True;
+ (No_Standard_Allocators_After_Elaboration) := True;
end if;
-- Loop through all restriction violations
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 7afabd1c2c6..73aefb0698c 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -996,7 +996,7 @@ package body Checks is
elsif Dsiz <= Standard_Long_Long_Integer_Size then
Ctyp := Standard_Long_Long_Integer;
- -- No check type exists, use runtime call
+ -- No check type exists, use runtime call
else
if Nkind (N) = N_Op_Add then
@@ -3244,13 +3244,20 @@ package body Checks is
Reason => CE_Discriminant_Check_Failed));
end;
- -- For arrays, conversions are applied during expansion, to take into
- -- accounts changes of representation. The checks become range checks on
- -- the base type or length checks on the subtype, depending on whether
- -- the target type is unconstrained or constrained.
-
- else
- null;
+ -- For arrays, checks are set now, but conversions are applied during
+ -- expansion, to take into accounts changes of representation. The
+ -- checks become range checks on the base type or length checks on the
+ -- subtype, depending on whether the target type is unconstrained or
+ -- constrained. Note that the range check is put on the expression of a
+ -- type conversion, while the length check is put on the type conversion
+ -- itself.
+
+ elsif Is_Array_Type (Target_Type) then
+ if Is_Constrained (Target_Type) then
+ Set_Do_Length_Check (N);
+ else
+ Set_Do_Range_Check (Expr);
+ end if;
end if;
end Apply_Type_Conversion_Checks;
@@ -6221,6 +6228,7 @@ package body Checks is
procedure Insert_Valid_Check (Expr : Node_Id) is
Loc : constant Source_Ptr := Sloc (Expr);
+ Typ : constant Entity_Id := Etype (Expr);
Exp : Node_Id;
begin
@@ -6234,6 +6242,16 @@ package body Checks is
return;
end if;
+ -- Do not insert checks within a predicate function. This will arise
+ -- if the current unit and the predicate function are being compiled
+ -- with validity checks enabled.
+
+ if Present (Predicate_Function (Typ))
+ and then Current_Scope = Predicate_Function (Typ)
+ then
+ return;
+ end if;
+
-- If we have a checked conversion, then validity check applies to
-- the expression inside the conversion, not the result, since if
-- the expression inside is valid, then so is the conversion result.
@@ -6576,6 +6594,13 @@ package body Checks is
return;
end if;
+ -- No check needed in interface thunks since the runtime check is
+ -- already performed at the caller side.
+
+ if Is_Thunk (Current_Scope) then
+ return;
+ end if;
+
-- No check needed for the Get_Current_Excep.all.all idiom generated by
-- the expander within exception handlers, since we know that the value
-- can never be null.
diff --git a/gcc/ada/cio.c b/gcc/ada/cio.c
index ac23519ae9b..fd85df96923 100644
--- a/gcc/ada/cio.c
+++ b/gcc/ada/cio.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -40,6 +40,9 @@
#include "adaint.h"
+/* We need L_tmpnam definition */
+#include <stdio.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -135,7 +138,18 @@ put_char_stderr (int c)
char *
mktemp (char *template)
{
+#if !(defined (__RTP__) || defined (VTHREADS))
+ static char buf[L_tmpnam]; /* Internal buffer for name */
+
+ /* If parameter is NULL use internal buffer */
+ if (template == NULL)
+ template = buf;
+
+ __gnat_tmp_name (template);
+ return template;
+#else
return tmpnam (NULL);
+#endif
}
#endif
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb
index 9d9c4d457df..aa95c8d9bf3 100644
--- a/gcc/ada/clean.adb
+++ b/gcc/ada/clean.adb
@@ -1729,6 +1729,7 @@ package body Clean is
when 'f' =>
Force_Deletions := True;
+ Directories_Must_Exist_In_Projects := False;
when 'F' =>
Full_Path_Name_For_Brief_Errors := True;
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 82f8697bcb3..09c125dfdce 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -24,7 +24,6 @@
------------------------------------------------------------------------------
with Atree; use Atree;
-with Back_End; use Back_End;
with Csets; use Csets;
with Debug; use Debug;
with Einfo; use Einfo;
@@ -35,6 +34,7 @@ with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
+with Set_Targ; use Set_Targ;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
@@ -146,18 +146,19 @@ package body CStand is
-- Print representation of package Standard if switch set
procedure Register_Float_Type
- (Name : C_String; -- Nul-terminated string with name of type
- Digs : Natural; -- Nr or digits for floating point, 0 otherwise
- Complex : Boolean; -- True iff type has real and imaginary parts
- Count : Natural; -- Number of elements in vector, 0 otherwise
- Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
- Size : Positive; -- Size of representation in bits
- Alignment : Natural); -- Required alignment in bits
- pragma Convention (C, Register_Float_Type);
- -- Call back to allow the back end to register available types.
- -- This call back currently creates predefined floating point base types
- -- for any floating point types reported by the back end, and adds them
- -- to the list of predefined float types.
+ (Name : String;
+ Digs : Positive;
+ Float_Rep : Float_Rep_Kind;
+ Size : Positive;
+ Alignment : Natural);
+ -- Registers a single back end floating-point type (from FPT_Mode_Table in
+ -- Set_Targ). This will create a predefined floating-point base type for
+ -- one of the floating point types reported by the back end, and add it
+ -- to the list of predefined float types. Name is the name of the type
+ -- as a normal format (non-null-terminated) string. Digs is the number of
+ -- digits, which is always non-zero, since non-floating-point types were
+ -- filtered out earlier. Float_Rep indicates the kind of floating-point
+ -- type, and Size and Alignment are the size and alignment in bits.
procedure Set_Integer_Bounds
(Id : Entity_Id;
@@ -424,14 +425,20 @@ package body CStand is
Append (Decl, Decl_S);
end Build_Exception;
- ---------------------------
+ ---------------------------------
-- Create_Back_End_Float_Types --
- ---------------------------
+ ---------------------------------
procedure Create_Back_End_Float_Types is
begin
- Back_End_Float_Types := No_Elist;
- Register_Back_End_Types (Register_Float_Type'Access);
+ for J in 1 .. Num_FPT_Modes loop
+ declare
+ E : FPT_Mode_Entry renames FPT_Mode_Table (J);
+ begin
+ Register_Float_Type
+ (E.NAME.all, E.DIGS, E.FLOAT_REP, E.SIZE, E.ALIGNMENT);
+ end;
+ end loop;
end Create_Back_End_Float_Types;
------------------------
@@ -2009,107 +2016,29 @@ package body CStand is
-------------------------
procedure Register_Float_Type
- (Name : C_String;
- Digs : Natural;
- Complex : Boolean;
- Count : Natural;
+ (Name : String;
+ Digs : Positive;
Float_Rep : Float_Rep_Kind;
Size : Positive;
Alignment : Natural)
is
- T : String (1 .. Name'Length);
- Last : Natural := 0;
-
- procedure Dump;
- -- Dump information given by the back end for the type to register
-
- procedure Dump is
- begin
- Write_Str ("type " & T (1 .. Last) & " is ");
-
- if Count > 0 then
- Write_Str ("array (1 .. ");
- Write_Int (Int (Count));
-
- if Complex then
- Write_Str (", 1 .. 2");
- end if;
-
- Write_Str (") of ");
-
- elsif Complex then
- Write_Str ("array (1 .. 2) of ");
- end if;
-
- if Digs > 0 then
- Write_Str ("digits ");
- Write_Int (Int (Digs));
- Write_Line (";");
-
- Write_Str ("pragma Float_Representation (");
-
- case Float_Rep is
- when IEEE_Binary => Write_Str ("IEEE");
- when VAX_Native =>
- case Digs is
- when 6 => Write_Str ("VAXF");
- when 9 => Write_Str ("VAXD");
- when 15 => Write_Str ("VAXG");
- when others => Write_Str ("VAX_"); Write_Int (Int (Digs));
- end case;
- when AAMP => Write_Str ("AAMP");
- end case;
- Write_Line (", " & T & ");");
-
- else
- Write_Str ("mod 2**");
- Write_Int (Int (Size / Positive'Max (1, Count)));
- Write_Line (";");
- end if;
-
- Write_Str ("for " & T & "'Size use ");
- Write_Int (Int (Size));
- Write_Line (";");
-
- Write_Str ("for " & T & "'Alignment use ");
- Write_Int (Int (Alignment / 8));
- Write_Line (";");
- end Dump;
+ Ent : constant Entity_Id := New_Standard_Entity;
+ Esize : constant Pos :=
+ Pos ((Size + Alignment - 1) / Alignment * Alignment);
begin
- for J in T'Range loop
- T (J) := Name (Name'First + J - 1);
- if T (J) = ASCII.NUL then
- Last := J - 1;
- exit;
- end if;
- end loop;
-
- if Debug_Flag_Dot_B then
- Dump;
+ Set_Defining_Identifier (New_Node (N_Full_Type_Declaration, Stloc), Ent);
+ Make_Name (Ent, Name);
+ Set_Scope (Ent, Standard_Standard);
+ Build_Float_Type (Ent, Esize, Float_Rep, Pos (Digs));
+ Set_RM_Size (Ent, UI_From_Int (Int (Size)));
+ Set_Alignment (Ent, UI_From_Int (Int (Alignment / 8)));
+
+ if No (Back_End_Float_Types) then
+ Back_End_Float_Types := New_Elmt_List;
end if;
- if Digs > 0 and then not Complex and then Count = 0 then
- declare
- Ent : constant Entity_Id := New_Standard_Entity;
- Esize : constant Pos := Pos ((Size + Alignment - 1)
- / Alignment * Alignment);
- begin
- Set_Defining_Identifier
- (New_Node (N_Full_Type_Declaration, Stloc), Ent);
- Make_Name (Ent, T (1 .. Last));
- Set_Scope (Ent, Standard_Standard);
- Build_Float_Type (Ent, Esize, Float_Rep, Pos (Digs));
- Set_RM_Size (Ent, UI_From_Int (Int (Size)));
- Set_Alignment (Ent, UI_From_Int (Int (Alignment / 8)));
-
- if No (Back_End_Float_Types) then
- Back_End_Float_Types := New_Elmt_List;
- end if;
-
- Append_Elmt (Ent, Back_End_Float_Types);
- end;
- end if;
+ Append_Elmt (Ent, Back_End_Float_Types);
end Register_Float_Type;
----------------------
@@ -2118,10 +2047,8 @@ package body CStand is
procedure Set_Float_Bounds (Id : Entity_Id) is
L : Node_Id;
- -- Low bound of literal value
-
H : Node_Id;
- -- High bound of literal value
+ -- Low and high bounds of literal value
R : Node_Id;
-- Range specification
@@ -2166,9 +2093,12 @@ package body CStand is
Lb : Uint;
Hb : Uint)
is
- L : Node_Id; -- Low bound of literal value
- H : Node_Id; -- High bound of literal value
- R : Node_Id; -- Range specification
+ L : Node_Id;
+ H : Node_Id;
+ -- Low and high bounds of literal value
+
+ R : Node_Id;
+ -- Range specification
begin
L := Make_Integer (Lb);
diff --git a/gcc/ada/ctrl_c.c b/gcc/ada/ctrl_c.c
index a860b767cba..7f8d177d17c 100644
--- a/gcc/ada/ctrl_c.c
+++ b/gcc/ada/ctrl_c.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2002-2009, Free Software Foundation, Inc. *
+ * Copyright (C) 2002-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -50,7 +50,24 @@ void __gnat_uninstall_int_handler (void);
/* POSIX implementation */
#if (defined (__unix__) || defined (_AIX) || defined (__APPLE__)) \
- && !defined (__vxworks)
+ || defined (VMS) && !defined (__vxworks)
+
+#ifdef VMS
+/* On VMS _gnat_handle_vms_condition gets control first, and it has to
+ resignal the Ctrl/C in order for sigaction to gain control and execute
+ the user handler routine, but in doing so propagates the condition
+ causing the program to terminate. So instead we install a dummy handler
+ routine and put the real user handler in a special global variable so
+ that __gnat_handle_vms_condition can declare an AST to asynchronously
+ execute the Ctrl/C user handler at some future time and allow
+ __gnat_handle_vms_condition to return and not be held up waiting for
+ the potentially unbounded time required to execute the Crtl/C handler. */
+void
+dummy_handler () {}
+
+/* Lives in init.c. */
+extern void (*__gnat_ctrl_c_handler) (void);
+#endif
#include <signal.h>
@@ -75,8 +92,8 @@ __gnat_install_int_handler (void (*proc) (void))
if (sigint_intercepted == 0)
{
act.sa_handler = __gnat_int_handler;
-#if defined (__Lynx__)
- /* LynxOS does not support SA_RESTART. */
+#if defined (__Lynx__) || defined (VMS)
+ /* LynxOS and VMS do not support SA_RESTART. */
act.sa_flags = 0;
#else
act.sa_flags = SA_RESTART;
@@ -85,7 +102,12 @@ __gnat_install_int_handler (void (*proc) (void))
sigaction (SIGINT, &act, &original_act);
}
+#ifdef VMS
+ sigint_intercepted = &dummy_handler;
+ __gnat_ctrl_c_handler = proc;
+#else
sigint_intercepted = proc;
+#endif
}
/* Restore original handler */
@@ -98,6 +120,10 @@ __gnat_uninstall_int_handler (void)
sigaction (SIGINT, &original_act, 0);
sigint_intercepted = 0;
}
+#ifdef VMS
+ if (__gnat_ctrl_c_handler)
+ __gnat_ctrl_c_handler = 0;
+#endif
}
/* Windows implementation */
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index bcb6ee3322c..d0923fcd28a 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -124,17 +124,17 @@ package body Debug is
-- d.D Strict Alfa mode
-- d.E Force Alfa mode for gnat2why
-- d.F Alfa mode
- -- d.G Precondition only mode for gnat2why
+ -- d.G Frame condition mode for gnat2why
-- d.H Standard package only mode for gnat2why
- -- d.I SCIL generation mode
+ -- d.I Do not ignore enum representation clauses in CodePeer mode
-- d.J Disable parallel SCIL generation mode
-- d.K Alfa detection only mode for gnat2why
-- d.L Depend on back end for limited types in if and case expressions
- -- d.M
+ -- d.M Relaxed RM semantics
-- d.N Add node to all entities
-- d.O Dump internal SCO tables
-- d.P Previous (non-optimized) handling of length comparisons
- -- d.Q
+ -- d.Q Flow Analysis mode for gnat2why
-- d.R Restrictions in ali files in positional form
-- d.S Force Optimize_Alignment (Space)
-- d.T Force Optimize_Alignment (Time)
@@ -143,7 +143,7 @@ package body Debug is
-- d.W Print out debugging information for Walk_Library_Items
-- d.X Use Expression_With_Actions
-- d.Y Do not use Expression_With_Actions
- -- d.Z
+ -- d.Z Dump flow analysis graphs, for debugging purposes (gnat2why)
-- d1 Error msgs have node numbers where possible
-- d2 Eliminate error flags in verbose form error messages
@@ -603,19 +603,22 @@ package body Debug is
-- d.F Alfa mode. Generate AST in a form suitable for formal verification,
-- as well as additional cross reference information in ALI files to
- -- compute effects of subprograms.
+ -- compute effects of subprograms. Note that ALI files are only
+ -- written when option d.G is also given.
- -- d.G Precondition only mode for gnat2why. In this mode, gnat2why will
- -- only generate Why code that checks for the well-guardedness of
- -- preconditions.
+ -- d.G Frame condition mode for gnat2why. In this mode, gnat2why will not
+ -- generate Why code. Instead, it generates ALI files with an extra
+ -- section which contains the effects of subprograms.
-- d.H Standard package only mode for gnat2why. In this mode, gnat2why
-- will only generate Why code for package Standard. Any given input
-- file will be ignored.
- -- d.I Generate SCIL mode. Generate intermediate code for the sake of
- -- of static analysis tools, and ensure additional tree consistency
- -- between different compilations of specs.
+ -- d.I Do not ignore enum representation clauses in CodePeer mode.
+ -- The default of ignoring representation clauses for enumeration
+ -- types in CodePeer is good for the majority of Ada code, but in some
+ -- cases being able to change this default might be useful to remove
+ -- some false positives.
-- d.J Disable parallel SCIL generation. Normally SCIL file generation is
-- done in parallel to speed processing. This switch disables this
@@ -629,6 +632,9 @@ package body Debug is
-- case expansion, leaving it up to the back end to handle conditional
-- expressions correctly.
+ -- d.M Relaxed RM semantics. This flag sets Opt.Relaxed_RM_Semantics
+ -- See Opt.Relaxed_RM_Semantics for more details.
+
-- d.N Enlarge entities by one node (but don't attempt to use this extra
-- node for storage of any flags or fields). This can be used to do
-- experiments on the impact of increasing entity sizes.
@@ -642,6 +648,9 @@ package body Debug is
-- This is there in case we find a situation where the optimization
-- malfunctions, to provide a work around.
+ -- d.Q Flow Analysis mode for gnat2why. When this flag is given,
+ -- gnat2why will do flow analysis, and no translation to Why is done.
+
-- d.R As documented in lib-writ.ads, restrictions in the ali file can
-- have two forms, positional and named. The named notation is the
-- current preferred form, but the use of this debug switch will force
@@ -674,6 +683,11 @@ package body Debug is
-- forces use of the new N_Expression_With_Actions node in these other
-- cases and is intended for transitional use.
+ -- d.Z In gnat2why, in Flow analysis mode (-gnatd.Q), dump the different
+ -- graphs (control flow, control dependence) for debugging purposes.
+ -- This debug flag will be removed when flow analysis is sufficiently
+ -- stable.
+
-- d.Y Prevents the use of the N_Expression_With_Actions node even in the
-- case of the gcc back end. Provided as a back up in case the new
-- scheme has problems.
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 934dd27e25b..789a420704d 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -32,12 +32,13 @@
pragma Style_Checks (All_Checks);
-- Turn off subprogram ordering, not used for this unit
-with Atree; use Atree;
-with Namet; use Namet;
-with Nlists; use Nlists;
-with Output; use Output;
-with Sinfo; use Sinfo;
-with Stand; use Stand;
+with Aspects; use Aspects;
+with Atree; use Atree;
+with Namet; use Namet;
+with Nlists; use Nlists;
+with Output; use Output;
+with Sinfo; use Sinfo;
+with Stand; use Stand;
package body Einfo is
@@ -245,7 +246,7 @@ package body Einfo is
-- Corresponding_Equality Node30
-- Static_Initialization Node30
- -- (unused) Node31
+ -- Thunk_Entity Node31
-- (unused) Node32
@@ -542,12 +543,12 @@ package body Einfo is
-- Is_Processed_Transient Flag252
-- Has_Anonymous_Master Flag253
-- Is_Implementation_Defined Flag254
+ -- Is_Predicate_Function Flag255
+ -- Is_Predicate_Function_M Flag256
+ -- Is_Invariant_Procedure Flag257
+ -- Has_Dynamic_Predicate_Aspect Flag258
+ -- Has_Static_Predicate_Aspect Flag259
- -- (unused) Flag255
- -- (unused) Flag256
- -- (unused) Flag257
- -- (unused) Flag258
- -- (unused) Flag259
-- (unused) Flag260
-- (unused) Flag261
@@ -578,40 +579,8 @@ package body Einfo is
-- (unused) Flag284
-- (unused) Flag285
-- (unused) Flag286
- -- (unused) Flag287
- -- (unused) Flag288
- -- (unused) Flag289
- -- (unused) Flag290
-
- -- (unused) Flag291
- -- (unused) Flag292
- -- (unused) Flag293
- -- (unused) Flag294
- -- (unused) Flag295
- -- (unused) Flag296
- -- (unused) Flag297
- -- (unused) Flag298
- -- (unused) Flag299
- -- (unused) Flag300
-
- -- (unused) Flag301
- -- (unused) Flag302
- -- (unused) Flag303
- -- (unused) Flag304
- -- (unused) Flag305
- -- (unused) Flag306
- -- (unused) Flag307
- -- (unused) Flag308
- -- (unused) Flag309
- -- (unused) Flag310
-
- -- (unused) Flag311
- -- (unused) Flag312
- -- (unused) Flag313
- -- (unused) Flag314
- -- (unused) Flag315
- -- (unused) Flag316
- -- (unused) Flag317
+
+ -- Note: Flag287-317 are defined in atree.ads/adb, but not yet in atree.h
-----------------------
-- Local subprograms --
@@ -1426,6 +1395,12 @@ package body Einfo is
return Flag220 (Id);
end Has_Dispatch_Table;
+ function Has_Dynamic_Predicate_Aspect (Id : E) return B is
+ begin
+ pragma Assert (Is_Type (Id));
+ return Flag258 (Id);
+ end Has_Dynamic_Predicate_Aspect;
+
function Has_Enumeration_Rep_Clause (Id : E) return B is
begin
pragma Assert (Is_Enumeration_Type (Id));
@@ -1488,9 +1463,7 @@ package body Einfo is
function Has_Invariants (Id : E) return B is
begin
- pragma Assert (Is_Type (Id)
- or else Ekind (Id) = E_Procedure
- or else Ekind (Id) = E_Generic_Procedure);
+ pragma Assert (Is_Type (Id));
return Flag232 (Id);
end Has_Invariants;
@@ -1614,6 +1587,7 @@ package body Einfo is
function Has_Predicates (Id : E) return B is
begin
+ pragma Assert (Is_Type (Id));
return Flag250 (Id);
end Has_Predicates;
@@ -1702,6 +1676,12 @@ package body Einfo is
return Flag211 (Id);
end Has_Static_Discriminants;
+ function Has_Static_Predicate_Aspect (Id : E) return B is
+ begin
+ pragma Assert (Is_Type (Id));
+ return Flag259 (Id);
+ end Has_Static_Predicate_Aspect;
+
function Has_Storage_Size_Clause (Id : E) return B is
begin
pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
@@ -2076,6 +2056,12 @@ package body Einfo is
return Flag64 (Id);
end Is_Intrinsic_Subprogram;
+ function Is_Invariant_Procedure (Id : E) return B is
+ begin
+ pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+ return Flag257 (Id);
+ end Is_Invariant_Procedure;
+
function Is_Itype (Id : E) return B is
begin
return Flag91 (Id);
@@ -2167,6 +2153,18 @@ package body Einfo is
return Flag9 (Id);
end Is_Potentially_Use_Visible;
+ function Is_Predicate_Function (Id : E) return B is
+ begin
+ pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+ return Flag255 (Id);
+ end Is_Predicate_Function;
+
+ function Is_Predicate_Function_M (Id : E) return B is
+ begin
+ pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+ return Flag256 (Id);
+ end Is_Predicate_Function_M;
+
function Is_Preelaborated (Id : E) return B is
begin
return Flag59 (Id);
@@ -2286,7 +2284,6 @@ package body Einfo is
function Is_Thunk (Id : E) return B is
begin
- pragma Assert (Is_Subprogram (Id));
return Flag225 (Id);
end Is_Thunk;
@@ -2923,6 +2920,13 @@ package body Einfo is
return Node25 (Id);
end Task_Body_Procedure;
+ function Thunk_Entity (Id : E) return E is
+ begin
+ pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
+ and then Is_Thunk (Id));
+ return Node31 (Id);
+ end Thunk_Entity;
+
function Treat_As_Volatile (Id : E) return B is
begin
return Flag41 (Id);
@@ -3975,6 +3979,12 @@ package body Einfo is
Set_Flag220 (Id, V);
end Set_Has_Dispatch_Table;
+ procedure Set_Has_Dynamic_Predicate_Aspect (Id : E; V : B := True) is
+ begin
+ pragma Assert (Is_Type (Id));
+ Set_Flag258 (Id, V);
+ end Set_Has_Dynamic_Predicate_Aspect;
+
procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
begin
pragma Assert (Is_Enumeration_Type (Id));
@@ -4037,9 +4047,7 @@ package body Einfo is
procedure Set_Has_Invariants (Id : E; V : B := True) is
begin
- pragma Assert (Is_Type (Id)
- or else Ekind (Id) = E_Procedure
- or else Ekind (Id) = E_Void);
+ pragma Assert (Is_Type (Id));
Set_Flag232 (Id, V);
end Set_Has_Invariants;
@@ -4172,6 +4180,7 @@ package body Einfo is
procedure Set_Has_Predicates (Id : E; V : B := True) is
begin
+ pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Void);
Set_Flag250 (Id, V);
end Set_Has_Predicates;
@@ -4260,6 +4269,12 @@ package body Einfo is
Set_Flag211 (Id, V);
end Set_Has_Static_Discriminants;
+ procedure Set_Has_Static_Predicate_Aspect (Id : E; V : B := True) is
+ begin
+ pragma Assert (Is_Type (Id));
+ Set_Flag259 (Id, V);
+ end Set_Has_Static_Predicate_Aspect;
+
procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
begin
pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
@@ -4658,6 +4673,12 @@ package body Einfo is
Set_Flag64 (Id, V);
end Set_Is_Intrinsic_Subprogram;
+ procedure Set_Is_Invariant_Procedure (Id : E; V : B := True) is
+ begin
+ pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+ Set_Flag257 (Id, V);
+ end Set_Is_Invariant_Procedure;
+
procedure Set_Is_Itype (Id : E; V : B := True) is
begin
Set_Flag91 (Id, V);
@@ -4752,6 +4773,18 @@ package body Einfo is
Set_Flag9 (Id, V);
end Set_Is_Potentially_Use_Visible;
+ procedure Set_Is_Predicate_Function (Id : E; V : B := True) is
+ begin
+ pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+ Set_Flag255 (Id, V);
+ end Set_Is_Predicate_Function;
+
+ procedure Set_Is_Predicate_Function_M (Id : E; V : B := True) is
+ begin
+ pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+ Set_Flag256 (Id, V);
+ end Set_Is_Predicate_Function_M;
+
procedure Set_Is_Preelaborated (Id : E; V : B := True) is
begin
Set_Flag59 (Id, V);
@@ -4878,6 +4911,7 @@ package body Einfo is
procedure Set_Is_Thunk (Id : E; V : B := True) is
begin
+ pragma Assert (Is_Subprogram (Id));
Set_Flag225 (Id, V);
end Set_Is_Thunk;
@@ -5537,6 +5571,13 @@ package body Einfo is
Set_Node25 (Id, V);
end Set_Task_Body_Procedure;
+ procedure Set_Thunk_Entity (Id : E; V : E) is
+ begin
+ pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
+ and then Is_Thunk (Id));
+ Set_Node31 (Id, V);
+ end Set_Thunk_Entity;
+
procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
begin
Set_Flag41 (Id, V);
@@ -6403,7 +6444,7 @@ package body Einfo is
else
S := Subprograms_For_Type (Id);
while Present (S) loop
- if Has_Invariants (S) then
+ if Is_Invariant_Procedure (S) then
return S;
else
S := Subprograms_For_Type (S);
@@ -6533,10 +6574,31 @@ package body Einfo is
function Is_Finalizer (Id : E) return B is
begin
- return Ekind (Id) = E_Procedure
- and then Chars (Id) = Name_uFinalizer;
+ return Ekind (Id) = E_Procedure and then Chars (Id) = Name_uFinalizer;
end Is_Finalizer;
+ -----------------------
+ -- Is_Ghost_Function --
+ -----------------------
+
+ function Is_Ghost_Function (Id : E) return B is
+ Subp_Id : Entity_Id := Id;
+
+ begin
+ if Present (Subp_Id) and then Ekind (Subp_Id) = E_Function then
+
+ -- Handle renamings of functions
+
+ if Present (Alias (Subp_Id)) then
+ Subp_Id := Alias (Subp_Id);
+ end if;
+
+ return Has_Aspect (Subp_Id, Aspect_Ghost);
+ end if;
+
+ return False;
+ end Is_Ghost_Function;
+
--------------------
-- Is_Input_State --
--------------------
@@ -6554,8 +6616,7 @@ package body Einfo is
function Is_Null_State (Id : E) return B is
begin
return
- Ekind (Id) = E_Abstract_State
- and then Nkind (Parent (Id)) = N_Null;
+ Ekind (Id) = E_Abstract_State and then Nkind (Parent (Id)) = N_Null;
end Is_Null_State;
---------------------
@@ -6574,10 +6635,7 @@ package body Einfo is
function Is_Package_Or_Generic_Package (Id : E) return B is
begin
- return
- Ekind (Id) = E_Package
- or else
- Ekind (Id) = E_Generic_Package;
+ return Ekind_In (Id, E_Generic_Package, E_Package);
end Is_Package_Or_Generic_Package;
---------------
@@ -6596,8 +6654,7 @@ package body Einfo is
function Is_Protected_Component (Id : E) return B is
begin
- return Ekind (Id) = E_Component
- and then Is_Protected_Type (Scope (Id));
+ return Ekind (Id) = E_Component and then Is_Protected_Type (Scope (Id));
end Is_Protected_Component;
----------------------------
@@ -7121,7 +7178,7 @@ package body Einfo is
else
S := Subprograms_For_Type (Id);
while Present (S) loop
- if Has_Predicates (S) then
+ if Is_Predicate_Function (S) then
return S;
else
S := Subprograms_For_Type (S);
@@ -7132,6 +7189,33 @@ package body Einfo is
end if;
end Predicate_Function;
+ --------------------------
+ -- Predicate_Function_M --
+ --------------------------
+
+ function Predicate_Function_M (Id : E) return E is
+ S : Entity_Id;
+
+ begin
+ pragma Assert (Is_Type (Id));
+
+ if No (Subprograms_For_Type (Id)) then
+ return Empty;
+
+ else
+ S := Subprograms_For_Type (Id);
+ while Present (S) loop
+ if Is_Predicate_Function_M (S) then
+ return S;
+ else
+ S := Subprograms_For_Type (S);
+ end if;
+ end loop;
+
+ return Empty;
+ end if;
+ end Predicate_Function_M;
+
-------------------------
-- Present_In_Rep_Item --
-------------------------
@@ -7365,8 +7449,10 @@ package body Einfo is
Set_Subprograms_For_Type (Id, V);
Set_Subprograms_For_Type (V, S);
+ -- Check for duplicate entry
+
while Present (S) loop
- if Has_Invariants (S) then
+ if Is_Invariant_Procedure (S) then
raise Program_Error;
else
S := Subprograms_For_Type (S);
@@ -7389,7 +7475,7 @@ package body Einfo is
Set_Subprograms_For_Type (V, S);
while Present (S) loop
- if Has_Predicates (S) then
+ if Is_Predicate_Function (S) then
raise Program_Error;
else
S := Subprograms_For_Type (S);
@@ -7397,6 +7483,31 @@ package body Einfo is
end loop;
end Set_Predicate_Function;
+ ------------------------------
+ -- Set_Predicate_Function_M --
+ ------------------------------
+
+ procedure Set_Predicate_Function_M (Id : E; V : E) is
+ S : Entity_Id;
+
+ begin
+ pragma Assert (Is_Type (Id) and then Has_Predicates (Id));
+
+ S := Subprograms_For_Type (Id);
+ Set_Subprograms_For_Type (Id, V);
+ Set_Subprograms_For_Type (V, S);
+
+ -- Check for duplicates
+
+ while Present (S) loop
+ if Is_Predicate_Function_M (S) then
+ raise Program_Error;
+ else
+ S := Subprograms_For_Type (S);
+ end if;
+ end loop;
+ end Set_Predicate_Function_M;
+
-----------------
-- Size_Clause --
-----------------
@@ -7672,6 +7783,8 @@ package body Einfo is
W ("Has_Delayed_Aspects", Flag200 (Id));
W ("Has_Delayed_Freeze", Flag18 (Id));
W ("Has_Discriminants", Flag5 (Id));
+ W ("Has_Dispatch_Table", Flag220 (Id));
+ W ("Has_Dynamic_Predicate_Aspect", Flag258 (Id));
W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
W ("Has_Exit", Flag47 (Id));
W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
@@ -7721,6 +7834,7 @@ package body Einfo is
W ("Has_Specified_Stream_Read", Flag192 (Id));
W ("Has_Specified_Stream_Write", Flag193 (Id));
W ("Has_Static_Discriminants", Flag211 (Id));
+ W ("Has_Static_Predicate_Aspect", Flag259 (Id));
W ("Has_Storage_Size_Clause", Flag23 (Id));
W ("Has_Stream_Size_Clause", Flag184 (Id));
W ("Has_Task", Flag30 (Id));
@@ -7783,6 +7897,7 @@ package body Einfo is
W ("Is_Internal", Flag17 (Id));
W ("Is_Interrupt_Handler", Flag89 (Id));
W ("Is_Intrinsic_Subprogram", Flag64 (Id));
+ W ("Is_Invariant_Procedure", Flag257 (Id));
W ("Is_Itype", Flag91 (Id));
W ("Is_Known_Non_Null", Flag37 (Id));
W ("Is_Known_Null", Flag204 (Id));
@@ -7800,6 +7915,8 @@ package body Einfo is
W ("Is_Packed", Flag51 (Id));
W ("Is_Packed_Array_Type", Flag138 (Id));
W ("Is_Potentially_Use_Visible", Flag9 (Id));
+ W ("Is_Predicate_Function", Flag255 (Id));
+ W ("Is_Predicate_Function_M", Flag256 (Id));
W ("Is_Preelaborated", Flag59 (Id));
W ("Is_Primitive", Flag218 (Id));
W ("Is_Primitive_Wrapper", Flag195 (Id));
@@ -8900,7 +9017,8 @@ package body Einfo is
E_Variable =>
Write_Str ("Related_Type");
- when E_Procedure =>
+ when E_Procedure |
+ E_Function =>
Write_Str ("Wrapped_Entity");
when others =>
@@ -8974,6 +9092,10 @@ package body Einfo is
procedure Write_Field31_Name (Id : Entity_Id) is
begin
case Ekind (Id) is
+ when E_Procedure |
+ E_Function =>
+ Write_Str ("Thunk_Entity");
+
when others =>
Write_Str ("Field31??");
end case;
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 8616333a0a8..62ae8bf5d0e 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -1230,7 +1230,7 @@ package Einfo is
-- the same structure for constrained and unconstrained arrays, subtype
-- marks and discrete ranges are both represented by a subtype. This
-- function returns the tree node corresponding to an occurrence of the
--- first index (NOT the entity for the type). Subsequent indexes are
+-- first index (NOT the entity for the type). Subsequent indices are
-- obtained using Next_Index. Note that this field is defined for the
-- case of string literal subtypes, but is always Empty.
@@ -1487,6 +1487,14 @@ package Einfo is
-- of the table); otherwise the code that builds the table is added at
-- the end of the list of declarations of the package.
+-- Has_Dynamic_Predicate_Aspect (Flag258)
+-- Defined in all types and subtypes. Set if a Dynamic_Predicate aspect
+-- applies to the type. Note that we can tell if a dynamic predicate is
+-- present by looking at Has_Predicates and Static_Predicate, but that
+-- could have come from a Predicate aspect or pragma, and we need to
+-- record the difference so that we can use the right set of check
+-- policies to figure out if the predicate is active.
+
-- Has_Entries (synthesized)
-- Applies to concurrent types. True if any entries are declared
-- within the task or protected definition for the type.
@@ -1587,9 +1595,7 @@ package Einfo is
-- True, then usually the Invariant_Procedure attribute is set once the
-- type is frozen, however this may not be true in some error situations.
-- Note that it might be the full type which has inheritable invariants,
--- and then the flag will also be set in the private type. Also set in
--- the invariant procedure entity, to distinguish it among entries in the
--- Subprograms_For_Type.
+-- and then the flag will also be set in the private type.
-- Has_Machine_Radix_Clause (Flag83)
-- Defined in decimal types and subtypes, set if a Machine_Radix
@@ -1731,11 +1737,9 @@ package Einfo is
-- such an object and no warning is generated.
-- Has_Predicates (Flag250)
--- Defined in all entities. Set in type and subtype entities if a pragma
--- Predicate or Predicate aspect applies to the type, or if it inherits a
--- Predicate aspect from its parent or progenitor types. Also set in the
--- predicate function entity, to distinguish it among entries in the
--- Subprograms_For_Type.
+-- Defined in type and subtype entities. Set if a pragma Predicate or
+-- Predicate aspect applies to the type or subtype, or if it inherits a
+-- Predicate aspect from its parent or progenitor types.
-- Has_Primitive_Operations (Flag120) [base type only]
-- Defined in all type entities. Set if at least one primitive operation
@@ -1821,6 +1825,14 @@ package Einfo is
-- case of a variant record, the component list can be trimmed down to
-- include only the components corresponding to these discriminants.
+-- Has_Static_Predicate_Aspect (Flag259)
+-- Defined in all types and subtypes. Set if a Dynamic_Predicate aspect
+-- applies to the type. Note that we can tell if a static predicate is
+-- present by looking at Has_Predicates and Static_Predicate, but that
+-- could have come from a Predicate aspect or pragma, and we need to
+-- record the difference so that we can use the right set of check
+-- policies to figure out if the predicate is active.
+
-- Has_Storage_Size_Clause (Flag23) [implementation base type only]
-- Defined in task types and access types. It is set if a Storage_Size
-- clause is present for the type. Used to prevent multiple clauses for
@@ -2296,6 +2308,10 @@ package Einfo is
-- package, generic function, generic procedure), and False for all
-- other entities.
+-- Is_Ghost_Function (synthesized)
+-- Applies to all entities. Yields True for a function marked by aspect
+-- Ghost.
+
-- Is_Hidden (Flag57)
-- Defined in all entities. Set true for all entities declared in the
-- private part or body of a package. Also marks generic formals of a
@@ -2406,6 +2422,10 @@ package Einfo is
-- setting of Is_Intrinsic_Subprogram, NOT simply having convention set
-- to intrinsic, which causes intrinsic code to be generated.
+-- Is_Invariant_Procedure (Flag257)
+-- Defined in functions an procedures. Set for a generated invariant
+-- procedure to identify it easily in the
+
-- Is_Itype (Flag91)
-- Defined in all entities. Set to indicate that a type is an Itype,
-- which means that the declaration for the type does not appear
@@ -2637,6 +2657,15 @@ package Einfo is
-- use clause (RM 8.4(8)). Note that potentially use visible entities
-- are not necessarily use visible (RM 8.4(9-11)).
+-- Is_Predicate_Function (Flag255)
+-- Present in functions and procedures. Set for generated predicate
+-- functions.
+
+-- Is_Predicate_Function_M (Flag256)
+-- Present in functions and procedures. Set for special version of
+-- predicate function generated for use in membership tests, where
+-- raise expressions are transformed to return False.
+
-- Is_Preelaborated (Flag59)
-- Defined in all entities, set in E_Package and E_Generic_Package
-- entities to which a pragma Preelaborate is applied, and also in
@@ -2834,14 +2863,17 @@ package Einfo is
-- Applies to all entities. True for task types and subtypes
-- Is_Thunk (Flag225)
--- Defined in all entities for subprograms (functions, procedures, and
--- operators). True for subprograms that are thunks, that is small
--- subprograms built by the expander for tagged types that cover
--- interface types. At run-time thunks displace the pointer to the object
--- (pointer named "this" in the C++ terminology) from a secondary
--- dispatch table to the primary dispatch table associated with a given
--- tagged type. Set by Expand_Interface_Thunk and used by Expand_Call to
--- handle extra actuals associated with accessibility level.
+-- Defined in all entities. True for subprograms that are thunks: that is
+-- small subprograms built by the expander for tagged types that cover
+-- interface types. As part of the runtime call to an interface, thunks
+-- displace the pointer to the object (pointer named "this" in the C++
+-- terminology) from a secondary dispatch table to the primary dispatch
+-- table associated with a given tagged type; if the thunk is a function
+-- that returns an object which covers an interface type then the thunk
+-- displaces the pointer to the object from the primary dispatch table to
+-- the secondary dispatch table associated with the interface type. Set
+-- by Expand_Interface_Thunk and used by Expand_Call to handle extra
+-- actuals associated with accessibility level.
-- Is_Trivial_Subprogram (Flag235)
-- Defined in all entities. Set in subprograms where either the body
@@ -3384,6 +3416,12 @@ package Einfo is
-- Note: the reason this is marked as a synthesized attribute is that the
-- way this is stored is as an element of the Subprograms_For_Type field.
+-- Predicate_Function_M (synthesized)
+-- Defined in all types. Present only if Predicate_Function is present,
+-- and only if the predicate function has Raise_Expression nodes. It
+-- is the special version created for membership tests, where if one of
+-- these raise expressions is executed, the result is to return False.
+
-- Primitive_Operations (synthesized)
-- Defined in concurrent types, tagged record types and subtypes, tagged
-- private types and tagged incomplete types. For concurrent types whose
@@ -3835,6 +3873,10 @@ package Einfo is
-- The last sentence is odd??? Why not have Task_Body_Procedure go to the
-- Underlying_Type of the Root_Type???
+-- Thunk_Entity (Node31)
+-- Defined in functions and procedures which have been classified as
+-- Is_Thunk. Set to the target entity called by the thunk.
+
-- Treat_As_Volatile (Flag41)
-- Defined in all type entities, and also in constants, components and
-- variables. Set if this entity is to be treated as volatile for code
@@ -4813,7 +4855,7 @@ package Einfo is
-- non-synthesized attributes, of the corresponding set procedures) are
-- in the Einfo body.
- -- The following attributes apply to all entities
+ -- The following attributes are defined in all entities
-- Ekind (Ekind)
@@ -4844,7 +4886,6 @@ package Einfo is
-- Has_Pragma_Thread_Local_Storage (Flag169)
-- Has_Pragma_Unmodified (Flag233)
-- Has_Pragma_Unreferenced (Flag180)
- -- Has_Predicates (Flag250)
-- Has_Private_Declaration (Flag155)
-- Has_Qualified_Name (Flag161)
-- Has_Stream_Size_Clause (Flag184)
@@ -4895,6 +4936,7 @@ package Einfo is
-- Is_Shared_Passive (Flag60)
-- Is_Statically_Allocated (Flag28)
-- Is_Tagged_Type (Flag55)
+ -- Is_Thunk (Flag225)
-- Is_Trivial_Subprogram (Flag235)
-- Is_Unchecked_Union (Flag117)
-- Is_Visible_Formal (Flag206)
@@ -4954,6 +4996,7 @@ package Einfo is
-- Has_Controlled_Component (Flag43) (base type only)
-- Has_Default_Aspect (Flag39) (base type only)
-- Has_Discriminants (Flag5)
+ -- Has_Dynamic_Predicate_Aspect (Flag258)
-- Has_Independent_Components (Flag34) (base type only)
-- Has_Inheritable_Invariants (Flag248)
-- Has_Invariants (Flag232)
@@ -4961,6 +5004,7 @@ package Einfo is
-- Has_Object_Size_Clause (Flag172)
-- Has_Pragma_Preelab_Init (Flag221)
-- Has_Pragma_Unreferenced_Objects (Flag212)
+ -- Has_Predicates (Flag250)
-- Has_Primitive_Operations (Flag120) (base type only)
-- Has_Size_Clause (Flag29)
-- Has_Specified_Layout (Flag100) (base type only)
@@ -4968,6 +5012,7 @@ package Einfo is
-- Has_Specified_Stream_Output (Flag191)
-- Has_Specified_Stream_Read (Flag192)
-- Has_Specified_Stream_Write (Flag193)
+ -- Has_Static_Predicate_Aspect (Flag259)
-- Has_Task (Flag30) (base type only)
-- Has_Unchecked_Union (Flag123) (base type only)
-- Has_Volatile_Components (Flag87) (base type only)
@@ -5006,6 +5051,7 @@ package Einfo is
-- Invariant_Procedure (synth)
-- Is_Access_Protected_Subprogram_Type (synth)
-- Predicate_Function (synth)
+ -- Predicate_Function_M (synth)
-- Root_Type (synth)
-- Size_Clause (synth)
@@ -5338,6 +5384,7 @@ package Einfo is
-- Extra_Formals (Node28)
-- Subprograms_For_Type (Node29)
-- Corresponding_Equality (Node30) (implicit /= only)
+ -- Thunk_Entity (Node31) (thunk case only)
-- Body_Needed_For_SAL (Flag40)
-- Elaboration_Entity_Required (Flag174)
-- Default_Expressions_Processed (Flag108)
@@ -5360,13 +5407,15 @@ package Einfo is
-- Is_Eliminated (Flag124)
-- Is_Instantiated (Flag126) (generic case only)
-- Is_Intrinsic_Subprogram (Flag64)
+ -- Is_Invariant_Procedure (Flag257) (non-generic case only)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
+ -- Is_Predicate_Function (Flag255) (non-generic case only)
+ -- Is_Predicate_Function_M (Flag256) (non-generic case only)
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
- -- Is_Thunk (Flag225)
-- Is_Visible_Lib_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
-- Requires_Overriding (Flag213) (non-generic case only)
@@ -5377,6 +5426,7 @@ package Einfo is
-- Address_Clause (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
+ -- Is_Ghost_Function (synth) (non-generic case only)
-- Last_Formal (synth)
-- Number_Formals (synth)
-- Scope_Depth (synth)
@@ -5491,7 +5541,6 @@ package Einfo is
-- Is_Pure (Flag44)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Primitive (Flag218)
- -- Is_Thunk (Flag225)
-- Default_Expressions_Processed (Flag108)
-- Aren't there more flags and fields? seems like this list should be
-- more similar to the E_Function list, which is much longer ???
@@ -5607,6 +5656,7 @@ package Einfo is
-- Wrapped_Entity (Node27) (non-generic case only)
-- Extra_Formals (Node28)
-- Static_Initialization (Node30) (init_proc only)
+ -- Thunk_Entity (Node31) (thunk case only)
-- Body_Needed_For_SAL (Flag40)
-- Delay_Cleanups (Flag114)
-- Discard_Names (Flag88)
@@ -5629,14 +5679,16 @@ package Einfo is
-- Is_Instantiated (Flag126) (generic case only)
-- Is_Interrupt_Handler (Flag89)
-- Is_Intrinsic_Subprogram (Flag64)
+ -- Is_Invariant_Procedure (Flag257) (non-generic case only)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Null_Init_Proc (Flag178)
+ -- Is_Predicate_Function (Flag255) (non-generic case only)
+ -- Is_Predicate_Function_M (Flag256) (non-generic case only)
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
- -- Is_Thunk (Flag225)
-- Is_Valued_Procedure (Flag127)
-- Is_Visible_Lib_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
@@ -6213,6 +6265,7 @@ package Einfo is
function Has_Delayed_Freeze (Id : E) return B;
function Has_Discriminants (Id : E) return B;
function Has_Dispatch_Table (Id : E) return B;
+ function Has_Dynamic_Predicate_Aspect (Id : E) return B;
function Has_Enumeration_Rep_Clause (Id : E) return B;
function Has_Exit (Id : E) return B;
function Has_External_Tag_Rep_Clause (Id : E) return B;
@@ -6251,6 +6304,7 @@ package Einfo is
function Has_Predicates (Id : E) return B;
function Has_Primitive_Operations (Id : E) return B;
function Has_Private_Ancestor (Id : E) return B;
+ function Has_Private_Declaration (Id : E) return B;
function Has_Qualified_Name (Id : E) return B;
function Has_RACW (Id : E) return B;
function Has_Record_Rep_Clause (Id : E) return B;
@@ -6263,6 +6317,7 @@ package Einfo is
function Has_Specified_Stream_Read (Id : E) return B;
function Has_Specified_Stream_Write (Id : E) return B;
function Has_Static_Discriminants (Id : E) return B;
+ function Has_Static_Predicate_Aspect (Id : E) return B;
function Has_Storage_Size_Clause (Id : E) return B;
function Has_Stream_Size_Clause (Id : E) return B;
function Has_Task (Id : E) return B;
@@ -6327,6 +6382,7 @@ package Einfo is
function Is_Internal (Id : E) return B;
function Is_Interrupt_Handler (Id : E) return B;
function Is_Intrinsic_Subprogram (Id : E) return B;
+ function Is_Invariant_Procedure (Id : E) return B;
function Is_Itype (Id : E) return B;
function Is_Known_Non_Null (Id : E) return B;
function Is_Known_Null (Id : E) return B;
@@ -6344,6 +6400,8 @@ package Einfo is
function Is_Packed (Id : E) return B;
function Is_Packed_Array_Type (Id : E) return B;
function Is_Potentially_Use_Visible (Id : E) return B;
+ function Is_Predicate_Function (Id : E) return B;
+ function Is_Predicate_Function_M (Id : E) return B;
function Is_Preelaborated (Id : E) return B;
function Is_Primitive (Id : E) return B;
function Is_Primitive_Wrapper (Id : E) return B;
@@ -6476,6 +6534,7 @@ package Einfo is
function Suppress_Style_Checks (Id : E) return B;
function Suppress_Value_Tracking_On_Call (Id : E) return B;
function Task_Body_Procedure (Id : E) return N;
+ function Thunk_Entity (Id : E) return E;
function Treat_As_Volatile (Id : E) return B;
function Underlying_Full_View (Id : E) return E;
function Underlying_Record_View (Id : E) return E;
@@ -6570,7 +6629,6 @@ package Einfo is
function Has_Attach_Handler (Id : E) return B;
function Has_Entries (Id : E) return B;
function Has_Foreign_Convention (Id : E) return B;
- function Has_Private_Declaration (Id : E) return B;
function Implementation_Base_Type (Id : E) return E;
function Is_Base_Type (Id : E) return B;
function Is_Boolean_Type (Id : E) return B;
@@ -6578,6 +6636,7 @@ package Einfo is
function Is_Discriminal (Id : E) return B;
function Is_Dynamic_Scope (Id : E) return B;
function Is_Finalizer (Id : E) return B;
+ function Is_Ghost_Function (Id : E) return B;
function Is_Input_State (Id : E) return B;
function Is_Null_State (Id : E) return B;
function Is_Output_State (Id : E) return B;
@@ -6814,6 +6873,7 @@ package Einfo is
procedure Set_Has_Delayed_Freeze (Id : E; V : B := True);
procedure Set_Has_Discriminants (Id : E; V : B := True);
procedure Set_Has_Dispatch_Table (Id : E; V : B := True);
+ procedure Set_Has_Dynamic_Predicate_Aspect (Id : E; V : B := True);
procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True);
procedure Set_Has_Exit (Id : E; V : B := True);
procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True);
@@ -6864,6 +6924,7 @@ package Einfo is
procedure Set_Has_Specified_Stream_Read (Id : E; V : B := True);
procedure Set_Has_Specified_Stream_Write (Id : E; V : B := True);
procedure Set_Has_Static_Discriminants (Id : E; V : B := True);
+ procedure Set_Has_Static_Predicate_Aspect (Id : E; V : B := True);
procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Task (Id : E; V : B := True);
@@ -6933,6 +6994,7 @@ package Einfo is
procedure Set_Is_Internal (Id : E; V : B := True);
procedure Set_Is_Interrupt_Handler (Id : E; V : B := True);
procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True);
+ procedure Set_Is_Invariant_Procedure (Id : E; V : B := True);
procedure Set_Is_Itype (Id : E; V : B := True);
procedure Set_Is_Known_Non_Null (Id : E; V : B := True);
procedure Set_Is_Known_Null (Id : E; V : B := True);
@@ -6951,6 +7013,8 @@ package Einfo is
procedure Set_Is_Packed (Id : E; V : B := True);
procedure Set_Is_Packed_Array_Type (Id : E; V : B := True);
procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True);
+ procedure Set_Is_Predicate_Function (Id : E; V : B := True);
+ procedure Set_Is_Predicate_Function_M (Id : E; V : B := True);
procedure Set_Is_Preelaborated (Id : E; V : B := True);
procedure Set_Is_Primitive (Id : E; V : B := True);
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True);
@@ -7083,6 +7147,7 @@ package Einfo is
procedure Set_Suppress_Style_Checks (Id : E; V : B := True);
procedure Set_Suppress_Value_Tracking_On_Call (Id : E; V : B := True);
procedure Set_Task_Body_Procedure (Id : E; V : N);
+ procedure Set_Thunk_Entity (Id : E; V : E);
procedure Set_Treat_As_Volatile (Id : E; V : B := True);
procedure Set_Underlying_Full_View (Id : E; V : E);
procedure Set_Underlying_Record_View (Id : E; V : E);
@@ -7104,9 +7169,11 @@ package Einfo is
function Invariant_Procedure (Id : E) return N;
function Predicate_Function (Id : E) return N;
+ function Predicate_Function_M (Id : E) return N;
procedure Set_Invariant_Procedure (Id : E; V : E);
procedure Set_Predicate_Function (Id : E; V : E);
+ procedure Set_Predicate_Function_M (Id : E; V : E);
-----------------------------------
-- Field Initialization Routines --
@@ -7505,6 +7572,7 @@ package Einfo is
pragma Inline (Has_Delayed_Freeze);
pragma Inline (Has_Discriminants);
pragma Inline (Has_Dispatch_Table);
+ pragma Inline (Has_Dynamic_Predicate_Aspect);
pragma Inline (Has_Enumeration_Rep_Clause);
pragma Inline (Has_Exit);
pragma Inline (Has_External_Tag_Rep_Clause);
@@ -7555,6 +7623,7 @@ package Einfo is
pragma Inline (Has_Specified_Stream_Read);
pragma Inline (Has_Specified_Stream_Write);
pragma Inline (Has_Static_Discriminants);
+ pragma Inline (Has_Static_Predicate_Aspect);
pragma Inline (Has_Storage_Size_Clause);
pragma Inline (Has_Stream_Size_Clause);
pragma Inline (Has_Task);
@@ -7649,6 +7718,7 @@ package Einfo is
pragma Inline (Is_Internal);
pragma Inline (Is_Interrupt_Handler);
pragma Inline (Is_Intrinsic_Subprogram);
+ pragma Inline (Is_Invariant_Procedure);
pragma Inline (Is_Itype);
pragma Inline (Is_Known_Non_Null);
pragma Inline (Is_Known_Null);
@@ -7673,6 +7743,8 @@ package Einfo is
pragma Inline (Is_Packed);
pragma Inline (Is_Packed_Array_Type);
pragma Inline (Is_Potentially_Use_Visible);
+ pragma Inline (Is_Predicate_Function);
+ pragma Inline (Is_Predicate_Function_M);
pragma Inline (Is_Preelaborated);
pragma Inline (Is_Primitive);
pragma Inline (Is_Primitive_Wrapper);
@@ -7816,6 +7888,7 @@ package Einfo is
pragma Inline (Suppress_Style_Checks);
pragma Inline (Suppress_Value_Tracking_On_Call);
pragma Inline (Task_Body_Procedure);
+ pragma Inline (Thunk_Entity);
pragma Inline (Treat_As_Volatile);
pragma Inline (Underlying_Full_View);
pragma Inline (Underlying_Record_View);
@@ -7956,6 +8029,7 @@ package Einfo is
pragma Inline (Set_Has_Delayed_Freeze);
pragma Inline (Set_Has_Discriminants);
pragma Inline (Set_Has_Dispatch_Table);
+ pragma Inline (Set_Has_Dynamic_Predicate_Aspect);
pragma Inline (Set_Has_Enumeration_Rep_Clause);
pragma Inline (Set_Has_Exit);
pragma Inline (Set_Has_External_Tag_Rep_Clause);
@@ -8006,6 +8080,7 @@ package Einfo is
pragma Inline (Set_Has_Specified_Stream_Read);
pragma Inline (Set_Has_Specified_Stream_Write);
pragma Inline (Set_Has_Static_Discriminants);
+ pragma Inline (Set_Has_Static_Predicate_Aspect);
pragma Inline (Set_Has_Storage_Size_Clause);
pragma Inline (Set_Has_Stream_Size_Clause);
pragma Inline (Set_Has_Task);
@@ -8074,6 +8149,7 @@ package Einfo is
pragma Inline (Set_Is_Internal);
pragma Inline (Set_Is_Interrupt_Handler);
pragma Inline (Set_Is_Intrinsic_Subprogram);
+ pragma Inline (Set_Is_Invariant_Procedure);
pragma Inline (Set_Is_Itype);
pragma Inline (Set_Is_Known_Non_Null);
pragma Inline (Set_Is_Known_Null);
@@ -8092,6 +8168,8 @@ package Einfo is
pragma Inline (Set_Is_Packed);
pragma Inline (Set_Is_Packed_Array_Type);
pragma Inline (Set_Is_Potentially_Use_Visible);
+ pragma Inline (Set_Is_Predicate_Function);
+ pragma Inline (Set_Is_Predicate_Function_M);
pragma Inline (Set_Is_Preelaborated);
pragma Inline (Set_Is_Primitive);
pragma Inline (Set_Is_Primitive_Wrapper);
@@ -8224,6 +8302,7 @@ package Einfo is
pragma Inline (Set_Suppress_Style_Checks);
pragma Inline (Set_Suppress_Value_Tracking_On_Call);
pragma Inline (Set_Task_Body_Procedure);
+ pragma Inline (Set_Thunk_Entity);
pragma Inline (Set_Treat_As_Volatile);
pragma Inline (Set_Underlying_Full_View);
pragma Inline (Set_Underlying_Record_View);
diff --git a/gcc/ada/elists.adb b/gcc/ada/elists.adb
index 58beb00d572..6170585272e 100644
--- a/gcc/ada/elists.adb
+++ b/gcc/ada/elists.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -158,6 +158,28 @@ package body Elists is
end loop;
end Append_Unique_Elmt;
+ --------------
+ -- Contains --
+ --------------
+
+ function Contains (List : Elist_Id; N : Node_Or_Entity_Id) return Boolean is
+ Elmt : Elmt_Id;
+
+ begin
+ if Present (List) then
+ Elmt := First_Elmt (List);
+ while Present (Elmt) loop
+ if Node (Elmt) = N then
+ return True;
+ end if;
+
+ Next_Elmt (Elmt);
+ end loop;
+ end if;
+
+ return False;
+ end Contains;
+
--------------------
-- Elists_Address --
--------------------
diff --git a/gcc/ada/elists.ads b/gcc/ada/elists.ads
index 0e9a2a2f33f..8f66e0553bf 100644
--- a/gcc/ada/elists.ads
+++ b/gcc/ada/elists.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -153,6 +153,10 @@ package Elists is
-- affected, but the space used by the list element may be (but is not
-- required to be) freed for reuse in a subsequent Append_Elmt call.
+ function Contains (List : Elist_Id; N : Node_Or_Entity_Id) return Boolean;
+ -- Perform a sequential search to determine whether the given list contains
+ -- a node or an entity.
+
function No (List : Elist_Id) return Boolean;
pragma Inline (No);
-- Tests given Id for equality with No_Elist. This allows notations like
diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads
index 1dd232bed6e..f53c3e032cd 100644
--- a/gcc/ada/errout.ads
+++ b/gcc/ada/errout.ads
@@ -222,7 +222,7 @@ package Errout is
-- A second ^ may occur in the message, in which case it is replaced
-- by the decimal conversion of the Uint value in Error_Msg_Uint_2.
- -- Insertion character > (Right bracket, run time name)
+ -- Insertion character > (Greater Than, run time name)
-- The character > is replaced by a string of the form (name) if
-- Targparm scanned out a Run_Time_Name (see package Targparm for
-- details). The name is enclosed in parentheses and output in mixed
@@ -242,7 +242,7 @@ package Errout is
-- messages starting with the \ insertion character). The effect of the
-- use of ! in a parent message automatically applies to all of its
-- continuation messages (since we clearly don't want any case in which
- -- continuations are separated from the parent message. It is allowable
+ -- continuations are separated from the main message). It is allowable
-- to put ! in continuation messages, and the usual style is to include
-- it, since it makes it clear that the continuation is part of an
-- unconditional message.
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 3b9d06febac..c4a80ef8406 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -59,6 +59,7 @@ with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
+with Stringt; use Stringt;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
@@ -312,31 +313,11 @@ package body Exp_Aggr is
Lov : Uint;
Hiv : Uint;
- -- The following constant determines the maximum size of an array
- -- aggregate produced by converting named to positional notation (e.g.
- -- from others clauses). This avoids running away with attempts to
- -- convert huge aggregates, which hit memory limits in the backend.
-
- -- The normal limit is 5000, but we increase this limit to 2**24 (about
- -- 16 million) if Restrictions (No_Elaboration_Code) or Restrictions
- -- (No_Implicit_Loops) is specified, since in either case we are at
- -- risk of declaring the program illegal because of this limit. We also
- -- increase the limit when Static_Elaboration_Desired, given that this
- -- means that objects are intended to be placed in data memory.
-
- -- We also increase the limit if the aggregate is for a packed two-
- -- dimensional array, because if components are static it is much more
- -- efficient to construct a one-dimensional equivalent array with static
- -- components.
-
- Max_Aggr_Size : constant Nat :=
- 5000 + (2 ** 24 - 5000) *
- Boolean'Pos
- (Restriction_Active (No_Elaboration_Code)
- or else Restriction_Active (No_Implicit_Loops)
- or else Is_Two_Dim_Packed_Array (Typ)
- or else ((Ekind (Current_Scope) = E_Package
- and then Static_Elaboration_Desired (Current_Scope))));
+ Max_Aggr_Size : Nat;
+ -- Determines the maximum size of an array aggregate produced by
+ -- converting named to positional notation (e.g. from others clauses).
+ -- This avoids running away with attempts to convert huge aggregates,
+ -- which hit memory limits in the backend.
function Component_Count (T : Entity_Id) return Int;
-- The limit is applied to the total number of components that the
@@ -395,6 +376,36 @@ package body Exp_Aggr is
-- Start of processing for Aggr_Size_OK
begin
+ -- The normal aggregate limit is 5000, but we increase this limit to
+ -- 2**24 (about 16 million) if Restrictions (No_Elaboration_Code) or
+ -- Restrictions (No_Implicit_Loops) is specified, since in either case
+ -- we are at risk of declaring the program illegal because of this
+ -- limit. We also increase the limit when Static_Elaboration_Desired,
+ -- given that this means that objects are intended to be placed in data
+ -- memory.
+
+ -- We also increase the limit if the aggregate is for a packed two-
+ -- dimensional array, because if components are static it is much more
+ -- efficient to construct a one-dimensional equivalent array with static
+ -- components.
+
+ -- Finally, we use a small limit in CodePeer mode where we favor loops
+ -- instead of thousands of single assignments (from large aggregates).
+
+ Max_Aggr_Size := 5000;
+
+ if CodePeer_Mode then
+ Max_Aggr_Size := 100;
+
+ elsif Restriction_Active (No_Elaboration_Code)
+ or else Restriction_Active (No_Implicit_Loops)
+ or else Is_Two_Dim_Packed_Array (Typ)
+ or else ((Ekind (Current_Scope) = E_Package
+ and then Static_Elaboration_Desired (Current_Scope)))
+ then
+ Max_Aggr_Size := 2 ** 24;
+ end if;
+
Siz := Component_Count (Component_Type (Typ));
Indx := First_Index (Typ);
@@ -1830,6 +1841,11 @@ package body Exp_Aggr is
-- these discriminants are not components of the aggregate, and must be
-- initialized. The assignments are appended to List.
+ function Get_Explicit_Discriminant_Value (D : Entity_Id) return Node_Id;
+ -- If the ancestor part is an unconstrained type and further ancestors
+ -- do not provide discriminants for it, check aggregate components for
+ -- values of the discriminants.
+
function Is_Int_Range_Bounds (Bounds : Node_Id) return Boolean;
-- Check whether Bounds is a range node and its lower and higher bounds
-- are integers literals.
@@ -2048,6 +2064,37 @@ package body Exp_Aggr is
return Empty;
end Get_Constraint_Association;
+ -------------------------------------
+ -- Get_Explicit_Discriminant_Value --
+ -------------------------------------
+
+ function Get_Explicit_Discriminant_Value
+ (D : Entity_Id) return Node_Id
+ is
+ Assoc : Node_Id;
+ Choice : Node_Id;
+ Val : Node_Id;
+
+ begin
+ -- The aggregate has been normalized and all associations have a
+ -- single choice.
+
+ Assoc := First (Component_Associations (N));
+ while Present (Assoc) loop
+ Choice := First (Choices (Assoc));
+
+ if Chars (Choice) = Chars (D) then
+ Val := Expression (Assoc);
+ Remove (Assoc);
+ return Val;
+ end if;
+
+ Next (Assoc);
+ end loop;
+
+ return Empty;
+ end Get_Explicit_Discriminant_Value;
+
-------------------------------
-- Init_Hidden_Discriminants --
-------------------------------
@@ -2285,6 +2332,15 @@ package body Exp_Aggr is
Discrim := First_Discriminant (Anc_Typ);
while Present (Discrim) loop
Disc_Value := Ancestor_Discriminant_Value (Discrim);
+
+ -- If no usable discriminant in ancestors, check
+ -- whether aggregate has an explicit value for it.
+
+ if No (Disc_Value) then
+ Disc_Value :=
+ Get_Explicit_Discriminant_Value (Discrim);
+ end if;
+
Append_To (Anc_Constr, Disc_Value);
Next_Discriminant (Discrim);
end loop;
@@ -5160,9 +5216,100 @@ package body Exp_Aggr is
procedure Expand_N_Aggregate (N : Node_Id) is
begin
+ -- Record aggregate case
+
if Is_Record_Type (Etype (N)) then
Expand_Record_Aggregate (N);
+
+ -- Array aggregate case
+
else
+ -- A special case, if we have a string subtype with bounds 1 .. N,
+ -- where N is known at compile time, and the aggregate is of the
+ -- form (others => 'x'), and N is less than 80 (an arbitrary limit
+ -- for now), then replace the aggregate by the equivalent string
+ -- literal (but do not mark it as static since it is not!)
+
+ -- Note: this entire circuit is redundant with respect to code in
+ -- Expand_Array_Aggregate that collapses others choices to positional
+ -- form, but there are two problems with that circuit:
+
+ -- a) It is limited to very small cases due to ill-understood
+ -- interations with bootstrapping. That limit is removed by
+ -- use of the No_Implicit_Loops restriction.
+
+ -- b) It erroneously ends up with the resulting expressions being
+ -- considered static when they are not. For example, the
+ -- following test should fail:
+
+ -- pragma Restrictions (No_Implicit_Loops);
+ -- package NonSOthers4 is
+ -- B : constant String (1 .. 6) := (others => 'A');
+ -- DH : constant String (1 .. 8) := B & "BB";
+ -- X : Integer;
+ -- pragma Export (C, X, Link_Name => DH);
+ -- end;
+
+ -- But it succeeds (DH looks static to pragma Export)
+
+ -- To be sorted out! ???
+
+ if Present (Component_Associations (N)) then
+ declare
+ CA : constant Node_Id := First (Component_Associations (N));
+ MX : constant := 80;
+
+ begin
+ if Nkind (First (Choices (CA))) = N_Others_Choice
+ and then Nkind (Expression (CA)) = N_Character_Literal
+ then
+ declare
+ T : constant Entity_Id := Etype (N);
+ X : constant Node_Id := First_Index (T);
+ EC : constant Node_Id := Expression (CA);
+ CV : constant Uint := Char_Literal_Value (EC);
+ CC : constant Int := UI_To_Int (CV);
+
+ begin
+ if Nkind (X) = N_Range
+ and then Compile_Time_Known_Value (Low_Bound (X))
+ and then Expr_Value (Low_Bound (X)) = 1
+ and then Compile_Time_Known_Value (High_Bound (X))
+ then
+ declare
+ Hi : constant Uint := Expr_Value (High_Bound (X));
+
+ begin
+ if Hi <= MX then
+ Start_String;
+
+ for J in 1 .. UI_To_Int (Hi) loop
+ Store_String_Char (Char_Code (CC));
+ end loop;
+
+ Rewrite (N,
+ Make_String_Literal (Sloc (N),
+ Strval => End_String));
+
+ if CC >= Int (2 ** 16) then
+ Set_Has_Wide_Wide_Character (N);
+ elsif CC >= Int (2 ** 8) then
+ Set_Has_Wide_Character (N);
+ end if;
+
+ Analyze_And_Resolve (N, T);
+ Set_Is_Static_Expression (N, False);
+ return;
+ end if;
+ end;
+ end if;
+ end;
+ end if;
+ end;
+ end if;
+
+ -- Not that special case, so normal expansion of array aggregate
+
Expand_Array_Aggregate (N);
end if;
exception
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 54442db72b4..a55a32ccd7b 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -1060,14 +1060,44 @@ package body Exp_Attr is
-- match in cases of expander-generated calls (e.g. init
-- procs).
+ -- The code may be nested in a block, so find enclosing
+ -- scope that is a protected operation.
+
else
- Formal :=
- First_Entity
- (Protected_Body_Subprogram (Current_Scope));
- Rewrite (N,
- Unchecked_Convert_To (Typ,
- New_Occurrence_Of (Formal, Loc)));
- Set_Etype (N, Typ);
+ declare
+ Subp : Entity_Id;
+
+ begin
+ Subp := Current_Scope;
+ while Ekind_In (Subp, E_Loop, E_Block) loop
+ Subp := Scope (Subp);
+ end loop;
+
+ Formal :=
+ First_Entity
+ (Protected_Body_Subprogram (Subp));
+
+ -- For a protected subprogram the _Object parameter
+ -- is the protected record, so we create an access
+ -- to it. The _Object parameter of an entry is an
+ -- address.
+
+ if Ekind (Subp) = E_Entry then
+ Rewrite (N,
+ Unchecked_Convert_To (Typ,
+ New_Occurrence_Of (Formal, Loc)));
+ Set_Etype (N, Typ);
+
+ else
+ Rewrite (N,
+ Unchecked_Convert_To (Typ,
+ Make_Attribute_Reference (Loc,
+ Attribute_Name => Name_Unrestricted_Access,
+ Prefix =>
+ New_Occurrence_Of (Formal, Loc))));
+ Analyze_And_Resolve (N);
+ end if;
+ end;
end if;
-- The expression must appear in a default expression,
diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb
index 076783f7113..d8a7022e504 100644
--- a/gcc/ada/exp_cg.adb
+++ b/gcc/ada/exp_cg.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2010-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -261,12 +261,10 @@ package body Exp_CG is
return True;
elsif not Has_Fully_Qualified_Name (E) then
- if Chars (E) = Name_uSize
- or else Chars (E) = Name_uAlignment
+ if Nam_In (Chars (E), Name_uSize, Name_uAlignment, Name_uAssign)
or else
(Chars (E) = Name_Op_Eq
- and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
- or else Chars (E) = Name_uAssign
+ and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
or else Is_Predefined_Interface_Primitive (E)
then
return True;
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index 64a53e36cda..2f2506918e8 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1402,10 +1402,15 @@ package body Exp_Ch11 is
-- Add clean up actions if required
- if Nkind (Parent (N)) /= N_Package_Body
- and then Nkind (Parent (N)) /= N_Accept_Statement
- and then Nkind (Parent (N)) /= N_Extended_Return_Statement
+ if not Nkind_In (Parent (N), N_Package_Body,
+ N_Accept_Statement,
+ N_Extended_Return_Statement)
and then not Delay_Cleanups (Current_Scope)
+
+ -- No cleanup action needed in thunks associated with interfaces
+ -- because they only displace the pointer to the object.
+
+ and then not Is_Thunk (Current_Scope)
then
Expand_Cleanup_Actions (Parent (N));
else
@@ -1431,6 +1436,62 @@ package body Exp_Ch11 is
Possible_Local_Raise (N, Standard_Constraint_Error);
end Expand_N_Raise_Constraint_Error;
+ -------------------------------
+ -- Expand_N_Raise_Expression --
+ -------------------------------
+
+ procedure Expand_N_Raise_Expression (N : Node_Id) is
+ Loc : constant Source_Ptr := Sloc (N);
+ Typ : constant Entity_Id := Etype (N);
+ RCE : Node_Id;
+
+ begin
+ Possible_Local_Raise (N, Name (N));
+
+ -- Later we must teach the back end/gigi how to deal with this, but
+ -- for now we will assume the type is Standard_Boolean and transform
+ -- the node to:
+
+ -- do
+ -- raise X [with string]
+ -- in
+ -- raise Constraint_Error;
+
+ -- unless the flag Convert_To_Return_False is set, in which case
+ -- the transformation is to:
+
+ -- do
+ -- return False;
+ -- in
+ -- raise Constraint_Error;
+
+ -- The raise constraint error can never be executed. It is just a dummy
+ -- node that can be labeled with an arbitrary type.
+
+ RCE := Make_Raise_Constraint_Error (Loc, Reason => CE_Explicit_Raise);
+ Set_Etype (RCE, Typ);
+
+ if Convert_To_Return_False (N) then
+ Rewrite (N,
+ Make_Expression_With_Actions (Loc,
+ Actions => New_List (
+ Make_Simple_Return_Statement (Loc,
+ Expression => New_Occurrence_Of (Standard_False, Loc))),
+ Expression => RCE));
+
+ else
+ Rewrite (N,
+ Make_Expression_With_Actions (Loc,
+ Actions => New_List (
+ Make_Raise_Statement (Loc,
+ Name => Name (N),
+ Expression => Expression (N))),
+ Expression => RCE));
+ end if;
+
+ Analyze_And_Resolve (N, Typ);
+ end Expand_N_Raise_Expression;
+
----------------------------------
-- Expand_N_Raise_Program_Error --
----------------------------------
diff --git a/gcc/ada/exp_ch11.ads b/gcc/ada/exp_ch11.ads
index d715a27c4e7..5f2f6b5f0a8 100644
--- a/gcc/ada/exp_ch11.ads
+++ b/gcc/ada/exp_ch11.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -31,6 +31,7 @@ package Exp_Ch11 is
procedure Expand_N_Exception_Declaration (N : Node_Id);
procedure Expand_N_Handled_Sequence_Of_Statements (N : Node_Id);
procedure Expand_N_Raise_Constraint_Error (N : Node_Id);
+ procedure Expand_N_Raise_Expression (N : Node_Id);
procedure Expand_N_Raise_Program_Error (N : Node_Id);
procedure Expand_N_Raise_Statement (N : Node_Id);
procedure Expand_N_Raise_Storage_Error (N : Node_Id);
@@ -95,4 +96,5 @@ package Exp_Ch11 is
-- handler (and restriction No_Exception_Propagation is set), or if there
-- is a local handler marking that it has a local raise. E is the entity
-- of the corresponding exception.
+
end Exp_Ch11;
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index 141e144ab5b..ba36805e24f 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,6 +43,7 @@ with Sem_Aux; use Sem_Aux;
with Sem_Ch7; use Sem_Ch7;
with Sem_Ch8; use Sem_Ch8;
with Sem_Eval; use Sem_Eval;
+with Sem_Prag; use Sem_Prag;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
@@ -553,6 +554,28 @@ package body Exp_Ch13 is
end;
else
+ -- If the action is the generated body of a null subprogram,
+ -- analyze the expressions in its delayed aspects, because we
+ -- may not have reached the end of the declarative list when
+ -- delayed aspects are normally analyzed. This ensures that
+ -- dispatching calls are properly rewritten when the inner
+ -- postcondition procedure is analyzed.
+
+ if Is_Subprogram (E)
+ and then Nkind (Parent (E)) = N_Procedure_Specification
+ and then Null_Present (Parent (E))
+ then
+ declare
+ Prag : Node_Id;
+ begin
+ Prag := Spec_PPC_List (Contract (E));
+ while Present (Prag) loop
+ Analyze_PPC_In_Decl_Part (Prag, E);
+ Prag := Next_Pragma (Prag);
+ end loop;
+ end;
+ end if;
+
Analyze (Decl, Suppress => All_Checks);
end if;
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb
index b93f832441c..af35113b7b9 100644
--- a/gcc/ada/exp_ch2.adb
+++ b/gcc/ada/exp_ch2.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -162,12 +162,11 @@ package body Exp_Ch2 is
-- lvalue references in the arguments.
and then not (Nkind (Parent (N)) = N_Attribute_Reference
- and then
- (Attribute_Name (Parent (N)) = Name_Asm_Input
- or else
- Attribute_Name (Parent (N)) = Name_Asm_Output
- or else
- Prefix (Parent (N)) = N))
+ and then
+ (Nam_In (Attribute_Name (Parent (N)),
+ Name_Asm_Input,
+ Name_Asm_Output)
+ or else Prefix (Parent (N)) = N))
then
-- Case of Current_Value is a compile time known value
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 15d5de0bd20..a0b08ed937c 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -229,12 +229,6 @@ package body Exp_Ch3 is
function Is_User_Defined_Equality (Prim : Node_Id) return Boolean;
-- Returns true if Prim is a user defined equality function
- function Is_Variable_Size_Array (E : Entity_Id) return Boolean;
- -- Returns true if E has variable size components
-
- function Is_Variable_Size_Record (E : Entity_Id) return Boolean;
- -- Returns true if E has variable size components
-
function Make_Eq_Body
(Typ : Entity_Id;
Eq_Name : Name_Id) return Node_Id;
@@ -1835,9 +1829,8 @@ package body Exp_Ch3 is
-- traversing the expression. ???
if Kind = N_Attribute_Reference
- and then (Attribute_Name (N) = Name_Unchecked_Access
- or else
- Attribute_Name (N) = Name_Unrestricted_Access)
+ and then Nam_In (Attribute_Name (N), Name_Unchecked_Access,
+ Name_Unrestricted_Access)
and then Is_Entity_Name (Prefix (N))
and then Is_Type (Entity (Prefix (N)))
and then Entity (Prefix (N)) = Rec_Type
@@ -2786,8 +2779,8 @@ package body Exp_Ch3 is
-- Loop through components, skipping pragmas, in 2 steps. The first
-- step deals with regular components. The second step deals with
- -- components have per object constraints, and no explicit initia-
- -- lization.
+ -- components that have per object constraints and no explicit
+ -- initialization.
Has_POC := False;
@@ -2805,9 +2798,7 @@ package body Exp_Ch3 is
-- Leave any processing of per-object constrained component for
-- the second pass.
- if Has_Access_Constraint (Id)
- and then No (Expression (Decl))
- then
+ if Has_Access_Constraint (Id) and then No (Expression (Decl)) then
Has_POC := True;
-- Regular component cases
@@ -2841,9 +2832,9 @@ package body Exp_Ch3 is
elsif Ekind (Scope (Id)) = E_Record_Type
and then Present (Corresponding_Concurrent_Type (Scope (Id)))
- and then (Chars (Id) = Name_uCPU or else
- Chars (Id) = Name_uDispatching_Domain or else
- Chars (Id) = Name_uPriority)
+ and then Nam_In (Chars (Id), Name_uCPU,
+ Name_uDispatching_Domain,
+ Name_uPriority)
then
declare
Exp : Node_Id;
@@ -4190,7 +4181,7 @@ package body Exp_Ch3 is
Eq_Op := Empty;
while Present (Prim) loop
if Chars (Node (Prim)) = Name_Op_Eq
- and then Comes_From_Source (Node (Prim))
+ and then Comes_From_Source (Node (Prim))
-- Don't we also need to check formal types and return type as in
-- User_Defined_Eq above???
@@ -4825,10 +4816,145 @@ package body Exp_Ch3 is
-- which case the init proc call must be inserted only after the bodies
-- of the shared variable procedures have been seen.
+ function Build_Equivalent_Aggregate return Boolean;
+ -- If the object has a constrained discriminated type and no initial
+ -- value, it may be possible to build an equivalent aggregate instead,
+ -- and prevent an actual call to the initialization procedure.
+
function Rewrite_As_Renaming return Boolean;
-- Indicate whether to rewrite a declaration with initialization into an
-- object renaming declaration (see below).
+ --------------------------------
+ -- Build_Equivalent_Aggregate --
+ --------------------------------
+
+ function Build_Equivalent_Aggregate return Boolean is
+ Aggr : Node_Id;
+ Comp : Entity_Id;
+ Discr : Elmt_Id;
+ Full_Type : Entity_Id;
+
+ begin
+ Full_Type := Typ;
+
+ if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
+ Full_Type := Full_View (Typ);
+ end if;
+
+ -- Only perform this transformation if Elaboration_Code is forbidden
+ -- or undesirable, and if this is a global entity of a constrained
+ -- record type.
+
+ -- If Initialize_Scalars might be active this transformation cannot
+ -- be performed either, because it will lead to different semantics
+ -- or because elaboration code will in fact be created.
+
+ if Ekind (Full_Type) /= E_Record_Subtype
+ or else not Has_Discriminants (Full_Type)
+ or else not Is_Constrained (Full_Type)
+ or else Is_Controlled (Full_Type)
+ or else Is_Limited_Type (Full_Type)
+ or else not Restriction_Active (No_Initialize_Scalars)
+ then
+ return False;
+ end if;
+
+ if Ekind (Current_Scope) = E_Package
+ and then
+ (Restriction_Active (No_Elaboration_Code)
+ or else Is_Preelaborated (Current_Scope))
+ then
+
+ -- Building a static aggregate is possible if the discriminants
+ -- have static values and the other components have static
+ -- defaults or none.
+
+ Discr := First_Elmt (Discriminant_Constraint (Full_Type));
+ while Present (Discr) loop
+ if not Is_OK_Static_Expression (Node (Discr)) then
+ return False;
+ end if;
+
+ Next_Elmt (Discr);
+ end loop;
+
+ -- Check that initialized components are OK, and that non-
+ -- initialized components do not require a call to their own
+ -- initialization procedure.
+
+ Comp := First_Component (Full_Type);
+ while Present (Comp) loop
+ if Ekind (Comp) = E_Component
+ and then Present (Expression (Parent (Comp)))
+ and then
+ not Is_OK_Static_Expression (Expression (Parent (Comp)))
+ then
+ return False;
+
+ elsif Has_Non_Null_Base_Init_Proc (Etype (Comp)) then
+ return False;
+
+ end if;
+
+ Next_Component (Comp);
+ end loop;
+
+ -- Everything is static, assemble the aggregate, discriminant
+ -- values first.
+
+ Aggr :=
+ Make_Aggregate (Loc,
+ Expressions => New_List,
+ Component_Associations => New_List);
+
+ Discr := First_Elmt (Discriminant_Constraint (Full_Type));
+ while Present (Discr) loop
+ Append_To (Expressions (Aggr), New_Copy (Node (Discr)));
+ Next_Elmt (Discr);
+ end loop;
+
+ -- Now collect values of initialized components.
+
+ Comp := First_Component (Full_Type);
+ while Present (Comp) loop
+ if Ekind (Comp) = E_Component
+ and then Present (Expression (Parent (Comp)))
+ then
+ Append_To (Component_Associations (Aggr),
+ Make_Component_Association (Loc,
+ Choices => New_List (New_Occurrence_Of (Comp, Loc)),
+ Expression => New_Copy_Tree
+ (Expression (Parent (Comp)))));
+ end if;
+
+ Next_Component (Comp);
+ end loop;
+
+ -- Finally, box-initialize remaining components.
+
+ Append_To (Component_Associations (Aggr),
+ Make_Component_Association (Loc,
+ Choices => New_List (Make_Others_Choice (Loc)),
+ Expression => Empty));
+ Set_Box_Present (Last (Component_Associations (Aggr)));
+ Set_Expression (N, Aggr);
+
+ if Typ /= Full_Type then
+ Analyze_And_Resolve (Aggr, Full_View (Base_Type (Full_Type)));
+ Rewrite (Aggr, Unchecked_Convert_To (Typ, Aggr));
+ Analyze_And_Resolve (Aggr, Typ);
+ else
+ Analyze_And_Resolve (Aggr, Full_Type);
+ end if;
+
+ return True;
+
+ else
+ return False;
+ end if;
+ end Build_Equivalent_Aggregate;
+
-------------------------
-- Rewrite_As_Renaming --
-------------------------
@@ -5033,6 +5159,14 @@ package body Exp_Ch3 is
(N, New_Copy_Tree (Init_Expr, New_Scope => Current_Scope));
return;
+ -- If type has discriminants, try to build equivalent aggregate
+ -- using discriminant values from the declaration. This
+ -- is a useful optimization, in particular if restriction
+ -- No_Elaboration_Code is active.
+
+ elsif Build_Equivalent_Aggregate then
+ return;
+
else
Initialization_Warning (Id_Ref);
@@ -7675,7 +7809,7 @@ package body Exp_Ch3 is
if not Has_Invariants (Typ) then
Set_Has_Invariants (Typ);
- Set_Has_Invariants (Proc_Id);
+ Set_Is_Invariant_Procedure (Proc_Id);
Set_Invariant_Procedure (Typ, Proc_Id);
Insert_After (N, Proc);
Analyze (Proc);
@@ -8171,69 +8305,6 @@ package body Exp_Ch3 is
and then Base_Type (Etype (Prim)) = Standard_Boolean;
end Is_User_Defined_Equality;
- ----------------------------
- -- Is_Variable_Size_Array --
- ----------------------------
-
- function Is_Variable_Size_Array (E : Entity_Id) return Boolean is
- Idx : Node_Id;
-
- begin
- pragma Assert (Is_Array_Type (E));
-
- -- Check if some index is initialized with a non-constant value
-
- Idx := First_Index (E);
- while Present (Idx) loop
- if Nkind (Idx) = N_Range then
- if not Is_Constant_Bound (Low_Bound (Idx))
- or else not Is_Constant_Bound (High_Bound (Idx))
- then
- return True;
- end if;
- end if;
-
- Idx := Next_Index (Idx);
- end loop;
-
- return False;
- end Is_Variable_Size_Array;
-
- -----------------------------
- -- Is_Variable_Size_Record --
- -----------------------------
-
- function Is_Variable_Size_Record (E : Entity_Id) return Boolean is
- Comp : Entity_Id;
- Comp_Typ : Entity_Id;
-
- begin
- pragma Assert (Is_Record_Type (E));
-
- Comp := First_Entity (E);
- while Present (Comp) loop
- Comp_Typ := Etype (Comp);
-
- -- Recursive call if the record type has discriminants
-
- if Is_Record_Type (Comp_Typ)
- and then Has_Discriminants (Comp_Typ)
- and then Is_Variable_Size_Record (Comp_Typ)
- then
- return True;
-
- elsif Is_Array_Type (Comp_Typ)
- and then Is_Variable_Size_Array (Comp_Typ)
- then
- return True;
- end if;
-
- Next_Entity (Comp);
- end loop;
-
- return False;
- end Is_Variable_Size_Record;
-
----------------------------------------
-- Make_Controlling_Function_Wrappers --
----------------------------------------
diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads
index d43366812ec..de767fcaa6b 100644
--- a/gcc/ada/exp_ch3.ads
+++ b/gcc/ada/exp_ch3.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index f8d37a5530f..31c689e232b 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -355,6 +355,7 @@ package body Exp_Ch4 is
if Nkind (Op1) = N_Op_Not then
Arg1 := Right_Opnd (Op1);
Arg2 := Right_Opnd (Op2);
+
if Kind = N_Op_And then
Proc_Name := RTE (RE_Vector_Nor);
elsif Kind = N_Op_Or then
@@ -601,9 +602,8 @@ package body Exp_Ch4 is
Dtyp := Available_View (Designated_Type (PtrT));
Etyp := Etype (Expression (Orig_Node));
- if Is_Class_Wide_Type (Dtyp)
- and then Is_Interface (Dtyp)
- then
+ if Is_Class_Wide_Type (Dtyp) and then Is_Interface (Dtyp) then
+
-- If the type of the allocator expression is not an interface type
-- we can generate code to reference the record component containing
-- the pointer to the secondary dispatch table.
@@ -641,7 +641,7 @@ package body Exp_Ch4 is
-- generate a run-time call to displace "this" to reference the
-- component containing the pointer to the secondary dispatch table
-- or else raise Constraint_Error if the actual object does not
- -- implement the target interface. This case corresponds with the
+ -- implement the target interface. This case corresponds to the
-- following example:
-- function Op (Obj : Iface_1'Class) return access Iface_2'Class is
@@ -842,7 +842,7 @@ package body Exp_Ch4 is
-- if statement instead of the regular Program_Error circuitry.
Insert_Action (N,
- Make_If_Statement (Loc,
+ Make_Implicit_If_Statement (N,
Condition => Cond,
Then_Statements => Stmts));
end if;
@@ -1204,9 +1204,8 @@ package body Exp_Ch4 is
Insert_Action (N, Tag_Assign);
end if;
- if Needs_Finalization (DesigT)
- and then Needs_Finalization (T)
- then
+ if Needs_Finalization (DesigT) and then Needs_Finalization (T) then
+
-- Generate an Adjust call if the object will be moved. In Ada
-- 2005, the object may be inherently limited, in which case
-- there is no Adjust procedure, and the object is built in
@@ -1220,17 +1219,17 @@ package body Exp_Ch4 is
and then not Is_Immutably_Limited_Type (T)
then
Insert_Action (N,
- Make_Adjust_Call (
- Obj_Ref =>
- -- An unchecked conversion is needed in the classwide
- -- case because the designated type can be an ancestor
- -- of the subtype mark of the allocator.
+ -- An unchecked conversion is needed in the classwide case
+ -- because the designated type can be an ancestor of the
+ -- subtype mark of the allocator.
- Unchecked_Convert_To (T,
- Make_Explicit_Dereference (Loc,
- Prefix => New_Reference_To (Temp, Loc))),
- Typ => T));
+ Make_Adjust_Call
+ (Obj_Ref =>
+ Unchecked_Convert_To (T,
+ Make_Explicit_Dereference (Loc,
+ Prefix => New_Reference_To (Temp, Loc))),
+ Typ => T));
end if;
-- Generate:
@@ -1315,9 +1314,7 @@ package body Exp_Ch4 is
Rewrite (N, New_Reference_To (Temp, Loc));
Analyze_And_Resolve (N, PtrT);
- elsif Is_Access_Type (T)
- and then Can_Never_Be_Null (T)
- then
+ elsif Is_Access_Type (T) and then Can_Never_Be_Null (T) then
Install_Null_Excluding_Check (Exp);
elsif Is_Access_Type (DesigT)
@@ -1870,9 +1867,9 @@ package body Exp_Ch4 is
X := First_Index (T);
while Present (X) loop
- if Denotes_Discriminant (Type_Low_Bound (Etype (X)))
- or else
- Denotes_Discriminant (Type_High_Bound (Etype (X)))
+ if Denotes_Discriminant (Type_Low_Bound (Etype (X)))
+ or else
+ Denotes_Discriminant (Type_High_Bound (Etype (X)))
then
T := Base_Type (T);
exit;
@@ -1894,8 +1891,7 @@ package body Exp_Ch4 is
Index : Node_Id) return Node_Id
is
Need_Separate_Indexes : constant Boolean :=
- Ltyp /= Rtyp
- or else not Is_Constrained (Ltyp);
+ Ltyp /= Rtyp or else not Is_Constrained (Ltyp);
-- If the index types are identical, and we are working with
-- constrained types, then we can use the same index for both
-- of the arrays.
@@ -2701,8 +2697,8 @@ package body Exp_Ch4 is
-- discriminant(s).
if Nkind (Lhs) = N_Selected_Component
- and then Has_Per_Object_Constraint (
- Entity (Selector_Name (Lhs)))
+ and then Has_Per_Object_Constraint
+ (Entity (Selector_Name (Lhs)))
then
Lhs_Discr_Val :=
Make_Selected_Component (Loc,
@@ -3233,7 +3229,6 @@ package body Exp_Ch4 is
Prefix =>
Duplicate_Subexpr (Opnd, Name_Req => True),
Attribute_Name => Name_First);
- Set_Parent (Opnd_Low_Bound (NN), Opnd);
-- Capture last operand bounds if result could be null
@@ -3244,7 +3239,6 @@ package body Exp_Ch4 is
Prefix =>
Duplicate_Subexpr (Opnd, Name_Req => True),
Attribute_Name => Name_First));
- Set_Parent (Last_Opnd_Low_Bound, Opnd);
Last_Opnd_High_Bound :=
Convert_To (Ityp,
@@ -3252,7 +3246,6 @@ package body Exp_Ch4 is
Prefix =>
Duplicate_Subexpr (Opnd, Name_Req => True),
Attribute_Name => Name_Last));
- Set_Parent (Last_Opnd_High_Bound, Opnd);
end if;
-- Capture length of operand in entity
@@ -3339,9 +3332,7 @@ package body Exp_Ch4 is
-- converted to an array, and the easiest way of doing that is to go
-- through the normal general circuit.
- if NN = 1
- and then Base_Type (Etype (Operands (1))) /= Ctyp
- then
+ if NN = 1 and then Base_Type (Etype (Operands (1))) /= Ctyp then
Result := Operands (1);
goto Done;
end if;
@@ -3966,7 +3957,7 @@ package body Exp_Ch4 is
Name => New_Occurrence_Of (Nnn, Loc),
Expression => Relocate_Node (Lop)),
- Make_If_Statement (Loc,
+ Make_Implicit_If_Statement (N,
Condition =>
Make_Op_Not (Loc,
Right_Opnd =>
@@ -4091,14 +4082,9 @@ package body Exp_Ch4 is
------------------------
procedure Expand_N_Allocator (N : Node_Id) is
- PtrT : constant Entity_Id := Etype (N);
- Dtyp : constant Entity_Id := Available_View (Designated_Type (PtrT));
- Etyp : constant Entity_Id := Etype (Expression (N));
- Loc : constant Source_Ptr := Sloc (N);
- Desig : Entity_Id;
- Nod : Node_Id;
- Pool : Entity_Id;
- Temp : Entity_Id;
+ Etyp : constant Entity_Id := Etype (Expression (N));
+ Loc : constant Source_Ptr := Sloc (N);
+ PtrT : constant Entity_Id := Etype (N);
procedure Rewrite_Coextension (N : Node_Id);
-- Static coextensions have the same lifetime as the entity they
@@ -4163,6 +4149,10 @@ package body Exp_Ch4 is
-- are too large, and which in the absence of a check results in
-- undetected chaos ???
+ -- Note in particular that this is a pessimistic estimate in the
+ -- case of packed array types, where an array element might occupy
+ -- just a fraction of a storage element???
+
declare
Len : Node_Id;
Res : Node_Id;
@@ -4196,6 +4186,15 @@ package body Exp_Ch4 is
end;
end Size_In_Storage_Elements;
+ -- Local variables
+
+ Dtyp : constant Entity_Id := Available_View (Designated_Type (PtrT));
+ Desig : Entity_Id;
+ Nod : Node_Id;
+ Pool : Entity_Id;
+ Rel_Typ : Entity_Id;
+ Temp : Entity_Id;
+
-- Start of processing for Expand_N_Allocator
begin
@@ -4213,17 +4212,42 @@ package body Exp_Ch4 is
-- Expand_Allocator_Expression inherit the proper type attributes.
if (Ekind (PtrT) = E_Anonymous_Access_Type
- or else
- (Is_Itype (PtrT) and then No (Finalization_Master (PtrT))))
+ or else (Is_Itype (PtrT) and then No (Finalization_Master (PtrT))))
and then Needs_Finalization (Dtyp)
then
+ -- Detect the allocation of an anonymous controlled object where the
+ -- type of the context is named. For example:
+
+ -- procedure Proc (Ptr : Named_Access_Typ);
+ -- Proc (new Designated_Typ);
+
+ -- Regardless of the anonymous-to-named access type conversion, the
+ -- lifetime of the object must be associated with the named access
+ -- type. Use the finalization-related attributes of this type.
+
+ if Nkind_In (Parent (N), N_Type_Conversion,
+ N_Unchecked_Type_Conversion)
+ and then Ekind_In (Etype (Parent (N)), E_Access_Subtype,
+ E_Access_Type,
+ E_General_Access_Type)
+ then
+ Rel_Typ := Etype (Parent (N));
+ else
+ Rel_Typ := Empty;
+ end if;
+
-- Anonymous access-to-controlled types allocate on the global pool.
-- Do not set this attribute on .NET/JVM since those targets do not
-- support pools.
if No (Associated_Storage_Pool (PtrT)) and then VM_Target = No_VM then
- Set_Associated_Storage_Pool
- (PtrT, Get_Global_Pool_For_Access_Type (PtrT));
+ if Present (Rel_Typ) then
+ Set_Associated_Storage_Pool (PtrT,
+ Associated_Storage_Pool (Rel_Typ));
+ else
+ Set_Associated_Storage_Pool (PtrT,
+ Get_Global_Pool_For_Access_Type (PtrT));
+ end if;
end if;
-- The finalization master must be inserted and analyzed as part of
@@ -4232,7 +4256,11 @@ package body Exp_Ch4 is
-- updated when analysis changes current units.
if not Alfa_Mode then
- Set_Finalization_Master (PtrT, Current_Anonymous_Master);
+ if Present (Rel_Typ) then
+ Set_Finalization_Master (PtrT, Finalization_Master (Rel_Typ));
+ else
+ Set_Finalization_Master (PtrT, Current_Anonymous_Master);
+ end if;
end if;
end if;
@@ -4766,9 +4794,7 @@ package body Exp_Ch4 is
-- * CodePeer mode - TSS primitive Finalize_Address is
-- not created in this mode.
- elsif not Alfa_Mode
- and then not CodePeer_Mode
- then
+ elsif not (Alfa_Mode or CodePeer_Mode) then
Insert_Action (N,
Make_Set_Finalize_Address_Call
(Loc => Loc,
@@ -4788,9 +4814,7 @@ package body Exp_Ch4 is
-- object that has been rewritten as a reference, we displace "this"
-- to reference properly its secondary dispatch table.
- if Nkind (N) = N_Identifier
- and then Is_Interface (Dtyp)
- then
+ if Nkind (N) = N_Identifier and then Is_Interface (Dtyp) then
Displace_Allocator_Pointer (N);
end if;
@@ -5013,30 +5037,9 @@ package body Exp_Ch4 is
----------------------------
function Find_Enclosing_Context return Node_Id is
- function Is_Body_Or_Unit (N : Node_Id) return Boolean;
- -- Determine whether N denotes a body or unit declaration
-
- ---------------------
- -- Is_Body_Or_Unit --
- ---------------------
-
- function Is_Body_Or_Unit (N : Node_Id) return Boolean is
- begin
- return Nkind_In (N, N_Entry_Body,
- N_Package_Body,
- N_Package_Declaration,
- N_Protected_Body,
- N_Subprogram_Body,
- N_Task_Body);
- end Is_Body_Or_Unit;
-
- -- Local variables
-
Par : Node_Id;
Top : Node_Id;
- -- Start of processing for Find_Enclosing_Context
-
begin
-- The expression_with_actions is in a case/if expression and
-- the lifetime of any temporary controlled object is therefore
@@ -5054,7 +5057,7 @@ package body Exp_Ch4 is
-- Prevent the search from going too far
- elsif Is_Body_Or_Unit (Par) then
+ elsif Is_Body_Or_Package_Declaration (Par) then
exit;
end if;
@@ -5070,16 +5073,16 @@ package body Exp_Ch4 is
while Present (Par) loop
if Is_List_Member (Par)
and then
- not Nkind_In (Par, N_Component_Association,
- N_Discriminant_Association,
- N_Parameter_Association,
- N_Pragma_Argument_Association)
+ not Nkind_In (Par, N_Component_Association,
+ N_Discriminant_Association,
+ N_Parameter_Association,
+ N_Pragma_Argument_Association)
then
return Par;
-- Prevent the search from going too far
- elsif Is_Body_Or_Unit (Par) then
+ elsif Is_Body_Or_Package_Declaration (Par) then
exit;
end if;
@@ -5138,15 +5141,22 @@ package body Exp_Ch4 is
-- return ... and then Ctrl_Func_Call ...;
+ -- Yet another case: a formal in a procedure call statement:
+
+ -- Proc (... and then Ctrl_Func_Call ...);
+
while Present (Par) loop
if Nkind_In (Par, N_Assignment_Statement,
N_Object_Declaration,
N_Pragma,
+ N_Procedure_Call_Statement,
N_Simple_Return_Statement)
then
return Par;
- elsif Is_Body_Or_Unit (Par) then
+ -- Prevent the search from going too far
+
+ elsif Is_Body_Or_Package_Declaration (Par) then
exit;
end if;
@@ -5167,6 +5177,7 @@ package body Exp_Ch4 is
Obj_Typ : constant Node_Id := Etype (Obj_Id);
Desig_Typ : Entity_Id;
Expr : Node_Id;
+ Fin_Call : Node_Id;
Ptr_Id : Entity_Id;
Temp_Id : Entity_Id;
@@ -5182,6 +5193,8 @@ package body Exp_Ch4 is
Desig_Typ := Obj_Typ;
end if;
+ Desig_Typ := Base_Type (Desig_Typ);
+
-- Generate:
-- Ann : access [all] <Desig_Typ>;
@@ -5217,8 +5230,14 @@ package body Exp_Ch4 is
-- Step 3: Hook the transient object to the temporary
+ -- The use of unchecked conversion / unrestricted access is needed
+ -- to avoid an accessibility violation. Note that the finalization
+ -- code is structured in such a way that the "hook" is processed
+ -- only when it points to an existing object.
+
if Is_Access_Type (Obj_Typ) then
- Expr := Convert_To (Ptr_Id, New_Reference_To (Obj_Id, Loc));
+ Expr :=
+ Unchecked_Convert_To (Ptr_Id, New_Reference_To (Obj_Id, Loc));
else
Expr :=
Make_Attribute_Reference (Loc,
@@ -5252,8 +5271,8 @@ package body Exp_Ch4 is
-- the return statement as this would make it unreachable.
if Nkind (Context) /= N_Simple_Return_Statement then
- Insert_Action_After (Context,
- Make_If_Statement (Loc,
+ Fin_Call :=
+ Make_Implicit_If_Statement (Obj_Decl,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd => New_Reference_To (Temp_Id, Loc),
@@ -5268,7 +5287,17 @@ package body Exp_Ch4 is
Make_Assignment_Statement (Loc,
Name => New_Reference_To (Temp_Id, Loc),
- Expression => Make_Null (Loc)))));
+ Expression => Make_Null (Loc))));
+
+ -- Use the Actions list of logical operators when inserting the
+ -- finalization call. This ensures that all transient objects
+ -- are finalized after the operators are evaluated.
+
+ if Nkind_In (Context, N_And_Then, N_Or_Else) then
+ Insert_Action (Context, Fin_Call);
+ else
+ Insert_Action_After (Context, Fin_Call);
+ end if;
end if;
end Process_Transient_Object;
@@ -5629,9 +5658,7 @@ package body Exp_Ch4 is
-- change it to the SLOC of the expression which, after expansion, will
-- correspond to what is being evaluated.
- if Present (Parent (N))
- and then Nkind (Parent (N)) = N_If_Statement
- then
+ if Present (Parent (N)) and then Nkind (Parent (N)) = N_If_Statement then
Set_Sloc (New_If, Sloc (Parent (N)));
Set_Sloc (Parent (N), Loc);
end if;
@@ -6310,7 +6337,7 @@ package body Exp_Ch4 is
Rewrite (N,
Make_And_Then (Loc,
Left_Opnd => Relocate_Node (N),
- Right_Opnd => Make_Predicate_Call (Rtyp, Lop)));
+ Right_Opnd => Make_Predicate_Call (Rtyp, Lop, Mem => True)));
-- Analyze new expression, mark left operand as analyzed to
-- avoid infinite recursion adding predicate calls. Similarly,
@@ -6458,11 +6485,9 @@ package body Exp_Ch4 is
return;
elsif Nkind (Parnt) = N_Attribute_Reference
- and then (Attribute_Name (Parnt) = Name_Address
- or else
- Attribute_Name (Parnt) = Name_Bit
- or else
- Attribute_Name (Parnt) = Name_Size)
+ and then Nam_In (Attribute_Name (Parnt), Name_Address,
+ Name_Bit,
+ Name_Size)
and then Prefix (Parnt) = Child
then
return;
@@ -6493,7 +6518,7 @@ package body Exp_Ch4 is
return;
elsif Nkind_In (Parnt, N_Indexed_Component, N_Selected_Component)
- and then Prefix (Parnt) = Child
+ and then Prefix (Parnt) = Child
then
null;
@@ -6605,8 +6630,8 @@ package body Exp_Ch4 is
-- Deal with software overflow checking
if not Backend_Overflow_Checks_On_Target
- and then Is_Signed_Integer_Type (Etype (N))
- and then Do_Overflow_Check (N)
+ and then Is_Signed_Integer_Type (Etype (N))
+ and then Do_Overflow_Check (N)
then
-- The only case to worry about is when the argument is equal to the
-- largest negative number, so what we do is to insert the check:
@@ -6671,9 +6696,7 @@ package body Exp_Ch4 is
-- Arithmetic overflow checks for signed integer/fixed point types
- if Is_Signed_Integer_Type (Typ)
- or else Is_Fixed_Point_Type (Typ)
- then
+ if Is_Signed_Integer_Type (Typ) or else Is_Fixed_Point_Type (Typ) then
Apply_Arithmetic_Overflow_Check (N);
return;
@@ -6748,7 +6771,6 @@ package body Exp_Ch4 is
-- Now Cnode is the deepest concatenation, and its parents are the
-- concatenation nodes above, so now we process bottom up, doing the
- -- operations. We gather a string that is as long as possible up to five
-- operands.
-- The outer loop runs more than once if more than one concatenation
@@ -6824,9 +6846,7 @@ package body Exp_Ch4 is
-- We cannot do this transformation in configurable run time mode if we
-- have 64-bit integers and long shifts are not available.
- and then
- (Esize (Ltyp) <= 32
- or else Support_Long_Shifts_On_Target)
+ and then (Esize (Ltyp) <= 32 or else Support_Long_Shifts_On_Target)
then
Rewrite (N,
Make_Op_Shift_Right (Loc,
@@ -6863,8 +6883,7 @@ package body Exp_Ch4 is
-- Other cases of division of fixed-point operands. Again we exclude the
-- case where Treat_Fixed_As_Integer is set.
- elsif (Is_Fixed_Point_Type (Ltyp) or else
- Is_Fixed_Point_Type (Rtyp))
+ elsif (Is_Fixed_Point_Type (Ltyp) or else Is_Fixed_Point_Type (Rtyp))
and then not Treat_Fixed_As_Integer (N)
then
if Is_Integer_Type (Typ) then
@@ -6877,17 +6896,13 @@ package body Exp_Ch4 is
-- Mixed-mode operations can appear in a non-static universal context,
-- in which case the integer argument must be converted explicitly.
- elsif Typ = Universal_Real
- and then Is_Integer_Type (Rtyp)
- then
+ elsif Typ = Universal_Real and then Is_Integer_Type (Rtyp) then
Rewrite (Ropnd,
Convert_To (Universal_Real, Relocate_Node (Ropnd)));
Analyze_And_Resolve (Ropnd, Universal_Real);
- elsif Typ = Universal_Real
- and then Is_Integer_Type (Ltyp)
- then
+ elsif Typ = Universal_Real and then Is_Integer_Type (Ltyp) then
Rewrite (Lopnd,
Convert_To (Universal_Real, Relocate_Node (Lopnd)));
@@ -7020,8 +7035,8 @@ package body Exp_Ch4 is
-- Lhs of equality
if Nkind (Lhs) = N_Selected_Component
- and then Has_Per_Object_Constraint
- (Entity (Selector_Name (Lhs)))
+ and then
+ Has_Per_Object_Constraint (Entity (Selector_Name (Lhs)))
then
-- Enclosing record is an Unchecked_Union, use formal A
@@ -7061,8 +7076,8 @@ package body Exp_Ch4 is
-- Rhs of equality
if Nkind (Rhs) = N_Selected_Component
- and then Has_Per_Object_Constraint
- (Entity (Selector_Name (Rhs)))
+ and then
+ Has_Per_Object_Constraint (Entity (Selector_Name (Rhs)))
then
if Is_Unchecked_Union
(Scope (Entity (Selector_Name (Rhs))))
@@ -7707,10 +7722,10 @@ package body Exp_Ch4 is
and then not Do_Overflow_Check (P))
or else
(Nkind (P) = N_Op_Divide
- and then Is_Integer_Type (Etype (L))
- and then Is_Unsigned_Type (Etype (L))
- and then R = N
- and then not Do_Overflow_Check (P))
+ and then Is_Integer_Type (Etype (L))
+ and then Is_Unsigned_Type (Etype (L))
+ and then R = N
+ and then not Do_Overflow_Check (P))
then
Set_Is_Power_Of_2_For_Shift (N);
return;
@@ -7791,9 +7806,9 @@ package body Exp_Ch4 is
elsif Rtyp = Base_Type (Standard_Long_Long_Integer)
or else (Rtyp = Base_Type (Standard_Long_Integer)
- and then
- Esize (Standard_Long_Integer) > Esize (Standard_Integer))
- or else (Rtyp = Universal_Integer)
+ and then
+ Esize (Standard_Long_Integer) > Esize (Standard_Integer))
+ or else Rtyp = Universal_Integer
then
Etyp := Standard_Long_Long_Integer;
@@ -8152,10 +8167,7 @@ package body Exp_Ch4 is
-- (the operation now corresponds to the hardware remainder), and it
-- does not seem likely that it could be harmful.
- if LOK and then Llo >= 0
- and then
- ROK and then Rlo >= 0
- then
+ if LOK and then Llo >= 0 and then ROK and then Rlo >= 0 then
Rewrite (N,
Make_Op_Rem (Sloc (N),
Left_Opnd => Left_Opnd (N),
@@ -8223,8 +8235,7 @@ package body Exp_Ch4 is
(Type_Low_Bound (Base_Type (Underlying_Type (Etype (Left)))));
if ((not ROK) or else (Rlo <= (-1) and then (-1) <= Rhi))
- and then
- ((not LOK) or else (Llo = LLB))
+ and then ((not LOK) or else (Llo = LLB))
then
Rewrite (N,
Make_If_Expression (Loc,
@@ -8255,12 +8266,9 @@ package body Exp_Ch4 is
Rop : constant Node_Id := Right_Opnd (N);
Lp2 : constant Boolean :=
- Nkind (Lop) = N_Op_Expon
- and then Is_Power_Of_2_For_Shift (Lop);
-
+ Nkind (Lop) = N_Op_Expon and then Is_Power_Of_2_For_Shift (Lop);
Rp2 : constant Boolean :=
- Nkind (Rop) = N_Op_Expon
- and then Is_Power_Of_2_For_Shift (Rop);
+ Nkind (Rop) = N_Op_Expon and then Is_Power_Of_2_For_Shift (Rop);
Ltyp : constant Entity_Id := Etype (Lop);
Rtyp : constant Entity_Id := Etype (Rop);
@@ -8419,18 +8427,12 @@ package body Exp_Ch4 is
-- Mixed-mode operations can appear in a non-static universal context,
-- in which case the integer argument must be converted explicitly.
- elsif Typ = Universal_Real
- and then Is_Integer_Type (Rtyp)
- then
+ elsif Typ = Universal_Real and then Is_Integer_Type (Rtyp) then
Rewrite (Rop, Convert_To (Universal_Real, Relocate_Node (Rop)));
-
Analyze_And_Resolve (Rop, Universal_Real);
- elsif Typ = Universal_Real
- and then Is_Integer_Type (Ltyp)
- then
+ elsif Typ = Universal_Real and then Is_Integer_Type (Ltyp) then
Rewrite (Lop, Convert_To (Universal_Real, Relocate_Node (Lop)));
-
Analyze_And_Resolve (Lop, Universal_Real);
-- Non-fixed point cases, check software overflow checking required
@@ -8992,10 +8994,7 @@ package body Exp_Ch4 is
-- Arithmetic overflow checks for signed integer/fixed point types
- if Is_Signed_Integer_Type (Typ)
- or else
- Is_Fixed_Point_Type (Typ)
- then
+ if Is_Signed_Integer_Type (Typ) or else Is_Fixed_Point_Type (Typ) then
Apply_Arithmetic_Overflow_Check (N);
-- VAX floating-point types case
@@ -9048,7 +9047,7 @@ package body Exp_Ch4 is
begin
-- Do validity check if validity checking operands
- if Validity_Checks_On and then Validity_Check_Operands then
+ if Validity_Checks_On and Validity_Check_Operands then
Ensure_Valid (Operand);
end if;
@@ -9182,6 +9181,7 @@ package body Exp_Ch4 is
Loc : constant Source_Ptr := Sloc (N);
Par : constant Node_Id := Parent (N);
P : constant Node_Id := Prefix (N);
+ S : constant Node_Id := Selector_Name (N);
Ptyp : Entity_Id := Underlying_Type (Etype (P));
Disc : Entity_Id;
New_N : Node_Id;
@@ -9257,18 +9257,27 @@ package body Exp_Ch4 is
-- Deal with discriminant check required
if Do_Discriminant_Check (N) then
+ if Present (Discriminant_Checking_Func
+ (Original_Record_Component (Entity (S))))
+ then
+ -- Present the discriminant checking function to the backend, so
+ -- that it can inline the call to the function.
+
+ Add_Inlined_Body
+ (Discriminant_Checking_Func
+ (Original_Record_Component (Entity (S))));
- -- Present the discriminant checking function to the backend, so that
- -- it can inline the call to the function.
+ -- Now reset the flag and generate the call
- Add_Inlined_Body
- (Discriminant_Checking_Func
- (Original_Record_Component (Entity (Selector_Name (N)))));
+ Set_Do_Discriminant_Check (N, False);
+ Generate_Discriminant_Check (N);
- -- Now reset the flag and generate the call
+ -- In the case of Unchecked_Union, no discriminant checking is
+ -- actually performed.
- Set_Do_Discriminant_Check (N, False);
- Generate_Discriminant_Check (N);
+ else
+ Set_Do_Discriminant_Check (N, False);
+ end if;
end if;
-- Ada 2005 (AI-318-02): If the prefix is a call to a build-in-place
@@ -9326,7 +9335,7 @@ package body Exp_Ch4 is
-- contexts where we do not want the value anyway.
elsif (Nkind (Par) = N_Attribute_Reference
- and then Prefix (Par) = N)
+ and then Prefix (Par) = N)
or else Is_Renamed_Object (N)
then
null;
@@ -9395,11 +9404,11 @@ package body Exp_Ch4 is
-- fact incorrect.
elsif Is_Entity_Name (Dval)
- and then Nkind (Parent (Entity (Dval))) =
- N_Object_Declaration
- and then Present (Expression (Parent (Entity (Dval))))
and then
- not Is_Static_Expression
+ Nkind (Parent (Entity (Dval))) = N_Object_Declaration
+ and then Present (Expression (Parent (Entity (Dval))))
+ and then not
+ Is_Static_Expression
(Expression (Parent (Entity (Dval))))
then
exit Discr_Loop;
@@ -9668,7 +9677,7 @@ package body Exp_Ch4 is
elsif Nkind (Parent (N)) = N_Assignment_Statement
or else (Nkind (Parent (Parent (N))) = N_Assignment_Statement
- and then Parent (N) = Name (Parent (Parent (N))))
+ and then Parent (N) = Name (Parent (Parent (N))))
then
return;
@@ -9901,7 +9910,7 @@ package body Exp_Ch4 is
-- range as the base type (or is the base type).
if Range_Checks_Suppressed (Target_Type)
- or else (Lo = Type_Low_Bound (Btyp)
+ or else (Lo = Type_Low_Bound (Btyp)
and then
Hi = Type_High_Bound (Btyp))
then
@@ -10037,6 +10046,20 @@ package body Exp_Ch4 is
-- Start of processing for Expand_N_Type_Conversion
begin
+ -- First remove check marks put by the semantic analysis on the type
+ -- conversion between array types. We need these checks, and they will
+ -- be generated by this expansion routine, but we do not depend on these
+ -- flags being set, and since we do intend to expand the checks in the
+ -- front end, we don't want them on the tree passed to the back end.
+
+ if Is_Array_Type (Target_Type) then
+ if Is_Constrained (Target_Type) then
+ Set_Do_Length_Check (N, False);
+ else
+ Set_Do_Range_Check (Operand, False);
+ end if;
+ end if;
+
-- Nothing at all to do if conversion is to the identical type so remove
-- the conversion completely, it is useless, except that it may carry
-- an Assignment_OK attribute, which must be propagated to the operand.
@@ -10165,9 +10188,7 @@ package body Exp_Ch4 is
-- Do validity check if validity checking operands
- if Validity_Checks_On
- and then Validity_Check_Operands
- then
+ if Validity_Checks_On and Validity_Check_Operands then
Ensure_Valid (Operand);
end if;
@@ -10338,7 +10359,7 @@ package body Exp_Ch4 is
-- Ada 2005 (AI-251): Handle interface type conversion
if Is_Interface (Actual_Op_Typ) then
- Expand_Interface_Conversion (N, Is_Static => False);
+ Expand_Interface_Conversion (N);
goto Done;
end if;
@@ -10865,53 +10886,60 @@ package body Exp_Ch4 is
First_Time : Boolean := True;
- function Suitable_Element (C : Entity_Id) return Entity_Id;
- -- Return the first field to compare beginning with C, skipping the
- -- inherited components.
+ function Element_To_Compare (C : Entity_Id) return Entity_Id;
+ -- Return the next discriminant or component to compare, starting with
+ -- C, skipping inherited components.
- ----------------------
- -- Suitable_Element --
- ----------------------
+ ------------------------
+ -- Element_To_Compare --
+ ------------------------
+
+ function Element_To_Compare (C : Entity_Id) return Entity_Id is
+ Comp : Entity_Id;
- function Suitable_Element (C : Entity_Id) return Entity_Id is
begin
- if No (C) then
- return Empty;
+ Comp := C;
+ loop
+ -- Exit loop when the next element to be compared is found, or
+ -- there is no more such element.
- elsif Ekind (C) /= E_Discriminant
- and then Ekind (C) /= E_Component
- then
- return Suitable_Element (Next_Entity (C));
+ exit when No (Comp);
- -- Below test for C /= Original_Record_Component (C) is dubious
- -- if Typ is a constrained record subtype???
+ exit when Ekind_In (Comp, E_Discriminant, E_Component)
+ and then not (
- elsif Is_Tagged_Type (Typ)
- and then C /= Original_Record_Component (C)
- then
- return Suitable_Element (Next_Entity (C));
+ -- Skip inherited components
- elsif Chars (C) = Name_uTag then
- return Suitable_Element (Next_Entity (C));
+ -- Note: for a tagged type, we always generate the "=" primitive
+ -- for the base type (not on the first subtype), so the test for
+ -- Comp /= Original_Record_Component (Comp) is True for
+ -- inherited components only.
- -- The .NET/JVM version of type Root_Controlled contains two fields
- -- which should not be considered part of the object. To achieve
- -- proper equiality between two controlled objects on .NET/JVM, skip
- -- field _parent whenever it is of type Root_Controlled.
+ (Is_Tagged_Type (Typ)
+ and then Comp /= Original_Record_Component (Comp))
- elsif Chars (C) = Name_uParent
- and then VM_Target /= No_VM
- and then Etype (C) = RTE (RE_Root_Controlled)
- then
- return Suitable_Element (Next_Entity (C));
+ -- Skip _Tag
- elsif Is_Interface (Etype (C)) then
- return Suitable_Element (Next_Entity (C));
+ or else Chars (Comp) = Name_uTag
- else
- return C;
- end if;
- end Suitable_Element;
+ -- The .NET/JVM version of type Root_Controlled contains two
+ -- fields which should not be considered part of the object. To
+ -- achieve proper equiality between two controlled objects on
+ -- .NET/JVM, skip _Parent whenever it has type Root_Controlled.
+
+ or else (Chars (Comp) = Name_uParent
+ and then VM_Target /= No_VM
+ and then Etype (Comp) = RTE (RE_Root_Controlled))
+
+ -- Skip interface elements (secondary tags???)
+
+ or else Is_Interface (Etype (Comp)));
+
+ Next_Entity (Comp);
+ end loop;
+
+ return Comp;
+ end Element_To_Compare;
-- Start of processing for Expand_Record_Equality
@@ -10927,7 +10955,7 @@ package body Exp_Ch4 is
-- and then Lhs.Cmpn = Rhs.Cmpn
Result := New_Reference_To (Standard_True, Loc);
- C := Suitable_Element (First_Entity (Typ));
+ C := Element_To_Compare (First_Entity (Typ));
while Present (C) loop
declare
New_Lhs : Node_Id;
@@ -10971,7 +10999,7 @@ package body Exp_Ch4 is
end if;
end;
- C := Suitable_Element (Next_Entity (C));
+ C := Element_To_Compare (Next_Entity (C));
end loop;
return Result;
@@ -11516,7 +11544,7 @@ package body Exp_Ch4 is
Set_Has_Dereference_Action (Deref);
Stmt :=
- Make_If_Statement (Loc,
+ Make_Implicit_If_Statement (N,
Condition =>
Make_Function_Call (Loc,
Name =>
@@ -11583,7 +11611,7 @@ package body Exp_Ch4 is
and then
(Root_Operand_Type = Base_Type (Standard_Short_Integer)
- or else
+ or else
Root_Operand_Type = Base_Type (Standard_Short_Short_Integer))
-- Test for interesting operation, which includes addition,
@@ -12711,8 +12739,8 @@ package body Exp_Ch4 is
if not Is_Class_Wide_Type (Left_Type)
and then (Is_Ancestor (Etype (Right_Type), Left_Type,
Use_Full_View => True)
- or else (Is_Interface (Etype (Right_Type))
- and then Interface_Present_In_Ancestor
+ or else (Is_Interface (Etype (Right_Type))
+ and then Interface_Present_In_Ancestor
(Typ => Left_Type,
Iface => Etype (Right_Type))))
then
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 243279b00fc..825ea1bd18d 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -3377,7 +3377,7 @@ package body Exp_Ch5 is
declare
Default_Iter : constant Entity_Id :=
Entity
- (Find_Aspect
+ (Find_Value_Of_Aspect
(Etype (Container),
Aspect_Default_Iterator));
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 9288e847734..5c5c809e880 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -2559,6 +2559,39 @@ package body Exp_Ch6 is
-- as we go through the loop, since this is a convenient place to do it.
-- (Though it seems that this would be better done in Expand_Actuals???)
+ -- Special case: Thunks must not compute the extra actuals; they must
+ -- just propagate to the target primitive their extra actuals.
+
+ if Is_Thunk (Current_Scope)
+ and then Thunk_Entity (Current_Scope) = Subp
+ and then Present (Extra_Formals (Subp))
+ then
+ pragma Assert (Present (Extra_Formals (Current_Scope)));
+
+ declare
+ Target_Formal : Entity_Id;
+ Thunk_Formal : Entity_Id;
+
+ begin
+ Target_Formal := Extra_Formals (Subp);
+ Thunk_Formal := Extra_Formals (Current_Scope);
+ while Present (Target_Formal) loop
+ Add_Extra_Actual
+ (New_Occurrence_Of (Thunk_Formal, Loc), Thunk_Formal);
+
+ Target_Formal := Extra_Formal (Target_Formal);
+ Thunk_Formal := Extra_Formal (Thunk_Formal);
+ end loop;
+
+ while Is_Non_Empty_List (Extra_Actuals) loop
+ Add_Actual_Parameter (Remove_Head (Extra_Actuals));
+ end loop;
+
+ Expand_Actuals (Call_Node, Subp);
+ return;
+ end;
+ end if;
+
Formal := First_Formal (Subp);
Actual := First_Actual (Call_Node);
Param_Count := 1;
@@ -2691,9 +2724,7 @@ package body Exp_Ch6 is
-- Ada 2005 (AI-251): Thunks must propagate the extra actuals of
-- accessibility levels.
- if Ekind (Current_Scope) in Subprogram_Kind
- and then Is_Thunk (Current_Scope)
- then
+ if Is_Thunk (Current_Scope) then
declare
Parm_Ent : Entity_Id;
@@ -5489,6 +5520,12 @@ package body Exp_Ch6 is
-- Start of processing for Expand_N_Extended_Return_Statement
begin
+ -- Given that functionality of interface thunks is simple (just displace
+ -- the pointer to the object) they are always handled by means of
+ -- simple return statements.
+
+ pragma Assert (not Is_Thunk (Current_Scope));
+
if Nkind (Ret_Obj_Decl) = N_Object_Declaration then
Exp := Expression (Ret_Obj_Decl);
else
@@ -7132,18 +7169,26 @@ package body Exp_Ch6 is
and then Is_Immutably_Limited_Type (Etype (Expression (N)))
and then Ada_Version >= Ada_2005
and then not Debug_Flag_Dot_L
+
+ -- The functionality of interface thunks is simple and it is always
+ -- handled by means of simple return statements. This leaves their
+ -- expansion simple and clean.
+
+ and then not Is_Thunk (Current_Scope)
then
declare
Return_Object_Entity : constant Entity_Id :=
Make_Temporary (Loc, 'R', Exp);
+
Obj_Decl : constant Node_Id :=
Make_Object_Declaration (Loc,
Defining_Identifier => Return_Object_Entity,
Object_Definition => Subtype_Ind,
Expression => Exp);
- Ext : constant Node_Id := Make_Extended_Return_Statement (Loc,
- Return_Object_Declarations => New_List (Obj_Decl));
+ Ext : constant Node_Id :=
+ Make_Extended_Return_Statement (Loc,
+ Return_Object_Declarations => New_List (Obj_Decl));
-- Do not perform this high-level optimization if the result type
-- is an interface because the "this" pointer must be displaced.
@@ -7205,6 +7250,13 @@ package body Exp_Ch6 is
then
null;
+ -- No copy needed for thunks returning interface type objects since
+ -- the object is returned by reference and the maximum functionality
+ -- required is just to displace the pointer.
+
+ elsif Is_Thunk (Current_Scope) and then Is_Interface (Exptyp) then
+ null;
+
elsif not Requires_Transient_Scope (R_Type) then
-- Mutable records with no variable length components are not
@@ -7433,12 +7485,16 @@ package body Exp_Ch6 is
-- return expression has a specific type whose level is known not to
-- be statically deeper than the function's result type.
+ -- No runtime check needed in interface thunks since it is performed
+ -- by the target primitive associated with the thunk.
+
-- Note: accessibility check is skipped in the VM case, since there
-- does not seem to be any practical way to implement this check.
elsif Ada_Version >= Ada_2005
and then Tagged_Type_Expansion
and then Is_Class_Wide_Type (R_Type)
+ and then not Is_Thunk (Current_Scope)
and then not Scope_Suppress.Suppress (Accessibility_Check)
and then
(Is_Class_Wide_Type (Etype (Exp))
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 49e7efeba6e..69eaafff1ed 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1933,8 +1933,8 @@ package body Exp_Ch9 is
-- Transfer ppc pragmas to the declarations of the wrapper
while Present (P) loop
- if Pragma_Name (P) = Name_Precondition
- or else Pragma_Name (P) = Name_Postcondition
+ if Nam_In (Pragma_Name (P), Name_Precondition,
+ Name_Postcondition)
then
Append (Relocate_Node (P), Decls);
Set_Analyzed (Last (Decls), False);
@@ -13388,6 +13388,7 @@ package body Exp_Ch9 is
Args : List_Id;
L : constant List_Id := New_List;
Has_Entry : constant Boolean := Has_Entries (Ptyp);
+ Prio_Type : Entity_Id;
Restricted : constant Boolean := Restricted_Profile;
begin
@@ -13456,18 +13457,37 @@ package body Exp_Ch9 is
Expression
(First (Pragma_Argument_Associations (Prio_Clause)));
+ -- Get_Rep_Item returns either priority pragma.
+
+ if Pragma_Name (Prio_Clause) = Name_Priority then
+ Prio_Type := RTE (RE_Any_Priority);
+ else
+ Prio_Type := RTE (RE_Interrupt_Priority);
+ end if;
+
-- Attribute definition clause Priority
else
+ if Chars (Prio_Clause) = Name_Priority then
+ Prio_Type := RTE (RE_Any_Priority);
+ else
+ Prio_Type := RTE (RE_Interrupt_Priority);
+ end if;
+
Prio := Expression (Prio_Clause);
end if;
-- If priority is a static expression, then we can duplicate it
-- with no problem and simply append it to the argument list.
+ -- However, it has only be pre-analyzed, so we need to check
+ -- now that it is in the bounds of the priority type.
if Is_Static_Expression (Prio) then
+ Set_Analyzed (Prio, False);
Append_To (Args,
- Duplicate_Subexpr_No_Checks (Prio));
+ Make_Type_Conversion (Loc,
+ Subtype_Mark => New_Occurrence_Of (Prio_Type, Loc),
+ Expression => Duplicate_Subexpr (Prio)));
-- Otherwise, the priority may be a per-object expression, if
-- it depends on a discriminant of the type. In this case,
@@ -13477,18 +13497,13 @@ package body Exp_Ch9 is
-- appropriate approach, but that could generate declarations
-- improperly placed in the enclosing scope.
- -- Note: Use System.Any_Priority as the expected type for the
- -- non-static priority expression, in case the expression has
- -- not been analyzed yet (as occurs for example with pragma
- -- Interrupt_Priority).
-
else
Temp := Make_Temporary (Loc, 'R', Prio);
Append_To (L,
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition =>
- New_Occurrence_Of (RTE (RE_Any_Priority), Loc),
+ New_Occurrence_Of (Prio_Type, Loc),
Expression => Relocate_Node (Prio)));
Append_To (Args, New_Occurrence_Of (Temp, Loc));
@@ -14071,11 +14086,10 @@ package body Exp_Ch9 is
and then (Nkind_In (Stmt, N_Null_Statement, N_Label)
or else
(Nkind (Stmt) = N_Pragma
- and then (Pragma_Name (Stmt) = Name_Unreferenced
- or else
- Pragma_Name (Stmt) = Name_Unmodified
- or else
- Pragma_Name (Stmt) = Name_Warnings)))
+ and then
+ Nam_In (Pragma_Name (Stmt), Name_Unreferenced,
+ Name_Unmodified,
+ Name_Warnings)))
loop
Next (Stmt);
end loop;
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index bf530cb4769..7490e9df7bf 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -1072,89 +1072,93 @@ package body Exp_Disp is
-- to avoid the generation of spurious warnings under ZFP run-time.
Analyze_And_Resolve (Call_Node, Call_Typ, Suppress => All_Checks);
-
- -- For functions returning interface types add implicit conversion to
- -- force the displacement of the pointer to the object to reference
- -- the corresponding secondary dispatch table. This is needed to
- -- handle well nested calls through secondary dispatch tables
- -- (for example Obj.Prim1.Prim2).
-
- if Is_Interface (Res_Typ) then
- Rewrite (Call_Node,
- Make_Type_Conversion (Loc,
- Subtype_Mark => New_Occurrence_Of (Res_Typ, Loc),
- Expression => Relocate_Node (Call_Node)));
- Set_Etype (Call_Node, Res_Typ);
- Expand_Interface_Conversion (Call_Node, Is_Static => False);
- Force_Evaluation (Call_Node);
-
- pragma Assert (Nkind (Call_Node) = N_Explicit_Dereference
- and then Nkind (Prefix (Call_Node)) = N_Identifier
- and then Nkind (Parent (Entity (Prefix (Call_Node))))
- = N_Object_Declaration);
- Set_Assignment_OK (Parent (Entity (Prefix (Call_Node))));
-
- if Nkind (Parent (Call_Node)) = N_Object_Declaration then
- Set_Assignment_OK (Parent (Call_Node));
- end if;
- end if;
end Expand_Dispatching_Call;
---------------------------------
-- Expand_Interface_Conversion --
---------------------------------
- procedure Expand_Interface_Conversion
- (N : Node_Id;
- Is_Static : Boolean := True)
- is
- Loc : constant Source_Ptr := Sloc (N);
- Etyp : constant Entity_Id := Etype (N);
- Operand : constant Node_Id := Expression (N);
- Operand_Typ : Entity_Id := Etype (Operand);
- Func : Node_Id;
- Iface_Typ : Entity_Id := Etype (N);
- Iface_Tag : Entity_Id;
+ procedure Expand_Interface_Conversion (N : Node_Id) is
+ function Underlying_Record_Type (Typ : Entity_Id) return Entity_Id;
+ -- Return the underlying record type of Typ.
- begin
- -- Ada 2005 (AI-345): Handle synchronized interface type derivations
+ ----------------------------
+ -- Underlying_Record_Type --
+ ----------------------------
- if Is_Concurrent_Type (Operand_Typ) then
- Operand_Typ := Base_Type (Corresponding_Record_Type (Operand_Typ));
- end if;
+ function Underlying_Record_Type (Typ : Entity_Id) return Entity_Id is
+ E : Entity_Id := Typ;
- -- Handle access to class-wide interface types
+ begin
+ -- Handle access to class-wide interface types
- if Is_Access_Type (Iface_Typ) then
- Iface_Typ := Etype (Directly_Designated_Type (Iface_Typ));
- end if;
+ if Is_Access_Type (E) then
+ E := Etype (Directly_Designated_Type (E));
+ end if;
- -- Handle class-wide interface types. This conversion can appear
- -- explicitly in the source code. Example: I'Class (Obj)
+ -- Handle class-wide types. This conversion can appear explicitly in
+ -- the source code. Example: I'Class (Obj)
- if Is_Class_Wide_Type (Iface_Typ) then
- Iface_Typ := Root_Type (Iface_Typ);
- end if;
+ if Is_Class_Wide_Type (E) then
+ E := Root_Type (E);
+ end if;
- -- If the target type is a tagged synchronized type, the dispatch table
- -- info is in the corresponding record type.
+ -- If the target type is a tagged synchronized type, the dispatch
+ -- table info is in the corresponding record type.
- if Is_Concurrent_Type (Iface_Typ) then
- Iface_Typ := Corresponding_Record_Type (Iface_Typ);
- end if;
+ if Is_Concurrent_Type (E) then
+ E := Corresponding_Record_Type (E);
+ end if;
- -- Handle private types
+ -- Handle private types
+
+ E := Underlying_Type (E);
+
+ -- Handle subtypes
+
+ return Base_Type (E);
+ end Underlying_Record_Type;
+
+ -- Local variables
+
+ Loc : constant Source_Ptr := Sloc (N);
+ Etyp : constant Entity_Id := Etype (N);
+ Operand : constant Node_Id := Expression (N);
+ Operand_Typ : Entity_Id := Etype (Operand);
+ Func : Node_Id;
+ Iface_Typ : constant Entity_Id := Underlying_Record_Type (Etype (N));
+ Iface_Tag : Entity_Id;
+ Is_Static : Boolean;
- Iface_Typ := Underlying_Type (Iface_Typ);
+ -- Start of processing for Expand_Interface_Conversion
+ begin
-- Freeze the entity associated with the target interface to have
-- available the attribute Access_Disp_Table.
Freeze_Before (N, Iface_Typ);
- pragma Assert (not Is_Static
- or else (not Is_Class_Wide_Type (Iface_Typ)
- and then Is_Interface (Iface_Typ)));
+ -- Ada 2005 (AI-345): Handle synchronized interface type derivations
+
+ if Is_Concurrent_Type (Operand_Typ) then
+ Operand_Typ := Base_Type (Corresponding_Record_Type (Operand_Typ));
+ end if;
+
+ -- Evaluate if we can statically displace the pointer to the object
+
+ declare
+ Opnd_Typ : constant Node_Id := Underlying_Record_Type (Operand_Typ);
+
+ begin
+ Is_Static :=
+ not Is_Interface (Opnd_Typ)
+ and then Interface_Present_In_Ancestor
+ (Typ => Opnd_Typ,
+ Iface => Iface_Typ)
+ and then (Etype (Opnd_Typ) = Opnd_Typ
+ or else not
+ Is_Variable_Size_Record (Etype (Opnd_Typ)));
+ end;
if not Tagged_Type_Expansion then
if VM_Target /= No_VM then
@@ -1166,16 +1170,14 @@ package body Exp_Disp is
Operand_Typ := Root_Type (Operand_Typ);
end if;
- if not Is_Static
- and then Operand_Typ /= Iface_Typ
- then
+ if not Is_Static and then Operand_Typ /= Iface_Typ then
Insert_Action (N,
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of
(RTE (RE_Check_Interface_Conversion), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
- Prefix => Duplicate_Subexpr (Expression (N)),
+ Prefix => Duplicate_Subexpr (Expression (N)),
Attribute_Name => Name_Tag),
Make_Attribute_Reference (Loc,
Prefix => New_Reference_To (Iface_Typ, Loc),
@@ -1881,8 +1883,10 @@ package body Exp_Disp is
end loop;
Thunk_Id := Make_Temporary (Loc, 'T');
+ Set_Ekind (Thunk_Id, Ekind (Prim));
Set_Is_Thunk (Thunk_Id);
Set_Convention (Thunk_Id, Convention (Prim));
+ Set_Thunk_Entity (Thunk_Id, Target);
-- Procedure case
@@ -1904,22 +1908,69 @@ package body Exp_Disp is
-- Function case
else pragma Assert (Ekind (Target) = E_Function);
- Thunk_Code :=
- Make_Subprogram_Body (Loc,
- Specification =>
- Make_Function_Specification (Loc,
- Defining_Unit_Name => Thunk_Id,
- Parameter_Specifications => Formals,
- Result_Definition =>
- New_Copy (Result_Definition (Parent (Target)))),
- Declarations => Decl,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (
- Make_Simple_Return_Statement (Loc,
- Make_Function_Call (Loc,
- Name => New_Occurrence_Of (Target, Loc),
- Parameter_Associations => Actuals)))));
+ declare
+ Result_Def : Node_Id;
+ Call_Node : Node_Id;
+
+ begin
+ Call_Node :=
+ Make_Function_Call (Loc,
+ Name => New_Occurrence_Of (Target, Loc),
+ Parameter_Associations => Actuals);
+
+ if not Is_Interface (Etype (Prim)) then
+ Result_Def := New_Copy (Result_Definition (Parent (Target)));
+
+ -- Thunk of function returning a class-wide interface object. No
+ -- extra displacement needed since the displacement is generated
+ -- in the return statement of Prim. Example:
+
+ -- type Iface is interface ...
+ -- function F (O : Iface) return Iface'Class;
+
+ -- type T is new ... and Iface with ...
+ -- function F (O : T) return Iface'Class;
+
+ elsif Is_Class_Wide_Type (Etype (Prim)) then
+ Result_Def := New_Occurrence_Of (Etype (Prim), Loc);
+
+ -- Thunk of function returning an interface object. Displacement
+ -- needed. Example:
+
+ -- type Iface is interface ...
+ -- function F (O : Iface) return Iface;
+
+ -- type T is new ... and Iface with ...
+ -- function F (O : T) return T;
+
+ else
+ Result_Def :=
+ New_Occurrence_Of (Class_Wide_Type (Etype (Prim)), Loc);
+
+ -- Adding implicit conversion to force the displacement of
+ -- the pointer to the object to reference the corresponding
+ -- secondary dispatch table.
+
+ Call_Node :=
+ Make_Type_Conversion (Loc,
+ Subtype_Mark =>
+ New_Occurrence_Of (Class_Wide_Type (Etype (Prim)), Loc),
+ Expression => Relocate_Node (Call_Node));
+ end if;
+
+ Thunk_Code :=
+ Make_Subprogram_Body (Loc,
+ Specification =>
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => Thunk_Id,
+ Parameter_Specifications => Formals,
+ Result_Definition => Result_Def),
+ Declarations => Decl,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Simple_Return_Statement (Loc, Call_Node))));
+ end;
end if;
end Expand_Interface_Thunk;
@@ -2055,11 +2106,10 @@ package body Exp_Disp is
TSS_Name_Type
(Name_Buffer (Name_Len - TSS_Name'Length + 1 .. Name_Len));
- if Chars (E) = Name_uSize
+ if Nam_In (Chars (E), Name_uSize, Name_uAssign)
or else
(Chars (E) = Name_Op_Eq
- and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
- or else Chars (E) = Name_uAssign
+ and then Etype (First_Formal (E)) = Etype (Last_Formal (E)))
or else TSS_Name = TSS_Deep_Adjust
or else TSS_Name = TSS_Deep_Finalize
or else Is_Predefined_Interface_Primitive (E)
@@ -8382,10 +8432,10 @@ package body Exp_Disp is
-- excluded from this check because interfaces must be visible in
-- the public and private part (RM 7.3 (7.3/2))
- -- We disable this check in CodePeer mode, to accommodate legacy
- -- Ada code.
+ -- We disable this check in Relaxed_RM_Semantics mode, to
+ -- accommodate legacy Ada code.
- if not CodePeer_Mode
+ if not Relaxed_RM_Semantics
and then Is_Abstract_Type (Typ)
and then Is_Abstract_Subprogram (Prim)
and then Present (Alias (Prim))
diff --git a/gcc/ada/exp_disp.ads b/gcc/ada/exp_disp.ads
index f95fba5adfe..67b8be0d4b5 100644
--- a/gcc/ada/exp_disp.ads
+++ b/gcc/ada/exp_disp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -222,12 +222,10 @@ package Exp_Disp is
-- Ada 2005 (AI-251): Displace all the actuals corresponding to class-wide
-- interfaces to reference the interface tag of the actual object
- procedure Expand_Interface_Conversion
- (N : Node_Id;
- Is_Static : Boolean := True);
- -- Ada 2005 (AI-251): N is a type-conversion node. Reference the base of
- -- the object to give access to the interface tag associated with the
- -- secondary dispatch table.
+ procedure Expand_Interface_Conversion (N : Node_Id);
+ -- Ada 2005 (AI-251): N is a type-conversion node. Displace the pointer
+ -- to the object to give access to the interface tag associated with the
+ -- dispatch table of the target type.
procedure Expand_Interface_Thunk
(Prim : Node_Id;
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index e0e7250a3b7..d7055f2cc83 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -6630,9 +6630,10 @@ package body Exp_Dist is
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Function_Call (Loc,
- Name => New_Occurrence_Of (RTE (RE_TC_Build), Loc),
+ Name =>
+ New_Occurrence_Of (RTE (RE_Build_Complex_TC), Loc),
Parameter_Associations => New_List (
- New_Occurrence_Of (RTE (RE_TC_Object), Loc),
+ New_Occurrence_Of (RTE (RE_Tk_Objref), Loc),
Make_Aggregate (Loc,
Expressions =>
New_List (
@@ -10207,11 +10208,11 @@ package body Exp_Dist is
function Make_Constructed_TypeCode
(Kind : Entity_Id;
Parameters : List_Id) return Node_Id;
- -- Call TC_Build with the given kind and parameters
+ -- Call Build_Complex_TC with the given kind and parameters
procedure Return_Constructed_TypeCode (Kind : Entity_Id);
- -- Make a return statement that calls TC_Build with the given
- -- typecode kind, and the constructed parameters list.
+ -- Make a return statement that calls Build_Complex_TC with the
+ -- given typecode kind, and the constructed parameters list.
procedure Return_Alias_TypeCode (Base_TypeCode : Node_Id);
-- Return a typecode that is a TC_Alias for the given typecode
@@ -10285,7 +10286,7 @@ package body Exp_Dist is
procedure Return_Alias_TypeCode (Base_TypeCode : Node_Id) is
begin
Add_TypeCode_Parameter (Base_TypeCode, Parameters);
- Return_Constructed_TypeCode (RTE (RE_TC_Alias));
+ Return_Constructed_TypeCode (RTE (RE_Tk_Alias));
end Return_Alias_TypeCode;
-------------------------------
@@ -10298,12 +10299,12 @@ package body Exp_Dist is
is
Constructed_TC : constant Node_Id :=
Make_Function_Call (Loc,
- Name =>
- New_Occurrence_Of (RTE (RE_TC_Build), Loc),
+ Name =>
+ New_Occurrence_Of (RTE (RE_Build_Complex_TC), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (Kind, Loc),
Make_Aggregate (Loc,
- Expressions => Parameters)));
+ Expressions => Parameters)));
begin
Set_Etype (Constructed_TC, RTE (RE_TypeCode));
return Constructed_TC;
@@ -10420,7 +10421,7 @@ package body Exp_Dist is
Add_TypeCode_Parameter
(Make_Constructed_TypeCode
- (RTE (RE_TC_Struct), Struct_TC_Params),
+ (RTE (RE_Tk_Struct), Struct_TC_Params),
Union_TC_Params);
Add_String_Parameter (Name_Str, Union_TC_Params);
@@ -10439,7 +10440,7 @@ package body Exp_Dist is
Add_TypeCode_Parameter
(Make_Constructed_TypeCode
- (RTE (RE_TC_Union), Union_TC_Params),
+ (RTE (RE_Tk_Union), Union_TC_Params),
Params);
Add_String_Parameter (Name_Str, Params);
@@ -10687,7 +10688,7 @@ package body Exp_Dist is
TC_Append_Record_Traversal
(Parameters, Component_List (Rdef),
Empty, Dummy_Counter);
- Return_Constructed_TypeCode (RTE (RE_TC_Struct));
+ Return_Constructed_TypeCode (RTE (RE_Tk_Struct));
end;
end if;
@@ -10705,7 +10706,7 @@ package body Exp_Dist is
for J in 1 .. Ndim loop
if Constrained then
Inner_TypeCode := Make_Constructed_TypeCode
- (RTE (RE_TC_Array), New_List (
+ (RTE (RE_Tk_Array), New_List (
Build_To_Any_Call (Loc,
OK_Convert_To (RTE (RE_Unsigned_32),
Make_Attribute_Reference (Loc,
@@ -10731,7 +10732,7 @@ package body Exp_Dist is
Next_Index (Indx);
Inner_TypeCode := Make_Constructed_TypeCode
- (RTE (RE_TC_Sequence), New_List (
+ (RTE (RE_Tk_Sequence), New_List (
Build_To_Any_Call (Loc,
OK_Convert_To (RTE (RE_Unsigned_32),
Make_Integer_Literal (Loc, 0)),
@@ -10747,7 +10748,7 @@ package body Exp_Dist is
Start_String;
Store_String_Char ('V');
Add_String_Parameter (End_String, Parameters);
- Return_Constructed_TypeCode (RTE (RE_TC_Struct));
+ Return_Constructed_TypeCode (RTE (RE_Tk_Struct));
end if;
end;
diff --git a/gcc/ada/exp_dist.ads b/gcc/ada/exp_dist.ads
index a0bb6c113db..53f59f4757f 100644
--- a/gcc/ada/exp_dist.ads
+++ b/gcc/ada/exp_dist.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -35,7 +35,7 @@ package Exp_Dist is
PCS_Version_Number : constant array (PCS_Names) of Int :=
(Name_No_DSA => 1,
Name_GARLIC_DSA => 1,
- Name_PolyORB_DSA => 5);
+ Name_PolyORB_DSA => 6);
-- PCS interface version. This is used to check for consistency between the
-- compiler used to generate distribution stubs and the PCS implementation.
-- It must be incremented whenever a change is made to the generated code
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index 2d0d817fc8a..7302f077012 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -518,11 +518,9 @@ package body Exp_Intr is
elsif Nam = Name_Generic_Dispatching_Constructor then
Expand_Dispatching_Constructor_Call (N);
- elsif Nam = Name_Import_Address
- or else
- Nam = Name_Import_Largest_Value
- or else
- Nam = Name_Import_Value
+ elsif Nam_In (Nam, Name_Import_Address,
+ Name_Import_Largest_Value,
+ Name_Import_Value)
then
Expand_Import_Call (N);
@@ -556,10 +554,10 @@ package body Exp_Intr is
elsif Nam = Name_To_Pointer then
Expand_To_Pointer (N);
- elsif Nam = Name_File
- or else Nam = Name_Line
- or else Nam = Name_Source_Location
- or else Nam = Name_Enclosing_Entity
+ elsif Nam_In (Nam, Name_File,
+ Name_Line,
+ Name_Source_Location,
+ Name_Enclosing_Entity)
then
Expand_Source_Info (N, Nam);
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index 2ae1b561907..ae59ae1d35c 100644
--- a/gcc/ada/exp_prag.adb
+++ b/gcc/ada/exp_prag.adb
@@ -392,10 +392,7 @@ package body Exp_Prag is
-- that the failure is not at the point of occurrence of the
-- pragma, unlike the other Check cases.
- elsif Nam = Name_Precondition
- or else
- Nam = Name_Postcondition
- then
+ elsif Nam_In (Nam, Name_Precondition, Name_Postcondition) then
Get_Name_String (Nam);
Insert_Str_In_Name_Buffer ("failed ", 1);
Add_Str_To_Name_Buffer (" from ");
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 1900a9fd7ea..79b9d372afa 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -1774,6 +1774,35 @@ package body Exp_Util is
end if;
end Ensure_Defined;
+ ---------------
+ -- Entity_Of --
+ ---------------
+
+ function Entity_Of (N : Node_Id) return Entity_Id is
+ Id : Entity_Id;
+
+ begin
+ Id := Empty;
+
+ if Is_Entity_Name (N) then
+ Id := Entity (N);
+
+ -- Follow a possible chain of renamings to reach the root renamed
+ -- object.
+
+ while Present (Renamed_Object (Id)) loop
+ if Is_Entity_Name (Renamed_Object (Id)) then
+ Id := Entity (Renamed_Object (Id));
+ else
+ Id := Empty;
+ exit;
+ end if;
+ end loop;
+ end if;
+
+ return Id;
+ end Entity_Of;
+
--------------------
-- Entry_Names_OK --
--------------------
@@ -3674,6 +3703,7 @@ package body Exp_Util is
N_Push_Storage_Error_Label |
N_Qualified_Expression |
N_Quantified_Expression |
+ N_Raise_Expression |
N_Range |
N_Range_Constraint |
N_Real_Literal |
@@ -4268,7 +4298,7 @@ package body Exp_Util is
-- Look for aspect Default_Iterator
if Has_Aspects (Parent (Typ)) then
- Aspect := Find_Aspect (Typ, Aspect_Default_Iterator);
+ Aspect := Find_Value_Of_Aspect (Typ, Aspect_Default_Iterator);
if Present (Aspect) then
Iter := Entity (Aspect);
@@ -5159,11 +5189,9 @@ package body Exp_Util is
-- True if access attribute
elsif Nkind (N) = N_Attribute_Reference
- and then (Attribute_Name (N) = Name_Access
- or else
- Attribute_Name (N) = Name_Unchecked_Access
- or else
- Attribute_Name (N) = Name_Unrestricted_Access)
+ and then Nam_In (Attribute_Name (N), Name_Access,
+ Name_Unchecked_Access,
+ Name_Unrestricted_Access)
then
return True;
@@ -5428,10 +5456,7 @@ package body Exp_Util is
pragma Assert
(Has_Invariants (Typ) and then Present (Invariant_Procedure (Typ)));
- if Check_Enabled (Name_Invariant)
- or else
- Check_Enabled (Name_Assertion)
- then
+ if Check_Kind (Name_Invariant) = Name_Check then
return
Make_Procedure_Call_Statement (Loc,
Name =>
@@ -5519,18 +5544,36 @@ package body Exp_Util is
function Make_Predicate_Call
(Typ : Entity_Id;
- Expr : Node_Id) return Node_Id
+ Expr : Node_Id;
+ Mem : Boolean := False) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Expr);
begin
pragma Assert (Present (Predicate_Function (Typ)));
+ -- Call special membership version if requested and available
+
+ if Mem then
+ declare
+ PFM : constant Entity_Id := Predicate_Function_M (Typ);
+ begin
+ if Present (PFM) then
+ return
+ Make_Function_Call (Loc,
+ Name => New_Occurrence_Of (PFM, Loc),
+ Parameter_Associations => New_List (Relocate_Node (Expr)));
+ end if;
+ end;
+ end if;
+
+ -- Case of calling normal predicate function
+
return
- Make_Function_Call (Loc,
- Name =>
- New_Occurrence_Of (Predicate_Function (Typ), Loc),
- Parameter_Associations => New_List (Relocate_Node (Expr)));
+ Make_Function_Call (Loc,
+ Name =>
+ New_Occurrence_Of (Predicate_Function (Typ), Loc),
+ Parameter_Associations => New_List (Relocate_Node (Expr)));
end Make_Predicate_Call;
--------------------------
@@ -5542,14 +5585,26 @@ package body Exp_Util is
Expr : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Expr);
+ Nam : Name_Id;
begin
+ -- Compute proper name to use, we need to get this right so that the
+ -- right set of check policies apply to the CHeck pragma we are making.
+
+ if Has_Dynamic_Predicate_Aspect (Typ) then
+ Nam := Name_Dynamic_Predicate;
+ elsif Has_Static_Predicate_Aspect (Typ) then
+ Nam := Name_Static_Predicate;
+ else
+ Nam := Name_Predicate;
+ end if;
+
return
Make_Pragma (Loc,
Pragma_Identifier => Make_Identifier (Loc, Name_Check),
Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc,
- Expression => Make_Identifier (Loc, Name_Predicate)),
+ Expression => Make_Identifier (Loc, Nam)),
Make_Pragma_Argument_Association (Loc,
Expression => Make_Predicate_Call (Typ, Expr))));
end Make_Predicate_Check;
@@ -7965,13 +8020,7 @@ package body Exp_Util is
-- Prevent the search from going too far
- elsif Nkind_In (Par, N_Entry_Body,
- N_Package_Body,
- N_Package_Declaration,
- N_Protected_Body,
- N_Subprogram_Body,
- N_Task_Body)
- then
+ elsif Is_Body_Or_Package_Declaration (Par) then
return False;
end if;
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index e0b0e09f88b..39d1c0b0b84 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -345,10 +345,14 @@ package Exp_Util is
-- This procedure ensures that type referenced by Typ is defined. For the
-- case of a type other than an Itype, nothing needs to be done, since
-- all such types have declaration nodes. For Itypes, an N_Itype_Reference
- -- node is generated and inserted at the given node N. This is typically
+ -- node is generated and inserted as an action on node N. This is typically
-- used to ensure that an Itype is properly defined outside a conditional
-- construct when it is referenced in more than one branch.
+ function Entity_Of (N : Node_Id) return Entity_Id;
+ -- Return the entity of N or Empty. If N is a renaming, return the entity
+ -- of the root renamed object.
+
function Entry_Names_OK return Boolean;
-- Determine whether it is appropriate to dynamically allocate strings
-- which represent entry [family member] names. These strings are created
@@ -440,7 +444,8 @@ package Exp_Util is
function Fully_Qualified_Name_String (E : Entity_Id) return String_Id;
-- Generates the string literal corresponding to the fully qualified name
- -- of entity E with an ASCII.NUL appended at the end of the name.
+ -- of entity E, in all upper case, with an ASCII.NUL appended at the end
+ -- of the name.
procedure Generate_Poll_Call (N : Node_Id);
-- If polling is active, then a call to the Poll routine is built,
@@ -647,9 +652,12 @@ package Exp_Util is
function Make_Predicate_Call
(Typ : Entity_Id;
- Expr : Node_Id) return Node_Id;
+ Expr : Node_Id;
+ Mem : Boolean := False) return Node_Id;
-- Typ is a type with Predicate_Function set. This routine builds a call to
-- this function passing Expr as the argument, and returns it unanalyzed.
+ -- If Mem is set True, this is the special call for the membership case,
+ -- and the function called is the Predicate_Function_M if present.
function Make_Predicate_Check
(Typ : Entity_Id;
diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb
index 83a692067cf..cb20234db17 100644
--- a/gcc/ada/expander.adb
+++ b/gcc/ada/expander.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -388,6 +388,9 @@ package body Expander is
when N_Raise_Constraint_Error =>
Expand_N_Raise_Constraint_Error (N);
+ when N_Raise_Expression =>
+ Expand_N_Raise_Expression (N);
+
when N_Raise_Program_Error =>
Expand_N_Raise_Program_Error (N);
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 234cdd2cb42..87bc2c0b0c1 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -249,12 +249,13 @@ package body Freeze is
-- has an interface name, or if it is one of the shift/rotate
-- operations known to the compiler.
- and then (Present (Interface_Name (Renamed_Subp))
- or else Chars (Renamed_Subp) = Name_Rotate_Left
- or else Chars (Renamed_Subp) = Name_Rotate_Right
- or else Chars (Renamed_Subp) = Name_Shift_Left
- or else Chars (Renamed_Subp) = Name_Shift_Right
- or else Chars (Renamed_Subp) = Name_Shift_Right_Arithmetic)
+ and then
+ (Present (Interface_Name (Renamed_Subp))
+ or else Nam_In (Chars (Renamed_Subp), Name_Rotate_Left,
+ Name_Rotate_Right,
+ Name_Shift_Left,
+ Name_Shift_Right,
+ Name_Shift_Right_Arithmetic))
then
Set_Interface_Name (Ent, Interface_Name (Renamed_Subp));
@@ -1834,9 +1835,8 @@ package body Freeze is
begin
case Nkind (N) is
when N_Attribute_Reference =>
- if (Attribute_Name (N) = Name_Access
- or else
- Attribute_Name (N) = Name_Unchecked_Access)
+ if Nam_In (Attribute_Name (N), Name_Access,
+ Name_Unchecked_Access)
and then Is_Entity_Name (Prefix (N))
and then Is_Type (Entity (Prefix (N)))
and then Entity (Prefix (N)) = E
@@ -3484,7 +3484,7 @@ package body Freeze is
Set_Is_Packed (Btyp);
Set_Has_Non_Standard_Rep (Btyp);
- -- Otherwise give an error message
+ -- Otherwise give an error message
else
Error_Msg_NE
@@ -4550,9 +4550,9 @@ package body Freeze is
begin
pragma Assert
- (Op_Name = Name_Allocate
- or else Op_Name = Name_Deallocate
- or else Op_Name = Name_Storage_Size);
+ (Nam_In (Op_Name, Name_Allocate,
+ Name_Deallocate,
+ Name_Storage_Size));
Error_Msg_Name_1 := Op_Name;
@@ -4601,7 +4601,8 @@ package body Freeze is
if Op_Name = Name_Allocate then
Validate_Simple_Pool_Op_Formal
(Op, Formal, E_Out_Parameter,
- Address_Type, "Storage_Address", Is_OK);
+ Address_Type, "Storage_Address", Is_OK);
+
elsif Op_Name = Name_Deallocate then
Validate_Simple_Pool_Op_Formal
(Op, Formal, E_In_Parameter,
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb
index c7b71208ff0..e186258805a 100644
--- a/gcc/ada/g-socket.adb
+++ b/gcc/ada/g-socket.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, AdaCore --
+-- Copyright (C) 2001-2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -200,6 +200,12 @@ package body GNAT.Sockets is
-- Raise Constraint_Error if Fd is less than 0 or greater than or equal to
-- FD_SETSIZE, on platforms where fd_set is a bitmap.
+ function Connect_Socket
+ (Socket : Socket_Type;
+ Server : Sock_Addr_Type) return C.int;
+ pragma Inline (Connect_Socket);
+ -- Underlying implementation for the Connect_Socket procedures
+
-- Types needed for Datagram_Socket_Stream_Type
type Datagram_Socket_Stream_Type is new Root_Stream_Type with record
@@ -510,10 +516,6 @@ package body GNAT.Sockets is
(Selector, R_Socket_Set, W_Socket_Set, E_Socket_Set, Status, Timeout);
end Check_Selector;
- --------------------
- -- Check_Selector --
- --------------------
-
procedure Check_Selector
(Selector : Selector_Type;
R_Socket_Set : in out Socket_Set_Type;
@@ -662,11 +664,10 @@ package body GNAT.Sockets is
-- Connect_Socket --
--------------------
- procedure Connect_Socket
+ function Connect_Socket
(Socket : Socket_Type;
- Server : Sock_Addr_Type)
+ Server : Sock_Addr_Type) return C.int
is
- Res : C.int;
Sin : aliased Sockaddr_In;
Len : constant C.int := Sin'Size / 8;
@@ -681,17 +682,19 @@ package body GNAT.Sockets is
(Sin'Unchecked_Access,
Short_To_Network (C.unsigned_short (Server.Port)));
- Res := C_Connect (C.int (Socket), Sin'Address, Len);
+ return C_Connect (C.int (Socket), Sin'Address, Len);
+ end Connect_Socket;
- if Res = Failure then
+ procedure Connect_Socket
+ (Socket : Socket_Type;
+ Server : Sock_Addr_Type)
+ is
+ begin
+ if Connect_Socket (Socket, Server) = Failure then
Raise_Socket_Error (Socket_Errno);
end if;
end Connect_Socket;
- --------------------
- -- Connect_Socket --
- --------------------
-
procedure Connect_Socket
(Socket : Socket_Type;
Server : Sock_Addr_Type;
@@ -719,28 +722,32 @@ package body GNAT.Sockets is
Req := (Name => Non_Blocking_IO, Enabled => True);
Control_Socket (Socket, Request => Req);
- -- Start operation (non-blocking), will raise Socket_Error with
- -- EINPROGRESS.
+ -- Start operation (non-blocking), will return Failure with errno set
+ -- to EINPROGRESS.
- begin
- Connect_Socket (Socket, Server);
- exception
- when E : Socket_Error =>
- if Resolve_Exception (E) = Operation_Now_In_Progress then
- null;
- else
- raise;
- end if;
- end;
+ Res := Connect_Socket (Socket, Server);
+ if Res = Failure then
+ Conn_Err := Socket_Errno;
+ if Conn_Err /= SOSC.EINPROGRESS then
+ Raise_Socket_Error (Conn_Err);
+ end if;
+ end if;
- -- Wait for socket to become available for writing
+ -- Wait for socket to become available for writing (unless the Timeout
+ -- is zero, in which case we consider that it has already expired, and
+ -- we do not need to wait at all).
- Wait_On_Socket
- (Socket => Socket,
- For_Read => False,
- Timeout => Timeout,
- Selector => Selector,
- Status => Status);
+ if Timeout = 0.0 then
+ Status := Expired;
+
+ else
+ Wait_On_Socket
+ (Socket => Socket,
+ For_Read => False,
+ Timeout => Timeout,
+ Selector => Selector,
+ Status => Status);
+ end if;
-- Check error condition (the asynchronous connect may have terminated
-- with an error, e.g. ECONNREFUSED) if select(2) completed.
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index 462556265a6..4761f3a4ab5 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2011, AdaCore --
+-- Copyright (C) 2001-2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -858,7 +858,9 @@ package GNAT.Sockets is
-- whether the operation completed successfully, timed out, or was aborted.
-- If Selector is not null, the designated selector is used to wait for the
-- socket to become available, else a private selector object is created
- -- by this procedure and destroyed before it returns.
+ -- by this procedure and destroyed before it returns. If Timeout is 0.0,
+ -- no attempt is made to detect whether the connection has succeeded; it
+ -- is up to the user to determine this using Check_Selector later on.
procedure Control_Socket
(Socket : Socket_Type;
diff --git a/gcc/ada/g-spipat.ads b/gcc/ada/g-spipat.ads
index 5ba0bdd811d..27cd8d564e1 100644
--- a/gcc/ada/g-spipat.ads
+++ b/gcc/ada/g-spipat.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2010, AdaCore --
+-- Copyright (C) 1997-2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -729,7 +729,7 @@ package GNAT.Spitbol.Patterns is
function "*" (P : PString; Var : VString_Var) return Pattern;
function "*" (P : PChar; Var : VString_Var) return Pattern;
-- Matches P, and if the match succeeds, assigns the matched substring
- -- to the given VString variable S. This assignment happens as soon as
+ -- to the given VString variable Var. This assignment happens as soon as
-- the substring is matched, and if the pattern P1 is matched more than
-- once during the course of the match, then the assignment will occur
-- more than once.
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 57f90090dcf..5baf44e43bc 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -386,6 +386,7 @@ GNAT_ADA_OBJS = \
ada/sem_util.o \
ada/sem_vfpt.o \
ada/sem_warn.o \
+ ada/set_targ.o \
ada/sinfo-cn.o \
ada/sinfo.o \
ada/sinput-d.o \
@@ -1274,18 +1275,19 @@ ada/checks.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
ada/sem_dist.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/urealp.adb ada/validsw.ads ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
+ ada/widechar.ads
ada/comperr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1313,20 +1315,20 @@ ada/csets.o : ada/ada.ads ada/a-unccon.ads ada/a-uncdea.ads ada/csets.ads \
ada/cstand.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
- ada/atree.adb ada/back_end.ads ada/casing.ads ada/checks.ads \
- ada/csets.ads ada/cstand.ads ada/cstand.adb ada/debug.ads ada/einfo.ads \
- ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads ada/exp_disp.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/hostparm.ads \
- ada/interfac.ads ada/layout.ads ada/lib.ads ada/lib-util.ads \
- ada/lib-xref.ads ada/namet.ads ada/namet-sp.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/put_alfa.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_eval.ads ada/sem_mech.ads ada/sem_res.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads \
+ ada/cstand.ads ada/cstand.adb ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_ch11.ads ada/exp_disp.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/interfac.ads \
+ ada/layout.ads ada/lib.ads ada/lib-util.ads ada/lib-xref.ads \
+ ada/namet.ads ada/namet-sp.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/put_alfa.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_attr.ads \
+ ada/sem_aux.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads \
+ ada/sem_mech.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
ada/system.ads ada/s-assert.ads ada/s-crc32.ads ada/s-exctab.ads \
@@ -1453,19 +1455,19 @@ ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
ada/sem_disp.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_eval.adb \
ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
- ada/widechar.ads
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads ada/widechar.ads
ada/exp_alfa.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1529,18 +1531,19 @@ ada/exp_attr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
ada/sem_ch9.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
- ada/validsw.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/exp_cg.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1612,16 +1615,16 @@ ada/exp_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
ada/opt.ads ada/output.ads ada/restrict.ads ada/restrict.adb \
ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_aux.ads \
- ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_util.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/types.ads \
- ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads
+ ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_prag.ads \
+ ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
+ ada/s-exctab.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_ch2.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1659,18 +1662,19 @@ ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb \
ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_eval.ads \
- ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_scil.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/sem_eval.adb ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads \
+ ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads
ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1694,19 +1698,19 @@ ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch8.ads \
ada/sem_disp.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-exctab.adb \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
- ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/validsw.ads ada/widechar.ads
ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1727,18 +1731,18 @@ ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch6.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_eval.adb \
ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1766,18 +1770,18 @@ ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch9.ads ada/sem_dim.ads ada/sem_disp.ads ada/sem_dist.ads \
ada/sem_eval.ads ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads \
ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
ada/exp_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1800,18 +1804,18 @@ ada/exp_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads \
ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_disp.ads ada/sem_eval.ads \
ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
- ada/widechar.ads
+ ada/sem_util.adb ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads ada/widechar.ads
ada/exp_ch8.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1825,16 +1829,16 @@ ada/exp_ch8.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_aux.ads \
ada/sem_ch8.ads ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads
+ ada/sem_type.ads ada/sem_util.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1857,17 +1861,18 @@ ada/exp_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_ch9.adb ada/sem_disp.ads \
ada/sem_elab.ads ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/exp_code.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1885,18 +1890,18 @@ ada/exp_code.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads \
ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-carun8.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/types.adb ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/exp_dbug.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -1934,8 +1939,8 @@ ada/exp_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/scil_ll.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_aux.adb ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
ada/sem_disp.ads ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
@@ -1961,16 +1966,17 @@ ada/exp_dist.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_aux.ads \
ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch12.ads ada/sem_ch3.ads \
ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_util.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-strhas.ads ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-htable.adb ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/exp_fixd.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -2005,8 +2011,8 @@ ada/exp_imgv.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
ada/rtsfind.adb ada/sem.ads ada/sem_aux.ads ada/sem_ch7.ads \
- ada/sem_dist.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/sem_dist.ads ada/sem_res.ads ada/sem_util.ads ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-assert.ads \
ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
@@ -2035,18 +2041,18 @@ ada/exp_intr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
- ada/validsw.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb ada/validsw.ads ada/widechar.ads
ada/exp_pakd.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -2063,17 +2069,17 @@ ada/exp_pakd.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_aux.ads \
ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads \
ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
- ada/validsw.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads
ada/exp_prag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -2099,19 +2105,19 @@ ada/exp_prag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/urealp.ads ada/widechar.ads
ada/exp_sel.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
- ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/debug.ads \
- ada/einfo.ads ada/einfo.adb ada/elists.ads ada/exp_sel.ads \
- ada/exp_sel.adb ada/hostparm.ads ada/lib.ads ada/namet.ads \
- ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
- ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/sem_aux.ads ada/sinfo.ads ada/sinfo.adb ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-stalib.ads ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
+ ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/exp_sel.ads ada/exp_sel.adb ada/hostparm.ads ada/lib.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/sem_aux.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-stalib.ads \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
ada/exp_smem.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -2136,15 +2142,15 @@ ada/exp_strm.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-htable.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \
ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/sem_aux.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/sem_aux.ads ada/sem_util.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-stalib.ads ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/exp_tss.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -2185,16 +2191,16 @@ ada/exp_util.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads \
ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_eval.ads ada/sem_eval.adb \
ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/system.ads ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/system.ads ada/s-assert.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
ada/validsw.ads ada/widechar.ads
@@ -2293,18 +2299,19 @@ ada/freeze.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \
ada/sem_eval.ads ada/sem_intr.ads ada/sem_mech.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/frontend.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -2359,9 +2366,15 @@ ada/get_alfa.o : ada/ada.ads ada/a-ioexce.ads ada/a-unccon.ads \
ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-unstyp.ads \
ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-ada/get_targ.o : ada/ada.ads ada/a-unccon.ads ada/get_targ.ads \
- ada/get_targ.adb ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ada/get_targ.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
+ ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/einfo.ads \
+ ada/get_targ.ads ada/get_targ.adb ada/hostparm.ads ada/namet.ads \
+ ada/opt.ads ada/output.ads ada/snames.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
ada/gnat.o : ada/gnat.ads ada/system.ads
@@ -2380,16 +2393,16 @@ ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/prepcomp.ads ada/put_alfa.ads ada/repinfo.ads ada/restrict.ads \
ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scos.ads ada/sem.ads \
ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_elim.ads \
- ada/sem_eval.ads ada/sem_type.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/sinput.adb ada/sinput-l.ads ada/snames.ads \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads ada/treepr.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/sem_eval.ads ada/sem_type.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/sinput-l.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tree_gen.ads ada/tree_io.ads \
+ ada/treepr.ads ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/usage.ads \
ada/validsw.ads ada/widechar.ads
@@ -2489,8 +2502,8 @@ ada/layout.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch13.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
@@ -2541,27 +2554,26 @@ ada/lib-writ.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/atree.ads ada/atree.adb ada/butil.ads ada/casing.ads ada/csets.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
- ada/fname-uf.ads ada/get_targ.ads ada/gnat.ads ada/g-byorma.ads \
- ada/g-hesorg.ads ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
- ada/lib-sort.adb ada/lib-util.ads ada/lib-util.adb ada/lib-writ.ads \
- ada/lib-writ.adb ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/opt.ads ada/osint.ads ada/osint-c.ads \
- ada/output.ads ada/par.ads ada/par_sco.ads ada/put_alfa.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/scans.ads \
- ada/scn.ads ada/scng.ads ada/scng.adb ada/sem_aux.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-casuti.ads ada/s-crc32.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/fname-uf.ads ada/gnat.ads ada/g-byorma.ads ada/g-hesorg.ads \
+ ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb \
+ ada/lib-util.ads ada/lib-util.adb ada/lib-writ.ads ada/lib-writ.adb \
+ ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \
+ ada/par.ads ada/par_sco.ads ada/put_alfa.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem_aux.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-casuti.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/lib-xref.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alfa.ads ada/alfa.adb ada/alloc.ads \
@@ -2581,18 +2593,18 @@ ada/lib-xref.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-htable.adb ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-htable.adb ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/lib.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads \
ada/alloc.ads ada/aspects.ads ada/atree.ads ada/atree.adb \
@@ -2743,21 +2755,22 @@ ada/par.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads \
ada/rtsfind.ads ada/scans.ads ada/scans.adb ada/scn.ads ada/scng.ads \
ada/scng.adb ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb \
- ada/sinput-l.ads ada/snames.ads ada/snames.adb ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/style.ads ada/style.adb \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \
- ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
- ada/validsw.ads ada/warnsw.ads ada/widechar.ads
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \
+ ada/sinput.adb ada/sinput-l.ads ada/snames.ads ada/snames.adb \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/style.adb ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-carun8.ads ada/s-crc32.ads \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/types.adb \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/warnsw.ads \
+ ada/widechar.ads
ada/par_sco.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/aspects.adb \
@@ -2836,16 +2849,16 @@ ada/repinfo.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/lib.ads \
ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
ada/nlists.ads ada/opt.ads ada/output.ads ada/output.adb \
- ada/repinfo.ads ada/repinfo.adb ada/scans.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/repinfo.ads ada/repinfo.adb ada/scans.ads ada/sem_aux.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/restrict.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/aspects.adb \
@@ -3153,18 +3166,19 @@ ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_dim.ads \
ada/sem_disp.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads ada/alloc.ads \
@@ -3191,20 +3205,20 @@ ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads \
ada/sem_eval.adb ada/sem_intr.ads ada/sem_prag.ads ada/sem_res.ads \
ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
- ada/sinput.ads ada/sinput.adb ada/snames.ads ada/snames.adb \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads \
- ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
- ada/validsw.ads ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/snames.adb ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/urealp.adb ada/validsw.ads ada/widechar.ads
ada/sem_aux.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3252,17 +3266,17 @@ ada/sem_cat.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
ada/sem_cat.adb ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/sem_util.adb ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/sem_ch10.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3285,17 +3299,18 @@ ada/sem_ch10.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_disp.ads \
ada/sem_dist.ads ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \
- ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/widechar.ads
ada/sem_ch11.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3340,19 +3355,20 @@ ada/sem_ch12.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_dim.ads ada/sem_disp.ads \
ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads \
ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinfo-cn.ads ada/sinput.ads ada/sinput-l.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-htable.adb \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-strhas.ads \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/widechar.ads
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/sinput-l.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-htable.adb ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/widechar.ads
ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/aspects.adb \
@@ -3375,18 +3391,19 @@ ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch9.ads ada/sem_dim.ads ada/sem_disp.ads ada/sem_dist.ads \
ada/sem_eval.ads ada/sem_eval.adb ada/sem_prag.ads ada/sem_res.ads \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
- ada/validsw.ads ada/warnsw.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb ada/validsw.ads ada/warnsw.ads \
+ ada/widechar.ads
ada/sem_ch2.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3428,18 +3445,18 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_dist.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \
ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_smem.ads \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
- ada/validsw.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb ada/validsw.ads ada/widechar.ads
ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3462,17 +3479,18 @@ ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads \
ada/sem_eval.adb ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/widechar.ads
ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3499,18 +3517,18 @@ ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \
ada/sem_intr.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_res.adb \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads
+ ada/sem_warn.adb ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3535,19 +3553,19 @@ ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_dim.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elim.ads \
ada/sem_eval.ads ada/sem_eval.adb ada/sem_mech.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
- ada/sinput.ads ada/snames.ads ada/snames.adb ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
- ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/snames.adb \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads ada/widechar.ads
ada/sem_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3566,18 +3584,18 @@ ada/sem_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch3.ads \
ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch7.adb ada/sem_ch8.ads \
ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/snames.adb \
- ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
+ ada/snames.adb ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/sem_ch8.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3602,18 +3620,18 @@ ada/sem_ch8.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_dim.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/aspects.adb \
@@ -3638,17 +3656,17 @@ ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch9.adb ada/sem_dim.ads ada/sem_disp.ads ada/sem_dist.ads \
ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads \
ada/sem_prag.ads ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads \
- ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/sem_dim.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
@@ -3667,19 +3685,19 @@ ada/sem_dim.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dim.ads ada/sem_dim.adb \
ada/sem_disp.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
- ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-strhas.ads \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-htable.adb ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3699,16 +3717,17 @@ ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_aux.adb ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_disp.adb ada/sem_eval.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
ada/sem_dist.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3743,8 +3762,8 @@ ada/sem_elab.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
ada/sem_elab.ads ada/sem_elab.adb ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
@@ -3794,17 +3813,17 @@ ada/sem_eval.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_dim.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads \
ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb
ada/sem_intr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
@@ -3870,21 +3889,21 @@ ada/sem_prag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_mech.ads \
ada/sem_prag.ads ada/sem_prag.adb ada/sem_res.ads ada/sem_res.adb \
ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_vfpt.ads \
- ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb \
- ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb ada/snames.ads \
- ada/snames.adb ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-casuti.ads \
- ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-exctab.adb \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
- ada/validsw.ads ada/warnsw.ads ada/widechar.ads
+ ada/sem_warn.ads ada/sem_warn.adb ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/snames.adb ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-casuti.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/urealp.adb ada/validsw.ads ada/warnsw.ads ada/widechar.ads
ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3911,19 +3930,20 @@ ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads \
ada/sem_eval.adb ada/sem_intr.ads ada/sem_prag.ads ada/sem_res.ads \
ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
- ada/urealp.adb ada/validsw.ads ada/widechar.ads
+ ada/sem_warn.ads ada/set_targ.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/types.adb \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
+ ada/widechar.ads
ada/sem_scil.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3966,8 +3986,8 @@ ada/sem_type.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_ch12.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \
ada/sem_dist.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \
- ada/sem_type.adb ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/sem_type.adb ada/sem_util.ads ada/sem_util.adb ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
@@ -4000,31 +4020,32 @@ ada/sem_util.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
ada/sem_ch9.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_eval.ads \
ada/sem_eval.adb ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
- ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-imenne.ads \
- ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-strhas.ads ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/urealp.adb ada/widechar.ads
+ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/set_targ.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
+ ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-strhas.ads \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/widechar.ads
ada/sem_vfpt.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
- ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/cstand.ads \
- ada/debug.ads ada/einfo.ads ada/einfo.adb ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads ada/rident.ads \
- ada/sem_vfpt.ads ada/sem_vfpt.adb ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
+ ada/cstand.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/opt.ads \
+ ada/output.ads ada/rident.ads ada/sem_vfpt.ads ada/sem_vfpt.adb \
+ ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-stalib.ads \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads
ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -4041,18 +4062,28 @@ ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/scans.ads ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads \
ada/sem_aux.adb ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/widechar.ads
+ ada/sem_warn.ads ada/sem_warn.adb ada/set_targ.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-assert.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+
+ada/set_targ.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
+ ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/einfo.ads \
+ ada/get_targ.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
+ ada/output.ads ada/set_targ.ads ada/set_targ.adb ada/snames.ads \
+ ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-stalib.ads ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/sinfo-cn.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -4229,16 +4260,17 @@ ada/switch-b.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/switch-c.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
- ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/get_targ.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads ada/opt.ads \
- ada/osint.ads ada/output.ads ada/stylesw.ads ada/switch.ads \
- ada/switch-c.ads ada/switch-c.adb ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/validsw.ads ada/warnsw.ads
+ ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/einfo.ads \
+ ada/get_targ.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
+ ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads ada/set_targ.ads \
+ ada/snames.ads ada/stylesw.ads ada/switch.ads ada/switch-c.ads \
+ ada/switch-c.adb ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads ada/warnsw.ads
ada/switch.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/gnatvsn.ads \
@@ -4353,9 +4385,15 @@ ada/treeprs.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/tree_io.ads ada/treeprs.ads ada/types.ads ada/uintp.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/ttypes.o : ada/ada.ads ada/a-unccon.ads ada/get_targ.ads \
- ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/ttypes.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ada/ttypes.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
+ ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/einfo.ads \
+ ada/get_targ.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
+ ada/output.ads ada/set_targ.ads ada/snames.ads ada/system.ads \
+ ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/types.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads ada/system.ads \
ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-exctab.adb \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 0ddde729425..b5c4fb41550 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -1592,7 +1592,7 @@ ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ)))
endif
# *-elf
-ifeq ($(strip $(filter-out avr none powerpc% eabispe leon% erc32% unknown elf,$(targ))),)
+ifeq ($(strip $(filter-out lmp avr none powerpc% eabispe leon% erc32% unknown elf,$(targ))),)
TOOLS_TARGET_PAIRS=\
mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb \
indepsw.adb<indepsw-gnu.adb
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 7342fa3c9ed..e65701b9a05 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -6186,12 +6186,13 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, tree gnu_name,
expr_variable_p = false;
else
{
- /* Skip any conversions and simple arithmetics to see if the expression
- is based on a read-only variable.
+ /* Skip any conversions and simple constant arithmetics to see if the
+ expression is based on a read-only variable.
??? This really should remain read-only, but we have to think about
the typing of the tree here. */
- tree inner
- = skip_simple_arithmetic (remove_conversions (gnu_expr, true));
+ tree inner = remove_conversions (gnu_expr, true);
+
+ inner = skip_simple_constant_arithmetic (inner);
if (handled_component_p (inner))
{
diff --git a/gcc/ada/get_targ.adb b/gcc/ada/get_targ.adb
index 9eb588dd522..a2f7370f8e5 100644
--- a/gcc/ada/get_targ.adb
+++ b/gcc/ada/get_targ.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -25,6 +25,261 @@
package body Get_Targ is
+ -- Functions returning individual runtime. For the standard (GCC) back
+ -- end these come from C interface functions (one for each value).
+
+ -----------------------
+ -- Get_Bits_Per_Unit --
+ -----------------------
+
+ function Get_Bits_Per_Unit return Pos is
+ function C_Get_Bits_Per_Unit return Pos;
+ pragma Import (C, C_Get_Bits_Per_Unit,
+ "get_target_bits_per_unit");
+ begin
+ return C_Get_Bits_Per_Unit;
+ end Get_Bits_Per_Unit;
+
+ -----------------------
+ -- Get_Bits_Per_Word --
+ -----------------------
+
+ function Get_Bits_Per_Word return Pos is
+ function C_Get_Bits_Per_Word return Pos;
+ pragma Import (C, C_Get_Bits_Per_Word,
+ "get_target_bits_per_word");
+ begin
+ return C_Get_Bits_Per_Word;
+ end Get_Bits_Per_Word;
+
+ -------------------
+ -- Get_Char_Size --
+ -------------------
+
+ function Get_Char_Size return Pos is
+ function C_Get_Char_Size return Pos;
+ pragma Import (C, C_Get_Char_Size,
+ "get_target_char_size");
+ begin
+ return C_Get_Char_Size;
+ end Get_Char_Size;
+
+ ----------------------
+ -- Get_Wchar_T_Size --
+ ----------------------
+
+ function Get_Wchar_T_Size return Pos is
+ function C_Get_Wchar_T_Size return Pos;
+ pragma Import (C, C_Get_Wchar_T_Size,
+ "get_target_wchar_t_size");
+ begin
+ return C_Get_Wchar_T_Size;
+ end Get_Wchar_T_Size;
+
+ --------------------
+ -- Get_Short_Size --
+ --------------------
+
+ function Get_Short_Size return Pos is
+ function C_Get_Short_Size return Pos;
+ pragma Import (C, C_Get_Short_Size,
+ "get_target_short_size");
+ begin
+ return C_Get_Short_Size;
+ end Get_Short_Size;
+
+ ------------------
+ -- Get_Int_Size --
+ ------------------
+
+ function Get_Int_Size return Pos is
+ function C_Get_Int_Size return Pos;
+ pragma Import (C, C_Get_Int_Size,
+ "get_target_int_size");
+ begin
+ return C_Get_Int_Size;
+ end Get_Int_Size;
+
+ -------------------
+ -- Get_Long_Size --
+ -------------------
+
+ function Get_Long_Size return Pos is
+ function C_Get_Long_Size return Pos;
+ pragma Import (C, C_Get_Long_Size,
+ "get_target_long_size");
+ begin
+ return C_Get_Long_Size;
+ end Get_Long_Size;
+
+ ------------------------
+ -- Get_Long_Long_Size --
+ ------------------------
+
+ function Get_Long_Long_Size return Pos is
+ function C_Get_Long_Long_Size return Pos;
+ pragma Import (C, C_Get_Long_Long_Size,
+ "get_target_long_long_size");
+ begin
+ return C_Get_Long_Long_Size;
+ end Get_Long_Long_Size;
+
+ --------------------
+ -- Get_Float_Size --
+ --------------------
+
+ function Get_Float_Size return Pos is
+ function C_Get_Float_Size return Pos;
+ pragma Import (C, C_Get_Float_Size,
+ "get_target_float_size");
+ begin
+ return C_Get_Float_Size;
+ end Get_Float_Size;
+
+ ---------------------
+ -- Get_Double_Size --
+ ---------------------
+
+ function Get_Double_Size return Pos is
+ function C_Get_Double_Size return Pos;
+ pragma Import (C, C_Get_Double_Size,
+ "get_target_double_size");
+ begin
+ return C_Get_Double_Size;
+ end Get_Double_Size;
+
+ --------------------------
+ -- Get_Long_Double_Size --
+ --------------------------
+
+ function Get_Long_Double_Size return Pos is
+ function C_Get_Long_Double_Size return Pos;
+ pragma Import (C, C_Get_Long_Double_Size,
+ "get_target_long_double_size");
+ begin
+ return C_Get_Long_Double_Size;
+ end Get_Long_Double_Size;
+
+ ----------------------
+ -- Get_Pointer_Size --
+ ----------------------
+
+ function Get_Pointer_Size return Pos is
+ function C_Get_Pointer_Size return Pos;
+ pragma Import (C, C_Get_Pointer_Size,
+ "get_target_pointer_size");
+ begin
+ return C_Get_Pointer_Size;
+ end Get_Pointer_Size;
+
+ ---------------------------
+ -- Get_Maximum_Alignment --
+ ---------------------------
+
+ function Get_Maximum_Alignment return Pos is
+ function C_Get_Maximum_Alignment return Pos;
+ pragma Import (C, C_Get_Maximum_Alignment,
+ "get_target_maximum_alignment");
+ begin
+ return C_Get_Maximum_Alignment;
+ end Get_Maximum_Alignment;
+
+ ------------------------
+ -- Get_Float_Words_BE --
+ ------------------------
+
+ function Get_Float_Words_BE return Nat is
+ function C_Get_Float_Words_BE return Nat;
+ pragma Import (C, C_Get_Float_Words_BE,
+ "get_float_words_be");
+ begin
+ return C_Get_Float_Words_BE;
+ end Get_Float_Words_BE;
+
+ ------------------
+ -- Get_Words_BE --
+ ------------------
+
+ function Get_Words_BE return Nat is
+ function C_Get_Words_BE return Nat;
+ pragma Import (C, C_Get_Words_BE,
+ "get_words_be");
+ begin
+ return C_Get_Words_BE;
+ end Get_Words_BE;
+
+ ------------------
+ -- Get_Bytes_BE --
+ ------------------
+
+ function Get_Bytes_BE return Nat is
+ function C_Get_Bytes_BE return Nat;
+ pragma Import (C, C_Get_Bytes_BE,
+ "get_bytes_be");
+ begin
+ return C_Get_Bytes_BE;
+ end Get_Bytes_BE;
+
+ -----------------
+ -- Get_Bits_BE --
+ -----------------
+
+ function Get_Bits_BE return Nat is
+ function C_Get_Bits_BE return Nat;
+ pragma Import (C, C_Get_Bits_BE,
+ "get_bits_be");
+ begin
+ return C_Get_Bits_BE;
+ end Get_Bits_BE;
+
+ --------------------------
+ -- Get_Strict_Alignment --
+ --------------------------
+
+ function Get_Strict_Alignment return Nat is
+ function C_Get_Strict_Alignment return Nat;
+ pragma Import (C, C_Get_Strict_Alignment,
+ "get_target_strict_alignment");
+ begin
+ return C_Get_Strict_Alignment;
+ end Get_Strict_Alignment;
+
+ ------------------------------------
+ -- Get_System_Allocator_Alignment --
+ ------------------------------------
+
+ function Get_System_Allocator_Alignment return Nat is
+ function C_Get_System_Allocator_Alignment return Nat;
+ pragma Import (C, C_Get_System_Allocator_Alignment,
+ "get_target_system_allocator_alignment");
+ begin
+ return C_Get_System_Allocator_Alignment;
+ end Get_System_Allocator_Alignment;
+
+ --------------------------------
+ -- Get_Double_Float_Alignment --
+ --------------------------------
+
+ function Get_Double_Float_Alignment return Nat is
+ function C_Get_Double_Float_Alignment return Nat;
+ pragma Import (C, C_Get_Double_Float_Alignment,
+ "get_target_double_float_alignment");
+ begin
+ return C_Get_Double_Float_Alignment;
+ end Get_Double_Float_Alignment;
+
+ ---------------------------------
+ -- Get_Double_Scalar_Alignment --
+ ---------------------------------
+
+ function Get_Double_Scalar_Alignment return Nat is
+ function C_Get_Double_Scalar_Alignment return Nat;
+ pragma Import (C, C_Get_Double_Scalar_Alignment,
+ "get_target_double_scalar_alignment");
+ begin
+ return C_Get_Double_Scalar_Alignment;
+ end Get_Double_Scalar_Alignment;
+
----------------------
-- Digits_From_Size --
----------------------
@@ -55,6 +310,17 @@ package body Get_Targ is
return 64; -- Can be different on some targets (e.g., AAMP)
end Get_Max_Unaligned_Field;
+ -----------------------------
+ -- Register_Back_End_Types --
+ -----------------------------
+
+ procedure Register_Back_End_Types (Call_Back : Register_Type_Proc) is
+ procedure Enumerate_Modes (Call_Back : Register_Type_Proc);
+ pragma Import (C, Enumerate_Modes, "enumerate_modes");
+ begin
+ Enumerate_Modes (Call_Back);
+ end Register_Back_End_Types;
+
---------------------
-- Width_From_Size --
---------------------
diff --git a/gcc/ada/get_targ.ads b/gcc/ada/get_targ.ads
index 6cdbf7509a4..08af7f33855 100644
--- a/gcc/ada/get_targ.ads
+++ b/gcc/ada/get_targ.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -25,87 +25,90 @@
-- This package provides an Import to the C functions which provide
-- values related to types on the target system. It is only needed for
--- exp_dbug and the elaboration of ttypes.
+-- exp_dbug and the elaboration of ttypes, via the Set_Targs package.
+-- It also contains the routine for registering floating-point types.
-- NOTE: Any changes in this package must be reflected in jgettarg.ads
--- and aa_getta.ads!
+-- and aa_getta.ads and any other versions of this package.
-- Note that all these values return sizes of C types with corresponding
-- names. This allows GNAT to define the corresponding Ada types to have
--- the same representation. There is one exception to this: the
--- Wide_Character_Type uses twice the size of a C char, instead of the
+-- the same representation. There is one exception to this general rule:
+-- the Wide_Character_Type uses twice the size of a C char, instead of the
-- size of wchar_t.
+with Einfo; use Einfo;
with Types; use Types;
package Get_Targ is
- pragma Preelaborate;
- function Get_Bits_Per_Unit return Pos;
- pragma Import (C, Get_Bits_Per_Unit, "get_target_bits_per_unit");
+ -- Functions returning individual runtime values
- function Get_Bits_Per_Word return Pos;
- pragma Import (C, Get_Bits_Per_Word, "get_target_bits_per_word");
+ function Get_Bits_Per_Unit return Pos;
+ -- System.Storage_Unit
- function Get_Char_Size return Pos; -- Standard.Character'Size
- pragma Import (C, Get_Char_Size, "get_target_char_size");
+ function Get_Bits_Per_Word return Pos;
+ -- System.Word_Size
- function Get_Wchar_T_Size return Pos; -- Interfaces.C.wchar_t'Size
- pragma Import (C, Get_Wchar_T_Size, "get_target_wchar_t_size");
+ function Get_Char_Size return Pos;
+ -- Size of Standard.Character
- function Get_Short_Size return Pos; -- Standard.Short_Integer'Size
- pragma Import (C, Get_Short_Size, "get_target_short_size");
+ function Get_Wchar_T_Size return Pos;
+ -- Size of Interfaces.C.wchar_t
- function Get_Int_Size return Pos; -- Standard.Integer'Size
- pragma Import (C, Get_Int_Size, "get_target_int_size");
+ function Get_Short_Size return Pos;
+ -- Size of Standard.Short_Integer
- function Get_Long_Size return Pos; -- Standard.Long_Integer'Size
- pragma Import (C, Get_Long_Size, "get_target_long_size");
+ function Get_Int_Size return Pos;
+ -- Size of Standard.Integer
- function Get_Long_Long_Size return Pos; -- Standard.Long_Long_Integer'Size
- pragma Import (C, Get_Long_Long_Size, "get_target_long_long_size");
+ function Get_Long_Size return Pos;
+ -- Size of Standard.Long_Integer
- function Get_Float_Size return Pos; -- Standard.Float'Size
- pragma Import (C, Get_Float_Size, "get_target_float_size");
+ function Get_Long_Long_Size return Pos;
+ -- Size of Standard.Long_Long_Integer
- function Get_Double_Size return Pos; -- Standard.Long_Float'Size
- pragma Import (C, Get_Double_Size, "get_target_double_size");
+ function Get_Float_Size return Pos;
+ -- Size of Standard.Float
- function Get_Long_Double_Size return Pos; -- Standard.Long_Long_Float'Size
- pragma Import (C, Get_Long_Double_Size, "get_target_long_double_size");
+ function Get_Double_Size return Pos;
+ -- Size of Standard.Long_Float
- function Get_Pointer_Size return Pos; -- System.Address'Size
- pragma Import (C, Get_Pointer_Size, "get_target_pointer_size");
+ function Get_Long_Double_Size return Pos;
+ -- Size of Standard.Long_Long_Float
- function Get_Maximum_Alignment return Pos;
- pragma Import (C, Get_Maximum_Alignment, "get_target_maximum_alignment");
+ function Get_Pointer_Size return Pos;
+ -- Size of System.Address
- function Get_Float_Words_BE return Nat;
- pragma Import (C, Get_Float_Words_BE, "get_float_words_be");
+ function Get_Maximum_Alignment return Pos;
+ -- Maximum supported alignment
- function Get_Words_BE return Nat;
- pragma Import (C, Get_Words_BE, "get_words_be");
+ function Get_Float_Words_BE return Nat;
+ -- Non-zero iff float words big endian
- function Get_Bytes_BE return Nat;
- pragma Import (C, Get_Bytes_BE, "get_bytes_be");
+ function Get_Words_BE return Nat;
+ -- Non-zero iff integer words big endian
- function Get_Bits_BE return Nat;
- pragma Import (C, Get_Bits_BE, "get_bits_be");
+ function Get_Bytes_BE return Nat;
+ -- Non-zero iff bytes big-endian
- function Get_Strict_Alignment return Nat;
- pragma Import (C, Get_Strict_Alignment, "get_target_strict_alignment");
+ function Get_Bits_BE return Nat;
+ -- Non-zero iff bit order big endian
+
+ function Get_Strict_Alignment return Nat;
+ -- Non-zero if target requires strict alignent
function Get_System_Allocator_Alignment return Nat;
- pragma Import (C, Get_System_Allocator_Alignment,
- "get_target_system_allocator_alignment");
+ -- Alignment guaranteed by malloc falls
+
+ function Get_Double_Float_Alignment return Nat;
+ -- Alignment required for Long_Float or 0 if no special requirement
- function Get_Double_Float_Alignment return Nat;
- pragma Import (C, Get_Double_Float_Alignment,
- "get_target_double_float_alignment");
+ function Get_Double_Scalar_Alignment return Nat;
+ -- Alignment required for Long_Long_Integer or larger integer types
+ -- or 0 if no special requirement.
- function Get_Double_Scalar_Alignment return Nat;
- pragma Import (C, Get_Double_Scalar_Alignment,
- "get_target_double_scalar_alignment");
+ -- Other subprograms
function Get_Max_Unaligned_Field return Pos;
-- Returns the maximum supported size in bits for a field that is
@@ -115,4 +118,23 @@ package Get_Targ is
function Digits_From_Size (Size : Pos) return Pos;
-- Calculate values for 'Width or 'Digits from 'Size
+ type C_String is array (0 .. 255) of aliased Character;
+ pragma Convention (C, C_String);
+
+ type Register_Type_Proc is access procedure
+ (C_Name : C_String; -- Nul-terminated string with name of type
+ Digs : Natural; -- Digits for floating point, 0 otherwise
+ Complex : Boolean; -- True iff type has real and imaginary parts
+ Count : Natural; -- Number of elements in vector, 0 otherwise
+ Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
+ Size : Positive; -- Size of representation in bits
+ Alignment : Natural); -- Required alignment in bits
+ pragma Convention (C, Register_Type_Proc);
+ -- Call back procedure for Register_Back_End_Types. This is to be used by
+ -- Create_Standard to create predefined types for all types supported by
+ -- the back end.
+
+ procedure Register_Back_End_Types (Call_Back : Register_Type_Proc);
+ -- Calls the Call_Back function with information for each supported type
+
end Get_Targ;
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index 4cfc3392f24..10ad1e907d3 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -61,6 +61,7 @@ with Sem_Ch13;
with Sem_Elim;
with Sem_Eval;
with Sem_Type;
+with Set_Targ;
with Sinfo; use Sinfo;
with Sinput.L; use Sinput.L;
with Snames;
@@ -110,11 +111,10 @@ procedure Gnat1drv is
procedure Adjust_Global_Switches is
begin
- -- Debug flag -gnatd.I is a synonym for Generate_SCIL and requires code
- -- generation.
+ -- -gnatd.M enables Relaxed_RM_Semantics
- if Debug_Flag_Dot_II and then Operating_Mode = Generate_Code then
- Generate_SCIL := True;
+ if Debug_Flag_Dot_MM then
+ Relaxed_RM_Semantics := True;
end if;
-- Disable CodePeer_Mode in Check_Syntax, since we need front-end
@@ -240,11 +240,9 @@ procedure Gnat1drv is
Generate_SCIL := True;
- -- Enable assertions and debug pragmas, since they give CodePeer
- -- valuable extra information.
+ -- Enable assertions, since they give CodePeer valuable extra info
Assertions_Enabled := True;
- Debug_Pragmas_Enabled := True;
-- Disable all simple value propagation. This is an optimization
-- which is valuable for code optimization, and also for generation
@@ -275,6 +273,17 @@ procedure Gnat1drv is
Force_ALI_Tree_File := True;
Try_Semantics := True;
+
+ -- Make the Ada front-end more liberal so that the compiler will
+ -- allow illegal code that is allowed by other compilers. CodePeer
+ -- is in the business of finding problems, not enforcing rules!
+ -- This is useful when using CodePeer mode with other compilers.
+
+ Relaxed_RM_Semantics := True;
+ end if;
+
+ if Relaxed_RM_Semantics then
+ Overriding_Renamings := True;
end if;
-- Set switches for formal verification mode
@@ -283,8 +292,15 @@ procedure Gnat1drv is
Formal_Extensions := True;
end if;
+ -- Enable Alfa_Mode when using -gnatd.F switch
+
if Debug_Flag_Dot_FF then
Alfa_Mode := True;
+ end if;
+
+ -- Alfa_Mode is also activated by default in the gnat2why executable
+
+ if Alfa_Mode then
-- Set strict standard interpretation of compiler permissions
@@ -292,6 +308,18 @@ procedure Gnat1drv is
Strict_Alfa_Mode := True;
end if;
+ -- Distinguish between the two modes of gnat2why: frame condition
+ -- generation (generation of ALI files) and translation of Why (no
+ -- ALI files generated). This is done with the switch -gnatd.G,
+ -- which activates frame condition mode. The other changes in
+ -- behavior depending on this switch are done in gnat2why directly.
+
+ if Debug_Flag_Dot_GG then
+ Frame_Condition_Mode := True;
+ else
+ Opt.Disable_ALI_File := True;
+ end if;
+
-- Turn off inlining, which would confuse formal verification output
-- and gain nothing.
@@ -371,11 +399,10 @@ procedure Gnat1drv is
Use_Expression_With_Actions := False;
- -- Enable assertions and debug pragmas, since they give valuable
- -- extra information for formal verification.
+ -- Enable assertions, since they give valuable extra information for
+ -- formal verification.
- Assertions_Enabled := True;
- Debug_Pragmas_Enabled := True;
+ Assertions_Enabled := True;
-- Turn off style check options since we are not interested in any
-- front-end warnings when we are getting Alfa output.
@@ -398,6 +425,7 @@ procedure Gnat1drv is
-- which is more complex to formally verify than the original source.
Tagged_Type_Expansion := False;
+
end if;
-- Set Configurable_Run_Time mode if system.ads flag set
@@ -848,6 +876,14 @@ begin
Usage;
end if;
+ -- Generate target dependent output file if requested
+
+ if Target_Dependent_Info_Write_Name /= null then
+ Set_Targ.Write_Target_Dependent_Values;
+ end if;
+
+ -- Call the front end
+
Original_Operating_Mode := Operating_Mode;
Frontend;
@@ -1020,11 +1056,24 @@ begin
elsif Main_Kind in N_Generic_Renaming_Declaration then
Back_End_Mode := Generate_Object;
- -- It's not an error to generate SCIL for e.g. a spec which has a body
+ -- It is not an error to analyze in CodePeer mode a spec which requires
+ -- a body, in order to generate SCIL for this spec.
elsif CodePeer_Mode then
Back_End_Mode := Generate_Object;
+ -- It is not an error to analyze in Alfa mode a spec which requires a
+ -- body, when the body is not available. During frame condition
+ -- generation, the corresponding ALI file is generated. During
+ -- translation to Why, Why code is generated for the spec.
+
+ elsif Alfa_Mode then
+ if Frame_Condition_Mode then
+ Back_End_Mode := Declarations_Only;
+ else
+ Back_End_Mode := Generate_Object;
+ end if;
+
-- In all other cases (specs which have bodies, generics, and bodies
-- where subunits are missing), we cannot generate code and we generate
-- a warning message. Note that generic instantiations are gone at this
@@ -1207,7 +1256,7 @@ begin
Errout.Finalize (Last_Call => True);
Errout.Output_Messages;
- List_Rep_Info;
+ List_Rep_Info (Ttypes.Bytes_Big_Endian);
List_Inlining_Info;
-- Only write the library if the backend did not generate any error
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 3ef8a524544..130ee3c0f72 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -548,6 +548,8 @@ The GNAT Library
* System.Address_Image (s-addima.ads)::
* System.Assertions (s-assert.ads)::
* System.Memory (s-memory.ads)::
+* System.Multiprocessors (s-multip.ads)::
+* System.Multiprocessors.Dispatching_Domains (s-mudido.ads)::
* System.Partition_Interface (s-parint.ads)::
* System.Pool_Global (s-pooglo.ads)::
* System.Pool_Local (s-pooloc.ads)::
@@ -1227,47 +1229,69 @@ addition.
@node Pragma Assertion_Policy
@unnumberedsec Pragma Assertion_Policy
-@findex Debug_Policy
+@findex Assertion_Policy
@noindent
Syntax:
-
@smallexample @c ada
pragma Assertion_Policy (CHECK | DISABLE | IGNORE);
+
+Pragma Assertion_Policy (
+ ASSERTION_KIND => POLICY_IDENTIFIER
+ @{, ASSERTION_KIND => POLICY_IDENTIFIER@});
+
+ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND
+
+RM_ASSERTION_KIND ::= Assert |
+ Static_Predicate |
+ Dynamic_Predicate |
+ Pre |
+ Pre'Class |
+ Post |
+ Post'Class |
+ Type_Invariant |
+ Type_Invariant'Class
+
+ID_ASSERTION_KIND ::= Assert_And_Cut |
+ Assume |
+ Contract_Cases |
+ Debug |
+ Invariant |
+ Invariant'Class |
+ Loop_Invariant |
+ Loop_Variant |
+ Postcondition |
+ Precondition |
+ Predicate
+
+POLICY_IDENTIFIER ::= Check | Disable | Ignore
@end smallexample
@noindent
-This is a standard Ada 2005 pragma that is available as an
+This is a standard Ada 2012 pragma that is available as an
implementation-defined pragma in earlier versions of Ada.
-
-If the argument is @code{CHECK}, then assertions are enabled.
-If the argument is @code{IGNORE}, then assertions are ignored.
+The assertion kinds @code{RM_ASSERTION_KIND} are those defined in
+the Ada standard. The assertion kinds @code{ID_ASSERTION_KIND}
+are implementation defined additions recognized by the GNAT compiler.
+
+The pragma applies in both cases to pragmas and aspects with matching
+names, e.g. @code{Pre} applies to the Pre aspect, and @code{Precondition}
+applies to both the @code{Precondition} pragma
+and the aspect @code{Precondition}.
+
+If the policy is @code{CHECK}, then assertions are enabled, i.e.
+the corresponding pragma or aspect is activated.
+If the policy is @code{IGNORE}, then assertions are ignored, i.e.
+the corresponding pragma or aspect is deactivated.
This pragma overrides the effect of the @option{-gnata} switch on the
command line.
-Assertions are of three kinds:
-
-@itemize @bullet
-@item
-Pragma @code{Assert}.
-@item
-In Ada 2012, all assertions defined in the RM as aspects: preconditions,
-postconditions, type invariants and (sub)type predicates.
-@item
-Corresponding pragmas for type invariants and (sub)type predicates.
-@end itemize
-
The implementation defined policy @code{DISABLE} is like
@code{IGNORE} except that it completely disables semantic
-checking of the argument to @code{pragma Assert}. This may
-be useful when the pragma argument references subprograms
+checking of the corresponding pragma or aspect. This is
+useful when the pragma or aspect argument references subprograms
in a with'ed package which is replaced by a dummy package
for the final build.
-Note: this is a standard language-defined pragma in versions
-of Ada from 2005 on. In GNAT, it is implemented in all versions
-of Ada, and the DISABLE policy is an implementation-defined
-addition.
-
@node Pragma Assume_No_Invalid_Values
@unnumberedsec Pragma Assume_No_Invalid_Values
@findex Assume_No_Invalid_Values
@@ -1414,9 +1438,12 @@ passing mechanisms on a parameter by parameter basis.
Syntax:
@smallexample @c ada
pragma Check (
- [Name =>] Identifier,
+ [Name =>] CHECK_KIND,
[Check =>] Boolean_EXPRESSION
[, [Message =>] string_EXPRESSION] );
+
+CHECK_KIND ::= IDENTIFIER |
+ Pre'Class | Post'Class | Type_Invariant'Class
@end smallexample
@noindent
@@ -1424,10 +1451,7 @@ This pragma is similar to the predefined pragma @code{Assert} except that an
extra identifier argument is present. In conjunction with pragma
@code{Check_Policy}, this can be used to define groups of assertions that can
be independently controlled. The identifier @code{Assertion} is special, it
-refers to the normal set of pragma @code{Assert} statements. The identifiers
-@code{Precondition} and @code{Postcondition} correspond to the pragmas of these
-names, so these three names would normally not be used directly in a pragma
-@code{Check}.
+refers to the normal set of pragma @code{Assert} statements.
Checks introduced by this pragma are normally deactivated by default. They can
be activated either by the command line option @option{-gnata}, which turns on
@@ -1516,6 +1540,9 @@ the current unit, or if it appears at the start of any unit that
is part of the dependency set of the current unit (e.g., units that
are mentioned in @code{with} clauses).
+Check names introduced by this pragma are subject to control by compiler
+switches (in particular -gnatp) in the usual manner.
+
@node Pragma Check_Policy
@unnumberedsec Pragma Check_Policy
@cindex Controlling assertions
@@ -1527,22 +1554,50 @@ are mentioned in @code{with} clauses).
Syntax:
@smallexample @c ada
pragma Check_Policy
- ([Name =>] Identifier,
+ ([Name =>] CHECK_KIND,
[Policy =>] POLICY_IDENTIFIER);
+Pragma Check_Policy (
+ CHECK_KIND => POLICY_IDENTIFIER
+ @{, CHECK_KIND => POLICY_IDENTIFIER@});
+
+ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND
+
+CHECK_KIND ::= IDENTIFIER |
+ Pre'Class |
+ Post'Class |
+ Type_Invariant'Class |
+ Invariant'Class
+
+The identifiers Name and Policy are not allowed as CHECK_KIND values. This
+avoids confusion between the two possible syntax forms for this pragma.
+
POLICY_IDENTIFIER ::= ON | OFF | CHECK | DISABLE | IGNORE
@end smallexample
@noindent
-This pragma is similar to the predefined pragma @code{Assertion_Policy},
-except that it controls sets of named assertions introduced using the
-@code{Check} pragmas. It can be used as a configuration pragma or (unlike
-@code{Assertion_Policy}) can be used within a declarative part, in which case
-it controls the status to the end of the corresponding construct (in a manner
-identical to pragma @code{Suppress)}.
+This pragma is used to set the checking policy for assertions (specified
+by aspects or pragmas), the @code{Debug} pragma, or additional checks
+to be checked using the @code{Check} pragma. It may appear either as
+a configuration pragma, or within a declarative part of package. In the
+latter case, it applies from the point where it appears to the end of
+the declarative region (like pragma @code{Suppress}).
-The identifier given as the first argument corresponds to a name used in
-associated @code{Check} pragmas. For example, if the pragma:
+The @code{Check_Policy} pragma is similar to the
+predefined @code{Assertion_Policy} pragma,
+and if the check kind corresponds to one of the assertion kinds that
+are allowed by @code{Assertion_Policy}, then the effect is identical.
+
+If the first argument is Debug, then the policy applies to Debug pragmas,
+disabling their effect if the policy is @code{Off}, @code{Disable}, or
+@code{Ignore}, and allowing them to execute with normal semantics if
+the policy is @code{On} or @code{Check}. In addition if the policy is
+@code{Disable}, then the procedure call in @code{Debug} pragmas will
+be totally ignored and not analyzed semanticslly.
+
+Finally the first argument may be some other identifier than the above
+posibilities, in which case it controls a set of named assertions
+that can be checked using pragma @code{Check}. For example, if the pragma:
@smallexample @c ada
pragma Check_Policy (Critical_Error, OFF);
@@ -1550,37 +1605,18 @@ pragma Check_Policy (Critical_Error, OFF);
@noindent
is given, then subsequent @code{Check} pragmas whose first argument is also
-@code{Critical_Error} will be disabled. The special identifier @code{Assertion}
-controls the behavior of normal assertions (thus a pragma
-@code{Check_Policy} with this identifier is similar to the normal
-@code{Assertion_Policy} pragma except that it can appear within a
-declarative part).
-
-The special identifiers @code{Precondition} and @code{Postcondition} control
-the status of preconditions and postconditions given as pragmas.
-If a @code{Precondition} pragma
-is encountered, it is ignored if turned off by a @code{Check_Policy} specifying
-that @code{Precondition} checks are @code{Off} or @code{Ignored}. Similarly use
-of the name @code{Postcondition} controls whether @code{Postcondition} pragmas
-are recognized. Note that preconditions and postconditions given as aspects
-are controlled differently, either by the @code{Assertion_Policy} pragma or
-by the @code{Check_Policy} pragma with identifier @code{Assertion}.
+@code{Critical_Error} will be disabled.
The check policy is @code{OFF} to turn off corresponding checks, and @code{ON}
to turn on corresponding checks. The default for a set of checks for which no
@code{Check_Policy} is given is @code{OFF} unless the compiler switch
@option{-gnata} is given, which turns on all checks by default.
-The check policy settings @code{CHECK} and @code{IGNORE} are also recognized
+The check policy settings @code{CHECK} and @code{IGNORE} are recognized
as synonyms for @code{ON} and @code{OFF}. These synonyms are provided for
-compatibility with the standard @code{Assertion_Policy} pragma.
-
-The implementation defined policy @code{DISABLE} is like
-@code{OFF} except that it completely disables semantic
-checking of the argument to the corresponding class of
-pragmas. This may be useful when the pragma arguments reference
-subprograms in a with'ed package which is replaced by a dummy package
-for the final build.
+compatibility with the standard @code{Assertion_Policy} pragma. The check
+policy setting @code{DISABLE} causes the second argument of a corresponding
+@code{Check} pragma to be completely ignored and not analyzed.
@node Pragma Comment
@unnumberedsec Pragma Comment
@@ -2108,7 +2144,8 @@ corresponding to the argument with a terminating semicolon. Pragmas are
permitted in sequences of declarations, so you can use pragma @code{Debug} to
intersperse calls to debug procedures in the middle of declarations. Debug
pragmas can be enabled either by use of the command line switch @option{-gnata}
-or by use of the configuration pragma @code{Debug_Policy}.
+or by use of the pragma @code{Check_Policy} with a first argument of
+@code{Debug}.
@node Pragma Debug_Policy
@unnumberedsec Pragma Debug_Policy
@@ -2117,21 +2154,13 @@ or by use of the configuration pragma @code{Debug_Policy}.
Syntax:
@smallexample @c ada
-pragma Debug_Policy (CHECK | DISABLE | IGNORE);
+pragma Debug_Policy (CHECK | DISABLE | IGNORE | ON | OFF);
@end smallexample
@noindent
-If the argument is @code{CHECK}, then pragma @code{DEBUG} is enabled.
-If the argument is @code{IGNORE}, then pragma @code{DEBUG} is ignored.
-This pragma overrides the effect of the @option{-gnata} switch on the
-command line.
-
-The implementation defined policy @code{DISABLE} is like
-@code{IGNORE} except that it completely disables semantic
-checking of the argument to @code{pragma Debug}. This may
-be useful when the pragma argument references subprograms
-in a with'ed package which is replaced by a dummy package
-for the final build.
+This pragma is equivalent to a corresponding @code{Check_Policy} pragma
+with a first argument of @code{Debug}. It is retained for historical
+compatibility reasons.
@node Pragma Default_Storage_Pool
@unnumberedsec Pragma Default_Storage_Pool
@@ -4029,7 +4058,7 @@ earlier versions of the package body.
Syntax:
@smallexample @c ada
-pragma No_Inline (NAME [, NAME]);
+pragma No_Inline (NAME @{, NAME@});
@end smallexample
@noindent
@@ -4857,10 +4886,10 @@ priority-ordered scheduling policy.
@item Locking_Policy (Ceiling_Locking)
[RM D.3] While tasks and interrupts execute a protected action, they inherit
the ceiling priority of the corresponding protected object.
-@c
-@c @item Detect_Blocking
-@c This pragma forces the detection of potentially blocking operations within a
-@c protected operation, and to raise Program_Error if that happens.
+
+@item Detect_Blocking
+This pragma forces the detection of potentially blocking operations within a
+protected operation, and to raise Program_Error if that happens.
@end table
@noindent
@@ -7130,7 +7159,7 @@ what is passed to @code{Allocate} and returned from @code{Deallocate}.
the number of values represented by the subtype (zero for a null
range). The result is static for static subtypes. @code{Range_Length}
applied to the index subtype of a one dimensional array always gives the
-same result as @code{Range} applied to the array itself.
+same result as @code{Length} applied to the array itself.
@node Ref
@unnumberedsec Ref
@@ -14256,6 +14285,25 @@ The use of these parameters is described later in this section. If an
unrecognized keyword appears in a form string, it is silently ignored
and not considered invalid.
+@noindent
+For OpenVMS additional FORM string keywords are available for use with
+RMS services. The syntax is:
+
+@smallexample
+VMS_RMS_Keys=(keyword=value,@dots{},keyword=value)
+@end smallexample
+
+@noindent
+The following RMS keywords and values are currently defined:
+
+@smallexample
+Context=Force_Stream_Mode|Force_Record_Mode
+@end smallexample
+
+@noindent
+VMS RMS keys are silently ignored on non-VMS systems. On OpenVMS
+unimplented RMS keywords, values, or invalid syntax will raise Use_Error.
+
@node Direct_IO
@section Direct_IO
@@ -15505,6 +15553,8 @@ of GNAT, and will generate a warning message.
* System.Address_Image (s-addima.ads)::
* System.Assertions (s-assert.ads)::
* System.Memory (s-memory.ads)::
+* System.Multiprocessors (s-multip.ads)::
+* System.Multiprocessors.Dispatching_Domains (s-mudido.ads)::
* System.Partition_Interface (s-parint.ads)::
* System.Pool_Global (s-pooglo.ads)::
* System.Pool_Local (s-pooloc.ads)::
@@ -16967,6 +17017,22 @@ allocation mechanisms for the default pool, and in addition, direct
calls to this unit may be made for low level allocation uses (for
example see the body of @code{GNAT.Tables}).
+@node System.Multiprocessors (s-multip.ads)
+@section @code{System.Multiprocessors} (@file{s-multip.ads})
+@cindex @code{System.Multiprocessors} (@file{s-multip.ads})
+@cindex Multiprocessor interface
+This is an Ada 2012 unit defined in the Ada 2012 Reference Manual, but
+in GNAT we also make it available in Ada 95 and Ada 2005 (where it is
+technically an implementation-defined addition).
+
+@node System.Multiprocessors.Dispatching_Domains (s-mudido.ads)
+@section @code{System.Multiprocessors.Dispatching_Domains} (@file{s-mudido.ads})
+@cindex @code{System.Multiprocessors.Dispatching_Domains} (@file{s-mudido.ads})
+@cindex Multiprocessor interface
+This is an Ada 2012 unit defined in the Ada 2012 Reference Manual, but
+in GNAT we also make it available in Ada 95 and Ada 2005 (where it is
+technically an implementation-defined addition).
+
@node System.Partition_Interface (s-parint.ads)
@section @code{System.Partition_Interface} (@file{s-parint.ads})
@cindex @code{System.Partition_Interface} (@file{s-parint.ads})
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 1af8a943ef7..e1cd61abc4a 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -169,39 +169,39 @@ AdaCore@*
* About This Guide::
* Getting Started with GNAT::
* The GNAT Compilation Model::
-* Compiling Using gcc::
-* Binding Using gnatbind::
-* Linking Using gnatlink::
+* Compiling with gcc::
+* Binding with gnatbind::
+* Linking with gnatlink::
* The GNAT Make Program gnatmake::
* Improving Performance::
-* Renaming Files Using gnatchop::
+* Renaming Files with gnatchop::
* Configuration Pragmas::
-* Handling Arbitrary File Naming Conventions Using gnatname::
+* Handling Arbitrary File Naming Conventions with gnatname::
* GNAT Project Manager::
* Tools Supporting Project Files::
* The Cross-Referencing Tools gnatxref and gnatfind::
* The GNAT Pretty-Printer gnatpp::
-* The GNAT Metric Tool gnatmetric::
-* File Name Krunching Using gnatkr::
-* Preprocessing Using gnatprep::
+* The GNAT Metrics Tool gnatmetric::
+* File Name Krunching with gnatkr::
+* Preprocessing with gnatprep::
* The GNAT Library Browser gnatls::
-* Cleaning Up Using gnatclean::
+* Cleaning Up with gnatclean::
@ifclear vms
* GNAT and Libraries::
* Using the GNU make Utility::
@end ifclear
* Memory Management Issues::
* Stack Related Facilities::
-* Verifying Properties Using gnatcheck::
-* Creating Sample Bodies Using gnatstub::
-* Creating Unit Tests Using gnattest::
+* Verifying Properties with gnatcheck::
+* Creating Sample Bodies with gnatstub::
+* Creating Unit Tests with gnattest::
* Performing Dimensionality Analysis in GNAT::
* Generating Ada Bindings for C and C++ headers::
* Other Utility Programs::
-* Running and Debugging Ada Programs::
@ifclear vms
* Code Coverage and Profiling::
@end ifclear
+* Running and Debugging Ada Programs::
@ifset vms
* Compatibility with HP Ada::
@end ifset
@@ -212,468 +212,10 @@ AdaCore@*
* Conditional Compilation::
* Inline Assembler::
* Compatibility and Porting Guide::
-@ifset unw
* Microsoft Windows Topics::
* Mac OS Topics::
-@end ifset
* GNU Free Documentation License::
* Index::
-
- --- The Detailed Node Listing ---
-
-About This Guide
-
-* What This Guide Contains::
-* What You Should Know before Reading This Guide::
-* Related Information::
-* Conventions::
-
-Getting Started with GNAT
-
-* Running GNAT::
-* Running a Simple Ada Program::
-* Running a Program with Multiple Units::
-* Using the gnatmake Utility::
-@ifset vms
-* Editing with Emacs::
-@end ifset
-@ifclear vms
-* Introduction to GPS::
-@end ifclear
-
-The GNAT Compilation Model
-
-* Source Representation::
-* Foreign Language Representation::
-* File Naming Rules::
-* Using Other File Names::
-* Alternative File Naming Schemes::
-* Generating Object Files::
-* Source Dependencies::
-* The Ada Library Information Files::
-* Binding an Ada Program::
-* Mixed Language Programming::
-@ifclear vms
-* Building Mixed Ada & C++ Programs::
-* Comparison between GNAT and C/C++ Compilation Models::
-@end ifclear
-* Comparison between GNAT and Conventional Ada Library Models::
-@ifset vms
-* Placement of temporary files::
-@end ifset
-
-Foreign Language Representation
-
-* Latin-1::
-* Other 8-Bit Codes::
-* Wide Character Encodings::
-
-Compiling Ada Programs With gcc
-
-* Compiling Programs::
-* Switches for gcc::
-* Search Paths and the Run-Time Library (RTL)::
-* Order of Compilation Issues::
-* Examples::
-
-Switches for gcc
-
-* Output and Error Message Control::
-* Warning Message Control::
-* Debugging and Assertion Control::
-* Validity Checking::
-* Style Checking::
-* Run-Time Checks::
-* Using gcc for Syntax Checking::
-* Using gcc for Semantic Checking::
-* Compiling Different Versions of Ada::
-* Character Set Control::
-* File Naming Control::
-* Subprogram Inlining Control::
-* Auxiliary Output Control::
-* Debugging Control::
-* Exception Handling Control::
-* Units to Sources Mapping Files::
-* Integrated Preprocessing::
-@ifset vms
-* Return Codes::
-@end ifset
-
-Binding Ada Programs With gnatbind
-
-* Running gnatbind::
-* Switches for gnatbind::
-* Command-Line Access::
-* Search Paths for gnatbind::
-* Examples of gnatbind Usage::
-
-Switches for gnatbind
-
-* Consistency-Checking Modes::
-* Binder Error Message Control::
-* Elaboration Control::
-* Output Control::
-* Binding with Non-Ada Main Programs::
-* Binding Programs with No Main Subprogram::
-
-Linking Using gnatlink
-
-* Running gnatlink::
-* Switches for gnatlink::
-
-The GNAT Make Program gnatmake
-
-* Running gnatmake::
-* Switches for gnatmake::
-* Mode Switches for gnatmake::
-* Notes on the Command Line::
-* How gnatmake Works::
-* Examples of gnatmake Usage::
-
-Improving Performance
-* Performance Considerations::
-* Text_IO Suggestions::
-* Reducing Size of Ada Executables with gnatelim::
-* Reducing Size of Executables with unused subprogram/data elimination::
-
-Performance Considerations
-* Controlling Run-Time Checks::
-* Use of Restrictions::
-* Optimization Levels::
-* Debugging Optimized Code::
-* Inlining of Subprograms::
-* Vectorization of loops::
-* Other Optimization Switches::
-* Optimization and Strict Aliasing::
-@ifset vms
-* Coverage Analysis::
-@end ifset
-
-Reducing Size of Ada Executables with gnatelim
-* About gnatelim::
-* Running gnatelim::
-* Processing Precompiled Libraries::
-* Correcting the List of Eliminate Pragmas::
-* Making Your Executables Smaller::
-* Summary of the gnatelim Usage Cycle::
-
-Reducing Size of Executables with unused subprogram/data elimination
-* About unused subprogram/data elimination::
-* Compilation options::
-
-Renaming Files Using gnatchop
-
-* Handling Files with Multiple Units::
-* Operating gnatchop in Compilation Mode::
-* Command Line for gnatchop::
-* Switches for gnatchop::
-* Examples of gnatchop Usage::
-
-Configuration Pragmas
-
-* Handling of Configuration Pragmas::
-* The Configuration Pragmas Files::
-
-Handling Arbitrary File Naming Conventions Using gnatname
-
-* Arbitrary File Naming Conventions::
-* Running gnatname::
-* Switches for gnatname::
-* Examples of gnatname Usage::
-
-The Cross-Referencing Tools gnatxref and gnatfind
-
-* Switches for gnatxref::
-* Switches for gnatfind::
-* Project Files for gnatxref and gnatfind::
-* Regular Expressions in gnatfind and gnatxref::
-* Examples of gnatxref Usage::
-* Examples of gnatfind Usage::
-
-The GNAT Pretty-Printer gnatpp
-
-* Switches for gnatpp::
-* Formatting Rules::
-
-The GNAT Metrics Tool gnatmetric
-
-* Switches for gnatmetric::
-
-File Name Krunching Using gnatkr
-
-* About gnatkr::
-* Using gnatkr::
-* Krunching Method::
-* Examples of gnatkr Usage::
-
-Preprocessing Using gnatprep
-* Preprocessing Symbols::
-* Using gnatprep::
-* Switches for gnatprep::
-* Form of Definitions File::
-* Form of Input Text for gnatprep::
-
-The GNAT Library Browser gnatls
-
-* Running gnatls::
-* Switches for gnatls::
-* Examples of gnatls Usage::
-
-Cleaning Up Using gnatclean
-
-* Running gnatclean::
-* Switches for gnatclean::
-@c * Examples of gnatclean Usage::
-
-@ifclear vms
-
-GNAT and Libraries
-
-* Introduction to Libraries in GNAT::
-* General Ada Libraries::
-* Stand-alone Ada Libraries::
-* Rebuilding the GNAT Run-Time Library::
-
-Using the GNU make Utility
-
-* Using gnatmake in a Makefile::
-* Automatically Creating a List of Directories::
-* Generating the Command Line Switches::
-* Overcoming Command Line Length Limits::
-@end ifclear
-
-Memory Management Issues
-
-* Some Useful Memory Pools::
-* The GNAT Debug Pool Facility::
-@ifclear vms
-* The gnatmem Tool::
-@end ifclear
-
-Stack Related Facilities
-
-* Stack Overflow Checking::
-* Static Stack Usage Analysis::
-* Dynamic Stack Usage Analysis::
-
-Some Useful Memory Pools
-
-The GNAT Debug Pool Facility
-
-@ifclear vms
-The gnatmem Tool
-
-* Running gnatmem::
-* Switches for gnatmem::
-* Example of gnatmem Usage::
-@end ifclear
-
-Verifying Properties Using gnatcheck
-
-Sample Bodies Using gnatstub
-
-* Running gnatstub::
-* Switches for gnatstub::
-
-Creating Unit Tests Using gnattest
-
-* Running gnattest::
-* Switches for gnattest::
-* Project Attributes for gnattest::
-* Simple Example::
-* Setting Up and Tearing Down the Testing Environment::
-* Regenerating Tests::
-* Default Test Behavior::
-* Testing Primitive Operations of Tagged Types::
-* Testing Inheritance::
-* Tagged Types Substitutability Testing::
-* Testing with Contracts::
-* Additional Tests::
-@ifclear vms
-* Support for other platforms/run-times::
-@end ifclear
-* Current Limitations::
-
-Other Utility Programs
-
-* Using Other Utility Programs with GNAT::
-* The External Symbol Naming Scheme of GNAT::
-* Converting Ada Files to html with gnathtml::
-
-@ifclear vms
-Code Coverage and Profiling
-
-* Code Coverage of Ada Programs using gcov::
-* Profiling an Ada Program using gprof::
-@end ifclear
-
-Running and Debugging Ada Programs
-
-* The GNAT Debugger GDB::
-* Running GDB::
-* Introduction to GDB Commands::
-* Using Ada Expressions::
-* Calling User-Defined Subprograms::
-* Using the Next Command in a Function::
-* Ada Exceptions::
-* Ada Tasks::
-* Debugging Generic Units::
-* Remote Debugging using gdbserver::
-* GNAT Abnormal Termination or Failure to Terminate::
-* Naming Conventions for GNAT Source Files::
-* Getting Internal Debugging Information::
-* Stack Traceback::
-
-@ifset vms
-* LSE::
-@end ifset
-
-@ifset vms
-Compatibility with HP Ada
-
-* Ada Language Compatibility::
-* Differences in the Definition of Package System::
-* Language-Related Features::
-* The Package STANDARD::
-* The Package SYSTEM::
-* Tasking and Task-Related Features::
-* Pragmas and Pragma-Related Features::
-* Library of Predefined Units::
-* Bindings::
-* Main Program Definition::
-* Implementation-Defined Attributes::
-* Compiler and Run-Time Interfacing::
-* Program Compilation and Library Management::
-* Input-Output::
-* Implementation Limits::
-* Tools and Utilities::
-
-Language-Related Features
-
-* Integer Types and Representations::
-* Floating-Point Types and Representations::
-* Pragmas Float_Representation and Long_Float::
-* Fixed-Point Types and Representations::
-* Record and Array Component Alignment::
-* Address Clauses::
-* Other Representation Clauses::
-
-Tasking and Task-Related Features
-
-* Implementation of Tasks in HP Ada for OpenVMS Alpha Systems::
-* Assigning Task IDs::
-* Task IDs and Delays::
-* Task-Related Pragmas::
-* Scheduling and Task Priority::
-* The Task Stack::
-* External Interrupts::
-
-Pragmas and Pragma-Related Features
-
-* Restrictions on the Pragma INLINE::
-* Restrictions on the Pragma INTERFACE::
-* Restrictions on the Pragma SYSTEM_NAME::
-
-Library of Predefined Units
-
-* Changes to DECLIB::
-
-Bindings
-
-* Shared Libraries and Options Files::
-* Interfaces to C::
-@end ifset
-
-Platform-Specific Information for the Run-Time Libraries
-
-* Summary of Run-Time Configurations::
-* Specifying a Run-Time Library::
-* Choosing the Scheduling Policy::
-* Solaris-Specific Considerations::
-* Linux-Specific Considerations::
-* AIX-Specific Considerations::
-* RTX-Specific Considerations::
-* HP-UX-Specific Considerations::
-
-Example of Binder Output File
-
-Elaboration Order Handling in GNAT
-
-* Elaboration Code::
-* Checking the Elaboration Order::
-* Controlling the Elaboration Order::
-* Controlling Elaboration in GNAT - Internal Calls::
-* Controlling Elaboration in GNAT - External Calls::
-* Default Behavior in GNAT - Ensuring Safety::
-* Treatment of Pragma Elaborate::
-* Elaboration Issues for Library Tasks::
-* Mixing Elaboration Models::
-* What to Do If the Default Elaboration Behavior Fails::
-* Elaboration for Dispatching Calls::
-* Summary of Procedures for Elaboration Control::
-* Other Elaboration Order Considerations::
-
-Overflow Check Handling in GNAT
-* Background::
-* Overflow Checking Modes in GNAT::
-* Specifying the Desired Mode::
-* Default Settings::
-* Implementation Notes::
-
-Conditional Compilation
-* Use of Boolean Constants::
-* Debugging - A Special Case::
-* Conditionalizing Declarations::
-* Use of Alternative Implementations::
-* Preprocessing::
-
-Inline Assembler
-
-* Basic Assembler Syntax::
-* A Simple Example of Inline Assembler::
-* Output Variables in Inline Assembler::
-* Input Variables in Inline Assembler::
-* Inlining Inline Assembler Code::
-* Other Asm Functionality::
-
-Compatibility and Porting Guide
-
-* Compatibility with Ada 83::
-* Compatibility between Ada 95 and Ada 2005::
-* Implementation-dependent characteristics::
-@ifclear vms
-@c This brief section is only in the non-VMS version
-@c The complete chapter on HP Ada issues is in the VMS version
-* Compatibility with HP Ada 83::
-@end ifclear
-* Compatibility with Other Ada Systems::
-* Representation Clauses::
-@ifset vms
-* Transitioning to 64-Bit GNAT for OpenVMS::
-@end ifset
-
-@ifset unw
-Microsoft Windows Topics
-
-* Using GNAT on Windows::
-* CONSOLE and WINDOWS subsystems::
-* Temporary Files::
-* Mixed-Language Programming on Windows::
-* Windows Calling Conventions::
-* Introduction to Dynamic Link Libraries (DLLs)::
-* Using DLLs with GNAT::
-* Building DLLs with GNAT::
-* GNAT and Windows Resources::
-* Debugging a DLL::
-* Setting Stack Size from gnatlink::
-* Setting Heap Size from gnatlink::
-
-Mac OS Topics
-
-* Codesigning the Debugger::
-@end ifset
-
-* Index::
@end menu
@end ifnottex
@@ -735,16 +277,16 @@ and running Ada programs with the GNAT Ada programming environment.
by GNAT.
@item
-@ref{Compiling Using gcc}, describes how to compile
+@ref{Compiling with gcc}, describes how to compile
Ada programs with @command{gcc}, the Ada compiler.
@item
-@ref{Binding Using gnatbind}, describes how to
+@ref{Binding with gnatbind}, describes how to
perform binding of Ada programs with @code{gnatbind}, the GNAT binding
utility.
@item
-@ref{Linking Using gnatlink},
+@ref{Linking with gnatlink},
describes @command{gnatlink}, a
program that provides for linking using the GNAT run-time library to
construct a program. @command{gnatlink} can also incorporate foreign language
@@ -764,7 +306,7 @@ also describes the @command{gnatelim} tool and unused subprogram/data
elimination.
@item
-@ref{Renaming Files Using gnatchop}, describes
+@ref{Renaming Files with gnatchop}, describes
@code{gnatchop}, a utility that allows you to preprocess a file that
contains Ada source code, and split it into one or more new files, one
for each compilation unit.
@@ -774,7 +316,7 @@ for each compilation unit.
handled by GNAT.
@item
-@ref{Handling Arbitrary File Naming Conventions Using gnatname},
+@ref{Handling Arbitrary File Naming Conventions with gnatname},
shows how to override the default GNAT file naming conventions,
either for an individual unit or globally.
@@ -793,17 +335,17 @@ version of an Ada source file with control over casing, indentation,
comment placement, and other elements of program presentation style.
@item
-@ref{The GNAT Metric Tool gnatmetric}, shows how to compute various
+@ref{The GNAT Metrics Tool gnatmetric}, shows how to compute various
metrics for an Ada source file, such as the number of types and subprograms,
and assorted complexity measures.
@item
-@ref{File Name Krunching Using gnatkr}, describes the @code{gnatkr}
+@ref{File Name Krunching with gnatkr}, describes the @code{gnatkr}
file name krunching utility, used to handle shortened
file names on operating systems with a limit on the length of names.
@item
-@ref{Preprocessing Using gnatprep}, describes @code{gnatprep}, a
+@ref{Preprocessing with gnatprep}, describes @code{gnatprep}, a
preprocessor utility that allows a single source file to be used to
generate multiple or parameterized source files by means of macro
substitution.
@@ -814,7 +356,7 @@ utility that displays information about compiled units, including dependences
on the corresponding sources files, and consistency of compilations.
@item
-@ref{Cleaning Up Using gnatclean}, describes @code{gnatclean}, a utility
+@ref{Cleaning Up with gnatclean}, describes @code{gnatclean}, a utility
to delete files that are produced by the compiler, binder and linker.
@ifclear vms
@@ -842,15 +384,15 @@ allocation and deallocation and helps detect ``memory leaks''.
stack checking and analysis.
@item
-@ref{Verifying Properties Using gnatcheck}, discusses @code{gnatcheck},
+@ref{Verifying Properties with gnatcheck}, discusses @code{gnatcheck},
a utility that checks Ada code against a set of rules.
@item
-@ref{Creating Sample Bodies Using gnatstub}, discusses @code{gnatstub},
+@ref{Creating Sample Bodies with gnatstub}, discusses @code{gnatstub},
a utility that generates empty but compilable bodies for library units.
@item
-@ref{Creating Unit Tests Using gnattest}, discusses @code{gnattest},
+@ref{Creating Unit Tests with gnattest}, discusses @code{gnattest},
a utility that generates unit testing templates for library units.
@item
@@ -1141,7 +683,7 @@ Alternatively, if you want to rename your files according to this default
convention, which is probably more convenient if you will be using GNAT
for all your compilations, then the @code{gnatchop} utility
can be used to generate correctly-named source files
-(@pxref{Renaming Files Using gnatchop}).
+(@pxref{Renaming Files with gnatchop}).
You can compile the program using the following command (@code{$} is used
as the command prompt in the examples in this document):
@@ -2078,7 +1620,7 @@ can specify the exact file names that you want used, as described
in the next section. Finally, if your Ada programs are migrating from a
compiler with a different naming convention, you can use the gnatchop
utility to produce source files that follow the GNAT naming conventions.
-(For details @pxref{Renaming Files Using gnatchop}.)
+(For details @pxref{Renaming Files with gnatchop}.)
Note: in the case of @code{Windows NT/XP} or @code{OpenVMS} operating
systems, case is not significant. So for example on @code{Windows XP}
@@ -3810,8 +3352,8 @@ GNAT uses the current directory for temporary files.
@end ifset
@c *************************
-@node Compiling Using gcc
-@chapter Compiling Using @command{gcc}
+@node Compiling with gcc
+@chapter Compiling with @command{gcc}
@noindent
This chapter discusses how to compile Ada programs using the @command{gcc}
@@ -3926,23 +3468,19 @@ files.
It is possible to supply several file names on the same @command{gcc}
command. This causes @command{gcc} to call the appropriate compiler for
-each file. For example, the following command lists three separate
+each file. For example, the following command lists two separate
files to be compiled:
@smallexample
-$ gcc -c x.adb y.adb z.c
+$ gcc -c x.adb y.adb
@end smallexample
@noindent
calls @code{gnat1} (the Ada compiler) twice to compile @file{x.adb} and
-@file{y.adb}, and @code{cc1} (the C compiler) once to compile @file{z.c}.
-The compiler generates three object files @file{x.o}, @file{y.o} and
-@file{z.o} and the two ALI files @file{x.ali} and @file{y.ali} from the
-Ada compilations. Any switches apply to all the files ^listed,^listed.^
-@ifclear vms
-except for
-@option{-gnat@var{x}} switches, which apply only to Ada compilations.
-@end ifclear
+@file{y.adb}.
+The compiler generates two object files @file{x.o} and @file{y.o}
+and the two ALI files @file{x.ali} and @file{y.ali}.
+Any switches apply to all the files ^listed,^listed.^
@node Switches for gcc
@section Switches for @command{gcc}
@@ -4157,7 +3695,15 @@ Assume no invalid (bad) values except for 'Valid attribute use
@item -gnatc
@cindex @option{-gnatc} (@command{gcc})
-Check syntax and semantics only (no code generation attempted).
+Check syntax and semantics only (no code generation attempted). When the
+compiler is invoked by @command{gnatmake}, if the switch @option{-gnatc} is
+only given to the compiler (after @option{-cargs} or in package Compiler of
+the project file, @command{gnatmake} will fail because it will not find the
+object file after compilation. If @command{gnatmake} is called with
+@option{-gnatc} as a builder switch (before @option{-cargs} or in package
+Builder of the project file) then @command{gnatmake} will not fail because
+it will not look for the object files after compilation, and it will not try
+to build and link.
@item -gnatC
@cindex @option{-gnatC} (@command{gcc})
@@ -4419,7 +3965,7 @@ cases; if two digits are given, then the first applies outside
assertions, and the second within assertions.
If no digits follow the @option{-gnato}, then it is equivalent to
-@option{-gnato11},
+@option{^-gnato11^/OVERFLOW_CHECKS=11^},
causing all intermediate overflows to be handled in strict mode.
This switch also causes arithmetic overflow checking to be performed
@@ -7002,6 +6548,12 @@ year). The compiler will generate code based on the assumption that
the condition being checked is true, which can result in disaster if
that assumption is wrong.
+The checks subject to suppression include all the checks defined by
+the Ada standard, the additional implementation defined checks
+@code{Alignment_Check}, @code{Atomic_Synchronization}, and
+@code{Validity_Check}, as well as any checks introduced using
+@code{pragma Check_Name}.
+
The @option{-gnatp} switch has no effect if a subsequent
@option{-gnat-p} switch appears.
@@ -7059,8 +6611,7 @@ with the use of @option{-gnato} in previous versions of GNAT.
@findex Machine_Overflows
Note that the @option{-gnato??} switch does not affect the code generated
-for any floating-point operations; it applies only to integer
-semantics.
+for any floating-point operations; it applies only to integer semantics.
For floating-point, @value{EDITION} has the @code{Machine_Overflows}
attribute set to @code{False} and the normal mode of operation is to
generate IEEE NaN and infinite values on overflow or invalid operations
@@ -7074,13 +6625,13 @@ subscript), or a wild jump (from an out of range case value). Overflow
checking is also quite expensive in time and space, since in general it
requires the use of double length arithmetic.
-Note again that the default is @option{-gnato00}, so overflow checking is
-not performed in default mode. This means that out of the box, with the
-default settings, @value{EDITION} does not do all the checks expected from the
-language description in the Ada Reference Manual. If you want all constraint
-checks to be performed, as described in this Manual, then you must
-explicitly use the @option{-gnato??} switch either on the @command{gnatmake} or
-@command{gcc} command.
+Note again that the default is @option{^-gnato00^/OVERFLOW_CHECKS=00^},
+so overflow checking is not performed in default mode. This means that out of
+the box, with the default settings, @value{EDITION} does not do all the checks
+expected from the language description in the Ada Reference Manual.
+If you want all constraint checks to be performed, as described in this Manual,
+then you must explicitly use the @option{-gnato??}
+switch either on the @command{gnatmake} or @command{gcc} command.
@item -gnatE
@cindex @option{-gnatE} (@command{gcc})
@@ -7091,7 +6642,7 @@ on subprogram calls and generic instantiations.
Note that @option{-gnatE} is not necessary for safety, because in the
default mode, GNAT ensures statically that the checks would not fail.
For full details of the effect and use of this switch,
-@xref{Compiling Using gcc}.
+@xref{Compiling with gcc}.
@item -fstack-check
@cindex @option{-fstack-check} (@command{gcc})
@@ -7160,7 +6711,7 @@ Normally, GNAT allows only a single unit in a source file. However, this
restriction does not apply in syntax-check-only mode, and it is possible
to check a file containing multiple compilation units concatenated
together. This is primarily used by the @code{gnatchop} utility
-(@pxref{Renaming Files Using gnatchop}).
+(@pxref{Renaming Files with gnatchop}).
@end table
@node Using gcc for Semantic Checking
@@ -7935,7 +7486,7 @@ preprocessing.
@noindent
The actual preprocessing function is described in details in section
-@ref{Preprocessing Using gnatprep}. This section only describes how integrated
+@ref{Preprocessing with gnatprep}. This section only describes how integrated
preprocessing is triggered and parameterized.
@table @code
@@ -7945,7 +7496,7 @@ preprocessing is triggered and parameterized.
This switch indicates to the compiler the file name (without directory
information) of the preprocessor data file to use. The preprocessor data file
should be found in the source directories. Note that when the compiler is
-called by a builder (@command{gnatmake} or @command{gprbuild}) with a project
+called by a builder such as (@command{gnatmake} with a project
file, if the object directory is not also a source directory, the builder needs
to be called with @option{-x}.
@@ -8283,8 +7834,8 @@ Compile the subunit in file @file{abc-def.adb} in semantic-checking-only
mode.
@end table
-@node Binding Using gnatbind
-@chapter Binding Using @code{gnatbind}
+@node Binding with gnatbind
+@chapter Binding with @code{gnatbind}
@findex gnatbind
@menu
@@ -9279,8 +8830,8 @@ since gnatlink will not be able to find the generated file.
@end table
@c ------------------------------------
-@node Linking Using gnatlink
-@chapter Linking Using @command{gnatlink}
+@node Linking with gnatlink
+@chapter Linking with @command{gnatlink}
@c ------------------------------------
@findex gnatlink
@@ -11636,8 +11187,8 @@ It can be observed that the procedure @code{Unused} and the object
appropriate options.
@c ********************************
-@node Renaming Files Using gnatchop
-@chapter Renaming Files Using @code{gnatchop}
+@node Renaming Files with gnatchop
+@chapter Renaming Files with @code{gnatchop}
@findex gnatchop
@noindent
@@ -11994,6 +11545,11 @@ unit will be skipped.
@cindex Configuration pragmas
@cindex Pragmas, configuration
+@menu
+* Handling of Configuration Pragmas::
+* The Configuration Pragmas Files::
+@end menu
+
@noindent
Configuration pragmas include those pragmas described as
such in the Ada Reference Manual, as well as
@@ -12070,14 +11626,8 @@ recognized by GNAT:
Validity_Checks
Warnings
Wide_Character_Encoding
-
@end smallexample
-@menu
-* Handling of Configuration Pragmas::
-* The Configuration Pragmas Files::
-@end menu
-
@node Handling of Configuration Pragmas
@section Handling of Configuration Pragmas
@@ -12166,8 +11716,8 @@ predefined package SYSTEM all the additional types and subprograms that are
defined in HP Ada. See @ref{Compatibility with HP Ada} for details.
@end ifset
-@node Handling Arbitrary File Naming Conventions Using gnatname
-@chapter Handling Arbitrary File Naming Conventions Using @code{gnatname}
+@node Handling Arbitrary File Naming Conventions with gnatname
+@chapter Handling Arbitrary File Naming Conventions with @code{gnatname}
@cindex Arbitrary File Naming Conventions
@menu
@@ -12283,6 +11833,13 @@ Display Copyright and version, then exit disregarding all other options.
If @option{--version} was not used, display usage, then exit disregarding
all other options.
+@item --subdirs=<dir>
+Real object, library or exec directories are subdirectories <dir> of the
+specified ones.
+
+@item --no-backup
+Do not create a backup copy of an existing project file.
+
@item --and
Start another section of directories/patterns.
@@ -12303,6 +11860,9 @@ specified, no switch @option{^-P^/PROJECT_FILE^} may be specified (see below).
@cindex @option{^-d^/SOURCE_DIRS^} (@code{gnatname})
Look for source files in directory @file{dir}. There may be zero, one or more
spaces between @option{^-d^/SOURCE_DIRS=^} and @file{dir}.
+@file{dir} may end with @code{/**}, that is it may be of the form
+@code{root_dir/**}. In this case, the directory @code{root_dir} and all of its
+subdirectories, recursively, have to be searched for sources.
When a switch @option{^-d^/SOURCE_DIRS^}
is specified, the current working directory will not be searched for source
files, unless it is explicitly specified with a @option{^-d^/SOURCE_DIRS^}
@@ -12329,6 +11889,9 @@ Specifying switch @option{^-D^/DIRS_FILE^} is equivalent to specifying as many
switches @option{^-d^/SOURCE_DIRS^} as there are nonempty lines in
@file{file}.
+@item -eL
+Follow symbolic links when processing project files.
+
@item ^-f^/FOREIGN_PATTERN=^@file{pattern}
@cindex @option{^-f^/FOREIGN_PATTERN^} (@code{gnatname})
Foreign patterns. Using this switch, it is possible to add sources of languages
@@ -12355,6 +11918,10 @@ information. @file{proj} must be writable.
There may be only one switch @option{^-P^/PROJECT_FILE^}.
When a switch @option{^-P^/PROJECT_FILE^} is specified,
no switch @option{^-c^/CONFIG_FILE^} may be specified.
+On all platforms, except on VMS, when @code{gnatname} is invoked for an
+existing project file <proj>.gpr, a backup copy of the project file is created
+in the project directory with file name <proj>.gpr.saved_x. 'x' is the first
+non negative number that makes this backup copy a new file.
@item ^-v^/VERBOSE^
@cindex @option{^-v^/VERBOSE^} (@code{gnatname})
@@ -12478,6 +12045,806 @@ are used in this example.
@include projects.texi
+@c ---------------------------------------------
+@c Tools Supporting Project Files
+@c ---------------------------------------------
+
+@node Tools Supporting Project Files
+@chapter Tools Supporting Project Files
+
+@noindent
+
+@menu
+* gnatmake and Project Files::
+* The GNAT Driver and Project Files::
+@end menu
+
+@c ---------------------------------------------
+@node gnatmake and Project Files
+@section gnatmake and Project Files
+@c ---------------------------------------------
+
+@noindent
+This section covers several topics related to @command{gnatmake} and
+project files: defining ^switches^switches^ for @command{gnatmake}
+and for the tools that it invokes; specifying configuration pragmas;
+the use of the @code{Main} attribute; building and rebuilding library project
+files.
+
+@menu
+* Switches Related to Project Files::
+* Switches and Project Files::
+* Specifying Configuration Pragmas::
+* Project Files and Main Subprograms::
+* Library Project Files::
+@end menu
+
+@c ---------------------------------------------
+@node Switches Related to Project Files
+@subsection Switches Related to Project Files
+@c ---------------------------------------------
+
+@noindent
+The following switches are used by GNAT tools that support project files:
+
+@table @option
+
+@item ^-P^/PROJECT_FILE=^@var{project}
+@cindex @option{^-P^/PROJECT_FILE^} (any project-aware tool)
+Indicates the name of a project file. This project file will be parsed with
+the verbosity indicated by @option{^-vP^MESSAGE_PROJECT_FILES=^@emph{x}},
+if any, and using the external references indicated
+by @option{^-X^/EXTERNAL_REFERENCE^} switches, if any.
+@ifclear vms
+There may zero, one or more spaces between @option{-P} and @var{project}.
+@end ifclear
+
+There must be only one @option{^-P^/PROJECT_FILE^} switch on the command line.
+
+Since the Project Manager parses the project file only after all the switches
+on the command line are checked, the order of the switches
+@option{^-P^/PROJECT_FILE^},
+@option{^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}}
+or @option{^-X^/EXTERNAL_REFERENCE^} is not significant.
+
+@item ^-X^/EXTERNAL_REFERENCE=^@var{name=value}
+@cindex @option{^-X^/EXTERNAL_REFERENCE^} (any project-aware tool)
+Indicates that external variable @var{name} has the value @var{value}.
+The Project Manager will use this value for occurrences of
+@code{external(name)} when parsing the project file.
+
+@ifclear vms
+If @var{name} or @var{value} includes a space, then @var{name=value} should be
+put between quotes.
+@smallexample
+ -XOS=NT
+ -X"user=John Doe"
+@end smallexample
+@end ifclear
+
+Several @option{^-X^/EXTERNAL_REFERENCE^} switches can be used simultaneously.
+If several @option{^-X^/EXTERNAL_REFERENCE^} switches specify the same
+@var{name}, only the last one is used.
+
+An external variable specified with a @option{^-X^/EXTERNAL_REFERENCE^} switch
+takes precedence over the value of the same name in the environment.
+
+@item ^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}
+@cindex @option{^-vP^/MESSAGES_PROJECT_FILE^} (any project-aware tool)
+Indicates the verbosity of the parsing of GNAT project files.
+
+@ifclear vms
+@option{-vP0} means Default;
+@option{-vP1} means Medium;
+@option{-vP2} means High.
+@end ifclear
+
+@ifset vms
+There are three possible options for this qualifier: DEFAULT, MEDIUM and
+HIGH.
+@end ifset
+
+The default is ^Default^DEFAULT^: no output for syntactically correct
+project files.
+If several @option{^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}} switches are present,
+only the last one is used.
+
+@item ^-aP^/ADD_PROJECT_SEARCH_DIR=^<dir>
+@cindex @option{^-aP^/ADD_PROJECT_SEARCH_DIR=^} (any project-aware tool)
+Add directory <dir> at the beginning of the project search path, in order,
+after the current working directory.
+
+@ifclear vms
+@item -eL
+@cindex @option{-eL} (any project-aware tool)
+Follow all symbolic links when processing project files.
+@end ifclear
+
+@item ^--subdirs^/SUBDIRS^=<subdir>
+@cindex @option{^--subdirs^/SUBDIRS^=} (gnatmake and gnatclean)
+This switch is recognized by @command{gnatmake} and @command{gnatclean}. It
+indicate that the real directories (except the source directories) are the
+subdirectories <subdir> of the directories specified in the project files.
+This applies in particular to object directories, library directories and
+exec directories. If the subdirectories do not exist, they are created
+automatically.
+
+@end table
+
+@c ---------------------------------------------
+@node Switches and Project Files
+@subsection Switches and Project Files
+@c ---------------------------------------------
+
+@noindent
+@ifset vms
+It is not currently possible to specify VMS style qualifiers in the project
+files; only Unix style ^switches^switches^ may be specified.
+@end ifset
+
+For each of the packages @code{Builder}, @code{Compiler}, @code{Binder}, and
+@code{Linker}, you can specify a @code{^Default_Switches^Default_Switches^}
+attribute, a @code{Switches} attribute, or both;
+as their names imply, these ^switch^switch^-related
+attributes affect the ^switches^switches^ that are used for each of these GNAT
+components when
+@command{gnatmake} is invoked. As will be explained below, these
+component-specific ^switches^switches^ precede
+the ^switches^switches^ provided on the @command{gnatmake} command line.
+
+The @code{^Default_Switches^Default_Switches^} attribute is an attribute
+indexed by language name (case insensitive) whose value is a string list.
+For example:
+
+@smallexample @c projectfile
+@group
+package Compiler is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-gnaty^-gnaty^",
+ "^-v^-v^");
+end Compiler;
+@end group
+@end smallexample
+
+@noindent
+The @code{Switches} attribute is indexed on a file name (which may or may
+not be case sensitive, depending
+on the operating system) whose value is a string list. For example:
+
+@smallexample @c projectfile
+@group
+package Builder is
+ for Switches ("main1.adb")
+ use ("^-O2^-O2^");
+ for Switches ("main2.adb")
+ use ("^-g^-g^");
+end Builder;
+@end group
+@end smallexample
+
+@noindent
+For the @code{Builder} package, the file names must designate source files
+for main subprograms. For the @code{Binder} and @code{Linker} packages, the
+file names must designate @file{ALI} or source files for main subprograms.
+In each case just the file name without an explicit extension is acceptable.
+
+For each tool used in a program build (@command{gnatmake}, the compiler, the
+binder, and the linker), the corresponding package @dfn{contributes} a set of
+^switches^switches^ for each file on which the tool is invoked, based on the
+^switch^switch^-related attributes defined in the package.
+In particular, the ^switches^switches^
+that each of these packages contributes for a given file @var{f} comprise:
+
+@itemize @bullet
+@item the value of attribute @code{Switches (@var{f})},
+ if it is specified in the package for the given file,
+@item otherwise, the value of @code{^Default_Switches^Default_Switches^ ("Ada")},
+ if it is specified in the package.
+
+@end itemize
+
+@noindent
+If neither of these attributes is defined in the package, then the package does
+not contribute any ^switches^switches^ for the given file.
+
+When @command{gnatmake} is invoked on a file, the ^switches^switches^ comprise
+two sets, in the following order: those contributed for the file
+by the @code{Builder} package;
+and the switches passed on the command line.
+
+When @command{gnatmake} invokes a tool (compiler, binder, linker) on a file,
+the ^switches^switches^ passed to the tool comprise three sets,
+in the following order:
+
+@enumerate
+@item
+the applicable ^switches^switches^ contributed for the file
+by the @code{Builder} package in the project file supplied on the command line;
+
+@item
+those contributed for the file by the package (in the relevant project file --
+see below) corresponding to the tool; and
+
+@item
+the applicable switches passed on the command line.
+@end enumerate
+
+The term @emph{applicable ^switches^switches^} reflects the fact that
+@command{gnatmake} ^switches^switches^ may or may not be passed to individual
+tools, depending on the individual ^switch^switch^.
+
+@command{gnatmake} may invoke the compiler on source files from different
+projects. The Project Manager will use the appropriate project file to
+determine the @code{Compiler} package for each source file being compiled.
+Likewise for the @code{Binder} and @code{Linker} packages.
+
+As an example, consider the following package in a project file:
+
+@smallexample @c projectfile
+@group
+project Proj1 is
+ package Compiler is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-g^-g^");
+ for Switches ("a.adb")
+ use ("^-O1^-O1^");
+ for Switches ("b.adb")
+ use ("^-O2^-O2^",
+ "^-gnaty^-gnaty^");
+ end Compiler;
+end Proj1;
+@end group
+@end smallexample
+
+@noindent
+If @command{gnatmake} is invoked with this project file, and it needs to
+compile, say, the files @file{a.adb}, @file{b.adb}, and @file{c.adb}, then
+@file{a.adb} will be compiled with the ^switch^switch^
+@option{^-O1^-O1^},
+@file{b.adb} with ^switches^switches^
+@option{^-O2^-O2^}
+and @option{^-gnaty^-gnaty^},
+and @file{c.adb} with @option{^-g^-g^}.
+
+The following example illustrates the ordering of the ^switches^switches^
+contributed by different packages:
+
+@smallexample @c projectfile
+@group
+project Proj2 is
+ package Builder is
+ for Switches ("main.adb")
+ use ("^-g^-g^",
+ "^-O1^-)1^",
+ "^-f^-f^");
+ end Builder;
+@end group
+
+@group
+ package Compiler is
+ for Switches ("main.adb")
+ use ("^-O2^-O2^");
+ end Compiler;
+end Proj2;
+@end group
+@end smallexample
+
+@noindent
+If you issue the command:
+
+@smallexample
+ gnatmake ^-Pproj2^/PROJECT_FILE=PROJ2^ -O0 main
+@end smallexample
+
+@noindent
+then the compiler will be invoked on @file{main.adb} with the following
+sequence of ^switches^switches^
+
+@smallexample
+ ^-g -O1 -O2 -O0^-g -O1 -O2 -O0^
+@end smallexample
+
+@noindent
+with the last @option{^-O^-O^}
+^switch^switch^ having precedence over the earlier ones;
+several other ^switches^switches^
+(such as @option{^-c^-c^}) are added implicitly.
+
+The ^switches^switches^
+@option{^-g^-g^}
+and @option{^-O1^-O1^} are contributed by package
+@code{Builder}, @option{^-O2^-O2^} is contributed
+by the package @code{Compiler}
+and @option{^-O0^-O0^} comes from the command line.
+
+The @option{^-g^-g^}
+^switch^switch^ will also be passed in the invocation of
+@command{Gnatlink.}
+
+A final example illustrates switch contributions from packages in different
+project files:
+
+@smallexample @c projectfile
+@group
+project Proj3 is
+ for Source_Files use ("pack.ads", "pack.adb");
+ package Compiler is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-gnata^-gnata^");
+ end Compiler;
+end Proj3;
+@end group
+
+@group
+with "Proj3";
+project Proj4 is
+ for Source_Files use ("foo_main.adb", "bar_main.adb");
+ package Builder is
+ for Switches ("foo_main.adb")
+ use ("^-s^-s^",
+ "^-g^-g^");
+ end Builder;
+end Proj4;
+@end group
+
+@group
+-- Ada source file:
+with Pack;
+procedure Foo_Main is
+ @dots{}
+end Foo_Main;
+@end group
+@end smallexample
+
+@noindent
+If the command is
+@smallexample
+gnatmake ^-PProj4^/PROJECT_FILE=PROJ4^ foo_main.adb -cargs -gnato
+@end smallexample
+
+@noindent
+then the ^switches^switches^ passed to the compiler for @file{foo_main.adb} are
+@option{^-g^-g^} (contributed by the package @code{Proj4.Builder}) and
+@option{^-gnato^-gnato^} (passed on the command line).
+When the imported package @code{Pack} is compiled, the ^switches^switches^ used
+are @option{^-g^-g^} from @code{Proj4.Builder},
+@option{^-gnata^-gnata^} (contributed from package @code{Proj3.Compiler},
+and @option{^-gnato^-gnato^} from the command line.
+
+When using @command{gnatmake} with project files, some ^switches^switches^ or
+arguments may be expressed as relative paths. As the working directory where
+compilation occurs may change, these relative paths are converted to absolute
+paths. For the ^switches^switches^ found in a project file, the relative paths
+are relative to the project file directory, for the switches on the command
+line, they are relative to the directory where @command{gnatmake} is invoked.
+The ^switches^switches^ for which this occurs are:
+^-I^-I^,
+^-A^-A^,
+^-L^-L^,
+^-aO^-aO^,
+^-aL^-aL^,
+^-aI^-aI^, as well as all arguments that are not switches (arguments to
+^switch^switch^
+^-o^-o^, object files specified in package @code{Linker} or after
+-largs on the command line). The exception to this rule is the ^switch^switch^
+^--RTS=^--RTS=^ for which a relative path argument is never converted.
+
+@c ---------------------------------------------
+@node Specifying Configuration Pragmas
+@subsection Specifying Configuration Pragmas
+@c ---------------------------------------------
+
+@noindent
+When using @command{gnatmake} with project files, if there exists a file
+@file{gnat.adc} that contains configuration pragmas, this file will be
+ignored.
+
+Configuration pragmas can be defined by means of the following attributes in
+project files: @code{Global_Configuration_Pragmas} in package @code{Builder}
+and @code{Local_Configuration_Pragmas} in package @code{Compiler}.
+
+Both these attributes are single string attributes. Their values is the path
+name of a file containing configuration pragmas. If a path name is relative,
+then it is relative to the project directory of the project file where the
+attribute is defined.
+
+When compiling a source, the configuration pragmas used are, in order,
+those listed in the file designated by attribute
+@code{Global_Configuration_Pragmas} in package @code{Builder} of the main
+project file, if it is specified, and those listed in the file designated by
+attribute @code{Local_Configuration_Pragmas} in package @code{Compiler} of
+the project file of the source, if it exists.
+
+@c ---------------------------------------------
+@node Project Files and Main Subprograms
+@subsection Project Files and Main Subprograms
+@c ---------------------------------------------
+
+@noindent
+When using a project file, you can invoke @command{gnatmake}
+with one or several main subprograms, by specifying their source files on the
+command line.
+
+@smallexample
+ gnatmake ^-P^/PROJECT_FILE=^prj main1.adb main2.adb main3.adb
+@end smallexample
+
+@noindent
+Each of these needs to be a source file of the same project, except
+when the switch ^-u^/UNIQUE^ is used.
+
+When ^-u^/UNIQUE^ is not used, all the mains need to be sources of the
+same project, one of the project in the tree rooted at the project specified
+on the command line. The package @code{Builder} of this common project, the
+"main project" is the one that is considered by @command{gnatmake}.
+
+When ^-u^/UNIQUE^ is used, the specified source files may be in projects
+imported directly or indirectly by the project specified on the command line.
+Note that if such a source file is not part of the project specified on the
+command line, the ^switches^switches^ found in package @code{Builder} of the
+project specified on the command line, if any, that are transmitted
+to the compiler will still be used, not those found in the project file of
+the source file.
+
+When using a project file, you can also invoke @command{gnatmake} without
+explicitly specifying any main, and the effect depends on whether you have
+defined the @code{Main} attribute. This attribute has a string list value,
+where each element in the list is the name of a source file (the file
+extension is optional) that contains a unit that can be a main subprogram.
+
+If the @code{Main} attribute is defined in a project file as a non-empty
+string list and the switch @option{^-u^/UNIQUE^} is not used on the command
+line, then invoking @command{gnatmake} with this project file but without any
+main on the command line is equivalent to invoking @command{gnatmake} with all
+the file names in the @code{Main} attribute on the command line.
+
+Example:
+@smallexample @c projectfile
+@group
+ project Prj is
+ for Main use ("main1.adb", "main2.adb", "main3.adb");
+ end Prj;
+@end group
+@end smallexample
+
+@noindent
+With this project file, @code{"gnatmake ^-Pprj^/PROJECT_FILE=PRJ^"}
+is equivalent to
+@code{"gnatmake ^-Pprj^/PROJECT_FILE=PRJ^ main1.adb main2.adb main3.adb"}.
+
+When the project attribute @code{Main} is not specified, or is specified
+as an empty string list, or when the switch @option{-u} is used on the command
+line, then invoking @command{gnatmake} with no main on the command line will
+result in all immediate sources of the project file being checked, and
+potentially recompiled. Depending on the presence of the switch @option{-u},
+sources from other project files on which the immediate sources of the main
+project file depend are also checked and potentially recompiled. In other
+words, the @option{-u} switch is applied to all of the immediate sources of the
+main project file.
+
+When no main is specified on the command line and attribute @code{Main} exists
+and includes several mains, or when several mains are specified on the
+command line, the default ^switches^switches^ in package @code{Builder} will
+be used for all mains, even if there are specific ^switches^switches^
+specified for one or several mains.
+
+But the ^switches^switches^ from package @code{Binder} or @code{Linker} will be
+the specific ^switches^switches^ for each main, if they are specified.
+
+@c ---------------------------------------------
+@node Library Project Files
+@subsection Library Project Files
+@c ---------------------------------------------
+
+@noindent
+When @command{gnatmake} is invoked with a main project file that is a library
+project file, it is not allowed to specify one or more mains on the command
+line.
+
+When a library project file is specified, switches ^-b^/ACTION=BIND^ and
+^-l^/ACTION=LINK^ have special meanings.
+
+@itemize @bullet
+@item ^-b^/ACTION=BIND^ is only allowed for stand-alone libraries. It indicates
+ to @command{gnatmake} that @command{gnatbind} should be invoked for the
+ library.
+
+@item ^-l^/ACTION=LINK^ may be used for all library projects. It indicates
+ to @command{gnatmake} that the binder generated file should be compiled
+ (in the case of a stand-alone library) and that the library should be built.
+@end itemize
+
+@c ---------------------------------------------
+@node The GNAT Driver and Project Files
+@section The GNAT Driver and Project Files
+@c ---------------------------------------------
+
+@noindent
+A number of GNAT tools, other than @command{^gnatmake^gnatmake^}
+can benefit from project files:
+(@command{^gnatbind^gnatbind^},
+@command{^gnatcheck^gnatcheck^},
+@command{^gnatclean^gnatclean^},
+@command{^gnatelim^gnatelim^},
+@command{^gnatfind^gnatfind^},
+@command{^gnatlink^gnatlink^},
+@command{^gnatls^gnatls^},
+@command{^gnatmetric^gnatmetric^},
+@command{^gnatpp^gnatpp^},
+@command{^gnatstub^gnatstub^},
+and @command{^gnatxref^gnatxref^}). However, none of these tools can be invoked
+directly with a project file switch (@option{^-P^/PROJECT_FILE=^}).
+They must be invoked through the @command{gnat} driver.
+
+The @command{gnat} driver is a wrapper that accepts a number of commands and
+calls the corresponding tool. It was designed initially for VMS platforms (to
+convert VMS qualifiers to Unix-style switches), but it is now available on all
+GNAT platforms.
+
+On non-VMS platforms, the @command{gnat} driver accepts the following commands
+(case insensitive):
+
+@itemize @bullet
+@item BIND to invoke @command{^gnatbind^gnatbind^}
+@item CHOP to invoke @command{^gnatchop^gnatchop^}
+@item CLEAN to invoke @command{^gnatclean^gnatclean^}
+@item COMP or COMPILE to invoke the compiler
+@item ELIM to invoke @command{^gnatelim^gnatelim^}
+@item FIND to invoke @command{^gnatfind^gnatfind^}
+@item KR or KRUNCH to invoke @command{^gnatkr^gnatkr^}
+@item LINK to invoke @command{^gnatlink^gnatlink^}
+@item LS or LIST to invoke @command{^gnatls^gnatls^}
+@item MAKE to invoke @command{^gnatmake^gnatmake^}
+@item NAME to invoke @command{^gnatname^gnatname^}
+@item PREP or PREPROCESS to invoke @command{^gnatprep^gnatprep^}
+@item PP or PRETTY to invoke @command{^gnatpp^gnatpp^}
+@item METRIC to invoke @command{^gnatmetric^gnatmetric^}
+@item STUB to invoke @command{^gnatstub^gnatstub^}
+@item XREF to invoke @command{^gnatxref^gnatxref^}
+
+@end itemize
+
+@noindent
+(note that the compiler is invoked using the command
+@command{^gnatmake -f -u -c^gnatmake -f -u -c^}).
+
+On non-VMS platforms, between @command{gnat} and the command, two
+special switches may be used:
+
+@itemize @bullet
+@item @command{-v} to display the invocation of the tool.
+@item @command{-dn} to prevent the @command{gnat} driver from removing
+ the temporary files it has created. These temporary files are
+ configuration files and temporary file list files.
+
+@end itemize
+
+@noindent
+The command may be followed by switches and arguments for the invoked
+tool.
+
+@smallexample
+ gnat bind -C main.ali
+ gnat ls -a main
+ gnat chop foo.txt
+@end smallexample
+
+@noindent
+Switches may also be put in text files, one switch per line, and the text
+files may be specified with their path name preceded by '@@'.
+
+@smallexample
+ gnat bind @@args.txt main.ali
+@end smallexample
+
+@noindent
+In addition, for commands BIND, COMP or COMPILE, FIND, ELIM, LS or LIST, LINK,
+METRIC, PP or PRETTY, STUB and XREF, the project file related switches
+(@option{^-P^/PROJECT_FILE^},
+@option{^-X^/EXTERNAL_REFERENCE^} and
+@option{^-vP^/MESSAGES_PROJECT_FILE=^x}) may be used in addition to
+the switches of the invoking tool.
+
+When GNAT PP or GNAT PRETTY is used with a project file, but with no source
+specified on the command line, it invokes @command{^gnatpp^gnatpp^} with all
+the immediate sources of the specified project file.
+
+When GNAT METRIC is used with a project file, but with no source
+specified on the command line, it invokes @command{^gnatmetric^gnatmetric^}
+with all the immediate sources of the specified project file and with
+@option{^-d^/DIRECTORY^} with the parameter pointing to the object directory
+of the project.
+
+In addition, when GNAT PP, GNAT PRETTY or GNAT METRIC is used with
+a project file, no source is specified on the command line and
+switch ^-U^/ALL_PROJECTS^ is specified on the command line, then
+the underlying tool (^gnatpp^gnatpp^ or
+^gnatmetric^gnatmetric^) is invoked for all sources of all projects,
+not only for the immediate sources of the main project.
+@ifclear vms
+(-U stands for Universal or Union of the project files of the project tree)
+@end ifclear
+
+For each of the following commands, there is optionally a corresponding
+package in the main project.
+
+@itemize @bullet
+@item package @code{Binder} for command BIND (invoking @code{^gnatbind^gnatbind^})
+
+@item package @code{Check} for command CHECK (invoking
+ @code{^gnatcheck^gnatcheck^})
+
+@item package @code{Compiler} for command COMP or COMPILE (invoking the compiler)
+
+@item package @code{Cross_Reference} for command XREF (invoking
+ @code{^gnatxref^gnatxref^})
+
+@item package @code{Eliminate} for command ELIM (invoking
+ @code{^gnatelim^gnatelim^})
+
+@item package @code{Finder} for command FIND (invoking @code{^gnatfind^gnatfind^})
+
+@item package @code{Gnatls} for command LS or LIST (invoking @code{^gnatls^gnatls^})
+
+@item package @code{Gnatstub} for command STUB
+ (invoking @code{^gnatstub^gnatstub^})
+
+@item package @code{Linker} for command LINK (invoking @code{^gnatlink^gnatlink^})
+
+@item package @code{Check} for command CHECK
+ (invoking @code{^gnatcheck^gnatcheck^})
+
+@item package @code{Metrics} for command METRIC
+ (invoking @code{^gnatmetric^gnatmetric^})
+
+@item package @code{Pretty_Printer} for command PP or PRETTY
+ (invoking @code{^gnatpp^gnatpp^})
+
+@end itemize
+
+@noindent
+Package @code{Gnatls} has a unique attribute @code{Switches},
+a simple variable with a string list value. It contains ^switches^switches^
+for the invocation of @code{^gnatls^gnatls^}.
+
+@smallexample @c projectfile
+@group
+project Proj1 is
+ package gnatls is
+ for Switches
+ use ("^-a^-a^",
+ "^-v^-v^");
+ end gnatls;
+end Proj1;
+@end group
+@end smallexample
+
+@noindent
+All other packages have two attribute @code{Switches} and
+@code{^Default_Switches^Default_Switches^}.
+
+@code{Switches} is an indexed attribute, indexed by the
+source file name, that has a string list value: the ^switches^switches^ to be
+used when the tool corresponding to the package is invoked for the specific
+source file.
+
+@code{^Default_Switches^Default_Switches^} is an attribute,
+indexed by the programming language that has a string list value.
+@code{^Default_Switches^Default_Switches^ ("Ada")} contains the
+^switches^switches^ for the invocation of the tool corresponding
+to the package, except if a specific @code{Switches} attribute
+is specified for the source file.
+
+@smallexample @c projectfile
+@group
+project Proj is
+
+ for Source_Dirs use ("**");
+
+ package gnatls is
+ for Switches use
+ ("^-a^-a^",
+ "^-v^-v^");
+ end gnatls;
+@end group
+@group
+
+ package Compiler is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-gnatv^-gnatv^",
+ "^-gnatwa^-gnatwa^");
+ end Binder;
+@end group
+@group
+
+ package Binder is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-C^-C^",
+ "^-e^-e^");
+ end Binder;
+@end group
+@group
+
+ package Linker is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-C^-C^");
+ for Switches ("main.adb")
+ use ("^-C^-C^",
+ "^-v^-v^",
+ "^-v^-v^");
+ end Linker;
+@end group
+@group
+
+ package Finder is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-a^-a^",
+ "^-f^-f^");
+ end Finder;
+@end group
+@group
+
+ package Cross_Reference is
+ for ^Default_Switches^Default_Switches^ ("Ada")
+ use ("^-a^-a^",
+ "^-f^-f^",
+ "^-d^-d^",
+ "^-u^-u^");
+ end Cross_Reference;
+end Proj;
+@end group
+@end smallexample
+
+@noindent
+With the above project file, commands such as
+
+@smallexample
+ ^gnat comp -Pproj main^GNAT COMP /PROJECT_FILE=PROJ MAIN^
+ ^gnat ls -Pproj main^GNAT LIST /PROJECT_FILE=PROJ MAIN^
+ ^gnat xref -Pproj main^GNAT XREF /PROJECT_FILE=PROJ MAIN^
+ ^gnat bind -Pproj main.ali^GNAT BIND /PROJECT_FILE=PROJ MAIN.ALI^
+ ^gnat link -Pproj main.ali^GNAT LINK /PROJECT_FILE=PROJ MAIN.ALI^
+@end smallexample
+
+@noindent
+will set up the environment properly and invoke the tool with the switches
+found in the package corresponding to the tool:
+@code{^Default_Switches^Default_Switches^ ("Ada")} for all tools,
+except @code{Switches ("main.adb")}
+for @code{^gnatlink^gnatlink^}.
+It is also possible to invoke some of the tools,
+(@code{^gnatcheck^gnatcheck^},
+@code{^gnatmetric^gnatmetric^},
+and @code{^gnatpp^gnatpp^})
+on a set of project units thanks to the combination of the switches
+@option{-P}, @option{-U} and possibly the main unit when one is interested
+in its closure. For instance,
+@smallexample
+gnat metric -Pproj
+@end smallexample
+
+@noindent
+will compute the metrics for all the immediate units of project
+@code{proj}.
+@smallexample
+gnat metric -Pproj -U
+@end smallexample
+
+@noindent
+will compute the metrics for all the units of the closure of projects
+rooted at @code{proj}.
+@smallexample
+gnat metric -Pproj -U main_unit
+@end smallexample
+
+@noindent
+will compute the metrics for the closure of units rooted at
+@code{main_unit}. This last possibility relies implicitly
+on @command{gnatbind}'s option @option{-R}. But if the argument files for the
+tool invoked by the @command{gnat} driver are explicitly specified
+either directly or through the tool @option{-files} option, then the tool
+is called only for these explicitly specified files.
+
@c *****************************************
@c * Cross-referencing tools
@c *****************************************
@@ -13226,6 +13593,11 @@ point to any character in the middle of the identifier.
@findex gnatpp
@cindex Pretty-Printer
+@menu
+* Switches for gnatpp::
+* Formatting Rules::
+@end menu
+
@noindent
^The @command{gnatpp} tool^GNAT PRETTY^ is an ASIS-based utility
for source reformatting / pretty-printing.
@@ -13286,11 +13658,6 @@ use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@end itemize
-@menu
-* Switches for gnatpp::
-* Formatting Rules::
-@end menu
-
@node Switches for gnatpp
@section Switches for @command{gnatpp}
@@ -14396,8 +14763,8 @@ end Test;
@end smallexample
@c *********************************
-@node The GNAT Metric Tool gnatmetric
-@chapter The GNAT Metric Tool @command{gnatmetric}
+@node The GNAT Metrics Tool gnatmetric
+@chapter The GNAT Metrics Tool @command{gnatmetric}
@findex gnatmetric
@cindex Metric tool
@@ -14408,6 +14775,10 @@ It takes an Ada source file as input and generates a file containing the
metrics data as output. Various switches control which
metrics are computed and output.
+@menu
+* Switches for gnatmetric::
+@end menu
+
@command{gnatmetric} generates and uses the ASIS
tree for the input source and thus requires the input to be syntactically and
semantically legal.
@@ -14460,10 +14831,6 @@ use the @option{-gnat05} switch if sources should be compiled in
Ada 2005 mode etc.
@end itemize
-@menu
-* Switches for gnatmetric::
-@end menu
-
@node Switches for gnatmetric
@section Switches for @command{gnatmetric}
@@ -15335,8 +15702,8 @@ the @option{-U} option followed by the name of the main unit:
@c ***********************************
-@node File Name Krunching Using gnatkr
-@chapter File Name Krunching Using @code{gnatkr}
+@node File Name Krunching with gnatkr
+@chapter File Name Krunching with @code{gnatkr}
@findex gnatkr
@noindent
@@ -15551,8 +15918,8 @@ $ gnatkr very_long_unit_name.ads/count=6 --> vlunna.ads
$ gnatkr very_long_unit_name.ads/count=0 --> very_long_unit_name.ads
@end smallexample
-@node Preprocessing Using gnatprep
-@chapter Preprocessing Using @code{gnatprep}
+@node Preprocessing with gnatprep
+@chapter Preprocessing with @code{gnatprep}
@findex gnatprep
@noindent
@@ -16148,8 +16515,8 @@ GNU:[LIB.OPENVMS7_1.2_8_1.ADALIB]unchconv.ads
@end smallexample
@end ifset
-@node Cleaning Up Using gnatclean
-@chapter Cleaning Up Using @code{gnatclean}
+@node Cleaning Up with gnatclean
+@chapter Cleaning Up with @code{gnatclean}
@findex gnatclean
@cindex Cleaning tool
@@ -18002,8 +18369,8 @@ stack usage reports at run-time. See its body for the details.
@c *********************************
@c * GNATCHECK *
@c *********************************
-@node Verifying Properties Using gnatcheck
-@chapter Verifying Properties Using @command{gnatcheck}
+@node Verifying Properties with gnatcheck
+@chapter Verifying Properties with @command{gnatcheck}
@findex gnatcheck
@cindex @command{gnatcheck}
@@ -18024,8 +18391,8 @@ For full details, refer to @cite{GNATcheck Reference Manual} document.
@c *********************************
-@node Creating Sample Bodies Using gnatstub
-@chapter Creating Sample Bodies Using @command{gnatstub}
+@node Creating Sample Bodies with gnatstub
+@chapter Creating Sample Bodies with @command{gnatstub}
@findex gnatstub
@noindent
@@ -18165,7 +18532,7 @@ the generated body sample to @var{n}.
The default indentation is 3.
@item ^-gnatyo^/ORDERED_SUBPROGRAMS^
-@cindex @option{^-gnato^/ORDERED_SUBPROGRAMS^} (@command{gnatstub})
+@cindex @option{^-gnatyo^/ORDERED_SUBPROGRAMS^} (@command{gnatstub})
Order local bodies alphabetically. (By default local bodies are ordered
in the same way as the corresponding local specs in the argument spec file.)
@@ -18233,8 +18600,8 @@ Verbose mode: generate version information.
@end table
@c *********************************
-@node Creating Unit Tests Using gnattest
-@chapter Creating Unit Tests Using @command{gnattest}
+@node Creating Unit Tests with gnattest
+@chapter Creating Unit Tests with @command{gnattest}
@findex gnattest
@noindent
@@ -18505,8 +18872,8 @@ $ gnattest --harness-dir=driver -Psimple.gpr
a test driver is created in directory "driver". It can be compiled and run:
@smallexample
-$ cd driver
-$ gprbuild -Ptest_driver
+$ cd obj/driver
+$ gnatmake -Ptest_driver
$ test_runner
@end smallexample
@@ -18571,8 +18938,8 @@ and body of function Dec in simple.ads and simple.adb, running
@smallexample
gnattest --harness-dir=driver -Psimple.gpr
-cd driver
-gprbuild -Ptest_driver
+cd obj/driver
+gnatmake -Ptest_driver
test_runner
@end smallexample
@@ -18667,8 +19034,8 @@ seen by running the test driver generated for the second example. As previously
mentioned, actual tests are already written for this example.
@smallexample
-cd driver
-gprbuild -Ptest_driver
+cd obj/driver
+gnatmake -Ptest_driver
test_runner
@end smallexample
@@ -18709,8 +19076,8 @@ of the type which have overriding primitives:
@smallexample
gnattest --harness-dir=driver --validate-type-extensions -Ptagged_rec.gpr
-cd driver
-gprbuild -Ptest_driver
+cd obj/driver
+gnatmake -Ptest_driver
test_runner
@end smallexample
@@ -18758,8 +19125,8 @@ Assert (Sqrt (-5.0) = -1.0, "wrong error indication");
are acceptable:
@smallexample
-cd driver
-gprbuild -Ptest_driver
+cd obj/driver
+gnatmake -Ptest_driver
test_runner
@end smallexample
@@ -19528,12 +19895,12 @@ This chapter describes how to use @code{gcov} - coverage testing tool - and
@code{gprof} - profiler tool - on your Ada programs.
@menu
-* Code Coverage of Ada Programs using gcov::
-* Profiling an Ada Program using gprof::
+* Code Coverage of Ada Programs with gcov::
+* Profiling an Ada Program with gprof::
@end menu
-@node Code Coverage of Ada Programs using gcov
-@section Code Coverage of Ada Programs using gcov
+@node Code Coverage of Ada Programs with gcov
+@section Code Coverage of Ada Programs with gcov
@cindex gcov
@cindex -fprofile-arcs
@cindex -ftest-coverage
@@ -19620,8 +19987,8 @@ text file, and provide this file to gcov as a parameter, preceded by a @@
Note that on AIX compiling a static library with @code{-fprofile-arcs} is
not supported as there can be unresolved symbols during the final link.
-@node Profiling an Ada Program using gprof
-@section Profiling an Ada Program using gprof
+@node Profiling an Ada Program with gprof
+@section Profiling an Ada Program with gprof
@cindex gprof
@cindex -pg
@cindex Profiling
@@ -19846,7 +20213,7 @@ the incorrect user program.
* Ada Exceptions::
* Ada Tasks::
* Debugging Generic Units::
-* Remote Debugging using gdbserver::
+* Remote Debugging with gdbserver::
* GNAT Abnormal Termination or Failure to Terminate::
* Naming Conventions for GNAT Source Files::
* Getting Internal Debugging Information::
@@ -20304,9 +20671,9 @@ When the breakpoint occurs, you can step through the code of the
instance in the normal manner and examine the values of local variables, as for
other units.
-@node Remote Debugging using gdbserver
-@section Remote Debugging using gdbserver
-@cindex Remote Debugging using gdbserver
+@node Remote Debugging with gdbserver
+@section Remote Debugging with gdbserver
+@cindex Remote Debugging with gdbserver
@noindent
On platforms where gdbserver is supported, it is possible to use this tool
@@ -25962,10 +26329,11 @@ eliminate intermediate overflows (@code{ELIMINATED})
As with the pragma, if only one digit appears then it applies to all
cases; if two digits are given, then the first applies outside
assertions, and the second within assertions. Thus the equivalent
-of the example pragma above would be @option{-gnato23}.
+of the example pragma above would be
+@option{^-gnato23^/OVERFLOW_CHECKS=23^}.
If no digits follow the @option{-gnato}, then it is equivalent to
-@option{-gnato11},
+@option{^-gnato11^/OVERFLOW_CHECKS=11^},
causing all intermediate operations to be computed using the base
type (@code{STRICT} mode).
@@ -26496,7 +26864,7 @@ The preprocessor may be used in two separate modes. It can be used quite
separately from the compiler, to generate a separate output source file
that is then fed to the compiler as a separate step. This is the
@code{gnatprep} utility, whose use is fully described in
-@ref{Preprocessing Using gnatprep}.
+@ref{Preprocessing with gnatprep}.
@cindex @code{gnatprep}
The preprocessing language allows such constructs as
@@ -28252,7 +28620,6 @@ without sacrificing the capabilities of the 64-bit architecture.
@end ifset
@c ************************************************
-@ifset unw
@node Microsoft Windows Topics
@appendix Microsoft Windows Topics
@cindex Windows NT
@@ -28264,6 +28631,9 @@ This chapter describes topics that are specific to the Microsoft Windows
platforms (NT, 2000, and XP Professional).
@menu
+@ifclear FSFEDITION
+* Installing from the Command Line::
+@end ifclear
* Using GNAT on Windows::
* Using a network installation of GNAT::
* CONSOLE and WINDOWS subsystems::
@@ -28281,6 +28651,54 @@ platforms (NT, 2000, and XP Professional).
* Setting Heap Size from gnatlink::
@end menu
+@ifclear FSFEDITION
+@node Installing from the Command Line
+@section Installing from the Command Line
+@cindex Batch installation
+@cindex Silent installation
+@cindex Unassisted installation
+
+@noindent
+By default the @value{EDITION} installers display a GUI that prompts the user
+to enter installation path and similar information, and guide him through the
+installation process. It is also possible to perform silent installations
+using the command-line interface.
+
+In order to install one of the @value{EDITION} installers from the command
+line you should pass parameter @code{/S} (and, optionally,
+@code{/D=<directory>}) as command-line arguments.
+
+@ifset PROEDITION
+For example, for an unattended installation of
+@value{EDITION} 7.0.2 into the default directory
+@code{C:\GNATPRO\7.0.2} you would run:
+
+@smallexample
+gnatpro-7.0.2-i686-pc-mingw32-bin.exe /S
+@end smallexample
+
+To install into a custom directory, say, @code{C:\TOOLS\GNATPRO\7.0.2}:
+
+@smallexample
+gnatpro-7.0.2-i686-pc-mingw32-bin /S /D=C:\TOOLS\GNATPRO\7.0.2
+@end smallexample
+@end ifset
+
+@ifset GPLEDITION
+For example, for an unattended installation of
+@value{EDITION} 2012 into @code{C:\GNAT\2012}:
+
+@smallexample
+gnat-gpl-2012-i686-pc-mingw32-bin /S /D=C:\GNAT\2012
+@end smallexample
+@end ifset
+
+You can use the same syntax for all installers.
+
+Note that unattended installations don't modify system path, nor create file
+associations, so such activities need to be done by hand.
+@end ifclear
+
@node Using GNAT on Windows
@section Using GNAT on Windows
@@ -28864,12 +29282,6 @@ end API;
@end group
@end smallexample
-@noindent
-Note that a variable is
-@strong{always imported with a DLL convention}. A function
-can have @code{C} or @code{Stdcall} convention.
-(@pxref{Windows Calling Conventions}).
-
@node Creating an Import Library
@subsection Creating an Import Library
@cindex Import library
@@ -30321,15 +30733,13 @@ codesign -f -s "gdb-cert" <gnat_install_prefix>/bin/gdb
name chosen above, and <gnat_install_prefix> should be replaced by
the location where you installed GNAT.
-@end ifset
-
@c **********************************
@c * GNU Free Documentation License *
@c **********************************
@include fdl.texi
@c GNU Free Documentation License
-@node Index,,GNU Free Documentation License, Top
+@node Index
@unnumbered Index
@printindex cp
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index c53d67ecf5c..63e7c142cee 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -143,7 +143,7 @@ procedure Gnatbind is
-- should not be listed.
No_Restriction_List : constant array (All_Restrictions) of Boolean :=
- (No_Allocators_After_Elaboration => True,
+ (No_Standard_Allocators_After_Elaboration => True,
-- This involves run-time conditions not checkable at compile time
No_Anonymous_Allocators => True,
@@ -176,6 +176,18 @@ procedure Gnatbind is
Max_Storage_At_Blocking => True,
-- Not checkable at compile time
+ -- The following three should not be partition-wide, so the
+ -- following tests are junk to be removed eventually ???
+
+ No_Specification_Of_Aspect => True,
+ -- Requires a parameter value, not a count
+
+ No_Use_Of_Attribute => True,
+ -- Requires a parameter value, not a count
+
+ No_Use_Of_Pragma => True,
+ -- Requires a parameter value, not a count
+
others => False);
Additional_Restrictions_Listed : Boolean := False;
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index 87ad072f7a5..503c2f7b152 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -153,6 +153,8 @@ procedure Gnatlink is
Binder_Ali_File : String_Access;
Binder_Obj_File : String_Access;
+ Base_Command_Name : String_Access;
+
Tname : Temp_File_Name;
Tname_FD : File_Descriptor := Invalid_FD;
-- Temporary file used by linker to pass list of object files on
@@ -226,6 +228,12 @@ procedure Gnatlink is
procedure Process_Binder_File (Name : String);
-- Reads the binder file and extracts linker arguments
+ function To_Lower (A : Character) return Character;
+ -- Fold a character to lower case;
+
+ procedure To_Lower (A : in out String);
+ -- Fold a string to lower case;
+
procedure Usage;
-- Display usage
@@ -314,7 +322,7 @@ procedure Gnatlink is
procedure Error_Msg (Message : String) is
begin
- Write_Str (Base_Name (Command_Name));
+ Write_Str (Base_Command_Name.all);
Write_Str (": ");
Write_Str (Message);
Write_Eol;
@@ -1406,6 +1414,31 @@ procedure Gnatlink is
Status := fclose (Fd);
end Process_Binder_File;
+ --------------
+ -- To_Lower --
+ --------------
+
+ function To_Lower (A : Character) return Character is
+ A_Val : constant Natural := Character'Pos (A);
+
+ begin
+ if A in 'A' .. 'Z'
+ or else A_Val in 16#C0# .. 16#D6#
+ or else A_Val in 16#D8# .. 16#DE#
+ then
+ return Character'Val (A_Val + 16#20#);
+ else
+ return A;
+ end if;
+ end To_Lower;
+
+ procedure To_Lower (A : in out String) is
+ begin
+ for J in A'Range loop
+ A (J) := To_Lower (A (J));
+ end loop;
+ end To_Lower;
+
-----------
-- Usage --
-----------
@@ -1413,7 +1446,7 @@ procedure Gnatlink is
procedure Usage is
begin
Write_Str ("Usage: ");
- Write_Str (Base_Name (Command_Name));
+ Write_Str (Base_Command_Name.all);
Write_Str (" switches mainprog.ali [non-Ada-objects] [linker-options]");
Write_Eol;
Write_Eol;
@@ -1501,6 +1534,15 @@ begin
end;
end if;
+ Base_Command_Name := new String'(Base_Name (Command_Name));
+
+ -- Fold to lower case "GNATLINK" on VMS to be consistent with output
+ -- from other GNAT utilities.
+
+ if Hostparm.OpenVMS then
+ To_Lower (Base_Command_Name.all);
+ end if;
+
Process_Args;
if Argument_Count = 0
@@ -1737,7 +1779,7 @@ begin
-- Assume this is a cross tool if the executable name is not gnatlink
- if Base_Name (Command_Name) = "gnatlink"
+ if Base_Command_Name.all = "gnatlink"
and then Output_File_Name.all = "test"
then
Error_Msg ("warning: executable name """ & Output_File_Name.all
diff --git a/gcc/ada/gnatname.adb b/gcc/ada/gnatname.adb
index 68375ef21db..56157ead462 100644
--- a/gcc/ada/gnatname.adb
+++ b/gcc/ada/gnatname.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -88,7 +88,7 @@ procedure Gnatname is
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gnatname.Arguments");
- -- Table to accumulate the foreign patterns
+ -- Table to accumulate directories and patterns
package Preprocessor_Switches is new Table.Table
(Table_Component_Type => String_Access,
@@ -346,6 +346,11 @@ procedure Gnatname is
Subdirs :=
new String'(Arg (Subdirs_Switch'Length + 1 .. Arg'Last));
+ -- --no-backup
+
+ elsif Arg = "--no-backup" then
+ Opt.No_Backup := True;
+
-- -c
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-c" then
@@ -515,6 +520,7 @@ procedure Gnatname is
Display_Usage_Version_And_Help;
Write_Line (" --subdirs=dir real obj/lib/exec dirs are subdirs");
+ Write_Line (" --no-backup do not create backup of project file");
Write_Eol;
Write_Line (" --and use different patterns");
diff --git a/gcc/ada/hostparm.ads b/gcc/ada/hostparm.ads
index ebecd5ceeff..d868f2fa724 100644
--- a/gcc/ada/hostparm.ads
+++ b/gcc/ada/hostparm.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -54,13 +54,14 @@ package Hostparm is
Normalized_CWD : constant String := "." & Direct_Separator;
-- Normalized string to access current directory
- Max_Line_Length : constant := Types.Column_Number'Pred
- (Types.Column_Number'Last);
+ Max_Line_Length : constant :=
+ Types.Column_Number'Pred (Types.Column_Number'Last);
-- Maximum source line length. By default we set it to the maximum
-- value that can be supported, which is given by the range of the
-- Column_Number type. We subtract 1 because need to be able to
-- have a valid Column_Number equal to Max_Line_Length to represent
-- the location of a "line too long" error.
+ --
-- 200 is the minimum value required (RM 2.2(15)). The value set here
-- can be reduced by the explicit use of the -gnatyM style switch.
diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads
index 1a7e76a713b..95dae64361e 100644
--- a/gcc/ada/i-cstrea.ads
+++ b/gcc/ada/i-cstrea.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -107,8 +107,8 @@ package Interfaces.C_Streams is
function fopen
(filename : chars;
mode : chars;
- encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8)
- return FILEs
+ encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8;
+ vms_form : chars := System.Null_Address) return FILEs
renames System.CRTL.fopen;
-- Note: to maintain target independence, use text_translation_required,
-- a boolean variable defined in sysdep.c to deal with the target
@@ -144,8 +144,8 @@ package Interfaces.C_Streams is
(filename : chars;
mode : chars;
stream : FILEs;
- encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8)
- return FILEs
+ encoding : System.CRTL.Filename_Encoding := System.CRTL.UTF8;
+ vms_form : chars := System.Null_Address) return FILEs
renames System.CRTL.freopen;
function fseek
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb
index efeb8960a4e..bb62264c66b 100644
--- a/gcc/ada/impunit.adb
+++ b/gcc/ada/impunit.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -380,7 +380,14 @@ package body Impunit is
("s-ststop", F), -- System.Strings.Stream_Ops
("s-tasinf", F), -- System.Task_Info
("s-wchcnv", F), -- System.Wch_Cnv
- ("s-wchcon", F)); -- System.Wch_Con
+ ("s-wchcon", F), -- System.Wch_Con
+
+ -- The following are strictly speaking Ada 2012 units, but we are allowed
+ -- to add children to system, so we consider them to be implementation
+ -- defined additions to System in earlier versions of Ada.
+
+ ("s-multip", T), -- System.Multiprocessors
+ ("s-mudido", T)); -- System.Multiprocessors.Dispatching_Domains
--------------------
-- Ada 2005 Units --
@@ -544,8 +551,6 @@ package body Impunit is
-- The following units should be used only in Ada 2012 mode
Non_Imp_File_Names_12 : constant File_List := (
- ("s-multip", T), -- System.Multiprocessors
- ("s-mudido", T), -- System.Multiprocessors.Dispatching_Domains
("s-stposu", T), -- System.Storage_Pools.Subpools
("a-cobove", T), -- Ada.Containers.Bounded_Vectors
("a-cbdlli", T), -- Ada.Containers.Bounded_Doubly_Linked_Lists
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index f5c3a814411..8408225dd7b 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -603,14 +603,6 @@ __gnat_install_handler (void)
handled properly, avoiding a SEGV generation from stack usage by the
handler itself. */
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
- stack_t stack;
- stack.ss_sp = __gnat_alternate_stack;
- stack.ss_size = sizeof (__gnat_alternate_stack);
- stack.ss_flags = 0;
- sigaltstack (&stack, NULL);
-#endif
-
act.sa_sigaction = __gnat_error_handler;
act.sa_flags = SA_NODEFER | SA_RESTART | SA_SIGINFO;
sigemptyset (&act.sa_mask);
@@ -624,11 +616,23 @@ __gnat_install_handler (void)
sigaction (SIGILL, &act, NULL);
if (__gnat_get_interrupt_state (SIGBUS) != 's')
sigaction (SIGBUS, &act, NULL);
+ if (__gnat_get_interrupt_state (SIGSEGV) != 's')
+ {
#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
- act.sa_flags |= SA_ONSTACK;
+ /* Setup an alternate stack region for the handler execution so that
+ stack overflows can be handled properly, avoiding a SEGV generation
+ from stack usage by the handler itself. */
+ stack_t stack;
+
+ stack.ss_sp = __gnat_alternate_stack;
+ stack.ss_size = sizeof (__gnat_alternate_stack);
+ stack.ss_flags = 0;
+ sigaltstack (&stack, NULL);
+
+ act.sa_flags |= SA_ONSTACK;
#endif
- if (__gnat_get_interrupt_state (SIGSEGV) != 's')
- sigaction (SIGSEGV, &act, NULL);
+ sigaction (SIGSEGV, &act, NULL);
+ }
__gnat_handler_installed = 1;
}
@@ -707,15 +711,6 @@ __gnat_install_handler(void)
#include <sys/ucontext.h>
#include <sys/regset.h>
-/* The code below is common to SPARC and x86. Beware of the delay slot
- differences for signal context adjustments. */
-
-#if defined (__sparc)
-#define RETURN_ADDR_OFFSET 8
-#else
-#define RETURN_ADDR_OFFSET 0
-#endif
-
static void
__gnat_error_handler (int sig, siginfo_t *si, void *ucontext ATTRIBUTE_UNUSED)
{
@@ -809,6 +804,7 @@ __gnat_install_handler (void)
/* Routine called from binder to override default feature values. */
void __gnat_set_features (void);
int __gnat_features_set = 0;
+void (*__gnat_ctrl_c_handler) (void) = 0;
#ifdef __IA64
#define lib_get_curr_invo_context LIB$I64_GET_CURR_INVO_CONTEXT
@@ -823,10 +819,12 @@ int __gnat_features_set = 0;
/* Define macro symbols for the VMS conditions that become Ada exceptions.
It would be better to just include <ssdef.h> */
+#define SS$_CONTINUE 1
#define SS$_ACCVIO 12
#define SS$_HPARITH 1284
#define SS$_INTDIV 1156
#define SS$_STKOVF 1364
+#define SS$_CONTROLC 1617
#define SS$_RESIGNAL 2328
#define MTH$_FLOOVEMAT 1475268 /* Some ACVC_21 CXA tests */
@@ -846,24 +844,28 @@ extern int LIB$_ACTIMAGE;
#define FDL$_UNPRIKW 11829410
#define CMA$_EXIT_THREAD 4227492
-struct cond_sigargs {
+struct cond_sigargs
+{
unsigned int sigarg;
unsigned int sigargval;
};
-struct cond_subtests {
+struct cond_subtests
+{
unsigned int num;
const struct cond_sigargs sigargs[];
};
-struct cond_except {
+struct cond_except
+{
unsigned int cond;
const struct Exception_Data *except;
unsigned int needs_adjust; /* 1 = adjust PC, 0 = no adjust */
const struct cond_subtests *subtests;
};
-struct descriptor_s {
+struct descriptor_s
+{
unsigned short len, mbz;
__char_ptr32 adr;
};
@@ -911,6 +913,9 @@ extern Exception_Code Base_Code_In (Exception_Code);
/* DEC Ada exceptions are not defined in a header file, so they
must be declared. */
+#define FAC_MASK 0x0fff0000
+#define DECADA_M_FACILITY 0x00310000
+
#define ADA$_ALREADY_OPEN 0x0031a594
#define ADA$_CONSTRAINT_ERRO 0x00318324
#define ADA$_DATA_ERROR 0x003192c4
@@ -939,7 +944,8 @@ extern Exception_Code Base_Code_In (Exception_Code);
#define ADA$_USE_ERROR 0x0031a8a4
/* DEC Ada specific conditions. */
-static const struct cond_except dec_ada_cond_except_table [] = {
+static const struct cond_except dec_ada_cond_except_table [] =
+{
{ADA$_PROGRAM_ERROR, &program_error, 0, 0},
{ADA$_USE_ERROR, &Use_Error, 0, 0},
{ADA$_KEYSIZERR, &program_error, 0, 0},
@@ -987,18 +993,19 @@ static const struct cond_except dec_ada_cond_except_table [] = {
in hindsight should have just made ACCVIO == Storage_Error. */
#define ACCVIO_VIRTUAL_ADDR 3
static const struct cond_subtests accvio_c_e =
- {1, /* number of subtests below */
- {
- {ACCVIO_VIRTUAL_ADDR, 0}
- }
- };
+{1, /* number of subtests below */
+ {
+ { ACCVIO_VIRTUAL_ADDR, 0 }
+ }
+};
/* Macro flag to adjust PC which gets off by one for some conditions,
not sure if this is reliably true, PC could be off by more for
HPARITH for example, unless a trapb is inserted. */
#define NEEDS_ADJUST 1
-static const struct cond_except system_cond_except_table [] = {
+static const struct cond_except system_cond_except_table [] =
+{
{MTH$_FLOOVEMAT, &constraint_error, 0, 0},
{SS$_INTDIV, &constraint_error, 0, 0},
{SS$_HPARITH, &constraint_error, NEEDS_ADJUST, 0},
@@ -1040,7 +1047,8 @@ static const struct cond_except system_cond_except_table [] = {
typedef int
resignal_predicate (int code);
-static const int * const cond_resignal_table [] = {
+static const int * const cond_resignal_table [] =
+{
&C$_SIGKILL,
(int *)CMA$_EXIT_THREAD,
&SS$_DEBUG,
@@ -1051,7 +1059,8 @@ static const int * const cond_resignal_table [] = {
0
};
-static const int facility_resignal_table [] = {
+static const int facility_resignal_table [] =
+{
0x1380000, /* RDB */
0x2220000, /* SQL */
0
@@ -1065,7 +1074,7 @@ __gnat_default_resignal_p (int code)
int i, iexcept;
for (i = 0; facility_resignal_table [i]; i++)
- if ((code & 0xfff0000) == facility_resignal_table [i])
+ if ((code & FAC_MASK) == facility_resignal_table [i])
return 1;
for (i = 0, iexcept = 0;
@@ -1099,7 +1108,6 @@ __gnat_set_resignal_predicate (resignal_predicate *predicate)
/* Action routine for SYS$PUTMSG. There may be multiple
conditions, each with text to be appended to MESSAGE
and separated by line termination. */
-
static int
copy_msg (struct descriptor_s *msgdesc, char *message)
{
@@ -1125,7 +1133,6 @@ copy_msg (struct descriptor_s *msgdesc, char *message)
/* Scan TABLE for a match for the condition contained in SIGARGS,
and return the entry, or the empty entry if no match found. */
-
static const struct cond_except *
scan_conditions ( int *sigargs, const struct cond_except *table [])
{
@@ -1174,6 +1181,8 @@ static const struct cond_except *
return &(*table) [i];
}
+/* __gnat_handle_vms_condtition is both a frame based handler
+ for the runtime, and an exception vector for the compiler. */
long
__gnat_handle_vms_condition (int *sigargs, void *mechargs)
{
@@ -1211,6 +1220,19 @@ __gnat_handle_vms_condition (int *sigargs, void *mechargs)
const struct cond_except *cond_tables [] = {dec_ada_cond_except_table,
system_cond_except_table,
0};
+ unsigned int ctrlc = SS$_CONTROLC;
+ int ctrlc_match = LIB$MATCH_COND (&sigargs [1], &ctrlc);
+
+ extern int SYS$DCLAST (void (*astadr)(), unsigned long long astprm,
+ unsigned int acmode);
+
+ /* If SS$_CONTROLC has been imported as an exception, it will take
+ priority over a a Ctrl/C handler. See above. */
+ if (ctrlc_match && __gnat_ctrl_c_handler)
+ {
+ SYS$DCLAST (__gnat_ctrl_c_handler, 0, 0);
+ return SS$_CONTINUE;
+ }
i = 0;
while ((cond_table = cond_tables[i++]) && !exception)
@@ -1236,7 +1258,18 @@ __gnat_handle_vms_condition (int *sigargs, void *mechargs)
message[0] = 0;
/* Subtract PC & PSL fields as per ABI for SYS$PUTMSG. */
sigargs[0] -= 2;
- SYS$PUTMSG (sigargs, copy_msg, &gnat_facility, message);
+
+ extern int SYS$PUTMSG (void *, int (*)(), void *, unsigned long long);
+
+ /* If it was a DEC Ada specific condtiion, make it GNAT otherwise
+ keep the old facility. */
+ if (sigargs [1] & FAC_MASK == DECADA_M_FACILITY)
+ SYS$PUTMSG (sigargs, copy_msg, &gnat_facility,
+ (unsigned long long ) message);
+ else
+ SYS$PUTMSG (sigargs, copy_msg, 0,
+ (unsigned long long ) message);
+
/* Add back PC & PSL fields as per ABI for SYS$PUTMSG. */
sigargs[0] += 2;
msg = message;
@@ -1253,6 +1286,8 @@ __gnat_install_handler (void)
long prvhnd ATTRIBUTE_UNUSED;
#if !defined (IN_RTS)
+ extern int SYS$SETEXV (unsigned int vector, int (*addres)(),
+ unsigned int accmode, void *(*(prvhnd)));
SYS$SETEXV (1, __gnat_handle_vms_condition, 3, &prvhnd);
#endif
@@ -1378,15 +1413,14 @@ struct regsum
};
extern int SYS$GET_REGION_INFO (unsigned int, unsigned long long *,
- void *, void *, unsigned int,
- void *, unsigned int *);
+ void *, void *, unsigned int,
+ void *, unsigned int *);
extern int SYS$EXPREG_64 (unsigned long long *, unsigned long long,
- unsigned int, unsigned int, void **,
- unsigned long long *);
+ unsigned int, unsigned int, void **,
+ unsigned long long *);
extern int SYS$SETPRT_64 (void *, unsigned long long, unsigned int,
- unsigned int, void **, unsigned long long *,
- unsigned int *);
-extern int SYS$PUTMSG (void *, int (*)(), void *, unsigned long long);
+ unsigned int, void **, unsigned long long *,
+ unsigned int *);
/* Add a guard page in the memory region containing ADDR at ADDR +/- SIZE.
(The sign depends on the kind of the memory region). */
@@ -1412,7 +1446,7 @@ __gnat_set_stack_guard_page (void *addr, unsigned long size)
/* Extend the region. */
status = SYS$EXPREG_64 (&buffer.q_region_id,
- size, 0, 0, &start_va, &length);
+ size, 0, 0, &start_va, &length);
if ((status & 1) != 1)
return -1;
@@ -1422,7 +1456,7 @@ __gnat_set_stack_guard_page (void *addr, unsigned long size)
start_va = (void *)((unsigned long long)start_va + length - VMS_PAGESIZE);
status = SYS$SETPRT_64 (start_va, VMS_PAGESIZE, PSL__C_USER, PRT__C_NA,
- &ret_va, &ret_len, &ret_prot);
+ &ret_va, &ret_len, &ret_prot);
if ((status & 1) != 1)
return -1;
@@ -1473,7 +1507,8 @@ struct feature {
int __gl_heap_size = 64;
/* Array feature logical names and global variable addresses. */
-static const struct feature features[] = {
+static const struct feature features[] =
+{
{"GNAT$NO_MALLOC_64", &__gl_heap_size},
{0, 0}
};
@@ -1490,13 +1525,13 @@ __gnat_set_features (void)
__gnat_vms_get_logical (features[i].name, buff, sizeof (buff));
if (strcmp (buff, "ENABLE") == 0
- || strcmp (buff, "TRUE") == 0
- || strcmp (buff, "1") == 0)
- *features[i].gl_addr = 32;
+ || strcmp (buff, "TRUE") == 0
+ || strcmp (buff, "1") == 0)
+ *features[i].gl_addr = 32;
else if (strcmp (buff, "DISABLE") == 0
- || strcmp (buff, "FALSE") == 0
- || strcmp (buff, "0") == 0)
- *features[i].gl_addr = 64;
+ || strcmp (buff, "FALSE") == 0
+ || strcmp (buff, "0") == 0)
+ *features[i].gl_addr = 64;
}
/* Features to artificially limit the stack size. */
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 7f743e23aa9..12664ee376f 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -49,7 +49,6 @@ with Sinput; use Sinput;
with Snames; use Snames;
with Stringt; use Stringt;
with Tbuild; use Tbuild;
-with Ttypes; use Ttypes;
with Uname; use Uname;
with System.Case_Util; use System.Case_Util;
@@ -1441,93 +1440,6 @@ package body Lib.Writ is
Output_Alfa;
end if;
- -- Output target dependent information if needed
-
- if Generate_Target_Dependent_Info then
- Gen_TDI : declare
- subtype Str4 is String (1 .. 4);
-
- procedure Gen_TDI_Bool (Code : Str4; Val : Boolean);
- -- Generate T line for Bool value
-
- procedure Gen_TDI_Nat (Code : Str4; Val : Int);
- -- Generate T line for Pos or Nat value
-
- ------------------
- -- Gen_TDI_Bool --
- ------------------
-
- procedure Gen_TDI_Bool (Code : Str4; Val : Boolean) is
- begin
- Write_Info_Initiate ('T');
- Write_Info_Char (' ');
- Write_Info_Str (Code);
-
- if Val then
- Write_Info_Str (" TRUE");
- else
- Write_Info_Str (" FALSE");
- end if;
-
- Write_Info_EOL;
- end Gen_TDI_Bool;
-
- -----------------
- -- Gen_TDI_Nat --
- -----------------
-
- procedure Gen_TDI_Nat (Code : Str4; Val : Int) is
- begin
- Write_Info_Initiate ('T');
- Write_Info_Char (' ');
- Write_Info_Str (Code);
- Write_Info_Char (' ');
- Write_Info_Nat (Val);
-
- Write_Info_EOL;
- end Gen_TDI_Nat;
-
- -- Start of processing for Gen_TDI
-
- begin
- Gen_TDI_Nat ("SINS", Standard_Short_Short_Integer_Size);
- Gen_TDI_Nat ("SINW", Standard_Short_Short_Integer_Width);
- Gen_TDI_Nat ("SHIS", Standard_Short_Integer_Size);
- Gen_TDI_Nat ("SHIW", Standard_Short_Integer_Width);
- Gen_TDI_Nat ("INTS", Standard_Integer_Size);
- Gen_TDI_Nat ("INTW", Standard_Integer_Width);
- Gen_TDI_Nat ("LINS", Standard_Long_Integer_Size);
- Gen_TDI_Nat ("LINW", Standard_Long_Integer_Width);
- Gen_TDI_Nat ("LLIS", Standard_Long_Long_Integer_Size);
- Gen_TDI_Nat ("LLIW", Standard_Long_Long_Integer_Width);
- Gen_TDI_Nat ("SFLS", Standard_Short_Float_Size);
- Gen_TDI_Nat ("SFLD", Standard_Short_Float_Digits);
- Gen_TDI_Nat ("FLTS", Standard_Float_Size);
- Gen_TDI_Nat ("FLTD", Standard_Float_Digits);
- Gen_TDI_Nat ("LFLS", Standard_Long_Float_Size);
- Gen_TDI_Nat ("LFLD", Standard_Long_Float_Digits);
- Gen_TDI_Nat ("LLFS", Standard_Long_Long_Float_Size);
- Gen_TDI_Nat ("LLFD", Standard_Long_Long_Float_Digits);
- Gen_TDI_Nat ("CHAS", Standard_Character_Size);
- Gen_TDI_Nat ("WCHS", Standard_Wide_Character_Size);
- Gen_TDI_Nat ("WWCS", Standard_Wide_Wide_Character_Size);
- Gen_TDI_Nat ("ADRS", System_Address_Size);
- Gen_TDI_Nat ("MBMP", System_Max_Binary_Modulus_Power);
- Gen_TDI_Nat ("MNMP", System_Max_Nonbinary_Modulus_Power);
- Gen_TDI_Nat ("SUNI", System_Storage_Unit);
- Gen_TDI_Nat ("WRDS", System_Word_Size);
- Gen_TDI_Nat ("TICK", System_Tick_Nanoseconds);
- Gen_TDI_Nat ("WCTS", Interfaces_Wchar_T_Size);
- Gen_TDI_Nat ("MAXA", Maximum_Alignment);
- Gen_TDI_Nat ("ALLA", System_Allocator_Alignment);
- Gen_TDI_Nat ("MUNF", Max_Unaligned_Field);
- Gen_TDI_Bool ("BEND", Bytes_Big_Endian);
- Gen_TDI_Bool ("STRA", Target_Strict_Alignment);
- Gen_TDI_Nat ("DFLA", Target_Double_Float_Alignment);
- Gen_TDI_Nat ("DSCA", Target_Double_Scalar_Alignment);
- end Gen_TDI;
- end if;
-
-- Output final blank line and we are done. This final blank line is
-- probably junk, but we don't feel like making an incompatible change!
diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads
index 3867c5f2643..f6553571c22 100644
--- a/gcc/ada/lib-writ.ads
+++ b/gcc/ada/lib-writ.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -818,24 +818,6 @@ package Lib.Writ is
-- The Alfa information follows the SCO information. See the spec of Alfa
-- in file alfa.ads for full details of the format.
- -------------------------------------
- -- T Target Dependent Information --
- -------------------------------------
-
- -- This section is present if the option to generate target dependent
- -- information is present (this flag is set by the -gnatT switch). The
- -- format of T lines is:
-
- -- T key val
-
- -- There is one line for each constant declared in the Ttypes package
-
- -- key is the four letter code (which can be found as a comment on each
- -- of the constant declarations in Ttypes).
-
- -- val is the value of the constant, which is either a non-negative
- -- decimal constant, or TRUE or FALSE for a Boolean value.
-
----------------------
-- Global Variables --
----------------------
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 2f01dd4480f..ba9221b2bd4 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -516,11 +516,9 @@ package body Lib.Xref is
P := Parent (P);
if Nkind (P) = N_Pragma then
- if Pragma_Name (P) = Name_Warnings
- or else
- Pragma_Name (P) = Name_Unmodified
- or else
- Pragma_Name (P) = Name_Unreferenced
+ if Nam_In (Pragma_Name (P), Name_Warnings,
+ Name_Unmodified,
+ Name_Unreferenced)
then
return False;
end if;
@@ -1364,6 +1362,23 @@ package body Lib.Xref is
then
Tref := Etype (Tref);
+ -- Another special case: an object of a classwide type
+ -- initialized with a tag-indeterminate call gets a subtype
+ -- of the classwide type during expansion. See if the original
+ -- type in the declaration is named, and return it instead
+ -- of going to the root type.
+
+ if Ekind (Tref) = E_Class_Wide_Subtype
+ and then Nkind (Parent (Ent)) = N_Object_Declaration
+ and then
+ Nkind (Original_Node (Object_Definition (Parent (Ent))))
+ = N_Identifier
+ then
+ Tref :=
+ Entity
+ (Original_Node ((Object_Definition (Parent (Ent)))));
+ end if;
+
-- For anything else, exit
else
@@ -2047,8 +2062,8 @@ package body Lib.Xref is
Ctyp := '*';
end if;
- -- Special handling for access parameters and objects of
- -- an anonymous access type.
+ -- Special handling for access parameters and objects and
+ -- components of an anonymous access type.
if Ekind_In (Etype (XE.Key.Ent),
E_Anonymous_Access_Type,
@@ -2056,7 +2071,9 @@ package body Lib.Xref is
E_Anonymous_Access_Protected_Subprogram_Type)
then
if Is_Formal (XE.Key.Ent)
- or else Ekind_In (XE.Key.Ent, E_Variable, E_Constant)
+ or else
+ Ekind_In
+ (XE.Key.Ent, E_Variable, E_Constant, E_Component)
then
Ctyp := 'p';
end if;
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 27d0f697e98..56b7a7f1f64 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -1321,8 +1321,8 @@ package body Make is
then
Errutil.Error_Msg
('"' & Argv &
- """ is not a gnatmake switch. Consider moving " &
- "it to Global_Compilation_Switches.",
+ """ is not a gnatmake switch. Consider moving "
+ & "it to Global_Compilation_Switches.",
Element.Location);
Make_Failed ("*** illegal switch """ & Argv & """");
end if;
@@ -2982,8 +2982,8 @@ package body Make is
Make_Failed
("not allowed to compile """ &
Get_Name_String (Fname) &
- """; use -a switch, or compile file with " &
- """-gnatg"" switch");
+ """; use -a switch, or use the compiler directly with "
+ & "the ""-gnatg"" switch");
end if;
end if;
end;
@@ -3449,8 +3449,8 @@ package body Make is
Fail
("not allowed to compile """ &
Get_Name_String (Source.File) &
- """; use -a switch, or compile file with " &
- """-gnatg"" switch");
+ """; use -a switch, or use the compiler directly with "
+ & "the ""-gnatg"" switch");
end if;
Verbose_Msg
@@ -3841,7 +3841,7 @@ package body Make is
Last := 1;
Result (1) :=
new String'
- ("-gnatec=" & Get_Name_String (For_Project.Config_File_Name));
+ ("-gnatec=" & Get_Name_String (For_Project.Config_File_Name));
else
Temporary_Config_File := False;
@@ -4233,8 +4233,7 @@ package body Make is
(Index).Library_Dir.Display_Name) &
"lib" &
Get_Name_String
- (Library_Projs.Table
- (Index).Library_Name) &
+ (Library_Projs.Table (Index).Library_Name) &
"." &
MLib.Tgt.Archive_Ext);
@@ -4244,9 +4243,8 @@ package body Make is
Linker_Switches.Increment_Last;
Linker_Switches.Table (Linker_Switches.Last) :=
new String'("-L" &
- Get_Name_String
- (Library_Projs.Table (Index).
- Library_Dir.Display_Name));
+ Get_Name_String (Library_Projs.Table (Index).
+ Library_Dir.Display_Name));
-- Add the -l switch
@@ -4254,8 +4252,7 @@ package body Make is
Linker_Switches.Table (Linker_Switches.Last) :=
new String'("-l" &
Get_Name_String
- (Library_Projs.Table (Index).
- Library_Name));
+ (Library_Projs.Table (Index).Library_Name));
end if;
end if;
end loop;
@@ -5592,8 +5589,8 @@ package body Make is
-- No main program may be specified on the command line
elsif Osint.Number_Of_Files /= 0 then
- Make_Failed ("-B cannot be used with a main specified on " &
- "the command line");
+ Make_Failed
+ ("-B cannot be used with a main specified on the command line");
-- And the project file cannot be a library project file
@@ -5641,8 +5638,9 @@ package body Make is
and then not Unique_Compile
and then ((not Make_Steps) or else Bind_Only or else Link_Only)
then
- Make_Failed ("cannot specify a main program " &
- "on the command line for a library project file");
+ Make_Failed
+ ("cannot specify a main program "
+ & "on the command line for a library project file");
end if;
-- If no mains have been specified on the command line, and we are
@@ -5652,8 +5650,8 @@ package body Make is
else
if Main_Index /= 0 then
- Make_Failed ("cannot specify a multi-unit index but no main " &
- "on the command line");
+ Make_Failed ("cannot specify a multi-unit index but no main "
+ & "on the command line");
end if;
declare
@@ -5879,9 +5877,10 @@ package body Make is
Add_Switch
("-I" &
Normalize_Directory_Name
- (Get_Primary_Src_Search_Directory.all).all,
- Compiler, Append_Switch => False,
- And_Save => False);
+ (Get_Primary_Src_Search_Directory.all).all,
+ Compiler,
+ Append_Switch => False,
+ And_Save => False);
end if;
@@ -6440,9 +6439,8 @@ package body Make is
if Prefix'Length > 0 then
declare
PATH : constant String :=
- Prefix & Directory_Separator & "bin" &
- Path_Separator &
- Getenv ("PATH").all;
+ Prefix & Directory_Separator & "bin" & Path_Separator &
+ Getenv ("PATH").all;
begin
Setenv ("PATH", PATH);
end;
@@ -7423,8 +7421,8 @@ package body Make is
elsif Program_Args = Linker
and then Argv = "-o"
then
- Make_Failed ("switch -o not allowed within a -largs. " &
- "Use -o directly.");
+ Make_Failed
+ ("switch -o not allowed within a -largs. Use -o directly.");
-- Check to see if we are reading switches after a -cargs, -bargs or
-- -largs switch. If so, save it.
@@ -7573,16 +7571,16 @@ package body Make is
elsif Src_Path_Name = null
and then Lib_Path_Name = null
then
- Make_Failed ("RTS path not valid: missing " &
- "adainclude and adalib directories");
+ Make_Failed ("RTS path not valid: missing "
+ & "adainclude and adalib directories");
elsif Src_Path_Name = null then
- Make_Failed ("RTS path not valid: missing adainclude " &
- "directory");
+ Make_Failed ("RTS path not valid: missing adainclude "
+ & "directory");
elsif Lib_Path_Name = null then
- Make_Failed ("RTS path not valid: missing adalib " &
- "directory");
+ Make_Failed ("RTS path not valid: missing adalib "
+ & "directory");
end if;
end;
end if;
@@ -7820,8 +7818,8 @@ package body Make is
-- or a -P switch inside a project file.
Fail
- ("either the tool is not ""project-aware"" or " &
- "a project file is specified inside a project file");
+ ("either the tool is not ""project-aware"" or "
+ & "a project file is specified inside a project file");
elsif Argv'Last = 2 then
diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb
index 6d33aaacca7..aef82cba856 100644
--- a/gcc/ada/makeutl.adb
+++ b/gcc/ada/makeutl.adb
@@ -369,12 +369,12 @@ package body Makeutl is
Status : Boolean;
-- For call to Close
- Iter : Source_Iterator :=
- For_Each_Source
- (In_Tree => Project_Tree,
- Language => Name_Ada,
- Encapsulated_Libs => False,
- Locally_Removed => False);
+ Iter : Source_Iterator := For_Each_Source
+ (In_Tree => Project_Tree,
+ Language => Name_Ada,
+ Encapsulated_Libs => False,
+ Locally_Removed => False);
+
Source : Prj.Source_Id;
begin
@@ -390,7 +390,10 @@ package body Makeutl is
Unit := Source.Unit;
- if Unit = No_Unit_Index or else Unit.Name = No_Name then
+ if Source.Replaced_By /= No_Source
+ or else Unit = No_Unit_Index
+ or else Unit.Name = No_Name
+ then
ALI_Name := No_File;
-- If this is a body, put it in the mapping
@@ -431,13 +434,14 @@ package body Makeutl is
-- found.
if ALI_Name /= No_File then
+
-- Look in the project and the projects that are extending it
-- to find the real ALI file.
declare
- ALI : constant String := Get_Name_String (ALI_Name);
+ ALI : constant String := Get_Name_String (ALI_Name);
+ ALI_Path : Name_Id := No_Name;
- ALI_Path : Name_Id := No_Name;
begin
loop
-- For library projects, use the library ALI directory,
@@ -462,6 +466,7 @@ package body Makeutl is
end loop;
if ALI_Path /= No_Name then
+
-- First line is the unit name
Get_Name_String (ALI_Unit);
@@ -475,7 +480,7 @@ package body Makeutl is
exit when not OK;
- -- Second line it the ALI file name
+ -- Second line is the ALI file name
Get_Name_String (ALI_Name);
Add_Char_To_Name_Buffer (ASCII.LF);
@@ -488,7 +493,7 @@ package body Makeutl is
exit when not OK;
- -- Third line it the ALI path name
+ -- Third line is the ALI path name
Get_Name_String (ALI_Path);
Add_Char_To_Name_Buffer (ASCII.LF);
@@ -576,8 +581,9 @@ package body Makeutl is
if Sw'Length >= 3
and then (Sw (2) = 'I'
or else (not For_Gnatbind
- and then (Sw (2) = 'L'
- or else Sw (2) = 'A')))
+ and then (Sw (2) = 'L'
+ or else
+ Sw (2) = 'A')))
then
Start := 3;
@@ -592,7 +598,7 @@ package body Makeutl is
or else
Sw (2 .. 3) = "aI"
or else
- (For_Gnatbind and then Sw (2 .. 3) = "A="))
+ (For_Gnatbind and then Sw (2 .. 3) = "A="))
then
Start := 4;
@@ -1250,56 +1256,56 @@ package body Makeutl is
Obj_Proj := Source.Project;
while Obj_Proj /= No_Project loop
- declare
- Dir : constant String :=
- Get_Name_String
- (Obj_Proj.Object_Directory.Display_Name);
+ if Obj_Proj.Object_Directory /= No_Path_Information then
+ declare
+ Dir : constant String :=
+ Get_Name_String (Obj_Proj.Object_Directory.Display_Name);
- Object_Path : constant String :=
- Normalize_Pathname
- (Name =>
- Get_Name_String (Source.Object),
- Resolve_Links => Opt.Follow_Links_For_Files,
- Directory => Dir);
+ Object_Path : constant String :=
+ Normalize_Pathname
+ (Name => Get_Name_String (Source.Object),
+ Resolve_Links => Opt.Follow_Links_For_Files,
+ Directory => Dir);
- Obj_Path : constant Path_Name_Type := Create_Name (Object_Path);
- Stamp : Time_Stamp_Type := Empty_Time_Stamp;
+ Obj_Path : constant Path_Name_Type :=
+ Create_Name (Object_Path);
- begin
- -- For specs, we do not check object files if there is a body.
- -- This saves a system call. On the other hand, we do need to
- -- know the object_path, in case the user has passed the .ads
- -- on the command line to compile the spec only.
-
- if Source.Kind /= Spec
- or else Source.Unit = No_Unit_Index
- or else Source.Unit.File_Names (Impl) = No_Source
- then
- Stamp := File_Stamp (Obj_Path);
- end if;
+ Stamp : Time_Stamp_Type := Empty_Time_Stamp;
- if Stamp /= Empty_Time_Stamp
- or else (Obj_Proj.Extended_By = No_Project
- and then Source.Object_Project = No_Project)
- then
- Set_Object_Project (Dir, Obj_Proj, Obj_Path, Stamp);
- end if;
+ begin
+ -- For specs, we do not check object files if there is a
+ -- body. This saves a system call. On the other hand, we do
+ -- need to know the object_path, in case the user has passed
+ -- the .ads on the command line to compile the spec only.
+
+ if Source.Kind /= Spec
+ or else Source.Unit = No_Unit_Index
+ or else Source.Unit.File_Names (Impl) = No_Source
+ then
+ Stamp := File_Stamp (Obj_Path);
+ end if;
- Obj_Proj := Obj_Proj.Extended_By;
- end;
+ if Stamp /= Empty_Time_Stamp
+ or else (Obj_Proj.Extended_By = No_Project
+ and then Source.Object_Project = No_Project)
+ then
+ Set_Object_Project (Dir, Obj_Proj, Obj_Path, Stamp);
+ end if;
+ end;
+ end if;
+
+ Obj_Proj := Obj_Proj.Extended_By;
end loop;
elsif Source.Language.Config.Dependency_Kind = Makefile then
declare
Object_Dir : constant String :=
- Get_Name_String
- (Source.Project.Object_Directory.Display_Name);
+ Get_Name_String (Source.Project.Object_Directory.Display_Name);
Dep_Path : constant String :=
- Normalize_Pathname
- (Name => Get_Name_String (Source.Dep_Name),
- Resolve_Links =>
- Opt.Follow_Links_For_Files,
- Directory => Object_Dir);
+ Normalize_Pathname
+ (Name => Get_Name_String (Source.Dep_Name),
+ Resolve_Links => Opt.Follow_Links_For_Files,
+ Directory => Object_Dir);
begin
Source.Dep_Path := Create_Name (Dep_Path);
Source.Dep_TS := Osint.Unknown_Attributes;
@@ -1317,8 +1323,8 @@ package body Makeutl is
(Env : Prj.Tree.Environment;
Argv : String) return Boolean
is
- Start : Positive := 3;
- Finish : Natural := Argv'Last;
+ Start : Positive := 3;
+ Finish : Natural := Argv'Last;
pragma Assert (Argv'First = 1);
pragma Assert (Argv (1 .. 2) = "-X");
diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb
index 2842dfd4e81..1cebb464b8e 100644
--- a/gcc/ada/namet.adb
+++ b/gcc/ada/namet.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1039,6 +1039,100 @@ package body Namet is
end if;
end Name_Find;
+ -------------
+ -- Nam_In --
+ -------------
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id) return Boolean
+ is
+ begin
+ return T = V1 or else
+ T = V2;
+ end Nam_In;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id) return Boolean
+ is
+ begin
+ return T = V1 or else
+ T = V2 or else
+ T = V3;
+ end Nam_In;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id) return Boolean
+ is
+ begin
+ return T = V1 or else
+ T = V2 or else
+ T = V3 or else
+ T = V4;
+ end Nam_In;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id;
+ V5 : Name_Id) return Boolean
+ is
+ begin
+ return T = V1 or else
+ T = V2 or else
+ T = V3 or else
+ T = V4 or else
+ T = V5;
+ end Nam_In;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id;
+ V5 : Name_Id;
+ V6 : Name_Id) return Boolean
+ is
+ begin
+ return T = V1 or else
+ T = V2 or else
+ T = V3 or else
+ T = V4 or else
+ T = V5 or else
+ T = V6;
+ end Nam_In;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id;
+ V5 : Name_Id;
+ V6 : Name_Id;
+ V7 : Name_Id) return Boolean
+ is
+ begin
+ return T = V1 or else
+ T = V2 or else
+ T = V3 or else
+ T = V4 or else
+ T = V5 or else
+ T = V6 or else
+ T = V7;
+ end Nam_In;
+
------------------
-- Reinitialize --
------------------
diff --git a/gcc/ada/namet.ads b/gcc/ada/namet.ads
index e8978f8b52f..dcce9ea91c9 100644
--- a/gcc/ada/namet.ads
+++ b/gcc/ada/namet.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -165,6 +165,65 @@ package Namet is
First_Name_Id : constant Name_Id := Names_Low_Bound + 2;
-- Subscript of first entry in names table
+ ------------------------------
+ -- Name_Id Membership Tests --
+ ------------------------------
+
+ -- The following functions allow a convenient notation for testing whether
+ -- a Name_Id value matches any one of a list of possible values. In each
+ -- case True is returned if the given T argument is equal to any of the V
+ -- arguments. These essentially duplicate the Ada 2012 membership tests,
+ -- but we cannot use the latter (yet) in the compiler front end, because
+ -- of bootstrap considerations
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id) return Boolean;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id) return Boolean;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id) return Boolean;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id;
+ V5 : Name_Id) return Boolean;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id;
+ V5 : Name_Id;
+ V6 : Name_Id) return Boolean;
+
+ function Nam_In
+ (T : Name_Id;
+ V1 : Name_Id;
+ V2 : Name_Id;
+ V3 : Name_Id;
+ V4 : Name_Id;
+ V5 : Name_Id;
+ V6 : Name_Id;
+ V7 : Name_Id) return Boolean;
+
+ pragma Inline (Nam_In);
+ -- Inline all above functions
+
-----------------
-- Subprograms --
-----------------
diff --git a/gcc/ada/nlists.adb b/gcc/ada/nlists.adb
index 453e665eccc..41b5ac2e08c 100644
--- a/gcc/ada/nlists.adb
+++ b/gcc/ada/nlists.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -987,21 +987,6 @@ package body Nlists is
return Int (Lists.Last) - Int (Lists.First) + 1;
end Num_Lists;
- -------
- -- p --
- -------
-
- function p (U : Union_Id) return Node_Or_Entity_Id is
- begin
- if U in Node_Range then
- return Parent (Node_Or_Entity_Id (U));
- elsif U in List_Range then
- return Parent (List_Id (U));
- else
- return 99_999_999;
- end if;
- end p;
-
------------
-- Parent --
------------
diff --git a/gcc/ada/nlists.ads b/gcc/ada/nlists.ads
index 10c04ed9021..5fd66ded7ff 100644
--- a/gcc/ada/nlists.ads
+++ b/gcc/ada/nlists.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -363,12 +363,4 @@ package Nlists is
-- These functions return the addresses of the Next_Node and Prev_Node
-- tables (used in Back_End for Gigi).
- function p (U : Union_Id) return Node_Or_Entity_Id;
- -- This function is intended for use from the debugger, it determines
- -- whether U is a Node_Id or List_Id, and calls the appropriate Parent
- -- function and returns the parent Node in either case. This is shorter
- -- to type, and avoids the overloading problem of using Parent. It
- -- should NEVER be used except from the debugger. If p is called with
- -- other than a node or list id value, it returns 99_999_999.
-
end Nlists;
diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb
index 98eab409877..136fb5f2d7b 100644
--- a/gcc/ada/opt.adb
+++ b/gcc/ada/opt.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -59,8 +59,6 @@ package body Opt is
Assume_No_Invalid_Values_Config := Assume_No_Invalid_Values;
Check_Float_Overflow_Config := Check_Float_Overflow;
Check_Policy_List_Config := Check_Policy_List;
- Debug_Pragmas_Disabled_Config := Debug_Pragmas_Disabled;
- Debug_Pragmas_Enabled_Config := Debug_Pragmas_Enabled;
Default_Pool_Config := Default_Pool;
Dynamic_Elaboration_Checks_Config := Dynamic_Elaboration_Checks;
Exception_Locations_Suppressed_Config := Exception_Locations_Suppressed;
@@ -94,8 +92,6 @@ package body Opt is
Assume_No_Invalid_Values := Save.Assume_No_Invalid_Values;
Check_Float_Overflow := Save.Check_Float_Overflow;
Check_Policy_List := Save.Check_Policy_List;
- Debug_Pragmas_Disabled := Save.Debug_Pragmas_Disabled;
- Debug_Pragmas_Enabled := Save.Debug_Pragmas_Enabled;
Default_Pool := Save.Default_Pool;
Dynamic_Elaboration_Checks := Save.Dynamic_Elaboration_Checks;
Exception_Locations_Suppressed := Save.Exception_Locations_Suppressed;
@@ -131,8 +127,6 @@ package body Opt is
Save.Assume_No_Invalid_Values := Assume_No_Invalid_Values;
Save.Check_Float_Overflow := Check_Float_Overflow;
Save.Check_Policy_List := Check_Policy_List;
- Save.Debug_Pragmas_Disabled := Debug_Pragmas_Disabled;
- Save.Debug_Pragmas_Enabled := Debug_Pragmas_Enabled;
Save.Default_Pool := Default_Pool;
Save.Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks;
Save.Exception_Locations_Suppressed := Exception_Locations_Suppressed;
@@ -183,14 +177,10 @@ package body Opt is
if Main_Unit then
Assertions_Enabled := Assertions_Enabled_Config;
Assume_No_Invalid_Values := Assume_No_Invalid_Values_Config;
- Debug_Pragmas_Disabled := Debug_Pragmas_Disabled_Config;
- Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config;
Check_Policy_List := Check_Policy_List_Config;
else
Assertions_Enabled := False;
Assume_No_Invalid_Values := False;
- Debug_Pragmas_Disabled := False;
- Debug_Pragmas_Enabled := False;
Check_Policy_List := Empty;
end if;
@@ -203,8 +193,6 @@ package body Opt is
Assume_No_Invalid_Values := Assume_No_Invalid_Values_Config;
Check_Float_Overflow := Check_Float_Overflow_Config;
Check_Policy_List := Check_Policy_List_Config;
- Debug_Pragmas_Disabled := Debug_Pragmas_Disabled_Config;
- Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config;
Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks_Config;
Extensions_Allowed := Extensions_Allowed_Config;
External_Name_Exp_Casing := External_Name_Exp_Casing_Config;
@@ -261,8 +249,6 @@ package body Opt is
Tree_Read_Bool (Assertions_Enabled);
Tree_Read_Bool (Check_Float_Overflow);
Tree_Read_Int (Int (Check_Policy_List));
- Tree_Read_Bool (Debug_Pragmas_Disabled);
- Tree_Read_Bool (Debug_Pragmas_Enabled);
Tree_Read_Int (Int (Default_Pool));
Tree_Read_Bool (Full_List);
@@ -328,8 +314,6 @@ package body Opt is
Tree_Write_Bool (Assertions_Enabled);
Tree_Write_Bool (Check_Float_Overflow);
Tree_Write_Int (Int (Check_Policy_List));
- Tree_Write_Bool (Debug_Pragmas_Disabled);
- Tree_Write_Bool (Debug_Pragmas_Enabled);
Tree_Write_Int (Int (Default_Pool));
Tree_Write_Bool (Full_List);
Tree_Write_Int (Int (Version_String'Length));
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index 9beeb583523..bbf6e295270 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -119,14 +119,11 @@ package Opt is
-- Think twice before using "="; Ada_Version >= Ada_2012 is more likely
-- what you want, because it will apply to future versions of the language.
- Ada_Version_Default : constant Ada_Version_Type := Ada_2005;
+ Ada_Version_Default : constant Ada_Version_Type := Ada_2012;
pragma Warnings (Off, Ada_Version_Default);
-- GNAT
-- Default Ada version if no switch given. The Warnings off is to kill
-- constant condition warnings.
- --
- -- WARNING: some scripts rely on the format of this line of code. Any
- -- change must be coordinated with the scripts requirements.
Ada_Version : Ada_Version_Type := Ada_Version_Default;
-- GNAT
@@ -344,7 +341,7 @@ package Opt is
-- Modified by use of -gnatwu/U.
CodePeer_Mode : Boolean := False;
- -- GNAT, GNATBIND
+ -- GNAT, GNATBIND, GPRBUILD
-- Enable full CodePeer mode (SCIL generation, disable switches that
-- interact badly with it, etc...).
@@ -391,14 +388,6 @@ package Opt is
-- Set to True (-C switch) to indicate that the compiler will be invoked
-- with a mapping file (-gnatem compiler switch).
- Debug_Pragmas_Enabled : Boolean := False;
- -- GNAT
- -- Enable debug statements from pragma Debug
-
- Debug_Pragmas_Disabled : Boolean := False;
- -- GNAT
- -- Debug pragmas completely disabled (no semantic checking)
-
subtype Debug_Level_Value is Nat range 0 .. 3;
Debugger_Level : Debug_Level_Value := 0;
-- GNATBIND
@@ -447,6 +436,10 @@ package Opt is
-- Set True to force the run time to raise Program_Error if calls to
-- potentially blocking operations are detected from protected actions.
+ Directories_Must_Exist_In_Projects : Boolean := True;
+ -- PROJECT MANAGER
+ -- Set to False with switch -f of gnatclean and gprclean
+
Display_Compilation_Progress : Boolean := False;
-- GNATMAKE, GPRMAKE, GPRBUILD
-- Set True (-d switch) to display information on progress while compiling
@@ -600,26 +593,25 @@ package Opt is
Fast_Math : Boolean := False;
-- GNAT
-- Indicates the current setting of Fast_Math mode, as set by the use
- -- of a Fast_Math pragma (set on by Fast_Math (On)).
+ -- of a Fast_Math pragma (set True by Fast_Math (On)).
Float_Format : Character := ' ';
-- GNAT
-- A non-blank value indicates that a Float_Format pragma has been
- -- processed, in which case this variable is set to 'I' for IEEE or
- -- to 'V' for VAX. The setting of 'V' is only possible on OpenVMS
- -- versions of GNAT.
+ -- processed, in which case this variable is set to 'I' for IEEE or to
+ -- 'V' for VAX. The setting of 'V' is only possible on OpenVMS versions
+ -- of GNAT.
Float_Format_Long : Character := ' ';
-- GNAT
- -- A non-blank value indicates that a Long_Float pragma has been
- -- processed (this pragma is recognized only in OpenVMS versions
- -- of GNAT), in which case this variable is set to D or G for
- -- D_Float or G_Float.
+ -- A non-blank value indicates that a Long_Float pragma has been processed
+ -- (this pragma is recognized only in OpenVMS versions of GNAT), in which
+ -- case this variable is set to D or G for D_Float or G_Float.
Force_ALI_Tree_File : Boolean := False;
-- GNAT
- -- Force generation of ALI file even if errors are encountered.
- -- Also forces generation of tree file if -gnatt is also set.
+ -- Force generation of ALI file even if errors are encountered. Also forces
+ -- generation of tree file if -gnatt is also set. Set on by use of -gnatQ.
Disable_ALI_File : Boolean := False;
-- GNAT
@@ -667,11 +659,6 @@ package Opt is
-- True when switch -fdebug-instances is used. When True, a table of
-- instances is included in SCOs.
- Generate_Target_Dependent_Info : Boolean := False;
- -- GNAT
- -- When true (-gnatet switch used). True if target dependent info is to be
- -- generated in the ali file.
-
Generating_Code : Boolean := False;
-- GNAT
-- True if the frontend finished its work and has called the backend to
@@ -986,6 +973,11 @@ package Opt is
-- in this variable (e.g. 2 = select second unit in file). A value of
-- zero indicates that we are in normal (one unit per file) mode.
+ No_Backup : Boolean := False;
+ -- GNATNAME
+ -- Set by switch --no-backup.
+ -- Do not create backup copies of project files.
+
No_Deletion : Boolean := False;
-- GNATPREP
-- Set by preprocessor switch -a. Do not eliminate any source text. Implies
@@ -1186,6 +1178,16 @@ package Opt is
-- Set to True to enable compatibility mode with Rational compiler, and
-- to accept renamings of implicit operations in their own scope.
+ Relaxed_RM_Semantics : Boolean := False;
+ -- GNAT
+ -- Set to True to ignore some Ada semantic error to help parse legacy
+ -- Ada code for use in e.g. static analysis (such as CodePeer). This
+ -- deals with cases where other compilers allow illegal constructs. Tools
+ -- such as CodePeer are interested in analyzing code rather than enforcing
+ -- legality rules, so as long as these illegal constructs end up with code
+ -- that can be handled by the tool in question, there is no reason to
+ -- reject the code that is considered correct by the other compiler.
+
Replace_In_Comments : Boolean := False;
-- GNATPREP
-- Set to True if -C switch used
@@ -1261,7 +1263,15 @@ package Opt is
-- GNAT
-- Set True to perform style checks. Activates checks carried out in
-- package Style (see body of this package for details of checks). This
- -- flag is set True by either the -gnatg or -gnaty switches.
+ -- flag is set True by use of either the -gnatg or -gnaty switches, or
+ -- by the Style_Check pragma.
+
+ Style_Check_Main : Boolean := False;
+ -- GNAT
+ -- Set True if Style_Check was set for the main unit. This is used to
+ -- renable style checks for units in the mail extended source that get
+ -- with'ed indirectly. It is set True by use of either the -gnatg or
+ -- -gnaty switches, but not by use of the Style_Checks pragma.
Suppress_All_Inlining : Boolean := False;
-- GNAT
@@ -1324,6 +1334,20 @@ package Opt is
-- types and dispatching calls, assuming the underlying target supports
-- it (e.g. in the JVM case).
+ Target_Dependent_Info_Read_Name : String_Ptr := null;
+ -- GNAT
+ -- Set non-null to override the normal processing in Get_Targ and set the
+ -- necessary information by reading the target dependent information file
+ -- whose name is given here (see packages Get_Targ and Set_Targ for full
+ -- details). Set to non-null file name by use of the -gnateT switch.
+
+ Target_Dependent_Info_Write_Name : String_Ptr := null;
+ -- GNAT
+ -- Set non-null to enable a call to Set_Targ.Write_Target_Dependent_Info
+ -- which writes a target independent information file (see packages
+ -- Get_Targ and Set_Targ for full details) using the name given by
+ -- this switch. Set to non-null file name by use of the -gnatet switch.
+
Task_Dispatching_Policy : Character := ' ';
-- GNAT, GNATBIND
-- Set to ' ' for the default case (no task dispatching policy specified).
@@ -1383,12 +1407,12 @@ package Opt is
-- Flag set to force attempt at semantic analysis, even if parser errors
-- occur. This will probably cause blowups at this stage in the game. On
-- the other hand, most such blowups will be caught cleanly and simply
- -- say compilation abandoned. This flag is set to True by -gnatq or -gnatQ.
+ -- say compilation abandoned. This flag is set True by -gnatq or -gnatQ.
Unchecked_Shared_Lib_Imports : Boolean := False;
-- GPRBUILD
-- Set to True when shared library projects are allowed to import projects
- -- that are not shared library projects. Set by switch
+ -- that are not shared library projects. Set on by use of the switch
-- --unchecked-shared-lib-imports.
Undefined_Symbols_Are_False : Boolean := False;
@@ -1757,17 +1781,6 @@ package Opt is
-- terminated by Empty. The order is most recently processed first. This
-- list includes only those pragmas in configuration pragma files.
- Debug_Pragmas_Disabled_Config : Boolean;
- -- GNAT
- -- This is the value of the configuration switch for debug pragmas disabled
- -- mode, as possibly set by use of the configuration pragma Debug_Policy.
-
- Debug_Pragmas_Enabled_Config : Boolean;
- -- GNAT
- -- This is the value of the configuration switch for debug pragmas enabled
- -- mode, as possibly set by the command line switch -gnata and possibly
- -- modified by the use of the configuration pragma Debug_Policy.
-
Default_Pool_Config : Node_Id := Empty;
-- GNAT
-- Same as Default_Pool above, except this is only for Default_Storage_Pool
@@ -1970,7 +1983,14 @@ package Opt is
Alfa_Mode : Boolean := False;
-- Specific compiling mode targeting formal verification through the
-- generation of Why code for those parts of the input code that belong to
- -- the Alfa subset of Ada. Set by debug flag -gnatd.F.
+ -- the Alfa subset of Ada. Set True by the gnat2why executable or by use
+ -- of the -gnatd.F debug switch.
+
+ Frame_Condition_Mode : Boolean := False;
+ -- Specific mode to be used in combination with Alfa_Mode. If set to
+ -- true, ALI files containing the frame conditions (global effects) are
+ -- generated, and Why files are *not* generated. If not true, Why files
+ -- are generated. Set by debug flag -gnatd.G.
Strict_Alfa_Mode : Boolean := False;
-- Interpret compiler permissions as strictly as possible. E.g. base ranges
@@ -2007,8 +2027,6 @@ private
Assume_No_Invalid_Values : Boolean;
Check_Float_Overflow : Boolean;
Check_Policy_List : Node_Id;
- Debug_Pragmas_Disabled : Boolean;
- Debug_Pragmas_Enabled : Boolean;
Default_Pool : Node_Id;
Dynamic_Elaboration_Checks : Boolean;
Exception_Locations_Suppressed : Boolean;
diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb
index 5ac680176b8..da3c25deb5f 100644
--- a/gcc/ada/output.adb
+++ b/gcc/ada/output.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -344,7 +344,7 @@ package body Output is
procedure Write_Eol is
begin
- -- Remove any trailing space
+ -- Remove any trailing spaces
while Next_Col > 1 and then Buffer (Next_Col - 1) = ' ' loop
Next_Col := Next_Col - 1;
diff --git a/gcc/ada/par-ch11.adb b/gcc/ada/par-ch11.adb
index c255325699f..f0537f27cd1 100644
--- a/gcc/ada/par-ch11.adb
+++ b/gcc/ada/par-ch11.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -199,11 +199,43 @@ package body Ch11 is
return Error;
end P_Exception_Choice;
+ ----------------------------
+ -- 11.3 Raise Expression --
+ ----------------------------
+
+ -- RAISE_EXPRESSION ::= raise [exception_NAME [with string_EXPRESSION]]
+
+ -- The caller has verified that the initial token is RAISE
+
+ -- Error recovery: can raise Error_Resync
+
+ function P_Raise_Expression return Node_Id is
+ Raise_Node : Node_Id;
+
+ begin
+ if Ada_Version < Ada_2012 then
+ Error_Msg_SC ("raise expression is an Ada 2012 feature");
+ Error_Msg_SC ("\|unit must be compiled with -gnat2012 switch");
+ end if;
+
+ Raise_Node := New_Node (N_Raise_Expression, Token_Ptr);
+ Scan; -- past RAISE
+
+ Set_Name (Raise_Node, P_Name);
+
+ if Token = Tok_With then
+ Scan; -- past WITH
+ Set_Expression (Raise_Node, P_Expression);
+ end if;
+
+ return Raise_Node;
+ end P_Raise_Expression;
+
---------------------------
-- 11.3 Raise Statement --
---------------------------
- -- RAISE_STATEMENT ::= raise [exception_NAME];
+ -- RAISE_STATEMENT ::= raise [exception_NAME with string_EXPRESSION];
-- The caller has verified that the initial token is RAISE
diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb
index 2cd54b7001c..e8d6a9cd227 100644
--- a/gcc/ada/par-ch2.adb
+++ b/gcc/ada/par-ch2.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -40,6 +40,12 @@ package body Ch2 is
-- the scanned association has an identifier (this is used to check the
-- rule that no associations without identifiers can follow an association
-- which has an identifier). The result is returned in Association.
+ --
+ -- Note: We allow attribute forms Pre'Class, Post'Class, Invariant'Class,
+ -- Type_Invariant'Class in place of a pragma argument identifier. Rather
+ -- than handle this case specially, we replace such references with
+ -- one of the special internal identifiers _Pre, _Post, _Invariant, or
+ -- _Type_Invariant, and this procedure is where this replacement occurs.
---------------------
-- 2.3 Identifier --
@@ -427,9 +433,7 @@ package body Ch2 is
P := P_Pragma;
if Nkind (P) /= N_Error
- and then (Pragma_Name (P) = Name_Assert
- or else
- Pragma_Name (P) = Name_Debug)
+ and then Nam_In (Pragma_Name (P), Name_Assert, Name_Debug)
then
Error_Msg_Name_1 := Pragma_Name (P);
Error_Msg_N
@@ -448,6 +452,24 @@ package body Ch2 is
-- [pragma_argument_IDENTIFIER =>] NAME
-- | [pragma_argument_IDENTIFIER =>] EXPRESSION
+ -- In Ada 2012, there are two more possibilities:
+
+ -- PRAGMA_ARGUMENT_ASSOCIATION ::=
+ -- [pragma_argument_ASPECT_MARK =>] NAME
+ -- | [pragma_argument_ASPECT_MARK =>] EXPRESSION
+
+ -- where the interesting allowed cases (which do not fit the syntax of the
+ -- first alternative above are
+
+ -- ASPECT_MARK ::=
+ -- Pre'Class | Post'Class | Invariant'Class | Type_Invariant'Class
+
+ -- We allow this special usage in all Ada modes, but it would be a pain to
+ -- allow these aspects to pervade the pragma syntax, and the representation
+ -- of pragma nodes internally. So what we do is to replace these
+ -- ASPECT_MARK forms with identifiers whose name is one of the special
+ -- internal names _Pre, _Post, _Invariant, or _Type_Invariant.
+
-- Error recovery: cannot raise Error_Resync
procedure Scan_Pragma_Argument_Association
@@ -461,6 +483,7 @@ package body Ch2 is
begin
Association := New_Node (N_Pragma_Argument_Association, Token_Ptr);
Set_Chars (Association, No_Name);
+ Id_Present := False;
-- Argument starts with identifier
@@ -470,22 +493,69 @@ package body Ch2 is
Scan; -- past Identifier
if Token = Tok_Arrow then
- Identifier_Seen := True;
Scan; -- past arrow
- Set_Chars (Association, Chars (Identifier_Node));
Id_Present := True;
- -- Case of argument with no identifier
+ -- Case of one of the special aspect forms
- else
- Restore_Scan_State (Scan_State); -- to Identifier
- Id_Present := False;
+ elsif Token = Tok_Apostrophe then
+ Scan; -- past apostrophe
+
+ -- We have apostrophe, so check for identifier'Class
+
+ if Token /= Tok_Identifier or else Token_Name /= Name_Class then
+ null;
+
+ -- We have identifier'Class, check for arrow
+
+ else
+ Scan; -- Past Class
+
+ if Token /= Tok_Arrow then
+ null;
+
+ -- Here we have scanned identifier'Class =>
+
+ else
+ Id_Present := True;
+ Scan; -- past arrow
+
+ case Chars (Identifier_Node) is
+ when Name_Pre =>
+ Set_Chars (Identifier_Node, Name_uPre);
+
+ when Name_Post =>
+ Set_Chars (Identifier_Node, Name_uPost);
+
+ when Name_Type_Invariant =>
+ Set_Chars (Identifier_Node, Name_uType_Invariant);
+
+ when Name_Invariant =>
+ Set_Chars (Identifier_Node, Name_uInvariant);
+
+ -- If it is X'Class => for some invalid X, we will give
+ -- an error, and forget that 'Class was present, which
+ -- will give better error recovery. We could do a spell
+ -- check here, but it seems too much work.
+
+ when others =>
+ Error_Msg_SC ("invalid aspect id for pragma");
+ end case;
+ end if;
+ end if;
end if;
- -- Argument does not start with identifier
+ -- Identifier was present
- else
- Id_Present := False;
+ if Id_Present then
+ Set_Chars (Association, Chars (Identifier_Node));
+ Identifier_Seen := True;
+
+ -- Identifier not present after all
+
+ else
+ Restore_Scan_State (Scan_State); -- to Identifier
+ end if;
end if;
-- Diagnose error of "positional" argument for pragma appearing after
@@ -493,9 +563,10 @@ package body Ch2 is
-- Ada RM terminology).
-- Since older GNAT versions did not generate this error, disable this
- -- message in codepeer mode to help legacy code using codepeer.
+ -- message in Relaxed_RM_Semantics mode to help legacy code using e.g.
+ -- codepeer.
- if Identifier_Seen and not Id_Present and not CodePeer_Mode then
+ if Identifier_Seen and not Id_Present and not Relaxed_RM_Semantics then
Error_Msg_SC ("|pragma argument identifier required here");
Error_Msg_SC ("\since previous argument had identifier (RM 2.8(4))");
end if;
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 185a07d97c2..8066b8c37f0 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1818,6 +1818,7 @@ package body Ch4 is
-- RELATION ::=
-- SIMPLE_EXPRESSION [not] in MEMBERSHIP_CHOICE_LIST
+ -- | RAISE_EXPRESSION
-- MEMBERSHIP_CHOICE_LIST ::=
-- MEMBERSHIP_CHOICE {'|' MEMBERSHIP CHOICE}
@@ -1825,6 +1826,8 @@ package body Ch4 is
-- MEMBERSHIP_CHOICE ::=
-- CHOICE_EXPRESSION | RANGE | SUBTYPE_MARK
+ -- RAISE_EXPRESSION ::= raise exception_NAME [with string_EXPRESSION]
+
-- On return, Expr_Form indicates the categorization of the expression
-- Note: if Token = Tok_Apostrophe on return, then Expr_Form is set to
@@ -1839,6 +1842,15 @@ package body Ch4 is
Optok : Source_Ptr;
begin
+ -- First check for raise expression
+
+ if Token = Tok_Raise then
+ Expr_Form := EF_Non_Simple;
+ return P_Raise_Expression;
+ end if;
+
+ -- All other cases
+
Node1 := P_Simple_Expression;
if Token not in Token_Class_Relop then
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index 2243acea2eb..42c2a8594e6 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -684,6 +684,15 @@ package body Ch6 is
Stub_Node :=
New_Node (N_Subprogram_Body_Stub, Sloc (Specification_Node));
Set_Specification (Stub_Node, Specification_Node);
+
+ -- The specification has been parsed as part of a subprogram
+ -- declaration, and aspects have already been collected.
+
+ if Is_Non_Empty_List (Aspects) then
+ Set_Parent (Aspects, Stub_Node);
+ Set_Aspect_Specifications (Stub_Node, Aspects);
+ end if;
+
Scan; -- past SEPARATE
Pop_Scope_Stack;
TF_Semicolon;
diff --git a/gcc/ada/par-ch7.adb b/gcc/ada/par-ch7.adb
index 15f98bfcfb3..d52a13d6c5b 100644
--- a/gcc/ada/par-ch7.adb
+++ b/gcc/ada/par-ch7.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -138,6 +138,7 @@ package body Ch7 is
end if;
T_Body;
+ Scope.Table (Scope.Last).Sloc := Token_Ptr;
Name_Node := P_Defining_Program_Unit_Name;
Scope.Table (Scope.Last).Labl := Name_Node;
TF_Is;
@@ -182,6 +183,7 @@ package body Ch7 is
-- Cases other than Package_Body
else
+ Scope.Table (Scope.Last).Sloc := Token_Ptr;
Name_Node := P_Defining_Program_Unit_Name;
Scope.Table (Scope.Last).Labl := Name_Node;
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index 07f31be423c..214a150f82b 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -155,9 +155,7 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is
begin
if Nkind (Expression (Arg)) /= N_Identifier
- or else (Chars (Argx) /= Name_On
- and then
- Chars (Argx) /= Name_Off)
+ or else not Nam_In (Chars (Argx), Name_On, Name_Off)
then
Error_Msg_Name_2 := Name_On;
Error_Msg_Name_3 := Name_Off;
@@ -1140,6 +1138,7 @@ begin
Pragma_Controlled |
Pragma_Convention |
Pragma_Debug_Policy |
+ Pragma_Depends |
Pragma_Detect_Blocking |
Pragma_Default_Storage_Pool |
Pragma_Disable_Atomic_Synchronization |
@@ -1165,6 +1164,7 @@ begin
Pragma_Fast_Math |
Pragma_Finalize_Storage_Only |
Pragma_Float_Representation |
+ Pragma_Ghost |
Pragma_Global |
Pragma_Ident |
Pragma_Implementation_Defined |
diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb
index 3b59287b703..f2ac335e08c 100644
--- a/gcc/ada/par-util.adb
+++ b/gcc/ada/par-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -181,8 +181,7 @@ package body Util is
if Ada_Version = Ada_95
and then Warn_On_Ada_2005_Compatibility
then
- if Token_Name = Name_Overriding
- or else Token_Name = Name_Synchronized
+ if Nam_In (Token_Name, Name_Overriding, Name_Synchronized)
or else (Token_Name = Name_Interface
and then Prev_Token /= Tok_Pragma)
then
diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb
index 571713f3d51..ac21375ef46 100644
--- a/gcc/ada/par.adb
+++ b/gcc/ada/par.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -838,6 +838,7 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
package Ch11 is
function P_Handled_Sequence_Of_Statements return Node_Id;
+ function P_Raise_Expression return Node_Id;
function P_Raise_Statement return Node_Id;
function Parse_Exception_Handlers return List_Id;
diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb
index b575edaa105..a69281130dd 100644
--- a/gcc/ada/prj-attr.adb
+++ b/gcc/ada/prj-attr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -365,7 +365,6 @@ package body Prj.Attr is
-- package Remote
"Premote#" &
- "LVbuild_slaves#" &
"SVroot_dir#" &
-- package Stack
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb
index 4788fbedf95..67b077f372f 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -33,6 +33,8 @@ with Prj.Com; use Prj.Com;
with Sdefault;
with Tempdir;
+with Ada.Text_IO; use Ada.Text_IO;
+
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
package body Prj.Env is
@@ -1895,14 +1897,17 @@ package body Prj.Env is
New_Len : Positive;
New_Last : Positive;
- Ada_Project_Path : constant String := "ADA_PROJECT_PATH";
- Gpr_Project_Path : constant String := "GPR_PROJECT_PATH";
- -- Name of alternate env. variable that contain path name(s) of
- -- directories where project files may reside. GPR_PROJECT_PATH has
- -- precedence over ADA_PROJECT_PATH.
-
- Gpr_Prj_Path : String_Access;
- Ada_Prj_Path : String_Access;
+ Ada_Project_Path : constant String := "ADA_PROJECT_PATH";
+ Gpr_Project_Path : constant String := "GPR_PROJECT_PATH";
+ Gpr_Project_Path_File : constant String := "GPR_PROJECT_PATH_FILE";
+ -- Names of alternate env. variable that contain path name(s) of
+ -- directories where project files may reside. They are taken into
+ -- account in this order: GPR_PROJECT_PATH_FILE, GPR_PROJECT_PATH,
+ -- ADA_PROJECT_PATH.
+
+ Gpr_Prj_Path_File : String_Access;
+ Gpr_Prj_Path : String_Access;
+ Ada_Prj_Path : String_Access;
-- The path name(s) of directories where project files may reside.
-- May be empty.
@@ -1926,8 +1931,50 @@ package body Prj.Env is
-- If environment variables are defined and not empty, add their content
- Gpr_Prj_Path := Getenv (Gpr_Project_Path);
- Ada_Prj_Path := Getenv (Ada_Project_Path);
+ Gpr_Prj_Path_File := Getenv (Gpr_Project_Path_File);
+ Gpr_Prj_Path := Getenv (Gpr_Project_Path);
+ Ada_Prj_Path := Getenv (Ada_Project_Path);
+
+ if Gpr_Prj_Path_File.all /= "" then
+ declare
+ File : Ada.Text_IO.File_Type;
+ Line : String (1 .. 10_000);
+ Last : Natural;
+
+ Tmp : String_Access;
+
+ begin
+ Open (File, In_File, Gpr_Prj_Path_File.all);
+
+ while not End_Of_File (File) loop
+ Get_Line (File, Line, Last);
+
+ if Last /= 0
+ and then (Last = 1 or else Line (1 .. 2) /= "--")
+ then
+ Tmp := Self.Path;
+ Self.Path :=
+ new String'
+ (Tmp.all & Path_Separator & Line (1 .. Last));
+ Free (Tmp);
+ end if;
+
+ if Current_Verbosity = High then
+ Debug_Output ("Adding directory to Project_Path: """
+ & Line (1 .. Last) & '"');
+ end if;
+ end loop;
+
+ Close (File);
+
+ exception
+ when others =>
+ Write_Str ("warning: could not read project path file """);
+ Write_Str (Gpr_Prj_Path_File.all);
+ Write_Line ("""");
+ end;
+
+ end if;
if Gpr_Prj_Path.all /= "" then
Add_Directories (Self, Gpr_Prj_Path.all);
diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb
index e2b1ad1d9fd..de55a74802c 100644
--- a/gcc/ada/prj-makr.adb
+++ b/gcc/ada/prj-makr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -24,6 +24,7 @@
------------------------------------------------------------------------------
with Csets;
+with Hostparm;
with Opt;
with Output;
with Osint; use Osint;
@@ -37,6 +38,7 @@ with Prj.Util; use Prj.Util;
with Sdefault;
with Snames; use Snames;
with Table; use Table;
+with Tempdir;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
@@ -952,10 +954,10 @@ package body Prj.Makr is
then
Name := Prj.Tree.Name_Of (Current_Node, Tree);
- if Name = Name_Source_Files or else
- Name = Name_Source_List_File or else
- Name = Name_Source_Dirs or else
- Name = Name_Naming
+ if Nam_In (Name, Name_Source_Files,
+ Name_Source_List_File,
+ Name_Source_Dirs,
+ Name_Naming)
then
Comments :=
Tree.Project_Nodes.Table (Current_Node).Comments;
@@ -1047,6 +1049,42 @@ package body Prj.Makr is
Project_File_Extension;
Output_Name_Last := Output_Name_Last + Project_File_Extension'Length;
+ -- Back up project file if it already exists (not needed in VMS since
+ -- versioning of files takes care of this requirement on VMS).
+
+ if not Hostparm.OpenVMS
+ and then not Opt.No_Backup
+ and then Is_Regular_File (Path_Name (1 .. Path_Last))
+ then
+ declare
+ Discard : Boolean;
+ Saved_Path : constant String :=
+ Path_Name (1 .. Path_Last) & ".saved_";
+ Nmb : Natural;
+
+ begin
+ Nmb := 0;
+ loop
+ declare
+ Img : constant String := Nmb'Img;
+
+ begin
+ if not Is_Regular_File
+ (Saved_Path & Img (2 .. Img'Last))
+ then
+ Copy_File
+ (Name => Path_Name (1 .. Path_Last),
+ Pathname => Saved_Path & Img (2 .. Img'Last),
+ Mode => Overwrite,
+ Success => Discard);
+ exit;
+ end if;
+
+ Nmb := Nmb + 1;
+ end;
+ end loop;
+ end;
+ end if;
end if;
-- Change the current directory to the directory of the project file,
@@ -1198,6 +1236,7 @@ package body Prj.Makr is
Success : Boolean;
Saved_Output : File_Descriptor;
Saved_Error : File_Descriptor;
+ Tmp_File : Path_Name_Type;
begin
-- If we don't have the path of the compiler yet,
@@ -1219,19 +1258,26 @@ package body Prj.Makr is
end if;
end if;
- -- If we don't have yet the file name of the
- -- temporary file, get it now.
+ -- Create the temporary file
- if Temp_File_Name = null then
- Create_Temp_File (FD, Temp_File_Name);
+ Tempdir.Create_Temp_File (FD, Tmp_File);
- if FD = Invalid_FD then
- Prj.Com.Fail
- ("could not create temporary file");
- end if;
+ if FD = Invalid_FD then
+ Prj.Com.Fail
+ ("could not create temporary file");
+ else
+ Temp_File_Name :=
+ new String'(Get_Name_String (Tmp_File));
+ end if;
+
+ -- On VMS, a file created with Create_Temp_File cannot
+ -- be used to redirect output.
+
+ if Hostparm.OpenVMS then
Close (FD);
Delete_File (Temp_File_Name.all, Success);
+ FD := Create_Output_Text_File (Temp_File_Name.all);
end if;
Args (Args'Last) := new String'
@@ -1239,16 +1285,6 @@ package body Prj.Makr is
Directory_Separator &
Str (1 .. Last));
- -- Create the temporary file
-
- FD := Create_Output_Text_File
- (Name => Temp_File_Name.all);
-
- if FD = Invalid_FD then
- Prj.Com.Fail
- ("could not create temporary file");
- end if;
-
-- Save the standard output and error
Saved_Output := Dup (Standout);
@@ -1294,7 +1330,8 @@ package body Prj.Makr is
if not Is_Valid (File) then
Prj.Com.Fail
- ("could not read temporary file");
+ ("could not read temporary file " &
+ Temp_File_Name.all);
end if;
Save_Last_Source_Index := Sources.Last;
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index b956292a6e6..751dab8dd08 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -3155,16 +3155,20 @@ package body Prj.Nmsc is
end if;
if not Dir_Exists then
+ if Directories_Must_Exist_In_Projects then
- -- Get the absolute name of the library directory that
- -- does not exist, to report an error.
+ -- Get the absolute name of the library directory that does
+ -- not exist, to report an error.
- Err_Vars.Error_Msg_File_1 :=
- File_Name_Type (Project.Library_Dir.Display_Name);
- Error_Msg
- (Data.Flags,
- "library directory { does not exist",
- Lib_Dir.Location, Project);
+ Err_Vars.Error_Msg_File_1 :=
+ File_Name_Type (Project.Library_Dir.Display_Name);
+ Error_Msg
+ (Data.Flags,
+ "library directory { does not exist",
+ Lib_Dir.Location, Project);
+ end if;
+
+ Project.Library_Dir := No_Path_Information;
-- Checks for object/source directories
@@ -3208,8 +3212,8 @@ package body Prj.Nmsc is
File_Name_Type (Dir_Elem.Value);
Error_Msg
(Data.Flags,
- "library directory cannot be the same " &
- "as source directory {",
+ "library directory cannot be the same "
+ & "as source directory {",
Lib_Dir.Location, Project);
OK := False;
exit;
@@ -3243,8 +3247,8 @@ package body Prj.Nmsc is
Error_Msg
(Data.Flags,
- "library directory cannot be the same" &
- " as source directory { of project %%",
+ "library directory cannot be the same "
+ & "as source directory { of project %%",
Lib_Dir.Location, Project);
OK := False;
exit Project_Loop;
@@ -5022,9 +5026,8 @@ package body Prj.Nmsc is
function Is_Reserved (Name : Name_Id) return Boolean is
begin
if Get_Name_Table_Byte (Name) /= 0
- and then Name /= Name_Project
- and then Name /= Name_Extends
- and then Name /= Name_External
+ and then
+ not Nam_In (Name, Name_Project, Name_Extends, Name_External)
and then Name not in Ada_2005_Reserved_Words
then
Unit := No_Name;
@@ -5408,15 +5411,20 @@ package body Prj.Nmsc is
Externally_Built => Project.Externally_Built);
if not Dir_Exists and then not Project.Externally_Built then
+ if Opt.Directories_Must_Exist_In_Projects then
+ -- The object directory does not exist, report an error if
+ -- the project is not externally built.
- -- The object directory does not exist, report an error if the
- -- project is not externally built.
+ Err_Vars.Error_Msg_File_1 :=
+ File_Name_Type (Object_Dir.Value);
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Require_Obj_Dirs,
+ "object directory { not found",
+ Project.Location, Project);
+ end if;
+
+ Project.Object_Directory := No_Path_Information;
- Err_Vars.Error_Msg_File_1 :=
- File_Name_Type (Object_Dir.Value);
- Error_Or_Warning
- (Data.Flags, Data.Flags.Require_Obj_Dirs,
- "object directory { not found", Project.Location, Project);
end if;
end if;
@@ -5489,10 +5497,14 @@ package body Prj.Nmsc is
Externally_Built => Project.Externally_Built);
if not Dir_Exists then
- Err_Vars.Error_Msg_File_1 := File_Name_Type (Exec_Dir.Value);
- Error_Or_Warning
- (Data.Flags, Data.Flags.Missing_Source_Files,
- "exec directory { not found", Project.Location, Project);
+ if Opt.Directories_Must_Exist_In_Projects then
+ Err_Vars.Error_Msg_File_1 := File_Name_Type (Exec_Dir.Value);
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Missing_Source_Files,
+ "exec directory { not found", Project.Location, Project);
+ end if;
+
+ Project.Exec_Directory := No_Path_Information;
end if;
end if;
end if;
@@ -7729,7 +7741,7 @@ package body Prj.Nmsc is
if Language.First_Source = No_Source
and then (Data.Flags.Require_Sources_Other_Lang
- or else Language.Name = Name_Ada)
+ or else Language.Name = Name_Ada)
then
Iter := For_Each_Source (In_Tree => Data.Tree,
Project => Project.Project);
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb
index de2254cb222..9e0e0aa38d1 100644
--- a/gcc/ada/prj.adb
+++ b/gcc/ada/prj.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -112,6 +112,15 @@ package body Prj is
new Restricted_Lang'(Name => Name_Find, Next => Restricted_Languages);
end Add_Restricted_Language;
+ -------------------------------------
+ -- Remove_All_Restricted_Languages --
+ -------------------------------------
+
+ procedure Remove_All_Restricted_Languages is
+ begin
+ Restricted_Languages := null;
+ end Remove_All_Restricted_Languages;
+
-------------------
-- Add_To_Buffer --
-------------------
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index 449b038e475..66f878688d0 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -45,6 +45,10 @@ package Prj is
-- Call by gprbuild for each language specify by switch
-- --restricted-to-languages=.
+ procedure Remove_All_Restricted_Languages;
+ -- Call by gprbuild in CodePeer mode to ignore switches
+ -- --restricted-to-languages=.
+
function Is_Allowed_Language (Name : Name_Id) return Boolean;
-- Returns True if --restricted-to-languages= is not used or if Name
-- is one of the restricted languages.
@@ -1829,6 +1833,7 @@ package Prj is
Gprbuild_Flags : constant Processing_Flags;
Gprclean_Flags : constant Processing_Flags;
+ Gprexec_Flags : constant Processing_Flags;
Gnatmake_Flags : constant Processing_Flags;
-- Flags used by the various tools. They all display the error messages
-- through Prj.Err.
@@ -2003,6 +2008,18 @@ private
Missing_Source_Files => Error,
Ignore_Missing_With => False);
+ Gprexec_Flags : constant Processing_Flags :=
+ (Report_Error => null,
+ When_No_Sources => Silent,
+ Require_Sources_Other_Lang => False,
+ Allow_Duplicate_Basenames => False,
+ Compiler_Driver_Mandatory => False,
+ Error_On_Unknown_Language => True,
+ Require_Obj_Dirs => Silent,
+ Allow_Invalid_External => Error,
+ Missing_Source_Files => Silent,
+ Ignore_Missing_With => False);
+
Gnatmake_Flags : constant Processing_Flags :=
(Report_Error => null,
When_No_Sources => Error,
diff --git a/gcc/ada/projects.texi b/gcc/ada/projects.texi
index 32ae8f66c5f..ca477369b13 100644
--- a/gcc/ada/projects.texi
+++ b/gcc/ada/projects.texi
@@ -1,7 +1,7 @@
@set gprconfig GPRconfig
@c ------ projects.texi
-@c Copyright (C) 2002-2012, Free Software Foundation, Inc.
+@c Copyright (C) 2002-2013, Free Software Foundation, Inc.
@c This file is shared between the GNAT user's guide and gprbuild. It is not
@c compilable on its own, you should instead compile the other two manuals.
@c For that reason, there is no toplevel @menu
@@ -82,7 +82,6 @@ the information on the command line itself). They share common switches
to control the loading of the project (in particular
@option{^-P^/PROJECT_FILE=^@emph{projectfile}} and
@option{^-X^/EXTERNAL_REFERENCE=^@emph{vbl}=@emph{value}}).
-@xref{Switches Related to Project Files}.
The Project Manager supports a wide range of development strategies,
for systems of all sizes. Here are some typical practices that are
@@ -218,6 +217,7 @@ should contain the following code:
@menu
* Source Files and Directories::
+* Duplicate Sources in Projects::
* Object and Exec Directory::
* Main Subprograms::
* Tools Options in Project Files::
@@ -402,21 +402,31 @@ setting @code{Source_Dirs}. The project manager automatically finds
@file{pack.ads}, @file{pack.adb} and @file{proc.adb} as source files of the
project.
-Note that it is considered an error for a project file to have no sources
-attached to it unless explicitly declared as mentioned above.
+Note that by default a warning is issued when a project has no sources attached
+to it and this is not explicitly indicated in the project file.
+@c ---------------------------------------------
+@node Duplicate Sources in Projects
+@subsection Duplicate Sources in Projects
+@c ---------------------------------------------
+
+@noindent
If the order of the source directories is known statically, that is if
-@code{"**"} is not used in the string list @code{Source_Dirs}, then there may
+@code{"/**"} is not used in the string list @code{Source_Dirs}, then there may
be several files with the same source file name sitting in different
directories of the project. In this case, only the file in the first directory
is considered as a source of the project and the others are hidden. If
-@code{"**"} is used in the string list @code{Source_Dirs}, it is an error
+@code{"/**"} is used in the string list @code{Source_Dirs}, it is an error
to have several files with the same source file name in the same directory
-@code{"**"} subtree, since there would be an ambiguity as to which one should
+@code{"/**"} subtree, since there would be an ambiguity as to which one should
be used. However, two files with the same source file name may exist in two
single directories or directory subtrees. In this case, the one in the first
directory or directory subtree is a source of the project.
+If there are two sources in different directories of the same @code{"/**"}
+subtree, one way to resolve the problem is to exclude the directory of the
+file that should not be used as a source of the project.
+
@c ---------------------------------------------
@node Object and Exec Directory
@subsection Object and Exec Directory
@@ -875,8 +885,7 @@ the associated language, and thus the compiler to use.
Note that the use by the Ada compiler of pragmas Source_File_Name is not
supported when using project files. You must use the features described in this
-paragraph. You can however specify other configuration pragmas
-(@pxref{Specifying Configuration Pragmas}).
+paragraph. You can however specify other configuration pragmas.
The following attributes can be defined in package @code{Naming}:
@@ -1092,31 +1101,6 @@ The following attributes can be defined in package @code{Remote}:
@table @asis
-@item @b{Build_Slaves}
-@cindex @code{Build_Slaves}
-
-A list of string referencing the remote build slaves to use for the
-compilation phase. The format is:
-@code{[protocol://]name.domain[:port]}.
-
-Where @code{protocol} is one of:
-
-@table @asis
-
-@item rsync
-@cindex @code{rsync}
-
-The sources are copied using the external @code{rsync} tool.
-
-@item file
-
-The sources are accessed via a shared directory or mount point.
-
-@end table
-
-The default port used to communicate with @command{gprslave} is
-@code{8484}.
-
@item @b{Root_Dir}:
@cindex @code{Root_Dir}
@@ -1225,12 +1209,18 @@ the search stops:
current project file.
@item
-@cindex @code{ADA_PROJECT_PATH}
+@cindex @code{GPR_PROJECT_PATH_FILE}
@cindex @code{GPR_PROJECT_PATH}
+@cindex @code{ADA_PROJECT_PATH}
Then it is searched relative to all the directories specified in the
- ^environment variables^logical names^ @b{GPR_PROJECT_PATH} and
- @b{ADA_PROJECT_PATH} (in that order) if they exist. The former is
- recommended, the latter is kept for backward compatibility.
+ ^environment variables^logical names^ @b{GPR_PROJECT_PATH_FILE},
+ @b{GPR_PROJECT_PATH} and @b{ADA_PROJECT_PATH} (in that order) if they exist.
+ The value of @b{GPR_PROJECT_PATH_FILE}, when defined, is the path name of
+ a text file that contains project directory path names, one per line.
+ @b{GPR_PROJECT_PATH} and @b{ADA_PROJECT_PATH}, when defined, contain
+ project directory path names separated by directory separators.
+ @b{ADA_PROJECT_PATH} is used for compatibility, it is recommended to
+ use @b{GPR_PROJECT_PATH_FILE} or @b{GPR_PROJECT_PATH}.
@item Finally, it is searched relative to the default project directories.
Such directories depends on the tool used. The different locations searched
@@ -1532,13 +1522,13 @@ The second parameter to @code{external} is optional, and is the default
value to use if "mode" is not set from the command line or the environment.
In order to set the switches according to the different scenarios, other
-constructs have to be introduced such as typed variables and case statements.
+constructs have to be introduced such as typed variables and case constructions.
@cindex typed variable
-@cindex case statement
+@cindex case construction
A @b{typed variable} is a variable that
can take only a limited number of values, similar to an enumeration in Ada.
-Such a variable can then be used in a @b{case statement} and create conditional
+Such a variable can then be used in a @b{case construction} and create conditional
sections in the project. The following example shows how this can be done:
@smallexample @c projectfile
@@ -1565,7 +1555,7 @@ project is considered as invalid.
The @code{Mode} variable is initialized with an external value
defaulting to @code{"debug"}. This default could be omitted and that would
-force the user to define the value. Finally, we can use a case statement to set the
+force the user to define the value. Finally, we can use a case construction to set the
switches depending on the scenario the user has chosen.
Most aspects of the projects can depend on scenarios. The notable exception
@@ -2914,8 +2904,8 @@ attributes.
* External Values::
* Typed String Declaration::
* Variables::
+* Case Constructions::
* Attributes::
-* Case Statements::
@end menu
@c ---------------------------------------------
@@ -3122,6 +3112,9 @@ The following packages are currently supported in project files
@code{Builder}. The first string should always be @code{-rules} to specify
that all the other options belong to the @code{-rules} section of the
parameters to @command{gnatcheck}.
+@item Clean
+ This package specifies the options used when cleaning a project or a project
+ tree using the tools @command{gnatclean} or @command{gprclean}.
@item Compiler
This package specifies the compilation options used by the compiler for
each languages. @xref{Tools Options in Project Files}.
@@ -3151,17 +3144,12 @@ The following packages are currently supported in project files
@item IDE
This package specifies the options used when starting an integrated
development environment, for instance @command{GPS} or @command{Gnatbench}.
- @xref{The Development Environments}.
@item Install
This package specifies the options used when installing a project
with @command{gprinstall}. @xref{Installation}.
@item Linker
This package specifies the options used by the linker.
@xref{Main Subprograms}.
-@item Makefile
-@cindex Makefile package in projects
- This package is used by the GPS plugin Makefile.py. See the documentation
- in that plugin (from GPS: /Tools/Plug-ins).
@item Metrics
This package specifies the options used when calling the tool
@command{gnatmetric} via the @command{gnat} driver. Its attributes
@@ -3178,6 +3166,9 @@ The following packages are currently supported in project files
@command{gnatpp} via the @command{gnat} driver. Its attributes
@b{Default_Switches} and @b{Switches} have the same semantics as for the
package @code{Builder}.
+@item Remote
+ This package is used by @command{gprbuild} to describe how distributed
+ compilation should be done.
@item Stack
This package specifies the options used when calling the tool
@command{gnatstack} via the @command{gnat} driver. Its attributes
@@ -3430,7 +3421,7 @@ Here is an example of a string type declaration:
Variables of a string type are called @b{typed variables}; all other
variables are called @b{untyped variables}. Typed variables are
particularly useful in @code{case} constructions, to support conditional
-attribute declarations. (@pxref{Case Statements}).
+attribute declarations. (@pxref{Case Constructions}).
A string type may be referenced by its name if it has been declared in the same
project file, or by an expanded name whose prefix is the name of the project
@@ -3452,7 +3443,7 @@ string ("").
A @b{typed} variable can be used as part of a @b{case} expression to
compute the value, but it can only be declared once in the project file,
-so that all case statements see the same value for the variable. This
+so that all case constructions see the same value for the variable. This
provides more consistency and makes the project easier to understand.
The syntax for its declaration is identical to the Ada syntax for an
object declaration. In effect, a typed variable acts as a constant.
@@ -3514,10 +3505,102 @@ A @b{context} may be one of the following:
@end itemize
@c ---------------------------------------------
+@node Case Constructions
+@subsection Case Constructions
+@c ---------------------------------------------
+
+@noindent
+A @b{case} statement is used in a project file to effect conditional
+behavior. Through this statement, you can set the value of attributes
+and variables depending on the value previously assigned to a typed
+variable.
+
+All choices in a choice list must be distinct. Unlike Ada, the choice
+lists of all alternatives do not need to include all values of the type.
+An @code{others} choice must appear last in the list of alternatives.
+
+The syntax of a @code{case} construction is based on the Ada case statement
+(although the @code{null} statement for empty alternatives is optional).
+
+The case expression must be a typed string variable, whose value is often
+given by an external reference (@pxref{External Values}).
+
+Each alternative starts with the reserved word @code{when}, either a list of
+literal strings separated by the @code{"|"} character or the reserved word
+@code{others}, and the @code{"=>"} token.
+Each literal string must belong to the string type that is the type of the
+case variable.
+After each @code{=>}, there are zero or more statements. The only
+statements allowed in a case construction are other case constructions,
+attribute declarations and variable declarations. String type declarations and
+package declarations are not allowed. Variable declarations are restricted to
+variables that have already been declared before the case construction.
+
+@smallexample
+case_statement ::=
+ @i{case} @i{<typed_variable_>}name @i{is} @{case_item@} @i{end case} ;
+
+case_item ::=
+ @i{when} discrete_choice_list =>
+ @{case_statement
+ | attribute_declaration
+ | variable_declaration
+ | empty_declaration@}
+
+discrete_choice_list ::= string_literal @{| string_literal@} | @i{others}
+@end smallexample
+
+@noindent
+Here is a typical example:
+
+@smallexample @c projectfile
+@group
+project MyProj is
+ type OS_Type is ("GNU/Linux", "Unix", "NT", "VMS");
+ OS : OS_Type := external ("OS", "GNU/Linux");
+
+ package Compiler is
+ case OS is
+ when "GNU/Linux" | "Unix" =>
+ for Switches ("Ada") use ("-gnath");
+ when "NT" =>
+ for Switches ("Ada") use ("-gnatP");
+ when others =>
+ null;
+ end case;
+ end Compiler;
+end MyProj;
+@end group
+@end smallexample
+
+@c ---------------------------------------------
@node Attributes
@subsection Attributes
@c ---------------------------------------------
+@menu
+* Project Level Attributes::
+* Package Binder Attributes::
+* Package Builder Attributes::
+* Package Check Attributes::
+* Package Clean Attributes::
+* Package Compiler Attributes::
+* Package Cross_Reference Attributes::
+* Package Eliminate Attributes::
+* Package Finder Attributes::
+* Package gnatls Attributes::
+* Package gnatstub Attributes::
+* Package IDE Attributes::
+* Package Install Attributes::
+* Package Linker Attributes::
+* Package Metrics Attribute::
+* Package Naming Attributes::
+* Package Pretty_Printer Attributes::
+* Package Remote Attributes::
+* Package Stack Attributes::
+* Package Synchronize Attributes::
+@end menu
+
@noindent
A project (and its packages) may have @b{attributes} that define
the project's properties. Some attributes have values that are strings;
@@ -3570,7 +3653,7 @@ Here are some examples of attribute declarations:
@end smallexample
@noindent
-Attributes references may be appear anywhere in expressions, and are used
+Attributes references may appear anywhere in expressions, and are used
to retrieve the value previously assigned to the attribute. If an attribute
has not been set in a given package or project, its value defaults to the
empty string or the empty list.
@@ -3608,1099 +3691,1246 @@ The prefix of an attribute may be:
@end itemize
@noindent
-Legal attribute names are listed below, including the package in
-which they must be declared. These names are case-insensitive. The
-semantics for the attributes is explained in great details in other sections.
-
-The column @emph{index} indicates whether the attribute is an indexed attribute,
-and when it is whether its index is case sensitive (sensitive) or not (insensitive), or if case sensitivity depends is the same as file names sensitivity on the
-system (file). The text is between brackets ([]) if the index is optional.
-
-@multitable @columnfractions .3 .1 .2 .4
-@headitem Attribute Name @tab Value @tab Package @tab Index
-@headitem General attributes @tab @tab @tab @pxref{Building With Projects}
-@item Name @tab string @tab - @tab (Read-only, name of project)
-@item Project_Dir @tab string @tab - @tab (Read-only, directory of project)
-@item Source_Files @tab list @tab - @tab -
-@item Source_Dirs @tab list @tab - @tab -
-@item Source_List_File @tab string @tab - @tab -
-@item Locally_Removed_Files @tab list @tab - @tab -
-@item Excluded_Source_Files @tab list @tab - @tab -
-@item Object_Dir @tab string @tab - @tab -
-@item Exec_Dir @tab string @tab - @tab -
-@item Excluded_Source_Dirs @tab list @tab - @tab -
-@item Excluded_Source_Files @tab list @tab - @tab -
-@item Excluded_Source_List_File @tab list @tab - @tab -
-@item Inherit_Source_Path @tab list @tab - @tab insensitive
-@item Languages @tab list @tab - @tab -
-@item Main @tab list @tab - @tab -
-@item Main_Language @tab string @tab - @tab -
-@item Externally_Built @tab string @tab - @tab -
-@item Roots @tab list @tab - @tab file
-@headitem
- Library-related attributes @tab @tab @tab @pxref{Library Projects}
-@item Library_Dir @tab string @tab - @tab -
-@item Library_Name @tab string @tab - @tab -
-@item Library_Kind @tab string @tab - @tab -
-@item Library_Version @tab string @tab - @tab -
-@item Library_Interface @tab string @tab - @tab -
-@item Library_Auto_Init @tab string @tab - @tab -
-@item Library_Options @tab list @tab - @tab -
-@item Leading_Library_Options @tab list @tab - @tab -
-@item Library_Src_Dir @tab string @tab - @tab -
-@item Library_ALI_Dir @tab string @tab - @tab -
-@item Library_GCC @tab string @tab - @tab -
-@item Library_Symbol_File @tab string @tab - @tab -
-@item Library_Symbol_Policy @tab string @tab - @tab -
-@item Library_Reference_Symbol_File @tab string @tab - @tab -
-@item Interfaces @tab list @tab - @tab -
-@headitem
- Naming @tab @tab @tab @pxref{Naming Schemes}
-@item Spec_Suffix @tab string @tab Naming @tab insensitive (language)
-@item Body_Suffix @tab string @tab Naming @tab insensitive (language)
-@item Separate_Suffix @tab string @tab Naming @tab -
-@item Casing @tab string @tab Naming @tab -
-@item Dot_Replacement @tab string @tab Naming @tab -
-@item Spec @tab string @tab Naming @tab insensitive (Ada unit)
-@item Body @tab string @tab Naming @tab insensitive (Ada unit)
-@item Specification_Exceptions @tab list @tab Naming @tab insensitive (language)
-@item Implementation_Exceptions @tab list @tab Naming @tab insensitive (language)
-@headitem
- Building @tab @tab @tab @pxref{Switches and Project Files}
-@item Default_Switches @tab list @tab Builder, Compiler, Binder, Linker, Cross_Reference, Finder, Pretty_Printer, gnatstub, Check, Synchronize, Eliminate, Metrics, IDE @tab insensitive (language name)
-@item Switches @tab list @tab Builder, Compiler, Binder, Linker, Cross_Reference, Finder, gnatls, Pretty_Printer, gnatstub, Check, Synchronize, Eliminate, Metrics, Stack @tab [file] (file name)
-@item Local_Configuration_Pragmas @tab string @tab Compiler @tab -
-@item Local_Config_File @tab string @tab insensitive @tab -
-@item Global_Configuration_Pragmas @tab list @tab Builder @tab -
-@item Global_Compilation_Switches @tab list @tab Builder @tab language
-@item Executable @tab string @tab Builder @tab [file]
-@item Executable_Suffix @tab string @tab Builder @tab -
-@item Global_Config_File @tab string @tab Builder @tab insensitive (language)
-@headitem
- IDE (used and created by GPS) @tab @tab @tab
-@item Remote_Host @tab string @tab IDE @tab -
-@item Program_Host @tab string @tab IDE @tab -
-@item Communication_Protocol @tab string @tab IDE @tab -
-@item Compiler_Command @tab string @tab IDE @tab insensitive (language)
-@item Debugger_Command @tab string @tab IDE @tab -
-@item Gnatlist @tab string @tab IDE @tab -
-@item Gnat @tab string @tab IDE @tab -
-@item VCS_Kind @tab string @tab IDE @tab -
-@item VCS_File_Check @tab string @tab IDE @tab -
-@item VCS_Log_Check @tab string @tab IDE @tab -
-@item Documentation_Dir @tab string @tab IDE @tab -
-@headitem
- Configuration files @tab @tab @tab See gprbuild manual
-@item Default_Language @tab string @tab - @tab -
-@item Run_Path_Option @tab list @tab - @tab -
-@item Run_Path_Origin @tab string @tab - @tab -
-@item Separate_Run_Path_Options @tab string @tab - @tab -
-@item Toolchain_Version @tab string @tab - @tab insensitive
-@item Toolchain_Description @tab string @tab - @tab insensitive
-@item Object_Generated @tab string @tab - @tab insensitive
-@item Objects_Linked @tab string @tab - @tab insensitive
-@item Target @tab string @tab - @tab -
-@item Library_Builder @tab string @tab - @tab -
-@item Library_Support @tab string @tab - @tab -
-@item Archive_Builder @tab list @tab - @tab -
-@item Archive_Builder_Append_Option @tab list @tab - @tab -
-@item Archive_Indexer @tab list @tab - @tab -
-@item Archive_Suffix @tab string @tab - @tab -
-@item Library_Partial_Linker @tab list @tab - @tab -
-@item Shared_Library_Prefix @tab string @tab - @tab -
-@item Shared_Library_Suffix @tab string @tab - @tab -
-@item Symbolic_Link_Supported @tab string @tab - @tab -
-@item Library_Major_Minor_Id_Supported @tab string @tab - @tab -
-@item Library_Auto_Init_Supported @tab string @tab - @tab -
-@item Shared_Library_Minimum_Switches @tab list @tab - @tab -
-@item Library_Version_Switches @tab list @tab - @tab -
-@item Library_Install_Name_Option @tab string @tab - @tab -
-@item Runtime_Library_Dir @tab string @tab - @tab insensitive
-@item Runtime_Source_Dir @tab string @tab - @tab insensitive
-@item Driver @tab string @tab Compiler,Binder,Linker @tab insensitive (language)
-@item Required_Switches @tab list @tab Compiler,Binder,Linker @tab insensitive (language)
-@item Leading_Required_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Trailing_Required_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Pic_Options @tab list @tab Compiler @tab insensitive (language)
-@item Path_Syntax @tab string @tab Compiler @tab insensitive (language)
-@item Object_File_Suffix @tab string @tab Compiler @tab insensitive (language)
-@item Object_File_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Multi_Unit_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Multi_Unit_Object_Separator @tab string @tab Compiler @tab insensitive (language)
-@item Mapping_File_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Mapping_Spec_Suffix @tab string @tab Compiler @tab insensitive (language)
-@item Mapping_body_Suffix @tab string @tab Compiler @tab insensitive (language)
-@item Config_File_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Config_Body_File_Name @tab string @tab Compiler @tab insensitive (language)
-@item Config_Body_File_Name_Index @tab string @tab Compiler @tab insensitive (language)
-@item Config_Body_File_Name_Pattern @tab string @tab Compiler @tab insensitive (language)
-@item Config_Spec_File_Name @tab string @tab Compiler @tab insensitive (language)
-@item Config_Spec_File_Name_Index @tab string @tab Compiler @tab insensitive (language)
-@item Config_Spec_File_Name_Pattern @tab string @tab Compiler @tab insensitive (language)
-@item Config_File_Unique @tab string @tab Compiler @tab insensitive (language)
-@item Dependency_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Dependency_Driver @tab list @tab Compiler @tab insensitive (language)
-@item Include_Switches @tab list @tab Compiler @tab insensitive (language)
-@item Include_Path @tab string @tab Compiler @tab insensitive (language)
-@item Include_Path_File @tab string @tab Compiler @tab insensitive (language)
-@item Prefix @tab string @tab Binder @tab insensitive (language)
-@item Objects_Path @tab string @tab Binder @tab insensitive (language)
-@item Objects_Path_File @tab string @tab Binder @tab insensitive (language)
-@item Linker_Options @tab list @tab Linker @tab -
-@item Leading_Switches @tab list @tab Linker @tab -
-@item Map_File_Options @tab string @tab Linker @tab -
-@item Executable_Switches @tab list @tab Linker @tab -
-@item Lib_Dir_Switch @tab string @tab Linker @tab -
-@item Lib_Name_Switch @tab string @tab Linker @tab -
-@item Max_Command_Line_Length @tab string @tab Linker @tab -
-@item Response_File_Format @tab string @tab Linker @tab -
-@item Response_File_Switches @tab list @tab Linker @tab -
-@end multitable
-@c ---------------------------------------------
-@node Case Statements
-@subsection Case Statements
-@c ---------------------------------------------
+In the following sections, all predefined attributes are succinctly described,
+first the project level attributes, that is those attributes that are not in a
+package, then the attributes in the different packages.
-@noindent
-A @b{case} statement is used in a project file to effect conditional
-behavior. Through this statement, you can set the value of attributes
-and variables depending on the value previously assigned to a typed
-variable.
+It is possible for different tools to create dynamically new packages with
+attributes, or new attribute in predefined packages. These attributes are
+not documented here.
-All choices in a choice list must be distinct. Unlike Ada, the choice
-lists of all alternatives do not need to include all values of the type.
-An @code{others} choice must appear last in the list of alternatives.
+The attributes under Configuration headings are usually found only in
+configuration project files.
-The syntax of a @code{case} construction is based on the Ada case statement
-(although the @code{null} statement for empty alternatives is optional).
+The characteristics of each attribute are indicated as follows:
-The case expression must be a typed string variable, whose value is often
-given by an external reference (@pxref{External Values}).
+@itemize @bullet
-Each alternative starts with the reserved word @code{when}, either a list of
-literal strings separated by the @code{"|"} character or the reserved word
-@code{others}, and the @code{"=>"} token.
-Each literal string must belong to the string type that is the type of the
-case variable.
-After each @code{=>}, there are zero or more statements. The only
-statements allowed in a case construction are other case statements,
-attribute declarations and variable declarations. String type declarations and
-package declarations are not allowed. Variable declarations are restricted to
-variables that have already been declared before the case construction.
+@item @b{Type of value}
-@smallexample
-case_statement ::=
- @i{case} @i{<typed_variable_>}name @i{is} @{case_item@} @i{end case} ;
+The value of an attribute may be a single string, indicated by the word
+"single", or a string list, indicated by the word "list".
-case_item ::=
- @i{when} discrete_choice_list =>
- @{case_statement
- | attribute_declaration
- | variable_declaration
- | empty_declaration@}
+@item @b{Read-only}
-discrete_choice_list ::= string_literal @{| string_literal@} | @i{others}
-@end smallexample
+When the attribute is read-only, that is when it is not allowed to declare
+the attribute, this is indicated by the words "read-only".
-@noindent
-Here is a typical example:
+@item @b{Optional index}
-@smallexample @c projectfile
-@group
-project MyProj is
- type OS_Type is ("GNU/Linux", "Unix", "NT", "VMS");
- OS : OS_Type := external ("OS", "GNU/Linux");
+If it is allowed in the value of the attribute (both single and list) to have
+an optional index, this is indicated by the words "optional index".
- package Compiler is
- case OS is
- when "GNU/Linux" | "Unix" =>
- for Switches ("Ada") use ("-gnath");
- when "NT" =>
- for Switches ("Ada") use ("-gnatP");
- when others =>
- null;
- end case;
- end Compiler;
-end MyProj;
-@end group
-@end smallexample
+@item @b{Indexed attribute}
-@c ---------------------------------------------
-@node Tools Supporting Project Files
-@chapter Tools Supporting Project Files
-@c ---------------------------------------------
+When an it is an indexed attribute, this is indicated by the word "indexed".
-@noindent
+@item @b{Case-sensitivity of the index}
-@menu
-* gnatmake and Project Files::
-* The GNAT Driver and Project Files::
-* The Development Environments::
-@end menu
+For an indexed attribute, if the index is case-insensitive, this is indicated
+by the words "case-insensitive index".
-@c ---------------------------------------------
-@node gnatmake and Project Files
-@section gnatmake and Project Files
-@c ---------------------------------------------
+@item @b{File name index}
+For an indexed attribute, when the index is a file name, this is indicated by
+the words "file name index". The index may or may not be case-sensitive,
+depending on the platform.
+
+@item @b{others allowed in index}
+
+For an indexed attribute, if it is allowed to use @b{others} as the index,
+this is indicated by the words "others allowed".
+
+@end itemize
+
+@node Project Level Attributes
+@subsubsection Project Level Attributes
@noindent
-This section covers several topics related to @command{gnatmake} and
-project files: defining ^switches^switches^ for @command{gnatmake}
-and for the tools that it invokes; specifying configuration pragmas;
-the use of the @code{Main} attribute; building and rebuilding library project
-files.
-@menu
-* Switches Related to Project Files::
-* Switches and Project Files::
-* Specifying Configuration Pragmas::
-* Project Files and Main Subprograms::
-* Library Project Files::
-@end menu
+@itemize @bullet
-@c ---------------------------------------------
-@node Switches Related to Project Files
-@subsection Switches Related to Project Files
-@c ---------------------------------------------
+@item @b{General}
+@itemize @bullet
+
+@item @b{Name}: single, read-only
+
+The name of the project.
+
+@item @b{Project_Dir}: single, read-only
+
+The path name of the project directory.
+
+@item @b{Main}: list, optional index
+
+The list of main sources for the executables.
+
+@item @b{Languages}: list
+
+The list of languages of the sources of the project.
+
+@item @b{Roots}: list, indexed, file name index
+
+The index is the file name of an executable source. Indicates the list of
+units that need to be bound and linked with their closures with the executable.
+
+@item @b{Externally_Built}: single
+
+Indicates if the project is externally built.
+Only case-insensitive values allowed are "true" and "false", the default.
+
+@end itemize
@noindent
-The following switches are used by GNAT tools that support project files:
-@table @option
+@item @b{Directories}
-@item ^-P^/PROJECT_FILE=^@var{project}
-@cindex @option{^-P^/PROJECT_FILE^} (any project-aware tool)
-Indicates the name of a project file. This project file will be parsed with
-the verbosity indicated by @option{^-vP^MESSAGE_PROJECT_FILES=^@emph{x}},
-if any, and using the external references indicated
-by @option{^-X^/EXTERNAL_REFERENCE^} switches, if any.
-@ifclear vms
-There may zero, one or more spaces between @option{-P} and @var{project}.
-@end ifclear
+@itemize @bullet
-There must be only one @option{^-P^/PROJECT_FILE^} switch on the command line.
+@item @b{Object_Dir}: single
-Since the Project Manager parses the project file only after all the switches
-on the command line are checked, the order of the switches
-@option{^-P^/PROJECT_FILE^},
-@option{^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}}
-or @option{^-X^/EXTERNAL_REFERENCE^} is not significant.
+Indicates the object directory for the project.
-@item ^-X^/EXTERNAL_REFERENCE=^@var{name=value}
-@cindex @option{^-X^/EXTERNAL_REFERENCE^} (any project-aware tool)
-Indicates that external variable @var{name} has the value @var{value}.
-The Project Manager will use this value for occurrences of
-@code{external(name)} when parsing the project file.
+@item @b{Exec_Dir}: single
-@ifclear vms
-If @var{name} or @var{value} includes a space, then @var{name=value} should be
-put between quotes.
-@smallexample
- -XOS=NT
- -X"user=John Doe"
-@end smallexample
-@end ifclear
+Indicates the exec directory for the project, that is the directory where the
+executables are.
-Several @option{^-X^/EXTERNAL_REFERENCE^} switches can be used simultaneously.
-If several @option{^-X^/EXTERNAL_REFERENCE^} switches specify the same
-@var{name}, only the last one is used.
+@item @b{Source_Dirs}: list
-An external variable specified with a @option{^-X^/EXTERNAL_REFERENCE^} switch
-takes precedence over the value of the same name in the environment.
+The list of source directories of the project.
-@item ^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}
-@cindex @option{^-vP^/MESSAGES_PROJECT_FILE^} (any project-aware tool)
-Indicates the verbosity of the parsing of GNAT project files.
+@item @b{Inherit_Source_Path}: list, indexed, case-insensitive index
-@ifclear vms
-@option{-vP0} means Default;
-@option{-vP1} means Medium;
-@option{-vP2} means High.
-@end ifclear
+Index is a language name. Value is a list of language names. Indicates that
+in the source search path of the index language the source directories of
+the languages in the list should be included.
-@ifset vms
-There are three possible options for this qualifier: DEFAULT, MEDIUM and
-HIGH.
-@end ifset
+Example:
-The default is ^Default^DEFAULT^: no output for syntactically correct
-project files.
-If several @option{^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}} switches are present,
-only the last one is used.
+for Inherit_Source_Path ("C++") use ("C");
-@item ^-aP^/ADD_PROJECT_SEARCH_DIR=^<dir>
-@cindex @option{^-aP^/ADD_PROJECT_SEARCH_DIR=^} (any project-aware tool)
-Add directory <dir> at the beginning of the project search path, in order,
-after the current working directory.
+@item @b{Exclude_Source_Dirs}: list
-@ifclear vms
-@item -eL
-@cindex @option{-eL} (any project-aware tool)
-Follow all symbolic links when processing project files.
-@end ifclear
+The list of directories that are included in Source_Dirs but are not source
+directories of the project.
-@item ^--subdirs^/SUBDIRS^=<subdir>
-@cindex @option{^--subdirs^/SUBDIRS^=} (gnatmake and gnatclean)
-This switch is recognized by @command{gnatmake} and @command{gnatclean}. It
-indicate that the real directories (except the source directories) are the
-subdirectories <subdir> of the directories specified in the project files.
-This applies in particular to object directories, library directories and
-exec directories. If the subdirectories do not exist, they are created
-automatically.
+@item @b{Ignore_Source_Sub_Dirs}: list
-@end table
+Value is a list of simple names for subdirectories that are removed from the
+list of source directories, including theur subdirectories.
-@c ---------------------------------------------
-@node Switches and Project Files
-@subsection Switches and Project Files
-@c ---------------------------------------------
+@end itemize
-@noindent
-@ifset vms
-It is not currently possible to specify VMS style qualifiers in the project
-files; only Unix style ^switches^switches^ may be specified.
-@end ifset
+@item @b{Source Files}
-For each of the packages @code{Builder}, @code{Compiler}, @code{Binder}, and
-@code{Linker}, you can specify a @code{^Default_Switches^Default_Switches^}
-attribute, a @code{Switches} attribute, or both;
-as their names imply, these ^switch^switch^-related
-attributes affect the ^switches^switches^ that are used for each of these GNAT
-components when
-@command{gnatmake} is invoked. As will be explained below, these
-component-specific ^switches^switches^ precede
-the ^switches^switches^ provided on the @command{gnatmake} command line.
+@itemize @bullet
-The @code{^Default_Switches^Default_Switches^} attribute is an attribute
-indexed by language name (case insensitive) whose value is a string list.
-For example:
+@item @b{Source_Files}: list
-@smallexample @c projectfile
-@group
-package Compiler is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-gnaty^-gnaty^",
- "^-v^-v^");
-end Compiler;
-@end group
-@end smallexample
+Value is a list of source file simple names.
-@noindent
-The @code{Switches} attribute is indexed on a file name (which may or may
-not be case sensitive, depending
-on the operating system) whose value is a string list. For example:
+@item @b{Locally_Removed_Files}: list
-@smallexample @c projectfile
-@group
-package Builder is
- for Switches ("main1.adb")
- use ("^-O2^-O2^");
- for Switches ("main2.adb")
- use ("^-g^-g^");
-end Builder;
-@end group
-@end smallexample
+Obsolescent. Equivalent to Excluded_Source_Files.
-@noindent
-For the @code{Builder} package, the file names must designate source files
-for main subprograms. For the @code{Binder} and @code{Linker} packages, the
-file names must designate @file{ALI} or source files for main subprograms.
-In each case just the file name without an explicit extension is acceptable.
-
-For each tool used in a program build (@command{gnatmake}, the compiler, the
-binder, and the linker), the corresponding package @dfn{contributes} a set of
-^switches^switches^ for each file on which the tool is invoked, based on the
-^switch^switch^-related attributes defined in the package.
-In particular, the ^switches^switches^
-that each of these packages contributes for a given file @var{f} comprise:
+@item @b{Excluded_Source_Files}: list
+
+Value is a list of simple file names that are not sources of the project.
+Allows to remove sources that are inherited or found in the source directories
+and that match the naming scheme.
+
+@item @b{Source_List_File}: single
+
+Value is a text file name that contains a list of source file simple names,
+one on each line.
+
+@item @b{Excluded_Source_List_File}: single
+
+Value is a text file name that contains a list of file simple names that
+are not sources of the project.
+
+@item @b{Interfaces}: list
+
+Value is a list of file names that constitutes the interfaces of the project.
+
+@end itemize
+
+@item @b{Aggregate Projects}
@itemize @bullet
-@item the value of attribute @code{Switches (@var{f})},
- if it is specified in the package for the given file,
-@item otherwise, the value of @code{^Default_Switches^Default_Switches^ ("Ada")},
- if it is specified in the package.
+
+@item @b{Project_Files}: list
+
+Value is the list of aggregated projects.
+
+@item @b{Project_Path}: list
+
+Value is a list of directories that are added to the project search path when
+looking for the aggregated projects.
+
+@item @b{External}: single, indexed
+
+Index is the name of an external reference. Value is the value of the
+external reference to be used when parsing the aggregated projects.
@end itemize
-@noindent
-If neither of these attributes is defined in the package, then the package does
-not contribute any ^switches^switches^ for the given file.
+@item @b{Libraries}
-When @command{gnatmake} is invoked on a file, the ^switches^switches^ comprise
-two sets, in the following order: those contributed for the file
-by the @code{Builder} package;
-and the switches passed on the command line.
+@itemize @bullet
-When @command{gnatmake} invokes a tool (compiler, binder, linker) on a file,
-the ^switches^switches^ passed to the tool comprise three sets,
-in the following order:
+@item @b{Library_Dir}: single
-@enumerate
-@item
-the applicable ^switches^switches^ contributed for the file
-by the @code{Builder} package in the project file supplied on the command line;
+Value is the name of the library directory. This attribute needs to be
+declared for each library project.
-@item
-those contributed for the file by the package (in the relevant project file --
-see below) corresponding to the tool; and
+@item @b{Library_Name}: single
-@item
-the applicable switches passed on the command line.
-@end enumerate
+Value is the name of the library. This attribute needs to be declared or
+inherited for each library project.
-The term @emph{applicable ^switches^switches^} reflects the fact that
-@command{gnatmake} ^switches^switches^ may or may not be passed to individual
-tools, depending on the individual ^switch^switch^.
+@item @b{Library_Kind}: single
-@command{gnatmake} may invoke the compiler on source files from different
-projects. The Project Manager will use the appropriate project file to
-determine the @code{Compiler} package for each source file being compiled.
-Likewise for the @code{Binder} and @code{Linker} packages.
+Specifies the kind of library: static library (archive) or shared library.
+Case-insensitive values must be one of "static" for archives (the default) or
+"dynamic" or "relocatable" for shared libraries.
-As an example, consider the following package in a project file:
+@item @b{Library_Version}: single
-@smallexample @c projectfile
-@group
-project Proj1 is
- package Compiler is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-g^-g^");
- for Switches ("a.adb")
- use ("^-O1^-O1^");
- for Switches ("b.adb")
- use ("^-O2^-O2^",
- "^-gnaty^-gnaty^");
- end Compiler;
-end Proj1;
-@end group
-@end smallexample
+Value is the name of the library file.
-@noindent
-If @command{gnatmake} is invoked with this project file, and it needs to
-compile, say, the files @file{a.adb}, @file{b.adb}, and @file{c.adb}, then
-@file{a.adb} will be compiled with the ^switch^switch^
-@option{^-O1^-O1^},
-@file{b.adb} with ^switches^switches^
-@option{^-O2^-O2^}
-and @option{^-gnaty^-gnaty^},
-and @file{c.adb} with @option{^-g^-g^}.
-
-The following example illustrates the ordering of the ^switches^switches^
-contributed by different packages:
+@item @b{Library_Interface}: list
-@smallexample @c projectfile
-@group
-project Proj2 is
- package Builder is
- for Switches ("main.adb")
- use ("^-g^-g^",
- "^-O1^-)1^",
- "^-f^-f^");
- end Builder;
-@end group
+Value is the list of unit names that constitutes the interfaces
+of a Stand-Alone Library project.
-@group
- package Compiler is
- for Switches ("main.adb")
- use ("^-O2^-O2^");
- end Compiler;
-end Proj2;
-@end group
-@end smallexample
+@item @b{Library_Standalone}: single
-@noindent
-If you issue the command:
+Specifies if a Stand-Alone Library (SAL) is encapsulated or not.
+Only authorized case-insensitive values are "standard" for non encapsulated
+SALs, "encapsulated" for encapsulated SALs or "no" for non SAL library project.
-@smallexample
- gnatmake ^-Pproj2^/PROJECT_FILE=PROJ2^ -O0 main
-@end smallexample
+@item @b{Library_Encapsulated_Options}: list
-@noindent
-then the compiler will be invoked on @file{main.adb} with the following
-sequence of ^switches^switches^
+Value is a list of options that need to be used when linking an encapsulated
+Stand-Alone Library.
-@smallexample
- ^-g -O1 -O2 -O0^-g -O1 -O2 -O0^
-@end smallexample
+@item @b{Library_Encapsulated_Supported}: single
-@noindent
-with the last @option{^-O^-O^}
-^switch^switch^ having precedence over the earlier ones;
-several other ^switches^switches^
-(such as @option{^-c^-c^}) are added implicitly.
+Indicates if encapsulated Stand-Alone Libraries are supported. Only
+authorized case-insensitive values are "true" and "false" (the default).
-The ^switches^switches^
-@option{^-g^-g^}
-and @option{^-O1^-O1^} are contributed by package
-@code{Builder}, @option{^-O2^-O2^} is contributed
-by the package @code{Compiler}
-and @option{^-O0^-O0^} comes from the command line.
+@item @b{Library_Auto_Init}: single
-The @option{^-g^-g^}
-^switch^switch^ will also be passed in the invocation of
-@command{Gnatlink.}
+Indicates if a Stand-Alone Library is auto-initialized. Only authorized
+case-insentive values are "true" and "false".
-A final example illustrates switch contributions from packages in different
-project files:
+@item @b{Leading_Library_Options}: list
-@smallexample @c projectfile
-@group
-project Proj3 is
- for Source_Files use ("pack.ads", "pack.adb");
- package Compiler is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-gnata^-gnata^");
- end Compiler;
-end Proj3;
-@end group
+Value is a list of options that are to be used at the beginning of
+the command line when linking a shared library.
-@group
-with "Proj3";
-project Proj4 is
- for Source_Files use ("foo_main.adb", "bar_main.adb");
- package Builder is
- for Switches ("foo_main.adb")
- use ("^-s^-s^",
- "^-g^-g^");
- end Builder;
-end Proj4;
-@end group
+@item @b{Library_Options}: list
-@group
--- Ada source file:
-with Pack;
-procedure Foo_Main is
- @dots{}
-end Foo_Main;
-@end group
-@end smallexample
+Value is a list of options that are to be used when linking a shared library.
-@noindent
-If the command is
-@smallexample
-gnatmake ^-PProj4^/PROJECT_FILE=PROJ4^ foo_main.adb -cargs -gnato
-@end smallexample
+@item @b{Library_Src_Dir}: single
-@noindent
-then the ^switches^switches^ passed to the compiler for @file{foo_main.adb} are
-@option{^-g^-g^} (contributed by the package @code{Proj4.Builder}) and
-@option{^-gnato^-gnato^} (passed on the command line).
-When the imported package @code{Pack} is compiled, the ^switches^switches^ used
-are @option{^-g^-g^} from @code{Proj4.Builder},
-@option{^-gnata^-gnata^} (contributed from package @code{Proj3.Compiler},
-and @option{^-gnato^-gnato^} from the command line.
-
-When using @command{gnatmake} with project files, some ^switches^switches^ or
-arguments may be expressed as relative paths. As the working directory where
-compilation occurs may change, these relative paths are converted to absolute
-paths. For the ^switches^switches^ found in a project file, the relative paths
-are relative to the project file directory, for the switches on the command
-line, they are relative to the directory where @command{gnatmake} is invoked.
-The ^switches^switches^ for which this occurs are:
-^-I^-I^,
-^-A^-A^,
-^-L^-L^,
-^-aO^-aO^,
-^-aL^-aL^,
-^-aI^-aI^, as well as all arguments that are not switches (arguments to
-^switch^switch^
-^-o^-o^, object files specified in package @code{Linker} or after
--largs on the command line). The exception to this rule is the ^switch^switch^
-^--RTS=^--RTS=^ for which a relative path argument is never converted.
+Value is the name of the directory where copies of the sources of the
+interfaces of a Stand-Alone Library are to be copied.
-@c ---------------------------------------------
-@node Specifying Configuration Pragmas
-@subsection Specifying Configuration Pragmas
-@c ---------------------------------------------
+@item @b{Library_ALI_Dir}: single
-@noindent
-When using @command{gnatmake} with project files, if there exists a file
-@file{gnat.adc} that contains configuration pragmas, this file will be
-ignored.
-
-Configuration pragmas can be defined by means of the following attributes in
-project files: @code{Global_Configuration_Pragmas} in package @code{Builder}
-and @code{Local_Configuration_Pragmas} in package @code{Compiler}.
-
-Both these attributes are single string attributes. Their values is the path
-name of a file containing configuration pragmas. If a path name is relative,
-then it is relative to the project directory of the project file where the
-attribute is defined.
-
-When compiling a source, the configuration pragmas used are, in order,
-those listed in the file designated by attribute
-@code{Global_Configuration_Pragmas} in package @code{Builder} of the main
-project file, if it is specified, and those listed in the file designated by
-attribute @code{Local_Configuration_Pragmas} in package @code{Compiler} of
-the project file of the source, if it exists.
+Value is the name of the directory where the ALI files of the interfaces
+of a Stand-Alone Library are to be copied. When this attribute is not declared,
+the directory is the library directory.
-@c ---------------------------------------------
-@node Project Files and Main Subprograms
-@subsection Project Files and Main Subprograms
-@c ---------------------------------------------
+@item @b{Library_gcc}: single
-@noindent
-When using a project file, you can invoke @command{gnatmake}
-with one or several main subprograms, by specifying their source files on the
-command line.
+Obsolescent attribute. Specify the linker driver used to link a shared library.
+Use instead attribute Linker'Driver.
-@smallexample
- gnatmake ^-P^/PROJECT_FILE=^prj main1.adb main2.adb main3.adb
-@end smallexample
+@item @b{Library_Symbol_File}: single
-@noindent
-Each of these needs to be a source file of the same project, except
-when the switch ^-u^/UNIQUE^ is used.
-
-When ^-u^/UNIQUE^ is not used, all the mains need to be sources of the
-same project, one of the project in the tree rooted at the project specified
-on the command line. The package @code{Builder} of this common project, the
-"main project" is the one that is considered by @command{gnatmake}.
-
-When ^-u^/UNIQUE^ is used, the specified source files may be in projects
-imported directly or indirectly by the project specified on the command line.
-Note that if such a source file is not part of the project specified on the
-command line, the ^switches^switches^ found in package @code{Builder} of the
-project specified on the command line, if any, that are transmitted
-to the compiler will still be used, not those found in the project file of
-the source file.
-
-When using a project file, you can also invoke @command{gnatmake} without
-explicitly specifying any main, and the effect depends on whether you have
-defined the @code{Main} attribute. This attribute has a string list value,
-where each element in the list is the name of a source file (the file
-extension is optional) that contains a unit that can be a main subprogram.
-
-If the @code{Main} attribute is defined in a project file as a non-empty
-string list and the switch @option{^-u^/UNIQUE^} is not used on the command
-line, then invoking @command{gnatmake} with this project file but without any
-main on the command line is equivalent to invoking @command{gnatmake} with all
-the file names in the @code{Main} attribute on the command line.
+Value is the name of the library symbol file.
-Example:
-@smallexample @c projectfile
-@group
- project Prj is
- for Main use ("main1.adb", "main2.adb", "main3.adb");
- end Prj;
-@end group
-@end smallexample
+@item @b{Library_Symbol_Policy}: single
-@noindent
-With this project file, @code{"gnatmake ^-Pprj^/PROJECT_FILE=PRJ^"}
-is equivalent to
-@code{"gnatmake ^-Pprj^/PROJECT_FILE=PRJ^ main1.adb main2.adb main3.adb"}.
-
-When the project attribute @code{Main} is not specified, or is specified
-as an empty string list, or when the switch @option{-u} is used on the command
-line, then invoking @command{gnatmake} with no main on the command line will
-result in all immediate sources of the project file being checked, and
-potentially recompiled. Depending on the presence of the switch @option{-u},
-sources from other project files on which the immediate sources of the main
-project file depend are also checked and potentially recompiled. In other
-words, the @option{-u} switch is applied to all of the immediate sources of the
-main project file.
-
-When no main is specified on the command line and attribute @code{Main} exists
-and includes several mains, or when several mains are specified on the
-command line, the default ^switches^switches^ in package @code{Builder} will
-be used for all mains, even if there are specific ^switches^switches^
-specified for one or several mains.
-
-But the ^switches^switches^ from package @code{Binder} or @code{Linker} will be
-the specific ^switches^switches^ for each main, if they are specified.
+Indicates the symbol policy kind. Only authorized case-insensitive values are
+"autonomous", "default", "compliant", "controlled" or "direct".
-@c ---------------------------------------------
-@node Library Project Files
-@subsection Library Project Files
-@c ---------------------------------------------
+@item @b{Library_Reference_Symbol_File}: single
-@noindent
-When @command{gnatmake} is invoked with a main project file that is a library
-project file, it is not allowed to specify one or more mains on the command
-line.
+Value is the name of the reference symbol file.
+
+@end itemize
-When a library project file is specified, switches ^-b^/ACTION=BIND^ and
-^-l^/ACTION=LINK^ have special meanings.
+@item @b{Configuration - General}
@itemize @bullet
-@item ^-b^/ACTION=BIND^ is only allowed for stand-alone libraries. It indicates
- to @command{gnatmake} that @command{gnatbind} should be invoked for the
- library.
-@item ^-l^/ACTION=LINK^ may be used for all library projects. It indicates
- to @command{gnatmake} that the binder generated file should be compiled
- (in the case of a stand-alone library) and that the library should be built.
+@item @b{Default_Language}: single
+
+Value is the case-insensitive name of the language of a project when attribute
+Languages is not specified.
+
+@item @b{Run_Path_Option}: list
+
+Value is the list of switches to be used when specifying the run path option
+in an executable.
+
+@item @b{Run_Path_Origin}: single
+
+Value is the the string that may replace the path name of the executable
+directory in the run path options.
+
+@item @b{Separate_Run_Path_Options}: single
+
+Indicates if there may be or not several run path options specified when
+linking an executable. Only authorized case-insensitive b=values are "true" or
+"false" (the default).
+
+@item @b{Toolchain_Version}: single, indexed, case-insensitive index
+
+Index is a language name. Specify the version of a toolchain for a language.
+
+@item @b{Toolchain_Description}: single, indexed, case-insensitive index
+
+Obsolescent. No longer used.
+
+@item @b{Object_Generated}: single, indexed, case-insensitive index
+
+Index is a language name. Indicates if invoking the compiler for a language
+produces an object file. Only authorized case-insensitive values are "false"
+and "true" (the default).
+
+@item @b{Objects_Linked}: single, indexed, case-insensitive index
+
+Index is a language name. Indicates if the object files created by the compiler
+for a language need to be linked in the executable. Only authorized
+case-insensitive values are "false" and "true" (the default).
+
+@item @b{Target}: single
+
+Value is the name of the target platform.
+
@end itemize
-@c ---------------------------------------------
-@node The GNAT Driver and Project Files
-@section The GNAT Driver and Project Files
-@c ---------------------------------------------
+@item @b{Configuration - Libraries}
-@noindent
-A number of GNAT tools, other than @command{^gnatmake^gnatmake^}
-can benefit from project files:
-(@command{^gnatbind^gnatbind^},
-@command{^gnatcheck^gnatcheck^},
-@command{^gnatclean^gnatclean^},
-@command{^gnatelim^gnatelim^},
-@command{^gnatfind^gnatfind^},
-@command{^gnatlink^gnatlink^},
-@command{^gnatls^gnatls^},
-@command{^gnatmetric^gnatmetric^},
-@command{^gnatpp^gnatpp^},
-@command{^gnatstub^gnatstub^},
-and @command{^gnatxref^gnatxref^}). However, none of these tools can be invoked
-directly with a project file switch (@option{^-P^/PROJECT_FILE=^}).
-They must be invoked through the @command{gnat} driver.
-
-The @command{gnat} driver is a wrapper that accepts a number of commands and
-calls the corresponding tool. It was designed initially for VMS platforms (to
-convert VMS qualifiers to Unix-style switches), but it is now available on all
-GNAT platforms.
-
-On non-VMS platforms, the @command{gnat} driver accepts the following commands
-(case insensitive):
+@itemize @bullet
+
+@item @b{Library_Builder}: single
+
+Value is the path name of the application that is to be used to build
+libraries. Usually the path name of "gprlib".
+
+@item @b{Library_Support}: single
+
+Indicates the level of support of libraries. Only authorized case-insensitive
+values are "static_only", "full" or "none" (the default).
+
+@end itemize
+
+@item @b{Configuration - Archives}
@itemize @bullet
-@item BIND to invoke @command{^gnatbind^gnatbind^}
-@item CHOP to invoke @command{^gnatchop^gnatchop^}
-@item CLEAN to invoke @command{^gnatclean^gnatclean^}
-@item COMP or COMPILE to invoke the compiler
-@item ELIM to invoke @command{^gnatelim^gnatelim^}
-@item FIND to invoke @command{^gnatfind^gnatfind^}
-@item KR or KRUNCH to invoke @command{^gnatkr^gnatkr^}
-@item LINK to invoke @command{^gnatlink^gnatlink^}
-@item LS or LIST to invoke @command{^gnatls^gnatls^}
-@item MAKE to invoke @command{^gnatmake^gnatmake^}
-@item NAME to invoke @command{^gnatname^gnatname^}
-@item PREP or PREPROCESS to invoke @command{^gnatprep^gnatprep^}
-@item PP or PRETTY to invoke @command{^gnatpp^gnatpp^}
-@item METRIC to invoke @command{^gnatmetric^gnatmetric^}
-@item STUB to invoke @command{^gnatstub^gnatstub^}
-@item XREF to invoke @command{^gnatxref^gnatxref^}
+
+@item @b{Archive_Builder}: list
+
+Value is the name of the application to be used to create a static library
+(archive), followed by the options to be used.
+
+@item @b{Archive_Builder_Append_Option}: list
+
+Value is the list of options to be used when invoking the archive builder
+to add project files into an archive.
+
+@item @b{Archive_Indexer}: list
+
+Value is the name of the archive indexer, followed by the required options.
+
+@item @b{Archive_Suffix}: single
+
+Value is the extension of archives. When not declared, the extension is ".a".
+
+@item @b{Library_Partial_Linker}: list
+
+Value is the name of the partial linker executable, followed by the required
+options.
@end itemize
-@noindent
-(note that the compiler is invoked using the command
-@command{^gnatmake -f -u -c^gnatmake -f -u -c^}).
+@item @b{Configuration - Shared Libraries}
+
+@itemize @bullet
+
+@item @b{Shared_Library_Prefix}: single
+
+Value is the prefix in the name of shared library files. When not declared,
+the prefix is "lib".
+
+@item @b{Shared_Library_Suffix}: single
+
+Value is the the extension of the name of shared library files. When not
+declared, the extension is ".so".
+
+@item @b{Symbolic_Link_Supported}: single
+
+Indicates if symbolic links are supported on the platform. Only authorized
+case-insensitive values are "true" and "false" (the default).
+
+@item @b{Library_Major_Minor_Id_Supported}: single
+
+Indicates if major and minor ids for shared library names are supported on
+the platform. Only authorized case-insensitive values are "true" and "false"
+(the default).
+
+@item @b{Library_Auto_Init_Supported}: single
+
+Indicates if auto-initialization of Stand-Alone Libraries is supported. Only
+authorized case-insensitive values are "true" and "false" (the default).
+
+@item @b{Shared_Library_Minimum_Switches}: list
+
+Value is the list of required switches when linking a shared library.
+
+@item @b{Library_Version_Switches}: list
+
+Value is the list of switches to specify a internal name for a shared library.
-On non-VMS platforms, between @command{gnat} and the command, two
-special switches may be used:
+@item @b{Library_Install_Name_Option}: single
+
+Value is the name of the option that needs to be used, concatenated with the
+path name of the library file, when linking a shared library.
+
+@item @b{Runtime_Library_Dir}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the path name of the directory where the
+runtime libraries are located.
+
+@item @b{Runtime_Source_Dir}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the path name of the directory where the
+sources of runtime libraries are located.
+
+@end itemize
+
+@end itemize
+
+@node Package Binder Attributes
+@subsubsection Package Binder Attributes
+
+@itemize @bullet
+
+@item @b{General}
@itemize @bullet
-@item @command{-v} to display the invocation of the tool.
-@item @command{-dn} to prevent the @command{gnat} driver from removing
- the temporary files it has created. These temporary files are
- configuration files and temporary file list files.
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to be used when binding
+code of the language, if there is no applicable attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is either a language name or a source file name. Value is the list of
+switches to be used when binding code. Index is either the source file name
+of the executable to be bound or the language name of the code to be bound.
@end itemize
-@noindent
-The command may be followed by switches and arguments for the invoked
-tool.
+@item @b{Configuration - Binding}
-@smallexample
- gnat bind -C main.ali
- gnat ls -a main
- gnat chop foo.txt
-@end smallexample
+@itemize @bullet
-@noindent
-Switches may also be put in text files, one switch per line, and the text
-files may be specified with their path name preceded by '@@'.
+@item @b{Driver}: single, indexed, case-insensitive index
-@smallexample
- gnat bind @@args.txt main.ali
-@end smallexample
+Index is a language name. Value is the name of the application to be used when
+binding code of the language.
-@noindent
-In addition, for commands BIND, COMP or COMPILE, FIND, ELIM, LS or LIST, LINK,
-METRIC, PP or PRETTY, STUB and XREF, the project file related switches
-(@option{^-P^/PROJECT_FILE^},
-@option{^-X^/EXTERNAL_REFERENCE^} and
-@option{^-vP^/MESSAGES_PROJECT_FILE=^x}) may be used in addition to
-the switches of the invoking tool.
-
-When GNAT PP or GNAT PRETTY is used with a project file, but with no source
-specified on the command line, it invokes @command{^gnatpp^gnatpp^} with all
-the immediate sources of the specified project file.
-
-When GNAT METRIC is used with a project file, but with no source
-specified on the command line, it invokes @command{^gnatmetric^gnatmetric^}
-with all the immediate sources of the specified project file and with
-@option{^-d^/DIRECTORY^} with the parameter pointing to the object directory
-of the project.
-
-In addition, when GNAT PP, GNAT PRETTY or GNAT METRIC is used with
-a project file, no source is specified on the command line and
-switch ^-U^/ALL_PROJECTS^ is specified on the command line, then
-the underlying tool (^gnatpp^gnatpp^ or
-^gnatmetric^gnatmetric^) is invoked for all sources of all projects,
-not only for the immediate sources of the main project.
-@ifclear vms
-(-U stands for Universal or Union of the project files of the project tree)
-@end ifclear
+@item @b{Required_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of the required switches to be
+used when binding code of the language.
-For each of the following commands, there is optionally a corresponding
-package in the main project.
+@item @b{Prefix}: single, indexed, case-insensitive index
+
+Index is a language name. Value is a prefix to be used for the binder exchange
+file name for the language. Used to have different binder exchange file names
+when binding different languages.
+
+@item @b{Objects_Path}: single,indexed, case-insensitive index
+
+Index is a language name. Value is the name of the environment variable that
+contains the path for the object directories.
+
+@item @b{Object_Path_File}: single,indexed, case-insensitive index
+
+Index is a language name. Value is the name of the environment variable. The
+value of the environment variable is the path name of a text file that
+contains the list of object directories.
+
+@end itemize
+
+@end itemize
+
+@node Package Builder Attributes
+@subsubsection Package Builder Attributes
@itemize @bullet
-@item package @code{Binder} for command BIND (invoking @code{^gnatbind^gnatbind^})
-@item package @code{Check} for command CHECK (invoking
- @code{^gnatcheck^gnatcheck^})
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of builder switches to be used when
+building an executable of the language, if there is no applicable attribute
+Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
-@item package @code{Compiler} for command COMP or COMPILE (invoking the compiler)
+Index is either a language name or a source file name. Value is the list of
+builder switches to be used when building an executable. Index is either the
+source file name of the executable to be built or its language name.
-@item package @code{Cross_Reference} for command XREF (invoking
- @code{^gnatxref^gnatxref^})
+@item @b{Global_Compilation_Switches}: list, optional index, indexed,
+ case-insensitive index
-@item package @code{Eliminate} for command ELIM (invoking
- @code{^gnatelim^gnatelim^})
+Index is either a language name or a source file name. Value is the list of
+compilation switches to be used when building an executable. Index is either
+the source file name of the executable to be built or its language name.
-@item package @code{Finder} for command FIND (invoking @code{^gnatfind^gnatfind^})
+@item @b{Executable}: single, indexed, case-insensitive index
-@item package @code{Gnatls} for command LS or LIST (invoking @code{^gnatls^gnatls^})
+Index is an executable source file name. Value is the simple file name of the
+executable to be built.
-@item package @code{Gnatstub} for command STUB
- (invoking @code{^gnatstub^gnatstub^})
+@item @b{Executable_Suffix}: single
-@item package @code{Linker} for command LINK (invoking @code{^gnatlink^gnatlink^})
+Value is the extension of the file names of executable. When not specified,
+the extension is the default extension of executables on the platform.
-@item package @code{Check} for command CHECK
- (invoking @code{^gnatcheck^gnatcheck^})
+@item @b{Global_Configuration_Pragmas}: single
-@item package @code{Metrics} for command METRIC
- (invoking @code{^gnatmetric^gnatmetric^})
+Value is the file name of a configuration pragmas file that is specified to
+the Ada compiler when compiling any Ada source in the project tree.
-@item package @code{Pretty_Printer} for command PP or PRETTY
- (invoking @code{^gnatpp^gnatpp^})
+@item @b{Global_Config_File}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the file name of a configuration file that
+is specified to the compiler when compiling any source of the language in the
+project tree.
@end itemize
-@noindent
-Package @code{Gnatls} has a unique attribute @code{Switches},
-a simple variable with a string list value. It contains ^switches^switches^
-for the invocation of @code{^gnatls^gnatls^}.
+@node Package Check Attributes
+@subsubsection Package Check Attributes
-@smallexample @c projectfile
-@group
-project Proj1 is
- package gnatls is
- for Switches
- use ("^-a^-a^",
- "^-v^-v^");
- end gnatls;
-end Proj1;
-@end group
-@end smallexample
+@itemize @bullet
-@noindent
-All other packages have two attribute @code{Switches} and
-@code{^Default_Switches^Default_Switches^}.
+@item @b{Default_Switches}: list, indexed, case-insensitive index
-@code{Switches} is an indexed attribute, indexed by the
-source file name, that has a string list value: the ^switches^switches^ to be
-used when the tool corresponding to the package is invoked for the specific
-source file.
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatcheck} for a source of the language, if there is no applicable
+attribute Switches.
-@code{^Default_Switches^Default_Switches^} is an attribute,
-indexed by the programming language that has a string list value.
-@code{^Default_Switches^Default_Switches^ ("Ada")} contains the
-^switches^switches^ for the invocation of the tool corresponding
-to the package, except if a specific @code{Switches} attribute
-is specified for the source file.
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
-@smallexample @c projectfile
-@group
-project Proj is
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatcheck} for the source.
- for Source_Dirs use ("**");
+@end itemize
- package gnatls is
- for Switches use
- ("^-a^-a^",
- "^-v^-v^");
- end gnatls;
-@end group
-@group
+@node Package Clean Attributes
+@subsubsection Package Clean Attributes
- package Compiler is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-gnatv^-gnatv^",
- "^-gnatwa^-gnatwa^");
- end Binder;
-@end group
-@group
+@itemize @bullet
- package Binder is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-C^-C^",
- "^-e^-e^");
- end Binder;
-@end group
-@group
+@item @b{Switches}: list
- package Linker is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-C^-C^");
- for Switches ("main.adb")
- use ("^-C^-C^",
- "^-v^-v^",
- "^-v^-v^");
- end Linker;
-@end group
-@group
+Value is a list of switches to be used by the cleaning application.
- package Finder is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-a^-a^",
- "^-f^-f^");
- end Finder;
-@end group
-@group
+@item @b{Source_Artifact_Extensions}: list, indexed, case-insensitive index
- package Cross_Reference is
- for ^Default_Switches^Default_Switches^ ("Ada")
- use ("^-a^-a^",
- "^-f^-f^",
- "^-d^-d^",
- "^-u^-u^");
- end Cross_Reference;
-end Proj;
-@end group
-@end smallexample
+Index is a language names. Value is the list of extensions for file names
+derived from object file names that need to be cleaned in the object
+directory of the project.
-@noindent
-With the above project file, commands such as
+@item @b{Object_Artifact_Extensions}: list, indexed, case-insensitive index
-@smallexample
- ^gnat comp -Pproj main^GNAT COMP /PROJECT_FILE=PROJ MAIN^
- ^gnat ls -Pproj main^GNAT LIST /PROJECT_FILE=PROJ MAIN^
- ^gnat xref -Pproj main^GNAT XREF /PROJECT_FILE=PROJ MAIN^
- ^gnat bind -Pproj main.ali^GNAT BIND /PROJECT_FILE=PROJ MAIN.ALI^
- ^gnat link -Pproj main.ali^GNAT LINK /PROJECT_FILE=PROJ MAIN.ALI^
-@end smallexample
+Index is a language names. Value is the list of extensions for file names
+derived from source file names that need to be cleaned in the object
+directory of the project.
-@noindent
-will set up the environment properly and invoke the tool with the switches
-found in the package corresponding to the tool:
-@code{^Default_Switches^Default_Switches^ ("Ada")} for all tools,
-except @code{Switches ("main.adb")}
-for @code{^gnatlink^gnatlink^}.
-It is also possible to invoke some of the tools,
-(@code{^gnatcheck^gnatcheck^},
-@code{^gnatmetric^gnatmetric^},
-and @code{^gnatpp^gnatpp^})
-on a set of project units thanks to the combination of the switches
-@option{-P}, @option{-U} and possibly the main unit when one is interested
-in its closure. For instance,
-@smallexample
-gnat metric -Pproj
-@end smallexample
+@end itemize
-@noindent
-will compute the metrics for all the immediate units of project
-@code{proj}.
-@smallexample
-gnat metric -Pproj -U
-@end smallexample
+@node Package Compiler Attributes
+@subsubsection Package Compiler Attributes
-@noindent
-will compute the metrics for all the units of the closure of projects
-rooted at @code{proj}.
-@smallexample
-gnat metric -Pproj -U main_unit
-@end smallexample
+@itemize @bullet
-@noindent
-will compute the metrics for the closure of units rooted at
-@code{main_unit}. This last possibility relies implicitly
-on @command{gnatbind}'s option @option{-R}. But if the argument files for the
-tool invoked by the @command{gnat} driver are explicitly specified
-either directly or through the tool @option{-files} option, then the tool
-is called only for these explicitly specified files.
+@item @b{General}
-@c ---------------------------------------------
-@node The Development Environments
-@section The Development Environments
-@c ---------------------------------------------
+@itemize @bullet
-@noindent
-See the appropriate manuals for more details. These environments will
-store a number of settings in the project itself, when they are meant
-to be shared by the whole team working on the project. Here are the
-attributes defined in the package @b{IDE} in projects.
+@item @b{Default_Switches}: list, indexed, case-insensitive index
-@table @code
-@item Remote_Host
-This is a simple attribute. Its value is a string that designates the remote
-host in a cross-compilation environment, to be used for remote compilation and
-debugging. This field should not be specified when running on the local
-machine.
-
-@item Program_Host
-This is a simple attribute. Its value is a string that specifies the
-name of IP address of the embedded target in a cross-compilation environment,
-on which the program should execute.
-
-@item Communication_Protocol
-This is a simple string attribute. Its value is the name of the protocol
-to use to communicate with the target in a cross-compilation environment,
-e.g.@: @code{"wtx"} or @code{"vxworks"}.
-
-@item Compiler_Command
-This is an associative array attribute, whose domain is a language name. Its
-value is string that denotes the command to be used to invoke the compiler.
-The value of @code{Compiler_Command ("Ada")} is expected to be compatible with
-@command{gnatmake}, in particular in the handling of switches.
-
-@item Debugger_Command
-This is simple attribute, Its value is a string that specifies the name of
-the debugger to be used, such as gdb, powerpc-wrs-vxworks-gdb or gdb-4.
-
-@item Default_Switches
-This is an associative array attribute. Its indexes are the name of the
-external tools that the GNAT Programming System (GPS) is supporting. Its
-value is a list of switches to use when invoking that tool.
-
-@item Gnatlist
-This is a simple attribute. Its value is a string that specifies the name
-of the @command{gnatls} utility to be used to retrieve information about the
-predefined path; e.g., @code{"gnatls"}, @code{"powerpc-wrs-vxworks-gnatls"}.
-
-@item VCS_Kind
-This is a simple attribute. Its value is a string used to specify the
-Version Control System (VCS) to be used for this project, e.g.@: CVS, RCS
-ClearCase or Perforce.
-
-@item Gnat
-This is a simple attribute. Its value is a string that specifies the name
-of the @command{gnat} utility to be used when executing various tools from
-GPS, in particular @code{"gnat pp"}, @code{"gnat stub"},@dots{}
-
-@item VCS_File_Check
-This is a simple attribute. Its value is a string that specifies the
-command used by the VCS to check the validity of a file, either
-when the user explicitly asks for a check, or as a sanity check before
-doing the check-in.
-
-@item VCS_Log_Check
-This is a simple attribute. Its value is a string that specifies
-the command used by the VCS to check the validity of a log file.
-
-@item VCS_Repository_Root
-The VCS repository root path. This is used to create tags or branches
-of the repository. For subversion the value should be the @code{URL}
-as specified to check-out the working copy of the repository.
-
-@item VCS_Patch_Root
-The local root directory to use for building patch file. All patch chunks
-will be relative to this path. The root project directory is used if
-this value is not defined.
+Index is a language name. Value is a list of switches to be used when invoking
+the compiler for the language for a source of the project, if there is no
+applicable attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name or a language name. Value is the list of switches
+to be used when invoking the compiler for the source or for its language.
+
+@item @b{Local_Configuration_Pragmas}: single
+
+Value is the file name of a configuration pragmas file that is specified to
+the Ada compiler when compiling any Ada source in the project.
+
+@item @b{Local_Config_File}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the file name of a configuration file that
+is specified to the compiler when compiling any source of the language in the
+project.
+
+@end itemize
+
+@item @b{Configuration - Compiling}
+
+@itemize @bullet
+
+@item @b{Driver}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the name of the executable for the compiler
+of the language.
+
+@item @b{Language_Kind}: single, indexed, case-insensitive index
+
+Index is a language name. Indicates the kind of the language, either file based
+or unit based. Only authorized case-insensitive values are "unit_based" and
+"file_based" (the default).
+
+@item @b{Dependency_Kind}: : single, indexed, case-insensitive index
+
+Index is a language name. Indicates how the dependencies are handled for the
+language. Only authorized case-insensitive values are "makefile", "ali_file",
+"ali_closure" or "none" (the default.
+
+@item @b{Required_Switches}: list, indexed, case-insensitive index
+
+Equivalent to attribute Leading_Required_Switches.
+
+@item @b{Leading_Required_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of the minimum switches to be used
+at the beginning of the command line when invoking the compiler for the
+language.
+
+@item @b{Trailing_Required_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of the minimum switches to be used
+at the end of the command line when invoking the compiler for the language.
+
+@item @b{PIC_Option}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to be used when
+compiling a source of the language when the project is a shared library
+project.
+
+@item @b{Path_Syntax}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the kind of path syntax to be used when
+invoking the compiler for the language. Only authorized case-insensitive
+values are "canonical" and "host" (the default).
+
+@item @b{Source_File_Switches}: single, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used just before
+the path name of the source to compile when invoking the compiler for a source
+of the language.
+
+@item @b{Object_File_Suffix}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the extension of the object files created
+by the compiler of the language. When not specified, the extension is the
+default one for the platform.
+
+@item @b{Object_File_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to be used by the
+compiler of the language to specify the path name of the object file. When not
+specified, the switch used is "-o".
+
+@item @b{Multi_Unit_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to be used to compile
+a unit in a multi unit source of the language. The index of the unit in the
+source is concatenated with the last switches in the list.
+
+@item @b{Multi_Unit_Object_Separator}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the string to be used in the object file
+name before the index of the unit, when compiling a unit in a multi unit source
+of the language.
+
+@end itemize
+
+@item @b{Configuration - Mapping Files}
+
+@itemize @bullet
+
+@item @b{Mapping_File_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to be used to specify
+a mapping file when invoking the compiler for a source of the language.
+
+@item @b{Mapping_Spec_Suffix}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the suffix to be used in a mapping file
+to indicate that the source is a spec.
+
+@item @b{Mapping_Body_Suffix}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the suffix to be used in a mapping file
+to indicate that the source is a body.
+
+@end itemize
+
+@item @b{Configuration - Config Files}
+
+@itemize @bullet
+
+@item @b{Config_File_Switches}: list: single, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to specify to the
+compiler of the language a configuration file.
+
+@item @b{Config_Body_File_Name}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the template to be used to indicate a
+configuration specific to a body of the language in a configuration
+file.
+
+@item @b{Config_Body_File_Name_Index}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the template to be used to indicate a
+configuration specific to the body a unit in a multi unit source of the
+language in a configuration file.
+
+@item @b{Config_Body_File_Name_Pattern}: single, indexed,
+ case-insensitive index
+
+Index is a language name. Value is the template to be used to indicate a
+configuration for all bodies of the languages in a configuration file.
+
+@item @b{Config_Spec_File_Name}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the template to be used to indicate a
+configuration specific to a spec of the language in a configuration
+file.
+
+@item @b{Config_Spec_File_Name_Index}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the template to be used to indicate a
+configuration specific to the spec a unit in a multi unit source of the
+language in a configuration file.
+
+@item @b{Config_Spec_File_Name_Pattern}: single, indexed,
+ case-insensitive index
+
+Index is a language name. Value is the template to be used to indicate a
+configuration for all specs of the languages in a configuration file.
+
+@item @b{Config_File_Unique}: single, indexed, case-insensitive index
+
+Index is a language name. Indicates if there should be only one configuration
+file specified to the compiler of the language. Only authorized
+case-insensitive values are "true" and "false" (the default).
+
+@end itemize
+
+@item @b{Configuration - Dependencies}
+
+@itemize @bullet
+
+@item @b{Dependency_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to be used to specify
+to the compiler the dependency file when the dependency kind of the language is
+file based, and when Dependency_Driver is not specified for the language.
+
+@item @b{Dependency_Driver}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the name of the executable to be used to
+create the dependency file for a source of the language, followed by the
+required switches.
+
+@end itemize
+
+@item @b{Configuration - Search Paths}
+
+@itemize @bullet
+
+@item @b{Include_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to specify to the
+compiler of the language to indicate a directory to look for sources.
+
+@item @b{Include_Path}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the name of an environment variable that
+contains the path of all the directories that the compiler of the language
+may search for sources.
+
+@item @b{Include_Path_File}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the name of an environment variable the
+value of which is the path name of a text file that contains the directories
+that the compiler of the language may search for sources.
+
+@item @b{Object_Path_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is the list of switches to specify to the
+compiler of the language the name of a text file that contains the list of
+object directories. When this attribute is not declared, the text file is
+not created.
+
+@end itemize
+
+@end itemize
+
+@node Package Cross_Reference Attributes
+@subsubsection Package Cross_Reference Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatxref} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatxref} for the source.
+
+@end itemize
+
+@node Package Eliminate Attributes
+@subsubsection Package Eliminate Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatelim} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatelim} for the source.
+
+@end itemize
+
+@node Package Finder Attributes
+@subsubsection Package Finder Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatfind} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatfind} for the source.
+
+@end itemize
+
+@node Package gnatls Attributes
+@subsubsection Package gnatls Attributes
+
+@itemize @bullet
+
+@item @b{Switches}: list
+
+Value is a list of switches to be used when invoking @code{gnatls}.
+
+@end itemize
+
+@node Package gnatstub Attributes
+@subsubsection Package gnatstub Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatstub} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatstub} for the source.
+
+@end itemize
+
+@node Package IDE Attributes
+@subsubsection Package IDE Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed
+
+Index is the name of an external tool that the GNAT Programming System (GPS)
+is supporting. Value is a list of switches to use when invoking that tool.
+
+@item @b{Remote_Host}: single
+
+Value is a string that designates the remote host in a cross-compilation
+environment, to be used for remote compilation and debugging. This attribute
+should not be specified when running on the local machine.
+
+@item @b{Program_Host}: single
+
+Value is a string that specifies the name of IP address of the embedded target
+in a cross-compilation environment, on which the program should execute.
+
+@item @b{Communication_Protocol}: single
+
+Value is the name of the protocol to use to communicate with the target
+in a cross-compilation environment, for example @code{"wtx"} or
+@code{"vxworks"}.
+
+@item @b{Compiler_Command}: single, indexed, case-insensitive index
+
+Index is a language Name. Value is a string that denotes the command to be
+used to invoke the compiler. The value of @code{Compiler_Command ("Ada")} is
+expected to be compatible with @command{gnatmake}, in particular in
+the handling of switches.
+
+@item @b{Debugger_Command}: single
+
+Value is a string that specifies the name of the debugger to be used, such as
+gdb, powerpc-wrs-vxworks-gdb or gdb-4.
+
+@item @b{gnatlist}: single
+
+Value is a string that specifies the name of the @command{gnatls} utility
+to be used to retrieve information about the predefined path; for example,
+@code{"gnatls"}, @code{"powerpc-wrs-vxworks-gnatls"}.
+
+@item @b{VCS_Kind}: single
+
+Value is a string used to specify the Version Control System (VCS) to be used
+for this project, for example CVS, RCS, ClearCase or Perforce.
+
+@item @b{VCS_File_Check}: single
+
+Value is a string that specifies the command used by the VCS to check
+the validity of a file, either when the user explicitly asks for a check,
+or as a sanity check before doing the check-in.
+
+@item @b{VCS_Log_Check}: single
+
+Value is a string that specifies the command used by the VCS to check
+the validity of a log file.
+
+@item @b{Documentation_Dir}: single
+
+Value is the directory used to generate the documentation of source code.
+
+@end itemize
+
+@node Package Install Attributes
+@subsubsection Package Install Attributes
+
+@itemize @bullet
+
+@item @b{Prefix}: single
+
+Value is the install destination directory.
+
+@item @b{Sources_Subdir}: single
+
+Value is the sources directory or subdirectory of Prefix.
+
+@item @b{Exec_Subdir}: single
+
+Value is the executables directory or subdirectory of Prefix.
+
+@item @b{Lib_Subdir}: single
+
+Value is library directory or subdirectory of Prefix.
+
+@item @b{Project_Subdir}: single
+
+Value is the project directory or subdirectory of Prefix.
+
+@item @b{Active}: single
+
+Indicates that the project is to be installed or not. Case-insensitive value
+"false" means that the project is not to be installed, all other values mean
+that the project is to be installed.
+
+@end itemize
+
+@node Package Linker Attributes
+@subsubsection Package Linker Attributes
+
+@itemize @bullet
+
+@item @b{General}
+
+@itemize @bullet
+
+@item @b{Required_Switches}: list
+
+Value is a list of switches that are required when invoking the linker to link
+an executable.
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches for the linker when
+linking an executable for a main source of the language, when there is no
+applicable Switches.
+
+@item @b{Leading_Switches}: list, optional index, indexed,
+ case-insensitive index, others allowed
+
+Index is a source file name or a language name. Value is the list of switches
+to be used at the beginning of the command line when invoking the linker to
+build an executable for the source or for its language.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name or a language name. Value is the list of switches
+to be used when invoking the linker to build an executable for the source or
+for its language.
+
+@item @b{Trailing_Switches}: list, optional index, indexed,
+ case-insensitive index, others allowed
+
+Index is a source file name or a language name. Value is the list of switches
+to be used at the end of the command line when invoking the linker to
+build an executable for the source or for its language. These switches may
+override the Required_Switches.
+
+@item @b{Linker_Options}: list
+
+Value is a list of switches/options that are to be added when linking an
+executable from a project importing the current project directly or indirectly.
+Linker_Options are not used when linking an executable from the current
+project.
+
+@item @b{Map_File_Option}: single
+
+Value is the switch to specify the map file name that the linker needs to
+create.
+
+@end itemize
+
+@item @b{Configuration - Linking}
+
+@itemize @bullet
+
+@item @b{Driver}: single
+
+Value is the name of the linker executable.
+
+@end itemize
+
+@item @b{Configuration - Response Files}
+
+@itemize @bullet
+
+@item @b{Max_Command_Line_Length}: single
+
+Value is the maximum number of character in the command line when invoking
+the linker to link an executable.
+
+@item @b{Response_File_Format}: single
+
+Indicates the kind of response file to create when the length of the linking
+command line is too large. Only authorized case-insensitive values are "none",
+"gnu", "object_list", "gcc_gnu", "gcc_option_list" and "gcc_object_list".
+
+@item @b{Response_File_Switches}: list
+
+Value is the list of switches to specify a response file to the linker.
+
+@end itemize
+
+@end itemize
+
+@node Package Metrics Attribute
+@subsubsection Package Metrics Attribute
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatmetric} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatmetric} for the source.
+
+@end itemize
+
+@node Package Naming Attributes
+@subsubsection Package Naming Attributes
+
+@itemize @bullet
+
+@item @b{Specification_Suffix}: single, indexed, case-insensitive index
+
+Equivalent to attribute Spec_Suffix.
+
+@item @b{Spec_Suffix}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the extension of file names for specs of
+the language.
+
+@item @b{Implementation_Suffix}: single, indexed, case-insensitive index
+
+Equivalent to attribute Body_Suffix.
+
+@item @b{Body_Suffix}: single, indexed, case-insensitive index
+
+Index is a language name. Value is the extension of file names for bodies of
+the language.
+
+@item @b{Separate_Suffix}: single
+
+Value is the extension of file names for subunits of Ada.
+
+@item @b{Casing}: single
+
+Indicates the casing of sources of the Ada language. Only authorized
+case-insensitive values are "lowercase", "uppercase" and "mixedcase".
+
+@item @b{Dot_Replacement}: single
+
+Value is the string that replace the dot of unit names in the source file names
+of the Ada language.
+
+@item @b{Specification}: single, optional index, indexed,
+ case-insensitive index
+
+Equivalent to attribute Spec.
+
+@item @b{Spec}: single, optional index, indexed, case-insensitive index
+
+Index is a unit name. Value is the file name of the spec of the unit.
+
+@item @b{Implementation}: single, optional index, indexed,
+ case-insensitive index
+
+Equivalent to attribute Body.
+
+@item @b{Body}: single, optional index, indexed, case-insensitive index
+
+Index is a unit name. Value is the file name of the body of the unit.
+
+@item @b{Specification_Exceptions}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of specs for the language that do not
+necessarily follow the naming scheme for the language and that may or may not
+be found in the source directories of the project.
+
+@item @b{Implementation_Exceptions}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of bodies for the language that do not
+necessarily follow the naming scheme for the language and that may or may not
+be found in the source directories of the project.
+
+@end itemize
+
+@node Package Pretty_Printer Attributes
+@subsubsection Package Pretty_Printer Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatpp} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatpp} for the source.
+
+@end itemize
+
+@node Package Remote Attributes
+@subsubsection Package Remote Attributes
+
+@itemize @bullet
+
+@item @b{Build_Slaves}: list
+
+Value is the list of machine names that are to be used in distributed
+compilation.
+
+@item @b{Root_Dir}: single
+
+Value is the root directory used by the slave machines.
+
+@end itemize
+
+@node Package Stack Attributes
+@subsubsection Package Stack Attributes
+
+@itemize @bullet
+
+@item @b{Switches}: list
+
+Value is the list of switches to be used when invoking @code{gnatstack}.
+
+@end itemize
+
+@node Package Synchronize Attributes
+@subsubsection Package Synchronize Attributes
+
+@itemize @bullet
+
+@item @b{Default_Switches}: list, indexed, case-insensitive index
+
+Index is a language name. Value is a list of switches to be used when invoking
+@code{gnatsync} for a source of the language, if there is no applicable
+attribute Switches.
+
+@item @b{Switches}: list, optional index, indexed, case-insensitive index,
+ others allowed
+
+Index is a source file name. Value is the list of switches to be used when
+invoking @code{gnatsync} for the source.
+
+@end itemize
-@end table
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index c3e6772ed50..37dd5e48886 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -29,22 +29,23 @@
-- --
------------------------------------------------------------------------------
-with Alloc; use Alloc;
-with Atree; use Atree;
-with Casing; use Casing;
-with Debug; use Debug;
-with Einfo; use Einfo;
-with Lib; use Lib;
-with Namet; use Namet;
-with Opt; use Opt;
-with Output; use Output;
-with Sinfo; use Sinfo;
-with Sinput; use Sinput;
-with Snames; use Snames;
-with Stand; use Stand;
-with Table; use Table;
-with Uname; use Uname;
-with Urealp; use Urealp;
+with Alloc; use Alloc;
+with Atree; use Atree;
+with Casing; use Casing;
+with Debug; use Debug;
+with Einfo; use Einfo;
+with Lib; use Lib;
+with Namet; use Namet;
+with Opt; use Opt;
+with Output; use Output;
+with Sem_Aux; use Sem_Aux;
+with Sinfo; use Sinfo;
+with Sinput; use Sinput;
+with Snames; use Snames;
+with Stand; use Stand;
+with Table; use Table;
+with Uname; use Uname;
+with Urealp; use Urealp;
with Ada.Unchecked_Conversion;
@@ -133,7 +134,7 @@ package body Repinfo is
-- Called before outputting anything for an entity. Ensures that
-- a blank line precedes the output for a particular entity.
- procedure List_Entities (Ent : Entity_Id);
+ procedure List_Entities (Ent : Entity_Id; Bytes_Big_Endian : Boolean);
-- This procedure lists the entities associated with the entity E, starting
-- with the First_Entity and using the Next_Entity link. If a nested
-- package is found, entities within the package are recursively processed.
@@ -142,7 +143,7 @@ package body Repinfo is
-- List name of entity Ent in appropriate case. The name is listed with
-- full qualification up to but not including the compilation unit name.
- procedure List_Array_Info (Ent : Entity_Id);
+ procedure List_Array_Info (Ent : Entity_Id; Bytes_Big_Endian : Boolean);
-- List representation info for array type Ent
procedure List_Mechanisms (Ent : Entity_Id);
@@ -152,9 +153,14 @@ package body Repinfo is
procedure List_Object_Info (Ent : Entity_Id);
-- List representation info for object Ent
- procedure List_Record_Info (Ent : Entity_Id);
+ procedure List_Record_Info (Ent : Entity_Id; Bytes_Big_Endian : Boolean);
-- List representation info for record type Ent
+ procedure List_Scalar_Storage_Order
+ (Ent : Entity_Id;
+ Bytes_Big_Endian : Boolean);
+ -- List scalar storage order information for record or array type Ent
+
procedure List_Type_Info (Ent : Entity_Id);
-- List type info for type Ent
@@ -286,7 +292,7 @@ package body Repinfo is
-- List_Array_Info --
----------------------
- procedure List_Array_Info (Ent : Entity_Id) is
+ procedure List_Array_Info (Ent : Entity_Id; Bytes_Big_Endian : Boolean) is
begin
List_Type_Info (Ent);
Write_Str ("for ");
@@ -294,13 +300,15 @@ package body Repinfo is
Write_Str ("'Component_Size use ");
Write_Val (Component_Size (Ent));
Write_Line (";");
+
+ List_Scalar_Storage_Order (Ent, Bytes_Big_Endian);
end List_Array_Info;
-------------------
-- List_Entities --
-------------------
- procedure List_Entities (Ent : Entity_Id) is
+ procedure List_Entities (Ent : Entity_Id; Bytes_Big_Endian : Boolean) is
Body_E : Entity_Id;
E : Entity_Id;
@@ -379,12 +387,12 @@ package body Repinfo is
elsif Is_Record_Type (E) then
if List_Representation_Info >= 1 then
- List_Record_Info (E);
+ List_Record_Info (E, Bytes_Big_Endian);
end if;
elsif Is_Array_Type (E) then
if List_Representation_Info >= 1 then
- List_Array_Info (E);
+ List_Array_Info (E, Bytes_Big_Endian);
end if;
elsif Is_Type (E) then
@@ -411,7 +419,7 @@ package body Repinfo is
if Ekind (E) = E_Package then
if No (Renamed_Object (E)) then
- List_Entities (E);
+ List_Entities (E, Bytes_Big_Endian);
end if;
-- Recurse into bodies
@@ -428,12 +436,12 @@ package body Repinfo is
or else
Ekind (E) = E_Protected_Body
then
- List_Entities (E);
+ List_Entities (E, Bytes_Big_Endian);
-- Recurse into blocks
elsif Ekind (E) = E_Block then
- List_Entities (E);
+ List_Entities (E, Bytes_Big_Endian);
end if;
end if;
@@ -461,7 +469,7 @@ package body Repinfo is
and then
Nkind (Parent (Find_Declaration (Body_E))) /= N_Subunit
then
- List_Entities (Body_E);
+ List_Entities (Body_E, Bytes_Big_Endian);
end if;
end if;
@@ -779,7 +787,7 @@ package body Repinfo is
-- List_Record_Info --
----------------------
- procedure List_Record_Info (Ent : Entity_Id) is
+ procedure List_Record_Info (Ent : Entity_Id; Bytes_Big_Endian : Boolean) is
Comp : Entity_Id;
Cfbit : Uint;
Sunit : Uint;
@@ -963,13 +971,15 @@ package body Repinfo is
end loop;
Write_Line ("end record;");
+
+ List_Scalar_Storage_Order (Ent, Bytes_Big_Endian);
end List_Record_Info;
-------------------
-- List_Rep_Info --
-------------------
- procedure List_Rep_Info is
+ procedure List_Rep_Info (Bytes_Big_Endian : Boolean) is
Col : Nat;
begin
@@ -994,7 +1004,7 @@ package body Repinfo is
end loop;
Write_Eol;
- List_Entities (Cunit_Entity (U));
+ List_Entities (Cunit_Entity (U), Bytes_Big_Endian);
-- List representation information to file
@@ -1002,7 +1012,7 @@ package body Repinfo is
Create_Repinfo_File_Access.all
(Get_Name_String (File_Name (Source_Index (U))));
Set_Special_Output (Write_Info_Line'Access);
- List_Entities (Cunit_Entity (U));
+ List_Entities (Cunit_Entity (U), Bytes_Big_Endian);
Set_Special_Output (null);
Close_Repinfo_File_Access.all;
end if;
@@ -1011,6 +1021,52 @@ package body Repinfo is
end if;
end List_Rep_Info;
+ -------------------------------
+ -- List_Scalar_Storage_Order --
+ -------------------------------
+
+ procedure List_Scalar_Storage_Order
+ (Ent : Entity_Id;
+ Bytes_Big_Endian : Boolean)
+ is
+ procedure List_Attr (Attr_Name : String);
+ -- Show attribute definition clause for Attr_Name
+
+ ---------------
+ -- List_Attr --
+ ---------------
+
+ procedure List_Attr (Attr_Name : String) is
+ begin
+ Write_Str ("for ");
+ List_Name (Ent);
+ Write_Str ("'" & Attr_Name & " use System.");
+
+ if Bytes_Big_Endian xor Reverse_Storage_Order (Ent) then
+ Write_Str ("High");
+ else
+ Write_Str ("Low");
+ end if;
+
+ Write_Line ("_Order_First;");
+ end List_Attr;
+
+ -- Start of processing for List_Scalar_Storage_Order
+
+ begin
+ if Has_Rep_Item (Ent, Name_Scalar_Storage_Order) then
+
+ -- For a record type with explicitly specified scalar storage order,
+ -- also display explicit Bit_Order.
+
+ if Is_Record_Type (Ent) then
+ List_Attr ("Bit_Order");
+ end if;
+
+ List_Attr ("Scalar_Storage_Order");
+ end if;
+ end List_Scalar_Storage_Order;
+
--------------------
-- List_Type_Info --
--------------------
diff --git a/gcc/ada/repinfo.ads b/gcc/ada/repinfo.ads
index 652769924e7..99fccc34d4a 100644
--- a/gcc/ada/repinfo.ads
+++ b/gcc/ada/repinfo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -283,8 +283,9 @@ package Repinfo is
-- Compiler Interface --
------------------------
- procedure List_Rep_Info;
- -- Procedure to list representation information
+ procedure List_Rep_Info (Bytes_Big_Endian : Boolean);
+ -- Procedure to list representation information. Bytes_Big_Endian is the
+ -- value from Ttypes (Repinfo cannot have a dependency on Ttypes).
procedure Tree_Write;
-- Writes out internal tables to current tree file using the relevant
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index d4acf1dd912..6502bb1df7a 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -68,6 +68,24 @@ package body Restrict is
-- Set True if any entry of No_Specifcation_Of_Aspects has been set True.
-- Once set True, this is never turned off again.
+ No_Use_Of_Attribute : array (Attribute_Id) of Source_Ptr :=
+ (others => No_Location);
+
+ No_Use_Of_Attribute_Warning : array (Attribute_Id) of Boolean :=
+ (others => False);
+
+ No_Use_Of_Attribute_Set : Boolean := False;
+ -- Indicates that No_Use_Of_Attribute was set at least once
+
+ No_Use_Of_Pragma : array (Pragma_Id) of Source_Ptr :=
+ (others => No_Location);
+
+ No_Use_Of_Pragma_Warning : array (Pragma_Id) of Boolean :=
+ (others => False);
+
+ No_Use_Of_Pragma_Set : Boolean := False;
+ -- Indicates that No_Use_Of_Pragma was set at least once
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -287,6 +305,72 @@ package body Restrict is
Check_Restriction (No_Implicit_Heap_Allocations, N);
end Check_No_Implicit_Heap_Alloc;
+ -------------------------------------------
+ -- Check_Restriction_No_Use_Of_Attribute --
+ --------------------------------------------
+
+ procedure Check_Restriction_No_Use_Of_Attribute (N : Node_Id) is
+ Id : constant Name_Id := Chars (N);
+ A_Id : constant Attribute_Id := Get_Attribute_Id (Id);
+
+ begin
+ -- Ignore call if node N is not in the main source unit, since we only
+ -- give messages for the main unit. This avoids giving messages for
+ -- aspects that are specified in withed units.
+
+ if not In_Extended_Main_Source_Unit (N) then
+ return;
+ end if;
+
+ -- If nothing set, nothing to check
+
+ if not No_Use_Of_Attribute_Set then
+ return;
+ end if;
+
+ Error_Msg_Sloc := No_Use_Of_Attribute (A_Id);
+
+ if Error_Msg_Sloc /= No_Location then
+ Error_Msg_Node_1 := N;
+ Error_Msg_Warn := No_Use_Of_Attribute_Warning (A_Id);
+ Error_Msg_N
+ ("<violation of restriction `No_Use_Of_Attribute '='> &`#", N);
+ end if;
+ end Check_Restriction_No_Use_Of_Attribute;
+
+ ----------------------------------------
+ -- Check_Restriction_No_Use_Of_Pragma --
+ ----------------------------------------
+
+ procedure Check_Restriction_No_Use_Of_Pragma (N : Node_Id) is
+ Id : constant Node_Id := Pragma_Identifier (N);
+ P_Id : constant Pragma_Id := Get_Pragma_Id (Chars (Id));
+
+ begin
+ -- Ignore call if node N is not in the main source unit, since we only
+ -- give messages for the main unit. This avoids giving messages for
+ -- aspects that are specified in withed units.
+
+ if not In_Extended_Main_Source_Unit (N) then
+ return;
+ end if;
+
+ -- If nothing set, nothing to check
+
+ if not No_Use_Of_Pragma_Set then
+ return;
+ end if;
+
+ Error_Msg_Sloc := No_Use_Of_Pragma (P_Id);
+
+ if Error_Msg_Sloc /= No_Location then
+ Error_Msg_Node_1 := Id;
+ Error_Msg_Warn := No_Use_Of_Pragma_Warning (P_Id);
+ Error_Msg_N
+ ("<violation of restriction `No_Use_Of_Pragma '='> &`#", Id);
+ end if;
+ end Check_Restriction_No_Use_Of_Pragma;
+
-----------------------------------
-- Check_Obsolescent_2005_Entity --
-----------------------------------
@@ -295,6 +379,10 @@ package body Restrict is
function Chars_Is (E : Entity_Id; S : String) return Boolean;
-- Return True iff Chars (E) matches S (given in lower case)
+ --------------
+ -- Chars_Is --
+ --------------
+
function Chars_Is (E : Entity_Id; S : String) return Boolean is
Nam : constant Name_Id := Chars (E);
begin
@@ -1271,6 +1359,44 @@ package body Restrict is
No_Specification_Of_Aspect_Set := True;
end Set_Restriction_No_Specification_Of_Aspect;
+ -----------------------------------------
+ -- Set_Restriction_No_Use_Of_Attribute --
+ -----------------------------------------
+
+ procedure Set_Restriction_No_Use_Of_Attribute
+ (N : Node_Id;
+ Warning : Boolean)
+ is
+ A_Id : constant Attribute_Id := Get_Attribute_Id (Chars (N));
+
+ begin
+ No_Use_Of_Attribute_Set := True;
+ No_Use_Of_Attribute (A_Id) := Sloc (N);
+
+ if Warning = False then
+ No_Use_Of_Attribute_Warning (A_Id) := False;
+ end if;
+ end Set_Restriction_No_Use_Of_Attribute;
+
+ --------------------------------------
+ -- Set_Restriction_No_Use_Of_Pragma --
+ --------------------------------------
+
+ procedure Set_Restriction_No_Use_Of_Pragma
+ (N : Node_Id;
+ Warning : Boolean)
+ is
+ A_Id : constant Pragma_Id := Get_Pragma_Id (Chars (N));
+
+ begin
+ No_Use_Of_Pragma_Set := True;
+ No_Use_Of_Pragma (A_Id) := Sloc (N);
+
+ if Warning = False then
+ No_Use_Of_Pragma_Warning (A_Id) := False;
+ end if;
+ end Set_Restriction_No_Use_Of_Pragma;
+
----------------------------------
-- Suppress_Restriction_Message --
----------------------------------
diff --git a/gcc/ada/restrict.ads b/gcc/ada/restrict.ads
index 54702abd10c..b01ffe46a35 100644
--- a/gcc/ada/restrict.ads
+++ b/gcc/ada/restrict.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -252,6 +252,16 @@ package Restrict is
-- Wrapper on Check_Restriction with Msg_Issued, with the out-parameter
-- being ignored here.
+ procedure Check_Restriction_No_Use_Of_Attribute (N : Node_Id);
+ -- N is the node of an attribute definition clause. An error message
+ -- (warning) will be issued if a restriction (warning) was previously set
+ -- for this attribute using Set_No_Use_Of_Attribute.
+
+ procedure Check_Restriction_No_Use_Of_Pragma (N : Node_Id);
+ -- N is the node of a pragma. An error message (warning) will be issued
+ -- if a restriction (warning) was previously set for this pragma using
+ -- Set_No_Use_Of_Pragma.
+
procedure Check_Restriction_No_Dependence (U : Node_Id; Err : Node_Id);
-- Called when a dependence on a unit is created (either implicitly, or by
-- an explicit WITH clause). U is a node for the unit involved, and Err is
@@ -416,6 +426,19 @@ package Restrict is
-- case of a Restriction_Warnings pragma specifying this restriction and
-- False for a Restrictions pragma specifying this restriction.
+ procedure Set_Restriction_No_Use_Of_Attribute
+ (N : Node_Id;
+ Warning : Boolean);
+ -- N is the node id for the identifier in a pragma Restrictions for
+ -- No_Use_Of_Attribute. Caller has verified that this is a valid attribute
+ -- designator.
+
+ procedure Set_Restriction_No_Use_Of_Pragma
+ (N : Node_Id;
+ Warning : Boolean);
+ -- N is the node id for the identifier in a pragma Restrictions for
+ -- No_Use_Of_Pragma. Caller has verified that this is a valid pragma id.
+
function Tasking_Allowed return Boolean;
pragma Inline (Tasking_Allowed);
-- Tests if tasking operations are allowed by the current restrictions
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index 5327da54aac..382d2d1b015 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -537,15 +537,11 @@ package body Rtsfind is
return
Nkind (Prf) = N_Identifier
and then
- (Chars (Prf) = Name_Text_IO
- or else
- Chars (Prf) = Name_Wide_Text_IO
- or else
- Chars (Prf) = Name_Wide_Wide_Text_IO)
- and then
- Nkind (Sel) = N_Identifier
- and then
- Chars (Sel) in Text_IO_Package_Name;
+ Nam_In (Chars (Prf), Name_Text_IO,
+ Name_Wide_Text_IO,
+ Name_Wide_Wide_Text_IO)
+ and then Nkind (Sel) = N_Identifier
+ and then Chars (Sel) in Text_IO_Package_Name;
end Is_Text_IO_Kludge_Unit;
---------------
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index 2bfbaa82a36..f218cdc7a2b 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1307,6 +1307,9 @@ package Rtsfind is
RE_Release_Buffer, -- System.Partition_Interface
RE_BS_To_Any, -- System.Partition_Interface
RE_Any_To_BS, -- System.Partition_Interface
+ RE_Build_Complex_TC, -- System.Partition_Interface
+ RE_Get_TC, -- System.Partition_Interface
+ RE_Set_TC, -- System.Partition_Interface
RE_FA_A, -- System.Partition_Interface
RE_FA_B, -- System.Partition_Interface
@@ -1350,10 +1353,6 @@ package Rtsfind is
RE_TA_Std_String, -- System.Partition_Interface
RE_TA_TC, -- System.Partition_Interface
- RE_TC_Alias, -- System.Partition_Interface
- RE_TC_Build, -- System.Partition_Interface
- RE_Get_TC, -- System.Partition_Interface
- RE_Set_TC, -- System.Partition_Interface
RE_TC_A, -- System.Partition_Interface
RE_TC_B, -- System.Partition_Interface
RE_TC_C, -- System.Partition_Interface
@@ -1373,12 +1372,14 @@ package Rtsfind is
RE_TC_Opaque, -- System.Partition_Interface
RE_TC_WC, -- System.Partition_Interface
RE_TC_WWC, -- System.Partition_Interface
- RE_TC_Array, -- System.Partition_Interface
- RE_TC_Sequence, -- System.Partition_Interface
RE_TC_String, -- System.Partition_Interface
- RE_TC_Struct, -- System.Partition_Interface
- RE_TC_Union, -- System.Partition_Interface
- RE_TC_Object, -- System.Partition_Interface
+
+ RE_Tk_Alias, -- System.Partition_Interface
+ RE_Tk_Array, -- System.Partition_Interface
+ RE_Tk_Sequence, -- System.Partition_Interface
+ RE_Tk_Struct, -- System.Partition_Interface
+ RE_Tk_Objref, -- System.Partition_Interface
+ RE_Tk_Union, -- System.Partition_Interface
RE_IS_Is1, -- System.Scalar_Values
RE_IS_Is2, -- System.Scalar_Values
@@ -2550,6 +2551,9 @@ package Rtsfind is
RE_Release_Buffer => System_Partition_Interface,
RE_BS_To_Any => System_Partition_Interface,
RE_Any_To_BS => System_Partition_Interface,
+ RE_Build_Complex_TC => System_Partition_Interface,
+ RE_Get_TC => System_Partition_Interface,
+ RE_Set_TC => System_Partition_Interface,
RE_FA_A => System_Partition_Interface,
RE_FA_B => System_Partition_Interface,
@@ -2593,10 +2597,6 @@ package Rtsfind is
RE_TA_Std_String => System_Partition_Interface,
RE_TA_TC => System_Partition_Interface,
- RE_TC_Alias => System_Partition_Interface,
- RE_TC_Build => System_Partition_Interface,
- RE_Get_TC => System_Partition_Interface,
- RE_Set_TC => System_Partition_Interface,
RE_TC_A => System_Partition_Interface,
RE_TC_B => System_Partition_Interface,
RE_TC_C => System_Partition_Interface,
@@ -2616,12 +2616,14 @@ package Rtsfind is
RE_TC_Opaque => System_Partition_Interface,
RE_TC_WC => System_Partition_Interface,
RE_TC_WWC => System_Partition_Interface,
- RE_TC_Array => System_Partition_Interface,
- RE_TC_Sequence => System_Partition_Interface,
RE_TC_String => System_Partition_Interface,
- RE_TC_Struct => System_Partition_Interface,
- RE_TC_Union => System_Partition_Interface,
- RE_TC_Object => System_Partition_Interface,
+
+ RE_Tk_Alias => System_Partition_Interface,
+ RE_Tk_Array => System_Partition_Interface,
+ RE_Tk_Sequence => System_Partition_Interface,
+ RE_Tk_Struct => System_Partition_Interface,
+ RE_Tk_Objref => System_Partition_Interface,
+ RE_Tk_Union => System_Partition_Interface,
RE_Global_Pool_Object => System_Pool_Global,
diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads
index 18c43c42a64..390f47e02df 100644
--- a/gcc/ada/s-crtl.ads
+++ b/gcc/ada/s-crtl.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -97,7 +97,8 @@ package System.CRTL is
function fopen
(filename : chars;
mode : chars;
- encoding : Filename_Encoding := Unspecified) return FILEs;
+ encoding : Filename_Encoding := Unspecified;
+ vms_form : chars := System.Null_Address) return FILEs;
pragma Import (C, fopen, "__gnat_fopen");
function fputc (C : int; stream : FILEs) return int;
@@ -113,7 +114,8 @@ package System.CRTL is
(filename : chars;
mode : chars;
stream : FILEs;
- encoding : Filename_Encoding := Unspecified) return FILEs;
+ encoding : Filename_Encoding := Unspecified;
+ vms_form : chars := System.Null_Address) return FILEs;
pragma Import (C, freopen, "__gnat_freopen");
function fseek
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index 88bad49f76e..64b89926753 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -29,15 +29,15 @@
-- --
------------------------------------------------------------------------------
-with Ada.Finalization; use Ada.Finalization;
-with Ada.IO_Exceptions; use Ada.IO_Exceptions;
+with Ada.Finalization; use Ada.Finalization;
+with Ada.IO_Exceptions; use Ada.IO_Exceptions;
with Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Interfaces.C_Streams; use Interfaces.C_Streams;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.CRTL.Runtime;
-with System.Case_Util; use System.Case_Util;
+with System.Case_Util; use System.Case_Util;
with System.OS_Lib;
with System.Soft_Links;
@@ -52,6 +52,12 @@ package body System.File_IO is
use type Interfaces.C.int;
use type CRTL.size_t;
+ subtype String_Access is System.OS_Lib.String_Access;
+ procedure Free (X : in out String_Access) renames System.OS_Lib.Free;
+
+ function "=" (X, Y : String_Access) return Boolean
+ renames System.OS_Lib."=";
+
----------------------
-- Global Variables --
----------------------
@@ -98,6 +104,9 @@ package body System.File_IO is
(C, text_translation_required, "__gnat_text_translation_required");
-- If true, add appropriate suffix to control string for Open
+ VMS_Formstr : String_Access := null;
+ -- For special VMS RMS keywords and values
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -132,11 +141,20 @@ package body System.File_IO is
-- with Name includes that file name in the message.
procedure Raise_Device_Error
- (File : AFCB_Ptr; Errno : Integer := OS_Lib.Errno);
+ (File : AFCB_Ptr;
+ Errno : Integer := OS_Lib.Errno);
pragma No_Return (Raise_Device_Error);
-- Clear error indication on File and raise Device_Error with an exception
-- message providing errno information.
+ procedure Form_VMS_RMS_Keys (Form : String; VMS_Form : out String_Access);
+ -- Parse the RMS Keys
+
+ function Form_RMS_Context_Key
+ (Form : String;
+ VMS_Form : String_Access) return Natural;
+ -- Parse the RMS Context Key
+
----------------
-- Append_Set --
----------------
@@ -514,7 +532,6 @@ package body System.File_IO is
Fopstr (1) := (if Creat then 'w' else 'r');
Fopstr (2) := '+';
Fptr := 3;
-
end case;
-- If text_translation_required is true then we need to append either a
@@ -558,13 +575,10 @@ package body System.File_IO is
if V1 = 0 then
return Default;
-
elsif Form (V1) = 'y' then
return True;
-
elsif Form (V1) = 'n' then
return False;
-
else
raise Use_Error with "invalid Form";
end if;
@@ -640,6 +654,197 @@ package body System.File_IO is
Stop := 0;
end Form_Parameter;
+ --------------------------
+ -- Form_RMS_Context_Key --
+ --------------------------
+
+ function Form_RMS_Context_Key
+ (Form : String;
+ VMS_Form : String_Access) return Natural
+ is
+ type Context_Parms is
+ (Binary_Data, Convert_Fortran_Carriage_Control, Force_Record_Mode,
+ Force_Stream_Mode, Explicit_Write);
+ -- Ada-fied list of all possible Context keyword values
+
+ Pos : Natural := 0;
+ Klen : Natural := 0;
+ Index : Natural;
+
+ begin
+ -- Find the end of the occupation
+
+ for J in VMS_Form'First .. VMS_Form'Last loop
+ if VMS_Form (J) = ASCII.NUL then
+ Pos := J;
+ exit;
+ end if;
+ end loop;
+
+ Index := Form'First;
+ while Index < Form'Last loop
+ if Form (Index) = '=' then
+ Index := Index + 1;
+
+ -- Loop through the context values and look for a match
+
+ for Parm in Context_Parms loop
+ declare
+ KImage : String := Context_Parms'Image (Parm);
+
+ begin
+ Klen := KImage'Length;
+ To_Lower (KImage);
+
+ if Index + Klen - 1 <= Form'Last
+ and then Form (Index .. Index + Klen - 1) = KImage
+ then
+ case Parm is
+ when Force_Record_Mode =>
+ VMS_Form (Pos) := '"';
+ Pos := Pos + 1;
+ VMS_Form (Pos .. Pos + 6) := "ctx=rec";
+ Pos := Pos + 7;
+ VMS_Form (Pos) := '"';
+ Pos := Pos + 1;
+ VMS_Form (Pos) := ',';
+ return Index + Klen;
+
+ when Force_Stream_Mode =>
+ VMS_Form (Pos) := '"';
+ Pos := Pos + 1;
+ VMS_Form (Pos .. Pos + 6) := "ctx=stm";
+ Pos := Pos + 7;
+ VMS_Form (Pos) := '"';
+ Pos := Pos + 1;
+ VMS_Form (Pos) := ',';
+ return Index + Klen;
+
+ when others =>
+ raise Use_Error
+ with "unimplemented RMS Context Value";
+ end case;
+ end if;
+ end;
+ end loop;
+
+ raise Use_Error with "unrecognized RMS Context Value";
+ end if;
+ end loop;
+
+ raise Use_Error with "malformed RMS Context Value";
+ end Form_RMS_Context_Key;
+
+ -----------------------
+ -- Form_VMS_RMS_Keys --
+ -----------------------
+
+ procedure Form_VMS_RMS_Keys (Form : String; VMS_Form : out String_Access)
+ is
+ VMS_RMS_Keys_Token : constant String := "vms_rms_keys";
+ Klen : Natural := VMS_RMS_Keys_Token'Length;
+ Index : Natural;
+
+ -- Ada-fied list of all RMS keywords, translated from the HP C Run-Time
+ -- Library Reference Manual, Table REF-3: RMS Valid Keywords and Values.
+
+ type RMS_Keys is
+ (Access_Callback, Allocation_Quantity, Block_Size, Context,
+ Default_Extension_Quantity, Default_File_Name_String, Error_Callback,
+ File_Processing_Options, Fixed_Header_Size, Global_Buffer_Count,
+ Multiblock_Count, Multibuffer_Count, Maximum_Record_Size,
+ Terminal_Input_Prompt, Record_Attributes, Record_Format,
+ Record_Processing_Options, Retrieval_Pointer_Count, Sharing_Options,
+ Timeout_IO_Value);
+
+ begin
+ Index := Form'First + Klen - 1;
+ while Index < Form'Last loop
+ Index := Index + 1;
+
+ -- Scan for the token signalling VMS RMS Keys ahead. Should
+ -- whitespace be eaten???
+
+ if Form (Index - Klen .. Index - 1) = VMS_RMS_Keys_Token then
+
+ -- Allocate the VMS form string that will contain the cryptic
+ -- CRTL RMS strings and initialize it to all nulls. Since the
+ -- CRTL strings are always shorter than the Ada-fied strings,
+ -- it follows that an allocation of the original size will be
+ -- more than adequate.
+ VMS_Form := new String'(Form (Form'First .. Form'Last));
+ VMS_Form.all := (others => ASCII.NUL);
+
+ if Form (Index) = '=' then
+ Index := Index + 1;
+ if Form (Index) = '(' then
+ while Index < Form'Last loop
+ Index := Index + 1;
+
+ -- Loop through the RMS Keys and dispatch.
+
+ for Key in RMS_Keys loop
+ declare
+ KImage : String := RMS_Keys'Image (Key);
+
+ begin
+ Klen := KImage'Length;
+ To_Lower (KImage);
+
+ if Form (Index .. Index + Klen - 1) = KImage then
+ case Key is
+ when Context =>
+ Index := Form_RMS_Context_Key
+ (Form (Index + Klen .. Form'Last),
+ VMS_Form);
+ exit;
+
+ when others =>
+ raise Use_Error
+ with "unimplemented VMS RMS Form Key";
+ end case;
+ end if;
+ end;
+ end loop;
+
+ if Form (Index) = ')' then
+
+ -- Done, erase the unneeded trailing comma and return
+
+ for J in reverse VMS_Form'First .. VMS_Form'Last loop
+ if VMS_Form (J) = ',' then
+ VMS_Form (J) := ASCII.NUL;
+ return;
+ end if;
+ end loop;
+
+ -- Shouldn't be possible to get here
+
+ raise Use_Error;
+
+ elsif Form (Index) = ',' then
+
+ -- Another key ahead, exit inner loop
+
+ null;
+
+ else
+
+ -- Keyword value not terminated correctly
+
+ raise Use_Error with "malformed VMS RMS Form";
+ end if;
+ end loop;
+ end if;
+ end if;
+
+ -- Found the keyword, but not followed by correct syntax
+
+ raise Use_Error with "malformed VMS RMS Form";
+ end if;
+ end loop;
+ end Form_VMS_RMS_Keys;
+
-------------
-- Is_Open --
-------------
@@ -822,13 +1027,10 @@ package body System.File_IO is
if V1 = 0 then
Shared := None;
-
elsif Formstr (V1 .. V2) = "yes" then
Shared := Yes;
-
elsif Formstr (V1 .. V2) = "no" then
Shared := No;
-
else
raise Use_Error with "invalid Form";
end if;
@@ -844,13 +1046,10 @@ package body System.File_IO is
if V1 = 0 then
Encoding := CRTL.Unspecified;
-
elsif Formstr (V1 .. V2) = "utf8" then
Encoding := CRTL.UTF8;
-
elsif Formstr (V1 .. V2) = "8bits" then
Encoding := CRTL.ASCII_8bits;
-
else
raise Use_Error with "invalid Form";
end if;
@@ -868,6 +1067,17 @@ package body System.File_IO is
Form_Boolean (Formstr, "text_translation", Default => True);
end if;
+ -- Acquire settings of target specific form parameters on VMS. Only
+ -- Context is currently implemented, for forcing a byte stream mode
+ -- read. On non-VMS systems, the settings are ultimately ignored in
+ -- the implementation of __gnat_fopen.
+
+ -- Should a warning be issued on non-VMS systems? That's not possible
+ -- without testing System.OpenVMS boolean which isn't present in most
+ -- non-VMS versions of package System.
+
+ Form_VMS_RMS_Keys (Formstr, VMS_Formstr);
+
-- If we were given a stream (call from xxx.C_Streams.Open), then set
-- the full name to the given one, and skip to end of processing.
@@ -1030,7 +1240,19 @@ package body System.File_IO is
-- since by the time of the delete, the current working directory
-- may have changed and we do not want to delete a different file!
- Stream := fopen (Namestr'Address, Fopstr'Address, Encoding);
+ if VMS_Formstr = null then
+ Stream := fopen (Namestr'Address, Fopstr'Address, Encoding,
+ Null_Address);
+ else
+ Stream := fopen (Namestr'Address, Fopstr'Address, Encoding,
+ VMS_Formstr.all'Address);
+ end if;
+
+ -- No need to keep this around
+
+ if VMS_Formstr /= null then
+ Free (VMS_Formstr);
+ end if;
if Stream = NULL_Stream then
@@ -1042,15 +1264,15 @@ package body System.File_IO is
declare
function Is_File_Not_Found_Error
(Errno_Value : Integer) return Integer;
- -- Non-zero when the given errno value indicates a non-
- -- existing file.
-
pragma Import
(C, Is_File_Not_Found_Error,
"__gnat_is_file_not_found_error");
+ -- Non-zero when the given errno value indicates a non-
+ -- existing file.
- Errno : constant Integer := OS_Lib.Errno;
+ Errno : constant Integer := OS_Lib.Errno;
Message : constant String := Errno_Message (Name, Errno);
+
begin
if Is_File_Not_Found_Error (Errno) /= 0 then
raise Name_Error with Message;
@@ -1089,7 +1311,8 @@ package body System.File_IO is
------------------------
procedure Raise_Device_Error
- (File : AFCB_Ptr; Errno : Integer := OS_Lib.Errno)
+ (File : AFCB_Ptr;
+ Errno : Integer := OS_Lib.Errno)
is
begin
-- Clear error status so that the same error is not reported twice
@@ -1123,7 +1346,6 @@ package body System.File_IO is
else -- 0 < Nread < Siz
raise Data_Error with "not enough data read";
end if;
-
end Read_Buf;
procedure Read_Buf
@@ -1196,13 +1418,25 @@ package body System.File_IO is
Fopen_Mode
(Mode, File.Is_Text_File, False, File.Access_Method, Fopstr);
- File.Stream := freopen
- (File.Name.all'Address, Fopstr'Address, File.Stream, File.Encoding);
+ Form_VMS_RMS_Keys (File.Form.all, VMS_Formstr);
+
+ if VMS_Formstr = null then
+ File.Stream := freopen
+ (File.Name.all'Address, Fopstr'Address, File.Stream,
+ File.Encoding, Null_Address);
+ else
+ File.Stream := freopen
+ (File.Name.all'Address, Fopstr'Address, File.Stream,
+ File.Encoding, VMS_Formstr.all'Address);
+ end if;
+
+ if VMS_Formstr /= null then
+ Free (VMS_Formstr);
+ end if;
if File.Stream = NULL_Stream then
Close (File_Ptr);
raise Use_Error;
-
else
File.Mode := Mode;
Append_Set (File);
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index 9848cb82c82..4e11fb1c211 100644
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -924,7 +924,6 @@ package System.OS_Lib is
procedure OS_Exit (Status : Integer);
pragma No_Return (OS_Exit);
-
-- Exit to OS with given status code (program is terminated). Note that
-- this is abrupt termination. All tasks are immediately terminated. There
-- are no finalization or other Ada-specific cleanup actions performed. On
diff --git a/gcc/ada/s-osprim-mingw.adb b/gcc/ada/s-osprim-mingw.adb
index 874b1cb186a..a2c466406c4 100644
--- a/gcc/ada/s-osprim-mingw.adb
+++ b/gcc/ada/s-osprim-mingw.adb
@@ -68,17 +68,17 @@ package body System.OS_Primitives is
type Clock_Data_Access is access all Clock_Data;
- -- Two base clock buffers. This is used to be able to update a buffer
- -- while the other buffer is read. The point is that we do not want to
- -- use a lock inside the Clock routine for performance reasons. We still
- -- use a lock in the Get_Base_Time which is called very rarely. Current
- -- is a pointer, the pragma Atomic is there to ensure that the value can
- -- be set or read atomically. That's it, when Get_Base_Time has updated
- -- a buffer the switch to the new value is done by changing Current
- -- pointer.
+ -- Two base clock buffers. This is used to be able to update a buffer while
+ -- the other buffer is read. The point is that we do not want to use a lock
+ -- inside the Clock routine for performance reasons. We still use a lock
+ -- in the Get_Base_Time which is called very rarely. Current is a pointer,
+ -- the pragma Atomic is there to ensure that the value can be set or read
+ -- atomically. That's it, when Get_Base_Time has updated a buffer the
+ -- switch to the new value is done by changing Current pointer.
First, Second : aliased Clock_Data;
- Current : Clock_Data_Access := First'Access;
+
+ Current : Clock_Data_Access := First'Access;
pragma Atomic (Current);
-- The following signature is to detect change on the base clock data
@@ -177,9 +177,11 @@ package body System.OS_Primitives is
epoch_1970 : constant := 16#19D_B1DE_D53E_8000#; -- win32 UTC epoch
system_time_ns : constant := 100; -- 100 ns per tick
Sec_Unit : constant := 10#1#E9;
- Max_Elapsed : constant LARGE_INTEGER :=
+
+ Max_Elapsed : constant LARGE_INTEGER :=
LARGE_INTEGER (Tick_Frequency / 100_000);
-- Look for a precision of 0.01 ms
+
Sig : constant Signature_Type := Signature;
Loc_Ticks, Ctrl_Ticks : aliased LARGE_INTEGER;
@@ -269,13 +271,14 @@ package body System.OS_Primitives is
end if;
end loop;
- New_Data.Base_Clock := Duration
- (Long_Long_Float ((New_Data.Base_Time - epoch_1970) * system_time_ns) /
- Long_Long_Float (Sec_Unit));
+ New_Data.Base_Clock :=
+ Duration
+ (Long_Long_Float
+ ((New_Data.Base_Time - epoch_1970) * system_time_ns) /
+ Long_Long_Float (Sec_Unit));
-- At this point all the base values have been set into the new data
- -- record. We just change the pointer (atomic operation) to this new
- -- values.
+ -- record. Change the pointer (atomic operation) to these new values.
Current := New_Data;
Data := New_Data.all;
diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads
index fcdf2ad87f7..480c5a573a4 100644
--- a/gcc/ada/s-rident.ads
+++ b/gcc/ada/s-rident.ads
@@ -65,7 +65,7 @@
-- The latest implementation avoids both this problem by using a named
-- scheme for recording restrictions, rather than a positional scheme which
-- fails completely if restrictions are added or subtracted. Now the worst
--- that happens at bind time in incosistent builds is that unrecognized
+-- that happens at bind time in inconsistent builds is that unrecognized
-- restrictions are ignored, and the consistency checking for restrictions
-- might be incomplete, which is no big deal.
@@ -88,69 +88,71 @@ package System.Rident is
-- binder will check that every unit either has the restriction set, or
-- does not violate the restriction.
- (Simple_Barriers, -- GNAT (Ravenscar)
- No_Abort_Statements, -- (RM D.7(5), H.4(3))
- No_Access_Subprograms, -- (RM H.4(17))
- No_Allocators, -- (RM H.4(7))
- No_Allocators_After_Elaboration, -- Ada 2012 (RM D.7(19.1/2))
- No_Anonymous_Allocators, -- Ada 2012 (RM H.4(8/1))
- No_Asynchronous_Control, -- (RM J.13(3/2)
- No_Calendar, -- GNAT
- No_Default_Stream_Attributes, -- Ada 2012 (RM 13.12.1(4/2))
- No_Delay, -- (RM H.4(21))
- No_Direct_Boolean_Operators, -- GNAT
- No_Dispatch, -- (RM H.4(19))
- No_Dispatching_Calls, -- GNAT
- No_Dynamic_Attachment, -- GNAT
- No_Dynamic_Priorities, -- (RM D.9(9))
- No_Enumeration_Maps, -- GNAT
- No_Entry_Calls_In_Elaboration_Code, -- GNAT
- No_Entry_Queue, -- GNAT (Ravenscar)
- No_Exception_Handlers, -- GNAT
- No_Exception_Propagation, -- GNAT
- No_Exception_Registration, -- GNAT
- No_Exceptions, -- (RM H.4(12))
- No_Finalization, -- GNAT
- No_Fixed_Point, -- (RM H.4(15))
- No_Floating_Point, -- (RM H.4(14))
- No_IO, -- (RM H.4(20))
- No_Implicit_Conditionals, -- GNAT
- No_Implicit_Dynamic_Code, -- GNAT
- No_Implicit_Heap_Allocations, -- (RM D.8(8), H.4(3))
- No_Implicit_Loops, -- GNAT
- No_Initialize_Scalars, -- GNAT
- No_Local_Allocators, -- (RM H.4(8))
- No_Local_Timing_Events, -- (RM D.7(10.2/2))
- No_Local_Protected_Objects, -- GNAT
- No_Nested_Finalization, -- (RM D.7(4))
- No_Protected_Type_Allocators, -- GNAT
- No_Protected_Types, -- (RM H.4(5))
- No_Recursion, -- (RM H.4(22))
- No_Reentrancy, -- (RM H.4(23))
- No_Relative_Delay, -- GNAT (Ravenscar)
- No_Requeue_Statements, -- GNAT
- No_Secondary_Stack, -- GNAT
- No_Select_Statements, -- GNAT (Ravenscar)
- No_Specific_Termination_Handlers, -- (RM D.7(10.7/2))
- No_Standard_Storage_Pools, -- GNAT
- No_Stream_Optimizations, -- GNAT
- No_Streams, -- GNAT
- No_Task_Allocators, -- (RM D.7(7))
- No_Task_Attributes_Package, -- GNAT
- No_Task_Hierarchy, -- (RM D.7(3), H.4(3))
- No_Task_Termination, -- GNAT (Ravenscar)
- No_Tasking, -- GNAT
- No_Terminate_Alternatives, -- (RM D.7(6))
- No_Unchecked_Access, -- (RM H.4(18))
- No_Unchecked_Conversion, -- (RM J.13(4/2))
- No_Unchecked_Deallocation, -- (RM J.13(5/2))
- Static_Priorities, -- GNAT
- Static_Storage_Size, -- GNAT
+ (Simple_Barriers, -- Ada 2012 (D.7 (10.9/3))
+ No_Abort_Statements, -- (RM D.7(5), H.4(3))
+ No_Access_Parameter_Allocators, -- Ada 2012 (RM H.4 (8.3/3))
+ No_Access_Subprograms, -- (RM H.4(17))
+ No_Allocators, -- (RM H.4(7))
+ No_Anonymous_Allocators, -- Ada 2012 (RM H.4(8/1))
+ No_Asynchronous_Control, -- (RM J.13(3/2)
+ No_Calendar, -- GNAT
+ No_Coextensions, -- Ada 2012 (RM H.4(8.2/3))
+ No_Default_Stream_Attributes, -- Ada 2012 (RM 13.12.1(4/2))
+ No_Delay, -- (RM H.4(21))
+ No_Direct_Boolean_Operators, -- GNAT
+ No_Dispatch, -- (RM H.4(19))
+ No_Dispatching_Calls, -- GNAT
+ No_Dynamic_Attachment, -- Ada 2012 (RM E.7(10/3))
+ No_Dynamic_Priorities, -- (RM D.9(9))
+ No_Enumeration_Maps, -- GNAT
+ No_Entry_Calls_In_Elaboration_Code, -- GNAT
+ No_Entry_Queue, -- GNAT (Ravenscar)
+ No_Exception_Handlers, -- GNAT
+ No_Exception_Propagation, -- GNAT
+ No_Exception_Registration, -- GNAT
+ No_Exceptions, -- (RM H.4(12))
+ No_Finalization, -- GNAT
+ No_Fixed_Point, -- (RM H.4(15))
+ No_Floating_Point, -- (RM H.4(14))
+ No_IO, -- (RM H.4(20))
+ No_Implicit_Conditionals, -- GNAT
+ No_Implicit_Dynamic_Code, -- GNAT
+ No_Implicit_Heap_Allocations, -- (RM D.8(8), H.4(3))
+ No_Implicit_Loops, -- GNAT
+ No_Initialize_Scalars, -- GNAT
+ No_Local_Allocators, -- (RM H.4(8))
+ No_Local_Timing_Events, -- (RM D.7(10.2/2))
+ No_Local_Protected_Objects, -- Ada 2012 (D.7(10/1.3))
+ No_Nested_Finalization, -- (RM D.7(4))
+ No_Protected_Type_Allocators, -- Ada 2012 (D.7 (10.3/2))
+ No_Protected_Types, -- (RM H.4(5))
+ No_Recursion, -- (RM H.4(22))
+ No_Reentrancy, -- (RM H.4(23))
+ No_Relative_Delay, -- Ada 2012 (D.7 (10.5/3))
+ No_Requeue_Statements, -- Ada 2012 (D.7 (10.6/3))
+ No_Secondary_Stack, -- GNAT
+ No_Select_Statements, -- Ada 2012 (D.7 (10.7/4))
+ No_Specific_Termination_Handlers, -- (RM D.7(10.7/2))
+ No_Standard_Allocators_After_Elaboration, -- Ada 2012 (RM D.7(19.1/2))
+ No_Standard_Storage_Pools, -- GNAT
+ No_Stream_Optimizations, -- GNAT
+ No_Streams, -- GNAT
+ No_Task_Allocators, -- (RM D.7(7))
+ No_Task_Attributes_Package, -- GNAT
+ No_Task_Hierarchy, -- (RM D.7(3), H.4(3))
+ No_Task_Termination, -- GNAT (Ravenscar)
+ No_Tasking, -- GNAT
+ No_Terminate_Alternatives, -- (RM D.7(6))
+ No_Unchecked_Access, -- (RM H.4(18))
+ No_Unchecked_Conversion, -- (RM J.13(4/2))
+ No_Unchecked_Deallocation, -- (RM J.13(5/2))
+ Static_Priorities, -- GNAT
+ Static_Storage_Size, -- GNAT
-- The following require consistency checking with special rules. See
-- individual routines in unit Bcheck for details of what is required.
- No_Default_Initialization, -- GNAT
+ No_Default_Initialization, -- GNAT
-- The following cases do not require consistency checking and if used
-- as a configuration pragma within a specific unit, apply only to that
@@ -162,30 +164,34 @@ package System.Rident is
-- it is sticky, in that if it is found anywhere within any of these
-- units, it applies to all units in this extended main source.
- Immediate_Reclamation, -- (RM H.4(10))
- No_Implementation_Aspect_Specifications, -- Ada 2012 AI-241
- No_Implementation_Attributes, -- Ada 2005 AI-257
- No_Implementation_Identifiers, -- Ada 2012 AI-246
- No_Implementation_Pragmas, -- Ada 2005 AI-257
- No_Implementation_Restrictions, -- GNAT
- No_Implementation_Units, -- Ada 2012 AI-242
- No_Implicit_Aliasing, -- GNAT
- No_Elaboration_Code, -- GNAT
- No_Obsolescent_Features, -- Ada 2005 AI-368
- No_Wide_Characters, -- GNAT
- SPARK, -- GNAT
+ Immediate_Reclamation, -- (RM H.4(10))
+ No_Implementation_Aspect_Specifications, -- Ada 2012 AI-241
+ No_Implementation_Attributes, -- Ada 2005 AI-257
+ No_Implementation_Identifiers, -- Ada 2012 AI-246
+ No_Implementation_Pragmas, -- Ada 2005 AI-257
+ No_Implementation_Restrictions, -- GNAT
+ No_Implementation_Units, -- Ada 2012 AI-242
+ No_Implicit_Aliasing, -- GNAT
+ No_Elaboration_Code, -- GNAT
+ No_Obsolescent_Features, -- Ada 2005 AI-368
+ No_Wide_Characters, -- GNAT
+ SPARK, -- GNAT
-- The following cases require a parameter value
+ No_Specification_Of_Aspect, -- 2012 (RM 13.12.1 (6.1/3))
+ No_Use_Of_Attribute, -- 2012 (RM 13.12.1 (6.2/3))
+ No_Use_Of_Pragma, -- 2012 (RM 13.12.1 (6.3/3))
+
-- The following entries are fully checked at compile/bind time, which
-- means that the compiler can in general tell the minimum value which
-- could be used with a restrictions pragma. The binder can deduce the
-- appropriate minimum value for the partition by taking the maximum
-- value required by any unit.
- Max_Protected_Entries, -- (RM D.7(14))
- Max_Select_Alternatives, -- (RM D.7(12))
- Max_Task_Entries, -- (RM D.7(13), H.4(3))
+ Max_Protected_Entries, -- (RM D.7(14))
+ Max_Select_Alternatives, -- (RM D.7(12))
+ Max_Task_Entries, -- (RM D.7(13), H.4(3))
-- The following entries are also fully checked at compile/bind time,
-- and the compiler can also at least in some cases tell the minimum
@@ -193,19 +199,19 @@ package System.Rident is
-- is that the contributions are additive, so the binder deduces this
-- value by adding the unit contributions.
- Max_Tasks, -- (RM D.7(19), H.4(3))
+ Max_Tasks, -- (RM D.7(19), H.4(3))
-- The following entries are checked at compile time only for zero/
-- nonzero entries. This means that the compiler can tell at compile
-- time if a restriction value of zero is (would be) violated, but that
-- the compiler cannot distinguish between different non-zero values.
- Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3))
- Max_Entry_Queue_Length, -- GNAT
+ Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3))
+ Max_Entry_Queue_Length, -- Ada 2012 (RM D.7 (19.1/2))
-- The remaining entries are not checked at compile/bind time
- Max_Storage_At_Blocking, -- (RM D.7(17))
+ Max_Storage_At_Blocking, -- (RM D.7(17))
Not_A_Restriction_Id);
@@ -242,7 +248,7 @@ package System.Rident is
subtype All_Parameter_Restrictions is
Restriction_Id range
- Max_Protected_Entries .. Max_Storage_At_Blocking;
+ No_Specification_Of_Aspect .. Max_Storage_At_Blocking;
-- All restrictions that take a parameter
subtype Checked_Parameter_Restrictions is
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index 95b69428704..d3ec497188d 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -470,6 +470,9 @@ package body Sem is
when N_Quantified_Expression =>
Analyze_Quantified_Expression (N);
+ when N_Raise_Expression =>
+ Analyze_Raise_Expression (N);
+
when N_Raise_Statement =>
Analyze_Raise_Statement (N);
@@ -1308,6 +1311,7 @@ package body Sem is
S_In_Spec_Expr : constant Boolean := In_Spec_Expression;
S_Inside_A_Generic : constant Boolean := Inside_A_Generic;
S_Outer_Gen_Scope : constant Entity_Id := Outer_Generic_Scope;
+ S_Style_Check : constant Boolean := Style_Check;
Generic_Main : constant Boolean :=
Nkind (Unit (Cunit (Main_Unit)))
@@ -1315,6 +1319,10 @@ package body Sem is
-- If the main unit is generic, every compiled unit, including its
-- context, is compiled with expansion disabled.
+ Ext_Main_Source_Unit : constant Boolean :=
+ In_Extended_Main_Source_Unit (Comp_Unit);
+ -- Determine if unit is in extended main source unit
+
Save_Config_Switches : Config_Switches_Type;
-- Variable used to save values of config switches while we analyze the
-- new unit, to be restored on exit for proper recursive behavior.
@@ -1383,9 +1391,6 @@ package body Sem is
-- Sequential_IO) as this would prevent pragma Extend_System from being
-- taken into account, for example when Text_IO is renaming DEC.Text_IO.
- -- Cleaner might be to do the kludge at the point of excluding the
- -- pragma (do not exclude for renamings ???)
-
if Is_Predefined_File_Name
(Unit_File_Name (Current_Sem_Unit), Renamings_Included => False)
then
@@ -1420,12 +1425,28 @@ package body Sem is
-- For unit in main extended unit, we reset the configuration values
-- for the non-partition-wide restrictions. For other units reset them.
- if In_Extended_Main_Source_Unit (Comp_Unit) then
+ if Ext_Main_Source_Unit then
Restore_Config_Cunit_Boolean_Restrictions;
else
Reset_Cunit_Boolean_Restrictions;
end if;
+ -- Turn off style checks for unit that is not in the extended main
+ -- source unit. This improves processing efficiency for such units
+ -- (for which we don't want style checks anyway, and where they will
+ -- get suppressed), and is definitely needed to stop some style checks
+ -- from invading the run-time units (e.g. overriding checks).
+
+ if not Ext_Main_Source_Unit then
+ Style_Check := False;
+
+ -- If this is part of the extended main source unit, set style check
+ -- mode to match the style check mode of the main source unit itself.
+
+ else
+ Style_Check := Style_Check_Main;
+ end if;
+
-- Only do analysis of unit that has not already been analyzed
if not Analyzed (Comp_Unit) then
@@ -1479,6 +1500,7 @@ package body Sem is
In_Spec_Expression := S_In_Spec_Expr;
Inside_A_Generic := S_Inside_A_Generic;
Outer_Generic_Scope := S_Outer_Gen_Scope;
+ Style_Check := S_Style_Check;
Restore_Opt_Config_Switches (Save_Config_Switches);
diff --git a/gcc/ada/sem.ads b/gcc/ada/sem.ads
index 31fc37b95af..545aadc6a53 100644
--- a/gcc/ada/sem.ads
+++ b/gcc/ada/sem.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -177,7 +177,7 @@
-- repeatedly (for instance in the above aggregate "new Thing (Function_Call)"
-- needs to be called 100 times.)
--- The reason why this mechanism does not work is that, the expanded code for
+-- The reason why this mechanism does not work is that the expanded code for
-- the children is typically inserted above the parent and thus when the
-- father gets expanded no re-evaluation takes place. For instance in the case
-- of aggregates if "new Thing (Function_Call)" is expanded before of the
@@ -429,11 +429,11 @@ package Sem is
-- compilation unit. These sections are separated by distinct occurrences
-- of package Standard. The currently active section of the scope stack
-- goes from the current scope to the first (innermost) occurrence of
- -- Standard, which is additionally marked with the flag
- -- Is_Active_Stack_Base. The basic visibility routine (Find_Direct_Name, in
- -- Sem_Ch8) uses this contiguous section of the scope stack to determine
- -- whether a given entity is or is not visible at a point. In_Open_Scopes
- -- only examines the currently active section of the scope stack.
+ -- Standard, which is additionally marked with flag Is_Active_Stack_Base.
+ -- The basic visibility routine (Find_Direct_Name, in Sem_Ch8) uses this
+ -- contiguous section of the scope stack to determine whether a given
+ -- entity is or is not visible at a point. In_Open_Scopes only examines
+ -- the currently active section of the scope stack.
-- Similar complications arise when processing child instances. These
-- must be compiled in the context of parent instances, and therefore the
@@ -464,7 +464,12 @@ package Sem is
-- Save contents of Local_Suppress_Stack on entry to restore on exit
Save_Check_Policy_List : Node_Id;
- -- Save contents of Check_Policy_List on entry to restore on exit
+ -- Save contents of Check_Policy_List on entry to restore on exit. The
+ -- Check_Policy pragmas are chained with Check_Policy_List pointing to
+ -- the most recent entry. This list is searched starting here, so that
+ -- the search finds the most recent appicable entry. When we restore
+ -- Check_Policy_List on exit from the scope, the effect is to remove
+ -- all entries set in the scope being exited.
Save_Default_Storage_Pool : Node_Id;
-- Save contents of Default_Storage_Pool on entry to restore on exit
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index c2a298bbdf8..42615c1c091 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -175,7 +175,7 @@ package body Sem_Attr is
-- Note that the only required action of this procedure is to catch the
-- static expression cases as described in the RM. Folding of other cases
-- is done where convenient, but some additional non-static folding is in
- -- N_Expand_Attribute_Reference in cases where this is more convenient.
+ -- Expand_N_Attribute_Reference in cases where this is more convenient.
function Is_Anonymous_Tagged_Base
(Anon : Entity_Id;
@@ -602,10 +602,13 @@ package body Sem_Attr is
if Has_Pragma_Inline_Always (Entity (P)) then
Error_Attr_P
("prefix of % attribute cannot be Inline_Always subprogram");
- end if;
- if Aname = Name_Unchecked_Access then
+ elsif Aname = Name_Unchecked_Access then
Error_Attr ("attribute% cannot be applied to a subprogram", P);
+
+ elsif Is_Ghost_Function (Entity (P)) then
+ Error_Attr_P
+ ("prefix of % attribute cannot be a ghost function");
end if;
-- Issue an error if the prefix denotes an eliminated subprogram
@@ -651,10 +654,11 @@ package body Sem_Attr is
Kill_Current_Values;
end if;
- -- Treat as call for elaboration purposes and we are all done.
- -- Suppress this treatment under debug flag.
+ -- In the static elaboration model, treat the attribute reference
+ -- as a call for elaboration purposes. Suppress this treatment
+ -- under debug flag. In any case, we are all done.
- if not Debug_Flag_Dot_UU then
+ if not Dynamic_Elaboration_Checks and not Debug_Flag_Dot_UU then
Check_Elab_Call (N);
end if;
@@ -1221,11 +1225,9 @@ package body Sem_Attr is
-- the prefix of another attribute. Error is posted on parent.
if Nkind (Parent (N)) = N_Attribute_Reference
- and then (Attribute_Name (Parent (N)) = Name_Address
- or else
- Attribute_Name (Parent (N)) = Name_Code_Address
- or else
- Attribute_Name (Parent (N)) = Name_Access)
+ and then Nam_In (Attribute_Name (Parent (N)), Name_Address,
+ Name_Code_Address,
+ Name_Access)
then
Error_Msg_Name_1 := Attribute_Name (Parent (N));
Error_Msg_N ("illegal prefix for % attribute", Parent (N));
@@ -1742,9 +1744,13 @@ package body Sem_Attr is
-- AI05-0057: if restriction No_Default_Stream_Attributes is active,
-- it is illegal to use a predefined elementary type stream attribute
-- either by itself, or more importantly as part of the attribute
- -- subprogram for a composite type.
+ -- subprogram for a composite type. However, if the broader
+ -- restriction No_Streams is active, stream operations are not
+ -- generated, and there is no error.
- if Restriction_Active (No_Default_Stream_Attributes) then
+ if Restriction_Active (No_Default_Stream_Attributes)
+ and then not Restriction_Active (No_Streams)
+ then
declare
T : Entity_Id;
@@ -2196,9 +2202,7 @@ package body Sem_Attr is
-- a context check
if Ada_Version >= Ada_2005
- and then (Aname = Name_Count
- or else Aname = Name_Caller
- or else Aname = Name_AST_Entry)
+ and then Nam_In (Aname, Name_Count, Name_Caller, Name_AST_Entry)
then
declare
Count : Natural := 0;
@@ -2405,6 +2409,11 @@ package body Sem_Attr is
elsif not Comes_From_Source (N) then
null;
+ elsif Relaxed_RM_Semantics
+ and then Nkind (P) = N_Attribute_Reference
+ then
+ null;
+
else
Error_Attr ("invalid prefix for % attribute", P);
end if;
@@ -2832,9 +2841,7 @@ package body Sem_Attr is
Check_E0;
if Nkind (P) = N_Attribute_Reference
- and then (Attribute_Name (P) = Name_Elab_Body
- or else
- Attribute_Name (P) = Name_Elab_Spec)
+ and then Nam_In (Attribute_Name (P), Name_Elab_Body, Name_Elab_Spec)
then
null;
@@ -3689,13 +3696,7 @@ package body Sem_Attr is
-- Prevent the search from going too far
- elsif Nkind_In (Stmt, N_Entry_Body,
- N_Package_Body,
- N_Package_Declaration,
- N_Protected_Body,
- N_Subprogram_Body,
- N_Task_Body)
- then
+ elsif Is_Body_Or_Package_Declaration (Stmt) then
exit;
end if;
@@ -3811,11 +3812,10 @@ package body Sem_Attr is
if Nkind (Original_Node (Stmt)) = N_Pragma
and then
- (Pragma_Name (Original_Node (Stmt)) = Name_Assert
- or else
- Pragma_Name (Original_Node (Stmt)) = Name_Loop_Invariant
- or else
- Pragma_Name (Original_Node (Stmt)) = Name_Loop_Variant)
+ Nam_In (Pragma_Name (Original_Node (Stmt)),
+ Name_Assert,
+ Name_Loop_Invariant,
+ Name_Loop_Variant)
then
In_Loop_Assertion := True;
@@ -3840,13 +3840,7 @@ package body Sem_Attr is
-- Prevent the search from going too far
- elsif Nkind_In (Stmt, N_Entry_Body,
- N_Package_Body,
- N_Package_Declaration,
- N_Protected_Body,
- N_Subprogram_Body,
- N_Task_Body)
- then
+ elsif Is_Body_Or_Package_Declaration (Stmt) then
exit;
end if;
@@ -4257,7 +4251,7 @@ package body Sem_Attr is
if In_Spec_Expression then
- -- Check in postcondition or Ensures clause
+ -- Check in postcondition, Test_Case or Contract_Cases
Prag := N;
while not Nkind_In (Prag, N_Pragma,
@@ -4297,6 +4291,30 @@ package body Sem_Attr is
end if;
end;
+ elsif Get_Pragma_Id (Prag) = Pragma_Contract_Cases then
+ declare
+ Aggr : constant Node_Id :=
+ Expression (First (Pragma_Argument_Associations (Prag)));
+ Arg : Node_Id;
+
+ begin
+ Arg := N;
+ while Arg /= Prag and Parent (Parent (Arg)) /= Aggr loop
+ Arg := Parent (Arg);
+ end loop;
+
+ -- At this point, Parent (Arg) should be a component
+ -- association. Attribute Result is only allowed in
+ -- the expression part of this association.
+
+ if Nkind (Parent (Arg)) /= N_Component_Association
+ or else Arg /= Expression (Parent (Arg))
+ then
+ Error_Attr
+ ("% attribute misplaced inside contract cases", P);
+ end if;
+ end;
+
elsif Get_Pragma_Id (Prag) /= Pragma_Postcondition then
Error_Attr ("% attribute can only appear in postcondition", P);
end if;
@@ -4320,11 +4338,10 @@ package body Sem_Attr is
end if;
end if;
- -- Either the attribute reference is generated for a Requires
- -- clause, in which case no expressions follow, or it is a
- -- primary. In that case, if expressions follow, the attribute
- -- reference is an indexable object, so rewrite the node
- -- accordingly.
+ -- If the attribute reference is generated for a Requires clause,
+ -- then no expressions follow. Otherwise it is a primary, in which
+ -- case, if expressions follow, the attribute reference must be
+ -- an indexable object, so rewrite the node accordingly.
if Present (E1) then
Rewrite (N,
@@ -4649,7 +4666,7 @@ package body Sem_Attr is
Error_Attr;
end if;
- -- Check in postcondition or Ensures clause of function
+ -- Check in postcondition, Test_Case or Contract_Cases of function
Prag := N;
while not Nkind_In (Prag, N_Pragma,
@@ -4690,6 +4707,30 @@ package body Sem_Attr is
end if;
end;
+ elsif Get_Pragma_Id (Prag) = Pragma_Contract_Cases then
+ declare
+ Aggr : constant Node_Id :=
+ Expression (First (Pragma_Argument_Associations (Prag)));
+ Arg : Node_Id;
+
+ begin
+ Arg := N;
+ while Arg /= Prag and Parent (Parent (Arg)) /= Aggr loop
+ Arg := Parent (Arg);
+ end loop;
+
+ -- At this point, Parent (Arg) should be a component
+ -- association. Attribute Result is only allowed in
+ -- the expression part of this association.
+
+ if Nkind (Parent (Arg)) /= N_Component_Association
+ or else Arg /= Expression (Parent (Arg))
+ then
+ Error_Attr
+ ("% attribute misplaced inside contract cases", P);
+ end if;
+ end;
+
elsif Get_Pragma_Id (Prag) /= Pragma_Postcondition then
Error_Attr
("% attribute can only appear in postcondition of function",
@@ -5011,6 +5052,13 @@ package body Sem_Attr is
then
null;
+ -- Some other compilers allow dubious use of X'???'Size
+
+ elsif Relaxed_RM_Semantics
+ and then Nkind (P) = N_Attribute_Reference
+ then
+ null;
+
else
Error_Attr_P ("invalid prefix for % attribute");
end if;
@@ -9133,7 +9181,6 @@ package body Sem_Attr is
and then
(Ekind (Btyp) = E_Access_Subprogram_Type
or else Is_Local_Anonymous_Access (Btyp))
-
and then Subprogram_Access_Level (Entity (P)) >
Type_Access_Level (Btyp)
then
@@ -9180,15 +9227,12 @@ package body Sem_Attr is
-- when within an instance, because any violations will have
-- been caught by the compilation of the generic unit.
- -- Note that we relax this check in CodePeer mode for
- -- compatibility with legacy code, since CodePeer is an
- -- Ada source code analyzer, not a strict compiler.
- -- ??? Note that a better approach would be to have a
- -- separate switch to relax this rule, and enable this
- -- switch in CodePeer mode.
+ -- We relax this check in Relaxed_RM_Semantics mode for
+ -- compatibility with legacy code for use by Ada source
+ -- code analyzers (e.g. CodePeer).
elsif Attr_Id = Attribute_Access
- and then not CodePeer_Mode
+ and then not Relaxed_RM_Semantics
and then not In_Instance
and then Present (Enclosing_Generic_Unit (Entity (P)))
and then Present (Enclosing_Generic_Body (N))
@@ -9288,6 +9332,17 @@ package body Sem_Attr is
Resolve (Prefix (P));
Generate_Reference (Entity (Selector_Name (P)), P);
+ -- Implement check implied by 3.10.2 (18.1/2) : F.all'access is
+ -- statically illegal if F is an anonymous access to subprogram.
+
+ elsif Nkind (P) = N_Explicit_Dereference
+ and then Is_Entity_Name (Prefix (P))
+ and then Ekind (Etype (Entity (Prefix (P)))) =
+ E_Anonymous_Access_Subprogram_Type
+ then
+ Error_Msg_N ("anonymous access to subprogram "
+ & "has deeper accessibility than any master", P);
+
elsif Is_Overloaded (P) then
-- Use the designated type of the context to disambiguate
@@ -9527,9 +9582,9 @@ package body Sem_Attr is
-- in such a context.
if Attr_Id /= Attribute_Unchecked_Access
+ and then Ekind (Btyp) = E_General_Access_Type
and then
Object_Access_Level (P) > Deepest_Type_Access_Level (Btyp)
- and then Ekind (Btyp) = E_General_Access_Type
then
Accessibility_Message;
return;
@@ -10031,9 +10086,7 @@ package body Sem_Attr is
-- then this is only legal within a task or protected record.
when others =>
- if not Is_Entity_Name (P)
- or else not Is_Type (Entity (P))
- then
+ if not Is_Entity_Name (P) or else not Is_Type (Entity (P)) then
Resolve (P);
end if;
@@ -10041,9 +10094,7 @@ package body Sem_Attr is
-- 'Class) then this is only legal within a task or protected
-- record. What is this all about ???
- if Is_Entity_Name (N)
- and then Is_Type (Entity (N))
- then
+ if Is_Entity_Name (N) and then Is_Type (Entity (N)) then
if Is_Concurrent_Type (Entity (N))
and then In_Open_Scopes (Entity (P))
then
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
index 490048e9a7c..556156af08e 100644
--- a/gcc/ada/sem_aux.adb
+++ b/gcc/ada/sem_aux.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -467,8 +467,8 @@ package body Sem_Aux is
elsif Nkind (N) = N_Attribute_Definition_Clause
and then
(Chars (N) = Nam
- or else (Nam = Name_Priority
- and then Chars (N) = Name_Interrupt_Priority))
+ or else (Nam = Name_Priority
+ and then Chars (N) = Name_Interrupt_Priority))
then
if Check_Parents or else Entity (N) = E then
return N;
@@ -477,9 +477,9 @@ package body Sem_Aux is
elsif Nkind (N) = N_Aspect_Specification
and then
(Chars (Identifier (N)) = Nam
- or else (Nam = Name_Priority
- and then Chars (Identifier (N)) =
- Name_Interrupt_Priority))
+ or else
+ (Nam = Name_Priority
+ and then Chars (Identifier (N)) = Name_Interrupt_Priority))
then
if Check_Parents then
return N;
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb
index 432de5dc367..6f066fe917b 100644
--- a/gcc/ada/sem_case.adb
+++ b/gcc/ada/sem_case.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -114,6 +114,18 @@ package body Sem_Case is
Others_Present : Boolean;
Case_Node : Node_Id)
is
+ procedure Check_Against_Predicate
+ (Pred : in out Node_Id;
+ Choice : Choice_Bounds;
+ Prev_Lo : in out Uint;
+ Prev_Hi : in out Uint;
+ Error : in out Boolean);
+ -- Determine whether a choice covers legal values as defined by a static
+ -- predicate set. Pred is a static predicate range. Choice is the choice
+ -- to be examined. Prev_Lo and Prev_Hi are the bounds of the previous
+ -- choice that covered a predicate set. Error denotes whether the check
+ -- found an illegal intersection.
+
procedure Explain_Non_Static_Bound;
-- Called when we find a non-static bound, requiring the base type to
-- be covered. Provides where possible a helpful explanation of why the
@@ -123,102 +135,292 @@ package body Sem_Case is
-- Comparison routine for comparing Choice_Table entries. Use the lower
-- bound of each Choice as the key.
+ procedure Missing_Choice (Value1 : Node_Id; Value2 : Node_Id);
+ procedure Missing_Choice (Value1 : Node_Id; Value2 : Uint);
+ procedure Missing_Choice (Value1 : Uint; Value2 : Node_Id);
+ procedure Missing_Choice (Value1 : Uint; Value2 : Uint);
+ -- Issue an error message indicating that there are missing choices,
+ -- followed by the image of the missing choices themselves which lie
+ -- between Value1 and Value2 inclusive.
+
+ procedure Missing_Choices (Pred : Node_Id; Prev_Hi : Uint);
+ -- Emit an error message for each non-covered static predicate set.
+ -- Prev_Hi denotes the upper bound of the last choice that covered a
+ -- set.
+
procedure Move_Choice (From : Natural; To : Natural);
-- Move routine for sorting the Choice_Table
package Sorting is new GNAT.Heap_Sort_G (Move_Choice, Lt_Choice);
- procedure Issue_Msg (Value1 : Node_Id; Value2 : Node_Id);
- procedure Issue_Msg (Value1 : Node_Id; Value2 : Uint);
- procedure Issue_Msg (Value1 : Uint; Value2 : Node_Id);
- procedure Issue_Msg (Value1 : Uint; Value2 : Uint);
- -- Issue an error message indicating that there are missing choices,
- -- followed by the image of the missing choices themselves which lie
- -- between Value1 and Value2 inclusive.
+ -----------------------------
+ -- Check_Against_Predicate --
+ -----------------------------
- ---------------
- -- Issue_Msg --
- ---------------
+ procedure Check_Against_Predicate
+ (Pred : in out Node_Id;
+ Choice : Choice_Bounds;
+ Prev_Lo : in out Uint;
+ Prev_Hi : in out Uint;
+ Error : in out Boolean)
+ is
+ procedure Illegal_Range
+ (Loc : Source_Ptr;
+ Lo : Uint;
+ Hi : Uint);
+ -- Emit an error message regarding a choice that clashes with the
+ -- legal static predicate sets. Loc is the location of the choice
+ -- that introduced the illegal range. Lo .. Hi is the range.
+
+ function Inside_Range
+ (Lo : Uint;
+ Hi : Uint;
+ Val : Uint) return Boolean;
+ -- Determine whether position Val within a discrete type is within
+ -- the range Lo .. Hi inclusive.
+
+ -------------------
+ -- Illegal_Range --
+ -------------------
+
+ procedure Illegal_Range
+ (Loc : Source_Ptr;
+ Lo : Uint;
+ Hi : Uint)
+ is
+ begin
+ Error_Msg_Name_1 := Chars (Bounds_Type);
- procedure Issue_Msg (Value1 : Node_Id; Value2 : Node_Id) is
- begin
- Issue_Msg (Expr_Value (Value1), Expr_Value (Value2));
- end Issue_Msg;
+ -- Single value
- procedure Issue_Msg (Value1 : Node_Id; Value2 : Uint) is
- begin
- Issue_Msg (Expr_Value (Value1), Value2);
- end Issue_Msg;
+ if Lo = Hi then
+ if Is_Integer_Type (Bounds_Type) then
+ Error_Msg_Uint_1 := Lo;
+ Error_Msg ("static predicate on % excludes value ^!", Loc);
+ else
+ Error_Msg_Name_2 := Choice_Image (Lo, Bounds_Type);
+ Error_Msg ("static predicate on % excludes value %!", Loc);
+ end if;
- procedure Issue_Msg (Value1 : Uint; Value2 : Node_Id) is
- begin
- Issue_Msg (Value1, Expr_Value (Value2));
- end Issue_Msg;
+ -- Range
- procedure Issue_Msg (Value1 : Uint; Value2 : Uint) is
- Msg_Sloc : constant Source_Ptr := Sloc (Case_Node);
+ else
+ if Is_Integer_Type (Bounds_Type) then
+ Error_Msg_Uint_1 := Lo;
+ Error_Msg_Uint_2 := Hi;
+ Error_Msg
+ ("static predicate on % excludes range ^ .. ^!", Loc);
+ else
+ Error_Msg_Name_2 := Choice_Image (Lo, Bounds_Type);
+ Error_Msg_Name_3 := Choice_Image (Hi, Bounds_Type);
+ Error_Msg
+ ("static predicate on % excludes range % .. %!", Loc);
+ end if;
+ end if;
+ end Illegal_Range;
+
+ ------------------
+ -- Inside_Range --
+ ------------------
+
+ function Inside_Range
+ (Lo : Uint;
+ Hi : Uint;
+ Val : Uint) return Boolean
+ is
+ begin
+ return
+ Val = Lo or else Val = Hi or else (Lo < Val and then Val < Hi);
+ end Inside_Range;
+
+ -- Local variables
+
+ Choice_Hi : constant Uint := Expr_Value (Choice.Hi);
+ Choice_Lo : constant Uint := Expr_Value (Choice.Lo);
+ Loc : Source_Ptr;
+ Next_Hi : Uint;
+ Next_Lo : Uint;
+ Pred_Hi : Uint;
+ Pred_Lo : Uint;
+
+ -- Start of processing for Check_Against_Predicate
begin
- -- AI05-0188 : within an instance the non-others choices do not
- -- have to belong to the actual subtype.
+ -- Find the proper error message location
- if Ada_Version >= Ada_2012 and then In_Instance then
- return;
+ if Present (Choice.Node) then
+ Loc := Sloc (Choice.Node);
+ else
+ Loc := Sloc (Case_Node);
end if;
- -- In some situations, we call this with a null range, and
- -- obviously we don't want to complain in this case!
+ if Present (Pred) then
+ Pred_Lo := Expr_Value (Low_Bound (Pred));
+ Pred_Hi := Expr_Value (High_Bound (Pred));
+
+ -- Previous choices managed to satisfy all static predicate sets
+
+ else
+ Illegal_Range (Loc, Choice_Lo, Choice_Hi);
+ Error := True;
- if Value1 > Value2 then
return;
end if;
- -- Case of only one value that is missing
+ -- Step 1: Detect duplicate choices
- if Value1 = Value2 then
- if Is_Integer_Type (Bounds_Type) then
- Error_Msg_Uint_1 := Value1;
- Error_Msg ("missing case value: ^!", Msg_Sloc);
+ if Inside_Range (Choice_Lo, Choice_Hi, Prev_Lo)
+ or else Inside_Range (Choice_Lo, Choice_Hi, Prev_Hi)
+ then
+ Error_Msg ("duplication of choice value", Loc);
+ Error := True;
+
+ -- Step 2: Detect full coverage
+
+ -- Choice_Lo Choice_Hi
+ -- +============+
+ -- Pred_Lo Pred_Hi
+
+ elsif Choice_Lo = Pred_Lo and then Choice_Hi = Pred_Hi then
+ Prev_Lo := Choice_Lo;
+ Prev_Hi := Choice_Hi;
+ Next (Pred);
+
+ -- Step 3: Detect all cases where a choice mentions values that are
+ -- not part of the static predicate sets.
+
+ -- Choice_Lo Choice_Hi Pred_Lo Pred_Hi
+ -- +-----------+ . . . . . +=========+
+ -- ^ illegal ^
+
+ elsif Choice_Lo < Pred_Lo and then Choice_Hi < Pred_Lo then
+ Illegal_Range (Loc, Choice_Lo, Choice_Hi);
+ Error := True;
+
+ -- Choice_Lo Pred_Lo Choice_Hi Pred_Hi
+ -- +-----------+=========+===========+
+ -- ^ illegal ^
+
+ elsif Choice_Lo < Pred_Lo
+ and then Inside_Range (Pred_Lo, Pred_Hi, Choice_Hi)
+ then
+ Illegal_Range (Loc, Choice_Lo, Pred_Lo - 1);
+ Error := True;
+
+ -- Pred_Lo Pred_Hi Choice_Lo Choice_Hi
+ -- +=========+ . . . . +-----------+
+ -- ^ illegal ^
+
+ elsif Pred_Lo < Choice_Lo and then Pred_Hi < Choice_Lo then
+ Missing_Choice (Pred_Lo, Pred_Hi);
+ Error := True;
+
+ -- There may be several static predicate sets between the current
+ -- one and the choice. Inspect the next static predicate set.
+
+ Next (Pred);
+ Check_Against_Predicate
+ (Pred => Pred,
+ Choice => Choice,
+ Prev_Lo => Prev_Lo,
+ Prev_Hi => Prev_Hi,
+ Error => Error);
+
+ -- Pred_Lo Choice_Lo Pred_Hi Choice_Hi
+ -- +=========+===========+-----------+
+ -- ^ illegal ^
+
+ elsif Pred_Hi < Choice_Hi
+ and then Inside_Range (Pred_Lo, Pred_Hi, Choice_Lo)
+ then
+ Next (Pred);
+
+ -- The choice may fall in a static predicate set. If this is the
+ -- case, avoid mentioning legal values in the error message.
+
+ if Present (Pred) then
+ Next_Lo := Expr_Value (Low_Bound (Pred));
+ Next_Hi := Expr_Value (High_Bound (Pred));
+
+ -- The next static predicate set is to the right of the choice
+
+ if Choice_Hi < Next_Lo and then Choice_Hi < Next_Hi then
+ Illegal_Range (Loc, Pred_Hi + 1, Choice_Hi);
+ else
+ Illegal_Range (Loc, Pred_Hi + 1, Next_Lo - 1);
+ end if;
else
- Error_Msg_Name_1 := Choice_Image (Value1, Bounds_Type);
- Error_Msg ("missing case value: %!", Msg_Sloc);
+ Illegal_Range (Loc, Pred_Hi + 1, Choice_Hi);
end if;
- -- More than one choice value, so print range of values
+ Error := True;
+
+ -- Choice_Lo Pred_Lo Pred_Hi Choice_Hi
+ -- +-----------+=========+-----------+
+ -- ^ illegal ^ ^ illegal ^
+
+ -- Emit an error on the low gap, disregard the upper gap
+
+ elsif Choice_Lo < Pred_Lo and then Pred_Hi < Choice_Hi then
+ Illegal_Range (Loc, Choice_Lo, Pred_Lo - 1);
+ Error := True;
+
+ -- Step 4: Detect all cases of partial or missing coverage
+
+ -- Pred_Lo Choice_Lo Choice_Hi Pred_Hi
+ -- +=========+==========+===========+
+ -- ^ gap ^ ^ gap ^
else
- if Is_Integer_Type (Bounds_Type) then
- Error_Msg_Uint_1 := Value1;
- Error_Msg_Uint_2 := Value2;
- Error_Msg ("missing case values: ^ .. ^!", Msg_Sloc);
- else
- Error_Msg_Name_1 := Choice_Image (Value1, Bounds_Type);
- Error_Msg_Name_2 := Choice_Image (Value2, Bounds_Type);
- Error_Msg ("missing case values: % .. %!", Msg_Sloc);
- end if;
- end if;
- end Issue_Msg;
+ -- An "others" choice covers all gaps
- ---------------
- -- Lt_Choice --
- ---------------
+ if Others_Present then
+ Prev_Lo := Choice_Lo;
+ Prev_Hi := Choice_Hi;
+ Next (Pred);
- function Lt_Choice (C1, C2 : Natural) return Boolean is
- begin
- return
- Expr_Value (Choice_Table (Nat (C1)).Lo)
- <
- Expr_Value (Choice_Table (Nat (C2)).Lo);
- end Lt_Choice;
+ -- Choice_Lo Choice_Hi Pred_Hi
+ -- +===========+===========+
+ -- Pred_Lo ^ gap ^
- -----------------
- -- Move_Choice --
- -----------------
+ -- The upper gap may be covered by a subsequent choice
- procedure Move_Choice (From : Natural; To : Natural) is
- begin
- Choice_Table (Nat (To)) := Choice_Table (Nat (From));
- end Move_Choice;
+ elsif Pred_Lo = Choice_Lo then
+ Prev_Lo := Choice_Lo;
+ Prev_Hi := Choice_Hi;
+
+ -- Pred_Lo Prev_Hi Choice_Lo Choice_Hi Pred_Hi
+ -- +===========+=========+===========+===========+
+ -- ^ covered ^ ^ gap ^
+
+ else pragma Assert (Pred_Lo < Choice_Lo);
+
+ -- A previous choice covered the gap up to the current choice
+
+ if Prev_Hi = Choice_Lo - 1 then
+ Prev_Lo := Choice_Lo;
+ Prev_Hi := Choice_Hi;
+
+ if Choice_Hi = Pred_Hi then
+ Next (Pred);
+ end if;
+
+ -- The previous choice did not intersect with the current
+ -- static predicate set.
+
+ elsif Prev_Hi < Pred_Lo then
+ Missing_Choice (Pred_Lo, Choice_Lo - 1);
+ Error := True;
+
+ -- The previous choice covered part of the static predicate set
+
+ else
+ Missing_Choice (Prev_Hi, Choice_Lo - 1);
+ Error := True;
+ end if;
+ end if;
+ end if;
+ end Check_Against_Predicate;
------------------------------
-- Explain_Non_Static_Bound --
@@ -236,16 +438,16 @@ package body Sem_Case is
if Bounds_Type /= Subtyp then
- -- If the case is a variant part, the expression is given by
- -- the discriminant itself, and the bounds are the culprits.
+ -- If the case is a variant part, the expression is given by the
+ -- discriminant itself, and the bounds are the culprits.
if Nkind (Case_Node) = N_Variant_Part then
Error_Msg_NE
("bounds of & are not static," &
" alternatives must cover base type", Expr, Expr);
- -- If this is a case statement, the expression may be
- -- non-static or else the subtype may be at fault.
+ -- If this is a case statement, the expression may be non-static
+ -- or else the subtype may be at fault.
elsif Is_Entity_Name (Expr) then
Error_Msg_NE
@@ -269,30 +471,150 @@ package body Sem_Case is
end if;
end Explain_Non_Static_Bound;
- -- Variables local to Check_Choices
+ ---------------
+ -- Lt_Choice --
+ ---------------
+
+ function Lt_Choice (C1, C2 : Natural) return Boolean is
+ begin
+ return
+ Expr_Value (Choice_Table (Nat (C1)).Lo)
+ <
+ Expr_Value (Choice_Table (Nat (C2)).Lo);
+ end Lt_Choice;
+
+ --------------------
+ -- Missing_Choice --
+ --------------------
- Choice : Node_Id;
- Bounds_Lo : constant Node_Id := Type_Low_Bound (Bounds_Type);
- Bounds_Hi : constant Node_Id := Type_High_Bound (Bounds_Type);
+ procedure Missing_Choice (Value1 : Node_Id; Value2 : Node_Id) is
+ begin
+ Missing_Choice (Expr_Value (Value1), Expr_Value (Value2));
+ end Missing_Choice;
- Prev_Choice : Node_Id;
+ procedure Missing_Choice (Value1 : Node_Id; Value2 : Uint) is
+ begin
+ Missing_Choice (Expr_Value (Value1), Value2);
+ end Missing_Choice;
+
+ procedure Missing_Choice (Value1 : Uint; Value2 : Node_Id) is
+ begin
+ Missing_Choice (Value1, Expr_Value (Value2));
+ end Missing_Choice;
+
+ procedure Missing_Choice (Value1 : Uint; Value2 : Uint) is
+ Msg_Sloc : constant Source_Ptr := Sloc (Case_Node);
+
+ begin
+ -- AI05-0188 : within an instance the non-others choices do not have
+ -- to belong to the actual subtype.
+
+ if Ada_Version >= Ada_2012 and then In_Instance then
+ return;
+
+ -- In some situations, we call this with a null range, and obviously
+ -- we don't want to complain in this case.
+
+ elsif Value1 > Value2 then
+ return;
+ end if;
+
+ -- Case of only one value that is missing
+
+ if Value1 = Value2 then
+ if Is_Integer_Type (Bounds_Type) then
+ Error_Msg_Uint_1 := Value1;
+ Error_Msg ("missing case value: ^!", Msg_Sloc);
+ else
+ Error_Msg_Name_1 := Choice_Image (Value1, Bounds_Type);
+ Error_Msg ("missing case value: %!", Msg_Sloc);
+ end if;
+
+ -- More than one choice value, so print range of values
+
+ else
+ if Is_Integer_Type (Bounds_Type) then
+ Error_Msg_Uint_1 := Value1;
+ Error_Msg_Uint_2 := Value2;
+ Error_Msg ("missing case values: ^ .. ^!", Msg_Sloc);
+ else
+ Error_Msg_Name_1 := Choice_Image (Value1, Bounds_Type);
+ Error_Msg_Name_2 := Choice_Image (Value2, Bounds_Type);
+ Error_Msg ("missing case values: % .. %!", Msg_Sloc);
+ end if;
+ end if;
+ end Missing_Choice;
+
+ ---------------------
+ -- Missing_Choices --
+ ---------------------
- Hi : Uint;
- Lo : Uint;
- Prev_Hi : Uint;
+ procedure Missing_Choices (Pred : Node_Id; Prev_Hi : Uint) is
+ Hi : Uint;
+ Lo : Uint;
+ Set : Node_Id;
+
+ begin
+ Set := Pred;
+ while Present (Set) loop
+ Lo := Expr_Value (Low_Bound (Set));
+ Hi := Expr_Value (High_Bound (Set));
+
+ -- A choice covered part of a static predicate set
+
+ if Lo <= Prev_Hi and then Prev_Hi < Hi then
+ Missing_Choice (Prev_Hi + 1, Hi);
+
+ else
+ Missing_Choice (Lo, Hi);
+ end if;
+
+ Next (Set);
+ end loop;
+ end Missing_Choices;
+
+ -----------------
+ -- Move_Choice --
+ -----------------
+
+ procedure Move_Choice (From : Natural; To : Natural) is
+ begin
+ Choice_Table (Nat (To)) := Choice_Table (Nat (From));
+ end Move_Choice;
+
+ -- Local variables
+
+ Bounds_Hi : constant Node_Id := Type_High_Bound (Bounds_Type);
+ Bounds_Lo : constant Node_Id := Type_Low_Bound (Bounds_Type);
+ Has_Predicate : constant Boolean :=
+ Is_Static_Subtype (Bounds_Type)
+ and then Present (Static_Predicate (Bounds_Type));
+ Num_Choices : constant Nat := Choice_Table'Last;
+
+ Choice : Node_Id;
+ Choice_Hi : Uint;
+ Choice_Lo : Uint;
+ Error : Boolean;
+ Pred : Node_Id;
+ Prev_Choice : Node_Id;
+ Prev_Lo : Uint;
+ Prev_Hi : Uint;
-- Start of processing for Check_Choices
begin
- -- Choice_Table must start at 0 which is an unused location used
- -- by the sorting algorithm. However the first valid position for
- -- a discrete choice is 1.
+ -- Choice_Table must start at 0 which is an unused location used by the
+ -- sorting algorithm. However the first valid position for a discrete
+ -- choice is 1.
pragma Assert (Choice_Table'First = 0);
- if Choice_Table'Last = 0 then
+ -- The choices do not cover the base range. Emit an error if "others" is
+ -- not available and return as there is no need for further processing.
+
+ if Num_Choices = 0 then
if not Others_Present then
- Issue_Msg (Bounds_Lo, Bounds_Hi);
+ Missing_Choice (Bounds_Lo, Bounds_Hi);
end if;
return;
@@ -300,59 +622,98 @@ package body Sem_Case is
Sorting.Sort (Positive (Choice_Table'Last));
- Lo := Expr_Value (Choice_Table (1).Lo);
- Hi := Expr_Value (Choice_Table (1).Hi);
- Prev_Hi := Hi;
+ -- The type covered by the list of choices is actually a static subtype
+ -- subject to a static predicate. The predicate defines subsets of legal
+ -- values and requires finer grained analysis.
+
+ if Has_Predicate then
+ Pred := First (Static_Predicate (Bounds_Type));
+ Prev_Lo := Uint_Minus_1;
+ Prev_Hi := Uint_Minus_1;
+ Error := False;
+
+ for Index in 1 .. Num_Choices loop
+ Check_Against_Predicate
+ (Pred => Pred,
+ Choice => Choice_Table (Index),
+ Prev_Lo => Prev_Lo,
+ Prev_Hi => Prev_Hi,
+ Error => Error);
+
+ -- The analysis detected an illegal intersection between a choice
+ -- and a static predicate set.
- if not Others_Present and then Expr_Value (Bounds_Lo) < Lo then
- Issue_Msg (Bounds_Lo, Lo - 1);
+ if Error then
+ return;
+ end if;
+ end loop;
- -- If values are missing outside of the subtype, add explanation.
- -- No additional message if only one value is missing.
+ -- The choices may legally cover some of the static predicate sets,
+ -- but not all. Emit an error for each non-covered set.
- if Expr_Value (Bounds_Lo) < Lo - 1 then
- Explain_Non_Static_Bound;
+ if not Others_Present then
+ Missing_Choices (Pred, Prev_Hi);
end if;
- end if;
- for J in 2 .. Choice_Table'Last loop
- Lo := Expr_Value (Choice_Table (J).Lo);
- Hi := Expr_Value (Choice_Table (J).Hi);
+ -- Default analysis
- if Lo <= Prev_Hi then
- Choice := Choice_Table (J).Node;
+ else
+ Choice_Lo := Expr_Value (Choice_Table (1).Lo);
+ Choice_Hi := Expr_Value (Choice_Table (1).Hi);
+ Prev_Hi := Choice_Hi;
- -- Find first previous choice that overlaps
+ if not Others_Present and then Expr_Value (Bounds_Lo) < Choice_Lo then
+ Missing_Choice (Bounds_Lo, Choice_Lo - 1);
- for K in 1 .. J - 1 loop
- if Lo <= Expr_Value (Choice_Table (K).Hi) then
- Prev_Choice := Choice_Table (K).Node;
- exit;
- end if;
- end loop;
+ -- If values are missing outside of the subtype, add explanation.
+ -- No additional message if only one value is missing.
- if Sloc (Prev_Choice) <= Sloc (Choice) then
- Error_Msg_Sloc := Sloc (Prev_Choice);
- Error_Msg_N ("duplication of choice value#", Choice);
- else
- Error_Msg_Sloc := Sloc (Choice);
- Error_Msg_N ("duplication of choice value#", Prev_Choice);
+ if Expr_Value (Bounds_Lo) < Choice_Lo - 1 then
+ Explain_Non_Static_Bound;
end if;
-
- elsif not Others_Present and then Lo /= Prev_Hi + 1 then
- Issue_Msg (Prev_Hi + 1, Lo - 1);
end if;
- if Hi > Prev_Hi then
- Prev_Hi := Hi;
- end if;
- end loop;
+ for Outer_Index in 2 .. Num_Choices loop
+ Choice_Lo := Expr_Value (Choice_Table (Outer_Index).Lo);
+ Choice_Hi := Expr_Value (Choice_Table (Outer_Index).Hi);
+
+ if Choice_Lo <= Prev_Hi then
+ Choice := Choice_Table (Outer_Index).Node;
- if not Others_Present and then Expr_Value (Bounds_Hi) > Hi then
- Issue_Msg (Hi + 1, Bounds_Hi);
+ -- Find first previous choice that overlaps
- if Expr_Value (Bounds_Hi) > Hi + 1 then
- Explain_Non_Static_Bound;
+ for Inner_Index in 1 .. Outer_Index - 1 loop
+ if Choice_Lo <=
+ Expr_Value (Choice_Table (Inner_Index).Hi)
+ then
+ Prev_Choice := Choice_Table (Inner_Index).Node;
+ exit;
+ end if;
+ end loop;
+
+ if Sloc (Prev_Choice) <= Sloc (Choice) then
+ Error_Msg_Sloc := Sloc (Prev_Choice);
+ Error_Msg_N ("duplication of choice value#", Choice);
+ else
+ Error_Msg_Sloc := Sloc (Choice);
+ Error_Msg_N ("duplication of choice value#", Prev_Choice);
+ end if;
+
+ elsif not Others_Present and then Choice_Lo /= Prev_Hi + 1 then
+ Missing_Choice (Prev_Hi + 1, Choice_Lo - 1);
+ end if;
+
+ if Choice_Hi > Prev_Hi then
+ Prev_Hi := Choice_Hi;
+ end if;
+ end loop;
+
+ if not Others_Present and then Expr_Value (Bounds_Hi) > Choice_Hi then
+ Missing_Choice (Choice_Hi + 1, Bounds_Hi);
+
+ if Expr_Value (Bounds_Hi) > Choice_Hi + 1 then
+ Explain_Non_Static_Bound;
+ end if;
end if;
end if;
end Check_Choices;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index a4241afabd7..98b0d5795ae 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -79,8 +79,8 @@ package body Sem_Ch10 is
-- Build and decorate the list of shadow entities for a package mentioned
-- in a limited_with clause. If the package was not previously analyzed
-- then it also performs a basic decoration of the real entities. This is
- -- required to do not pass non-decorated entities to the back-end.
- -- Implements Ada 2005 (AI-50217).
+ -- required in order to avoid passing non-decorated entities to the
+ -- back-end. Implements Ada 2005 (AI-50217).
procedure Check_Body_Needed_For_SAL (Unit_Name : Entity_Id);
-- Check whether the source for the body of a compilation unit must be
@@ -401,9 +401,8 @@ package body Sem_Ch10 is
elsif Nkind (Cont_Item) = N_Pragma
and then
- (Pragma_Name (Cont_Item) = Name_Elaborate
- or else
- Pragma_Name (Cont_Item) = Name_Elaborate_All)
+ Nam_In (Pragma_Name (Cont_Item), Name_Elaborate,
+ Name_Elaborate_All)
and then not Used_Type_Or_Elab
then
Prag_Unit :=
@@ -2457,14 +2456,6 @@ package body Sem_Ch10 is
return;
end if;
- -- We reset ordinary style checking during the analysis of a with'ed
- -- unit, but we do NOT reset GNAT special analysis mode (the latter
- -- definitely *does* apply to with'ed units).
-
- if not GNAT_Mode then
- Style_Check := False;
- end if;
-
-- If the library unit is a predefined unit, and we are in high
-- integrity mode, then temporarily reset Configurable_Run_Time_Mode
-- for the analysis of the with'ed unit. This mode does not prevent
@@ -2501,9 +2492,9 @@ package body Sem_Ch10 is
if Nkind (Nam) = N_Selected_Component
and then Nkind (Prefix (Nam)) = N_Identifier
and then Chars (Prefix (Nam)) = Name_Gnat
- and then (Chars (Selector_Name (Nam)) = Name_Most_Recent_Exception
- or else
- Chars (Selector_Name (Nam)) = Name_Exception_Traces)
+ and then Nam_In (Chars (Selector_Name (Nam)),
+ Name_Most_Recent_Exception,
+ Name_Exception_Traces)
then
Check_Restriction (No_Exception_Propagation, N);
Special_Exception_Package_Used := True;
diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb
index e3635c66e17..180ecc6ca0b 100644
--- a/gcc/ada/sem_ch11.adb
+++ b/gcc/ada/sem_ch11.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -424,6 +424,60 @@ package body Sem_Ch11 is
end if;
end Analyze_Handled_Statements;
+ ------------------------------
+ -- Analyze_Raise_Expression --
+ ------------------------------
+
+ procedure Analyze_Raise_Expression (N : Node_Id) is
+ Exception_Id : constant Node_Id := Name (N);
+ Exception_Name : Entity_Id := Empty;
+
+ begin
+ Check_SPARK_Restriction ("raise expression is not allowed", N);
+
+ -- Check exception restrictions on the original source
+
+ if Comes_From_Source (N) then
+ Check_Restriction (No_Exceptions, N);
+ end if;
+
+ Analyze (Exception_Id);
+
+ if Is_Entity_Name (Exception_Id) then
+ Exception_Name := Entity (Exception_Id);
+ end if;
+
+ if No (Exception_Name)
+ or else Ekind (Exception_Name) /= E_Exception
+ then
+ Error_Msg_N
+ ("exception name expected in raise statement", Exception_Id);
+ else
+ Set_Is_Raised (Exception_Name);
+ end if;
+
+ -- Deal with RAISE WITH case
+
+ if Present (Expression (N)) then
+ Check_Compiler_Unit (Expression (N));
+ Analyze_And_Resolve (Expression (N), Standard_String);
+ end if;
+
+ -- Check obsolescent use of Numeric_Error
+
+ if Exception_Name = Standard_Numeric_Error then
+ Check_Restriction (No_Obsolescent_Features, Exception_Id);
+ end if;
+
+ -- Kill last assignment indication
+
+ Kill_Current_Values (Last_Assignment_Only => True);
+
+ -- Set type as Any_Type since we have no information at all on the type
+
+ Set_Etype (N, Any_Type);
+ end Analyze_Raise_Expression;
+
-----------------------------
-- Analyze_Raise_Statement --
-----------------------------
diff --git a/gcc/ada/sem_ch11.ads b/gcc/ada/sem_ch11.ads
index 63544bd0e31..656f12d8cc3 100644
--- a/gcc/ada/sem_ch11.ads
+++ b/gcc/ada/sem_ch11.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -27,6 +27,7 @@ with Types; use Types;
package Sem_Ch11 is
procedure Analyze_Exception_Declaration (N : Node_Id);
procedure Analyze_Handled_Statements (N : Node_Id);
+ procedure Analyze_Raise_Expression (N : Node_Id);
procedure Analyze_Raise_Statement (N : Node_Id);
procedure Analyze_Raise_xxx_Error (N : Node_Id);
procedure Analyze_Subprogram_Info (N : Node_Id);
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 3f8abe7f58c..1fe5277cfd8 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -4966,8 +4966,7 @@ package body Sem_Ch12 is
Make_Compilation_Unit (Sloc (N),
Context_Items => Empty_List,
Unit => Act_Decl,
- Aux_Decls_Node =>
- Make_Compilation_Unit_Aux (Sloc (N)));
+ Aux_Decls_Node => Make_Compilation_Unit_Aux (Sloc (N)));
Set_Parent_Spec (Act_Decl, Parent_Spec (N));
@@ -4984,8 +4983,8 @@ package body Sem_Ch12 is
-- The two compilation unit nodes are linked by the Library_Unit field
- Set_Library_Unit (Decl_Cunit, Body_Cunit);
- Set_Library_Unit (Body_Cunit, Decl_Cunit);
+ Set_Library_Unit (Decl_Cunit, Body_Cunit);
+ Set_Library_Unit (Body_Cunit, Decl_Cunit);
-- Preserve the private nature of the package if needed
@@ -5043,8 +5042,7 @@ package body Sem_Ch12 is
procedure Check_Access_Definition (N : Node_Id) is
begin
pragma Assert
- (Ada_Version >= Ada_2005
- and then Present (Access_Definition (N)));
+ (Ada_Version >= Ada_2005 and then Present (Access_Definition (N)));
null;
end Check_Access_Definition;
@@ -12404,7 +12402,16 @@ package body Sem_Ch12 is
Analyze (Act);
end if;
- if Errs /= Serious_Errors_Detected then
+ -- Ensure that a ghost function does not act as generic actual
+
+ if Is_Entity_Name (Act)
+ and then Is_Ghost_Function (Entity (Act))
+ then
+ Error_Msg_N
+ ("ghost function & cannot act as generic actual", Act);
+ Abandon_Instantiation (Act);
+
+ elsif Errs /= Serious_Errors_Detected then
-- Do a minimal analysis of the generic, to prevent spurious
-- warnings complaining about the generic being unreferenced,
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 92df5569df6..32f1f6d76ac 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -26,6 +26,7 @@
with Aspects; use Aspects;
with Atree; use Atree;
with Checks; use Checks;
+with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
@@ -50,6 +51,7 @@ with Sem_Ch9; use Sem_Ch9;
with Sem_Dim; use Sem_Dim;
with Sem_Disp; use Sem_Disp;
with Sem_Eval; use Sem_Eval;
+with Sem_Prag; use Sem_Prag;
with Sem_Res; use Sem_Res;
with Sem_Type; use Sem_Type;
with Sem_Util; use Sem_Util;
@@ -82,7 +84,7 @@ package body Sem_Ch13 is
-- type whose inherited alignment is no longer appropriate for the new
-- size value. In this case, we reset the Alignment to unknown.
- procedure Build_Predicate_Function (Typ : Entity_Id; N : Node_Id);
+ procedure Build_Predicate_Functions (Typ : Entity_Id; N : Node_Id);
-- If Typ has predicates (indicated by Has_Predicates being set for Typ,
-- then either there are pragma Predicate entries on the rep chain for the
-- type (note that Predicate aspects are converted to pragma Predicate), or
@@ -90,7 +92,9 @@ package body Sem_Ch13 is
-- This procedure builds the spec and body for the Predicate function that
-- tests these predicates. N is the freeze node for the type. The spec of
-- the function is inserted before the freeze node, and the body of the
- -- function is inserted after the freeze node.
+ -- function is inserted after the freeze node. If the predicate expression
+ -- has at least one Raise_Expression, then this procedure also builds the
+ -- M version of the predicate function for use in membership tests.
procedure Build_Static_Predicate
(Typ : Entity_Id;
@@ -944,11 +948,11 @@ package body Sem_Ch13 is
-- Some special cases don't require delay analysis, thus the aspect is
-- analyzed right now.
- -- Note that there is a special handling for
- -- Pre/Post/Test_Case/Contract_Case aspects. In this case, we do not
- -- have to worry about delay issues, since the pragmas themselves deal
- -- with delay of visibility for the expression analysis. Thus, we just
- -- insert the pragma after the node N.
+ -- Note that there is a special handling for Pre, Post, Test_Case,
+ -- Contract_Case aspects. In these cases, we do not have to worry
+ -- about delay issues, since the pragmas themselves deal with delay
+ -- of visibility for the expression analysis. Thus, we just insert
+ -- the pragma after the node N.
begin
pragma Assert (Present (L));
@@ -997,14 +1001,14 @@ package body Sem_Ch13 is
begin
A := First (L);
while Present (A) loop
- exit when Chars (Identifier (A)) = Name_Export
- or else Chars (Identifier (A)) = Name_Import;
+ exit when Nam_In (Chars (Identifier (A)), Name_Export,
+ Name_Import);
Next (A);
end loop;
if No (A) then
Error_Msg_N
- ("Missing Import/Export for Link/External name",
+ ("missing Import/Export for Link/External name",
Aspect);
end if;
end;
@@ -1018,7 +1022,7 @@ package body Sem_Ch13 is
begin
if not Is_Type (E) or else not Has_Discriminants (E) then
Error_Msg_N
- ("Aspect must apply to a type with discriminants", N);
+ ("aspect must apply to a type with discriminants", N);
else
declare
@@ -1054,6 +1058,15 @@ package body Sem_Ch13 is
goto Continue;
end if;
+ -- Skip looking at aspect if it is totally disabled. Just mark
+ -- it as such for later reference in the tree.
+
+ Check_Applicable_Policy (Aspect);
+
+ if Is_Disabled (Aspect) then
+ goto Continue;
+ end if;
+
-- Set the source location of expression, used in the case of
-- a failed precondition/postcondition or invariant. Note that
-- the source location of the expression is not usually the best
@@ -1077,7 +1090,7 @@ package body Sem_Ch13 is
Check_Restriction_No_Specification_Of_Aspect (Aspect);
- -- Analyze this aspect
+ -- Analyze this aspect (actual analysis is delayed till later)
Set_Analyzed (Aspect);
Set_Entity (Aspect, E);
@@ -1199,7 +1212,7 @@ package body Sem_Ch13 is
Chars => Chars (Id),
Expression => Relocate_Node (Expr));
- -- Case 2: Aspects cooresponding to pragmas
+ -- Case 2: Aspects corresponding to pragmas
-- Case 2a: Aspects corresponding to pragmas with two
-- arguments, where the first argument is a local name
@@ -1209,8 +1222,6 @@ package body Sem_Ch13 is
when Aspect_Suppress |
Aspect_Unsuppress =>
- -- Construct the pragma
-
Aitem :=
Make_Pragma (Loc,
Pragma_Argument_Associations => New_List (
@@ -1223,11 +1234,10 @@ package body Sem_Ch13 is
Pragma_Identifier =>
Make_Identifier (Sloc (Id), Chars (Id)));
- when Aspect_Synchronization =>
-
- -- The aspect corresponds to pragma Implemented.
- -- Construct the pragma.
+ -- The aspect corresponds to pragma Implemented. Construct the
+ -- pragma.
+ when Aspect_Synchronization =>
Aitem :=
Make_Pragma (Loc,
Pragma_Argument_Associations => New_List (
@@ -1262,7 +1272,8 @@ package body Sem_Ch13 is
Aspect_Static_Predicate =>
-- Construct the pragma (always a pragma Predicate, with
- -- flags recording whether it is static/dynamic).
+ -- flags recording whether it is static/dynamic). We also
+ -- set flags recording this in the type itself.
Aitem :=
Make_Pragma (Loc,
@@ -1275,16 +1286,33 @@ package body Sem_Ch13 is
Pragma_Identifier =>
Make_Identifier (Sloc (Id), Name_Predicate));
+ -- Mark type has predicates, and remember what kind of
+ -- aspect lead to this predicate (we need this to access
+ -- the right set of check policies later on).
+
+ Set_Has_Predicates (E);
+
+ if A_Id = Aspect_Dynamic_Predicate then
+ Set_Has_Dynamic_Predicate_Aspect (E);
+ elsif A_Id = Aspect_Static_Predicate then
+ Set_Has_Static_Predicate_Aspect (E);
+ end if;
+
-- If the type is private, indicate that its completion
-- has a freeze node, because that is the one that will be
-- visible at freeze time.
- Set_Has_Predicates (E);
-
if Is_Private_Type (E)
and then Present (Full_View (E))
then
Set_Has_Predicates (Full_View (E));
+
+ if A_Id = Aspect_Dynamic_Predicate then
+ Set_Has_Dynamic_Predicate_Aspect (Full_View (E));
+ elsif A_Id = Aspect_Static_Predicate then
+ Set_Has_Static_Predicate_Aspect (Full_View (E));
+ end if;
+
Set_Has_Delayed_Aspects (Full_View (E));
Ensure_Freeze_Node (Full_View (E));
end if;
@@ -1321,9 +1349,7 @@ package body Sem_Ch13 is
while Present (A) loop
A_Name := Chars (Identifier (A));
- if A_Name = Name_Import or else
- A_Name = Name_Export
- then
+ if Nam_In (A_Name, Name_Import, Name_Export) then
if Found then
Error_Msg_N ("conflicting", A);
else
@@ -1377,6 +1403,7 @@ package body Sem_Ch13 is
when Aspect_CPU |
Aspect_Interrupt_Priority |
Aspect_Priority =>
+
if Nkind (N) = N_Subprogram_Body then
Aitem :=
Make_Pragma (Loc,
@@ -1394,9 +1421,6 @@ package body Sem_Ch13 is
end if;
when Aspect_Warnings =>
-
- -- Construct the pragma
-
Aitem :=
Make_Pragma (Loc,
Pragma_Argument_Associations => New_List (
@@ -1427,8 +1451,6 @@ package body Sem_Ch13 is
-- an invariant must apply to a private type, or appear in
-- the private part of a spec and apply to a completion.
- -- Construct the pragma
-
Aitem :=
Make_Pragma (Loc,
Pragma_Argument_Associations => New_List (
@@ -1438,7 +1460,7 @@ package body Sem_Ch13 is
Expression => Relocate_Node (Expr))),
Class_Present => Class_Present (Aspect),
Pragma_Identifier =>
- Make_Identifier (Sloc (Id), Name_Invariant));
+ Make_Identifier (Sloc (Id), Name_Invariant));
-- Add message unless exception messages are suppressed
@@ -1472,6 +1494,18 @@ package body Sem_Ch13 is
Delay_Required := False;
+ -- Aspect Depends must be delayed because it mentions names
+ -- of inputs and output that are classified by aspect Global.
+
+ when Aspect_Depends =>
+ Aitem :=
+ Make_Pragma (Loc,
+ Pragma_Identifier =>
+ Make_Identifier (Sloc (Id), Name_Depends),
+ Pragma_Argument_Associations => New_List (
+ Make_Pragma_Argument_Association (Loc,
+ Expression => Relocate_Node (Expr))));
+
-- Aspect Global must be delayed because it can mention names
-- and benefit from the forward visibility rules applicable to
-- aspects of subprograms.
@@ -1558,6 +1592,7 @@ package body Sem_Ch13 is
goto Continue;
-- Case 4: Special handling for aspects
+
-- Pre/Post/Test_Case/Contract_Case whose corresponding pragmas
-- take care of the delay.
@@ -1679,6 +1714,14 @@ package body Sem_Ch13 is
else
Insert_After (N, Aitem);
+
+ -- Pre/Postconditions on stubs are analyzed at once,
+ -- because the proper body is analyzed next, and the
+ -- contract must be captured before the body.
+
+ if Nkind (N) = N_Subprogram_Body_Stub then
+ Analyze (Aitem);
+ end if;
end if;
goto Continue;
@@ -1945,12 +1988,27 @@ package body Sem_Ch13 is
end if;
end if;
+ -- Aspect Abstract_State introduces implicit declarations for all
+ -- state abstraction entities it defines. To emulate this behavior
+ -- insert the pragma at the start of the visible declarations of
+ -- the related package.
+
+ if Nam = Name_Abstract_State
+ and then Nkind (N) = N_Package_Declaration
+ then
+ if No (Visible_Declarations (Specification (N))) then
+ Set_Visible_Declarations (Specification (N), New_List);
+ end if;
+
+ Prepend (Aitem, Visible_Declarations (Specification (N)));
+ goto Continue;
+
-- In the context of a compilation unit, we directly put the
-- pragma in the Pragmas_After list of the
-- N_Compilation_Unit_Aux node (no delay is required here)
-- except for aspects on a subprogram body (see below).
- if Nkind (Parent (N)) = N_Compilation_Unit
+ elsif Nkind (Parent (N)) = N_Compilation_Unit
and then (Present (Aitem) or else Is_Boolean_Aspect (Aspect))
then
declare
@@ -1991,20 +2049,6 @@ package body Sem_Ch13 is
Prepend (Aitem, Declarations (N));
- -- Aspect Abstract_State produces implicit declarations for
- -- all state abstraction entities it defines. To emulate
- -- this behavior, insert the pragma at the start of the
- -- visible declarations of the related package.
-
- elsif Nam = Name_Abstract_State
- and then Nkind (N) = N_Package_Declaration
- then
- if No (Visible_Declarations (Specification (N))) then
- Set_Visible_Declarations (Specification (N), New_List);
- end if;
-
- Prepend (Aitem, Visible_Declarations (Specification (N)));
-
else
if No (Pragmas_After (Aux)) then
Set_Pragmas_After (Aux, New_List);
@@ -2031,12 +2075,17 @@ package body Sem_Ch13 is
Set_Is_Delayed_Aspect (Aspect);
- -- In the case of Default_Value, link aspect to base type
- -- as well, even though it appears on a first subtype. This
- -- is mandated by the semantics of the aspect. Verify that
- -- this a scalar type, to prevent cascaded errors.
+ -- In the case of Default_Value, link the aspect to base type
+ -- as well, even though it appears on a first subtype. This is
+ -- mandated by the semantics of the aspect. Do not establish
+ -- the link when processing the base type itself as this leads
+ -- to a rep item circularity. Verify that we are dealing with
+ -- a scalar type to prevent cascaded errors.
- if A_Id = Aspect_Default_Value and then Is_Scalar_Type (E) then
+ if A_Id = Aspect_Default_Value
+ and then Is_Scalar_Type (E)
+ and then Base_Type (E) /= E
+ then
Set_Has_Delayed_Aspects (Base_Type (E));
Record_Rep_Item (Base_Type (E), Aspect);
end if;
@@ -2309,7 +2358,7 @@ package body Sem_Ch13 is
procedure Check_One_Function (Subp : Entity_Id) is
Default_Element : constant Node_Id :=
- Find_Aspect
+ Find_Value_Of_Aspect
(Etype (First_Formal (Subp)),
Aspect_Iterator_Element);
@@ -2741,6 +2790,7 @@ package body Sem_Ch13 is
end if;
Set_Entity (N, U_Ent);
+ Check_Restriction_No_Use_Of_Attribute (N);
-- Switch on particular attribute
@@ -4251,6 +4301,14 @@ package body Sem_Ch13 is
return;
end if;
+ -- Ignore enumeration rep clauses by default in CodePeer mode,
+ -- unless -gnatd.I is specified, as a work around for potential false
+ -- positive messages.
+
+ if CodePeer_Mode and not Debug_Flag_Dot_II then
+ return;
+ end if;
+
-- First some basic error checks
Find_Type (Ident);
@@ -4689,12 +4747,12 @@ package body Sem_Ch13 is
-- If we have a type with predicates, build predicate function
if Is_Type (E) and then Has_Predicates (E) then
- Build_Predicate_Function (E, N);
+ Build_Predicate_Functions (E, N);
end if;
-- If type has delayed aspects, this is where we do the preanalysis at
-- the freeze point, as part of the consistent visibility check. Note
- -- that this must be done after calling Build_Predicate_Function or
+ -- that this must be done after calling Build_Predicate_Functions or
-- Build_Invariant_Procedure since these subprograms fix occurrences of
-- the subtype name in the saved expression so that they will not cause
-- trouble in the preanalysis.
@@ -5225,9 +5283,9 @@ package body Sem_Ch13 is
SId :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Typ), "Invariant"));
- Set_Has_Invariants (SId);
Set_Has_Invariants (Typ);
Set_Ekind (SId, E_Procedure);
+ Set_Is_Invariant_Procedure (SId);
Set_Invariant_Procedure (Typ, SId);
Spec :=
@@ -5597,11 +5655,11 @@ package body Sem_Ch13 is
end if;
end Build_Invariant_Procedure;
- ------------------------------
- -- Build_Predicate_Function --
- ------------------------------
+ -------------------------------
+ -- Build_Predicate_Functions --
+ -------------------------------
- -- The procedure that is constructed here has the form:
+ -- The procedures that are constructed here has the form:
-- function typPredicate (Ixxx : typ) return Boolean is
-- begin
@@ -5618,17 +5676,38 @@ package body Sem_Ch13 is
-- inherited. Note that we do NOT generate Check pragmas, that's because we
-- use this function even if checks are off, e.g. for membership tests.
- procedure Build_Predicate_Function (Typ : Entity_Id; N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (Typ);
- Spec : Node_Id;
- SId : Entity_Id;
- FDecl : Node_Id;
- FBody : Node_Id;
+ -- If the expression has at least one Raise_Expression, then we also build
+ -- the typPredicateM version of the function, in which any occurence of a
+ -- Raise_Expressioon is converted to "return False".
+
+ procedure Build_Predicate_Functions (Typ : Entity_Id; N : Node_Id) is
+ Loc : constant Source_Ptr := Sloc (Typ);
Expr : Node_Id;
- -- This is the expression for the return statement in the function. It
+ -- This is the expression for the result of the function. It is
-- is build by connecting the component predicates with AND THEN.
+ Expr_M : Node_Id;
+ -- This is the corresponding return expression for the Predicate_M
+ -- function. It differs in that raise expressions are marked for
+ -- special expansion (see Process_REs).
+
+ Object_Name : constant Name_Id := New_Internal_Name ('I');
+ -- Name for argument of Predicate procedure. Note that we use the same
+ -- name for both predicate procedure. That way the reference within the
+ -- predicate expression is the same in both functions.
+
+ Object_Entity : constant Entity_Id :=
+ Make_Defining_Identifier (Loc, Chars => Object_Name);
+ -- Entity for argument of Predicate procedure
+
+ Object_Entity_M : constant Entity_Id :=
+ Make_Defining_Identifier (Loc, Chars => Object_Name);
+ -- Entity for argument of Predicate_M procedure
+
+ Raise_Expression_Present : Boolean := False;
+ -- Set True if Expr has at least one Raise_Expression
+
procedure Add_Call (T : Entity_Id);
-- Includes a call to the predicate function for type T in Expr if T
-- has predicates and Predicate_Function (T) is non-empty.
@@ -5639,19 +5718,26 @@ package body Sem_Ch13 is
-- Inheritance of predicates for the parent type is done by calling the
-- Predicate_Function of the parent type, using Add_Call above.
- Object_Name : constant Name_Id := New_Internal_Name ('I');
- -- Name for argument of Predicate procedure
+ function Test_RE (N : Node_Id) return Traverse_Result;
+ -- Used in Test_REs, tests one node for being a raise expression, and if
+ -- so sets Raise_Expression_Present True.
- Object_Entity : constant Entity_Id :=
- Make_Defining_Identifier (Loc, Object_Name);
- -- The entity for the spec entity for the argument
+ procedure Test_REs is new Traverse_Proc (Test_RE);
+ -- Tests to see if Expr contains any raise expressions
+
+ function Process_RE (N : Node_Id) return Traverse_Result;
+ -- Used in Process REs, tests if node N is a raise expression, and if
+ -- so, marks it to be converted to return False.
+
+ procedure Process_REs is new Traverse_Proc (Process_RE);
+ -- Marks any raise expressions in Expr_M to return False
Dynamic_Predicate_Present : Boolean := False;
-- Set True if a dynamic predicate is present, results in the entire
-- predicate being considered dynamic even if it looks static
Static_Predicate_Present : Node_Id := Empty;
- -- Set to N_Pragma node for a static predicate if one is encountered.
+ -- Set to N_Pragma node for a static predicate if one is encountered
--------------
-- Add_Call --
@@ -5730,8 +5816,8 @@ package body Sem_Ch13 is
Rewrite (N, Make_Identifier (Sloc (N), Object_Name));
-- Use the Sloc of the usage name, not the defining name
- Set_Entity (N, Object_Entity);
Set_Etype (N, Typ);
+ Set_Entity (N, Object_Entity);
-- We want to treat the node as if it comes from source, so that
-- ASIS will not ignore it
@@ -5830,13 +5916,37 @@ package body Sem_Ch13 is
end loop;
end Add_Predicates;
- -- Start of processing for Build_Predicate_Function
+ ----------------
+ -- Process_RE --
+ ----------------
- begin
- -- Initialize for construction of statement list
+ function Process_RE (N : Node_Id) return Traverse_Result is
+ begin
+ if Nkind (N) = N_Raise_Expression then
+ Set_Convert_To_Return_False (N);
+ return Skip;
+ else
+ return OK;
+ end if;
+ end Process_RE;
- Expr := Empty;
+ -------------
+ -- Test_RE --
+ -------------
+ function Test_RE (N : Node_Id) return Traverse_Result is
+ begin
+ if Nkind (N) = N_Raise_Expression then
+ Raise_Expression_Present := True;
+ return Abandon;
+ else
+ return OK;
+ end if;
+ end Test_RE;
+
+ -- Start of processing for Build_Predicate_Functions
+
+ begin
-- Return if already built or if type does not have predicates
if not Has_Predicates (Typ)
@@ -5845,6 +5955,10 @@ package body Sem_Ch13 is
return;
end if;
+ -- Prepare to construct predicate expression
+
+ Expr := Empty;
+
-- Add Predicates for the current type
Add_Predicates;
@@ -5859,69 +5973,198 @@ package body Sem_Ch13 is
end if;
end;
- -- If we have predicates, build the function
+ -- Case where predicates are present
if Present (Expr) then
- -- Build function declaration
+ -- Test for raise expression present
- SId :=
- Make_Defining_Identifier (Loc,
- Chars => New_External_Name (Chars (Typ), "Predicate"));
- Set_Has_Predicates (SId);
- Set_Ekind (SId, E_Function);
- Set_Predicate_Function (Typ, SId);
+ Test_REs (Expr);
- -- The predicate function is shared between views of a type.
+ -- If raise expression is present, capture a copy of Expr for use
+ -- in building the predicateM function version later on. For this
+ -- copy we replace references to Object_Entity by Object_Entity_M.
- if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
- Set_Predicate_Function (Full_View (Typ), SId);
+ if Raise_Expression_Present then
+ declare
+ Map : constant Elist_Id := New_Elmt_List;
+ begin
+ Append_Elmt (Object_Entity, Map);
+ Append_Elmt (Object_Entity_M, Map);
+ Expr_M := New_Copy_Tree (Expr, Map => Map);
+ end;
end if;
- Spec :=
- Make_Function_Specification (Loc,
- Defining_Unit_Name => SId,
- Parameter_Specifications => New_List (
- Make_Parameter_Specification (Loc,
- Defining_Identifier => Object_Entity,
- Parameter_Type => New_Occurrence_Of (Typ, Loc))),
- Result_Definition =>
- New_Occurrence_Of (Standard_Boolean, Loc));
-
- FDecl := Make_Subprogram_Declaration (Loc, Specification => Spec);
-
- -- Build function body
-
- SId :=
- Make_Defining_Identifier (Loc,
- Chars => New_External_Name (Chars (Typ), "Predicate"));
-
- Spec :=
- Make_Function_Specification (Loc,
- Defining_Unit_Name => SId,
- Parameter_Specifications => New_List (
- Make_Parameter_Specification (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Loc, Object_Name),
- Parameter_Type =>
- New_Occurrence_Of (Typ, Loc))),
- Result_Definition =>
- New_Occurrence_Of (Standard_Boolean, Loc));
-
- FBody :=
- Make_Subprogram_Body (Loc,
- Specification => Spec,
- Declarations => Empty_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (
- Make_Simple_Return_Statement (Loc,
- Expression => Expr))));
+ -- Build the main predicate function
- -- Insert declaration before freeze node and body after
+ declare
+ SId : constant Entity_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_External_Name (Chars (Typ), "Predicate"));
+ -- The entity for the the function spec
+
+ SIdB : constant Entity_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_External_Name (Chars (Typ), "Predicate"));
+ -- The entity for the function body
+
+ Spec : Node_Id;
+ FDecl : Node_Id;
+ FBody : Node_Id;
+
+ begin
+ -- Build function declaration
+
+ Set_Ekind (SId, E_Function);
+ Set_Is_Predicate_Function (SId);
+ Set_Predicate_Function (Typ, SId);
+
+ -- The predicate function is shared between views of a type
+
+ if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
+ Set_Predicate_Function (Full_View (Typ), SId);
+ end if;
+
+ Spec :=
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => SId,
+ Parameter_Specifications => New_List (
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier => Object_Entity,
+ Parameter_Type => New_Occurrence_Of (Typ, Loc))),
+ Result_Definition =>
+ New_Occurrence_Of (Standard_Boolean, Loc));
+
+ FDecl :=
+ Make_Subprogram_Declaration (Loc,
+ Specification => Spec);
+
+ -- Build function body
+
+ Spec :=
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => SIdB,
+ Parameter_Specifications => New_List (
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc, Object_Name),
+ Parameter_Type =>
+ New_Occurrence_Of (Typ, Loc))),
+ Result_Definition =>
+ New_Occurrence_Of (Standard_Boolean, Loc));
+
+ FBody :=
+ Make_Subprogram_Body (Loc,
+ Specification => Spec,
+ Declarations => Empty_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Simple_Return_Statement (Loc,
+ Expression => Expr))));
+
+ -- Insert declaration before freeze node and body after
+
+ Insert_Before_And_Analyze (N, FDecl);
+ Insert_After_And_Analyze (N, FBody);
+ end;
- Insert_Before_And_Analyze (N, FDecl);
- Insert_After_And_Analyze (N, FBody);
+ -- Test for raise expressions present and if so build M version
+
+ if Raise_Expression_Present then
+ declare
+ SId : constant Entity_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_External_Name (Chars (Typ), "PredicateM"));
+ -- The entity for the the function spec
+
+ SIdB : constant Entity_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_External_Name (Chars (Typ), "PredicateM"));
+ -- The entity for the function body
+
+ Spec : Node_Id;
+ FDecl : Node_Id;
+ FBody : Node_Id;
+ BTemp : Entity_Id;
+
+ begin
+ -- Mark any raise expressions for special expansion
+
+ Process_REs (Expr_M);
+
+ -- Build function declaration
+
+ Set_Ekind (SId, E_Function);
+ Set_Is_Predicate_Function_M (SId);
+ Set_Predicate_Function_M (Typ, SId);
+
+ -- The predicate function is shared between views of a type
+
+ if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
+ Set_Predicate_Function_M (Full_View (Typ), SId);
+ end if;
+
+ Spec :=
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => SId,
+ Parameter_Specifications => New_List (
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier => Object_Entity_M,
+ Parameter_Type => New_Occurrence_Of (Typ, Loc))),
+ Result_Definition =>
+ New_Occurrence_Of (Standard_Boolean, Loc));
+
+ FDecl :=
+ Make_Subprogram_Declaration (Loc,
+ Specification => Spec);
+
+ -- Build function body
+
+ Spec :=
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => SIdB,
+ Parameter_Specifications => New_List (
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc, Object_Name),
+ Parameter_Type =>
+ New_Occurrence_Of (Typ, Loc))),
+ Result_Definition =>
+ New_Occurrence_Of (Standard_Boolean, Loc));
+
+ -- Build the body, we declare the boolean expression before
+ -- doing the return, because we are not really confident of
+ -- what happens if a return appears within a return!
+
+ BTemp :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_Internal_Name ('B'));
+
+ FBody :=
+ Make_Subprogram_Body (Loc,
+ Specification => Spec,
+
+ Declarations => New_List (
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => BTemp,
+ Constant_Present => True,
+ Object_Definition =>
+ New_Reference_To (Standard_Boolean, Loc),
+ Expression => Expr_M)),
+
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Simple_Return_Statement (Loc,
+ Expression => New_Reference_To (BTemp, Loc)))));
+
+ -- Insert declaration before freeze node and body after
+
+ Insert_Before_And_Analyze (N, FDecl);
+ Insert_After_And_Analyze (N, FBody);
+ end;
+ end if;
-- Deal with static predicate case
@@ -5944,7 +6187,7 @@ package body Sem_Ch13 is
end if;
end if;
end if;
- end Build_Predicate_Function;
+ end Build_Predicate_Functions;
----------------------------
-- Build_Static_Predicate --
@@ -5973,15 +6216,15 @@ package body Sem_Ch13 is
type REnt is record
Lo, Hi : Uint;
end record;
- -- One entry in a Rlist value, a single REnt (range entry) value
- -- denotes one range from Lo to Hi. To represent a single value
- -- range Lo = Hi = value.
+ -- One entry in a Rlist value, a single REnt (range entry) value denotes
+ -- one range from Lo to Hi. To represent a single value range Lo = Hi =
+ -- value.
type RList is array (Nat range <>) of REnt;
- -- A list of ranges. The ranges are sorted in increasing order,
- -- and are disjoint (there is a gap of at least one value between
- -- each range in the table). A value is in the set of ranges in
- -- Rlist if it lies within one of these ranges
+ -- A list of ranges. The ranges are sorted in increasing order, and are
+ -- disjoint (there is a gap of at least one value between each range in
+ -- the table). A value is in the set of ranges in Rlist if it lies
+ -- within one of these ranges.
False_Range : constant RList :=
RList'(1 .. 0 => REnt'(No_Uint, No_Uint));
@@ -5995,41 +6238,41 @@ package body Sem_Ch13 is
True_Range : constant RList := RList'(1 => REnt'(BLo, BHi));
-- Range representing True, value must be in the base range
- function "and" (Left, Right : RList) return RList;
- -- And's together two range lists, returning a range list. This is
- -- a set intersection operation.
+ function "and" (Left : RList; Right : RList) return RList;
+ -- And's together two range lists, returning a range list. This is a set
+ -- intersection operation.
- function "or" (Left, Right : RList) return RList;
- -- Or's together two range lists, returning a range list. This is a
- -- set union operation.
+ function "or" (Left : RList; Right : RList) return RList;
+ -- Or's together two range lists, returning a range list. This is a set
+ -- union operation.
function "not" (Right : RList) return RList;
-- Returns complement of a given range list, i.e. a range list
- -- representing all the values in TLo .. THi that are not in the
- -- input operand Right.
+ -- representing all the values in TLo .. THi that are not in the input
+ -- operand Right.
function Build_Val (V : Uint) return Node_Id;
-- Return an analyzed N_Identifier node referencing this value, suitable
-- for use as an entry in the Static_Predicate list. This node is typed
-- with the base type.
- function Build_Range (Lo, Hi : Uint) return Node_Id;
- -- Return an analyzed N_Range node referencing this range, suitable
- -- for use as an entry in the Static_Predicate list. This node is typed
- -- with the base type.
+ function Build_Range (Lo : Uint; Hi : Uint) return Node_Id;
+ -- Return an analyzed N_Range node referencing this range, suitable for
+ -- use as an entry in the Static_Predicate list. This node is typed with
+ -- the base type.
function Get_RList (Exp : Node_Id) return RList;
- -- This is a recursive routine that converts the given expression into
- -- a list of ranges, suitable for use in building the static predicate.
+ -- This is a recursive routine that converts the given expression into a
+ -- list of ranges, suitable for use in building the static predicate.
function Is_False (R : RList) return Boolean;
pragma Inline (Is_False);
- -- Returns True if the given range list is empty, and thus represents
- -- a False list of ranges that can never be satisfied.
+ -- Returns True if the given range list is empty, and thus represents a
+ -- False list of ranges that can never be satisfied.
function Is_True (R : RList) return Boolean;
- -- Returns True if R trivially represents the True predicate by having
- -- a single range from BLo to BHi.
+ -- Returns True if R trivially represents the True predicate by having a
+ -- single range from BLo to BHi.
function Is_Type_Ref (N : Node_Id) return Boolean;
pragma Inline (Is_Type_Ref);
@@ -6062,7 +6305,7 @@ package body Sem_Ch13 is
-- "and" --
-----------
- function "and" (Left, Right : RList) return RList is
+ function "and" (Left : RList; Right : RList) return RList is
FEnt : REnt;
-- First range of result
@@ -6087,8 +6330,8 @@ package body Sem_Ch13 is
return False_Range;
end if;
- -- Loop to remove entries at start that are disjoint, and thus
- -- just get discarded from the result entirely.
+ -- Loop to remove entries at start that are disjoint, and thus just
+ -- get discarded from the result entirely.
loop
-- If no operands left in either operand, result is false
@@ -6113,15 +6356,15 @@ package body Sem_Ch13 is
end if;
end loop;
- -- Now we have two non-null operands, and first entries overlap.
- -- The first entry in the result will be the overlapping part of
- -- these two entries.
+ -- Now we have two non-null operands, and first entries overlap. The
+ -- first entry in the result will be the overlapping part of these
+ -- two entries.
FEnt := REnt'(Lo => UI_Max (Left (SLeft).Lo, Right (SRight).Lo),
Hi => UI_Min (Left (SLeft).Hi, Right (SRight).Hi));
- -- Now we can remove the entry that ended at a lower value, since
- -- its contribution is entirely contained in Fent.
+ -- Now we can remove the entry that ended at a lower value, since its
+ -- contribution is entirely contained in Fent.
if Left (SLeft).Hi <= Right (SRight).Hi then
SLeft := SLeft + 1;
@@ -6129,10 +6372,10 @@ package body Sem_Ch13 is
SRight := SRight + 1;
end if;
- -- Compute result by concatenating this first entry with the "and"
- -- of the remaining parts of the left and right operands. Note that
- -- if either of these is empty, "and" will yield empty, so that we
- -- will end up with just Fent, which is what we want in that case.
+ -- Compute result by concatenating this first entry with the "and" of
+ -- the remaining parts of the left and right operands. Note that if
+ -- either of these is empty, "and" will yield empty, so that we will
+ -- end up with just Fent, which is what we want in that case.
return
FEnt & (Left (SLeft .. Left'Last) and Right (SRight .. Right'Last));
@@ -6196,7 +6439,7 @@ package body Sem_Ch13 is
-- "or" --
----------
- function "or" (Left, Right : RList) return RList is
+ function "or" (Left : RList; Right : RList) return RList is
FEnt : REnt;
-- First range of result
@@ -6221,8 +6464,8 @@ package body Sem_Ch13 is
return Left;
end if;
- -- Initialize result first entry from left or right operand
- -- depending on which starts with the lower range.
+ -- Initialize result first entry from left or right operand depending
+ -- on which starts with the lower range.
if Left (SLeft).Lo < Right (SRight).Lo then
FEnt := Left (SLeft);
@@ -6232,12 +6475,12 @@ package body Sem_Ch13 is
SRight := SRight + 1;
end if;
- -- This loop eats ranges from left and right operands that
- -- are contiguous with the first range we are gathering.
+ -- This loop eats ranges from left and right operands that are
+ -- contiguous with the first range we are gathering.
loop
- -- Eat first entry in left operand if contiguous or
- -- overlapped by gathered first operand of result.
+ -- Eat first entry in left operand if contiguous or overlapped by
+ -- gathered first operand of result.
if SLeft <= Left'Last
and then Left (SLeft).Lo <= FEnt.Hi + 1
@@ -6245,8 +6488,8 @@ package body Sem_Ch13 is
FEnt.Hi := UI_Max (FEnt.Hi, Left (SLeft).Hi);
SLeft := SLeft + 1;
- -- Eat first entry in right operand if contiguous or
- -- overlapped by gathered right operand of result.
+ -- Eat first entry in right operand if contiguous or overlapped by
+ -- gathered right operand of result.
elsif SRight <= Right'Last
and then Right (SRight).Lo <= FEnt.Hi + 1
@@ -6254,7 +6497,7 @@ package body Sem_Ch13 is
FEnt.Hi := UI_Max (FEnt.Hi, Right (SRight).Hi);
SRight := SRight + 1;
- -- All done if no more entries to eat!
+ -- All done if no more entries to eat
else
exit;
@@ -6273,20 +6516,18 @@ package body Sem_Ch13 is
-- Build_Range --
-----------------
- function Build_Range (Lo, Hi : Uint) return Node_Id is
+ function Build_Range (Lo : Uint; Hi : Uint) return Node_Id is
Result : Node_Id;
+
begin
- if Lo = Hi then
- return Build_Val (Hi);
- else
- Result :=
- Make_Range (Loc,
- Low_Bound => Build_Val (Lo),
- High_Bound => Build_Val (Hi));
- Set_Etype (Result, Btyp);
- Set_Analyzed (Result);
- return Result;
- end if;
+ Result :=
+ Make_Range (Loc,
+ Low_Bound => Build_Val (Lo),
+ High_Bound => Build_Val (Hi));
+ Set_Etype (Result, Btyp);
+ Set_Analyzed (Result);
+
+ return Result;
end Build_Range;
---------------
@@ -6449,7 +6690,10 @@ package body Sem_Ch13 is
declare
Ent : constant Entity_Id := Entity (Name (Exp));
begin
- if Has_Predicates (Ent) then
+ if Is_Predicate_Function (Ent)
+ or else
+ Is_Predicate_Function_M (Ent)
+ then
return Stat_Pred (Etype (First_Formal (Ent)));
end if;
end;
@@ -6693,11 +6937,7 @@ package body Sem_Ch13 is
-- Convert range into required form
- if Lo = Hi then
- Append_To (Plist, Build_Val (Lo));
- else
- Append_To (Plist, Build_Range (Lo, Hi));
- end if;
+ Append_To (Plist, Build_Range (Lo, Hi));
end if;
end;
end loop;
@@ -6977,6 +7217,14 @@ package body Sem_Ch13 is
when Aspect_Default_Value =>
T := Entity (ASN);
+ -- Depends is a delayed aspect because it mentiones names first
+ -- introduced by aspect Global which is already delayed. There is
+ -- no action to be taken with respect to the aspect itself as the
+ -- analysis is done by the corresponding pragma.
+
+ when Aspect_Depends =>
+ return;
+
when Aspect_Dispatching_Domain =>
T := RTE (RE_Dispatching_Domain);
@@ -6988,8 +7236,8 @@ package body Sem_Ch13 is
-- Global is a delayed aspect because it may reference names that
-- have not been declared yet. There is no action to be taken with
- -- respect to the aspect itself as the reference checking is done on
- -- the corresponding pragma.
+ -- respect to the aspect itself as the reference checking is done
+ -- on the corresponding pragma.
when Aspect_Global =>
return;
@@ -7318,13 +7566,10 @@ package body Sem_Ch13 is
Check_Expr_Constants (Prefix (Nod));
when N_Attribute_Reference =>
- if Attribute_Name (Nod) = Name_Address
- or else
- Attribute_Name (Nod) = Name_Access
- or else
- Attribute_Name (Nod) = Name_Unchecked_Access
- or else
- Attribute_Name (Nod) = Name_Unrestricted_Access
+ if Nam_In (Attribute_Name (Nod), Name_Address,
+ Name_Access,
+ Name_Unchecked_Access,
+ Name_Unrestricted_Access)
then
Check_At_Constant_Address (Prefix (Nod));
@@ -7489,10 +7734,7 @@ package body Sem_Ch13 is
-- record, both at location zero. This seems a bit strange, but
-- it seems to happen in some circumstances, perhaps on an error.
- if Chars (C1_Ent) = Name_uTag
- and then
- Chars (C2_Ent) = Name_uTag
- then
+ if Nam_In (Chars (C1_Ent), Name_uTag, Name_uTag) then
return;
end if;
@@ -9002,7 +9244,13 @@ package body Sem_Ch13 is
procedure Too_Late is
begin
- Error_Msg_N ("|representation item appears too late!", N);
+ -- Other compilers seem more relaxed about rep items appearing too
+ -- late. Since analysis tools typically don't care about rep items
+ -- anyway, no reason to be too strict about this.
+
+ if not Relaxed_RM_Semantics then
+ Error_Msg_N ("|representation item appears too late!", N);
+ end if;
end Too_Late;
-- Start of processing for Rep_Item_Too_Late
@@ -9017,7 +9265,7 @@ package body Sem_Ch13 is
and then not From_With_Type (T)
- -- Exclude generated entitiesa (not coming from source). The common
+ -- Exclude generated entities (not coming from source). The common
-- case is when we generate a renaming which prematurely freezes the
-- renamed internal entity, but we still want to be able to set copies
-- of attribute values such as Size/Alignment.
@@ -9066,11 +9314,8 @@ package body Sem_Ch13 is
declare
Pname : constant Name_Id := Pragma_Name (N);
begin
- if Pname = Name_Convention or else
- Pname = Name_Import or else
- Pname = Name_Export or else
- Pname = Name_External or else
- Pname = Name_Interface
+ if Nam_In (Pname, Name_Convention, Name_Import, Name_Export,
+ Name_External, Name_Interface)
then
return False;
end if;
@@ -9223,12 +9468,16 @@ package body Sem_Ch13 is
return False;
end if;
- -- Representations are different if component alignments differ
+ -- Representations are different if component alignments or scalar
+ -- storage orders differ.
if (Is_Record_Type (T1) or else Is_Array_Type (T1))
- and then
+ and then
(Is_Record_Type (T2) or else Is_Array_Type (T2))
- and then Component_Alignment (T1) /= Component_Alignment (T2)
+ and then
+ (Component_Alignment (T1) /= Component_Alignment (T2)
+ or else
+ Reverse_Storage_Order (T1) /= Reverse_Storage_Order (T2))
then
return False;
end if;
@@ -9305,7 +9554,7 @@ package body Sem_Ch13 is
function Same_Rep return Boolean;
-- CD1 and CD2 are either components or discriminants. This
- -- function tests whether the two have the same representation
+ -- function tests whether they have the same representation.
--------------
-- Same_Rep --
@@ -9315,8 +9564,11 @@ package body Sem_Ch13 is
begin
if No (Component_Clause (CD1)) then
return No (Component_Clause (CD2));
-
else
+ -- Note: at this point, component clauses have been
+ -- normalized to the default bit order, so that the
+ -- comparison of Component_Bit_Offsets is meaningful.
+
return
Present (Component_Clause (CD2))
and then
@@ -9665,8 +9917,7 @@ package body Sem_Ch13 is
procedure No_Independence is
begin
if Pragma_Name (N) = Name_Independent then
- Error_Msg_NE
- ("independence cannot be guaranteed for&", N, E);
+ Error_Msg_NE ("independence cannot be guaranteed for&", N, E);
else
Error_Msg_NE
("independent components cannot be guaranteed for&", N, E);
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 2346b10a1d0..9a687dbfaa7 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -1661,6 +1661,15 @@ package body Sem_Ch3 is
(New_Subp, Is_Abstract_Subprogram (Prim));
Set_Interface_Alias (New_Subp, Iface_Prim);
+ -- If the returned type is an interface then propagate it to
+ -- the returned type. Needed by the thunk to generate the code
+ -- which displaces "this" to reference the corresponding
+ -- secondary dispatch table in the returned object.
+
+ if Is_Interface (Etype (Iface_Prim)) then
+ Set_Etype (New_Subp, Etype (Iface_Prim));
+ end if;
+
-- Internal entities associated with interface types are
-- only registered in the list of primitives of the tagged
-- type. They are only used to fill the contents of the
@@ -8347,7 +8356,6 @@ package body Sem_Ch3 is
and then Present (Full_View (T))
then
Analyze_And_Resolve (Expr, BDT, Suppress => Overflow_Check);
-
else
Analyze_And_Resolve (Expr, BDT);
end if;
@@ -9643,7 +9651,7 @@ package body Sem_Ch3 is
elsif Is_Subprogram (E)
and then (not Comes_From_Source (E)
- or else Chars (E) = Name_uCall)
+ or else Chars (E) = Name_uCall)
then
null;
@@ -12060,9 +12068,9 @@ package body Sem_Ch3 is
Set_Ekind (Def_Id, E_Signed_Integer_Subtype);
end if;
- Set_Etype (Def_Id, Base_Type (T));
- Set_Size_Info (Def_Id, (T));
- Set_First_Rep_Item (Def_Id, First_Rep_Item (T));
+ Set_Etype (Def_Id, Base_Type (T));
+ Set_Size_Info (Def_Id, (T));
+ Set_First_Rep_Item (Def_Id, First_Rep_Item (T));
Set_Discrete_RM_Size (Def_Id);
end Constrain_Integer;
@@ -12078,10 +12086,10 @@ package body Sem_Ch3 is
begin
Set_Ekind (Def_Id, E_Ordinary_Fixed_Point_Subtype);
- Set_Etype (Def_Id, Base_Type (T));
- Set_Size_Info (Def_Id, (T));
- Set_First_Rep_Item (Def_Id, First_Rep_Item (T));
- Set_Small_Value (Def_Id, Small_Value (T));
+ Set_Etype (Def_Id, Base_Type (T));
+ Set_Size_Info (Def_Id, (T));
+ Set_First_Rep_Item (Def_Id, First_Rep_Item (T));
+ Set_Small_Value (Def_Id, Small_Value (T));
-- Process the constraint
@@ -12429,9 +12437,7 @@ package body Sem_Ch3 is
then
Old_C := First_Component (Typ);
while Present (Old_C) loop
- if Chars ((Old_C)) = Name_uTag
- or else Chars ((Old_C)) = Name_uParent
- then
+ if Nam_In (Chars (Old_C), Name_uTag, Name_uParent) then
Append_Elmt (Old_C, Comp_List);
end if;
@@ -13268,9 +13274,9 @@ package body Sem_Ch3 is
or else Is_Internal (Parent_Subp)
or else Is_Private_Overriding
or else Is_Internal_Name (Chars (Parent_Subp))
- or else Chars (Parent_Subp) = Name_Initialize
- or else Chars (Parent_Subp) = Name_Adjust
- or else Chars (Parent_Subp) = Name_Finalize
+ or else Nam_In (Chars (Parent_Subp), Name_Initialize,
+ Name_Adjust,
+ Name_Finalize)
then
Set_Derived_Name;
@@ -13443,10 +13449,9 @@ package body Sem_Ch3 is
-- set on both views of the type.
if Is_Controlled (Parent_Type)
- and then
- (Chars (Parent_Subp) = Name_Initialize or else
- Chars (Parent_Subp) = Name_Adjust or else
- Chars (Parent_Subp) = Name_Finalize)
+ and then Nam_In (Chars (Parent_Subp), Name_Initialize,
+ Name_Adjust,
+ Name_Finalize)
and then Is_Hidden (Parent_Subp)
and then not Is_Visibly_Controlled (Parent_Type)
then
@@ -16324,31 +16329,6 @@ package body Sem_Ch3 is
end Inherit_Components;
-----------------------
- -- Is_Constant_Bound --
- -----------------------
-
- function Is_Constant_Bound (Exp : Node_Id) return Boolean is
- begin
- if Compile_Time_Known_Value (Exp) then
- return True;
-
- elsif Is_Entity_Name (Exp)
- and then Present (Entity (Exp))
- then
- return Is_Constant_Object (Entity (Exp))
- or else Ekind (Entity (Exp)) = E_Enumeration_Literal;
-
- elsif Nkind (Exp) in N_Binary_Op then
- return Is_Constant_Bound (Left_Opnd (Exp))
- and then Is_Constant_Bound (Right_Opnd (Exp))
- and then Scope (Entity (Exp)) = Standard_Standard;
-
- else
- return False;
- end if;
- end Is_Constant_Bound;
-
- -----------------------
-- Is_Null_Extension --
-----------------------
@@ -19343,7 +19323,7 @@ package body Sem_Ch3 is
or else
(Is_Class_Wide_Type (Entity (Subt))
and then
- Chars (Etype (Base_Type (Entity (Subt)))) =
+ Chars (Etype (Base_Type (Entity (Subt)))) =
Type_Id));
end if;
@@ -20179,7 +20159,7 @@ package body Sem_Ch3 is
-- Complete both implicit base and declared first subtype entities
- Set_Etype (Implicit_Base, Base_Typ);
+ Set_Etype (Implicit_Base, Base_Typ);
Set_Size_Info (Implicit_Base, (Base_Typ));
Set_RM_Size (Implicit_Base, RM_Size (Base_Typ));
Set_First_Rep_Item (Implicit_Base, First_Rep_Item (Base_Typ));
diff --git a/gcc/ada/sem_ch3.ads b/gcc/ada/sem_ch3.ads
index 98a8dbc8ce3..a0b37ea0a5b 100644
--- a/gcc/ada/sem_ch3.ads
+++ b/gcc/ada/sem_ch3.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -174,12 +174,6 @@ package Sem_Ch3 is
-- Given a discriminant somewhere in the Typ_For_Constraint tree and a
-- Constraint, return the value of that discriminant.
- function Is_Constant_Bound (Exp : Node_Id) return Boolean;
- -- Exp is the expression for an array bound. Determines whether the
- -- bound is a compile-time known value, or a constant entity, or an
- -- enumeration literal, or an expression composed of constant-bound
- -- subexpressions which are evaluated by means of standard operators.
-
function Is_Null_Extension (T : Entity_Id) return Boolean;
-- Returns True if the tagged type T has an N_Full_Type_Declaration that
-- is a null extension, meaning that it has an extension part without any
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 421cd81b5c3..83d71aa8aa2 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -413,8 +413,8 @@ package body Sem_Ch4 is
if Comes_From_Source (N) then
Check_Restriction (No_Allocators, N);
- -- Processing for No_Allocators_After_Elaboration, loop to look at
- -- enclosing context, checking task case and main subprogram case.
+ -- Processing for No_Standard_Allocators_After_Elaboration, loop to
+ -- look at enclosing context, checking task/main subprogram case.
C := N;
P := Parent (C);
@@ -431,7 +431,8 @@ package body Sem_Ch4 is
-- violation of No_Allocators_After_Elaboration we can detect.
if Nkind (Original_Node (Parent (P))) = N_Task_Body then
- Check_Restriction (No_Allocators_After_Elaboration, N);
+ Check_Restriction
+ (No_Standard_Allocators_After_Elaboration, N);
exit;
end if;
@@ -866,6 +867,11 @@ package body Sem_Ch4 is
-- Flag indicates whether an interpretation of the prefix is a
-- parameterless call that returns an access_to_subprogram.
+ procedure Check_Ghost_Function_Call;
+ -- Verify the legality of a call to a ghost function. Such calls can
+ -- appear only in assertion expressions except subtype predicates or
+ -- from within another ghost function.
+
procedure Check_Mixed_Parameter_And_Named_Associations;
-- Check that parameter and named associations are not mixed. This is
-- a restriction in SPARK mode.
@@ -880,6 +886,38 @@ package body Sem_Ch4 is
procedure No_Interpretation;
-- Output error message when no valid interpretation exists
+ -------------------------------
+ -- Check_Ghost_Function_Call --
+ -------------------------------
+
+ procedure Check_Ghost_Function_Call is
+ S : Entity_Id;
+
+ begin
+ -- The ghost function appears inside an assertion expression
+
+ if In_Assertion_Expression (N) then
+ return;
+
+ else
+ S := Current_Scope;
+ while Present (S) and then S /= Standard_Standard loop
+
+ -- The call appears inside another ghost function
+
+ if Is_Ghost_Function (S) then
+ return;
+ end if;
+
+ S := Scope (S);
+ end loop;
+ end if;
+
+ Error_Msg_N
+ ("call to ghost function must appear in assertion expression or "
+ & "another ghost function", N);
+ end Check_Ghost_Function_Call;
+
--------------------------------------------------
-- Check_Mixed_Parameter_And_Named_Associations --
--------------------------------------------------
@@ -970,6 +1008,12 @@ package body Sem_Ch4 is
Check_Mixed_Parameter_And_Named_Associations;
end if;
+ -- Mark a function that appears inside an assertion expression
+
+ if Nkind (N) = N_Function_Call and then In_Assertion_Expr > 0 then
+ Set_In_Assertion_Expression (N);
+ end if;
+
-- Initialize the type of the result of the call to the error type,
-- which will be reset if the type is successfully resolved.
@@ -1076,6 +1120,8 @@ package body Sem_Ch4 is
Set_Etype (Nam_Ent, Etype (N));
end if;
+ -- Overloaded call
+
else
-- An overloaded selected component must denote overloaded operations
-- of a concurrent type. The interpretations are attached to the
@@ -1160,9 +1206,9 @@ package body Sem_Ch4 is
Get_Next_Interp (X, It);
end loop;
- -- If the name is the result of a function call, it can only
- -- be a call to a function returning an access to subprogram.
- -- Insert explicit dereference.
+ -- If the name is the result of a function call, it can only be a
+ -- call to a function returning an access to subprogram. Insert
+ -- explicit dereference.
if Nkind (Nam) = N_Function_Call then
Insert_Explicit_Dereference (Nam);
@@ -1241,6 +1287,13 @@ package body Sem_Ch4 is
End_Interp_List;
end if;
+
+ -- A call to a ghost function is allowed only in assertion expressions,
+ -- excluding subtype predicates, or from within another ghost function.
+
+ if Is_Ghost_Function (Get_Subprogram_Entity (N)) then
+ Check_Ghost_Function_Call;
+ end if;
end Analyze_Call;
-----------------------------
@@ -1248,14 +1301,8 @@ package body Sem_Ch4 is
-----------------------------
procedure Analyze_Case_Expression (N : Node_Id) is
- Expr : constant Node_Id := Expression (N);
- FirstX : constant Node_Id := Expression (First (Alternatives (N)));
- Alt : Node_Id;
- Exp_Type : Entity_Id;
- Exp_Btype : Entity_Id;
-
- Dont_Care : Boolean;
- Others_Present : Boolean;
+ function Has_Static_Predicate (Subtyp : Entity_Id) return Boolean;
+ -- Determine whether subtype Subtyp has aspect Static_Predicate
procedure Non_Static_Choice_Error (Choice : Node_Id);
-- Error routine invoked by the generic instantiation below when
@@ -1270,6 +1317,28 @@ package body Sem_Ch4 is
Process_Associated_Node => No_OP);
use Case_Choices_Processing;
+ --------------------------
+ -- Has_Static_Predicate --
+ --------------------------
+
+ function Has_Static_Predicate (Subtyp : Entity_Id) return Boolean is
+ Item : Node_Id;
+
+ begin
+ Item := First_Rep_Item (Subtyp);
+ while Present (Item) loop
+ if Nkind (Item) = N_Aspect_Specification
+ and then Chars (Identifier (Item)) = Name_Static_Predicate
+ then
+ return True;
+ end if;
+
+ Next_Rep_Item (Item);
+ end loop;
+
+ return False;
+ end Has_Static_Predicate;
+
-----------------------------
-- Non_Static_Choice_Error --
-----------------------------
@@ -1280,6 +1349,17 @@ package body Sem_Ch4 is
("choice given in case expression is not static!", Choice);
end Non_Static_Choice_Error;
+ -- Local variables
+
+ Expr : constant Node_Id := Expression (N);
+ FirstX : constant Node_Id := Expression (First (Alternatives (N)));
+ Alt : Node_Id;
+ Exp_Type : Entity_Id;
+ Exp_Btype : Entity_Id;
+
+ Dont_Care : Boolean;
+ Others_Present : Boolean;
+
-- Start of processing for Analyze_Case_Expression
begin
@@ -1364,9 +1444,22 @@ package body Sem_Ch4 is
Exp_Type := Exp_Btype;
end if;
+ -- The case expression alternatives cover the range of a static subtype
+ -- subject to aspect Static_Predicate. Do not check the choices when the
+ -- case expression has not been fully analyzed yet because this may lead
+ -- to bogus errors.
+
+ if Is_Static_Subtype (Exp_Type)
+ and then Has_Static_Predicate (Exp_Type)
+ and then In_Spec_Expression
+ then
+ null;
+
-- Call instantiated Analyze_Choices which does the rest of the work
- Analyze_Choices (N, Exp_Type, Dont_Care, Others_Present);
+ else
+ Analyze_Choices (N, Exp_Type, Dont_Care, Others_Present);
+ end if;
if Exp_Type = Universal_Integer and then not Others_Present then
Error_Msg_N
@@ -1896,13 +1989,15 @@ package body Sem_Ch4 is
begin
A := First (Actions (N));
- loop
+ while Present (A) loop
Analyze (A);
Next (A);
- exit when No (A);
end loop;
- -- This test needs a comment ???
+ -- We currently hijack Expression_With_Actions with a VOID type and
+ -- a NULL statement in the Expression. This will ultimately be replaced
+ -- by a proper separate N_Compound_Statement node, at which point the
+ -- test below can go away???
if Nkind (Expression (N)) = N_Null_Statement then
Set_Etype (N, Standard_Void_Type);
@@ -4016,13 +4111,11 @@ package body Sem_Ch4 is
and then Nkind (Name) /= N_Selected_Component)
or else
(Nkind (Parent_N) = N_Attribute_Reference
- and then (Attribute_Name (Parent_N) = Name_First
- or else
- Attribute_Name (Parent_N) = Name_Last
- or else
- Attribute_Name (Parent_N) = Name_Length
- or else
- Attribute_Name (Parent_N) = Name_Range)))
+ and then
+ Nam_In (Attribute_Name (Parent_N), Name_First,
+ Name_Last,
+ Name_Length,
+ Name_Range)))
then
Set_Etype (N, Etype (Comp));
@@ -4685,9 +4778,9 @@ package body Sem_Ch4 is
elsif Nkind (Expr) = N_Attribute_Reference
and then
- (Attribute_Name (Expr) = Name_Access or else
- Attribute_Name (Expr) = Name_Unchecked_Access or else
- Attribute_Name (Expr) = Name_Unrestricted_Access)
+ Nam_In (Attribute_Name (Expr), Name_Access,
+ Name_Unchecked_Access,
+ Name_Unrestricted_Access)
then
Error_Msg_N ("argument of conversion cannot be access", N);
Error_Msg_N ("\use qualified expression instead", N);
@@ -4942,8 +5035,7 @@ package body Sem_Ch4 is
-- Start of processing for Check_Arithmetic_Pair
begin
- if Op_Name = Name_Op_Add or else Op_Name = Name_Op_Subtract then
-
+ if Nam_In (Op_Name, Name_Op_Add, Name_Op_Subtract) then
if Is_Numeric_Type (T1)
and then Is_Numeric_Type (T2)
and then (Covers (T1 => T1, T2 => T2)
@@ -4953,11 +5045,9 @@ package body Sem_Ch4 is
Add_One_Interp (N, Op_Id, Specific_Type (T1, T2));
end if;
- elsif Op_Name = Name_Op_Multiply or else Op_Name = Name_Op_Divide then
-
+ elsif Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide) then
if Is_Fixed_Point_Type (T1)
- and then (Is_Fixed_Point_Type (T2)
- or else T2 = Universal_Real)
+ and then (Is_Fixed_Point_Type (T2) or else T2 = Universal_Real)
then
-- If Treat_Fixed_As_Integer is set then the Etype is already set
-- and no further processing is required (this is the case of an
@@ -4995,7 +5085,7 @@ package body Sem_Ch4 is
elsif Is_Fixed_Point_Type (T1)
and then (Base_Type (T2) = Base_Type (Standard_Integer)
- or else T2 = Universal_Integer)
+ or else T2 = Universal_Integer)
then
Add_One_Interp (N, Op_Id, T1);
@@ -5012,7 +5102,7 @@ package body Sem_Ch4 is
elsif Is_Fixed_Point_Type (T2)
and then (Base_Type (T1) = Base_Type (Standard_Integer)
- or else T1 = Universal_Integer)
+ or else T1 = Universal_Integer)
and then Op_Name = Name_Op_Multiply
then
Add_One_Interp (N, Op_Id, T2);
@@ -6622,11 +6712,13 @@ package body Sem_Ch4 is
Func_Name := Empty;
if Is_Variable (Prefix) then
- Func_Name := Find_Aspect (Etype (Prefix), Aspect_Variable_Indexing);
+ Func_Name :=
+ Find_Value_Of_Aspect (Etype (Prefix), Aspect_Variable_Indexing);
end if;
if No (Func_Name) then
- Func_Name := Find_Aspect (Etype (Prefix), Aspect_Constant_Indexing);
+ Func_Name :=
+ Find_Value_Of_Aspect (Etype (Prefix), Aspect_Constant_Indexing);
end if;
-- If aspect does not exist the expression is illegal. Error is
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 2e8f3a7b2f0..6f57730e151 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -141,13 +141,13 @@ package body Sem_Ch5 is
-- directly.
elsif (Is_Prival (Ent)
- and then
- (Ekind (Current_Scope) = E_Function
- or else Ekind (Enclosing_Dynamic_Scope
- (Current_Scope)) = E_Function))
+ and then
+ (Ekind (Current_Scope) = E_Function
+ or else Ekind (Enclosing_Dynamic_Scope
+ (Current_Scope)) = E_Function))
or else
(Ekind (Ent) = E_Component
- and then Is_Protected_Type (Scope (Ent)))
+ and then Is_Protected_Type (Scope (Ent)))
then
Error_Msg_N
("protected function cannot modify protected object", N);
@@ -222,16 +222,15 @@ package body Sem_Ch5 is
if Is_Entity_Name (Opnd)
and then (Ekind (Entity (Opnd)) = E_Out_Parameter
- or else Ekind (Entity (Opnd)) =
- E_In_Out_Parameter
- or else Ekind (Entity (Opnd)) =
- E_Generic_In_Out_Parameter
+ or else Ekind_In (Entity (Opnd),
+ E_In_Out_Parameter,
+ E_Generic_In_Out_Parameter)
or else
(Ekind (Entity (Opnd)) = E_Variable
and then Nkind (Parent (Entity (Opnd))) =
- N_Object_Renaming_Declaration
+ N_Object_Renaming_Declaration
and then Nkind (Parent (Parent (Entity (Opnd)))) =
- N_Accept_Statement))
+ N_Accept_Statement))
then
Opnd_Type := Get_Actual_Subtype (Opnd);
@@ -394,7 +393,7 @@ package body Sem_Ch5 is
end loop;
if (Nkind (Ent) = N_Attribute_Reference
- and then Attribute_Name (Ent) = Name_Priority)
+ and then Attribute_Name (Ent) = Name_Priority)
-- Renamings of the attribute Priority applied to protected
-- objects have been previously expanded into calls to the
@@ -402,15 +401,15 @@ package body Sem_Ch5 is
or else
(Nkind (Ent) = N_Function_Call
- and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling)
- or else
- Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling)))
+ and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling)
+ or else
+ Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling)))
then
-- The enclosing subprogram cannot be a protected function
S := Current_Scope;
while not (Is_Subprogram (S)
- and then Convention (S) = Convention_Protected)
+ and then Convention (S) = Convention_Protected)
and then S /= Standard_Standard
loop
S := Scope (S);
@@ -583,8 +582,8 @@ package body Sem_Ch5 is
Propagate_Tag (Lhs, Rhs);
elsif Nkind (Rhs) = N_Function_Call
- and then Is_Entity_Name (Name (Rhs))
- and then Is_Abstract_Subprogram (Entity (Name (Rhs)))
+ and then Is_Entity_Name (Name (Rhs))
+ and then Is_Abstract_Subprogram (Entity (Name (Rhs)))
then
Error_Msg_N
("call to abstract function must be dispatching", Name (Rhs));
@@ -607,9 +606,7 @@ package body Sem_Ch5 is
-- as well to anonymous access-to-subprogram types that are component
-- subtypes or formal parameters.
- if Ada_Version >= Ada_2005
- and then Is_Access_Type (T1)
- then
+ if Ada_Version >= Ada_2005 and then Is_Access_Type (T1) then
if Is_Local_Anonymous_Access (T1)
or else Ekind (T2) = E_Anonymous_Access_Subprogram_Type
@@ -665,12 +662,10 @@ package body Sem_Ch5 is
-- assignment within the block.
elsif Is_Array_Type (T1)
- and then
- (Nkind (Rhs) /= N_Type_Conversion
- or else Is_Constrained (Etype (Rhs)))
- and then
- (Nkind (Rhs) /= N_Function_Call
- or else Nkind (N) /= N_Block_Statement)
+ and then (Nkind (Rhs) /= N_Type_Conversion
+ or else Is_Constrained (Etype (Rhs)))
+ and then (Nkind (Rhs) /= N_Function_Call
+ or else Nkind (N) /= N_Block_Statement)
then
-- Assignment verifies that the length of the Lsh and Rhs are equal,
-- but of course the indexes do not have to match. If the right-hand
@@ -1172,7 +1167,7 @@ package body Sem_Ch5 is
elsif Ada_Version = Ada_83
and then (Is_Generic_Type (Exp_Btype)
- or else Is_Generic_Type (Root_Type (Exp_Btype)))
+ or else Is_Generic_Type (Root_Type (Exp_Btype)))
then
Error_Msg_N
("(Ada 83) case expression cannot be of a generic type", Exp);
@@ -1198,9 +1193,7 @@ package body Sem_Ch5 is
-- A case statement with a single OTHERS alternative is not allowed
-- in SPARK.
- if Others_Present
- and then List_Length (Alternatives (N)) = 1
- then
+ if Others_Present and then List_Length (Alternatives (N)) = 1 then
Check_SPARK_Restriction
("OTHERS as unique case alternative is not allowed", N);
end if;
@@ -1297,9 +1290,7 @@ package body Sem_Ch5 is
Scope_Id := Scope_Stack.Table (J).Entity;
Kind := Ekind (Scope_Id);
- if Kind = E_Loop
- and then (No (Target) or else Scope_Id = U_Name)
- then
+ if Kind = E_Loop and then (No (Target) or else Scope_Id = U_Name) then
Set_Has_Exit (Scope_Id);
exit;
@@ -1423,9 +1414,7 @@ package body Sem_Ch5 is
Scope_Id := Scope_Stack.Table (J).Entity;
if Label_Scope = Scope_Id
- or else (Ekind (Scope_Id) /= E_Block
- and then Ekind (Scope_Id) /= E_Loop
- and then Ekind (Scope_Id) /= E_Return_Statement)
+ or else not Ekind_In (Scope_Id, E_Block, E_Loop, E_Return_Statement)
then
if Scope_Id /= Label_Scope then
Error_Msg_N
@@ -1447,9 +1436,9 @@ package body Sem_Ch5 is
-- The expander has circuitry to completely delete code that it can tell
-- will not be executed (as a result of compile time known conditions). In
- -- the analyzer, we ensure that code that will be deleted in this manner is
- -- analyzed but not expanded. This is obviously more efficient, but more
- -- significantly, difficulties arise if code is expanded and then
+ -- the analyzer, we ensure that code that will be deleted in this manner
+ -- is analyzed but not expanded. This is obviously more efficient, but
+ -- more significantly, difficulties arise if code is expanded and then
-- eliminated (e.g. exception table entries disappear). Similarly, itypes
-- generated in deleted code must be frozen from start, because the nodes
-- on which they depend will not be available at the freeze point.
@@ -1800,7 +1789,7 @@ package body Sem_Ch5 is
declare
Element : constant Entity_Id :=
- Find_Aspect (Typ, Aspect_Iterator_Element);
+ Find_Value_Of_Aspect (Typ, Aspect_Iterator_Element);
begin
if No (Element) then
Error_Msg_NE ("cannot iterate over&", N, Typ);
@@ -1811,7 +1800,7 @@ package body Sem_Ch5 is
-- If the container has a variable indexing aspect, the
-- element is a variable and is modifiable in the loop.
- if Present (Find_Aspect (Typ, Aspect_Variable_Indexing)) then
+ if Has_Aspect (Typ, Aspect_Variable_Indexing) then
Set_Ekind (Def_Id, E_Variable);
end if;
end if;
@@ -1825,7 +1814,7 @@ package body Sem_Ch5 is
if Is_Entity_Name (Original_Node (Name (N)))
and then not Is_Iterator (Typ)
then
- if No (Find_Aspect (Typ, Aspect_Iterator_Element)) then
+ if not Has_Aspect (Typ, Aspect_Iterator_Element) then
Error_Msg_NE
("cannot iterate over&", Name (N), Typ);
else
@@ -2161,15 +2150,11 @@ package body Sem_Ch5 is
-- Propagate staticness to loop range itself, in case the
-- corresponding subtype is static.
- if New_Lo /= Lo
- and then Is_Static_Expression (New_Lo)
- then
+ if New_Lo /= Lo and then Is_Static_Expression (New_Lo) then
Rewrite (Low_Bound (R), New_Copy (New_Lo));
end if;
- if New_Hi /= Hi
- and then Is_Static_Expression (New_Hi)
- then
+ if New_Hi /= Hi and then Is_Static_Expression (New_Hi) then
Rewrite (High_Bound (R), New_Copy (New_Hi));
end if;
end Process_Bounds;
@@ -2238,9 +2223,8 @@ package body Sem_Ch5 is
-- new iterator form.
if Nkind (DS_Copy) = N_Function_Call
- or else
- (Is_Entity_Name (DS_Copy)
- and then not Is_Type (Entity (DS_Copy)))
+ or else (Is_Entity_Name (DS_Copy)
+ and then not Is_Type (Entity (DS_Copy)))
then
-- This is an iterator specification. Rewrite it as such and
-- analyze it to capture function calls that may require
@@ -2351,7 +2335,7 @@ package body Sem_Ch5 is
and then Is_Itype (Etype (Id))
and then Nkind (Parent (Loop_Nod)) = N_Expression_With_Actions
and then Nkind (Original_Node (Parent (Loop_Nod))) =
- N_Quantified_Expression)
+ N_Quantified_Expression)
then
Set_Etype (Id, Etype (DS));
end if;
@@ -2395,9 +2379,8 @@ package body Sem_Ch5 is
-- instance, since in practice they tend to be dubious in these
-- cases since they can result from intended parametrization.
- if not Inside_A_Generic
- and then not In_Instance
- then
+ if not Inside_A_Generic and then not In_Instance then
+
-- Specialize msg if invalid values could make the loop
-- non-null after all.
@@ -2436,7 +2419,7 @@ package body Sem_Ch5 is
-- The other case for a warning is a reverse loop where the
-- upper bound is the integer literal zero or one, and the
- -- lower bound can be positive.
+ -- lower bound may exceed this value.
-- For example, we have
@@ -2449,10 +2432,23 @@ package body Sem_Ch5 is
and then Nkind (Original_Node (H)) = N_Integer_Literal
and then
(Intval (Original_Node (H)) = Uint_0
- or else Intval (Original_Node (H)) = Uint_1)
+ or else
+ Intval (Original_Node (H)) = Uint_1)
then
- Error_Msg_N ("??loop range may be null", DS);
- Error_Msg_N ("\??bounds may be wrong way round", DS);
+ -- Lower bound may in fact be known and known not to exceed
+ -- upper bound (e.g. reverse 0 .. 1) and that's OK.
+
+ if Compile_Time_Known_Value (L)
+ and then Expr_Value (L) <= Expr_Value (H)
+ then
+ null;
+
+ -- Otherwise warning is warranted
+
+ else
+ Error_Msg_N ("??loop range may be null", DS);
+ Error_Msg_N ("\??bounds may be wrong way round", DS);
+ end if;
end if;
end;
end if;
@@ -2839,9 +2835,7 @@ package body Sem_Ch5 is
P : Node_Id;
begin
- if Is_List_Member (N)
- and then Comes_From_Source (N)
- then
+ if Is_List_Member (N) and then Comes_From_Source (N) then
declare
Nxt : Node_Id;
@@ -2993,9 +2987,8 @@ package body Sem_Ch5 is
Analyze (R_Copy);
- if Nkind (R_Copy) in N_Subexpr
- and then Is_Overloaded (R_Copy)
- then
+ if Nkind (R_Copy) in N_Subexpr and then Is_Overloaded (R_Copy) then
+
-- Apply preference rules for range of predefined integer types, or
-- diagnose true ambiguity.
@@ -3037,9 +3030,7 @@ package body Sem_Ch5 is
-- Subtype mark in iteration scheme
- if Is_Entity_Name (R_Copy)
- and then Is_Type (Entity (R_Copy))
- then
+ if Is_Entity_Name (R_Copy) and then Is_Type (Entity (R_Copy)) then
null;
-- Expression in range, or Ada 2012 iterator
@@ -3053,9 +3044,9 @@ package body Sem_Ch5 is
-- Check that the resulting object is an iterable container
- elsif Present (Find_Aspect (Typ, Aspect_Iterator_Element))
- or else Present (Find_Aspect (Typ, Aspect_Constant_Indexing))
- or else Present (Find_Aspect (Typ, Aspect_Variable_Indexing))
+ elsif Has_Aspect (Typ, Aspect_Iterator_Element)
+ or else Has_Aspect (Typ, Aspect_Constant_Indexing)
+ or else Has_Aspect (Typ, Aspect_Variable_Indexing)
then
null;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 728e4a7a8d7..6f2bee5659c 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -101,6 +101,11 @@ package body Sem_Ch6 is
-- Local Subprograms --
-----------------------
+ procedure Analyze_Null_Procedure
+ (N : Node_Id;
+ Is_Completion : out Boolean);
+ -- A null procedure can be a declaration or (Ada 2012) a completion.
+
procedure Analyze_Return_Statement (N : Node_Id);
-- Common processing for simple and extended return statements
@@ -362,9 +367,7 @@ package body Sem_Ch6 is
Analyze (New_Body);
Set_Is_Inlined (Prev);
- elsif Present (Prev)
- and then Comes_From_Source (Prev)
- then
+ elsif Present (Prev) and then Comes_From_Source (Prev) then
Set_Has_Completion (Prev, False);
-- For navigation purposes, indicate that the function is a body
@@ -436,9 +439,9 @@ package body Sem_Ch6 is
begin
if Nkind (Par) = N_Package_Specification
- and then Decls = Visible_Declarations (Par)
- and then Present (Private_Declarations (Par))
- and then not Is_Empty_List (Private_Declarations (Par))
+ and then Decls = Visible_Declarations (Par)
+ and then Present (Private_Declarations (Par))
+ and then not Is_Empty_List (Private_Declarations (Par))
then
Decls := Private_Declarations (Par);
end if;
@@ -446,7 +449,18 @@ package body Sem_Ch6 is
Insert_After (Last (Decls), New_Body);
Push_Scope (Id);
Install_Formals (Id);
- Preanalyze_Spec_Expression (Expression (Ret), Etype (Id));
+
+ -- Do a preanalysis of the expression on a separate copy, to
+ -- prevent visibility issues later with operators in instances.
+ -- Attach copy to tree so that parent links are available.
+
+ declare
+ Expr : constant Node_Id := New_Copy_Tree (Expression (Ret));
+ begin
+ Set_Parent (Expr, Ret);
+ Preanalyze_Spec_Expression (Expr, Etype (Id));
+ end;
+
End_Scope;
end;
end if;
@@ -472,19 +486,19 @@ package body Sem_Ch6 is
----------------------------
procedure Analyze_Function_Call (N : Node_Id) is
- P : constant Node_Id := Name (N);
- Actuals : constant List_Id := Parameter_Associations (N);
- Actual : Node_Id;
+ Actuals : constant List_Id := Parameter_Associations (N);
+ Func_Nam : constant Node_Id := Name (N);
+ Actual : Node_Id;
begin
- Analyze (P);
+ Analyze (Func_Nam);
-- A call of the form A.B (X) may be an Ada 2005 call, which is
-- rewritten as B (A, X). If the rewriting is successful, the call
-- has been analyzed and we just return.
- if Nkind (P) = N_Selected_Component
- and then Name (N) /= P
+ if Nkind (Func_Nam) = N_Selected_Component
+ and then Name (N) /= Func_Nam
and then Is_Rewrite_Substitution (N)
and then Present (Etype (N))
then
@@ -493,7 +507,7 @@ package body Sem_Ch6 is
-- If error analyzing name, then set Any_Type as result type and return
- if Etype (P) = Any_Type then
+ if Etype (Func_Nam) = Any_Type then
Set_Etype (N, Any_Type);
return;
end if;
@@ -510,12 +524,6 @@ package body Sem_Ch6 is
end if;
Analyze_Call (N);
-
- -- Mark function call if within assertion
-
- if In_Assertion_Expr /= 0 then
- Set_In_Assertion (N);
- end if;
end Analyze_Function_Call;
-----------------------------
@@ -523,9 +531,9 @@ package body Sem_Ch6 is
-----------------------------
procedure Analyze_Function_Return (N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Stm_Entity : constant Entity_Id := Return_Statement_Entity (N);
- Scope_Id : constant Entity_Id := Return_Applies_To (Stm_Entity);
+ Loc : constant Source_Ptr := Sloc (N);
+ Stm_Entity : constant Entity_Id := Return_Statement_Entity (N);
+ Scope_Id : constant Entity_Id := Return_Applies_To (Stm_Entity);
R_Type : constant Entity_Id := Etype (Scope_Id);
-- Function result subtype
@@ -882,7 +890,7 @@ package body Sem_Ch6 is
if Present (Expr)
- -- Defend against previous errors
+ -- Defend against previous errors
and then Nkind (Expr) /= N_Empty
and then Present (Etype (Expr))
@@ -1204,6 +1212,137 @@ package body Sem_Ch6 is
End_Generic;
end Analyze_Generic_Subprogram_Body;
+ ----------------------------
+ -- Analyze_Null_Procedure --
+ ----------------------------
+
+ procedure Analyze_Null_Procedure
+ (N : Node_Id;
+ Is_Completion : out Boolean)
+ is
+ Loc : constant Source_Ptr := Sloc (N);
+ Spec : constant Node_Id := Specification (N);
+ Designator : Entity_Id;
+ Form : Node_Id;
+ Null_Body : Node_Id := Empty;
+ Prev : Entity_Id;
+
+ begin
+ -- Capture the profile of the null procedure before analysis, for
+ -- expansion at the freeze point and at each point of call. The body is
+ -- used if the procedure has preconditions, or if it is a completion. In
+ -- the first case the body is analyzed at the freeze point, in the other
+ -- it replaces the null procedure declaration.
+
+ Null_Body :=
+ Make_Subprogram_Body (Loc,
+ Specification => New_Copy_Tree (Spec),
+ Declarations => New_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (Make_Null_Statement (Loc))));
+
+ -- Create new entities for body and formals
+
+ Set_Defining_Unit_Name (Specification (Null_Body),
+ Make_Defining_Identifier (Loc, Chars (Defining_Entity (N))));
+
+ Form := First (Parameter_Specifications (Specification (Null_Body)));
+ while Present (Form) loop
+ Set_Defining_Identifier (Form,
+ Make_Defining_Identifier (Loc, Chars (Defining_Identifier (Form))));
+ Next (Form);
+ end loop;
+
+ -- Determine whether the null procedure may be a completion of a generic
+ -- suprogram, in which case we use the new null body as the completion
+ -- and set minimal semantic information on the original declaration,
+ -- which is rewritten as a null statement.
+
+ Prev := Current_Entity_In_Scope (Defining_Entity (Spec));
+
+ if Present (Prev) and then Is_Generic_Subprogram (Prev) then
+ Insert_Before (N, Null_Body);
+ Set_Ekind (Defining_Entity (N), Ekind (Prev));
+ Set_Contract (Defining_Entity (N), Make_Contract (Loc));
+
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze_Generic_Subprogram_Body (Null_Body, Prev);
+ Is_Completion := True;
+ return;
+
+ else
+
+ -- Resolve the types of the formals now, because the freeze point
+ -- may appear in a different context, e.g. an instantiation.
+
+ Form := First (Parameter_Specifications (Specification (Null_Body)));
+ while Present (Form) loop
+ if Nkind (Parameter_Type (Form)) /= N_Access_Definition then
+ Find_Type (Parameter_Type (Form));
+
+ elsif
+ No (Access_To_Subprogram_Definition (Parameter_Type (Form)))
+ then
+ Find_Type (Subtype_Mark (Parameter_Type (Form)));
+
+ else
+ -- The case of a null procedure with a formal that is an
+ -- access_to_subprogram type, and that is used as an actual
+ -- in an instantiation is left to the enthusiastic reader.
+
+ null;
+ end if;
+
+ Next (Form);
+ end loop;
+ end if;
+
+ -- If there are previous overloadable entities with the same name,
+ -- check whether any of them is completed by the null procedure.
+
+ if Present (Prev) and then Is_Overloadable (Prev) then
+ Designator := Analyze_Subprogram_Specification (Spec);
+ Prev := Find_Corresponding_Spec (N);
+ end if;
+
+ if No (Prev) or else not Comes_From_Source (Prev) then
+ Designator := Analyze_Subprogram_Specification (Spec);
+ Set_Has_Completion (Designator);
+
+ -- Signal to caller that this is a procedure declaration
+
+ Is_Completion := False;
+
+ -- Null procedures are always inlined, but generic formal subprograms
+ -- which appear as such in the internal instance of formal packages,
+ -- need no completion and are not marked Inline.
+
+ if Expander_Active
+ and then Nkind (N) /= N_Formal_Concrete_Subprogram_Declaration
+ then
+ Set_Corresponding_Body (N, Defining_Entity (Null_Body));
+ Set_Body_To_Inline (N, Null_Body);
+ Set_Is_Inlined (Designator);
+ end if;
+
+ else
+ -- The null procedure is a completion
+
+ Is_Completion := True;
+
+ if Expander_Active then
+ Rewrite (N, Null_Body);
+ Analyze (N);
+
+ else
+ Designator := Analyze_Subprogram_Specification (Spec);
+ Set_Has_Completion (Designator);
+ Set_Has_Completion (Prev);
+ end if;
+ end if;
+ end Analyze_Null_Procedure;
+
-----------------------------
-- Analyze_Operator_Symbol --
-----------------------------
@@ -1220,7 +1359,7 @@ package body Sem_Ch6 is
begin
if (Nkind (Par) = N_Function_Call
- and then N = Name (Par))
+ and then N = Name (Par))
or else Nkind (Par) = N_Function_Instantiation
or else (Nkind (Par) = N_Indexed_Component
and then N = Prefix (Par))
@@ -1322,9 +1461,9 @@ package body Sem_Ch6 is
-- Special processing for Elab_Spec, Elab_Body and Elab_Subp_Body calls
if Nkind (P) = N_Attribute_Reference
- and then (Attribute_Name (P) = Name_Elab_Spec or else
- Attribute_Name (P) = Name_Elab_Body or else
- Attribute_Name (P) = Name_Elab_Subp_Body)
+ and then Nam_In (Attribute_Name (P), Name_Elab_Spec,
+ Name_Elab_Body,
+ Name_Elab_Subp_Body)
then
if Present (Actuals) then
Error_Msg_N
@@ -1410,11 +1549,9 @@ package body Sem_Ch6 is
-- function, the context will select the operation whose type is Void.
elsif Nkind (P) = N_Selected_Component
- and then (Ekind (Entity (Selector_Name (P))) = E_Entry
- or else
- Ekind (Entity (Selector_Name (P))) = E_Procedure
- or else
- Ekind (Entity (Selector_Name (P))) = E_Function)
+ and then Ekind_In (Entity (Selector_Name (P)), E_Entry,
+ E_Procedure,
+ E_Function)
then
Analyze_Call_And_Resolve;
@@ -1490,8 +1627,8 @@ package body Sem_Ch6 is
Returns_Object : constant Boolean :=
Nkind (N) = N_Extended_Return_Statement
or else
- (Nkind (N) = N_Simple_Return_Statement
- and then Present (Expression (N)));
+ (Nkind (N) = N_Simple_Return_Statement
+ and then Present (Expression (N)));
-- True if we're returning something; that is, "return <expression>;"
-- or "return Result : T [:= ...]". False for "return;". Used for error
-- checking: If Returns_Object is True, N should apply to a function
@@ -1685,9 +1822,7 @@ package body Sem_Ch6 is
-- Unconstrained array as result is not allowed in SPARK
- if Is_Array_Type (Typ)
- and then not Is_Constrained (Typ)
- then
+ if Is_Array_Type (Typ) and then not Is_Constrained (Typ) then
Check_SPARK_Restriction
("returning an unconstrained array is not allowed",
Result_Definition (N));
@@ -1703,9 +1838,7 @@ package body Sem_Ch6 is
-- right before this, because they don't get applied to types that
-- do not come from source.
- if Is_Access_Type (Typ)
- and then Null_Exclusion_Present (N)
- then
+ if Is_Access_Type (Typ) and then Null_Exclusion_Present (N) then
Set_Etype (Designator,
Create_Null_Excluding_Itype
(T => Typ,
@@ -1752,8 +1885,7 @@ package body Sem_Ch6 is
elsif Ekind (Typ) = E_Incomplete_Type
or else (Is_Class_Wide_Type (Typ)
- and then
- Ekind (Root_Type (Typ)) = E_Incomplete_Type)
+ and then Ekind (Root_Type (Typ)) = E_Incomplete_Type)
then
-- AI05-0151: Tagged incomplete types are allowed in all formal
-- parts. Untagged incomplete types are not allowed in bodies.
@@ -1952,7 +2084,7 @@ package body Sem_Ch6 is
Is_Limited_Record (Designated_Type (Etype (Scop)))))
and then Expander_Active
- -- Avoid cases with no tasking support
+ -- Avoid cases with no tasking support
and then RTE_Available (RE_Current_Master)
and then not Restriction_Active (No_Task_Hierarchy)
@@ -2019,14 +2151,14 @@ package body Sem_Ch6 is
return
Nkind (N) = N_Pragma
and then
- (Pragma_Name (N) = Name_Inline_Always
- or else
+ (Pragma_Name (N) = Name_Inline_Always
+ or else
(Front_End_Inlining
and then Pragma_Name (N) = Name_Inline))
and then
- Chars
- (Expression (First (Pragma_Argument_Associations (N))))
- = Chars (Body_Id);
+ Chars
+ (Expression (First (Pragma_Argument_Associations (N)))) =
+ Chars (Body_Id);
end Is_Inline_Pragma;
-- Start of processing for Check_Inline_Pragma
@@ -2490,9 +2622,7 @@ package body Sem_Ch6 is
-- part of the context of one of its subunits. No need to redo the
-- analysis.
- elsif Prev_Id = Body_Id
- and then Has_Completion (Body_Id)
- then
+ elsif Prev_Id = Body_Id and then Has_Completion (Body_Id) then
return;
else
@@ -2545,10 +2675,11 @@ package body Sem_Ch6 is
end if;
-- Ada 2012 aspects may appear in a subprogram body, but only if there
- -- is no previous spec.
+ -- is no previous spec. Ditto for a subprogram stub that does not have
+ -- a corresponding spec, but for which there may also be a spec_id.
if Has_Aspects (N) then
- if Present (Corresponding_Spec (N)) then
+ if Present (Spec_Id) then
Error_Msg_N
("aspect specifications must appear in subprogram declaration",
N);
@@ -2658,8 +2789,8 @@ package body Sem_Ch6 is
(Nkind (Original_Node (Spec_Decl)) =
N_Subprogram_Renaming_Declaration
or else (Present (Corresponding_Body (Spec_Decl))
- and then
- Nkind (Unit_Declaration_Node
+ and then
+ Nkind (Unit_Declaration_Node
(Corresponding_Body (Spec_Decl))) =
N_Subprogram_Renaming_Declaration))
then
@@ -2821,9 +2952,7 @@ package body Sem_Ch6 is
-- is the limited view of a class-wide type and the non-limited view is
-- available, update the return type accordingly.
- if Ada_Version >= Ada_2005
- and then Comes_From_Source (N)
- then
+ if Ada_Version >= Ada_2005 and then Comes_From_Source (N) then
declare
Etyp : Entity_Id;
Rtyp : Entity_Id;
@@ -2834,9 +2963,7 @@ package body Sem_Ch6 is
if Ekind (Rtyp) = E_Anonymous_Access_Type then
Etyp := Directly_Designated_Type (Rtyp);
- if Is_Class_Wide_Type (Etyp)
- and then From_With_Type (Etyp)
- then
+ if Is_Class_Wide_Type (Etyp) and then From_With_Type (Etyp) then
Set_Directly_Designated_Type
(Etype (Current_Scope), Available_View (Etyp));
end if;
@@ -2898,7 +3025,7 @@ package body Sem_Ch6 is
and then Expander_Active
and then
(Has_Pragma_Inline_Always (Spec_Id)
- or else (Has_Pragma_Inline (Spec_Id) and Front_End_Inlining))
+ or else (Has_Pragma_Inline (Spec_Id) and Front_End_Inlining))
then
Build_Body_To_Inline (N, Spec_Id);
end if;
@@ -3198,13 +3325,10 @@ package body Sem_Ch6 is
------------------------------------
procedure Analyze_Subprogram_Declaration (N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (N);
Scop : constant Entity_Id := Current_Scope;
Designator : Entity_Id;
- Form : Node_Id;
- Null_Body : Node_Id := Empty;
-
- -- Start of processing for Analyze_Subprogram_Declaration
+ Is_Completion : Boolean;
+ -- Indicates whether a null procedure declaration is a completion
begin
-- Null procedures are not allowed in SPARK
@@ -3213,63 +3337,18 @@ package body Sem_Ch6 is
and then Null_Present (Specification (N))
then
Check_SPARK_Restriction ("null procedure is not allowed", N);
- end if;
-
- -- For a null procedure, capture the profile before analysis, for
- -- expansion at the freeze point and at each point of call. The body
- -- will only be used if the procedure has preconditions. In that case
- -- the body is analyzed at the freeze point.
-
- if Nkind (Specification (N)) = N_Procedure_Specification
- and then Null_Present (Specification (N))
- and then Expander_Active
- then
- Null_Body :=
- Make_Subprogram_Body (Loc,
- Specification =>
- New_Copy_Tree (Specification (N)),
- Declarations =>
- New_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements => New_List (Make_Null_Statement (Loc))));
-
- -- Create new entities for body and formals
-
- Set_Defining_Unit_Name (Specification (Null_Body),
- Make_Defining_Identifier (Loc, Chars (Defining_Entity (N))));
-
- Form := First (Parameter_Specifications (Specification (Null_Body)));
- while Present (Form) loop
- Set_Defining_Identifier (Form,
- Make_Defining_Identifier (Loc,
- Chars (Defining_Identifier (Form))));
- -- Resolve the types of the formals now, because the freeze point
- -- may appear in a different context, e.g. an instantiation.
-
- if Nkind (Parameter_Type (Form)) /= N_Access_Definition then
- Find_Type (Parameter_Type (Form));
-
- elsif
- No (Access_To_Subprogram_Definition (Parameter_Type (Form)))
- then
- Find_Type (Subtype_Mark (Parameter_Type (Form)));
-
- else
+ if Is_Protected_Type (Current_Scope) then
+ Error_Msg_N ("protected operation cannot be a null procedure", N);
+ end if;
- -- the case of a null procedure with a formal that is an
- -- access_to_subprogram type, and that is used as an actual
- -- in an instantiation is left to the enthusiastic reader.
+ Analyze_Null_Procedure (N, Is_Completion);
- null;
- end if;
+ if Is_Completion then
- Next (Form);
- end loop;
+ -- The null procedure acts as a body, nothing further is needed.
- if Is_Protected_Type (Current_Scope) then
- Error_Msg_N ("protected operation cannot be a null procedure", N);
+ return;
end if;
end if;
@@ -3290,30 +3369,12 @@ package body Sem_Ch6 is
Indent;
end if;
- if Nkind (Specification (N)) = N_Procedure_Specification
- and then Null_Present (Specification (N))
- then
- Set_Has_Completion (Designator);
-
- -- Null procedures are always inlined, but generic formal subprograms
- -- which appear as such in the internal instance of formal packages,
- -- need no completion and are not marked Inline.
-
- if Present (Null_Body)
- and then Nkind (N) /= N_Formal_Concrete_Subprogram_Declaration
- then
- Set_Corresponding_Body (N, Defining_Entity (Null_Body));
- Set_Body_To_Inline (N, Null_Body);
- Set_Is_Inlined (Designator);
- end if;
- end if;
-
Validate_RCI_Subprogram_Declaration (N);
New_Overloaded_Entity (Designator);
Check_Delayed_Subprogram (Designator);
-- If the type of the first formal of the current subprogram is a
- -- nongeneric tagged private type, mark the subprogram as being a
+ -- non-generic tagged private type, mark the subprogram as being a
-- private primitive. Ditto if this is a function with controlling
-- result, and the return type is currently private. In both cases,
-- the type of the controlling argument or result must be in the
@@ -3373,7 +3434,7 @@ package body Sem_Ch6 is
if Is_Interface (Etyp)
and then not Is_Abstract_Subprogram (Designator)
and then not (Ekind (Designator) = E_Procedure
- and then Null_Present (Specification (N)))
+ and then Null_Present (Specification (N)))
then
Error_Msg_Name_1 := Chars (Defining_Entity (N));
@@ -3401,10 +3462,9 @@ package body Sem_Ch6 is
Set_Kill_Elaboration_Checks (Designator);
end if;
- if Scop /= Standard_Standard
- and then not Is_Child_Unit (Designator)
- then
+ if Scop /= Standard_Standard and then not Is_Child_Unit (Designator) then
Set_Categorization_From_Scope (Designator, Scop);
+
else
-- For a compilation unit, check for library-unit pragmas
@@ -3890,7 +3950,7 @@ package body Sem_Ch6 is
elsif No (Expression (N))
and then Nkind (Parent (Parent (N))) =
- N_Extended_Return_Statement
+ N_Extended_Return_Statement
then
return OK;
@@ -3932,7 +3992,7 @@ package body Sem_Ch6 is
return Present (Declarations (N))
and then Present (First (Declarations (N)))
and then Chars (Expression (Return_Statement)) =
- Chars (Defining_Identifier (First (Declarations (N))));
+ Chars (Defining_Identifier (First (Declarations (N))));
end if;
end Has_Single_Return;
@@ -3950,9 +4010,8 @@ package body Sem_Ch6 is
Nxt := Next (Decl);
if Nkind (Decl) = N_Pragma
- and then (Pragma_Name (Decl) = Name_Unreferenced
- or else
- Pragma_Name (Decl) = Name_Unmodified)
+ and then Nam_In (Pragma_Name (Decl), Name_Unreferenced,
+ Name_Unmodified)
then
Remove (Decl);
end if;
@@ -4455,8 +4514,8 @@ package body Sem_Ch6 is
Conv := Current_Entity (Id);
elsif Nkind_In (Id, N_Selected_Component, N_Expanded_Name)
- and then Chars (Selector_Name (Id))
- = Name_Unchecked_Conversion
+ and then
+ Chars (Selector_Name (Id)) = Name_Unchecked_Conversion
then
Conv := Current_Entity (Selector_Name (Id));
else
@@ -4809,8 +4868,8 @@ package body Sem_Ch6 is
May_Inline : constant Boolean :=
Has_Pragma_Inline_Always (Spec_Id)
or else (Has_Pragma_Inline (Spec_Id)
- and then ((Optimization_Level > 0
- and then Ekind (Spec_Id)
+ and then ((Optimization_Level > 0
+ and then Ekind (Spec_Id)
= E_Function)
or else Front_End_Inlining));
Body_To_Analyze : Node_Id;
@@ -5040,9 +5099,8 @@ package body Sem_Ch6 is
Nxt := Next (Decl);
if Nkind (Decl) = N_Pragma
- and then (Pragma_Name (Decl) = Name_Unreferenced
- or else
- Pragma_Name (Decl) = Name_Unmodified)
+ and then Nam_In (Pragma_Name (Decl), Name_Unreferenced,
+ Name_Unmodified)
then
Remove (Decl);
end if;
@@ -5493,10 +5551,9 @@ package body Sem_Ch6 is
if Ada_Version >= Ada_2005
and then Ekind (Etype (Old_Type)) = E_Anonymous_Access_Type
and then
- (Can_Never_Be_Null (Old_Type)
- /= Can_Never_Be_Null (New_Type)
- or else Is_Access_Constant (Etype (Old_Type))
- /= Is_Access_Constant (Etype (New_Type)))
+ (Can_Never_Be_Null (Old_Type) /= Can_Never_Be_Null (New_Type)
+ or else Is_Access_Constant (Etype (Old_Type)) /=
+ Is_Access_Constant (Etype (New_Type)))
then
Conformance_Error ("\return type does not match!", New_Id);
return;
@@ -5519,7 +5576,6 @@ package body Sem_Ch6 is
if Ctype >= Subtype_Conformant then
if Convention (Old_Id) /= Convention (New_Id) then
-
if not Is_Frozen (New_Id) then
null;
@@ -5646,8 +5702,8 @@ package body Sem_Ch6 is
Access_Types_Match := Ada_Version >= Ada_2005
- -- Ensure that this rule is only applied when New_Id is a
- -- renaming of Old_Id.
+ -- Ensure that this rule is only applied when New_Id is a
+ -- renaming of Old_Id.
and then Nkind (Parent (Parent (New_Id))) =
N_Subprogram_Renaming_Declaration
@@ -5655,26 +5711,26 @@ package body Sem_Ch6 is
and then Present (Entity (Name (Parent (Parent (New_Id)))))
and then Entity (Name (Parent (Parent (New_Id)))) = Old_Id
- -- Now handle the allowed access-type case
+ -- Now handle the allowed access-type case
and then Is_Access_Type (Old_Formal_Base)
and then Is_Access_Type (New_Formal_Base)
- -- The type kinds must match. The only exception occurs with
- -- multiple generics of the form:
+ -- The type kinds must match. The only exception occurs with
+ -- multiple generics of the form:
- -- generic generic
- -- type F is private; type A is private;
- -- type F_Ptr is access F; type A_Ptr is access A;
- -- with proc F_P (X : F_Ptr); with proc A_P (X : A_Ptr);
- -- package F_Pack is ... package A_Pack is
- -- package F_Inst is
- -- new F_Pack (A, A_Ptr, A_P);
+ -- generic generic
+ -- type F is private; type A is private;
+ -- type F_Ptr is access F; type A_Ptr is access A;
+ -- with proc F_P (X : F_Ptr); with proc A_P (X : A_Ptr);
+ -- package F_Pack is ... package A_Pack is
+ -- package F_Inst is
+ -- new F_Pack (A, A_Ptr, A_P);
- -- When checking for conformance between the parameters of A_P
- -- and F_P, the type kinds of F_Ptr and A_Ptr will not match
- -- because the compiler has transformed A_Ptr into a subtype of
- -- F_Ptr. We catch this case in the code below.
+ -- When checking for conformance between the parameters of A_P
+ -- and F_P, the type kinds of F_Ptr and A_Ptr will not match
+ -- because the compiler has transformed A_Ptr into a subtype of
+ -- F_Ptr. We catch this case in the code below.
and then (Ekind (Old_Formal_Base) = Ekind (New_Formal_Base)
or else
@@ -5684,7 +5740,7 @@ package body Sem_Ch6 is
and then Etype (Etype (New_Formal_Base)) =
Old_Formal_Base))
and then Directly_Designated_Type (Old_Formal_Base) =
- Directly_Designated_Type (New_Formal_Base)
+ Directly_Designated_Type (New_Formal_Base)
and then ((Is_Itype (Old_Formal_Base)
and then Can_Never_Be_Null (Old_Formal_Base))
or else
@@ -6116,17 +6172,13 @@ package body Sem_Ch6 is
-- done for delayed_freeze subprograms because the underlying
-- returned type may not be known yet (for private types)
- if not Has_Delayed_Freeze (Designator)
- and then Expander_Active
- then
+ if not Has_Delayed_Freeze (Designator) and then Expander_Active then
declare
Typ : constant Entity_Id := Etype (Designator);
Utyp : constant Entity_Id := Underlying_Type (Typ);
-
begin
if Is_Immutably_Limited_Type (Typ) then
Set_Returns_By_Ref (Designator);
-
elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
Set_Returns_By_Ref (Designator);
end if;
@@ -6190,7 +6242,7 @@ package body Sem_Ch6 is
-- with partial declaration.
if Is_Access_Type (New_Discr_Type)
- and then Null_Exclusion_Present (New_Discr)
+ and then Null_Exclusion_Present (New_Discr)
then
New_Discr_Type :=
Create_Null_Excluding_Itype
@@ -6445,11 +6497,9 @@ package body Sem_Ch6 is
if Present (Overridden_Subp)
and then (not Is_Hidden (Overridden_Subp)
or else
- ((Chars (Overridden_Subp) = Name_Initialize
- or else
- Chars (Overridden_Subp) = Name_Adjust
- or else
- Chars (Overridden_Subp) = Name_Finalize)
+ (Nam_In (Chars (Overridden_Subp), Name_Initialize,
+ Name_Adjust,
+ Name_Finalize)
and then Present (Alias (Overridden_Subp))
and then not Is_Hidden (Alias (Overridden_Subp))))
then
@@ -6502,6 +6552,11 @@ package body Sem_Ch6 is
else
Set_Overridden_Operation (Subp, Overridden_Subp);
end if;
+
+ -- Ensure that a ghost function is not overriding another routine
+
+ elsif Is_Ghost_Function (Subp) then
+ Error_Msg_N ("ghost function & cannot be overriding", Subp);
end if;
end if;
@@ -6678,9 +6733,7 @@ package body Sem_Ch6 is
-- sequences (which were the original sequences of statements in
-- the exception handlers) and check them.
- if Nkind (Last_Stm) = N_Label
- and then Exception_Junk (Last_Stm)
- then
+ if Nkind (Last_Stm) = N_Label and then Exception_Junk (Last_Stm) then
Stm := Last_Stm;
loop
Prev (Stm);
@@ -6721,7 +6774,7 @@ package body Sem_Ch6 is
(Nkind_In (Last_Stm, N_Goto_Statement,
N_Label,
N_Object_Declaration)
- and then Exception_Junk (Last_Stm))
+ and then Exception_Junk (Last_Stm))
or else Nkind (Last_Stm) in N_Push_xxx_Label
or else Nkind (Last_Stm) in N_Pop_xxx_Label
@@ -7006,8 +7059,8 @@ package body Sem_Ch6 is
-- Last non-trivial postcondition on the subprogram, or else Empty if
-- either no non-trivial postcondition or only inherited postconditions.
- Last_Contract_Case : Node_Id := Empty;
- -- Last non-trivial contract-case on the subprogram, or else Empty
+ Last_Contract_Cases : Node_Id := Empty;
+ -- Last non-trivial contract-cases on the subprogram, or else Empty
Attribute_Result_Mentioned : Boolean := False;
-- Whether attribute 'Result is mentioned in a non-trivial postcondition
@@ -7146,8 +7199,10 @@ package body Sem_Ch6 is
----------------------------
procedure Process_Contract_Cases (Spec : Node_Id) is
- Prag : Node_Id;
- Arg : Node_Id;
+ Prag : Node_Id;
+ Aggr : Node_Id;
+ Conseq : Node_Id;
+ Post_Case : Node_Id;
Ignored : Traverse_Final_Result;
pragma Unreferenced (Ignored);
@@ -7155,42 +7210,46 @@ package body Sem_Ch6 is
begin
Prag := Spec_CTC_List (Contract (Spec));
loop
- -- Retrieve the Ensures component of the contract-case, if any
+ if Pragma_Name (Prag) = Name_Contract_Cases then
+ Aggr :=
+ Expression (First (Pragma_Argument_Associations (Prag)));
- Arg := Get_Ensures_From_CTC_Pragma (Prag);
+ Post_Case := First (Component_Associations (Aggr));
+ while Present (Post_Case) loop
+ Conseq := Expression (Post_Case);
- -- Ignore trivial contract-case when Ensures component is "True"
- -- or "False".
+ -- Ignore trivial contract-case when consequence is "True"
+ -- or "False".
- if Pragma_Name (Prag) = Name_Contract_Case
- and then not Is_Trivial_Post_Or_Ensures (Expression (Arg))
- then
- -- Since contract-cases are listed in reverse order, the first
- -- contract-case in the list is the last in the source.
+ if not Is_Trivial_Post_Or_Ensures (Conseq) then
- if No (Last_Contract_Case) then
- Last_Contract_Case := Prag;
- end if;
+ Last_Contract_Cases := Prag;
- -- For functions, look for presence of 'Result in Ensures
+ -- For functions, look for presence of 'Result in
+ -- consequence expression.
- if Ekind_In (Spec_Id, E_Function, E_Generic_Function) then
- Ignored := Find_Attribute_Result (Arg);
- end if;
+ if Ekind_In (Spec_Id, E_Function, E_Generic_Function) then
+ Ignored := Find_Attribute_Result (Conseq);
+ end if;
- -- For each individual contract-case, look for presence
- -- of an expression that could be evaluated differently
- -- in post-state.
+ -- For each individual case, look for presence of an
+ -- expression that could be evaluated differently in
+ -- post-state.
- Post_State_Mentioned := False;
- Ignored := Find_Post_State (Arg);
+ Post_State_Mentioned := False;
+ Ignored := Find_Post_State (Conseq);
- if Post_State_Mentioned then
- No_Warning_On_Some_Postcondition := True;
- else
- Error_Msg_N
- ("`Ensures` component refers only to pre-state??", Prag);
- end if;
+ if Post_State_Mentioned then
+ No_Warning_On_Some_Postcondition := True;
+ else
+ Error_Msg_N
+ ("contract case refers only to pre-state?T?",
+ Conseq);
+ end if;
+ end if;
+
+ Next (Post_Case);
+ end loop;
end if;
Prag := Next_Pragma (Prag);
@@ -7246,7 +7305,7 @@ package body Sem_Ch6 is
No_Warning_On_Some_Postcondition := True;
else
Error_Msg_N
- ("postcondition refers only to pre-state??", Prag);
+ ("postcondition refers only to pre-state?T?", Prag);
end if;
end if;
end if;
@@ -7294,12 +7353,12 @@ package body Sem_Ch6 is
if Ekind_In (Spec_Id, E_Function, E_Generic_Function)
and then (Present (Last_Postcondition)
- or else Present (Last_Contract_Case))
+ or else Present (Last_Contract_Cases))
and then not Attribute_Result_Mentioned
and then No_Warning_On_Some_Postcondition
then
if Present (Last_Postcondition) then
- if Present (Last_Contract_Case) then
+ if Present (Last_Contract_Cases) then
Error_Msg_N
("neither function postcondition nor "
& "contract cases mention result?T?", Last_Postcondition);
@@ -7311,7 +7370,7 @@ package body Sem_Ch6 is
end if;
else
Error_Msg_N
- ("contract cases do not mention result?T?", Last_Contract_Case);
+ ("contract cases do not mention result?T?", Last_Contract_Cases);
end if;
end if;
end Check_Subprogram_Contract;
@@ -7511,11 +7570,14 @@ package body Sem_Ch6 is
----------------------
function Base_Types_Match (T1, T2 : Entity_Id) return Boolean is
+ BT1 : constant Entity_Id := Base_Type (T1);
+ BT2 : constant Entity_Id := Base_Type (T2);
+
begin
if T1 = T2 then
return True;
- elsif Base_Type (T1) = Base_Type (T2) then
+ elsif BT1 = BT2 then
-- The following is too permissive. A more precise test should
-- check that the generic actual is an ancestor subtype of the
@@ -7528,6 +7590,16 @@ package body Sem_Ch6 is
or else not Is_Generic_Actual_Type (T2)
or else Scope (T1) /= Scope (T2);
+ -- If T2 is a generic actual type it is declared as the subtype of
+ -- the actual. If that actual is itself a subtype we need to use
+ -- its own base type to check for compatibility.
+
+ elsif Ekind (BT2) = Ekind (T2) and then BT1 = Base_Type (BT2) then
+ return True;
+
+ elsif Ekind (BT1) = Ekind (T1) and then BT2 = Base_Type (BT1) then
+ return True;
+
else
return False;
end if;
@@ -7572,14 +7644,10 @@ package body Sem_Ch6 is
-- access-to-class-wide type in a formal. Both entities designate the
-- same type.
- if From_With_Type (T1)
- and then T2 = Available_View (T1)
- then
+ if From_With_Type (T1) and then T2 = Available_View (T1) then
return True;
- elsif From_With_Type (T2)
- and then T1 = Available_View (T2)
- then
+ elsif From_With_Type (T2) and then T1 = Available_View (T2) then
return True;
elsif From_With_Type (T1)
@@ -7596,10 +7664,9 @@ package body Sem_Ch6 is
-- Start of processing for Conforming_Types
begin
- -- The context is an instance association for a formal
- -- access-to-subprogram type; the formal parameter types require
- -- mapping because they may denote other formal parameters of the
- -- generic unit.
+ -- The context is an instance association for a formal access-to-
+ -- subprogram type; the formal parameter types require mapping because
+ -- they may denote other formal parameters of the generic unit.
if Get_Inst then
Type_1 := Get_Instance_Of (T1);
@@ -7645,9 +7712,8 @@ package body Sem_Ch6 is
Are_Anonymous_Access_To_Subprogram_Types :=
Ekind (Type_1) = Ekind (Type_2)
and then
- (Ekind (Type_1) = E_Anonymous_Access_Subprogram_Type
- or else
- Ekind (Type_1) = E_Anonymous_Access_Protected_Subprogram_Type);
+ Ekind_In (Type_1, E_Anonymous_Access_Subprogram_Type,
+ E_Anonymous_Access_Protected_Subprogram_Type);
-- Test anonymous access type case. For this case, static subtype
-- matching is required for mode conformance (RM 6.3.1(15)). We check
@@ -7657,7 +7723,10 @@ package body Sem_Ch6 is
if (Ekind (Base_Type (Type_1)) = E_Anonymous_Access_Type
and then
Ekind (Base_Type (Type_2)) = E_Anonymous_Access_Type)
- or else Are_Anonymous_Access_To_Subprogram_Types -- Ada 2005 (AI-254)
+
+ -- Ada 2005 (AI-254)
+
+ or else Are_Anonymous_Access_To_Subprogram_Types
then
declare
Desig_1 : Entity_Id;
@@ -7725,8 +7794,8 @@ package body Sem_Ch6 is
else
return Base_Type (Desig_1) = Base_Type (Desig_2)
and then (Ctype = Type_Conformant
- or else
- Subtypes_Statically_Match (Desig_1, Desig_2));
+ or else
+ Subtypes_Statically_Match (Desig_1, Desig_2));
end if;
end;
@@ -7736,7 +7805,7 @@ package body Sem_Ch6 is
if ((Ekind (Type_1) = E_Anonymous_Access_Type
and then Is_Access_Type (Type_2))
or else (Ekind (Type_2) = E_Anonymous_Access_Type
- and then Is_Access_Type (Type_1)))
+ and then Is_Access_Type (Type_1)))
and then
Conforming_Types
(Designated_Type (Type_1), Designated_Type (Type_2), Ctype)
@@ -7826,13 +7895,20 @@ package body Sem_Ch6 is
-- Start of processing for Create_Extra_Formals
begin
- -- We never generate extra formals if expansion is not active
- -- because we don't need them unless we are generating code.
+ -- We never generate extra formals if expansion is not active because we
+ -- don't need them unless we are generating code.
if not Expander_Active then
return;
end if;
+ -- No need to generate extra formals in interface thunks whose target
+ -- primitive has no extra formals.
+
+ if Is_Thunk (E) and then No (Extra_Formals (Thunk_Entity (E))) then
+ return;
+ end if;
+
-- If this is a derived subprogram then the subtypes of the parent
-- subprogram's formal parameters will be used to determine the need
-- for extra formals.
@@ -7852,9 +7928,7 @@ package body Sem_Ch6 is
-- situation may arise for subprogram types created as part of
-- dispatching calls (see Expand_Dispatching_Call)
- if Present (Last_Extra) and then
- Present (Extra_Formal (Last_Extra))
- then
+ if Present (Last_Extra) and then Present (Extra_Formal (Last_Extra)) then
return;
end if;
@@ -8093,9 +8167,7 @@ package body Sem_Ch6 is
-- Chain new entity if front of homonym in current scope, so that
-- homonyms are contiguous.
- if Present (E)
- and then E /= C_E
- then
+ if Present (E) and then E /= C_E then
while Homonym (C_E) /= E loop
C_E := Homonym (C_E);
end loop;
@@ -8353,6 +8425,15 @@ package body Sem_Ch6 is
then
null;
+ -- For null procedures coming from source that are completions,
+ -- analysis of the generated body will establish the link.
+
+ elsif Comes_From_Source (E)
+ and then Nkind (Spec) = N_Procedure_Specification
+ and then Null_Present (Spec)
+ then
+ return E;
+
elsif not Has_Completion (E) then
if Nkind (N) /= N_Subprogram_Body_Stub then
Set_Corresponding_Spec (N, E);
@@ -8606,14 +8687,10 @@ package body Sem_Ch6 is
return Nkind (Selector_Name (E1)) = N_Character_Literal
and then Chars (E2) = Chars (Selector_Name (E1));
- elsif Nkind (E1) in N_Op
- and then Nkind (E2) = N_Function_Call
- then
+ elsif Nkind (E1) in N_Op and then Nkind (E2) = N_Function_Call then
return FCO (E1, E2);
- elsif Nkind (E2) in N_Op
- and then Nkind (E1) = N_Function_Call
- then
+ elsif Nkind (E2) in N_Op and then Nkind (E1) = N_Function_Call then
return FCO (E2, E1);
-- Otherwise we must have the same syntactic entity
@@ -9319,8 +9396,8 @@ package body Sem_Ch6 is
and then No (N_Formal)
and then (Ekind (New_E) /= E_Function
or else
- Types_Correspond
- (Etype (P_Prim), Etype (New_E)))
+ Types_Correspond
+ (Etype (P_Prim), Etype (New_E)))
then
return False;
end if;
@@ -9615,12 +9692,8 @@ package body Sem_Ch6 is
("abstract subprograms must be visible "
& "(RM 3.9.3(10))!", S);
- elsif Ekind (S) = E_Function
- and then not Is_Overriding
- then
- if Is_Tagged_Type (T)
- and then T = Base_Type (Etype (S))
- then
+ elsif Ekind (S) = E_Function and then not Is_Overriding then
+ if Is_Tagged_Type (T) and then T = Base_Type (Etype (S)) then
Error_Msg_N
("private function with tagged result must"
& " override visible-part function", S);
@@ -10038,7 +10111,7 @@ package body Sem_Ch6 is
-- interface procedures.
elsif (Ekind (Def_Id) = E_Procedure
- or else Ekind (Def_Id) = E_Entry)
+ or else Ekind (Def_Id) = E_Entry)
and then Ekind (Subp) = E_Procedure
and then Matches_Prefixed_View_Profile
(Parameter_Specifications (Parent (Def_Id)),
@@ -10059,13 +10132,12 @@ package body Sem_Ch6 is
-- routine must be of mode "out", "in out" or
-- access-to-variable.
- if (Ekind (Candidate) = E_Entry
- or else Ekind (Candidate) = E_Procedure)
+ if Ekind_In (Candidate, E_Entry, E_Procedure)
and then Is_Protected_Type (Typ)
and then Ekind (Formal) /= E_In_Out_Parameter
and then Ekind (Formal) /= E_Out_Parameter
- and then Nkind (Parameter_Type (Parent (Formal)))
- /= N_Access_Definition
+ and then Nkind (Parameter_Type (Parent (Formal))) /=
+ N_Access_Definition
then
null;
@@ -10453,9 +10525,7 @@ package body Sem_Ch6 is
begin
Prev := First_Entity (Current_Scope);
- while Present (Prev)
- and then Next_Entity (Prev) /= E
- loop
+ while Present (Prev) and then Next_Entity (Prev) /= E loop
Next_Entity (Prev);
end loop;
@@ -10798,8 +10868,7 @@ package body Sem_Ch6 is
end if;
return
- Ekind (Desig) = E_Incomplete_Type
- and then From_With_Type (Desig);
+ Ekind (Desig) = E_Incomplete_Type and then From_With_Type (Desig);
end Designates_From_With_Type;
---------------------------
@@ -10842,7 +10911,7 @@ package body Sem_Ch6 is
if Is_Incomplete_Type (Formal_Type)
or else
(Is_Class_Wide_Type (Formal_Type)
- and then Is_Incomplete_Type (Root_Type (Formal_Type)))
+ and then Is_Incomplete_Type (Root_Type (Formal_Type)))
then
-- Ada 2005 (AI-326): Tagged incomplete types allowed in
-- primitive operations, as long as their completion is
@@ -11809,6 +11878,12 @@ package body Sem_Ch6 is
Map : Elist_Id;
CP : Node_Id;
+ Ename : Name_Id;
+ -- Effective name of pragma (maybe Pre/Post rather than Precondition/
+ -- Postcodition if the pragma came from a Pre/Post aspect). We need
+ -- the name right when we generate the Check pragma, since we want
+ -- the right set of check policies to apply.
+
begin
-- Prepare map if this is the case where we have to map entities of
-- arguments in the overridden subprogram to corresponding entities
@@ -11860,11 +11935,19 @@ package body Sem_Ch6 is
return CP;
end if;
+ -- Get effective name of aspect
+
+ if Present (Corresponding_Aspect (Prag)) then
+ Ename := Chars (Identifier (Corresponding_Aspect (Prag)));
+ else
+ Ename := Nam;
+ end if;
+
-- Change copy of pragma into corresponding pragma Check
Prepend_To (Pragma_Argument_Associations (CP),
Make_Pragma_Argument_Association (Sloc (Prag),
- Expression => Make_Identifier (Loc, Nam)));
+ Expression => Make_Identifier (Loc, Ename)));
Set_Pragma_Identifier (CP, Make_Identifier (Sloc (Prag), Name_Check));
-- If this is inherited case and the current message starts with
@@ -12173,11 +12256,12 @@ package body Sem_Ch6 is
Prag := First (Declarations (N));
while Present (Prag) loop
if Nkind (Prag) = N_Pragma then
+ Check_Applicable_Policy (Prag);
- -- If pragma, capture if enabled postcondition, else ignore
+ -- If pragma, capture if postconditions enabled, else ignore
if Pragma_Name (Prag) = Name_Postcondition
- and then Check_Enabled (Name_Postcondition)
+ and then not Is_Ignored (Prag)
then
if Plist = No_List then
Plist := Empty_List;
@@ -12515,9 +12599,7 @@ package body Sem_Ch6 is
-- If this is an empty initialization procedure, no need to create
-- actual subtypes (small optimization).
- if Ekind (Subp) = E_Procedure
- and then Is_Null_Init_Proc (Subp)
- then
+ if Ekind (Subp) = E_Procedure and then Is_Null_Init_Proc (Subp) then
return;
end if;
@@ -12654,6 +12736,13 @@ package body Sem_Ch6 is
-- [IN] OUT parameters allowed for functions in Ada 2012
if Ada_Version >= Ada_2012 then
+
+ -- Even in Ada 2012 operators can only have IN parameters
+
+ if Is_Operator_Symbol_Name (Chars (Scope (Formal_Id))) then
+ Error_Msg_N ("operators can only have IN parameters", Spec);
+ end if;
+
if In_Present (Spec) then
Set_Ekind (Formal_Id, E_In_Out_Parameter);
else
@@ -12817,16 +12906,12 @@ package body Sem_Ch6 is
-- Verify that user-defined operators have proper number of arguments
-- First case of operators which can only be unary
- if Id = Name_Op_Not
- or else Id = Name_Op_Abs
- then
+ if Nam_In (Id, Name_Op_Not, Name_Op_Abs) then
N_OK := (N = 1);
-- Case of operators which can be unary or binary
- elsif Id = Name_Op_Add
- or Id = Name_Op_Subtract
- then
+ elsif Nam_In (Id, Name_Op_Add, Name_Op_Subtract) then
N_OK := (N in 1 .. 2);
-- All other operators can only be binary
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index dd1e1d4120e..f8e2799dc85 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1394,9 +1394,8 @@ package body Sem_Ch7 is
begin
ASN := First (Aspect_Specifications (Parent (E)));
while Present (ASN) loop
- if Chars (Identifier (ASN)) = Name_Invariant
- or else
- Chars (Identifier (ASN)) = Name_Type_Invariant
+ if Nam_In (Chars (Identifier (ASN)), Name_Invariant,
+ Name_Type_Invariant)
then
Build_Invariant_Procedure (E, N);
exit;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 32d49cc6932..12b37f447a4 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -450,6 +450,25 @@ package body Sem_Ch8 is
-- when compiling a subunit or instantiating a generic body on the fly,
-- when it is necessary to save and restore full environments.
+ function Enclosing_Instance return Entity_Id;
+ -- In an instance nested within another one, several semantic checks are
+ -- unnecessary because the legality of the nested instance has been checked
+ -- in the enclosing generic unit. This applies in particular to legality
+ -- checks on actuals for formal subprograms of the inner instance, which
+ -- are checked as subprogram renamings, and may be complicated by confusion
+ -- in private/full views. This function returns the instance enclosing the
+ -- current one if there is such, else it returns Empty.
+ --
+ -- If the renaming determines the entity for the default of a formal
+ -- subprogram nested within another instance, choose the innermost
+ -- candidate. This is because if the formal has a box, and we are within
+ -- an enclosing instance where some candidate interpretations are local
+ -- to this enclosing instance, we know that the default was properly
+ -- resolved when analyzing the generic, so we prefer the local
+ -- candidates to those that are external. This is not always the case
+ -- but is a reasonable heuristic on the use of nested generics. The
+ -- proper solution requires a full renaming model.
+
function Has_Implicit_Character_Literal (N : Node_Id) return Boolean;
-- Find a type derived from Character or Wide_Character in the prefix of N.
-- Used to resolved qualified names whose selector is a character literal.
@@ -773,6 +792,12 @@ package body Sem_Ch8 is
Make_Subtype_From_Expr (Nam, Typ)));
Rewrite (Subtype_Mark (N), New_Occurrence_Of (Subt, Loc));
Set_Etype (Nam, Subt);
+
+ -- Freeze subtype at once, to prevent order of elaboration
+ -- issues in the backend. The renamed object exists, so its
+ -- type is already frozen in any case.
+
+ Freeze_Before (N, Subt);
end if;
end if;
end Check_Constrained_Object;
@@ -1076,9 +1101,7 @@ package body Sem_Ch8 is
then
null;
- elsif Ada_Version >= Ada_2005
- and then Nkind (Nam) in N_Has_Entity
- then
+ elsif Ada_Version >= Ada_2005 and then Nkind (Nam) in N_Has_Entity then
declare
Nam_Decl : Node_Id;
Nam_Ent : Entity_Id;
@@ -1103,7 +1126,7 @@ package body Sem_Ch8 is
-- have a null exclusion or a null-excluding subtype.
if Is_Formal_Object (Nam_Ent)
- and then In_Generic_Scope (Id)
+ and then In_Generic_Scope (Id)
then
if not Can_Never_Be_Null (Etype (Nam_Ent)) then
Error_Msg_N
@@ -1132,10 +1155,10 @@ package body Sem_Ch8 is
elsif Nkind (Nam_Decl) = N_Object_Declaration
and then In_Instance
- and then Present
- (Corresponding_Generic_Association (Nam_Decl))
- and then Nkind (Expression (Nam_Decl))
- = N_Raise_Constraint_Error
+ and then
+ Present (Corresponding_Generic_Association (Nam_Decl))
+ and then Nkind (Expression (Nam_Decl)) =
+ N_Raise_Constraint_Error
then
Error_Msg_N
("renamed actual does not exclude `NULL` "
@@ -1214,7 +1237,7 @@ package body Sem_Ch8 is
Nkind (Original_Node (Nam)) /= N_Attribute_Reference)
or else (Nkind (Nam) = N_Type_Conversion
- and then Is_Tagged_Type (Entity (Subtype_Mark (Nam))))
+ and then Is_Tagged_Type (Entity (Subtype_Mark (Nam))))
then
null;
@@ -1385,9 +1408,7 @@ package body Sem_Ch8 is
begin
E := First_Entity (Old_P);
- while Present (E)
- and then E /= New_P
- loop
+ while Present (E) and then E /= New_P loop
if Is_Type (E)
and then Nkind (Parent (E)) = N_Subtype_Declaration
then
@@ -1589,8 +1610,7 @@ package body Sem_Ch8 is
begin
if (Is_Entity_Name (P) and then Ekind (Entity (P)) = E_Entry_Family)
or else (Nkind (P) = N_Selected_Component
- and then
- Ekind (Entity (Selector_Name (P))) = E_Entry_Family)
+ and then Ekind (Entity (Selector_Name (P))) = E_Entry_Family)
then
if Is_Entity_Name (P) then
Old_S := Entity (P);
@@ -1982,13 +2002,11 @@ package body Sem_Ch8 is
Ren_Formal := First_Formal (Ren);
Sub_Formal := First_Formal (Sub);
- while Present (Ren_Formal)
- and then Present (Sub_Formal)
- loop
+ while Present (Ren_Formal) and then Present (Sub_Formal) loop
if Has_Null_Exclusion (Parent (Ren_Formal))
and then
not (Has_Null_Exclusion (Parent (Sub_Formal))
- or else Can_Never_Be_Null (Etype (Sub_Formal)))
+ or else Can_Never_Be_Null (Etype (Sub_Formal)))
then
Error_Msg_NE
("`NOT NULL` required for parameter &",
@@ -2004,9 +2022,8 @@ package body Sem_Ch8 is
if Nkind (Parent (Ren)) = N_Function_Specification
and then Nkind (Parent (Sub)) = N_Function_Specification
and then Has_Null_Exclusion (Parent (Ren))
- and then
- not (Has_Null_Exclusion (Parent (Sub))
- or else Can_Never_Be_Null (Etype (Sub)))
+ and then not (Has_Null_Exclusion (Parent (Sub))
+ or else Can_Never_Be_Null (Etype (Sub)))
then
Error_Msg_N
("return must specify `NOT NULL`",
@@ -2081,9 +2098,7 @@ package body Sem_Ch8 is
then
F_Nam := First_Entity (Entity (Nam));
F_Spec := First_Formal (Formal_Spec);
- while Present (F_Nam)
- and then Present (F_Spec)
- loop
+ while Present (F_Nam) and then Present (F_Spec) loop
if Is_Controlling_Formal (F_Nam)
and then Has_Unknown_Discriminants (Etype (F_Spec))
and then not Is_Class_Wide_Type (Etype (F_Spec))
@@ -2114,10 +2129,8 @@ package body Sem_Ch8 is
if Present (Alias (Subp)) then
return Alias (Subp);
- elsif
- Nkind (Unit_Declaration_Node (Subp)) = N_Subprogram_Declaration
- and then Present
- (Corresponding_Body (Unit_Declaration_Node (Subp)))
+ elsif Nkind (Unit_Declaration_Node (Subp)) = N_Subprogram_Declaration
+ and then Present (Corresponding_Body (Unit_Declaration_Node (Subp)))
then
-- Check if renamed entity is a renaming_as_body
@@ -2167,7 +2180,8 @@ package body Sem_Ch8 is
-- this must be treated as a normal attribute reference, to be
-- expanded in subsequent instantiations.
- if Is_Actual and then Is_Abstract_Subprogram (Formal_Spec)
+ if Is_Actual
+ and then Is_Abstract_Subprogram (Formal_Spec)
and then Full_Expander_Active
then
declare
@@ -2382,8 +2396,8 @@ package body Sem_Ch8 is
pragma Assert
(Is_Primitive (Entity (Nam))
- and then
- Is_Abstract_Type (Find_Dispatching_Type (Entity (Nam))));
+ and then
+ Is_Abstract_Type (Find_Dispatching_Type (Entity (Nam))));
declare
Old_Decl : constant Node_Id :=
Unit_Declaration_Node (Rename_Spec);
@@ -2490,8 +2504,7 @@ package body Sem_Ch8 is
(Is_Tagged_Type (T)
or else
(Is_Access_Type (T)
- and then
- Is_Tagged_Type (Designated_Type (T))))
+ and then Is_Tagged_Type (Designated_Type (T))))
and then Scope (Entity (Selector_Name (Nam))) /= T
then
Analyze_Renamed_Primitive_Operation
@@ -2506,9 +2519,7 @@ package body Sem_Ch8 is
-- This is not allowed for renaming as body if the renamed
-- spec is already frozen (see RM 8.5.4(5) for details).
- if Present (Rename_Spec)
- and then Is_Frozen (Rename_Spec)
- then
+ if Present (Rename_Spec) and then Is_Frozen (Rename_Spec) then
Error_Msg_N
("renaming-as-body cannot rename entry as subprogram", N);
Error_Msg_NE
@@ -2607,9 +2618,7 @@ package body Sem_Ch8 is
-- when performing a null exclusion check between a renaming and a
-- renamed subprogram that has been found to be illegal.
- if Ada_Version >= Ada_2005
- and then Entity (Nam) /= Any_Id
- then
+ if Ada_Version >= Ada_2005 and then Entity (Nam) /= Any_Id then
Check_Null_Exclusion
(Ren => New_S,
Sub => Entity (Nam));
@@ -2710,13 +2719,11 @@ package body Sem_Ch8 is
if CW_Actual then
null;
- else
+ elsif not Is_Actual or else No (Enclosing_Instance) then
Check_Mode_Conformant (New_S, Old_S);
end if;
- if Is_Actual
- and then Error_Posted (New_S)
- then
+ if Is_Actual and then Error_Posted (New_S) then
Error_Msg_NE ("invalid actual subprogram: & #!", N, Old_S);
end if;
end if;
@@ -2750,13 +2757,12 @@ package body Sem_Ch8 is
Set_Is_Intrinsic_Subprogram
(New_S,
- Is_Intrinsic_Subprogram (Old_S)
- and then
- (Chars (Old_S) /= Name_Op_Ne
- or else Ekind (Old_S) = E_Operator
- or else
- Is_Intrinsic_Subprogram
- (Corresponding_Equality (Old_S))));
+ Is_Intrinsic_Subprogram (Old_S)
+ and then
+ (Chars (Old_S) /= Name_Op_Ne
+ or else Ekind (Old_S) = E_Operator
+ or else Is_Intrinsic_Subprogram
+ (Corresponding_Equality (Old_S))));
if Ekind (Alias (New_S)) = E_Operator then
Set_Has_Delayed_Freeze (New_S, False);
@@ -2821,13 +2827,13 @@ package body Sem_Ch8 is
and then Entity (Prefix (Nam)) = Current_Scope
and then Chars (Selector_Name (Nam)) = Chars (New_S)
then
- if Overriding_Renamings then
- null;
+ -- This is an error, but we overlook the error and accept the
+ -- renaming if the special Overriding_Renamings mode is in effect.
- else
+ if not Overriding_Renamings then
Error_Msg_NE
- ("implicit operation& is not visible (RM 8.3 (15))",
- Nam, Old_S);
+ ("implicit operation& is not visible (RM 8.3 (15))",
+ Nam, Old_S);
end if;
end if;
@@ -2909,7 +2915,6 @@ package body Sem_Ch8 is
F1 := First_Formal (Candidate_Renaming);
F2 := First_Formal (New_S);
T1 := First_Subtype (Etype (F1));
-
while Present (F1) and then Present (F2) loop
Next_Formal (F1);
Next_Formal (F2);
@@ -2980,9 +2985,8 @@ package body Sem_Ch8 is
if Comes_From_Source (N)
and then Present (Old_S)
- and then
- (Nkind (Old_S) = N_Defining_Operator_Symbol
- or else Ekind (Old_S) = E_Operator)
+ and then (Nkind (Old_S) = N_Defining_Operator_Symbol
+ or else Ekind (Old_S) = E_Operator)
and then Nkind (New_S) = N_Defining_Operator_Symbol
and then Chars (Old_S) /= Chars (New_S)
then
@@ -3003,9 +3007,8 @@ package body Sem_Ch8 is
and then Comes_From_Source (N)
and then Scope (Old_S) /= Standard_Standard
and then Warn_On_Redundant_Constructs
- and then
- (Is_Immediately_Visible (Old_S)
- or else Is_Potentially_Use_Visible (Old_S))
+ and then (Is_Immediately_Visible (Old_S)
+ or else Is_Potentially_Use_Visible (Old_S))
and then Is_Overloadable (Current_Scope)
and then Chars (Current_Scope) /= Chars (Old_S)
then
@@ -3102,9 +3105,7 @@ package body Sem_Ch8 is
if Is_Entity_Name (Pack_Name) then
Pack := Entity (Pack_Name);
- if Ekind (Pack) /= E_Package
- and then Etype (Pack) /= Any_Type
- then
+ if Ekind (Pack) /= E_Package and then Etype (Pack) /= Any_Type then
if Ekind (Pack) = E_Generic_Package then
Error_Msg_N -- CODEFIX
("a generic package is not allowed in a use clause",
@@ -3224,14 +3225,12 @@ package body Sem_Ch8 is
function Mentioned (Nam : Node_Id) return Boolean is
begin
return Nkind (Name (Item)) = N_Selected_Component
- and then
- Chars (Prefix (Name (Item))) = Chars (Nam);
+ and then Chars (Prefix (Name (Item))) = Chars (Nam);
end Mentioned;
begin
Pref := Prefix (Id);
Item := First (Context_Items (Parent (N)));
-
while Present (Item) and then Item /= N loop
if Nkind (Item) = N_With_Clause
and then Limited_Present (Item)
@@ -3260,9 +3259,7 @@ package body Sem_Ch8 is
begin
if In_Open_Scopes (Pack) then
- if Warn_On_Redundant_Constructs
- and then Pack = Current_Scope
- then
+ if Warn_On_Redundant_Constructs and then Pack = Current_Scope then
Error_Msg_NE -- CODEFIX
("& is already use-visible within itself?r?", Pack_Name, Pack);
end if;
@@ -3365,13 +3362,9 @@ package body Sem_Ch8 is
Error_Msg_N ("illegal expressions in attribute reference", Nam);
elsif
- Aname = Name_Compose or else
- Aname = Name_Exponent or else
- Aname = Name_Leading_Part or else
- Aname = Name_Pos or else
- Aname = Name_Round or else
- Aname = Name_Scaling or else
- Aname = Name_Val
+ Nam_In (Aname, Name_Compose, Name_Exponent, Name_Leading_Part,
+ Name_Pos, Name_Round, Name_Scaling,
+ Name_Val)
then
if Nkind (N) = N_Subprogram_Renaming_Declaration
and then Present (Corresponding_Formal_Spec (N))
@@ -3572,9 +3565,7 @@ package body Sem_Ch8 is
Old_S : Entity_Id;
begin
- if Is_Frozen (Subp)
- and then not Has_Completion (Subp)
- then
+ if Is_Frozen (Subp) and then not Has_Completion (Subp) then
B_Node :=
Build_Renamed_Body
(Parent (Declaration_Node (Subp)), Defining_Entity (N));
@@ -3591,12 +3582,10 @@ package body Sem_Ch8 is
Analyze (B_Node);
end if;
- if Is_Intrinsic_Subprogram (Old_S)
- and then not In_Instance
- then
+ if Is_Intrinsic_Subprogram (Old_S) and then not In_Instance then
Error_Msg_N
("subprogram used in renaming_as_body cannot be intrinsic",
- Name (N));
+ Name (N));
end if;
else
@@ -3629,11 +3618,10 @@ package body Sem_Ch8 is
-- for details on their handling.
elsif Is_Concurrent_Type (Scope (E)) then
-
P := Parent (N);
while Present (P)
and then not Nkind_In (P, N_Parameter_Specification,
- N_Component_Declaration)
+ N_Component_Declaration)
loop
P := Parent (P);
end loop;
@@ -3670,13 +3658,10 @@ package body Sem_Ch8 is
begin
Item := First (Context_Items (Parent (N)));
-
- while Present (Item)
- and then Item /= N
- loop
+ while Present (Item) and then Item /= N loop
if Nkind (Item) = N_With_Clause
- -- Protect the frontend against previous critical errors
+ -- Protect the frontend against previous critical errors
and then Nkind (Name (Item)) /= N_Selected_Component
and then Entity (Name (Item)) = Pack
@@ -3745,9 +3730,9 @@ package body Sem_Ch8 is
("renamed unit must be a child unit of generic parent", Name (N));
elsif Nkind (N) in N_Generic_Renaming_Declaration
- and then Nkind (Name (N)) = N_Expanded_Name
- and then Is_Generic_Instance (Entity (Prefix (Name (N))))
- and then Is_Generic_Unit (Old_E)
+ and then Nkind (Name (N)) = N_Expanded_Name
+ and then Is_Generic_Instance (Entity (Prefix (Name (N))))
+ and then Is_Generic_Unit (Old_E)
then
Error_Msg_N
("renamed generic unit must be a library unit", Name (N));
@@ -3766,6 +3751,30 @@ package body Sem_Ch8 is
end if;
end Check_Library_Unit_Renaming;
+ ------------------------
+ -- Enclosing_Instance --
+ ------------------------
+
+ function Enclosing_Instance return Entity_Id is
+ S : Entity_Id;
+
+ begin
+ if not Is_Generic_Instance (Current_Scope) then
+ return Empty;
+ end if;
+
+ S := Scope (Current_Scope);
+ while S /= Standard_Standard loop
+ if Is_Generic_Instance (S) then
+ return S;
+ end if;
+
+ S := Scope (S);
+ end loop;
+
+ return Empty;
+ end Enclosing_Instance;
+
---------------
-- End_Scope --
---------------
@@ -3952,16 +3961,14 @@ package body Sem_Ch8 is
if Nkind (Id) = N_Defining_Operator_Symbol
and then
- (Is_Primitive_Operator_In_Use
- (Id, First_Formal (Id))
- or else
- (Present (Next_Formal (First_Formal (Id)))
- and then
- Is_Primitive_Operator_In_Use
- (Id, Next_Formal (First_Formal (Id)))))
+ (Is_Primitive_Operator_In_Use (Id, First_Formal (Id))
+ or else
+ (Present (Next_Formal (First_Formal (Id)))
+ and then
+ Is_Primitive_Operator_In_Use
+ (Id, Next_Formal (First_Formal (Id)))))
then
null;
-
else
Set_Is_Potentially_Use_Visible (Id, False);
end if;
@@ -4222,10 +4229,10 @@ package body Sem_Ch8 is
Nkind (N) = N_Identifier
and then
(Nkind (Parent (N)) = N_Procedure_Call_Statement
- or else
- (Nkind (Parent (N)) = N_Parameter_Association
- and then N = Explicit_Actual_Parameter (Parent (N))
- and then Nkind (Parent (Parent (N))) =
+ or else
+ (Nkind (Parent (N)) = N_Parameter_Association
+ and then N = Explicit_Actual_Parameter (Parent (N))
+ and then Nkind (Parent (Parent (N))) =
N_Procedure_Call_Statement));
end Is_Actual_Parameter;
@@ -4558,7 +4565,7 @@ package body Sem_Ch8 is
-- is put or put_line, then add a special error message (since
-- this is a very common error for beginners to make).
- if Chars (N) = Name_Put or else Chars (N) = Name_Put_Line then
+ if Nam_In (Chars (N), Name_Put, Name_Put_Line) then
Error_Msg_N -- CODEFIX
("\\possible missing `WITH Ada.Text_'I'O; " &
"USE Ada.Text_'I'O`!", N);
@@ -4802,9 +4809,7 @@ package body Sem_Ch8 is
-- Find current instance
Inst := Current_Scope;
- while Present (Inst)
- and then Inst /= Standard_Standard
- loop
+ while Present (Inst) and then Inst /= Standard_Standard loop
if Is_Generic_Instance (Inst) then
exit;
end if;
@@ -5202,9 +5207,7 @@ package body Sem_Ch8 is
end;
if No (Id)
- and then (Ekind (P_Name) = E_Procedure
- or else
- Ekind (P_Name) = E_Function)
+ and then Ekind_In (P_Name, E_Procedure, E_Function)
and then Is_Generic_Instance (P_Name)
then
-- Expanded name denotes entity in (instance of) generic subprogram.
@@ -5463,9 +5466,7 @@ package body Sem_Ch8 is
-- Ada 2005 (AI-50217): Check usage of entities in limited withed units
- if Ekind (P_Name) = E_Package
- and then From_With_Type (P_Name)
- then
+ if Ekind (P_Name) = E_Package and then From_With_Type (P_Name) then
if From_With_Type (Id)
or else Is_Type (Id)
or else Ekind (Id) = E_Package
@@ -5481,11 +5482,11 @@ package body Sem_Ch8 is
if Is_Task_Type (P_Name)
and then ((Ekind (Id) = E_Entry
- and then Nkind (Parent (N)) /= N_Attribute_Reference)
+ and then Nkind (Parent (N)) /= N_Attribute_Reference)
or else
- (Ekind (Id) = E_Entry_Family
- and then
- Nkind (Parent (Parent (N))) /= N_Attribute_Reference))
+ (Ekind (Id) = E_Entry_Family
+ and then
+ Nkind (Parent (Parent (N))) /= N_Attribute_Reference))
then
-- If both the task type and the entry are in scope, this may still
-- be the expanded name of an entry formal.
@@ -5538,18 +5539,15 @@ package body Sem_Ch8 is
if Ekind (Id) = E_Void then
Premature_Usage (N);
- elsif Is_Overloadable (Id)
- and then Present (Homonym (Id))
- then
+ elsif Is_Overloadable (Id) and then Present (Homonym (Id)) then
declare
H : Entity_Id := Homonym (Id);
begin
while Present (H) loop
if Scope (H) = Scope (Id)
- and then
- (not Is_Hidden (H)
- or else Is_Immediately_Visible (H))
+ and then (not Is_Hidden (H)
+ or else Is_Immediately_Visible (H))
then
Collect_Interps (N);
exit;
@@ -5618,17 +5616,6 @@ package body Sem_Ch8 is
Old_S : Entity_Id;
Inst : Entity_Id;
- function Enclosing_Instance return Entity_Id;
- -- If the renaming determines the entity for the default of a formal
- -- subprogram nested within another instance, choose the innermost
- -- candidate. This is because if the formal has a box, and we are within
- -- an enclosing instance where some candidate interpretations are local
- -- to this enclosing instance, we know that the default was properly
- -- resolved when analyzing the generic, so we prefer the local
- -- candidates to those that are external. This is not always the case
- -- but is a reasonable heuristic on the use of nested generics. The
- -- proper solution requires a full renaming model.
-
function Is_Visible_Operation (Op : Entity_Id) return Boolean;
-- If the renamed entity is an implicit operator, check whether it is
-- visible because its operand type is properly visible. This check
@@ -5644,32 +5631,6 @@ package body Sem_Ch8 is
-- Determine whether a candidate subprogram is defined within the
-- enclosing instance. If yes, it has precedence over outer candidates.
- ------------------------
- -- Enclosing_Instance --
- ------------------------
-
- function Enclosing_Instance return Entity_Id is
- S : Entity_Id;
-
- begin
- if not Is_Generic_Instance (Current_Scope)
- and then not Is_Actual
- then
- return Empty;
- end if;
-
- S := Scope (Current_Scope);
- while S /= Standard_Standard loop
- if Is_Generic_Instance (S) then
- return S;
- end if;
-
- S := Scope (S);
- end loop;
-
- return Empty;
- end Enclosing_Instance;
-
--------------------------
-- Is_Visible_Operation --
--------------------------
@@ -5683,9 +5644,8 @@ package body Sem_Ch8 is
if Ekind (Op) /= E_Operator
or else Scope (Op) /= Standard_Standard
or else (In_Instance
- and then
- (not Is_Actual
- or else Present (Enclosing_Instance)))
+ and then (not Is_Actual
+ or else Present (Enclosing_Instance)))
then
return True;
@@ -5776,7 +5736,10 @@ package body Sem_Ch8 is
Candidate_Renaming := Empty;
if not Is_Overloaded (Nam) then
- if Entity_Matches_Spec (Entity (Nam), New_S) then
+ if Is_Actual and then Present (Enclosing_Instance) then
+ Old_S := Entity (Nam);
+
+ elsif Entity_Matches_Spec (Entity (Nam), New_S) then
Candidate_Renaming := New_S;
if Is_Visible_Operation (Entity (Nam)) then
@@ -5786,8 +5749,8 @@ package body Sem_Ch8 is
elsif
Present (First_Formal (Entity (Nam)))
and then Present (First_Formal (New_S))
- and then (Base_Type (Etype (First_Formal (Entity (Nam))))
- = Base_Type (Etype (First_Formal (New_S))))
+ and then (Base_Type (Etype (First_Formal (Entity (Nam)))) =
+ Base_Type (Etype (First_Formal (New_S))))
then
Candidate_Renaming := Entity (Nam);
end if;
@@ -5851,8 +5814,8 @@ package body Sem_Ch8 is
elsif
Present (First_Formal (It.Nam))
and then Present (First_Formal (New_S))
- and then (Base_Type (Etype (First_Formal (It.Nam)))
- = Base_Type (Etype (First_Formal (New_S))))
+ and then (Base_Type (Etype (First_Formal (It.Nam))) =
+ Base_Type (Etype (First_Formal (New_S))))
then
Candidate_Renaming := It.Nam;
end if;
@@ -5964,10 +5927,10 @@ package body Sem_Ch8 is
((RTE_Available (RE_Dispatch_Table_Wrapper)
and then Scope (Selector) =
RTE (RE_Dispatch_Table_Wrapper))
- or else
- (RTE_Available (RE_No_Dispatch_Table_Wrapper)
- and then Scope (Selector) =
- RTE (RE_No_Dispatch_Table_Wrapper)))
+ or else
+ (RTE_Available (RE_No_Dispatch_Table_Wrapper)
+ and then Scope (Selector) =
+ RTE (RE_No_Dispatch_Table_Wrapper)))
then
C_Etype := Empty;
@@ -6071,7 +6034,7 @@ package body Sem_Ch8 is
elsif Is_Appropriate_For_Entry_Prefix (P_Type)
and then not In_Open_Scopes (P_Name)
and then (not Is_Concurrent_Type (Etype (P_Name))
- or else not In_Open_Scopes (Etype (P_Name)))
+ or else not In_Open_Scopes (Etype (P_Name)))
then
-- Call to protected operation or entry. Type checking is
-- needed on the prefix.
@@ -6148,9 +6111,9 @@ package body Sem_Ch8 is
-- entry, as is P.X; this is an error.
if Ekind (P_Name) /= E_Function
- and then (not Is_Overloaded (P)
- or else
- Nkind (Parent (N)) = N_Procedure_Call_Statement)
+ and then
+ (not Is_Overloaded (P)
+ or else Nkind (Parent (N)) = N_Procedure_Call_Statement)
then
-- Prefix may mention a package that is hidden by a local
-- declaration: let the user know. Scan the full homonym
@@ -6327,9 +6290,7 @@ package body Sem_Ch8 is
-- Warn_On_Obsolescent_ Feature). Once this issue
-- is cleared in the sources, it can be enabled.
- elsif Warn_On_Obsolescent_Feature
- and then False
- then
+ elsif Warn_On_Obsolescent_Feature and then False then
Error_Msg_N
("applying 'Class to an untagged incomplete type"
& " is an obsolescent feature (RM J.11)?r?", N);
@@ -6596,9 +6557,7 @@ package body Sem_Ch8 is
Priv_Id : Entity_Id := Empty;
begin
- if Ekind (P) = E_Package
- and then not In_Open_Scopes (P)
- then
+ if Ekind (P) = E_Package and then not In_Open_Scopes (P) then
Priv_Id := First_Private_Entity (P);
end if;
@@ -6611,9 +6570,7 @@ package body Sem_Ch8 is
end if;
Id := First_Entity (P);
- while Present (Id)
- and then Id /= Priv_Id
- loop
+ while Present (Id) and then Id /= Priv_Id loop
if Is_Standard_Character_Type (Id) and then Is_Base_Type (Id) then
-- We replace the node with the literal itself, resolve as a
@@ -6695,7 +6652,6 @@ package body Sem_Ch8 is
begin
Predef_Op := Current_Entity (Selector_Name (N));
-
while Present (Predef_Op)
and then Scope (Predef_Op) /= Standard_Standard
loop
@@ -6760,9 +6716,7 @@ package body Sem_Ch8 is
-- Start of processing for Has_Implicit_Operator
begin
- if Ekind (P) = E_Package
- and then not In_Open_Scopes (P)
- then
+ if Ekind (P) = E_Package and then not In_Open_Scopes (P) then
Priv_Id := First_Private_Entity (P);
end if;
@@ -7202,9 +7156,7 @@ package body Sem_Ch8 is
-- of the stack is related to the current compilation.
Scop := Current_Scope;
- while Present (Scop)
- and then Scop /= Standard_Standard
- loop
+ while Present (Scop) and then Scop /= Standard_Standard loop
if Is_Compilation_Unit (Scop)
and then not Is_Child_Unit (Scop)
then
@@ -7495,14 +7447,9 @@ package body Sem_Ch8 is
-- name resolution on component associations. (see 4717-008). In such a
-- case, look for the visible homonym on the chain.
- if In_Instance
- and then Present (Homonym (E))
- then
+ if In_Instance and then Present (Homonym (E)) then
E := Homonym (E);
-
- while Present (E)
- and then not In_Open_Scopes (Scope (E))
- loop
+ while Present (E) and then not In_Open_Scopes (Scope (E)) loop
E := Homonym (E);
end loop;
@@ -7609,16 +7556,14 @@ package body Sem_Ch8 is
if No (With_Sys)
and then
(Nkind (The_Unit) = N_Package_Body
- or else (Nkind (The_Unit) = N_Subprogram_Body
- and then
- not Acts_As_Spec (Cunit (Current_Sem_Unit))))
+ or else (Nkind (The_Unit) = N_Subprogram_Body
+ and then not Acts_As_Spec (Cunit (Current_Sem_Unit))))
then
With_Sys := Find_System (Library_Unit (Cunit (Current_Sem_Unit)));
end if;
- if No (With_Sys)
- and then Present (N)
- then
+ if No (With_Sys) and then Present (N) then
+
-- If we are compiling a subunit, we need to examine its
-- context as well (Current_Sem_Unit is the parent unit);
@@ -7735,8 +7680,9 @@ package body Sem_Ch8 is
else
pragma Assert
(Nkind (Parent (E)) = N_Defining_Program_Unit_Name
- and then
- Nkind (Parent (Parent (E))) = N_Package_Specification);
+ and then
+ Nkind (Parent (Parent (E))) =
+ N_Package_Specification);
Set_Is_Immediately_Visible (E,
Limited_View_Installed (Parent (Parent (E))));
end if;
@@ -7746,9 +7692,8 @@ package body Sem_Ch8 is
Next_Entity (E);
- if not Full_Vis
- and then Is_Package_Or_Generic_Package (S)
- then
+ if not Full_Vis and then Is_Package_Or_Generic_Package (S) then
+
-- We are in the visible part of the package scope
exit when E = First_Private_Entity (S);
@@ -7798,8 +7743,7 @@ package body Sem_Ch8 is
elsif Is_Hidden_Open_Scope (S) then
null;
- elsif (Ekind (S) = E_Procedure
- or else Ekind (S) = E_Function)
+ elsif Ekind_In (S, E_Procedure, E_Function)
and then Has_Completion (S)
then
Full_Vis := True;
@@ -7974,7 +7918,7 @@ package body Sem_Ch8 is
Id := First_Entity (P);
while Present (Id)
and then (Id /= First_Private_Entity (P)
- or else Private_With_OK) -- Ada 2005 (AI-262)
+ or else Private_With_OK) -- Ada 2005 (AI-262)
loop
Prev := Current_Entity (Id);
while Present (Prev) loop
@@ -8042,10 +7986,10 @@ package body Sem_Ch8 is
elsif Ekind (Prev) = E_Operator
and then Operator_Matches_Spec (Prev, Id)
and then In_Open_Scopes
- (Scope (Base_Type (Etype (First_Formal (Id)))))
+ (Scope (Base_Type (Etype (First_Formal (Id)))))
and then (No (Next_Formal (First_Formal (Id)))
- or else Etype (First_Formal (Id))
- = Etype (Next_Formal (First_Formal (Id)))
+ or else Etype (First_Formal (Id)) =
+ Etype (Next_Formal (First_Formal (Id)))
or else Chars (Prev) = Name_Op_Expon)
then
goto Next_Usable_Entity;
@@ -8074,14 +8018,11 @@ package body Sem_Ch8 is
-- On exit, we know entity is not hidden, unless it is private
if not Is_Hidden (Id)
- and then ((not Is_Child_Unit (Id))
- or else Is_Visible_Lib_Unit (Id))
+ and then ((not Is_Child_Unit (Id)) or else Is_Visible_Lib_Unit (Id))
then
Set_Is_Potentially_Use_Visible (Id);
- if Is_Private_Type (Id)
- and then Present (Full_View (Id))
- then
+ if Is_Private_Type (Id) and then Present (Full_View (Id)) then
Set_Is_Potentially_Use_Visible (Full_View (Id));
end if;
end if;
@@ -8252,12 +8193,10 @@ package body Sem_Ch8 is
-- a limited view unless we only have a limited view of its enclosing
-- package.
- elsif From_With_Type (T)
- and then From_With_Type (Scope (T))
- then
+ elsif From_With_Type (T) and then From_With_Type (Scope (T)) then
Error_Msg_N
("incomplete type from limited view "
- & "cannot appear in use clause", Id);
+ & "cannot appear in use clause", Id);
-- If the subtype mark designates a subtype in a different package,
-- we have to check that the parent type is visible, otherwise the
@@ -8321,18 +8260,18 @@ package body Sem_Ch8 is
if Warn_On_Redundant_Constructs
and then Is_Known_Used
- -- with P; with P; use P;
- -- package P is package X is package body X is
- -- type T ... use P.T;
+ -- with P; with P; use P;
+ -- package P is package X is package body X is
+ -- type T ... use P.T;
- -- The compilation unit is the body of X. GNAT first compiles the
- -- spec of X, then proceeds to the body. At that point P is marked
- -- as use visible. The analysis then reinstalls the spec along with
- -- its context. The use clause P.T is now recognized as redundant,
- -- but in the wrong context. Do not emit a warning in such cases.
- -- Do not emit a warning either if we are in an instance, there is
- -- no redundancy between an outer use_clause and one that appears
- -- within the generic.
+ -- The compilation unit is the body of X. GNAT first compiles the
+ -- spec of X, then proceeds to the body. At that point P is marked
+ -- as use visible. The analysis then reinstalls the spec along with
+ -- its context. The use clause P.T is now recognized as redundant,
+ -- but in the wrong context. Do not emit a warning in such cases.
+ -- Do not emit a warning either if we are in an instance, there is
+ -- no redundancy between an outer use_clause and one that appears
+ -- within the generic.
and then not Spec_Reloaded_For_Body
and then not In_Instance
@@ -8386,7 +8325,6 @@ package body Sem_Ch8 is
and then
Nkind (Parent (Clause2)) = N_Compilation_Unit
then
-
-- If the unit is a subprogram body that acts as spec,
-- the context clause is shared with the constructed
-- subprogram spec. Clearly there is no redundancy.
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index 757e0ee732b..e60574a1496 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -536,6 +536,21 @@ package body Sem_Disp is
Set_Entity (Name (N), Alias (Subp));
return;
+ -- An obscure special case: a null procedure may have a class-
+ -- wide pre/postcondition that includes a call to an abstract
+ -- subp. Calls within the expression may not have been rewritten
+ -- as dispatching calls yet, because the null body appears in
+ -- the current declarative part. The expression will be properly
+ -- rewritten/reanalyzed when the postcondition procedure is built.
+
+ elsif In_Spec_Expression
+ and then Is_Subprogram (Current_Scope)
+ and then
+ Nkind (Parent (Current_Scope)) = N_Procedure_Specification
+ and then Null_Present (Parent (Current_Scope))
+ then
+ null;
+
else
-- We need to determine whether the context of the call
-- provides a tag to make the call dispatching. This requires
@@ -1198,9 +1213,7 @@ package body Sem_Disp is
Check_Subtype_Conformant (Subp, Ovr_Subp);
- if (Chars (Subp) = Name_Initialize
- or else Chars (Subp) = Name_Adjust
- or else Chars (Subp) = Name_Finalize)
+ if Nam_In (Chars (Subp), Name_Initialize, Name_Adjust, Name_Finalize)
and then Is_Controlled (Tagged_Type)
and then not Is_Visibly_Controlled (Tagged_Type)
then
@@ -1371,11 +1384,10 @@ package body Sem_Disp is
Set_DT_Position (Subp, No_Uint);
elsif Has_Controlled_Component (Tagged_Type)
- and then
- (Chars (Subp) = Name_Initialize or else
- Chars (Subp) = Name_Adjust or else
- Chars (Subp) = Name_Finalize or else
- Chars (Subp) = Name_Finalize_Address)
+ and then Nam_In (Chars (Subp), Name_Initialize,
+ Name_Adjust,
+ Name_Finalize,
+ Name_Finalize_Address)
then
declare
F_Node : constant Node_Id := Freeze_Node (Tagged_Type);
@@ -2445,7 +2457,7 @@ package body Sem_Disp is
Set_Etype (Call_Node, Etype (Control));
Set_Analyzed (Call_Node);
- Expand_Interface_Conversion (Call_Node, Is_Static => False);
+ Expand_Interface_Conversion (Call_Node);
end if;
end;
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 74cbdf10df6..6d941025c0d 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -2021,9 +2021,8 @@ package body Sem_Elab is
elsif not Debug_Flag_Dot_UU
and then Nkind (N) = N_Attribute_Reference
- and then (Attribute_Name (N) = Name_Access
- or else
- Attribute_Name (N) = Name_Unrestricted_Access)
+ and then Nam_In (Attribute_Name (N), Name_Access,
+ Name_Unrestricted_Access)
and then Is_Entity_Name (Prefix (N))
and then Is_Subprogram (Entity (Prefix (N)))
then
@@ -2258,7 +2257,7 @@ package body Sem_Elab is
-- in this case, due to the out of order handling in this case.
and then (Nkind (Original_Node (N)) /= N_Function_Call
- or else not In_Assertion (Original_Node (N)))
+ or else not In_Assertion_Expression (Original_Node (N)))
then
if Inst_Case then
Error_Msg_NE
@@ -3339,9 +3338,11 @@ package body Sem_Elab is
if Nkind (Item) = N_Pragma
and then Pragma_Name (Item) = Name_Elaborate_All
then
- -- Return if some previous error on the pragma itself
+ -- Return if some previous error on the pragma itself. The
+ -- pragma may be unanalyzed, because of a previous error, or
+ -- if it is the context of a subunit, inherited by its parent.
- if Error_Posted (Item) then
+ if Error_Posted (Item) or else not Analyzed (Item) then
return;
end if;
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index ab7f3c934ae..0f3d55db3da 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -528,9 +528,7 @@ package body Sem_Eval is
-- Fixup only required for First/Last attribute reference
if Nkind (N) = N_Attribute_Reference
- and then (Attribute_Name (N) = Name_First
- or else
- Attribute_Name (N) = Name_Last)
+ and then Nam_In (Attribute_Name (N), Name_First, Name_Last)
then
Xtyp := Etype (Prefix (N));
@@ -697,9 +695,7 @@ package body Sem_Eval is
elsif Nkind (Lf) = N_Attribute_Reference
and then Attribute_Name (Lf) = Attribute_Name (Rf)
- and then (Attribute_Name (Lf) = Name_First
- or else
- Attribute_Name (Lf) = Name_Last)
+ and then Nam_In (Attribute_Name (Lf), Name_First, Name_Last)
and then Nkind_In (Prefix (Lf), N_Identifier, N_Expanded_Name)
and then Nkind_In (Prefix (Rf), N_Identifier, N_Expanded_Name)
and then Entity (Prefix (Lf)) = Entity (Prefix (Rf))
@@ -1932,20 +1928,17 @@ package body Sem_Eval is
Set_Is_Static_Expression (N, Stat);
- if Stat then
-
- -- If left operand is the empty string, the result is the
- -- right operand, including its bounds if anomalous.
-
- if Left_Len = 0
- and then Is_Array_Type (Etype (Right))
- and then Etype (Right) /= Any_String
- then
- Set_Etype (N, Etype (Right));
- end if;
+ -- If left operand is the empty string, the result is the
+ -- right operand, including its bounds if anomalous.
- Fold_Str (N, Folded_Val, Static => True);
+ if Left_Len = 0
+ and then Is_Array_Type (Etype (Right))
+ and then Etype (Right) /= Any_String
+ then
+ Set_Etype (N, Etype (Right));
end if;
+
+ Fold_Str (N, Folded_Val, Static => Stat);
end;
end Eval_Concatenation;
@@ -3411,11 +3404,12 @@ package body Sem_Eval is
-- is too long, or it is null, and the lower bound is type'First. In
-- either case it is the upper bound that is out of range of the index
-- type.
-
if Ada_Version >= Ada_95 then
if Root_Type (Bas) = Standard_String
or else
Root_Type (Bas) = Standard_Wide_String
+ or else
+ Root_Type (Bas) = Standard_Wide_Wide_String
then
Xtp := Standard_Positive;
else
@@ -3428,24 +3422,54 @@ package body Sem_Eval is
Lo := Type_Low_Bound (Etype (First_Index (Typ)));
end if;
+ -- Check for string too long
+
Len := String_Length (Strval (N));
if UI_From_Int (Len) > String_Type_Len (Bas) then
- Apply_Compile_Time_Constraint_Error
- (N, "string literal too long for}", CE_Length_Check_Failed,
- Ent => Bas,
- Typ => First_Subtype (Bas));
+
+ -- Issue message. Note that this message is a warning if the
+ -- string literal is not marked as static (happens in some cases
+ -- of folding strings known at compile time, but not static).
+ -- Furthermore in such cases, we reword the message, since there
+ -- is no string literal in the source program!
+
+ if Is_Static_Expression (N) then
+ Apply_Compile_Time_Constraint_Error
+ (N, "string literal too long for}", CE_Length_Check_Failed,
+ Ent => Bas,
+ Typ => First_Subtype (Bas));
+ else
+ Apply_Compile_Time_Constraint_Error
+ (N, "string value too long for}", CE_Length_Check_Failed,
+ Ent => Bas,
+ Typ => First_Subtype (Bas),
+ Warn => True);
+ end if;
+
+ -- Test for null string not allowed
elsif Len = 0
and then not Is_Generic_Type (Xtp)
and then
Expr_Value (Lo) = Expr_Value (Type_Low_Bound (Base_Type (Xtp)))
then
- Apply_Compile_Time_Constraint_Error
- (N, "null string literal not allowed for}",
- CE_Length_Check_Failed,
- Ent => Bas,
- Typ => First_Subtype (Bas));
+ -- Same specialization of message
+
+ if Is_Static_Expression (N) then
+ Apply_Compile_Time_Constraint_Error
+ (N, "null string literal not allowed for}",
+ CE_Length_Check_Failed,
+ Ent => Bas,
+ Typ => First_Subtype (Bas));
+ else
+ Apply_Compile_Time_Constraint_Error
+ (N, "null string value not allowed for}",
+ CE_Length_Check_Failed,
+ Ent => Bas,
+ Typ => First_Subtype (Bas),
+ Warn => True);
+ end if;
end if;
end if;
end Eval_String_Literal;
@@ -4091,7 +4115,7 @@ package body Sem_Eval is
-- Note that we have to reset Is_Static_Expression both after the
-- analyze step (because Resolve will evaluate the literal, which
-- will cause semantic errors if it is marked as static), and after
- -- the Resolve step (since Resolve in some cases sets this flag).
+ -- the Resolve step (since Resolve in some cases resets this flag).
Analyze (N);
Set_Is_Static_Expression (N, Static);
@@ -5467,8 +5491,8 @@ package body Sem_Eval is
if Raises_Constraint_Error (Expr) then
Error_Msg_N
- ("expression raises exception, cannot be static " &
- "(RM 4.9(34))!", N);
+ ("\expression raises exception, cannot be static " &
+ "(RM 4.9(34))", N);
return;
end if;
@@ -5488,8 +5512,8 @@ package body Sem_Eval is
and then not Is_RTE (Typ, RE_Bignum)
then
Error_Msg_N
- ("static expression must have scalar or string type " &
- "(RM 4.9(2))!", N);
+ ("\static expression must have scalar or string type " &
+ "(RM 4.9(2))", N);
return;
end if;
end if;
@@ -5497,6 +5521,9 @@ package body Sem_Eval is
-- If we got through those checks, test particular node kind
case Nkind (N) is
+
+ -- Entity name
+
when N_Expanded_Name | N_Identifier | N_Operator_Symbol =>
E := Entity (N);
@@ -5504,30 +5531,84 @@ package body Sem_Eval is
null;
elsif Ekind (E) = E_Constant then
- if not Is_Static_Expression (Constant_Value (E)) then
- Error_Msg_NE
- ("& is not a static constant (RM 4.9(5))!", N, E);
- end if;
+
+ -- One case we can give a metter message is when we have a
+ -- string literal created by concatenating an aggregate with
+ -- an others expression.
+
+ Entity_Case : declare
+ CV : constant Node_Id := Constant_Value (E);
+ CO : constant Node_Id := Original_Node (CV);
+
+ function Is_Aggregate (N : Node_Id) return Boolean;
+ -- See if node N came from an others aggregate, if so
+ -- return True and set Error_Msg_Sloc to aggregate.
+
+ ------------------
+ -- Is_Aggregate --
+ ------------------
+
+ function Is_Aggregate (N : Node_Id) return Boolean is
+ begin
+ if Nkind (Original_Node (N)) = N_Aggregate then
+ Error_Msg_Sloc := Sloc (Original_Node (N));
+ return True;
+ elsif Is_Entity_Name (N)
+ and then Ekind (Entity (N)) = E_Constant
+ and then
+ Nkind (Original_Node (Constant_Value (Entity (N)))) =
+ N_Aggregate
+ then
+ Error_Msg_Sloc :=
+ Sloc (Original_Node (Constant_Value (Entity (N))));
+ return True;
+ else
+ return False;
+ end if;
+ end Is_Aggregate;
+
+ -- Start of processing for Entity_Case
+
+ begin
+ if Is_Aggregate (CV)
+ or else (Nkind (CO) = N_Op_Concat
+ and then (Is_Aggregate (Left_Opnd (CO))
+ or else
+ Is_Aggregate (Right_Opnd (CO))))
+ then
+ Error_Msg_N ("\aggregate (#) is never static", N);
+
+ elsif not Is_Static_Expression (CV) then
+ Error_Msg_NE
+ ("\& is not a static constant (RM 4.9(5))", N, E);
+ end if;
+ end Entity_Case;
else
Error_Msg_NE
- ("& is not static constant or named number " &
- "(RM 4.9(5))!", N, E);
+ ("\& is not static constant or named number "
+ & "(RM 4.9(5))", N, E);
end if;
+ -- Binary operator
+
when N_Binary_Op | N_Short_Circuit | N_Membership_Test =>
if Nkind (N) in N_Op_Shift then
Error_Msg_N
- ("shift functions are never static (RM 4.9(6,18))!", N);
+ ("\shift functions are never static (RM 4.9(6,18))", N);
else
Why_Not_Static (Left_Opnd (N));
Why_Not_Static (Right_Opnd (N));
end if;
+ -- Unary operator
+
when N_Unary_Op =>
Why_Not_Static (Right_Opnd (N));
+ -- Attribute reference
+
when N_Attribute_Reference =>
Why_Not_Static_List (Expressions (N));
@@ -5541,8 +5622,8 @@ package body Sem_Eval is
if Attribute_Name (N) = Name_Size then
Error_Msg_N
- ("size attribute is only static for static scalar type " &
- "(RM 4.9(7,8))", N);
+ ("\size attribute is only static for static scalar type "
+ & "(RM 4.9(7,8))", N);
-- Flag array cases
@@ -5554,15 +5635,15 @@ package body Sem_Eval is
Attribute_Name (N) /= Name_Length
then
Error_Msg_N
- ("static array attribute must be Length, First, or Last " &
- "(RM 4.9(8))!", N);
+ ("\static array attribute must be Length, First, or Last "
+ & "(RM 4.9(8))", N);
-- Since we know the expression is not-static (we already
-- tested for this, must mean array is not static).
else
Error_Msg_N
- ("prefix is non-static array (RM 4.9(8))!", Prefix (N));
+ ("\prefix is non-static array (RM 4.9(8))", Prefix (N));
end if;
return;
@@ -5575,30 +5656,36 @@ package body Sem_Eval is
Is_Generic_Type (E)
then
Error_Msg_N
- ("attribute of generic type is never static " &
- "(RM 4.9(7,8))!", N);
+ ("\attribute of generic type is never static "
+ & "(RM 4.9(7,8))", N);
elsif Is_Static_Subtype (E) then
null;
elsif Is_Scalar_Type (E) then
Error_Msg_N
- ("prefix type for attribute is not static scalar subtype " &
- "(RM 4.9(7))!", N);
+ ("\prefix type for attribute is not static scalar subtype "
+ & "(RM 4.9(7))", N);
else
Error_Msg_N
- ("static attribute must apply to array/scalar type " &
- "(RM 4.9(7,8))!", N);
+ ("\static attribute must apply to array/scalar type "
+ & "(RM 4.9(7,8))", N);
end if;
+ -- String literal
+
when N_String_Literal =>
Error_Msg_N
- ("subtype of string literal is non-static (RM 4.9(4))!", N);
+ ("\subtype of string literal is non-static (RM 4.9(4))", N);
+
+ -- Explicit dereference
when N_Explicit_Dereference =>
Error_Msg_N
- ("explicit dereference is never static (RM 4.9)!", N);
+ ("\explicit dereference is never static (RM 4.9)", N);
+
+ -- Function call
when N_Function_Call =>
Why_Not_Static_List (Parameter_Associations (N));
@@ -5608,44 +5695,59 @@ package body Sem_Eval is
-- scalar arithmetic operation.
if not Is_RTE (Typ, RE_Bignum) then
- Error_Msg_N ("non-static function call (RM 4.9(6,18))!", N);
+ Error_Msg_N ("\non-static function call (RM 4.9(6,18))", N);
end if;
+ -- Parameter assocation (test actual parameter)
+
when N_Parameter_Association =>
Why_Not_Static (Explicit_Actual_Parameter (N));
+ -- Indexed component
+
when N_Indexed_Component =>
- Error_Msg_N
- ("indexed component is never static (RM 4.9)!", N);
+ Error_Msg_N ("\indexed component is never static (RM 4.9)", N);
+
+ -- Procedure call
when N_Procedure_Call_Statement =>
- Error_Msg_N
- ("procedure call is never static (RM 4.9)!", N);
+ Error_Msg_N ("\procedure call is never static (RM 4.9)", N);
+
+ -- Qualified expression (test expression)
when N_Qualified_Expression =>
Why_Not_Static (Expression (N));
+ -- Aggregate
+
when N_Aggregate | N_Extension_Aggregate =>
- Error_Msg_N
- ("an aggregate is never static (RM 4.9)!", N);
+ Error_Msg_N ("\an aggregate is never static (RM 4.9)", N);
+
+ -- Range
when N_Range =>
Why_Not_Static (Low_Bound (N));
Why_Not_Static (High_Bound (N));
+ -- Range constraint, test range expression
+
when N_Range_Constraint =>
Why_Not_Static (Range_Expression (N));
+ -- Subtype indication, test constraint
+
when N_Subtype_Indication =>
Why_Not_Static (Constraint (N));
+ -- Selected component
+
when N_Selected_Component =>
- Error_Msg_N
- ("selected component is never static (RM 4.9)!", N);
+ Error_Msg_N ("\selected component is never static (RM 4.9)", N);
+
+ -- Slice
when N_Slice =>
- Error_Msg_N
- ("slice is never static (RM 4.9)!", N);
+ Error_Msg_N ("\slice is never static (RM 4.9)", N);
when N_Type_Conversion =>
Why_Not_Static (Expression (N));
@@ -5654,13 +5756,17 @@ package body Sem_Eval is
or else not Is_Static_Subtype (Entity (Subtype_Mark (N)))
then
Error_Msg_N
- ("static conversion requires static scalar subtype result " &
- "(RM 4.9(9))!", N);
+ ("\static conversion requires static scalar subtype result "
+ & "(RM 4.9(9))", N);
end if;
+ -- Unchecked type conversion
+
when N_Unchecked_Type_Conversion =>
Error_Msg_N
- ("unchecked type conversion is never static (RM 4.9)!", N);
+ ("\unchecked type conversion is never static (RM 4.9)", N);
+
+ -- All other cases, no reason to give
when others =>
null;
diff --git a/gcc/ada/sem_eval.ads b/gcc/ada/sem_eval.ads
index 06607d77897..66a9e3ecc65 100644
--- a/gcc/ada/sem_eval.ads
+++ b/gcc/ada/sem_eval.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -417,17 +417,17 @@ package Sem_Eval is
procedure Why_Not_Static (Expr : Node_Id);
-- This procedure may be called after generating an error message that
- -- complains that something is non-static. If it finds good reasons, it
- -- generates one or more error messages pointing the appropriate offending
- -- component of the expression. If no good reasons can be figured out, then
- -- no messages are generated. The expectation here is that the caller has
- -- already issued a message complaining that the expression is non-static.
- -- Note that this message should be placed using Error_Msg_F or
- -- Error_Msg_FE, so that it will sort before any messages placed by this
- -- call. Note that it is fine to call Why_Not_Static with something that is
- -- not an expression, and usually this has no effect, but in some cases
- -- (N_Parameter_Association or N_Range), it makes sense for the internal
- -- recursive calls.
+ -- complains that something is non-static. If it finds good reasons,
+ -- it generates one or more continuation error messages pointing the
+ -- appropriate offending component of the expression. If no good reasons
+ -- can be figured out, then no messages are generated. The expectation here
+ -- is that the caller has already issued a message complaining that the
+ -- expression is non-static. Note that this message should be placed using
+ -- Error_Msg_F or Error_Msg_FE, so that it will sort before any messages
+ -- placed by this call. Note that it is fine to call Why_Not_Static with
+ -- something that is not an expression, and usually this has no effect, but
+ -- in some cases (N_Parameter_Association or N_Range), it makes sense for
+ -- the internal recursive calls.
procedure Initialize;
-- Initializes the internal data structures. Must be called before each
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb
index fe3855d33d6..ed607ce53c1 100644
--- a/gcc/ada/sem_intr.adb
+++ b/gcc/ada/sem_intr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -127,11 +127,9 @@ package body Sem_Intr is
-- literal is legal even in Ada 83 mode, where such literals are
-- not static.
- if Cnam = Name_Import_Address
- or else
- Cnam = Name_Import_Largest_Value
- or else
- Cnam = Name_Import_Value
+ if Nam_In (Cnam, Name_Import_Address,
+ Name_Import_Largest_Value,
+ Name_Import_Value)
then
if Etype (Arg1) = Any_Type
or else Raises_Constraint_Error (Arg1)
@@ -196,30 +194,13 @@ package body Sem_Intr is
begin
-- Arithmetic operators
- if Nam = Name_Op_Add
- or else
- Nam = Name_Op_Subtract
- or else
- Nam = Name_Op_Multiply
- or else
- Nam = Name_Op_Divide
- or else
- Nam = Name_Op_Rem
- or else
- Nam = Name_Op_Mod
- or else
- Nam = Name_Op_Abs
+ if Nam_In (Nam, Name_Op_Add, Name_Op_Subtract, Name_Op_Multiply,
+ Name_Op_Divide, Name_Op_Rem, Name_Op_Mod, Name_Op_Abs)
then
T1 := Etype (First_Formal (E));
if No (Next_Formal (First_Formal (E))) then
-
- if Nam = Name_Op_Add
- or else
- Nam = Name_Op_Subtract
- or else
- Nam = Name_Op_Abs
- then
+ if Nam_In (Nam, Name_Op_Add, Name_Op_Subtract, Name_Op_Abs) then
T2 := T1;
-- Previous error in declaration
@@ -254,17 +235,8 @@ package body Sem_Intr is
-- Comparison operators
- elsif Nam = Name_Op_Eq
- or else
- Nam = Name_Op_Ge
- or else
- Nam = Name_Op_Gt
- or else
- Nam = Name_Op_Le
- or else
- Nam = Name_Op_Lt
- or else
- Nam = Name_Op_Ne
+ elsif Nam_In (Nam, Name_Op_Eq, Name_Op_Ge, Name_Op_Gt, Name_Op_Le,
+ Name_Op_Lt, Name_Op_Ne)
then
T1 := Etype (First_Formal (E));
@@ -370,35 +342,22 @@ package body Sem_Intr is
-- Shift cases. We allow user specification of intrinsic shift
-- operators for any numeric types.
- elsif
- Nam = Name_Rotate_Left
- or else
- Nam = Name_Rotate_Right
- or else
- Nam = Name_Shift_Left
- or else
- Nam = Name_Shift_Right
- or else
- Nam = Name_Shift_Right_Arithmetic
+ elsif Nam_In (Nam, Name_Rotate_Left, Name_Rotate_Right, Name_Shift_Left,
+ Name_Shift_Right, Name_Shift_Right_Arithmetic)
then
Check_Shift (E, N);
- elsif
- Nam = Name_Exception_Information
- or else
- Nam = Name_Exception_Message
- or else
- Nam = Name_Exception_Name
+ elsif Nam_In (Nam, Name_Exception_Information,
+ Name_Exception_Message,
+ Name_Exception_Name)
then
Check_Exception_Function (E, N);
elsif Nkind (E) = N_Defining_Operator_Symbol then
Check_Intrinsic_Operator (E, N);
- elsif Nam = Name_File
- or else Nam = Name_Line
- or else Nam = Name_Source_Location
- or else Nam = Name_Enclosing_Entity
+ elsif Nam_In (Nam, Name_File, Name_Line, Name_Source_Location,
+ Name_Enclosing_Entity)
then
null;
diff --git a/gcc/ada/sem_mech.adb b/gcc/ada/sem_mech.adb
index e2fce979a22..924b58c76af 100644
--- a/gcc/ada/sem_mech.adb
+++ b/gcc/ada/sem_mech.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -110,8 +110,9 @@ package body Sem_Mech is
Class := First (Expressions (Mech_Name));
if Nkind (Prefix (Mech_Name)) /= N_Identifier
- or else not (Chars (Prefix (Mech_Name)) = Name_Descriptor or else
- Chars (Prefix (Mech_Name)) = Name_Short_Descriptor)
+ or else
+ not Nam_In (Chars (Prefix (Mech_Name)), Name_Descriptor,
+ Name_Short_Descriptor)
or else Present (Next (Class))
then
Bad_Mechanism;
@@ -129,8 +130,9 @@ package body Sem_Mech is
Param := First (Parameter_Associations (Mech_Name));
if Nkind (Name (Mech_Name)) /= N_Identifier
- or else not (Chars (Name (Mech_Name)) = Name_Descriptor or else
- Chars (Name (Mech_Name)) = Name_Short_Descriptor)
+ or else
+ not Nam_In (Chars (Name (Mech_Name)), Name_Descriptor,
+ Name_Short_Descriptor)
or else Present (Next (Param))
or else No (Selector_Name (Param))
or else Chars (Selector_Name (Param)) /= Name_Class
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 32b5130f797..0636b8e272b 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -181,11 +181,24 @@ package body Sem_Prag is
-- original one, following the renaming chain) is returned. Otherwise the
-- entity is returned unchanged. Should be in Einfo???
+ function Is_Valid_Assertion_Kind (Nam : Name_Id) return Boolean;
+ -- Returns True if Nam is one of the names recognized as a valid assertion
+ -- kind by the Assertion_Policy pragma. Note that the 'Class cases are
+ -- represented by the corresponding special names Name_uPre, Name_uPost,
+ -- Name_uInviarnat, and Name_uType_Invariant (_Pre, _Post, _Invariant,
+ -- and _Type_Invariant).
+
procedure Preanalyze_CTC_Args (N, Arg_Req, Arg_Ens : Node_Id);
-- Preanalyze the boolean expressions in the Requires and Ensures arguments
-- of a Contract_Case or Test_Case pragma if present (possibly Empty). We
-- treat these as spec expressions (i.e. similar to a default expression).
+ procedure Rewrite_Assertion_Kind (N : Node_Id);
+ -- If N is Pre'Class, Post'Class, Invariant'Class, or Type_Invariant'Class,
+ -- then it is rewritten as an identifier with the corresponding special
+ -- name _Pre, _Post, _Invariant, or _Type_Invariant. Used by pragmas
+ -- Check, Check_Policy.
+
procedure rv;
-- This is a dummy function called by the processing for pragma Reviewable.
-- It is there for assisting front end debugging. By placing a Reviewable
@@ -248,20 +261,68 @@ package body Sem_Prag is
------------------------------
procedure Analyze_CTC_In_Decl_Part (N : Node_Id; S : Entity_Id) is
+
+ procedure Analyze_Contract_Cases (Aggr : Node_Id);
+ -- Pre-analyze the guard and consequence expressions of a Contract_Cases
+ -- pragma/aspect aggregate expression.
+
+ ----------------------------
+ -- Analyze_Contract_Cases --
+ ----------------------------
+
+ procedure Analyze_Contract_Cases (Aggr : Node_Id) is
+ Case_Guard : Node_Id;
+ Conseq : Node_Id;
+ Post_Case : Node_Id;
+
+ begin
+ Post_Case := First (Component_Associations (Aggr));
+ while Present (Post_Case) loop
+ Case_Guard := First (Choices (Post_Case));
+ Conseq := Expression (Post_Case);
+
+ -- Preanalyze the boolean expression, we treat this as a spec
+ -- expression (i.e. similar to a default expression).
+
+ if Nkind (Case_Guard) /= N_Others_Choice then
+ Preanalyze_Assert_Expression (Case_Guard, Standard_Boolean);
+ end if;
+
+ Preanalyze_Assert_Expression (Conseq, Standard_Boolean);
+
+ Next (Post_Case);
+ end loop;
+ end Analyze_Contract_Cases;
+
+ -- Start of processing for Analyze_CTC_In_Decl_Part
+
begin
-- Install formals and push subprogram spec onto scope stack so that we
-- can see the formals from the pragma.
- Install_Formals (S);
Push_Scope (S);
+ Install_Formals (S);
-- Preanalyze the boolean expressions, we treat these as spec
-- expressions (i.e. similar to a default expression).
- Preanalyze_CTC_Args
- (N,
- Get_Requires_From_CTC_Pragma (N),
- Get_Ensures_From_CTC_Pragma (N));
+ if Nam_In (Pragma_Name (N), Name_Test_Case, Name_Contract_Case) then
+ Preanalyze_CTC_Args
+ (N,
+ Get_Requires_From_CTC_Pragma (N),
+ Get_Ensures_From_CTC_Pragma (N));
+
+ elsif Pragma_Name (N) = Name_Contract_Cases then
+ Analyze_Contract_Cases
+ (Expression (First (Pragma_Argument_Associations (N))));
+
+ -- In ASIS mode, for a pragma generated from a source aspect, also
+ -- analyze the original aspect expression.
+
+ if ASIS_Mode and then Present (Corresponding_Aspect (N)) then
+ Analyze_Contract_Cases (Expression (Corresponding_Aspect (N)));
+ end if;
+ end if;
-- Remove the subprogram from the scope stack now that the pre-analysis
-- of the expressions in the contract case or test case is done.
@@ -401,9 +462,8 @@ package body Sem_Prag is
Error_Msg_Name_2 := Name_Class;
Error_Msg_N
- ("aspect `%''%` can only be specified for a primitive " &
- "operation of a tagged type",
- Corresponding_Aspect (N));
+ ("aspect `%''%` can only be specified for a primitive "
+ & "operation of a tagged type", Corresponding_Aspect (N));
end if;
Replace_Type (Get_Pragma_Arg (Arg1));
@@ -459,6 +519,11 @@ package body Sem_Prag is
-- In Ada 95 or 05 mode, these are implementation defined pragmas, so
-- should be caught by the No_Implementation_Pragmas restriction.
+ procedure Add_Item (Item : Entity_Id; To_List : in out Elist_Id);
+ -- Subsidiary routine to the analysis of pragmas Depends and Global.
+ -- Append an input or output item to a list. If the list is empty, a
+ -- new one is created.
+
procedure Check_Ada_83_Warning;
-- Issues a warning message for the current pragma if operating in Ada
-- 83 mode (used for language pragmas that are not a standard part of
@@ -984,6 +1049,19 @@ package body Sem_Prag is
end if;
end Ada_2012_Pragma;
+ --------------
+ -- Add_Item --
+ --------------
+
+ procedure Add_Item (Item : Entity_Id; To_List : in out Elist_Id) is
+ begin
+ if No (To_List) then
+ To_List := New_Elmt_List;
+ end if;
+
+ Append_Unique_Elmt (Item, To_List);
+ end Add_Item;
+
--------------------------
-- Check_Ada_83_Warning --
--------------------------
@@ -1143,6 +1221,7 @@ package body Sem_Prag is
OK : Boolean;
Ent : constant Entity_Id := Entity (Argx);
Scop : constant Entity_Id := Scope (Ent);
+
begin
-- Case of a pragma applied to a compilation unit: pragma must
-- occur immediately after the program unit in the compilation.
@@ -1239,7 +1318,7 @@ package body Sem_Prag is
begin
Check_Arg_Is_Identifier (Argx);
- if Chars (Argx) /= N1 and then Chars (Argx) /= N2 then
+ if not Nam_In (Chars (Argx), N1, N2) then
Error_Msg_Name_2 := N1;
Error_Msg_Name_3 := N2;
Error_Pragma_Arg ("argument for pragma% must be% or%", Argx);
@@ -1255,10 +1334,7 @@ package body Sem_Prag is
begin
Check_Arg_Is_Identifier (Argx);
- if Chars (Argx) /= N1
- and then Chars (Argx) /= N2
- and then Chars (Argx) /= N3
- then
+ if not Nam_In (Chars (Argx), N1, N2, N3) then
Error_Pragma_Arg ("invalid argument for pragma%", Argx);
end if;
end Check_Arg_Is_One_Of;
@@ -1272,11 +1348,7 @@ package body Sem_Prag is
begin
Check_Arg_Is_Identifier (Argx);
- if Chars (Argx) /= N1
- and then Chars (Argx) /= N2
- and then Chars (Argx) /= N3
- and then Chars (Argx) /= N4
- then
+ if not Nam_In (Chars (Argx), N1, N2, N3, N4) then
Error_Pragma_Arg ("invalid argument for pragma%", Argx);
end if;
end Check_Arg_Is_One_Of;
@@ -1290,12 +1362,7 @@ package body Sem_Prag is
begin
Check_Arg_Is_Identifier (Argx);
- if Chars (Argx) /= N1
- and then Chars (Argx) /= N2
- and then Chars (Argx) /= N3
- and then Chars (Argx) /= N4
- and then Chars (Argx) /= N5
- then
+ if not Nam_In (Chars (Argx), N1, N2, N3, N4, N5) then
Error_Pragma_Arg ("invalid argument for pragma%", Argx);
end if;
end Check_Arg_Is_One_Of;
@@ -1430,8 +1497,8 @@ package body Sem_Prag is
and then not Is_Unchecked_Union (Etype (Subtype_Mark (Sindic)))
then
Error_Msg_N
- ("component subtype subject to per-object constraint " &
- "must be an Unchecked_Union", Comp);
+ ("component subtype subject to per-object constraint "
+ & "must be an Unchecked_Union", Comp);
-- Ada 2012 (AI05-0026): For an unchecked union type declared within
-- the body of a generic unit, or within the body of any of its
@@ -1914,13 +1981,15 @@ package body Sem_Prag is
-- instance can be in a nested scope. The check that protected type
-- is itself a library-level declaration is done elsewhere.
- -- Note: we omit this check in Codepeer mode to properly handle code
- -- prior to AI-0033 (pragmas don't matter to codepeer in any case).
+ -- Note: we omit this check in Relaxed_RM_Semantics mode to properly
+ -- handle code prior to AI-0033. Analysis tools typically are not
+ -- interested in this pragma in any case, so no need to worry too
+ -- much about its placement.
if Inside_A_Generic then
if Ekind (Scope (Current_Scope)) = E_Generic_Package
and then In_Package_Body (Scope (Current_Scope))
- and then not CodePeer_Mode
+ and then not Relaxed_RM_Semantics
then
Error_Pragma ("pragma% cannot be used inside a generic");
end if;
@@ -1946,12 +2015,12 @@ package body Sem_Prag is
begin
if Nkind (Constr) = N_Pragma then
Error_Pragma
- ("pragma % must appear immediately within the statements " &
- "of a loop");
+ ("pragma % must appear immediately within the statements "
+ & "of a loop");
else
Error_Pragma_Arg
- ("block containing pragma % must appear immediately within " &
- "the statements of a loop", Constr);
+ ("block containing pragma % must appear immediately within "
+ & "the statements of a loop", Constr);
end if;
end Placement_Error;
@@ -2095,9 +2164,7 @@ package body Sem_Prag is
procedure Check_No_Link_Name is
begin
- if Present (Arg3)
- and then Chars (Arg3) = Name_Link_Name
- then
+ if Present (Arg3) and then Chars (Arg3) = Name_Link_Name then
Arg4 := Arg3;
end if;
@@ -2185,13 +2252,18 @@ package body Sem_Prag is
("aspect % requires ''Class for null procedure");
-- Pre/postconditions are legal on a subprogram body if it is not
- -- a completion of a declaration.
+ -- a completion of a declaration. They are also legal on a stub
+ -- with no previous declarations (this is checked when processing
+ -- the corresponding aspects).
elsif Nkind (PO) = N_Subprogram_Body
and then Acts_As_Spec (PO)
then
null;
+ elsif Nkind (PO) = N_Subprogram_Body_Stub then
+ null;
+
elsif not Nkind_In (PO, N_Subprogram_Declaration,
N_Expression_Function,
N_Generic_Subprogram_Declaration,
@@ -2248,12 +2320,12 @@ package body Sem_Prag is
-- For a pragma PPC in the extended main source unit, record enabled
-- status in SCO.
- -- This may seem redundant with the call to Check_Enabled occurring
- -- later on when the pragma is rewritten into a pragma Check but
- -- is actually required in the case of a postcondition within a
+ -- This may seem redundant with the call to Check_Kind test that
+ -- occurs later on when the pragma is rewritten into a pragma Check
+ -- but is actually required in the case of a postcondition within a
-- generic.
- if Check_Enabled (Pname) and then not Split_PPC (N) then
+ if Check_Kind (Pname) = Name_Check and then not Split_PPC (N) then
Set_SCO_Pragma_Enabled (Loc);
end if;
@@ -3410,19 +3482,16 @@ package body Sem_Prag is
then
-- Give error if same as our pragma or Export/Convention
- if Pragma_Name (Decl) = Name_Export
- or else
- Pragma_Name (Decl) = Name_Convention
- or else
- Pragma_Name (Decl) = Pragma_Name (N)
+ if Nam_In (Pragma_Name (Decl), Name_Export,
+ Name_Convention,
+ Pragma_Name (N))
then
exit;
-- Case of Import/Interface or the other way round
- elsif Pragma_Name (Decl) = Name_Interface
- or else
- Pragma_Name (Decl) = Name_Import
+ elsif Nam_In (Pragma_Name (Decl), Name_Interface,
+ Name_Import)
then
-- Here we know that we have Import and Interface. It
-- doesn't matter which way round they are. See if
@@ -3450,8 +3519,12 @@ package body Sem_Prag is
end if;
-- Give message if needed if we fall through those tests
+ -- except on Relaxed_RM_Semantics where we let go: either this
+ -- is a case accepted/ignored by other Ada compilers (e.g.
+ -- a mix of Convention and Import), or another error will be
+ -- generated later (e.g. using both Import and Export).
- if Err then
+ if Err and not Relaxed_RM_Semantics then
Error_Pragma_Arg
("at most one Convention/Export/Import pragma is allowed",
Arg2);
@@ -3475,9 +3548,8 @@ package body Sem_Prag is
and then C /= Convention (Overridden_Operation (E))
then
Error_Pragma_Arg
- ("cannot change convention for " &
- "overridden dispatching operation",
- Arg1);
+ ("cannot change convention for overridden dispatching "
+ & "operation", Arg1);
end if;
-- Set the convention
@@ -3648,9 +3720,12 @@ package body Sem_Prag is
end if;
-- Check that we are not applying this to a specless body
+ -- Relax this check if Relaxed_RM_Semantics to accomodate other Ada
+ -- compilers.
if Is_Subprogram (E)
and then Nkind (Parent (Declaration_Node (E))) = N_Subprogram_Body
+ and then not Relaxed_RM_Semantics
then
Error_Pragma
("pragma% requires separate spec and must come before body");
@@ -4192,9 +4267,7 @@ package body Sem_Prag is
elsif Etype (Def_Id) /= Standard_Void_Type
and then
- (Pname = Name_Export_Procedure
- or else
- Pname = Name_Import_Procedure)
+ Nam_In (Pname, Name_Export_Procedure, Name_Import_Procedure)
then
Match := False;
@@ -4786,8 +4859,8 @@ package body Sem_Prag is
then
Error_Msg_Sloc := Sloc (Def_Id);
Error_Msg_NE
- ("cannot import&, renaming already provided for " &
- "declaration #", N, Def_Id);
+ ("cannot import&, renaming already provided for "
+ & "declaration #", N, Def_Id);
end if;
end;
@@ -5256,7 +5329,7 @@ package body Sem_Prag is
elsif not Effective
and then Warn_On_Redundant_Constructs
- and then not (Status = Suppressed or Suppress_All_Inlining)
+ and then not (Status = Suppressed or else Suppress_All_Inlining)
then
if Inlining_Not_Possible (Subp) then
Error_Msg_NE
@@ -5729,6 +5802,26 @@ package body Sem_Prag is
end if;
end;
+ elsif Id = Name_No_Use_Of_Attribute then
+ if Nkind (Expr) /= N_Identifier
+ or else not Is_Attribute_Name (Chars (Expr))
+ then
+ Error_Msg_N ("unknown attribute name?", Expr);
+
+ else
+ Set_Restriction_No_Use_Of_Attribute (Expr, Warn);
+ end if;
+
+ elsif Id = Name_No_Use_Of_Pragma then
+ if Nkind (Expr) /= N_Identifier
+ or else not Is_Pragma_Name (Chars (Expr))
+ then
+ Error_Msg_N ("unknown pragma name?", Expr);
+
+ else
+ Set_Restriction_No_Use_Of_Pragma (Expr, Warn);
+ end if;
+
-- All other cases of restriction identifier present
else
@@ -5996,7 +6089,9 @@ package body Sem_Prag is
Error_Pragma_Arg
("cannot export entity& that was previously imported", Arg);
- elsif Present (Address_Clause (E)) and then not CodePeer_Mode then
+ elsif Present (Address_Clause (E))
+ and then not Relaxed_RM_Semantics
+ then
Error_Pragma_Arg
("cannot export entity& that has an address clause", Arg);
end if;
@@ -6152,6 +6247,12 @@ package body Sem_Prag is
if Is_Exported (E) then
Error_Msg_NE ("entity& was previously exported", N, E);
+ -- Ignore error in CodePeer mode where we treat all imported
+ -- subprograms as unknown.
+
+ elsif CodePeer_Mode then
+ goto OK;
+
-- OK if Import/Interface case
elsif Import_Interface_Present (N) then
@@ -6286,9 +6387,10 @@ package body Sem_Prag is
Class := First (Expressions (Mech_Name));
if Nkind (Prefix (Mech_Name)) /= N_Identifier
- or else not (Chars (Prefix (Mech_Name)) = Name_Descriptor or else
- Chars (Prefix (Mech_Name)) = Name_Short_Descriptor)
- or else Present (Next (Class))
+ or else
+ not Nam_In (Chars (Prefix (Mech_Name)), Name_Descriptor,
+ Name_Short_Descriptor)
+ or else Present (Next (Class))
then
Bad_Mechanism;
else
@@ -6313,8 +6415,9 @@ package body Sem_Prag is
Param := First (Parameter_Associations (Mech_Name));
if Nkind (Name (Mech_Name)) /= N_Identifier
- or else not (Chars (Name (Mech_Name)) = Name_Descriptor or else
- Chars (Name (Mech_Name)) = Name_Short_Descriptor)
+ or else
+ not Nam_In (Chars (Name (Mech_Name)), Name_Descriptor,
+ Name_Short_Descriptor)
or else Present (Next (Param))
or else No (Selector_Name (Param))
or else Chars (Selector_Name (Param)) /= Name_Class
@@ -6658,6 +6761,16 @@ package body Sem_Prag is
Pname := Chars (Identifier (Corresponding_Aspect (N)));
end if;
+ Check_Applicable_Policy (N);
+
+ -- If pragma is disable, rewrite as Null statement and skip analysis
+
+ if Is_Disabled (N) then
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze (N);
+ raise Pragma_Exit;
+ end if;
+
-- Preset arguments
Arg_Count := 0;
@@ -6683,6 +6796,8 @@ package body Sem_Prag is
end if;
end if;
+ Check_Restriction_No_Use_Of_Pragma (N);
+
-- An enumeration type defines the pragmas that are supported by the
-- implementation. Get_Pragma_Id (in package Prag) transforms a name
-- into the corresponding enumeration value for the following case.
@@ -6715,20 +6830,21 @@ package body Sem_Prag is
-- pragma Abstract_State (ABSTRACT_STATE_LIST)
- -- ABSTRACT_STATE_LIST ::=
+ -- ABSTRACT_STATE_LIST ::=
-- null
- -- | STATE_NAME_WITH_PROPERTIES {, STATE_NAME_WITH_PROPERTIES}
+ -- | STATE_NAME_WITH_PROPERTIES {, STATE_NAME_WITH_PROPERTIES}
-- STATE_NAME_WITH_PROPERTIES ::=
-- STATE_NAME
- -- | (STATE_NAME with PROPERTY_LIST)
+ -- | (STATE_NAME with PROPERTY_LIST)
- -- PROPERTY_LIST ::= PROPERTY {, PROPERTY}
- -- PROPERTY ::= SIMPLE_PROPERTY
- -- | NAME_VALUE_PROPERTY
- -- SIMPLE_PROPERTY ::= IDENTIFIER
- -- NAME_VALUE_PROPERTY ::= IDENTIFIER => EXPRESSION
- -- STATE_NAME ::= DEFINING_IDENTIFIER
+ -- PROPERTY_LIST ::= PROPERTY {, PROPERTY}
+ -- PROPERTY ::= SIMPLE_PROPERTY | NAME_VALUE_PROPERTY
+
+ -- SIMPLE_PROPERTY ::= IDENTIFIER
+ -- NAME_VALUE_PROPERTY ::= IDENTIFIER => EXPRESSION
+
+ -- STATE_NAME ::= DEFINING_IDENTIFIER
when Pragma_Abstract_State => Abstract_State : declare
Pack_Id : Entity_Id;
@@ -6796,8 +6912,8 @@ package body Sem_Prag is
-- declare additional states.
if Null_Seen then
- Error_Msg_Name_1 := Chars (Pack_Id);
- Error_Msg_N ("package % has null abstract state", State);
+ Error_Msg_NE
+ ("package & has null abstract state", State, Pack_Id);
-- Null states appear as internally generated entities
@@ -6810,9 +6926,9 @@ package body Sem_Prag is
-- non-null states.
if Non_Null_Seen then
- Error_Msg_Name_1 := Chars (Pack_Id);
- Error_Msg_N
- ("package % has non-null abstract state", State);
+ Error_Msg_NE
+ ("package & has non-null abstract state",
+ State, Pack_Id);
end if;
-- Simple state declaration
@@ -6865,8 +6981,8 @@ package body Sem_Prag is
(not Input_Seen and then not Output_Seen)) -- none
then
Error_Msg_N
- ("property Volatile requires exactly one Input or " &
- "Output", State);
+ ("property Volatile requires exactly one Input or "
+ & "Output", State);
end if;
-- Either Input or Output require Volatile
@@ -6979,7 +7095,7 @@ package body Sem_Prag is
return;
end if;
- Pack_Id := Defining_Unit_Name (Specification (Par));
+ Pack_Id := Defining_Entity (Par);
State := Expression (Arg1);
-- Multiple abstract states appear as an aggregate
@@ -7333,41 +7449,175 @@ package body Sem_Prag is
-- Assertion_Policy --
----------------------
- -- pragma Assertion_Policy (Check | Disable | Ignore)
+ -- pragma Assertion_Policy (POLICY_IDENTIFIER);
+
+ -- The following form is Ada 2012 only, but we allow it in all modes
+
+ -- Pragma Assertion_Policy (
+ -- ASSERTION_KIND => POLICY_IDENTIFIER
+ -- {, ASSERTION_KIND => POLICY_IDENTIFIER});
+
+ -- ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND
+
+ -- RM_ASSERTION_KIND ::= Assert |
+ -- Static_Predicate |
+ -- Dynamic_Predicate |
+ -- Pre |
+ -- Pre'Class |
+ -- Post |
+ -- Post'Class |
+ -- Type_Invariant |
+ -- Type_Invariant'Class
+
+ -- ID_ASSERTION_KIND ::= Assert_And_Cut }
+ -- Assume |
+ -- Contract_Cases |
+ -- Debug |
+ -- Loop_Invariant |
+ -- Loop_Variant |
+ -- Postcondition |
+ -- Precondition |
+ -- Predicate
+ --
+ -- Note: The RM_ASSERTION_KIND list is language-defined, and the
+ -- ID_ASSERTION_KIND list contains implementation-defined additions
+ -- recognized by GNAT. The effect is to control the behavior of
+ -- identically named aspects and pragmas, depending on the specified
+ -- policy identifier:
+
+ -- POLICY_IDENTIFIER ::= Check | Disable | Ignore
+
+ -- Note: Check and Ignore are language-defined. Disable is a GNAT
+ -- implementation defined addition that results in totally ignoring
+ -- the corresponding assertion. If Disable is specified, then the
+ -- argument of the assertion is not even analyzed. This is useful
+ -- when the aspect/pragma argument references entities in a with'ed
+ -- packaqe that is replaced by a dummy package in the final build.
+
+ -- Note: the attribute forms Pre'Class, Post'Class, Invariant'Class,
+ -- and Type_Invariant'Class were recognized by the parser and
+ -- transformed into referencea to the special internal identifiers
+ -- _Pre, _Post, _Invariant, and _Type_Invariant, so no special
+ -- processing is required here.
when Pragma_Assertion_Policy => Assertion_Policy : declare
+ LocP : Source_Ptr;
Policy : Node_Id;
+ Arg : Node_Id;
+ Kind : Name_Id;
+ Prag : Node_Id;
begin
Ada_2005_Pragma;
- Check_Valid_Configuration_Pragma;
- Check_Arg_Count (1);
- Check_No_Identifiers;
- Check_Arg_Is_One_Of (Arg1, Name_Check, Name_Disable, Name_Ignore);
- -- We treat pragma Assertion_Policy as equivalent to:
+ -- This can always appear as a configuration pragma
- -- pragma Check_Policy (Assertion, policy)
+ if Is_Configuration_Pragma then
+ null;
- -- So rewrite the pragma in that manner and link on to the chain
- -- of Check_Policy pragmas, marking the pragma as analyzed.
+ -- It can also appear in a declaration or package spec in Ada
+ -- 2012 mode. We allow this in other modes, but in that case
+ -- we consider that we have an Ada 2012 pragma on our hands.
- Policy := Get_Pragma_Arg (Arg1);
+ else
+ Check_Is_In_Decl_Part_Or_Package_Spec;
+ Ada_2012_Pragma;
+ end if;
- Rewrite (N,
- Make_Pragma (Loc,
- Chars => Name_Check_Policy,
- Pragma_Argument_Associations => New_List (
- Make_Pragma_Argument_Association (Loc,
- Expression => Make_Identifier (Loc, Name_Assertion)),
+ -- One argument case with no identifier (first form above)
- Make_Pragma_Argument_Association (Loc,
- Expression =>
- Make_Identifier (Sloc (Policy), Chars (Policy))))));
+ if Arg_Count = 1
+ and then (Nkind (Arg1) /= N_Pragma_Argument_Association
+ or else Chars (Arg1) = No_Name)
+ then
+ Check_Arg_Is_One_Of
+ (Arg1, Name_Check, Name_Disable, Name_Ignore);
+
+ -- Treat one argument Assertion_Policy as equivalent to:
+
+ -- pragma Check_Policy (Assertion, policy)
- Set_Analyzed (N);
- Set_Next_Pragma (N, Opt.Check_Policy_List);
- Opt.Check_Policy_List := N;
+ -- So rewrite pragma in that manner and link on to the chain
+ -- of Check_Policy pragmas, marking the pragma as analyzed.
+
+ Policy := Get_Pragma_Arg (Arg1);
+
+ Rewrite (N,
+ Make_Pragma (Loc,
+ Chars => Name_Check_Policy,
+ Pragma_Argument_Associations => New_List (
+ Make_Pragma_Argument_Association (Loc,
+ Expression => Make_Identifier (Loc, Name_Assertion)),
+
+ Make_Pragma_Argument_Association (Loc,
+ Expression =>
+ Make_Identifier (Sloc (Policy), Chars (Policy))))));
+
+ Set_Analyzed (N);
+ Set_Next_Pragma (N, Opt.Check_Policy_List);
+ Opt.Check_Policy_List := N;
+
+ -- Here if we have two or more arguments
+
+ else
+ Check_At_Least_N_Arguments (1);
+ Ada_2012_Pragma;
+
+ -- Loop through arguments
+
+ Arg := Arg1;
+ while Present (Arg) loop
+ LocP := Sloc (Arg);
+
+ -- Kind must be specified
+
+ if Nkind (Arg) /= N_Pragma_Argument_Association
+ or else Chars (Arg) = No_Name
+ then
+ Error_Pragma_Arg
+ ("missing assertion kind for pragma%", Arg);
+ end if;
+
+ -- Check Kind and Policy have allowed forms
+
+ Kind := Chars (Arg);
+
+ if not Is_Valid_Assertion_Kind (Kind) then
+ Error_Pragma_Arg
+ ("invalid assertion kind for pragma%", Arg);
+ end if;
+
+ Check_Arg_Is_One_Of
+ (Arg, Name_Check, Name_Disable, Name_Ignore);
+
+ -- We rewrite the Assertion_Policy pragma as a series of
+ -- Check_Policy pragmas:
+
+ -- Check_Policy (Kind, Policy);
+
+ Prag :=
+ Make_Pragma (LocP,
+ Chars => Name_Check_Policy,
+ Pragma_Argument_Associations => New_List (
+ Make_Pragma_Argument_Association (LocP,
+ Expression => Make_Identifier (LocP, Kind)),
+ Make_Pragma_Argument_Association (LocP,
+ Expression => Get_Pragma_Arg (Arg))));
+
+ Set_Analyzed (Prag);
+ Set_Next_Pragma (Prag, Opt.Check_Policy_List);
+ Opt.Check_Policy_List := Prag;
+ Insert_Action (N, Prag);
+
+ Arg := Next (Arg);
+ end loop;
+
+ -- Rewrite the Assertion_Policy pragma as null since we have
+ -- now inserted all the equivalent Check pragmas.
+
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze (N);
+ end if;
end Assertion_Policy;
------------
@@ -7593,8 +7843,7 @@ package body Sem_Prag is
-- unit (RM E.4.1(4)).
Error_Pragma
- ("pragma% not in Remote_Call_Interface or " &
- "Remote_Types unit");
+ ("pragma% not in Remote_Call_Interface or Remote_Types unit");
end if;
if Ekind (Nm) = E_Procedure
@@ -7818,14 +8067,21 @@ package body Sem_Prag is
-- Check --
-----------
- -- pragma Check ([Name =>] IDENTIFIER,
+ -- pragma Check ([Name =>] CHECK_KIND,
-- [Check =>] Boolean_EXPRESSION
-- [,[Message =>] String_EXPRESSION]);
+ -- CHECK_KIND ::= IDENTIFIER |
+ -- Pre'Class |
+ -- Post'Class |
+ -- Invariant'Class |
+ -- Type_Invariant'Class
+
when Pragma_Check => Check : declare
Expr : Node_Id;
Eloc : Source_Ptr;
Cname : Name_Id;
+ Str : Node_Id;
Check_On : Boolean;
-- Set True if category of assertions referenced by Name enabled
@@ -7839,21 +8095,41 @@ package body Sem_Prag is
if Arg_Count = 3 then
Check_Optional_Identifier (Arg3, Name_Message);
- Analyze_And_Resolve (Get_Pragma_Arg (Arg3), Standard_String);
+ Str := Get_Pragma_Arg (Arg3);
end if;
+ Rewrite_Assertion_Kind (Get_Pragma_Arg (Arg1));
Check_Arg_Is_Identifier (Arg1);
+ Cname := Chars (Get_Pragma_Arg (Arg1));
- -- Completely ignore if disabled
+ -- Set Check_On to indicate check status
- if Check_Disabled (Chars (Get_Pragma_Arg (Arg1))) then
- Rewrite (N, Make_Null_Statement (Loc));
- Analyze (N);
- return;
- end if;
+ case Check_Kind (Cname) is
+ when Name_Ignore =>
+ Check_On := False;
- Cname := Chars (Get_Pragma_Arg (Arg1));
- Check_On := Check_Enabled (Cname);
+ when Name_Check =>
+ Check_On := True;
+
+ -- For disable, rewrite pragma as null statement and skip
+ -- rest of the analysis of the pragma.
+
+ when Name_Disable =>
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze (N);
+ raise Pragma_Exit;
+
+ -- No other possibilities
+
+ when others =>
+ raise Program_Error;
+ end case;
+
+ -- If check kind was not Disable, then continue pragma analysis
+
+ Expr := Get_Pragma_Arg (Arg2);
+
+ -- Deal with SCO generation
case Cname is
when Name_Predicate |
@@ -7875,28 +8151,51 @@ package body Sem_Prag is
end if;
end case;
- -- If expansion is active and the check is not enabled then we
- -- rewrite the Check as:
+ -- Deal with analyzing the string argument.
+
+ if Arg_Count = 3 then
+
+ -- If checks are not on we don't want any expansion (since
+ -- such expansion would not get properly deleted) but
+ -- we do want to analyze (to get proper references).
+ -- The Preanalyze_And_Resolve routine does just what we want
+
+ if not Check_On then
+ Preanalyze_And_Resolve (Str, Standard_String);
+
+ -- Otherwise we need a proper analysis and expansion
+
+ else
+ Analyze_And_Resolve (Str, Standard_String);
+ end if;
+ end if;
+
+ -- Now you might think we could just do the same with the Boolean
+ -- expression if checks are off (and expansion is on) and then
+ -- rewrite the check as a null statement. This would work but we
+ -- would lose the useful warnings about an assertion being bound
+ -- to fail even if assertions are turned off.
+
+ -- So instead we wrap the boolean expression in an if statement
+ -- that looks like:
-- if False and then condition then
-- null;
-- end if;
- -- The reason we do this rewriting during semantic analysis rather
- -- than as part of normal expansion is that we cannot analyze and
- -- expand the code for the boolean expression directly, or it may
- -- cause insertion of actions that would escape the attempt to
- -- suppress the check code.
+ -- The reason we do this rewriting during semantic analysis
+ -- rather than as part of normal expansion is that we cannot
+ -- analyze and expand the code for the boolean expression
+ -- directly, or it may cause insertion of actions that would
+ -- escape the attempt to suppress the check code.
-- Note that the Sloc for the if statement corresponds to the
- -- argument condition, not the pragma itself. The reason for this
- -- is that we may generate a warning if the condition is False at
- -- compile time, and we do not want to delete this warning when we
- -- delete the if statement.
+ -- argument condition, not the pragma itself. The reason for
+ -- this is that we may generate a warning if the condition is
+ -- False at compile time, and we do not want to delete this
+ -- warning when we delete the if statement.
- Expr := Get_Pragma_Arg (Arg2);
-
- if Expander_Active and then not Check_On then
+ if Expander_Active and not Check_On then
Eloc := Sloc (Expr);
Rewrite (N,
@@ -7908,9 +8207,12 @@ package body Sem_Prag is
Then_Statements => New_List (
Make_Null_Statement (Eloc))));
+ In_Assertion_Expr := In_Assertion_Expr + 1;
Analyze (N);
+ In_Assertion_Expr := In_Assertion_Expr - 1;
- -- Check is active
+ -- Check is active or expansion not active. In these cases we can
+ -- just go ahead and analyze the boolean with no worries.
else
In_Assertion_Expr := In_Assertion_Expr + 1;
@@ -7961,22 +8263,36 @@ package body Sem_Prag is
-- Check_Policy --
------------------
- -- pragma Check_Policy (
- -- [Name =>] IDENTIFIER,
- -- [Policy =>] POLICY_IDENTIFIER);
+ -- This is the old style syntax, which is still allowed in all modes:
+
+ -- pragma Check_Policy ([Name =>] CHECK_KIND
+ -- [Policy =>] POLICY_IDENTIFIER);
+
+ -- POLICY_IDENTIFIER ::= On | Off | Check | Disable | Ignore
- -- POLICY_IDENTIFIER ::= ON | OFF | CHECK | DISABLE | IGNORE
+ -- CHECK_KIND ::= IDENTIFIER |
+ -- Pre'Class |
+ -- Post'Class |
+ -- Type_Invariant'Class |
+ -- Invariant'Class
- -- Note: this is a configuration pragma, but it is allowed to appear
- -- anywhere else.
+ -- This is the new style syntax, compatible with Assertion_Policy
+ -- and also allowed in all modes.
- when Pragma_Check_Policy =>
+ -- Pragma Check_Policy (
+ -- CHECK_KIND => POLICY_IDENTIFIER
+ -- {, CHECK_KIND => POLICY_IDENTIFIER});
+
+ -- Note: the identifiers Name and Policy are not allowed as
+ -- Check_Kind values. This avoids ambiguities between the old and
+ -- new form syntax.
+
+ when Pragma_Check_Policy => Check_Policy : declare
+ Kind : Node_Id;
+
+ begin
GNAT_Pragma;
- Check_Arg_Count (2);
- Check_Optional_Identifier (Arg1, Name_Name);
- Check_Optional_Identifier (Arg2, Name_Policy);
- Check_Arg_Is_One_Of
- (Arg2, Name_On, Name_Off, Name_Check, Name_Disable, Name_Ignore);
+ Check_At_Least_N_Arguments (1);
-- A Check_Policy pragma can appear either as a configuration
-- pragma, or in a declarative part or a package spec (see RM
@@ -7987,8 +8303,91 @@ package body Sem_Prag is
Check_Is_In_Decl_Part_Or_Package_Spec;
end if;
- Set_Next_Pragma (N, Opt.Check_Policy_List);
- Opt.Check_Policy_List := N;
+ -- Figure out if we have the old or new syntax. We have the
+ -- old syntax if the first argument has no identifier, or the
+ -- identifier is Name.
+
+ if Nkind (Arg1) /= N_Pragma_Argument_Association
+ or else Nam_In (Chars (Arg1), No_Name, Name_Name)
+ then
+ -- Old syntax
+
+ Check_Arg_Count (2);
+ Check_Optional_Identifier (Arg1, Name_Name);
+ Kind := Get_Pragma_Arg (Arg1);
+ Rewrite_Assertion_Kind (Kind);
+ Check_Arg_Is_Identifier (Arg1);
+
+ -- Check forbidden check kind
+
+ if Nam_In (Chars (Kind), Name_Name, Name_Policy) then
+ Error_Msg_Name_2 := Chars (Kind);
+ Error_Pragma_Arg
+ ("pragma% does not allow% as check name", Arg1);
+ end if;
+
+ -- Check policy
+
+ Check_Optional_Identifier (Arg2, Name_Policy);
+ Check_Arg_Is_One_Of
+ (Arg2,
+ Name_On, Name_Off, Name_Check, Name_Disable, Name_Ignore);
+
+ -- And chain pragma on the Check_Policy_List for search
+
+ Set_Next_Pragma (N, Opt.Check_Policy_List);
+ Opt.Check_Policy_List := N;
+
+ -- For the new syntax, what we do is to convert each argument to
+ -- an old syntax equivalent. We do that because we want to chain
+ -- old style Check_Pragmas for the search (we don't wnat to have
+ -- to deal with multiple arguments in the search)
+
+ else
+ declare
+ Arg : Node_Id;
+ Argx : Node_Id;
+ LocP : Source_Ptr;
+
+ begin
+ Arg := Arg1;
+ while Present (Arg) loop
+ LocP := Sloc (Arg);
+ Argx := Get_Pragma_Arg (Arg);
+
+ -- Kind must be specified
+
+ if Nkind (Arg) /= N_Pragma_Argument_Association
+ or else Chars (Arg) = No_Name
+ then
+ Error_Pragma_Arg
+ ("missing assertion kind for pragma%", Arg);
+ end if;
+
+ -- Construct equivalent old form syntax Check_Policy
+ -- pragma and insert it to get remaining checks.
+
+ Insert_Action (N,
+ Make_Pragma (LocP,
+ Chars => Name_Check_Policy,
+ Pragma_Argument_Associations => New_List (
+ Make_Pragma_Argument_Association (LocP,
+ Expression =>
+ Make_Identifier (LocP, Chars (Arg))),
+ Make_Pragma_Argument_Association (Sloc (Argx),
+ Expression => Argx))));
+
+ Arg := Next (Arg);
+ end loop;
+
+ -- Rewrite original Check_Policy pragma to null, since we
+ -- have converted it into a series of old syntax pragmas.
+
+ Rewrite (N, Make_Null_Statement (Loc));
+ Analyze (N);
+ end;
+ end if;
+ end Check_Policy;
---------------------
-- CIL_Constructor --
@@ -8204,8 +8603,8 @@ package body Sem_Prag is
and then not Is_Array_Type (Typ)
then
Error_Pragma_Arg
- ("Name parameter of pragma% must identify record or " &
- "array type", Name);
+ ("Name parameter of pragma% must identify record or "
+ & "array type", Name);
end if;
-- An explicit Component_Alignment pragma overrides an
@@ -8305,9 +8704,9 @@ package body Sem_Prag is
S14_Pragma;
Check_Arg_Count (1);
- -- Completely ignore if disabled
+ -- Completely ignore if not enabled
- if Check_Disabled (Pname) then
+ if Is_Ignored (N) then
Rewrite (N, Make_Null_Statement (Loc));
Analyze (N);
return;
@@ -8491,10 +8890,9 @@ package body Sem_Prag is
GNAT_Pragma;
if Warn_On_Obsolescent_Feature then
- -- Following message is obsolete ???
Error_Msg_N
- ("'G'N'A'T pragma cpp'_class is now obsolete and has no " &
- "effect; replace it by pragma import?j?", N);
+ ("'G'N'A'T pragma cpp'_class is now obsolete and has no "
+ & "effect; replace it by pragma import?j?", N);
end if;
Check_Arg_Count (1);
@@ -8557,8 +8955,8 @@ package body Sem_Prag is
then
if Scope (Def_Id) /= Scope (Etype (Def_Id)) then
Error_Msg_N
- ("'C'P'P constructor must be defined in the scope of " &
- "its returned type", Arg1);
+ ("'C'P'P constructor must be defined in the scope of "
+ & "its returned type", Arg1);
end if;
if Arg_Count >= 2 then
@@ -8618,8 +9016,8 @@ package body Sem_Prag is
if Warn_On_Obsolescent_Feature then
Error_Msg_N
- ("'G'N'A'T pragma cpp'_virtual is now obsolete and has " &
- "no effect?j?", N);
+ ("'G'N'A'T pragma cpp'_virtual is now obsolete and has no "
+ & "effect?j?", N);
end if;
end CPP_Virtual;
@@ -8633,8 +9031,8 @@ package body Sem_Prag is
if Warn_On_Obsolescent_Feature then
Error_Msg_N
- ("'G'N'A'T pragma cpp'_vtable is now obsolete and has " &
- "no effect?j?", N);
+ ("'G'N'A'T pragma cpp'_vtable is now obsolete and has no "
+ & "effect?j?", N);
end if;
end CPP_Vtable;
@@ -8741,20 +9139,16 @@ package body Sem_Prag is
begin
GNAT_Pragma;
- -- Skip analysis if disabled
-
- if Debug_Pragmas_Disabled then
- Rewrite (N, Make_Null_Statement (Loc));
- Analyze (N);
- return;
- end if;
+ -- The condition for executing the call is that the expander
+ -- is active and that we are not ignoring this debug pragma.
Cond :=
New_Occurrence_Of
- (Boolean_Literals (Debug_Pragmas_Enabled and Expander_Active),
+ (Boolean_Literals
+ (Expander_Active and then not Is_Ignored (N)),
Loc);
- if Debug_Pragmas_Enabled then
+ if not Is_Ignored (N) then
Set_SCO_Pragma_Enabled (Loc);
end if;
@@ -8833,16 +9227,1085 @@ package body Sem_Prag is
-- Debug_Policy --
------------------
- -- pragma Debug_Policy (Check | Ignore)
+ -- pragma Debug_Policy (On | Off | Check | Disable | Ignore)
when Pragma_Debug_Policy =>
GNAT_Pragma;
Check_Arg_Count (1);
- Check_Arg_Is_One_Of (Arg1, Name_Check, Name_Disable, Name_Ignore);
- Debug_Pragmas_Enabled :=
- Chars (Get_Pragma_Arg (Arg1)) = Name_Check;
- Debug_Pragmas_Disabled :=
- Chars (Get_Pragma_Arg (Arg1)) = Name_Disable;
+ Check_No_Identifiers;
+ Check_Arg_Is_Identifier (Arg1);
+
+ -- Exactly equivalent to pragma Check_Policy (Debug, arg), so
+ -- rewrite it that way, and let the rest of the checking come
+ -- from analyzing the rewritten pragma.
+
+ Rewrite (N,
+ Make_Pragma (Loc,
+ Chars => Name_Check_Policy,
+ Pragma_Argument_Associations => New_List (
+ Make_Pragma_Argument_Association (Loc,
+ Expression => Make_Identifier (Loc, Name_Debug)),
+
+ Make_Pragma_Argument_Association (Loc,
+ Expression => Get_Pragma_Arg (Arg1)))));
+
+ Analyze (N);
+
+ -------------
+ -- Depends --
+ -------------
+
+ -- pragma Depends (DEPENDENCY_RELATION);
+
+ -- DEPENDENCY_RELATION ::=
+ -- null
+ -- | DEPENDENCY_CLAUSE {, DEPENDENCY_CLAUSE}
+
+ -- DEPENDENCY_CLAUSE ::=
+ -- OUTPUT_LIST =>[+] INPUT_LIST
+ -- | NULL_DEPENDENCY_CLAUSE
+
+ -- NULL_DEPENDENCY_CLAUSE ::= null => INPUT_LIST
+
+ -- OUTPUT_LIST ::= OUTPUT | (OUTPUT {, OUTPUT})
+
+ -- INPUT_LIST ::= null | INPUT | (INPUT {, INPUT})
+
+ -- OUTPUT ::= NAME | FUNCTION_RESULT
+ -- INPUT ::= NAME
+
+ -- where FUNCTION_RESULT is a function Result attribute_reference
+
+ when Pragma_Depends => Depends : declare
+ All_Inputs_Seen : Elist_Id := No_Elist;
+ -- A list containing the entities of all the inputs processed so
+ -- far. This Elist is populated with unique entities because the
+ -- same input may appear in multiple input lists.
+
+ Global_Seen : Boolean := False;
+ -- A flag set when pragma Global has been processed
+
+ Outputs_Seen : Elist_Id := No_Elist;
+ -- A list containing the entities of all the outputs processed so
+ -- far. The elements of this list may come from different output
+ -- lists.
+
+ Null_Output_Seen : Boolean := False;
+ -- A flag used to track the legality of a null output
+
+ Result_Seen : Boolean := False;
+ -- A flag set when Subp_Id'Result is processed
+
+ Subp_Id : Entity_Id;
+ -- The entity of the subprogram subject to pragma Depends
+
+ Subp_Inputs : Elist_Id := No_Elist;
+ Subp_Outputs : Elist_Id := No_Elist;
+ -- Two lists containing the full set of inputs and output of the
+ -- related subprograms. Note that these lists contain both nodes
+ -- and entities.
+
+ procedure Analyze_Dependency_Clause
+ (Clause : Node_Id;
+ Is_Last : Boolean);
+ -- Verify the legality of a single dependency clause. Flag Is_Last
+ -- denotes whether Clause is the last clause in the relation.
+
+ function Appears_In
+ (List : Elist_Id;
+ Item_Id : Entity_Id) return Boolean;
+ -- Determine whether a particular item appears in a mixed list of
+ -- nodes and entities.
+
+ procedure Check_Function_Return;
+ -- Verify that Funtion'Result appears as one of the outputs
+
+ procedure Check_Mode
+ (Item : Node_Id;
+ Item_Id : Entity_Id;
+ Is_Input : Boolean);
+ -- Ensure that an item has a proper "in", "in out" or "out" mode
+ -- depending on its function. If this is not the case, emit an
+ -- error.
+
+ procedure Check_Usage
+ (Subp_List : Elist_Id;
+ Item_List : Elist_Id;
+ Is_Input : Boolean);
+ -- Verify that all items from list Subp_List appear in Item_List.
+ -- Emit an error if this is not the case.
+
+ procedure Collect_Subprogram_Inputs_Outputs;
+ -- Gather all inputs and outputs of the subprogram. These are the
+ -- formal parameters and entities classified in pragma Global.
+
+ procedure Normalize_Clause (Clause : Node_Id);
+ -- Remove a self-dependency "+" from the input list of a clause.
+ -- Depending on the contents of the relation, either split the
+ -- the clause into multiple smaller clauses or perform the
+ -- normalization in place.
+
+ -------------------------------
+ -- Analyze_Dependency_Clause --
+ -------------------------------
+
+ procedure Analyze_Dependency_Clause
+ (Clause : Node_Id;
+ Is_Last : Boolean)
+ is
+ procedure Analyze_Input_List (Inputs : Node_Id);
+ -- Verify the legality of a single input list
+
+ procedure Analyze_Input_Output
+ (Item : Node_Id;
+ Is_Input : Boolean;
+ Top_Level : Boolean;
+ Seen : in out Elist_Id;
+ Null_Seen : in out Boolean);
+ -- Verify the legality of a single input or output item. Flag
+ -- Is_Input should be set whenever Item is an input, False when
+ -- it denotes an output. Flag Top_Level should be set whenever
+ -- Item appears immediately within an input or output list.
+ -- Seen is a collection of all abstract states, variables and
+ -- formals processed so far. Flag Null_Seen denotes whether a
+ -- null input or output has been encountered.
+
+ ------------------------
+ -- Analyze_Input_List --
+ ------------------------
+
+ procedure Analyze_Input_List (Inputs : Node_Id) is
+ Inputs_Seen : Elist_Id := No_Elist;
+ -- A list containing the entities of all inputs that appear
+ -- in the current input list.
+
+ Null_Input_Seen : Boolean := False;
+ -- A flag used to track the legality of a null input
+
+ Input : Node_Id;
+
+ begin
+ -- Multiple inputs appear as an aggregate
+
+ if Nkind (Inputs) = N_Aggregate then
+ if Present (Component_Associations (Inputs)) then
+ Error_Msg_N
+ ("nested dependency relations not allowed", Inputs);
+
+ elsif Present (Expressions (Inputs)) then
+ Input := First (Expressions (Inputs));
+ while Present (Input) loop
+ Analyze_Input_Output
+ (Item => Input,
+ Is_Input => True,
+ Top_Level => False,
+ Seen => Inputs_Seen,
+ Null_Seen => Null_Input_Seen);
+
+ Next (Input);
+ end loop;
+
+ else
+ Error_Msg_N
+ ("malformed input dependency list", Inputs);
+ end if;
+
+ -- Process a solitary input
+
+ else
+ Analyze_Input_Output
+ (Item => Inputs,
+ Is_Input => True,
+ Top_Level => False,
+ Seen => Inputs_Seen,
+ Null_Seen => Null_Input_Seen);
+ end if;
+
+ -- Detect an illegal dependency clause of the form
+
+ -- (null =>[+] null)
+
+ if Null_Output_Seen and then Null_Input_Seen then
+ Error_Msg_N
+ ("null dependency clause cannot have a null input list",
+ Inputs);
+ end if;
+ end Analyze_Input_List;
+
+ --------------------------
+ -- Analyze_Input_Output --
+ --------------------------
+
+ procedure Analyze_Input_Output
+ (Item : Node_Id;
+ Is_Input : Boolean;
+ Top_Level : Boolean;
+ Seen : in out Elist_Id;
+ Null_Seen : in out Boolean)
+ is
+ Is_Output : constant Boolean := not Is_Input;
+ Grouped : Node_Id;
+ Item_Id : Entity_Id;
+
+ begin
+ -- Multiple input or output items appear as an aggregate
+
+ if Nkind (Item) = N_Aggregate then
+ if not Top_Level then
+ Error_Msg_N
+ ("nested grouping of items not allowed", Item);
+
+ elsif Present (Component_Associations (Item)) then
+ Error_Msg_N
+ ("nested dependency relations not allowed", Item);
+
+ -- Recursively analyze the grouped items
+
+ elsif Present (Expressions (Item)) then
+ Grouped := First (Expressions (Item));
+ while Present (Grouped) loop
+ Analyze_Input_Output
+ (Item => Grouped,
+ Is_Input => Is_Input,
+ Top_Level => False,
+ Seen => Seen,
+ Null_Seen => Null_Seen);
+
+ Next (Grouped);
+ end loop;
+
+ else
+ Error_Msg_N ("malformed dependency list", Item);
+ end if;
+
+ -- Process Function'Result in the context of a dependency
+ -- clause.
+
+ elsif Nkind (Item) = N_Attribute_Reference
+ and then Attribute_Name (Item) = Name_Result
+ then
+ -- It is sufficent to analyze the prefix of 'Result in
+ -- order to establish legality of the attribute.
+
+ Analyze (Prefix (Item));
+
+ -- The prefix of 'Result must denote the function for
+ -- which aspect/pragma Depends applies.
+
+ if not Is_Entity_Name (Prefix (Item))
+ or else Ekind (Subp_Id) /= E_Function
+ or else Entity (Prefix (Item)) /= Subp_Id
+ then
+ Error_Msg_Name_1 := Name_Result;
+ Error_Msg_N
+ ("prefix of attribute % must denote the enclosing "
+ & "function", Item);
+
+ -- Function'Result is allowed to appear on the output
+ -- side of a dependency clause.
+
+ elsif Is_Input then
+ Error_Msg_N
+ ("function result cannot act as input", Item);
+
+ else
+ Result_Seen := True;
+ end if;
+
+ -- Detect multiple uses of null in a single dependency list
+ -- or throughout the whole relation. Verify the placement of
+ -- a null output list relative to the other clauses.
+
+ elsif Nkind (Item) = N_Null then
+ if Null_Seen then
+ Error_Msg_N
+ ("multiple null dependency relations not allowed",
+ Item);
+ else
+ Null_Seen := True;
+
+ if Is_Output and then not Is_Last then
+ Error_Msg_N
+ ("null output list must be the last clause in "
+ & "a dependency relation", Item);
+ end if;
+ end if;
+
+ -- Default case
+
+ else
+ Analyze (Item);
+
+ -- Find the entity of the item. If this is a renaming,
+ -- climb the renaming chain to reach the root object.
+ -- Renamings of non-entire objects do not yield an
+ -- entity (Empty).
+
+ Item_Id := Entity_Of (Item);
+
+ if Present (Item_Id) then
+ if Ekind_In (Item_Id, E_Abstract_State,
+ E_In_Parameter,
+ E_In_Out_Parameter,
+ E_Out_Parameter,
+ E_Variable)
+ then
+ -- Ensure that the item is of the correct mode
+ -- depending on its function.
+
+ Check_Mode (Item, Item_Id, Is_Input);
+
+ -- Detect multiple uses of the same state, variable
+ -- or formal parameter. If this is not the case,
+ -- add the item to the list of processed relations.
+
+ if Contains (Seen, Item_Id) then
+ Error_Msg_N ("duplicate use of item", Item);
+ else
+ Add_Item (Item_Id, Seen);
+ end if;
+
+ -- Detect an illegal use of an input related to a
+ -- null output. Such input items cannot appear in
+ -- other input lists.
+
+ if Null_Output_Seen
+ and then Contains (All_Inputs_Seen, Item_Id)
+ then
+ Error_Msg_N
+ ("input of a null output list appears in "
+ & "multiple input lists", Item);
+ else
+ Add_Item (Item_Id, All_Inputs_Seen);
+ end if;
+
+ -- When the item renames an entire object, replace
+ -- the item with a reference to the object.
+
+ if Present (Renamed_Object (Entity (Item))) then
+ Rewrite (Item,
+ New_Reference_To (Item_Id, Sloc (Item)));
+ Analyze (Item);
+ end if;
+
+ -- All other input/output items are illegal
+
+ else
+ Error_Msg_N
+ ("item must denote variable, state or formal "
+ & "parameter", Item);
+ end if;
+
+ -- All other input/output items are illegal
+
+ else
+ Error_Msg_N
+ ("item must denote variable, state or formal "
+ & "parameter", Item);
+ end if;
+ end if;
+ end Analyze_Input_Output;
+
+ -- Local variables
+
+ Inputs : Node_Id;
+ Output : Node_Id;
+
+ -- Start of processing for Analyze_Dependency_Clause
+
+ begin
+ -- Process the output_list of a dependency_clause
+
+ Output := First (Choices (Clause));
+ while Present (Output) loop
+ Analyze_Input_Output
+ (Item => Output,
+ Is_Input => False,
+ Top_Level => True,
+ Seen => Outputs_Seen,
+ Null_Seen => Null_Output_Seen);
+
+ Next (Output);
+ end loop;
+
+ -- Process the input_list of a dependency_clause
+
+ Inputs := Expression (Clause);
+
+ -- An input list with a self-dependency appears as operator "+"
+ -- where the actuals inputs are the right operand.
+
+ if Nkind (Inputs) = N_Op_Plus then
+ Inputs := Right_Opnd (Inputs);
+ end if;
+
+ Analyze_Input_List (Inputs);
+ end Analyze_Dependency_Clause;
+
+ ----------------
+ -- Appears_In --
+ ----------------
+
+ function Appears_In
+ (List : Elist_Id;
+ Item_Id : Entity_Id) return Boolean
+ is
+ Elmt : Elmt_Id;
+ Id : Entity_Id;
+
+ begin
+ if Present (List) then
+ Elmt := First_Elmt (List);
+ while Present (Elmt) loop
+ if Nkind (Node (Elmt)) = N_Defining_Identifier then
+ Id := Node (Elmt);
+ else
+ Id := Entity (Node (Elmt));
+ end if;
+
+ if Id = Item_Id then
+ return True;
+ end if;
+
+ Next_Elmt (Elmt);
+ end loop;
+ end if;
+
+ return False;
+ end Appears_In;
+
+ ----------------------------
+ -- Check_Function_Return --
+ ----------------------------
+
+ procedure Check_Function_Return is
+ begin
+ if Ekind (Subp_Id) = E_Function and then not Result_Seen then
+ Error_Msg_NE
+ ("result of & must appear in exactly one output list",
+ N, Subp_Id);
+ end if;
+ end Check_Function_Return;
+
+ ----------------
+ -- Check_Mode --
+ ----------------
+
+ procedure Check_Mode
+ (Item : Node_Id;
+ Item_Id : Entity_Id;
+ Is_Input : Boolean)
+ is
+ begin
+ if Is_Input then
+ if Ekind (Item_Id) = E_Out_Parameter
+ or else (Global_Seen
+ and then not Appears_In (Subp_Inputs, Item_Id))
+ then
+ Error_Msg_NE
+ ("item & must have mode in or in out", Item, Item_Id);
+ end if;
+
+ -- Output
+
+ else
+ if Ekind (Item_Id) = E_In_Parameter
+ or else
+ (Global_Seen
+ and then not Appears_In (Subp_Outputs, Item_Id))
+ then
+ Error_Msg_NE
+ ("item & must have mode out or in out", Item, Item_Id);
+ end if;
+ end if;
+ end Check_Mode;
+
+ -----------------
+ -- Check_Usage --
+ -----------------
+
+ procedure Check_Usage
+ (Subp_List : Elist_Id;
+ Item_List : Elist_Id;
+ Is_Input : Boolean)
+ is
+ procedure Usage_Error (Item : Node_Id; Item_Id : Entity_Id);
+ -- Emit an error concerning the erroneous usage of an item
+
+ -----------------
+ -- Usage_Error --
+ -----------------
+
+ procedure Usage_Error (Item : Node_Id; Item_Id : Entity_Id) is
+ begin
+ if Is_Input then
+ Error_Msg_NE
+ ("item & must appear in at least one input list of "
+ & "aspect Depends", Item, Item_Id);
+ else
+ Error_Msg_NE
+ ("item & must appear in exactly one output list of "
+ & "aspect Depends", Item, Item_Id);
+ end if;
+ end Usage_Error;
+
+ -- Local variables
+
+ Elmt : Elmt_Id;
+ Item : Node_Id;
+ Item_Id : Entity_Id;
+
+ -- Start of processing for Check_Usage
+
+ begin
+ if No (Subp_List) then
+ return;
+ end if;
+
+ -- Each input or output of the subprogram must appear in a
+ -- dependency relation.
+
+ Elmt := First_Elmt (Subp_List);
+ while Present (Elmt) loop
+ Item := Node (Elmt);
+
+ if Nkind (Item) = N_Defining_Identifier then
+ Item_Id := Item;
+ else
+ Item_Id := Entity (Item);
+ end if;
+
+ -- The item does not appear in a dependency
+
+ if not Contains (Item_List, Item_Id) then
+ if Is_Formal (Item_Id) then
+ Usage_Error (Item, Item_Id);
+
+ -- States and global variables are not used properly only
+ -- when the subprogram is subject to pragma Global.
+
+ elsif Global_Seen then
+ Usage_Error (Item, Item_Id);
+ end if;
+ end if;
+
+ Next_Elmt (Elmt);
+ end loop;
+ end Check_Usage;
+
+ ---------------------------------------
+ -- Collect_Subprogram_Inputs_Outputs --
+ ---------------------------------------
+
+ procedure Collect_Subprogram_Inputs_Outputs is
+ procedure Collect_Global_List
+ (List : Node_Id;
+ Mode : Name_Id := Name_Input);
+ -- Collect all relevant items from a global list
+
+ -------------------------
+ -- Collect_Global_List --
+ -------------------------
+
+ procedure Collect_Global_List
+ (List : Node_Id;
+ Mode : Name_Id := Name_Input)
+ is
+ procedure Collect_Global_Item
+ (Item : Node_Id;
+ Mode : Name_Id);
+ -- Add an item to the proper subprogram input or output
+ -- collection.
+
+ -------------------------
+ -- Collect_Global_Item --
+ -------------------------
+
+ procedure Collect_Global_Item
+ (Item : Node_Id;
+ Mode : Name_Id)
+ is
+ begin
+ if Nam_In (Mode, Name_In_Out, Name_Input) then
+ Add_Item (Item, Subp_Inputs);
+ end if;
+
+ if Nam_In (Mode, Name_In_Out, Name_Output) then
+ Add_Item (Item, Subp_Outputs);
+ end if;
+ end Collect_Global_Item;
+
+ -- Local variables
+
+ Assoc : Node_Id;
+ Item : Node_Id;
+
+ -- Start of processing for Collect_Global_List
+
+ begin
+ -- Single global item declaration
+
+ if Nkind_In (List, N_Identifier, N_Selected_Component) then
+ Collect_Global_Item (List, Mode);
+
+ -- Simple global list or moded global list declaration
+
+ else
+ if Present (Expressions (List)) then
+ Item := First (Expressions (List));
+ while Present (Item) loop
+ Collect_Global_Item (Item, Mode);
+
+ Next (Item);
+ end loop;
+
+ else
+ Assoc := First (Component_Associations (List));
+ while Present (Assoc) loop
+ Collect_Global_List
+ (List => Expression (Assoc),
+ Mode => Chars (First (Choices (Assoc))));
+
+ Next (Assoc);
+ end loop;
+ end if;
+ end if;
+ end Collect_Global_List;
+
+ -- Local variables
+
+ Formal : Entity_Id;
+ Global : Node_Id;
+ List : Node_Id;
+
+ -- Start of processing for Collect_Subprogram_Inputs_Outputs
+
+ begin
+ -- Process all formal parameters
+
+ Formal := First_Formal (Subp_Id);
+ while Present (Formal) loop
+ if Ekind_In (Formal, E_In_Out_Parameter,
+ E_In_Parameter)
+ then
+ Add_Item (Formal, Subp_Inputs);
+ end if;
+
+ if Ekind_In (Formal, E_In_Out_Parameter,
+ E_Out_Parameter)
+ then
+ Add_Item (Formal, Subp_Outputs);
+ end if;
+
+ Next_Formal (Formal);
+ end loop;
+
+ -- If the subprogram is subject to pragma Global, traverse all
+ -- global lists and gather the relevant items.
+
+ Global := Find_Aspect (Subp_Id, Aspect_Global);
+ if Present (Global) then
+ Global_Seen := True;
+
+ -- Retrieve the pragma as it contains the analyzed lists
+
+ Global := Aspect_Rep_Item (Global);
+
+ -- The pragma may not have been analyzed because of the
+ -- arbitrary declaration order of aspects. Make sure that
+ -- it is analyzed for the purposes of item extraction.
+
+ if not Analyzed (Global) then
+ Analyze (Global);
+ end if;
+
+ List :=
+ Expression (First (Pragma_Argument_Associations (Global)));
+
+ -- Nothing to be done for a null global list
+
+ if Nkind (List) /= N_Null then
+ Collect_Global_List (List);
+ end if;
+ end if;
+ end Collect_Subprogram_Inputs_Outputs;
+
+ ----------------------
+ -- Normalize_Clause --
+ ----------------------
+
+ procedure Normalize_Clause (Clause : Node_Id) is
+ procedure Create_Or_Modify_Clause
+ (Output : Node_Id;
+ Outputs : Node_Id;
+ Inputs : Node_Id;
+ After : Node_Id;
+ In_Place : Boolean;
+ Multiple : Boolean);
+ -- Create a brand new clause to represent the self-reference
+ -- or modify the input and/or output lists of an existing
+ -- clause. Output denotes a self-referencial output. Outputs
+ -- is the output list of a clause. Inputs is the input list
+ -- of a clause. After denotes the clause after which the new
+ -- clause is to be inserted. Flag In_Place should be set when
+ -- normalizing the last output of an output list. Flag Multiple
+ -- should be set when Output comes from a list with multiple
+ -- items.
+
+ -----------------------------
+ -- Create_Or_Modify_Clause --
+ -----------------------------
+
+ procedure Create_Or_Modify_Clause
+ (Output : Node_Id;
+ Outputs : Node_Id;
+ Inputs : Node_Id;
+ After : Node_Id;
+ In_Place : Boolean;
+ Multiple : Boolean)
+ is
+ procedure Propagate_Output
+ (Output : Node_Id;
+ Inputs : Node_Id);
+ -- Handle the various cases of output propagation to the
+ -- input list. Output denotes a self-referencial output
+ -- item. Inputs is the input list of a clause.
+
+ ----------------------
+ -- Propagate_Output --
+ ----------------------
+
+ procedure Propagate_Output
+ (Output : Node_Id;
+ Inputs : Node_Id)
+ is
+ function In_Input_List
+ (Item : Entity_Id;
+ Inputs : List_Id) return Boolean;
+ -- Determine whether a particulat item appears in the
+ -- input list of a clause.
+
+ -------------------
+ -- In_Input_List --
+ -------------------
+
+ function In_Input_List
+ (Item : Entity_Id;
+ Inputs : List_Id) return Boolean
+ is
+ Elmt : Node_Id;
+
+ begin
+ Elmt := First (Inputs);
+ while Present (Elmt) loop
+ if Entity_Of (Elmt) = Item then
+ return True;
+ end if;
+
+ Next (Elmt);
+ end loop;
+
+ return False;
+ end In_Input_List;
+
+ -- Local variables
+
+ Output_Id : constant Entity_Id := Entity_Of (Output);
+ Grouped : List_Id;
+
+ -- Start of processing for Propagate_Output
+
+ begin
+ -- The clause is of the form:
+
+ -- (Output =>+ null)
+
+ -- Remove the null input and replace it with a copy of
+ -- the output:
+
+ -- (Output => Output)
+
+ if Nkind (Inputs) = N_Null then
+ Rewrite (Inputs, New_Copy_Tree (Output));
+
+ -- The clause is of the form:
+
+ -- (Output =>+ (Input1, ..., InputN))
+
+ -- Determine whether the output is not already mentioned
+ -- in the input list and if not, add it to the list of
+ -- inputs:
+
+ -- (Output => (Output, Input1, ..., InputN))
+
+ elsif Nkind (Inputs) = N_Aggregate then
+ Grouped := Expressions (Inputs);
+
+ if not In_Input_List
+ (Item => Output_Id,
+ Inputs => Grouped)
+ then
+ Prepend_To (Grouped, New_Copy_Tree (Output));
+ end if;
+
+ -- The clause is of the form:
+
+ -- (Output =>+ Input)
+
+ -- If the input does not mention the output, group the
+ -- two together:
+
+ -- (Output => (Output, Input))
+
+ elsif Entity_Of (Inputs) /= Output_Id then
+ Rewrite (Inputs,
+ Make_Aggregate (Loc,
+ Expressions => New_List (
+ New_Copy_Tree (Output),
+ New_Copy_Tree (Inputs))));
+ end if;
+ end Propagate_Output;
+
+ -- Local variables
+
+ Loc : constant Source_Ptr := Sloc (Output);
+ Clause : Node_Id;
+
+ -- Start of processing for Create_Or_Modify_Clause
+
+ begin
+ -- A function result cannot depend on itself because it
+ -- cannot appear in the input list of a relation.
+
+ if Nkind (Output) = N_Attribute_Reference
+ and then Attribute_Name (Output) = Name_Result
+ then
+ Error_Msg_N
+ ("function result cannot depend on itself", Output);
+ return;
+
+ -- A null output depending on itself does not require any
+ -- normalization.
+
+ elsif Nkind (Output) = N_Null then
+ return;
+ end if;
+
+ -- When performing the transformation in place, simply add
+ -- the output to the list of inputs (if not already there).
+ -- This case arises when dealing with the last output of an
+ -- output list - we perform the normalization in place to
+ -- avoid generating a malformed tree.
+
+ if In_Place then
+ Propagate_Output (Output, Inputs);
+
+ -- A list with multiple outputs is slowly trimmed until
+ -- only one element remains. When this happens, replace
+ -- the aggregate with the element itself.
+
+ if Multiple then
+ Remove (Output);
+ Rewrite (Outputs, Output);
+ end if;
+
+ -- Default case
+
+ else
+ -- Unchain the output from its output list as it will
+ -- appear in a new clause. Note that we cannot simply
+ -- rewrite the output as null because this will violate
+ -- the semantics of aspect/pragma Depends.
+
+ Remove (Output);
+
+ -- Create a new clause of the form:
+
+ -- (Output => Inputs)
+
+ Clause :=
+ Make_Component_Association (Loc,
+ Choices => New_List (Output),
+ Expression => New_Copy_Tree (Inputs));
+
+ -- The new clause contains replicated content that has
+ -- already been analyzed. There is not need to reanalyze
+ -- it or renormalize it again.
+
+ Set_Analyzed (Clause);
+
+ Propagate_Output
+ (Output => First (Choices (Clause)),
+ Inputs => Expression (Clause));
+
+ Insert_After (After, Clause);
+ end if;
+ end Create_Or_Modify_Clause;
+
+ -- Local variables
+
+ Outputs : constant Node_Id := First (Choices (Clause));
+ Inputs : Node_Id;
+ Last_Output : Node_Id;
+ Next_Output : Node_Id;
+ Output : Node_Id;
+
+ -- Start of processing for Normalize_Clause
+
+ begin
+ -- A self-dependency appears as operator "+". Remove the "+"
+ -- from the tree by moving the real inputs to their proper
+ -- place.
+
+ if Nkind (Expression (Clause)) = N_Op_Plus then
+ Rewrite
+ (Expression (Clause), Right_Opnd (Expression (Clause)));
+ Inputs := Expression (Clause);
+
+ -- Multiple outputs appear as an aggregate
+
+ if Nkind (Outputs) = N_Aggregate then
+ Last_Output := Last (Expressions (Outputs));
+
+ Output := First (Expressions (Outputs));
+ while Present (Output) loop
+
+ -- Normalization may remove an output from its list,
+ -- preserve the subsequent output now.
+
+ Next_Output := Next (Output);
+
+ Create_Or_Modify_Clause
+ (Output => Output,
+ Outputs => Outputs,
+ Inputs => Inputs,
+ After => Clause,
+ In_Place => Output = Last_Output,
+ Multiple => True);
+
+ Output := Next_Output;
+ end loop;
+
+ -- Solitary output
+
+ else
+ Create_Or_Modify_Clause
+ (Output => Outputs,
+ Outputs => Empty,
+ Inputs => Inputs,
+ After => Empty,
+ In_Place => True,
+ Multiple => False);
+ end if;
+ end if;
+ end Normalize_Clause;
+
+ -- Local variables
+
+ Clause : Node_Id;
+ Errors : Nat;
+ Last_Clause : Node_Id;
+ Subp_Decl : Node_Id;
+
+ -- Start of processing for Depends
+
+ begin
+ GNAT_Pragma;
+ S14_Pragma;
+ Check_Arg_Count (1);
+
+ -- Ensure the proper placement of the pragma. Depends must be
+ -- associated with a subprogram declaration.
+
+ Subp_Decl := Parent (Corresponding_Aspect (N));
+
+ if Nkind (Subp_Decl) /= N_Subprogram_Declaration then
+ Pragma_Misplaced;
+ return;
+ end if;
+
+ Subp_Id := Defining_Unit_Name (Specification (Subp_Decl));
+ Clause := Expression (Arg1);
+
+ -- Empty dependency list
+
+ if Nkind (Clause) = N_Null then
+
+ -- Gather all states, variables and formal parameters that the
+ -- subprogram may depend on. These items are obtained from the
+ -- parameter profile or pragma Global (if available).
+
+ Collect_Subprogram_Inputs_Outputs;
+
+ -- Verify that every input or output of the subprogram appear
+ -- in a dependency.
+
+ Check_Usage (Subp_Inputs, All_Inputs_Seen, True);
+ Check_Usage (Subp_Outputs, Outputs_Seen, False);
+ Check_Function_Return;
+
+ -- Dependency clauses appear as component associations of an
+ -- aggregate.
+
+ elsif Nkind (Clause) = N_Aggregate
+ and then Present (Component_Associations (Clause))
+ then
+ Last_Clause := Last (Component_Associations (Clause));
+
+ -- Gather all states, variables and formal parameters that the
+ -- subprogram may depend on. These items are obtained from the
+ -- parameter profile or pragma Global (if available).
+
+ Collect_Subprogram_Inputs_Outputs;
+
+ -- Ensure that the formal parameters are visible when analyzing
+ -- all clauses. This falls out of the general rule of aspects
+ -- pertaining to subprogram declarations.
+
+ Push_Scope (Subp_Id);
+ Install_Formals (Subp_Id);
+
+ Clause := First (Component_Associations (Clause));
+ while Present (Clause) loop
+ Errors := Serious_Errors_Detected;
+
+ -- Normalization may create extra clauses that contain
+ -- replicated input and output names. There is no need
+ -- to reanalyze or renormalize these extra clauses.
+
+ if not Analyzed (Clause) then
+ Set_Analyzed (Clause);
+
+ Analyze_Dependency_Clause
+ (Clause => Clause,
+ Is_Last => Clause = Last_Clause);
+
+ -- Do not normalize an erroneous clause because the
+ -- inputs or outputs may denote illegal items.
+
+ if Errors = Serious_Errors_Detected then
+ Normalize_Clause (Clause);
+ end if;
+ end if;
+
+ Next (Clause);
+ end loop;
+
+ End_Scope;
+
+ -- Verify that every input or output of the subprogram appear
+ -- in a dependency.
+
+ Check_Usage (Subp_Inputs, All_Inputs_Seen, True);
+ Check_Usage (Subp_Outputs, Outputs_Seen, False);
+ Check_Function_Return;
+
+ -- The top level dependency relation is malformed
+
+ else
+ Error_Msg_N ("malformed dependency relation", Clause);
+ end if;
+ end Depends;
---------------------
-- Detect_Blocking --
@@ -9325,8 +10788,8 @@ package body Sem_Prag is
Present (Source_Location)
then
Error_Pragma
- ("parameter profile and source location cannot " &
- "be used together in pragma%");
+ ("parameter profile and source location cannot be used "
+ & "together in pragma%");
end if;
Process_Eliminate_Pragma
@@ -10030,20 +11493,55 @@ package body Sem_Prag is
end if;
end Float_Representation;
+ -----------
+ -- Ghost --
+ -----------
+
+ -- pragma GHOST (function_LOCAL_NAME);
+
+ when Pragma_Ghost => Ghost : declare
+ Subp : Node_Id;
+ Subp_Id : Entity_Id;
+
+ begin
+ GNAT_Pragma;
+ S14_Pragma;
+ Check_Arg_Count (1);
+ Check_Arg_Is_Local_Name (Arg1);
+
+ -- Ensure the proper placement of the pragma. Ghost must be
+ -- associated with a subprogram declaration.
+
+ Subp := Parent (Corresponding_Aspect (N));
+
+ if Nkind (Subp) /= N_Subprogram_Declaration then
+ Pragma_Misplaced;
+ return;
+ end if;
+
+ Subp_Id := Defining_Unit_Name (Specification (Subp));
+
+ if Ekind (Subp_Id) /= E_Function then
+ Error_Pragma ("pragma % must be applied to a function");
+ end if;
+ end Ghost;
+
------------
-- Global --
------------
-- pragma Global (GLOBAL_SPECIFICATION)
- -- GLOBAL_SPECIFICATION ::= MODED_GLOBAL_LIST {, MODED_GLOBAL_LIST}
- -- | GLOBAL_LIST
- -- | null
- -- MODED_GLOBAL_LIST ::= MODE_SELECTOR => GLOBAL_LIST
- -- MODE_SELECTOR ::= Input | Output | In_Out | Contract_In
- -- GLOBAL_LIST ::= GLOBAL_ITEM
- -- | (GLOBAL_ITEM {, GLOBAL_ITEM})
- -- GLOBAL_ITEM ::= NAME
+ -- GLOBAL_SPECIFICATION ::=
+ -- null
+ -- | GLOBAL_LIST
+ -- | MODED_GLOBAL_LIST {, MODED_GLOBAL_LIST}
+
+ -- MODED_GLOBAL_LIST ::= MODE_SELECTOR => GLOBAL_LIST
+
+ -- MODE_SELECTOR ::= Input | Output | In_Out | Contract_In
+ -- GLOBAL_LIST ::= GLOBAL_ITEM | (GLOBAL_ITEM {, GLOBAL_ITEM})
+ -- GLOBAL_ITEM ::= NAME
when Pragma_Global => Global : declare
Subp_Id : Entity_Id;
@@ -10052,12 +11550,11 @@ package body Sem_Prag is
-- A list containing the entities of all the items processed so
-- far. It plays a role in detecting distinct entities.
- -- Flags used to verify the consistency of modes
-
Contract_Seen : Boolean := False;
In_Out_Seen : Boolean := False;
Input_Seen : Boolean := False;
Output_Seen : Boolean := False;
+ -- Flags used to verify the consistency of modes
procedure Analyze_Global_List
(List : Node_Id;
@@ -10099,36 +11596,7 @@ package body Sem_Prag is
(Item : Node_Id;
Global_Mode : Name_Id)
is
- function Is_Duplicate_Item (Id : Entity_Id) return Boolean;
- -- Determine whether Id has already been processed
-
- -----------------------
- -- Is_Duplicate_Item --
- -----------------------
-
- function Is_Duplicate_Item (Id : Entity_Id) return Boolean is
- Item_Elmt : Elmt_Id;
-
- begin
- if Present (Seen) then
- Item_Elmt := First_Elmt (Seen);
- while Present (Item_Elmt) loop
- if Node (Item_Elmt) = Id then
- return True;
- end if;
-
- Next_Elmt (Item_Elmt);
- end loop;
- end if;
-
- return False;
- end Is_Duplicate_Item;
-
- -- Local declarations
-
- Id : Entity_Id;
-
- -- Start of processing for Analyze_Global_Item
+ Item_Id : Entity_Id;
begin
-- Detect one of the following cases
@@ -10145,13 +11613,18 @@ package body Sem_Prag is
Analyze (Item);
- if Is_Entity_Name (Item) then
- Id := Entity (Item);
+ -- Find the entity of the item. If this is a renaming, climb
+ -- the renaming chain to reach the root object. Renamings of
+ -- non-entire objects do not yield an entity (Empty).
+
+ Item_Id := Entity_Of (Item);
+
+ if Present (Item_Id) then
-- A global item cannot reference a formal parameter. Do
-- this check first to provide a better error diagnostic.
- if Is_Formal (Id) then
+ if Is_Formal (Item_Id) then
Error_Msg_N
("global item cannot reference formal parameter",
Item);
@@ -10160,14 +11633,23 @@ package body Sem_Prag is
-- The only legal references are those to abstract states
-- and variables.
- elsif not Ekind_In (Entity (Item), E_Abstract_State,
- E_Variable)
+ elsif not Ekind_In (Item_Id, E_Abstract_State,
+ E_Variable)
then
Error_Msg_N
("global item must denote variable or state", Item);
return;
end if;
+ -- When the item renames an entire object, replace the
+ -- item with a reference to the object.
+
+ if Present (Renamed_Object (Entity (Item))) then
+ Rewrite (Item,
+ New_Reference_To (Item_Id, Sloc (Item)));
+ Analyze (Item);
+ end if;
+
-- Some form of illegal construct masquerading as a name
else
@@ -10179,42 +11661,34 @@ package body Sem_Prag is
-- The same entity might be referenced through various way.
-- Check the entity of the item rather than the item itself.
- if Is_Duplicate_Item (Id) then
+ if Contains (Seen, Item_Id) then
Error_Msg_N ("duplicate global item", Item);
-- Add the entity of the current item to the list of
-- processed items.
else
- if No (Seen) then
- Seen := New_Elmt_List;
- end if;
-
- Append_Elmt (Id, Seen);
+ Add_Item (Item_Id, Seen);
end if;
- if Ekind (Id) = E_Abstract_State
- and then Is_Volatile_State (Id)
+ if Ekind (Item_Id) = E_Abstract_State
+ and then Is_Volatile_State (Item_Id)
then
-- A global item of mode In_Out or Output cannot denote a
-- volatile Input state.
- if Is_Input_State (Id)
- and then (Global_Mode = Name_In_Out
- or else
- Global_Mode = Name_Output)
+ if Is_Input_State (Item_Id)
+ and then Nam_In (Global_Mode, Name_In_Out, Name_Output)
then
Error_Msg_N
- ("global item of mode In_Out or Output cannot " &
- "reference Volatile Input state", Item);
+ ("global item of mode In_Out or Output cannot "
+ & "reference Volatile Input state", Item);
-- A global item of mode In_Out or Input cannot reference
-- a volatile Output state.
- elsif Is_Output_State (Id)
- and then (Global_Mode = Name_In_Out
- or else
- Global_Mode = Name_Input)
+ elsif Is_Output_State (Item_Id)
+ and then Nam_In (Global_Mode, Name_In_Out, Name_Input)
then
Error_Msg_N
("global item of mode In_Out or Input cannot "
@@ -10246,9 +11720,8 @@ package body Sem_Prag is
procedure Check_Mode_Restriction_In_Function (Mode : Node_Id) is
begin
if Ekind (Subp_Id) = E_Function then
- Error_Msg_Name_1 := Chars (Mode);
Error_Msg_N
- ("global mode % not applicable to functions", Mode);
+ ("global mode & not applicable to functions", Mode);
end if;
end Check_Mode_Restriction_In_Function;
@@ -10300,22 +11773,22 @@ package body Sem_Prag is
Assoc := First (Component_Associations (List));
while Present (Assoc) loop
- Mode := First (Choices (Assoc));
+ Mode := First (Choices (Assoc));
if Nkind (Mode) = N_Identifier then
if Chars (Mode) = Name_Contract_In then
- Check_Duplicate_Mode (Mode, Contract_Seen);
+ Check_Duplicate_Mode (Mode, Contract_Seen);
elsif Chars (Mode) = Name_In_Out then
Check_Duplicate_Mode (Mode, In_Out_Seen);
- Check_Mode_Restriction_In_Function (Mode);
+ Check_Mode_Restriction_In_Function (Mode);
elsif Chars (Mode) = Name_Input then
- Check_Duplicate_Mode (Mode, Input_Seen);
+ Check_Duplicate_Mode (Mode, Input_Seen);
elsif Chars (Mode) = Name_Output then
Check_Duplicate_Mode (Mode, Output_Seen);
- Check_Mode_Restriction_In_Function (Mode);
+ Check_Mode_Restriction_In_Function (Mode);
else
Error_Msg_N ("invalid mode selector", Mode);
@@ -10393,7 +11866,7 @@ package body Sem_Prag is
Analyze_Global_List (List);
- Pop_Scope;
+ End_Scope;
end if;
end Global;
@@ -10608,8 +12081,8 @@ package body Sem_Prag is
null;
else
Error_Pragma_Arg
- ("controlling formal must be of synchronized " &
- "tagged type", Arg1);
+ ("controlling formal must be of synchronized tagged type",
+ Arg1);
return;
end if;
@@ -10637,8 +12110,8 @@ package body Sem_Prag is
and then Is_Task_Interface (Typ)
then
Error_Pragma_Arg
- ("implementation kind By_Protected_Procedure cannot be " &
- "applied to a task interface primitive", Arg2);
+ ("implementation kind By_Protected_Procedure cannot be "
+ & "applied to a task interface primitive", Arg2);
return;
end if;
@@ -11460,8 +12933,8 @@ package body Sem_Prag is
Int_Val > Expr_Value (Type_High_Bound (Int_Id))
then
Error_Pragma_Arg
- ("value not in range of type " &
- """Ada.Interrupts.Interrupt_'I'D""", Arg1);
+ ("value not in range of type "
+ & """Ada.Interrupts.Interrupt_'I'D""", Arg1);
end if;
end if;
@@ -11567,8 +13040,8 @@ package body Sem_Prag is
elsif In_Private_Part (Current_Scope) then
Error_Pragma_Arg
- ("pragma% only allowed for private type " &
- "declared in visible part", Arg1);
+ ("pragma% only allowed for private type declared in "
+ & "visible part", Arg1);
else
Error_Pragma_Arg
@@ -11576,10 +13049,10 @@ package body Sem_Prag is
end if;
-- Note that the type has at least one invariant, and also that
- -- it has inheritable invariants if we have Invariant'Class.
- -- Build the corresponding invariant procedure declaration, so
- -- that calls to it can be generated before the body is built
- -- (for example wihin an expression function).
+ -- it has inheritable invariants if we have Invariant'Class
+ -- or Type_Invariant'Class. Build the corresponding invariant
+ -- procedure declaration, so that calls to it can be generated
+ -- before the body is built (e.g. within an expression function).
PDecl := Build_Invariant_Procedure_Declaration (Typ);
Insert_After (N, PDecl);
@@ -11661,12 +13134,12 @@ package body Sem_Prag is
if Ekind (Def_Id) /= E_Function then
if VM_Target = JVM_Target then
Error_Pragma_Arg
- ("pragma% requires function returning a " &
- "'Java access type", Def_Id);
+ ("pragma% requires function returning a 'Java access "
+ & "type", Def_Id);
else
Error_Pragma_Arg
- ("pragma% requires function returning a " &
- "'C'I'L access type", Def_Id);
+ ("pragma% requires function returning a 'C'I'L access "
+ & "type", Def_Id);
end if;
end if;
@@ -11762,8 +13235,8 @@ package body Sem_Prag is
then
Error_Msg_Name_1 := Pname;
Error_Msg_N
- ("first formal of % function must be a named access" &
- " to subprogram type",
+ ("first formal of % function must be a named access "
+ & "to subprogram type",
Parameter_Type (Parent (This_Formal)));
-- Warning: We should reject anonymous access types because
@@ -11779,9 +13252,8 @@ package body Sem_Prag is
then
Error_Msg_Name_1 := Pname;
Error_Msg_N
- ("first formal of % function must be a named access" &
- " type",
- Parameter_Type (Parent (This_Formal)));
+ ("first formal of % function must be a named access "
+ & "type", Parameter_Type (Parent (This_Formal)));
elsif Atree.Convention
(Designated_Type (Etype (This_Formal))) /= Convention
@@ -11790,14 +13262,12 @@ package body Sem_Prag is
if Convention = Convention_Java then
Error_Msg_N
- ("pragma% requires convention 'Cil in designated" &
- " type",
- Parameter_Type (Parent (This_Formal)));
+ ("pragma% requires convention 'Cil in designated "
+ & "type", Parameter_Type (Parent (This_Formal)));
else
Error_Msg_N
- ("pragma% requires convention 'Java in designated" &
- " type",
- Parameter_Type (Parent (This_Formal)));
+ ("pragma% requires convention 'Java in designated "
+ & "type", Parameter_Type (Parent (This_Formal)));
end if;
elsif No (Expression (Parent (This_Formal)))
@@ -11826,13 +13296,13 @@ package body Sem_Prag is
if Atree.Convention (Etype (Def_Id)) /= Convention then
if Convention = Convention_Java then
Error_Pragma_Arg
- ("pragma% requires function returning a " &
- "'Java access type", Arg1);
+ ("pragma% requires function returning a 'Java "
+ & "access type", Arg1);
else
pragma Assert (Convention = Convention_CIL);
Error_Pragma_Arg
- ("pragma% requires function returning a " &
- "'C'I'L access type", Arg1);
+ ("pragma% requires function returning a 'C'I'L "
+ & "access type", Arg1);
end if;
end if;
@@ -11847,12 +13317,12 @@ package body Sem_Prag is
if Convention = Convention_Java then
Error_Pragma_Arg
- ("pragma% requires function returning a named" &
- "'Java access type", Arg1);
+ ("pragma% requires function returning a named "
+ & "'Java access type", Arg1);
else
Error_Pragma_Arg
- ("pragma% requires function returning a named" &
- "'C'I'L access type", Arg1);
+ ("pragma% requires function returning a named "
+ & "'C'I'L access type", Arg1);
end if;
end if;
end if;
@@ -12392,22 +13862,20 @@ package body Sem_Prag is
Check_Arg_Count (1);
Check_Loop_Pragma_Placement;
- -- Completely ignore if disabled
+ -- Completely ignore if not enabled
- if Check_Disabled (Pname) then
+ if Is_Ignored (N) then
Rewrite (N, Make_Null_Statement (Loc));
Analyze (N);
return;
end if;
- Preanalyze_And_Resolve (Expression (Arg1), Any_Boolean);
+ Preanalyze_Assert_Expression (Expression (Arg1), Any_Boolean);
-- Transform pragma Loop_Invariant into equivalent pragma Check
-- Generate:
-- pragma Check (Loop_Invaraint, Arg1);
- -- Seems completely wrong to hijack pragma Check this way ???
-
Rewrite (N,
Make_Pragma (Loc,
Chars => Name_Check,
@@ -12434,12 +13902,14 @@ package body Sem_Prag is
GNAT_Pragma;
Check_At_Least_N_Arguments (1);
Check_No_Identifiers;
+
Hint := First (Pragma_Argument_Associations (N));
while Present (Hint) loop
Check_Arg_Is_One_Of (Hint,
Name_No_Unroll, Name_Unroll, Name_No_Vector, Name_Vector);
Next (Hint);
end loop;
+
Check_Loop_Pragma_Placement;
end Loop_Optimize;
@@ -12463,9 +13933,9 @@ package body Sem_Prag is
Check_At_Least_N_Arguments (1);
Check_Loop_Pragma_Placement;
- -- Completely ignore if disabled
+ -- Completely ignore if not enabled
- if Check_Disabled (Pname) then
+ if Is_Ignored (N) then
Rewrite (N, Make_Null_Statement (Loc));
Analyze (N);
return;
@@ -12475,13 +13945,14 @@ package body Sem_Prag is
Variant := First (Pragma_Argument_Associations (N));
while Present (Variant) loop
- if Chars (Variant) /= Name_Decreases
- and then Chars (Variant) /= Name_Increases
+ if not Nam_In (Chars (Variant), Name_Decreases,
+ Name_Increases)
then
Error_Pragma_Arg ("wrong change modifier", Variant);
end if;
- Preanalyze_And_Resolve (Expression (Variant), Any_Discrete);
+ Preanalyze_Assert_Expression
+ (Expression (Variant), Any_Discrete);
Next (Variant);
end loop;
@@ -12875,8 +14346,8 @@ package body Sem_Prag is
loop
if No (Ent) then
Error_Pragma
- ("pragma % entity name does not match any " &
- "enumeration literal");
+ ("pragma % entity name does not match any "
+ & "enumeration literal");
elsif Chars (Ent) = Chars (Ename) then
Set_Entity (Ename, Ent);
@@ -13414,12 +14885,22 @@ package body Sem_Prag is
Check_First_Subtype (Arg1);
Ent := Entity (Get_Pragma_Arg (Arg1));
- if not (Is_Private_Type (Ent)
- or else
- Is_Protected_Type (Ent)
- or else
- (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent)))
+ -- The pragma may come from an aspect on a private declaration,
+ -- even if the freeze point at which this is analyzed in the
+ -- private part after the full view.
+
+ if Has_Private_Declaration (Ent)
+ and then From_Aspect_Specification (N)
+ then
+ null;
+
+ elsif Is_Private_Type (Ent)
+ or else Is_Protected_Type (Ent)
+ or else (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent))
then
+ null;
+
+ else
Error_Pragma_Arg
("pragma % can only be applied to private, formal derived or "
& "protected type",
@@ -13434,8 +14915,8 @@ package body Sem_Prag is
and then not Has_Preelaborable_Initialization (Ent)
then
Error_Msg_N
- ("protected type & does not have preelaborable " &
- "initialization", Ent);
+ ("protected type & does not have preelaborable "
+ & "initialization", Ent);
-- Otherwise mark the type as definitely having preelaborable
-- initialization.
@@ -13552,7 +15033,7 @@ package body Sem_Prag is
Check_Precondition_Postcondition (In_Body);
- -- When the pragma is a source contruct and appears inside a body,
+ -- When the pragma is a source construct appearing inside a body,
-- preanalyze the boolean_expression to detect illegal forward
-- references:
@@ -13583,10 +15064,20 @@ package body Sem_Prag is
Check_Precondition_Postcondition (In_Body);
-- If in spec, nothing more to do. If in body, then we convert the
- -- pragma to pragma Check (Precondition, cond [, msg]). Note we do
- -- this whether or not precondition checks are enabled. That works
- -- fine since pragma Check will do this check, and will also
- -- analyze the condition itself in the proper context.
+ -- pragma to an equivalent pragam Check. Note we do this whether
+ -- or not precondition checks are enabled. That works fine since
+ -- pragma Check will do this check, and will also analyze the
+ -- condition itself in the proper context.
+
+ -- The form of the pragma Check is either:
+
+ -- pragma Check (Precondition, cond [, msg])
+ -- or
+ -- pragma Check (Pre, cond [, msg])
+
+ -- We use the Pre form if this pragma derived from a Pre aspect.
+ -- This is needed to make sure that the right set of Policy
+ -- pragmas are checked.
if In_Body then
Rewrite (N,
@@ -13594,7 +15085,7 @@ package body Sem_Prag is
Chars => Name_Check,
Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc,
- Expression => Make_Identifier (Loc, Name_Precondition)),
+ Expression => Make_Identifier (Loc, Pname)),
Make_Pragma_Argument_Association (Sloc (Arg1),
Expression => Relocate_Node (Get_Pragma_Arg (Arg1))))));
@@ -13808,7 +15299,7 @@ package body Sem_Prag is
-- described in "Handling of Default and Per-Object
-- Expressions" in sem.ads.
- Preanalyze_Spec_Expression (Arg, Standard_Integer);
+ Preanalyze_Spec_Expression (Arg, RTE (RE_Any_Priority));
if not Is_Static_Expression (Arg) then
Check_Restriction (Static_Priorities, Arg);
@@ -13894,8 +15385,8 @@ package body Sem_Prag is
elsif Lower_Val > Upper_Val then
Error_Pragma
- ("last_priority_expression must be greater than" &
- " or equal to first_priority_expression");
+ ("last_priority_expression must be greater than or equal to "
+ & "first_priority_expression");
-- Store the new policy, but always preserve System_Location since
-- we like the error message with the run-time name.
@@ -14737,8 +16228,8 @@ package body Sem_Prag is
or else In_Package_Body (Current_Scope)
then
Error_Pragma
- ("pragma% can only apply to type declared immediately " &
- "within a package declaration");
+ ("pragma% can only apply to type declared immediately "
+ & "within a package declaration");
end if;
-- A simple storage pool type must be an immutably limited record
@@ -14976,8 +16467,8 @@ package body Sem_Prag is
or else Present (Next_Formal (First_Formal (Ent)))
then
Error_Pragma_Arg
- ("argument for pragma% must be" &
- " function of one argument", Arg);
+ ("argument for pragma% must be function of one argument",
+ Arg);
end if;
end Check_OK_Stream_Convert_Function;
@@ -16100,10 +17591,7 @@ package body Sem_Prag is
-- On/Off one argument case was processed by parser
if Nkind (Argx) = N_Identifier
- and then
- (Chars (Argx) = Name_On
- or else
- Chars (Argx) = Name_Off)
+ and then Nam_In (Chars (Argx), Name_On, Name_Off)
then
null;
@@ -16111,8 +17599,8 @@ package body Sem_Prag is
elsif not Is_Static_String_Expression (Arg1) then
Error_Pragma_Arg
- ("argument of pragma% must be On/Off or " &
- "static string expression", Arg1);
+ ("argument of pragma% must be On/Off or static string "
+ & "expression", Arg1);
-- One argument string expression case
@@ -16156,8 +17644,8 @@ package body Sem_Prag is
if not Set_Dot_Warning_Switch (Chr) then
Error_Pragma_Arg
- ("invalid warning switch character " &
- '.' & Chr, Arg1);
+ ("invalid warning switch character "
+ & '.' & Chr, Arg1);
end if;
-- Non-Dot case
@@ -16250,8 +17738,8 @@ package body Sem_Prag is
elsif not Is_Static_String_Expression (Arg2) then
Error_Pragma_Arg
- ("second argument of pragma% must be entity " &
- "name or static string expression", Arg2);
+ ("second argument of pragma% must be entity name "
+ & "or static string expression", Arg2);
-- String literal case
@@ -16290,9 +17778,8 @@ package body Sem_Prag is
if Err then
Error_Msg
- ("??pragma Warnings On with no " &
- "matching Warnings Off",
- Loc);
+ ("??pragma Warnings On with no matching "
+ & "Warnings Off", Loc);
end if;
end if;
end if;
@@ -16371,84 +17858,140 @@ package body Sem_Prag is
when Pragma_Exit => null;
end Analyze_Pragma;
- --------------------
- -- Check_Disabled --
- --------------------
+ ----------------
+ -- Check_Kind --
+ ----------------
- function Check_Disabled (Nam : Name_Id) return Boolean is
+ function Check_Kind (Nam : Name_Id) return Name_Id is
PP : Node_Id;
begin
-- Loop through entries in check policy list
PP := Opt.Check_Policy_List;
- loop
- -- If there are no specific entries that matched, then nothing is
- -- disabled, so return False.
+ while Present (PP) loop
+ declare
+ PPA : constant List_Id := Pragma_Argument_Associations (PP);
+ Pnm : constant Name_Id := Chars (Get_Pragma_Arg (First (PPA)));
- if No (PP) then
- return False;
+ begin
+ if Nam = Pnm
+ or else (Is_Valid_Assertion_Kind (Nam)
+ and then Pnm = Name_Assertion)
+ then
+ case (Chars (Get_Pragma_Arg (Last (PPA)))) is
+ when Name_On | Name_Check =>
+ return Name_Check;
+ when Name_Off | Name_Ignore =>
+ return Name_Ignore;
+ when Name_Disable =>
+ return Name_Disable;
+ when others =>
+ raise Program_Error;
+ end case;
- -- Here we have an entry see if it matches
+ else
+ PP := Next_Pragma (PP);
+ end if;
+ end;
+ end loop;
+
+ -- If there are no specific entries that matched, then we let the
+ -- setting of assertions govern. Note that this provides the needed
+ -- compatibility with the RM for the cases of assertion, invariant,
+ -- precondition, predicate, and postcondition.
+
+ if Assertions_Enabled then
+ return Name_Check;
+ else
+ return Name_Ignore;
+ end if;
+ end Check_Kind;
+
+ -----------------------------
+ -- Check_Applicable_Policy --
+ -----------------------------
+
+ procedure Check_Applicable_Policy (N : Node_Id) is
+ PP : Node_Id;
+ Policy : Name_Id;
+ Ename : Name_Id;
+ -- Effective name of aspect or pragma, this is simply the name of
+ -- the aspect or pragma, except in the case of a pragma derived from
+ -- an aspect, in which case it is the name of the aspect (which may be
+ -- different, e.g. Pre aspect generating Precondition pragma). It also
+ -- deals with the 'Class cases for an aspect.
+
+ begin
+ if Nkind (N) = N_Pragma then
+ if Present (Corresponding_Aspect (N)) then
+ Ename := Chars (Identifier (Corresponding_Aspect (N)));
else
- declare
- PPA : constant List_Id := Pragma_Argument_Associations (PP);
- begin
- if Nam = Chars (Get_Pragma_Arg (First (PPA))) then
- return Chars (Get_Pragma_Arg (Last (PPA))) = Name_Disable;
- else
- PP := Next_Pragma (PP);
- end if;
- end;
+ Ename := Chars (Pragma_Identifier (N));
end if;
- end loop;
- end Check_Disabled;
- -------------------
- -- Check_Enabled --
- -------------------
+ else
+ pragma Assert (Nkind (N) = N_Aspect_Specification);
+ Ename := Chars (Identifier (N));
+
+ if Class_Present (N) then
+ case Ename is
+ when Name_Invariant => Ename := Name_uInvariant;
+ when Name_Pre => Ename := Name_uPre;
+ when Name_Post => Ename := Name_uPost;
+ when Name_Type_Invariant => Ename := Name_uType_Invariant;
+ when others => raise Program_Error;
+ end case;
+ end if;
+ end if;
- function Check_Enabled (Nam : Name_Id) return Boolean is
- PP : Node_Id;
+ -- No effect if not valid assertion kind name
+
+ if not Is_Valid_Assertion_Kind (Ename) then
+ return;
+ end if;
- begin
-- Loop through entries in check policy list
PP := Opt.Check_Policy_List;
- loop
- -- If there are no specific entries that matched, then we let the
- -- setting of assertions govern. Note that this provides the needed
- -- compatibility with the RM for the cases of assertion, invariant,
- -- precondition, predicate, and postcondition.
+ while Present (PP) loop
+ declare
+ PPA : constant List_Id := Pragma_Argument_Associations (PP);
+ Pnm : constant Name_Id := Chars (Get_Pragma_Arg (First (PPA)));
- if No (PP) then
- return Assertions_Enabled;
+ begin
+ if Ename = Pnm or else Pnm = Name_Assertion then
+ Policy := Chars (Get_Pragma_Arg (Last (PPA)));
- -- Here we have an entry see if it matches
+ case Policy is
+ when Name_Off | Name_Ignore =>
+ Set_Is_Ignored (N, True);
- else
- declare
- PPA : constant List_Id := Pragma_Argument_Associations (PP);
+ when Name_Disable =>
+ Set_Is_Ignored (N, True);
+ Set_Is_Disabled (N, True);
- begin
- if Nam = Chars (Get_Pragma_Arg (First (PPA))) then
- case (Chars (Get_Pragma_Arg (Last (PPA)))) is
- when Name_On | Name_Check =>
- return True;
- when Name_Off | Name_Ignore =>
- return False;
- when others =>
- raise Program_Error;
- end case;
+ when others =>
+ null;
+ end case;
- else
- PP := Next_Pragma (PP);
- end if;
- end;
- end if;
+ return;
+ end if;
+
+ PP := Next_Pragma (PP);
+ end;
end loop;
- end Check_Enabled;
+
+ -- If there are no specific entries that matched, then we let the
+ -- setting of assertions govern. Note that this provides the needed
+ -- compatibility with the RM for the cases of assertion, invariant,
+ -- precondition, predicate, and postcondition.
+
+ if not Assertions_Enabled then
+ Set_Is_Ignored (N);
+ end if;
+ end Check_Applicable_Policy;
---------------------------------
-- Delay_Config_Pragma_Analyze --
@@ -16456,9 +17999,8 @@ package body Sem_Prag is
function Delay_Config_Pragma_Analyze (N : Node_Id) return Boolean is
begin
- return Pragma_Name (N) = Name_Interrupt_State
- or else
- Pragma_Name (N) = Name_Priority_Specific_Dispatching;
+ return Nam_In (Pragma_Name (N), Name_Interrupt_State,
+ Name_Priority_Specific_Dispatching);
end Delay_Config_Pragma_Analyze;
-------------------------
@@ -16618,6 +18160,7 @@ package body Sem_Prag is
Pragma_Debug_Policy => 0,
Pragma_Detect_Blocking => -1,
Pragma_Default_Storage_Pool => -1,
+ Pragma_Depends => -1,
Pragma_Disable_Atomic_Synchronization => -1,
Pragma_Discard_Names => 0,
Pragma_Dispatching_Domain => -1,
@@ -16642,6 +18185,7 @@ package body Sem_Prag is
Pragma_Fast_Math => -1,
Pragma_Finalize_Storage_Only => 0,
Pragma_Float_Representation => 0,
+ Pragma_Ghost => 0,
Pragma_Global => -1,
Pragma_Ident => -1,
Pragma_Implementation_Defined => -1,
@@ -16899,6 +18443,44 @@ package body Sem_Prag is
end if;
end Is_Pragma_String_Literal;
+ -----------------------------
+ -- Is_Valid_Assertion_Kind --
+ -----------------------------
+
+ function Is_Valid_Assertion_Kind (Nam : Name_Id) return Boolean is
+ begin
+ case Nam is
+ when
+ -- RM defined
+
+ Name_Assert |
+ Name_Static_Predicate |
+ Name_Dynamic_Predicate |
+ Name_Pre |
+ Name_uPre |
+ Name_Post |
+ Name_uPost |
+ Name_Type_Invariant |
+ Name_uType_Invariant |
+
+ -- Impl defined
+
+ Name_Assert_And_Cut |
+ Name_Assume |
+ Name_Contract_Cases |
+ Name_Debug |
+ Name_Invariant |
+ Name_uInvariant |
+ Name_Loop_Invariant |
+ Name_Loop_Variant |
+ Name_Postcondition |
+ Name_Precondition |
+ Name_Predicate => return True;
+
+ when others => return False;
+ end case;
+ end Is_Valid_Assertion_Kind;
+
-----------------------------------------
-- Make_Aspect_For_PPC_In_Gen_Sub_Decl --
-----------------------------------------
@@ -17038,6 +18620,35 @@ package body Sem_Prag is
end Process_Compilation_Unit_Pragmas;
+ ----------------------------
+ -- Rewrite_Assertion_Kind --
+ ----------------------------
+
+ procedure Rewrite_Assertion_Kind (N : Node_Id) is
+ Nam : Name_Id;
+
+ begin
+ if Nkind (N) = N_Attribute_Reference
+ and then Attribute_Name (N) = Name_Class
+ and then Nkind (Prefix (N)) = N_Identifier
+ then
+ case Chars (Prefix (N)) is
+ when Name_Pre =>
+ Nam := Name_uPre;
+ when Name_Post =>
+ Nam := Name_uPost;
+ when Name_Type_Invariant =>
+ Nam := Name_uType_Invariant;
+ when Name_Invariant =>
+ Nam := Name_uInvariant;
+ when others =>
+ return;
+ end case;
+
+ Rewrite (N, Make_Identifier (Sloc (N), Chars => Nam));
+ end if;
+ end Rewrite_Assertion_Kind;
+
--------
-- rv --
--------
diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads
index 9df7d5ab711..38e39ed2f8a 100644
--- a/gcc/ada/sem_prag.ads
+++ b/gcc/ada/sem_prag.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -54,22 +54,45 @@ package Sem_Prag is
-- of the expressions in the pragma as "spec expressions" (see section
-- in Sem "Handling of Default and Per-Object Expressions...").
- function Check_Disabled (Nam : Name_Id) return Boolean;
+ function Check_Kind (Nam : Name_Id) return Name_Id;
-- This function is used in connection with pragmas Assertion, Check,
- -- Precondition, and Postcondition, to determine if Check pragmas (or
- -- corresponding Assert, Precondition, or Postcondition pragmas) are
- -- currently disabled (as set by a Check_Policy or Assertion_Policy pragma
- -- with the Disable argument).
-
- function Check_Enabled (Nam : Name_Id) return Boolean;
- -- This function is used in connection with pragmas Assertion, Check,
- -- Precondition, and Postcondition, to determine if Check pragmas (or
- -- corresponding Assert, Precondition, or Postcondition pragmas) are
- -- currently active, as determined by the presence of -gnata on the
- -- command line (which sets the default), and the appearance of pragmas
- -- Check_Policy and Assertion_Policy as configuration pragmas either in
- -- a configuration pragma file, or at the start of the current unit.
- -- True is returned if the specified check is enabled.
+ -- and assertion aspects and pragmas, to determine if Check pragmas
+ -- (or corresponding assertion aspects or pragmas) are currently active
+ -- as determined by the presence of -gnata on the command line (which
+ -- sets the default), and the appearance of pragmas Check_Policy and
+ -- Assertion_Policy as configuration pragmas either in a configuration
+ -- pragma file, or at the start of the current unit, or locally given
+ -- Check_Policy and Assertion_Policy pragmas that are currently active.
+ --
+ -- The value returned is one of the names Check, Ignore, Disable (On
+ -- returns Check, and Off returns Ignore).
+ --
+ -- Note: for assertion kinds Pre'Class, Post'Class, Invariant'Class,
+ -- and Type_Invariant'Class, the name passed is Name_uPre, Name_uPost,
+ -- Name_uInvariant, or Name_uType_Invariant, which corresponds to _Pre,
+ -- _Post, _Invariant, or _Type_Invariant, which are special names used
+ -- in identifiers to represent these attribute references.
+
+ procedure Check_Applicable_Policy (N : Node_Id);
+ -- N is either an N_Aspect or an N_Pragma node. There are two cases. If
+ -- the name of the aspect or pragma is not one of those recognized as a
+ -- assertion kind by an Assertion_Kind pragma, then the call has no effect.
+ -- Note that in the case of a pragma derived from an aspect, the name
+ -- we use for the purpose of this procedure is the aspect name, which may
+ -- be different from the pragma name (e.g. Precondition for Pre aspect).
+ -- In addition, 'Class aspects are recognized (and the corresponding
+ -- special names used in the processing).
+ --
+ -- If the name is valid ASSERTION_KIND name, then the Check_Policy pragma
+ -- chain is checked for a matching entry (or for an Assertion entry which
+ -- matches all possibilities). If a matching entry is found then the policy
+ -- is checked. If it is Off, Ignore, or Disable, then the Is_Ignored flag
+ -- is set in the aspect or pragma node. Additionally for policy Disable,
+ -- the Is_Disabled flag is set.
+ --
+ -- If no matching Check_Policy pragma is found then the effect depends on
+ -- whether -gnata was used, if so, then the call has no effect, otherwise
+ -- Is_Ignored (but not Is_Disabled) is set True.
function Delay_Config_Pragma_Analyze (N : Node_Id) return Boolean;
-- N is a pragma appearing in a configuration pragma file. Most such
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 4fcbee93a2c..f78f2ae2d48 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -1005,9 +1005,9 @@ package body Sem_Res is
-- functions, this is never a parameterless call (RM 4.1.4(6)).
if Nkind (Parent (N)) = N_Attribute_Reference
- and then (Attribute_Name (Parent (N)) = Name_Address or else
- Attribute_Name (Parent (N)) = Name_Code_Address or else
- Attribute_Name (Parent (N)) = Name_Access)
+ and then Nam_In (Attribute_Name (Parent (N)), Name_Address,
+ Name_Code_Address,
+ Name_Access)
then
return False;
end if;
@@ -1373,7 +1373,7 @@ package body Sem_Res is
elsif In_Instance then
null;
- elsif (Op_Name = Name_Op_Multiply or else Op_Name = Name_Op_Divide)
+ elsif Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide)
and then Is_Fixed_Point_Type (Etype (Left_Opnd (Op_Node)))
and then Is_Fixed_Point_Type (Etype (Right_Opnd (Op_Node)))
then
@@ -1385,7 +1385,7 @@ package body Sem_Res is
-- available.
elsif Ada_Version >= Ada_2005
- and then (Op_Name = Name_Op_Eq or else Op_Name = Name_Op_Ne)
+ and then Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne)
and then Ekind (Etype (Act1)) = E_Anonymous_Access_Type
then
null;
@@ -1496,9 +1496,7 @@ package body Sem_Res is
and then not In_Instance
then
if Is_Fixed_Point_Type (Typ)
- and then (Op_Name = Name_Op_Multiply
- or else
- Op_Name = Name_Op_Divide)
+ and then Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide)
then
-- Already checked above
@@ -1534,7 +1532,7 @@ package body Sem_Res is
-- the equality node will not resolve any remaining ambiguity, and it
-- assumes that the first operand is not overloaded.
- if (Op_Name = Name_Op_Eq or else Op_Name = Name_Op_Ne)
+ if Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne)
and then Ekind (Func) = E_Function
and then Is_Overloaded (Act1)
then
@@ -1947,9 +1945,9 @@ package body Sem_Res is
-- access-to-subprogram type.
if Nkind (N) = N_Attribute_Reference
- and then (Attribute_Name (N) = Name_Access or else
- Attribute_Name (N) = Name_Unrestricted_Access or else
- Attribute_Name (N) = Name_Unchecked_Access)
+ and then Nam_In (Attribute_Name (N), Name_Access,
+ Name_Unrestricted_Access,
+ Name_Unchecked_Access)
and then Comes_From_Source (N)
and then Is_Entity_Name (Prefix (N))
and then Is_Subprogram (Entity (Prefix (N)))
@@ -2060,7 +2058,17 @@ package body Sem_Res is
Analyze_Dimension (N);
return;
- -- Return if type = Any_Type (previous error encountered)
+ -- A Raise_Expression takes its type from context. The Etype was set
+ -- to Any_Type, reflecting the fact that the expression itself does
+ -- not specify any possible interpretation. So we set the type to the
+ -- resolution type here and now. We need to do this before Resolve sees
+ -- the Any_Type value.
+
+ elsif Nkind (N) = N_Raise_Expression then
+ Set_Etype (N, Typ);
+
+ -- Any other case of Any_Type as the Etype value means that we had
+ -- a previous error.
elsif Etype (N) = Any_Type then
Debug_A_Exit ("resolving ", N, " (done, Etype = Any_Type)");
@@ -2299,9 +2307,8 @@ package body Sem_Res is
and then Scope (It.Nam) = Standard_Standard
then
Error_Msg_N
- ("\\possible interpretation as " &
- "universal_fixed operation " &
- "(RM 4.5.5 (19))", N);
+ ("\\possible interpretation as universal_fixed "
+ & "operation (RM 4.5.5 (19))", N);
else
Error_Msg_N
("\\possible interpretation (predefined)#!", N);
@@ -2589,8 +2596,9 @@ package body Sem_Res is
end if;
Error_Msg_Node_2 := Typ;
- Error_Msg_NE ("no visible interpretation of&" &
- " matches expected type&", N, Subp_Name);
+ Error_Msg_NE
+ ("no visible interpretation of& "
+ & "matches expected type&", N, Subp_Name);
end;
if All_Errors_Mode then
@@ -2804,7 +2812,16 @@ package body Sem_Res is
when N_Qualified_Expression
=> Resolve_Qualified_Expression (N, Ctx_Type);
- when N_Quantified_Expression => null;
+ -- Why is the following null, needs a comment ???
+
+ when N_Quantified_Expression
+ => null;
+
+ -- Nothing to do for Raise_Expression, since we took care of
+ -- setting the Etype earlier, and no other processing is needed.
+
+ when N_Raise_Expression
+ => null;
when N_Raise_xxx_Error
=> Set_Etype (N, Ctx_Type);
@@ -3513,8 +3530,8 @@ package body Sem_Res is
or else Is_By_Reference_Type (Etype (Expression (A)))
then
Error_Msg_N
- ("view conversion between unrelated by reference " &
- "array types not allowed (\'A'I-00246)", A);
+ ("view conversion between unrelated by reference "
+ & "array types not allowed (\'A'I-00246)", A);
-- In Ada 2005 mode, check view conversion component
-- type cannot be private, tagged, or volatile. Note
@@ -3598,8 +3615,8 @@ package body Sem_Res is
or else Is_Limited_Type (Etype (Expression (A))))
then
Error_Msg_N
- ("conversion between unrelated limited array types " &
- "not allowed (\A\I-00246)", A);
+ ("conversion between unrelated limited array types "
+ & "not allowed (\A\I-00246)", A);
if Is_Limited_Type (Etype (F)) then
Explain_Limited_Type (Etype (F), A);
@@ -3648,6 +3665,10 @@ package body Sem_Res is
Establish_Transient_Scope (A, False);
end if;
end;
+
+ if Ekind (Etype (F)) = E_Anonymous_Access_Type then
+ Check_Restriction (No_Access_Parameter_Allocators, A);
+ end if;
end if;
-- (Ada 2005): The call may be to a primitive operation of
@@ -3928,7 +3949,9 @@ package body Sem_Res is
-- infinite recursion.
if not (Ekind (Nam) = E_Function
- and then Has_Predicates (Nam))
+ and then (Is_Predicate_Function (Nam)
+ or else
+ Is_Predicate_Function_M (Nam)))
then
Apply_Predicate_Check (A, F_Typ);
end if;
@@ -4078,8 +4101,8 @@ package body Sem_Res is
and then No (Non_Limited_View (Desig))
then
Error_Msg_NE
- ("premature use of incomplete type& " &
- "in dispatching call", A, Desig);
+ ("premature use of incomplete type& "
+ & "in dispatching call", A, Desig);
end if;
end;
end if;
@@ -4314,8 +4337,8 @@ package body Sem_Res is
(Etype (Pool), Name_Simple_Storage_Pool_Type))
then
Error_Msg_N
- ("limited function calls not yet supported in simple " &
- "storage pool allocators", Expression (E));
+ ("limited function calls not yet supported in simple "
+ & "storage pool allocators", Expression (E));
end if;
end;
end if;
@@ -4462,10 +4485,11 @@ package body Sem_Res is
Deepest_Type_Access_Level (Typ)
then
if In_Instance_Body then
- Error_Msg_N ("??type in allocator has deeper level than" &
- " designated class-wide type", E);
- Error_Msg_N ("\??Program_Error will be raised at run time",
- E);
+ Error_Msg_N
+ ("??type in allocator has deeper level than "
+ & "designated class-wide type", E);
+ Error_Msg_N
+ ("\??Program_Error will be raised at run time", E);
Rewrite (N,
Make_Raise_Program_Error (Sloc (N),
Reason => PE_Accessibility_Check_Failed));
@@ -4476,8 +4500,8 @@ package body Sem_Res is
-- type. A run-time check will be performed in the instance.
elsif not Is_Generic_Type (Exp_Typ) then
- Error_Msg_N ("type in allocator has deeper level than" &
- " designated class-wide type", E);
+ Error_Msg_N ("type in allocator has deeper level than "
+ & "designated class-wide type", E);
end if;
end if;
end;
@@ -4530,6 +4554,8 @@ package body Sem_Res is
Defining_Identifier (Associated_Node_For_Itype (Typ));
begin
+ Check_Restriction (No_Coextensions, N);
+
-- Ada 2012 AI05-0052: If the designated type of the allocator
-- is limited, then the allocator shall not be used to define
-- the value of an access discriminant unless the discriminated
@@ -5039,8 +5065,8 @@ package body Sem_Res is
and then not Machine_Overflows_On_Target
then
Error_Msg_N
- ("float division by zero, " &
- "may generate '+'/'- infinity??", Right_Opnd (N));
+ ("float division by zero, may generate "
+ & "'+'/'- infinity??", Right_Opnd (N));
-- For all other cases, we get a Constraint_Error
@@ -6799,10 +6825,12 @@ package body Sem_Res is
-- the expression must be rejected.
function Find_Unique_Access_Type return Entity_Id;
- -- In the case of allocators, make a last-ditch attempt to find a single
- -- access type with the right designated type. This is semantically
- -- dubious, and of no interest to any real code, but c48008a makes it
- -- all worthwhile.
+ -- In the case of allocators and access attributes, the context must
+ -- provide an indication of the specific access type to be used. If
+ -- one operand is of such a "generic" access type, check whether there
+ -- is a specific visible access type that has the same designated type.
+ -- This is semantically dubious, and of no interest to any real code,
+ -- but c48008a makes it all worthwhile.
-------------------------
-- Check_If_Expression --
@@ -6835,9 +6863,14 @@ package body Sem_Res is
S : Entity_Id;
begin
- if Ekind (Etype (R)) = E_Allocator_Type then
+ if Ekind_In (Etype (R), E_Allocator_Type,
+ E_Access_Attribute_Type)
+ then
Acc := Designated_Type (Etype (R));
- elsif Ekind (Etype (L)) = E_Allocator_Type then
+
+ elsif Ekind_In (Etype (L), E_Allocator_Type,
+ E_Access_Attribute_Type)
+ then
Acc := Designated_Type (Etype (L));
else
return Empty;
@@ -8776,8 +8809,6 @@ package body Sem_Res is
and then Ekind_In (Entity (S), E_Component, E_Discriminant)
and then Present (Original_Record_Component (Entity (S)))
and then Ekind (Original_Record_Component (Entity (S))) = E_Component
- and then Present (Discriminant_Checking_Func
- (Original_Record_Component (Entity (S))))
and then not Discriminant_Checks_Suppressed (T)
and then not Init_Component
then
@@ -9737,7 +9768,7 @@ package body Sem_Res is
N);
else
- Expand_Interface_Conversion (N, Is_Static => False);
+ Expand_Interface_Conversion (N);
end if;
-- Conversion to interface type
@@ -9750,29 +9781,18 @@ package body Sem_Res is
Opnd := Etype (Opnd);
end if;
- if not Interface_Present_In_Ancestor
- (Typ => Opnd,
- Iface => Target)
+ if Is_Class_Wide_Type (Opnd)
+ or else Interface_Present_In_Ancestor
+ (Typ => Opnd,
+ Iface => Target)
then
- if Is_Class_Wide_Type (Opnd) then
-
- -- The static analysis is not enough to know if the
- -- interface is implemented or not. Hence we must pass
- -- the work to the expander to generate code to evaluate
- -- the conversion at run time.
-
- Expand_Interface_Conversion (N, Is_Static => False);
-
- else
- Error_Msg_Name_1 := Chars (Etype (Target));
- Error_Msg_Name_2 := Chars (Opnd);
- Error_Msg_N
- ("wrong interface conversion (% is not a progenitor " &
- "of %)", N);
- end if;
-
- else
Expand_Interface_Conversion (N);
+ else
+ Error_Msg_Name_1 := Chars (Etype (Target));
+ Error_Msg_Name_2 := Chars (Opnd);
+ Error_Msg_N
+ ("wrong interface conversion (% is not a progenitor "
+ & "of %)", N);
end if;
end if;
end;
@@ -9785,7 +9805,9 @@ package body Sem_Res is
if Has_Predicates (Target_Typ) then
if Nkind (Parent (N)) = N_Function_Call
and then Present (Name (Parent (N)))
- and then Has_Predicates (Entity (Name (Parent (N))))
+ and then (Is_Predicate_Function (Entity (Name (Parent (N))))
+ or else
+ Is_Predicate_Function_M (Entity (Name (Parent (N)))))
then
null;
@@ -10480,22 +10502,19 @@ package body Sem_Res is
Operand : Node_Id;
Report_Errs : Boolean := True) return Boolean
is
- Target_Type : constant Entity_Id := Base_Type (Target);
- Opnd_Type : Entity_Id := Etype (Operand);
+ Target_Type : constant Entity_Id := Base_Type (Target);
+ Opnd_Type : Entity_Id := Etype (Operand);
+ Inc_Ancestor : Entity_Id;
function Conversion_Check
(Valid : Boolean;
Msg : String) return Boolean;
-- Little routine to post Msg if Valid is False, returns Valid value
- -- The following are badly named, this kind of overloading is actively
- -- confusing in reading code, please rename to something like
- -- Error_Msg_N_If_Reporting ???
-
- procedure Error_Msg_N (Msg : String; N : Node_Or_Entity_Id);
+ procedure Conversion_Error_N (Msg : String; N : Node_Or_Entity_Id);
-- If Report_Errs, then calls Errout.Error_Msg_N with its arguments
- procedure Error_Msg_NE
+ procedure Conversion_Error_NE
(Msg : String;
N : Node_Or_Entity_Id;
E : Node_Or_Entity_Id);
@@ -10532,37 +10551,37 @@ package body Sem_Res is
and then not In_Instance
then
- Error_Msg_N (Msg, Operand);
+ Conversion_Error_N (Msg, Operand);
end if;
return Valid;
end Conversion_Check;
- -----------------
- -- Error_Msg_N --
- -----------------
+ ------------------------
+ -- Conversion_Error_N --
+ ------------------------
- procedure Error_Msg_N (Msg : String; N : Node_Or_Entity_Id) is
+ procedure Conversion_Error_N (Msg : String; N : Node_Or_Entity_Id) is
begin
if Report_Errs then
- Errout.Error_Msg_N (Msg, N);
+ Error_Msg_N (Msg, N);
end if;
- end Error_Msg_N;
+ end Conversion_Error_N;
- ------------------
- -- Error_Msg_NE --
- ------------------
+ -------------------------
+ -- Conversion_Error_NE --
+ -------------------------
- procedure Error_Msg_NE
+ procedure Conversion_Error_NE
(Msg : String;
N : Node_Or_Entity_Id;
E : Node_Or_Entity_Id)
is
begin
if Report_Errs then
- Errout.Error_Msg_NE (Msg, N, E);
+ Error_Msg_NE (Msg, N, E);
end if;
- end Error_Msg_NE;
+ end Conversion_Error_NE;
----------------------------
-- Valid_Array_Conversion --
@@ -10590,7 +10609,7 @@ package body Sem_Res is
if
Number_Dimensions (Target_Type) /= Number_Dimensions (Opnd_Type)
then
- Error_Msg_N
+ Conversion_Error_N
("incompatible number of dimensions for conversion", Operand);
return False;
@@ -10612,7 +10631,7 @@ package body Sem_Res is
and then (Root_Type (Target_Index_Type)
/= Root_Type (Opnd_Index_Type))
then
- Error_Msg_N
+ Conversion_Error_N
("incompatible index types for array conversion",
Operand);
return False;
@@ -10646,10 +10665,10 @@ package body Sem_Res is
Deepest_Type_Access_Level (Opnd_Type)
then
if In_Instance_Body then
- Error_Msg_N
- ("??source array type has " &
- "deeper accessibility level than target", Operand);
- Error_Msg_N
+ Conversion_Error_N
+ ("??source array type has deeper accessibility "
+ & "level than target", Operand);
+ Conversion_Error_N
("\??Program_Error will be raised at run time",
Operand);
Rewrite (N,
@@ -10661,9 +10680,9 @@ package body Sem_Res is
-- Conversion not allowed because of accessibility levels
else
- Error_Msg_N
- ("source array type has " &
- "deeper accessibility level than target", Operand);
+ Conversion_Error_N
+ ("source array type has deeper accessibility "
+ & "level than target", Operand);
return False;
end if;
@@ -10674,7 +10693,7 @@ package body Sem_Res is
-- All other cases where component base types do not match
else
- Error_Msg_N
+ Conversion_Error_N
("incompatible component types for array conversion",
Operand);
return False;
@@ -10688,7 +10707,7 @@ package body Sem_Res is
if not Subtypes_Statically_Match
(Target_Comp_Type, Opnd_Comp_Type)
then
- Error_Msg_N
+ Conversion_Error_N
("component subtypes must statically match", Operand);
return False;
end if;
@@ -10751,7 +10770,7 @@ package body Sem_Res is
return True;
else
- Error_Msg_NE
+ Conversion_Error_NE
("invalid tagged conversion, not compatible with}",
N, First_Subtype (Opnd_Type));
return False;
@@ -10818,7 +10837,7 @@ package body Sem_Res is
It1 := It;
if No (It.Typ) then
- Error_Msg_N ("illegal operand in conversion", Operand);
+ Conversion_Error_N ("illegal operand in conversion", Operand);
return False;
end if;
@@ -10830,7 +10849,8 @@ package body Sem_Res is
It1 := Disambiguate (Operand, I1, I, Any_Type);
if It1 = No_Interp then
- Error_Msg_N ("ambiguous operand in conversion", Operand);
+ Conversion_Error_N
+ ("ambiguous operand in conversion", Operand);
-- If the interpretation involves a standard operator, use
-- the location of the type, which may be user-defined.
@@ -10841,7 +10861,7 @@ package body Sem_Res is
Error_Msg_Sloc := Sloc (It.Nam);
end if;
- Error_Msg_N -- CODEFIX
+ Conversion_Error_N -- CODEFIX
("\\possible interpretation#!", Operand);
if Sloc (N1) = Standard_Location then
@@ -10850,7 +10870,7 @@ package body Sem_Res is
Error_Msg_Sloc := Sloc (N1);
end if;
- Error_Msg_N -- CODEFIX
+ Conversion_Error_N -- CODEFIX
("\\possible interpretation#!", Operand);
return False;
@@ -10862,6 +10882,13 @@ package body Sem_Res is
end;
end if;
+ -- If we are within a child unit, check whether the type of the
+ -- expression has an ancestor in a parent unit, in which case it
+ -- belongs to its derivation class even if the ancestor is private.
+ -- See RM 7.3.1 (5.2/3).
+
+ Inc_Ancestor := Get_Incomplete_View_Of_Ancestor (Opnd_Type);
+
-- Numeric types
if Is_Numeric_Type (Target_Type) then
@@ -10890,7 +10917,10 @@ package body Sem_Res is
else
return Conversion_Check
- (Is_Numeric_Type (Opnd_Type),
+ (Is_Numeric_Type (Opnd_Type)
+ or else
+ (Present (Inc_Ancestor)
+ and then Is_Numeric_Type (Inc_Ancestor)),
"illegal operand for numeric conversion");
end if;
@@ -10901,8 +10931,10 @@ package body Sem_Res is
or else Opnd_Type = Any_Composite
or else Opnd_Type = Any_String
then
- Error_Msg_N ("illegal operand for array conversion", Operand);
+ Conversion_Error_N
+ ("illegal operand for array conversion", Operand);
return False;
+
else
return Valid_Array_Conversion;
end if;
@@ -10933,14 +10965,14 @@ package body Sem_Res is
-- will be generated by Expand_N_Type_Conversion.
if In_Instance_Body then
- Error_Msg_N
+ Conversion_Error_N
("??cannot convert local pointer to non-local access type",
Operand);
- Error_Msg_N
+ Conversion_Error_N
("\??Program_Error will be raised at run time", Operand);
else
- Error_Msg_N
+ Conversion_Error_N
("cannot convert local pointer to non-local access type",
Operand);
return False;
@@ -10966,16 +10998,16 @@ package body Sem_Res is
-- will be generated by Expand_N_Type_Conversion.
if In_Instance_Body then
- Error_Msg_N
- ("??cannot convert access discriminant to non-local" &
- " access type", Operand);
- Error_Msg_N
+ Conversion_Error_N
+ ("??cannot convert access discriminant to non-local "
+ & "access type", Operand);
+ Conversion_Error_N
("\??Program_Error will be raised at run time",
Operand);
else
- Error_Msg_N
- ("cannot convert access discriminant to non-local" &
- " access type", Operand);
+ Conversion_Error_N
+ ("cannot convert access discriminant to non-local "
+ & "access type", Operand);
return False;
end if;
end if;
@@ -10992,7 +11024,7 @@ package body Sem_Res is
Ekind_In (Entity (Operand), E_In_Parameter, E_Constant)
and then Present (Discriminal_Link (Entity (Operand)))
then
- Error_Msg_N
+ Conversion_Error_N
("discriminant has deeper accessibility level than target",
Operand);
return False;
@@ -11017,7 +11049,7 @@ package body Sem_Res is
if Is_Access_Constant (Opnd_Type)
and then not Is_Access_Constant (Target_Type)
then
- Error_Msg_N
+ Conversion_Error_N
("access-to-constant operand type not allowed", Operand);
return False;
end if;
@@ -11057,9 +11089,9 @@ package body Sem_Res is
if Nkind (Associated_Node_For_Itype (Opnd_Type)) =
N_Object_Declaration
then
- Error_Msg_N
- ("implicit conversion of stand-alone anonymous " &
- "access object not allowed", Operand);
+ Conversion_Error_N
+ ("implicit conversion of stand-alone anonymous "
+ & "access object not allowed", Operand);
return False;
-- Implicit conversions aren't allowed for anonymous access
@@ -11071,9 +11103,9 @@ package body Sem_Res is
N_Function_Specification,
N_Procedure_Specification)
then
- Error_Msg_N
- ("implicit conversion of anonymous access formal " &
- "not allowed", Operand);
+ Conversion_Error_N
+ ("implicit conversion of anonymous access formal "
+ & "not allowed", Operand);
return False;
-- This is a case where there's an enclosing object whose
@@ -11084,9 +11116,9 @@ package body Sem_Res is
elsif Object_Access_Level (Operand)
= Scope_Depth (Standard_Standard)
then
- Error_Msg_N
- ("implicit conversion of anonymous access value " &
- "not allowed", Operand);
+ Conversion_Error_N
+ ("implicit conversion of anonymous access value "
+ & "not allowed", Operand);
return False;
-- In other cases, the level of the operand's type must be
@@ -11096,9 +11128,9 @@ package body Sem_Res is
elsif Type_Access_Level (Opnd_Type) >
Deepest_Type_Access_Level (Target_Type)
then
- Error_Msg_N
- ("implicit conversion of anonymous access value " &
- "violates accessibility", Operand);
+ Conversion_Error_N
+ ("implicit conversion of anonymous access value "
+ & "violates accessibility", Operand);
return False;
end if;
end if;
@@ -11111,17 +11143,17 @@ package body Sem_Res is
-- will be generated by Expand_N_Type_Conversion.
if In_Instance_Body then
- Error_Msg_N
+ Conversion_Error_N
("??cannot convert local pointer to non-local access type",
Operand);
- Error_Msg_N
+ Conversion_Error_N
("\??Program_Error will be raised at run time", Operand);
else
-- Avoid generation of spurious error message
if not Error_Posted (N) then
- Error_Msg_N
+ Conversion_Error_N
("cannot convert local pointer to non-local access type",
Operand);
end if;
@@ -11149,17 +11181,17 @@ package body Sem_Res is
-- will be generated by Expand_N_Type_Conversion.
if In_Instance_Body then
- Error_Msg_N
- ("??cannot convert access discriminant to non-local"
- & " access type", Operand);
- Error_Msg_N
+ Conversion_Error_N
+ ("??cannot convert access discriminant to non-local "
+ & "access type", Operand);
+ Conversion_Error_N
("\??Program_Error will be raised at run time",
Operand);
else
- Error_Msg_N
- ("cannot convert access discriminant to non-local" &
- " access type", Operand);
+ Conversion_Error_N
+ ("cannot convert access discriminant to non-local "
+ & "access type", Operand);
return False;
end if;
end if;
@@ -11175,7 +11207,7 @@ package body Sem_Res is
Ekind_In (Entity (Operand), E_In_Parameter, E_Constant)
and then Present (Discriminal_Link (Entity (Operand)))
then
- Error_Msg_N
+ Conversion_Error_N
("discriminant has deeper accessibility level than target",
Operand);
return False;
@@ -11226,7 +11258,7 @@ package body Sem_Res is
else
if not Same_Base then
- Error_Msg_NE
+ Conversion_Error_NE
("target designated type not compatible with }",
N, Base_Type (Opnd));
return False;
@@ -11251,10 +11283,10 @@ package body Sem_Res is
and then Known_Static_RM_Size (Opnd)
and then RM_Size (Target) /= RM_Size (Opnd)
then
- Error_Msg_NE
+ Conversion_Error_NE
("target designated subtype not compatible with }",
N, Opnd);
- Error_Msg_NE
+ Conversion_Error_NE
("\because sizes of the two designated subtypes differ",
N, Opnd);
return False;
@@ -11292,12 +11324,12 @@ package body Sem_Res is
or else not Is_Entity_Name (Name (Parent (N)))
or else not Is_Return_Object (Entity (Name (Parent (N)))))
then
- Error_Msg_N
+ Conversion_Error_N
("illegal attempt to store anonymous access to subprogram",
Operand);
- Error_Msg_N
- ("\value has deeper accessibility than any master " &
- "(RM 3.10.2 (13))",
+ Conversion_Error_N
+ ("\value has deeper accessibility than any master "
+ & "(RM 3.10.2 (13))",
Operand);
Error_Msg_NE
@@ -11316,7 +11348,7 @@ package body Sem_Res is
if Type_Access_Level (Opnd_Type) >
Deepest_Type_Access_Level (Target_Type)
then
- Error_Msg_N
+ Conversion_Error_N
("operand type has deeper accessibility level than target",
Operand);
@@ -11338,9 +11370,9 @@ package body Sem_Res is
end loop;
if T_Gen /= O_Gen then
- Error_Msg_N
- ("target type must be declared in same generic body"
- & " as operand type", N);
+ Conversion_Error_N
+ ("target type must be declared in same generic body "
+ & "as operand type", N);
end if;
end;
end if;
@@ -11397,14 +11429,14 @@ package body Sem_Res is
elsif Ekind (Target_Type) = E_Access_Type
and then Is_Access_Type (Opnd_Type)
then
- Error_Msg_N ("target type must be general access type!", N);
- Error_Msg_NE -- CODEFIX
+ Conversion_Error_N ("target type must be general access type!", N);
+ Conversion_Error_NE -- CODEFIX
("add ALL to }!", N, Target_Type);
return False;
else
- Error_Msg_NE ("invalid conversion, not compatible with }",
- N, Opnd_Type);
+ Conversion_Error_NE
+ ("invalid conversion, not compatible with }", N, Opnd_Type);
return False;
end if;
end Valid_Conversion;
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 5f86561b148..fa5c085392f 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -780,7 +780,7 @@ package body Sem_Type is
RA : Entity_Id;
begin
- -- Retrieve parent subtype from subtype declaration for actual.
+ -- Retrieve parent subtype from subtype declaration for actual
if Nkind (Par) = N_Subtype_Declaration
and then not Comes_From_Source (Par)
@@ -793,7 +793,7 @@ package body Sem_Type is
end if;
end if;
- -- Otherwise actual is not the actual of an enclosing instance.
+ -- Otherwise actual is not the actual of an enclosing instance
return T;
end Real_Actual;
@@ -1313,7 +1313,7 @@ package body Sem_Type is
-- Determine whether a subprogram is an actual in an enclosing instance.
-- An overloading between such a subprogram and one declared outside the
-- instance is resolved in favor of the first, because it resolved in
- -- the generic. Within the instance the eactual is represented by a
+ -- the generic. Within the instance the actual is represented by a
-- constructed subprogram renaming.
function Matches (Actual, Formal : Node_Id) return Boolean;
@@ -2057,8 +2057,7 @@ package body Sem_Type is
and then not In_Instance
then
if Is_Fixed_Point_Type (Typ)
- and then (Chars (Nam1) = Name_Op_Multiply
- or else Chars (Nam1) = Name_Op_Divide)
+ and then Nam_In (Chars (Nam1), Name_Op_Multiply, Name_Op_Divide)
and then
(Ada_Version = Ada_83
or else
@@ -2079,9 +2078,7 @@ package body Sem_Type is
-- declared in the same declarative list as the type. The node
-- may be an operator or a function call.
- elsif (Chars (Nam1) = Name_Op_Eq
- or else
- Chars (Nam1) = Name_Op_Ne)
+ elsif Nam_In (Chars (Nam1), Name_Op_Eq, Name_Op_Ne)
and then Ada_Version >= Ada_2005
and then Etype (User_Subp) = Standard_Boolean
and then Ekind (Operand_Type) = E_Anonymous_Access_Type
@@ -3059,10 +3056,7 @@ package body Sem_Type is
elsif Num = 1 then
T1 := Etype (First_Formal (New_S));
- if Op_Name = Name_Op_Subtract
- or else Op_Name = Name_Op_Add
- or else Op_Name = Name_Op_Abs
- then
+ if Nam_In (Op_Name, Name_Op_Subtract, Name_Op_Add, Name_Op_Abs) then
return Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T);
@@ -3080,26 +3074,24 @@ package body Sem_Type is
T1 := Etype (First_Formal (New_S));
T2 := Etype (Next_Formal (First_Formal (New_S)));
- if Op_Name = Name_Op_And or else Op_Name = Name_Op_Or
- or else Op_Name = Name_Op_Xor
- then
+ if Nam_In (Op_Name, Name_Op_And, Name_Op_Or, Name_Op_Xor) then
return Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Valid_Boolean_Arg (Base_Type (T));
- elsif Op_Name = Name_Op_Eq or else Op_Name = Name_Op_Ne then
+ elsif Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne) then
return Base_Type (T1) = Base_Type (T2)
and then not Is_Limited_Type (T1)
and then Is_Boolean_Type (T);
- elsif Op_Name = Name_Op_Lt or else Op_Name = Name_Op_Le
- or else Op_Name = Name_Op_Gt or else Op_Name = Name_Op_Ge
+ elsif Nam_In (Op_Name, Name_Op_Lt, Name_Op_Le,
+ Name_Op_Gt, Name_Op_Ge)
then
return Base_Type (T1) = Base_Type (T2)
and then Valid_Comparison_Arg (T1)
and then Is_Boolean_Type (T);
- elsif Op_Name = Name_Op_Add or else Op_Name = Name_Op_Subtract then
+ elsif Nam_In (Op_Name, Name_Op_Add, Name_Op_Subtract) then
return Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T);
@@ -3152,7 +3144,7 @@ package body Sem_Type is
and then Is_Floating_Point_Type (T2)
and then Base_Type (T2) = Base_Type (T));
- elsif Op_Name = Name_Op_Mod or else Op_Name = Name_Op_Rem then
+ elsif Nam_In (Op_Name, Name_Op_Mod, Name_Op_Rem) then
return Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Is_Integer_Type (T);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index ae6fe607c88..00db63d6f9c 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -5380,6 +5380,55 @@ package body Sem_Util is
end if;
end Get_Generic_Entity;
+ -------------------------------------
+ -- Get_Incomplete_View_Of_Ancestor --
+ -------------------------------------
+
+ function Get_Incomplete_View_Of_Ancestor (E : Entity_Id) return Entity_Id is
+ Cur_Unit : constant Entity_Id := Cunit_Entity (Current_Sem_Unit);
+ Par_Scope : Entity_Id;
+ Par_Type : Entity_Id;
+
+ begin
+ -- The incomplete view of an ancestor is only relevant for private
+ -- derived types in child units.
+
+ if not Is_Derived_Type (E)
+ or else not Is_Child_Unit (Cur_Unit)
+ then
+ return Empty;
+
+ else
+ Par_Scope := Scope (Cur_Unit);
+ if No (Par_Scope) then
+ return Empty;
+ end if;
+
+ Par_Type := Etype (Base_Type (E));
+
+ -- Traverse list of ancestor types until we find one declared in
+ -- a parent or grandparent unit (two levels seem sufficient).
+
+ while Present (Par_Type) loop
+ if Scope (Par_Type) = Par_Scope
+ or else Scope (Par_Type) = Scope (Par_Scope)
+ then
+ return Par_Type;
+
+ elsif not Is_Derived_Type (Par_Type) then
+ return Empty;
+
+ else
+ Par_Type := Etype (Base_Type (Par_Type));
+ end if;
+ end loop;
+
+ -- If none found, there is no relevant ancestor type.
+
+ return Empty;
+ end if;
+ end Get_Incomplete_View_Of_Ancestor;
+
----------------------
-- Get_Index_Bounds --
----------------------
@@ -5563,49 +5612,58 @@ package body Sem_Util is
---------------------------
function Get_Subprogram_Entity (Nod : Node_Id) return Entity_Id is
- Nam : Node_Id;
- Proc : Entity_Id;
+ Subp : Node_Id;
+ Subp_Id : Entity_Id;
begin
if Nkind (Nod) = N_Accept_Statement then
- Nam := Entry_Direct_Name (Nod);
+ Subp := Entry_Direct_Name (Nod);
+
+ elsif Nkind (Nod) = N_Slice then
+ Subp := Prefix (Nod);
- -- For an entry call, the prefix of the call is a selected component.
- -- Need additional code for internal calls ???
+ else
+ Subp := Name (Nod);
+ end if;
+
+ -- Strip the subprogram call
+
+ loop
+ if Nkind_In (Subp, N_Explicit_Dereference,
+ N_Indexed_Component,
+ N_Selected_Component)
+ then
+ Subp := Prefix (Subp);
+
+ elsif Nkind_In (Subp, N_Type_Conversion,
+ N_Unchecked_Type_Conversion)
+ then
+ Subp := Expression (Subp);
- elsif Nkind (Nod) = N_Entry_Call_Statement then
- if Nkind (Name (Nod)) = N_Selected_Component then
- Nam := Entity (Selector_Name (Name (Nod)));
else
- Nam := Empty;
+ exit;
end if;
+ end loop;
- else
- Nam := Name (Nod);
- end if;
+ -- Extract the entity of the subprogram call
- if Nkind (Nam) = N_Explicit_Dereference then
- Proc := Etype (Prefix (Nam));
- elsif Is_Entity_Name (Nam) then
- Proc := Entity (Nam);
- else
- return Empty;
- end if;
+ if Is_Entity_Name (Subp) then
+ Subp_Id := Entity (Subp);
- if Is_Object (Proc) then
- Proc := Etype (Proc);
- end if;
+ if Ekind (Subp_Id) = E_Access_Subprogram_Type then
+ Subp_Id := Directly_Designated_Type (Subp_Id);
+ end if;
- if Ekind (Proc) = E_Access_Subprogram_Type then
- Proc := Directly_Designated_Type (Proc);
- end if;
+ if Is_Subprogram (Subp_Id) then
+ return Subp_Id;
+ else
+ return Empty;
+ end if;
+
+ -- The search did not find a construct that denotes a subprogram
- if not Is_Subprogram (Proc)
- and then Ekind (Proc) /= E_Subprogram_Type
- then
- return Empty;
else
- return Proc;
+ return Empty;
end if;
end Get_Subprogram_Entity;
@@ -7665,6 +7723,20 @@ package body Sem_Util is
end if;
end Is_Atomic_Object;
+ ------------------------------------
+ -- Is_Body_Or_Package_Declaration --
+ ------------------------------------
+
+ function Is_Body_Or_Package_Declaration (N : Node_Id) return Boolean is
+ begin
+ return Nkind_In (N, N_Entry_Body,
+ N_Package_Body,
+ N_Package_Declaration,
+ N_Protected_Body,
+ N_Subprogram_Body,
+ N_Task_Body);
+ end Is_Body_Or_Package_Declaration;
+
-----------------------
-- Is_Bounded_String --
-----------------------
@@ -7698,6 +7770,29 @@ package body Sem_Util is
or else Is_Task_Interface (T));
end Is_Concurrent_Interface;
+ -----------------------
+ -- Is_Constant_Bound --
+ -----------------------
+
+ function Is_Constant_Bound (Exp : Node_Id) return Boolean is
+ begin
+ if Compile_Time_Known_Value (Exp) then
+ return True;
+
+ elsif Is_Entity_Name (Exp) and then Present (Entity (Exp)) then
+ return Is_Constant_Object (Entity (Exp))
+ or else Ekind (Entity (Exp)) = E_Enumeration_Literal;
+
+ elsif Nkind (Exp) in N_Binary_Op then
+ return Is_Constant_Bound (Left_Opnd (Exp))
+ and then Is_Constant_Bound (Right_Opnd (Exp))
+ and then Scope (Entity (Exp)) = Standard_Standard;
+
+ else
+ return False;
+ end if;
+ end Is_Constant_Bound;
+
--------------------------------------
-- Is_Controlling_Limited_Procedure --
--------------------------------------
@@ -8383,9 +8478,8 @@ package body Sem_Util is
begin
if Is_Class_Wide_Type (Typ)
and then
- (Chars (Etype (Typ)) = Name_Forward_Iterator
- or else
- Chars (Etype (Typ)) = Name_Reversible_Iterator)
+ Nam_In (Chars (Etype (Typ)), Name_Forward_Iterator,
+ Name_Reversible_Iterator)
and then
Is_Predefined_File_Name
(Unit_File_Name (Get_Source_Unit (Etype (Typ))))
@@ -8548,9 +8642,7 @@ package body Sem_Util is
-- Attributes 'Input and 'Result produce objects
when N_Attribute_Reference =>
- return Attribute_Name (N) = Name_Input
- or else
- Attribute_Name (N) = Name_Result;
+ return Nam_In (Attribute_Name (N), Name_Input, Name_Result);
when N_Selected_Component =>
return
@@ -9432,6 +9524,69 @@ package body Sem_Util is
and then Get_Name_String (Chars (T)) = "valuetype";
end Is_Value_Type;
+ ----------------------------
+ -- Is_Variable_Size_Array --
+ ----------------------------
+
+ function Is_Variable_Size_Array (E : Entity_Id) return Boolean is
+ Idx : Node_Id;
+
+ begin
+ pragma Assert (Is_Array_Type (E));
+
+ -- Check if some index is initialized with a non-constant value
+
+ Idx := First_Index (E);
+ while Present (Idx) loop
+ if Nkind (Idx) = N_Range then
+ if not Is_Constant_Bound (Low_Bound (Idx))
+ or else not Is_Constant_Bound (High_Bound (Idx))
+ then
+ return True;
+ end if;
+ end if;
+
+ Idx := Next_Index (Idx);
+ end loop;
+
+ return False;
+ end Is_Variable_Size_Array;
+
+ -----------------------------
+ -- Is_Variable_Size_Record --
+ -----------------------------
+
+ function Is_Variable_Size_Record (E : Entity_Id) return Boolean is
+ Comp : Entity_Id;
+ Comp_Typ : Entity_Id;
+
+ begin
+ pragma Assert (Is_Record_Type (E));
+
+ Comp := First_Entity (E);
+ while Present (Comp) loop
+ Comp_Typ := Etype (Comp);
+
+ -- Recursive call if the record type has discriminants
+
+ if Is_Record_Type (Comp_Typ)
+ and then Has_Discriminants (Comp_Typ)
+ and then Is_Variable_Size_Record (Comp_Typ)
+ then
+ return True;
+
+ elsif Is_Array_Type (Comp_Typ)
+ and then Is_Variable_Size_Array (Comp_Typ)
+ then
+ return True;
+ end if;
+
+ Next_Entity (Comp);
+ end loop;
+
+ return False;
+ end Is_Variable_Size_Record;
+
---------------------
-- Is_VMS_Operator --
---------------------
@@ -9445,11 +9600,10 @@ package body Sem_Util is
return Ekind (Op) = E_Function
and then Is_Intrinsic_Subprogram (Op)
and then
- ((Present_System_Aux
- and then Scope (Op) = System_Aux_Id)
- or else
- (True_VMS_Target
- and then Scope (Scope (Op)) = RTU_Entity (System)));
+ ((Present_System_Aux and then Scope (Op) = System_Aux_Id)
+ or else
+ (True_VMS_Target
+ and then Scope (Scope (Op)) = RTU_Entity (System)));
end Is_VMS_Operator;
-----------------
@@ -12009,7 +12163,7 @@ package body Sem_Util is
function Is_Interface_Conversion (N : Node_Id) return Boolean;
-- Determine whether N is a construct of the form
-- Some_Type (Operand._tag'Address)
- -- This construct appears in the context of dispatching calls
+ -- This construct appears in the context of dispatching calls.
function Reference_To (Obj : Node_Id) return Node_Id;
-- An explicit dereference is created when removing side-effects from
@@ -12984,6 +13138,19 @@ package body Sem_Util is
else
Desc := P;
P := Parent (P);
+
+ -- A special Ada 2012 case: the original node may be part
+ -- of the else_actions of a conditional expression, in which
+ -- case it might not have been expanded yet, and appears in
+ -- a non-syntactic list of actions. In that case it is clearly
+ -- not safe to save a value.
+
+ if No (P)
+ and then Is_List_Member (Desc)
+ and then No (Parent (List_Containing (Desc)))
+ then
+ return False;
+ end if;
end if;
end loop;
end;
@@ -13357,9 +13524,10 @@ package body Sem_Util is
-- the entities within it).
if (Is_Implementation_Defined (Val)
- and then not (Ekind_In (Val, E_Package, E_Generic_Package)
- and then Is_Library_Level_Entity (Val)))
- or else Is_Implementation_Defined (Scope (Val))
+ or else
+ Is_Implementation_Defined (Scope (Val)))
+ and then not (Ekind_In (Val, E_Package, E_Generic_Package)
+ and then Is_Library_Level_Entity (Val))
then
Check_Restriction (No_Implementation_Identifiers, N);
end if;
@@ -14359,9 +14527,7 @@ package body Sem_Util is
return False;
elsif not Ekind_In (E, E_Discriminant, E_Component)
- or else (Chars (E) = Name_uTag
- or else
- Chars (E) = Name_uParent)
+ or else Nam_In (Chars (E), Name_uTag, Name_uParent)
then
Next_Entity (E);
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 0a9ff0af8f5..3d252a2c634 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -178,6 +178,17 @@ package Sem_Util is
-- not necessarily mean that CE could be raised, but a response of True
-- means that for sure CE cannot be raised.
+ procedure Check_Dynamically_Tagged_Expression
+ (Expr : Node_Id;
+ Typ : Entity_Id;
+ Related_Nod : Node_Id);
+ -- Check wrong use of dynamically tagged expression
+
+ procedure Check_Fully_Declared (T : Entity_Id; N : Node_Id);
+ -- Verify that the full declaration of type T has been seen. If not, place
+ -- error message on node N. Used in object declarations, type conversions
+ -- and qualified expressions.
+
procedure Check_Function_Writable_Actuals (N : Node_Id);
-- (Ada 2012): If the construct N has two or more direct constituents that
-- are names or expressions whose evaluation may occur in an arbitrary
@@ -210,17 +221,6 @@ package Sem_Util is
-- remains in the Examiner (JB01-005). Note that the Examiner does not
-- count package declarations in later declarative items.
- procedure Check_Dynamically_Tagged_Expression
- (Expr : Node_Id;
- Typ : Entity_Id;
- Related_Nod : Node_Id);
- -- Check wrong use of dynamically tagged expression
-
- procedure Check_Fully_Declared (T : Entity_Id; N : Node_Id);
- -- Verify that the full declaration of type T has been seen. If not, place
- -- error message on node N. Used in object declarations, type conversions
- -- and qualified expressions.
-
procedure Check_Nested_Access (Ent : Entity_Id);
-- Check whether Ent denotes an entity declared in an uplevel scope, which
-- is accessed inside a nested procedure, and set Has_Up_Level_Access flag
@@ -470,7 +470,7 @@ package Sem_Util is
-- discriminant at the same position in this new type.
procedure Find_Overlaid_Entity
- (N : Node_Id;
+ (N : Node_Id;
Ent : out Entity_Id;
Off : out Boolean);
-- The node N should be an address representation clause. Determines if
@@ -582,6 +582,12 @@ package Sem_Util is
-- Returns the true generic entity in an instantiation. If the name in the
-- instantiation is a renaming, the function returns the renamed generic.
+ function Get_Incomplete_View_Of_Ancestor (E : Entity_Id) return Entity_Id;
+ -- Implements the notion introduced ever-so briefly in RM 7.3.1 (5.2/3):
+ -- in a child unit a derived type is within the derivation class of an
+ -- ancestor declared in a parent unit, even if there is an intermediate
+ -- derivation that does not see the full view of that ancestor.
+
procedure Get_Index_Bounds (N : Node_Id; L, H : out Node_Id);
-- This procedure assigns to L and H respectively the values of the low and
-- high bounds of node N, which must be a range, subtype indication, or the
@@ -843,10 +849,19 @@ package Sem_Util is
-- Determines if the given node denotes an atomic object in the sense of
-- the legality checks described in RM C.6(12).
+ function Is_Body_Or_Package_Declaration (N : Node_Id) return Boolean;
+ -- Determine whether node N denotes a body or a package declaration
+
function Is_Bounded_String (T : Entity_Id) return Boolean;
-- True if T is a bounded string type. Used to make sure "=" composes
-- properly for bounded string types.
+ function Is_Constant_Bound (Exp : Node_Id) return Boolean;
+ -- Exp is the expression for an array bound. Determines whether the
+ -- bound is a compile-time known value, or a constant entity, or an
+ -- enumeration literal, or an expression composed of constant-bound
+ -- subexpressions which are evaluated by means of standard operators.
+
function Is_Controlling_Limited_Procedure
(Proc_Nam : Entity_Id) return Boolean;
-- Ada 2005 (AI-345): Determine whether Proc_Nam is a primitive procedure
@@ -1038,6 +1053,12 @@ package Sem_Util is
-- object that is accessed directly, as opposed to the other CIL objects
-- that are accessed through managed pointers.
+ function Is_Variable_Size_Array (E : Entity_Id) return Boolean;
+ -- Returns true if E has variable size components
+
+ function Is_Variable_Size_Record (E : Entity_Id) return Boolean;
+ -- Returns true if E has variable size components
+
function Is_VMS_Operator (Op : Entity_Id) return Boolean;
-- Determine whether an operator is one of the intrinsics defined
-- in the DEC system extension.
@@ -1286,9 +1307,9 @@ package Sem_Util is
-- S2. Otherwise, it is S itself.
function Object_Access_Level (Obj : Node_Id) return Uint;
- -- Return the accessibility level of the view of the object Obj.
- -- For convenience, qualified expressions applied to object names
- -- are also allowed as actuals for this function.
+ -- Return the accessibility level of the view of the object Obj. For
+ -- convenience, qualified expressions applied to object names are also
+ -- allowed as actuals for this function.
function Primitive_Names_Match (E1, E2 : Entity_Id) return Boolean;
-- Returns True if the names of both entities correspond with matching
@@ -1435,7 +1456,8 @@ package Sem_Util is
procedure Set_Entity_With_Style_Check (N : Node_Id; Val : Entity_Id);
-- This procedure has the same calling sequence as Set_Entity, but
-- if Style_Check is set, then it calls a style checking routine which
- -- can check identifier spelling style.
+ -- can check identifier spelling style. This procedure also takes care
+ -- of checking the restriction No_Implementation_Identifiers.
procedure Set_Name_Entity_Id (Id : Name_Id; Val : Entity_Id);
pragma Inline (Set_Name_Entity_Id);
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index be4532e609a..630b635bf23 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -643,6 +643,13 @@ package body Sem_Warn is
else
Expression := Condition (Exit_Stmt);
end if;
+
+ -- If an unconditional exit statement is the last statement in the
+ -- loop, assume that no warning is needed, without any attempt at
+ -- checking whether the exit is reachable.
+
+ elsif Exit_Stmt = Last (Statements (Loop_Statement)) then
+ return;
end if;
Exit_Stmt := Next_Exit_Statement (Exit_Stmt);
@@ -1781,9 +1788,8 @@ package body Sem_Warn is
if Nkind (P) = N_Pragma
and then
- (Pragma_Name (P) = Name_Contract_Case
- or else
- Pragma_Name (P) = Name_Test_Case)
+ Nam_In (Pragma_Name (P), Name_Contract_Case,
+ Name_Test_Case)
and then
Nod = Get_Ensures_From_CTC_Pragma (P)
then
@@ -3219,9 +3225,8 @@ package body Sem_Warn is
-- node, since assert pragmas get rewritten at analysis time.
elsif Nkind (Original_Node (P)) = N_Pragma
- and then (Pragma_Name (Original_Node (P)) = Name_Assert
- or else
- Pragma_Name (Original_Node (P)) = Name_Check)
+ and then Nam_In (Pragma_Name (Original_Node (P)), Name_Assert,
+ Name_Check)
then
return;
end if;
diff --git a/gcc/ada/set_targ.adb b/gcc/ada/set_targ.adb
new file mode 100755
index 00000000000..db08f0d4e7b
--- /dev/null
+++ b/gcc/ada/set_targ.adb
@@ -0,0 +1,839 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S E T _ T A R G --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2013, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+with Debug; use Debug;
+with Get_Targ; use Get_Targ;
+with Opt; use Opt;
+with Output; use Output;
+
+with System; use System;
+with System.OS_Lib; use System.OS_Lib;
+
+with Unchecked_Conversion;
+
+package body Set_Targ is
+
+ --------------------------------------------------------
+ -- Data Used to Read/Write Target Dependent Info File --
+ --------------------------------------------------------
+
+ -- Table of string names written to file
+
+ subtype Str is String;
+
+ S_Bits_BE : constant Str := "Bits_BE";
+ S_Bits_Per_Unit : constant Str := "Bits_Per_Unit";
+ S_Bits_Per_Word : constant Str := "Bits_Per_Word";
+ S_Bytes_BE : constant Str := "Bytes_BE";
+ S_Char_Size : constant Str := "Char_Size";
+ S_Double_Float_Alignment : constant Str := "Double_Float_Alignment";
+ S_Double_Scalar_Alignment : constant Str := "Double_Scalar_Alignment";
+ S_Double_Size : constant Str := "Double_Size";
+ S_Float_Size : constant Str := "Float_Size";
+ S_Float_Words_BE : constant Str := "Float_Words_BE";
+ S_Int_Size : constant Str := "Int_Size";
+ S_Long_Double_Size : constant Str := "Long_Double_Size";
+ S_Long_Long_Size : constant Str := "Long_Long_Size";
+ S_Long_Size : constant Str := "Long_Size";
+ S_Maximum_Alignment : constant Str := "Maximum_Alignment";
+ S_Max_Unaligned_Field : constant Str := "Max_Unaligned_Field";
+ S_Pointer_Size : constant Str := "Pointer_Size";
+ S_Short_Size : constant Str := "Short_Size";
+ S_Strict_Alignment : constant Str := "Strict_Alignment";
+ S_System_Allocator_Alignment : constant Str := "System_Allocator_Alignment";
+ S_Wchar_T_Size : constant Str := "Wchar_T_Size";
+ S_Words_BE : constant Str := "Words_BE";
+
+ -- Table of names
+
+ type AStr is access all String;
+
+ DTN : constant array (Nat range <>) of AStr := (
+ S_Bits_BE 'Unrestricted_Access,
+ S_Bits_Per_Unit 'Unrestricted_Access,
+ S_Bits_Per_Word 'Unrestricted_Access,
+ S_Bytes_BE 'Unrestricted_Access,
+ S_Char_Size 'Unrestricted_Access,
+ S_Double_Float_Alignment 'Unrestricted_Access,
+ S_Double_Scalar_Alignment 'Unrestricted_Access,
+ S_Double_Size 'Unrestricted_Access,
+ S_Float_Size 'Unrestricted_Access,
+ S_Float_Words_BE 'Unrestricted_Access,
+ S_Int_Size 'Unrestricted_Access,
+ S_Long_Double_Size 'Unrestricted_Access,
+ S_Long_Long_Size 'Unrestricted_Access,
+ S_Long_Size 'Unrestricted_Access,
+ S_Maximum_Alignment 'Unrestricted_Access,
+ S_Max_Unaligned_Field 'Unrestricted_Access,
+ S_Pointer_Size 'Unrestricted_Access,
+ S_Short_Size 'Unrestricted_Access,
+ S_Strict_Alignment 'Unrestricted_Access,
+ S_System_Allocator_Alignment 'Unrestricted_Access,
+ S_Wchar_T_Size 'Unrestricted_Access,
+ S_Words_BE 'Unrestricted_Access);
+
+ -- Table of corresponding value pointers
+
+ DTV : constant array (Nat range <>) of System.Address := (
+ Bits_BE 'Address,
+ Bits_Per_Unit 'Address,
+ Bits_Per_Word 'Address,
+ Bytes_BE 'Address,
+ Char_Size 'Address,
+ Double_Float_Alignment 'Address,
+ Double_Scalar_Alignment 'Address,
+ Double_Size 'Address,
+ Float_Size 'Address,
+ Float_Words_BE 'Address,
+ Int_Size 'Address,
+ Long_Double_Size 'Address,
+ Long_Long_Size 'Address,
+ Long_Size 'Address,
+ Maximum_Alignment 'Address,
+ Max_Unaligned_Field 'Address,
+ Pointer_Size 'Address,
+ Short_Size 'Address,
+ Strict_Alignment 'Address,
+ System_Allocator_Alignment 'Address,
+ Wchar_T_Size 'Address,
+ Words_BE 'Address);
+
+ DTR : array (Nat range DTV'Range) of Boolean := (others => False);
+ -- Table of flags used to validate that all values are present in file
+
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
+
+ procedure Fail (E : String);
+ pragma No_Return (Fail);
+ -- Terminate program with fatal error message passed as parameter
+
+ procedure Register_Float_Type
+ (Name : C_String;
+ Digs : Natural;
+ Complex : Boolean;
+ Count : Natural;
+ Float_Rep : Float_Rep_Kind;
+ Size : Positive;
+ Alignment : Natural);
+ pragma Convention (C, Register_Float_Type);
+ -- Call back to allow the back end to register available types. This call
+ -- back makes entries in the FPT_Mode_Table for any floating point types
+ -- reported by the back end. Name is the name of the type as a normal
+ -- format Null-terminated string. Digs is the number of digits, where 0
+ -- means it is not a fpt type (ignored during registration). Complex is
+ -- non-zero if the type has real and imaginary parts (also ignored during
+ -- registration). Count is the number of elements in a vector type (zero =
+ -- not a vector, registration ignores vectors). Float_Rep shows the kind of
+ -- floating-point type, and Size/Alignment are the size/alignment in bits.
+ --
+ -- So to summarize, the only types that are actually registered have Digs
+ -- non-zero, Complex zero (false), and Count zero (not a vector).
+
+ ----------
+ -- Fail --
+ ----------
+
+ procedure Fail (E : String) is
+ E_Fatal : constant := 4;
+ -- Code for fatal error
+ begin
+ Write_Str (E);
+ Write_Eol;
+ OS_Exit (E_Fatal);
+ end Fail;
+
+ -------------------------
+ -- Register_Float_Type --
+ -------------------------
+
+ procedure Register_Float_Type
+ (Name : C_String;
+ Digs : Natural;
+ Complex : Boolean;
+ Count : Natural;
+ Float_Rep : Float_Rep_Kind;
+ Size : Positive;
+ Alignment : Natural)
+ is
+ T : String (1 .. Name'Length);
+ Last : Natural := 0;
+
+ procedure Dump;
+ -- Dump information given by the back end for the type to register
+
+ ----------
+ -- Dump --
+ ----------
+
+ procedure Dump is
+ begin
+ Write_Str ("type " & T (1 .. Last) & " is ");
+
+ if Count > 0 then
+ Write_Str ("array (1 .. ");
+ Write_Int (Int (Count));
+
+ if Complex then
+ Write_Str (", 1 .. 2");
+ end if;
+
+ Write_Str (") of ");
+
+ elsif Complex then
+ Write_Str ("array (1 .. 2) of ");
+ end if;
+
+ if Digs > 0 then
+ Write_Str ("digits ");
+ Write_Int (Int (Digs));
+ Write_Line (";");
+
+ Write_Str ("pragma Float_Representation (");
+
+ case Float_Rep is
+ when IEEE_Binary =>
+ Write_Str ("IEEE");
+
+ when VAX_Native =>
+ case Digs is
+ when 6 =>
+ Write_Str ("VAXF");
+
+ when 9 =>
+ Write_Str ("VAXD");
+
+ when 15 =>
+ Write_Str ("VAXG");
+
+ when others =>
+ Write_Str ("VAX_");
+ Write_Int (Int (Digs));
+ end case;
+
+ when AAMP => Write_Str ("AAMP");
+ end case;
+
+ Write_Line (", " & T (1 .. Last) & ");");
+
+ else
+ Write_Str ("mod 2**");
+ Write_Int (Int (Size / Positive'Max (1, Count)));
+ Write_Line (";");
+ end if;
+
+ Write_Str ("for " & T (1 .. Last) & "'Size use ");
+ Write_Int (Int (Size));
+ Write_Line (";");
+
+ Write_Str ("for " & T (1 .. Last) & "'Alignment use ");
+ Write_Int (Int (Alignment / 8));
+ Write_Line (";");
+ Write_Eol;
+ end Dump;
+
+ -- Start of processing for Register_Float_Type
+
+ begin
+ -- Acquire name
+
+ for J in T'Range loop
+ T (J) := Name (Name'First + J - 1);
+
+ if T (J) = ASCII.NUL then
+ Last := J - 1;
+ exit;
+ end if;
+ end loop;
+
+ -- Dump info if debug flag set
+
+ if Debug_Flag_Dot_B then
+ Dump;
+ end if;
+
+ -- Acquire entry if non-vector non-complex fpt type (digits non-zero)
+
+ if Digs > 0 and then not Complex and then Count = 0 then
+ Num_FPT_Modes := Num_FPT_Modes + 1;
+ FPT_Mode_Table (Num_FPT_Modes) :=
+ (NAME => new String'(T (1 .. Last)),
+ DIGS => Digs,
+ FLOAT_REP => Float_Rep,
+ SIZE => Size,
+ ALIGNMENT => Alignment);
+ end if;
+ end Register_Float_Type;
+
+ -----------------------------------
+ -- Write_Target_Dependent_Values --
+ -----------------------------------
+
+ -- We do this at the System.Os_Lib level, since we have to do the read at
+ -- that level anyway, so it is easier and more consistent to follow the
+ -- same path for the write.
+
+ procedure Write_Target_Dependent_Values is
+ Fdesc : File_Descriptor;
+ OK : Boolean;
+
+ Buffer : String (1 .. 80);
+ Buflen : Natural;
+ -- Buffer used to build line one of file
+
+ type ANat is access all Natural;
+ -- Pointer to Nat or Pos value (it is harmless to treat Pos values and
+ -- Nat values as Natural via Unchecked_Conversion).
+
+ function To_ANat is new Unchecked_Conversion (Address, ANat);
+
+ procedure AddC (C : Character);
+ -- Add one character to buffer
+
+ procedure AddN (N : Natural);
+ -- Add representation of integer N to Buffer, updating Buflen. N
+ -- must be less than 1000, and output is 3 characters with leading
+ -- spaces as needed.
+
+ procedure Write_Line;
+ -- Output contents of Buffer (1 .. Buflen) followed by a New_Line,
+ -- and set Buflen back to zero, ready to write next line.
+
+ ----------
+ -- AddC --
+ ----------
+
+ procedure AddC (C : Character) is
+ begin
+ Buflen := Buflen + 1;
+ Buffer (Buflen) := C;
+ end AddC;
+
+ ----------
+ -- AddN --
+ ----------
+
+ procedure AddN (N : Natural) is
+ begin
+ if N > 999 then
+ raise Program_Error;
+ end if;
+
+ if N > 99 then
+ AddC (Character'Val (48 + N / 100));
+ else
+ AddC (' ');
+ end if;
+
+ if N > 9 then
+ AddC (Character'Val (48 + N / 10 mod 10));
+ else
+ AddC (' ');
+ end if;
+
+ AddC (Character'Val (48 + N mod 10));
+ end AddN;
+
+ ----------------
+ -- Write_Line --
+ ----------------
+
+ procedure Write_Line is
+ begin
+ AddC (ASCII.LF);
+
+ if Buflen /= Write (Fdesc, Buffer'Address, Buflen) then
+ Delete_File (Target_Dependent_Info_Write_Name'Address, OK);
+ Fail ("disk full writing file "
+ & Target_Dependent_Info_Write_Name.all);
+ end if;
+
+ Buflen := 0;
+ end Write_Line;
+
+ -- Start of processing for Write_Target_Dependent_Values
+
+ begin
+ Fdesc :=
+ Create_File (Target_Dependent_Info_Write_Name.all'Address, Text);
+
+ if Fdesc = Invalid_FD then
+ Fail ("cannot create file " & Target_Dependent_Info_Write_Name.all);
+ end if;
+
+ -- Loop through values
+
+ for J in DTN'Range loop
+
+ -- Output name
+
+ Buflen := DTN (J)'Length;
+ Buffer (1 .. Buflen) := DTN (J).all;
+
+ -- Line up values
+
+ while Buflen < 26 loop
+ AddC (' ');
+ end loop;
+
+ AddC (' ');
+ AddC (' ');
+
+ -- Output value and write line
+
+ AddN (To_ANat (DTV (J)).all);
+ Write_Line;
+ end loop;
+
+ -- Blank line to separate sections
+
+ Write_Line;
+
+ -- Write lines for registered FPT types
+
+ for J in 1 .. Num_FPT_Modes loop
+ declare
+ E : FPT_Mode_Entry renames FPT_Mode_Table (J);
+ begin
+ Buflen := E.NAME'Last;
+ Buffer (1 .. Buflen) := E.NAME.all;
+
+ -- Pad out to line up values
+
+ while Buflen < 11 loop
+ AddC (' ');
+ end loop;
+
+ AddC (' ');
+ AddC (' ');
+
+ AddN (E.DIGS);
+ AddC (' ');
+ AddC (' ');
+
+ case E.FLOAT_REP is
+ when IEEE_Binary =>
+ AddC ('I');
+ when VAX_Native =>
+ AddC ('V');
+ when AAMP =>
+ AddC ('A');
+ end case;
+
+ AddC (' ');
+
+ AddN (E.SIZE);
+ AddC (' ');
+
+ AddN (E.ALIGNMENT);
+ Write_Line;
+ end;
+ end loop;
+
+ -- Close file
+
+ Close (Fdesc, OK);
+
+ if not OK then
+ Fail ("disk full writing file "
+ & Target_Dependent_Info_Write_Name.all);
+ end if;
+ end Write_Target_Dependent_Values;
+
+-- Package Initialization, set target dependent values. This must be done
+-- early on, before we start accessing various compiler packages, since
+-- these values are used all over the place.
+
+begin
+ -- First step: see if the -gnateT switch is present. As we have noted,
+ -- this has to be done very early, so can not depend on the normal circuit
+ -- for reading switches and setting switches in Opt. The following code
+ -- will set Opt.Target_Dependent_Info_Read_Name if the switch -gnateT=name
+ -- is present in the options string.
+
+ declare
+ type Arg_Array is array (Nat) of Big_String_Ptr;
+ type Arg_Array_Ptr is access Arg_Array;
+ -- Types to access compiler arguments
+
+ save_argc : Nat;
+ pragma Import (C, save_argc);
+ -- Saved value of argc (number of arguments), imported from misc.c
+
+ save_argv : Arg_Array_Ptr;
+ pragma Import (C, save_argv);
+ -- Saved value of argv (argument pointers), imported from misc.c
+
+ gnat_argc : Nat;
+ gnat_argv : Arg_Array_Ptr;
+ pragma Import (C, gnat_argc);
+ pragma Import (C, gnat_argv);
+ -- If save_argv is not set, default to gnat_argc/argv
+
+ argc : Nat;
+ argv : Arg_Array_Ptr;
+
+ function Len_Arg (Arg : Big_String_Ptr) return Nat;
+ -- Determine length of argument Arg (a nul terminated C string).
+
+ -------------
+ -- Len_Arg --
+ -------------
+
+ function Len_Arg (Arg : Big_String_Ptr) return Nat is
+ begin
+ for J in 1 .. Nat'Last loop
+ if Arg (Natural (J)) = ASCII.NUL then
+ return J - 1;
+ end if;
+ end loop;
+
+ raise Program_Error;
+ end Len_Arg;
+
+ begin
+ if save_argv /= null then
+ argv := save_argv;
+ argc := save_argc;
+ else
+ -- Case of a non gcc compiler, e.g. gnat2why or gnat2scil
+ argv := gnat_argv;
+ argc := gnat_argc;
+ end if;
+
+ -- Loop through arguments looking for -gnateT, also look for -gnatd.b
+
+ for Arg in 1 .. argc - 1 loop
+ declare
+ Argv_Ptr : constant Big_String_Ptr := argv (Arg);
+ Argv_Len : constant Nat := Len_Arg (Argv_Ptr);
+
+ begin
+ if Argv_Len > 8
+ and then Argv_Ptr (1 .. 8) = "-gnateT="
+ then
+ Opt.Target_Dependent_Info_Read_Name :=
+ new String'(Argv_Ptr (9 .. Natural (Argv_Len)));
+
+ elsif Argv_Len >= 8
+ and then Argv_Ptr (1 .. 8) = "-gnatd.b"
+ then
+ Debug_Flag_Dot_B := True;
+ end if;
+ end;
+ end loop;
+ end;
+
+ -- If the switch is not set, we get all values from the back end
+
+ if Opt.Target_Dependent_Info_Read_Name = null then
+
+ -- Set values by direct calls to the back end
+
+ Bits_BE := Get_Bits_BE;
+ Bits_Per_Unit := Get_Bits_Per_Unit;
+ Bits_Per_Word := Get_Bits_Per_Word;
+ Bytes_BE := Get_Bytes_BE;
+ Char_Size := Get_Char_Size;
+ Double_Float_Alignment := Get_Double_Float_Alignment;
+ Double_Scalar_Alignment := Get_Double_Scalar_Alignment;
+ Double_Size := Get_Double_Size;
+ Float_Size := Get_Float_Size;
+ Float_Words_BE := Get_Float_Words_BE;
+ Int_Size := Get_Int_Size;
+ Long_Double_Size := Get_Long_Double_Size;
+ Long_Long_Size := Get_Long_Long_Size;
+ Long_Size := Get_Long_Size;
+ Maximum_Alignment := Get_Maximum_Alignment;
+ Max_Unaligned_Field := Get_Max_Unaligned_Field;
+ Pointer_Size := Get_Pointer_Size;
+ Short_Size := Get_Short_Size;
+ Strict_Alignment := Get_Strict_Alignment;
+ System_Allocator_Alignment := Get_System_Allocator_Alignment;
+ Wchar_T_Size := Get_Wchar_T_Size;
+ Words_BE := Get_Words_BE;
+
+ -- Register floating-point types from the back end
+
+ Register_Back_End_Types (Register_Float_Type'Access);
+
+ -- Case of reading the target dependent values from file
+
+ -- This is bit more complex than might be expected, because it has to be
+ -- done very early. All kinds of packages depend on these values, and we
+ -- can't wait till the normal processing of reading command line switches
+ -- etc to read the file. We do this at the System.OS_Lib level since it is
+ -- too early to be using Osint directly.
+
+ else
+ Read_Target_Dependent_Values : declare
+ File_Desc : File_Descriptor;
+ N : Natural;
+
+ type ANat is access all Natural;
+ -- Pointer to Nat or Pos value (it is harmless to treat Pos values
+ -- as Nat via Unchecked_Conversion).
+
+ function To_ANat is new Unchecked_Conversion (Address, ANat);
+
+ VP : ANat;
+
+ Buffer : String (1 .. 2000);
+ Buflen : Natural;
+ -- File information and length (2000 easily enough!)
+
+ Nam_Buf : String (1 .. 40);
+ Nam_Len : Natural;
+
+ procedure Check_Spaces;
+ -- Checks that we have one or more spaces and skips them
+
+ procedure FailN (S : String);
+ -- Calls Fail adding " name in file xxx", where name is the currently
+ -- gathered name in Nam_Buf, surrounded by quotes, and xxx is the
+ -- name of the file.
+
+ procedure Get_Name;
+ -- Scan out name, leaving it in Nam_Buf with Nam_Len set. Calls
+ -- Skip_Spaces to skip any following spaces. Note that the name is
+ -- terminated by a sequence of at least two spaces.
+
+ function Get_Nat return Natural;
+ -- N on entry points to decimal integer, scan out decimal integer
+ -- and return it, leaving N pointing to following space or LF.
+
+ procedure Skip_Spaces;
+ -- Skip past spaces
+
+ ------------------
+ -- Check_Spaces --
+ ------------------
+
+ procedure Check_Spaces is
+ begin
+ if N > Buflen or else Buffer (N) /= ' ' then
+ FailN ("missing space for");
+ end if;
+
+ Skip_Spaces;
+ return;
+ end Check_Spaces;
+
+ -----------
+ -- FailN --
+ -----------
+
+ procedure FailN (S : String) is
+ begin
+ Fail (S & " """ & Nam_Buf (1 .. Nam_Len) & """ in file "
+ & Target_Dependent_Info_Read_Name.all);
+ end FailN;
+
+ --------------
+ -- Get_Name --
+ --------------
+
+ procedure Get_Name is
+ begin
+ Nam_Len := 0;
+
+ -- Scan out name and put it in Nam_Buf
+
+ loop
+ if N > Buflen or else Buffer (N) = ASCII.LF then
+ FailN ("incorrectly formatted line for");
+ end if;
+
+ -- Name is terminated by two blanks
+
+ exit when N < Buflen and then Buffer (N .. N + 1) = " ";
+
+ Nam_Len := Nam_Len + 1;
+
+ if Nam_Len > Nam_Buf'Last then
+ Fail ("name too long");
+ end if;
+
+ Nam_Buf (Nam_Len) := Buffer (N);
+ N := N + 1;
+ end loop;
+
+ Check_Spaces;
+ end Get_Name;
+
+ -------------
+ -- Get_Nat --
+ -------------
+
+ function Get_Nat return Natural is
+ Result : Natural := 0;
+
+ begin
+ loop
+ if N > Buflen
+ or else Buffer (N) not in '0' .. '9'
+ or else Result > 999
+ then
+ FailN ("bad value for");
+ end if;
+
+ Result := Result * 10 + (Character'Pos (Buffer (N)) - 48);
+ N := N + 1;
+
+ exit when N <= Buflen
+ and then (Buffer (N) = ASCII.LF or else Buffer (N) = ' ');
+ end loop;
+
+ return Result;
+ end Get_Nat;
+
+ -----------------
+ -- Skip_Spaces --
+ -----------------
+
+ procedure Skip_Spaces is
+ begin
+ while N <= Buflen and Buffer (N) = ' ' loop
+ N := N + 1;
+ end loop;
+ end Skip_Spaces;
+
+ -- Start of processing for Read_Target_Dependent_Values
+
+ begin
+ File_Desc := Open_Read (Target_Dependent_Info_Read_Name.all, Text);
+
+ if File_Desc = Invalid_FD then
+ Fail ("cannot read file " & Target_Dependent_Info_Read_Name.all);
+ end if;
+
+ Buflen := Read (File_Desc, Buffer'Address, Buffer'Length);
+
+ if Buflen = Buffer'Length then
+ Fail ("file is too long: " & Target_Dependent_Info_Read_Name.all);
+ end if;
+
+ -- Scan through file for properly formatted entries in first section
+
+ N := 1;
+ while N <= Buflen and then Buffer (N) /= ASCII.LF loop
+ Get_Name;
+
+ -- Validate name and get corresponding value pointer
+
+ VP := null;
+
+ for J in DTN'Range loop
+ if DTN (J).all = Nam_Buf (1 .. Nam_Len) then
+ VP := To_ANat (DTV (J));
+ DTR (J) := True;
+ exit;
+ end if;
+ end loop;
+
+ if VP = null then
+ FailN ("unrecognized name");
+ end if;
+
+ -- Scan out value
+
+ VP.all := Get_Nat;
+
+ if N > Buflen or else Buffer (N) /= ASCII.LF then
+ FailN ("misformatted line for");
+ end if;
+
+ N := N + 1; -- skip LF
+ end loop;
+
+ -- Fall through this loop when all lines in first section read.
+ -- Check that values have been supplied for all entries.
+
+ for J in DTR'Range loop
+ if not DTR (J) then
+ Fail ("missing entry for " & DTN (J).all & " in file "
+ & Target_Dependent_Info_Read_Name.all);
+ end if;
+ end loop;
+
+ -- Now acquire FPT entries
+
+ if N >= Buflen then
+ Fail ("missing entries for FPT modes in file "
+ & Target_Dependent_Info_Read_Name.all);
+ end if;
+
+ if Buffer (N) = ASCII.LF then
+ N := N + 1;
+ else
+ Fail ("missing blank line in file "
+ & Target_Dependent_Info_Read_Name.all);
+ end if;
+
+ Num_FPT_Modes := 0;
+ while N <= Buflen loop
+ Get_Name;
+
+ Num_FPT_Modes := Num_FPT_Modes + 1;
+
+ declare
+ E : FPT_Mode_Entry renames FPT_Mode_Table (Num_FPT_Modes);
+
+ begin
+ E.NAME := new String'(Nam_Buf (1 .. Nam_Len));
+
+ E.DIGS := Get_Nat;
+ Check_Spaces;
+
+ case Buffer (N) is
+ when 'I' =>
+ E.FLOAT_REP := IEEE_Binary;
+ when 'V' =>
+ E.FLOAT_REP := VAX_Native;
+ when 'A' =>
+ E.FLOAT_REP := AAMP;
+ when others =>
+ FailN ("bad float rep field for");
+ end case;
+
+ N := N + 1;
+ Check_Spaces;
+
+ E.SIZE := Get_Nat;
+ Check_Spaces;
+
+ E.ALIGNMENT := Get_Nat;
+
+ if Buffer (N) /= ASCII.LF then
+ FailN ("junk at end of line for");
+ end if;
+
+ N := N + 1;
+ end;
+ end loop;
+ end Read_Target_Dependent_Values;
+ end if;
+end Set_Targ;
diff --git a/gcc/ada/set_targ.ads b/gcc/ada/set_targ.ads
new file mode 100755
index 00000000000..86828817f57
--- /dev/null
+++ b/gcc/ada/set_targ.ads
@@ -0,0 +1,141 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S E T _ T A R G --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2013, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package handles setting target dependent parameters. If the -gnatet
+-- switch is not set, then these values are taken from the back end (via the
+-- routines in Get_Targ, and the enumerate_modes routine in misc.c). If the
+-- switch is set, then the values are read from the target.atp file in the
+-- current directory (usually written with the Write_Target_Dependent_Values
+-- procedure defined in this package).
+
+-- Note that all these values return sizes of C types with corresponding
+-- names. This allows GNAT to define the corresponding Ada types to have
+-- the same representation. There is one exception: the representation
+-- of Wide_Character_Type uses twice the size of a C char, instead of the
+-- size of wchar_t, since this corresponds to expected Ada usage.
+
+with Einfo; use Einfo;
+with Types; use Types;
+
+package Set_Targ is
+
+ -----------------------------
+ -- Target-Dependent Values --
+ -----------------------------
+
+ -- The following is a table of target dependent values. In normal operation
+ -- these values are set by calling the appropriate C backend routines that
+ -- interface to back end routines that determine target characteristics.
+
+ -- If the -gnateT switch is used, then any values that are read from the
+ -- file target.atp in the current directory overwrite values set from the
+ -- back end. This is used by tools other than the compiler, e.g. to do
+ -- semantic analysis of programs that will run on some other target than
+ -- the machine on which the tool is run.
+
+ -- Note: fields marked with a question mark are boolean fields, where a
+ -- value of 0 is False, and a value of 1 is True.
+
+ Bits_BE : Nat; -- Bits stored big-endian?
+ Bits_Per_Unit : Pos; -- Bits in a storage unit
+ Bits_Per_Word : Pos; -- Bits in a word
+ Bytes_BE : Nat; -- Bytes stored big-endian?
+ Char_Size : Pos; -- Standard.Character'Size
+ Double_Float_Alignment : Nat; -- Alignment of double float
+ Double_Scalar_Alignment : Nat; -- Alignment of double length scalar
+ Double_Size : Pos; -- Standard.Long_Float'Size
+ Float_Size : Pos; -- Standard.Float'Size
+ Float_Words_BE : Nat; -- Float words stored big-endian?
+ Int_Size : Pos; -- Standard.Integer'Size
+ Long_Double_Size : Pos; -- Standard.Long_Long_Float'Size
+ Long_Long_Size : Pos; -- Standard.Long_Long_Integer'Size
+ Long_Size : Pos; -- Standard.Long_Integer'Size
+ Maximum_Alignment : Pos; -- Maximum permitted alignment
+ Max_Unaligned_Field : Pos; -- Maximum size for unaligned bit field
+ Pointer_Size : Pos; -- System.Address'Size
+ Short_Size : Pos; -- Standard.Short_Integer'Size
+ Strict_Alignment : Nat; -- Strict alignment?
+ System_Allocator_Alignment : Nat; -- Alignment for malloc calls
+ Wchar_T_Size : Pos; -- Interfaces.C.wchar_t'Size
+ Words_BE : Nat; -- Words stored big-endian?
+
+ -------------------------------------
+ -- Registered Floating-Point Types --
+ -------------------------------------
+
+ -- This table contains the list of modes supported by the back-end as
+ -- provided by the back end routine enumerate_modes in misc.c. Note that
+ -- we only store floating-point modes (see Register_Float_Type).
+
+ type FPT_Mode_Entry is record
+ NAME : String_Ptr; -- Name of mode (no null character at end)
+ DIGS : Natural; -- Digits for floating-point type
+ FLOAT_REP : Float_Rep_Kind; -- Float representation
+ SIZE : Natural; -- Size in bits
+ ALIGNMENT : Natural; -- Alignment in bits
+ end record;
+
+ FPT_Mode_Table : array (1 .. 1000) of FPT_Mode_Entry;
+ Num_FPT_Modes : Natural;
+ -- Table containing the supported modes and number of entries
+
+ -----------------
+ -- Subprograms --
+ -----------------
+
+ procedure Write_Target_Dependent_Values;
+ -- This routine writes the file target.atp in the current directory with
+ -- the values of the global target parameters as listed above, and as set
+ -- by prior calls to Initialize/Read_Target_Dependent_Values. The format
+ -- of the target.atp file is as follows
+ --
+ -- First come the values of the variables defined in this spec:
+ --
+ -- One line per value
+ --
+ -- name value
+ --
+ -- where name is the name of the parameter, spelled out in full,
+ -- and cased as in the above list, and value is an unsigned decimal
+ -- integer. Two or more blanks separates the name from the value.
+ --
+ -- All the variables must be present, in alphabetical order (i.e. the
+ -- same order as the declarations in this spec).
+ --
+ -- Then there is a blank line to separate the two parts of the file. Then
+ -- come the lines showing the floating-point types to be registered.
+ --
+ -- One line per registered mode
+ --
+ -- name digs float_rep size alignment
+ --
+ -- where name is the string name of the type (which can have single
+ -- spaces embedded in the name (e.g. long double). The name is followed
+ -- by at least two blanks. The following fields are as described above
+ -- for a Mode_Entry (where float_rep is I/V/A for IEEE-754-Binary,
+ -- Vax_Native, AAMP), fields are separated by at least one blank, and
+ -- a LF character immediately follows the alignment field.
+
+end Set_Targ;
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 3d5a64434f2..dc7d973867f 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -602,6 +602,14 @@ package body Sinfo is
return Flag14 (N);
end Conversion_OK;
+ function Convert_To_Return_False
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Raise_Expression);
+ return Flag13 (N);
+ end Convert_To_Return_False;
+
function Corresponding_Aspect
(N : Node_Id) return Node_Id is
begin
@@ -1233,6 +1241,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Pragma_Argument_Association
or else NT (N).Nkind = N_Qualified_Expression
+ or else NT (N).Nkind = N_Raise_Expression
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Simple_Return_Statement
or else NT (N).Nkind = N_Type_Conversion
@@ -1631,13 +1640,13 @@ package body Sinfo is
return Flag16 (N);
end Import_Interface_Present;
- function In_Assertion
+ function In_Assertion_Expression
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call);
return Flag4 (N);
- end In_Assertion;
+ end In_Assertion_Expression;
function In_Present
(N : Node_Id) return Boolean is
@@ -1731,6 +1740,15 @@ package body Sinfo is
return Flag16 (N);
end Is_Controlling_Actual;
+ function Is_Disabled
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Aspect_Specification
+ or else NT (N).Nkind = N_Pragma);
+ return Flag15 (N);
+ end Is_Disabled;
+
function Is_Delayed_Aspect
(N : Node_Id) return Boolean is
begin
@@ -1789,6 +1807,15 @@ package body Sinfo is
return Flag4 (N);
end Is_Folded_In_Parser;
+ function Is_Ignored
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Aspect_Specification
+ or else NT (N).Nkind = N_Pragma);
+ return Flag9 (N);
+ end Is_Ignored;
+
function Is_In_Discriminant_Check
(N : Node_Id) return Boolean is
begin
@@ -2130,6 +2157,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Procedure_Instantiation
+ or else NT (N).Nkind = N_Raise_Expression
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Requeue_Statement
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
@@ -3683,6 +3711,14 @@ package body Sinfo is
Set_Flag14 (N, Val);
end Set_Conversion_OK;
+ procedure Set_Convert_To_Return_False
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Raise_Expression);
+ Set_Flag13 (N, Val);
+ end Set_Convert_To_Return_False;
+
procedure Set_Corresponding_Aspect
(N : Node_Id; Val : Node_Id) is
begin
@@ -4305,6 +4341,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Pragma_Argument_Association
or else NT (N).Nkind = N_Qualified_Expression
+ or else NT (N).Nkind = N_Raise_Expression
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Simple_Return_Statement
or else NT (N).Nkind = N_Type_Conversion
@@ -4703,13 +4740,13 @@ package body Sinfo is
Set_Flag16 (N, Val);
end Set_Import_Interface_Present;
- procedure Set_In_Assertion
+ procedure Set_In_Assertion_Expression
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call);
Set_Flag4 (N, Val);
- end Set_In_Assertion;
+ end Set_In_Assertion_Expression;
procedure Set_In_Present
(N : Node_Id; Val : Boolean := True) is
@@ -4813,6 +4850,15 @@ package body Sinfo is
Set_Flag14 (N, Val);
end Set_Is_Delayed_Aspect;
+ procedure Set_Is_Disabled
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Aspect_Specification
+ or else NT (N).Nkind = N_Pragma);
+ Set_Flag15 (N, Val);
+ end Set_Is_Disabled;
+
procedure Set_Is_Dynamic_Coextension
(N : Node_Id; Val : Boolean := True) is
begin
@@ -4861,6 +4907,15 @@ package body Sinfo is
Set_Flag4 (N, Val);
end Set_Is_Folded_In_Parser;
+ procedure Set_Is_Ignored
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Aspect_Specification
+ or else NT (N).Nkind = N_Pragma);
+ Set_Flag9 (N, Val);
+ end Set_Is_Ignored;
+
procedure Set_Is_In_Discriminant_Check
(N : Node_Id; Val : Boolean := True) is
begin
@@ -5202,6 +5257,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Procedure_Instantiation
+ or else NT (N).Nkind = N_Raise_Expression
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Requeue_Statement
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 20fb08c4071..49188c7d3ad 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -720,6 +720,12 @@ package Sinfo is
-- direct conversion of the underlying integer result, with no regard to
-- the small operand.
+ -- Convert_To_Return_False (Flag13-Sem)
+ -- Present in N_Raise_Expression nodes that appear in the body of the
+ -- special predicateM function used to test a predicate in the context
+ -- of a membership test, where raise expression results in returning a
+ -- value of False rather than raising an exception.
+
-- Corresponding_Aspect (Node3-Sem)
-- Present in N_Pragma node. Used to point back to the source aspect from
-- the corresponding pragma. This field is Empty for source pragmas.
@@ -801,7 +807,10 @@ package Sinfo is
-- This flag is set on N_Selected_Component nodes to indicate that a
-- discriminant check is required using the discriminant check routine
-- associated with the selector. The actual check is generated by the
- -- expander when processing selected components.
+ -- expander when processing selected components. In the case of
+ -- Unchecked_Union, the flag is also set, but no discriminant check
+ -- routine is associated with the selector, and the expander does not
+ -- generate a check.
-- Do_Division_Check (Flag13-Sem)
-- This flag is set on a division operator (/ mod rem) to indicate
@@ -1218,7 +1227,7 @@ package Sinfo is
-- pragma of the other kind is also present. This is used to avoid
-- generating some unwanted error messages.
- -- In_Assertion (Flag4-Sem)
+ -- In_Assertion_Expression (Flag4-Sem)
-- This flag is present in N_Function_Call nodes. It is set if the
-- function is called from within an assertion expression. This is
-- used to avoid some bogus warnings about early elaboration.
@@ -1277,6 +1286,14 @@ package Sinfo is
-- a dispatching call. It is off in all other cases. See Sem_Disp for
-- details of its use.
+ -- Is_Disabled (Flag15-Sem)
+ -- A flag set in an N_Aspect_Specification or N_Pragma node if there was
+ -- a Check_Policy or Assertion_Policy (or in the case of a Debug_Pragma)
+ -- a Debug_Policy pragma that resulted in totally disabling the flagged
+ -- aspect or policy as a result of using the GNAT-defined policy DISABLE.
+ -- If this flag is set, the aspect or policy is not analyzed for semantic
+ -- correctness, so any expressions etc will not be marked as analyzed.
+
-- Is_Dynamic_Coextension (Flag18-Sem)
-- Present in allocator nodes, to indicate that this is an allocator
-- for an access discriminant of a dynamically allocated object. The
@@ -1299,6 +1316,20 @@ package Sinfo is
-- objects. The wrapper prevents interference between exception handlers
-- and At_End handlers.
+ -- Is_Ignored (Flag9-Sem)
+ -- A flag set in an N_Aspect_Specification or N_Pragma node if there was
+ -- a Check_Policy or Assertion_Policy (or in the case of a Debug_Pragma)
+ -- a Debug_Policy pragma that specified a policy of IGNORE, DISABLE, or
+ -- OFF, for the pragma/aspect. If there was a Policy pragma specifying
+ -- a Policy of ON or CHECK, then this flag is reset. If no Policy pragma
+ -- gives a policy for the aspect or pragma, then there are two cases. For
+ -- an assertion aspect or pragma (one of the assertion kinds allowed in
+ -- an Assertion_Policy pragma), then Is_Ignored is set if assertions are
+ -- ignored because of the use of a -gnata switch. For any other aspects
+ -- or pragmas, the flag is off. If this flag is set, the aspect/pragma
+ -- is fully analyzed and checked for other syntactic/semantic errors,
+ -- but it does not have any semantic effect.
+
-- Is_In_Discriminant_Check (Flag11-Sem)
-- This flag is present in a selected component, and is used to indicate
-- that the reference occurs within a discriminant check. The
@@ -2076,11 +2107,13 @@ package Sinfo is
-- Corresponding_Aspect (Node3-Sem) (set to Empty if not present)
-- Pragma_Identifier (Node4)
-- Next_Rep_Item (Node5-Sem)
+ -- Class_Present (Flag6) set if from Aspect with 'Class
-- From_Aspect_Specification (Flag13-Sem)
-- Is_Delayed_Aspect (Flag14-Sem)
+ -- Is_Disabled (Flag15-Sem)
+ -- Is_Ignored (Flag9-Sem)
-- Import_Interface_Present (Flag16-Sem)
-- Split_PPC (Flag17) set if corresponding aspect had Split_PPC set
- -- Class_Present (Flag6) set if from Aspect with 'Class
-- Note: we should have a section on what pragmas are passed on to
-- the back end to be processed. This section should note that pragma
@@ -2103,6 +2136,27 @@ package Sinfo is
-- [pragma_argument_IDENTIFIER =>] NAME
-- | [pragma_argument_IDENTIFIER =>] EXPRESSION
+ -- In Ada 2012, there are two more possibilities:
+
+ -- PRAGMA_ARGUMENT_ASSOCIATION ::=
+ -- [pragma_argument_ASPECT_MARK =>] NAME
+ -- | [pragma_argument_ASPECT_MARK =>] EXPRESSION
+
+ -- where the interesting allowed cases (which do not fit the syntax of
+ -- the first alternative above) are
+
+ -- ASPECT_MARK => Pre'Class | Post'Class | Type_Invariant'Class
+
+ -- We allow this special usage in all Ada modes, but it would be a
+ -- pain to allow these aspects to pervade the pragma syntax, and the
+ -- representation of pragma nodes internally. So what we do is to
+ -- replace these ASPECT_MARK forms with identifiers whose name is one
+ -- of the special internal names _Pre, _Post or _Type_Invariant.
+
+ -- We do a similar replacement of these Aspect_Mark forms in the
+ -- Expression of a pragma argument association for the cases of
+ -- the first arguments of any Check pragmas and Check_Policy pragmas
+
-- N_Pragma_Argument_Association
-- Sloc points to first token in association
-- Chars (Name1) (set to No_Name if no pragma argument identifier)
@@ -3545,6 +3599,7 @@ package Sinfo is
-- RELATION ::=
-- SIMPLE_EXPRESSION [not] in MEMBERSHIP_CHOICE_LIST
+ -- | RAISE_EXPRESSION
-- MEMBERSHIP_CHOICE_LIST ::=
-- MEMBERSHIP_CHOICE {'|' MEMBERSHIP CHOICE}
@@ -4762,7 +4817,7 @@ package Sinfo is
-- actual parameter part)
-- First_Named_Actual (Node4-Sem)
-- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
- -- In_Assertion (Flag4-Sem)
+ -- In_Assertion_Expression (Flag4-Sem)
-- Is_Expanded_Build_In_Place_Call (Flag11-Sem)
-- Do_Tag_Check (Flag13-Sem)
-- No_Elaboration_Check (Flag14-Sem)
@@ -6119,7 +6174,8 @@ package Sinfo is
-- In Ada 2005, we have
- -- RAISE_STATEMENT ::= raise; | raise exception_NAME [with EXPRESSION];
+ -- RAISE_STATEMENT ::=
+ -- raise; | raise exception_NAME [with string_EXPRESSION];
-- N_Raise_Statement
-- Sloc points to RAISE
@@ -6127,6 +6183,19 @@ package Sinfo is
-- Expression (Node3) (set to Empty if no expression present)
-- From_At_End (Flag4-Sem)
+ ----------------------------
+ -- 11.3 Raise Expression --
+ ----------------------------
+
+ -- RAISE_EXPRESSION ::= raise exception_NAME [with string_EXPRESSION]
+
+ -- N_Raise_Expression
+ -- Sloc points to RAISE
+ -- Name (Node2) (always present)
+ -- Expression (Node3) (set to Empty if no expression present)
+ -- Convert_To_Return_False (Flag13-Sem)
+ -- plus fields for expression
+
-------------------------------
-- 12.1 Generic Declaration --
-------------------------------
@@ -6688,6 +6757,8 @@ package Sinfo is
-- Split_PPC (Flag17) Set if split pre/post attribute
-- Is_Boolean_Aspect (Flag16-Sem)
-- Is_Delayed_Aspect (Flag14-Sem)
+ -- Is_Disabled (Flag15-Sem)
+ -- Is_Ignored (Flag9-Sem)
-- Note: Aspect_Specification is an Ada 2012 feature
@@ -7050,7 +7121,11 @@ package Sinfo is
-- N_Expression_With_Actions has type Standard_Void_Type. However some
-- backends do not support such expression-with-actions occurring
-- outside of a proper (non-void) expression, so this should just be
- -- used as an intermediate representation within the front-end.
+ -- used as an intermediate representation within the front-end. Also
+ -- note that this is really an irregularity (expressions and statements
+ -- are not interchangeable, and in particular an N_Null_Statement is
+ -- not a proper expression), and in the long term all cases of this
+ -- idiom should instead use a new node kind N_Compound_Statement.
--------------------
-- Free Statement --
@@ -7664,6 +7739,7 @@ package Sinfo is
N_Allocator,
N_Case_Expression,
N_Extension_Aggregate,
+ N_Raise_Expression,
N_Range,
N_Real_Literal,
N_Reference,
@@ -8284,6 +8360,9 @@ package Sinfo is
function Conversion_OK
(N : Node_Id) return Boolean; -- Flag14
+ function Convert_To_Return_False
+ (N : Node_Id) return Boolean; -- Flag13
+
function Corresponding_Aspect
(N : Node_Id) return Node_Id; -- Node3
@@ -8596,7 +8675,7 @@ package Sinfo is
function Import_Interface_Present
(N : Node_Id) return Boolean; -- Flag16
- function In_Assertion
+ function In_Assertion_Expression
(N : Node_Id) return Boolean; -- Flag4
function In_Present
@@ -8635,6 +8714,9 @@ package Sinfo is
function Is_Delayed_Aspect
(N : Node_Id) return Boolean; -- Flag14
+ function Is_Disabled
+ (N : Node_Id) return Boolean; -- Flag15
+
function Is_Dynamic_Coextension
(N : Node_Id) return Boolean; -- Flag18
@@ -8653,6 +8735,9 @@ package Sinfo is
function Is_Folded_In_Parser
(N : Node_Id) return Boolean; -- Flag4
+ function Is_Ignored
+ (N : Node_Id) return Boolean; -- Flag9
+
function Is_In_Discriminant_Check
(N : Node_Id) return Boolean; -- Flag11
@@ -9265,6 +9350,9 @@ package Sinfo is
procedure Set_Conversion_OK
(N : Node_Id; Val : Boolean := True); -- Flag14
+ procedure Set_Convert_To_Return_False
+ (N : Node_Id; Val : Boolean := True); -- Flag13
+
procedure Set_Corresponding_Aspect
(N : Node_Id; Val : Node_Id); -- Node3
@@ -9574,7 +9662,7 @@ package Sinfo is
procedure Set_Import_Interface_Present
(N : Node_Id; Val : Boolean := True); -- Flag16
- procedure Set_In_Assertion
+ procedure Set_In_Assertion_Expression
(N : Node_Id; Val : Boolean := True); -- Flag4
procedure Set_In_Present
@@ -9613,6 +9701,12 @@ package Sinfo is
procedure Set_Is_Delayed_Aspect
(N : Node_Id; Val : Boolean := True); -- Flag14
+ procedure Set_Is_Disabled
+ (N : Node_Id; Val : Boolean := True); -- Flag15
+
+ procedure Set_Is_Ignored
+ (N : Node_Id; Val : Boolean := True); -- Flag9
+
procedure Set_Is_Dynamic_Coextension
(N : Node_Id; Val : Boolean := True); -- Flag18
@@ -11348,6 +11442,13 @@ package Sinfo is
4 => False, -- unused
5 => False), -- unused
+ N_Raise_Expression =>
+ (1 => False, -- unused
+ 2 => True, -- Name (Node2)
+ 3 => True, -- Expression (Node3)
+ 4 => False, -- unused
+ 5 => False), -- Etype (Node5-Sem)
+
N_Generic_Subprogram_Declaration =>
(1 => True, -- Specification (Node1)
2 => True, -- Generic_Formal_Declarations (List2)
@@ -11858,6 +11959,7 @@ package Sinfo is
pragma Inline (Context_Items);
pragma Inline (Context_Pending);
pragma Inline (Controlling_Argument);
+ pragma Inline (Convert_To_Return_False);
pragma Inline (Conversion_OK);
pragma Inline (Corresponding_Aspect);
pragma Inline (Corresponding_Body);
@@ -11964,7 +12066,7 @@ package Sinfo is
pragma Inline (Interface_Present);
pragma Inline (Includes_Infinities);
pragma Inline (Import_Interface_Present);
- pragma Inline (In_Assertion);
+ pragma Inline (In_Assertion_Expression);
pragma Inline (In_Present);
pragma Inline (Inherited_Discriminant);
pragma Inline (Instance_Spec);
@@ -11977,12 +12079,14 @@ package Sinfo is
pragma Inline (Is_Component_Right_Opnd);
pragma Inline (Is_Controlling_Actual);
pragma Inline (Is_Delayed_Aspect);
+ pragma Inline (Is_Disabled);
pragma Inline (Is_Dynamic_Coextension);
pragma Inline (Is_Elsif);
pragma Inline (Is_Entry_Barrier_Function);
pragma Inline (Is_Expanded_Build_In_Place_Call);
pragma Inline (Is_Finalization_Wrapper);
pragma Inline (Is_Folded_In_Parser);
+ pragma Inline (Is_Ignored);
pragma Inline (Is_In_Discriminant_Check);
pragma Inline (Is_Machine_Number);
pragma Inline (Is_Null_Loop);
@@ -12143,20 +12247,20 @@ package Sinfo is
pragma Inline (Set_All_Present);
pragma Inline (Set_Alternatives);
pragma Inline (Set_Ancestor_Part);
- pragma Inline (Set_Atomic_Sync_Required);
pragma Inline (Set_Array_Aggregate);
pragma Inline (Set_Aspect_Rep_Item);
pragma Inline (Set_Assignment_OK);
pragma Inline (Set_Associated_Node);
pragma Inline (Set_At_End_Proc);
+ pragma Inline (Set_Atomic_Sync_Required);
pragma Inline (Set_Attribute_Name);
pragma Inline (Set_Aux_Decls_Node);
pragma Inline (Set_Backwards_OK);
pragma Inline (Set_Bad_Is_Detected);
- pragma Inline (Set_Body_To_Inline);
pragma Inline (Set_Body_Required);
- pragma Inline (Set_By_Ref);
+ pragma Inline (Set_Body_To_Inline);
pragma Inline (Set_Box_Present);
+ pragma Inline (Set_By_Ref);
pragma Inline (Set_Char_Literal_Value);
pragma Inline (Set_Chars);
pragma Inline (Set_Check_Address_Alignment);
@@ -12183,6 +12287,7 @@ package Sinfo is
pragma Inline (Set_Context_Pending);
pragma Inline (Set_Controlling_Argument);
pragma Inline (Set_Conversion_OK);
+ pragma Inline (Set_Convert_To_Return_False);
pragma Inline (Set_Corresponding_Aspect);
pragma Inline (Set_Corresponding_Body);
pragma Inline (Set_Corresponding_Formal_Spec);
@@ -12193,8 +12298,8 @@ package Sinfo is
pragma Inline (Set_Dcheck_Function);
pragma Inline (Set_Declarations);
pragma Inline (Set_Default_Expression);
- pragma Inline (Set_Default_Storage_Pool);
pragma Inline (Set_Default_Name);
+ pragma Inline (Set_Default_Storage_Pool);
pragma Inline (Set_Defining_Identifier);
pragma Inline (Set_Defining_Unit_Name);
pragma Inline (Set_Delay_Alternative);
@@ -12210,16 +12315,16 @@ package Sinfo is
pragma Inline (Set_Discriminant_Type);
pragma Inline (Set_Do_Accessibility_Check);
pragma Inline (Set_Do_Discriminant_Check);
- pragma Inline (Set_Do_Length_Check);
pragma Inline (Set_Do_Division_Check);
+ pragma Inline (Set_Do_Length_Check);
pragma Inline (Set_Do_Overflow_Check);
pragma Inline (Set_Do_Range_Check);
pragma Inline (Set_Do_Storage_Check);
pragma Inline (Set_Do_Tag_Check);
- pragma Inline (Set_Elaborate_Present);
pragma Inline (Set_Elaborate_All_Desirable);
pragma Inline (Set_Elaborate_All_Present);
pragma Inline (Set_Elaborate_Desirable);
+ pragma Inline (Set_Elaborate_Present);
pragma Inline (Set_Elaboration_Boolean);
pragma Inline (Set_Else_Actions);
pragma Inline (Set_Else_Statements);
@@ -12266,13 +12371,14 @@ package Sinfo is
pragma Inline (Set_Has_Created_Identifier);
pragma Inline (Set_Has_Dereference_Action);
pragma Inline (Set_Has_Dynamic_Length_Check);
+ pragma Inline (Set_Has_Dynamic_Range_Check);
pragma Inline (Set_Has_Init_Expression);
pragma Inline (Set_Has_Local_Raise);
- pragma Inline (Set_Has_Dynamic_Range_Check);
pragma Inline (Set_Has_No_Elaboration_Code);
pragma Inline (Set_Has_Pragma_Suppress_All);
pragma Inline (Set_Has_Private_View);
pragma Inline (Set_Has_Relative_Deadline_Pragma);
+ pragma Inline (Set_Has_Self_Reference);
pragma Inline (Set_Has_Storage_Size_Pragma);
pragma Inline (Set_Has_Wide_Character);
pragma Inline (Set_Has_Wide_Wide_Character);
@@ -12281,16 +12387,15 @@ package Sinfo is
pragma Inline (Set_High_Bound);
pragma Inline (Set_Identifier);
pragma Inline (Set_Implicit_With);
- pragma Inline (Set_Includes_Infinities);
- pragma Inline (Set_Interface_List);
- pragma Inline (Set_Interface_Present);
pragma Inline (Set_Import_Interface_Present);
- pragma Inline (Set_In_Assertion);
+ pragma Inline (Set_In_Assertion_Expression);
pragma Inline (Set_In_Present);
+ pragma Inline (Set_Includes_Infinities);
pragma Inline (Set_Inherited_Discriminant);
pragma Inline (Set_Instance_Spec);
+ pragma Inline (Set_Interface_List);
+ pragma Inline (Set_Interface_Present);
pragma Inline (Set_Intval);
- pragma Inline (Set_Iterator_Specification);
pragma Inline (Set_Is_Accessibility_Actual);
pragma Inline (Set_Is_Asynchronous_Call_Block);
pragma Inline (Set_Is_Boolean_Aspect);
@@ -12298,12 +12403,14 @@ package Sinfo is
pragma Inline (Set_Is_Component_Right_Opnd);
pragma Inline (Set_Is_Controlling_Actual);
pragma Inline (Set_Is_Delayed_Aspect);
+ pragma Inline (Set_Is_Disabled);
pragma Inline (Set_Is_Dynamic_Coextension);
pragma Inline (Set_Is_Elsif);
pragma Inline (Set_Is_Entry_Barrier_Function);
pragma Inline (Set_Is_Expanded_Build_In_Place_Call);
pragma Inline (Set_Is_Finalization_Wrapper);
pragma Inline (Set_Is_Folded_In_Parser);
+ pragma Inline (Set_Is_Ignored);
pragma Inline (Set_Is_In_Discriminant_Check);
pragma Inline (Set_Is_Machine_Number);
pragma Inline (Set_Is_Null_Loop);
@@ -12311,22 +12418,22 @@ package Sinfo is
pragma Inline (Set_Is_Power_Of_2_For_Shift);
pragma Inline (Set_Is_Prefixed_Call);
pragma Inline (Set_Is_Protected_Subprogram_Body);
- pragma Inline (Set_Has_Self_Reference);
pragma Inline (Set_Is_Static_Coextension);
pragma Inline (Set_Is_Static_Expression);
pragma Inline (Set_Is_Subprogram_Descriptor);
pragma Inline (Set_Is_Task_Allocation_Block);
pragma Inline (Set_Is_Task_Master);
pragma Inline (Set_Iteration_Scheme);
+ pragma Inline (Set_Iterator_Specification);
pragma Inline (Set_Itype);
pragma Inline (Set_Kill_Range_Check);
+ pragma Inline (Set_Label_Construct);
pragma Inline (Set_Last_Bit);
pragma Inline (Set_Last_Name);
- pragma Inline (Set_Library_Unit);
- pragma Inline (Set_Label_Construct);
pragma Inline (Set_Left_Opnd);
- pragma Inline (Set_Limited_View_Installed);
+ pragma Inline (Set_Library_Unit);
pragma Inline (Set_Limited_Present);
+ pragma Inline (Set_Limited_View_Installed);
pragma Inline (Set_Literals);
pragma Inline (Set_Local_Raise_Not_OK);
pragma Inline (Set_Local_Raise_Statements);
@@ -12354,9 +12461,9 @@ package Sinfo is
pragma Inline (Set_No_Initialization);
pragma Inline (Set_No_Minimize_Eliminate);
pragma Inline (Set_No_Truncation);
- pragma Inline (Set_Null_Present);
pragma Inline (Set_Null_Exclusion_Present);
pragma Inline (Set_Null_Exclusion_In_Return_Present);
+ pragma Inline (Set_Null_Present);
pragma Inline (Set_Null_Record_Present);
pragma Inline (Set_Object_Definition);
pragma Inline (Set_Of_Present);
@@ -12365,8 +12472,8 @@ package Sinfo is
pragma Inline (Set_Others_Discrete_Choices);
pragma Inline (Set_Out_Present);
pragma Inline (Set_Parameter_Associations);
- pragma Inline (Set_Parameter_Specifications);
pragma Inline (Set_Parameter_List_Truncated);
+ pragma Inline (Set_Parameter_Specifications);
pragma Inline (Set_Parameter_Type);
pragma Inline (Set_Parent_Spec);
pragma Inline (Set_Position);
@@ -12409,38 +12516,38 @@ package Sinfo is
pragma Inline (Set_Selector_Names);
pragma Inline (Set_Shift_Count_OK);
pragma Inline (Set_Source_Type);
- pragma Inline (Set_Spec_PPC_List);
pragma Inline (Set_Spec_CTC_List);
+ pragma Inline (Set_Spec_PPC_List);
pragma Inline (Set_Specification);
pragma Inline (Set_Split_PPC);
pragma Inline (Set_Statements);
pragma Inline (Set_Storage_Pool);
- pragma Inline (Set_Subpool_Handle_Name);
pragma Inline (Set_Strval);
+ pragma Inline (Set_Subpool_Handle_Name);
pragma Inline (Set_Subtype_Indication);
pragma Inline (Set_Subtype_Mark);
pragma Inline (Set_Subtype_Marks);
pragma Inline (Set_Suppress_Assignment_Checks);
pragma Inline (Set_Suppress_Loop_Warnings);
pragma Inline (Set_Synchronized_Present);
+ pragma Inline (Set_TSS_Elist);
pragma Inline (Set_Tagged_Present);
pragma Inline (Set_Target_Type);
pragma Inline (Set_Task_Definition);
pragma Inline (Set_Task_Present);
pragma Inline (Set_Then_Actions);
pragma Inline (Set_Then_Statements);
+ pragma Inline (Set_Treat_Fixed_As_Integer);
pragma Inline (Set_Triggering_Alternative);
pragma Inline (Set_Triggering_Statement);
- pragma Inline (Set_Treat_Fixed_As_Integer);
- pragma Inline (Set_TSS_Elist);
pragma Inline (Set_Type_Definition);
pragma Inline (Set_Unit);
pragma Inline (Set_Unknown_Discriminants_Present);
pragma Inline (Set_Unreferenced_In_Spec);
+ pragma Inline (Set_Used_Operations);
pragma Inline (Set_Variant_Part);
pragma Inline (Set_Variants);
pragma Inline (Set_Visible_Declarations);
- pragma Inline (Set_Used_Operations);
pragma Inline (Set_Was_Originally_Stub);
pragma Inline (Set_Withed_Body);
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 5e5d1a2743c..43e902f2e17 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -165,9 +165,12 @@ package Snames is
Name_uFinalizer : constant Name_Id := N + $;
Name_uIdepth : constant Name_Id := N + $;
Name_uInit : constant Name_Id := N + $;
+ Name_uInvariant : constant Name_Id := N + $;
Name_uMaster : constant Name_Id := N + $;
Name_uObject : constant Name_Id := N + $;
+ Name_uPost : constant Name_Id := N + $;
Name_uPostconditions : constant Name_Id := N + $;
+ Name_uPre : constant Name_Id := N + $;
Name_uPriority : constant Name_Id := N + $;
Name_uProcess_ATSD : constant Name_Id := N + $;
Name_uRelative_Deadline : constant Name_Id := N + $;
@@ -182,6 +185,7 @@ package Snames is
Name_uTask_Info : constant Name_Id := N + $;
Name_uTask_Name : constant Name_Id := N + $;
Name_uTrace_Sp : constant Name_Id := N + $;
+ Name_uType_Invariant : constant Name_Id := N + $;
-- Names of predefined primitives used in the expansion of dispatching
-- requeue and select statements, Abort, 'Callable and 'Terminated.
@@ -485,6 +489,7 @@ package Snames is
-- pragma.
Name_Debug : constant Name_Id := N + $; -- GNAT
+ Name_Depends : constant Name_Id := N + $; -- GNAT
Name_Elaborate : constant Name_Id := N + $; -- Ada 83
Name_Elaborate_All : constant Name_Id := N + $;
Name_Elaborate_Body : constant Name_Id := N + $;
@@ -497,6 +502,7 @@ package Snames is
Name_Export_Valued_Procedure : constant Name_Id := N + $; -- GNAT
Name_External : constant Name_Id := N + $; -- GNAT
Name_Finalize_Storage_Only : constant Name_Id := N + $; -- GNAT
+ Name_Ghost : constant Name_Id := N + $; -- GNAT
Name_Global : constant Name_Id := N + $; -- GNAT
Name_Ident : constant Name_Id := N + $; -- VMS
Name_Implementation_Defined : constant Name_Id := N + $; -- GNAT
@@ -720,6 +726,8 @@ package Snames is
Name_Name : constant Name_Id := N + $;
Name_NCA : constant Name_Id := N + $;
Name_No : constant Name_Id := N + $;
+ Name_No_Access_Parameter_Allocators : constant Name_Id := N + $;
+ Name_No_Coextensions : constant Name_Id := N + $;
Name_No_Dependence : constant Name_Id := N + $;
Name_No_Dynamic_Attachment : constant Name_Id := N + $;
Name_No_Dynamic_Interrupts : constant Name_Id := N + $;
@@ -727,8 +735,11 @@ package Snames is
Name_No_Requeue : constant Name_Id := N + $;
Name_No_Requeue_Statements : constant Name_Id := N + $;
Name_No_Specification_Of_Aspect : constant Name_Id := N + $;
+ Name_No_Standard_Allocators_After_Elaboration : constant Name_Id := N + $;
Name_No_Task_Attributes : constant Name_Id := N + $;
Name_No_Task_Attributes_Package : constant Name_Id := N + $;
+ Name_No_Use_Of_Attribute : constant Name_Id := N + $;
+ Name_No_Use_Of_Pragma : constant Name_Id := N + $;
Name_No_Unroll : constant Name_Id := N + $;
Name_No_Vector : constant Name_Id := N + $;
Name_Nominal : constant Name_Id := N + $;
@@ -1204,7 +1215,6 @@ package Snames is
Name_Archive_Suffix : constant Name_Id := N + $;
Name_Binder : constant Name_Id := N + $;
Name_Body_Suffix : constant Name_Id := N + $;
- Name_Build_Slaves : constant Name_Id := N + $;
Name_Builder : constant Name_Id := N + $;
Name_Clean : constant Name_Id := N + $;
Name_Compiler : constant Name_Id := N + $;
@@ -1774,6 +1784,7 @@ package Snames is
Pragma_CPP_Virtual,
Pragma_CPP_Vtable,
Pragma_Debug,
+ Pragma_Depends,
Pragma_Elaborate,
Pragma_Elaborate_All,
Pragma_Elaborate_Body,
@@ -1786,6 +1797,7 @@ package Snames is
Pragma_Export_Valued_Procedure,
Pragma_External,
Pragma_Finalize_Storage_Only,
+ Pragma_Ghost,
Pragma_Global,
Pragma_Ident,
Pragma_Implementation_Defined,
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 27173504aed..5185c1527aa 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -1993,6 +1993,7 @@ package body Sprint is
if not Has_Parens then
Write_Char ('(');
end if;
+
Write_Str_With_Col_Check_Sloc ("if ");
Sprint_Node (Condition);
Write_Str_With_Col_Check (" then ");
@@ -2763,6 +2764,32 @@ package body Sprint is
Write_Str (" => ");
Sprint_Node (Condition (Node));
+ when N_Raise_Expression =>
+ declare
+ Has_Parens : constant Boolean := Paren_Count (Node) > 0;
+
+ begin
+ -- The syntax for raise_expression does not include parentheses
+ -- but sometimes parentheses are required, so unconditionally
+ -- generate them here unless already present.
+
+ if not Has_Parens then
+ Write_Char ('(');
+ end if;
+
+ Write_Str_With_Col_Check_Sloc ("raise ");
+ Sprint_Node (Name (Node));
+
+ if Present (Expression (Node)) then
+ Write_Str_With_Col_Check (" with ");
+ Sprint_Node (Expression (Node));
+ end if;
+
+ if not Has_Parens then
+ Write_Char (')');
+ end if;
+ end;
+
when N_Raise_Constraint_Error =>
-- This node can be used either as a subexpression or as a
diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads
index 16f388d5fe6..33a184ccfbc 100644
--- a/gcc/ada/stand.ads
+++ b/gcc/ada/stand.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -362,10 +362,23 @@ package Stand is
-- identifier references to prevent cascaded errors.
Any_Type : Entity_Id;
- -- Used to represent some unknown type. Plays an important role in
- -- avoiding cascaded errors, since any node that remains labeled with
- -- this type corresponds to an already issued error message. Any_Type
- -- is propagated to avoid cascaded errors from a single type error.
+ -- Used to represent some unknown type. Any_Type is the type of an
+ -- unresolved operator, and it is the type of a node where a type error
+ -- has been detected. Any_Type plays an important role in avoiding cascaded
+ -- errors, because it is compatible with all other types, and is propagated
+ -- to any expression that has a subexpression of Any_Type. When resolving
+ -- operators, Any_Type is the initial type of the node before any of its
+ -- candidate interpretations has been examined. If after examining all of
+ -- them the type is still Any_Type, the node has no possible interpretation
+ -- and an error can be emitted (and Any_Type will be propagated upwards).
+ --
+ -- There is one situation in which Any_Type is used to legitimately
+ -- represent a case where the type is not known pre-resolution, and that
+ -- is for the N_Raise_Expression node. In this case, the Etype being set to
+ -- Any_Type is normal and does not represent an error. In particular, it is
+ -- compatible with the type of any constituent of the enclosing expression,
+ -- if any. The type is eventually replaced with the type of the context,
+ -- which plays no role in the resolution of the Raise_Expression.
Any_Access : Entity_Id;
-- Used to resolve the overloaded literal NULL
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index 2ac486bd30f..96416a5e546 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -147,6 +147,10 @@ package body Switch.C is
First_Char : Positive;
-- Marks start of switch to be stored
+ First_Ptr : Positive;
+ -- Save position of first character after -gnatd (for checking that
+ -- debug flags that must come first are first, in particular -gnatd.b),
+
begin
Ptr := Switch_Chars'First;
@@ -274,30 +278,31 @@ package body Switch.C is
case C is
+ -- -gnata (assertions enabled)
+
when 'a' =>
Ptr := Ptr + 1;
Assertions_Enabled := True;
- Debug_Pragmas_Enabled := True;
- -- Processing for A switch
+ -- -gnatA (disregard gnat.adc)
when 'A' =>
Ptr := Ptr + 1;
Config_File := False;
- -- Processing for b switch
+ -- -gnatb (brief messages to stderr)
when 'b' =>
Ptr := Ptr + 1;
Brief_Output := True;
- -- Processing for B switch
+ -- -gnatB (assume no invalid values)
when 'B' =>
Ptr := Ptr + 1;
Assume_No_Invalid_Values := True;
- -- Processing for c switch
+ -- -gnatc (check syntax and semantics only)
when 'c' =>
if not First_Switch then
@@ -308,7 +313,7 @@ package body Switch.C is
Ptr := Ptr + 1;
Operating_Mode := Check_Semantics;
- -- Processing for C switch
+ -- -gnatC (Generate CodePeer information)
when 'C' =>
Ptr := Ptr + 1;
@@ -326,11 +331,12 @@ package body Switch.C is
Warning_Mode := Suppress;
end if;
- -- Processing for d switch
+ -- -gnatd (compiler debug options)
when 'd' =>
Store_Switch := False;
Dot := False;
+ First_Ptr := Ptr + 1;
-- Note: for the debug switch, the remaining characters in this
-- switch field must all be debug flags, since all valid switch
@@ -347,9 +353,25 @@ package body Switch.C is
C in 'a' .. 'z' or else
C in 'A' .. 'Z'
then
+ -- Case of dotted flag
+
if Dot then
Set_Dotted_Debug_Flag (C);
Store_Compilation_Switch ("-gnatd." & C);
+
+ -- Special check, -gnatd.b must come first
+
+ if C = 'b'
+ and then (Ptr /= First_Ptr + 1
+ or else not First_Switch)
+ then
+ Osint.Fail
+ ("-gnatd.b must be first if combined "
+ & "with other switches");
+ end if;
+
+ -- Not a dotted flag
+
else
Set_Debug_Flag (C);
Store_Compilation_Switch ("-gnatd" & C);
@@ -367,7 +389,7 @@ package body Switch.C is
return;
- -- Processing for D switch
+ -- -gnatD (debug expanded code)
when 'D' =>
Ptr := Ptr + 1;
@@ -403,6 +425,8 @@ package body Switch.C is
-- -gnatea (initial delimiter of explicit switches)
+ -- This is an internal switch
+
-- All switches that come before -gnatea have been added by
-- the GCC driver and are not stored in the ALI file.
-- See also -gnatez below.
@@ -562,6 +586,8 @@ package body Switch.C is
-- -gnateO= (object path file)
+ -- This is an internal switch
+
when 'O' =>
Store_Switch := False;
Ptr := Ptr + 1;
@@ -570,7 +596,6 @@ package body Switch.C is
if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then
Bad_Switch ("-gnateO");
-
else
Object_Path_File_Name :=
new String'(Switch_Chars (Ptr + 1 .. Max));
@@ -621,12 +646,52 @@ package body Switch.C is
Generate_SCO_Instance_Table := True;
Ptr := Ptr + 1;
- -- -gnatet (generate target dependent information)
+ -- -gnatet (write target dependent information)
when 't' =>
- Generate_Target_Dependent_Info := True;
+ if not First_Switch then
+ Osint.Fail
+ ("-gnatet must not be combined with other switches");
+ end if;
+
+ -- Check for '='
+
+ Ptr := Ptr + 1;
+
+ if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then
+ Bad_Switch ("-gnatet");
+ else
+ Target_Dependent_Info_Write_Name :=
+ new String'(Switch_Chars (Ptr + 1 .. Max));
+ end if;
+
+ return;
+
+ -- -gnateT (read target dependent information)
+
+ when 'T' =>
+ if not First_Switch then
+ Osint.Fail
+ ("-gnateT must not be combined with other switches");
+ end if;
+
+ -- Check for '='
+
Ptr := Ptr + 1;
+ if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then
+ Bad_Switch ("-gnateT");
+ else
+ -- This parameter was stored by Set_Targ earlier
+
+ pragma Assert
+ (Target_Dependent_Info_Read_Name.all =
+ Switch_Chars (Ptr + 1 .. Max));
+ null;
+ end if;
+
+ return;
+
-- -gnateV (validity checks on parameters)
when 'V' =>
@@ -641,6 +706,8 @@ package body Switch.C is
-- -gnatez (final delimiter of explicit switches)
+ -- This is an internal switch
+
-- All switches that come after -gnatez have been added by
-- the GCC driver and are not stored in the ALI file. See
-- also -gnatea above.
@@ -668,14 +735,14 @@ package body Switch.C is
Ptr := Ptr + 1;
All_Errors_Mode := True;
- -- Processing for F switch
+ -- -gnatF (overflow of predefined float types)
when 'F' =>
Ptr := Ptr + 1;
External_Name_Exp_Casing := Uppercase;
External_Name_Imp_Casing := Uppercase;
- -- Processing for g switch
+ -- -gnatg (GNAT implementation mode)
when 'g' =>
Ptr := Ptr + 1;
@@ -683,6 +750,7 @@ package body Switch.C is
Identifier_Character_Set := 'n';
System_Extend_Unit := Empty;
Warning_Mode := Treat_As_Error;
+ Style_Check_Main := True;
-- Set Ada 2012 mode explicitly. We don't want to rely on the
-- implicit setting here, since for example, we want
@@ -696,7 +764,7 @@ package body Switch.C is
Set_GNAT_Mode_Warnings;
Set_GNAT_Style_Check_Options;
- -- Processing for G switch
+ -- -gnatG (output generated code)
when 'G' =>
Ptr := Ptr + 1;
@@ -709,13 +777,13 @@ package body Switch.C is
Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40);
end if;
- -- Processing for h switch
+ -- -gnath (help information)
when 'h' =>
Ptr := Ptr + 1;
Usage_Requested := True;
- -- Processing for i switch
+ -- -gnati (character set)
when 'i' =>
if Ptr = Max then
@@ -740,26 +808,26 @@ package body Switch.C is
Bad_Switch ("-gnati" & Switch_Chars (Ptr .. Max));
end if;
- -- Processing for I switch
+ -- -gnatI (ignore representation clauses)
when 'I' =>
Ptr := Ptr + 1;
Ignore_Rep_Clauses := True;
- -- Processing for j switch
+ -- -gnatj (messages in limited length lines)
when 'j' =>
Ptr := Ptr + 1;
Scan_Nat (Switch_Chars, Max, Ptr, Error_Msg_Line_Length, C);
- -- Processing for k switch
+ -- -gnatk (limit file name length)
when 'k' =>
Ptr := Ptr + 1;
Scan_Pos
(Switch_Chars, Max, Ptr, Maximum_File_Name_Length, C);
- -- Processing for l switch
+ -- -gnatl (output full source)
when 'l' =>
Ptr := Ptr + 1;
@@ -777,19 +845,19 @@ package body Switch.C is
end if;
end if;
- -- Processing for L switch
+ -- -gnatL (corresponding source text)
when 'L' =>
Ptr := Ptr + 1;
Dump_Source_Text := True;
- -- Processing for m switch
+ -- -gnatm (max number or errors/warnings)
when 'm' =>
Ptr := Ptr + 1;
Scan_Nat (Switch_Chars, Max, Ptr, Maximum_Messages, C);
- -- Processing for n switch
+ -- -gnatn (enable pragma Inline)
when 'n' =>
Ptr := Ptr + 1;
@@ -806,14 +874,14 @@ package body Switch.C is
end if;
end if;
- -- Processing for N switch
+ -- -gnatN (obsolescent)
when 'N' =>
Ptr := Ptr + 1;
Inline_Active := True;
Front_End_Inlining := True;
- -- Processing for o switch
+ -- -gnato (overflow checks)
when 'o' =>
Ptr := Ptr + 1;
@@ -852,14 +920,16 @@ package body Switch.C is
end if;
end if;
- -- Processing for O switch
+ -- -gnatO (specify name of the object file)
+
+ -- This is an internal switch
when 'O' =>
Store_Switch := False;
Ptr := Ptr + 1;
Output_File_Name_Present := True;
- -- Processing for p switch
+ -- -gnatp (suppress all checks)
when 'p' =>
Ptr := Ptr + 1;
@@ -890,32 +960,32 @@ package body Switch.C is
Opt.Suppress_Checks := True;
end if;
- -- Processing for P switch
+ -- -gnatP (periodic poll)
when 'P' =>
Ptr := Ptr + 1;
Polling_Required := True;
- -- Processing for q switch
+ -- -gnatq (don't quit)
when 'q' =>
Ptr := Ptr + 1;
Try_Semantics := True;
- -- Processing for Q switch
+ -- -gnatQ (always write ALI file)
when 'Q' =>
Ptr := Ptr + 1;
Force_ALI_Tree_File := True;
Try_Semantics := True;
- -- Processing for r switch
+ -- -gnatr (restrictions as warnings)
when 'r' =>
Ptr := Ptr + 1;
Treat_Restrictions_As_Warnings := True;
- -- Processing for R switch
+ -- -gnatR (list rep. info)
when 'R' =>
Back_Annotate_Rep_Info := True;
@@ -942,7 +1012,7 @@ package body Switch.C is
Ptr := Ptr + 1;
end loop;
- -- Processing for s switch
+ -- -gnats (syntax check only)
when 's' =>
if not First_Switch then
@@ -953,44 +1023,44 @@ package body Switch.C is
Ptr := Ptr + 1;
Operating_Mode := Check_Syntax;
- -- Processing for S switch
+ -- -gnatS (print package Standard)
when 'S' =>
Print_Standard := True;
Ptr := Ptr + 1;
- -- Processing for t switch
+ -- -gnatt (output tree)
when 't' =>
Ptr := Ptr + 1;
Tree_Output := True;
Back_Annotate_Rep_Info := True;
- -- Processing for T switch
+ -- -gnatT (change start of internal table sizes)
when 'T' =>
Ptr := Ptr + 1;
Scan_Pos (Switch_Chars, Max, Ptr, Table_Factor, C);
- -- Processing for u switch
+ -- -gnatu (list units for compilation)
when 'u' =>
Ptr := Ptr + 1;
List_Units := True;
- -- Processing for U switch
+ -- -gnatU (unique tags)
when 'U' =>
Ptr := Ptr + 1;
Unique_Error_Tag := True;
- -- Processing for v switch
+ -- -gnatv (verbose mode)
when 'v' =>
Ptr := Ptr + 1;
Verbose_Mode := True;
- -- Processing for V switch
+ -- -gnatV (validity checks)
when 'V' =>
Store_Switch := False;
@@ -1020,7 +1090,7 @@ package body Switch.C is
Ptr := Max + 1;
- -- Processing for w switch
+ -- -gnatw (warning modes)
when 'w' =>
Store_Switch := False;
@@ -1060,7 +1130,7 @@ package body Switch.C is
return;
- -- Processing for W switch
+ -- -gnatW (wide character encoding method)
when 'W' =>
Ptr := Ptr + 1;
@@ -1085,13 +1155,13 @@ package body Switch.C is
Ptr := Ptr + 1;
- -- Processing for x switch
+ -- -gnatx (suppress cross-ref information)
when 'x' =>
Ptr := Ptr + 1;
Xref_Active := False;
- -- Processing for X switch
+ -- -gnatX (language extensions)
when 'X' =>
Ptr := Ptr + 1;
@@ -1099,10 +1169,11 @@ package body Switch.C is
Ada_Version := Ada_Version_Type'Last;
Ada_Version_Explicit := Ada_Version_Type'Last;
- -- Processing for y switch
+ -- -gnaty (style checks)
when 'y' =>
Ptr := Ptr + 1;
+ Style_Check_Main := True;
if Ptr > Max then
Set_Default_Style_Check_Options;
@@ -1145,7 +1216,7 @@ package body Switch.C is
end;
end if;
- -- Processing for z switch
+ -- -gnatz (stub generation)
when 'z' =>
@@ -1185,7 +1256,7 @@ package body Switch.C is
Osint.Fail ("only one -gnatz* switch allowed");
end if;
- -- Processing for Z switch
+ -- -gnatZ (obsolescent)
when 'Z' =>
Ptr := Ptr + 1;
@@ -1196,7 +1267,7 @@ package body Switch.C is
-- version switch is added, Switch.M.Normalize_Compiler_Switches
-- must be updated.
- -- Processing for 83 switch
+ -- -gnat83
when '8' =>
if Ptr = Max then
@@ -1213,7 +1284,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version;
end if;
- -- Processing for 95 switch
+ -- -gnat95
when '9' =>
if Ptr = Max then
@@ -1230,7 +1301,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version;
end if;
- -- Processing for 05 switch
+ -- -gnat05
when '0' =>
if Ptr = Max then
@@ -1247,7 +1318,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version;
end if;
- -- Processing for 12 switch
+ -- -gnat12
when '1' =>
if Ptr = Max then
@@ -1264,7 +1335,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version;
end if;
- -- Processing for 2005 and 2012 switches
+ -- -gnat2005 and -gnat2012
when '2' =>
if Ptr > Max - 3 then
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb
index 3343d7c81c5..01ea5d56cbd 100644
--- a/gcc/ada/tbuild.adb
+++ b/gcc/ada/tbuild.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -174,9 +174,8 @@ package body Tbuild is
Attribute_Name => Attribute_Name);
begin
- pragma Assert (Attribute_Name = Name_Address
- or else
- Attribute_Name = Name_Unrestricted_Access);
+ pragma Assert (Nam_In (Attribute_Name, Name_Address,
+ Name_Unrestricted_Access));
Set_Must_Be_Byte_Aligned (N, True);
return N;
end Make_Byte_Aligned_Attribute_Reference;
diff --git a/gcc/ada/tree_io.ads b/gcc/ada/tree_io.ads
index 1f5b90059eb..25e24c3c2db 100644
--- a/gcc/ada/tree_io.ads
+++ b/gcc/ada/tree_io.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -47,7 +47,7 @@ package Tree_IO is
Tree_Format_Error : exception;
-- Raised if a format error is detected in the input file
- ASIS_Version_Number : constant := 30;
+ ASIS_Version_Number : constant := 31;
-- ASIS Version. This is used to check for consistency between the compiler
-- used to generate trees and an ASIS application that is reading the
-- trees. It must be incremented whenever a change is made to the tree
@@ -59,6 +59,7 @@ package Tree_IO is
-- 29 Changes in Sem_Ch3 (tree copying in case of discriminant constraint
-- for concurrent types).
-- 30 Add Check_Float_Overflow boolean to tree file
+ -- 31 Remove read/write of Debug_Pragmas_Disabled/Debug_Pragmas_Enabled
procedure Tree_Read_Initialize (Desc : File_Descriptor);
-- Called to initialize reading of a tree file. This call must be made
diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb
index 64dbf2dd536..4de6b8529f1 100644
--- a/gcc/ada/treepr.adb
+++ b/gcc/ada/treepr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -215,6 +215,27 @@ package body Treepr is
-- descendents are to be printed. Prefix_Str is to be added to all
-- printed lines.
+ -------
+ -- p --
+ -------
+
+ function p (N : Union_Id) return Node_Or_Entity_Id is
+ begin
+ case N is
+ when List_Low_Bound .. List_High_Bound - 1 =>
+ return Nlists.Parent (List_Id (N));
+
+ when Node_Range =>
+ return Atree.Parent (Node_Or_Entity_Id (N));
+
+ when others =>
+ Write_Int (Int (N));
+ Write_Str (" is not a Node_Id or List_Id value");
+ Write_Eol;
+ return Empty;
+ end case;
+ end p;
+
--------
-- pe --
--------
diff --git a/gcc/ada/treepr.ads b/gcc/ada/treepr.ads
index 212c49155b5..d33e93bb21e 100644
--- a/gcc/ada/treepr.ads
+++ b/gcc/ada/treepr.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -62,16 +62,27 @@ package Treepr is
-- The following debugging procedures are intended to be called from gdb
+ function p (N : Union_Id) return Node_Or_Entity_Id;
+ pragma Export (Ada, p);
+ -- Returns parent of a list or node (depending on the value of N). If N
+ -- is neither a list nor a node id, then prints a message to that effect
+ -- and returns Empty.
+
+ procedure pn (N : Union_Id);
+ -- Prints a node, node list, uint, or anything else that falls under
+ -- the definition of Union_Id. Historically this was only for printing
+ -- nodes, hence the name.
+
procedure pp (N : Union_Id);
pragma Export (Ada, pp);
- -- Prints a node, node list, uint, or anything else that falls under
- -- Union_Id.
+ -- Identical to pn, present for historical reasons
procedure ppp (N : Node_Id);
pragma Export (Ada, ppp);
-- Same as Print_Node_Subtree
- -- The following are no longer needed; you can use pp or ppp instead
+ -- The following are no longer really needed, now that pn will print
+ -- anything you throw at it!
procedure pe (E : Elist_Id);
pragma Export (Ada, pe);
@@ -84,10 +95,6 @@ package Treepr is
-- on the left and add a minus sign. This just saves some typing in the
-- debugger.
- procedure pn (N : Union_Id);
- pragma Export (Ada, pn);
- -- Same as pp
-
procedure pt (N : Node_Id);
pragma Export (Ada, pt);
-- Same as ppp
diff --git a/gcc/ada/ttypes.ads b/gcc/ada/ttypes.ads
index be0162d6b44..5e27cbd2e58 100644
--- a/gcc/ada/ttypes.ads
+++ b/gcc/ada/ttypes.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -26,7 +26,8 @@
-- This package contains constants describing target properties
with Types; use Types;
-with Get_Targ; use Get_Targ;
+with Get_Targ;
+with Set_Targ;
package Ttypes is
@@ -92,18 +93,6 @@ package Ttypes is
-- than referencing System.Storage_Unit, or Standard'Storage_Unit, both of
-- which would yield the host value.
- ----------------------------------------------
- -- Target-Dependent Information in ALI File --
- ----------------------------------------------
-
- -- If the flag Generate_Target_Dependent_Info is set (e.g. by use of the
- -- -gnatT switch), then the ALI file contains T lines representing each of
- -- the constants defined in this package (see Lib-Writ spec for details).
-
- -- These T lines use a code consisting of four upper case letters to
- -- identify the constant whose value is output. These four letter codes
- -- may be found as a comment in the declaration of each constant.
-
---------------------------------------------------
-- Target-Dependent Values for Types in Standard --
---------------------------------------------------
@@ -113,65 +102,64 @@ package Ttypes is
-- example, on some machines, Short_Float may be the same as Float, and
-- Long_Long_Float may be the same as Long_Float.
- Standard_Short_Short_Integer_Size : constant Pos := -- SINS
- Get_Char_Size;
- Standard_Short_Short_Integer_Width : constant Pos := -- SINW
- Width_From_Size
+ Standard_Short_Short_Integer_Size : constant Pos :=
+ Set_Targ.Char_Size;
+ Standard_Short_Short_Integer_Width : constant Pos :=
+ Get_Targ.Width_From_Size
(Standard_Short_Short_Integer_Size);
- Standard_Short_Integer_Size : constant Pos := -- SHIS
- Get_Short_Size;
- Standard_Short_Integer_Width : constant Pos := -- SHIW
- Width_From_Size
+ Standard_Short_Integer_Size : constant Pos :=
+ Set_Targ.Short_Size;
+ Standard_Short_Integer_Width : constant Pos :=
+ Get_Targ.Width_From_Size
(Standard_Short_Integer_Size);
- Standard_Integer_Size : constant Pos := -- INTS
- Get_Int_Size;
- Standard_Integer_Width : constant Pos := -- INTW
- Width_From_Size
+ Standard_Integer_Size : constant Pos :=
+ Set_Targ.Int_Size;
+ Standard_Integer_Width : constant Pos :=
+ Get_Targ.Width_From_Size
(Standard_Integer_Size);
- Standard_Long_Integer_Size : constant Pos := -- LINS
- Get_Long_Size;
- Standard_Long_Integer_Width : constant Pos := -- LINW
- Width_From_Size
+ Standard_Long_Integer_Size : constant Pos :=
+ Set_Targ.Long_Size;
+ Standard_Long_Integer_Width : constant Pos :=
+ Get_Targ.Width_From_Size
(Standard_Long_Integer_Size);
- Standard_Long_Long_Integer_Size : constant Pos := -- LLIS
- Get_Long_Long_Size;
- Standard_Long_Long_Integer_Width : constant Pos := -- LLIW
- Width_From_Size
+ Standard_Long_Long_Integer_Size : constant Pos :=
+ Set_Targ.Long_Long_Size;
+ Standard_Long_Long_Integer_Width : constant Pos :=
+ Get_Targ.Width_From_Size
(Standard_Long_Long_Integer_Size);
- Standard_Short_Float_Size : constant Pos := -- SFLS
- Get_Float_Size;
- Standard_Short_Float_Digits : constant Pos := -- SFLD
- Digits_From_Size
+ Standard_Short_Float_Size : constant Pos :=
+ Set_Targ.Float_Size;
+ Standard_Short_Float_Digits : constant Pos :=
+ Get_Targ.Digits_From_Size
(Standard_Short_Float_Size);
- Standard_Float_Size : constant Pos := -- FLTS
- Get_Float_Size;
- Standard_Float_Digits : constant Pos := -- FLTD
- Digits_From_Size
+ Standard_Float_Size : constant Pos :=
+ Set_Targ.Float_Size;
+ Standard_Float_Digits : constant Pos :=
+ Get_Targ.Digits_From_Size
(Standard_Float_Size);
- Standard_Long_Float_Size : constant Pos := -- LFLS
- Get_Double_Size;
- Standard_Long_Float_Digits : constant Pos := -- LFLD
- Digits_From_Size
+ Standard_Long_Float_Size : constant Pos :=
+ Set_Targ.Double_Size;
+ Standard_Long_Float_Digits : constant Pos :=
+ Get_Targ.Digits_From_Size
(Standard_Long_Float_Size);
- Standard_Long_Long_Float_Size : constant Pos := -- LLFS
- Get_Long_Double_Size;
- Standard_Long_Long_Float_Digits : constant Pos := -- LLFD
- Digits_From_Size
+ Standard_Long_Long_Float_Size : constant Pos :=
+ Set_Targ.Long_Double_Size;
+ Standard_Long_Long_Float_Digits : constant Pos :=
+ Get_Targ.Digits_From_Size
(Standard_Long_Long_Float_Size);
- Standard_Character_Size : constant Pos := -- CHAS
- Get_Char_Size;
+ Standard_Character_Size : constant Pos := Set_Targ.Char_Size;
- Standard_Wide_Character_Size : constant Pos := 16; -- WCHS
- Standard_Wide_Wide_Character_Size : constant Pos := 32; -- WWCS
+ Standard_Wide_Character_Size : constant Pos := 16;
+ Standard_Wide_Wide_Character_Size : constant Pos := 32;
-- Standard wide character sizes
-- Note: there is no specific control over the representation of
@@ -187,19 +175,18 @@ package Ttypes is
-- Target-Dependent Values for Types in System --
-------------------------------------------------
- System_Address_Size : constant Pos := Get_Pointer_Size; -- ADRS
+ System_Address_Size : constant Pos := Set_Targ.Pointer_Size;
-- System.Address'Size (also size of all thin pointers)
- System_Max_Binary_Modulus_Power : constant Pos := -- MBMP
+ System_Max_Binary_Modulus_Power : constant Pos :=
Standard_Long_Long_Integer_Size;
- System_Max_Nonbinary_Modulus_Power : constant Pos := -- MNMP
- Standard_Integer_Size;
+ System_Max_Nonbinary_Modulus_Power : constant Pos := Standard_Integer_Size;
- System_Storage_Unit : constant Pos := Get_Bits_Per_Unit; -- SUNI
- System_Word_Size : constant Pos := Get_Bits_Per_Word; -- WRDS
+ System_Storage_Unit : constant Pos := Set_Targ.Bits_Per_Unit;
+ System_Word_Size : constant Pos := Set_Targ.Bits_Per_Word;
- System_Tick_Nanoseconds : constant Pos := 1_000_000_000; -- TICK
+ System_Tick_Nanoseconds : constant Pos := 1_000_000_000;
-- Value of System.Tick in nanoseconds. At the moment, this is a fixed
-- constant (with value of 1.0 seconds), but later we should add this
-- value to the GCC configuration file so that its value can be made
@@ -209,25 +196,25 @@ package Ttypes is
-- Target-Dependent Values for Types in Interfaces --
-----------------------------------------------------
- Interfaces_Wchar_T_Size : constant Pos := Get_Wchar_T_Size; -- WCTS
+ Interfaces_Wchar_T_Size : constant Pos := Set_Targ.Wchar_T_Size;
----------------------------------------
-- Other Target-Dependent Definitions --
----------------------------------------
- Maximum_Alignment : constant Pos := Get_Maximum_Alignment; -- MAXA
+ Maximum_Alignment : constant Pos := Set_Targ.Maximum_Alignment;
-- The maximum alignment, in storage units, that an object or type may
-- require on the target machine.
- System_Allocator_Alignment : constant Pos := -- ALLA
- Get_System_Allocator_Alignment;
+ System_Allocator_Alignment : constant Pos :=
+ Set_Targ.System_Allocator_Alignment;
-- The alignment in storage units of addresses returned by malloc
- Max_Unaligned_Field : constant Pos := Get_Max_Unaligned_Field; -- MUNF
+ Max_Unaligned_Field : constant Pos := Set_Targ.Max_Unaligned_Field;
-- The maximum supported size in bits for a field that is not aligned
-- on a storage unit boundary.
- Bytes_Big_Endian : Boolean := Get_Bytes_BE /= 0; -- BEND
+ Bytes_Big_Endian : Boolean := Set_Targ.Bytes_BE /= 0;
-- Important note: for Ada purposes, the important setting is the bytes
-- endianness (Bytes_Big_Endian), not the bits value (Bits_Big_Endian).
-- This is because Ada bit addressing must be compatible with the byte
@@ -237,22 +224,26 @@ package Ttypes is
-- and thus relevant only to the back end. Note that this is a variable
-- rather than a constant, since it can be modified (flipped) by -gnatd8.
- Target_Strict_Alignment : Boolean := -- STRA
- Get_Strict_Alignment /= 0;
+ Target_Strict_Alignment : Boolean :=
+ Set_Targ.Strict_Alignment /= 0;
-- True if instructions will fail if data is misaligned. Note that this
-- is a variable rather than a constant since it can be modified (set to
-- True) if the debug flag -gnatd.A is used.
- Target_Double_Float_Alignment : constant Nat := -- DFLA
- Get_Double_Float_Alignment;
+ Target_Double_Float_Alignment : constant Nat :=
+ Set_Targ.Double_Float_Alignment;
-- The default alignment of "double" floating-point types, i.e. floating
-- point types whose size is equal to 64 bits, or 0 if this alignment is
- -- not specifically capped.
+ -- not lower than the largest power of 2 multiple of System.Storage_Unit
+ -- that does not exceed either the object size of the type or the maximum
+ -- allowed alignment.
- Target_Double_Scalar_Alignment : constant Nat := -- DSCA
- Get_Double_Scalar_Alignment;
+ Target_Double_Scalar_Alignment : constant Nat :=
+ Set_Targ.Double_Scalar_Alignment;
-- The default alignment of "double" or larger scalar types, i.e. scalar
-- types whose size is greater or equal to 64 bits, or 0 if this alignment
- -- is not specifically capped.
+ -- is not lower than the largest power of 2 multiple of System.Storage_Unit
+ -- that does not exceed either the object size of the type or the maximum
+ -- allowed alignment.
end Ttypes;
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index a63e10c97e8..19e3269c570 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -102,8 +102,8 @@ package Types is
-- Graphic characters, as defined in ARM
subtype Line_Terminator is Character range ASCII.LF .. ASCII.CR;
- -- Line terminator characters (LF, VT, FF, CR). For further details,
- -- see the extensive discussion of line termination in the Sinput spec.
+ -- Line terminator characters (LF, VT, FF, CR). For further details, see
+ -- the extensive discussion of line termination in the Sinput spec.
subtype Upper_Half_Character is
Character range Character'Val (16#80#) .. Character'Val (16#FF#);
diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words
index 77a36ca095f..d450164ee4c 100644
--- a/gcc/ada/ug_words
+++ b/gcc/ada/ug_words
@@ -94,6 +94,7 @@ gcc -c ^ GNAT COMPILE
-gnatn2 ^ /INLINE=PRAGMA_LEVEL_2
-gnatN ^ /INLINE=FULL
-gnato ^ /CHECKS=OVERFLOW
+-gnato? ^ /OVERFLOW_CHECKS=?
-gnato?? ^ /OVERFLOW_CHECKS=??
-gnatp ^ /CHECKS=SUPPRESS_ALL
-gnat-p ^ /CHECKS=UNSUPPRESS_ALL
diff --git a/gcc/ada/urealp.ads b/gcc/ada/urealp.ads
index 54fe8ffe14d..d9d63eaeca5 100644
--- a/gcc/ada/urealp.ads
+++ b/gcc/ada/urealp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -46,7 +46,7 @@ package Urealp is
-- use the UR_Eq function).
-- A Ureal value represents an arbitrary precision universal real value,
- -- stored internally using four components
+ -- stored internally using four components:
-- the numerator (Uint, always non-negative)
-- the denominator (Uint, always non-zero, always positive if base = 0)
@@ -125,7 +125,7 @@ package Urealp is
-- Returns value 10.0 ** 36
function Ureal_M_10_36 return Ureal;
- -- Returns value -(10.0
+ -- Returns value -10.0 ** 36
-----------------
-- Subprograms --
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index 08a41c28069..dd0f2af33e4 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -167,10 +167,7 @@ begin
Write_Switch_Char ("Dnn");
Write_Line ("Debug expanded generated code (max line length = nn)");
- -- Line for -gnatea switch
-
- Write_Switch_Char ("ea");
- Write_Line ("Delimiter for automatically added switches (internal switch)");
+ -- No line for -gnatea : internal switch
-- Line for -gnateA switch
@@ -227,10 +224,7 @@ begin
Write_Switch_Char ("em=?");
Write_Line ("Specify mapping file, e.g. -gnatem=mapping");
- -- Line for -gnateO=?
-
- Write_Switch_Char ("eO=?");
- Write_Line ("Specify an object path file (internal switch)");
+ -- No line for -gnateO=? : internal switch
-- Line for -gnatep switch
@@ -249,8 +243,13 @@ begin
-- Line for -gnatet switch
- Write_Switch_Char ("et");
- Write_Line ("Generate target dependent information in ALI file");
+ Write_Switch_Char ("et=?");
+ Write_Line ("Write target dependent information file ?, e.g. gnatet=tdf");
+
+ -- Line for -gnateT switch
+
+ Write_Switch_Char ("eT=?");
+ Write_Line ("Read target dependent information file ?, e.g. gnateT=tdf");
-- Line for -gnateV switch
@@ -262,10 +261,7 @@ begin
Write_Switch_Char ("eY");
Write_Line ("Ignore all Style_Checks pragmas in source");
- -- Line for -gnatez switch
-
- Write_Switch_Char ("ez");
- Write_Line ("Delimiter for automatically added switches (internal switch)");
+ -- No line for -gnatez : internal switch
-- Line for -gnatE switch
@@ -355,10 +351,7 @@ begin
Write_Line
("Set mode for general/assertion expressions separately");
- -- Line for -gnatO switch
-
- Write_Switch_Char ("O nm ");
- Write_Line ("Set name of output ali file (internal switch)");
+ -- No line for -gnatO : internal switch
-- Line for -gnatp switch
@@ -584,8 +577,8 @@ begin
-- Line for -gnatW switch
- Write_Switch_Char ("W");
- Write_Str ("Wide character encoding method (");
+ Write_Switch_Char ("W?");
+ Write_Str ("Wide character encoding method (?=");
for J in WC_Encoding_Method loop
Write_Char (WC_Encoding_Letters (J));
diff --git a/gcc/ada/xgnatugn.adb b/gcc/ada/xgnatugn.adb
index ab168170f0c..4706701e9b1 100644
--- a/gcc/ada/xgnatugn.adb
+++ b/gcc/ada/xgnatugn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -85,12 +85,6 @@
-- output. A line containing this escape sequence may not also contain
-- a ^alpha^beta^ sequence.
--- Process @ifset and @ifclear for the target flags (unw, vms);
--- this is because we have menu problems if we let makeinfo handle
--- these ifset/ifclear pairs.
--- Note: @ifset/@ifclear commands for the edition flags (FSFEDITION,
--- PROEDITION, GPLEDITION) are passed through unchanged
-
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
@@ -129,6 +123,7 @@ procedure Xgnatugn is
procedure Put_Line (F : Sfile; S : String);
-- Local version of Put_Line ensures Unix style line endings
+ First_Time : Boolean := True;
Number_Of_Warnings : Natural := 0;
Number_Of_Errors : Natural := 0;
Warnings_Enabled : Boolean;
@@ -148,10 +143,6 @@ procedure Xgnatugn is
(Input : Input_File;
At_Character : Natural;
Message : String);
- procedure Warning
- (Input : Input_File;
- Message : String);
- -- Like Error, but just print a warning message
Dictionary_File : aliased Input_File;
procedure Read_Dictionary_File;
@@ -180,13 +171,11 @@ procedure Xgnatugn is
-- Conditional commands for edition are passed through unchanged
subtype Target_Type is Flag_Type range UNW .. VMS;
- subtype Edition_Type is Flag_Type range FSFEDITION .. GPLEDITION;
Target : Target_Type;
-- The Target variable is initialized using the command line
- Valid_Characters : constant Character_Set :=
- To_Set (Span => (' ', '~'));
+ Valid_Characters : constant Character_Set := To_Set (Span => (' ', '~'));
-- This array controls which characters are permitted in the input
-- file (after line breaks have been removed). Valid characters
-- are all printable ASCII characters and the space character.
@@ -194,7 +183,7 @@ procedure Xgnatugn is
Word_Characters : constant Character_Set :=
(To_Set (Ranges =>
(('0', '9'), ('a', 'z'), ('A', 'Z')))
- or To_Set ("?-_~"));
+ or To_Set ("?-_~"));
-- The characters which are permitted in words. Other (valid)
-- characters are assumed to be delimiters between words. Note that
-- this set has to include all characters of the source words of the
@@ -236,47 +225,6 @@ procedure Xgnatugn is
-- This subprogram takes a line and rewrites it according to Target.
-- It relies on information in Source_File to generate error messages.
- type Conditional is (Set, Clear);
- procedure Push_Conditional (Cond : Conditional; Flag : Target_Type);
- procedure Pop_Conditional (Cond : Conditional);
- -- These subprograms deal with conditional processing (@ifset/@ifclear).
- -- They rely on information in Source_File to generate error messages.
-
- function Currently_Excluding return Boolean;
- -- Returns true if conditional processing directives imply that the
- -- current line should not be included in the output.
-
- function VMS_Context_Determined return Boolean;
- -- Returns true if, in the current conditional preprocessing context, we
- -- always have a VMS or a non-VMS version, regardless of the value of
- -- Target.
-
- function In_VMS_Section return Boolean;
- -- Returns True if in an "@ifset vms" section
-
- procedure Check_No_Pending_Conditional;
- -- Checks that all preprocessing directives have been properly matched by
- -- their @end counterpart. If this is not the case, print an error
- -- message.
-
- -- The following definitions implement a stack to track the conditional
- -- preprocessing context.
-
- type Conditional_Context is record
- Starting_Line : Positive;
- Cond : Conditional;
- Flag : Flag_Type;
- Excluding : Boolean;
- end record;
-
- Conditional_Stack_Depth : constant := 3;
-
- Conditional_Stack :
- array (1 .. Conditional_Stack_Depth) of Conditional_Context;
-
- Conditional_TOS : Natural := 0;
- -- Pointer to the Top Of Stack for Conditional_Stack
-
-----------
-- Usage --
-----------
@@ -415,16 +363,6 @@ procedure Xgnatugn is
-------------
procedure Warning
- (Input : Input_File;
- Message : String)
- is
- begin
- if Warnings_Enabled then
- Warning (Input, 0, Message);
- end if;
- end Warning;
-
- procedure Warning
(Input : Input_File;
At_Character : Natural;
Message : String)
@@ -487,8 +425,9 @@ procedure Xgnatugn is
Trim (Line (1 .. Split - 1), Both);
Target : constant String :=
Trim (Line (Split + 1 .. Line'Last), Both);
- Two_Spaces : constant Natural :=
- Index (Source, " ");
+
+ Two_Spaces : constant Natural := Index (Source, " ");
+
Non_Word_Character : constant Natural :=
Index (Source,
Word_Characters or
@@ -524,7 +463,6 @@ procedure Xgnatugn is
declare
Prefix : String renames
Source (Source'First .. J - 1);
-
begin
if not Is_Known_Word (Prefix) then
Error (Dictionary_File,
@@ -678,7 +616,7 @@ procedure Xgnatugn is
(VMS_Second_Character + 1, VMS_Third_Character - 1));
return;
end;
- end if; -- VMS_Alternative
+ end if;
-- The Word case. Search for characters not in Word_Characters.
-- We have found a word if the first non-word character is not
@@ -718,7 +656,7 @@ procedure Xgnatugn is
procedure Rewrite_Word is
First_Word : String
- renames Line (Token.Span.First .. Token.Span.Last);
+ renames Line (Token.Span.First .. Token.Span.Last);
begin
-- We do not perform any error checking below, so we can just skip
@@ -736,7 +674,7 @@ procedure Xgnatugn is
-- longest possible sequence we can rewrite.
declare
- Seq : Token_Span := Token.Span;
+ Seq : Token_Span := Token.Span;
Lost_Space : Boolean := False;
begin
@@ -746,23 +684,25 @@ procedure Xgnatugn is
and then Line (Token.Span.First .. Token.Span.Last) = " "
then
Next_Token;
+
if Token.Kind /= Word
or else not Is_Known_Word (Line (Seq.First
.. Token.Span.Last))
then
- -- When we reach this point, the following
- -- conditions are true:
- --
- -- Seq is a known word.
- -- The previous token was a space character.
- -- Seq extended to the current token is not a
- -- known word.
+ -- When we reach this point, the following conditions
+ -- are true:
+
+ -- Seq is a known word
+
+ -- The previous token was a space character
+
+ -- Seq extended to the current token is not a
+ -- known word.
Lost_Space := True;
exit;
else
-
-- Extend Seq to cover the current (known) word
Seq.Last := Token.Span.Last;
@@ -772,10 +712,12 @@ procedure Xgnatugn is
else
-- When we reach this point, the following conditions
-- are true:
- --
- -- Seq is a known word.
- -- The previous token was a word.
- -- The current token is not a space character.
+
+ -- Seq is a known word
+
+ -- The previous token was a word
+
+ -- The current token is not a space character.
exit;
end if;
@@ -804,8 +746,8 @@ procedure Xgnatugn is
Next_Token;
if Token.Kind = Word
- and then Is_Extension (Line (Token.Span.First
- .. Token.Span.Last))
+ and then
+ Is_Extension (Line (Token.Span.First .. Token.Span.Last))
then
-- We have discovered a file extension. Convert the file
-- name to upper case.
@@ -848,6 +790,7 @@ procedure Xgnatugn is
-- Rewrite_Word would have handled it.
Next_Token;
+
if Token.Kind = Word
and then Is_Extension (Line (Token.Span.First
.. Token.Span.Last))
@@ -858,6 +801,7 @@ procedure Xgnatugn is
else
Append (Rewritten_Line, '.');
end if;
+
else
Append (Rewritten_Line, Line (Token.Span.First
.. Token.Span.Last));
@@ -887,17 +831,6 @@ procedure Xgnatugn is
Maybe_Rewrite_Extension;
when VMS_Alternative =>
- if VMS_Context_Determined then
- if (not In_VMS_Section)
- or else
- Line (Token.VMS.First .. Token.VMS.Last) /=
- Line (Token.Non_VMS.First .. Token.Non_VMS.Last)
- then
- Warning (Source_File, Token.First,
- "VMS alternative already determined "
- & "by conditionals");
- end if;
- end if;
if Target = VMS then
Append (Rewritten_Line, Line (Token.VMS.First
.. Token.VMS.Last));
@@ -905,6 +838,7 @@ procedure Xgnatugn is
Append (Rewritten_Line, Line (Token.Non_VMS.First
.. Token.Non_VMS.Last));
end if;
+
Next_Token;
when VMS_Error =>
@@ -921,155 +855,27 @@ procedure Xgnatugn is
-------------------------
procedure Process_Source_File is
- Ifset : constant String := "@ifset ";
- Ifclear : constant String := "@ifclear ";
- Endsetclear : constant String := "@end ";
- -- Strings to be recognized for conditional processing
-
begin
while not End_Of_File (Source_File.Data) loop
declare
Line : constant String := Get_Line (Source_File'Access);
+
Rewritten : constant String := Rewrite_Source_Line (Line);
-- We unconditionally rewrite the line so that we can check the
-- syntax of all lines, and not only those which are actually
-- included in the output.
- Have_Conditional : Boolean := False;
- -- True if we have encountered a conditional preprocessing
- -- directive.
-
- Cond : Conditional;
- -- The kind of the directive
-
- Flag : Flag_Type;
- -- Its flag
-
begin
- -- If the line starts with @ifset or @ifclear, we try to convert
- -- the following flag to one of our flag types. If we fail,
- -- Have_Conditional remains False.
-
- if Line'Length >= Ifset'Length
- and then Line (1 .. Ifset'Length) = Ifset
- then
- Cond := Set;
-
- declare
- Arg : constant String :=
- Trim (Line (Ifset'Length + 1 .. Line'Last), Both);
-
- begin
- Flag := Flag_Type'Value (Arg);
- Have_Conditional := True;
-
- case Flag is
- when Target_Type =>
- if Translate (Target_Type'Image (Flag),
- Lower_Case_Map)
- /= Arg
- then
- Error (Source_File, "flag has to be lowercase");
- end if;
-
- when Edition_Type =>
- null;
- end case;
- exception
- when Constraint_Error =>
- Error (Source_File, "unknown flag for '@ifset'");
- end;
-
- elsif Line'Length >= Ifclear'Length
- and then Line (1 .. Ifclear'Length) = Ifclear
+ if First_Time
+ and then Line'Length > 3 and then Line (1 .. 3) = "@if"
then
- Cond := Clear;
-
- declare
- Arg : constant String :=
- Trim (Line (Ifclear'Length + 1 .. Line'Last), Both);
-
- begin
- Flag := Flag_Type'Value (Arg);
- Have_Conditional := True;
-
- case Flag is
- when Target_Type =>
- if Translate (Target_Type'Image (Flag),
- Lower_Case_Map)
- /= Arg
- then
- Error (Source_File, "flag has to be lowercase");
- end if;
-
- when Edition_Type =>
- null;
- end case;
- exception
- when Constraint_Error =>
- Error (Source_File, "unknown flag for '@ifclear'");
- end;
+ Put_Line (Output_File, "@set " & Argument (1));
+ First_Time := False;
end if;
- if Have_Conditional and (Flag in Target_Type) then
-
- -- We create a new conditional context and suppress the
- -- directive in the output.
-
- Push_Conditional (Cond, Flag);
-
- elsif Line'Length >= Endsetclear'Length
- and then Line (1 .. Endsetclear'Length) = Endsetclear
- and then (Flag in Target_Type)
- then
- -- The '@end ifset'/'@end ifclear' case is handled here. We
- -- have to pop the conditional context.
-
- declare
- First, Last : Natural;
-
- begin
- Find_Token (Source => Line (Endsetclear'Length + 1
- .. Line'Length),
- Set => Letter_Set,
- Test => Inside,
- First => First,
- Last => Last);
-
- if Last = 0 then
- Error (Source_File, "'@end' without argument");
- else
- if Line (First .. Last) = "ifset" then
- Have_Conditional := True;
- Cond := Set;
- elsif Line (First .. Last) = "ifclear" then
- Have_Conditional := True;
- Cond := Clear;
- end if;
-
- if Have_Conditional then
- Pop_Conditional (Cond);
- end if;
-
- -- We fall through to the ordinary case for other @end
- -- directives.
-
- end if; -- @end without argument
- end;
- end if; -- Have_Conditional
-
- if (not Have_Conditional) or (Flag in Edition_Type) then
-
- -- The ordinary case
-
- if not Currently_Excluding then
- Put_Line (Output_File, Rewritten);
- end if;
- end if;
+ Put_Line (Output_File, Rewritten);
end;
end loop;
-
- Check_No_Pending_Conditional;
end Process_Source_File;
---------------------------
@@ -1079,8 +885,7 @@ procedure Xgnatugn is
procedure Initialize_Extensions is
procedure Add (Extension : String);
- -- Adds an extension which is replaced with itself (in upper
- -- case).
+ -- Adds an extension which is replaced with itself (in upper case)
procedure Add (Extension, Replacement : String);
-- Adds an extension with a custom replacement
@@ -1152,148 +957,6 @@ procedure Xgnatugn is
return S (Get (Ug_Words, Word));
end Get_Replacement_Word;
- ----------------------
- -- Push_Conditional --
- ----------------------
-
- procedure Push_Conditional (Cond : Conditional; Flag : Target_Type) is
- Will_Exclude : Boolean;
-
- begin
- -- If we are already in an excluding context, inherit this property,
- -- otherwise calculate it from scratch.
-
- if Conditional_TOS > 0
- and then Conditional_Stack (Conditional_TOS).Excluding
- then
- Will_Exclude := True;
- else
- case Cond is
- when Set =>
- Will_Exclude := Flag /= Target;
- when Clear =>
- Will_Exclude := Flag = Target;
- end case;
- end if;
-
- -- Check if the current directive is pointless because of a previous,
- -- enclosing directive.
-
- for J in 1 .. Conditional_TOS loop
- if Conditional_Stack (J).Flag = Flag then
- Warning (Source_File, "directive without effect because of line"
- & Integer'Image (Conditional_Stack (J).Starting_Line));
- end if;
- end loop;
-
- Conditional_TOS := Conditional_TOS + 1;
- Conditional_Stack (Conditional_TOS) :=
- (Starting_Line => Source_File.Line,
- Cond => Cond,
- Flag => Flag,
- Excluding => Will_Exclude);
- end Push_Conditional;
-
- ---------------------
- -- Pop_Conditional --
- ---------------------
-
- procedure Pop_Conditional (Cond : Conditional) is
- begin
- if Conditional_TOS > 0 then
- case Cond is
- when Set =>
- if Conditional_Stack (Conditional_TOS).Cond /= Set then
- Error (Source_File,
- "'@end ifset' does not match '@ifclear' at line"
- & Integer'Image (Conditional_Stack
- (Conditional_TOS).Starting_Line));
- end if;
-
- when Clear =>
- if Conditional_Stack (Conditional_TOS).Cond /= Clear then
- Error (Source_File,
- "'@end ifclear' does not match '@ifset' at line"
- & Integer'Image (Conditional_Stack
- (Conditional_TOS).Starting_Line));
- end if;
- end case;
-
- Conditional_TOS := Conditional_TOS - 1;
-
- else
- case Cond is
- when Set =>
- Error (Source_File,
- "'@end ifset' without corresponding '@ifset'");
-
- when Clear =>
- Error (Source_File,
- "'@end ifclear' without corresponding '@ifclear'");
- end case;
- end if;
- end Pop_Conditional;
-
- -------------------------
- -- Currently_Excluding --
- -------------------------
-
- function Currently_Excluding return Boolean is
- begin
- return Conditional_TOS > 0
- and then Conditional_Stack (Conditional_TOS).Excluding;
- end Currently_Excluding;
-
- ----------------------------
- -- VMS_Context_Determined --
- ----------------------------
-
- function VMS_Context_Determined return Boolean is
- begin
- for J in 1 .. Conditional_TOS loop
- if Conditional_Stack (J).Flag = VMS then
- return True;
- end if;
- end loop;
-
- return False;
- end VMS_Context_Determined;
-
- --------------------
- -- In_VMS_Section --
- --------------------
-
- function In_VMS_Section return Boolean is
- begin
- for J in 1 .. Conditional_TOS loop
- if Conditional_Stack (J).Flag = VMS then
- return Conditional_Stack (J).Cond = Set;
- end if;
- end loop;
-
- return False;
- end In_VMS_Section;
-
- ----------------------------------
- -- Check_No_Pending_Conditional --
- ----------------------------------
-
- procedure Check_No_Pending_Conditional is
- begin
- for J in 1 .. Conditional_TOS loop
- case Conditional_Stack (J).Cond is
- when Set =>
- Error (Source_File, "Missing '@end ifset' for '@ifset' at line"
- & Integer'Image (Conditional_Stack (J).Starting_Line));
-
- when Clear =>
- Error (Source_File,
- "Missing '@end ifclear' for '@ifclear' at line"
- & Integer'Image (Conditional_Stack (J).Starting_Line));
- end case;
- end loop;
- end Check_No_Pending_Conditional;
-
-- Start of processing for Xgnatugn
Valid_Command_Line : Boolean;
diff --git a/gcc/alias.c b/gcc/alias.c
index f327c187994..6551bc135b5 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1694,16 +1694,16 @@ find_base_term (rtx x)
term is from a pointer or is a named object or a special address
(like an argument or stack reference), then use it for the
base term. */
- tmp1 = find_base_term (tmp1);
- if (tmp1 != NULL_RTX
+ rtx base = find_base_term (tmp1);
+ if (base != NULL_RTX
&& ((REG_P (tmp1) && REG_POINTER (tmp1))
- || known_base_value_p (tmp1)))
- return tmp1;
- tmp2 = find_base_term (tmp2);
- if (tmp2 != NULL_RTX
+ || known_base_value_p (base)))
+ return base;
+ base = find_base_term (tmp2);
+ if (base != NULL_RTX
&& ((REG_P (tmp2) && REG_POINTER (tmp2))
- || known_base_value_p (tmp2)))
- return tmp2;
+ || known_base_value_p (base)))
+ return base;
/* We could not determine which of the two operands was the
base register and which was the index. So we can determine
diff --git a/gcc/asan.c b/gcc/asan.c
index 52a2dbc5dfd..36eccf93cbb 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -412,7 +412,8 @@ get_mem_ref_of_assignment (const gimple assignment,
{
gcc_assert (gimple_assign_single_p (assignment));
- if (gimple_store_p (assignment))
+ if (gimple_store_p (assignment)
+ && !gimple_clobber_p (assignment))
{
ref->start = gimple_assign_lhs (assignment);
*ref_is_store = true;
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index bd242839cf4..e1b19546435 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -87,16 +87,6 @@ enum cfg_edge_flags {
profile.c. */
extern const struct gcov_ctr_summary *profile_info;
-/* Working set size statistics for a given percentage of the entire
- profile (sum_all from the counter summary). */
-typedef struct gcov_working_set_info
-{
- /* Number of hot counters included in this working set. */
- unsigned num_counters;
- /* Smallest counter included in this working set. */
- gcov_type min_counter;
-} gcov_working_set_t;
-
/* Structure to gather statistic about profile consistency, per pass.
An array of this structure, indexed by pass static number, is allocated
in passes.c. The structure is defined here so that different CFG modes
@@ -513,6 +503,11 @@ struct edge_list
#define EDGE_FREQUENCY(e) RDIV ((e)->src->frequency * (e)->probability, \
REG_BR_PROB_BASE)
+/* Compute a scale factor (or probability) suitable for scaling of
+ gcov_type values via apply_probability(). */
+#define GCOV_COMPUTE_SCALE(num,den) \
+ ((den) ? RDIV ((num) * REG_BR_PROB_BASE, (den)) : REG_BR_PROB_BASE)
+
/* Return nonzero if edge is critical. */
#define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \
&& EDGE_COUNT ((e)->dest->preds) >= 2)
@@ -939,6 +934,7 @@ extern void rtl_profile_for_edge (edge);
extern void default_rtl_profile (void);
/* In profile.c. */
+typedef struct gcov_working_set_info gcov_working_set_t;
extern gcov_working_set_t *find_working_set(unsigned pct_times_10);
/* Check tha probability is sane. */
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 48d43a63dde..7605e17e7ef 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -1998,14 +1998,12 @@ fix_crossing_unconditional_branches (void)
if (JUMP_P (last_insn)
&& (succ->flags & EDGE_CROSSING))
{
- rtx label2;
-
gcc_assert (!any_condjump_p (last_insn));
/* Make sure the jump is not already an indirect or table jump. */
if (!computed_jump_p (last_insn)
- && !tablejump_p (last_insn, &label2, NULL))
+ && !tablejump_p (last_insn, NULL, NULL))
{
/* We have found a "crossing" unconditional branch. Now
we must convert it to an indirect jump. First create
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 471ae42e4c6..9ca1bd98dcd 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -1520,8 +1520,7 @@ struct rtl_opt_pass pass_branch_target_load_optimize1 =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_verify_rtl_sharing |
- TODO_ggc_collect, /* todo_flags_finish */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
}
};
@@ -1570,6 +1569,6 @@ struct rtl_opt_pass pass_branch_target_load_optimize2 =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect, /* todo_flags_finish */
+ 0, /* todo_flags_finish */
}
};
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 2c4cf175789..cfef93a0e82 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -76,6 +76,9 @@ const char * built_in_names[(int) END_BUILTINS] =
initialized to NULL_TREE. */
builtin_info_type builtin_info;
+/* Non-zero if __builtin_constant_p should be folded right away. */
+bool force_folding_builtin_constant_p;
+
static const char *c_getstr (tree);
static rtx c_readstr (const char *, enum machine_mode);
static int target_char_cast (tree, char *);
@@ -7057,7 +7060,8 @@ fold_builtin_constant_p (tree arg)
|| AGGREGATE_TYPE_P (TREE_TYPE (arg))
|| POINTER_TYPE_P (TREE_TYPE (arg))
|| cfun == 0
- || folding_initializer)
+ || folding_initializer
+ || force_folding_builtin_constant_p)
return integer_zero_node;
return NULL_TREE;
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index dd6cb296a44..96cf7bd1de0 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,17 @@
+2013-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table,
+ gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format
+ specifiers.
+
+2013-04-07 Steven Bosscher <steven@gcc.gnu.org>
+
+ * c-pragma.c (add_to_renaming_pragma_list): Fix leading comment.
+
+2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * c-common.c (pointer_int_sum): Remove dead code.
+
2013-03-09 Richard Sandiford <rdsandiford@googlemail.com>
PR middle-end/56524
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index c4d8bd3a0f1..0766f4b98c5 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -4300,12 +4300,6 @@ pointer_int_sum (location_t loc, enum tree_code resultcode,
"pointer to a function used in arithmetic");
size_exp = integer_one_node;
}
- else if (TREE_CODE (TREE_TYPE (result_type)) == METHOD_TYPE)
- {
- pedwarn (loc, pedantic ? OPT_Wpedantic : OPT_Wpointer_arith,
- "pointer to member function used in arithmetic");
- size_exp = integer_one_node;
- }
else
size_exp = size_in_bytes (TREE_TYPE (result_type));
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 8f1ffedbaf7..c11d93aa89d 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -654,9 +654,10 @@ static const format_char_info gcc_diag_char_table[] =
/* Custom conversion specifiers. */
/* These will require a "tree" at runtime. */
- { "K", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
+ { "K", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
- { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL },
+ { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL },
+ { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL },
{ "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL },
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
@@ -676,9 +677,10 @@ static const format_char_info gcc_tdiag_char_table[] =
/* These will require a "tree" at runtime. */
{ "DFKTEV", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL },
- { "v", 0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL },
+ { "v", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL },
- { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL },
+ { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL },
+ { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL },
{ "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL },
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
@@ -698,9 +700,10 @@ static const format_char_info gcc_cdiag_char_table[] =
/* These will require a "tree" at runtime. */
{ "DEFKTV", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL },
- { "v", 0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL },
+ { "v", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL },
- { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL },
+ { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL },
+ { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL },
{ "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL },
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
@@ -725,7 +728,8 @@ static const format_char_info gcc_cxxdiag_char_table[] =
/* These accept either an 'int' or an 'enum tree_code' (which is handled as an 'int'.) */
{ "CLOPQ",0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
- { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL },
+ { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL },
+ { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL },
{ "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL },
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
index f5795cc0ae1..536b9a72b2a 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
@@ -478,7 +478,7 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
add_to_renaming_pragma_list (oldname, newname);
}
-/* This is called from here and from ia64.c. */
+/* This is called from here and from ia64-c.c. */
void
add_to_renaming_pragma_list (tree oldname, tree newname)
{
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index a76fb3e8862..771a55742b8 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,11 @@
+2013-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/19449
+ * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p
+ argument. If set, or it temporarily for parsing of the first
+ argument into force_folding_builtin_constant_p.
+ (c_parser_postfix_expression): Adjust callers.
+
2013-03-21 Richard Biener <rguenther@suse.de>
* c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
index d4bcdb67e0a..941cc682ef7 100644
--- a/gcc/c/c-array-notation.c
+++ b/gcc/c/c-array-notation.c
@@ -51,6 +51,47 @@ struct inv_list
vec<tree, va_gc> *replacement;
};
+/* Returns false if there is a length mismatch among expressions
+ on the same dimension AND the same side of the equal sign. The exprs are
+ passed in through 2-D array **LIST where X and Y indicate first and
+ second dimension sizes of LIST, respectively. */
+static bool
+length_mismatch_in_expr_p (location_t loc, tree **list, size_t x, size_t y)
+{
+ size_t ii, jj;
+ tree start = NULL_TREE;
+ HOST_WIDE_INT l_start, l_node;
+ for (jj = 0; jj < y; jj++)
+ {
+ start = NULL_TREE;
+ for (ii = 0; ii < x; ii++)
+ {
+ if (!start)
+ start = list[ii][jj];
+ else if (TREE_CODE (start) == INTEGER_CST)
+ {
+ /* If start is a INTEGER, and list[ii][jj] is an integer then
+ check if they are equal. If they are not equal then return
+ true. */
+ if (TREE_CODE (list[ii][jj]) == INTEGER_CST)
+ {
+ l_node = int_cst_value (list[ii][jj]);
+ l_start = int_cst_value (start);
+ if (abs (l_start) != abs (l_node))
+ {
+ error_at (loc, "length mismatch in expression");
+ return true;
+ }
+ }
+ }
+ else
+ /* We set the start node as the current node just in case it turns
+ out to be an integer. */
+ start = list[ii][jj];
+ }
+ }
+ return false;
+}
/* Returns the rank of ARRAY through the *RANK. The user can specify whether
(s)he wants to step into array_notation-specific builtin functions
@@ -69,10 +110,20 @@ find_rank (tree array, bool ignore_builtin_fn, size_t *rank)
return;
else if (TREE_CODE (array) == ARRAY_NOTATION_REF)
{
- for (ii_tree = array;
- ii_tree && TREE_CODE (ii_tree) == ARRAY_NOTATION_REF;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree))
- current_rank++;
+ ii_tree = array;
+ while (ii_tree)
+ {
+ if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
+ {
+ current_rank++;
+ ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
+ }
+ else if (TREE_CODE (ii_tree) == ARRAY_REF)
+ ii_tree = TREE_OPERAND (ii_tree, 0);
+ else if (TREE_CODE (ii_tree) == PARM_DECL
+ || TREE_CODE (ii_tree) == VAR_DECL)
+ break;
+ }
if (*rank == 0)
*rank = current_rank;
}
@@ -415,7 +466,10 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
{
builtin_loop = fix_builtin_array_notation_fn (rhs_node, &new_var);
if (builtin_loop == error_mark_node)
- return error_mark_node;
+ {
+ pop_stmt_list (loop);
+ return error_mark_node;
+ }
else if (builtin_loop)
{
add_stmt (builtin_loop);
@@ -490,7 +544,7 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
rhs_base);
return error_mark_node;
}
-
+
/* Here we assign the array notation components to variable so that we can
satisfy the exec once rule. */
for (ii = 0; ii < lhs_list_size; ii++)
@@ -499,62 +553,79 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
tree array_begin = ARRAY_NOTATION_START (array_node);
tree array_lngth = ARRAY_NOTATION_LENGTH (array_node);
tree array_strde = ARRAY_NOTATION_STRIDE (array_node);
-
- begin_var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
- lngth_var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
- strde_var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
-
- add_stmt (build_modify_expr (location, begin_var, TREE_TYPE (begin_var),
- NOP_EXPR, location, array_begin,
- TREE_TYPE (array_begin)));
- add_stmt (build_modify_expr (location, lngth_var, TREE_TYPE (lngth_var),
- NOP_EXPR, location, array_lngth,
- TREE_TYPE (array_lngth)));
- add_stmt (build_modify_expr (location, strde_var, TREE_TYPE (strde_var),
- NOP_EXPR, location, array_strde,
- TREE_TYPE (array_strde)));
-
- ARRAY_NOTATION_START (array_node) = begin_var;
- ARRAY_NOTATION_LENGTH (array_node) = lngth_var;
- ARRAY_NOTATION_STRIDE (array_node) = strde_var;
- }
- for (ii = 0; ii < rhs_list_size; ii++)
- {
- tree array_node = (*rhs_list)[ii];
- if (array_node && TREE_CODE (array_node) == ARRAY_NOTATION_REF)
+
+ if (TREE_CODE (array_begin) != INTEGER_CST)
{
- tree array_begin = ARRAY_NOTATION_START (array_node);
- tree array_lngth = ARRAY_NOTATION_LENGTH (array_node);
- tree array_strde = ARRAY_NOTATION_STRIDE (array_node);
-
begin_var = build_decl (location, VAR_DECL, NULL_TREE,
integer_type_node);
- lngth_var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
- strde_var = build_decl (location, VAR_DECL, NULL_TREE,
- integer_type_node);
-
add_stmt (build_modify_expr (location, begin_var,
TREE_TYPE (begin_var),
NOP_EXPR, location, array_begin,
TREE_TYPE (array_begin)));
+ ARRAY_NOTATION_START (array_node) = begin_var;
+ }
+ if (TREE_CODE (array_lngth) != INTEGER_CST)
+ {
+ lngth_var = build_decl (location, VAR_DECL, NULL_TREE,
+ integer_type_node);
add_stmt (build_modify_expr (location, lngth_var,
TREE_TYPE (lngth_var),
NOP_EXPR, location, array_lngth,
TREE_TYPE (array_lngth)));
+ ARRAY_NOTATION_LENGTH (array_node) = lngth_var;
+ }
+ if (TREE_CODE (array_strde) != INTEGER_CST)
+ {
+ strde_var = build_decl (location, VAR_DECL, NULL_TREE,
+ integer_type_node);
+
add_stmt (build_modify_expr (location, strde_var,
TREE_TYPE (strde_var),
NOP_EXPR, location, array_strde,
- TREE_TYPE (array_strde)));
-
- ARRAY_NOTATION_START (array_node) = begin_var;
- ARRAY_NOTATION_LENGTH (array_node) = lngth_var;
+ TREE_TYPE (array_strde)));
ARRAY_NOTATION_STRIDE (array_node) = strde_var;
}
}
+ for (ii = 0; ii < rhs_list_size; ii++)
+ {
+ tree array_node = (*rhs_list)[ii];
+ if (array_node && TREE_CODE (array_node) == ARRAY_NOTATION_REF)
+ {
+ tree array_begin = ARRAY_NOTATION_START (array_node);
+ tree array_lngth = ARRAY_NOTATION_LENGTH (array_node);
+ tree array_strde = ARRAY_NOTATION_STRIDE (array_node);
+ if (TREE_CODE (array_begin) != INTEGER_CST)
+ {
+ begin_var = build_decl (location, VAR_DECL, NULL_TREE,
+ integer_type_node);
+ add_stmt (build_modify_expr (location, begin_var,
+ TREE_TYPE (begin_var),
+ NOP_EXPR, location, array_begin,
+ TREE_TYPE (array_begin)));
+ ARRAY_NOTATION_START (array_node) = begin_var;
+ }
+ if (TREE_CODE (array_lngth) != INTEGER_CST)
+ {
+ lngth_var = build_decl (location, VAR_DECL, NULL_TREE,
+ integer_type_node);
+ add_stmt (build_modify_expr (location, lngth_var,
+ TREE_TYPE (lngth_var),
+ NOP_EXPR, location, array_lngth,
+ TREE_TYPE (array_lngth)));
+ ARRAY_NOTATION_LENGTH (array_node) = lngth_var;
+ }
+ if (TREE_CODE (array_strde) != INTEGER_CST)
+ {
+ strde_var = build_decl (location, VAR_DECL, NULL_TREE,
+ integer_type_node);
+ add_stmt (build_modify_expr (location, strde_var,
+ TREE_TYPE (strde_var),
+ NOP_EXPR, location, array_strde,
+ TREE_TYPE (array_strde)));
+ ARRAY_NOTATION_STRIDE (array_node) = strde_var;
+ }
+ }
+ }
lhs_vector = XNEWVEC (bool *, lhs_list_size);
for (ii = 0; ii < lhs_list_size; ii++)
@@ -642,14 +713,26 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
if (lhs_rank)
{
for (ii = 0; ii < lhs_list_size; ii++)
+ for (jj = 0; jj < lhs_rank; jj++)
+ lhs_array[ii][jj] = NULL_TREE;
+
+ for (ii = 0; ii < lhs_list_size; ii++)
{
jj = 0;
- for (ii_tree = (*lhs_list)[ii];
- ii_tree && TREE_CODE (ii_tree) == ARRAY_NOTATION_REF;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree))
+ ii_tree = (*lhs_list)[ii];
+ while (ii_tree)
{
- lhs_array[ii][jj] = ii_tree;
- jj++;
+ if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
+ {
+ lhs_array[ii][jj] = ii_tree;
+ jj++;
+ ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
+ }
+ else if (TREE_CODE (ii_tree) == ARRAY_REF)
+ ii_tree = TREE_OPERAND (ii_tree, 0);
+ else if (TREE_CODE (ii_tree) == VAR_DECL
+ || TREE_CODE (ii_tree) == PARM_DECL)
+ break;
}
}
}
@@ -659,18 +742,31 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
if (rhs_rank)
{
for (ii = 0; ii < rhs_list_size; ii++)
+ for (jj = 0; jj < rhs_rank; jj++)
+ rhs_array[ii][jj] = NULL_TREE;
+ for (ii = 0; ii < rhs_list_size; ii++)
{
- jj = 0;
- for (ii_tree = (*rhs_list)[ii];
- ii_tree && TREE_CODE (ii_tree) == ARRAY_NOTATION_REF;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree))
+ jj = 0;
+ ii_tree = (*rhs_list)[ii];
+ while (ii_tree)
{
- rhs_array[ii][jj] = ii_tree;
- jj++;
+ if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
+ {
+ rhs_array[ii][jj] = ii_tree;
+ jj++;
+ ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
+ }
+ else if (TREE_CODE (ii_tree) == ARRAY_REF)
+ ii_tree = TREE_OPERAND (ii_tree, 0);
+ else if (TREE_CODE (ii_tree) == VAR_DECL
+ || TREE_CODE (ii_tree) == PARM_DECL)
+ break;
+ else if (TREE_CODE (ii_tree) == CALL_EXPR)
+ break;
}
}
}
-
+
for (ii = 0; ii < lhs_list_size; ii++)
{
tree lhs_node = (*lhs_list)[ii];
@@ -743,8 +839,31 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
rhs_vector[ii][jj] = false;
}
-
-
+ if (length_mismatch_in_expr_p (EXPR_LOCATION (lhs), lhs_length,
+ lhs_list_size, lhs_rank)
+ || length_mismatch_in_expr_p (EXPR_LOCATION (rhs), rhs_length,
+ rhs_list_size, rhs_rank))
+ {
+ pop_stmt_list (loop);
+ return error_mark_node;
+ }
+
+ if (lhs_list_size > 0 && rhs_list_size > 0)
+ if (TREE_CODE (lhs_length[0][0]) == INTEGER_CST
+ && TREE_CODE (rhs_length[0][0]) == INTEGER_CST)
+ {
+ HOST_WIDE_INT l_length = int_cst_value (lhs_length[0][0]);
+ HOST_WIDE_INT r_length = int_cst_value (rhs_length[0][0]);
+ /* The length can be negative or positive. As long as the
+ magnitude is OK, then the array notation is valid. */
+ if (abs (l_length) != abs (r_length))
+ {
+ error_at (location, "length mismatch between LHS and RHS");
+ pop_stmt_list (loop);
+ return error_mark_node;
+ }
+ }
+
for (ii = 0; ii < lhs_rank; ii++)
{
if (lhs_vector[0][ii])
@@ -1768,12 +1887,26 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
|| TREE_CODE (func_parm) == NOP_EXPR)
func_parm = TREE_OPERAND (func_parm, 0);
- find_rank (an_builtin_fn, true, &rank);
+ find_rank (func_parm, false, &rank);
location = EXPR_LOCATION (an_builtin_fn);
if (rank == 0)
- return an_builtin_fn;
+ {
+ if (an_type == REDUCE_ADD || an_type == REDUCE_MUL
+ || an_type == REDUCE_MAX || an_type == REDUCE_MIN
+ || an_type == REDUCE_ALL_ZEROS || an_type == REDUCE_ANY_ZEROS
+ || an_type == REDUCE_ANY_NONZEROS || an_type == REDUCE_ALL_NONZEROS
+ || an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX
+ || an_type == REDUCE_CUSTOM || an_type == REDUCE_MUTATING)
+ {
+ error_at (location, "array notation builtin functions cannot have"
+ " array notation parameter with zero rank");
+ return error_mark_node;
+ }
+ else
+ return an_builtin_fn;
+ }
else if (rank > 1
&& (an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX))
{
@@ -2109,9 +2242,14 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
TREE_TYPE (new_yes_expr), new_no_expr, TREE_TYPE (new_no_expr));
break;
case REDUCE_MAX:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, func_parm, new_var_type);
+ if (TYPE_MIN_VALUE (new_var_type))
+ new_var_init = build_modify_expr
+ (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
+ location, TYPE_MIN_VALUE (new_var_type), new_var_type);
+ else
+ new_var_init = build_modify_expr
+ (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
+ location, func_parm, new_var_type);
new_no_expr = build_modify_expr
(location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
location, *new_var, TREE_TYPE (*new_var));
@@ -2124,9 +2262,14 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
new_yes_expr, TREE_TYPE (*new_var), new_no_expr, TREE_TYPE (*new_var));
break;
case REDUCE_MIN:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, func_parm, new_var_type);
+ if (TYPE_MAX_VALUE (new_var_type))
+ new_var_init = build_modify_expr
+ (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
+ location, TYPE_MAX_VALUE (new_var_type), new_var_type);
+ else
+ new_var_init = build_modify_expr
+ (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
+ location, func_parm, new_var_type);
new_no_expr = build_modify_expr
(location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
location, *new_var, TREE_TYPE (*new_var));
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 6c5f219ad7e..855e3979c99 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -115,6 +115,8 @@ c_parse_init (void)
C_IS_RESERVED_WORD (id) = 1;
ridpointers [(int) c_common_reswords[i].rid] = id;
}
+ if (flag_enable_cilk)
+ p_simd_nodes_clear ();
}
/* The C lexer intermediates between the lexer in cpplib and c-lex.c
@@ -6270,11 +6272,13 @@ c_parser_alignof_expression (c_parser *parser)
stores the arguments in CEXPR_LIST. */
static bool
c_parser_get_builtin_args (c_parser *parser, const char *bname,
- vec<c_expr_t, va_gc> **ret_cexpr_list)
+ vec<c_expr_t, va_gc> **ret_cexpr_list,
+ bool choose_expr_p)
{
location_t loc = c_parser_peek_token (parser)->location;
vec<c_expr_t, va_gc> *cexpr_list;
c_expr_t expr;
+ bool saved_force_folding_builtin_constant_p;
*ret_cexpr_list = NULL;
if (c_parser_next_token_is_not (parser, CPP_OPEN_PAREN))
@@ -6291,7 +6295,12 @@ c_parser_get_builtin_args (c_parser *parser, const char *bname,
return true;
}
+ saved_force_folding_builtin_constant_p
+ = force_folding_builtin_constant_p;
+ force_folding_builtin_constant_p |= choose_expr_p;
expr = c_parser_expr_no_commas (parser, NULL);
+ force_folding_builtin_constant_p
+ = saved_force_folding_builtin_constant_p;
vec_alloc (cexpr_list, 1);
C_EXPR_APPEND (cexpr_list, expr);
while (c_parser_next_token_is (parser, CPP_COMMA))
@@ -6665,7 +6674,7 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_consume_token (parser);
if (!c_parser_get_builtin_args (parser,
"__builtin_choose_expr",
- &cexpr_list))
+ &cexpr_list, true))
{
expr.value = error_mark_node;
break;
@@ -6747,7 +6756,7 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_consume_token (parser);
if (!c_parser_get_builtin_args (parser,
"__builtin_complex",
- &cexpr_list))
+ &cexpr_list, false))
{
expr.value = error_mark_node;
break;
@@ -6809,7 +6818,7 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_consume_token (parser);
if (!c_parser_get_builtin_args (parser,
"__builtin_shuffle",
- &cexpr_list))
+ &cexpr_list, false))
{
expr.value = error_mark_node;
break;
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 0c1e425a00d..2bcd790d306 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -848,6 +848,7 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency,
/* Compute the probability of TAKEN_EDGE being reached via threaded edge.
Watch for overflows. */
if (bb->frequency)
+ /* Update to use GCOV_COMPUTE_SCALE. */
prob = edge_frequency * REG_BR_PROB_BASE / bb->frequency;
else
prob = 0;
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 1e0121dbc02..ac6aefb86df 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -545,8 +545,7 @@ compute_outgoing_frequencies (basic_block b)
probability = INTVAL (XEXP (note, 0));
e = BRANCH_EDGE (b);
e->probability = probability;
- e->count = ((b->count * probability + REG_BR_PROB_BASE / 2)
- / REG_BR_PROB_BASE);
+ e->count = apply_probability (b->count, probability);
f = FALLTHRU_EDGE (b);
f->probability = REG_BR_PROB_BASE - probability;
f->count = b->count - e->count;
@@ -583,8 +582,7 @@ compute_outgoing_frequencies (basic_block b)
if (b->count)
FOR_EACH_EDGE (e, ei, b->succs)
- e->count = ((b->count * e->probability + REG_BR_PROB_BASE / 2)
- / REG_BR_PROB_BASE);
+ e->count = apply_probability (b->count, e->probability);
}
/* Assume that some pass has inserted labels or control flow
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 471d293f12f..7764c6c9d2d 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -595,9 +595,7 @@ try_forward_edges (int mode, basic_block b)
/* We successfully forwarded the edge. Now update profile
data: for each edge we traversed in the chain, remove
the original edge's execution count. */
- edge_frequency = ((edge_probability * b->frequency
- + REG_BR_PROB_BASE / 2)
- / REG_BR_PROB_BASE);
+ edge_frequency = apply_probability (b->frequency, edge_probability);
do
{
@@ -3057,7 +3055,7 @@ struct rtl_opt_pass pass_jump =
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
- TODO_ggc_collect, /* todo_flags_start */
+ 0, /* todo_flags_start */
TODO_verify_rtl_sharing, /* todo_flags_finish */
}
};
@@ -3084,7 +3082,7 @@ struct rtl_opt_pass pass_jump2 =
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
- TODO_ggc_collect, /* todo_flags_start */
+ 0, /* todo_flags_start */
TODO_verify_rtl_sharing, /* todo_flags_finish */
}
};
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index b1ea6e56800..b9a0d6429cd 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4864,6 +4864,6 @@ struct rtl_opt_pass pass_expand =
PROP_ssa | PROP_trees, /* properties_destroyed */
TODO_verify_ssa | TODO_verify_flow
| TODO_verify_stmts, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 3e53aa0dddf..13efb7515f9 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -502,7 +502,7 @@ scale_loop_profile (struct loop *loop, int scale, gcov_type iteration_bound)
/* See if loop is predicted to iterate too many times. */
if (iteration_bound && iterations > 0
- && RDIV (iterations * scale, REG_BR_PROB_BASE) > iteration_bound)
+ && apply_probability (iterations, scale) > iteration_bound)
{
/* Fixing loop profile for different trip count is not trivial; the exit
probabilities has to be updated to match and frequencies propagated down
@@ -563,7 +563,8 @@ scale_loop_profile (struct loop *loop, int scale, gcov_type iteration_bound)
count_in += e->count;
if (count_in != 0)
- scale = RDIV (count_in * iteration_bound * REG_BR_PROB_BASE, loop->header->count);
+ scale = GCOV_COMPUTE_SCALE (count_in * iteration_bound,
+ loop->header->count);
}
else if (loop->header->frequency)
{
@@ -574,7 +575,8 @@ scale_loop_profile (struct loop *loop, int scale, gcov_type iteration_bound)
freq_in += EDGE_FREQUENCY (e);
if (freq_in != 0)
- scale = RDIV (freq_in * iteration_bound * REG_BR_PROB_BASE, loop->header->frequency);
+ scale = GCOV_COMPUTE_SCALE (freq_in * iteration_bound,
+ loop->header->frequency);
}
if (!scale)
scale = 1;
@@ -890,7 +892,7 @@ loopify (edge latch_edge, edge header_edge,
switch_bb->count = cnt;
FOR_EACH_EDGE (e, ei, switch_bb->succs)
{
- e->count = RDIV (switch_bb->count * e->probability, REG_BR_PROB_BASE);
+ e->count = apply_probability (switch_bb->count, e->probability);
}
}
scale_loop_frequencies (loop, false_scale, REG_BR_PROB_BASE);
@@ -1199,8 +1201,9 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
{
/* The blocks that are dominated by a removed exit edge ORIG have
frequencies scaled by this. */
- scale_after_exit = RDIV (REG_BR_PROB_BASE * REG_BR_PROB_BASE,
- REG_BR_PROB_BASE - orig->probability);
+ scale_after_exit
+ = GCOV_COMPUTE_SCALE (REG_BR_PROB_BASE,
+ REG_BR_PROB_BASE - orig->probability);
bbs_to_scale = BITMAP_ALLOC (NULL);
for (i = 0; i < n; i++)
{
@@ -1231,12 +1234,12 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
frequency should be reduced by prob_pass_wont_exit. Caller
should've managed the flags so all except for original loop
has won't exist set. */
- scale_act = RDIV (wanted_freq * REG_BR_PROB_BASE, freq_in);
+ scale_act = GCOV_COMPUTE_SCALE (wanted_freq, freq_in);
/* Now simulate the duplication adjustments and compute header
frequency of the last copy. */
for (i = 0; i < ndupl; i++)
- wanted_freq = RDIV (wanted_freq * scale_step[i], REG_BR_PROB_BASE);
- scale_main = RDIV (wanted_freq * REG_BR_PROB_BASE, freq_in);
+ wanted_freq = combine_probabilities (wanted_freq, scale_step[i]);
+ scale_main = GCOV_COMPUTE_SCALE (wanted_freq, freq_in);
}
else if (is_latch)
{
@@ -1248,16 +1251,16 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
for (i = 0; i < ndupl; i++)
{
scale_main += p;
- p = RDIV (p * scale_step[i], REG_BR_PROB_BASE);
+ p = combine_probabilities (p, scale_step[i]);
}
- scale_main = RDIV (REG_BR_PROB_BASE * REG_BR_PROB_BASE, scale_main);
- scale_act = RDIV (scale_main * prob_pass_main, REG_BR_PROB_BASE);
+ scale_main = GCOV_COMPUTE_SCALE (REG_BR_PROB_BASE, scale_main);
+ scale_act = combine_probabilities (scale_main, prob_pass_main);
}
else
{
scale_main = REG_BR_PROB_BASE;
for (i = 0; i < ndupl; i++)
- scale_main = RDIV (scale_main * scale_step[i], REG_BR_PROB_BASE);
+ scale_main = combine_probabilities (scale_main, scale_step[i]);
scale_act = REG_BR_PROB_BASE - prob_pass_thru;
}
for (i = 0; i < ndupl; i++)
@@ -1378,7 +1381,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
if (flags & DLTHE_FLAG_UPDATE_FREQ)
{
scale_bbs_frequencies_int (new_bbs, n, scale_act, REG_BR_PROB_BASE);
- scale_act = RDIV (scale_act * scale_step[j], REG_BR_PROB_BASE);
+ scale_act = combine_probabilities (scale_act, scale_step[j]);
}
}
free (new_bbs);
@@ -1638,8 +1641,8 @@ lv_adjust_loop_entry_edge (basic_block first_head, basic_block second_head,
current_ir_type () == IR_GIMPLE ? EDGE_TRUE_VALUE : 0);
e1->probability = then_prob;
e->probability = REG_BR_PROB_BASE - then_prob;
- e1->count = RDIV (e->count * e1->probability, REG_BR_PROB_BASE);
- e->count = RDIV (e->count * e->probability, REG_BR_PROB_BASE);
+ e1->count = apply_probability (e->count, e1->probability);
+ e->count = apply_probability (e->count, e->probability);
set_immediate_dominator (CDI_DOMINATORS, first_head, new_head);
set_immediate_dominator (CDI_DOMINATORS, second_head, new_head);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f715a761cc4..69ad004e9de 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -164,6 +164,8 @@ delete_insn (rtx insn)
{
/* If this insn has already been deleted, something is very wrong. */
gcc_assert (!INSN_DELETED_P (insn));
+ if (INSN_P (insn))
+ df_insn_delete (insn);
remove_insn (insn);
INSN_DELETED_P (insn) = 1;
}
@@ -1362,6 +1364,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
int prob = INTVAL (XEXP (note, 0));
b->probability = prob;
+ /* Update this to use GCOV_COMPUTE_SCALE. */
b->count = e->count * prob / REG_BR_PROB_BASE;
e->probability -= e->probability;
e->count -= b->count;
@@ -2684,6 +2687,7 @@ purge_dead_edges (basic_block bb)
f = FALLTHRU_EDGE (bb);
b->probability = INTVAL (XEXP (note, 0));
f->probability = REG_BR_PROB_BASE - b->probability;
+ /* Update these to use GCOV_COMPUTE_SCALE. */
b->count = bb->count * b->probability / REG_BR_PROB_BASE;
f->count = bb->count * f->probability / REG_BR_PROB_BASE;
}
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 930ccd862fe..693d4db9014 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1260,7 +1260,10 @@ cgraph_node_remove_callers (struct cgraph_node *node)
node->callers = NULL;
}
-/* Release memory used to represent body of function NODE. */
+/* Release memory used to represent body of function NODE.
+ Use this only for functions that are released before being translated to
+ target code (i.e. RTL). Functions that are compiled to RTL and beyond
+ are free'd in final.c via free_after_compilation(). */
void
cgraph_release_function_body (struct cgraph_node *node)
@@ -1285,6 +1288,7 @@ cgraph_release_function_body (struct cgraph_node *node)
gcc_assert (dom_computed[0] == DOM_NONE);
gcc_assert (dom_computed[1] == DOM_NONE);
clear_edges ();
+ cfun->cfg = NULL;
}
if (cfun->value_histograms)
free_histograms ();
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 9075e8a344f..aea6f41d34b 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -732,7 +732,7 @@ void debug_varpool_node_set (varpool_node_set);
void free_varpool_node_set (varpool_node_set);
void ipa_discover_readonly_nonaddressable_vars (void);
bool cgraph_comdat_can_be_unshared_p (struct cgraph_node *);
-bool varpool_externally_visible_p (struct varpool_node *, bool);
+bool varpool_externally_visible_p (struct varpool_node *);
/* In predict.c */
bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 3a2e3d679e2..fa6a9113a1e 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -102,6 +102,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
int freq_scale, bool update_original)
{
struct cgraph_edge *new_edge;
+ /* Update this to use GCOV_COMPUTE_SCALE. */
gcov_type count = e->count * count_scale / REG_BR_PROB_BASE;
gcov_type freq;
@@ -204,6 +205,7 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
if (new_node->count > n->count)
count_scale = REG_BR_PROB_BASE;
else
+ /* Update to use GCOV_COMPUTE_SCALE. */
count_scale = new_node->count * REG_BR_PROB_BASE / n->count;
}
else
diff --git a/gcc/cif-code.def b/gcc/cif-code.def
index 55e0ef45b3b..d1c49417325 100644
--- a/gcc/cif-code.def
+++ b/gcc/cif-code.def
@@ -48,7 +48,7 @@ DEFCIFCODE(REDEFINED_EXTERN_INLINE,
/* Function is not inlinable. */
DEFCIFCODE(FUNCTION_NOT_INLINABLE, N_("function not inlinable"))
-/* Function is not overwritable. */
+/* Function is overwritable. */
DEFCIFCODE(OVERWRITABLE, N_("function body can be overwritten at link time"))
/* Function is not an inlining candidate. */
diff --git a/gcc/cilk.c b/gcc/cilk.c
index 15868a22c12..1e3cbd10ab9 100644
--- a/gcc/cilk.c
+++ b/gcc/cilk.c
@@ -699,7 +699,6 @@ make_cilk_frame (tree fn)
DECL_CONTEXT (decl) = fn;
/* Magic to prevent assert failure. Easier than doing it right. */
DECL_SEEN_IN_BIND_EXPR_P (decl) = 1;
-
f->cilk_frame_decl = decl;
return decl;
}
diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
index 0a4d8a51d1d..7392b92b3f5 100644
--- a/gcc/combine-stack-adj.c
+++ b/gcc/combine-stack-adj.c
@@ -659,7 +659,6 @@ struct rtl_opt_pass pass_stack_adjustments =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect, /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/combine.c b/gcc/combine.c
index feb6267b490..6d58b19dbe9 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10759,8 +10759,9 @@ simplify_compare_const (enum rtx_code code, rtx op0, rtx *pop1)
&& (code == EQ || code == NE || code == GE || code == GEU
|| code == LT || code == LTU)
&& mode_width <= HOST_BITS_PER_WIDE_INT
- && exact_log2 (const_op) >= 0
- && nonzero_bits (op0, mode) == (unsigned HOST_WIDE_INT) const_op)
+ && exact_log2 (const_op & GET_MODE_MASK (mode)) >= 0
+ && (nonzero_bits (op0, mode)
+ == (unsigned HOST_WIDE_INT) (const_op & GET_MODE_MASK (mode))))
{
code = (code == EQ || code == GE || code == GEU ? NE : EQ);
const_op = 0;
@@ -13817,7 +13818,6 @@ struct rtl_opt_pass pass_combine =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect, /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/common.opt b/gcc/common.opt
index bdbd3b6cd9e..f0cb9e8075e 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -792,6 +792,11 @@ Driver Undocumented
; 7: The version of the ABI that treats nullptr_t as a builtin type and
; corrects the mangling of lambdas in default argument scope.
; First selectable in G++ 4.8.
+;
+; 8: The version of the ABI that corrects the substitution behavior of
+; function types with function-cv-qualifiers.
+; First selectable in G++ 4.9.
+;
; Additional positive integers will be assigned as new versions of
; the ABI become the default version of the ABI.
fabi-version=
@@ -1023,6 +1028,30 @@ fdiagnostics-show-caret
Common Var(flag_diagnostics_show_caret) Init(1)
Show the source line with a caret indicating the column
+fdiagnostics-color
+Common Alias(fdiagnostics-color=,always,never)
+;
+
+fdiagnostics-color=
+Common Joined RejectNegative Enum(diagnostic_color_rule)
+-fdiagnostics-color=[never|always|auto] Colorize diagnostics
+
+; Required for these enum values.
+SourceInclude
+diagnostic-color.h
+
+Enum
+Name(diagnostic_color_rule) Type(int)
+
+EnumValue
+Enum(diagnostic_color_rule) String(never) Value(DIAGNOSTICS_COLOR_NO)
+
+EnumValue
+Enum(diagnostic_color_rule) String(always) Value(DIAGNOSTICS_COLOR_YES)
+
+EnumValue
+Enum(diagnostic_color_rule) String(auto) Value(DIAGNOSTICS_COLOR_AUTO)
+
fdiagnostics-show-option
Common Var(flag_diagnostics_show_option) Init(1)
Amend appropriate diagnostic messages with the command line option that controls them
@@ -2303,9 +2332,13 @@ Common JoinedOrMissing
Generate debug information in default format
gcoff
-Common JoinedOrMissing Negative(gdwarf-)
+Common JoinedOrMissing Negative(gdwarf)
Generate debug information in COFF format
+gdwarf
+Common JoinedOrMissing Negative(gdwarf-)
+Generate debug information in default version of DWARF format
+
gdwarf-
Common Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs)
Generate debug information in DWARF v2 (or later) format
diff --git a/gcc/compare-elim.c b/gcc/compare-elim.c
index 81b0c2d3050..367cd8ea8dc 100644
--- a/gcc/compare-elim.c
+++ b/gcc/compare-elim.c
@@ -669,7 +669,6 @@ struct rtl_opt_pass pass_compare_elim_after_reload =
0, /* todo_flags_start */
TODO_df_finish
| TODO_df_verify
- | TODO_verify_rtl_sharing
- | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/config.gcc b/gcc/config.gcc
index e51db91478c..44ed19075e9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -878,7 +878,7 @@ arm*-*-linux-*) # ARM GNU/Linux with ELF
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
esac
- tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-linux-android"
+ tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h"
extra_objs="$extra_objs linux-android.o"
# Define multilib configuration for arm-linux-androideabi.
diff --git a/gcc/config.in b/gcc/config.in
index de8271bcfe2..66e47caa3ff 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1205,7 +1205,8 @@
#endif
-/* Define if your linker supports --as-needed and --no-as-needed options. */
+/* Define if your linker supports --as-needed/--no-as-needed or equivalent
+ options. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_AS_NEEDED
#endif
@@ -1642,12 +1643,24 @@
#endif
+/* Define to the linker option to ignore unused dependencies. */
+#ifndef USED_FOR_TARGET
+#undef LD_AS_NEEDED_OPTION
+#endif
+
+
/* Define to the linker option to enable use of shared objects. */
#ifndef USED_FOR_TARGET
#undef LD_DYNAMIC_OPTION
#endif
+/* Define to the linker option to keep unused dependencies. */
+#ifndef USED_FOR_TARGET
+#undef LD_NO_AS_NEEDED_OPTION
+#endif
+
+
/* Define to the linker option to disable use of shared objects. */
#ifndef USED_FOR_TARGET
#undef LD_STATIC_OPTION
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index 5d0072f9da7..7ebbf51a201 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -151,6 +151,7 @@ bool aarch64_regno_ok_for_base_p (int, bool);
bool aarch64_regno_ok_for_index_p (int, bool);
bool aarch64_simd_imm_scalar_p (rtx x, enum machine_mode mode);
bool aarch64_simd_imm_zero_p (rtx, enum machine_mode);
+bool aarch64_simd_scalar_immediate_valid_for_move (rtx, enum machine_mode);
bool aarch64_simd_shift_imm_p (rtx, enum machine_mode, bool);
bool aarch64_symbolic_address_p (rtx);
bool aarch64_symbolic_constant_p (rtx, enum aarch64_symbol_context,
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index 92dcfc0c57b..f72a2e2ff4b 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -1622,6 +1622,7 @@
"TARGET_SIMD"
{
int inverse = 0;
+ int use_zero_form = 0;
int swap_bsl_operands = 0;
rtx mask = gen_reg_rtx (<V_cmp_result>mode);
rtx tmp = gen_reg_rtx (<V_cmp_result>mode);
@@ -1632,12 +1633,16 @@
switch (GET_CODE (operands[3]))
{
case GE:
+ case GT:
case LE:
+ case LT:
case EQ:
- if (!REG_P (operands[5])
- && (operands[5] != CONST0_RTX (<MODE>mode)))
- operands[5] = force_reg (<MODE>mode, operands[5]);
- break;
+ if (operands[5] == CONST0_RTX (<MODE>mode))
+ {
+ use_zero_form = 1;
+ break;
+ }
+ /* Fall through. */
default:
if (!REG_P (operands[5]))
operands[5] = force_reg (<MODE>mode, operands[5]);
@@ -1688,7 +1693,26 @@
a GT b -> a GT b
a LE b -> b GE a
a LT b -> b GT a
- a EQ b -> a EQ b */
+ a EQ b -> a EQ b
+ Note that there also exist direct comparison against 0 forms,
+ so catch those as a special case. */
+ if (use_zero_form)
+ {
+ inverse = 0;
+ switch (GET_CODE (operands[3]))
+ {
+ case LT:
+ base_comparison = gen_aarch64_cmlt<mode>;
+ break;
+ case LE:
+ base_comparison = gen_aarch64_cmle<mode>;
+ break;
+ default:
+ /* Do nothing, other zero form cases already have the correct
+ base_comparison. */
+ break;
+ }
+ }
if (!inverse)
emit_insn (base_comparison (mask, operands[4], operands[5]));
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6a024d09044..68f847a2977 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -3087,7 +3087,8 @@ aarch64_select_cc_mode (RTX_CODE code, rtx x, rtx y)
if ((GET_MODE (x) == SImode || GET_MODE (x) == DImode)
&& y == const0_rtx
&& (code == EQ || code == NE || code == LT || code == GE)
- && (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS || GET_CODE (x) == AND))
+ && (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS || GET_CODE (x) == AND
+ || GET_CODE (x) == NEG))
return CC_NZmode;
/* A compare with a shifted operand. Because of canonicalization,
@@ -4070,7 +4071,7 @@ aarch64_output_casesi (rtx *operands)
{
char buf[100];
char label[100];
- rtx diff_vec = PATTERN (next_real_insn (operands[2]));
+ rtx diff_vec = PATTERN (next_active_insn (operands[2]));
int index;
static const char *const patterns[4][2] =
{
@@ -6407,6 +6408,21 @@ aarch64_simd_gen_const_vector_dup (enum machine_mode mode, int val)
return gen_rtx_CONST_VECTOR (mode, v);
}
+/* Check OP is a legal scalar immediate for the MOVI instruction. */
+
+bool
+aarch64_simd_scalar_immediate_valid_for_move (rtx op, enum machine_mode mode)
+{
+ enum machine_mode vmode;
+
+ gcc_assert (!VECTOR_MODE_P (mode));
+ vmode = aarch64_preferred_simd_mode (mode);
+ rtx op_v = aarch64_simd_gen_const_vector_dup (vmode, INTVAL (op));
+ int retval = aarch64_simd_immediate_valid_for_move (op_v, vmode, 0,
+ NULL, NULL, NULL, NULL);
+ return retval;
+}
+
/* Construct and return a PARALLEL RTX vector. */
rtx
aarch64_simd_vect_par_cnst_half (enum machine_mode mode, bool high)
@@ -7065,12 +7081,30 @@ aarch64_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
}
static void
+aarch64_print_extension (void)
+{
+ const struct aarch64_option_extension *opt = NULL;
+
+ for (opt = all_extensions; opt->name != NULL; opt++)
+ if ((aarch64_isa_flags & opt->flags_on) == opt->flags_on)
+ asm_fprintf (asm_out_file, "+%s", opt->name);
+
+ asm_fprintf (asm_out_file, "\n");
+}
+
+static void
aarch64_start_file (void)
{
if (selected_arch)
- asm_fprintf (asm_out_file, "\t.arch %s\n", selected_arch->name);
+ {
+ asm_fprintf (asm_out_file, "\t.arch %s", selected_arch->name);
+ aarch64_print_extension ();
+ }
else if (selected_cpu)
- asm_fprintf (asm_out_file, "\t.cpu %s\n", selected_cpu->name);
+ {
+ asm_fprintf (asm_out_file, "\t.cpu %s", selected_cpu->name);
+ aarch64_print_extension ();
+ }
default_file_start();
}
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index c3efd2a887f..a08797b1e76 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -709,6 +709,8 @@ do { \
#define SELECT_CC_MODE(OP, X, Y) aarch64_select_cc_mode (OP, X, Y)
+#define REVERSIBLE_CC_MODE(MODE) 1
+
#define REVERSE_CONDITION(CODE, MODE) \
(((MODE) == CCFPmode || (MODE) == CCFPEmode) \
? reverse_condition_maybe_unordered (CODE) \
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index ab73ae3c673..dab5b40d59f 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -763,19 +763,23 @@
)
(define_insn "*mov<mode>_aarch64"
- [(set (match_operand:SHORT 0 "nonimmediate_operand" "=r,r,r,m, r,*w")
- (match_operand:SHORT 1 "general_operand" " r,M,m,rZ,*w,r"))]
+ [(set (match_operand:SHORT 0 "nonimmediate_operand" "=r,r, *w,r,*w, m, m, r,*w,*w")
+ (match_operand:SHORT 1 "general_operand" " r,M,D<hq>,m, m,rZ,*w,*w, r,*w"))]
"(register_operand (operands[0], <MODE>mode)
|| aarch64_reg_or_zero (operands[1], <MODE>mode))"
"@
mov\\t%w0, %w1
mov\\t%w0, %1
+ movi\\t%0.<Vallxd>, %1
ldr<size>\\t%w0, %1
+ ldr\\t%<size>0, %1
str<size>\\t%w1, %0
+ str\\t%<size>1, %0
umov\\t%w0, %1.<v>[0]
- dup\\t%0.<Vallxd>, %w1"
- [(set_attr "v8type" "move,alu,load1,store1,*,*")
- (set_attr "simd_type" "*,*,*,*,simd_movgp,simd_dupgp")
+ dup\\t%0.<Vallxd>, %w1
+ dup\\t%0, %1.<v>[0]"
+ [(set_attr "v8type" "move,alu,alu,load1,load1,store1,store1,*,*,*")
+ (set_attr "simd_type" "*,*,simd_move_imm,*,*,*,*,simd_movgp,simd_dupgp,simd_dup")
(set_attr "mode" "<MODE>")
(set_attr "simd_mode" "<MODE>")]
)
@@ -1149,13 +1153,14 @@
)
(define_insn "*zero_extend<SHORT:mode><GPI:mode>2_aarch64"
- [(set (match_operand:GPI 0 "register_operand" "=r,r")
- (zero_extend:GPI (match_operand:SHORT 1 "nonimmediate_operand" "r,m")))]
+ [(set (match_operand:GPI 0 "register_operand" "=r,r,*w")
+ (zero_extend:GPI (match_operand:SHORT 1 "nonimmediate_operand" "r,m,m")))]
""
"@
uxt<SHORT:size>\t%<GPI:w>0, %w1
- ldr<SHORT:size>\t%w0, %1"
- [(set_attr "v8type" "extend,load1")
+ ldr<SHORT:size>\t%w0, %1
+ ldr\t%<SHORT:size>0, %1"
+ [(set_attr "v8type" "extend,load1,load1")
(set_attr "mode" "<GPI:MODE>")]
)
@@ -1896,6 +1901,21 @@
(set_attr "mode" "SI")]
)
+(define_insn "*neg_<shift><mode>3_compare0"
+ [(set (reg:CC_NZ CC_REGNUM)
+ (compare:CC_NZ
+ (neg:GPI (ASHIFT:GPI
+ (match_operand:GPI 1 "register_operand" "r")
+ (match_operand:QI 2 "aarch64_shift_imm_<mode>" "n")))
+ (const_int 0)))
+ (set (match_operand:GPI 0 "register_operand" "=r")
+ (neg:GPI (ASHIFT:GPI (match_dup 1) (match_dup 2))))]
+ ""
+ "negs\\t%<w>0, %<w>1, <shift> %2"
+ [(set_attr "v8type" "alus_shift")
+ (set_attr "mode" "<MODE>")]
+)
+
(define_insn "*neg_<shift>_<mode>2"
[(set (match_operand:GPI 0 "register_operand" "=r")
(neg:GPI (ASHIFT:GPI
diff --git a/gcc/config/aarch64/constraints.md b/gcc/config/aarch64/constraints.md
index 917b93922cd..18ac16a3160 100644
--- a/gcc/config/aarch64/constraints.md
+++ b/gcc/config/aarch64/constraints.md
@@ -152,6 +152,22 @@
NULL, NULL, NULL,
NULL, NULL) != 0")))
+(define_constraint "Dh"
+ "@internal
+ A constraint that matches an immediate operand valid for\
+ AdvSIMD scalar move in HImode."
+ (and (match_code "const_int")
+ (match_test "aarch64_simd_scalar_immediate_valid_for_move (op,
+ HImode)")))
+
+(define_constraint "Dq"
+ "@internal
+ A constraint that matches an immediate operand valid for\
+ AdvSIMD scalar move in QImode."
+ (and (match_code "const_int")
+ (match_test "aarch64_simd_scalar_immediate_valid_for_move (op,
+ QImode)")))
+
(define_constraint "Dl"
"@internal
A constraint that matches vector of immediates for left shifts."
diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md
index ce81ac5ce87..863a4af0346 100644
--- a/gcc/config/aarch64/iterators.md
+++ b/gcc/config/aarch64/iterators.md
@@ -249,6 +249,9 @@
;; 32-bit version and "%x0" in the 64-bit version.
(define_mode_attr w [(QI "w") (HI "w") (SI "w") (DI "x") (SF "s") (DF "d")])
+;; For constraints used in scalar immediate vector moves
+(define_mode_attr hq [(HI "h") (QI "q")])
+
;; For scalar usage of vector/FP registers
(define_mode_attr v [(QI "b") (HI "h") (SI "s") (DI "d")
(V8QI "") (V16QI "")
diff --git a/gcc/config/arm/arm-arches.def b/gcc/config/arm/arm-arches.def
index 613163081ca..fcf34012262 100644
--- a/gcc/config/arm/arm-arches.def
+++ b/gcc/config/arm/arm-arches.def
@@ -53,6 +53,6 @@ ARM_ARCH("armv7-a", cortexa8, 7A, FL_CO_PROC | FL_FOR_ARCH7A)
ARM_ARCH("armv7-r", cortexr4, 7R, FL_CO_PROC | FL_FOR_ARCH7R)
ARM_ARCH("armv7-m", cortexm3, 7M, FL_CO_PROC | FL_FOR_ARCH7M)
ARM_ARCH("armv7e-m", cortexm4, 7EM, FL_CO_PROC | FL_FOR_ARCH7EM)
-ARM_ARCH("armv8-a", cortexa15, 8A, FL_CO_PROC | FL_FOR_ARCH8A)
+ARM_ARCH("armv8-a", cortexa53, 8A, FL_CO_PROC | FL_FOR_ARCH8A)
ARM_ARCH("iwmmxt", iwmmxt, 5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
ARM_ARCH("iwmmxt2", iwmmxt2, 5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2)
diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
index 185f78e7b00..3d59fa6f5a9 100644
--- a/gcc/config/arm/arm-cores.def
+++ b/gcc/config/arm/arm-cores.def
@@ -129,6 +129,7 @@ ARM_CORE("cortex-a7", cortexa7, 7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV
ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, cortex)
ARM_CORE("cortex-a9", cortexa9, 7A, FL_LDSCHED, cortex_a9)
ARM_CORE("cortex-a15", cortexa15, 7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, cortex_a15)
+ARM_CORE("cortex-a53", cortexa53, 8A, FL_LDSCHED, cortex_a5)
ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, cortex)
ARM_CORE("cortex-r4f", cortexr4f, 7R, FL_LDSCHED, cortex)
ARM_CORE("cortex-r5", cortexr5, 7R, FL_LDSCHED | FL_ARM_DIV, cortex)
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 694aa2802ae..a6af9275712 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -78,6 +78,7 @@ extern char *neon_output_shift_immediate (const char *, char, rtx *,
extern void neon_pairwise_reduce (rtx, rtx, enum machine_mode,
rtx (*) (rtx, rtx, rtx));
extern rtx neon_make_constant (rtx);
+extern tree arm_builtin_vectorized_function (tree, tree, tree);
extern void neon_expand_vector_init (rtx, rtx);
extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
extern void neon_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
@@ -117,6 +118,7 @@ extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
extern bool offset_ok_for_ldrd_strd (HOST_WIDE_INT);
extern bool operands_ok_ldrd_strd (rtx, rtx, rtx, HOST_WIDE_INT, bool, bool);
+extern bool gen_operands_ldrd_strd (rtx *, bool, bool, bool);
extern int arm_gen_movmemqi (rtx *);
extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
extern enum machine_mode arm_select_dominance_cc_mode (rtx, rtx,
diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt
index ad52d18915d..bf206959569 100644
--- a/gcc/config/arm/arm-tables.opt
+++ b/gcc/config/arm/arm-tables.opt
@@ -250,6 +250,9 @@ EnumValue
Enum(processor_type) String(cortex-a15) Value(cortexa15)
EnumValue
+Enum(processor_type) String(cortex-a53) Value(cortexa53)
+
+EnumValue
Enum(processor_type) String(cortex-r4) Value(cortexr4)
EnumValue
diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
index ac85f94b3fd..e4da0988b22 100644
--- a/gcc/config/arm/arm-tune.md
+++ b/gcc/config/arm/arm-tune.md
@@ -1,5 +1,5 @@
;; -*- buffer-read-only: t -*-
;; Generated automatically by gentune.sh from arm-cores.def
(define_attr "tune"
- "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,fa526,fa626,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,fa606te,fa626te,fmp626,fa726te,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,genericv7a,cortexa5,cortexa7,cortexa8,cortexa9,cortexa15,cortexr4,cortexr4f,cortexr5,cortexr7,cortexm4,cortexm3,cortexm1,cortexm0,cortexm0plus,marvell_pj4"
+ "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,fa526,fa626,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,fa606te,fa626te,fmp626,fa726te,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,arm1156t2fs,genericv7a,cortexa5,cortexa7,cortexa8,cortexa9,cortexa15,cortexa53,cortexr4,cortexr4f,cortexr5,cortexr7,cortexm4,cortexm3,cortexm1,cortexm0,cortexm0plus,marvell_pj4"
(const (symbol_ref "((enum attr_tune) arm_tune)")))
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 88165f27da4..89affa7c8bd 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -620,6 +620,13 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_CLASS_LIKELY_SPILLED_P
#define TARGET_CLASS_LIKELY_SPILLED_P arm_class_likely_spilled_p
+#undef TARGET_VECTORIZE_BUILTINS
+#define TARGET_VECTORIZE_BUILTINS
+
+#undef TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
+#define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \
+ arm_builtin_vectorized_function
+
#undef TARGET_VECTOR_ALIGNMENT
#define TARGET_VECTOR_ALIGNMENT arm_vector_alignment
@@ -2639,6 +2646,9 @@ const_ok_for_dimode_op (HOST_WIDE_INT i, enum rtx_code code)
switch (code)
{
+ case AND:
+ return (const_ok_for_op (hi_val, code) || hi_val == 0xFFFFFFFF)
+ && (const_ok_for_op (lo_val, code) || lo_val == 0xFFFFFFFF);
case PLUS:
return arm_not_operand (hi, SImode) && arm_add_operand (lo, SImode);
@@ -12629,6 +12639,277 @@ operands_ok_ldrd_strd (rtx rt, rtx rt2, rtx rn, HOST_WIDE_INT offset,
return true;
}
+/* Helper for gen_operands_ldrd_strd. Returns true iff the memory
+ operand ADDR is an immediate offset from the base register and is
+ not volatile, in which case it sets BASE and OFFSET
+ accordingly. */
+bool
+mem_ok_for_ldrd_strd (rtx addr, rtx *base, rtx *offset)
+{
+ /* TODO: Handle more general memory operand patterns, such as
+ PRE_DEC and PRE_INC. */
+
+ /* Convert a subreg of mem into mem itself. */
+ if (GET_CODE (addr) == SUBREG)
+ addr = alter_subreg (&addr, true);
+
+ gcc_assert (MEM_P (addr));
+
+ /* Don't modify volatile memory accesses. */
+ if (MEM_VOLATILE_P (addr))
+ return false;
+
+ *offset = const0_rtx;
+
+ addr = XEXP (addr, 0);
+ if (REG_P (addr))
+ {
+ *base = addr;
+ return true;
+ }
+ else if (GET_CODE (addr) == PLUS || GET_CODE (addr) == MINUS)
+ {
+ *base = XEXP (addr, 0);
+ *offset = XEXP (addr, 1);
+ return (REG_P (*base) && CONST_INT_P (*offset));
+ }
+
+ return false;
+}
+
+#define SWAP_RTX(x,y) do { rtx tmp = x; x = y; y = tmp; } while (0)
+
+/* Called from a peephole2 to replace two word-size accesses with a
+ single LDRD/STRD instruction. Returns true iff we can generate a
+ new instruction sequence. That is, both accesses use the same base
+ register and the gap between constant offsets is 4. This function
+ may reorder its operands to match ldrd/strd RTL templates.
+ OPERANDS are the operands found by the peephole matcher;
+ OPERANDS[0,1] are register operands, and OPERANDS[2,3] are the
+ corresponding memory operands. LOAD indicaates whether the access
+ is load or store. CONST_STORE indicates a store of constant
+ integer values held in OPERANDS[4,5] and assumes that the pattern
+ is of length 4 insn, for the purpose of checking dead registers.
+ COMMUTE indicates that register operands may be reordered. */
+bool
+gen_operands_ldrd_strd (rtx *operands, bool load,
+ bool const_store, bool commute)
+{
+ int nops = 2;
+ HOST_WIDE_INT offsets[2], offset;
+ rtx base = NULL_RTX;
+ rtx cur_base, cur_offset, tmp;
+ int i, gap;
+ HARD_REG_SET regset;
+
+ gcc_assert (!const_store || !load);
+ /* Check that the memory references are immediate offsets from the
+ same base register. Extract the base register, the destination
+ registers, and the corresponding memory offsets. */
+ for (i = 0; i < nops; i++)
+ {
+ if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset))
+ return false;
+
+ if (i == 0)
+ base = cur_base;
+ else if (REGNO (base) != REGNO (cur_base))
+ return false;
+
+ offsets[i] = INTVAL (cur_offset);
+ if (GET_CODE (operands[i]) == SUBREG)
+ {
+ tmp = SUBREG_REG (operands[i]);
+ gcc_assert (GET_MODE (operands[i]) == GET_MODE (tmp));
+ operands[i] = tmp;
+ }
+ }
+
+ /* Make sure there is no dependency between the individual loads. */
+ if (load && REGNO (operands[0]) == REGNO (base))
+ return false; /* RAW */
+
+ if (load && REGNO (operands[0]) == REGNO (operands[1]))
+ return false; /* WAW */
+
+ /* If the same input register is used in both stores
+ when storing different constants, try to find a free register.
+ For example, the code
+ mov r0, 0
+ str r0, [r2]
+ mov r0, 1
+ str r0, [r2, #4]
+ can be transformed into
+ mov r1, 0
+ strd r1, r0, [r2]
+ in Thumb mode assuming that r1 is free. */
+ if (const_store
+ && REGNO (operands[0]) == REGNO (operands[1])
+ && INTVAL (operands[4]) != INTVAL (operands[5]))
+ {
+ if (TARGET_THUMB2)
+ {
+ CLEAR_HARD_REG_SET (regset);
+ tmp = peep2_find_free_register (0, 4, "r", SImode, &regset);
+ if (tmp == NULL_RTX)
+ return false;
+
+ /* Use the new register in the first load to ensure that
+ if the original input register is not dead after peephole,
+ then it will have the correct constant value. */
+ operands[0] = tmp;
+ }
+ else if (TARGET_ARM)
+ {
+ return false;
+ int regno = REGNO (operands[0]);
+ if (!peep2_reg_dead_p (4, operands[0]))
+ {
+ /* When the input register is even and is not dead after the
+ pattern, it has to hold the second constant but we cannot
+ form a legal STRD in ARM mode with this register as the second
+ register. */
+ if (regno % 2 == 0)
+ return false;
+
+ /* Is regno-1 free? */
+ SET_HARD_REG_SET (regset);
+ CLEAR_HARD_REG_BIT(regset, regno - 1);
+ tmp = peep2_find_free_register (0, 4, "r", SImode, &regset);
+ if (tmp == NULL_RTX)
+ return false;
+
+ operands[0] = tmp;
+ }
+ else
+ {
+ /* Find a DImode register. */
+ CLEAR_HARD_REG_SET (regset);
+ tmp = peep2_find_free_register (0, 4, "r", DImode, &regset);
+ if (tmp != NULL_RTX)
+ {
+ operands[0] = simplify_gen_subreg (SImode, tmp, DImode, 0);
+ operands[1] = simplify_gen_subreg (SImode, tmp, DImode, 4);
+ }
+ else
+ {
+ /* Can we use the input register to form a DI register? */
+ SET_HARD_REG_SET (regset);
+ CLEAR_HARD_REG_BIT(regset,
+ regno % 2 == 0 ? regno + 1 : regno - 1);
+ tmp = peep2_find_free_register (0, 4, "r", SImode, &regset);
+ if (tmp == NULL_RTX)
+ return false;
+ operands[regno % 2 == 1 ? 0 : 1] = tmp;
+ }
+ }
+
+ gcc_assert (operands[0] != NULL_RTX);
+ gcc_assert (operands[1] != NULL_RTX);
+ gcc_assert (REGNO (operands[0]) % 2 == 0);
+ gcc_assert (REGNO (operands[1]) == REGNO (operands[0]) + 1);
+ }
+ }
+
+ /* Make sure the instructions are ordered with lower memory access first. */
+ if (offsets[0] > offsets[1])
+ {
+ gap = offsets[0] - offsets[1];
+ offset = offsets[1];
+
+ /* Swap the instructions such that lower memory is accessed first. */
+ SWAP_RTX (operands[0], operands[1]);
+ SWAP_RTX (operands[2], operands[3]);
+ if (const_store)
+ SWAP_RTX (operands[4], operands[5]);
+ }
+ else
+ {
+ gap = offsets[1] - offsets[0];
+ offset = offsets[0];
+ }
+
+ /* Make sure accesses are to consecutive memory locations. */
+ if (gap != 4)
+ return false;
+
+ /* Make sure we generate legal instructions. */
+ if (operands_ok_ldrd_strd (operands[0], operands[1], base, offset,
+ false, load))
+ return true;
+
+ /* In Thumb state, where registers are almost unconstrained, there
+ is little hope to fix it. */
+ if (TARGET_THUMB2)
+ return false;
+
+ if (load && commute)
+ {
+ /* Try reordering registers. */
+ SWAP_RTX (operands[0], operands[1]);
+ if (operands_ok_ldrd_strd (operands[0], operands[1], base, offset,
+ false, load))
+ return true;
+ }
+
+ if (const_store)
+ {
+ /* If input registers are dead after this pattern, they can be
+ reordered or replaced by other registers that are free in the
+ current pattern. */
+ if (!peep2_reg_dead_p (4, operands[0])
+ || !peep2_reg_dead_p (4, operands[1]))
+ return false;
+
+ /* Try to reorder the input registers. */
+ /* For example, the code
+ mov r0, 0
+ mov r1, 1
+ str r1, [r2]
+ str r0, [r2, #4]
+ can be transformed into
+ mov r1, 0
+ mov r0, 1
+ strd r0, [r2]
+ */
+ if (operands_ok_ldrd_strd (operands[1], operands[0], base, offset,
+ false, false))
+ {
+ SWAP_RTX (operands[0], operands[1]);
+ return true;
+ }
+
+ /* Try to find a free DI register. */
+ CLEAR_HARD_REG_SET (regset);
+ add_to_hard_reg_set (&regset, SImode, REGNO (operands[0]));
+ add_to_hard_reg_set (&regset, SImode, REGNO (operands[1]));
+ while (true)
+ {
+ tmp = peep2_find_free_register (0, 4, "r", DImode, &regset);
+ if (tmp == NULL_RTX)
+ return false;
+
+ /* DREG must be an even-numbered register in DImode.
+ Split it into SI registers. */
+ operands[0] = simplify_gen_subreg (SImode, tmp, DImode, 0);
+ operands[1] = simplify_gen_subreg (SImode, tmp, DImode, 4);
+ gcc_assert (operands[0] != NULL_RTX);
+ gcc_assert (operands[1] != NULL_RTX);
+ gcc_assert (REGNO (operands[0]) % 2 == 0);
+ gcc_assert (REGNO (operands[0]) + 1 == REGNO (operands[1]));
+
+ return (operands_ok_ldrd_strd (operands[0], operands[1],
+ base, offset,
+ false, load));
+ }
+ }
+
+ return false;
+}
+#undef SWAP_RTX
+
+
+
/* Print a symbolic form of X to the debug file, F. */
static void
@@ -12821,8 +13102,8 @@ is_jump_table (rtx insn)
rtx table;
if (jump_to_label_p (insn)
- && ((table = next_real_insn (JUMP_LABEL (insn)))
- == next_real_insn (insn))
+ && ((table = next_active_insn (JUMP_LABEL (insn)))
+ == next_active_insn (insn))
&& table != NULL
&& JUMP_TABLE_DATA_P (table))
return table;
@@ -14818,7 +15099,8 @@ output_move_double (rtx *operands, bool emit, int *count)
{
/* Constraints should ensure this. */
gcc_assert (code0 == MEM && code1 == REG);
- gcc_assert (REGNO (operands[1]) != IP_REGNUM);
+ gcc_assert ((REGNO (operands[1]) != IP_REGNUM)
+ || (TARGET_ARM && TARGET_LDRD));
switch (GET_CODE (XEXP (operands[0], 0)))
{
@@ -19483,7 +19765,8 @@ typedef struct {
VAR9 (T, N, A, B, C, D, E, F, G, H, I), \
{#N, NEON_##T, UP (J), CF (N, J), 0}
-/* The mode entries in the following table correspond to the "key" type of the
+/* The NEON builtin data can be found in arm_neon_builtins.def.
+ The mode entries in the following table correspond to the "key" type of the
instruction variant, i.e. equivalent to that which would be specified after
the assembler mnemonic, which usually refers to the last vector operand.
(Signed/unsigned/polynomial types are not differentiated between though, and
@@ -19493,196 +19776,7 @@ typedef struct {
static neon_builtin_datum neon_builtin_data[] =
{
- VAR10 (BINOP, vadd,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR3 (BINOP, vaddl, v8qi, v4hi, v2si),
- VAR3 (BINOP, vaddw, v8qi, v4hi, v2si),
- VAR6 (BINOP, vhadd, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR8 (BINOP, vqadd, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR3 (BINOP, vaddhn, v8hi, v4si, v2di),
- VAR8 (BINOP, vmul, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR8 (TERNOP, vmla, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR3 (TERNOP, vmlal, v8qi, v4hi, v2si),
- VAR2 (TERNOP, vfma, v2sf, v4sf),
- VAR2 (TERNOP, vfms, v2sf, v4sf),
- VAR8 (TERNOP, vmls, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR3 (TERNOP, vmlsl, v8qi, v4hi, v2si),
- VAR4 (BINOP, vqdmulh, v4hi, v2si, v8hi, v4si),
- VAR2 (TERNOP, vqdmlal, v4hi, v2si),
- VAR2 (TERNOP, vqdmlsl, v4hi, v2si),
- VAR3 (BINOP, vmull, v8qi, v4hi, v2si),
- VAR2 (SCALARMULL, vmull_n, v4hi, v2si),
- VAR2 (LANEMULL, vmull_lane, v4hi, v2si),
- VAR2 (SCALARMULL, vqdmull_n, v4hi, v2si),
- VAR2 (LANEMULL, vqdmull_lane, v4hi, v2si),
- VAR4 (SCALARMULH, vqdmulh_n, v4hi, v2si, v8hi, v4si),
- VAR4 (LANEMULH, vqdmulh_lane, v4hi, v2si, v8hi, v4si),
- VAR2 (BINOP, vqdmull, v4hi, v2si),
- VAR8 (BINOP, vshl, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR8 (BINOP, vqshl, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR8 (SHIFTIMM, vshr_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR3 (SHIFTIMM, vshrn_n, v8hi, v4si, v2di),
- VAR3 (SHIFTIMM, vqshrn_n, v8hi, v4si, v2di),
- VAR3 (SHIFTIMM, vqshrun_n, v8hi, v4si, v2di),
- VAR8 (SHIFTIMM, vshl_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR8 (SHIFTIMM, vqshl_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR8 (SHIFTIMM, vqshlu_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR3 (SHIFTIMM, vshll_n, v8qi, v4hi, v2si),
- VAR8 (SHIFTACC, vsra_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR10 (BINOP, vsub,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR3 (BINOP, vsubl, v8qi, v4hi, v2si),
- VAR3 (BINOP, vsubw, v8qi, v4hi, v2si),
- VAR8 (BINOP, vqsub, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR6 (BINOP, vhsub, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR3 (BINOP, vsubhn, v8hi, v4si, v2di),
- VAR8 (BINOP, vceq, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR8 (BINOP, vcge, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR6 (BINOP, vcgeu, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR8 (BINOP, vcgt, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR6 (BINOP, vcgtu, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR2 (BINOP, vcage, v2sf, v4sf),
- VAR2 (BINOP, vcagt, v2sf, v4sf),
- VAR6 (BINOP, vtst, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR8 (BINOP, vabd, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR3 (BINOP, vabdl, v8qi, v4hi, v2si),
- VAR6 (TERNOP, vaba, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR3 (TERNOP, vabal, v8qi, v4hi, v2si),
- VAR8 (BINOP, vmax, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR8 (BINOP, vmin, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR4 (BINOP, vpadd, v8qi, v4hi, v2si, v2sf),
- VAR6 (UNOP, vpaddl, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR6 (BINOP, vpadal, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR4 (BINOP, vpmax, v8qi, v4hi, v2si, v2sf),
- VAR4 (BINOP, vpmin, v8qi, v4hi, v2si, v2sf),
- VAR2 (BINOP, vrecps, v2sf, v4sf),
- VAR2 (BINOP, vrsqrts, v2sf, v4sf),
- VAR8 (SHIFTINSERT, vsri_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR8 (SHIFTINSERT, vsli_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
- VAR8 (UNOP, vabs, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR6 (UNOP, vqabs, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR8 (UNOP, vneg, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR6 (UNOP, vqneg, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR6 (UNOP, vcls, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR6 (UNOP, vclz, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- VAR2 (UNOP, vcnt, v8qi, v16qi),
- VAR4 (UNOP, vrecpe, v2si, v2sf, v4si, v4sf),
- VAR4 (UNOP, vrsqrte, v2si, v2sf, v4si, v4sf),
- VAR6 (UNOP, vmvn, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
- /* FIXME: vget_lane supports more variants than this! */
- VAR10 (GETLANE, vget_lane,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (SETLANE, vset_lane,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (CREATE, vcreate, v8qi, v4hi, v2si, v2sf, di),
- VAR10 (DUP, vdup_n,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (DUPLANE, vdup_lane,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (COMBINE, vcombine, v8qi, v4hi, v2si, v2sf, di),
- VAR5 (SPLIT, vget_high, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (SPLIT, vget_low, v16qi, v8hi, v4si, v4sf, v2di),
- VAR3 (UNOP, vmovn, v8hi, v4si, v2di),
- VAR3 (UNOP, vqmovn, v8hi, v4si, v2di),
- VAR3 (UNOP, vqmovun, v8hi, v4si, v2di),
- VAR3 (UNOP, vmovl, v8qi, v4hi, v2si),
- VAR6 (LANEMUL, vmul_lane, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR6 (LANEMAC, vmla_lane, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR2 (LANEMAC, vmlal_lane, v4hi, v2si),
- VAR2 (LANEMAC, vqdmlal_lane, v4hi, v2si),
- VAR6 (LANEMAC, vmls_lane, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR2 (LANEMAC, vmlsl_lane, v4hi, v2si),
- VAR2 (LANEMAC, vqdmlsl_lane, v4hi, v2si),
- VAR6 (SCALARMUL, vmul_n, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR6 (SCALARMAC, vmla_n, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR2 (SCALARMAC, vmlal_n, v4hi, v2si),
- VAR2 (SCALARMAC, vqdmlal_n, v4hi, v2si),
- VAR6 (SCALARMAC, vmls_n, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR2 (SCALARMAC, vmlsl_n, v4hi, v2si),
- VAR2 (SCALARMAC, vqdmlsl_n, v4hi, v2si),
- VAR10 (BINOP, vext,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR8 (UNOP, vrev64, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR4 (UNOP, vrev32, v8qi, v4hi, v16qi, v8hi),
- VAR2 (UNOP, vrev16, v8qi, v16qi),
- VAR4 (CONVERT, vcvt, v2si, v2sf, v4si, v4sf),
- VAR4 (FIXCONV, vcvt_n, v2si, v2sf, v4si, v4sf),
- VAR10 (SELECT, vbsl,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR2 (RINT, vrintn, v2sf, v4sf),
- VAR2 (RINT, vrinta, v2sf, v4sf),
- VAR2 (RINT, vrintp, v2sf, v4sf),
- VAR2 (RINT, vrintm, v2sf, v4sf),
- VAR2 (RINT, vrintz, v2sf, v4sf),
- VAR2 (RINT, vrintx, v2sf, v4sf),
- VAR1 (VTBL, vtbl1, v8qi),
- VAR1 (VTBL, vtbl2, v8qi),
- VAR1 (VTBL, vtbl3, v8qi),
- VAR1 (VTBL, vtbl4, v8qi),
- VAR1 (VTBX, vtbx1, v8qi),
- VAR1 (VTBX, vtbx2, v8qi),
- VAR1 (VTBX, vtbx3, v8qi),
- VAR1 (VTBX, vtbx4, v8qi),
- VAR8 (RESULTPAIR, vtrn, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR8 (RESULTPAIR, vzip, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR8 (RESULTPAIR, vuzp, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
- VAR5 (REINTERP, vreinterpretv8qi, v8qi, v4hi, v2si, v2sf, di),
- VAR5 (REINTERP, vreinterpretv4hi, v8qi, v4hi, v2si, v2sf, di),
- VAR5 (REINTERP, vreinterpretv2si, v8qi, v4hi, v2si, v2sf, di),
- VAR5 (REINTERP, vreinterpretv2sf, v8qi, v4hi, v2si, v2sf, di),
- VAR5 (REINTERP, vreinterpretdi, v8qi, v4hi, v2si, v2sf, di),
- VAR5 (REINTERP, vreinterpretv16qi, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (REINTERP, vreinterpretv8hi, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (REINTERP, vreinterpretv4si, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (REINTERP, vreinterpretv4sf, v16qi, v8hi, v4si, v4sf, v2di),
- VAR5 (REINTERP, vreinterpretv2di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (LOAD1, vld1,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (LOAD1LANE, vld1_lane,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (LOAD1, vld1_dup,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (STORE1, vst1,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (STORE1LANE, vst1_lane,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR9 (LOADSTRUCT,
- vld2, v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
- VAR7 (LOADSTRUCTLANE, vld2_lane,
- v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR5 (LOADSTRUCT, vld2_dup, v8qi, v4hi, v2si, v2sf, di),
- VAR9 (STORESTRUCT, vst2,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
- VAR7 (STORESTRUCTLANE, vst2_lane,
- v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR9 (LOADSTRUCT,
- vld3, v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
- VAR7 (LOADSTRUCTLANE, vld3_lane,
- v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR5 (LOADSTRUCT, vld3_dup, v8qi, v4hi, v2si, v2sf, di),
- VAR9 (STORESTRUCT, vst3,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
- VAR7 (STORESTRUCTLANE, vst3_lane,
- v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR9 (LOADSTRUCT, vld4,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
- VAR7 (LOADSTRUCTLANE, vld4_lane,
- v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR5 (LOADSTRUCT, vld4_dup, v8qi, v4hi, v2si, v2sf, di),
- VAR9 (STORESTRUCT, vst4,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
- VAR7 (STORESTRUCTLANE, vst4_lane,
- v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
- VAR10 (LOGICBINOP, vand,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (LOGICBINOP, vorr,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (BINOP, veor,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (LOGICBINOP, vbic,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
- VAR10 (LOGICBINOP, vorn,
- v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di)
+#include "arm_neon_builtins.def"
};
#undef CF
@@ -19697,9 +19791,36 @@ static neon_builtin_datum neon_builtin_data[] =
#undef VAR9
#undef VAR10
-/* Neon defines builtins from ARM_BUILTIN_MAX upwards, though they don't have
- symbolic names defined here (which would require too much duplication).
- FIXME? */
+#define CF(N,X) ARM_BUILTIN_NEON_##N##X
+#define VAR1(T, N, A) \
+ CF (N, A)
+#define VAR2(T, N, A, B) \
+ VAR1 (T, N, A), \
+ CF (N, B)
+#define VAR3(T, N, A, B, C) \
+ VAR2 (T, N, A, B), \
+ CF (N, C)
+#define VAR4(T, N, A, B, C, D) \
+ VAR3 (T, N, A, B, C), \
+ CF (N, D)
+#define VAR5(T, N, A, B, C, D, E) \
+ VAR4 (T, N, A, B, C, D), \
+ CF (N, E)
+#define VAR6(T, N, A, B, C, D, E, F) \
+ VAR5 (T, N, A, B, C, D, E), \
+ CF (N, F)
+#define VAR7(T, N, A, B, C, D, E, F, G) \
+ VAR6 (T, N, A, B, C, D, E, F), \
+ CF (N, G)
+#define VAR8(T, N, A, B, C, D, E, F, G, H) \
+ VAR7 (T, N, A, B, C, D, E, F, G), \
+ CF (N, H)
+#define VAR9(T, N, A, B, C, D, E, F, G, H, I) \
+ VAR8 (T, N, A, B, C, D, E, F, G, H), \
+ CF (N, I)
+#define VAR10(T, N, A, B, C, D, E, F, G, H, I, J) \
+ VAR9 (T, N, A, B, C, D, E, F, G, H, I), \
+ CF (N, J)
enum arm_builtins
{
ARM_BUILTIN_GETWCGR0,
@@ -19948,11 +20069,25 @@ enum arm_builtins
ARM_BUILTIN_WMERGE,
- ARM_BUILTIN_NEON_BASE,
+#include "arm_neon_builtins.def"
- ARM_BUILTIN_MAX = ARM_BUILTIN_NEON_BASE + ARRAY_SIZE (neon_builtin_data)
+ ,ARM_BUILTIN_MAX
};
+#define ARM_BUILTIN_NEON_BASE (ARM_BUILTIN_MAX - ARRAY_SIZE (neon_builtin_data))
+
+#undef CF
+#undef VAR1
+#undef VAR2
+#undef VAR3
+#undef VAR4
+#undef VAR5
+#undef VAR6
+#undef VAR7
+#undef VAR8
+#undef VAR9
+#undef VAR10
+
static GTY(()) tree arm_builtin_decls[ARM_BUILTIN_MAX];
static void
@@ -21629,7 +21764,7 @@ arm_expand_builtin (tree exp,
rtx op1;
rtx op2;
rtx pat;
- int fcode = DECL_FUNCTION_CODE (fndecl);
+ unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
size_t i;
enum machine_mode tmode;
enum machine_mode mode0;
@@ -22581,6 +22716,11 @@ thumb1_final_prescan_insn (rtx insn)
else if (conds != CONDS_NOCOND)
cfun->machine->thumb1_cc_insn = NULL_RTX;
}
+
+ /* Check if unexpected far jump is used. */
+ if (cfun->machine->lr_save_eliminated
+ && get_attr_far_jump (insn) == FAR_JUMP_YES)
+ internal_error("Unexpected thumb1 far jump");
}
int
@@ -22606,6 +22746,8 @@ static int
thumb_far_jump_used_p (void)
{
rtx insn;
+ bool far_jump = false;
+ unsigned int func_size = 0;
/* This test is only important for leaf functions. */
/* assert (!leaf_function_p ()); */
@@ -22656,6 +22798,26 @@ thumb_far_jump_used_p (void)
{
if (JUMP_P (insn) && get_attr_far_jump (insn) == FAR_JUMP_YES)
{
+ far_jump = true;
+ }
+ func_size += get_attr_length (insn);
+ }
+
+ /* Attribute far_jump will always be true for thumb1 before
+ shorten_branch pass. So checking far_jump attribute before
+ shorten_branch isn't much useful.
+
+ Following heuristic tries to estimate more accurately if a far jump
+ may finally be used. The heuristic is very conservative as there is
+ no chance to roll-back the decision of not to use far jump.
+
+ Thumb1 long branch offset is -2048 to 2046. The worst case is each
+ 2-byte insn is associated with a 4 byte constant pool. Using
+ function size 2048/3 as the threshold is conservative enough. */
+ if (far_jump)
+ {
+ if ((func_size * 3) >= 2048)
+ {
/* Record the fact that we have decided that
the function does use far jumps. */
cfun->machine->far_jump_used = 1;
@@ -25802,7 +25964,7 @@ arm_output_iwmmxt_tinsr (rtx *operands)
const char *
thumb1_output_casesi (rtx *operands)
{
- rtx diff_vec = PATTERN (next_real_insn (operands[0]));
+ rtx diff_vec = PATTERN (next_active_insn (operands[0]));
gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC);
@@ -25825,7 +25987,7 @@ thumb1_output_casesi (rtx *operands)
const char *
thumb2_output_casesi (rtx *operands)
{
- rtx diff_vec = PATTERN (next_real_insn (operands[2]));
+ rtx diff_vec = PATTERN (next_active_insn (operands[2]));
gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC);
@@ -25873,6 +26035,7 @@ arm_issue_rate (void)
case cortexa7:
case cortexa8:
case cortexa9:
+ case cortexa53:
case fa726te:
case marvell_pj4:
return 2;
@@ -25999,6 +26162,60 @@ arm_have_conditional_execution (void)
return !TARGET_THUMB1;
}
+tree
+arm_builtin_vectorized_function (tree fndecl, tree type_out, tree type_in)
+{
+ enum machine_mode in_mode, out_mode;
+ int in_n, out_n;
+
+ if (TREE_CODE (type_out) != VECTOR_TYPE
+ || TREE_CODE (type_in) != VECTOR_TYPE
+ || !(TARGET_NEON && TARGET_FPU_ARMV8 && flag_unsafe_math_optimizations))
+ return NULL_TREE;
+
+ out_mode = TYPE_MODE (TREE_TYPE (type_out));
+ out_n = TYPE_VECTOR_SUBPARTS (type_out);
+ in_mode = TYPE_MODE (TREE_TYPE (type_in));
+ in_n = TYPE_VECTOR_SUBPARTS (type_in);
+
+/* ARM_CHECK_BUILTIN_MODE and ARM_FIND_VRINT_VARIANT are used to find the
+ decl of the vectorized builtin for the appropriate vector mode.
+ NULL_TREE is returned if no such builtin is available. */
+#undef ARM_CHECK_BUILTIN_MODE
+#define ARM_CHECK_BUILTIN_MODE(C) \
+ (out_mode == SFmode && out_n == C \
+ && in_mode == SFmode && in_n == C)
+
+#undef ARM_FIND_VRINT_VARIANT
+#define ARM_FIND_VRINT_VARIANT(N) \
+ (ARM_CHECK_BUILTIN_MODE (2) \
+ ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##v2sf, false) \
+ : (ARM_CHECK_BUILTIN_MODE (4) \
+ ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##v4sf, false) \
+ : NULL_TREE))
+
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ {
+ enum built_in_function fn = DECL_FUNCTION_CODE (fndecl);
+ switch (fn)
+ {
+ case BUILT_IN_FLOORF:
+ return ARM_FIND_VRINT_VARIANT (vrintm);
+ case BUILT_IN_CEILF:
+ return ARM_FIND_VRINT_VARIANT (vrintp);
+ case BUILT_IN_TRUNCF:
+ return ARM_FIND_VRINT_VARIANT (vrintz);
+ case BUILT_IN_ROUNDF:
+ return ARM_FIND_VRINT_VARIANT (vrinta);
+ default:
+ return NULL_TREE;
+ }
+ }
+ return NULL_TREE;
+}
+#undef ARM_CHECK_BUILTIN_MODE
+#undef ARM_FIND_VRINT_VARIANT
+
/* The AAPCS sets the maximum alignment of a vector to 64 bits. */
static HOST_WIDE_INT
arm_vector_alignment (const_tree type)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index beee458477d..cc1774b559c 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1205,7 +1205,7 @@ enum reg_class
{ 0x00000000, 0x00000000, 0x00000000, 0x00000020 }, /* VFPCC_REG */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000040 }, /* SFP_REG */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000080 }, /* AFP_REG */ \
- { 0xFFFF7FFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 } /* ALL_REGS */ \
+ { 0xFFFF7FFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F } /* ALL_REGS */ \
}
/* Any of the VFP register classes. */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 8895080cb03..913dc5f50c6 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -22,6 +22,25 @@
;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
+;; Beware of splitting Thumb1 patterns that output multiple
+;; assembly instructions, in particular instruction such as SBC and
+;; ADC which consume flags. For example, in the pattern thumb_subdi3
+;; below, the output SUB implicitly sets the flags (assembled to SUBS)
+;; and then the Carry flag is used by SBC to compute the correct
+;; result. If we split thumb_subdi3 pattern into two separate RTL
+;; insns (using define_insn_and_split), the scheduler might place
+;; other RTL insns between SUB and SBC, possibly modifying the Carry
+;; flag used by SBC. This might happen because most Thumb1 patterns
+;; for flag-setting instructions do not have explicit RTL for setting
+;; or clobbering the flags. Instead, they have the attribute "conds"
+;; with value "set" or "clob". However, this attribute is not used to
+;; identify dependencies and therefore the scheduler might reorder
+;; these instruction. Currenly, this problem cannot happen because
+;; there are no separate Thumb1 patterns for individual instruction
+;; that consume flags (except conditional execution, which is treated
+;; differently). In particular there is no Thumb1 armv6-m pattern for
+;; sbc or adc.
+
;;---------------------------------------------------------------------------
;; Constants
@@ -496,7 +515,7 @@
(define_attr "generic_sched" "yes,no"
(const (if_then_else
- (ior (eq_attr "tune" "fa526,fa626,fa606te,fa626te,fmp626,fa726te,arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs,cortexa5,cortexa7,cortexa8,cortexa9,cortexa15,cortexm4,marvell_pj4")
+ (ior (eq_attr "tune" "fa526,fa626,fa606te,fa626te,fmp626,fa726te,arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs,cortexa5,cortexa7,cortexa8,cortexa9,cortexa15,cortexa53,cortexm4,marvell_pj4")
(eq_attr "tune_cortexr4" "yes"))
(const_string "no")
(const_string "yes"))))
@@ -504,7 +523,7 @@
(define_attr "generic_vfp" "yes,no"
(const (if_then_else
(and (eq_attr "fpu" "vfp")
- (eq_attr "tune" "!arm1020e,arm1022e,cortexa5,cortexa7,cortexa8,cortexa9,cortexm4,marvell_pj4")
+ (eq_attr "tune" "!arm1020e,arm1022e,cortexa5,cortexa7,cortexa8,cortexa9,cortexa53,cortexm4,marvell_pj4")
(eq_attr "tune_cortexr4" "no"))
(const_string "yes")
(const_string "no"))))
@@ -525,6 +544,7 @@
(include "cortex-a8.md")
(include "cortex-a9.md")
(include "cortex-a15.md")
+(include "cortex-a53.md")
(include "cortex-r4.md")
(include "cortex-r4f.md")
(include "cortex-m4.md")
@@ -969,7 +989,8 @@
"@
adc%?\\t%0, %1, %2
sbc%?\\t%0, %1, #%B2"
- [(set_attr "conds" "use")]
+ [(set_attr "conds" "use")
+ (set_attr "predicable" "yes")]
)
(define_insn "*addsi3_carryin_alt2_<optab>"
@@ -981,7 +1002,8 @@
"@
adc%?\\t%0, %1, %2
sbc%?\\t%0, %1, #%B2"
- [(set_attr "conds" "use")]
+ [(set_attr "conds" "use")
+ (set_attr "predicable" "yes")]
)
(define_insn "*addsi3_carryin_shift_<optab>"
@@ -995,6 +1017,7 @@
"TARGET_32BIT"
"adc%?\\t%0, %1, %3%S2"
[(set_attr "conds" "use")
+ (set_attr "predicable" "yes")
(set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
(const_string "alu_shift")
(const_string "alu_shift_reg")))]
@@ -1011,26 +1034,88 @@
[(set_attr "conds" "set")]
)
-(define_expand "incscc"
+(define_insn "*subsi3_carryin"
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
- (plus:SI (match_operator:SI 2 "arm_comparison_operator"
- [(match_operand:CC 3 "cc_register" "") (const_int 0)])
- (match_operand:SI 1 "s_register_operand" "0,?r")))]
+ (minus:SI (minus:SI (match_operand:SI 1 "reg_or_int_operand" "r,I")
+ (match_operand:SI 2 "s_register_operand" "r,r"))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
"TARGET_32BIT"
- ""
+ "@
+ sbc%?\\t%0, %1, %2
+ rsc%?\\t%0, %2, %1"
+ [(set_attr "conds" "use")
+ (set_attr "arch" "*,a")
+ (set_attr "predicable" "yes")]
)
-(define_insn "*arm_incscc"
- [(set (match_operand:SI 0 "s_register_operand" "=r,r")
- (plus:SI (match_operator:SI 2 "arm_comparison_operator"
- [(match_operand:CC 3 "cc_register" "") (const_int 0)])
- (match_operand:SI 1 "s_register_operand" "0,?r")))]
+(define_insn "*subsi3_carryin_const"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (minus:SI (plus:SI (match_operand:SI 1 "reg_or_int_operand" "r")
+ (match_operand:SI 2 "arm_not_operand" "K"))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ "TARGET_32BIT"
+ "sbc\\t%0, %1, #%B2"
+ [(set_attr "conds" "use")]
+)
+
+(define_insn "*subsi3_carryin_compare"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "s_register_operand" "r")
+ (match_operand:SI 2 "s_register_operand" "r")))
+ (set (match_operand:SI 0 "s_register_operand" "=r")
+ (minus:SI (minus:SI (match_dup 1)
+ (match_dup 2))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ "TARGET_32BIT"
+ "sbcs\\t%0, %1, %2"
+ [(set_attr "conds" "set")]
+)
+
+(define_insn "*subsi3_carryin_compare_const"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "reg_or_int_operand" "r")
+ (match_operand:SI 2 "arm_not_operand" "K")))
+ (set (match_operand:SI 0 "s_register_operand" "=r")
+ (minus:SI (plus:SI (match_dup 1)
+ (match_dup 2))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ "TARGET_32BIT"
+ "sbcs\\t%0, %1, #%B2"
+ [(set_attr "conds" "set")]
+)
+
+(define_insn "*subsi3_carryin_shift"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (minus:SI (minus:SI
+ (match_operand:SI 1 "s_register_operand" "r")
+ (match_operator:SI 2 "shift_operator"
+ [(match_operand:SI 3 "s_register_operand" "r")
+ (match_operand:SI 4 "reg_or_int_operand" "rM")]))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ "TARGET_32BIT"
+ "sbc%?\\t%0, %1, %3%S2"
+ [(set_attr "conds" "use")
+ (set_attr "predicable" "yes")
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
+)
+
+(define_insn "*rsbsi3_carryin_shift"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (minus:SI (minus: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"))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
"TARGET_ARM"
- "@
- add%d2\\t%0, %1, #1
- mov%D2\\t%0, %1\;add%d2\\t%0, %1, #1"
+ "rsc%?\\t%0, %1, %3%S2"
[(set_attr "conds" "use")
- (set_attr "length" "4,8")]
+ (set_attr "predicable" "yes")
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
; transform ((x << y) - 1) to ~(~(x-1) << y) Where X is a constant.
@@ -1081,13 +1166,27 @@
"
)
-(define_insn "*arm_subdi3"
+(define_insn_and_split "*arm_subdi3"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r")
(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_NEON"
- "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
+ "#" ; "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
+ (set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[5] = gen_highpart (SImode, operands[2]);
+ operands[2] = gen_lowpart (SImode, operands[2]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
@@ -1102,55 +1201,113 @@
[(set_attr "length" "4")]
)
-(define_insn "*subdi_di_zesidi"
+(define_insn_and_split "*subdi_di_zesidi"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(minus:DI (match_operand:DI 1 "s_register_operand" "0,r")
(zero_extend:DI
(match_operand:SI 2 "s_register_operand" "r,r"))))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
- "subs\\t%Q0, %Q1, %2\;sbc\\t%R0, %R1, #0"
+ "#" ; "subs\\t%Q0, %Q1, %2\;sbc\\t%R0, %R1, #0"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
+ (set (match_dup 3) (minus: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]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[5] = GEN_INT (~0);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
-(define_insn "*subdi_di_sesidi"
+(define_insn_and_split "*subdi_di_sesidi"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(minus:DI (match_operand:DI 1 "s_register_operand" "0,r")
(sign_extend:DI
(match_operand:SI 2 "s_register_operand" "r,r"))))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
- "subs\\t%Q0, %Q1, %2\;sbc\\t%R0, %R1, %2, asr #31"
+ "#" ; "subs\\t%Q0, %Q1, %2\;sbc\\t%R0, %R1, %2, asr #31"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
+ (set (match_dup 3) (minus:SI (minus:SI (match_dup 4)
+ (ashiftrt:SI (match_dup 2)
+ (const_int 31)))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
-(define_insn "*subdi_zesidi_di"
+(define_insn_and_split "*subdi_zesidi_di"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(minus:DI (zero_extend:DI
(match_operand:SI 2 "s_register_operand" "r,r"))
(match_operand:DI 1 "s_register_operand" "0,r")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "rsbs\\t%Q0, %Q1, %2\;rsc\\t%R0, %R1, #0"
+ "#" ; "rsbs\\t%Q0, %Q1, %2\;rsc\\t%R0, %R1, #0"
+ ; is equivalent to:
+ ; "subs\\t%Q0, %2, %Q1\;rsc\\t%R0, %R1, #0"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 2) (match_dup 1)))
+ (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 1)))])
+ (set (match_dup 3) (minus:SI (minus:SI (const_int 0) (match_dup 4))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
-(define_insn "*subdi_sesidi_di"
+(define_insn_and_split "*subdi_sesidi_di"
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(minus:DI (sign_extend:DI
(match_operand:SI 2 "s_register_operand" "r,r"))
(match_operand:DI 1 "s_register_operand" "0,r")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "rsbs\\t%Q0, %Q1, %2\;rsc\\t%R0, %R1, %2, asr #31"
+ "#" ; "rsbs\\t%Q0, %Q1, %2\;rsc\\t%R0, %R1, %2, asr #31"
+ ; is equivalent to:
+ ; "subs\\t%Q0, %2, %Q1\;rsc\\t%R0, %R1, %2, asr #31"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 2) (match_dup 1)))
+ (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 1)))])
+ (set (match_dup 3) (minus:SI (minus:SI
+ (ashiftrt:SI (match_dup 2)
+ (const_int 31))
+ (match_dup 4))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
-(define_insn "*subdi_zesidi_zesidi"
+(define_insn_and_split "*subdi_zesidi_zesidi"
[(set (match_operand:DI 0 "s_register_operand" "=r")
(minus:DI (zero_extend:DI
(match_operand:SI 1 "s_register_operand" "r"))
@@ -1158,7 +1315,17 @@
(match_operand:SI 2 "s_register_operand" "r"))))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
- "subs\\t%Q0, %1, %2\;sbc\\t%R0, %1, %1"
+ "#" ; "subs\\t%Q0, %1, %2\;sbc\\t%R0, %1, %1"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
+ (set (match_dup 3) (minus:SI (minus:SI (match_dup 1) (match_dup 1))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
@@ -1263,29 +1430,6 @@
(set_attr "type" "simple_alu_imm,*,*")]
)
-(define_expand "decscc"
- [(set (match_operand:SI 0 "s_register_operand" "=r,r")
- (minus:SI (match_operand:SI 1 "s_register_operand" "0,?r")
- (match_operator:SI 2 "arm_comparison_operator"
- [(match_operand 3 "cc_register" "") (const_int 0)])))]
- "TARGET_32BIT"
- ""
-)
-
-(define_insn "*arm_decscc"
- [(set (match_operand:SI 0 "s_register_operand" "=r,r")
- (minus:SI (match_operand:SI 1 "s_register_operand" "0,?r")
- (match_operator:SI 2 "arm_comparison_operator"
- [(match_operand 3 "cc_register" "") (const_int 0)])))]
- "TARGET_ARM"
- "@
- sub%d2\\t%0, %1, #1
- mov%D2\\t%0, %1\;sub%d2\\t%0, %1, #1"
- [(set_attr "conds" "use")
- (set_attr "length" "*,8")
- (set_attr "type" "simple_alu_imm,*")]
-)
-
(define_expand "subsf3"
[(set (match_operand:SF 0 "s_register_operand" "")
(minus:SF (match_operand:SF 1 "s_register_operand" "")
@@ -2018,13 +2162,58 @@
""
)
-(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_NEON"
- "#"
- [(set_attr "length" "8")]
+(define_insn_and_split "*anddi3_insn"
+ [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r,w,w ,?&r,?&r,?w,?w")
+ (and:DI (match_operand:DI 1 "s_register_operand" "%0 ,r ,0,r ,w,0 ,0 ,r ,w ,0")
+ (match_operand:DI 2 "arm_anddi_operand_neon" "r ,r ,De,De,w,DL,r ,r ,w ,DL")))]
+ "TARGET_32BIT && !TARGET_IWMMXT"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3: /* fall through */
+ return "#";
+ case 4: /* fall through */
+ case 8: return "vand\t%P0, %P1, %P2";
+ case 5: /* fall through */
+ case 9: return neon_output_logic_immediate ("vand", &operands[2],
+ DImode, 1, VALID_NEON_QREG_MODE (DImode));
+ case 6: return "#";
+ case 7: return "#";
+ default: gcc_unreachable ();
+ }
+}
+ "TARGET_32BIT && !TARGET_IWMMXT"
+ [(set (match_dup 3) (match_dup 4))
+ (set (match_dup 5) (match_dup 6))]
+ "
+ {
+ operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[5] = gen_highpart (SImode, operands[0]);
+
+ operands[4] = simplify_gen_binary (AND, SImode,
+ gen_lowpart (SImode, operands[1]),
+ gen_lowpart (SImode, operands[2]));
+ operands[6] = simplify_gen_binary (AND, SImode,
+ gen_highpart (SImode, operands[1]),
+ gen_highpart_mode (SImode, DImode, operands[2]));
+
+ }"
+ [(set_attr "neon_type" "*,*,*,*,neon_int_1,neon_int_1,*,*,neon_int_1,neon_int_1")
+ (set_attr "arch" "*,*,*,*,neon_for_64bits,neon_for_64bits,*,*,
+ avoid_neon_for_64bits,avoid_neon_for_64bits")
+ (set_attr "length" "8,8,8,8,*,*,8,8,*,*")
+ (set (attr "insn_enabled") (if_then_else
+ (lt (symbol_ref "which_alternative")
+ (const_int 4))
+ (if_then_else (match_test "!TARGET_NEON")
+ (const_string "yes")
+ (const_string "no"))
+ (if_then_else (match_test "TARGET_NEON")
+ (const_string "yes")
+ (const_string "no"))))]
)
(define_insn_and_split "*anddi_zesidi_di"
@@ -3090,13 +3279,17 @@
""
)
-(define_insn "*andsi_iorsi3_notsi"
+(define_insn_and_split "*andsi_iorsi3_notsi"
[(set (match_operand:SI 0 "s_register_operand" "=&r,&r,&r")
(and:SI (ior:SI (match_operand:SI 1 "s_register_operand" "%0,r,r")
(match_operand:SI 2 "arm_rhs_operand" "rI,0,rI"))
(not:SI (match_operand:SI 3 "arm_rhs_operand" "rI,rI,rI"))))]
"TARGET_32BIT"
- "orr%?\\t%0, %1, %2\;bic%?\\t%0, %0, %3"
+ "#" ; "orr%?\\t%0, %1, %2\;bic%?\\t%0, %0, %3"
+ "&& reload_completed"
+ [(set (match_dup 0) (ior:SI (match_dup 1) (match_dup 2)))
+ (set (match_dup 0) (and:SI (not:SI (match_dup 3)) (match_dup 0)))]
+ ""
[(set_attr "length" "8")
(set_attr "ce_count" "2")
(set_attr "predicable" "yes")]
@@ -3247,15 +3440,23 @@
[(set_attr "predicable" "yes")]
)
-(define_insn "*arm_smax_insn"
+(define_insn_and_split "*arm_smax_insn"
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
(smax:SI (match_operand:SI 1 "s_register_operand" "%0,?r")
(match_operand:SI 2 "arm_rhs_operand" "rI,rI")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "@
- cmp\\t%1, %2\;movlt\\t%0, %2
- cmp\\t%1, %2\;movge\\t%0, %1\;movlt\\t%0, %2"
+ "#"
+ ; cmp\\t%1, %2\;movlt\\t%0, %2
+ ; cmp\\t%1, %2\;movge\\t%0, %1\;movlt\\t%0, %2"
+ "TARGET_ARM"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0)
+ (if_then_else:SI (ge:SI (reg:CC CC_REGNUM) (const_int 0))
+ (match_dup 1)
+ (match_dup 2)))]
+ ""
[(set_attr "conds" "clob")
(set_attr "length" "8,12")]
)
@@ -3287,15 +3488,23 @@
[(set_attr "predicable" "yes")]
)
-(define_insn "*arm_smin_insn"
+(define_insn_and_split "*arm_smin_insn"
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
(smin:SI (match_operand:SI 1 "s_register_operand" "%0,?r")
(match_operand:SI 2 "arm_rhs_operand" "rI,rI")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "@
- cmp\\t%1, %2\;movge\\t%0, %2
- cmp\\t%1, %2\;movlt\\t%0, %1\;movge\\t%0, %2"
+ "#"
+ ; cmp\\t%1, %2\;movge\\t%0, %2
+ ; cmp\\t%1, %2\;movlt\\t%0, %1\;movge\\t%0, %2"
+ "TARGET_ARM"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0)
+ (if_then_else:SI (lt:SI (reg:CC CC_REGNUM) (const_int 0))
+ (match_dup 1)
+ (match_dup 2)))]
+ ""
[(set_attr "conds" "clob")
(set_attr "length" "8,12")]
)
@@ -3310,16 +3519,24 @@
""
)
-(define_insn "*arm_umaxsi3"
+(define_insn_and_split "*arm_umaxsi3"
[(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
(umax:SI (match_operand:SI 1 "s_register_operand" "0,r,?r")
(match_operand:SI 2 "arm_rhs_operand" "rI,0,rI")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "@
- cmp\\t%1, %2\;movcc\\t%0, %2
- cmp\\t%1, %2\;movcs\\t%0, %1
- cmp\\t%1, %2\;movcs\\t%0, %1\;movcc\\t%0, %2"
+ "#"
+ ; cmp\\t%1, %2\;movcc\\t%0, %2
+ ; cmp\\t%1, %2\;movcs\\t%0, %1
+ ; cmp\\t%1, %2\;movcs\\t%0, %1\;movcc\\t%0, %2"
+ "TARGET_ARM"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0)
+ (if_then_else:SI (geu:SI (reg:CC CC_REGNUM) (const_int 0))
+ (match_dup 1)
+ (match_dup 2)))]
+ ""
[(set_attr "conds" "clob")
(set_attr "length" "8,8,12")]
)
@@ -3334,16 +3551,24 @@
""
)
-(define_insn "*arm_uminsi3"
+(define_insn_and_split "*arm_uminsi3"
[(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
(umin:SI (match_operand:SI 1 "s_register_operand" "0,r,?r")
(match_operand:SI 2 "arm_rhs_operand" "rI,0,rI")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "@
- cmp\\t%1, %2\;movcs\\t%0, %2
- cmp\\t%1, %2\;movcc\\t%0, %1
- cmp\\t%1, %2\;movcc\\t%0, %1\;movcs\\t%0, %2"
+ "#"
+ ; cmp\\t%1, %2\;movcs\\t%0, %2
+ ; cmp\\t%1, %2\;movcc\\t%0, %1
+ ; cmp\\t%1, %2\;movcc\\t%0, %1\;movcs\\t%0, %2"
+ "TARGET_ARM"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 1) (match_dup 2)))
+ (set (match_dup 0)
+ (if_then_else:SI (ltu:SI (reg:CC CC_REGNUM) (const_int 0))
+ (match_dup 1)
+ (match_dup 2)))]
+ ""
[(set_attr "conds" "clob")
(set_attr "length" "8,8,12")]
)
@@ -3417,6 +3642,50 @@
(const_int 12)))]
)
+; Reject the frame pointer in operand[1], since reloading this after
+; it has been eliminated can cause carnage.
+(define_insn_and_split "*minmax_arithsi_non_canon"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (minus:SI
+ (match_operand:SI 1 "s_register_operand" "0,?r")
+ (match_operator:SI 4 "minmax_operator"
+ [(match_operand:SI 2 "s_register_operand" "r,r")
+ (match_operand:SI 3 "arm_rhs_operand" "rI,rI")])))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT && !arm_eliminable_register (operands[1])"
+ "#"
+ "TARGET_32BIT && !arm_eliminable_register (operands[1]) && reload_completed"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 2) (match_dup 3)))
+
+ (cond_exec (match_op_dup 4 [(reg:CC CC_REGNUM) (const_int 0)])
+ (set (match_dup 0)
+ (minus:SI (match_dup 1)
+ (match_dup 2))))
+ (cond_exec (match_op_dup 5 [(reg:CC CC_REGNUM) (const_int 0)])
+ (set (match_dup 0)
+ (minus:SI (match_dup 1)
+ (match_dup 3))))]
+ {
+ enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[1]),
+ operands[2], operands[3]);
+ enum rtx_code rc = minmax_code (operands[4]);
+ operands[4] = gen_rtx_fmt_ee (rc, VOIDmode,
+ operands[2], operands[3]);
+
+ if (mode == CCFPmode || mode == CCFPEmode)
+ rc = reverse_condition_maybe_unordered (rc);
+ else
+ rc = reverse_condition (rc);
+ operands[5] = gen_rtx_fmt_ee (rc, SImode, operands[2], operands[3]);
+ }
+ [(set_attr "conds" "clob")
+ (set (attr "length")
+ (if_then_else (eq_attr "is_thumb" "yes")
+ (const_int 14)
+ (const_int 12)))]
+)
+
(define_code_iterator SAT [smin smax])
(define_code_iterator SATrev [smin smax])
(define_code_attr SATlo [(smin "1") (smax "2")])
@@ -3527,13 +3796,26 @@
"
)
-(define_insn "arm_ashldi3_1bit"
+(define_insn_and_split "arm_ashldi3_1bit"
[(set (match_operand:DI 0 "s_register_operand" "=r,&r")
(ashift:DI (match_operand:DI 1 "s_register_operand" "0,r")
(const_int 1)))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
- "movs\\t%Q0, %Q1, asl #1\;adc\\t%R0, %R1, %R1"
+ "#" ; "movs\\t%Q0, %Q1, asl #1\;adc\\t%R0, %R1, %R1"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (ashift:SI (match_dup 1) (const_int 1))
+ (const_int 0)))
+ (set (match_dup 0) (ashift:SI (match_dup 1) (const_int 1)))])
+ (set (match_dup 2) (plus:SI (plus:SI (match_dup 3) (match_dup 3))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
@@ -3609,18 +3891,43 @@
"
)
-(define_insn "arm_ashrdi3_1bit"
+(define_insn_and_split "arm_ashrdi3_1bit"
[(set (match_operand:DI 0 "s_register_operand" "=r,&r")
(ashiftrt:DI (match_operand:DI 1 "s_register_operand" "0,r")
(const_int 1)))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
- "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx"
+ "#" ; "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (ashiftrt:SI (match_dup 3) (const_int 1))
+ (const_int 0)))
+ (set (match_dup 2) (ashiftrt:SI (match_dup 3) (const_int 1)))])
+ (set (match_dup 0) (unspec:SI [(match_dup 1)
+ (reg:CC_C CC_REGNUM)]
+ UNSPEC_RRX))]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
- (set_attr "insn" "mov")
(set_attr "length" "8")]
)
+(define_insn "*rrx"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (unspec:SI [(match_operand:SI 1 "s_register_operand" "r")
+ (reg:CC_C CC_REGNUM)]
+ UNSPEC_RRX))]
+ "TARGET_32BIT"
+ "mov\\t%0, %1, rrx"
+ [(set_attr "conds" "use")
+ (set_attr "insn" "mov")
+ (set_attr "type" "alu_shift")]
+)
+
(define_expand "ashrsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(ashiftrt:SI (match_operand:SI 1 "s_register_operand" "")
@@ -3689,15 +3996,28 @@
"
)
-(define_insn "arm_lshrdi3_1bit"
+(define_insn_and_split "arm_lshrdi3_1bit"
[(set (match_operand:DI 0 "s_register_operand" "=r,&r")
(lshiftrt:DI (match_operand:DI 1 "s_register_operand" "0,r")
(const_int 1)))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
- "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx"
+ "#" ; "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (lshiftrt:SI (match_dup 3) (const_int 1))
+ (const_int 0)))
+ (set (match_dup 2) (lshiftrt:SI (match_dup 3) (const_int 1)))])
+ (set (match_dup 0) (unspec:SI [(match_dup 1)
+ (reg:CC_C CC_REGNUM)]
+ UNSPEC_RRX))]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
- (set_attr "insn" "mov")
(set_attr "length" "8")]
)
@@ -3785,6 +4105,23 @@
(const_string "alu_shift_reg")))]
)
+(define_insn "*shiftsi3_compare"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operator:SI 3 "shift_operator"
+ [(match_operand:SI 1 "s_register_operand" "r")
+ (match_operand:SI 2 "arm_rhs_operand" "rM")])
+ (const_int 0)))
+ (set (match_operand:SI 0 "s_register_operand" "=r")
+ (match_op_dup 3 [(match_dup 1) (match_dup 2)]))]
+ "TARGET_32BIT"
+ "* return arm_output_shift(operands, 1);"
+ [(set_attr "conds" "set")
+ (set_attr "shift" "1")
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
+)
+
(define_insn "*shiftsi3_compare0"
[(set (reg:CC_NOOV CC_REGNUM)
(compare:CC_NOOV (match_operator:SI 3 "shift_operator"
@@ -4148,12 +4485,24 @@
;; The constraints here are to prevent a *partial* overlap (where %Q0 == %R1).
;; The first alternative allows the common case of a *full* overlap.
-(define_insn "*arm_negdi2"
+(define_insn_and_split "*arm_negdi2"
[(set (match_operand:DI 0 "s_register_operand" "=r,&r")
(neg:DI (match_operand:DI 1 "s_register_operand" "0,r")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "rsbs\\t%Q0, %Q1, #0\;rsc\\t%R0, %R1, #0"
+ "#" ; "rsbs\\t%Q0, %Q1, #0\;rsc\\t%R0, %R1, #0"
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (const_int 0) (match_dup 1)))
+ (set (match_dup 0) (minus:SI (const_int 0) (match_dup 1)))])
+ (set (match_dup 2) (minus:SI (minus:SI (const_int 0) (match_dup 3))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "clob")
(set_attr "length" "8")]
)
@@ -4203,6 +4552,73 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
"")
+;; Negate an extended 32-bit value.
+(define_insn_and_split "*negdi_extendsidi"
+ [(set (match_operand:DI 0 "s_register_operand" "=r,&r,l,&l")
+ (neg:DI (sign_extend:DI (match_operand:SI 1 "s_register_operand" "0,r,0,l"))))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT"
+ "#" ; rsb\\t%Q0, %1, #0\;asr\\t%R0, %Q0, #31
+ "&& reload_completed"
+ [(const_int 0)]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ rtx tmp = gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_MINUS (SImode,
+ const0_rtx,
+ operands[1]));
+ if (TARGET_ARM)
+ {
+ emit_insn (tmp);
+ }
+ else
+ {
+ /* Set the flags, to emit the short encoding in Thumb2. */
+ rtx flags = gen_rtx_SET (VOIDmode,
+ gen_rtx_REG (CCmode, CC_REGNUM),
+ gen_rtx_COMPARE (CCmode,
+ const0_rtx,
+ operands[1]));
+ emit_insn (gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (2,
+ flags,
+ tmp)));
+ }
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[2],
+ gen_rtx_ASHIFTRT (SImode,
+ operands[0],
+ GEN_INT (31))));
+ DONE;
+ }
+ [(set_attr "length" "8,8,4,4")
+ (set_attr "arch" "a,a,t2,t2")]
+)
+
+(define_insn_and_split "*negdi_zero_extendsidi"
+ [(set (match_operand:DI 0 "s_register_operand" "=r,&r")
+ (neg:DI (zero_extend:DI (match_operand:SI 1 "s_register_operand" "0,r"))))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_32BIT"
+ "#" ; "rsbs\\t%Q0, %1, #0\;sbc\\t%R0,%R0,%R0"
+ ;; Don't care what register is input to sbc,
+ ;; since we just just need to propagate the carry.
+ "&& reload_completed"
+ [(parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (const_int 0) (match_dup 1)))
+ (set (match_dup 0) (minus:SI (const_int 0) (match_dup 1)))])
+ (set (match_dup 2) (minus:SI (minus:SI (match_dup 2) (match_dup 2))
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ }
+ [(set_attr "conds" "clob")
+ (set_attr "length" "8")] ;; length in thumb is 4
+)
+
;; abssi2 doesn't really clobber the condition codes if a different register
;; is being set. To keep things simple, assume during rtl manipulations that
;; it does, but tell the final scan operator the truth. Similarly for
@@ -4221,14 +4637,67 @@
operands[2] = gen_rtx_REG (CCmode, CC_REGNUM);
")
-(define_insn "*arm_abssi2"
+(define_insn_and_split "*arm_abssi2"
[(set (match_operand:SI 0 "s_register_operand" "=r,&r")
(abs:SI (match_operand:SI 1 "s_register_operand" "0,r")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "@
- cmp\\t%0, #0\;rsblt\\t%0, %0, #0
- eor%?\\t%0, %1, %1, asr #31\;sub%?\\t%0, %0, %1, asr #31"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+ {
+ /* if (which_alternative == 0) */
+ if (REGNO(operands[0]) == REGNO(operands[1]))
+ {
+ /* Emit the pattern:
+ cmp\\t%0, #0\;rsblt\\t%0, %0, #0
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 0) (const_int 0)))
+ (cond_exec (lt:CC (reg:CC CC_REGNUM) (const_int 0))
+ (set (match_dup 0) (minus:SI (const_int 0) (match_dup 1))))]
+ */
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_rtx_REG (CCmode, CC_REGNUM),
+ gen_rtx_COMPARE (CCmode, operands[0], const0_rtx)));
+ emit_insn (gen_rtx_COND_EXEC (VOIDmode,
+ (gen_rtx_LT (SImode,
+ gen_rtx_REG (CCmode, CC_REGNUM),
+ const0_rtx)),
+ (gen_rtx_SET (VOIDmode,
+ operands[0],
+ (gen_rtx_MINUS (SImode,
+ const0_rtx,
+ operands[1]))))));
+ DONE;
+ }
+ else
+ {
+ /* Emit the pattern:
+ alt1: eor%?\\t%0, %1, %1, asr #31\;sub%?\\t%0, %0, %1, asr #31
+ [(set (match_dup 0)
+ (xor:SI (match_dup 1)
+ (ashiftrt:SI (match_dup 1) (const_int 31))))
+ (set (match_dup 0)
+ (minus:SI (match_dup 0)
+ (ashiftrt:SI (match_dup 1) (const_int 31))))]
+ */
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_XOR (SImode,
+ gen_rtx_ASHIFTRT (SImode,
+ operands[1],
+ GEN_INT (31)),
+ operands[1])));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_MINUS (SImode,
+ operands[0],
+ gen_rtx_ASHIFTRT (SImode,
+ operands[1],
+ GEN_INT (31)))));
+ DONE;
+ }
+ }
[(set_attr "conds" "clob,*")
(set_attr "shift" "1")
(set_attr "predicable" "no, yes")
@@ -4249,14 +4718,56 @@
[(set_attr "length" "6")]
)
-(define_insn "*arm_neg_abssi2"
+(define_insn_and_split "*arm_neg_abssi2"
[(set (match_operand:SI 0 "s_register_operand" "=r,&r")
(neg:SI (abs:SI (match_operand:SI 1 "s_register_operand" "0,r"))))
(clobber (reg:CC CC_REGNUM))]
"TARGET_ARM"
- "@
- cmp\\t%0, #0\;rsbgt\\t%0, %0, #0
- eor%?\\t%0, %1, %1, asr #31\;rsb%?\\t%0, %0, %1, asr #31"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+ {
+ /* if (which_alternative == 0) */
+ if (REGNO (operands[0]) == REGNO (operands[1]))
+ {
+ /* Emit the pattern:
+ cmp\\t%0, #0\;rsbgt\\t%0, %0, #0
+ */
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_rtx_REG (CCmode, CC_REGNUM),
+ gen_rtx_COMPARE (CCmode, operands[0], const0_rtx)));
+ emit_insn (gen_rtx_COND_EXEC (VOIDmode,
+ gen_rtx_GT (SImode,
+ gen_rtx_REG (CCmode, CC_REGNUM),
+ const0_rtx),
+ gen_rtx_SET (VOIDmode,
+ operands[0],
+ (gen_rtx_MINUS (SImode,
+ const0_rtx,
+ operands[1])))));
+ }
+ else
+ {
+ /* Emit the pattern:
+ eor%?\\t%0, %1, %1, asr #31\;rsb%?\\t%0, %0, %1, asr #31
+ */
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_XOR (SImode,
+ gen_rtx_ASHIFTRT (SImode,
+ operands[1],
+ GEN_INT (31)),
+ operands[1])));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_MINUS (SImode,
+ gen_rtx_ASHIFTRT (SImode,
+ operands[1],
+ GEN_INT (31)),
+ operands[0])));
+ }
+ DONE;
+ }
[(set_attr "conds" "clob,*")
(set_attr "shift" "1")
(set_attr "predicable" "no, yes")
@@ -5307,8 +5818,8 @@
)
(define_insn "*arm_movdi"
- [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m")
- (match_operand:DI 1 "di_operand" "rDa,Db,Dc,mi,r"))]
+ [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, q, m")
+ (match_operand:DI 1 "di_operand" "rDa,Db,Dc,mi,q"))]
"TARGET_32BIT
&& !(TARGET_HARD_FLOAT && TARGET_VFP)
&& !TARGET_IWMMXT
@@ -6732,8 +7243,8 @@
)
(define_insn "*movdf_soft_insn"
- [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,r,r,m")
- (match_operand:DF 1 "soft_df_operand" "rDa,Db,Dc,mF,r"))]
+ [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,r,q,m")
+ (match_operand:DF 1 "soft_df_operand" "rDa,Db,Dc,mF,q"))]
"TARGET_32BIT && TARGET_SOFT_FLOAT
&& ( register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode))"
@@ -7611,23 +8122,64 @@
;; if-conversion can not reduce to a conditional compare, so we do
;; that directly.
-(define_insn "*arm_cmpdi_insn"
+(define_insn_and_split "*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"
- "cmp\\t%Q0, %Q1\;sbcs\\t%2, %R0, %R1"
+ "#" ; "cmp\\t%Q0, %Q1\;sbcs\\t%2, %R0, %R1"
+ "&& reload_completed"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 0) (match_dup 1)))
+ (parallel [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 3) (match_dup 4)))
+ (set (match_dup 2)
+ (minus:SI (match_dup 5)
+ (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))])]
+ {
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ if (CONST_INT_P (operands[1]))
+ {
+ operands[4] = GEN_INT (~INTVAL (gen_highpart_mode (SImode,
+ DImode,
+ operands[1])));
+ operands[5] = gen_rtx_PLUS (SImode, operands[3], operands[4]);
+ }
+ else
+ {
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[5] = gen_rtx_MINUS (SImode, operands[3], operands[4]);
+ }
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_lowpart (SImode, operands[2]);
+ }
[(set_attr "conds" "set")
(set_attr "length" "8")]
)
-(define_insn "*arm_cmpdi_unsigned"
+(define_insn_and_split "*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_32BIT"
- "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
+ "#" ; "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
+ "&& reload_completed"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 2) (match_dup 3)))
+ (cond_exec (eq:SI (reg:CC CC_REGNUM) (const_int 0))
+ (set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 0) (match_dup 1))))]
+ {
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ if (CONST_INT_P (operands[1]))
+ operands[3] = gen_highpart_mode (SImode, DImode, operands[1]);
+ else
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ }
[(set_attr "conds" "set")
(set_attr "length" "8")]
)
@@ -7752,36 +8304,56 @@
operands[3] = const0_rtx;"
)
-(define_insn "*mov_scc"
+(define_insn_and_split "*mov_scc"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(match_operator:SI 1 "arm_comparison_operator"
[(match_operand 2 "cc_register" "") (const_int 0)]))]
"TARGET_ARM"
- "mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
+ "#" ; "mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
+ "TARGET_ARM"
+ [(set (match_dup 0)
+ (if_then_else:SI (match_dup 1)
+ (const_int 1)
+ (const_int 0)))]
+ ""
[(set_attr "conds" "use")
- (set_attr "insn" "mov")
(set_attr "length" "8")]
)
-(define_insn "*mov_negscc"
+(define_insn_and_split "*mov_negscc"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(neg:SI (match_operator:SI 1 "arm_comparison_operator"
[(match_operand 2 "cc_register" "") (const_int 0)])))]
"TARGET_ARM"
- "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
+ "#" ; "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
+ "TARGET_ARM"
+ [(set (match_dup 0)
+ (if_then_else:SI (match_dup 1)
+ (match_dup 3)
+ (const_int 0)))]
+ {
+ operands[3] = GEN_INT (~0);
+ }
[(set_attr "conds" "use")
- (set_attr "insn" "mov")
(set_attr "length" "8")]
)
-(define_insn "*mov_notscc"
+(define_insn_and_split "*mov_notscc"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(not:SI (match_operator:SI 1 "arm_comparison_operator"
[(match_operand 2 "cc_register" "") (const_int 0)])))]
"TARGET_ARM"
- "mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1"
+ "#" ; "mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1"
+ "TARGET_ARM"
+ [(set (match_dup 0)
+ (if_then_else:SI (match_dup 1)
+ (match_dup 3)
+ (match_dup 4)))]
+ {
+ operands[3] = GEN_INT (~1);
+ operands[4] = GEN_INT (~0);
+ }
[(set_attr "conds" "use")
- (set_attr "insn" "mov")
(set_attr "length" "8")]
)
@@ -11653,6 +12225,9 @@
(set_attr "predicable" "yes")])
+;; Load the load/store double peephole optimizations.
+(include "ldrdstrd.md")
+
;; Load the load/store multiple patterns
(include "ldmstm.md")
diff --git a/gcc/config/arm/arm_neon_builtins.def b/gcc/config/arm/arm_neon_builtins.def
new file mode 100644
index 00000000000..5bf6d31cb88
--- /dev/null
+++ b/gcc/config/arm/arm_neon_builtins.def
@@ -0,0 +1,210 @@
+/* NEON builtin definitions for ARM.
+ Copyright (C) 2013
+ Free Software Foundation, Inc.
+ Contributed by ARM Ltd.
+
+ 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/>. */
+
+VAR10 (BINOP, vadd,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR3 (BINOP, vaddl, v8qi, v4hi, v2si),
+VAR3 (BINOP, vaddw, v8qi, v4hi, v2si),
+VAR6 (BINOP, vhadd, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR8 (BINOP, vqadd, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR3 (BINOP, vaddhn, v8hi, v4si, v2di),
+VAR8 (BINOP, vmul, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR8 (TERNOP, vmla, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR3 (TERNOP, vmlal, v8qi, v4hi, v2si),
+VAR2 (TERNOP, vfma, v2sf, v4sf),
+VAR2 (TERNOP, vfms, v2sf, v4sf),
+VAR8 (TERNOP, vmls, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR3 (TERNOP, vmlsl, v8qi, v4hi, v2si),
+VAR4 (BINOP, vqdmulh, v4hi, v2si, v8hi, v4si),
+VAR2 (TERNOP, vqdmlal, v4hi, v2si),
+VAR2 (TERNOP, vqdmlsl, v4hi, v2si),
+VAR3 (BINOP, vmull, v8qi, v4hi, v2si),
+VAR2 (SCALARMULL, vmull_n, v4hi, v2si),
+VAR2 (LANEMULL, vmull_lane, v4hi, v2si),
+VAR2 (SCALARMULL, vqdmull_n, v4hi, v2si),
+VAR2 (LANEMULL, vqdmull_lane, v4hi, v2si),
+VAR4 (SCALARMULH, vqdmulh_n, v4hi, v2si, v8hi, v4si),
+VAR4 (LANEMULH, vqdmulh_lane, v4hi, v2si, v8hi, v4si),
+VAR2 (BINOP, vqdmull, v4hi, v2si),
+VAR8 (BINOP, vshl, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR8 (BINOP, vqshl, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR8 (SHIFTIMM, vshr_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR3 (SHIFTIMM, vshrn_n, v8hi, v4si, v2di),
+VAR3 (SHIFTIMM, vqshrn_n, v8hi, v4si, v2di),
+VAR3 (SHIFTIMM, vqshrun_n, v8hi, v4si, v2di),
+VAR8 (SHIFTIMM, vshl_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR8 (SHIFTIMM, vqshl_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR8 (SHIFTIMM, vqshlu_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR3 (SHIFTIMM, vshll_n, v8qi, v4hi, v2si),
+VAR8 (SHIFTACC, vsra_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR10 (BINOP, vsub, v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR3 (BINOP, vsubl, v8qi, v4hi, v2si),
+VAR3 (BINOP, vsubw, v8qi, v4hi, v2si),
+VAR8 (BINOP, vqsub, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR6 (BINOP, vhsub, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR3 (BINOP, vsubhn, v8hi, v4si, v2di),
+VAR8 (BINOP, vceq, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR8 (BINOP, vcge, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR6 (BINOP, vcgeu, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR8 (BINOP, vcgt, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR6 (BINOP, vcgtu, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR2 (BINOP, vcage, v2sf, v4sf),
+VAR2 (BINOP, vcagt, v2sf, v4sf),
+VAR6 (BINOP, vtst, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR8 (BINOP, vabd, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR3 (BINOP, vabdl, v8qi, v4hi, v2si),
+VAR6 (TERNOP, vaba, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR3 (TERNOP, vabal, v8qi, v4hi, v2si),
+VAR8 (BINOP, vmax, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR8 (BINOP, vmin, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR4 (BINOP, vpadd, v8qi, v4hi, v2si, v2sf),
+VAR6 (UNOP, vpaddl, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR6 (BINOP, vpadal, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR4 (BINOP, vpmax, v8qi, v4hi, v2si, v2sf),
+VAR4 (BINOP, vpmin, v8qi, v4hi, v2si, v2sf),
+VAR2 (BINOP, vrecps, v2sf, v4sf),
+VAR2 (BINOP, vrsqrts, v2sf, v4sf),
+VAR8 (SHIFTINSERT, vsri_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR8 (SHIFTINSERT, vsli_n, v8qi, v4hi, v2si, di, v16qi, v8hi, v4si, v2di),
+VAR8 (UNOP, vabs, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR6 (UNOP, vqabs, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR8 (UNOP, vneg, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR6 (UNOP, vqneg, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR6 (UNOP, vcls, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR6 (UNOP, vclz, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+VAR2 (UNOP, vcnt, v8qi, v16qi),
+VAR4 (UNOP, vrecpe, v2si, v2sf, v4si, v4sf),
+VAR4 (UNOP, vrsqrte, v2si, v2sf, v4si, v4sf),
+VAR6 (UNOP, vmvn, v8qi, v4hi, v2si, v16qi, v8hi, v4si),
+ /* FIXME: vget_lane supports more variants than this! */
+VAR10 (GETLANE, vget_lane,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (SETLANE, vset_lane,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (CREATE, vcreate, v8qi, v4hi, v2si, v2sf, di),
+VAR10 (DUP, vdup_n,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (DUPLANE, vdup_lane,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (COMBINE, vcombine, v8qi, v4hi, v2si, v2sf, di),
+VAR5 (SPLIT, vget_high, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (SPLIT, vget_low, v16qi, v8hi, v4si, v4sf, v2di),
+VAR3 (UNOP, vmovn, v8hi, v4si, v2di),
+VAR3 (UNOP, vqmovn, v8hi, v4si, v2di),
+VAR3 (UNOP, vqmovun, v8hi, v4si, v2di),
+VAR3 (UNOP, vmovl, v8qi, v4hi, v2si),
+VAR6 (LANEMUL, vmul_lane, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR6 (LANEMAC, vmla_lane, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR2 (LANEMAC, vmlal_lane, v4hi, v2si),
+VAR2 (LANEMAC, vqdmlal_lane, v4hi, v2si),
+VAR6 (LANEMAC, vmls_lane, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR2 (LANEMAC, vmlsl_lane, v4hi, v2si),
+VAR2 (LANEMAC, vqdmlsl_lane, v4hi, v2si),
+VAR6 (SCALARMUL, vmul_n, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR6 (SCALARMAC, vmla_n, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR2 (SCALARMAC, vmlal_n, v4hi, v2si),
+VAR2 (SCALARMAC, vqdmlal_n, v4hi, v2si),
+VAR6 (SCALARMAC, vmls_n, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR2 (SCALARMAC, vmlsl_n, v4hi, v2si),
+VAR2 (SCALARMAC, vqdmlsl_n, v4hi, v2si),
+VAR10 (BINOP, vext,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR8 (UNOP, vrev64, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR4 (UNOP, vrev32, v8qi, v4hi, v16qi, v8hi),
+VAR2 (UNOP, vrev16, v8qi, v16qi),
+VAR4 (CONVERT, vcvt, v2si, v2sf, v4si, v4sf),
+VAR4 (FIXCONV, vcvt_n, v2si, v2sf, v4si, v4sf),
+VAR10 (SELECT, vbsl,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR2 (RINT, vrintn, v2sf, v4sf),
+VAR2 (RINT, vrinta, v2sf, v4sf),
+VAR2 (RINT, vrintp, v2sf, v4sf),
+VAR2 (RINT, vrintm, v2sf, v4sf),
+VAR2 (RINT, vrintz, v2sf, v4sf),
+VAR2 (RINT, vrintx, v2sf, v4sf),
+VAR1 (VTBL, vtbl1, v8qi),
+VAR1 (VTBL, vtbl2, v8qi),
+VAR1 (VTBL, vtbl3, v8qi),
+VAR1 (VTBL, vtbl4, v8qi),
+VAR1 (VTBX, vtbx1, v8qi),
+VAR1 (VTBX, vtbx2, v8qi),
+VAR1 (VTBX, vtbx3, v8qi),
+VAR1 (VTBX, vtbx4, v8qi),
+VAR8 (RESULTPAIR, vtrn, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR8 (RESULTPAIR, vzip, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR8 (RESULTPAIR, vuzp, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
+VAR5 (REINTERP, vreinterpretv8qi, v8qi, v4hi, v2si, v2sf, di),
+VAR5 (REINTERP, vreinterpretv4hi, v8qi, v4hi, v2si, v2sf, di),
+VAR5 (REINTERP, vreinterpretv2si, v8qi, v4hi, v2si, v2sf, di),
+VAR5 (REINTERP, vreinterpretv2sf, v8qi, v4hi, v2si, v2sf, di),
+VAR5 (REINTERP, vreinterpretdi, v8qi, v4hi, v2si, v2sf, di),
+VAR5 (REINTERP, vreinterpretv16qi, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (REINTERP, vreinterpretv8hi, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (REINTERP, vreinterpretv4si, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (REINTERP, vreinterpretv4sf, v16qi, v8hi, v4si, v4sf, v2di),
+VAR5 (REINTERP, vreinterpretv2di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (LOAD1, vld1,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (LOAD1LANE, vld1_lane,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (LOAD1, vld1_dup,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (STORE1, vst1,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (STORE1LANE, vst1_lane,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR9 (LOADSTRUCT,
+ vld2, v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
+VAR7 (LOADSTRUCTLANE, vld2_lane,
+ v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR5 (LOADSTRUCT, vld2_dup, v8qi, v4hi, v2si, v2sf, di),
+VAR9 (STORESTRUCT, vst2,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
+VAR7 (STORESTRUCTLANE, vst2_lane,
+ v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR9 (LOADSTRUCT,
+ vld3, v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
+VAR7 (LOADSTRUCTLANE, vld3_lane,
+ v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR5 (LOADSTRUCT, vld3_dup, v8qi, v4hi, v2si, v2sf, di),
+VAR9 (STORESTRUCT, vst3,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
+VAR7 (STORESTRUCTLANE, vst3_lane,
+ v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR9 (LOADSTRUCT, vld4,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
+VAR7 (LOADSTRUCTLANE, vld4_lane,
+ v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR5 (LOADSTRUCT, vld4_dup, v8qi, v4hi, v2si, v2sf, di),
+VAR9 (STORESTRUCT, vst4,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf),
+VAR7 (STORESTRUCTLANE, vst4_lane,
+ v8qi, v4hi, v2si, v2sf, v8hi, v4si, v4sf),
+VAR10 (LOGICBINOP, vand,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (LOGICBINOP, vorr,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (BINOP, veor,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (LOGICBINOP, vbic,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di),
+VAR10 (LOGICBINOP, vorn,
+ v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di)
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index bee429f82db..8e6683b3b23 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -60,6 +60,7 @@
|mcpu=cortex-a7 \
|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
|mcpu=marvell-pj4 \
+ |mcpu=cortex-a53 \
|mcpu=generic-armv7-a \
|march=armv7-m|mcpu=cortex-m3 \
|march=armv7e-m|mcpu=cortex-m4 \
@@ -71,6 +72,7 @@
" %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5 \
|mcpu=cortex-a7 \
|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
+ |mcpu=cortex-a53 \
|mcpu=marvell-pj4 \
|mcpu=generic-armv7-a \
|march=armv7-m|mcpu=cortex-m3 \
diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md
index 775f8afd7f3..767ebfb6080 100644
--- a/gcc/config/arm/constraints.md
+++ b/gcc/config/arm/constraints.md
@@ -21,7 +21,7 @@
;; The following register constraints have been used:
;; - in ARM/Thumb-2 state: t, w, x, y, z
;; - in Thumb state: h, b
-;; - in both states: l, c, k
+;; - in both states: l, c, k, q
;; In ARM state, 'l' is an alias for 'r'
;; 'f' and 'v' were previously used for FPA and MAVERICK registers.
@@ -86,6 +86,9 @@
(define_register_constraint "k" "STACK_REG"
"@internal The stack register.")
+(define_register_constraint "q" "(TARGET_ARM && TARGET_LDRD) ? CORE_REGS : GENERAL_REGS"
+ "@internal In ARM state with LDRD support, core registers, otherwise general registers.")
+
(define_register_constraint "b" "TARGET_THUMB ? BASE_REGS : NO_REGS"
"@internal
Thumb only. The union of the low registers and the stack register.")
@@ -248,6 +251,12 @@
(and (match_code "const_int")
(match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, PLUS)")))
+(define_constraint "De"
+ "@internal
+ In ARM/Thumb-2 state a const_int that can be used by insn anddi."
+ (and (match_code "const_int")
+ (match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, AND)")))
+
(define_constraint "Di"
"@internal
In ARM/Thumb-2 state a const_int or const_double where both the high
diff --git a/gcc/config/arm/cortex-a53.md b/gcc/config/arm/cortex-a53.md
new file mode 100644
index 00000000000..b6a291e017b
--- /dev/null
+++ b/gcc/config/arm/cortex-a53.md
@@ -0,0 +1,296 @@
+;; ARM Cortex-A53 pipeline description
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+;;
+;; Contributed by ARM Ltd.
+;;
+;; 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/>.
+
+(define_automaton "cortex_a53")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Functional units.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; There are two main integer execution pipelines, described as
+;; slot 0 and issue slot 1.
+
+(define_cpu_unit "cortex_a53_slot0" "cortex_a53")
+(define_cpu_unit "cortex_a53_slot1" "cortex_a53")
+
+(define_reservation "cortex_a53_slot_any" "cortex_a53_slot0|cortex_a53_slot1")
+(define_reservation "cortex_a53_single_issue" "cortex_a53_slot0+cortex_a53_slot1")
+
+;; The load/store pipeline. Load/store instructions can dual-issue from
+;; either pipeline, but two load/stores cannot simultaneously issue.
+
+(define_cpu_unit "cortex_a53_ls" "cortex_a53")
+
+;; The store pipeline. Shared between both execution pipelines.
+
+(define_cpu_unit "cortex_a53_store" "cortex_a53")
+
+;; The branch pipeline. Branches can dual-issue with other instructions
+;; (except when those instructions take multiple cycles to issue).
+
+(define_cpu_unit "cortex_a53_branch" "cortex_a53")
+
+;; The integer divider.
+
+(define_cpu_unit "cortex_a53_idiv" "cortex_a53")
+
+;; The floating-point add pipeline used to model the usage
+;; of the add pipeline by fmac instructions.
+
+(define_cpu_unit "cortex_a53_fpadd_pipe" "cortex_a53")
+
+;; Floating-point div/sqrt (long latency, out-of-order completion).
+
+(define_cpu_unit "cortex_a53_fp_div_sqrt" "cortex_a53")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ALU instructions.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn_reservation "cortex_a53_alu" 2
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "alu_reg,simple_alu_imm"))
+ "cortex_a53_slot_any")
+
+(define_insn_reservation "cortex_a53_alu_shift" 2
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "alu_shift,alu_shift_reg"))
+ "cortex_a53_slot_any")
+
+;; Forwarding path for unshifted operands.
+
+(define_bypass 1 "cortex_a53_alu,cortex_a53_alu_shift"
+ "cortex_a53_alu")
+
+(define_bypass 1 "cortex_a53_alu,cortex_a53_alu_shift"
+ "cortex_a53_alu_shift"
+ "arm_no_early_alu_shift_dep")
+
+;; The multiplier pipeline can forward results so there's no need to specify
+;; bypasses. Multiplies can only single-issue currently.
+
+(define_insn_reservation "cortex_a53_mul" 3
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "mult"))
+ "cortex_a53_single_issue")
+
+;; A multiply with a single-register result or an MLA, followed by an
+;; MLA with an accumulator dependency, has its result forwarded so two
+;; such instructions can issue back-to-back.
+
+(define_bypass 1 "cortex_a53_mul"
+ "cortex_a53_mul"
+ "arm_mac_accumulator_is_mul_result")
+
+;; Punt with a high enough latency for divides.
+(define_insn_reservation "cortex_a53_udiv" 8
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "insn" "udiv"))
+ "(cortex_a53_slot0+cortex_a53_idiv),cortex_a53_idiv*7")
+
+(define_insn_reservation "cortex_a53_sdiv" 9
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "insn" "sdiv"))
+ "(cortex_a53_slot0+cortex_a53_idiv),cortex_a53_idiv*8")
+
+
+(define_bypass 2 "cortex_a53_mul,cortex_a53_udiv,cortex_a53_sdiv"
+ "cortex_a53_alu")
+(define_bypass 2 "cortex_a53_mul,cortex_a53_udiv,cortex_a53_sdiv"
+ "cortex_a53_alu_shift"
+ "arm_no_early_alu_shift_dep")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Load/store instructions.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Address-generation happens in the issue stage.
+
+(define_insn_reservation "cortex_a53_load1" 3
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "load_byte,load1"))
+ "cortex_a53_slot_any+cortex_a53_ls")
+
+(define_insn_reservation "cortex_a53_store1" 2
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "store1"))
+ "cortex_a53_slot_any+cortex_a53_ls+cortex_a53_store")
+
+(define_insn_reservation "cortex_a53_load2" 3
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "load2"))
+ "cortex_a53_single_issue+cortex_a53_ls")
+
+(define_insn_reservation "cortex_a53_store2" 2
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "store2"))
+ "cortex_a53_single_issue+cortex_a53_ls+cortex_a53_store")
+
+(define_insn_reservation "cortex_a53_load3plus" 4
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "load3,load4"))
+ "(cortex_a53_single_issue+cortex_a53_ls)*2")
+
+(define_insn_reservation "cortex_a53_store3plus" 3
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "store3,store4"))
+ "(cortex_a53_single_issue+cortex_a53_ls+cortex_a53_store)*2")
+
+;; Load/store addresses are required early in Issue.
+(define_bypass 3 "cortex_a53_load1,cortex_a53_load2,cortex_a53_load3plus,cortex_a53_alu,cortex_a53_alu_shift"
+ "cortex_a53_load*"
+ "arm_early_load_addr_dep")
+(define_bypass 3 "cortex_a53_load1,cortex_a53_load2,cortex_a53_load3plus,cortex_a53_alu,cortex_a53_alu_shift"
+ "cortex_a53_store*"
+ "arm_early_store_addr_dep")
+
+;; Load data can forward in the ALU pipeline
+(define_bypass 2 "cortex_a53_load1,cortex_a53_load2"
+ "cortex_a53_alu")
+(define_bypass 2 "cortex_a53_load1,cortex_a53_load2"
+ "cortex_a53_alu_shift"
+ "arm_no_early_alu_shift_dep")
+
+;; ALU ops can forward to stores.
+(define_bypass 0 "cortex_a53_alu,cortex_a53_alu_shift"
+ "cortex_a53_store1,cortex_a53_store2,cortex_a53_store3plus"
+ "arm_no_early_store_addr_dep")
+
+(define_bypass 1 "cortex_a53_mul,cortex_a53_udiv,cortex_a53_sdiv,cortex_a53_load1,cortex_a53_load2,cortex_a53_load3plus"
+ "cortex_a53_store1,cortex_a53_store2,cortex_a53_store3plus"
+ "arm_no_early_store_addr_dep")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Branches.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Currently models all branches as dual-issuable from either execution
+;; slot, which isn't true for all cases. We still need to model indirect
+;; branches.
+
+(define_insn_reservation "cortex_a53_branch" 0
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "branch,call"))
+ "cortex_a53_slot_any+cortex_a53_branch")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Floating-point arithmetic.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn_reservation "cortex_a53_fpalu" 4
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "ffariths, fadds, ffarithd, faddd, fcpys, fmuls, f_cvt,\
+ fcmps, fcmpd"))
+ "cortex_a53_slot0+cortex_a53_fpadd_pipe")
+
+(define_insn_reservation "cortex_a53_fconst" 2
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "fconsts,fconstd"))
+ "cortex_a53_slot0+cortex_a53_fpadd_pipe")
+
+(define_insn_reservation "cortex_a53_fpmul" 4
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "fmuls,fmuld"))
+ "cortex_a53_slot0")
+
+;; For single-precision multiply-accumulate, the add (accumulate) is issued after
+;; the multiply completes. Model that accordingly.
+
+(define_insn_reservation "cortex_a53_fpmac" 8
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "fmacs,fmacd,ffmas,ffmad"))
+ "cortex_a53_slot0, nothing*3, cortex_a53_fpadd_pipe")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Floating-point divide/square root instructions.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fsqrt really takes one cycle less, but that is not modelled.
+
+(define_insn_reservation "cortex_a53_fdivs" 14
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "fdivs"))
+ "cortex_a53_slot0, cortex_a53_fp_div_sqrt * 13")
+
+(define_insn_reservation "cortex_a53_fdivd" 29
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "fdivd"))
+ "cortex_a53_slot0, cortex_a53_fp_div_sqrt * 28")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; VFP to/from core transfers.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn_reservation "cortex_a53_r2f" 4
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "r_2_f"))
+ "cortex_a53_slot0")
+
+(define_insn_reservation "cortex_a53_f2r" 2
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "f_2_r"))
+ "cortex_a53_slot0")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; VFP flag transfer.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn_reservation "cortex_a53_f_flags" 4
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "f_flag"))
+ "cortex_a53_slot0")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; VFP load/store.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_insn_reservation "cortex_a53_f_loads" 4
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "f_loads"))
+ "cortex_a53_slot0")
+
+(define_insn_reservation "cortex_a53_f_loadd" 5
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "f_loadd"))
+ "cortex_a53_slot0")
+
+(define_insn_reservation "cortex_a53_f_stores" 0
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "f_stores"))
+ "cortex_a53_slot0")
+
+(define_insn_reservation "cortex_a53_f_stored" 0
+ (and (eq_attr "tune" "cortexa53")
+ (eq_attr "type" "f_stored"))
+ "cortex_a53_slot0")
+
+;; Load-to-use for floating-point values has a penalty of one cycle,
+;; i.e. a latency of two.
+
+(define_bypass 2 "cortex_a53_f_loads"
+ "cortex_a53_fpalu, cortex_a53_fpmac, cortex_a53_fpmul,\
+ cortex_a53_fdivs, cortex_a53_fdivd,\
+ cortex_a53_f2r")
+
+(define_bypass 2 "cortex_a53_f_loadd"
+ "cortex_a53_fpalu, cortex_a53_fpmac, cortex_a53_fpmul,\
+ cortex_a53_fdivs, cortex_a53_fdivd,\
+ cortex_a53_f2r")
+
diff --git a/gcc/config/arm/ldrdstrd.md b/gcc/config/arm/ldrdstrd.md
new file mode 100644
index 00000000000..58c883ef1cb
--- /dev/null
+++ b/gcc/config/arm/ldrdstrd.md
@@ -0,0 +1,260 @@
+;; ARM ldrd/strd peephole optimizations.
+;;
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+;;
+;; Written by Greta Yorsh <greta.yorsh@arm.com>
+
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; The following peephole optimizations identify consecutive memory
+;; accesses, and try to rearrange the operands to enable generation of
+;; ldrd/strd.
+
+(define_peephole2 ; ldrd
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
+ (match_operand:SI 2 "memory_operand" ""))
+ (set (match_operand:SI 1 "arm_general_register_operand" "")
+ (match_operand:SI 3 "memory_operand" ""))]
+ "TARGET_LDRD
+ && current_tune->prefer_ldrd_strd
+ && !optimize_function_for_size_p (cfun)"
+ [(const_int 0)]
+{
+ if (!gen_operands_ldrd_strd (operands, true, false, false))
+ FAIL;
+ else if (TARGET_ARM)
+ {
+ /* In ARM state, the destination registers of LDRD/STRD must be
+ consecutive. We emit DImode access. */
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
+ operands[2] = adjust_address (operands[2], DImode, 0);
+ /* Emit [(set (match_dup 0) (match_dup 2))] */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[2]));
+ DONE;
+ }
+ else if (TARGET_THUMB2)
+ {
+ /* Emit the pattern:
+ [(parallel [(set (match_dup 0) (match_dup 2))
+ (set (match_dup 1) (match_dup 3))])] */
+ rtx t1 = gen_rtx_SET (VOIDmode, operands[0], operands[2]);
+ rtx t2 = gen_rtx_SET (VOIDmode, operands[1], operands[3]);
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, t1, t2)));
+ DONE;
+ }
+})
+
+(define_peephole2 ; strd
+ [(set (match_operand:SI 2 "memory_operand" "")
+ (match_operand:SI 0 "arm_general_register_operand" ""))
+ (set (match_operand:SI 3 "memory_operand" "")
+ (match_operand:SI 1 "arm_general_register_operand" ""))]
+ "TARGET_LDRD
+ && current_tune->prefer_ldrd_strd
+ && !optimize_function_for_size_p (cfun)"
+ [(const_int 0)]
+{
+ if (!gen_operands_ldrd_strd (operands, false, false, false))
+ FAIL;
+ else if (TARGET_ARM)
+ {
+ /* In ARM state, the destination registers of LDRD/STRD must be
+ consecutive. We emit DImode access. */
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
+ operands[2] = adjust_address (operands[2], DImode, 0);
+ /* Emit [(set (match_dup 2) (match_dup 0))] */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[2], operands[0]));
+ DONE;
+ }
+ else if (TARGET_THUMB2)
+ {
+ /* Emit the pattern:
+ [(parallel [(set (match_dup 2) (match_dup 0))
+ (set (match_dup 3) (match_dup 1))])] */
+ rtx t1 = gen_rtx_SET (VOIDmode, operands[2], operands[0]);
+ rtx t2 = gen_rtx_SET (VOIDmode, operands[3], operands[1]);
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, t1, t2)));
+ DONE;
+ }
+})
+
+;; The following peepholes reorder registers to enable LDRD/STRD.
+(define_peephole2 ; strd of constants
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))
+ (set (match_operand:SI 2 "memory_operand" "")
+ (match_dup 0))
+ (set (match_operand:SI 1 "arm_general_register_operand" "")
+ (match_operand:SI 5 "const_int_operand" ""))
+ (set (match_operand:SI 3 "memory_operand" "")
+ (match_dup 1))]
+ "TARGET_LDRD
+ && current_tune->prefer_ldrd_strd
+ && !optimize_function_for_size_p (cfun)"
+ [(const_int 0)]
+{
+ if (!gen_operands_ldrd_strd (operands, false, true, false))
+ FAIL;
+ else if (TARGET_ARM)
+ {
+ rtx tmp = gen_rtx_REG (DImode, REGNO (operands[0]));
+ operands[2] = adjust_address (operands[2], DImode, 0);
+ /* Emit the pattern:
+ [(set (match_dup 0) (match_dup 4))
+ (set (match_dup 1) (match_dup 5))
+ (set (match_dup 2) tmp)] */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[4]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[1], operands[5]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[2], tmp));
+ DONE;
+ }
+ else if (TARGET_THUMB2)
+ {
+ /* Emit the pattern:
+ [(set (match_dup 0) (match_dup 4))
+ (set (match_dup 1) (match_dup 5))
+ (parallel [(set (match_dup 2) (match_dup 0))
+ (set (match_dup 3) (match_dup 1))])] */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[4]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[1], operands[5]));
+ rtx t1 = gen_rtx_SET (VOIDmode, operands[2], operands[0]);
+ rtx t2 = gen_rtx_SET (VOIDmode, operands[3], operands[1]);
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, t1, t2)));
+ DONE;
+ }
+})
+
+(define_peephole2 ; strd of constants
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))
+ (set (match_operand:SI 1 "arm_general_register_operand" "")
+ (match_operand:SI 5 "const_int_operand" ""))
+ (set (match_operand:SI 2 "memory_operand" "")
+ (match_dup 0))
+ (set (match_operand:SI 3 "memory_operand" "")
+ (match_dup 1))]
+ "TARGET_LDRD
+ && current_tune->prefer_ldrd_strd
+ && !optimize_function_for_size_p (cfun)"
+ [(const_int 0)]
+{
+ if (!gen_operands_ldrd_strd (operands, false, true, false))
+ FAIL;
+ else if (TARGET_ARM)
+ {
+ rtx tmp = gen_rtx_REG (DImode, REGNO (operands[0]));
+ operands[2] = adjust_address (operands[2], DImode, 0);
+ /* Emit the pattern
+ [(set (match_dup 0) (match_dup 4))
+ (set (match_dup 1) (match_dup 5))
+ (set (match_dup 2) tmp)] */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[4]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[1], operands[5]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[2], tmp));
+ DONE;
+ }
+ else if (TARGET_THUMB2)
+ {
+ /* Emit the pattern:
+ [(set (match_dup 0) (match_dup 4))
+ (set (match_dup 1) (match_dup 5))
+ (parallel [(set (match_dup 2) (match_dup 0))
+ (set (match_dup 3) (match_dup 1))])] */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[4]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[1], operands[5]));
+ rtx t1 = gen_rtx_SET (VOIDmode, operands[2], operands[0]);
+ rtx t2 = gen_rtx_SET (VOIDmode, operands[3], operands[1]);
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, t1, t2)));
+ DONE;
+ }
+})
+
+;; The following two peephole optimizations are only relevant for ARM
+;; mode where LDRD/STRD require consecutive registers.
+
+(define_peephole2 ; swap the destination registers of two loads
+ ; before a commutative operation.
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
+ (match_operand:SI 2 "memory_operand" ""))
+ (set (match_operand:SI 1 "arm_general_register_operand" "")
+ (match_operand:SI 3 "memory_operand" ""))
+ (set (match_operand:SI 4 "arm_general_register_operand" "")
+ (match_operator:SI 5 "commutative_binary_operator"
+ [(match_operand 6 "arm_general_register_operand" "")
+ (match_operand 7 "arm_general_register_operand" "") ]))]
+ "TARGET_LDRD && TARGET_ARM
+ && current_tune->prefer_ldrd_strd
+ && !optimize_function_for_size_p (cfun)
+ && ( ((rtx_equal_p(operands[0], operands[6])) && (rtx_equal_p(operands[1], operands[7])))
+ ||((rtx_equal_p(operands[0], operands[7])) && (rtx_equal_p(operands[1], operands[6]))))
+ && (peep2_reg_dead_p (3, operands[0]) || rtx_equal_p (operands[0], operands[4]))
+ && (peep2_reg_dead_p (3, operands[1]) || rtx_equal_p (operands[1], operands[4]))"
+ [(set (match_dup 0) (match_dup 2))
+ (set (match_dup 4) (match_op_dup 5 [(match_dup 6) (match_dup 7)]))]
+ {
+ if (!gen_operands_ldrd_strd (operands, true, false, true))
+ {
+ FAIL;
+ }
+ else
+ {
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
+ operands[2] = adjust_address (operands[2], DImode, 0);
+ }
+ }
+)
+
+(define_peephole2 ; swap the destination registers of two loads
+ ; before a commutative operation that sets the flags.
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
+ (match_operand:SI 2 "memory_operand" ""))
+ (set (match_operand:SI 1 "arm_general_register_operand" "")
+ (match_operand:SI 3 "memory_operand" ""))
+ (parallel
+ [(set (match_operand:SI 4 "arm_general_register_operand" "")
+ (match_operator:SI 5 "commutative_binary_operator"
+ [(match_operand 6 "arm_general_register_operand" "")
+ (match_operand 7 "arm_general_register_operand" "") ]))
+ (clobber (reg:CC CC_REGNUM))])]
+ "TARGET_LDRD && TARGET_ARM
+ && current_tune->prefer_ldrd_strd
+ && !optimize_function_for_size_p (cfun)
+ && ( ((rtx_equal_p(operands[0], operands[6])) && (rtx_equal_p(operands[1], operands[7])))
+ ||((rtx_equal_p(operands[0], operands[7])) && (rtx_equal_p(operands[1], operands[6]))))
+ && (peep2_reg_dead_p (3, operands[0]) || rtx_equal_p (operands[0], operands[4]))
+ && (peep2_reg_dead_p (3, operands[1]) || rtx_equal_p (operands[1], operands[4]))"
+ [(set (match_dup 0) (match_dup 2))
+ (parallel
+ [(set (match_dup 4)
+ (match_op_dup 5 [(match_dup 6) (match_dup 7)]))
+ (clobber (reg:CC CC_REGNUM))])]
+ {
+ if (!gen_operands_ldrd_strd (operands, true, false, true))
+ {
+ FAIL;
+ }
+ else
+ {
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
+ operands[2] = adjust_address (operands[2], DImode, 0);
+ }
+ }
+)
+
+;; TODO: Handle LDRD/STRD with writeback:
+;; (a) memory operands can be POST_INC, POST_DEC, PRE_MODIFY, POST_MODIFY
+;; (b) Patterns may be followed by an update of the base address.
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index d7c2cb36949..67f89b2fb03 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -724,29 +724,6 @@
[(set_attr "neon_type" "neon_int_1")]
)
-(define_insn "anddi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w,w,?&r,?&r,?w,?w")
- (and:DI (match_operand:DI 1 "s_register_operand" "%w,0,0,r,w,0")
- (match_operand:DI 2 "neon_inv_logic_op2" "w,DL,r,r,w,DL")))]
- "TARGET_NEON"
-{
- switch (which_alternative)
- {
- case 0: /* fall through */
- case 4: return "vand\t%P0, %P1, %P2";
- case 1: /* fall through */
- case 5: 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,neon_int_1,*,*,neon_int_1,neon_int_1")
- (set_attr "length" "*,*,8,8,*,*")
- (set_attr "arch" "neon_for_64bits,neon_for_64bits,*,*,avoid_neon_for_64bits,avoid_neon_for_64bits")]
-)
-
(define_insn "orn<mode>3_neon"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(ior:VDQ (not:VDQ (match_operand:VDQ 2 "s_register_operand" "w"))
@@ -5611,7 +5588,7 @@
(match_operand:SI 3 "immediate_operand" "")]
"TARGET_NEON"
{
- emit_insn (gen_and<mode>3<V_suf64> (operands[0], operands[1], operands[2]));
+ emit_insn (gen_and<mode>3 (operands[0], operands[1], operands[2]));
DONE;
})
diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
index f301df2fcdb..2e0de08a8d0 100644
--- a/gcc/config/arm/predicates.md
+++ b/gcc/config/arm/predicates.md
@@ -31,6 +31,17 @@
|| REGNO_REG_CLASS (REGNO (op)) != NO_REGS));
})
+(define_predicate "imm_for_neon_inv_logic_operand"
+ (match_code "const_vector")
+{
+ return (TARGET_NEON
+ && neon_immediate_valid_for_logic (op, mode, 1, NULL, NULL));
+})
+
+(define_predicate "neon_inv_logic_op2"
+ (ior (match_operand 0 "imm_for_neon_inv_logic_operand")
+ (match_operand 0 "s_register_operand")))
+
;; Any hard register.
(define_predicate "arm_hard_register_operand"
(match_code "reg")
@@ -145,6 +156,12 @@
(ior (match_operand 0 "arm_rhs_operand")
(match_operand 0 "arm_neg_immediate_operand")))
+(define_predicate "arm_anddi_operand_neon"
+ (ior (match_operand 0 "s_register_operand")
+ (and (match_code "const_int")
+ (match_test "const_ok_for_dimode_op (INTVAL (op), AND)"))
+ (match_operand 0 "neon_inv_logic_op2")))
+
(define_predicate "arm_adddi_operand"
(ior (match_operand 0 "s_register_operand")
(and (match_code "const_int")
@@ -525,21 +542,10 @@
&& neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL));
})
-(define_predicate "imm_for_neon_inv_logic_operand"
- (match_code "const_vector")
-{
- return (TARGET_NEON
- && neon_immediate_valid_for_logic (op, mode, 1, NULL, NULL));
-})
-
(define_predicate "neon_logic_op2"
(ior (match_operand 0 "imm_for_neon_logic_operand")
(match_operand 0 "s_register_operand")))
-(define_predicate "neon_inv_logic_op2"
- (ior (match_operand 0 "imm_for_neon_inv_logic_operand")
- (match_operand 0 "s_register_operand")))
-
;; Predicates for named expanders that overlap multiple ISAs.
(define_predicate "cmpdi_operand"
diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm
index 96b88de0f7c..fe075e5862a 100644
--- a/gcc/config/arm/t-arm
+++ b/gcc/config/arm/t-arm
@@ -39,6 +39,7 @@ MD_INCLUDES= $(srcdir)/config/arm/arm1020e.md \
$(srcdir)/config/arm/cortex-a8-neon.md \
$(srcdir)/config/arm/cortex-a9.md \
$(srcdir)/config/arm/cortex-a9-neon.md \
+ $(srcdir)/config/arm/cortex-a53.md \
$(srcdir)/config/arm/cortex-m4-fpu.md \
$(srcdir)/config/arm/cortex-m4.md \
$(srcdir)/config/arm/cortex-r4f.md \
@@ -52,6 +53,7 @@ MD_INCLUDES= $(srcdir)/config/arm/arm1020e.md \
$(srcdir)/config/arm/iwmmxt.md \
$(srcdir)/config/arm/iwmmxt2.md \
$(srcdir)/config/arm/ldmstm.md \
+ $(srcdir)/config/arm/ldrdstrd.md \
$(srcdir)/config/arm/marvell-f-iwmmxt.md \
$(srcdir)/config/arm/neon.md \
$(srcdir)/config/arm/predicates.md \
@@ -84,7 +86,8 @@ arm.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) except.h $(C_PRAGMA_H) $(TM_P_H) \
$(TARGET_H) $(TARGET_DEF_H) debug.h langhooks.h $(DF_H) \
intl.h libfuncs.h $(PARAMS_H) $(OPTS_H) $(srcdir)/config/arm/arm-cores.def \
- $(srcdir)/config/arm/arm-arches.def $(srcdir)/config/arm/arm-fpus.def
+ $(srcdir)/config/arm/arm-arches.def $(srcdir)/config/arm/arm-fpus.def \
+ $(srcdir)/config/arm/arm_neon_builtins.def
arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H)
diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h
index c1fe9f130fa..74d63df4418 100644
--- a/gcc/config/arm/uclinux-elf.h
+++ b/gcc/config/arm/uclinux-elf.h
@@ -65,7 +65,7 @@
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
- "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G %L}"
/* Use --as-needed -lgcc_s for eh support. */
#ifdef HAVE_LD_AS_NEEDED
diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md
index 508603cf6c8..c43a6a6c696 100644
--- a/gcc/config/arm/unspecs.md
+++ b/gcc/config/arm/unspecs.md
@@ -83,6 +83,8 @@
; FPSCR rounding mode and signal inexactness.
UNSPEC_VRINTA ; Represent a float to integral float rounding
; towards nearest, ties away from zero.
+ UNSPEC_RRX ; Rotate Right with Extend shifts register right
+ ; by one place, with Carry flag shifted into bit[31].
])
(define_c_enum "unspec" [
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
index 923624ffc6f..1930cddb835 100644
--- a/gcc/config/arm/vfp.md
+++ b/gcc/config/arm/vfp.md
@@ -132,8 +132,8 @@
;; DImode moves
(define_insn "*movdi_vfp"
- [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,r,r,r,r,m,w,r,w,w, Uv")
- (match_operand:DI 1 "di_operand" "r,rDa,Db,Dc,mi,mi,r,r,w,w,Uvi,w"))]
+ [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,r,r,q,q,m,w,r,w,w, Uv")
+ (match_operand:DI 1 "di_operand" "r,rDa,Db,Dc,mi,mi,q,r,w,w,Uvi,w"))]
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP && arm_tune != cortexa8
&& ( register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode))
diff --git a/gcc/config/epiphany/constraints.md b/gcc/config/epiphany/constraints.md
index bd3d935a275..d4d6049fe67 100644
--- a/gcc/config/epiphany/constraints.md
+++ b/gcc/config/epiphany/constraints.md
@@ -39,6 +39,11 @@
(and (match_code "const_int")
(match_test "SIMM11 (ival)")))
+(define_constraint "CnL"
+ "A negated signed 11-bit constant."
+ (and (match_code "const_int")
+ (match_test "SIMM11 (-ival)")))
+
(define_constraint "Cm1"
"A signed 11-bit constant added to -1"
(and (match_code "const_int")
diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
index 5520a633c1f..7d251e3d00e 100644
--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -335,7 +335,8 @@ epiphany_select_cc_mode (enum rtx_code op,
{
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
{
- if (TARGET_SOFT_CMPSF)
+ if (TARGET_SOFT_CMPSF
+ || op == ORDERED || op == UNORDERED)
{
if (op == EQ || op == NE)
return CC_FP_EQmode;
@@ -537,24 +538,47 @@ gen_compare_reg (enum machine_mode cmode, enum rtx_code code,
if (mode == CC_FP_GTEmode
&& (code == LE || code == LT || code == UNGT || code == UNGE))
{
- rtx tmp = x; x = y; y = tmp;
- code = swap_condition (code);
+ if (flag_finite_math_only
+ && ((REG_P (x) && REGNO (x) == GPR_0)
+ || (REG_P (y) && REGNO (y) == GPR_1)))
+ switch (code)
+ {
+ case LE: code = UNLE; break;
+ case LT: code = UNLT; break;
+ case UNGT: code = GT; break;
+ case UNGE: code = GE; break;
+ default: gcc_unreachable ();
+ }
+ else
+ {
+ rtx tmp = x; x = y; y = tmp;
+ code = swap_condition (code);
+ }
}
cc_reg = gen_rtx_REG (mode, CC_REGNUM);
}
if ((mode == CC_FP_EQmode || mode == CC_FP_GTEmode
|| mode == CC_FP_ORDmode || mode == CC_FP_UNEQmode)
/* mov<mode>cc might want to re-emit a comparison during ifcvt. */
- && (!REG_P (x) || REGNO (x) != 0 || !REG_P (y) || REGNO (y) != 1))
+ && (!REG_P (x) || REGNO (x) != GPR_0
+ || !REG_P (y) || REGNO (y) != GPR_1))
{
rtx reg;
+#if 0
+ /* ??? We should really do the r0/r1 clobber only during rtl expansion,
+ but just like the flag clobber of movsicc, we have to allow
+ this for ifcvt to work, on the assumption that we'll only want
+ to do this if these registers have been used before by the
+ pre-ifcvt code. */
gcc_assert (currently_expanding_to_rtl);
- reg = gen_rtx_REG (in_mode, 0);
- gcc_assert (!reg_overlap_mentioned_p (reg, y));
+#endif
+ reg = gen_rtx_REG (in_mode, GPR_0);
+ if (reg_overlap_mentioned_p (reg, y))
+ return 0;
emit_move_insn (reg, x);
x = reg;
- reg = gen_rtx_REG (in_mode, 1);
+ reg = gen_rtx_REG (in_mode, GPR_1);
emit_move_insn (reg, y);
y = reg;
}
@@ -964,7 +988,6 @@ epiphany_compute_frame_size (int size /* # of var. bytes allocated. */)
int first_slot, last_slot, first_slot_offset, last_slot_offset;
int first_slot_size;
int small_slots = 0;
- long lr_slot_offset;
var_size = size;
args_size = crtl->outgoing_args_size;
@@ -1021,7 +1044,7 @@ epiphany_compute_frame_size (int size /* # of var. bytes allocated. */)
first_slot = regno;
else if (last_slot < 0
&& (first_slot ^ regno) != 1
- && (!interrupt_p || regno > GPR_0 + 1))
+ && (!interrupt_p || regno > GPR_1))
last_slot = regno;
}
}
@@ -1116,28 +1139,6 @@ epiphany_compute_frame_size (int size /* # of var. bytes allocated. */)
}
total_size = first_slot_offset + last_slot_offset;
- lr_slot_offset
- = (frame_pointer_needed ? first_slot_offset : (long) total_size);
- if (first_slot != GPR_LR)
- {
- int stack_offset = epiphany_stack_offset - UNITS_PER_WORD;
-
- for (regno = 0; ; regno++)
- {
- if (stack_offset + UNITS_PER_WORD - first_slot_size == 0
- && first_slot >= 0)
- {
- stack_offset -= first_slot_size;
- regno--;
- }
- else if (regno == GPR_LR)
- break;
- else if TEST_HARD_REG_BIT (gmask, regno)
- stack_offset -= UNITS_PER_WORD;
- }
- lr_slot_offset += stack_offset;
- }
-
/* Save computed information. */
current_frame_info.total_size = total_size;
current_frame_info.pretend_size = pretend_size;
@@ -1150,7 +1151,6 @@ epiphany_compute_frame_size (int size /* # of var. bytes allocated. */)
current_frame_info.first_slot_offset = first_slot_offset;
current_frame_info.first_slot_size = first_slot_size;
current_frame_info.last_slot_offset = last_slot_offset;
- MACHINE_FUNCTION (cfun)->lr_slot_offset = lr_slot_offset;
current_frame_info.initialized = reload_completed;
@@ -1622,6 +1622,28 @@ epiphany_emit_save_restore (int min, int limit, rtx addr, int epilogue_p)
mem = skipped_mem;
else
mem = gen_mem (mode, addr);
+
+ /* If we are loading / storing LR, note the offset that
+ gen_reload_insi_ra requires. Since GPR_LR is even,
+ we only need to test n, even if mode is DImode. */
+ gcc_assert ((GPR_LR & 1) == 0);
+ if (n == GPR_LR)
+ {
+ long lr_slot_offset = 0;
+ rtx m_addr = XEXP (mem, 0);
+
+ if (GET_CODE (m_addr) == PLUS)
+ lr_slot_offset = INTVAL (XEXP (m_addr, 1));
+ if (frame_pointer_needed)
+ lr_slot_offset += (current_frame_info.first_slot_offset
+ - current_frame_info.total_size);
+ if (MACHINE_FUNCTION (cfun)->lr_slot_known)
+ gcc_assert (MACHINE_FUNCTION (cfun)->lr_slot_offset
+ == lr_slot_offset);
+ MACHINE_FUNCTION (cfun)->lr_slot_offset = lr_slot_offset;
+ MACHINE_FUNCTION (cfun)->lr_slot_known = 1;
+ }
+
if (!epilogue_p)
frame_move_insn (mem, reg);
else if (n >= MAX_EPIPHANY_PARM_REGS || !crtl->args.pretend_args_size)
@@ -1667,7 +1689,7 @@ epiphany_expand_prologue (void)
gen_rtx_REG (DImode, GPR_0));
frame_move_insn (gen_rtx_REG (SImode, GPR_0),
gen_rtx_REG (word_mode, STATUS_REGNUM));
- frame_move_insn (gen_rtx_REG (SImode, GPR_0+1),
+ frame_move_insn (gen_rtx_REG (SImode, GPR_1),
gen_rtx_REG (word_mode, IRET_REGNUM));
mem = gen_frame_mem (BLKmode, stack_pointer_rtx);
off = GEN_INT (-current_frame_info.first_slot_offset);
@@ -1843,7 +1865,7 @@ epiphany_expand_epilogue (int sibcall_p)
emit_move_insn (gen_rtx_REG (word_mode, STATUS_REGNUM),
gen_rtx_REG (SImode, GPR_0));
emit_move_insn (gen_rtx_REG (word_mode, IRET_REGNUM),
- gen_rtx_REG (SImode, GPR_0+1));
+ gen_rtx_REG (SImode, GPR_1));
addr = plus_constant (Pmode, stack_pointer_rtx,
- (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
emit_move_insn (gen_rtx_REG (DImode, GPR_0),
diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h
index 42b16300284..1e5c3056629 100644
--- a/gcc/config/epiphany/epiphany.h
+++ b/gcc/config/epiphany/epiphany.h
@@ -450,6 +450,7 @@ typedef struct GTY (()) machine_function
unsigned pretend_args_odd : 1;
unsigned lr_clobbered : 1;
unsigned control_use_inserted : 1;
+ unsigned lr_slot_known : 1;
unsigned sw_entities_processed : 6;
long lr_slot_offset;
rtx and_mask;
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
index 6375d3f8c97..7b63ef25da6 100644
--- a/gcc/config/epiphany/epiphany.md
+++ b/gcc/config/epiphany/epiphany.md
@@ -22,6 +22,7 @@
(define_constants
[(GPR_0 0)
+ (GPR_1 1)
(GPR_FP 11)
(GPR_IP 12)
(GPR_SP 13)
@@ -264,6 +265,15 @@
rtx addr
= (frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx);
+ if (!MACHINE_FUNCTION (cfun)->lr_slot_known)
+ {
+ start_sequence ();
+ epiphany_expand_prologue ();
+ if (!MACHINE_FUNCTION (cfun)->lr_slot_known)
+ epiphany_expand_epilogue (0);
+ end_sequence ();
+ gcc_assert (MACHINE_FUNCTION (cfun)->lr_slot_known);
+ }
addr = plus_constant (Pmode, addr, MACHINE_FUNCTION (cfun)->lr_slot_offset);
operands[1] = gen_frame_mem (SImode, addr);
})
@@ -420,13 +430,19 @@
DONE;
}")
+; The default case of epiphany_print_operand emits IMMEDIATE_PREFIX
+; where appropriate; however, 'n' is processed by output_asm_insn
+; which doesn't, so we have to explicitly emit the '# in the
+; r/r/CnL output template alternative.
(define_insn "addsi3_i"
- [(set (match_operand:SI 0 "add_reg_operand" "=r")
- (plus:SI (match_operand:SI 1 "add_reg_operand" "%r")
- (match_operand:SI 2 "add_operand" "rL")))
+ [(set (match_operand:SI 0 "add_reg_operand" "=r,r")
+ (plus:SI (match_operand:SI 1 "add_reg_operand" "%r,r")
+ (match_operand:SI 2 "add_operand" "rL,CnL")))
(clobber (reg:CC CC_REGNUM))]
""
- "add %0,%1,%2"
+ "@
+ add %0,%1,%2
+ sub %0,%1,#%n2"
[(set_attr "type" "misc")])
; We use a clobber of UNKNOWN_REGNUM here so that the peephole optimizers
@@ -1705,6 +1721,132 @@
"sub %0,%1,%2"
[(set_attr "type" "compare")])
+(define_code_iterator logical_op
+ [and ior xor])
+
+(define_code_attr op_mnc
+ [(plus "add") (minus "sub") (and "and") (ior "orr") (xor "eor")])
+
+(define_insn "*<op_mnc>_f"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (logical_op:SI (match_operand:SI 1 "gpr_operand" "%r")
+ (match_operand:SI 2 "gpr_operand" "r"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "gpr_operand" "=r")
+ (logical_op:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "<op_mnc> %0,%1,%2"
+ [(set_attr "type" "compare")])
+
+(define_insn_and_split "*mov_f"
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:SI 1 "gpr_operand" "r") (const_int 0)))
+ (set (match_operand:SI 0 "gpr_operand" "=r") (match_dup 1))]
+ ""
+ "#"
+ "reload_completed"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (and:SI (match_dup 1) (match_dup 1)) (const_int 0)))
+ (set (match_operand:SI 0 "gpr_operand" "=r")
+ (and:SI (match_dup 1) (match_dup 1)))])]
+ ""
+ [(set_attr "type" "compare")])
+
+(define_peephole2
+ [(parallel
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (logical_op:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "%r")))
+ (clobber (reg:CC CC_REGNUM))])
+ (parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (and:SI (match_dup 0) (match_dup 0)) (const_int 0)))
+ (set (match_operand:SI 3 "gpr_operand" "=r")
+ (and:SI (match_dup 0) (match_dup 0)))])]
+ "peep2_reg_dead_p (2, operands[0])"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (logical_op:SI (match_dup 1) (match_dup 2))
+ (const_int 0)))
+ (set (match_dup 3) (logical_op:SI (match_dup 1) (match_dup 2)))])])
+
+(define_peephole2
+ [(parallel
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (logical_op:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "%r")))
+ (clobber (reg:CC CC_REGNUM))])
+ (parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (and:SI (match_dup 0) (match_dup 0)) (const_int 0)))
+ (set (match_operand:SI 3 "gpr_operand" "=r")
+ (and:SI (match_dup 0) (match_dup 0)))])]
+ "peep2_reg_dead_p (2, operands[3])"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (logical_op:SI (match_dup 1) (match_dup 2))
+ (const_int 0)))
+ (set (match_dup 0) (logical_op:SI (match_dup 1) (match_dup 2)))])])
+
+(define_peephole2
+ [(parallel
+ [(set (match_operand:SI 0 "gpr_operand" "=r")
+ (logical_op:SI (match_operand:SI 1 "gpr_operand" "r")
+ (match_operand:SI 2 "gpr_operand" "%r")))
+ (clobber (reg:CC CC_REGNUM))])
+ (parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 0) (const_int 0)))
+ (clobber (match_operand:SI 3 "gpr_operand" "=r"))])]
+ ""
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (logical_op:SI (match_dup 1) (match_dup 2))
+ (const_int 0)))
+ (set (match_dup 0) (logical_op:SI (match_dup 1) (match_dup 2)))])])
+
+(define_expand "cstoresi4"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (match_operand:SI 1 "comparison_operator"))
+ (match_operand:SI 2 "" "")])
+ (set (match_dup 0) (match_operand:SI 3 "arith_operand" ""))
+ (set (match_operand:SI 0 "gpr_operand" "=r")
+ (if_then_else:SI (match_dup 4) (match_dup 5) (match_dup 0)))]
+ ""
+{
+ enum rtx_code o2_code = GET_CODE (operands[2]);
+ enum rtx_code cmp_code = GET_CODE (operands[1]);
+
+ if ((o2_code == AND || o2_code == IOR || o2_code == XOR)
+ && operands[3] == const0_rtx)
+ {
+ operands[2] = copy_rtx(operands[2]);
+ XEXP (operands[2], 0) = force_reg (SImode, XEXP (operands[2], 0));
+ XEXP (operands[2], 1) = force_reg (SImode, XEXP (operands[2], 1));
+ }
+ else
+ operands[2] = force_reg (SImode, operands[2]);
+ operands[1] = gen_rtx_COMPARE (CCmode, operands[2], operands[3]);
+ if (cmp_code != NE)
+ {
+ operands[2] = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (SImode));
+ operands[3] = const0_rtx;
+ }
+ else
+ {
+ if (operands[3] != const0_rtx)
+ operands[2] = gen_rtx_MINUS (SImode, operands[2], operands[3]);
+ operands[2] = gen_rtx_SET (VOIDmode, operands[0], operands[2]);
+ operands[3] = operands[0];
+ }
+ operands[4] = gen_rtx_fmt_ee (cmp_code, SImode,
+ gen_rtx_REG (CCmode, CC_REGNUM), const0_rtx);
+ operands[5] = force_reg (SImode, GEN_INT (STORE_FLAG_VALUE));
+})
+
+
; floating point comparisons
(define_insn "*cmpsf_cc_insn"
@@ -1747,7 +1889,7 @@
(clobber (reg:SI GPR_IP))
(clobber (reg:SI GPR_16))
(clobber (reg:SI GPR_LR))]
- "TARGET_SOFT_CMPSF"
+ ""
"%f0"
[(set_attr "type" "sfunc")])
@@ -1811,6 +1953,8 @@
operations - if we get some. */
operands[1]
= gen_compare_reg (<MODE>mode, code, cmp_in_mode, cmp_op0, cmp_op1);
+ if (!operands[1])
+ FAIL;
}
})
@@ -2285,6 +2429,11 @@
[(plus "add") (minus "sub") (mult "mul") (div "div")
(and "and") (ior "ior") (xor "xor")])
+; The addsi3 / subsi3 do checks that we don't want when splitting V2SImode
+; operations into two SImode operations.
+(define_code_attr si_pattern_suffix
+ [(plus "_i") (minus "_i") (and "") (ior "") (xor "")])
+
; You might think that this would work better as a define_expand, but
; again lower_subreg pessimizes the code if it sees indiviudual operations.
; We need to keep inputs and outputs as register pairs if we want to
@@ -2311,8 +2460,8 @@
o1h = copy_to_mode_reg (SImode, o1h);
if (reg_overlap_mentioned_p (o0l, o2h))
o2h = copy_to_mode_reg (SImode, o2h);
- emit_insn (gen_<insn_opname>si3 (o0l, o1l, o2l));
- emit_insn (gen_<insn_opname>si3 (o0h, o1h, o2h));
+ emit_insn (gen_<insn_opname>si3<si_pattern_suffix> (o0l, o1l, o2l));
+ emit_insn (gen_<insn_opname>si3<si_pattern_suffix> (o0h, o1h, o2h));
DONE;
}
[(set_attr "length" "8")])
diff --git a/gcc/config/epiphany/predicates.md b/gcc/config/epiphany/predicates.md
index 1ae5824f337..af60d7c73f7 100644
--- a/gcc/config/epiphany/predicates.md
+++ b/gcc/config/epiphany/predicates.md
@@ -98,7 +98,7 @@
{
if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
return add_reg_operand (op, mode);
- return satisfies_constraint_L (op);
+ return satisfies_constraint_L (op) || satisfies_constraint_CnL (op);
})
;; Ordinary 3rd operand for arithmetic operations
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 50491c243f6..4be15c486b8 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -474,5 +474,8 @@ do { \
#undef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY i386_pe_assemble_visibility
+#undef SUB_TARGET_RECORD_STUB
+#define SUB_TARGET_RECORD_STUB i386_pe_record_stub
+
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index 940b113a7c4..3fe0a011b8f 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
do \
{ \
builtin_define ("__CYGWIN__"); \
- if (!TARGET_CYGWIN64) \
+ if (!TARGET_64BIT) \
builtin_define ("__CYGWIN32__"); \
builtin_define ("__unix__"); \
builtin_define ("__unix"); \
diff --git a/gcc/config/i386/i386-opts.h b/gcc/config/i386/i386-opts.h
index 11c08457db3..61f04ced53b 100644
--- a/gcc/config/i386/i386-opts.h
+++ b/gcc/config/i386/i386-opts.h
@@ -85,4 +85,9 @@ enum ix86_veclibabi {
ix86_veclibabi_type_acml
};
+enum stack_protector_guard {
+ SSP_TLS, /* per-thread canary in TLS block */
+ SSP_GLOBAL /* global canary */
+};
+
#endif
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 602e6fce46d..ef4dc761d5a 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -260,6 +260,7 @@ extern void i386_pe_end_function (FILE *, const char *, tree);
extern void i386_pe_assemble_visibility (tree, int);
extern tree i386_pe_mangle_decl_assembler_name (tree, tree);
extern tree i386_pe_mangle_assembler_name (const char *);
+extern void i386_pe_record_stub (const char *);
extern void i386_pe_seh_init (FILE *);
extern void i386_pe_seh_end_prologue (FILE *);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b4dedcd05ab..e72715bda32 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -64,6 +64,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
static rtx legitimize_dllimport_symbol (rtx, bool);
+static rtx legitimize_pe_coff_extern_decl (rtx, bool);
+static rtx legitimize_pe_coff_symbol (rtx, bool);
#ifndef CHECK_STACK_LIMIT
#define CHECK_STACK_LIMIT (-1)
@@ -3233,9 +3235,7 @@ ix86_option_override_internal (bool main_args_p)
use of rip-relative addressing. This eliminates fixups that
would otherwise be needed if this object is to be placed in a
DLL, and is essentially just as efficient as direct addressing. */
- if (TARGET_64BIT && DEFAULT_ABI == MS_ABI)
- ix86_cmodel = CM_SMALL_PIC, flag_pic = 1;
- else if (TARGET_64BIT && TARGET_RDOS)
+ if (TARGET_64BIT && (TARGET_RDOS || DEFAULT_ABI == MS_ABI))
ix86_cmodel = CM_MEDIUM_PIC, flag_pic = 1;
else if (TARGET_64BIT)
ix86_cmodel = flag_pic ? CM_SMALL_PIC : CM_SMALL;
@@ -3922,6 +3922,10 @@ ix86_option_override_internal (bool main_args_p)
if (main_args_p)
target_option_default_node = target_option_current_node
= build_target_option_node ();
+
+ /* Handle stack protector */
+ if (!global_options_set.x_ix86_stack_protector_guard)
+ ix86_stack_protector_guard = TARGET_HAS_BIONIC ? SSP_GLOBAL : SSP_TLS;
}
/* Implement the TARGET_OPTION_OVERRIDE hook. */
@@ -10579,7 +10583,9 @@ ix86_expand_prologue (void)
ix86_emit_save_sse_regs_using_mov (frame.sse_reg_save_offset);
pic_reg_used = false;
+ /* We don't use pic-register for pe-coff target. */
if (pic_offset_table_rtx
+ && DEFAULT_ABI != MS_ABI
&& (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
|| crtl->profile))
{
@@ -11384,7 +11390,8 @@ ix86_expand_split_stack_prologue (void)
use_reg (&call_fusage, rax);
}
- if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC)
+ if ((ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC)
+ && DEFAULT_ABI != MS_ABI)
{
HOST_WIDE_INT argval;
@@ -12002,6 +12009,19 @@ ix86_cannot_force_const_mem (enum machine_mode mode, rtx x)
return !ix86_legitimate_constant_p (mode, x);
}
+/* Nonzero if the symbol is marked as dllimport, or as stub-variable,
+ otherwise zero. */
+
+static bool
+is_imported_p (rtx x)
+{
+ if (!TARGET_DLLIMPORT_DECL_ATTRIBUTES
+ || GET_CODE (x) != SYMBOL_REF)
+ return false;
+
+ return SYMBOL_REF_DLLIMPORT_P (x) || SYMBOL_REF_STUBVAR_P (x);
+}
+
/* Nonzero if the constant value X is a legitimate general operand
when generating PIC code. It is given that flag_pic is on and
@@ -12090,11 +12110,39 @@ legitimate_pic_address_disp_p (rtx disp)
/* FALLTHRU */
case SYMBOL_REF:
- /* TLS references should always be enclosed in UNSPEC. */
- if (SYMBOL_REF_TLS_MODEL (op0))
+ /* TLS references should always be enclosed in UNSPEC.
+ The dllimported symbol needs always to be resolved. */
+ if (SYMBOL_REF_TLS_MODEL (op0)
+ || (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op0)))
return false;
- if (!SYMBOL_REF_FAR_ADDR_P (op0) && SYMBOL_REF_LOCAL_P (op0)
- && ix86_cmodel != CM_LARGE_PIC)
+
+ if (DEFAULT_ABI == MS_ABI)
+ {
+ if (is_imported_p (op0))
+ return true;
+
+ if (SYMBOL_REF_FAR_ADDR_P (op0)
+ || !SYMBOL_REF_LOCAL_P (op0))
+ break;
+
+ /* Function-symbols need to be resolved only for
+ large-model.
+ For the small-model we don't need to resolve anything
+ here. */
+ if ((ix86_cmodel != CM_LARGE_PIC
+ && SYMBOL_REF_FUNCTION_P (op0))
+ || ix86_cmodel == CM_SMALL_PIC)
+ return true;
+ /* Non-external symbols don't need to be resolved for
+ large, and medium-model. */
+ if ((ix86_cmodel == CM_LARGE_PIC
+ || ix86_cmodel == CM_MEDIUM_PIC)
+ && !SYMBOL_REF_EXTERNAL_P (op0))
+ return true;
+ }
+ else if (!SYMBOL_REF_FAR_ADDR_P (op0)
+ && SYMBOL_REF_LOCAL_P (op0)
+ && ix86_cmodel != CM_LARGE_PIC)
return true;
break;
@@ -12155,7 +12203,7 @@ legitimate_pic_address_disp_p (rtx disp)
if ((GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF
|| GET_CODE (XVECEXP (disp, 0, 0)) == LABEL_REF)
&& !TARGET_64BIT)
- return gotoff_operand (XVECEXP (disp, 0, 0), Pmode);
+ return DEFAULT_ABI != MS_ABI && gotoff_operand (XVECEXP (disp, 0, 0), Pmode);
return false;
case UNSPEC_GOTTPOFF:
case UNSPEC_GOTNTPOFF:
@@ -12490,11 +12538,17 @@ legitimize_pic_address (rtx orig, rtx reg)
}
#endif
+ if (TARGET_64BIT && TARGET_DLLIMPORT_DECL_ATTRIBUTES)
+ {
+ rtx tmp = legitimize_pe_coff_symbol (addr, true);
+ if (tmp)
+ return tmp;
+ }
+
if (TARGET_64BIT && legitimate_pic_address_disp_p (addr))
new_rtx = addr;
- else if (TARGET_64BIT
- && ix86_cmodel != CM_SMALL_PIC
- && gotoff_operand (addr, Pmode))
+ else if (TARGET_64BIT && DEFAULT_ABI != MS_ABI
+ && ix86_cmodel != CM_SMALL_PIC && gotoff_operand (addr, Pmode))
{
rtx tmpreg;
/* This symbol may be referenced via a displacement from the PIC
@@ -12525,9 +12579,10 @@ legitimize_pic_address (rtx orig, rtx reg)
tmpreg, 1, OPTAB_DIRECT);
new_rtx = reg;
}
- else new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, tmpreg);
+ else
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, tmpreg);
}
- else if (!TARGET_64BIT && gotoff_operand (addr, Pmode))
+ else if (!TARGET_64BIT && DEFAULT_ABI != MS_ABI && gotoff_operand (addr, Pmode))
{
/* This symbol may be referenced via a displacement from the PIC
base address (@GOTOFF). */
@@ -12558,31 +12613,22 @@ legitimize_pic_address (rtx orig, rtx reg)
see gotoff_operand. */
|| (TARGET_VXWORKS_RTP && GET_CODE (addr) == LABEL_REF))
{
- if (TARGET_DLLIMPORT_DECL_ATTRIBUTES)
- {
- if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_DLLIMPORT_P (addr))
- return legitimize_dllimport_symbol (addr, true);
- if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF
- && SYMBOL_REF_DLLIMPORT_P (XEXP (XEXP (addr, 0), 0)))
- {
- rtx t = legitimize_dllimport_symbol (XEXP (XEXP (addr, 0), 0), true);
- return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (addr, 0), 1));
- }
- }
+ rtx tmp = legitimize_pe_coff_symbol (addr, true);
+ if (tmp)
+ return tmp;
/* For x64 PE-COFF there is no GOT table. So we use address
directly. */
if (TARGET_64BIT && DEFAULT_ABI == MS_ABI)
- {
+ {
new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_PCREL);
new_rtx = gen_rtx_CONST (Pmode, new_rtx);
if (reg == 0)
reg = gen_reg_rtx (Pmode);
- emit_move_insn (reg, new_rtx);
+ emit_move_insn (reg, new_rtx);
new_rtx = reg;
- }
+ }
else if (TARGET_64BIT && ix86_cmodel != CM_LARGE_PIC)
{
new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTPCREL);
@@ -12651,7 +12697,7 @@ legitimize_pic_address (rtx orig, rtx reg)
/* Check first to see if this is a constant offset from a @GOTOFF
symbol reference. */
- if (gotoff_operand (op0, Pmode)
+ if (DEFAULT_ABI != MS_ABI && gotoff_operand (op0, Pmode)
&& CONST_INT_P (op1))
{
if (!TARGET_64BIT)
@@ -12795,7 +12841,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
if (!TARGET_64BIT)
{
- if (flag_pic)
+ if (flag_pic && DEFAULT_ABI != MS_ABI)
pic = pic_offset_table_rtx;
else
{
@@ -13004,13 +13050,14 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
}
/* Create or return the unique __imp_DECL dllimport symbol corresponding
- to symbol DECL. */
+ to symbol DECL if BEIMPORT is true. Otherwise create or return the
+ unique refptr-DECL symbol corresponding to symbol DECL. */
static GTY((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
htab_t dllimport_map;
static tree
-get_dllimport_decl (tree decl)
+get_dllimport_decl (tree decl, bool beimport)
{
struct tree_map *h, in;
void **loc;
@@ -13043,8 +13090,11 @@ get_dllimport_decl (tree decl)
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = targetm.strip_name_encoding (name);
- prefix = name[0] == FASTCALL_PREFIX || user_label_prefix[0] == 0
- ? "*__imp_" : "*__imp__";
+ if (beimport)
+ prefix = name[0] == FASTCALL_PREFIX || user_label_prefix[0] == 0
+ ? "*__imp_" : "*__imp__";
+ else
+ prefix = user_label_prefix[0] == 0 ? "*.refptr." : "*refptr.";
namelen = strlen (name);
prefixlen = strlen (prefix);
imp_name = (char *) alloca (namelen + prefixlen + 1);
@@ -13054,7 +13104,14 @@ get_dllimport_decl (tree decl)
name = ggc_alloc_string (imp_name, namelen + prefixlen);
rtl = gen_rtx_SYMBOL_REF (Pmode, name);
SET_SYMBOL_REF_DECL (rtl, to);
- SYMBOL_REF_FLAGS (rtl) = SYMBOL_FLAG_LOCAL;
+ SYMBOL_REF_FLAGS (rtl) = SYMBOL_FLAG_LOCAL | SYMBOL_FLAG_STUBVAR;
+ if (!beimport)
+ {
+ SYMBOL_REF_FLAGS (rtl) |= SYMBOL_FLAG_EXTERNAL;
+#ifdef SUB_TARGET_RECORD_STUB
+ SUB_TARGET_RECORD_STUB (name);
+#endif
+ }
rtl = gen_const_mem (Pmode, rtl);
set_mem_alias_set (rtl, ix86_GOT_alias_set ());
@@ -13065,6 +13122,24 @@ get_dllimport_decl (tree decl)
return to;
}
+/* Expand SYMBOL into its corresponding far-addresse symbol.
+ WANT_REG is true if we require the result be a register. */
+
+static rtx
+legitimize_pe_coff_extern_decl (rtx symbol, bool want_reg)
+{
+ tree imp_decl;
+ rtx x;
+
+ gcc_assert (SYMBOL_REF_DECL (symbol));
+ imp_decl = get_dllimport_decl (SYMBOL_REF_DECL (symbol), false);
+
+ x = DECL_RTL (imp_decl);
+ if (want_reg)
+ x = force_reg (Pmode, x);
+ return x;
+}
+
/* Expand SYMBOL into its corresponding dllimport symbol. WANT_REG is
true if we require the result be a register. */
@@ -13075,7 +13150,7 @@ legitimize_dllimport_symbol (rtx symbol, bool want_reg)
rtx x;
gcc_assert (SYMBOL_REF_DECL (symbol));
- imp_decl = get_dllimport_decl (SYMBOL_REF_DECL (symbol));
+ imp_decl = get_dllimport_decl (SYMBOL_REF_DECL (symbol), true);
x = DECL_RTL (imp_decl);
if (want_reg)
@@ -13083,6 +13158,50 @@ legitimize_dllimport_symbol (rtx symbol, bool want_reg)
return x;
}
+/* Expand SYMBOL into its corresponding dllimport or refptr symbol. WANT_REG
+ is true if we require the result be a register. */
+
+static rtx
+legitimize_pe_coff_symbol (rtx addr, bool inreg)
+{
+ if (DEFAULT_ABI != MS_ABI)
+ return NULL_RTX;
+
+ if (TARGET_DLLIMPORT_DECL_ATTRIBUTES)
+ {
+ if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_DLLIMPORT_P (addr))
+ return legitimize_dllimport_symbol (addr, inreg);
+ if (GET_CODE (addr) == CONST
+ && GET_CODE (XEXP (addr, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF
+ && SYMBOL_REF_DLLIMPORT_P (XEXP (XEXP (addr, 0), 0)))
+ {
+ rtx t = legitimize_dllimport_symbol (XEXP (XEXP (addr, 0), 0), inreg);
+ return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (addr, 0), 1));
+ }
+ }
+
+ if (ix86_cmodel != CM_LARGE_PIC && ix86_cmodel != CM_MEDIUM_PIC)
+ return NULL_RTX;
+ if (GET_CODE (addr) == SYMBOL_REF
+ && !is_imported_p (addr)
+ && SYMBOL_REF_EXTERNAL_P (addr)
+ && SYMBOL_REF_DECL (addr))
+ return legitimize_pe_coff_extern_decl (addr, inreg);
+
+ if (GET_CODE (addr) == CONST
+ && GET_CODE (XEXP (addr, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF
+ && !is_imported_p (XEXP (XEXP (addr, 0), 0))
+ && SYMBOL_REF_EXTERNAL_P (XEXP (XEXP (addr, 0), 0))
+ && SYMBOL_REF_DECL (XEXP (XEXP (addr, 0), 0)))
+ {
+ rtx t = legitimize_pe_coff_extern_decl (XEXP (XEXP (addr, 0), 0), inreg);
+ return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (addr, 0), 1));
+ }
+ return NULL_RTX;
+}
+
/* Try machine-dependent ways of modifying an illegitimate address
to be legitimate. If we find one, return the new, valid address.
This macro is used in only one place: `memory_address' in explow.c.
@@ -13123,16 +13242,9 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
if (TARGET_DLLIMPORT_DECL_ATTRIBUTES)
{
- if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_DLLIMPORT_P (x))
- return legitimize_dllimport_symbol (x, true);
- if (GET_CODE (x) == CONST
- && GET_CODE (XEXP (x, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
- && SYMBOL_REF_DLLIMPORT_P (XEXP (XEXP (x, 0), 0)))
- {
- rtx t = legitimize_dllimport_symbol (XEXP (XEXP (x, 0), 0), true);
- return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (x, 0), 1));
- }
+ rtx tmp = legitimize_pe_coff_symbol (x, true);
+ if (tmp)
+ return tmp;
}
if (flag_pic && SYMBOLIC_CONST (x))
@@ -15948,6 +16060,8 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
if (GET_CODE (op1) == SYMBOL_REF)
{
+ rtx tmp;
+
model = SYMBOL_REF_TLS_MODEL (op1);
if (model)
{
@@ -15957,9 +16071,8 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
return;
op1 = convert_to_mode (mode, op1, 1);
}
- else if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
- && SYMBOL_REF_DLLIMPORT_P (op1))
- op1 = legitimize_dllimport_symbol (op1, false);
+ else if ((tmp = legitimize_pe_coff_symbol (op1, false)) != NULL_RTX)
+ op1 = tmp;
}
else if (GET_CODE (op1) == CONST
&& GET_CODE (XEXP (op1, 0)) == PLUS
@@ -15967,14 +16080,13 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
{
rtx addend = XEXP (XEXP (op1, 0), 1);
rtx symbol = XEXP (XEXP (op1, 0), 0);
- rtx tmp = NULL;
+ rtx tmp;
model = SYMBOL_REF_TLS_MODEL (symbol);
if (model)
tmp = legitimize_tls_address (symbol, model, true);
- else if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
- && SYMBOL_REF_DLLIMPORT_P (symbol))
- tmp = legitimize_dllimport_symbol (symbol, true);
+ else
+ tmp = legitimize_pe_coff_symbol (symbol, true);
if (tmp)
{
@@ -23580,7 +23692,7 @@ construct_plt_address (rtx symbol)
rtx tmp, unspec;
gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
- gcc_assert (ix86_cmodel == CM_LARGE_PIC);
+ gcc_assert (ix86_cmodel == CM_LARGE_PIC && DEFAULT_ABI != MS_ABI);
gcc_assert (Pmode == DImode);
tmp = gen_reg_rtx (Pmode);
@@ -23622,7 +23734,8 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
else
{
/* Static functions and indirect calls don't need the pic register. */
- if (flag_pic && (!TARGET_64BIT || ix86_cmodel == CM_LARGE_PIC)
+ if (flag_pic && (!TARGET_64BIT
+ || (ix86_cmodel == CM_LARGE_PIC && DEFAULT_ABI != MS_ABI))
&& GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF
&& ! SYMBOL_REF_LOCAL_P (XEXP (fnaddr, 0)))
use_reg (&use, pic_offset_table_rtx);
@@ -23636,6 +23749,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
}
if (ix86_cmodel == CM_LARGE_PIC
+ && DEFAULT_ABI != MS_ABI
&& MEM_P (fnaddr)
&& GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF
&& !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode))
@@ -33866,10 +33980,15 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
/* Take care for QImode values - they can be in non-QI regs,
but then they do cause partial register stalls. */
- if (TARGET_64BIT || QI_REGNO_P (regno))
+ if (ANY_QI_REGNO_P (regno))
return true;
if (!TARGET_PARTIAL_REG_STALL)
return true;
+ /* LRA checks if the hard register is OK for the given mode.
+ QImode values can live in non-QI regs, so we allow all
+ registers here. */
+ if (lra_in_progress)
+ return true;
return !can_create_pseudo_p ();
}
/* We handle both integer and floats in the general purpose registers. */
@@ -34178,6 +34297,13 @@ ix86_rtx_costs (rtx x, int code_i, int outer_code_i, int opno, int *total,
{
if (CONST_INT_P (XEXP (x, 1)))
*total = cost->shift_const;
+ else if (GET_CODE (XEXP (x, 1)) == SUBREG
+ && GET_CODE (XEXP (XEXP (x, 1), 0)) == AND)
+ {
+ /* Return the cost after shift-and truncation. */
+ *total = cost->shift_var;
+ return true;
+ }
else
*total = cost->shift_var;
}
@@ -34967,7 +35093,7 @@ x86_output_mi_thunk (FILE *file,
if (TARGET_64BIT)
{
if (!flag_pic || targetm.binds_local_p (function)
- || cfun->machine->call_abi == MS_ABI)
+ || DEFAULT_ABI == MS_ABI)
;
else
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index e551c980dfb..69d06550bcf 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -488,6 +488,9 @@ extern unsigned char x86_prefetch_sse;
#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0
#endif
+#define TARGET_SSP_GLOBAL_GUARD (ix86_stack_protector_guard == SSP_GLOBAL)
+#define TARGET_SSP_TLS_GUARD (ix86_stack_protector_guard == SSP_TLS)
+
/* Fence to use after loop using storent. */
extern tree x86_mfence;
@@ -1181,7 +1184,8 @@ enum target_cpu_default
#define REAL_PIC_OFFSET_TABLE_REGNUM BX_REG
#define PIC_OFFSET_TABLE_REGNUM \
- ((TARGET_64BIT && ix86_cmodel == CM_SMALL_PIC) \
+ ((TARGET_64BIT && (ix86_cmodel == CM_SMALL_PIC \
+ || DEFAULT_ABI == MS_ABI)) \
|| !flag_pic ? INVALID_REGNUM \
: reload_completed ? REGNO (pic_offset_table_rtx) \
: REAL_PIC_OFFSET_TABLE_REGNUM)
@@ -2381,6 +2385,10 @@ struct GTY(()) machine_function {
#define SYMBOL_REF_DLLEXPORT_P(X) \
((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLEXPORT) != 0)
+#define SYMBOL_FLAG_STUBVAR (SYMBOL_FLAG_MACH_DEP << 4)
+#define SYMBOL_REF_STUBVAR_P(X) \
+ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_STUBVAR) != 0)
+
extern void debug_ready_dispatch (void);
extern void debug_dispatch_window (int);
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 5b794a1b827..27e33c13780 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -7134,43 +7134,26 @@
[(set_attr "type" "test")
(set_attr "mode" "QI")])
-(define_insn "*testqi_ext_3_rex64"
- [(set (reg FLAGS_REG)
- (compare (zero_extract:DI
- (match_operand 0 "nonimmediate_operand" "rm")
- (match_operand:DI 1 "const_int_operand")
- (match_operand:DI 2 "const_int_operand"))
- (const_int 0)))]
- "TARGET_64BIT
- && ix86_match_ccmode (insn, CCNOmode)
- && INTVAL (operands[1]) > 0
- && INTVAL (operands[2]) >= 0
- /* Ensure that resulting mask is zero or sign extended operand. */
- && (INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
- || (INTVAL (operands[1]) + INTVAL (operands[2]) == 64
- && INTVAL (operands[1]) > 32))
- && (GET_MODE (operands[0]) == SImode
- || GET_MODE (operands[0]) == DImode
- || GET_MODE (operands[0]) == HImode
- || GET_MODE (operands[0]) == QImode)"
- "#")
-
;; Combine likes to form bit extractions for some tests. Humor it.
(define_insn "*testqi_ext_3"
[(set (reg FLAGS_REG)
- (compare (zero_extract:SI
+ (compare (zero_extract:SWI48
(match_operand 0 "nonimmediate_operand" "rm")
- (match_operand:SI 1 "const_int_operand")
- (match_operand:SI 2 "const_int_operand"))
+ (match_operand:SWI48 1 "const_int_operand")
+ (match_operand:SWI48 2 "const_int_operand"))
(const_int 0)))]
"ix86_match_ccmode (insn, CCNOmode)
- && INTVAL (operands[1]) > 0
- && INTVAL (operands[2]) >= 0
- && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
- && (GET_MODE (operands[0]) == SImode
- || (TARGET_64BIT && GET_MODE (operands[0]) == DImode)
+ && ((TARGET_64BIT && GET_MODE (operands[0]) == DImode)
+ || GET_MODE (operands[0]) == SImode
|| GET_MODE (operands[0]) == HImode
- || GET_MODE (operands[0]) == QImode)"
+ || GET_MODE (operands[0]) == QImode)
+ /* Ensure that resulting mask is zero or sign extended operand. */
+ && INTVAL (operands[2]) >= 0
+ && ((INTVAL (operands[1]) > 0
+ && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32)
+ || (<MODE>mode == DImode
+ && INTVAL (operands[1]) > 32
+ && INTVAL (operands[1]) + INTVAL (operands[2]) == 64))"
"#")
(define_split
@@ -17075,7 +17058,7 @@
(define_expand "stack_protect_set"
[(match_operand 0 "memory_operand")
(match_operand 1 "memory_operand")]
- "!TARGET_HAS_BIONIC"
+ "TARGET_SSP_TLS_GUARD"
{
rtx (*insn)(rtx, rtx);
@@ -17100,7 +17083,7 @@
UNSPEC_SP_SET))
(set (match_scratch:PTR 2 "=&r") (const_int 0))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_HAS_BIONIC"
+ "TARGET_SSP_TLS_GUARD"
"mov{<imodesuffix>}\t{%1, %2|%2, %1}\;mov{<imodesuffix>}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2"
[(set_attr "type" "multi")])
@@ -17118,7 +17101,7 @@
[(match_operand 0 "memory_operand")
(match_operand 1 "memory_operand")
(match_operand 2)]
- "!TARGET_HAS_BIONIC"
+ "TARGET_SSP_TLS_GUARD"
{
rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG);
@@ -17148,7 +17131,7 @@
(match_operand:PTR 2 "memory_operand" "m")]
UNSPEC_SP_TEST))
(clobber (match_scratch:PTR 3 "=&r"))]
- "!TARGET_HAS_BIONIC"
+ "TARGET_SSP_TLS_GUARD"
"mov{<imodesuffix>}\t{%1, %3|%3, %1}\;xor{<imodesuffix>}\t{%2, %3|%3, %2}"
[(set_attr "type" "multi")])
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 084a2486353..f5ad69e26c2 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -626,3 +626,17 @@ Split 32-byte AVX unaligned store
mrtm
Target Report Mask(ISA_RTM) Var(ix86_isa_flags) Save
Support RTM built-in functions and code generation
+
+mstack-protector-guard=
+Target RejectNegative Joined Enum(stack_protector_guard) Var(ix86_stack_protector_guard) Init(SSP_TLS)
+Use given stack-protector guard
+
+Enum
+Name(stack_protector_guard) Type(enum stack_protector_guard)
+Known stack protector guard (for use with the -mstack-protector-guard= option):
+
+EnumValue
+Enum(stack_protector_guard) String(tls) Value(SSP_TLS)
+
+EnumValue
+Enum(stack_protector_guard) String(global) Value(SSP_GLOBAL)
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 118b1ecb007..c8002f6723f 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -646,8 +646,18 @@ struct GTY(()) export_list
int is_data; /* used to type tag exported symbols. */
};
+/* Keep a list of stub symbols. */
+
+struct GTY(()) stub_list
+{
+ struct stub_list *next;
+ const char *name;
+};
+
static GTY(()) struct export_list *export_head;
+static GTY(()) struct stub_list *stub_head;
+
/* Assemble an export symbol entry. We need to keep a list of
these, so that we can output the export list at the end of the
assembly. We used to output these export symbols in each function,
@@ -678,6 +688,30 @@ i386_pe_maybe_record_exported_symbol (tree decl, const char *name, int is_data)
export_head = p;
}
+void
+i386_pe_record_stub (const char *name)
+{
+ struct stub_list *p;
+
+ if (!name || *name == 0)
+ return;
+
+ p = stub_head;
+ while (p != NULL)
+ {
+ if (p->name[0] == *name
+ && !strcmp (p->name, name))
+ return;
+ p = p->next;
+ }
+
+ p = ggc_alloc_stub_list ();
+ p->next = stub_head;
+ p->name = name;
+ stub_head = p;
+}
+
+
#ifdef CXX_WRAP_SPEC_LIST
/* Hash table equality helper function. */
@@ -781,6 +815,30 @@ i386_pe_file_end (void)
(q->is_data ? ",data" : ""));
}
}
+
+ if (stub_head)
+ {
+ struct stub_list *q;
+
+ for (q = stub_head; q != NULL; q = q->next)
+ {
+ const char *name = q->name;
+ const char *oname;
+
+ if (name[0] == '*')
+ ++name;
+ oname = name;
+ if (name[0] == '.')
+ ++name;
+ if (strncmp (name, "refptr.", 7) != 0)
+ continue;
+ name += 7;
+ fprintf (asm_out_file, "\t.section\t.rdata$%s, \"dr\"\n"
+ "\t.globl\t%s\n"
+ "\t.linkonce\tdiscard\n", oname, oname);
+ fprintf (asm_out_file, "%s:\n\t.quad\t%s\n", oname, name);
+ }
+ }
}
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c06513c567d..878883d6b38 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -792,7 +792,9 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
/* Extract CODE_LABEL. */
orig = XEXP (orig, 0);
add_reg_note (insn, REG_LABEL_OPERAND, orig);
- LABEL_NUSES (orig)++;
+ /* Make sure we have label and not a note. */
+ if (LABEL_P (orig))
+ LABEL_NUSES (orig)++;
}
crtl->uses_pic_offset_table = 1;
return reg;
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index eda641d591e..4b6aaa12413 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -26913,54 +26913,26 @@ rs6000_emit_nmsub (rtx dst, rtx m1, rtx m2, rtx a)
emit_insn (gen_rtx_SET (VOIDmode, dst, r));
}
-/* Newton-Raphson approximation of floating point divide with just 2 passes
- (either single precision floating point, or newer machines with higher
- accuracy estimates). Support both scalar and vector divide. Assumes no
- trapping math and finite arguments. */
+/* Newton-Raphson approximation of floating point divide DST = N/D. If NOTE_P,
+ add a reg_note saying that this was a division. Support both scalar and
+ vector divide. Assumes no trapping math and finite arguments. */
-static void
-rs6000_emit_swdiv_high_precision (rtx dst, rtx n, rtx d)
+void
+rs6000_emit_swdiv (rtx dst, rtx n, rtx d, bool note_p)
{
enum machine_mode mode = GET_MODE (dst);
- rtx x0, e0, e1, y1, u0, v0;
- 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);
-
- gcc_assert (code != CODE_FOR_nothing);
-
- /* x0 = 1./d estimate */
- x0 = gen_reg_rtx (mode);
- emit_insn (gen_rtx_SET (VOIDmode, x0,
- gen_rtx_UNSPEC (mode, gen_rtvec (1, d),
- UNSPEC_FRES)));
-
- e0 = gen_reg_rtx (mode);
- rs6000_emit_nmsub (e0, d, x0, one); /* e0 = 1. - (d * x0) */
-
- e1 = gen_reg_rtx (mode);
- rs6000_emit_madd (e1, e0, e0, e0); /* e1 = (e0 * e0) + e0 */
-
- y1 = gen_reg_rtx (mode);
- rs6000_emit_madd (y1, e1, x0, x0); /* y1 = (e1 * x0) + x0 */
-
- u0 = gen_reg_rtx (mode);
- emit_insn (gen_mul (u0, n, y1)); /* u0 = n * y1 */
-
- v0 = gen_reg_rtx (mode);
- rs6000_emit_nmsub (v0, d, u0, n); /* v0 = n - (d * u0) */
-
- rs6000_emit_madd (dst, v0, y1, u0); /* dst = (v0 * y1) + u0 */
-}
+ rtx one, x0, e0, x1, xprev, eprev, xnext, enext, u, v;
+ int i;
-/* Newton-Raphson approximation of floating point divide that has a low
- precision estimate. Assumes no trapping math and finite arguments. */
+ /* Low precision estimates guarantee 5 bits of accuracy. High
+ precision estimates guarantee 14 bits of accuracy. SFmode
+ requires 23 bits of accuracy. DFmode requires 52 bits of
+ accuracy. Each pass at least doubles the accuracy, leading
+ to the following. */
+ int passes = (TARGET_RECIP_PRECISION) ? 1 : 3;
+ if (mode == DFmode || mode == V2DFmode)
+ passes++;
-static void
-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);
gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
@@ -26974,46 +26946,44 @@ rs6000_emit_swdiv_low_precision (rtx dst, rtx n, rtx d)
gen_rtx_UNSPEC (mode, gen_rtvec (1, d),
UNSPEC_FRES)));
- e0 = gen_reg_rtx (mode);
- rs6000_emit_nmsub (e0, d, x0, one); /* e0 = 1. - d * x0 */
+ /* Each iteration but the last calculates x_(i+1) = x_i * (2 - d * x_i). */
+ if (passes > 1) {
- y1 = gen_reg_rtx (mode);
- rs6000_emit_madd (y1, e0, x0, x0); /* y1 = x0 + e0 * x0 */
+ /* e0 = 1. - d * x0 */
+ e0 = gen_reg_rtx (mode);
+ rs6000_emit_nmsub (e0, d, x0, one);
- e1 = gen_reg_rtx (mode);
- emit_insn (gen_mul (e1, e0, e0)); /* e1 = e0 * e0 */
+ /* x1 = x0 + e0 * x0 */
+ x1 = gen_reg_rtx (mode);
+ rs6000_emit_madd (x1, e0, x0, x0);
- y2 = gen_reg_rtx (mode);
- rs6000_emit_madd (y2, e1, y1, y1); /* y2 = y1 + e1 * y1 */
+ for (i = 0, xprev = x1, eprev = e0; i < passes - 2;
+ ++i, xprev = xnext, eprev = enext) {
+
+ /* enext = eprev * eprev */
+ enext = gen_reg_rtx (mode);
+ emit_insn (gen_mul (enext, eprev, eprev));
- e2 = gen_reg_rtx (mode);
- emit_insn (gen_mul (e2, e1, e1)); /* e2 = e1 * e1 */
+ /* xnext = xprev + enext * xprev */
+ xnext = gen_reg_rtx (mode);
+ rs6000_emit_madd (xnext, enext, xprev, xprev);
+ }
- y3 = gen_reg_rtx (mode);
- rs6000_emit_madd (y3, e2, y2, y2); /* y3 = y2 + e2 * y2 */
+ } else
+ xprev = x0;
- u0 = gen_reg_rtx (mode);
- emit_insn (gen_mul (u0, n, y3)); /* u0 = n * y3 */
+ /* The last iteration calculates x_(i+1) = n * x_i * (2 - d * x_i). */
- v0 = gen_reg_rtx (mode);
- rs6000_emit_nmsub (v0, d, u0, n); /* v0 = n - d * u0 */
+ /* u = n * xprev */
+ u = gen_reg_rtx (mode);
+ emit_insn (gen_mul (u, n, xprev));
- rs6000_emit_madd (dst, v0, y3, u0); /* dst = u0 + v0 * y3 */
-}
+ /* v = n - (d * u) */
+ v = gen_reg_rtx (mode);
+ rs6000_emit_nmsub (v, d, u, n);
-/* Newton-Raphson approximation of floating point divide DST = N/D. If NOTE_P,
- add a reg_note saying that this was a division. Support both scalar and
- vector divide. Assumes no trapping math and finite arguments. */
-
-void
-rs6000_emit_swdiv (rtx dst, rtx n, rtx d, bool note_p)
-{
- enum machine_mode mode = GET_MODE (dst);
-
- if (RS6000_RECIP_HIGH_PRECISION_P (mode))
- rs6000_emit_swdiv_high_precision (dst, n, d);
- else
- rs6000_emit_swdiv_low_precision (dst, n, d);
+ /* dst = (v * xprev) + u */
+ rs6000_emit_madd (dst, v, xprev, u);
if (note_p)
add_reg_note (get_last_insn (), REG_EQUAL, gen_rtx_DIV (mode, n, d));
@@ -27028,7 +26998,16 @@ rs6000_emit_swrsqrt (rtx dst, rtx src)
enum machine_mode mode = GET_MODE (src);
rtx x0 = gen_reg_rtx (mode);
rtx y = gen_reg_rtx (mode);
- int passes = (TARGET_RECIP_PRECISION) ? 2 : 3;
+
+ /* Low precision estimates guarantee 5 bits of accuracy. High
+ precision estimates guarantee 14 bits of accuracy. SFmode
+ requires 23 bits of accuracy. DFmode requires 52 bits of
+ accuracy. Each pass at least doubles the accuracy, leading
+ to the following. */
+ int passes = (TARGET_RECIP_PRECISION) ? 1 : 3;
+ if (mode == DFmode || mode == V2DFmode)
+ passes++;
+
REAL_VALUE_TYPE dconst3_2;
int i;
rtx halfthree;
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index b7b415d69c0..2040db95b7f 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -601,9 +601,6 @@ extern unsigned char rs6000_recip_bits[];
#define RS6000_RECIP_AUTO_RSQRTE_P(MODE) \
(rs6000_recip_bits[(int)(MODE)] & RS6000_RECIP_MASK_AUTO_RSQRTE)
-#define RS6000_RECIP_HIGH_PRECISION_P(MODE) \
- ((MODE) == SFmode || (MODE) == V4SFmode || TARGET_RECIP_PRECISION)
-
/* The default CPU for TARGET_OPTION_OVERRIDE. */
#define OPTION_TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 663cc545b8c..15783632457 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -4647,6 +4647,9 @@ s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src)
int smode_bsize, mode_bsize;
rtx op, clobber;
+ if (bitsize + bitpos > GET_MODE_SIZE (mode))
+ return false;
+
/* Generate INSERT IMMEDIATE (IILL et al). */
/* (set (ze (reg)) (const_int)). */
if (TARGET_ZARCH
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index ccf0ffe2108..a4bb62a394d 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -5842,7 +5842,7 @@ fixup_addr_diff_vecs (rtx first)
int
barrier_align (rtx barrier_or_label)
{
- rtx next = next_real_insn (barrier_or_label), pat, prev;
+ rtx next = next_active_insn (barrier_or_label), pat, prev;
if (! next)
return 0;
@@ -5856,7 +5856,7 @@ barrier_align (rtx barrier_or_label)
/* This is a barrier in front of a constant table. */
return 0;
- prev = prev_real_insn (barrier_or_label);
+ prev = prev_active_insn (barrier_or_label);
if (GET_CODE (PATTERN (prev)) == ADDR_DIFF_VEC)
{
pat = PATTERN (prev);
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 23a5bf51770..4c9b334e7a7 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -181,6 +181,11 @@ along with GCC; see the file COPYING3. If not see
%(link_arch) \
%{Qy:} %{!Qn:-Qy}"
+/* Use --as-needed/-z ignore -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
#ifdef USE_GLD
/* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
--eh-frame-hdr to create the required .eh_frame_hdr sections. */
diff --git a/gcc/config/sparc/predicates.md b/gcc/config/sparc/predicates.md
index b8524e5a064..073bce2adec 100644
--- a/gcc/config/sparc/predicates.md
+++ b/gcc/config/sparc/predicates.md
@@ -265,6 +265,11 @@
(ior (match_test "register_operand (op, SImode)")
(match_test "TARGET_ARCH64 && register_operand (op, DImode)")))
+;; Return true if OP is an integer register of the appropriate mode
+;; for a cstore result.
+(define_special_predicate "cstore_result_operand"
+ (match_test "register_operand (op, TARGET_ARCH64 ? DImode : SImode)"))
+
;; Return true if OP is a floating point condition code register.
(define_predicate "fcc_register_operand"
(match_code "reg")
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 3e98325bd3b..1dc4e3600a8 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "df.h"
#include "opts.h"
+#include "tree-pass.h"
/* Processor costs */
@@ -538,7 +539,6 @@ static void sparc_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
static bool sparc_can_output_mi_thunk (const_tree, HOST_WIDE_INT,
HOST_WIDE_INT, const_tree);
-static void sparc_reorg (void);
static struct machine_function * sparc_init_machine_status (void);
static bool sparc_cannot_force_const_mem (enum machine_mode, rtx);
static rtx sparc_tls_get_addr (void);
@@ -597,6 +597,7 @@ static void sparc_print_operand_address (FILE *, rtx);
static reg_class_t sparc_secondary_reload (bool, rtx, reg_class_t,
enum machine_mode,
secondary_reload_info *);
+static enum machine_mode sparc_cstore_mode (enum insn_code icode);
#ifdef SUBTARGET_ATTRIBUTE_TABLE
/* Table of valid machine attributes. */
@@ -680,9 +681,6 @@ char sparc_hard_reg_printed[8];
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK sparc_can_output_mi_thunk
-#undef TARGET_MACHINE_DEPENDENT_REORG
-#define TARGET_MACHINE_DEPENDENT_REORG sparc_reorg
-
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS sparc_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -802,8 +800,141 @@ char sparc_hard_reg_printed[8];
#undef TARGET_ATOMIC_TEST_AND_SET_TRUEVAL
#define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL 0xff
+#undef TARGET_CSTORE_MODE
+#define TARGET_CSTORE_MODE sparc_cstore_mode
+
struct gcc_target targetm = TARGET_INITIALIZER;
+/* We use a machine specific pass to enable workarounds for errata.
+ We need to have the (essentially) final form of the insn stream in order
+ to properly detect the various hazards. Therefore, this machine specific
+ pass runs as late as possible. The pass is inserted in the pass pipeline
+ at the end of sparc_options_override. */
+
+static bool
+sparc_gate_work_around_errata (void)
+{
+ /* The only erratum we handle for now is that of the AT697F processor. */
+ return sparc_fix_at697f != 0;
+}
+
+static unsigned int
+sparc_do_work_around_errata (void)
+{
+ rtx insn, next;
+
+ /* Now look for specific patterns in the insn stream. */
+ for (insn = get_insns (); insn; insn = next)
+ {
+ bool insert_nop = false;
+ rtx set;
+
+ /* Look for a single-word load into an odd-numbered FP register. */
+ if (NONJUMP_INSN_P (insn)
+ && (set = single_set (insn)) != NULL_RTX
+ && GET_MODE_SIZE (GET_MODE (SET_SRC (set))) == 4
+ && MEM_P (SET_SRC (set))
+ && REG_P (SET_DEST (set))
+ && REGNO (SET_DEST (set)) > 31
+ && REGNO (SET_DEST (set)) % 2 != 0)
+ {
+ /* The wrong dependency is on the enclosing double register. */
+ unsigned int x = REGNO (SET_DEST (set)) - 1;
+ unsigned int src1, src2, dest;
+ int code;
+
+ /* If the insn has a delay slot, then it cannot be problematic. */
+ next = next_active_insn (insn);
+ if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE)
+ code = -1;
+ else
+ {
+ extract_insn (next);
+ code = INSN_CODE (next);
+ }
+
+ switch (code)
+ {
+ case CODE_FOR_adddf3:
+ case CODE_FOR_subdf3:
+ case CODE_FOR_muldf3:
+ case CODE_FOR_divdf3:
+ dest = REGNO (recog_data.operand[0]);
+ src1 = REGNO (recog_data.operand[1]);
+ src2 = REGNO (recog_data.operand[2]);
+ if (src1 != src2)
+ {
+ /* Case [1-4]:
+ ld [address], %fx+1
+ FPOPd %f{x,y}, %f{y,x}, %f{x,y} */
+ if ((src1 == x || src2 == x)
+ && (dest == src1 || dest == src2))
+ insert_nop = true;
+ }
+ else
+ {
+ /* Case 5:
+ ld [address], %fx+1
+ FPOPd %fx, %fx, %fx */
+ if (src1 == x
+ && dest == src1
+ && (code == CODE_FOR_adddf3 || code == CODE_FOR_muldf3))
+ insert_nop = true;
+ }
+ break;
+
+ case CODE_FOR_sqrtdf2:
+ dest = REGNO (recog_data.operand[0]);
+ src1 = REGNO (recog_data.operand[1]);
+ /* Case 6:
+ ld [address], %fx+1
+ fsqrtd %fx, %fx */
+ if (src1 == x && dest == src1)
+ insert_nop = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ else
+ next = NEXT_INSN (insn);
+
+ if (insert_nop)
+ emit_insn_after (gen_nop (), insn);
+ }
+ return 0;
+}
+
+struct rtl_opt_pass pass_work_around_errata =
+{
+ {
+ RTL_PASS,
+ "errata", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ sparc_gate_work_around_errata, /* gate */
+ sparc_do_work_around_errata, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_MACH_DEP, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_rtl_sharing, /* todo_flags_finish */
+ }
+};
+
+struct register_pass_info insert_pass_work_around_errata =
+{
+ &pass_work_around_errata.pass, /* pass */
+ "dbr", /* reference_pass_name */
+ 1, /* ref_pass_instance_number */
+ PASS_POS_INSERT_AFTER /* po_op */
+};
+
+/* Helpers for TARGET_DEBUG_OPTIONS. */
static void
dump_target_flag_bits (const int flags)
{
@@ -1241,6 +1372,13 @@ sparc_option_override (void)
pessimizes for double floating-point registers. */
if (!global_options_set.x_flag_ira_share_save_slots)
flag_ira_share_save_slots = 0;
+
+ /* We register a machine specific pass to work around errata, if any.
+ The pass mut be scheduled as late as possible so that we have the
+ (essentially) final form of the insn stream to work on.
+ Registering the pass must be done at start up. It's convenient to
+ do it here. */
+ register_pass (&insert_pass_work_around_errata);
}
/* Miscellaneous utilities. */
@@ -2572,7 +2710,11 @@ emit_scc_insn (rtx operands[])
{
if (GET_MODE (x) == SImode)
{
- rtx pat = gen_seqsi_special (operands[0], x, y);
+ rtx pat;
+ if (TARGET_ARCH64)
+ pat = gen_seqsidi_special (operands[0], x, y);
+ else
+ pat = gen_seqsisi_special (operands[0], x, y);
emit_insn (pat);
return true;
}
@@ -2588,7 +2730,11 @@ emit_scc_insn (rtx operands[])
{
if (GET_MODE (x) == SImode)
{
- rtx pat = gen_snesi_special (operands[0], x, y);
+ rtx pat;
+ if (TARGET_ARCH64)
+ pat = gen_snesidi_special (operands[0], x, y);
+ else
+ pat = gen_snesisi_special (operands[0], x, y);
emit_insn (pat);
return true;
}
@@ -2631,7 +2777,7 @@ emit_scc_insn (rtx operands[])
|| (!TARGET_VIS3 && code == GEU))
{
emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_fmt_ee (code, SImode,
+ gen_rtx_fmt_ee (code, GET_MODE (operands[0]),
gen_compare_reg_1 (code, x, y),
const0_rtx)));
return true;
@@ -4321,13 +4467,14 @@ mem_min_alignment (rtx mem, int desired)
mapped into one sparc_mode_class mode. */
enum sparc_mode_class {
- S_MODE, D_MODE, T_MODE, O_MODE,
+ H_MODE, S_MODE, D_MODE, T_MODE, O_MODE,
SF_MODE, DF_MODE, TF_MODE, OF_MODE,
CC_MODE, CCFP_MODE
};
/* Modes for single-word and smaller quantities. */
-#define S_MODES ((1 << (int) S_MODE) | (1 << (int) SF_MODE))
+#define S_MODES \
+ ((1 << (int) H_MODE) | (1 << (int) S_MODE) | (1 << (int) SF_MODE))
/* Modes for double-word and smaller quantities. */
#define D_MODES (S_MODES | (1 << (int) D_MODE) | (1 << DF_MODE))
@@ -4338,13 +4485,11 @@ enum sparc_mode_class {
/* Modes for 8-word and smaller quantities. */
#define O_MODES (T_MODES | (1 << (int) O_MODE) | (1 << (int) OF_MODE))
-/* Modes for single-float quantities. We must allow any single word or
- smaller quantity. This is because the fix/float conversion instructions
- take integer inputs/outputs from the float registers. */
-#define SF_MODES (S_MODES)
+/* Modes for single-float quantities. */
+#define SF_MODES ((1 << (int) S_MODE) | (1 << (int) SF_MODE))
/* Modes for double-float and smaller quantities. */
-#define DF_MODES (D_MODES)
+#define DF_MODES (SF_MODES | (1 << (int) D_MODE) | (1 << DF_MODE))
/* Modes for quad-float and smaller quantities. */
#define TF_MODES (DF_MODES | (1 << (int) TF_MODE))
@@ -4440,7 +4585,9 @@ sparc_init_modes (void)
case MODE_INT:
case MODE_PARTIAL_INT:
case MODE_COMPLEX_INT:
- if (GET_MODE_SIZE (i) <= 4)
+ if (GET_MODE_SIZE (i) < 4)
+ sparc_mode_class[i] = 1 << (int) H_MODE;
+ else if (GET_MODE_SIZE (i) == 4)
sparc_mode_class[i] = 1 << (int) S_MODE;
else if (GET_MODE_SIZE (i) == 8)
sparc_mode_class[i] = 1 << (int) D_MODE;
@@ -4452,14 +4599,16 @@ sparc_init_modes (void)
sparc_mode_class[i] = 0;
break;
case MODE_VECTOR_INT:
- if (GET_MODE_SIZE (i) <= 4)
- sparc_mode_class[i] = 1 << (int)SF_MODE;
+ if (GET_MODE_SIZE (i) == 4)
+ sparc_mode_class[i] = 1 << (int) SF_MODE;
else if (GET_MODE_SIZE (i) == 8)
- sparc_mode_class[i] = 1 << (int)DF_MODE;
+ sparc_mode_class[i] = 1 << (int) DF_MODE;
+ else
+ sparc_mode_class[i] = 0;
break;
case MODE_FLOAT:
case MODE_COMPLEX_FLOAT:
- if (GET_MODE_SIZE (i) <= 4)
+ if (GET_MODE_SIZE (i) == 4)
sparc_mode_class[i] = 1 << (int) SF_MODE;
else if (GET_MODE_SIZE (i) == 8)
sparc_mode_class[i] = 1 << (int) DF_MODE;
@@ -10894,107 +11043,6 @@ sparc_can_output_mi_thunk (const_tree thunk_fndecl ATTRIBUTE_UNUSED,
return (vcall_offset >= -32768 || ! fixed_regs[5]);
}
-/* We use the machine specific reorg pass to enable workarounds for errata. */
-
-static void
-sparc_reorg (void)
-{
- rtx insn, next;
-
- /* The only erratum we handle for now is that of the AT697F processor. */
- if (!sparc_fix_at697f)
- return;
-
- /* We need to have the (essentially) final form of the insn stream in order
- to properly detect the various hazards. Run delay slot scheduling. */
- if (optimize > 0 && flag_delayed_branch)
- {
- cleanup_barriers ();
- dbr_schedule (get_insns ());
- }
-
- /* Now look for specific patterns in the insn stream. */
- for (insn = get_insns (); insn; insn = next)
- {
- bool insert_nop = false;
- rtx set;
-
- /* Look for a single-word load into an odd-numbered FP register. */
- if (NONJUMP_INSN_P (insn)
- && (set = single_set (insn)) != NULL_RTX
- && GET_MODE_SIZE (GET_MODE (SET_SRC (set))) == 4
- && MEM_P (SET_SRC (set))
- && REG_P (SET_DEST (set))
- && REGNO (SET_DEST (set)) > 31
- && REGNO (SET_DEST (set)) % 2 != 0)
- {
- /* The wrong dependency is on the enclosing double register. */
- unsigned int x = REGNO (SET_DEST (set)) - 1;
- unsigned int src1, src2, dest;
- int code;
-
- /* If the insn has a delay slot, then it cannot be problematic. */
- next = next_active_insn (insn);
- if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE)
- code = -1;
- else
- {
- extract_insn (next);
- code = INSN_CODE (next);
- }
-
- switch (code)
- {
- case CODE_FOR_adddf3:
- case CODE_FOR_subdf3:
- case CODE_FOR_muldf3:
- case CODE_FOR_divdf3:
- dest = REGNO (recog_data.operand[0]);
- src1 = REGNO (recog_data.operand[1]);
- src2 = REGNO (recog_data.operand[2]);
- if (src1 != src2)
- {
- /* Case [1-4]:
- ld [address], %fx+1
- FPOPd %f{x,y}, %f{y,x}, %f{x,y} */
- if ((src1 == x || src2 == x)
- && (dest == src1 || dest == src2))
- insert_nop = true;
- }
- else
- {
- /* Case 5:
- ld [address], %fx+1
- FPOPd %fx, %fx, %fx */
- if (src1 == x
- && dest == src1
- && (code == CODE_FOR_adddf3 || code == CODE_FOR_muldf3))
- insert_nop = true;
- }
- break;
-
- case CODE_FOR_sqrtdf2:
- dest = REGNO (recog_data.operand[0]);
- src1 = REGNO (recog_data.operand[1]);
- /* Case 6:
- ld [address], %fx+1
- fsqrtd %fx, %fx */
- if (src1 == x && dest == src1)
- insert_nop = true;
- break;
-
- default:
- break;
- }
- }
- else
- next = NEXT_INSN (insn);
-
- if (insert_nop)
- emit_insn_after (gen_nop (), insn);
- }
-}
-
/* How to allocate a 'struct machine_function'. */
static struct machine_function *
@@ -12104,4 +12152,9 @@ sparc_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2)
return true;
}
+static enum machine_mode sparc_cstore_mode (enum insn_code icode ATTRIBUTE_UNUSED)
+{
+ return (TARGET_ARCH64 ? DImode : SImode);
+}
+
#include "gt-sparc.h"
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 6b02b45a24c..c6122c115cd 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -327,6 +327,8 @@ extern enum cmodel sparc_cmodel;
%{mcpu=sparclite86x:-Asparclite} \
%{mcpu=f930:-Asparclite} %{mcpu=f934:-Asparclite} \
%{mcpu=v8:-Av8} \
+%{mcpu=supersparc:-Av8} \
+%{mcpu=hypersparc:-Av8} \
%{mcpu=leon:-Av8} \
%{mv8plus:-Av8plus} \
%{mcpu=v9:-Av9} \
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 933991c168d..292cb205271 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -22,88 +22,88 @@
;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
-(define_constants
- [(UNSPEC_MOVE_PIC 0)
- (UNSPEC_UPDATE_RETURN 1)
- (UNSPEC_LOAD_PCREL_SYM 2)
- (UNSPEC_FRAME_BLOCKAGE 3)
- (UNSPEC_MOVE_PIC_LABEL 5)
- (UNSPEC_SETH44 6)
- (UNSPEC_SETM44 7)
- (UNSPEC_SETHH 9)
- (UNSPEC_SETLM 10)
- (UNSPEC_EMB_HISUM 11)
- (UNSPEC_EMB_TEXTUHI 13)
- (UNSPEC_EMB_TEXTHI 14)
- (UNSPEC_EMB_TEXTULO 15)
- (UNSPEC_EMB_SETHM 18)
- (UNSPEC_MOVE_GOTDATA 19)
-
- (UNSPEC_MEMBAR 20)
- (UNSPEC_ATOMIC 21)
-
- (UNSPEC_TLSGD 30)
- (UNSPEC_TLSLDM 31)
- (UNSPEC_TLSLDO 32)
- (UNSPEC_TLSIE 33)
- (UNSPEC_TLSLE 34)
- (UNSPEC_TLSLD_BASE 35)
-
- (UNSPEC_FPACK16 40)
- (UNSPEC_FPACK32 41)
- (UNSPEC_FPACKFIX 42)
- (UNSPEC_FEXPAND 43)
- (UNSPEC_MUL16AU 44)
- (UNSPEC_MUL16AL 45)
- (UNSPEC_MUL8UL 46)
- (UNSPEC_MULDUL 47)
- (UNSPEC_ALIGNDATA 48)
- (UNSPEC_FCMP 49)
- (UNSPEC_PDIST 50)
- (UNSPEC_EDGE8 51)
- (UNSPEC_EDGE8L 52)
- (UNSPEC_EDGE16 53)
- (UNSPEC_EDGE16L 54)
- (UNSPEC_EDGE32 55)
- (UNSPEC_EDGE32L 56)
- (UNSPEC_ARRAY8 57)
- (UNSPEC_ARRAY16 58)
- (UNSPEC_ARRAY32 59)
-
- (UNSPEC_SP_SET 60)
- (UNSPEC_SP_TEST 61)
-
- (UNSPEC_EDGE8N 70)
- (UNSPEC_EDGE8LN 71)
- (UNSPEC_EDGE16N 72)
- (UNSPEC_EDGE16LN 73)
- (UNSPEC_EDGE32N 74)
- (UNSPEC_EDGE32LN 75)
- (UNSPEC_BSHUFFLE 76)
- (UNSPEC_CMASK8 77)
- (UNSPEC_CMASK16 78)
- (UNSPEC_CMASK32 79)
- (UNSPEC_FCHKSM16 80)
- (UNSPEC_PDISTN 81)
- (UNSPEC_FUCMP 82)
- (UNSPEC_FHADD 83)
- (UNSPEC_FHSUB 84)
- (UNSPEC_XMUL 85)
- (UNSPEC_MUL8 86)
- (UNSPEC_MUL8SU 87)
- (UNSPEC_MULDSU 88)
- ])
-
-(define_constants
- [(UNSPECV_BLOCKAGE 0)
- (UNSPECV_FLUSHW 1)
- (UNSPECV_FLUSH 4)
- (UNSPECV_SAVEW 6)
- (UNSPECV_CAS 8)
- (UNSPECV_SWAP 9)
- (UNSPECV_LDSTUB 10)
- (UNSPECV_PROBE_STACK_RANGE 11)
- ])
+(define_c_enum "unspec" [
+ UNSPEC_MOVE_PIC
+ UNSPEC_UPDATE_RETURN
+ UNSPEC_LOAD_PCREL_SYM
+ UNSPEC_FRAME_BLOCKAGE
+ UNSPEC_MOVE_PIC_LABEL
+ UNSPEC_SETH44
+ UNSPEC_SETM44
+ UNSPEC_SETHH
+ UNSPEC_SETLM
+ UNSPEC_EMB_HISUM
+ UNSPEC_EMB_TEXTUHI
+ UNSPEC_EMB_TEXTHI
+ UNSPEC_EMB_TEXTULO
+ UNSPEC_EMB_SETHM
+ UNSPEC_MOVE_GOTDATA
+
+ UNSPEC_MEMBAR
+ UNSPEC_ATOMIC
+
+ UNSPEC_TLSGD
+ UNSPEC_TLSLDM
+ UNSPEC_TLSLDO
+ UNSPEC_TLSIE
+ UNSPEC_TLSLE
+ UNSPEC_TLSLD_BASE
+
+ UNSPEC_FPACK16
+ UNSPEC_FPACK32
+ UNSPEC_FPACKFIX
+ UNSPEC_FEXPAND
+ UNSPEC_MUL16AU
+ UNSPEC_MUL16AL
+ UNSPEC_MUL8UL
+ UNSPEC_MULDUL
+ UNSPEC_ALIGNDATA
+ UNSPEC_FCMP
+ UNSPEC_PDIST
+ UNSPEC_EDGE8
+ UNSPEC_EDGE8L
+ UNSPEC_EDGE16
+ UNSPEC_EDGE16L
+ UNSPEC_EDGE32
+ UNSPEC_EDGE32L
+ UNSPEC_ARRAY8
+ UNSPEC_ARRAY16
+ UNSPEC_ARRAY32
+
+ UNSPEC_SP_SET
+ UNSPEC_SP_TEST
+
+ UNSPEC_EDGE8N
+ UNSPEC_EDGE8LN
+ UNSPEC_EDGE16N
+ UNSPEC_EDGE16LN
+ UNSPEC_EDGE32N
+ UNSPEC_EDGE32LN
+ UNSPEC_BSHUFFLE
+ UNSPEC_CMASK8
+ UNSPEC_CMASK16
+ UNSPEC_CMASK32
+ UNSPEC_FCHKSM16
+ UNSPEC_PDISTN
+ UNSPEC_FUCMP
+ UNSPEC_FHADD
+ UNSPEC_FHSUB
+ UNSPEC_XMUL
+ UNSPEC_MUL8
+ UNSPEC_MUL8SU
+ UNSPEC_MULDSU
+])
+
+(define_c_enum "unspecv" [
+ UNSPECV_BLOCKAGE
+ UNSPECV_FLUSHW
+ UNSPECV_FLUSH
+ UNSPECV_SAVEW
+ UNSPECV_CAS
+ UNSPECV_SWAP
+ UNSPECV_LDSTUB
+ UNSPECV_PROBE_STACK_RANGE
+])
(define_constants
[(G0_REG 0)
@@ -615,11 +615,14 @@
;; Next come the scc insns.
+;; Note that the boolean result (operand 0) takes on DImode
+;; (not SImode) when TARGET_ARCH64.
+
(define_expand "cstoresi4"
[(use (match_operator 1 "comparison_operator"
[(match_operand:SI 2 "compare_operand" "")
(match_operand:SI 3 "arith_operand" "")]))
- (clobber (match_operand:SI 0 "register_operand"))]
+ (clobber (match_operand:SI 0 "cstore_result_operand"))]
""
{
if (GET_CODE (operands[2]) == ZERO_EXTRACT && operands[3] != const0_rtx)
@@ -631,7 +634,7 @@
[(use (match_operator 1 "comparison_operator"
[(match_operand:DI 2 "compare_operand" "")
(match_operand:DI 3 "arith_operand" "")]))
- (clobber (match_operand:SI 0 "register_operand"))]
+ (clobber (match_operand:SI 0 "cstore_result_operand"))]
"TARGET_ARCH64"
{
if (GET_CODE (operands[2]) == ZERO_EXTRACT && operands[3] != const0_rtx)
@@ -643,7 +646,7 @@
[(use (match_operator 1 "comparison_operator"
[(match_operand:F 2 "register_operand" "")
(match_operand:F 3 "register_operand" "")]))
- (clobber (match_operand:SI 0 "register_operand"))]
+ (clobber (match_operand:SI 0 "cstore_result_operand"))]
"TARGET_FPU"
{ if (emit_scc_insn (operands)) DONE; else FAIL; })
@@ -652,12 +655,12 @@
;; Seq_special[_xxx] and sne_special[_xxx] clobber the CC reg, because they
;; generate addcc/subcc instructions.
-(define_expand "seqsi_special"
+(define_expand "seqsi<P:mode>_special"
[(set (match_dup 3)
(xor:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "register_operand" "")))
- (parallel [(set (match_operand:SI 0 "register_operand" "")
- (eq:SI (match_dup 3) (const_int 0)))
+ (parallel [(set (match_operand:P 0 "register_operand" "")
+ (eq:P (match_dup 3) (const_int 0)))
(clobber (reg:CC CC_REG))])]
""
{ operands[3] = gen_reg_rtx (SImode); })
@@ -666,17 +669,17 @@
[(set (match_dup 3)
(xor:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))
- (set (match_operand:SI 0 "register_operand" "")
- (eq:SI (match_dup 3) (const_int 0)))]
+ (set (match_operand:DI 0 "register_operand" "")
+ (eq:DI (match_dup 3) (const_int 0)))]
"TARGET_ARCH64"
{ operands[3] = gen_reg_rtx (DImode); })
-(define_expand "snesi_special"
+(define_expand "snesi<P:mode>_special"
[(set (match_dup 3)
(xor:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "register_operand" "")))
- (parallel [(set (match_operand:SI 0 "register_operand" "")
- (ne:SI (match_dup 3) (const_int 0)))
+ (parallel [(set (match_operand:P 0 "register_operand" "")
+ (ne:P (match_dup 3) (const_int 0)))
(clobber (reg:CC CC_REG))])]
""
{ operands[3] = gen_reg_rtx (SImode); })
@@ -685,8 +688,8 @@
[(set (match_dup 3)
(xor:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))
- (set (match_operand:SI 0 "register_operand" "")
- (ne:SI (match_dup 3) (const_int 0)))]
+ (set (match_operand:DI 0 "register_operand" "")
+ (ne:DI (match_dup 3) (const_int 0)))]
"TARGET_ARCH64 && ! TARGET_VIS3"
{ operands[3] = gen_reg_rtx (DImode); })
@@ -694,8 +697,8 @@
[(set (match_dup 3)
(xor:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))
- (parallel [(set (match_operand:SI 0 "register_operand" "")
- (ne:SI (match_dup 3) (const_int 0)))
+ (parallel [(set (match_operand:DI 0 "register_operand" "")
+ (ne:DI (match_dup 3) (const_int 0)))
(clobber (reg:CCX CC_REG))])]
"TARGET_ARCH64 && TARGET_VIS3"
{ operands[3] = gen_reg_rtx (DImode); })
@@ -708,9 +711,9 @@
;; them to always use the splits below so the results can be
;; scheduled.
-(define_insn_and_split "*snesi_zero"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (ne:SI (match_operand:SI 1 "register_operand" "r")
+(define_insn_and_split "*snesi<P:mode>_zero"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (ne:P (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
(clobber (reg:CC CC_REG))]
""
@@ -718,11 +721,11 @@
""
[(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (ltu:SI (reg:CC CC_REG) (const_int 0)))]
+ (set (match_dup 0) (ltu:P (reg:CC CC_REG) (const_int 0)))]
""
[(set_attr "length" "2")])
-(define_insn_and_split "*neg_snesi_zero"
+(define_insn_and_split "*neg_snesisi_zero"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (ne:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
@@ -736,35 +739,16 @@
""
[(set_attr "length" "2")])
-(define_insn_and_split "*snesi_zero_extend"
+(define_insn_and_split "*neg_snesidi_zero"
[(set (match_operand:DI 0 "register_operand" "=r")
- (ne:DI (match_operand:SI 1 "register_operand" "r")
- (const_int 0)))
+ (neg:DI (ne:DI (match_operand:SI 1 "register_operand" "r")
+ (const_int 0))))
(clobber (reg:CC CC_REG))]
"TARGET_ARCH64"
"#"
- "&& 1"
- [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (minus:SI (const_int 0)
- (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (zero_extend:DI (plus:SI (plus:SI (const_int 0)
- (const_int 0))
- (ltu:SI (reg:CC_NOOV CC_REG)
- (const_int 0)))))]
""
- [(set_attr "length" "2")])
-
-(define_insn_and_split "*neg_snesi_sign_extend"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (neg:DI (ne:DI (match_operand:SI 1 "register_operand" "r")
- (const_int 0))))
- (clobber (reg:CC CC_REG))]
- "TARGET_ARCH64"
- "#"
- "&& 1"
- [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (minus:SI (const_int 0)
- (match_dup 1))
- (const_int 0)))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
(set (match_dup 0) (sign_extend:DI (neg:SI (ltu:SI (reg:CC CC_REG)
(const_int 0)))))]
""
@@ -843,9 +827,9 @@
""
[(set_attr "length" "2")])
-(define_insn_and_split "*seqsi_zero"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (eq:SI (match_operand:SI 1 "register_operand" "r")
+(define_insn_and_split "*seqsi<P:mode>_zero"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (eq:P (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
(clobber (reg:CC CC_REG))]
""
@@ -853,11 +837,11 @@
""
[(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (geu:SI (reg:CC CC_REG) (const_int 0)))]
+ (set (match_dup 0) (geu:P (reg:CC CC_REG) (const_int 0)))]
""
[(set_attr "length" "2")])
-(define_insn_and_split "*neg_seqsi_zero"
+(define_insn_and_split "*neg_seqsisi_zero"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (eq:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
@@ -871,25 +855,7 @@
""
[(set_attr "length" "2")])
-(define_insn_and_split "*seqsi_zero_extend"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (eq:DI (match_operand:SI 1 "register_operand" "r")
- (const_int 0)))
- (clobber (reg:CC CC_REG))]
- "TARGET_ARCH64"
- "#"
- "&& 1"
- [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (minus:SI (const_int 0)
- (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (zero_extend:DI (minus:SI (minus:SI (const_int 0)
- (const_int -1))
- (ltu:SI (reg:CC_NOOV CC_REG)
- (const_int 0)))))]
- ""
- [(set_attr "length" "2")])
-
-(define_insn_and_split "*neg_seqsi_sign_extend"
+(define_insn_and_split "*neg_seqsidi_zero"
[(set (match_operand:DI 0 "register_operand" "=r")
(neg:DI (eq:DI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
@@ -1021,9 +987,9 @@
;; ??? The addx/subx insns use the 32 bit carry flag so there are no DImode
;; versions for v9.
-(define_insn "*sltu_insn"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (ltu:SI (reg:CC CC_REG) (const_int 0)))]
+(define_insn "*sltu<P:mode>_insn"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (ltu:P (reg:CC CC_REG) (const_int 0)))]
""
"addx\t%%g0, 0, %0"
[(set_attr "type" "ialuX")])
@@ -1042,28 +1008,20 @@
"addxc\t%%g0, %%g0, %0"
[(set_attr "type" "ialuX")])
-(define_insn "*sltu_extend_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (ltu:DI (reg:CC CC_REG) (const_int 0)))]
- "TARGET_ARCH64"
- "addx\t%%g0, 0, %0"
- [(set_attr "type" "ialuX")])
-
-(define_insn "*neg_sltu_insn"
+(define_insn "*neg_sltusi_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (ltu:SI (reg:CC CC_REG) (const_int 0))))]
""
"subx\t%%g0, 0, %0"
[(set_attr "type" "ialuX")])
-(define_insn "*neg_sltu_extend_sp64"
+(define_insn "*neg_sltudi_insn"
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI (neg:SI (ltu:SI (reg:CC CC_REG) (const_int 0)))))]
"TARGET_ARCH64"
"subx\t%%g0, 0, %0"
[(set_attr "type" "ialuX")])
-;; ??? Combine should canonicalize these next two to the same pattern.
(define_insn "*neg_sltu_minus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (neg:SI (ltu:SI (reg:CC CC_REG) (const_int 0)))
@@ -1080,28 +1038,21 @@
"subx\t%%g0, %1, %0"
[(set_attr "type" "ialuX")])
-(define_insn "*sgeu_insn"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (geu:SI (reg:CC CC_REG) (const_int 0)))]
+(define_insn "*sgeu<P:mode>_insn"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (geu:P (reg:CC CC_REG) (const_int 0)))]
""
"subx\t%%g0, -1, %0"
[(set_attr "type" "ialuX")])
-(define_insn "*sgeu_extend_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (geu:DI (reg:CC CC_REG) (const_int 0)))]
- "TARGET_ARCH64"
- "subx\t%%g0, -1, %0"
- [(set_attr "type" "ialuX")])
-
-(define_insn "*neg_sgeu_insn"
+(define_insn "*neg_sgeusi_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (geu:SI (reg:CC CC_REG) (const_int 0))))]
""
"addx\t%%g0, -1, %0"
[(set_attr "type" "ialuX")])
-(define_insn "*neg_sgeu_extend_sp64"
+(define_insn "*neg_sgeudi_insn"
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI (neg:SI (geu:SI (reg:CC CC_REG) (const_int 0)))))]
"TARGET_ARCH64"
diff --git a/gcc/config/sparc/t-sparc b/gcc/config/sparc/t-sparc
index d7b17fbd02b..664f4a42418 100644
--- a/gcc/config/sparc/t-sparc
+++ b/gcc/config/sparc/t-sparc
@@ -23,7 +23,7 @@ sparc.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
insn-codes.h conditions.h output.h $(INSN_ATTR_H) $(FLAGS_H) \
$(FUNCTION_H) $(EXCEPT_H) $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
$(DIAGNOSTIC_CORE_H) $(GGC_H) $(TM_P_H) debug.h $(TARGET_H) \
- $(TARGET_DEF_H) $(COMMON_TARGET_H) $(GIMPLE_H) \
+ $(TARGET_DEF_H) $(COMMON_TARGET_H) $(GIMPLE_H) $(TREE_PASS_H) \
langhooks.h reload.h $(PARAMS_H) $(DF_H) $(OPTS_H) \
gt-sparc.h
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 31d31f928a6..6cbd3f82337 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -1978,13 +1978,22 @@ static struct spu_bb_info *spu_bb_info;
/* Emit a nop for INSN such that the two will dual issue. This assumes
INSN is 8-byte aligned. When INSN is inline asm we emit an lnop.
We check for TImode to handle a MULTI1 insn which has dual issued its
- first instruction. get_pipe returns -1 for MULTI0, inline asm, or
- ADDR_VEC insns. */
+ first instruction. get_pipe returns -1 for MULTI0 or inline asm. */
static void
emit_nop_for_insn (rtx insn)
{
int p;
rtx new_insn;
+
+ /* We need to handle JUMP_TABLE_DATA separately. */
+ if (JUMP_TABLE_DATA_P (insn))
+ {
+ new_insn = emit_insn_after (gen_lnop(), insn);
+ recog_memoized (new_insn);
+ INSN_LOCATION (new_insn) = UNKNOWN_LOCATION;
+ return;
+ }
+
p = get_pipe (insn);
if ((CALL_P (insn) || JUMP_P (insn)) && SCHED_ON_EVEN_P (insn))
new_insn = emit_insn_after (gen_lnop (), insn);
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index 4ed0e40b05f..a074f651351 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -2508,14 +2508,18 @@
(set_attr "cc" "none_0hit")
(set_attr "type" "fpu")])
+;; Note: The FPU-2.0 (ie pre e3v5) versions of these routines do not actually
+;; need operand 4 to be the same as operand 0. But the FPU-2.0 versions are
+;; also deprecated so the loss of flexibility is unimportant.
+
;;; multiply-add
(define_insn "fmasf4"
[(set (match_operand:SF 0 "register_operand" "=r")
(fma:SF (match_operand:SF 1 "register_operand" "r")
(match_operand:SF 2 "register_operand" "r")
- (match_operand:SF 3 "register_operand" "r")))]
+ (match_operand:SF 3 "register_operand" "0")))]
"TARGET_USE_FPU"
- "maddf.s %2,%1,%3,%0"
+ { return TARGET_V850E3V5_UP ? "fmaf.s %1, %2, %0" : "maddf.s %2, %1, %3, %0"; }
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")
(set_attr "type" "fpu")])
@@ -2525,9 +2529,9 @@
[(set (match_operand:SF 0 "register_operand" "=r")
(fma:SF (match_operand:SF 1 "register_operand" "r")
(match_operand:SF 2 "register_operand" "r")
- (neg:SF (match_operand:SF 3 "register_operand" "r"))))]
+ (neg:SF (match_operand:SF 3 "register_operand" "0"))))]
"TARGET_USE_FPU"
- "msubf.s %2,%1,%3,%0"
+ { return TARGET_V850E3V5_UP ? "fmsf.s %1, %2, %0" : "msubf.s %2, %1, %3, %0"; }
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")
(set_attr "type" "fpu")])
@@ -2537,21 +2541,21 @@
[(set (match_operand:SF 0 "register_operand" "=r")
(neg:SF (fma:SF (match_operand:SF 1 "register_operand" "r")
(match_operand:SF 2 "register_operand" "r")
- (match_operand:SF 3 "register_operand" "r"))))]
+ (match_operand:SF 3 "register_operand" "0"))))]
"TARGET_USE_FPU"
- "nmaddf.s %2,%1,%3,%0"
+ { return TARGET_V850E3V5_UP ? "fnmaf.s %1, %2, %0" : "nmaddf.s %2, %1, %3, %0"; }
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")
(set_attr "type" "fpu")])
;; negative-multiply-subtract
(define_insn "fnmssf4"
- [(set (match_operand:SF 0 "register_operand" "=r")
+ [(set (match_operand:SF 0 "register_operand" "=r")
(neg:SF (fma:SF (match_operand:SF 1 "register_operand" "r")
(match_operand:SF 2 "register_operand" "r")
- (neg:SF (match_operand:SF 3 "register_operand" "r")))))]
+ (neg:SF (match_operand:SF 3 "register_operand" "0")))))]
"TARGET_USE_FPU"
- "nmsubf.s %2,%1,%3,%0"
+ { return TARGET_V850E3V5_UP ? "fnmsf.s %1, %2, %0" : "nmsubf.s %2, %1, %3, %0"; }
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")
(set_attr "type" "fpu")])
diff --git a/gcc/configure b/gcc/configure
index b8389066859..a33da7a73f8 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -17830,7 +17830,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17831 "configure"
+#line 17833 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17936,7 +17936,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17937 "configure"
+#line 17939 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -26557,6 +26557,8 @@ if test "${gcc_cv_ld_as_needed+set}" = set; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_ld_as_needed=no
+gcc_cv_ld_as_needed_option='--as-needed'
+gcc_cv_ld_no_as_needed_option='--no-as-needed'
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
&& test $in_tree_ld_is_elf = yes; then
@@ -26566,6 +26568,15 @@ elif test x$gcc_cv_ld != x; then
# Check if linker supports --as-needed and --no-as-needed options
if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then
gcc_cv_ld_as_needed=yes
+ else
+ case "$target" in
+ # Solaris 2 ld always supports -z ignore/-z record.
+ *-*-solaris2*)
+ gcc_cv_ld_as_needed=yes
+ gcc_cv_ld_as_needed_option="-z ignore"
+ gcc_cv_ld_no_as_needed_option="-z record"
+ ;;
+ esac
fi
fi
@@ -26576,6 +26587,16 @@ if test x"$gcc_cv_ld_as_needed" = xyes; then
$as_echo "#define HAVE_LD_AS_NEEDED 1" >>confdefs.h
+
+cat >>confdefs.h <<_ACEOF
+#define LD_AS_NEEDED_OPTION "$gcc_cv_ld_as_needed_option"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define LD_NO_AS_NEEDED_OPTION "$gcc_cv_ld_no_as_needed_option"
+_ACEOF
+
fi
case "$target:$tm_file" in
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 068c66ae9a3..1d5175b9f7e 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4538,6 +4538,8 @@ AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug)
AC_CACHE_CHECK(linker --as-needed support,
gcc_cv_ld_as_needed,
[gcc_cv_ld_as_needed=no
+gcc_cv_ld_as_needed_option='--as-needed'
+gcc_cv_ld_no_as_needed_option='--no-as-needed'
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
&& test $in_tree_ld_is_elf = yes; then
@@ -4547,12 +4549,25 @@ elif test x$gcc_cv_ld != x; then
# Check if linker supports --as-needed and --no-as-needed options
if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then
gcc_cv_ld_as_needed=yes
+ else
+ case "$target" in
+ # Solaris 2 ld always supports -z ignore/-z record.
+ *-*-solaris2*)
+ gcc_cv_ld_as_needed=yes
+ gcc_cv_ld_as_needed_option="-z ignore"
+ gcc_cv_ld_no_as_needed_option="-z record"
+ ;;
+ esac
fi
fi
])
if test x"$gcc_cv_ld_as_needed" = xyes; then
AC_DEFINE(HAVE_LD_AS_NEEDED, 1,
-[Define if your linker supports --as-needed and --no-as-needed options.])
+[Define if your linker supports --as-needed/--no-as-needed or equivalent options.])
+ AC_DEFINE_UNQUOTED(LD_AS_NEEDED_OPTION, "$gcc_cv_ld_as_needed_option",
+[Define to the linker option to ignore unused dependencies.])
+ AC_DEFINE_UNQUOTED(LD_NO_AS_NEEDED_OPTION, "$gcc_cv_ld_no_as_needed_option",
+[Define to the linker option to keep unused dependencies.])
fi
case "$target:$tm_file" in
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f96c2643059..b7df0d56782 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,250 @@
+2013-04-15 Jason Merrill <jason@redhat.com>
+
+ * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
+
+ PR c++/52748
+ * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
+ rather than a destructor name, it isn't an unqualified-name.
+ (tsubst_copy_and_build): Pass down decltype_flag to operator
+ handling code, too.
+
+ PR c++/56388
+ * semantics.c (insert_capture_proxy): Just use index 1 in the
+ stmt_list_stack.
+
+2013-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ * error.c (cp_print_error_function,
+ print_instantiation_partial_context_line,
+ maybe_print_constexpr_context): Colorize locus strings.
+
+2013-04-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/52748
+ * parser.c (complain_flags): New.
+ (cp_parser_postfix_expression): Use it.
+ (cp_parser_unary_expression): Likewise.
+ (cp_parser_binary_expression): Likewise.
+ (cp_parser_assignment_expression): Likewise.
+ (cp_parser_expression): Likewise.
+ (cp_parser_postfix_open_square_expression): Take decltype_p.
+ (cp_parser_builtin_offsetof): Adjust.
+ (cp_convert_range_for): Pass complain to finish_unary_op_expr.
+ * decl2.c (grok_array_decl): Add decltype_p parm.
+ * cp-tree.h: Adjust prototype.
+ * semantics.c (finish_unary_op_expr): Add complain parm.
+
+2013-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56895
+ * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
+ calling maybe_constant_value for C++98.
+
+2013-04-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/56901
+ * semantics.c (lambda_capture_field_type, lambda_proxy_type):
+ Strip references before checking WILDCARD_TYPE_P.
+
+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * call.c (build_conditional_expr_1, build_over_call): Protect
+ error calls with complain & tf_error.
+ * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
+ build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
+ build_ptrmemfunc): Likewise.
+ (lookup_destructor): Take tsubst_flags_t parameter, adjust.
+
+ * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
+ (convert_to_reference): Adjust.
+
+2013-04-11 Jason Merrill <jason@redhat.com>
+
+ * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
+ local variables, look them up instead.
+ (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
+ proxies and substitution in unevaluated context.
+ (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
+ before the iterators.
+
+ PR c++/23055
+ * pt.c (uses_deducible_template_parms): New.
+ (deducible_array_bound, deducible_expression): New.
+ (deducible_template_args): New.
+ (unify_one_argument): Call uses_deducible_template_parms.
+
+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56913
+ * typeck2.c (build_m_component_ref): Protect error calls with
+ (complain & tf_error).
+
+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/54216
+ * parser.c (cp_parser_enum_specifier): Check for empty
+ anonymous enums and anonymous scoped enums.
+
+2013-04-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56895
+ * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
+ first before calling maybe_constant_value for warn_for_div_by_zero
+ or invalid shift count warning purposes.
+
+2013-04-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/25466
+ * rtti.c (build_typeid): Check the address of the argument
+ rather than looking for an INDIRECT_REF.
+
+2013-04-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/56838
+ PR c++/17232
+ * typeck2.c (abstract_virtuals_error_sfinae): Disable
+ complete_type again.
+
+2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56871
+ * decl.c (validate_constexpr_redeclaration): Allow an explicit
+ specialization to be different wrt the constexpr specifier.
+
+2013-04-06 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
+ noreturn attribute.
+
+2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
+ cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
+
+2013-04-03 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
+ (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
+ (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
+
+ * mangle.c (write_type): When writing a function type with
+ function-cv-quals, don't add the unqualified type as a
+ substitution candidate.
+
+2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56815
+ * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
+ pedwarn.
+
+2013-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/56819
+ * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
+ from args to new_args.
+ (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
+ r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
+
+2013-04-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/56821
+ * mangle.c (write_function_type): Mangle ref-qualifier.
+ (write_nested_name): Likewise.
+ (canonicalize_for_substitution): Preserve ref-qualifier.
+ (write_type): Likewise.
+
+ PR c++/34949
+ * decl.c (begin_destructor_body): Clobber the object in a cleanup.
+
+2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
+ * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
+ (for_each_template_parm_r): Use TYPE_TI_ARGS.
+
+2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * cp-tree.h (TAGGED_TYPE_P): Remove.
+ (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
+ (TYPE_ANONYMOUS_P): Adjust.
+ * call.c (build_new_op_1): Likewise.
+ * class.c (find_abi_tags_r): Likewise.
+ * decl.c (warn_misplaced_attr_for_class_type, start_decl,
+ type_is_deprecated): Likewise.
+ * decl2.c (grokfield, min_vis_r): Likewise.
+ * pt.c (get_template_info): Likewise.
+ * tree.c (handle_abi_tag_attribute): Likewise.
+
+2013-04-01 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (maybe_constant_value): Check
+ instantiation_dependent_expression_p.
+ * pt.c (build_non_dependent_expr): Don't check it here.
+
+ PR c++/56772
+ * init.c (build_new): Don't try to process an array initializer
+ at template definition time.
+
+ PR c++/56793
+ * typeck.c (finish_class_member_access_expr): Handle enum scope.
+
+ PR c++/56794
+ * parser.c (cp_parser_range_for): Don't try to do auto deduction
+ in a template if the type of the range is incomplete.
+
+ * call.c (add_function_candidate): Take the address of 'this' here.
+ (build_over_call): And here.
+ (build_new_method_call_1, build_op_call_1): Not here.
+ (build_user_type_conversion_1): Or here.
+ (add_candidates): Adjust.
+
+ * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
+ * class.c (same_signature_p): Use type_memfn_quals.
+ * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
+ FUNCTION_OR_METHOD_TYPE_CHECK.
+ * error.c (dump_type_suffix): Add padding before cv-qualifiers.
+ * pt.c (unify): Use static_fn_type.
+
+2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
+ Jason Merrill <jason@redhat.com>
+
+ Implement N2439 (ref-qualifiers for 'this')
+ * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
+ (FUNCTION_RVALUE_QUALIFIED): New.
+ (FUNCTION_OR_METHOD_TYPE_CHECK): New.
+ (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
+ (cp_ref_qualifier): New enum.
+ (cp_declarator): Add ref_qualifier.
+ * parser.c (cp_parser_ref_qualifier_seq_opt): New.
+ (cp_parser_direct_declarator): Use it.
+ (make_call_declarator): Adjust.
+ (cp_parser_lambda_declarator_opt): Adjust.
+ * call.c (add_function_candidate): Handle ref-qualifier overload
+ resolution semantics.
+ (standard_conversion): Adjust.
+ * class.c (add_method, same_signature_p): Compare ref-qualifiers.
+ * decl.c (grokdeclarator): Handle ref-qualifiers.
+ (grokfndecl): Check for invalid ref-qualifiers.
+ (static_fn_type, revert_static_member_fn): Adjust.
+ * decl2.c (build_memfn_type): Handle ref-qualifiers.
+ (check_classfn): Check them.
+ (cp_reconstruct_complex_type): Retain them.
+ * error.c (dump_ref_qualifier): New.
+ (dump_type_suffix, dump_function_decl): Use it.
+ (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
+ * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
+ (unify): Retain them.
+ * tree.c (cp_check_qualified_type): New.
+ (cp_build_qualified_type_real): Keep exception spec and ref-qual.
+ (build_ref_qualified_type): New.
+ (strip_typedefs, build_exception_variant): Keep ref-qualifier.
+ (cp_build_type_attribute_variant): Keep ref-qualifier.
+ * typeck.c (merge_types): Keep ref-qualifier.
+ (structural_comptypes): Compare ref-qualifier.
+ (type_memfn_rqual): New.
+ (apply_memfn_quals): Take ref-qual argument.
+ * typeck2.c (build_m_component_ref): Check ref-qualifier.
+
2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
diff --git a/gcc/cp/ChangeLog.cilkplus b/gcc/cp/ChangeLog.cilkplus
index c3b9b8f351d..6d7d87ee6e8 100644
--- a/gcc/cp/ChangeLog.cilkplus
+++ b/gcc/cp/ChangeLog.cilkplus
@@ -1,3 +1,22 @@
+2013-04-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * cp-array-notation.c (fix_builtin_array_notation_fn): Fixed a bug of
+ switching the true and false condition in array notation reduction
+ functions.
+ (fix_unary_array_notation_exprs): Replaced appending to statement lists
+ with pushing and popping of statements along with add statement.
+
+2013-04-17 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * cp-array-notation.c (build_x_array_notation_expr): Added a check for
+ array notation length mismatch. Also added a check for CALL_EXPR.
+ (length_mismatch_in_expr_p): New function.
+ (fix_builtin_array_notation_fn): Added a check to see if max/min value
+ is available for the type. If so, set it as the starting point for
+ min and max reduction function.
+
+ * parser.c (cp_parser_array_notation): Added a new location parameter.
+
2013-04-14 Balaji V. Iyer <balaji.v.iyer@intel.com>
* Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-pragma-simd.o.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 9d89c467462..b3ce65c403c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -559,7 +559,7 @@ null_ptr_cst_p (tree t)
{
/* Core issue 903 says only literal 0 is a null pointer constant. */
if (cxx_dialect < cxx0x)
- t = maybe_constant_value (t);
+ t = maybe_constant_value (fold_non_dependent_expr_sfinae (t, tf_none));
STRIP_NOPS (t);
if (integer_zerop (t) && !TREE_OVERFLOW (t))
return true;
@@ -1280,7 +1280,10 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
static_fn_type (tofn)))
return NULL;
- from = build_memfn_type (fromfn, tbase, cp_type_quals (tbase));
+ from = build_memfn_type (fromfn,
+ tbase,
+ cp_type_quals (tbase),
+ type_memfn_rqual (tofn));
from = build_ptrmemfunc_type (build_pointer_type (from));
conv = build_conv (ck_pmem, from, conv);
conv->base_p = true;
@@ -1954,7 +1957,19 @@ add_function_candidate (struct z_candidate **candidates,
{
parmtype = cp_build_qualified_type
(ctype, cp_type_quals (TREE_TYPE (parmtype)));
- parmtype = build_pointer_type (parmtype);
+ if (FUNCTION_REF_QUALIFIED (TREE_TYPE (fn)))
+ {
+ /* If the function has a ref-qualifier, the implicit
+ object parameter has reference type. */
+ bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn));
+ parmtype = cp_build_reference_type (parmtype, rv);
+ }
+ else
+ {
+ parmtype = build_pointer_type (parmtype);
+ arg = build_this (arg);
+ argtype = lvalue_type (arg);
+ }
}
/* Core issue 899: When [copy-]initializing a temporary to be bound
@@ -3451,6 +3466,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags,
int ctorflags = flags;
first_arg = build_int_cst (build_pointer_type (totype), 0);
+ first_arg = build_fold_indirect_ref (first_arg);
/* We should never try to call the abstract or base constructor
from here. */
@@ -3492,7 +3508,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags,
}
if (conv_fns)
- first_arg = build_this (expr);
+ first_arg = expr;
for (; conv_fns; conv_fns = TREE_CHAIN (conv_fns))
{
@@ -4072,7 +4088,7 @@ build_op_call_1 (tree obj, vec<tree, va_gc> **args, enum call_context spawning,
if (fns)
{
- first_mem_arg = build_this (obj);
+ first_mem_arg = obj;
add_candidates (BASELINK_FUNCTIONS (fns),
first_mem_arg, *args, NULL_TREE,
@@ -4568,8 +4584,9 @@ build_conditional_expr_1 (tree arg1, tree arg2, tree arg3,
|| (conv2 && conv2->kind == ck_ambig)
|| (conv3 && conv3->kind == ck_ambig))
{
- error ("operands to ?: have different types %qT and %qT",
- arg2_type, arg3_type);
+ if (complain & tf_error)
+ error ("operands to ?: have different types %qT and %qT",
+ arg2_type, arg3_type);
result = error_mark_node;
}
else if (conv2 && (!conv2->bad_p || !conv3))
@@ -4751,10 +4768,11 @@ build_conditional_expr_1 (tree arg1, tree arg2, tree arg3,
/* In this case, there is always a common type. */
result_type = type_after_usual_arithmetic_conversions (arg2_type,
arg3_type);
- do_warn_double_promotion (result_type, arg2_type, arg3_type,
- "implicit conversion from %qT to %qT to "
- "match other result of conditional",
- input_location);
+ if (complain & tf_warning)
+ do_warn_double_promotion (result_type, arg2_type, arg3_type,
+ "implicit conversion from %qT to %qT to "
+ "match other result of conditional",
+ input_location);
if (TREE_CODE (arg2_type) == ENUMERAL_TYPE
&& TREE_CODE (arg3_type) == ENUMERAL_TYPE)
@@ -4936,7 +4954,7 @@ add_candidates (tree fns, tree first_arg, const vec<tree, va_gc> *args,
is considered to be a member of the class of the implicit
object argument for the purpose of defining the type of
the implicit object parameter. */
- ctype = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (first_arg)));
+ ctype = TYPE_MAIN_VARIANT (TREE_TYPE (first_arg));
}
else
{
@@ -4990,7 +5008,7 @@ add_candidates (tree fns, tree first_arg, const vec<tree, va_gc> *args,
for (ix = 1; args->iterate (ix, &arg); ++ix)
tempvec->quick_push (arg);
non_static_args = tempvec;
- first_arg = build_this ((*args)[0]);
+ first_arg = (*args)[0];
}
fn_first_arg = first_arg;
@@ -5094,8 +5112,8 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
if (code == COND_EXPR)
/* Use build_conditional_expr instead. */
gcc_unreachable ();
- else if (! IS_OVERLOAD_TYPE (TREE_TYPE (arg1))
- && (! arg2 || ! IS_OVERLOAD_TYPE (TREE_TYPE (arg2))))
+ else if (! OVERLOAD_TYPE_P (TREE_TYPE (arg1))
+ && (! arg2 || ! OVERLOAD_TYPE_P (TREE_TYPE (arg2))))
goto builtin;
if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
@@ -6731,16 +6749,18 @@ build_over_call (struct z_candidate *cand, int flags,
resolution, and must be of the proper type. */
if (DECL_CONSTRUCTOR_P (fn))
{
+ tree object_arg;
if (first_arg != NULL_TREE)
{
- argarray[j++] = first_arg;
+ object_arg = first_arg;
first_arg = NULL_TREE;
}
else
{
- argarray[j++] = (*args)[arg_index];
+ object_arg = (*args)[arg_index];
++arg_index;
}
+ argarray[j++] = build_this (object_arg);
parm = TREE_CHAIN (parm);
/* We should never try to call the abstract constructor. */
gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (fn));
@@ -6756,9 +6776,9 @@ build_over_call (struct z_candidate *cand, int flags,
else if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
{
tree parmtype = TREE_VALUE (parm);
- tree arg = (first_arg != NULL_TREE
- ? first_arg
- : (*args)[arg_index]);
+ tree arg = build_this (first_arg != NULL_TREE
+ ? first_arg
+ : (*args)[arg_index]);
tree argtype = TREE_TYPE (arg);
tree converted_arg;
tree base_binfo;
@@ -6794,9 +6814,14 @@ build_over_call (struct z_candidate *cand, int flags,
/* Check that the base class is accessible. */
if (!accessible_base_p (TREE_TYPE (argtype),
BINFO_TYPE (cand->conversion_path), true))
- error ("%qT is not an accessible base of %qT",
- BINFO_TYPE (cand->conversion_path),
- TREE_TYPE (argtype));
+ {
+ if (complain & tf_error)
+ error ("%qT is not an accessible base of %qT",
+ BINFO_TYPE (cand->conversion_path),
+ TREE_TYPE (argtype));
+ else
+ return error_mark_node;
+ }
/* If fn was found by a using declaration, the conversion path
will be to the derived class, not the base declaring fn. We
must convert from derived to base. */
@@ -7429,7 +7454,6 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
tree access_binfo;
tree optype;
tree first_mem_arg = NULL_TREE;
- tree instance_ptr;
tree name;
bool skip_first_for_error;
vec<tree, va_gc> *user_args;
@@ -7537,22 +7561,27 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
return error_mark_node;
}
- instance_ptr = build_this (instance);
+ /* Consider the object argument to be used even if we end up selecting a
+ static member function. */
+ instance = mark_type_use (instance);
/* It's OK to call destructors and constructors on cv-qualified objects.
- Therefore, convert the INSTANCE_PTR to the unqualified type, if
+ Therefore, convert the INSTANCE to the unqualified type, if
necessary. */
if (DECL_DESTRUCTOR_P (fn)
|| DECL_CONSTRUCTOR_P (fn))
{
- tree type = build_pointer_type (basetype);
- if (!same_type_p (type, TREE_TYPE (instance_ptr)))
- instance_ptr = build_nop (type, instance_ptr);
+ if (!same_type_p (basetype, TREE_TYPE (instance)))
+ {
+ instance = build_this (instance);
+ instance = build_nop (build_pointer_type (basetype), instance);
+ instance = build_fold_indirect_ref (instance);
+ }
}
if (DECL_DESTRUCTOR_P (fn))
name = complete_dtor_identifier;
- first_mem_arg = instance_ptr;
+ first_mem_arg = instance;
/* Get the high-water mark for the CONVERSION_OBSTACK. */
p = conversion_obstack_alloc (0);
@@ -7588,11 +7617,10 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
if (init)
{
- tree ob;
- if (integer_zerop (instance_ptr))
+ if (TREE_CODE (instance) == INDIRECT_REF
+ && integer_zerop (TREE_OPERAND (instance, 0)))
return get_target_expr_sfinae (init, complain);
- ob = build_fold_indirect_ref (instance_ptr);
- init = build2 (INIT_EXPR, TREE_TYPE (ob), ob, init);
+ init = build2 (INIT_EXPR, TREE_TYPE (instance), instance, init);
TREE_SIDE_EFFECTS (init) = true;
return init;
}
@@ -7617,11 +7645,11 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
if (complain & tf_error)
{
if (!COMPLETE_OR_OPEN_TYPE_P (basetype))
- cxx_incomplete_type_error (instance_ptr, basetype);
+ cxx_incomplete_type_error (instance, basetype);
else if (optype)
error ("no matching function for call to %<%T::operator %T(%A)%#V%>",
basetype, optype, build_tree_list_vec (user_args),
- TREE_TYPE (TREE_TYPE (instance_ptr)));
+ TREE_TYPE (instance));
else
{
char *pretty_name;
@@ -7634,7 +7662,7 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
arglist = TREE_CHAIN (arglist);
error ("no matching function for call to %<%T::%s(%A)%#V%>",
basetype, pretty_name, arglist,
- TREE_TYPE (TREE_TYPE (instance_ptr)));
+ TREE_TYPE (instance));
if (free_p)
free (pretty_name);
}
@@ -7684,7 +7712,7 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
fn);
if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE
- && is_dummy_object (instance_ptr))
+ && is_dummy_object (instance))
{
instance = maybe_resolve_dummy (instance);
if (instance == error_mark_node)
@@ -7693,8 +7721,7 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
{
/* We captured 'this' in the current lambda now that
we know we really need it. */
- instance_ptr = build_this (instance);
- cand->first_arg = instance_ptr;
+ cand->first_arg = instance;
}
else
{
@@ -7729,10 +7756,10 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
out to be a static member function, `a' is
none-the-less evaluated. */
if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
- && !is_dummy_object (instance_ptr)
- && TREE_SIDE_EFFECTS (instance_ptr))
+ && !is_dummy_object (instance)
+ && TREE_SIDE_EFFECTS (instance))
call = build2 (COMPOUND_EXPR, TREE_TYPE (call),
- instance_ptr, call);
+ instance, call);
else if (call != error_mark_node
&& DECL_DESTRUCTOR_P (cand->fn)
&& !VOID_TYPE_P (TREE_TYPE (call)))
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index cea8a512cd3..58248bf0a1e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1045,6 +1045,12 @@ add_method (tree type, tree method, tree using_decl)
overloaded if any of them is a static member
function declaration.
+ [over.load] Member function declarations with the same name and
+ the same parameter-type-list as well as member function template
+ declarations with the same name, the same parameter-type-list, and
+ the same template parameter lists cannot be overloaded if any of
+ them, but not all, have a ref-qualifier.
+
[namespace.udecl] When a using-declaration brings names
from a base class into a derived class scope, member
functions in the derived class override and/or hide member
@@ -1060,11 +1066,13 @@ add_method (tree type, tree method, tree using_decl)
coming from the using class in overload resolution. */
if (! DECL_STATIC_FUNCTION_P (fn)
&& ! DECL_STATIC_FUNCTION_P (method)
- && TREE_TYPE (TREE_VALUE (parms1)) != error_mark_node
- && TREE_TYPE (TREE_VALUE (parms2)) != error_mark_node
- && (cp_type_quals (TREE_TYPE (TREE_VALUE (parms1)))
- != cp_type_quals (TREE_TYPE (TREE_VALUE (parms2)))))
- continue;
+ /* Either both or neither need to be ref-qualified for
+ differing quals to allow overloading. */
+ && (FUNCTION_REF_QUALIFIED (fn_type)
+ == FUNCTION_REF_QUALIFIED (method_type))
+ && (type_memfn_quals (fn_type) != type_memfn_quals (method_type)
+ || type_memfn_rqual (fn_type) != type_memfn_rqual (method_type)))
+ continue;
/* For templates, the return type and template parameters
must be identical. */
@@ -1311,7 +1319,7 @@ struct abi_tag_data
static tree
find_abi_tags_r (tree *tp, int */*walk_subtrees*/, void *data)
{
- if (!TAGGED_TYPE_P (*tp))
+ if (!OVERLOAD_TYPE_P (*tp))
return NULL_TREE;
if (tree attributes = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (*tp)))
@@ -2058,12 +2066,12 @@ same_signature_p (const_tree fndecl, const_tree base_fndecl)
&& same_type_p (DECL_CONV_FN_TYPE (fndecl),
DECL_CONV_FN_TYPE (base_fndecl))))
{
- tree types, base_types;
- types = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
- base_types = TYPE_ARG_TYPES (TREE_TYPE (base_fndecl));
- if ((cp_type_quals (TREE_TYPE (TREE_VALUE (base_types)))
- == cp_type_quals (TREE_TYPE (TREE_VALUE (types))))
- && compparms (TREE_CHAIN (base_types), TREE_CHAIN (types)))
+ tree fntype = TREE_TYPE (fndecl);
+ tree base_fntype = TREE_TYPE (base_fndecl);
+ if (type_memfn_quals (fntype) == type_memfn_quals (base_fntype)
+ && type_memfn_rqual (fntype) == type_memfn_rqual (base_fntype)
+ && compparms (FUNCTION_FIRST_USER_PARMTYPE (fndecl),
+ FUNCTION_FIRST_USER_PARMTYPE (base_fndecl)))
return 1;
}
return 0;
diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c
index d25c3a60bf3..437a3f6ef30 100644
--- a/gcc/cp/cp-array-notation.c
+++ b/gcc/cp/cp-array-notation.c
@@ -55,6 +55,52 @@ struct inv_list
int array_notation_label_no;
+/* Returns false if there is a length mismatch among expressions
+ on the same dimension AND the same side of the equal sign. The exprs are
+ passed in through 2-D array **LIST where X and Y indicate first and
+ second dimension sizes of LIST, respectively. */
+static bool
+length_mismatch_in_expr_p (location_t loc, tree **list, size_t x, size_t y)
+{
+ size_t ii, jj;
+ tree start = NULL_TREE;
+ HOST_WIDE_INT l_start, l_node;
+ for (jj = 0; jj < y; jj++)
+ {
+ start = NULL_TREE;
+ for (ii = 0; ii < x; ii++)
+ {
+ if (!start)
+ start = list[ii][jj];
+ else if (TREE_CODE (start) == INTEGER_CST)
+ {
+ /* If start is a INTEGER, and list[ii][jj] is an integer then
+ check if they are equal. If they are not equal then return
+ true. */
+ if (TREE_CODE (list[ii][jj]) == INTEGER_CST)
+ {
+ l_node = int_cst_value (list[ii][jj]);
+ l_start = int_cst_value (start);
+ if (abs (l_start) != abs (l_node))
+ {
+ if (!loc && EXPR_HAS_LOCATION (start))
+ loc = EXPR_LOCATION (start);
+ if (!loc && EXPR_HAS_LOCATION (list[ii][jj]))
+ loc = EXPR_LOCATION (list[ii][jj]);
+ error_at (loc, "length mismatch in expression");
+ return true;
+ }
+ }
+ }
+ else
+ /* We set the start node as the current node just in case it turns
+ out to be an integer. */
+ start = list[ii][jj];
+ }
+ }
+ return false;
+}
+
/* Returns the rank of ARRAY through the *RANK. The user can specify whether
(s)he wants to step into array_notation-specific builtin functions
(specified by the IGNORE_BUILTIN_FN).
@@ -437,6 +483,8 @@ build_x_array_notation_expr (location_t location, tree lhs,
char label_name[50];
int s_jj = 0;
+ if (!location && EXPR_HAS_LOCATION (lhs))
+ location = EXPR_LOCATION (lhs);
/* In the first part, we try to break up the builtin functions for array
notations. */
find_rank (rhs, false, &rhs_rank);
@@ -517,7 +565,7 @@ build_x_array_notation_expr (location_t location, tree lhs,
{
new_modify_expr = build_x_modify_expr (location, lhs,
modifycode, rhs, complain);
- add_stmt (finish_expr_stmt (new_modify_expr));
+ finish_expr_stmt (new_modify_expr);
pop_stmt_list (loop);
return loop;
}
@@ -705,6 +753,8 @@ build_x_array_notation_expr (location_t location, tree lhs,
else if (TREE_CODE (ii_tree) == VAR_DECL
|| TREE_CODE (ii_tree) == PARM_DECL)
break;
+ else if (TREE_CODE (ii_tree) == CALL_EXPR)
+ break;
}
}
}
@@ -778,6 +828,30 @@ build_x_array_notation_expr (location_t location, tree lhs,
else
rhs_vector[ii][0] = false;
}
+ if (length_mismatch_in_expr_p (location ? location : EXPR_LOCATION (lhs),
+ lhs_length, lhs_list_size, lhs_rank)
+ || length_mismatch_in_expr_p (location ? location : EXPR_LOCATION (rhs),
+ rhs_length, rhs_list_size, rhs_rank))
+ {
+ pop_stmt_list (loop);
+ return error_mark_node;
+ }
+ if (lhs_list_size > 0 && rhs_list_size > 0)
+ if (TREE_CODE (lhs_length[0][0]) == INTEGER_CST
+ && TREE_CODE (rhs_length[0][0]) == INTEGER_CST)
+ {
+ HOST_WIDE_INT l_length = int_cst_value (lhs_length[0][0]);
+ HOST_WIDE_INT r_length = int_cst_value (rhs_length[0][0]);
+ /* The length can be negative or positive. As long as the
+ magnitude is OK, then the array notation is valid. */
+ if (abs (l_length) != abs (r_length))
+ {
+ error_at (location, "length mismatch between LHS and RHS");
+ pop_stmt_list (loop);
+ return error_mark_node;
+ }
+ }
+
for (ii = 0; ii < lhs_rank; ii++)
if (lhs_start[0][ii] && TREE_TYPE (lhs_start[0][ii]))
lhs_var[ii] = build_decl (location, VAR_DECL, NULL_TREE,
@@ -956,7 +1030,8 @@ build_x_array_notation_expr (location_t location, tree lhs,
base_var = ARRAY_NOTATION_ARRAY (lhs_array[ii][s_jj]);
if (TREE_CODE (base_var) == ARRAY_REF)
lhs_array_opr = grok_array_decl
- (location, lhs_array_opr, TREE_OPERAND (base_var, 1));
+ (location, lhs_array_opr, TREE_OPERAND (base_var, 1),
+ false);
if (lhs_count_down[ii][s_jj])
/* Array[start_index - (induction_var * stride)] */
@@ -964,14 +1039,14 @@ build_x_array_notation_expr (location_t location, tree lhs,
(location, lhs_array_opr,
build2 (MINUS_EXPR, TREE_TYPE (var), start,
build2 (MULT_EXPR, TREE_TYPE (var), var,
- stride)));
+ stride)), false);
else
/* Array[start_index + (induction_var * stride)] */
lhs_array_opr = grok_array_decl
(location, lhs_array_opr,
build2 (PLUS_EXPR, TREE_TYPE (var), start,
build2 (MULT_EXPR, TREE_TYPE (var), var,
- stride)));
+ stride)), false);
}
vec_safe_push (lhs_array_operand, lhs_array_opr);
}
@@ -1038,7 +1113,8 @@ build_x_array_notation_expr (location_t location, tree lhs,
base_var = ARRAY_NOTATION_ARRAY (rhs_array[ii][s_jj]);
if (TREE_CODE (base_var) == ARRAY_REF)
rhs_array_opr = grok_array_decl
- (location, rhs_array_opr, TREE_OPERAND (base_var, 1));
+ (location, rhs_array_opr, TREE_OPERAND (base_var, 1),
+ false);
if (rhs_count_down[ii][s_jj])
/* Array[start_index - (induction_var * stride)] */
@@ -1046,14 +1122,14 @@ build_x_array_notation_expr (location_t location, tree lhs,
(location, rhs_array_opr,
build2 (MINUS_EXPR, TREE_TYPE (var), start,
build2 (MULT_EXPR, TREE_TYPE (var), var,
- stride)));
+ stride)), false);
else
/* Array[start_index + (induction_var * stride)] */
rhs_array_opr = grok_array_decl
(location, rhs_array_opr,
build2 (PLUS_EXPR, TREE_TYPE (var), start,
build2 (MULT_EXPR, TREE_TYPE (var), var,
- stride)));
+ stride)), false);
}
vec_safe_push (rhs_array_operand, rhs_array_opr);
}
@@ -1624,13 +1700,15 @@ fix_conditional_array_notations_1 (tree orig_stmt)
array_opr = grok_array_decl
(location, array_opr,
build2 (MINUS_EXPR, TREE_TYPE (var), start,
- build2 (MULT_EXPR, TREE_TYPE (var), var, stride)));
+ build2 (MULT_EXPR, TREE_TYPE (var), var, stride)),
+ false);
else
/* Array[start_index + (induction_var * stride)] */
array_opr = grok_array_decl
(location, array_opr,
build2 (PLUS_EXPR, TREE_TYPE (var), start,
- build2 (MULT_EXPR, TREE_TYPE (var), var, stride)));
+ build2 (MULT_EXPR, TREE_TYPE (var), var, stride)),
+ false);
}
vec_safe_push (array_operand, array_opr);
@@ -1803,9 +1881,9 @@ fix_array_notation_exprs (tree t)
case STATEMENT_LIST:
{
tree_stmt_iterator i;
+
for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- *tsi_stmt_ptr (i) =
- fix_array_notation_exprs (*tsi_stmt_ptr (i));
+ *tsi_stmt_ptr (i) = fix_array_notation_exprs (*tsi_stmt_ptr (i));
return t;
}
@@ -2018,12 +2096,26 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
|| TREE_CODE (func_parm) == NOP_EXPR)
func_parm = TREE_OPERAND (func_parm, 0);
- find_rank (an_builtin_fn, false, &rank);
+ find_rank (func_parm, true, &rank);
location = EXPR_LOCATION (an_builtin_fn);
if (rank == 0)
- return an_builtin_fn;
+ {
+ if (an_type == REDUCE_ADD || an_type == REDUCE_MUL
+ || an_type == REDUCE_MAX || an_type == REDUCE_MIN
+ || an_type == REDUCE_ALL_ZEROS || an_type == REDUCE_ANY_ZEROS
+ || an_type == REDUCE_ANY_NONZEROS || an_type == REDUCE_ALL_NONZEROS
+ || an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX
+ || an_type == REDUCE_CUSTOM || an_type == REDUCE_MUTATING)
+ {
+ error_at (location, "array notation builtin functions cannot have"
+ " array notation parameter with zero rank");
+ return error_mark_node;
+ }
+ else
+ return an_builtin_fn;
+ }
else if (rank > 1
&& (an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX))
{
@@ -2237,13 +2329,15 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
array_opr = grok_array_decl
(location, array_opr,
build2 (MINUS_EXPR, TREE_TYPE (var), start,
- build2 (MULT_EXPR, TREE_TYPE (var), var, stride)));
+ build2 (MULT_EXPR, TREE_TYPE (var), var, stride)),
+ false);
else
/* Array[start_index + (induction_var * stride)] */
array_opr = grok_array_decl
(location, array_opr,
build2 (PLUS_EXPR, TREE_TYPE (var), start,
- build2 (MULT_EXPR, TREE_TYPE (var), var, stride)));
+ build2 (MULT_EXPR, TREE_TYPE (var), var, stride)),
+ false);
}
vec_safe_push (array_operand, array_opr);
}
@@ -2383,10 +2477,10 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
/* Initially we assume there are NO zeros in the list. When we find a
non-zero, we keep the previous value. If we find a zero, we set the
value to true. */
- new_no_expr = build_x_modify_expr
+ new_yes_expr = build_x_modify_expr
(location, *new_var, NOP_EXPR,
build_one_cst (TREE_TYPE (*new_var)), 1);
- new_yes_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
+ new_no_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
*new_var, 1);
if (ARITHMETIC_TYPE_P (TREE_TYPE (func_parm)))
comp_node = build_zero_cst (TREE_TYPE (func_parm));
@@ -2407,10 +2501,10 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
/* Initially we assume there are NO non-zeros in the list. When we find a
zero, we keep the previous value. If we find a zero, we set the value
to true. */
- new_no_expr = build_x_modify_expr
+ new_yes_expr = build_x_modify_expr
(location, *new_var, NOP_EXPR,
build_one_cst (TREE_TYPE (*new_var)), 1);
- new_yes_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
+ new_no_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
*new_var, 1);
if (ARITHMETIC_TYPE_P (TREE_TYPE (func_parm)))
comp_node = build_zero_cst (TREE_TYPE (func_parm));
@@ -2425,9 +2519,16 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
}
else if (an_type == REDUCE_MAX)
{
- /* Set initial value as the first element in the list. */
- new_var_init = build_x_modify_expr (location, *new_var, NOP_EXPR,
- func_parm, 1);
+ if (TYPE_MIN_VALUE (TREE_TYPE (*new_var)))
+ new_var_init =
+ build_x_modify_expr (location, *new_var, NOP_EXPR,
+ TYPE_MIN_VALUE (TREE_TYPE (*new_var)), 1);
+ else
+ /* Set initial value as the first element in the list if a MIN Value is
+ not defined. */
+ new_var_init = build_x_modify_expr (location, *new_var, NOP_EXPR,
+ func_parm, 1);
+
new_no_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
*new_var, 1);
new_yes_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
@@ -2442,8 +2543,15 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
}
else if (an_type == REDUCE_MIN)
{
- new_var_init = build_x_modify_expr (location, *new_var, NOP_EXPR,
- func_parm, 1);
+ if (TYPE_MAX_VALUE (TREE_TYPE (*new_var)))
+ new_var_init =
+ build_x_modify_expr (location, *new_var, NOP_EXPR,
+ TYPE_MAX_VALUE (TREE_TYPE (*new_var)), 1);
+ else
+ /* Set initial value as the first element in the list if a MIN Value is
+ not defined. */
+ new_var_init = build_x_modify_expr (location, *new_var, NOP_EXPR,
+ func_parm, 1);
new_no_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
*new_var, 1);
new_yes_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
@@ -2642,11 +2750,25 @@ fix_unary_array_notation_exprs (tree orig_stmt)
bool **count_down, **array_vector;
tree builtin_loop, stmt = NULL_TREE, new_var = NULL_TREE;
char label_name[50];
+ array_notation_reduce_type dummy;
location_t location = UNKNOWN_LOCATION;
find_rank (orig_stmt, false, &rank);
if (rank == 0)
- return orig_stmt;
+ {
+ if (TREE_CODE (orig_stmt) == CALL_EXPR
+ && is_builtin_array_notation_fn (CALL_EXPR_FN (orig_stmt), &dummy))
+ {
+ /* If we are here, it is almost 100% that there is an error. We
+ let the function to handle array notation function to emit the
+ error. */
+ builtin_loop = fix_builtin_array_notation_fn (orig_stmt, &new_var);
+ if (builtin_loop == error_mark_node)
+ return builtin_loop;
+ }
+ else
+ return orig_stmt;
+ }
extract_array_notation_exprs (orig_stmt, false, &array_list);
list_size = vec_safe_length (array_list);
@@ -2665,8 +2787,8 @@ fix_unary_array_notation_exprs (tree orig_stmt)
else if (builtin_loop)
{
vec<tree, va_gc> *sub_list = NULL, *new_var_list = NULL;
- stmt = alloc_stmt_list ();
- append_to_statement_list_force (builtin_loop, &stmt);
+ stmt = push_stmt_list ();
+ add_stmt (builtin_loop);
vec_safe_push (sub_list, list_node);
vec_safe_push (new_var_list, new_var);
replace_array_notations (&orig_stmt, false, sub_list,
@@ -2675,7 +2797,10 @@ fix_unary_array_notation_exprs (tree orig_stmt)
}
}
if (stmt != NULL_TREE)
- append_to_statement_list_force (finish_expr_stmt (orig_stmt), &stmt);
+ {
+ finish_expr_stmt (orig_stmt);
+ stmt = pop_stmt_list (stmt);
+ }
else
stmt = orig_stmt;
rank = 0;
@@ -2869,13 +2994,15 @@ fix_unary_array_notation_exprs (tree orig_stmt)
array_opr = grok_array_decl
(location, array_opr,
build2 (MINUS_EXPR, TREE_TYPE (var), start,
- build2 (MULT_EXPR, TREE_TYPE (var), var, stride)));
+ build2 (MULT_EXPR, TREE_TYPE (var), var, stride)),
+ false);
else
/* Array[start_index + (induction_var * stride)] */
array_opr = grok_array_decl
(location, array_opr,
build2 (PLUS_EXPR, TREE_TYPE (var), start,
- build2 (MULT_EXPR, TREE_TYPE (var), var, stride)));
+ build2 (MULT_EXPR, TREE_TYPE (var), var, stride)),
+ false);
}
vec_safe_push (array_operand, array_opr);
}
diff --git a/gcc/cp/cp-cilk.c b/gcc/cp/cp-cilk.c
index ea04b7e3ae5..1710b8b1c41 100644
--- a/gcc/cp/cp-cilk.c
+++ b/gcc/cp/cp-cilk.c
@@ -879,7 +879,6 @@ cp_make_cilk_frame (tree compstmt)
tree *saved_tree = &DECL_SAVED_TREE (current_function_decl);
decl = make_cilk_frame (current_function_decl);
-
push_local_binding (DECL_NAME (decl), decl, 0);
cp_finish_decl (decl, NULL_TREE, false, NULL_TREE, 0);
diff --git a/gcc/cp/cp-pragma-simd.c b/gcc/cp/cp-pragma-simd.c
index ce13d24bcab..347d6a5dc7a 100755
--- a/gcc/cp/cp-pragma-simd.c
+++ b/gcc/cp/cp-pragma-simd.c
@@ -44,7 +44,7 @@ find_invalid_stmts (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
else if (TREE_CODE (*tp) == GOTO_EXPR)
{
- error_at (loc, "goto statments are not allowed inside "
+ error_at (loc, "goto statements are not allowed inside "
"loops marked with #pragma simd");
*valid = false;
*walk_subtrees = 0;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 4024f1b2e12..8712f670c75 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -107,8 +107,10 @@ c-common.h, not after.
or FIELD_DECL).
IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
DECL_TINFO_P (in VAR_DECL)
+ FUNCTION_REF_QUALIFIED (in FUNCTION_TYPE, METHOD_TYPE)
5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
DECL_VTABLE_OR_VTT_P (in VAR_DECL)
+ FUNCTION_RVALUE_QUALIFIED (in FUNCTION_TYPE, METHOD_TYPE)
6: IDENTIFIER_REPO_CHOSEN (in IDENTIFIER_NODE)
DECL_CONSTRUCTION_VTABLE_P (in VAR_DECL)
TYPE_MARKED_P (in _TYPE)
@@ -433,9 +435,11 @@ typedef enum cpp0x_warn_str
/* inheriting constructors */
CPP0X_INHERITING_CTORS,
/* C++11 attributes */
- CPP0X_ATTRIBUTES
+ CPP0X_ATTRIBUTES,
+ /* ref-qualified member functions */
+ CPP0X_REF_QUALIFIER
} cpp0x_warn_str;
-
+
/* The various kinds of operation used by composite_pointer_type. */
typedef enum composite_pointer_operation
@@ -1230,7 +1234,7 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* Nonzero if NODE has no name for linkage purposes. */
#define TYPE_ANONYMOUS_P(NODE) \
- (TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
+ (OVERLOAD_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
/* The _DECL for this _TYPE. */
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
@@ -1267,9 +1271,8 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* Keep these checks in ascending code order. */
#define RECORD_OR_UNION_CODE_P(T) \
((T) == RECORD_TYPE || (T) == UNION_TYPE)
-#define TAGGED_TYPE_P(T) \
+#define OVERLOAD_TYPE_P(T) \
(CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
-#define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
/* True if this a "Java" type, defined in 'extern "Java"'. */
#define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3 (NODE)
@@ -1885,7 +1888,8 @@ struct GTY((variable_size)) lang_type {
a deferred noexcept-specification, TREE_PURPOSE is a DEFERRED_NOEXCEPT
(for templates) or an OVERLOAD list of functions (for implicitly
declared functions). */
-#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_LANG_SLOT_1 (NODE)
+#define TYPE_RAISES_EXCEPTIONS(NODE) \
+ TYPE_LANG_SLOT_1 (FUNC_OR_METHOD_CHECK (NODE))
/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'
or noexcept(true). */
@@ -2531,6 +2535,14 @@ struct GTY((variable_size)) lang_decl {
/* 1 iff VAR_DECL node NODE is virtual table or VTT. */
#define DECL_VTABLE_OR_VTT_P(NODE) TREE_LANG_FLAG_5 (VAR_DECL_CHECK (NODE))
+/* 1 iff FUNCTION_TYPE or METHOD_TYPE has a ref-qualifier (either & or &&). */
+#define FUNCTION_REF_QUALIFIED(NODE) \
+ TREE_LANG_FLAG_4 (FUNC_OR_METHOD_CHECK (NODE))
+
+/* 1 iff FUNCTION_TYPE or METHOD_TYPE has &&-ref-qualifier. */
+#define FUNCTION_RVALUE_QUALIFIED(NODE) \
+ TREE_LANG_FLAG_5 (FUNC_OR_METHOD_CHECK (NODE))
+
/* Returns 1 iff VAR_DECL is a construction virtual table.
DECL_VTABLE_OR_VTT_P will be true in this case and must be checked
before using this macro. */
@@ -4730,6 +4742,23 @@ enum virt_specifier
typedef int cp_virt_specifiers;
+/* Wherever there is a function-cv-qual, there could also be a ref-qualifier:
+
+ [dcl.fct]
+ The return type, the parameter-type-list, the ref-qualifier, and
+ the cv-qualifier-seq, but not the default arguments or the exception
+ specification, are part of the function type.
+
+ REF_QUAL_NONE Ordinary member function with no ref-qualifier
+ REF_QUAL_LVALUE Member function with the &-ref-qualifier
+ REF_QUAL_RVALUE Member function with the &&-ref-qualifier */
+
+enum cp_ref_qualifier {
+ REF_QUAL_NONE = 0,
+ REF_QUAL_LVALUE = 1,
+ REF_QUAL_RVALUE = 2
+};
+
/* A storage class. */
typedef enum cp_storage_class {
@@ -4891,6 +4920,8 @@ struct cp_declarator {
cp_cv_quals qualifiers;
/* The virt-specifiers for the function. */
cp_virt_specifiers virt_specifiers;
+ /* The ref-qualifier for the function. */
+ cp_ref_qualifier ref_qualifier;
/* The exception-specification for the function. */
tree exception_specification;
/* The late-specified return type, if any. */
@@ -5248,14 +5279,15 @@ extern tree cxx_maybe_build_cleanup (tree, tsubst_flags_t);
/* in decl2.c */
extern bool check_java_method (tree);
-extern tree build_memfn_type (tree, tree, cp_cv_quals);
+extern tree build_memfn_type (tree, tree, cp_cv_quals, cp_ref_qualifier);
+extern tree build_pointer_ptrmemfn_type (tree);
extern tree change_return_type (tree, tree);
extern void maybe_retrofit_in_chrg (tree);
extern void maybe_make_one_only (tree);
extern bool vague_linkage_p (tree);
extern void grokclassfn (tree, tree,
enum overload_flags);
-extern tree grok_array_decl (location_t, tree, tree);
+extern tree grok_array_decl (location_t, tree, tree, bool);
extern tree delete_sanity (tree, tree, bool, int, tsubst_flags_t);
extern tree check_classfn (tree, tree, tree);
extern void check_member_template (tree);
@@ -5724,7 +5756,8 @@ extern tree finish_call_expr (tree, vec<tree, va_gc> **, bool,
extern tree finish_increment_expr (tree, enum tree_code);
extern tree finish_this_expr (void);
extern tree finish_pseudo_destructor_expr (tree, tree, tree);
-extern tree finish_unary_op_expr (location_t, enum tree_code, tree);
+extern tree finish_unary_op_expr (location_t, enum tree_code, tree,
+ tsubst_flags_t);
extern tree finish_compound_literal (tree, tree, tsubst_flags_t);
extern tree finish_fname (tree);
extern void finish_translation_unit (void);
@@ -5862,6 +5895,7 @@ extern void diagnose_non_constexpr_vec_init (tree);
extern tree hash_tree_cons (tree, tree, tree);
extern tree hash_tree_chain (tree, tree);
extern tree build_qualified_name (tree, tree, tree, bool);
+extern tree build_ref_qualified_type (tree, cp_ref_qualifier);
extern int is_overloaded_fn (tree);
extern tree dependent_name (tree);
extern tree get_fns (tree);
@@ -6022,7 +6056,8 @@ 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);
+extern cp_ref_qualifier type_memfn_rqual (const_tree);
+extern tree apply_memfn_quals (tree, cp_cv_quals, cp_ref_qualifier);
extern bool cp_has_mutable_p (const_tree);
extern bool at_least_as_qualified_p (const_tree, const_tree);
extern void cp_apply_type_quals_to_decl (int, tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index a411d1bd0f6..96039b3dbfa 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -40,7 +40,7 @@ static tree cp_convert_to_pointer (tree, tree, tsubst_flags_t);
static tree convert_to_pointer_force (tree, tree, tsubst_flags_t);
static tree build_type_conversion (tree, tree);
static tree build_up_reference (tree, tree, int, tree, tsubst_flags_t);
-static void warn_ref_binding (location_t, tree, tree, tree);
+static void diagnose_ref_binding (location_t, tree, tree, tree);
/* Change of width--truncation and extension of integers or reals--
is represented with NOP_EXPR. Proper functioning of many things
@@ -371,7 +371,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl,
non-volatile const type. */
static void
-warn_ref_binding (location_t loc, tree reftype, tree intype, tree decl)
+diagnose_ref_binding (location_t loc, tree reftype, tree intype, tree decl)
{
tree ttl = TREE_TYPE (reftype);
@@ -456,9 +456,9 @@ convert_to_reference (tree reftype, tree expr, int convtype,
tree ttl = TREE_TYPE (reftype);
tree ttr = lvalue_type (expr);
- if ((complain & tf_warning)
+ if ((complain & tf_error)
&& ! real_lvalue_p (expr))
- warn_ref_binding (loc, reftype, intype, decl);
+ diagnose_ref_binding (loc, reftype, intype, decl);
if (! (convtype & CONV_CONST)
&& !at_least_as_qualified_p (ttl, ttr))
@@ -502,8 +502,8 @@ convert_to_reference (tree reftype, tree expr, int convtype,
ICR_CONVERTING, 0, 0, complain);
if (rval == NULL_TREE || rval == error_mark_node)
return rval;
- if (complain & tf_warning)
- warn_ref_binding (loc, reftype, intype, decl);
+ if (complain & tf_error)
+ diagnose_ref_binding (loc, reftype, intype, decl);
rval = build_up_reference (reftype, rval, flags, decl, complain);
}
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
index f1ab0e6ec78..0f7dc4a8174 100644
--- a/gcc/cp/cxx-pretty-print.h
+++ b/gcc/cp/cxx-pretty-print.h
@@ -42,6 +42,8 @@ typedef struct
#define pp_cxx_cv_qualifier_seq(PP, T) \
pp_c_type_qualifier_list (pp_c_base (PP), T)
+#define pp_cxx_cv_qualifiers(PP, CV) \
+ pp_c_cv_qualifiers (pp_c_base (PP), CV, false)
#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP))
#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP))
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index add0b8e5626..3953206ef93 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1203,12 +1203,21 @@ validate_constexpr_redeclaration (tree old_decl, tree new_decl)
if (DECL_DECLARED_CONSTEXPR_P (old_decl)
== DECL_DECLARED_CONSTEXPR_P (new_decl))
return true;
- if (TREE_CODE (old_decl) == FUNCTION_DECL && DECL_BUILT_IN (old_decl))
+ if (TREE_CODE (old_decl) == FUNCTION_DECL)
{
- /* Hide a built-in declaration. */
- DECL_DECLARED_CONSTEXPR_P (old_decl)
- = DECL_DECLARED_CONSTEXPR_P (new_decl);
- return true;
+ if (DECL_BUILT_IN (old_decl))
+ {
+ /* Hide a built-in declaration. */
+ DECL_DECLARED_CONSTEXPR_P (old_decl)
+ = DECL_DECLARED_CONSTEXPR_P (new_decl);
+ return true;
+ }
+ /* 7.1.5 [dcl.constexpr]
+ Note: An explicit specialization can differ from the template
+ declaration with respect to the constexpr specifier. */
+ if (! DECL_TEMPLATE_SPECIALIZATION (old_decl)
+ && DECL_TEMPLATE_SPECIALIZATION (new_decl))
+ return true;
}
error ("redeclaration %qD differs in %<constexpr%>", new_decl);
error ("from previous declaration %q+D", old_decl);
@@ -4196,7 +4205,7 @@ void
warn_misplaced_attr_for_class_type (source_location location,
tree class_type)
{
- gcc_assert (TAGGED_TYPE_P (class_type));
+ gcc_assert (OVERLOAD_TYPE_P (class_type));
warning_at (location, OPT_Wattributes,
"attribute ignored in declaration "
@@ -4511,7 +4520,7 @@ start_decl (const cp_declarator *declarator,
/* If this is a typedef that names the class for linkage purposes
(7.1.3p8), apply any attributes directly to the type. */
if (TREE_CODE (decl) == TYPE_DECL
- && TAGGED_TYPE_P (TREE_TYPE (decl))
+ && OVERLOAD_TYPE_P (TREE_TYPE (decl))
&& decl == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (decl))))
flags = ATTR_FLAG_TYPE_IN_PLACE;
else
@@ -7335,6 +7344,7 @@ grokfndecl (tree ctype,
int virtualp,
enum overload_flags flags,
cp_cv_quals quals,
+ cp_ref_qualifier rqual,
tree raises,
int check,
int friendp,
@@ -7351,6 +7361,8 @@ grokfndecl (tree ctype,
int staticp = ctype && TREE_CODE (type) == FUNCTION_TYPE;
tree t;
+ if (rqual)
+ type = build_ref_qualified_type (type, rqual);
if (raises)
type = build_exception_variant (type, raises);
@@ -7558,13 +7570,25 @@ grokfndecl (tree ctype,
DECL_DECLARED_CONSTEXPR_P (decl) = true;
DECL_EXTERNAL (decl) = 1;
- if (quals && TREE_CODE (type) == FUNCTION_TYPE)
+ if (TREE_CODE (type) == FUNCTION_TYPE)
{
- error (ctype
- ? G_("static member function %qD cannot have cv-qualifier")
- : G_("non-member function %qD cannot have cv-qualifier"),
- decl);
- quals = TYPE_UNQUALIFIED;
+ if (quals)
+ {
+ error (ctype
+ ? G_("static member function %qD cannot have cv-qualifier")
+ : G_("non-member function %qD cannot have cv-qualifier"),
+ decl);
+ quals = TYPE_UNQUALIFIED;
+ }
+
+ if (rqual)
+ {
+ error (ctype
+ ? G_("static member function %qD cannot have ref-qualifier")
+ : G_("non-member function %qD cannot have ref-qualifier"),
+ decl);
+ rqual = REF_QUAL_NONE;
+ }
}
if (IDENTIFIER_OPNAME_P (DECL_NAME (decl))
@@ -8002,7 +8026,8 @@ build_ptrmem_type (tree class_type, tree member_type)
if (TREE_CODE (member_type) == METHOD_TYPE)
{
cp_cv_quals quals = type_memfn_quals (member_type);
- member_type = build_memfn_type (member_type, class_type, quals);
+ cp_ref_qualifier rqual = type_memfn_rqual (member_type);
+ member_type = build_memfn_type (member_type, class_type, quals, rqual);
return build_ptrmemfunc_type (build_pointer_type (member_type));
}
else
@@ -8651,6 +8676,9 @@ grokdeclarator (const cp_declarator *declarator,
/* virt-specifiers that apply to the declarator, for a declaration of
a member function. */
cp_virt_specifiers virt_specifiers = VIRT_SPEC_UNSPECIFIED;
+ /* ref-qualifier that applies to the declarator, for a declaration of
+ a member function. */
+ cp_ref_qualifier rqual = REF_QUAL_NONE;
/* cv-qualifiers that apply to the type specified by the DECLSPECS. */
int type_quals;
tree raises = NULL_TREE;
@@ -9460,6 +9488,8 @@ grokdeclarator (const cp_declarator *declarator,
memfn_quals = declarator->u.function.qualifiers;
/* Pick up virt-specifiers. */
virt_specifiers = declarator->u.function.virt_specifiers;
+ /* And ref-qualifier, too */
+ rqual = declarator->u.function.ref_qualifier;
/* Pick up the exception specifications. */
raises = declarator->u.function.exception_specification;
/* If the exception-specification is ill-formed, let's pretend
@@ -9527,12 +9557,13 @@ grokdeclarator (const cp_declarator *declarator,
therefore returns a void type. */
/* ISO C++ 12.4/2. A destructor may not be declared
- const or volatile. A destructor may not be
- static.
+ const or volatile. A destructor may not be static.
+ A destructor may not be declared with ref-qualifier.
ISO C++ 12.1. A constructor may not be declared
const or volatile. A constructor may not be
- virtual. A constructor may not be static. */
+ virtual. A constructor may not be static.
+ A constructor may not be declared with ref-qualifier. */
if (staticp == 2)
error ((flags == DTOR_FLAG)
? G_("destructor cannot be static member function")
@@ -9545,6 +9576,14 @@ grokdeclarator (const cp_declarator *declarator,
memfn_quals = TYPE_UNQUALIFIED;
}
+ if (rqual)
+ {
+ error ((flags == DTOR_FLAG)
+ ? "destructors may not be ref-qualified"
+ : "constructors may not be ref-qualified");
+ rqual = REF_QUAL_NONE;
+ }
+
if (decl_context == FIELD
&& !member_function_or_else (ctype,
current_class_type,
@@ -9666,14 +9705,18 @@ grokdeclarator (const cp_declarator *declarator,
memfn_quals |= type_memfn_quals (type);
type = build_memfn_type (type,
declarator->u.pointer.class_type,
- memfn_quals);
+ memfn_quals,
+ rqual);
if (type == error_mark_node)
return error_mark_node;
+
+ rqual = REF_QUAL_NONE;
memfn_quals = TYPE_UNQUALIFIED;
}
if (TREE_CODE (type) == FUNCTION_TYPE
- && type_memfn_quals (type) != TYPE_UNQUALIFIED)
+ && (type_memfn_quals (type) != TYPE_UNQUALIFIED
+ || type_memfn_rqual (type) != REF_QUAL_NONE))
error (declarator->kind == cdk_reference
? G_("cannot declare reference to qualified function type %qT")
: G_("cannot declare pointer to qualified function type %qT"),
@@ -10018,12 +10061,13 @@ grokdeclarator (const cp_declarator *declarator,
example "f S::*" declares a pointer to a const-qualified
member function of S. We record the cv-qualification in the
function type. */
- if (memfn_quals && TREE_CODE (type) == FUNCTION_TYPE)
+ if ((rqual || memfn_quals) && TREE_CODE (type) == FUNCTION_TYPE)
{
- type = apply_memfn_quals (type, memfn_quals);
+ type = apply_memfn_quals (type, memfn_quals, rqual);
/* We have now dealt with these qualifiers. */
memfn_quals = TYPE_UNQUALIFIED;
+ rqual = REF_QUAL_NONE;
}
if (type_uses_auto (type))
@@ -10153,8 +10197,10 @@ grokdeclarator (const cp_declarator *declarator,
if (decl_context != TYPENAME)
{
/* A cv-qualifier-seq shall only be part of the function type
- for a non-static member function. [8.3.5/4 dcl.fct] */
- if (type_memfn_quals (type) != TYPE_UNQUALIFIED
+ for a non-static member function. A ref-qualifier shall only
+ .... /same as above/ [dcl.fct] */
+ if ((type_memfn_quals (type) != TYPE_UNQUALIFIED
+ || type_memfn_rqual (type) != REF_QUAL_NONE)
&& (current_class_type == NULL_TREE || staticp) )
{
error (staticp
@@ -10168,6 +10214,7 @@ grokdeclarator (const cp_declarator *declarator,
/* The qualifiers on the function type become the qualifiers on
the non-static member function. */
memfn_quals |= type_memfn_quals (type);
+ rqual = type_memfn_rqual (type);
type_quals = TYPE_UNQUALIFIED;
}
}
@@ -10232,10 +10279,10 @@ grokdeclarator (const cp_declarator *declarator,
ctype = TYPE_METHOD_BASETYPE (type);
if (ctype)
- type = build_memfn_type (type, ctype, memfn_quals);
+ type = build_memfn_type (type, ctype, memfn_quals, rqual);
/* Core issue #547: need to allow this in template type args. */
else if (template_type_arg && TREE_CODE (type) == FUNCTION_TYPE)
- type = apply_memfn_quals (type, memfn_quals);
+ type = apply_memfn_quals (type, memfn_quals, rqual);
else
error ("invalid qualifiers on non-member function type");
}
@@ -10304,7 +10351,7 @@ grokdeclarator (const cp_declarator *declarator,
cp_cv_quals real_quals = memfn_quals;
if (constexpr_p && sfk != sfk_constructor && sfk != sfk_destructor)
real_quals |= TYPE_QUAL_CONST;
- type = build_memfn_type (type, ctype, real_quals);
+ type = build_memfn_type (type, ctype, real_quals, rqual);
}
{
@@ -10436,7 +10483,7 @@ grokdeclarator (const cp_declarator *declarator,
? unqualified_id : dname,
parms,
unqualified_id,
- virtualp, flags, memfn_quals, raises,
+ virtualp, flags, memfn_quals, rqual, raises,
friendp ? -1 : 0, friendp, publicp,
inlinep | (2 * constexpr_p),
sfk,
@@ -10657,7 +10704,7 @@ grokdeclarator (const cp_declarator *declarator,
|| storage_class != sc_static);
decl = grokfndecl (ctype, type, original_name, parms, unqualified_id,
- virtualp, flags, memfn_quals, raises,
+ virtualp, flags, memfn_quals, rqual, raises,
1, friendp,
publicp, inlinep | (2 * constexpr_p), sfk,
funcdef_flag,
@@ -10916,7 +10963,7 @@ type_is_deprecated (tree type)
return type;
/* Do warn about using typedefs to a deprecated class. */
- if (TAGGED_TYPE_P (type) && type != TYPE_MAIN_VARIANT (type))
+ if (OVERLOAD_TYPE_P (type) && type != TYPE_MAIN_VARIANT (type))
return type_is_deprecated (TYPE_MAIN_VARIANT (type));
code = TREE_CODE (type);
@@ -13543,6 +13590,14 @@ begin_destructor_body (void)
initialize_vtbl_ptrs (current_class_ptr);
finish_compound_stmt (compound_stmt);
+ /* Insert a cleanup to let the back end know that the object is dead
+ when we exit the destructor, either normally or via exception. */
+ tree clobber = build_constructor (current_class_type, NULL);
+ TREE_THIS_VOLATILE (clobber) = true;
+ tree exprstmt = build2 (MODIFY_EXPR, current_class_type,
+ current_class_ref, clobber);
+ finish_decl_cleanup (NULL_TREE, exprstmt);
+
/* And insert cleanups for our bases and members so that they
will be properly destroyed if we throw. */
push_base_cleanups ();
@@ -14254,8 +14309,9 @@ static_fn_type (tree memfntype)
return memfntype;
gcc_assert (TREE_CODE (memfntype) == METHOD_TYPE);
args = TYPE_ARG_TYPES (memfntype);
+ cp_ref_qualifier rqual = type_memfn_rqual (memfntype);
fntype = build_function_type (TREE_TYPE (memfntype), TREE_CHAIN (args));
- fntype = apply_memfn_quals (fntype, type_memfn_quals (memfntype));
+ fntype = apply_memfn_quals (fntype, type_memfn_quals (memfntype), rqual);
fntype = (cp_build_type_attribute_variant
(fntype, TYPE_ATTRIBUTES (memfntype)));
fntype = (build_exception_variant
@@ -14271,9 +14327,10 @@ revert_static_member_fn (tree decl)
{
tree stype = static_fn_type (decl);
cp_cv_quals quals = type_memfn_quals (stype);
+ cp_ref_qualifier rqual = type_memfn_rqual (stype);
- if (quals != TYPE_UNQUALIFIED)
- stype = apply_memfn_quals (stype, TYPE_UNQUALIFIED);
+ if (quals != TYPE_UNQUALIFIED || rqual != REF_QUAL_NONE)
+ stype = apply_memfn_quals (stype, TYPE_UNQUALIFIED, REF_QUAL_NONE);
TREE_TYPE (decl) = stype;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3c6b6c5ef03..86a706c226f 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -109,7 +109,8 @@ int at_eof;
that apply to the function). */
tree
-build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals)
+build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals,
+ cp_ref_qualifier rqual)
{
tree raises;
tree attrs;
@@ -129,10 +130,12 @@ build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals)
(TREE_CODE (fntype) == METHOD_TYPE
? TREE_CHAIN (TYPE_ARG_TYPES (fntype))
: TYPE_ARG_TYPES (fntype)));
- if (raises)
- fntype = build_exception_variant (fntype, raises);
if (attrs)
fntype = cp_build_type_attribute_variant (fntype, attrs);
+ if (rqual)
+ fntype = build_ref_qualified_type (fntype, rqual);
+ if (raises)
+ fntype = build_exception_variant (fntype, raises);
return fntype;
}
@@ -157,7 +160,9 @@ change_return_type (tree new_ret, tree fntype)
if (TREE_CODE (fntype) == FUNCTION_TYPE)
{
newtype = build_function_type (new_ret, args);
- newtype = apply_memfn_quals (newtype, type_memfn_quals (fntype));
+ newtype = apply_memfn_quals (newtype,
+ type_memfn_quals (fntype),
+ type_memfn_rqual (fntype));
}
else
newtype = build_method_type_directly
@@ -330,10 +335,11 @@ grokclassfn (tree ctype, tree function, enum overload_flags flags)
}
/* Create an ARRAY_REF, checking for the user doing things backwards
- along the way. */
+ along the way. DECLTYPE_P is for N3276, as in the parser. */
tree
-grok_array_decl (location_t loc, tree array_expr, tree index_exp)
+grok_array_decl (location_t loc, tree array_expr, tree index_exp,
+ bool decltype_p)
{
tree type;
tree expr;
@@ -359,8 +365,13 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp)
/* If they have an `operator[]', use that. */
if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp)))
- expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, array_expr, index_exp,
- NULL_TREE, /*overload=*/NULL, tf_warning_or_error);
+ {
+ tsubst_flags_t complain = tf_warning_or_error;
+ if (decltype_p)
+ complain |= tf_decltype;
+ expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, array_expr,
+ index_exp, NULL_TREE, /*overload=*/NULL, complain);
+ }
else
{
tree p1, p2, i1, i2;
@@ -672,6 +683,11 @@ check_classfn (tree ctype, tree function, tree template_parms)
if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL))
continue;
+ /* ref-qualifier or absence of same must match. */
+ if (type_memfn_rqual (TREE_TYPE (function))
+ != type_memfn_rqual (TREE_TYPE (fndecl)))
+ continue;
+
/* While finding a match, same types and params are not enough
if the function is versioned. Also check version ("target")
attributes. */
@@ -858,7 +874,7 @@ grokfield (const cp_declarator *declarator,
/* If this is a typedef that names the class for linkage purposes
(7.1.3p8), apply any attributes directly to the type. */
- if (TAGGED_TYPE_P (TREE_TYPE (value))
+ if (OVERLOAD_TYPE_P (TREE_TYPE (value))
&& value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))))
attrflags = ATTR_FLAG_TYPE_IN_PLACE;
@@ -1260,7 +1276,9 @@ cp_reconstruct_complex_type (tree type, tree bottom)
{
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
outer = build_function_type (inner, TYPE_ARG_TYPES (type));
- outer = apply_memfn_quals (outer, type_memfn_quals (type));
+ outer = apply_memfn_quals (outer,
+ type_memfn_quals (type),
+ type_memfn_rqual (type));
}
else if (TREE_CODE (type) == METHOD_TYPE)
{
@@ -1922,7 +1940,7 @@ min_vis_r (tree *tp, int *walk_subtrees, void *data)
{
*walk_subtrees = 0;
}
- else if (TAGGED_TYPE_P (*tp)
+ else if (OVERLOAD_TYPE_P (*tp)
&& !TREE_PUBLIC (TYPE_MAIN_DECL (*tp)))
{
*vis_p = VISIBILITY_ANON;
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 38da24304e0..300fe0c1ffc 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -78,6 +78,7 @@ static void dump_aggr_init_expr_args (tree, int, bool);
static void dump_expr_list (tree, int);
static void dump_global_iord (tree);
static void dump_parameters (tree, int);
+static void dump_ref_qualifier (tree, int);
static void dump_exception_spec (tree, int);
static void dump_template_argument (tree, int);
static void dump_template_argument_list (tree, int);
@@ -828,10 +829,9 @@ dump_type_suffix (tree t, int flags)
anyway; they may in g++, but we'll just pretend otherwise. */
dump_parameters (arg, flags & ~TFF_FUNCTION_DEFAULT_ARGUMENTS);
- if (TREE_CODE (t) == METHOD_TYPE)
- pp_cxx_cv_qualifier_seq (cxx_pp, class_of_this_parm (t));
- else
- pp_cxx_cv_qualifier_seq (cxx_pp, t);
+ pp_base (cxx_pp)->padding = pp_before;
+ pp_cxx_cv_qualifiers (cxx_pp, type_memfn_quals (t));
+ dump_ref_qualifier (t, flags);
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags);
dump_type_suffix (TREE_TYPE (t), flags);
break;
@@ -1426,6 +1426,7 @@ dump_function_decl (tree t, int flags)
{
pp_base (cxx_pp)->padding = pp_before;
pp_cxx_cv_qualifier_seq (cxx_pp, class_of_this_parm (fntype));
+ dump_ref_qualifier (fntype, flags);
}
if (flags & TFF_EXCEPTION_SPECIFICATION)
@@ -1507,6 +1508,21 @@ dump_parameters (tree parmtypes, int flags)
pp_cxx_right_paren (cxx_pp);
}
+/* Print ref-qualifier of a FUNCTION_TYPE or METHOD_TYPE. FLAGS are ignored. */
+
+static void
+dump_ref_qualifier (tree t, int flags ATTRIBUTE_UNUSED)
+{
+ if (FUNCTION_REF_QUALIFIED (t))
+ {
+ pp_base (cxx_pp)->padding = pp_before;
+ if (FUNCTION_RVALUE_QUALIFIED (t))
+ pp_cxx_ws_string (cxx_pp, "&&");
+ else
+ pp_cxx_ws_string (cxx_pp, "&");
+ }
+}
+
/* Print an exception specification. T is the exception specification. */
static void
@@ -3006,14 +3022,14 @@ cp_print_error_function (diagnostic_context *context,
{
if (context->show_column && s.column != 0)
pp_printf (context->printer,
- _(" inlined from %qs at %s:%d:%d"),
+ _(" inlined from %qs at %r%s:%d:%d%R"),
cxx_printable_name_translate (fndecl, 2),
- s.file, s.line, s.column);
+ "locus", s.file, s.line, s.column);
else
pp_printf (context->printer,
- _(" inlined from %qs at %s:%d"),
+ _(" inlined from %qs at %r%s:%d%R"),
cxx_printable_name_translate (fndecl, 2),
- s.file, s.line);
+ "locus", s.file, s.line);
}
else
@@ -3095,11 +3111,11 @@ print_instantiation_partial_context_line (diagnostic_context *context,
xloc = expand_location (loc);
if (context->show_column)
- pp_verbatim (context->printer, _("%s:%d:%d: "),
- xloc.file, xloc.line, xloc.column);
+ pp_verbatim (context->printer, _("%r%s:%d:%d:%R "),
+ "locus", xloc.file, xloc.line, xloc.column);
else
- pp_verbatim (context->printer, _("%s:%d: "),
- xloc.file, xloc.line);
+ pp_verbatim (context->printer, _("%r%s:%d:%R "),
+ "locus", xloc.file, xloc.line);
if (t != NULL)
{
@@ -3173,14 +3189,16 @@ print_instantiation_partial_context (diagnostic_context *context,
xloc = expand_location (loc);
if (context->show_column)
pp_verbatim (context->printer,
- _("%s:%d:%d: [ skipping %d instantiation contexts, "
- "use -ftemplate-backtrace-limit=0 to disable ]\n"),
- xloc.file, xloc.line, xloc.column, skip);
+ _("%r%s:%d:%d:%R [ skipping %d instantiation "
+ "contexts, use -ftemplate-backtrace-limit=0 to "
+ "disable ]\n"),
+ "locus", xloc.file, xloc.line, xloc.column, skip);
else
pp_verbatim (context->printer,
- _("%s:%d: [ skipping %d instantiation contexts, "
- "use -ftemplate-backtrace-limit=0 to disable ]\n"),
- xloc.file, xloc.line, skip);
+ _("%r%s:%d:%R [ skipping %d instantiation "
+ "contexts, use -ftemplate-backtrace-limit=0 to "
+ "disable ]\n"),
+ "locus", xloc.file, xloc.line, skip);
do {
loc = t->locus;
@@ -3242,12 +3260,12 @@ maybe_print_constexpr_context (diagnostic_context *context)
const char *s = expr_as_string (t, 0);
if (context->show_column)
pp_verbatim (context->printer,
- _("%s:%d:%d: in constexpr expansion of %qs"),
- xloc.file, xloc.line, xloc.column, s);
+ _("%r%s:%d:%d:%R in constexpr expansion of %qs"),
+ "locus", xloc.file, xloc.line, xloc.column, s);
else
pp_verbatim (context->printer,
- _("%s:%d: in constexpr expansion of %qs"),
- xloc.file, xloc.line, s);
+ _("%r%s:%d:%R in constexpr expansion of %qs"),
+ "locus", xloc.file, xloc.line, s);
pp_base_newline (context->printer);
}
}
@@ -3408,6 +3426,11 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
"c++11 attributes "
"only available with -std=c++11 or -std=gnu++11");
break;
+ case CPP0X_REF_QUALIFIER:
+ pedwarn (input_location, 0,
+ "ref-qualifiers "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
default:
gcc_unreachable ();
}
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 083372849b9..3c63ea6dbb9 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -485,8 +485,7 @@ do_friend (tree ctype, tree declarator, tree decl,
to be a friend, so we do lookup here even if CTYPE is in
the process of being defined. */
if (class_template_depth
- || COMPLETE_TYPE_P (ctype)
- || (CLASS_TYPE_P (ctype) && TYPE_BEING_DEFINED (ctype)))
+ || COMPLETE_OR_OPEN_TYPE_P (ctype))
{
if (DECL_TEMPLATE_INFO (decl))
/* DECL is a template specialization. No need to
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 4ea1e513b67..50bec77cabe 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2922,6 +2922,7 @@ build_new (vec<tree, va_gc> **placement, tree type, tree nelts,
if (dependent_type_p (type)
|| any_type_dependent_arguments_p (*placement)
|| (nelts && type_dependent_expression_p (nelts))
+ || (nelts && *init)
|| any_type_dependent_arguments_p (*init))
return build_raw_new_expr (*placement, type, nelts, *init,
use_global_new);
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 13f7f2cf352..28b063a1866 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -350,6 +350,7 @@ canonicalize_for_substitution (tree node)
&& TYPE_CANONICAL (node) != node
&& TYPE_MAIN_VARIANT (node) != node)
{
+ tree orig = node;
/* Here we want to strip the topmost typedef only.
We need to do that so is_std_substitution can do proper
name matching. */
@@ -361,6 +362,9 @@ canonicalize_for_substitution (tree node)
else
node = cp_build_qualified_type (TYPE_MAIN_VARIANT (node),
cp_type_quals (node));
+ if (TREE_CODE (node) == FUNCTION_TYPE
+ || TREE_CODE (node) == METHOD_TYPE)
+ node = build_ref_qualified_type (node, type_memfn_rqual (orig));
}
return node;
}
@@ -904,9 +908,11 @@ write_unscoped_template_name (const tree decl)
/* Write the nested name, including CV-qualifiers, of DECL.
- <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
- ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
+ <nested-name> ::= N [<CV-qualifiers>] [<ref-qualifier>] <prefix> <unqualified-name> E
+ ::= N [<CV-qualifiers>] [<ref-qualifier>] <template-prefix> <template-args> E
+ <ref-qualifier> ::= R # & ref-qualifier
+ ::= O # && ref-qualifier
<CV-qualifiers> ::= [r] [V] [K] */
static void
@@ -926,6 +932,13 @@ write_nested_name (const tree decl)
write_char ('V');
if (DECL_CONST_MEMFUNC_P (decl))
write_char ('K');
+ if (FUNCTION_REF_QUALIFIED (TREE_TYPE (decl)))
+ {
+ if (FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (decl)))
+ write_char ('O');
+ else
+ write_char ('R');
+ }
}
/* Is this a template instance? */
@@ -1884,7 +1897,21 @@ write_type (tree type)
mangle the unqualified type. The recursive call is needed here
since both the qualified and unqualified types are substitution
candidates. */
- write_type (TYPE_MAIN_VARIANT (type));
+ {
+ tree t = TYPE_MAIN_VARIANT (type);
+ if (TREE_CODE (t) == FUNCTION_TYPE
+ || TREE_CODE (t) == METHOD_TYPE)
+ {
+ t = build_ref_qualified_type (t, type_memfn_rqual (type));
+ if (abi_version_at_least (8))
+ /* Avoid adding the unqualified function type as a substitution. */
+ write_function_type (t);
+ else
+ write_type (t);
+ }
+ else
+ write_type (t);
+ }
else if (TREE_CODE (type) == ARRAY_TYPE)
/* It is important not to use the TYPE_MAIN_VARIANT of TYPE here
so that the cv-qualification of the element type is available
@@ -1896,6 +1923,9 @@ write_type (tree type)
/* See through any typedefs. */
type = TYPE_MAIN_VARIANT (type);
+ if (TREE_CODE (type) == FUNCTION_TYPE
+ || TREE_CODE (type) == METHOD_TYPE)
+ type = build_ref_qualified_type (type, type_memfn_rqual (type_orig));
/* According to the C++ ABI, some library classes are passed the
same as the scalar type of their single member and use the same
@@ -2331,7 +2361,7 @@ write_builtin_type (tree type)
METHOD_TYPE. The return type is mangled before the parameter
types.
- <function-type> ::= F [Y] <bare-function-type> E */
+ <function-type> ::= F [Y] <bare-function-type> [<ref-qualifier>] E */
static void
write_function_type (const tree type)
@@ -2364,6 +2394,13 @@ write_function_type (const tree type)
See [dcl.link]. */
write_bare_function_type (type, /*include_return_type_p=*/1,
/*decl=*/NULL);
+ if (FUNCTION_REF_QUALIFIED (type))
+ {
+ if (FUNCTION_RVALUE_QUALIFIED (type))
+ write_char ('O');
+ else
+ write_char ('R');
+ }
write_char ('E');
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 38e0d5c5789..78f359a31ef 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -237,7 +237,7 @@ static tree cp_literal_operator_id
(const char *);
static tree cp_parser_array_notation
- (cp_parser *, tree, tree);
+ (location_t, cp_parser *, tree, tree);
static vec<tree, va_gc> *cp_parser_elem_fn_expression_list
(cp_parser *);
@@ -649,7 +649,11 @@ cp_lexer_new_main (void)
gcc_assert (!lexer->next_token->purged_p);
- array_notation_label_no = 0;
+ if (flag_enable_cilk)
+ {
+ array_notation_label_no = 0;
+ p_simd_nodes_clear ();
+ }
return lexer;
}
@@ -1248,7 +1252,7 @@ clear_decl_specs (cp_decl_specifier_seq *decl_specs)
VAR_DECLs or FUNCTION_DECLs) should do that directly. */
static cp_declarator *make_call_declarator
- (cp_declarator *, tree, cp_cv_quals, cp_virt_specifiers, tree, tree);
+ (cp_declarator *, tree, cp_cv_quals, cp_virt_specifiers, cp_ref_qualifier, tree, tree);
static cp_declarator *make_array_declarator
(cp_declarator *, tree);
static cp_declarator *make_pointer_declarator
@@ -1427,6 +1431,7 @@ make_call_declarator (cp_declarator *target,
tree parms,
cp_cv_quals cv_qualifiers,
cp_virt_specifiers virt_specifiers,
+ cp_ref_qualifier ref_qualifier,
tree exception_specification,
tree late_return_type)
{
@@ -1437,6 +1442,7 @@ make_call_declarator (cp_declarator *target,
declarator->u.function.parameters = parms;
declarator->u.function.qualifiers = cv_qualifiers;
declarator->u.function.virt_specifiers = virt_specifiers;
+ declarator->u.function.ref_qualifier = ref_qualifier;
declarator->u.function.exception_specification = exception_specification;
declarator->u.function.late_return_type = late_return_type;
if (target)
@@ -1864,7 +1870,7 @@ static tree cp_parser_qualifying_entity
static tree cp_parser_postfix_expression
(cp_parser *, bool, bool, bool, bool, cp_id_kind *);
static tree cp_parser_postfix_open_square_expression
- (cp_parser *, tree, bool);
+ (cp_parser *, tree, bool, bool);
static tree cp_parser_postfix_dot_deref_expression
(cp_parser *, enum cpp_ttype, tree, bool, cp_id_kind *, location_t);
static vec<tree, va_gc> *cp_parser_parenthesized_expression_list
@@ -2032,6 +2038,8 @@ static cp_cv_quals cp_parser_cv_qualifier_seq_opt
(cp_parser *);
static cp_virt_specifiers cp_parser_virt_specifier_seq_opt
(cp_parser *);
+static cp_ref_qualifier cp_parser_ref_qualifier_opt
+ (cp_parser *);
static tree cp_parser_late_return_type_opt
(cp_parser *, cp_cv_quals);
static tree cp_parser_declarator_id
@@ -3927,6 +3935,18 @@ cp_parser_translation_unit (cp_parser* parser)
return success;
}
+/* Return the appropriate tsubst flags for parsing, possibly in N3276
+ decltype context. */
+
+static inline tsubst_flags_t
+complain_flags (bool decltype_p)
+{
+ tsubst_flags_t complain = tf_warning_or_error;
+ if (decltype_p)
+ complain |= tf_decltype;
+ return complain;
+}
+
/* Expressions [gram.expr] */
/* Parse a primary-expression.
@@ -5820,7 +5840,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
postfix_expression
= cp_parser_postfix_open_square_expression (parser,
postfix_expression,
- false);
+ false,
+ decltype_p);
idk = CP_ID_KIND_NONE;
is_member_access = false;
break;
@@ -5832,12 +5853,9 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
bool is_builtin_constant_p;
bool saved_integral_constant_expression_p = false;
bool saved_non_integral_constant_expression_p = false;
- int complain = tf_warning_or_error;
+ tsubst_flags_t complain = complain_flags (decltype_p);
vec<tree, va_gc> *args;
- if (decltype_p)
- complain |= tf_decltype;
-
is_member_access = false;
is_builtin_constant_p
@@ -6097,7 +6115,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
static tree
cp_parser_postfix_open_square_expression (cp_parser *parser,
tree postfix_expression,
- bool for_offsetof)
+ bool for_offsetof,
+ bool decltype_p)
{
tree index;
location_t loc = cp_lexer_peek_token (parser->lexer)->location;
@@ -6110,7 +6129,7 @@ cp_parser_postfix_open_square_expression (cp_parser *parser,
/* If we reach here, then we have something like this:
ARRAY [:]
*/
- postfix_expression = cp_parser_array_notation (parser, NULL_TREE,
+ postfix_expression = cp_parser_array_notation (loc, parser, NULL_TREE,
postfix_expression);
else
{
@@ -6149,7 +6168,7 @@ cp_parser_postfix_open_square_expression (cp_parser *parser,
}
if (flag_enable_cilk
&& cp_lexer_peek_token (parser->lexer)->type == CPP_COLON)
- postfix_expression = cp_parser_array_notation (parser, index,
+ postfix_expression = cp_parser_array_notation (loc, parser, index,
postfix_expression);
else
{
@@ -6157,7 +6176,8 @@ cp_parser_postfix_open_square_expression (cp_parser *parser,
cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
/* Build the ARRAY_REF. */
- postfix_expression = grok_array_decl (loc, postfix_expression, index);
+ postfix_expression = grok_array_decl (loc, postfix_expression,
+ index, decltype_p);
/* When not doing offsetof, array references are not permitted in
constant-expressions. */
@@ -6861,6 +6881,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p,
tree expression = error_mark_node;
non_integral_constant non_constant_p = NIC_NONE;
location_t loc = token->location;
+ tsubst_flags_t complain = complain_flags (decltype_p);
/* Consume the operator token. */
token = cp_lexer_consume_token (parser->lexer);
@@ -6878,7 +6899,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p,
non_constant_p = NIC_STAR;
expression = build_x_indirect_ref (loc, cast_expression,
RO_UNARY_STAR,
- tf_warning_or_error);
+ complain);
break;
case ADDR_EXPR:
@@ -6887,7 +6908,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p,
case BIT_NOT_EXPR:
expression = build_x_unary_op (loc, unary_operator,
cast_expression,
- tf_warning_or_error);
+ complain);
break;
case PREINCREMENT_EXPR:
@@ -6899,7 +6920,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p,
case NEGATE_EXPR:
case TRUTH_NOT_EXPR:
expression = finish_unary_op_expr (loc, unary_operator,
- cast_expression);
+ cast_expression, complain);
break;
default:
@@ -7727,7 +7748,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
current.lhs = build_x_binary_op (current.loc, current.tree_type,
current.lhs, current.lhs_type,
rhs, rhs_type, &overload,
- tf_warning_or_error);
+ complain_flags (decltype_p));
current.lhs_type = current.tree_type;
if (EXPR_P (current.lhs))
SET_EXPR_LOCATION (current.lhs, current.loc);
@@ -7882,7 +7903,7 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p,
expr = build_x_modify_expr (loc, expr,
assignment_operator,
rhs,
- tf_warning_or_error);
+ complain_flags (decltype_p));
input_location = saved_input_location;
}
}
@@ -8028,7 +8049,7 @@ cp_parser_expression (cp_parser* parser, bool cast_p, bool decltype_p,
else
expression = build_x_compound_expr (loc, expression,
assignment_expression,
- tf_warning_or_error);
+ complain_flags (decltype_p));
/* If the next token is not a comma, then we are done with the
expression. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
@@ -8179,12 +8200,14 @@ cp_parser_builtin_offsetof (cp_parser *parser)
{
case CPP_OPEN_SQUARE:
/* offsetof-member-designator "[" expression "]" */
- expr = cp_parser_postfix_open_square_expression (parser, expr, true);
+ expr = cp_parser_postfix_open_square_expression (parser, expr,
+ true, false);
break;
case CPP_DEREF:
/* offsetof-member-designator "->" identifier */
- expr = grok_array_decl (token->location, expr, integer_zero_node);
+ expr = grok_array_decl (token->location, expr,
+ integer_zero_node, false);
/* FALLTHRU */
case CPP_DOT:
@@ -8804,6 +8827,7 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
? TYPE_UNQUALIFIED : TYPE_QUAL_CONST);
declarator = make_call_declarator (declarator, param_list, quals,
VIRT_SPEC_UNSPECIFIED,
+ REF_QUAL_NONE,
exception_spec,
/*late_return_type=*/NULL_TREE);
declarator->id_loc = LAMBDA_EXPR_LOCATION (lambda_expr);
@@ -9826,7 +9850,10 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl)
range_expr = error_mark_node;
stmt = begin_range_for_stmt (scope, init);
finish_range_for_decl (stmt, range_decl, range_expr);
- if (!type_dependent_expression_p (range_expr)
+ if (range_expr != error_mark_node
+ && !type_dependent_expression_p (range_expr)
+ /* The length of an array might be dependent. */
+ && COMPLETE_TYPE_P (TREE_TYPE (range_expr))
/* do_auto_deduction doesn't mess with template init-lists. */
&& !BRACE_ENCLOSED_INITIALIZER_P (range_expr))
do_range_for_auto_deduction (range_decl, range_expr);
@@ -9974,7 +10001,8 @@ cp_convert_range_for (tree statement, tree range_decl, tree range_expr)
/* The new increment expression. */
expression = finish_unary_op_expr (input_location,
- PREINCREMENT_EXPR, begin);
+ PREINCREMENT_EXPR, begin,
+ tf_warning_or_error);
finish_for_expr (expression, statement);
/* The declaration is initialized with *__begin inside the loop body. */
@@ -14998,6 +15026,9 @@ cp_parser_enum_specifier (cp_parser* parser)
{
identifier = make_anon_name ();
is_anonymous = true;
+ if (scoped_enum_p)
+ error_at (type_start_token->location,
+ "anonymous scoped enum is not allowed");
}
}
pop_deferring_access_checks ();
@@ -15145,7 +15176,13 @@ cp_parser_enum_specifier (cp_parser* parser)
if (type == error_mark_node)
cp_parser_skip_to_end_of_block_or_statement (parser);
/* If the next token is not '}', then there are some enumerators. */
- else if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_BRACE))
+ else if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
+ {
+ if (is_anonymous && !scoped_enum_p)
+ pedwarn (type_start_token->location, OPT_Wpedantic,
+ "ISO C++ forbids empty anonymous enum");
+ }
+ else
cp_parser_enumerator_list (parser, type);
/* Consume the final '}'. */
@@ -16938,6 +16975,7 @@ cp_parser_declarator (cp_parser* parser,
declarator-id
direct-declarator ( parameter-declaration-clause )
cv-qualifier-seq [opt]
+ ref-qualifier [opt]
exception-specification [opt]
direct-declarator [ constant-expression [opt] ]
( declarator )
@@ -16946,6 +16984,7 @@ cp_parser_declarator (cp_parser* parser,
direct-abstract-declarator [opt]
( parameter-declaration-clause )
cv-qualifier-seq [opt]
+ ref-qualifier [opt]
exception-specification [opt]
direct-abstract-declarator [opt] [ constant-expression [opt] ]
( abstract-declarator )
@@ -17060,12 +17099,13 @@ cp_parser_direct_declarator (cp_parser* parser,
/* Consume the `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN);
- /* If all went well, parse the cv-qualifier-seq and the
- exception-specification. */
+ /* If all went well, parse the cv-qualifier-seq,
+ ref-qualifier and the exception-specification. */
if (member_p || cp_parser_parse_definitely (parser))
{
cp_cv_quals cv_quals;
cp_virt_specifiers virt_specifiers;
+ cp_ref_qualifier ref_qual;
tree exception_specification;
tree late_return;
tree attrs;
@@ -17080,6 +17120,8 @@ cp_parser_direct_declarator (cp_parser* parser,
/* Parse the cv-qualifier-seq. */
cv_quals = cp_parser_cv_qualifier_seq_opt (parser);
+ /* Parse the ref-qualifier. */
+ ref_qual = cp_parser_ref_qualifier_opt (parser);
/* And the exception-specification. */
exception_specification
= cp_parser_exception_specification_opt (parser);
@@ -17097,6 +17139,7 @@ cp_parser_direct_declarator (cp_parser* parser,
params,
cv_quals,
virt_specifiers,
+ ref_qual,
exception_specification,
late_return);
declarator->std_attributes = attrs;
@@ -17660,6 +17703,59 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser)
return cv_quals;
}
+/* Parse an (optional) ref-qualifier
+
+ ref-qualifier:
+ &
+ &&
+
+ Returns cp_ref_qualifier representing ref-qualifier. */
+
+static cp_ref_qualifier
+cp_parser_ref_qualifier_opt (cp_parser* parser)
+{
+ cp_ref_qualifier ref_qual = REF_QUAL_NONE;
+
+ while (true)
+ {
+ cp_ref_qualifier curr_ref_qual = REF_QUAL_NONE;
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ switch (token->type)
+ {
+ case CPP_AND:
+ curr_ref_qual = REF_QUAL_LVALUE;
+ break;
+
+ case CPP_AND_AND:
+ curr_ref_qual = REF_QUAL_RVALUE;
+ break;
+
+ default:
+ curr_ref_qual = REF_QUAL_NONE;
+ break;
+ }
+
+ if (!curr_ref_qual)
+ break;
+ else if (ref_qual)
+ {
+ error_at (token->location, "multiple ref-qualifiers");
+ cp_lexer_purge_token (parser->lexer);
+ }
+ else
+ {
+ ref_qual = curr_ref_qual;
+ cp_lexer_consume_token (parser->lexer);
+ }
+ }
+
+ if (ref_qual)
+ maybe_warn_cpp0x (CPP0X_REF_QUALIFIER);
+
+ return ref_qual;
+}
+
/* Parse an (optional) virt-specifier-seq.
virt-specifier-seq:
@@ -21506,8 +21602,13 @@ cp_parser_std_attribute (cp_parser *parser)
token = cp_lexer_peek_token (parser->lexer);
}
else
- attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id),
- NULL_TREE);
+ {
+ attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id),
+ NULL_TREE);
+ /* C++11 noreturn attribute is equivalent to GNU's. */
+ if (is_attribute_p ("noreturn", attr_id))
+ TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu");
+ }
/* Now parse the optional argument clause of the attribute. */
@@ -29672,7 +29773,7 @@ cp_parser_simd_private (cp_parser *parser, cp_token *pragma_token,
{
if (!same_var_in_multiple_lists_p (p_simd_values))
{
- cp_lexer_peek_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, p_simd_values);
}
}
@@ -29736,7 +29837,7 @@ cp_parser_simd_vectorlength (cp_parser *parser, cp_token *pragma_token,
{
if (!same_var_in_multiple_lists_p (p_simd_values))
{
- cp_lexer_peek_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, p_simd_values);
}
}
@@ -29848,7 +29949,7 @@ cp_parser_simd_reduction (cp_parser *parser, cp_token *pragma_token,
{
if (!same_var_in_multiple_lists_p (p_simd_values))
{
- cp_lexer_peek_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, p_simd_values);
}
}
@@ -29979,7 +30080,8 @@ cp_parser_cilk_for_init_statement (cp_parser *parser, tree *init)
ARRAY_NOTATION_REF. If some error occurred it returns NULL_TREE. */
static tree
-cp_parser_array_notation (cp_parser *parser, tree init_index, tree array_value)
+cp_parser_array_notation (location_t loc, cp_parser *parser, tree init_index,
+ tree array_value)
{
cp_token *token = NULL;
tree start_index = NULL_TREE, length_index = NULL_TREE, stride = NULL_TREE;
@@ -29995,7 +30097,15 @@ cp_parser_array_notation (cp_parser *parser, tree init_index, tree array_value)
if (processing_template_decl)
{
array_type = TREE_TYPE (array_value);
- type = TREE_TYPE (array_type);
+ if (array_type)
+ type = TREE_TYPE (array_type);
+ else if (TREE_CODE (array_value) == ARRAY_REF)
+ {
+ array_type = TREE_TYPE (TREE_OPERAND (array_value, 0));
+ type = TREE_TYPE (array_type);
+ }
+ else
+ type = array_type;
}
else
{
@@ -30085,6 +30195,8 @@ cp_parser_array_notation (cp_parser *parser, tree init_index, tree array_value)
value_tree = build_array_notation_ref (input_location, array_value,
start_index, length_index, stride,
type);
+ if (value_tree != error_mark_node)
+ SET_EXPR_LOCATION (value_tree, loc);
return value_tree;
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 49cd1c6fa81..c49fa02459b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "timevar.h"
#include "tree-iterator.h"
+#include "cilk.h"
extern bool contains_array_notation_expr (tree );
/* The type of functions taking a tree, and some additional data, and
@@ -325,7 +326,7 @@ get_template_info (const_tree t)
if (!tinfo && DECL_IMPLICIT_TYPEDEF_P (t))
t = TREE_TYPE (t);
- if (TAGGED_TYPE_P (t))
+ if (OVERLOAD_TYPE_P (t))
tinfo = TYPE_TEMPLATE_INFO (t);
else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM)
tinfo = TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t);
@@ -3059,10 +3060,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
bool parameter_pack_p = false;
/* Handle type aliases/typedefs. */
- if (TYPE_P (t)
- && TYPE_NAME (t)
- && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL
- && TYPE_DECL_ALIAS_P (TYPE_NAME (t)))
+ if (TYPE_ALIAS_P (t))
{
if (TYPE_TEMPLATE_INFO (t))
cp_walk_tree (&TYPE_TI_ARGS (t),
@@ -3147,7 +3145,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
case UNION_TYPE:
case ENUMERAL_TYPE:
if (TYPE_TEMPLATE_INFO (t))
- cp_walk_tree (&TI_ARGS (TYPE_TEMPLATE_INFO (t)),
+ cp_walk_tree (&TYPE_TI_ARGS (t),
&find_parameter_packs_r, ppd, ppd->visited);
*walk_subtrees = 0;
@@ -7628,7 +7626,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d)
case ENUMERAL_TYPE:
if (!TYPE_TEMPLATE_INFO (t))
*walk_subtrees = 0;
- else if (for_each_template_parm (TI_ARGS (TYPE_TEMPLATE_INFO (t)),
+ else if (for_each_template_parm (TYPE_TI_ARGS (t),
fn, data, pfd->visited,
pfd->include_nondeduced_p))
return error_mark_node;
@@ -10653,16 +10651,6 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
break;
}
- if (VAR_P (t) && DECL_ANON_UNION_VAR_P (t))
- {
- /* Just use name lookup to find a member alias for an anonymous
- union, but then add it to the hash table. */
- r = lookup_name (DECL_NAME (t));
- gcc_assert (DECL_ANON_UNION_VAR_P (r));
- register_local_specialization (r, t);
- break;
- }
-
/* Create a new node for the specialization we need. */
r = copy_decl (t);
if (type == NULL_TREE)
@@ -10767,21 +10755,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
SET_DECL_IMPLICIT_INSTANTIATION (r);
}
else if (cp_unevaluated_operand)
- {
- /* We're substituting this var in a decltype outside of its
- scope, such as for a lambda return type. Don't add it to
- local_specializations, do perform auto deduction. */
- tree auto_node = type_uses_auto (type);
- if (auto_node)
- {
- tree init
- = tsubst_expr (DECL_INITIAL (t), args, complain, in_decl,
- /*constant_expression_p=*/false);
- init = resolve_nondeduced_context (init);
- TREE_TYPE (r) = type
- = do_auto_deduction (type, init, auto_node);
- }
- }
+ gcc_unreachable ();
else
register_local_specialization (r, t);
@@ -10972,7 +10946,9 @@ tsubst_function_type (tree t,
if (TREE_CODE (t) == FUNCTION_TYPE)
{
fntype = build_function_type (return_type, arg_types);
- fntype = apply_memfn_quals (fntype, type_memfn_quals (t));
+ fntype = apply_memfn_quals (fntype,
+ type_memfn_quals (t),
+ type_memfn_rqual (t));
}
else
{
@@ -10994,6 +10970,7 @@ tsubst_function_type (tree t,
fntype = build_method_type_directly (r, return_type,
TREE_CHAIN (arg_types));
+ fntype = build_ref_qualified_type (fntype, type_memfn_rqual (t));
}
fntype = cp_build_type_attribute_variant (fntype, TYPE_ATTRIBUTES (t));
@@ -11626,7 +11603,9 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* The type of the implicit object parameter gets its
cv-qualifiers from the FUNCTION_TYPE. */
tree memptr;
- tree method_type = build_memfn_type (type, r, type_memfn_quals (type));
+ tree method_type
+ = build_memfn_type (type, r, type_memfn_quals (type),
+ type_memfn_rqual (type));
memptr = build_ptrmemfunc_type (build_pointer_type (method_type));
return cp_build_qualified_type_real (memptr, cp_type_quals (t),
complain);
@@ -11809,9 +11788,10 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
++cp_unevaluated_operand;
++c_inhibit_evaluation_warnings;
- type = tsubst_expr (DECLTYPE_TYPE_EXPR (t), args,
- complain|tf_decltype, in_decl,
- /*integral_constant_expression_p=*/false);
+ type = tsubst_copy_and_build (DECLTYPE_TYPE_EXPR (t), args,
+ complain|tf_decltype, in_decl,
+ /*function_p*/false,
+ /*integral_constant_expression*/false);
--cp_unevaluated_operand;
--c_inhibit_evaluation_warnings;
@@ -11821,8 +11801,17 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
else if (DECLTYPE_FOR_LAMBDA_PROXY (t))
type = lambda_proxy_type (type);
else
- type = finish_decltype_type
- (type, DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t), complain);
+ {
+ bool id = DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t);
+ if (id && TREE_CODE (DECLTYPE_TYPE_EXPR (t)) == BIT_NOT_EXPR
+ && EXPR_P (type))
+ /* In a template ~id could be either a complement expression
+ or an unqualified-id naming a destructor; if instantiating
+ it produces an expression, it's not an id-expression or
+ member access. */
+ id = false;
+ type = finish_decltype_type (type, id, complain);
+ }
return cp_build_qualified_type_real (type,
cp_type_quals (t)
| cp_type_quals (type),
@@ -12190,11 +12179,37 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case VAR_DECL:
case FUNCTION_DECL:
- if ((DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t))
- || local_variable_p (t))
- t = tsubst (t, args, complain, in_decl);
- mark_used (t);
- return t;
+ if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t))
+ r = tsubst (t, args, complain, in_decl);
+ else if (local_variable_p (t))
+ {
+ if (flag_enable_cilk && TREE_TYPE (t) == cilk_frame_type_decl)
+ r = tsubst (t, args, complain, in_decl);
+ else
+ {
+ r = retrieve_local_specialization (t);
+ if (r == NULL_TREE)
+ {
+ if (DECL_ANON_UNION_VAR_P (t))
+ {
+ /* Just use name lookup to find a member alias for an
+ anonymous union, but then add it to the hash table. */
+ r = lookup_name (DECL_NAME (t));
+ gcc_assert (DECL_ANON_UNION_VAR_P (r));
+ register_local_specialization (r, t);
+ }
+ else
+ {
+ gcc_assert (errorcount || sorrycount);
+ return error_mark_node;
+ }
+ }
+ }
+ }
+ else
+ r = t;
+ mark_used (r);
+ return r;
case NAMESPACE_DECL:
return t;
@@ -13300,15 +13315,15 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
stmt = begin_omp_structured_block ();
+ pre_body = push_stmt_list ();
+ RECUR (OMP_FOR_PRE_BODY (t));
+ pre_body = pop_stmt_list (pre_body);
+
for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (t)); i++)
tsubst_omp_for_iterator (t, i, declv, initv, condv, incrv,
&clauses, args, complain, in_decl,
integral_constant_expression_p);
- pre_body = push_stmt_list ();
- RECUR (OMP_FOR_PRE_BODY (t));
- pre_body = pop_stmt_list (pre_body);
-
body = push_stmt_list ();
RECUR (OMP_FOR_BODY (t));
body = pop_stmt_list (body);
@@ -13520,9 +13535,8 @@ tsubst_copy_and_build (tree t,
/* N3276 decltype magic only applies to calls at the top level or on the
right side of a comma. */
- if (TREE_CODE (t) != CALL_EXPR
- && TREE_CODE (t) != COMPOUND_EXPR)
- complain &= ~tf_decltype;
+ tsubst_flags_t decltype_flag = (complain & tf_decltype);
+ complain &= ~tf_decltype;
switch (TREE_CODE (t))
{
@@ -13611,7 +13625,8 @@ tsubst_copy_and_build (tree t,
r = convert_from_reference (r);
}
else
- r = build_x_indirect_ref (input_location, r, RO_UNARY_STAR, complain);
+ r = build_x_indirect_ref (input_location, r, RO_UNARY_STAR,
+ complain|decltype_flag);
RETURN (r);
}
@@ -13688,7 +13703,8 @@ tsubst_copy_and_build (tree t,
case POSTINCREMENT_EXPR:
op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
args, complain, in_decl);
- RETURN (build_x_unary_op (input_location, TREE_CODE (t), op1, complain));
+ RETURN (build_x_unary_op (input_location, TREE_CODE (t), op1,
+ complain|decltype_flag));
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
@@ -13700,7 +13716,8 @@ tsubst_copy_and_build (tree t,
case REALPART_EXPR:
case IMAGPART_EXPR:
RETURN (build_x_unary_op (input_location, TREE_CODE (t),
- RECUR (TREE_OPERAND (t, 0)), complain));
+ RECUR (TREE_OPERAND (t, 0)),
+ complain|decltype_flag));
case FIX_TRUNC_EXPR:
RETURN (cp_build_unary_op (FIX_TRUNC_EXPR, RECUR (TREE_OPERAND (t, 0)),
@@ -13717,7 +13734,8 @@ tsubst_copy_and_build (tree t,
else
op1 = tsubst_non_call_postfix_expression (op1, args, complain,
in_decl);
- RETURN (build_x_unary_op (input_location, ADDR_EXPR, op1, complain));
+ RETURN (build_x_unary_op (input_location, ADDR_EXPR, op1,
+ complain|decltype_flag));
case PLUS_EXPR:
case MINUS_EXPR:
@@ -13766,7 +13784,7 @@ tsubst_copy_and_build (tree t,
? ERROR_MARK
: TREE_CODE (TREE_OPERAND (t, 1))),
/*overload=*/NULL,
- complain);
+ complain|decltype_flag);
if (EXPR_P (r) && TREE_NO_WARNING (t))
TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
@@ -13782,7 +13800,8 @@ tsubst_copy_and_build (tree t,
op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
args, complain, in_decl);
RETURN (build_x_array_ref (EXPR_LOCATION (t), op1,
- RECUR (TREE_OPERAND (t, 1)), complain));
+ RECUR (TREE_OPERAND (t, 1)),
+ complain|decltype_flag));
case ARRAY_NOTATION_REF:
{
tree start_index, length, stride;
@@ -13886,7 +13905,7 @@ tsubst_copy_and_build (tree t,
RECUR (TREE_OPERAND (t, 0)),
TREE_CODE (TREE_OPERAND (t, 1)),
RECUR (TREE_OPERAND (t, 2)),
- complain);
+ complain|decltype_flag);
/* TREE_NO_WARNING must be set if either the expression was
parenthesized or it uses an operator such as >>= rather
than plain assignment. In the former case, it was already
@@ -13975,7 +13994,7 @@ tsubst_copy_and_build (tree t,
RETURN (build_x_compound_expr (EXPR_LOCATION (t),
op0,
RECUR (TREE_OPERAND (t, 1)),
- complain));
+ complain|decltype_flag));
}
case CALL_EXPR:
@@ -13988,10 +14007,6 @@ tsubst_copy_and_build (tree t,
tree ret;
enum call_context spawning = CILK_CALL_NORMAL;
- /* Don't pass tf_decltype down to subexpressions. */
- tsubst_flags_t decltype_flag = (complain & tf_decltype);
- complain &= ~tf_decltype;
-
function = CALL_EXPR_FN (t);
/* When we parsed the expression, we determined whether or
not Koenig lookup should be performed. */
@@ -15460,6 +15475,135 @@ check_non_deducible_conversion (tree parm, tree arg, int strict,
return unify_arg_conversion (explain_p, parm, type, arg);
}
+static bool uses_deducible_template_parms (tree type);
+
+/* Returns true iff the expression EXPR is one from which a template
+ argument can be deduced. In other words, if it's an undecorated
+ use of a template non-type parameter. */
+
+static bool
+deducible_expression (tree expr)
+{
+ return (TREE_CODE (expr) == TEMPLATE_PARM_INDEX);
+}
+
+/* Returns true iff the array domain DOMAIN uses a template parameter in a
+ deducible way; that is, if it has a max value of <PARM> - 1. */
+
+static bool
+deducible_array_bound (tree domain)
+{
+ if (domain == NULL_TREE)
+ return false;
+
+ tree max = TYPE_MAX_VALUE (domain);
+ if (TREE_CODE (max) != MINUS_EXPR)
+ return false;
+
+ return deducible_expression (TREE_OPERAND (max, 0));
+}
+
+/* Returns true iff the template arguments ARGS use a template parameter
+ in a deducible way. */
+
+static bool
+deducible_template_args (tree args)
+{
+ for (int i = 0; i < TREE_VEC_LENGTH (args); ++i)
+ {
+ bool deducible;
+ tree elt = TREE_VEC_ELT (args, i);
+ if (ARGUMENT_PACK_P (elt))
+ deducible = deducible_template_args (ARGUMENT_PACK_ARGS (elt));
+ else
+ {
+ if (PACK_EXPANSION_P (elt))
+ elt = PACK_EXPANSION_PATTERN (elt);
+ if (TREE_CODE (elt) == TEMPLATE_TEMPLATE_PARM)
+ deducible = true;
+ else if (TYPE_P (elt))
+ deducible = uses_deducible_template_parms (elt);
+ else
+ deducible = deducible_expression (elt);
+ }
+ if (deducible)
+ return true;
+ }
+ return false;
+}
+
+/* Returns true iff TYPE contains any deducible references to template
+ parameters, as per 14.8.2.5. */
+
+static bool
+uses_deducible_template_parms (tree type)
+{
+ if (PACK_EXPANSION_P (type))
+ type = PACK_EXPANSION_PATTERN (type);
+
+ /* T
+ cv-list T
+ TT<T>
+ TT<i>
+ TT<> */
+ if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
+ || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ return true;
+
+ /* T*
+ T&
+ T&& */
+ if (POINTER_TYPE_P (type))
+ return uses_deducible_template_parms (TREE_TYPE (type));
+
+ /* T[integer-constant ]
+ type [i] */
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ return (uses_deducible_template_parms (TREE_TYPE (type))
+ || deducible_array_bound (TYPE_DOMAIN (type)));
+
+ /* T type ::*
+ type T::*
+ T T::*
+ T (type ::*)()
+ type (T::*)()
+ type (type ::*)(T)
+ type (T::*)(T)
+ T (type ::*)(T)
+ T (T::*)()
+ T (T::*)(T) */
+ if (TYPE_PTRMEM_P (type))
+ return (uses_deducible_template_parms (TYPE_PTRMEM_CLASS_TYPE (type))
+ || (uses_deducible_template_parms
+ (TYPE_PTRMEM_POINTED_TO_TYPE (type))));
+
+ /* template-name <T> (where template-name refers to a class template)
+ template-name <i> (where template-name refers to a class template) */
+ if (CLASS_TYPE_P (type)
+ && CLASSTYPE_TEMPLATE_INFO (type)
+ && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)))
+ return deducible_template_args (INNERMOST_TEMPLATE_ARGS
+ (CLASSTYPE_TI_ARGS (type)));
+
+ /* type (T)
+ T()
+ T(T) */
+ if (TREE_CODE (type) == FUNCTION_TYPE
+ || TREE_CODE (type) == METHOD_TYPE)
+ {
+ if (uses_deducible_template_parms (TREE_TYPE (type)))
+ return true;
+ tree parm = TYPE_ARG_TYPES (type);
+ if (TREE_CODE (type) == METHOD_TYPE)
+ parm = TREE_CHAIN (parm);
+ for (; parm; parm = TREE_CHAIN (parm))
+ if (uses_deducible_template_parms (TREE_VALUE (parm)))
+ return true;
+ }
+
+ return false;
+}
+
/* Subroutine of type_unification_real and unify_pack_expansion to
handle unification of a single P/A pair. Parameters are as
for those functions. */
@@ -15479,10 +15623,21 @@ unify_one_argument (tree tparms, tree targs, tree parm, tree arg,
template args from other function args. */
return unify_success (explain_p);
- /* FIXME uses_deducible_template_parms */
+ /* Implicit conversions (Clause 4) will be performed on a function
+ argument to convert it to the type of the corresponding function
+ parameter if the parameter type contains no template-parameters that
+ participate in template argument deduction. */
if (TYPE_P (parm) && !uses_template_parms (parm))
+ /* For function parameters that contain no template-parameters at all,
+ we have historically checked for convertibility in order to shortcut
+ consideration of this candidate. */
return check_non_deducible_conversion (parm, arg, strict, flags,
explain_p);
+ else if (strict == DEDUCE_CALL
+ && TYPE_P (parm) && !uses_deducible_template_parms (parm))
+ /* For function parameters with only non-deducible template parameters,
+ just return. */
+ return unify_success (explain_p);
switch (strict)
{
@@ -17188,9 +17343,6 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
deduces the type of the member as a function type. */
if (TYPE_PTRMEMFUNC_P (arg))
{
- tree method_type;
- tree fntype;
-
/* Check top-level cv qualifiers */
if (!check_cv_quals_for_unify (UNIFY_ALLOW_NONE, arg, parm))
return unify_cv_qual_mismatch (explain_p, parm, arg);
@@ -17200,15 +17352,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
UNIFY_ALLOW_NONE, explain_p);
/* Determine the type of the function we are unifying against. */
- method_type = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (arg));
- fntype =
- build_function_type (TREE_TYPE (method_type),
- TREE_CHAIN (TYPE_ARG_TYPES (method_type)));
-
- /* Extract the cv-qualifiers of the member function from the
- implicit object parameter and place them on the function
- type to be restored later. */
- fntype = apply_memfn_quals (fntype, type_memfn_quals (method_type));
+ tree fntype = static_fn_type (arg);
+
return unify (tparms, targs, TREE_TYPE (parm), fntype, strict, explain_p);
}
@@ -20560,8 +20705,7 @@ build_non_dependent_expr (tree expr)
#ifdef ENABLE_CHECKING
/* Try to get a constant value for all non-dependent expressions in
order to expose bugs in *_dependent_expression_p and constexpr. */
- if (!flag_enable_cilk && cxx_dialect >= cxx0x
- && !instantiation_dependent_expression_p (expr))
+ if (!flag_enable_cilk && cxx_dialect >= cxx0x)
maybe_constant_value (fold_non_dependent_expr_sfinae (expr, tf_none));
#endif
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 15707f8e963..026a881705c 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -326,18 +326,16 @@ build_typeid (tree exp, tsubst_flags_t complain)
/* FIXME when integrating with c_fully_fold, mark
resolves_to_fixed_type_p case as a non-constant expression. */
- if (INDIRECT_REF_P (exp)
- && TYPE_PTR_P (TREE_TYPE (TREE_OPERAND (exp, 0)))
- && TYPE_POLYMORPHIC_P (TREE_TYPE (exp))
+ if (TYPE_POLYMORPHIC_P (TREE_TYPE (exp))
&& ! resolves_to_fixed_type_p (exp, &nonnull)
&& ! nonnull)
{
/* So we need to look into the vtable of the type of exp.
- This is an lvalue use of expr then. */
- exp = mark_lvalue_use (exp);
+ Make sure it isn't a null lvalue. */
+ exp = cp_build_addr_expr (exp, complain);
exp = stabilize_reference (exp);
- cond = cp_convert (boolean_type_node, TREE_OPERAND (exp, 0),
- complain);
+ cond = cp_convert (boolean_type_node, exp, complain);
+ exp = cp_build_indirect_ref (exp, RO_NULL, complain);
}
exp = get_tinfo_decl_dynamic (exp, complain);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index f422a6bf9e6..5098aa06740 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2444,10 +2444,12 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
/* Finish an expression of the form CODE EXPR. */
tree
-finish_unary_op_expr (location_t loc, enum tree_code code, tree expr)
+finish_unary_op_expr (location_t loc, enum tree_code code, tree expr,
+ tsubst_flags_t complain)
{
- tree result = build_x_unary_op (loc, code, expr, tf_warning_or_error);
- if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr))
+ tree result = build_x_unary_op (loc, code, expr, complain);
+ if ((complain & tf_warning)
+ && TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr))
overflow_warning (input_location, result);
return result;
@@ -8335,11 +8337,10 @@ maybe_constant_value (tree t)
tree r;
extern bool contains_array_notation_expr (tree);
- if (type_dependent_expression_p (t)
+ if (instantiation_dependent_expression_p (t)
|| (!flag_enable_cilk && type_unknown_p (t))
|| BRACE_ENCLOSED_INITIALIZER_P (t)
- || (!flag_enable_cilk && !potential_constant_expression (t))
- || value_dependent_expression_p (t))
+ || (!flag_enable_cilk && !potential_constant_expression (t)))
{
if (TREE_OVERFLOW_P (t))
{
@@ -9183,16 +9184,14 @@ lambda_function (tree lambda)
tree
lambda_capture_field_type (tree expr)
{
- tree type;
- if (!TREE_TYPE (expr) || WILDCARD_TYPE_P (TREE_TYPE (expr)))
+ tree type = non_reference (unlowered_expr_type (expr));
+ if (!type || WILDCARD_TYPE_P (type))
{
type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = expr;
DECLTYPE_FOR_LAMBDA_CAPTURE (type) = true;
SET_TYPE_STRUCTURAL_EQUALITY (type);
}
- else
- type = non_reference (unlowered_expr_type (expr));
return type;
}
@@ -9334,13 +9333,12 @@ void
insert_capture_proxy (tree var)
{
cp_binding_level *b;
- int skip;
tree stmt_list;
/* Put the capture proxy in the extra body block so that it won't clash
with a later local variable. */
b = current_binding_level;
- for (skip = 0; ; ++skip)
+ for (;;)
{
cp_binding_level *n = b->level_chain;
if (n->kind == sk_function_parms)
@@ -9351,7 +9349,7 @@ insert_capture_proxy (tree var)
/* And put a DECL_EXPR in the STATEMENT_LIST for the same block. */
var = build_stmt (DECL_SOURCE_LOCATION (var), DECL_EXPR, var);
- stmt_list = (*stmt_list_stack)[stmt_list_stack->length () - 1 - skip];
+ stmt_list = (*stmt_list_stack)[1];
gcc_assert (stmt_list);
append_to_statement_list_force (var, &stmt_list);
}
@@ -9393,7 +9391,7 @@ lambda_proxy_type (tree ref)
if (REFERENCE_REF_P (ref))
ref = TREE_OPERAND (ref, 0);
type = TREE_TYPE (ref);
- if (type && !WILDCARD_TYPE_P (type))
+ if (type && !WILDCARD_TYPE_P (non_reference (type)))
return type;
type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = ref;
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index dabe56b82d1..bfd5edd80d1 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1082,6 +1082,15 @@ cp_build_qualified_type_real (tree type,
/* Retrieve (or create) the appropriately qualified variant. */
result = build_qualified_type (type, type_quals);
+ /* Preserve exception specs and ref-qualifier since build_qualified_type
+ doesn't know about them. */
+ if (TREE_CODE (result) == FUNCTION_TYPE
+ || TREE_CODE (result) == METHOD_TYPE)
+ {
+ result = build_exception_variant (result, TYPE_RAISES_EXCEPTIONS (type));
+ result = build_ref_qualified_type (result, type_memfn_rqual (type));
+ }
+
/* If this was a pointer-to-method type, and we just made a copy,
then we need to unshare the record that holds the cached
pointer-to-member-function type, because these will be distinct
@@ -1215,7 +1224,9 @@ strip_typedefs (tree t)
{
result = build_function_type (type,
arg_types);
- result = apply_memfn_quals (result, type_memfn_quals (t));
+ result = apply_memfn_quals (result,
+ type_memfn_quals (t),
+ type_memfn_rqual (t));
}
if (TYPE_RAISES_EXCEPTIONS (t))
@@ -1245,8 +1256,13 @@ strip_typedefs (tree t)
changed = true;
}
if (changed)
- fullname = lookup_template_function (TREE_OPERAND (fullname, 0),
- new_args);
+ {
+ NON_DEFAULT_TEMPLATE_ARGS_COUNT (new_args)
+ = NON_DEFAULT_TEMPLATE_ARGS_COUNT (args);
+ fullname
+ = lookup_template_function (TREE_OPERAND (fullname, 0),
+ new_args);
+ }
else
ggc_free (new_args);
}
@@ -1379,8 +1395,8 @@ strip_typedefs_expr (tree t)
r = copy_node (t);
for (i = 0; i < n; ++i)
TREE_VEC_ELT (r, i) = (*vec)[i];
- SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT
- (r, GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (t));
+ NON_DEFAULT_TEMPLATE_ARGS_COUNT (r)
+ = NON_DEFAULT_TEMPLATE_ARGS_COUNT (t);
}
else
r = t;
@@ -1703,6 +1719,64 @@ build_qualified_name (tree type, tree scope, tree name, bool template_p)
return t;
}
+/* Like check_qualified_type, but also check ref-qualifier and exception
+ specification. */
+
+static bool
+cp_check_qualified_type (const_tree cand, const_tree base, int type_quals,
+ cp_ref_qualifier rqual, tree raises)
+{
+ return (check_qualified_type (cand, base, type_quals)
+ && comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (cand),
+ ce_exact)
+ && type_memfn_rqual (cand) == rqual);
+}
+
+/* Build the FUNCTION_TYPE or METHOD_TYPE with the ref-qualifier RQUAL. */
+
+tree
+build_ref_qualified_type (tree type, cp_ref_qualifier rqual)
+{
+ tree t;
+
+ if (rqual == type_memfn_rqual (type))
+ return type;
+
+ int type_quals = TYPE_QUALS (type);
+ tree raises = TYPE_RAISES_EXCEPTIONS (type);
+ for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
+ if (cp_check_qualified_type (t, type, type_quals, rqual, raises))
+ return t;
+
+ t = build_variant_type_copy (type);
+ switch (rqual)
+ {
+ case REF_QUAL_RVALUE:
+ FUNCTION_RVALUE_QUALIFIED (t) = 1;
+ /* Intentional fall through */
+ case REF_QUAL_LVALUE:
+ FUNCTION_REF_QUALIFIED (t) = 1;
+ break;
+ default:
+ FUNCTION_REF_QUALIFIED (t) = 0;
+ break;
+ }
+
+ if (TYPE_STRUCTURAL_EQUALITY_P (type))
+ /* Propagate structural equality. */
+ SET_TYPE_STRUCTURAL_EQUALITY (t);
+ else if (TYPE_CANONICAL (type) != type)
+ /* Build the underlying canonical type, since it is different
+ from TYPE. */
+ TYPE_CANONICAL (t) = build_ref_qualified_type (TYPE_CANONICAL (type),
+ rqual);
+ else
+ /* T is its own canonical type. */
+ TYPE_CANONICAL (t) = t;
+
+ return t;
+}
+
/* Returns nonzero if X is an expression for a (possibly overloaded)
function. If "f" is a function or function template, "f", "c->f",
"c.f", "C::f", and "f<int>" will all be considered possibly
@@ -1908,9 +1982,9 @@ build_exception_variant (tree type, tree raises)
return type;
type_quals = TYPE_QUALS (type);
+ cp_ref_qualifier rqual = type_memfn_rqual (type);
for (v = TYPE_MAIN_VARIANT (type); v; v = TYPE_NEXT_VARIANT (v))
- if (check_qualified_type (v, type, type_quals)
- && comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (v), ce_exact))
+ if (cp_check_qualified_type (v, type, type_quals, rqual, raises))
return v;
/* Need to build a new variant. */
@@ -3238,7 +3312,7 @@ handle_abi_tag_attribute (tree* node, tree name, tree args,
{
if (TYPE_P (*node))
{
- if (!TAGGED_TYPE_P (*node))
+ if (!OVERLOAD_TYPE_P (*node))
{
error ("%qE attribute applied to non-class, non-enum type %qT",
name, *node);
@@ -3309,8 +3383,12 @@ cp_build_type_attribute_variant (tree type, tree attributes)
new_type = build_type_attribute_variant (type, attributes);
if (TREE_CODE (new_type) == FUNCTION_TYPE
|| TREE_CODE (new_type) == METHOD_TYPE)
- new_type = build_exception_variant (new_type,
- TYPE_RAISES_EXCEPTIONS (type));
+ {
+ new_type = build_exception_variant (new_type,
+ TYPE_RAISES_EXCEPTIONS (type));
+ new_type = build_ref_qualified_type (new_type,
+ type_memfn_rqual (type));
+ }
/* Making a new main variant of a class type is broken. */
gcc_assert (!CLASS_TYPE_P (type) || new_type == type);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 133d534fb0b..bed70f47e4f 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -54,7 +54,7 @@ static tree get_delta_difference (tree, tree, bool, bool, tsubst_flags_t);
static void casts_away_constness_r (tree *, tree *, tsubst_flags_t);
static bool casts_away_constness (tree, tree, tsubst_flags_t);
static void maybe_warn_about_returning_address_of_local (tree);
-static tree lookup_destructor (tree, tree, tree);
+static tree lookup_destructor (tree, tree, tree, tsubst_flags_t);
static void warn_args_num (location_t, tree, bool);
static int convert_arguments (tree, vec<tree, va_gc> **, tree, int,
tsubst_flags_t);
@@ -834,7 +834,10 @@ merge_types (tree t1, tree t2)
rval = build_function_type (valtype, parms);
gcc_assert (type_memfn_quals (t1) == type_memfn_quals (t2));
- rval = apply_memfn_quals (rval, type_memfn_quals (t1));
+ gcc_assert (type_memfn_rqual (t1) == type_memfn_rqual (t2));
+ rval = apply_memfn_quals (rval,
+ type_memfn_quals (t1),
+ type_memfn_rqual (t1));
raises = merge_exception_specifiers (TYPE_RAISES_EXCEPTIONS (t1),
TYPE_RAISES_EXCEPTIONS (t2),
NULL_TREE);
@@ -1186,6 +1189,12 @@ structural_comptypes (tree t1, tree t2, int strict)
if (TREE_CODE (t1) == FUNCTION_TYPE
&& type_memfn_quals (t1) != type_memfn_quals (t2))
return false;
+ /* Need to check this before TYPE_MAIN_VARIANT.
+ FIXME function qualifiers should really change the main variant. */
+ if ((TREE_CODE (t1) == FUNCTION_TYPE
+ || TREE_CODE (t1) == METHOD_TYPE)
+ && type_memfn_rqual (t1) != type_memfn_rqual (t2))
+ return false;
if (TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2))
return false;
@@ -2462,7 +2471,8 @@ build_class_member_access_expr (tree object, tree member,
SCOPE is NULL, by OBJECT.DTOR_NAME, where DTOR_NAME is ~type. */
static tree
-lookup_destructor (tree object, tree scope, tree dtor_name)
+lookup_destructor (tree object, tree scope, tree dtor_name,
+ tsubst_flags_t complain)
{
tree object_type = TREE_TYPE (object);
tree dtor_type = TREE_OPERAND (dtor_name, 0);
@@ -2470,8 +2480,9 @@ lookup_destructor (tree object, tree scope, tree dtor_name)
if (scope && !check_dtor_name (scope, dtor_type))
{
- error ("qualified type %qT does not match destructor name ~%qT",
- scope, dtor_type);
+ if (complain & tf_error)
+ error ("qualified type %qT does not match destructor name ~%qT",
+ scope, dtor_type);
return error_mark_node;
}
if (identifier_p (dtor_type))
@@ -2482,16 +2493,18 @@ lookup_destructor (tree object, tree scope, tree dtor_name)
dtor_type = object_type;
else
{
- error ("object type %qT does not match destructor name ~%qT",
- object_type, dtor_type);
+ if (complain & tf_error)
+ error ("object type %qT does not match destructor name ~%qT",
+ object_type, dtor_type);
return error_mark_node;
}
}
else if (!DERIVED_FROM_P (dtor_type, TYPE_MAIN_VARIANT (object_type)))
{
- error ("the type being destroyed is %qT, but the destructor refers to %qT",
- TYPE_MAIN_VARIANT (object_type), dtor_type);
+ if (complain & tf_error)
+ error ("the type being destroyed is %qT, but the destructor "
+ "refers to %qT", TYPE_MAIN_VARIANT (object_type), dtor_type);
return error_mark_node;
}
expr = lookup_member (dtor_type, complete_dtor_identifier,
@@ -2677,6 +2690,23 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
return error_mark_node;
}
+ if (TREE_CODE (scope) == ENUMERAL_TYPE)
+ {
+ /* Looking up a member enumerator (c++/56793). */
+ if (!TYPE_CLASS_SCOPE_P (scope)
+ || !DERIVED_FROM_P (TYPE_CONTEXT (scope), object_type))
+ {
+ if (complain & tf_error)
+ error ("%<%D::%D%> is not a member of %qT",
+ scope, name, object_type);
+ return error_mark_node;
+ }
+ tree val = lookup_enumerator (scope, name);
+ if (TREE_SIDE_EFFECTS (object))
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (val), object, val);
+ return val;
+ }
+
gcc_assert (CLASS_TYPE_P (scope));
gcc_assert (identifier_p (name) || TREE_CODE (name) == BIT_NOT_EXPR);
@@ -2707,7 +2737,7 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
}
if (TREE_CODE (name) == BIT_NOT_EXPR)
- member = lookup_destructor (object, scope, name);
+ member = lookup_destructor (object, scope, name, complain);
else
{
/* Look up the member. */
@@ -3932,7 +3962,8 @@ cp_build_binary_op (location_t location,
if ((invalid_op_diag
= targetm.invalid_binary_op (code, type0, type1)))
{
- error (invalid_op_diag);
+ if (complain & tf_error)
+ error (invalid_op_diag);
return error_mark_node;
}
@@ -4046,8 +4077,9 @@ cp_build_binary_op (location_t location,
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
{
enum tree_code tcode0 = code0, tcode1 = code1;
+ tree cop1 = fold_non_dependent_expr_sfinae (op1, tf_none);
- warn_for_div_by_zero (location, maybe_constant_value (op1));
+ warn_for_div_by_zero (location, maybe_constant_value (cop1));
if (tcode0 == COMPLEX_TYPE || tcode0 == VECTOR_TYPE)
tcode0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0)));
@@ -4083,7 +4115,11 @@ cp_build_binary_op (location_t location,
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
- warn_for_div_by_zero (location, maybe_constant_value (op1));
+ {
+ tree cop1 = fold_non_dependent_expr_sfinae (op1, tf_none);
+
+ warn_for_div_by_zero (location, maybe_constant_value (cop1));
+ }
if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
&& TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE
@@ -4131,7 +4167,8 @@ cp_build_binary_op (location_t location,
}
else if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
- tree const_op1 = maybe_constant_value (op1);
+ tree const_op1 = fold_non_dependent_expr_sfinae (op1, tf_none);
+ const_op1 = maybe_constant_value (const_op1);
if (TREE_CODE (const_op1) != INTEGER_CST)
const_op1 = op1;
result_type = type0;
@@ -4177,7 +4214,8 @@ cp_build_binary_op (location_t location,
}
else if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
- tree const_op1 = maybe_constant_value (op1);
+ tree const_op1 = fold_non_dependent_expr_sfinae (op1, tf_none);
+ const_op1 = maybe_constant_value (const_op1);
if (TREE_CODE (const_op1) != INTEGER_CST)
const_op1 = op1;
result_type = type0;
@@ -4592,7 +4630,8 @@ cp_build_binary_op (location_t location,
|| !same_scalar_type_ignoring_signedness (TREE_TYPE (type0),
TREE_TYPE (type1)))
{
- binary_op_error (location, code, type0, type1);
+ if (complain & tf_error)
+ binary_op_error (location, code, type0, type1);
return error_mark_node;
}
arithmetic_types_p = 1;
@@ -4604,11 +4643,12 @@ cp_build_binary_op (location_t location,
&& (shorten || common || short_compare))
{
result_type = cp_common_type (type0, type1);
- do_warn_double_promotion (result_type, type0, type1,
- "implicit conversion from %qT to %qT "
- "to match other operand of binary "
- "expression",
- location);
+ if (complain & tf_warning)
+ do_warn_double_promotion (result_type, type0, type1,
+ "implicit conversion from %qT to %qT "
+ "to match other operand of binary "
+ "expression",
+ location);
}
if (!result_type)
@@ -4946,10 +4986,11 @@ build_x_unary_op (location_t loc, enum tree_code code, tree xarg,
tree fn = get_first_fn (xarg);
if (DECL_CONSTRUCTOR_P (fn) || DECL_DESTRUCTOR_P (fn))
{
- error (DECL_CONSTRUCTOR_P (fn)
- ? G_("taking address of constructor %qE")
- : G_("taking address of destructor %qE"),
- xarg);
+ if (complain & tf_error)
+ error (DECL_CONSTRUCTOR_P (fn)
+ ? G_("taking address of constructor %qE")
+ : G_("taking address of destructor %qE"),
+ xarg);
return error_mark_node;
}
}
@@ -4962,17 +5003,23 @@ build_x_unary_op (location_t loc, enum tree_code code, tree xarg,
if (TREE_CODE (xarg) != OFFSET_REF
|| !TYPE_P (TREE_OPERAND (xarg, 0)))
{
- error ("invalid use of %qE to form a pointer-to-member-function",
- xarg);
- if (TREE_CODE (xarg) != OFFSET_REF)
- inform (input_location, " a qualified-id is required");
+ if (complain & tf_error)
+ {
+ error ("invalid use of %qE to form a "
+ "pointer-to-member-function", xarg);
+ if (TREE_CODE (xarg) != OFFSET_REF)
+ inform (input_location, " a qualified-id is required");
+ }
return error_mark_node;
}
else
{
- error ("parentheses around %qE cannot be used to form a"
- " pointer-to-member-function",
- xarg);
+ if (complain & tf_error)
+ error ("parentheses around %qE cannot be used to form a"
+ " pointer-to-member-function",
+ xarg);
+ else
+ return error_mark_node;
PTRMEM_OK_P (xarg) = 1;
}
}
@@ -5401,7 +5448,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
: code),
TREE_TYPE (xarg))))
{
- error (invalid_op_diag);
+ if (complain & tf_error)
+ error (invalid_op_diag);
return error_mark_node;
}
@@ -5587,15 +5635,16 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
else
return error_mark_node;
}
- else if ((pedantic || warn_pointer_arith)
- && !TYPE_PTROB_P (argtype))
+ else if (!TYPE_PTROB_P (argtype))
{
if (complain & tf_error)
- permerror (input_location, (code == PREINCREMENT_EXPR
+ pedwarn (input_location,
+ pedantic ? OPT_Wpedantic : OPT_Wpointer_arith,
+ (code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
- ? G_("ISO C++ forbids incrementing a pointer of type %qT")
- : G_("ISO C++ forbids decrementing a pointer of type %qT"),
- argtype);
+ ? G_("ISO C++ forbids incrementing a pointer of type %qT")
+ : G_("ISO C++ forbids decrementing a pointer of type %qT"),
+ argtype);
else
return error_mark_node;
}
@@ -6033,7 +6082,8 @@ cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain)
if (type_unknown_p (rhs))
{
- error ("no context to resolve type of %qE", rhs);
+ if (complain & tf_error)
+ error ("no context to resolve type of %qE", rhs);
return error_mark_node;
}
@@ -7583,8 +7633,13 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p,
if (!force
&& !can_convert_arg (to_type, TREE_TYPE (pfn), pfn,
LOOKUP_NORMAL, complain))
- error ("invalid conversion to type %qT from type %qT",
- to_type, pfn_type);
+ {
+ if (complain & tf_error)
+ error ("invalid conversion to type %qT from type %qT",
+ to_type, pfn_type);
+ else
+ return error_mark_node;
+ }
n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type),
@@ -8610,6 +8665,22 @@ cp_type_quals (const_tree type)
return quals;
}
+/* Returns the function-ref-qualifier for TYPE */
+
+cp_ref_qualifier
+type_memfn_rqual (const_tree type)
+{
+ gcc_assert (TREE_CODE (type) == FUNCTION_TYPE
+ || TREE_CODE (type) == METHOD_TYPE);
+
+ if (!FUNCTION_REF_QUALIFIED (type))
+ return REF_QUAL_NONE;
+ else if (FUNCTION_RVALUE_QUALIFIED (type))
+ return REF_QUAL_RVALUE;
+ else
+ return REF_QUAL_LVALUE;
+}
+
/* Returns the function-cv-quals for TYPE, which must be a FUNCTION_TYPE or
METHOD_TYPE. */
@@ -8625,18 +8696,22 @@ type_memfn_quals (const_tree type)
}
/* Returns the FUNCTION_TYPE TYPE with its function-cv-quals changed to
- MEMFN_QUALS. */
+ MEMFN_QUALS and its ref-qualifier to RQUAL. */
tree
-apply_memfn_quals (tree type, cp_cv_quals memfn_quals)
+apply_memfn_quals (tree type, cp_cv_quals memfn_quals, cp_ref_qualifier rqual)
{
/* Could handle METHOD_TYPE here if necessary. */
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
- if (TYPE_QUALS (type) == memfn_quals)
+ if (TYPE_QUALS (type) == memfn_quals
+ && type_memfn_rqual (type) == rqual)
return type;
+
/* This should really have a different TYPE_MAIN_VARIANT, but that gets
complex. */
- return build_qualified_type (type, memfn_quals);
+ tree result = build_qualified_type (type, memfn_quals);
+ result = build_exception_variant (result, TYPE_RAISES_EXCEPTIONS (type));
+ return build_ref_qualified_type (result, rqual);
}
/* Returns nonzero if TYPE is const or volatile. */
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 6d9012fa7da..a3d06a8956f 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -265,9 +265,13 @@ abstract_virtuals_error_sfinae (tree decl, tree type, abstract_class_use use,
return 0;
type = TYPE_MAIN_VARIANT (type);
+#if 0
+ /* Instantiation here seems to be required by the standard,
+ but breaks e.g. boost::bind. FIXME! */
/* In SFINAE, non-N3276 context, force instantiation. */
if (!(complain & (tf_error|tf_decltype)))
complete_type (type);
+#endif
/* If the type is incomplete, we register it within a hash table,
so that we can check again once it is completed. This makes sense
@@ -1708,7 +1712,32 @@ build_m_component_ref (tree datum, tree component, tsubst_flags_t complain)
return datum;
}
else
- return build2 (OFFSET_REF, type, datum, component);
+ {
+ /* 5.5/6: In a .* expression whose object expression is an rvalue, the
+ program is ill-formed if the second operand is a pointer to member
+ function with ref-qualifier &. In a .* expression whose object
+ expression is an lvalue, the program is ill-formed if the second
+ operand is a pointer to member function with ref-qualifier &&. */
+ if (FUNCTION_REF_QUALIFIED (type))
+ {
+ bool lval = real_lvalue_p (datum);
+ if (lval && FUNCTION_RVALUE_QUALIFIED (type))
+ {
+ if (complain & tf_error)
+ error ("pointer-to-member-function type %qT requires an rvalue",
+ ptrmem_type);
+ return error_mark_node;
+ }
+ else if (!lval && !FUNCTION_RVALUE_QUALIFIED (type))
+ {
+ if (complain & tf_error)
+ error ("pointer-to-member-function type %qT requires an lvalue",
+ ptrmem_type);
+ return error_mark_node;
+ }
+ }
+ return build2 (OFFSET_REF, type, datum, component);
+ }
}
/* Return a tree node for the expression TYPENAME '(' PARMS ')'. */
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 855a1d2873d..6a6b5f1fd10 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -1930,6 +1930,6 @@ struct rtl_opt_pass pass_rtl_cprop =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/cse.c b/gcc/cse.c
index b200fef4dfb..f2c8f635d39 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7466,8 +7466,7 @@ struct rtl_opt_pass pass_cse =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect |
- TODO_verify_flow, /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
@@ -7529,7 +7528,6 @@ struct rtl_opt_pass pass_cse2 =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect |
TODO_verify_flow /* todo_flags_finish */
}
};
@@ -7590,7 +7588,6 @@ struct rtl_opt_pass pass_cse_after_global_opts =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect |
TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/dce.c b/gcc/dce.c
index b7ecc3046a1..64ed81e35e8 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -802,8 +802,7 @@ struct rtl_opt_pass pass_ud_rtl_dce =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
@@ -1218,7 +1217,6 @@ struct rtl_opt_pass pass_fast_rtl_dce =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/df-core.c b/gcc/df-core.c
index d392cd6867e..e602290d8f4 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -1800,7 +1800,7 @@ df_find_def (rtx insn, rtx reg)
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
df_ref def = *def_rec;
- if (rtx_equal_p (DF_REF_REAL_REG (def), reg))
+ if (DF_REF_REGNO (def) == REGNO (reg))
return def;
}
@@ -1834,14 +1834,14 @@ df_find_use (rtx insn, rtx reg)
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
df_ref use = *use_rec;
- if (rtx_equal_p (DF_REF_REAL_REG (use), reg))
+ if (DF_REF_REGNO (use) == REGNO (reg))
return use;
}
if (df->changeable_flags & DF_EQ_NOTES)
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
df_ref use = *use_rec;
- if (rtx_equal_p (DF_REF_REAL_REG (use), reg))
+ if (DF_REF_REGNO (use) == REGNO (reg))
return use;
}
return NULL;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index fdfa93190ce..e8ee1892ef8 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -1158,8 +1158,17 @@ df_insn_delete (rtx insn)
In any case, we expect BB to be non-NULL at least up to register
allocation, so disallow a non-NULL BB up to there. Not perfect
but better than nothing... */
-
+ /* ??? bb can also be NULL if lower-subreg.c:resolve_simple_mov emits
+ an insn into a sequence and then does delete_insn on it. Not sure
+ if that makes sense, but for now it means this assert cannot work.
+ See PR56738.
+ Disable for now but revisit before the end of GCC 4.9 stage1. */
+#if 0
gcc_checking_assert (bb != NULL || reload_completed);
+#else
+ if (bb == NULL)
+ return;
+#endif
df_grow_bb_info (df_scan);
df_grow_reg_info ();
diff --git a/gcc/diagnostic-color.c b/gcc/diagnostic-color.c
new file mode 100644
index 00000000000..8680b504af5
--- /dev/null
+++ b/gcc/diagnostic-color.c
@@ -0,0 +1,307 @@
+/* Output colorization.
+ Copyright 2011-2013 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, 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. */
+
+#include "config.h"
+#include "system.h"
+#include "diagnostic-color.h"
+
+/* Select Graphic Rendition (SGR, "\33[...m") strings. */
+/* Also Erase in Line (EL) to Right ("\33[K") by default. */
+/* Why have EL to Right after SGR?
+ -- The behavior of line-wrapping when at the bottom of the
+ terminal screen and at the end of the current line is often
+ such that a new line is introduced, entirely cleared with
+ the current background color which may be different from the
+ default one (see the boolean back_color_erase terminfo(5)
+ capability), thus scrolling the display by one line.
+ The end of this new line will stay in this background color
+ even after reverting to the default background color with
+ "\33[m', unless it is explicitly cleared again with "\33[K"
+ (which is the behavior the user would instinctively expect
+ from the whole thing). There may be some unavoidable
+ background-color flicker at the end of this new line because
+ of this (when timing with the monitor's redraw is just right).
+ -- The behavior of HT (tab, "\t") is usually the same as that of
+ Cursor Forward Tabulation (CHT) with a default parameter
+ of 1 ("\33[I"), i.e., it performs pure movement to the next
+ tab stop, without any clearing of either content or screen
+ attributes (including background color); try
+ printf 'asdfqwerzxcv\rASDF\tZXCV\n'
+ in a bash(1) shell to demonstrate this. This is not what the
+ user would instinctively expect of HT (but is ok for CHT).
+ The instinctive behavior would include clearing the terminal
+ cells that are skipped over by HT with blank cells in the
+ current screen attributes, including background color;
+ the boolean dest_tabs_magic_smso terminfo(5) capability
+ indicates this saner behavior for HT, but only some rare
+ terminals have it (although it also indicates a special
+ glitch with standout mode in the Teleray terminal for which
+ it was initially introduced). The remedy is to add "\33K"
+ after each SGR sequence, be it START (to fix the behavior
+ of any HT after that before another SGR) or END (to fix the
+ behavior of an HT in default background color that would
+ follow a line-wrapping at the bottom of the screen in another
+ background color, and to complement doing it after START).
+ Piping GCC's output through a pager such as less(1) avoids
+ any HT problems since the pager performs tab expansion.
+
+ Generic disadvantages of this remedy are:
+ -- Some very rare terminals might support SGR but not EL (nobody
+ will use "gcc -fdiagnostics-color" on a terminal that does not
+ support SGR in the first place).
+ -- Having these extra control sequences might somewhat complicate
+ the task of any program trying to parse "gcc -fdiagnostics-color"
+ output in order to extract structuring information from it.
+ A specific disadvantage to doing it after SGR START is:
+ -- Even more possible background color flicker (when timing
+ with the monitor's redraw is just right), even when not at the
+ bottom of the screen.
+ There are no additional disadvantages specific to doing it after
+ SGR END.
+
+ It would be impractical for GCC to become a full-fledged
+ terminal program linked against ncurses or the like, so it will
+ not detect terminfo(5) capabilities. */
+#define COLOR_SEPARATOR ";"
+#define COLOR_NONE "00"
+#define COLOR_BOLD "01"
+#define COLOR_UNDERSCORE "04"
+#define COLOR_BLINK "05"
+#define COLOR_REVERSE "07"
+#define COLOR_FG_BLACK "30"
+#define COLOR_FG_RED "31"
+#define COLOR_FG_GREEN "32"
+#define COLOR_FG_YELLOW "33"
+#define COLOR_FG_BLUE "34"
+#define COLOR_FG_MAGENTA "35"
+#define COLOR_FG_CYAN "36"
+#define COLOR_FG_WHITE "37"
+#define COLOR_BG_BLACK "40"
+#define COLOR_BG_RED "41"
+#define COLOR_BG_GREEN "42"
+#define COLOR_BG_YELLOW "43"
+#define COLOR_BG_BLUE "44"
+#define COLOR_BG_MAGENTA "45"
+#define COLOR_BG_CYAN "46"
+#define COLOR_BG_WHITE "47"
+#define SGR_START "\33["
+#define SGR_END "m\33[K"
+#define SGR_SEQ(str) SGR_START str SGR_END
+#define SGR_RESET SGR_SEQ("")
+
+
+/* The context and logic for choosing default --color screen attributes
+ (foreground and background colors, etc.) are the following.
+ -- There are eight basic colors available, each with its own
+ nominal luminosity to the human eye and foreground/background
+ codes (black [0 %, 30/40], blue [11 %, 34/44], red [30 %, 31/41],
+ magenta [41 %, 35/45], green [59 %, 32/42], cyan [70 %, 36/46],
+ yellow [89 %, 33/43], and white [100 %, 37/47]).
+ -- Sometimes, white as a background is actually implemented using
+ a shade of light gray, so that a foreground white can be visible
+ on top of it (but most often not).
+ -- Sometimes, black as a foreground is actually implemented using
+ a shade of dark gray, so that it can be visible on top of a
+ background black (but most often not).
+ -- Sometimes, more colors are available, as extensions.
+ -- Other attributes can be selected/deselected (bold [1/22],
+ underline [4/24], standout/inverse [7/27], blink [5/25], and
+ invisible/hidden [8/28]). They are sometimes implemented by
+ using colors instead of what their names imply; e.g., bold is
+ often achieved by using brighter colors. In practice, only bold
+ is really available to us, underline sometimes being mapped by
+ the terminal to some strange color choice, and standout best
+ being left for use by downstream programs such as less(1).
+ -- We cannot assume that any of the extensions or special features
+ are available for the purpose of choosing defaults for everyone.
+ -- The most prevalent default terminal backgrounds are pure black
+ and pure white, and are not necessarily the same shades of
+ those as if they were selected explicitly with SGR sequences.
+ Some terminals use dark or light pictures as default background,
+ but those are covered over by an explicit selection of background
+ color with an SGR sequence; their users will appreciate their
+ background pictures not be covered like this, if possible.
+ -- Some uses of colors attributes is to make some output items
+ more understated (e.g., context lines); this cannot be achieved
+ by changing the background color.
+ -- For these reasons, the GCC color defaults should strive not
+ to change the background color from its default, unless it's
+ for a short item that should be highlighted, not understated.
+ -- The GCC foreground color defaults (without an explicitly set
+ background) should provide enough contrast to be readable on any
+ terminal with either a black (dark) or white (light) background.
+ This only leaves red, magenta, green, and cyan (and their bold
+ counterparts) and possibly bold blue. */
+/* Default colors. The user can overwrite them using environment
+ variable GCC_COLORS. */
+struct color_cap
+{
+ const char *name;
+ const char *val;
+ unsigned char name_len;
+ bool free_val;
+};
+
+/* For GCC_COLORS. */
+static struct color_cap color_dict[] =
+{
+ { "error", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_RED), 5, false },
+ { "warning", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_MAGENTA),
+ 7, false },
+ { "note", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_CYAN), 4, false },
+ { "caret", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_GREEN), 5, false },
+ { "locus", SGR_SEQ (COLOR_BOLD), 5, false },
+ { "quote", SGR_SEQ (COLOR_BOLD), 5, false },
+ { NULL, NULL, 0, false }
+};
+
+const char *
+colorize_start (bool show_color, const char *name, size_t name_len)
+{
+ struct color_cap const *cap;
+
+ if (!show_color)
+ return "";
+
+ for (cap = color_dict; cap->name; cap++)
+ if (cap->name_len == name_len
+ && memcmp (cap->name, name, name_len) == 0)
+ break;
+ if (cap->name == NULL)
+ return "";
+
+ return cap->val;
+}
+
+const char *
+colorize_stop (bool show_color)
+{
+ return show_color ? SGR_RESET : "";
+}
+
+/* Parse GCC_COLORS. The default would look like:
+ GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+ No character escaping is needed or supported. */
+static bool
+parse_gcc_colors (void)
+{
+ const char *p, *q, *name, *val;
+ char *b;
+ size_t name_len = 0, val_len = 0;
+
+ p = getenv ("GCC_COLORS"); /* Plural! */
+ if (p == NULL)
+ return true;
+ if (*p == '\0')
+ return false;
+
+ name = q = p;
+ val = NULL;
+ /* From now on, be well-formed or you're gone. */
+ for (;;)
+ if (*q == ':' || *q == '\0')
+ {
+ struct color_cap *cap;
+
+ if (val)
+ val_len = q - val;
+ else
+ name_len = q - name;
+ /* Empty name without val (empty cap)
+ won't match and will be ignored. */
+ for (cap = color_dict; cap->name; cap++)
+ if (cap->name_len == name_len
+ && memcmp (cap->name, name, name_len) == 0)
+ break;
+ /* If name unknown, go on for forward compatibility. */
+ if (cap->val && val)
+ {
+ if (cap->free_val)
+ free (CONST_CAST (char *, cap->val));
+ b = XNEWVEC (char, val_len + sizeof (SGR_SEQ ("")));
+ memcpy (b, SGR_START, strlen (SGR_START));
+ memcpy (b + strlen (SGR_START), val, val_len);
+ memcpy (b + strlen (SGR_START) + val_len, SGR_END,
+ sizeof (SGR_END));
+ cap->val = (const char *) b;
+ cap->free_val = true;
+ }
+ if (*q == '\0')
+ return true;
+ name = ++q;
+ val = NULL;
+ }
+ else if (*q == '=')
+ {
+ if (q == name || val)
+ return true;
+
+ name_len = q - name;
+ val = ++q; /* Can be the empty string. */
+ }
+ else if (val == NULL)
+ q++; /* Accumulate name. */
+ else if (*q == ';' || (*q >= '0' && *q <= '9'))
+ q++; /* Accumulate val. Protect the terminal from being sent
+ garbage. */
+ else
+ return true;
+}
+
+#if defined(_WIN32)
+static bool
+should_colorize (void)
+{
+ return false;
+}
+
+bool
+colorize_init (void)
+{
+ return false;
+}
+#else
+
+/* Return true if we should use color when in auto mode, false otherwise. */
+static bool
+should_colorize (void)
+{
+ char const *t = getenv ("TERM");
+ return t && strcmp (t, "dumb") != 0 && isatty (STDERR_FILENO);
+}
+
+
+bool
+colorize_init (diagnostic_color_rule_t rule)
+{
+ switch (rule)
+ {
+ case DIAGNOSTICS_COLOR_NO:
+ return false;
+ case DIAGNOSTICS_COLOR_YES:
+ return parse_gcc_colors ();
+ case DIAGNOSTICS_COLOR_AUTO:
+ if (should_colorize ())
+ return parse_gcc_colors ();
+ else
+ return false;
+ default:
+ gcc_unreachable ();
+ }
+}
+#endif
diff --git a/gcc/diagnostic-color.h b/gcc/diagnostic-color.h
new file mode 100644
index 00000000000..e643e5188c0
--- /dev/null
+++ b/gcc/diagnostic-color.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+ Contributed by Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+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/>. */
+
+/* Based on code from: */
+/* grep.c - main driver file for grep.
+ Copyright (C) 1992, 1997-2002, 2004-2013 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, 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.
+
+ Written July 1992 by Mike Haertel. */
+
+#ifndef GCC_DIAGNOSTIC_COLOR_H
+#define GCC_DIAGNOSTIC_COLOR_H
+
+/* How often diagnostics are prefixed by their locations:
+ o DIAGNOSTICS_SHOW_PREFIX_NEVER: never - not yet supported;
+ o DIAGNOSTICS_SHOW_PREFIX_ONCE: emit only once;
+ o DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: emit each time a physical
+ line is started. */
+typedef enum
+{
+ DIAGNOSTICS_COLOR_NO = 0,
+ DIAGNOSTICS_COLOR_YES = 1,
+ DIAGNOSTICS_COLOR_AUTO = 2
+} diagnostic_color_rule_t;
+
+const char *colorize_start (bool, const char *, size_t);
+const char *colorize_stop (bool);
+bool colorize_init (diagnostic_color_rule_t);
+
+inline const char *
+colorize_start (bool show_color, const char *name)
+{
+ return colorize_start (show_color, name, strlen (name));
+}
+
+#endif /* ! GCC_DIAGNOSTIC_COLOR_H */
diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h
index 68ec837fc57..a2107820e6e 100644
--- a/gcc/diagnostic-core.h
+++ b/gcc/diagnostic-core.h
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
/* Constants used to discriminate diagnostics. */
typedef enum
{
-#define DEFINE_DIAGNOSTIC_KIND(K, msgid) K,
+#define DEFINE_DIAGNOSTIC_KIND(K, msgid, C) K,
#include "diagnostic.def"
#undef DEFINE_DIAGNOSTIC_KIND
DK_LAST_DIAGNOSTIC_KIND,
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 87eb8dc40ab..e454cf31af2 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "backtrace.h"
#include "diagnostic.h"
+#include "diagnostic-color.h"
#define pedantic_warning_kind(DC) \
((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
@@ -53,7 +54,6 @@ const char *progname;
/* A diagnostic_context surrogate for stderr. */
static diagnostic_context global_diagnostic_context;
diagnostic_context *global_dc = &global_diagnostic_context;
-
/* Return a malloc'd string containing MSG formatted a la printf. The
caller is responsible for freeing the memory. */
@@ -210,12 +210,31 @@ diagnostic_build_prefix (diagnostic_context *context,
const diagnostic_info *diagnostic)
{
static const char *const diagnostic_kind_text[] = {
-#define DEFINE_DIAGNOSTIC_KIND(K, T) (T),
+#define DEFINE_DIAGNOSTIC_KIND(K, T, C) (T),
#include "diagnostic.def"
#undef DEFINE_DIAGNOSTIC_KIND
"must-not-happen"
};
+ static const char *const diagnostic_kind_color[] = {
+#define DEFINE_DIAGNOSTIC_KIND(K, T, C) (C),
+#include "diagnostic.def"
+#undef DEFINE_DIAGNOSTIC_KIND
+ NULL
+ };
const char *text = _(diagnostic_kind_text[diagnostic->kind]);
+ const char *text_cs = "", *text_ce = "";
+ const char *locus_cs, *locus_ce;
+ pretty_printer *pp = context->printer;
+
+ if (diagnostic_kind_color[diagnostic->kind])
+ {
+ text_cs = colorize_start (pp_show_color (pp),
+ diagnostic_kind_color[diagnostic->kind]);
+ text_ce = colorize_stop (pp_show_color (pp));
+ }
+ locus_cs = colorize_start (pp_show_color (pp), "locus");
+ locus_ce = colorize_stop (pp_show_color (pp));
+
expanded_location s = expand_location_to_spelling_point (diagnostic->location);
if (diagnostic->override_column)
s.column = diagnostic->override_column;
@@ -223,10 +242,13 @@ diagnostic_build_prefix (diagnostic_context *context,
return
(s.file == NULL
- ? build_message_string ("%s: %s", progname, text)
+ ? build_message_string ("%s%s:%s %s%s%s", locus_cs, progname, locus_ce,
+ text_cs, text, text_ce)
: context->show_column
- ? build_message_string ("%s:%d:%d: %s", s.file, s.line, s.column, text)
- : build_message_string ("%s:%d: %s", s.file, s.line, text));
+ ? build_message_string ("%s%s:%d:%d:%s %s%s%s", locus_cs, s.file, s.line,
+ s.column, locus_ce, text_cs, text, text_ce)
+ : build_message_string ("%s%s:%d:%s %s%s%s", locus_cs, s.file, s.line, locus_ce,
+ text_cs, text, text_ce));
}
/* If LINE is longer than MAX_WIDTH, and COLUMN is not smaller than
@@ -262,7 +284,7 @@ diagnostic_show_locus (diagnostic_context * context,
expanded_location s;
int max_width;
const char *saved_prefix;
-
+ const char *caret_cs, *caret_ce;
if (!context->show_caret
|| diagnostic->location <= BUILTINS_LOCATION
@@ -290,9 +312,13 @@ diagnostic_show_locus (diagnostic_context * context,
line++;
}
pp_newline (context->printer);
+ caret_cs = colorize_start (pp_show_color (context->printer), "caret");
+ caret_ce = colorize_stop (pp_show_color (context->printer));
+
/* pp_printf does not implement %*c. */
- buffer = XALLOCAVEC (char, s.column + 3);
- snprintf (buffer, s.column + 3, " %*c", s.column, '^');
+ size_t len = s.column + 3 + strlen (caret_cs) + strlen (caret_ce);
+ buffer = XALLOCAVEC (char, len);
+ snprintf (buffer, len, "%s %*c%s", caret_cs, s.column, '^', caret_ce);
pp_string (context->printer, buffer);
pp_set_prefix (context->printer, saved_prefix);
}
diff --git a/gcc/diagnostic.def b/gcc/diagnostic.def
index 9566491ca2a..2f1e36515ad 100644
--- a/gcc/diagnostic.def
+++ b/gcc/diagnostic.def
@@ -22,26 +22,26 @@ along with GCC; see the file COPYING3. If not see
kind specified. I.e. they're uninitialized. Within the diagnostic
machinery, this kind also means "don't change the existing kind",
meaning "no change is specified". */
-DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "")
+DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "", NULL)
/* If a diagnostic is set to DK_IGNORED, it won't get reported at all.
This is used by the diagnostic machinery when it wants to disable a
diagnostic without disabling the option which causes it. */
-DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "")
+DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "", NULL)
/* The remainder are real diagnostic types. */
-DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ")
-DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ")
-DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ")
-DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ")
-DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ")
-DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ")
-DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ")
-DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ")
+DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ", "error")
+DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ", "error")
+DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ", "error")
+DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ", "error")
+DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ", "warning")
+DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ", "warning")
+DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ", "note")
+DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ", "note")
/* These two would be re-classified as DK_WARNING or DK_ERROR, so the
prefix does not matter. */
-DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ")
-DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ")
+DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ", NULL)
+DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ", NULL)
/* This one is just for counting DK_WARNING promoted to DK_ERROR
due to -Werror and -Werror=warning. */
-DEFINE_DIAGNOSTIC_KIND (DK_WERROR, "error: ")
+DEFINE_DIAGNOSTIC_KIND (DK_WERROR, "error: ", NULL)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3530b475ae0..e136c9d19f9 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -226,6 +226,7 @@ Objective-C and Objective-C++ Dialects}.
@xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
@gccoptlist{-fmessage-length=@var{n} @gol
-fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]} @gol
+-fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]} @gol
-fno-diagnostics-show-option -fno-diagnostics-show-caret}
@item Warning Options
@@ -656,7 +657,8 @@ Objective-C and Objective-C++ Dialects}.
-mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
-m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
-msse2avx -mfentry -m8bit-idiv @gol
--mavx256-split-unaligned-load -mavx256-split-unaligned-store}
+-mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
+-mstack-protector-guard=@var{guard}}
@emph{i386 and x86-64 Windows Options}
@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
@@ -2956,6 +2958,76 @@ messages reporter to emit the same source location information (as
prefix) for physical lines that result from the process of breaking
a message which is too long to fit on a single line.
+@item -fdiagnostics-color[=@var{WHEN}]
+@itemx -fno-diagnostics-color
+@opindex fdiagnostics-color
+@cindex highlight, color, colour
+@vindex GCC_COLORS @r{environment variable}
+Use color in diagnostics. @var{WHEN} is @samp{never}, @samp{always},
+or @samp{auto}. The default is @samp{never}, @samp{auto} means to use color
+only when the standard error is a terminal. The forms
+@option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
+aliases for @option{-fdiagnostics-color=always} and
+@option{-fdiagnostics-color=never}, respectively.
+
+The colors are defined by the environment variable @env{GCC_COLORS}.
+Its value is a colon-separated list of capabilities and Select Graphic
+Rendition (SGR) substrings. SGR commands are interpreted by the
+terminal or terminal emulator. (See the section in the documentation
+of your text terminal for permitted values and their meanings as
+character attributes.) These substring values are integers in decimal
+representation and can be concatenated with semicolons.
+Common values to concatenate include
+@samp{1} for bold,
+@samp{4} for underline,
+@samp{5} for blink,
+@samp{7} for inverse,
+@samp{39} for default foreground color,
+@samp{30} to @samp{37} for foreground colors,
+@samp{90} to @samp{97} for 16-color mode foreground colors,
+@samp{38;5;0} to @samp{38;5;255}
+for 88-color and 256-color modes foreground colors,
+@samp{49} for default background color,
+@samp{40} to @samp{47} for background colors,
+@samp{100} to @samp{107} for 16-color mode background colors,
+and @samp{48;5;0} to @samp{48;5;255}
+for 88-color and 256-color modes background colors.
+
+The default @env{GCC_COLORS} is
+@samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
+where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
+@samp{01;36} is bold cyan, @samp{01;32} is bold green and
+@samp{01} is bold. Setting @env{GCC_COLORS} to the empty
+string disables colors.
+Supported capabilities are as follows.
+
+@table @code
+@item error=
+@vindex error GCC_COLORS @r{capability}
+SGR substring for error: markers.
+
+@item warning=
+@vindex warning GCC_COLORS @r{capability}
+SGR substring for warning: markers.
+
+@item note=
+@vindex note GCC_COLORS @r{capability}
+SGR substring for note: markers.
+
+@item caret=
+@vindex caret GCC_COLORS @r{capability}
+SGR substring for caret line.
+
+@item locus=
+@vindex locus GCC_COLORS @r{capability}
+SGR substring for location information, @samp{file:line} or
+@samp{file:line:column} etc.
+
+@item quote=
+@vindex quote GCC_COLORS @r{capability}
+SGR substring for information printed within quotes.
+@end table
+
@item -fno-diagnostics-show-option
@opindex fno-diagnostics-show-option
@opindex fdiagnostics-show-option
@@ -11266,8 +11338,8 @@ assembly code. Permissible names are: @samp{arm2}, @samp{arm250},
@samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
@samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
@samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9},
-@samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
-@samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
+@samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-r4}, @samp{cortex-r4f},
+@samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
@samp{cortex-m1},
@samp{cortex-m0},
@samp{cortex-m0plus},
@@ -14521,6 +14593,13 @@ to 255, 8-bit unsigned integer divide is used instead of
@opindex avx256-split-unaligned-store
Split 32-byte AVX unaligned load and store.
+@item -mstack-protector-guard=@var{guard}
+@opindex mstack-protector-guard=@var{guard}
+Generate stack protection code using canary at @var{guard}. Supported
+locations are @samp{global} or @samp{tls} per thread at %gs:20 (the default).
+This option has effect only when @option{-fstack-protector}
+or @option{-fstack-protector-all} is also specified.
+
@end table
These @samp{-m} switches are supported in addition to the above
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index a9890f88ee7..8829b0e3493 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -3099,17 +3099,10 @@ side-effects.
@findex sequence
@item (sequence [@var{insns} @dots{}])
-Represents a sequence of insns. Each of the @var{insns} that appears
-in the vector is suitable for appearing in the chain of insns, so it
-must be an @code{insn}, @code{jump_insn}, @code{call_insn},
-@code{code_label}, @code{barrier} or @code{note}.
-
-A @code{sequence} RTX is never placed in an actual insn during RTL
-generation. It represents the sequence of insns that result from a
-@code{define_expand} @emph{before} those insns are passed to
-@code{emit_insn} to insert them in the chain of insns. When actually
-inserted, the individual sub-insns are separated out and the
-@code{sequence} is forgotten.
+Represents a sequence of insns. If a @code{sequence} appears in the
+chain of insns, then each of the @var{insns} that appears in the sequence
+must be suitable for appearing in the chain of insns, i.e. must satisfy
+the @code{INSN_P} predicate.
After delay-slot scheduling is completed, an insn and all the insns that
reside in its delay slots are grouped together into a @code{sequence}.
@@ -3123,6 +3116,19 @@ the effect of the insns in the delay slots. In such a case,
the branch and should be executed only if the branch is taken; otherwise
the insn should be executed only if the branch is not taken.
@xref{Delay Slots}.
+
+Some back ends also use @code{sequence} objects for purposes other than
+delay-slot groups. This is not supported in the common parts of the
+compiler, which treat such sequences as delay-slot groups.
+
+DWARF2 Call Frame Address (CFA) adjustments are sometimes also expressed
+using @code{sequence} objects as the value of a @code{RTX_FRAME_RELATED_P}
+note. This only happens if the CFA adjustments cannot be easily derived
+from the pattern of the instruction to which the note is attached. In
+such cases, the value of the note is used instead of best-guesing the
+semantics of the instruction. The back end can attach notes containing
+a @code{sequence} of @code{set} patterns that express the effect of the
+parent instruction.
@end table
These expression codes appear in place of a side effect, as the body of
@@ -3602,28 +3608,8 @@ of debugging information.
@item NOTE_INSN_EH_REGION_BEG
@itemx NOTE_INSN_EH_REGION_END
These types of notes indicate the position of the beginning and end of a
-level of scoping for exception handling. @code{NOTE_BLOCK_NUMBER}
-identifies which @code{CODE_LABEL} or @code{note} of type
-@code{NOTE_INSN_DELETED_LABEL} is associated with the given region.
-
-@findex NOTE_INSN_LOOP_BEG
-@findex NOTE_INSN_LOOP_END
-@item NOTE_INSN_LOOP_BEG
-@itemx NOTE_INSN_LOOP_END
-These types of notes indicate the position of the beginning and end
-of a @code{while} or @code{for} loop. They enable the loop optimizer
-to find loops quickly.
-
-@findex NOTE_INSN_LOOP_CONT
-@item NOTE_INSN_LOOP_CONT
-Appears at the place in a loop that @code{continue} statements jump to.
-
-@findex NOTE_INSN_LOOP_VTOP
-@item NOTE_INSN_LOOP_VTOP
-This note indicates the place in a loop where the exit test begins for
-those loops in which the exit test has been duplicated. This position
-becomes another virtual start of the loop when considering loop
-invariants.
+level of scoping for exception handling. @code{NOTE_EH_HANDLER}
+identifies which region is associated with these notes.
@findex NOTE_INSN_FUNCTION_BEG
@item NOTE_INSN_FUNCTION_BEG
diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi
index be464e9522e..e8be08fb905 100644
--- a/gcc/doc/standards.texi
+++ b/gcc/doc/standards.texi
@@ -280,13 +280,8 @@ available online, see @uref{http://gcc.gnu.org/readings.html}
@section Go language
-The Go language continues to evolve as of this writing; see the
-@uref{http://golang.org/@/ref/@/spec, current language
-specifications}. At present there are no specific versions of Go, and
-there is no way to describe the language supported by GCC in terms of
-a specific version. In general GCC tracks the evolving specification
-closely, and any given release will support the language as of the
-date that the release was frozen.
+As of the GCC 4.7.1 release, GCC supports the Go 1 language standard,
+described at @uref{http://golang.org/doc/go1.html}.
@section References for other languages
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b95001f685f..c7bf3f415d3 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -260,7 +260,8 @@ line, but, unlike @code{LIBGCC_SPEC}, it is used unmodified.
@defmac USE_LD_AS_NEEDED
A macro that controls the modifications to @code{LIBGCC_SPEC}
mentioned in @code{REAL_LIBGCC_SPEC}. If nonzero, a spec will be
-generated that uses --as-needed and the shared libgcc in place of the
+generated that uses @option{--as-needed} or equivalent options and the
+shared @file{libgcc} in place of the
static exception handler library, when linking without any of
@code{-static}, @code{-static-libgcc}, or @code{-shared-libgcc}.
@end defmac
@@ -2905,6 +2906,10 @@ A target hook which returns true if an address with the same structure can have
This hook defines a class of registers which could be used for spilling pseudos of the given mode and class, or @code{NO_REGS} if only memory should be used. Not defining this hook is equivalent to returning @code{NO_REGS} for all inputs.
@end deftypefn
+@deftypefn {Target Hook} {enum machine_mode} TARGET_CSTORE_MODE (enum insn_code @var{icode})
+This hook defines the machine mode to use for the boolean result of conditional store patterns. The ICODE argument is the instruction code for the cstore being performed. Not definiting this hook is the same as accepting the mode encoded into operand 0 of the cstore expander patterns.
+@end deftypefn
+
@node Old Constraints
@section Obsolete Macros for Defining Constraints
@cindex defining constraints, obsolete method
@@ -9069,8 +9074,8 @@ The maximum number of bytes to skip before @var{label} when applying
@end deftypefn
@defmac LOOP_ALIGN (@var{label})
-The alignment (log base 2) to put in front of @var{label}, which follows
-a @code{NOTE_INSN_LOOP_BEG} note.
+The alignment (log base 2) to put in front of @var{label} that heads
+a frequently executed basic block (usually the header of a loop).
This macro need not be defined if you don't want any special alignment
to be done at such a time. Most machine descriptions do not currently
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index ce7d67f790e..ca1c54152ff 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -260,7 +260,8 @@ line, but, unlike @code{LIBGCC_SPEC}, it is used unmodified.
@defmac USE_LD_AS_NEEDED
A macro that controls the modifications to @code{LIBGCC_SPEC}
mentioned in @code{REAL_LIBGCC_SPEC}. If nonzero, a spec will be
-generated that uses --as-needed and the shared libgcc in place of the
+generated that uses @option{--as-needed} or equivalent options and the
+shared @file{libgcc} in place of the
static exception handler library, when linking without any of
@code{-static}, @code{-static-libgcc}, or @code{-shared-libgcc}.
@end defmac
@@ -2873,6 +2874,8 @@ as below:
@hook TARGET_SPILL_CLASS
+@hook TARGET_CSTORE_MODE
+
@node Old Constraints
@section Obsolete Macros for Defining Constraints
@cindex defining constraints, obsolete method
@@ -8920,8 +8923,8 @@ The maximum number of bytes to skip before @var{label} when applying
@end deftypefn
@defmac LOOP_ALIGN (@var{label})
-The alignment (log base 2) to put in front of @var{label}, which follows
-a @code{NOTE_INSN_LOOP_BEG} note.
+The alignment (log base 2) to put in front of @var{label} that heads
+a frequently executed basic block (usually the header of a loop).
This macro need not be defined if you don't want any special alignment
to be done at such a time. Most machine descriptions do not currently
diff --git a/gcc/dse.c b/gcc/dse.c
index 629d2387923..d643cb0b4fa 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -3745,8 +3745,7 @@ struct rtl_opt_pass pass_rtl_dse1 =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
@@ -3766,7 +3765,6 @@ struct rtl_opt_pass pass_rtl_dse2 =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 3e11509bab4..2e22744b1fb 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18837,6 +18837,7 @@ gen_producer_string (void)
case OPT_fdiagnostics_show_location_:
case OPT_fdiagnostics_show_option:
case OPT_fdiagnostics_show_caret:
+ case OPT_fdiagnostics_color_:
case OPT_fverbose_asm:
case OPT____:
case OPT__sysroot_:
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 73a59b58046..5a24a7913c4 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2596,16 +2596,13 @@ verify_rtx_sharing (rtx orig, rtx insn)
return;
}
-/* Go through all the RTL insn bodies and check that there is no unexpected
- sharing in between the subexpressions. */
+/* Go through all the RTL insn bodies and clear all the USED bits. */
-DEBUG_FUNCTION void
-verify_rtl_sharing (void)
+static void
+reset_all_used_flags (void)
{
rtx p;
- timevar_push (TV_VERIFY_RTL_SHARING);
-
for (p = get_insns (); p; p = NEXT_INSN (p))
if (INSN_P (p))
{
@@ -2629,6 +2626,19 @@ verify_rtl_sharing (void)
}
}
}
+}
+
+/* Go through all the RTL insn bodies and check that there is no unexpected
+ sharing in between the subexpressions. */
+
+DEBUG_FUNCTION void
+verify_rtl_sharing (void)
+{
+ rtx p;
+
+ timevar_push (TV_VERIFY_RTL_SHARING);
+
+ reset_all_used_flags ();
for (p = get_insns (); p; p = NEXT_INSN (p))
if (INSN_P (p))
@@ -2639,6 +2649,8 @@ verify_rtl_sharing (void)
verify_rtx_sharing (CALL_INSN_FUNCTION_USAGE (p), p);
}
+ reset_all_used_flags ();
+
timevar_pop (TV_VERIFY_RTL_SHARING);
}
@@ -3908,8 +3920,21 @@ set_insn_deleted (rtx insn)
}
-/* Remove an insn from its doubly-linked list. This function knows how
- to handle sequences. */
+/* Unlink INSN from the insn chain.
+
+ This function knows how to handle sequences.
+
+ This function does not invalidate data flow information associated with
+ INSN (i.e. does not call df_insn_delete). That makes this function
+ usable for only disconnecting an insn from the chain, and re-emit it
+ elsewhere later.
+
+ To later insert INSN elsewhere in the insn chain via add_insn and
+ similar functions, PREV_INSN and NEXT_INSN must be nullified by
+ the caller. Nullifying them here breaks many insn chain walks.
+
+ To really delete an insn and related DF information, use delete_insn. */
+
void
remove_insn (rtx insn)
{
@@ -3968,10 +3993,6 @@ remove_insn (rtx insn)
gcc_assert (stack);
}
- /* Invalidate data flow information associated with INSN. */
- if (INSN_P (insn))
- df_insn_delete (insn);
-
/* Fix up basic block boundaries, if necessary. */
if (!BARRIER_P (insn)
&& (bb = BLOCK_FOR_INSN (insn)))
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d66c6e667fb..3c3a179701f 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -5081,7 +5081,7 @@ emit_cstore (rtx target, enum insn_code icode, enum rtx_code code,
{
struct expand_operand ops[4];
rtx op0, last, comparison, subtarget;
- enum machine_mode result_mode = insn_data[(int) icode].operand[0].mode;
+ enum machine_mode result_mode = targetm.cstore_mode (icode);
last = get_last_insn ();
x = prepare_operand (icode, x, 2, mode, compare_mode, unsignedp);
diff --git a/gcc/final.c b/gcc/final.c
index fc827bdee51..e6c4e8942ab 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -811,8 +811,7 @@ struct rtl_opt_pass pass_compute_alignments =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_verify_rtl_sharing
- | TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
@@ -4406,7 +4405,7 @@ struct rtl_opt_pass pass_final =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 905661cf7e6..59dbc034c4f 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -984,12 +984,22 @@ int_const_binop_1 (enum tree_code code, const_tree arg1, const_tree arg2,
break;
case MULT_HIGHPART_EXPR:
- /* ??? Need quad precision, or an additional shift operand
- to the multiply primitive, to handle very large highparts. */
if (TYPE_PRECISION (type) > HOST_BITS_PER_WIDE_INT)
- return NULL_TREE;
- tmp = op1 - op2;
- res = tmp.rshift (TYPE_PRECISION (type), TYPE_PRECISION (type), !uns);
+ {
+ bool dummy_overflow;
+ if (TYPE_PRECISION (type) != 2 * HOST_BITS_PER_WIDE_INT)
+ return NULL_TREE;
+ op1.wide_mul_with_sign (op2, uns, &res, &dummy_overflow);
+ }
+ else
+ {
+ bool dummy_overflow;
+ /* MULT_HIGHPART_EXPR can't ever oveflow, as the multiplication
+ is performed in twice the precision of arguments. */
+ tmp = op1.mul_with_sign (op2, false, &dummy_overflow);
+ res = tmp.rshift (TYPE_PRECISION (type),
+ 2 * TYPE_PRECISION (type), !uns);
+ }
break;
case TRUNC_DIV_EXPR:
@@ -1342,21 +1352,44 @@ const_binop (enum tree_code code, tree arg1, tree arg2)
if (TREE_CODE (arg1) == VECTOR_CST
&& TREE_CODE (arg2) == VECTOR_CST)
{
- tree type = TREE_TYPE(arg1);
+ tree type = TREE_TYPE (arg1);
int count = TYPE_VECTOR_SUBPARTS (type), i;
- tree *elts = XALLOCAVEC (tree, count);
+ tree *elts = XALLOCAVEC (tree, count);
for (i = 0; i < count; i++)
{
- tree elem1 = VECTOR_CST_ELT (arg1, i);
+ tree elem1 = VECTOR_CST_ELT (arg1, i);
tree elem2 = VECTOR_CST_ELT (arg2, i);
- elts[i] = const_binop (code, elem1, elem2);
+ elts[i] = const_binop (code, elem1, elem2);
+
+ /* It is possible that const_binop cannot handle the given
+ code and return NULL_TREE */
+ if (elts[i] == NULL_TREE)
+ return NULL_TREE;
+ }
+
+ return build_vector (type, elts);
+ }
+
+ /* Shifts allow a scalar offset for a vector. */
+ if (TREE_CODE (arg1) == VECTOR_CST
+ && TREE_CODE (arg2) == INTEGER_CST)
+ {
+ tree type = TREE_TYPE (arg1);
+ int count = TYPE_VECTOR_SUBPARTS (type), i;
+ tree *elts = XALLOCAVEC (tree, count);
+
+ for (i = 0; i < count; i++)
+ {
+ tree elem1 = VECTOR_CST_ELT (arg1, i);
- /* It is possible that const_binop cannot handle the given
- code and return NULL_TREE */
- if(elts[i] == NULL_TREE)
- return NULL_TREE;
+ elts[i] = const_binop (code, elem1, arg2);
+
+ /* It is possible that const_binop cannot handle the given
+ code and return NULL_TREE */
+ if (elts[i] == NULL_TREE)
+ return NULL_TREE;
}
return build_vector (type, elts);
@@ -5850,8 +5883,10 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
/* The last case is if we are a multiply. In that case, we can
apply the distributive law to commute the multiply and addition
- if the multiplication of the constants doesn't overflow. */
- if (code == MULT_EXPR)
+ if the multiplication of the constants doesn't overflow
+ and overflow is defined. With undefined overflow
+ op0 * c might overflow, while (op0 + orig_op1) * c doesn't. */
+ if (code == MULT_EXPR && TYPE_OVERFLOW_WRAPS (ctype))
return fold_build2 (tcode, ctype,
fold_build2 (code, ctype,
fold_convert (ctype, op0),
@@ -9857,7 +9892,8 @@ fold_binary_loc (location_t loc,
|| (TREE_CODE (arg0) == FIXED_CST && TREE_CODE (arg1) == FIXED_CST)
|| (TREE_CODE (arg0) == FIXED_CST && TREE_CODE (arg1) == INTEGER_CST)
|| (TREE_CODE (arg0) == COMPLEX_CST && TREE_CODE (arg1) == COMPLEX_CST)
- || (TREE_CODE (arg0) == VECTOR_CST && TREE_CODE (arg1) == VECTOR_CST))
+ || (TREE_CODE (arg0) == VECTOR_CST && TREE_CODE (arg1) == VECTOR_CST)
+ || (TREE_CODE (arg0) == VECTOR_CST && TREE_CODE (arg1) == INTEGER_CST))
{
if (kind == tcc_binary)
{
@@ -13924,6 +13960,29 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
return pedantic_omit_one_operand_loc (loc, type, arg1, arg2);
if (integer_zerop (arg0))
return pedantic_omit_one_operand_loc (loc, type, arg2, arg1);
+
+ if ((TREE_CODE (arg1) == VECTOR_CST
+ || TREE_CODE (arg1) == CONSTRUCTOR)
+ && (TREE_CODE (arg2) == VECTOR_CST
+ || TREE_CODE (arg2) == CONSTRUCTOR))
+ {
+ unsigned int nelts = TYPE_VECTOR_SUBPARTS (type), i;
+ unsigned char *sel = XALLOCAVEC (unsigned char, nelts);
+ gcc_assert (nelts == VECTOR_CST_NELTS (arg0));
+ for (i = 0; i < nelts; i++)
+ {
+ tree val = VECTOR_CST_ELT (arg0, i);
+ if (integer_all_onesp (val))
+ sel[i] = i;
+ else if (integer_zerop (val))
+ sel[i] = nelts + i;
+ else /* Currently unreachable. */
+ return NULL_TREE;
+ }
+ tree t = fold_vec_perm (type, arg1, arg2, sel);
+ if (t != NULL_TREE)
+ return t;
+ }
}
if (operand_equal_p (arg1, op2, 0))
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7f9a1a5ccb3..8baf108dd25 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,146 @@
+2013-04-15 Tobias Burnus <burnus@net-b.de>
+
+ * intrinsic.texi (SYSTEM_CLOCK): Recommend kind=8.
+
+2013-04-15 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/56919
+ * intrinsics.texi (SYSTEM_CLOCK): Update documentation.
+
+2013-04-15 Tobias Burnus <burnus@net-b.de>
+
+ * class.c (gfc_find_intrinsic_vtab): Removed unused var.
+ * dependency.c (check_data_pointer_types): Fix check.
+ * frontend-passes.c (check_data_pointer_types): Remove
+ superfluous statement.
+ * parse.c (decode_omp_directive): Add missing break.
+ * resolve.c (resolve_typebound_subroutine: Free variable.
+ * trans-decl.c (create_function_arglist): Correct condition.
+
+2013-04-14 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/56816
+ * match.c (gfc_match_select_type): Add syntax error. Move namespace
+ allocation and cleanup...
+ * parse.c (decode_statement): ... here.
+
+2013-04-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55959
+ * expr.c (gfc_simplify_expr): Branch is not unreachable.
+
+2013-04-12 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56266
+ * primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.
+
+2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56929
+ * trans-array.c (duplicate_allocatable): Fix handling
+ of scalar coarrays.
+
+2013-04-12 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56261
+ * gfortran.h (gfc_explicit_interface_required): New prototype.
+ * expr.c (gfc_check_pointer_assign): Check if an explicit interface is
+ required in a proc-ptr assignment.
+ * interface.c (check_result_characteristics): Extra check.
+ * resolve.c (gfc_explicit_interface_required): New function.
+ (resolve_global_procedure): Use new function
+ 'gfc_explicit_interface_required'. Do a full interface check.
+
+2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56845
+ * trans-decl.c (gfc_trans_deferred_vars): Restrict
+ static CLASS init to SAVE and -fno-automatic.
+
+2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56845
+ * trans-decl.c (gfc_trans_deferred_vars): Set _vptr for
+ allocatable static BT_CLASS.
+ * trans-expr.c (gfc_class_set_static_fields): New function.
+ * trans.h (gfc_class_set_static_fields): New prototype.
+
+2013-04-11 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type.
+ * arith.c: Replace gfc_try with bool type.
+ * array.c: Likewise.
+ * check.c: Likewise.
+ * class.c: Likewise.
+ * cpp.c: Likewise.
+ * cpp.h: Likewise.
+ * data.c: Likewise.
+ * data.h: Likewise.
+ * decl.c: Likewise.
+ * error.c: Likewise.
+ * expr.c: Likewise.
+ * f95-lang.c: Likewise.
+ * interface.c: Likewise.
+ * intrinsic.c: Likewise.
+ * intrinsic.h: Likewise.
+ * io.c: Likewise.
+ * match.c: Likewise.
+ * match.h: Likewise.
+ * module.c: Likewise.
+ * openmp.c: Likewise.
+ * parse.c: Likewise.
+ * parse.h: Likewise.
+ * primary.c: Likewise.
+ * resolve.c: Likewise.
+ * scanner.c: Likewise.
+ * simplify.c: Likewise.
+ * symbol.c: Likewise.
+ * trans-intrinsic.c: Likewise.
+ * trans-openmp.c: Likewise.
+ * trans-stmt.c: Likewise.
+ * trans-types.c: Likewise.
+
+2013-04-09 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.texi (KIND Type Parameters,
+ Internal representation of LOGICAL variables): Add crossrefs.
+ (Intrinsic Types): Mention issues with _Bool interop.
+ (Naming and argument-passing conventions): New section.
+
+2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/56782
+ * frontend-passes.c (callback_reduction): Dont't do
+ any simplification if there is only a single element
+ which has an iterator.
+
+2013-04-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56849
+ * iresolve.c (gfc_resolve_reshape): Set shape also
+ with order=.
+
+2013-04-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/40881
+ * match.c (gfc_match_return): Remove standard notification.
+ * primary.c (gfc_match_actual_arglist): Add standard notification.
+
+2013-04-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50269
+ * gcc/fortran/check.c (is_c_interoperable,
+ gfc_check_c_loc): Correct c_loc array checking
+ for Fortran 2003 and Fortran 2008.
+
+2013-04-03 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56284
+ PR fortran/40881
+ * decl.c (gfc_match_formal_arglist): Warn about alternate-return
+ arguments.
+ * interface.c (check_dummy_characteristics): Return if symbols are NULL.
+
2013-04-01 Janus Weil <janus@gcc.gnu.org>
PR fortran/56500
@@ -274,7 +417,7 @@
* trans-array.c (structure_alloc_comps): Handle procedure-pointer
components with allocatable result.
-2012-02-21 Tobias Burnus <burnus@net-b.de>
+2013-02-21 Tobias Burnus <burnus@net-b.de>
PR fortran/56416
* gfortran.texi (Part II: Language Reference, Extensions,
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 83a9e3c24ea..3339585988a 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -901,9 +901,9 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
if (gfc_init_expr_flag)
{
- if (gfc_notify_std (GFC_STD_F2003, "Noninteger "
- "exponent in an initialization "
- "expression at %L", &op2->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Noninteger "
+ "exponent in an initialization "
+ "expression at %L", &op2->where))
{
gfc_free_expr (result);
return ARITH_PROHIBIT;
@@ -926,9 +926,9 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
if (gfc_init_expr_flag)
{
- if (gfc_notify_std (GFC_STD_F2003, "Noninteger "
- "exponent in an initialization "
- "expression at %L", &op2->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Noninteger "
+ "exponent in an initialization "
+ "expression at %L", &op2->where))
{
gfc_free_expr (result);
return ARITH_PROHIBIT;
@@ -1347,8 +1347,7 @@ reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
gfc_expr *r;
arith rc = ARITH_OK;
- if (gfc_check_conformance (op1, op2,
- "elemental binary operation") != SUCCESS)
+ if (!gfc_check_conformance (op1, op2, "elemental binary operation"))
return ARITH_INCOMMENSURATE;
head = gfc_constructor_copy (op1->value.constructor);
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 6ee292c2a76..c2ac1ece1e6 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -300,15 +300,15 @@ gfc_free_array_spec (gfc_array_spec *as)
/* Take an array bound, resolves the expression, that make up the
shape and check associated constraints. */
-static gfc_try
+static bool
resolve_array_bound (gfc_expr *e, int check_constant)
{
if (e == NULL)
- return SUCCESS;
+ return true;
- if (gfc_resolve_expr (e) == FAILURE
- || gfc_specification_expr (e) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (e)
+ || !gfc_specification_expr (e))
+ return false;
if (check_constant && !gfc_is_constant_expr (e))
{
@@ -318,34 +318,34 @@ resolve_array_bound (gfc_expr *e, int check_constant)
else
gfc_error ("Expression at %L in this context must be constant",
&e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Takes an array specification, resolves the expressions that make up
the shape and make sure everything is integral. */
-gfc_try
+bool
gfc_resolve_array_spec (gfc_array_spec *as, int check_constant)
{
gfc_expr *e;
int i;
if (as == NULL)
- return SUCCESS;
+ return true;
for (i = 0; i < as->rank + as->corank; i++)
{
e = as->lower[i];
- if (resolve_array_bound (e, check_constant) == FAILURE)
- return FAILURE;
+ if (!resolve_array_bound (e, check_constant))
+ return false;
e = as->upper[i];
- if (resolve_array_bound (e, check_constant) == FAILURE)
- return FAILURE;
+ if (!resolve_array_bound (e, check_constant))
+ return false;
if ((as->lower[i] == NULL) || (as->upper[i] == NULL))
continue;
@@ -363,7 +363,7 @@ gfc_resolve_array_spec (gfc_array_spec *as, int check_constant)
}
}
- return SUCCESS;
+ return true;
}
@@ -412,7 +412,7 @@ match_array_element_spec (gfc_array_spec *as)
gfc_error ("Expected expression in array specification at %C");
if (m != MATCH_YES)
return AS_UNKNOWN;
- if (gfc_expr_check_typed (*upper, gfc_current_ns, false) == FAILURE)
+ if (!gfc_expr_check_typed (*upper, gfc_current_ns, false))
return AS_UNKNOWN;
if (gfc_match_char (':') == MATCH_NO)
@@ -432,7 +432,7 @@ match_array_element_spec (gfc_array_spec *as)
return AS_UNKNOWN;
if (m == MATCH_NO)
return AS_ASSUMED_SHAPE;
- if (gfc_expr_check_typed (*upper, gfc_current_ns, false) == FAILURE)
+ if (!gfc_expr_check_typed (*upper, gfc_current_ns, false))
return AS_UNKNOWN;
return AS_EXPLICIT;
@@ -467,8 +467,7 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim)
as->type = AS_ASSUMED_RANK;
as->rank = -1;
- if (gfc_notify_std (GFC_STD_F2008_TS, "Assumed-rank array at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008_TS, "Assumed-rank array at %C"))
goto cleanup;
if (!match_codim)
@@ -576,9 +575,8 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim)
}
if (as->corank + as->rank >= 7
- && gfc_notify_std (GFC_STD_F2008, "Array "
- "specification at %C with more than 7 dimensions")
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "Array specification at %C "
+ "with more than 7 dimensions"))
goto cleanup;
}
@@ -589,8 +587,7 @@ coarray:
if (gfc_match_char ('[') != MATCH_YES)
goto done;
- if (gfc_notify_std (GFC_STD_F2008, "Coarray declaration at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "Coarray declaration at %C"))
goto cleanup;
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
@@ -730,26 +727,26 @@ cleanup:
have that array specification. The error locus is needed in case
something goes wrong. On failure, the caller must free the spec. */
-gfc_try
+bool
gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
{
int i;
if (as == NULL)
- return SUCCESS;
+ return true;
if (as->rank
- && gfc_add_dimension (&sym->attr, sym->name, error_loc) == FAILURE)
- return FAILURE;
+ && !gfc_add_dimension (&sym->attr, sym->name, error_loc))
+ return false;
if (as->corank
- && gfc_add_codimension (&sym->attr, sym->name, error_loc) == FAILURE)
- return FAILURE;
+ && !gfc_add_codimension (&sym->attr, sym->name, error_loc))
+ return false;
if (sym->as == NULL)
{
sym->as = as;
- return SUCCESS;
+ return true;
}
if ((sym->as->type == AS_ASSUMED_RANK && as->corank)
@@ -757,7 +754,7 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
{
gfc_error ("The assumed-rank array '%s' at %L shall not have a "
"codimension", sym->name, error_loc);
- return FAILURE;
+ return false;
}
if (as->corank)
@@ -799,7 +796,7 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
}
free (as);
- return SUCCESS;
+ return true;
}
@@ -1060,8 +1057,8 @@ gfc_match_array_constructor (gfc_expr **result)
return MATCH_NO;
else
{
- if (gfc_notify_std (GFC_STD_F2003, "[...] "
- "style array constructors at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "[...] "
+ "style array constructors at %C"))
return MATCH_ERROR;
end_delim = " ]";
}
@@ -1082,8 +1079,8 @@ gfc_match_array_constructor (gfc_expr **result)
if (seen_ts)
{
- if (gfc_notify_std (GFC_STD_F2003, "Array constructor "
- "including type specification at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Array constructor "
+ "including type specification at %C"))
{
gfc_restore_last_undo_checkpoint ();
goto cleanup;
@@ -1196,7 +1193,7 @@ check_element_type (gfc_expr *expr, bool convert)
return 0;
if (convert)
- return gfc_convert_type (expr, &constructor_ts, 1) == SUCCESS ? 0 : 1;
+ return gfc_convert_type(expr, &constructor_ts, 1) ? 0 : 1;
gfc_error ("Element in %s array constructor at %L is %s",
gfc_typename (&constructor_ts), &expr->where,
@@ -1209,7 +1206,7 @@ check_element_type (gfc_expr *expr, bool convert)
/* Recursive work function for gfc_check_constructor_type(). */
-static gfc_try
+static bool
check_constructor_type (gfc_constructor_base base, bool convert)
{
gfc_constructor *c;
@@ -1221,27 +1218,27 @@ check_constructor_type (gfc_constructor_base base, bool convert)
if (e->expr_type == EXPR_ARRAY)
{
- if (check_constructor_type (e->value.constructor, convert) == FAILURE)
- return FAILURE;
+ if (!check_constructor_type (e->value.constructor, convert))
+ return false;
continue;
}
if (check_element_type (e, convert))
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Check that all elements of an array constructor are the same type.
- On FAILURE, an error has been generated. */
+ On false, an error has been generated. */
-gfc_try
+bool
gfc_check_constructor_type (gfc_expr *e)
{
- gfc_try t;
+ bool t;
if (e->ts.type != BT_UNKNOWN)
{
@@ -1257,7 +1254,7 @@ gfc_check_constructor_type (gfc_expr *e)
/* If e->ts.type != BT_UNKNOWN, the array constructor included a
typespec, and we will now convert the values on the fly. */
t = check_constructor_type (e->value.constructor, e->ts.type != BT_UNKNOWN);
- if (t == SUCCESS && e->ts.type == BT_UNKNOWN)
+ if (t && e->ts.type == BT_UNKNOWN)
e->ts = constructor_ts;
return t;
@@ -1274,12 +1271,12 @@ cons_stack;
static cons_stack *base;
-static gfc_try check_constructor (gfc_constructor_base, gfc_try (*) (gfc_expr *));
+static bool check_constructor (gfc_constructor_base, bool (*) (gfc_expr *));
/* Check an EXPR_VARIABLE expression in a constructor to make sure
that that variable is an iteration variables. */
-gfc_try
+bool
gfc_check_iter_variable (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -1289,9 +1286,9 @@ gfc_check_iter_variable (gfc_expr *expr)
for (c = base; c && c->iterator; c = c->previous)
if (sym == c->iterator->var->symtree->n.sym)
- return SUCCESS;
+ return true;
- return FAILURE;
+ return false;
}
@@ -1299,12 +1296,12 @@ gfc_check_iter_variable (gfc_expr *expr)
to calling the check function for each expression in the
constructor, giving variables with the names of iterators a pass. */
-static gfc_try
-check_constructor (gfc_constructor_base ctor, gfc_try (*check_function) (gfc_expr *))
+static bool
+check_constructor (gfc_constructor_base ctor, bool (*check_function) (gfc_expr *))
{
cons_stack element;
gfc_expr *e;
- gfc_try t;
+ bool t;
gfc_constructor *c;
for (c = gfc_constructor_first (ctor); c; c = gfc_constructor_next (c))
@@ -1313,8 +1310,8 @@ check_constructor (gfc_constructor_base ctor, gfc_try (*check_function) (gfc_exp
if (e->expr_type != EXPR_ARRAY)
{
- if ((*check_function) (e) == FAILURE)
- return FAILURE;
+ if (!(*check_function)(e))
+ return false;
continue;
}
@@ -1325,12 +1322,12 @@ check_constructor (gfc_constructor_base ctor, gfc_try (*check_function) (gfc_exp
t = check_constructor (e->value.constructor, check_function);
base = element.previous;
- if (t == FAILURE)
- return FAILURE;
+ if (!t)
+ return false;
}
/* Nothing went wrong, so all OK. */
- return SUCCESS;
+ return true;
}
@@ -1338,11 +1335,11 @@ check_constructor (gfc_constructor_base ctor, gfc_try (*check_function) (gfc_exp
expression -- specification, restricted, or initialization as
determined by the check_function. */
-gfc_try
-gfc_check_constructor (gfc_expr *expr, gfc_try (*check_function) (gfc_expr *))
+bool
+gfc_check_constructor (gfc_expr *expr, bool (*check_function) (gfc_expr *))
{
cons_stack *base_save;
- gfc_try t;
+ bool t;
base_save = base;
base = NULL;
@@ -1370,19 +1367,19 @@ typedef struct
gfc_component *component;
mpz_t *repeat;
- gfc_try (*expand_work_function) (gfc_expr *);
+ bool (*expand_work_function) (gfc_expr *);
}
expand_info;
static expand_info current_expand;
-static gfc_try expand_constructor (gfc_constructor_base);
+static bool expand_constructor (gfc_constructor_base);
/* Work function that counts the number of elements present in a
constructor. */
-static gfc_try
+static bool
count_elements (gfc_expr *e)
{
mpz_t result;
@@ -1391,10 +1388,10 @@ count_elements (gfc_expr *e)
mpz_add_ui (*current_expand.count, *current_expand.count, 1);
else
{
- if (gfc_array_size (e, &result) == FAILURE)
+ if (!gfc_array_size (e, &result))
{
gfc_free_expr (e);
- return FAILURE;
+ return false;
}
mpz_add (*current_expand.count, *current_expand.count, result);
@@ -1402,20 +1399,20 @@ count_elements (gfc_expr *e)
}
gfc_free_expr (e);
- return SUCCESS;
+ return true;
}
/* Work function that extracts a particular element from an array
constructor, freeing the rest. */
-static gfc_try
+static bool
extract_element (gfc_expr *e)
{
if (e->rank != 0)
{ /* Something unextractable */
gfc_free_expr (e);
- return FAILURE;
+ return false;
}
if (current_expand.extract_count == current_expand.extract_n)
@@ -1425,21 +1422,21 @@ extract_element (gfc_expr *e)
current_expand.extract_count++;
- return SUCCESS;
+ return true;
}
/* Work function that constructs a new constructor out of the old one,
stringing new elements together. */
-static gfc_try
+static bool
expand (gfc_expr *e)
{
gfc_constructor *c = gfc_constructor_append_expr (&current_expand.base,
e, &e->where);
c->n.component = current_expand.component;
- return SUCCESS;
+ return true;
}
@@ -1469,7 +1466,7 @@ gfc_simplify_iterator_var (gfc_expr *e)
/* Expand an expression with that is inside of a constructor,
recursing into other constructors if present. */
-static gfc_try
+static bool
expand_expr (gfc_expr *e)
{
if (e->expr_type == EXPR_ARRAY)
@@ -1477,48 +1474,48 @@ expand_expr (gfc_expr *e)
e = gfc_copy_expr (e);
- if (gfc_simplify_expr (e, 1) == FAILURE)
+ if (!gfc_simplify_expr (e, 1))
{
gfc_free_expr (e);
- return FAILURE;
+ return false;
}
return current_expand.expand_work_function (e);
}
-static gfc_try
+static bool
expand_iterator (gfc_constructor *c)
{
gfc_expr *start, *end, *step;
iterator_stack frame;
mpz_t trip;
- gfc_try t;
+ bool t;
end = step = NULL;
- t = FAILURE;
+ t = false;
mpz_init (trip);
mpz_init (frame.value);
frame.prev = NULL;
start = gfc_copy_expr (c->iterator->start);
- if (gfc_simplify_expr (start, 1) == FAILURE)
+ if (!gfc_simplify_expr (start, 1))
goto cleanup;
if (start->expr_type != EXPR_CONSTANT || start->ts.type != BT_INTEGER)
goto cleanup;
end = gfc_copy_expr (c->iterator->end);
- if (gfc_simplify_expr (end, 1) == FAILURE)
+ if (!gfc_simplify_expr (end, 1))
goto cleanup;
if (end->expr_type != EXPR_CONSTANT || end->ts.type != BT_INTEGER)
goto cleanup;
step = gfc_copy_expr (c->iterator->step);
- if (gfc_simplify_expr (step, 1) == FAILURE)
+ if (!gfc_simplify_expr (step, 1))
goto cleanup;
if (step->expr_type != EXPR_CONSTANT || step->ts.type != BT_INTEGER)
@@ -1543,14 +1540,14 @@ expand_iterator (gfc_constructor *c)
while (mpz_sgn (trip) > 0)
{
- if (expand_expr (c->expr) == FAILURE)
+ if (!expand_expr (c->expr))
goto cleanup;
mpz_add (frame.value, frame.value, step->value.integer);
mpz_sub_ui (trip, trip, 1);
}
- t = SUCCESS;
+ t = true;
cleanup:
gfc_free_expr (start);
@@ -1571,7 +1568,7 @@ cleanup:
expressions. The work function needs to either save or free the
passed expression. */
-static gfc_try
+static bool
expand_constructor (gfc_constructor_base base)
{
gfc_constructor *c;
@@ -1581,8 +1578,8 @@ expand_constructor (gfc_constructor_base base)
{
if (c->iterator != NULL)
{
- if (expand_iterator (c) == FAILURE)
- return FAILURE;
+ if (!expand_iterator (c))
+ return false;
continue;
}
@@ -1590,25 +1587,25 @@ expand_constructor (gfc_constructor_base base)
if (e->expr_type == EXPR_ARRAY)
{
- if (expand_constructor (e->value.constructor) == FAILURE)
- return FAILURE;
+ if (!expand_constructor (e->value.constructor))
+ return false;
continue;
}
e = gfc_copy_expr (e);
- if (gfc_simplify_expr (e, 1) == FAILURE)
+ if (!gfc_simplify_expr (e, 1))
{
gfc_free_expr (e);
- return FAILURE;
+ return false;
}
current_expand.offset = &c->offset;
current_expand.repeat = &c->repeat;
current_expand.component = c->n.component;
- if (current_expand.expand_work_function (e) == FAILURE)
- return FAILURE;
+ if (!current_expand.expand_work_function(e))
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -1624,7 +1621,7 @@ gfc_get_array_element (gfc_expr *array, int element)
{
expand_info expand_save;
gfc_expr *e;
- gfc_try rc;
+ bool rc;
expand_save = current_expand;
current_expand.extract_n = element;
@@ -1638,7 +1635,7 @@ gfc_get_array_element (gfc_expr *array, int element)
e = current_expand.extracted;
current_expand = expand_save;
- if (rc == FAILURE)
+ if (!rc)
return NULL;
return e;
@@ -1648,12 +1645,12 @@ gfc_get_array_element (gfc_expr *array, int element)
/* Top level subroutine for expanding constructors. We only expand
constructor if they are small enough. */
-gfc_try
+bool
gfc_expand_constructor (gfc_expr *e, bool fatal)
{
expand_info expand_save;
gfc_expr *f;
- gfc_try rc;
+ bool rc;
/* If we can successfully get an array element at the max array size then
the array is too big to expand, so we just return. */
@@ -1668,9 +1665,9 @@ gfc_expand_constructor (gfc_expr *e, bool fatal)
"upper limit. See -fmax-array-constructor "
"option", &e->where,
gfc_option.flag_max_array_constructor);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* We now know the array is not too big so go ahead and try to expand it. */
@@ -1681,17 +1678,17 @@ gfc_expand_constructor (gfc_expr *e, bool fatal)
current_expand.expand_work_function = expand;
- if (expand_constructor (e->value.constructor) == FAILURE)
+ if (!expand_constructor (e->value.constructor))
{
gfc_constructor_free (current_expand.base);
- rc = FAILURE;
+ rc = false;
goto done;
}
gfc_constructor_free (e->value.constructor);
e->value.constructor = current_expand.base;
- rc = SUCCESS;
+ rc = true;
done:
current_expand = expand_save;
@@ -1702,9 +1699,9 @@ done:
/* Work function for checking that an element of a constructor is a
constant, after removal of any iteration variables. We return
- FAILURE if not so. */
+ false if not so. */
-static gfc_try
+static bool
is_constant_element (gfc_expr *e)
{
int rv;
@@ -1712,7 +1709,7 @@ is_constant_element (gfc_expr *e)
rv = gfc_is_constant_expr (e);
gfc_free_expr (e);
- return rv ? SUCCESS : FAILURE;
+ return rv ? true : false;
}
@@ -1726,7 +1723,7 @@ int
gfc_constant_ac (gfc_expr *e)
{
expand_info expand_save;
- gfc_try rc;
+ bool rc;
iter_stack = NULL;
expand_save = current_expand;
@@ -1735,7 +1732,7 @@ gfc_constant_ac (gfc_expr *e)
rc = expand_constructor (e->value.constructor);
current_expand = expand_save;
- if (rc == FAILURE)
+ if (!rc)
return 0;
return 1;
@@ -1809,14 +1806,14 @@ find_symbol_in_expr (gfc_symbol *sym, gfc_expr *expr, locus *sym_loc)
/* Recursive array list resolution function. All of the elements must
be of the same type. */
-static gfc_try
+static bool
resolve_array_list (gfc_constructor_base base)
{
- gfc_try t;
+ bool t;
gfc_constructor *c;
gfc_iterator *iter;
- t = SUCCESS;
+ t = true;
for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c))
{
@@ -1826,43 +1823,43 @@ resolve_array_list (gfc_constructor_base base)
gfc_symbol *iter_var;
locus iter_var_loc;
- if (gfc_resolve_iterator (iter, false, true) == FAILURE)
- t = FAILURE;
+ if (!gfc_resolve_iterator (iter, false, true))
+ t = false;
/* Check for bounds referencing the iterator variable. */
gcc_assert (iter->var->expr_type == EXPR_VARIABLE);
iter_var = iter->var->symtree->n.sym;
if (find_symbol_in_expr (iter_var, iter->start, &iter_var_loc))
{
- if (gfc_notify_std (GFC_STD_LEGACY, "AC-IMPLIED-DO initial "
- "expression references control variable "
- "at %L", &iter_var_loc) == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY, "AC-IMPLIED-DO initial "
+ "expression references control variable "
+ "at %L", &iter_var_loc))
+ t = false;
}
if (find_symbol_in_expr (iter_var, iter->end, &iter_var_loc))
{
- if (gfc_notify_std (GFC_STD_LEGACY, "AC-IMPLIED-DO final "
- "expression references control variable "
- "at %L", &iter_var_loc) == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY, "AC-IMPLIED-DO final "
+ "expression references control variable "
+ "at %L", &iter_var_loc))
+ t = false;
}
if (find_symbol_in_expr (iter_var, iter->step, &iter_var_loc))
{
- if (gfc_notify_std (GFC_STD_LEGACY, "AC-IMPLIED-DO step "
- "expression references control variable "
- "at %L", &iter_var_loc) == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY, "AC-IMPLIED-DO step "
+ "expression references control variable "
+ "at %L", &iter_var_loc))
+ t = false;
}
}
- if (gfc_resolve_expr (c->expr) == FAILURE)
- t = FAILURE;
+ if (!gfc_resolve_expr (c->expr))
+ t = false;
if (UNLIMITED_POLY (c->expr))
{
gfc_error ("Array constructor value at %L shall not be unlimited "
"polymorphic [F2008: C4106]", &c->expr->where);
- t = FAILURE;
+ t = false;
}
}
@@ -1874,7 +1871,7 @@ resolve_array_list (gfc_constructor_base base)
all elements are of compile-time known length, emit an error as this is
invalid. */
-gfc_try
+bool
gfc_resolve_character_array_constructor (gfc_expr *expr)
{
gfc_constructor *p;
@@ -1935,7 +1932,7 @@ got_charlen:
current_length = (int) j;
}
else
- return SUCCESS;
+ return true;
gcc_assert (current_length != -1);
@@ -1946,7 +1943,7 @@ got_charlen:
gfc_error ("Different CHARACTER lengths (%d/%d) in array"
" constructor at %L", found_length, current_length,
&p->expr->where);
- return FAILURE;
+ return false;
}
gcc_assert (found_length == current_length);
@@ -2000,19 +1997,19 @@ got_charlen:
}
}
- return SUCCESS;
+ return true;
}
/* Resolve all of the expressions in an array list. */
-gfc_try
+bool
gfc_resolve_array_constructor (gfc_expr *expr)
{
- gfc_try t;
+ bool t;
t = resolve_array_list (expr->value.constructor);
- if (t == SUCCESS)
+ if (t)
t = gfc_check_constructor_type (expr);
/* gfc_resolve_character_array_constructor is called in gfc_resolve_expr after
@@ -2054,11 +2051,11 @@ gfc_copy_iterator (gfc_iterator *src)
/* Get the size of single dimension of an array specification. The
array is guaranteed to be one dimensional. */
-gfc_try
+bool
spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
{
if (as == NULL)
- return FAILURE;
+ return false;
if (dimen < 0 || dimen > as->rank - 1)
gfc_internal_error ("spec_dimen_size(): Bad dimension");
@@ -2068,7 +2065,7 @@ spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
|| as->upper[dimen]->expr_type != EXPR_CONSTANT
|| as->lower[dimen]->ts.type != BT_INTEGER
|| as->upper[dimen]->ts.type != BT_INTEGER)
- return FAILURE;
+ return false;
mpz_init (*result);
@@ -2077,45 +2074,45 @@ spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
mpz_add_ui (*result, *result, 1);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
spec_size (gfc_array_spec *as, mpz_t *result)
{
mpz_t size;
int d;
if (as->type == AS_ASSUMED_RANK)
- return FAILURE;
+ return false;
mpz_init_set_ui (*result, 1);
for (d = 0; d < as->rank; d++)
{
- if (spec_dimen_size (as, d, &size) == FAILURE)
+ if (!spec_dimen_size (as, d, &size))
{
mpz_clear (*result);
- return FAILURE;
+ return false;
}
mpz_mul (*result, *result, size);
mpz_clear (size);
}
- return SUCCESS;
+ return true;
}
/* Get the number of elements in an array section. Optionally, also supply
the end value. */
-gfc_try
+bool
gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end)
{
mpz_t upper, lower, stride;
- gfc_try t;
+ bool t;
if (dimen < 0 || ar == NULL || dimen > ar->dimen - 1)
gfc_internal_error ("gfc_ref_dimen_size(): Bad dimension");
@@ -2125,7 +2122,7 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end)
case DIMEN_ELEMENT:
mpz_init (*result);
mpz_set_ui (*result, 1);
- t = SUCCESS;
+ t = true;
break;
case DIMEN_VECTOR:
@@ -2136,7 +2133,7 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end)
mpz_init (upper);
mpz_init (lower);
mpz_init (stride);
- t = FAILURE;
+ t = false;
if (ar->start[dimen] == NULL)
{
@@ -2183,7 +2180,7 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end)
/* Zero stride caught earlier. */
if (mpz_cmp_ui (*result, 0) < 0)
mpz_set_ui (*result, 0);
- t = SUCCESS;
+ t = true;
if (end)
{
@@ -2208,7 +2205,7 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end)
}
-static gfc_try
+static bool
ref_size (gfc_array_ref *ar, mpz_t *result)
{
mpz_t size;
@@ -2218,26 +2215,26 @@ ref_size (gfc_array_ref *ar, mpz_t *result)
for (d = 0; d < ar->dimen; d++)
{
- if (gfc_ref_dimen_size (ar, d, &size, NULL) == FAILURE)
+ if (!gfc_ref_dimen_size (ar, d, &size, NULL))
{
mpz_clear (*result);
- return FAILURE;
+ return false;
}
mpz_mul (*result, *result, size);
mpz_clear (size);
}
- return SUCCESS;
+ return true;
}
/* Given an array expression and a dimension, figure out how many
- elements it has along that dimension. Returns SUCCESS if we were
- able to return a result in the 'result' variable, FAILURE
+ elements it has along that dimension. Returns true if we were
+ able to return a result in the 'result' variable, false
otherwise. */
-gfc_try
+bool
gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
{
gfc_ref *ref;
@@ -2246,10 +2243,10 @@ gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
gcc_assert (array != NULL);
if (array->ts.type == BT_CLASS)
- return FAILURE;
+ return false;
if (array->rank == -1)
- return FAILURE;
+ return false;
if (dimen < 0 || dimen > array->rank - 1)
gfc_internal_error ("gfc_array_dimen_size(): Bad dimension");
@@ -2279,19 +2276,17 @@ gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
if (array->shape && array->shape[dimen])
{
mpz_init_set (*result, array->shape[dimen]);
- return SUCCESS;
+ return true;
}
if (array->symtree->n.sym->attr.generic
&& array->value.function.esym != NULL)
{
- if (spec_dimen_size (array->value.function.esym->as, dimen, result)
- == FAILURE)
- return FAILURE;
+ if (!spec_dimen_size (array->value.function.esym->as, dimen, result))
+ return false;
}
- else if (spec_dimen_size (array->symtree->n.sym->as, dimen, result)
- == FAILURE)
- return FAILURE;
+ else if (!spec_dimen_size (array->symtree->n.sym->as, dimen, result))
+ return false;
break;
@@ -2306,31 +2301,31 @@ gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
/* Fall through */
default:
if (array->shape == NULL)
- return FAILURE;
+ return false;
mpz_init_set (*result, array->shape[dimen]);
break;
}
- return SUCCESS;
+ return true;
}
/* Given an array expression, figure out how many elements are in the
- array. Returns SUCCESS if this is possible, and sets the 'result'
- variable. Otherwise returns FAILURE. */
+ array. Returns true if this is possible, and sets the 'result'
+ variable. Otherwise returns false. */
-gfc_try
+bool
gfc_array_size (gfc_expr *array, mpz_t *result)
{
expand_info expand_save;
gfc_ref *ref;
int i;
- gfc_try t;
+ bool t;
if (array->ts.type == BT_CLASS)
- return FAILURE;
+ return false;
switch (array->expr_type)
{
@@ -2349,7 +2344,7 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
gfc_pop_suppress_errors ();
- if (t == FAILURE)
+ if (!t)
mpz_clear (*result);
current_expand = expand_save;
return t;
@@ -2372,7 +2367,7 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
default:
if (array->rank == 0 || array->shape == NULL)
- return FAILURE;
+ return false;
mpz_init_set_ui (*result, 1);
@@ -2382,14 +2377,14 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
break;
}
- return SUCCESS;
+ return true;
}
/* Given an array reference, return the shape of the reference in an
array of mpz_t integers. */
-gfc_try
+bool
gfc_array_ref_shape (gfc_array_ref *ar, mpz_t *shape)
{
int d;
@@ -2401,23 +2396,23 @@ gfc_array_ref_shape (gfc_array_ref *ar, mpz_t *shape)
{
case AR_FULL:
for (; d < ar->as->rank; d++)
- if (spec_dimen_size (ar->as, d, &shape[d]) == FAILURE)
+ if (!spec_dimen_size (ar->as, d, &shape[d]))
goto cleanup;
- return SUCCESS;
+ return true;
case AR_SECTION:
for (i = 0; i < ar->dimen; i++)
{
if (ar->dimen_type[i] != DIMEN_ELEMENT)
{
- if (gfc_ref_dimen_size (ar, i, &shape[d], NULL) == FAILURE)
+ if (!gfc_ref_dimen_size (ar, i, &shape[d], NULL))
goto cleanup;
d++;
}
}
- return SUCCESS;
+ return true;
default:
break;
@@ -2425,7 +2420,7 @@ gfc_array_ref_shape (gfc_array_ref *ar, mpz_t *shape)
cleanup:
gfc_clear_shape (shape, d);
- return FAILURE;
+ return false;
}
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 99174bcc75b..870ca757192 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -37,67 +37,66 @@ along with GCC; see the file COPYING3. If not see
/* Make sure an expression is a scalar. */
-static gfc_try
+static bool
scalar_check (gfc_expr *e, int n)
{
if (e->rank == 0)
- return SUCCESS;
+ return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a scalar",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where);
- return FAILURE;
+ return false;
}
/* Check the type of an expression. */
-static gfc_try
+static bool
type_check (gfc_expr *e, int n, bt type)
{
if (e->ts.type == type)
- return SUCCESS;
+ return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be %s",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where, gfc_basic_typename (type));
- return FAILURE;
+ return false;
}
/* Check that the expression is a numeric type. */
-static gfc_try
+static bool
numeric_check (gfc_expr *e, int n)
{
if (gfc_numeric_ts (&e->ts))
- return SUCCESS;
+ return true;
/* If the expression has not got a type, check if its namespace can
offer a default type. */
if ((e->expr_type == EXPR_VARIABLE || e->expr_type == EXPR_FUNCTION)
&& e->symtree->n.sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (e->symtree->n.sym, 0,
- e->symtree->n.sym->ns) == SUCCESS
+ && gfc_set_default_type (e->symtree->n.sym, 0, e->symtree->n.sym->ns)
&& gfc_numeric_ts (&e->symtree->n.sym->ts))
{
e->ts = e->symtree->n.sym->ts;
- return SUCCESS;
+ return true;
}
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a numeric type",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where);
- return FAILURE;
+ return false;
}
/* Check that an expression is integer or real. */
-static gfc_try
+static bool
int_or_real_check (gfc_expr *e, int n)
{
if (e->ts.type != BT_INTEGER && e->ts.type != BT_REAL)
@@ -105,16 +104,16 @@ int_or_real_check (gfc_expr *e, int n)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be INTEGER "
"or REAL", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Check that an expression is real or complex. */
-static gfc_try
+static bool
real_or_complex_check (gfc_expr *e, int n)
{
if (e->ts.type != BT_REAL && e->ts.type != BT_COMPLEX)
@@ -122,16 +121,16 @@ real_or_complex_check (gfc_expr *e, int n)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be REAL "
"or COMPLEX", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Check that an expression is INTEGER or PROCEDURE. */
-static gfc_try
+static bool
int_or_proc_check (gfc_expr *e, int n)
{
if (e->ts.type != BT_INTEGER && e->ts.type != BT_PROCEDURE)
@@ -139,36 +138,36 @@ int_or_proc_check (gfc_expr *e, int n)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be INTEGER "
"or PROCEDURE", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Check that the expression is an optional constant integer
and that it specifies a valid kind for that type. */
-static gfc_try
+static bool
kind_check (gfc_expr *k, int n, bt type)
{
int kind;
if (k == NULL)
- return SUCCESS;
+ return true;
- if (type_check (k, n, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (k, n, BT_INTEGER))
+ return false;
- if (scalar_check (k, n) == FAILURE)
- return FAILURE;
+ if (!scalar_check (k, n))
+ return false;
- if (gfc_check_init_expr (k) != SUCCESS)
+ if (!gfc_check_init_expr (k))
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a constant",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&k->where);
- return FAILURE;
+ return false;
}
if (gfc_extract_int (k, &kind) != NULL
@@ -176,34 +175,34 @@ kind_check (gfc_expr *k, int n, bt type)
{
gfc_error ("Invalid kind for %s at %L", gfc_basic_typename (type),
&k->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Make sure the expression is a double precision real. */
-static gfc_try
+static bool
double_check (gfc_expr *d, int n)
{
- if (type_check (d, n, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (d, n, BT_REAL))
+ return false;
if (d->ts.kind != gfc_default_double_kind)
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be double "
"precision", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &d->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
coarray_check (gfc_expr *e, int n)
{
if (e->ts.type == BT_CLASS && gfc_expr_attr (e).class_ok
@@ -211,7 +210,7 @@ coarray_check (gfc_expr *e, int n)
&& CLASS_DATA (e)->as->corank)
{
gfc_add_class_array_ref (e);
- return SUCCESS;
+ return true;
}
if (!gfc_is_coarray (e))
@@ -219,16 +218,16 @@ coarray_check (gfc_expr *e, int n)
gfc_error ("Expected coarray variable as '%s' argument to the %s "
"intrinsic at %L", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Make sure the expression is a logical array. */
-static gfc_try
+static bool
logical_array_check (gfc_expr *array, int n)
{
if (array->ts.type != BT_LOGICAL || array->rank == 0)
@@ -236,16 +235,16 @@ logical_array_check (gfc_expr *array, int n)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a logical "
"array", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &array->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Make sure an expression is an array. */
-static gfc_try
+static bool
array_check (gfc_expr *e, int n)
{
if (e->ts.type == BT_CLASS && gfc_expr_attr (e).class_ok
@@ -253,24 +252,24 @@ array_check (gfc_expr *e, int n)
&& CLASS_DATA (e)->as->rank)
{
gfc_add_class_array_ref (e);
- return SUCCESS;
+ return true;
}
if (e->rank != 0 && e->ts.type != BT_PROCEDURE)
- return SUCCESS;
+ return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be an array",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where);
- return FAILURE;
+ return false;
}
/* If expr is a constant, then check to ensure that it is greater than
of equal to zero. */
-static gfc_try
+static bool
nonnegative_check (const char *arg, gfc_expr *expr)
{
int i;
@@ -281,18 +280,18 @@ nonnegative_check (const char *arg, gfc_expr *expr)
if (i < 0)
{
gfc_error ("'%s' at %L must be nonnegative", arg, &expr->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
/* If expr2 is constant, then check that the value is less than
(less than or equal to, if 'or_equal' is true) bit_size(expr1). */
-static gfc_try
+static bool
less_than_bitsize1 (const char *arg1, gfc_expr *expr1, const char *arg2,
gfc_expr *expr2, bool or_equal)
{
@@ -314,7 +313,7 @@ less_than_bitsize1 (const char *arg1, gfc_expr *expr1, const char *arg2,
gfc_error ("The absolute value of SHIFT at %L must be less "
"than or equal to BIT_SIZE('%s')",
&expr2->where, arg1);
- return FAILURE;
+ return false;
}
}
@@ -325,7 +324,7 @@ less_than_bitsize1 (const char *arg1, gfc_expr *expr1, const char *arg2,
gfc_error ("'%s' at %L must be less than "
"or equal to BIT_SIZE('%s')",
arg2, &expr2->where, arg1);
- return FAILURE;
+ return false;
}
}
else
@@ -334,25 +333,25 @@ less_than_bitsize1 (const char *arg1, gfc_expr *expr1, const char *arg2,
{
gfc_error ("'%s' at %L must be less than BIT_SIZE('%s')",
arg2, &expr2->where, arg1);
- return FAILURE;
+ return false;
}
}
}
- return SUCCESS;
+ return true;
}
/* If expr is constant, then check that the value is less than or equal
to the bit_size of the kind k. */
-static gfc_try
+static bool
less_than_bitsizekind (const char *arg, gfc_expr *expr, int k)
{
int i, val;
if (expr->expr_type != EXPR_CONSTANT)
- return SUCCESS;
+ return true;
i = gfc_validate_kind (BT_INTEGER, k, false);
gfc_extract_int (expr, &val);
@@ -361,17 +360,17 @@ less_than_bitsizekind (const char *arg, gfc_expr *expr, int k)
{
gfc_error ("'%s' at %L must be less than or equal to the BIT_SIZE of "
"INTEGER(KIND=%d)", arg, &expr->where, k);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* If expr2 and expr3 are constants, then check that the value is less than
or equal to bit_size(expr1). */
-static gfc_try
+static bool
less_than_bitsize2 (const char *arg1, gfc_expr *expr1, const char *arg2,
gfc_expr *expr2, const char *arg3, gfc_expr *expr3)
{
@@ -388,49 +387,49 @@ less_than_bitsize2 (const char *arg1, gfc_expr *expr1, const char *arg2,
gfc_error ("'%s + %s' at %L must be less than or equal "
"to BIT_SIZE('%s')",
arg2, arg3, &expr2->where, arg1);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
/* Make sure two expressions have the same type. */
-static gfc_try
+static bool
same_type_check (gfc_expr *e, int n, gfc_expr *f, int m)
{
if (gfc_compare_types (&e->ts, &f->ts))
- return SUCCESS;
+ return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be the same type "
"and kind as '%s'", gfc_current_intrinsic_arg[m]->name,
gfc_current_intrinsic, &f->where,
gfc_current_intrinsic_arg[n]->name);
- return FAILURE;
+ return false;
}
/* Make sure that an expression has a certain (nonzero) rank. */
-static gfc_try
+static bool
rank_check (gfc_expr *e, int n, int rank)
{
if (e->rank == rank)
- return SUCCESS;
+ return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be of rank %d",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where, rank);
- return FAILURE;
+ return false;
}
/* Make sure a variable expression is not an optional dummy argument. */
-static gfc_try
+static bool
nonoptional_check (gfc_expr *e, int n)
{
if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.optional)
@@ -442,13 +441,13 @@ nonoptional_check (gfc_expr *e, int n)
/* TODO: Recursive check on nonoptional variables? */
- return SUCCESS;
+ return true;
}
/* Check for ALLOCATABLE attribute. */
-static gfc_try
+static bool
allocatable_check (gfc_expr *e, int n)
{
symbol_attribute attr;
@@ -459,32 +458,32 @@ allocatable_check (gfc_expr *e, int n)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be ALLOCATABLE",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Check that an expression has a particular kind. */
-static gfc_try
+static bool
kind_value_check (gfc_expr *e, int n, int k)
{
if (e->ts.kind == k)
- return SUCCESS;
+ return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be of kind %d",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where, k);
- return FAILURE;
+ return false;
}
/* Make sure an expression is a variable. */
-static gfc_try
+static bool
variable_check (gfc_expr *e, int n, bool allow_proc)
{
if (e->expr_type == EXPR_VARIABLE
@@ -515,14 +514,14 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be "
"INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic, &e->where);
- return FAILURE;
+ return false;
}
}
if (e->expr_type == EXPR_VARIABLE
&& e->symtree->n.sym->attr.flavor != FL_PARAMETER
&& (allow_proc || !e->symtree->n.sym->attr.function))
- return SUCCESS;
+ return true;
if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.function
&& e->symtree->n.sym == e->symtree->n.sym->result)
@@ -530,41 +529,41 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
gfc_namespace *ns;
for (ns = gfc_current_ns; ns; ns = ns->parent)
if (ns->proc_name == e->symtree->n.sym)
- return SUCCESS;
+ return true;
}
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a variable",
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, &e->where);
- return FAILURE;
+ return false;
}
/* Check the common DIM parameter for correctness. */
-static gfc_try
+static bool
dim_check (gfc_expr *dim, int n, bool optional)
{
if (dim == NULL)
- return SUCCESS;
+ return true;
- if (type_check (dim, n, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (dim, n, BT_INTEGER))
+ return false;
- if (scalar_check (dim, n) == FAILURE)
- return FAILURE;
+ if (!scalar_check (dim, n))
+ return false;
- if (!optional && nonoptional_check (dim, n) == FAILURE)
- return FAILURE;
+ if (!optional && !nonoptional_check (dim, n))
+ return false;
- return SUCCESS;
+ return true;
}
/* If a coarray DIM parameter is a constant, make sure that it is greater than
zero and less than or equal to the corank of the given array. */
-static gfc_try
+static bool
dim_corank_check (gfc_expr *dim, gfc_expr *array)
{
int corank;
@@ -572,10 +571,10 @@ dim_corank_check (gfc_expr *dim, gfc_expr *array)
gcc_assert (array->expr_type == EXPR_VARIABLE);
if (dim->expr_type != EXPR_CONSTANT)
- return SUCCESS;
+ return true;
if (array->ts.type == BT_CLASS)
- return SUCCESS;
+ return true;
corank = gfc_get_corank (array);
@@ -585,10 +584,10 @@ dim_corank_check (gfc_expr *dim, gfc_expr *array)
gfc_error ("'dim' argument of '%s' intrinsic at %L is not a valid "
"codimension index", gfc_current_intrinsic, &dim->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -597,20 +596,20 @@ dim_corank_check (gfc_expr *dim, gfc_expr *array)
allow_assumed is zero then dim must be less than the rank of the array
for assumed size arrays. */
-static gfc_try
+static bool
dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
{
gfc_array_ref *ar;
int rank;
if (dim == NULL)
- return SUCCESS;
+ return true;
if (dim->expr_type != EXPR_CONSTANT)
- return SUCCESS;
+ return true;
if (array->ts.type == BT_CLASS)
- return SUCCESS;
+ return true;
if (array->expr_type == EXPR_FUNCTION && array->value.function.isym
&& array->value.function.isym->id == GFC_ISYM_SPREAD)
@@ -638,10 +637,10 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
gfc_error ("'dim' argument of '%s' intrinsic at %L is not a valid "
"dimension index", gfc_current_intrinsic, &dim->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -660,9 +659,9 @@ identical_dimen_shape (gfc_expr *a, int ai, gfc_expr *b, int bi)
ret = 1;
- if (gfc_array_dimen_size (a, ai, &a_size) == SUCCESS)
+ if (gfc_array_dimen_size (a, ai, &a_size))
{
- if (gfc_array_dimen_size (b, bi, &b_size) == SUCCESS)
+ if (gfc_array_dimen_size (b, bi, &b_size))
{
if (mpz_cmp (a_size, b_size) != 0)
ret = 0;
@@ -723,10 +722,10 @@ gfc_var_strlen (const gfc_expr *a)
}
/* Check whether two character expressions have the same length;
- returns SUCCESS if they have or if the length cannot be determined,
- otherwise return FAILURE and raise a gfc_error. */
+ returns true if they have or if the length cannot be determined,
+ otherwise return false and raise a gfc_error. */
-gfc_try
+bool
gfc_check_same_strlen (const gfc_expr *a, const gfc_expr *b, const char *name)
{
long len_a, len_b;
@@ -735,12 +734,12 @@ gfc_check_same_strlen (const gfc_expr *a, const gfc_expr *b, const char *name)
len_b = gfc_var_strlen(b);
if (len_a == -1 || len_b == -1 || len_a == len_b)
- return SUCCESS;
+ return true;
else
{
gfc_error ("Unequal character lengths (%ld/%ld) in %s at %L",
len_a, len_b, name, &a->where);
- return FAILURE;
+ return false;
}
}
@@ -750,21 +749,21 @@ gfc_check_same_strlen (const gfc_expr *a, const gfc_expr *b, const char *name)
/* Check subroutine suitable for intrinsics taking a real argument and
a kind argument for the result. */
-static gfc_try
+static bool
check_a_kind (gfc_expr *a, gfc_expr *kind, bt type)
{
- if (type_check (a, 0, BT_REAL) == FAILURE)
- return FAILURE;
- if (kind_check (kind, 1, type) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_REAL))
+ return false;
+ if (!kind_check (kind, 1, type))
+ return false;
- return SUCCESS;
+ return true;
}
/* Check subroutine suitable for ceiling, floor and nint. */
-gfc_try
+bool
gfc_check_a_ikind (gfc_expr *a, gfc_expr *kind)
{
return check_a_kind (a, kind, BT_INTEGER);
@@ -773,90 +772,90 @@ gfc_check_a_ikind (gfc_expr *a, gfc_expr *kind)
/* Check subroutine suitable for aint, anint. */
-gfc_try
+bool
gfc_check_a_xkind (gfc_expr *a, gfc_expr *kind)
{
return check_a_kind (a, kind, BT_REAL);
}
-gfc_try
+bool
gfc_check_abs (gfc_expr *a)
{
- if (numeric_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (a, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_achar (gfc_expr *a, gfc_expr *kind)
{
- if (type_check (a, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind_check (kind, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_INTEGER))
+ return false;
+ if (!kind_check (kind, 1, BT_CHARACTER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_access_func (gfc_expr *name, gfc_expr *mode)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE
- || scalar_check (name, 0) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER)
+ || !scalar_check (name, 0))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- if (type_check (mode, 1, BT_CHARACTER) == FAILURE
- || scalar_check (mode, 1) == FAILURE)
- return FAILURE;
- if (kind_value_check (mode, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (mode, 1, BT_CHARACTER)
+ || !scalar_check (mode, 1))
+ return false;
+ if (!kind_value_check (mode, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_all_any (gfc_expr *mask, gfc_expr *dim)
{
- if (logical_array_check (mask, 0) == FAILURE)
- return FAILURE;
+ if (!logical_array_check (mask, 0))
+ return false;
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
- if (dim_rank_check (dim, mask, 0) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, mask, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_allocated (gfc_expr *array)
{
- if (variable_check (array, 0, false) == FAILURE)
- return FAILURE;
- if (allocatable_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!variable_check (array, 0, false))
+ return false;
+ if (!allocatable_check (array, 0))
+ return false;
- return SUCCESS;
+ return true;
}
/* Common check function where the first argument must be real or
integer and the second argument must be the same as the first. */
-gfc_try
+bool
gfc_check_a_p (gfc_expr *a, gfc_expr *p)
{
- if (int_or_real_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (a, 0))
+ return false;
if (a->ts.type != p->ts.type)
{
@@ -864,36 +863,36 @@ gfc_check_a_p (gfc_expr *a, gfc_expr *p)
"have the same type", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&p->where);
- return FAILURE;
+ return false;
}
if (a->ts.kind != p->ts.kind)
{
- if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
- &p->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
+ &p->where))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_x_yd (gfc_expr *x, gfc_expr *y)
{
- if (double_check (x, 0) == FAILURE || double_check (y, 1) == FAILURE)
- return FAILURE;
+ if (!double_check (x, 0) || !double_check (y, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
{
symbol_attribute attr1, attr2;
int i;
- gfc_try t;
+ bool t;
locus *where;
where = &pointer->where;
@@ -908,7 +907,7 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a POINTER",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&pointer->where);
- return FAILURE;
+ return false;
}
/* F2008, C1242. */
@@ -917,12 +916,12 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be "
"coindexed", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &pointer->where);
- return FAILURE;
+ return false;
}
/* Target argument is optional. */
if (target == NULL)
- return SUCCESS;
+ return true;
where = &target->where;
if (target->expr_type == EXPR_NULL)
@@ -936,7 +935,7 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
"or target VARIABLE or FUNCTION",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&target->where);
- return FAILURE;
+ return false;
}
if (attr1.pointer && !attr2.pointer && !attr2.target)
@@ -944,7 +943,7 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a POINTER "
"or a TARGET", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &target->where);
- return FAILURE;
+ return false;
}
/* F2008, C1242. */
@@ -953,14 +952,14 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be "
"coindexed", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &target->where);
- return FAILURE;
+ return false;
}
- t = SUCCESS;
- if (same_type_check (pointer, 0, target, 1) == FAILURE)
- t = FAILURE;
- if (rank_check (target, 0, pointer->rank) == FAILURE)
- t = FAILURE;
+ t = true;
+ if (!same_type_check (pointer, 0, target, 1))
+ t = false;
+ if (!rank_check (target, 0, pointer->rank))
+ t = false;
if (target->rank > 0)
{
for (i = 0; i < target->rank; i++)
@@ -969,7 +968,7 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
gfc_error ("Array section with a vector subscript at %L shall not "
"be the target of a pointer",
&target->where);
- t = FAILURE;
+ t = false;
break;
}
}
@@ -979,37 +978,37 @@ null_arg:
gfc_error ("NULL pointer at %L is not permitted as actual argument "
"of '%s' intrinsic function", where, gfc_current_intrinsic);
- return FAILURE;
+ return false;
}
-gfc_try
+bool
gfc_check_atan_2 (gfc_expr *y, gfc_expr *x)
{
/* gfc_notify_std would be a waste of time as the return value
is seemingly used only for the generic resolution. The error
will be: Too many arguments. */
if ((gfc_option.allow_std & GFC_STD_F2008) == 0)
- return FAILURE;
+ return false;
return gfc_check_atan2 (y, x);
}
-gfc_try
+bool
gfc_check_atan2 (gfc_expr *y, gfc_expr *x)
{
- if (type_check (y, 0, BT_REAL) == FAILURE)
- return FAILURE;
- if (same_type_check (y, 0, x, 1) == FAILURE)
- return FAILURE;
+ if (!type_check (y, 0, BT_REAL))
+ return false;
+ if (!same_type_check (y, 0, x, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
gfc_check_atomic (gfc_expr *atom, gfc_expr *value)
{
if (!(atom->ts.type == BT_INTEGER && atom->ts.kind == gfc_atomic_int_kind)
@@ -1019,14 +1018,14 @@ gfc_check_atomic (gfc_expr *atom, gfc_expr *value)
gfc_error ("ATOM argument at %L to intrinsic function %s shall be an "
"integer of ATOMIC_INT_KIND or a logical of "
"ATOMIC_LOGICAL_KIND", &atom->where, gfc_current_intrinsic);
- return FAILURE;
+ return false;
}
if (!gfc_expr_attr (atom).codimension)
{
gfc_error ("ATOM argument at %L of the %s intrinsic function shall be a "
"coarray or coindexed", &atom->where, gfc_current_intrinsic);
- return FAILURE;
+ return false;
}
if (atom->ts.type != value->ts.type)
@@ -1034,41 +1033,41 @@ gfc_check_atomic (gfc_expr *atom, gfc_expr *value)
gfc_error ("ATOM and VALUE argument of the %s intrinsic function shall "
"have the same type at %L", gfc_current_intrinsic,
&value->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_atomic_def (gfc_expr *atom, gfc_expr *value)
{
- if (scalar_check (atom, 0) == FAILURE || scalar_check (value, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (atom, 0) || !scalar_check (value, 1))
+ return false;
- if (gfc_check_vardef_context (atom, false, false, false, NULL) == FAILURE)
+ if (!gfc_check_vardef_context (atom, false, false, false, NULL))
{
gfc_error ("ATOM argument of the %s intrinsic function at %L shall be "
"definable", gfc_current_intrinsic, &atom->where);
- return FAILURE;
+ return false;
}
return gfc_check_atomic (atom, value);
}
-gfc_try
+bool
gfc_check_atomic_ref (gfc_expr *value, gfc_expr *atom)
{
- if (scalar_check (value, 0) == FAILURE || scalar_check (atom, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (value, 0) || !scalar_check (atom, 1))
+ return false;
- if (gfc_check_vardef_context (value, false, false, false, NULL) == FAILURE)
+ if (!gfc_check_vardef_context (value, false, false, false, NULL))
{
gfc_error ("VALUE argument of the %s intrinsic function at %L shall be "
"definable", gfc_current_intrinsic, &value->where);
- return FAILURE;
+ return false;
}
return gfc_check_atomic (atom, value);
@@ -1077,184 +1076,184 @@ gfc_check_atomic_ref (gfc_expr *value, gfc_expr *atom)
/* BESJN and BESYN functions. */
-gfc_try
+bool
gfc_check_besn (gfc_expr *n, gfc_expr *x)
{
- if (type_check (n, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (n, 0, BT_INTEGER))
+ return false;
if (n->expr_type == EXPR_CONSTANT)
{
int i;
gfc_extract_int (n, &i);
- if (i < 0 && gfc_notify_std (GFC_STD_GNU, "Negative argument "
- "N at %L", &n->where) == FAILURE)
- return FAILURE;
+ if (i < 0 && !gfc_notify_std (GFC_STD_GNU, "Negative argument "
+ "N at %L", &n->where))
+ return false;
}
- if (type_check (x, 1, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 1, BT_REAL))
+ return false;
- return SUCCESS;
+ return true;
}
/* Transformational version of the Bessel JN and YN functions. */
-gfc_try
+bool
gfc_check_bessel_n2 (gfc_expr *n1, gfc_expr *n2, gfc_expr *x)
{
- if (type_check (n1, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (scalar_check (n1, 0) == FAILURE)
- return FAILURE;
- if (nonnegative_check("N1", n1) == FAILURE)
- return FAILURE;
-
- if (type_check (n2, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (scalar_check (n2, 1) == FAILURE)
- return FAILURE;
- if (nonnegative_check("N2", n2) == FAILURE)
- return FAILURE;
-
- if (type_check (x, 2, BT_REAL) == FAILURE)
- return FAILURE;
- if (scalar_check (x, 2) == FAILURE)
- return FAILURE;
+ if (!type_check (n1, 0, BT_INTEGER))
+ return false;
+ if (!scalar_check (n1, 0))
+ return false;
+ if (!nonnegative_check ("N1", n1))
+ return false;
+
+ if (!type_check (n2, 1, BT_INTEGER))
+ return false;
+ if (!scalar_check (n2, 1))
+ return false;
+ if (!nonnegative_check ("N2", n2))
+ return false;
+
+ if (!type_check (x, 2, BT_REAL))
+ return false;
+ if (!scalar_check (x, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_bge_bgt_ble_blt (gfc_expr *i, gfc_expr *j)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (j, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (j, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_bitfcn (gfc_expr *i, gfc_expr *pos)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (pos, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (pos, 1, BT_INTEGER))
+ return false;
- if (nonnegative_check ("pos", pos) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("pos", pos))
+ return false;
- if (less_than_bitsize1 ("i", i, "pos", pos, false) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize1 ("i", i, "pos", pos, false))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_char (gfc_expr *i, gfc_expr *kind)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind_check (kind, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
+ if (!kind_check (kind, 1, BT_CHARACTER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_chdir (gfc_expr *dir)
{
- if (type_check (dir, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (dir, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (dir, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (dir, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_chdir_sub (gfc_expr *dir, gfc_expr *status)
{
- if (type_check (dir, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (dir, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (dir, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (dir, 0, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (scalar_check (status, 1) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 1, BT_INTEGER))
+ return false;
+ if (!scalar_check (status, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_chmod (gfc_expr *name, gfc_expr *mode)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- if (type_check (mode, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (mode, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (mode, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (mode, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_chmod_sub (gfc_expr *name, gfc_expr *mode, gfc_expr *status)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- if (type_check (mode, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (mode, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (mode, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (mode, 1, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
{
- if (numeric_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (x, 0))
+ return false;
if (y != NULL)
{
- if (numeric_check (y, 1) == FAILURE)
- return FAILURE;
+ if (!numeric_check (y, 1))
+ return false;
if (x->ts.type == BT_COMPLEX)
{
@@ -1262,7 +1261,7 @@ gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
"present if 'x' is COMPLEX",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&y->where);
- return FAILURE;
+ return false;
}
if (y->ts.type == BT_COMPLEX)
@@ -1271,13 +1270,13 @@ gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
"of either REAL or INTEGER",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&y->where);
- return FAILURE;
+ return false;
}
}
- if (kind_check (kind, 2, BT_COMPLEX) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 2, BT_COMPLEX))
+ return false;
if (!kind && gfc_option.gfc_warn_conversion
&& x->ts.type == BT_REAL && x->ts.kind > gfc_default_real_kind)
@@ -1290,66 +1289,66 @@ gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
"might loose precision, consider using the KIND argument",
gfc_typename (&y->ts), gfc_default_real_kind, &y->where);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_complex (gfc_expr *x, gfc_expr *y)
{
- if (int_or_real_check (x, 0) == FAILURE)
- return FAILURE;
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (x, 0))
+ return false;
+ if (!scalar_check (x, 0))
+ return false;
- if (int_or_real_check (y, 1) == FAILURE)
- return FAILURE;
- if (scalar_check (y, 1) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (y, 1))
+ return false;
+ if (!scalar_check (y, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind)
{
- if (logical_array_check (mask, 0) == FAILURE)
- return FAILURE;
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
- if (dim_rank_check (dim, mask, 0) == FAILURE)
- return FAILURE;
- if (kind_check (kind, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!logical_array_check (mask, 0))
+ return false;
+ if (!dim_check (dim, 1, false))
+ return false;
+ if (!dim_rank_check (dim, mask, 0))
+ return false;
+ if (!kind_check (kind, 2, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
{
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (type_check (shift, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (shift, 1, BT_INTEGER))
+ return false;
- if (dim_check (dim, 2, true) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 2, true))
+ return false;
- if (dim_rank_check (dim, array, false) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, array, false))
+ return false;
if (array->rank == 1 || shift->rank == 0)
{
- if (scalar_check (shift, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (shift, 1))
+ return false;
}
else if (shift->rank == array->rank - 1)
{
@@ -1375,7 +1374,7 @@ gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
gfc_current_intrinsic, &shift->where, i + 1,
mpz_get_si (array->shape[i]),
mpz_get_si (shift->shape[j]));
- return FAILURE;
+ return false;
}
j += 1;
@@ -1387,44 +1386,44 @@ gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
gfc_error ("'%s' argument of intrinsic '%s' at %L of must have rank "
"%d or be a scalar", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &shift->where, array->rank - 1);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ctime (gfc_expr *time)
{
- if (scalar_check (time, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (time, 0))
+ return false;
- if (type_check (time, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (time, 0, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try gfc_check_datan2 (gfc_expr *y, gfc_expr *x)
+bool gfc_check_datan2 (gfc_expr *y, gfc_expr *x)
{
- if (double_check (y, 0) == FAILURE || double_check (x, 1) == FAILURE)
- return FAILURE;
+ if (!double_check (y, 0) || !double_check (x, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
{
- if (numeric_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (x, 0))
+ return false;
if (y != NULL)
{
- if (numeric_check (y, 1) == FAILURE)
- return FAILURE;
+ if (!numeric_check (y, 1))
+ return false;
if (x->ts.type == BT_COMPLEX)
{
@@ -1432,7 +1431,7 @@ gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
"present if 'x' is COMPLEX",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&y->where);
- return FAILURE;
+ return false;
}
if (y->ts.type == BT_COMPLEX)
@@ -1441,89 +1440,89 @@ gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
"of either REAL or INTEGER",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&y->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dble (gfc_expr *x)
{
- if (numeric_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_digits (gfc_expr *x)
{
- if (int_or_real_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
{
switch (vector_a->ts.type)
{
case BT_LOGICAL:
- if (type_check (vector_b, 1, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (!type_check (vector_b, 1, BT_LOGICAL))
+ return false;
break;
case BT_INTEGER:
case BT_REAL:
case BT_COMPLEX:
- if (numeric_check (vector_b, 1) == FAILURE)
- return FAILURE;
+ if (!numeric_check (vector_b, 1))
+ return false;
break;
default:
gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
"or LOGICAL", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &vector_a->where);
- return FAILURE;
+ return false;
}
- if (rank_check (vector_a, 0, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (vector_a, 0, 1))
+ return false;
- if (rank_check (vector_b, 1, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (vector_b, 1, 1))
+ return false;
if (! identical_dimen_shape (vector_a, 0, vector_b, 0))
{
gfc_error ("Different shape for arguments '%s' and '%s' at %L for "
"intrinsic 'dot_product'", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[1]->name, &vector_a->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dprod (gfc_expr *x, gfc_expr *y)
{
- if (type_check (x, 0, BT_REAL) == FAILURE
- || type_check (y, 1, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL)
+ || !type_check (y, 1, BT_REAL))
+ return false;
if (x->ts.kind != gfc_default_real_kind)
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be default "
"real", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &x->where);
- return FAILURE;
+ return false;
}
if (y->ts.kind != gfc_default_real_kind)
@@ -1531,75 +1530,75 @@ gfc_check_dprod (gfc_expr *x, gfc_expr *y)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be default "
"real", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &y->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dshift (gfc_expr *i, gfc_expr *j, gfc_expr *shift)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (j, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (j, 1, BT_INTEGER))
+ return false;
if (i->is_boz && j->is_boz)
{
gfc_error ("'I' at %L and 'J' at %L cannot both be BOZ literal "
"constants", &i->where, &j->where);
- return FAILURE;
+ return false;
}
- if (!i->is_boz && !j->is_boz && same_type_check (i, 0, j, 1) == FAILURE)
- return FAILURE;
+ if (!i->is_boz && !j->is_boz && !same_type_check (i, 0, j, 1))
+ return false;
- if (type_check (shift, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (shift, 2, BT_INTEGER))
+ return false;
- if (nonnegative_check ("SHIFT", shift) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("SHIFT", shift))
+ return false;
if (i->is_boz)
{
- if (less_than_bitsize1 ("J", j, "SHIFT", shift, true) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize1 ("J", j, "SHIFT", shift, true))
+ return false;
i->ts.kind = j->ts.kind;
}
else
{
- if (less_than_bitsize1 ("I", i, "SHIFT", shift, true) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize1 ("I", i, "SHIFT", shift, true))
+ return false;
j->ts.kind = i->ts.kind;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
gfc_expr *dim)
{
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (type_check (shift, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (shift, 1, BT_INTEGER))
+ return false;
- if (dim_check (dim, 3, true) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 3, true))
+ return false;
- if (dim_rank_check (dim, array, false) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, array, false))
+ return false;
if (array->rank == 1 || shift->rank == 0)
{
- if (scalar_check (shift, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (shift, 1))
+ return false;
}
else if (shift->rank == array->rank - 1)
{
@@ -1625,7 +1624,7 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
gfc_current_intrinsic, &shift->where, i + 1,
mpz_get_si (array->shape[i]),
mpz_get_si (shift->shape[j]));
- return FAILURE;
+ return false;
}
j += 1;
@@ -1637,28 +1636,28 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
gfc_error ("'%s' argument of intrinsic '%s' at %L of must have rank "
"%d or be a scalar", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &shift->where, array->rank - 1);
- return FAILURE;
+ return false;
}
if (boundary != NULL)
{
- if (same_type_check (array, 0, boundary, 2) == FAILURE)
- return FAILURE;
+ if (!same_type_check (array, 0, boundary, 2))
+ return false;
if (array->rank == 1 || boundary->rank == 0)
{
- if (scalar_check (boundary, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (boundary, 2))
+ return false;
}
else if (boundary->rank == array->rank - 1)
{
- if (gfc_check_conformance (shift, boundary,
- "arguments '%s' and '%s' for "
- "intrinsic %s",
- gfc_current_intrinsic_arg[1]->name,
- gfc_current_intrinsic_arg[2]->name,
- gfc_current_intrinsic ) == FAILURE)
- return FAILURE;
+ if (!gfc_check_conformance (shift, boundary,
+ "arguments '%s' and '%s' for "
+ "intrinsic %s",
+ gfc_current_intrinsic_arg[1]->name,
+ gfc_current_intrinsic_arg[2]->name,
+ gfc_current_intrinsic))
+ return false;
}
else
{
@@ -1666,197 +1665,197 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
"rank %d or be a scalar",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&shift->where, array->rank - 1);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_float (gfc_expr *a)
{
- if (type_check (a, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_INTEGER))
+ return false;
if ((a->ts.kind != gfc_default_integer_kind)
- && gfc_notify_std (GFC_STD_GNU, "non-default INTEGER "
- "kind argument to %s intrinsic at %L",
- gfc_current_intrinsic, &a->where) == FAILURE )
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_GNU, "non-default INTEGER "
+ "kind argument to %s intrinsic at %L",
+ gfc_current_intrinsic, &a->where))
+ return false;
- return SUCCESS;
+ return true;
}
/* A single complex argument. */
-gfc_try
+bool
gfc_check_fn_c (gfc_expr *a)
{
- if (type_check (a, 0, BT_COMPLEX) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_COMPLEX))
+ return false;
- return SUCCESS;
+ return true;
}
/* A single real argument. */
-gfc_try
+bool
gfc_check_fn_r (gfc_expr *a)
{
- if (type_check (a, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_REAL))
+ return false;
- return SUCCESS;
+ return true;
}
/* A single double argument. */
-gfc_try
+bool
gfc_check_fn_d (gfc_expr *a)
{
- if (double_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!double_check (a, 0))
+ return false;
- return SUCCESS;
+ return true;
}
/* A single real or complex argument. */
-gfc_try
+bool
gfc_check_fn_rc (gfc_expr *a)
{
- if (real_or_complex_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!real_or_complex_check (a, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fn_rc2008 (gfc_expr *a)
{
- if (real_or_complex_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!real_or_complex_check (a, 0))
+ return false;
if (a->ts.type == BT_COMPLEX
- && gfc_notify_std (GFC_STD_F2008, "COMPLEX argument '%s' "
- "argument of '%s' intrinsic at %L",
- gfc_current_intrinsic_arg[0]->name,
- gfc_current_intrinsic, &a->where) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2008, "COMPLEX argument '%s' "
+ "argument of '%s' intrinsic at %L",
+ gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic, &a->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fnum (gfc_expr *unit)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_huge (gfc_expr *x)
{
- if (int_or_real_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_hypot (gfc_expr *x, gfc_expr *y)
{
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
- if (same_type_check (x, 0, y, 1) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
+ if (!same_type_check (x, 0, y, 1))
+ return false;
- return SUCCESS;
+ return true;
}
/* Check that the single argument is an integer. */
-gfc_try
+bool
gfc_check_i (gfc_expr *i)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_iand (gfc_expr *i, gfc_expr *j)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (j, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (j, 1, BT_INTEGER))
+ return false;
if (i->ts.kind != j->ts.kind)
{
- if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
- &i->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
+ &i->where))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ibits (gfc_expr *i, gfc_expr *pos, gfc_expr *len)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (pos, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (pos, 1, BT_INTEGER))
+ return false;
- if (type_check (len, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (len, 2, BT_INTEGER))
+ return false;
- if (nonnegative_check ("pos", pos) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("pos", pos))
+ return false;
- if (nonnegative_check ("len", len) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("len", len))
+ return false;
- if (less_than_bitsize2 ("i", i, "pos", pos, "len", len) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize2 ("i", i, "pos", pos, "len", len))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
{
int i;
- if (type_check (c, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (c, 0, BT_CHARACTER))
+ return false;
- if (kind_check (kind, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 1, BT_INTEGER))
+ return false;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
if (c->expr_type == EXPR_VARIABLE || c->expr_type == EXPR_SUBSTRING)
{
@@ -1879,11 +1878,11 @@ gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
{
/* If we already have a length for this expression then use it. */
if (c->ts.u.cl->length->expr_type != EXPR_CONSTANT)
- return SUCCESS;
+ return true;
i = mpz_get_si (c->ts.u.cl->length->value.integer);
}
else
- return SUCCESS;
+ return true;
}
else
{
@@ -1893,73 +1892,73 @@ gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
gcc_assert (start);
if (end == NULL || end->expr_type != EXPR_CONSTANT
|| start->expr_type != EXPR_CONSTANT)
- return SUCCESS;
+ return true;
i = mpz_get_si (end->value.integer) + 1
- mpz_get_si (start->value.integer);
}
}
else
- return SUCCESS;
+ return true;
if (i != 1)
{
gfc_error ("Argument of %s at %L must be of length one",
gfc_current_intrinsic, &c->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_idnint (gfc_expr *a)
{
- if (double_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!double_check (a, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ieor (gfc_expr *i, gfc_expr *j)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (j, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (j, 1, BT_INTEGER))
+ return false;
if (i->ts.kind != j->ts.kind)
{
- if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
- &i->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
+ &i->where))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_index (gfc_expr *string, gfc_expr *substring, gfc_expr *back,
gfc_expr *kind)
{
- if (type_check (string, 0, BT_CHARACTER) == FAILURE
- || type_check (substring, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (string, 0, BT_CHARACTER)
+ || !type_check (substring, 1, BT_CHARACTER))
+ return false;
- if (back != NULL && type_check (back, 2, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (back != NULL && !type_check (back, 2, BT_LOGICAL))
+ return false;
- if (kind_check (kind, 3, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 3, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
if (string->ts.kind != substring->ts.kind)
{
@@ -1967,86 +1966,86 @@ gfc_check_index (gfc_expr *string, gfc_expr *substring, gfc_expr *back,
"kind as '%s'", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &substring->where,
gfc_current_intrinsic_arg[0]->name);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_int (gfc_expr *x, gfc_expr *kind)
{
- if (numeric_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (x, 0))
+ return false;
- if (kind_check (kind, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_intconv (gfc_expr *x)
{
- if (numeric_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ior (gfc_expr *i, gfc_expr *j)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (j, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (j, 1, BT_INTEGER))
+ return false;
if (i->ts.kind != j->ts.kind)
{
- if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
- &i->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
+ &i->where))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ishft (gfc_expr *i, gfc_expr *shift)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE
- || type_check (shift, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER)
+ || !type_check (shift, 1, BT_INTEGER))
+ return false;
- if (less_than_bitsize1 ("I", i, NULL, shift, true) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize1 ("I", i, NULL, shift, true))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ishftc (gfc_expr *i, gfc_expr *shift, gfc_expr *size)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE
- || type_check (shift, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER)
+ || !type_check (shift, 1, BT_INTEGER))
+ return false;
if (size != NULL)
{
int i2, i3;
- if (type_check (size, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (size, 2, BT_INTEGER))
+ return false;
- if (less_than_bitsize1 ("I", i, "SIZE", size, true) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize1 ("I", i, "SIZE", size, true))
+ return false;
if (size->expr_type == EXPR_CONSTANT)
{
@@ -2054,7 +2053,7 @@ gfc_check_ishftc (gfc_expr *i, gfc_expr *shift, gfc_expr *size)
if (i3 <= 0)
{
gfc_error ("SIZE at %L must be positive", &size->where);
- return FAILURE;
+ return false;
}
if (shift->expr_type == EXPR_CONSTANT)
@@ -2068,60 +2067,60 @@ gfc_check_ishftc (gfc_expr *i, gfc_expr *shift, gfc_expr *size)
gfc_error ("The absolute value of SHIFT at %L must be less "
"than or equal to SIZE at %L", &shift->where,
&size->where);
- return FAILURE;
+ return false;
}
}
}
}
- else if (less_than_bitsize1 ("I", i, NULL, shift, true) == FAILURE)
- return FAILURE;
+ else if (!less_than_bitsize1 ("I", i, NULL, shift, true))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_kill (gfc_expr *pid, gfc_expr *sig)
{
- if (type_check (pid, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (pid, 0, BT_INTEGER))
+ return false;
- if (type_check (sig, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (sig, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_kill_sub (gfc_expr *pid, gfc_expr *sig, gfc_expr *status)
{
- if (type_check (pid, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (pid, 0, BT_INTEGER))
+ return false;
- if (scalar_check (pid, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (pid, 0))
+ return false;
- if (type_check (sig, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (sig, 1, BT_INTEGER))
+ return false;
- if (scalar_check (sig, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (sig, 1))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_kind (gfc_expr *x)
{
if (x->ts.type == BT_DERIVED)
@@ -2129,220 +2128,220 @@ gfc_check_kind (gfc_expr *x)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a "
"non-derived type", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &x->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
- if (dim_rank_check (dim, array, 1) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, array, 1))
+ return false;
- if (kind_check (kind, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 2, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_lcobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind)
{
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
{
gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
- return FAILURE;
+ return false;
}
- if (coarray_check (coarray, 0) == FAILURE)
- return FAILURE;
+ if (!coarray_check (coarray, 0))
+ return false;
if (dim != NULL)
{
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
- if (dim_corank_check (dim, coarray) == FAILURE)
- return FAILURE;
+ if (!dim_corank_check (dim, coarray))
+ return false;
}
- if (kind_check (kind, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 2, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_len_lentrim (gfc_expr *s, gfc_expr *kind)
{
- if (type_check (s, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (s, 0, BT_CHARACTER))
+ return false;
- if (kind_check (kind, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 1, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_lge_lgt_lle_llt (gfc_expr *a, gfc_expr *b)
{
- if (type_check (a, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (a, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (a, 0, gfc_default_character_kind))
+ return false;
- if (type_check (b, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (b, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (b, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (b, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_link (gfc_expr *path1, gfc_expr *path2)
{
- if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path1, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path1, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path1, 0, gfc_default_character_kind))
+ return false;
- if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path2, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path2, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path2, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_link_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
{
- if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path1, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path1, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path1, 0, gfc_default_character_kind))
+ return false;
- if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path2, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path2, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path2, 0, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_loc (gfc_expr *expr)
{
return variable_check (expr, 0, true);
}
-gfc_try
+bool
gfc_check_symlnk (gfc_expr *path1, gfc_expr *path2)
{
- if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path1, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path1, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path1, 0, gfc_default_character_kind))
+ return false;
- if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path2, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path2, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path2, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_symlnk_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
{
- if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path1, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path1, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path1, 0, gfc_default_character_kind))
+ return false;
- if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path2, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path2, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path2, 1, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_logical (gfc_expr *a, gfc_expr *kind)
{
- if (type_check (a, 0, BT_LOGICAL) == FAILURE)
- return FAILURE;
- if (kind_check (kind, 1, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_LOGICAL))
+ return false;
+ if (!kind_check (kind, 1, BT_LOGICAL))
+ return false;
- return SUCCESS;
+ return true;
}
/* Min/max family. */
-static gfc_try
+static bool
min_max_args (gfc_actual_arglist *arg)
{
if (arg == NULL || arg->next == NULL)
{
gfc_error ("Intrinsic '%s' at %L must have at least two arguments",
gfc_current_intrinsic, gfc_current_intrinsic_where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
check_rest (bt type, int kind, gfc_actual_arglist *arglist)
{
gfc_actual_arglist *arg, *tmp;
@@ -2350,8 +2349,8 @@ check_rest (bt type, int kind, gfc_actual_arglist *arglist)
gfc_expr *x;
int m, n;
- if (min_max_args (arglist) == FAILURE)
- return FAILURE;
+ if (!min_max_args (arglist))
+ return false;
for (arg = arglist, n=1; arg; arg = arg->next, n++)
{
@@ -2360,74 +2359,74 @@ check_rest (bt type, int kind, gfc_actual_arglist *arglist)
{
if (x->ts.type == type)
{
- if (gfc_notify_std (GFC_STD_GNU, "Different type "
- "kinds at %L", &x->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Different type "
+ "kinds at %L", &x->where))
+ return false;
}
else
{
gfc_error ("'a%d' argument of '%s' intrinsic at %L must be "
"%s(%d)", n, gfc_current_intrinsic, &x->where,
gfc_basic_typename (type), kind);
- return FAILURE;
+ return false;
}
}
for (tmp = arglist, m=1; tmp != arg; tmp = tmp->next, m++)
- if (gfc_check_conformance (tmp->expr, x,
- "arguments 'a%d' and 'a%d' for "
- "intrinsic '%s'", m, n,
- gfc_current_intrinsic) == FAILURE)
- return FAILURE;
+ if (!gfc_check_conformance (tmp->expr, x,
+ "arguments 'a%d' and 'a%d' for "
+ "intrinsic '%s'", m, n,
+ gfc_current_intrinsic))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_min_max (gfc_actual_arglist *arg)
{
gfc_expr *x;
- if (min_max_args (arg) == FAILURE)
- return FAILURE;
+ if (!min_max_args (arg))
+ return false;
x = arg->expr;
if (x->ts.type == BT_CHARACTER)
{
- if (gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with CHARACTER argument at %L",
- gfc_current_intrinsic, &x->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with CHARACTER argument at %L",
+ gfc_current_intrinsic, &x->where))
+ return false;
}
else if (x->ts.type != BT_INTEGER && x->ts.type != BT_REAL)
{
gfc_error ("'a1' argument of '%s' intrinsic at %L must be INTEGER, "
"REAL or CHARACTER", gfc_current_intrinsic, &x->where);
- return FAILURE;
+ return false;
}
return check_rest (x->ts.type, x->ts.kind, arg);
}
-gfc_try
+bool
gfc_check_min_max_integer (gfc_actual_arglist *arg)
{
return check_rest (BT_INTEGER, gfc_default_integer_kind, arg);
}
-gfc_try
+bool
gfc_check_min_max_real (gfc_actual_arglist *arg)
{
return check_rest (BT_REAL, gfc_default_real_kind, arg);
}
-gfc_try
+bool
gfc_check_min_max_double (gfc_actual_arglist *arg)
{
return check_rest (BT_REAL, gfc_default_double_kind, arg);
@@ -2436,20 +2435,20 @@ gfc_check_min_max_double (gfc_actual_arglist *arg)
/* End of min/max family. */
-gfc_try
+bool
gfc_check_malloc (gfc_expr *size)
{
- if (type_check (size, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (size, 0, BT_INTEGER))
+ return false;
- if (scalar_check (size, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (size, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
{
if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_a->ts))
@@ -2457,7 +2456,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
"or LOGICAL", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &matrix_a->where);
- return FAILURE;
+ return false;
}
if ((matrix_b->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
@@ -2465,7 +2464,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
"or LOGICAL", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &matrix_b->where);
- return FAILURE;
+ return false;
}
if ((matrix_a->ts.type == BT_LOGICAL && gfc_numeric_ts (&matrix_b->ts))
@@ -2474,14 +2473,14 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
gfc_error ("Argument types of '%s' intrinsic at %L must match (%s/%s)",
gfc_current_intrinsic, &matrix_a->where,
gfc_typename(&matrix_a->ts), gfc_typename(&matrix_b->ts));
- return FAILURE;
+ return false;
}
switch (matrix_a->rank)
{
case 1:
- if (rank_check (matrix_b, 1, 2) == FAILURE)
- return FAILURE;
+ if (!rank_check (matrix_b, 1, 2))
+ return false;
/* Check for case matrix_a has shape(m), matrix_b has shape (m, k). */
if (!identical_dimen_shape (matrix_a, 0, matrix_b, 0))
{
@@ -2489,15 +2488,15 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
"and '%s' at %L for intrinsic matmul",
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[1]->name, &matrix_a->where);
- return FAILURE;
+ return false;
}
break;
case 2:
if (matrix_b->rank != 2)
{
- if (rank_check (matrix_b, 1, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (matrix_b, 1, 1))
+ return false;
}
/* matrix_b has rank 1 or 2 here. Common check for the cases
- matrix_a has shape (n,m) and matrix_b has shape (m, k)
@@ -2508,7 +2507,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
"dimension 1 for argument '%s' at %L for intrinsic "
"matmul", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[1]->name, &matrix_a->where);
- return FAILURE;
+ return false;
}
break;
@@ -2516,10 +2515,10 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be of rank "
"1 or 2", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &matrix_a->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -2537,14 +2536,14 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
I.e. in the case of minloc(array,mask), mask will be in the second
position of the argument list and we'll have to fix that up. */
-gfc_try
+bool
gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
{
gfc_expr *a, *m, *d;
a = ap->expr;
- if (int_or_real_check (a, 0) == FAILURE || array_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (a, 0) || !array_check (a, 0))
+ return false;
d = ap->next->expr;
m = ap->next->next->expr;
@@ -2558,24 +2557,24 @@ gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
ap->next->next->expr = m;
}
- if (dim_check (d, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (d, 1, false))
+ return false;
- if (dim_rank_check (d, a, 0) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (d, a, 0))
+ return false;
- if (m != NULL && type_check (m, 2, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (m != NULL && !type_check (m, 2, BT_LOGICAL))
+ return false;
if (m != NULL
- && gfc_check_conformance (a, m,
- "arguments '%s' and '%s' for intrinsic %s",
- gfc_current_intrinsic_arg[0]->name,
- gfc_current_intrinsic_arg[2]->name,
- gfc_current_intrinsic ) == FAILURE)
- return FAILURE;
+ && !gfc_check_conformance (a, m,
+ "arguments '%s' and '%s' for intrinsic %s",
+ gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic_arg[2]->name,
+ gfc_current_intrinsic))
+ return false;
- return SUCCESS;
+ return true;
}
@@ -2594,7 +2593,7 @@ gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
I.e. in the case of minval(array,mask), mask will be in the second
position of the argument list and we'll have to fix that up. */
-static gfc_try
+static bool
check_reduction (gfc_actual_arglist *ap)
{
gfc_expr *a, *m, *d;
@@ -2612,44 +2611,44 @@ check_reduction (gfc_actual_arglist *ap)
ap->next->next->expr = m;
}
- if (dim_check (d, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (d, 1, false))
+ return false;
- if (dim_rank_check (d, a, 0) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (d, a, 0))
+ return false;
- if (m != NULL && type_check (m, 2, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (m != NULL && !type_check (m, 2, BT_LOGICAL))
+ return false;
if (m != NULL
- && gfc_check_conformance (a, m,
- "arguments '%s' and '%s' for intrinsic %s",
- gfc_current_intrinsic_arg[0]->name,
- gfc_current_intrinsic_arg[2]->name,
- gfc_current_intrinsic) == FAILURE)
- return FAILURE;
+ && !gfc_check_conformance (a, m,
+ "arguments '%s' and '%s' for intrinsic %s",
+ gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic_arg[2]->name,
+ gfc_current_intrinsic))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_minval_maxval (gfc_actual_arglist *ap)
{
- if (int_or_real_check (ap->expr, 0) == FAILURE
- || array_check (ap->expr, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (ap->expr, 0)
+ || !array_check (ap->expr, 0))
+ return false;
return check_reduction (ap);
}
-gfc_try
+bool
gfc_check_product_sum (gfc_actual_arglist *ap)
{
- if (numeric_check (ap->expr, 0) == FAILURE
- || array_check (ap->expr, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (ap->expr, 0)
+ || !array_check (ap->expr, 0))
+ return false;
return check_reduction (ap);
}
@@ -2657,33 +2656,33 @@ gfc_check_product_sum (gfc_actual_arglist *ap)
/* For IANY, IALL and IPARITY. */
-gfc_try
+bool
gfc_check_mask (gfc_expr *i, gfc_expr *kind)
{
int k;
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (nonnegative_check ("I", i) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("I", i))
+ return false;
- if (kind_check (kind, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 1, BT_INTEGER))
+ return false;
if (kind)
gfc_extract_int (kind, &k);
else
k = gfc_default_integer_kind;
- if (less_than_bitsizekind ("I", i, k) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsizekind ("I", i, k))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_transf_bit_intrins (gfc_actual_arglist *ap)
{
if (ap->expr->ts.type != BT_INTEGER)
@@ -2691,77 +2690,77 @@ gfc_check_transf_bit_intrins (gfc_actual_arglist *ap)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be INTEGER",
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &ap->expr->where);
- return FAILURE;
+ return false;
}
- if (array_check (ap->expr, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (ap->expr, 0))
+ return false;
return check_reduction (ap);
}
-gfc_try
+bool
gfc_check_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
{
- if (same_type_check (tsource, 0, fsource, 1) == FAILURE)
- return FAILURE;
+ if (!same_type_check (tsource, 0, fsource, 1))
+ return false;
- if (type_check (mask, 2, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 2, BT_LOGICAL))
+ return false;
if (tsource->ts.type == BT_CHARACTER)
return gfc_check_same_strlen (tsource, fsource, "MERGE intrinsic");
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_merge_bits (gfc_expr *i, gfc_expr *j, gfc_expr *mask)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (j, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (j, 1, BT_INTEGER))
+ return false;
- if (type_check (mask, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 2, BT_INTEGER))
+ return false;
- if (same_type_check (i, 0, j, 1) == FAILURE)
- return FAILURE;
+ if (!same_type_check (i, 0, j, 1))
+ return false;
- if (same_type_check (i, 0, mask, 2) == FAILURE)
- return FAILURE;
+ if (!same_type_check (i, 0, mask, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
{
- if (variable_check (from, 0, false) == FAILURE)
- return FAILURE;
- if (allocatable_check (from, 0) == FAILURE)
- return FAILURE;
+ if (!variable_check (from, 0, false))
+ return false;
+ if (!allocatable_check (from, 0))
+ return false;
if (gfc_is_coindexed (from))
{
gfc_error ("The FROM argument to MOVE_ALLOC at %L shall not be "
"coindexed", &from->where);
- return FAILURE;
+ return false;
}
- if (variable_check (to, 1, false) == FAILURE)
- return FAILURE;
- if (allocatable_check (to, 1) == FAILURE)
- return FAILURE;
+ if (!variable_check (to, 1, false))
+ return false;
+ if (!allocatable_check (to, 1))
+ return false;
if (gfc_is_coindexed (to))
{
gfc_error ("The TO argument to MOVE_ALLOC at %L shall not be "
"coindexed", &to->where);
- return FAILURE;
+ return false;
}
if (from->ts.type == BT_CLASS && to->ts.type == BT_DERIVED)
@@ -2769,18 +2768,18 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
gfc_error ("The TO arguments in MOVE_ALLOC at %L must be "
"polymorphic if FROM is polymorphic",
&to->where);
- return FAILURE;
+ return false;
}
- if (same_type_check (to, 1, from, 0) == FAILURE)
- return FAILURE;
+ if (!same_type_check (to, 1, from, 0))
+ return false;
if (to->rank != from->rank)
{
gfc_error ("The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L "
"must have the same rank %d/%d", &to->where, from->rank,
to->rank);
- return FAILURE;
+ return false;
}
/* IR F08/0040; cf. 12-006A. */
@@ -2789,7 +2788,7 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
gfc_error ("The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L "
"must have the same corank %d/%d", &to->where,
gfc_get_corank (from), gfc_get_corank (to));
- return FAILURE;
+ return false;
}
/* CLASS arguments: Make sure the vtab of from is present. */
@@ -2801,18 +2800,18 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
gfc_find_intrinsic_vtab (&from->ts);
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_nearest (gfc_expr *x, gfc_expr *s)
{
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
- if (type_check (s, 1, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (s, 1, BT_REAL))
+ return false;
if (s->expr_type == EXPR_CONSTANT)
{
@@ -2820,49 +2819,49 @@ gfc_check_nearest (gfc_expr *x, gfc_expr *s)
{
gfc_error ("Argument 'S' of NEAREST at %L shall not be zero",
&s->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_new_line (gfc_expr *a)
{
- if (type_check (a, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_CHARACTER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_norm2 (gfc_expr *array, gfc_expr *dim)
{
- if (type_check (array, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (array, 0, BT_REAL))
+ return false;
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (dim_rank_check (dim, array, false) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, array, false))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_null (gfc_expr *mold)
{
symbol_attribute attr;
if (mold == NULL)
- return SUCCESS;
+ return true;
- if (variable_check (mold, 0, true) == FAILURE)
- return FAILURE;
+ if (!variable_check (mold, 0, true))
+ return false;
attr = gfc_variable_attr (mold, NULL);
@@ -2872,13 +2871,13 @@ gfc_check_null (gfc_expr *mold)
"ALLOCATABLE or procedure pointer",
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &mold->where);
- return FAILURE;
+ return false;
}
if (attr.allocatable
- && gfc_notify_std (GFC_STD_F2003, "NULL intrinsic with "
- "allocatable MOLD at %L", &mold->where) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2003, "NULL intrinsic with "
+ "allocatable MOLD at %L", &mold->where))
+ return false;
/* F2008, C1242. */
if (gfc_is_coindexed (mold))
@@ -2886,44 +2885,44 @@ gfc_check_null (gfc_expr *mold)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be "
"coindexed", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &mold->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
{
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (type_check (mask, 1, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 1, BT_LOGICAL))
+ return false;
- if (gfc_check_conformance (array, mask,
- "arguments '%s' and '%s' for intrinsic '%s'",
- gfc_current_intrinsic_arg[0]->name,
- gfc_current_intrinsic_arg[1]->name,
- gfc_current_intrinsic) == FAILURE)
- return FAILURE;
+ if (!gfc_check_conformance (array, mask,
+ "arguments '%s' and '%s' for intrinsic '%s'",
+ gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic_arg[1]->name,
+ gfc_current_intrinsic))
+ return false;
if (vector != NULL)
{
mpz_t array_size, vector_size;
bool have_array_size, have_vector_size;
- if (same_type_check (array, 0, vector, 2) == FAILURE)
- return FAILURE;
+ if (!same_type_check (array, 0, vector, 2))
+ return false;
- if (rank_check (vector, 2, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (vector, 2, 1))
+ return false;
/* VECTOR requires at least as many elements as MASK
has .TRUE. values. */
- have_array_size = gfc_array_size (array, &array_size) == SUCCESS;
- have_vector_size = gfc_array_size (vector, &vector_size) == SUCCESS;
+ have_array_size = gfc_array_size(array, &array_size);
+ have_vector_size = gfc_array_size(vector, &vector_size);
if (have_vector_size
&& (mask->expr_type == EXPR_ARRAY
@@ -2962,7 +2961,7 @@ gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
gfc_current_intrinsic, &vector->where,
gfc_current_intrinsic_arg[1]->name,
mpz_get_si (vector_size), mask_true_values);
- return FAILURE;
+ return false;
}
}
@@ -2972,43 +2971,43 @@ gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
mpz_clear (vector_size);
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_parity (gfc_expr *mask, gfc_expr *dim)
{
- if (type_check (mask, 0, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 0, BT_LOGICAL))
+ return false;
- if (array_check (mask, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (mask, 0))
+ return false;
- if (dim_rank_check (dim, mask, false) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, mask, false))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_precision (gfc_expr *x)
{
- if (real_or_complex_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!real_or_complex_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_present (gfc_expr *a)
{
gfc_symbol *sym;
- if (variable_check (a, 0, true) == FAILURE)
- return FAILURE;
+ if (!variable_check (a, 0, true))
+ return false;
sym = a->symtree->n.sym;
if (!sym->attr.dummy)
@@ -3016,7 +3015,7 @@ gfc_check_present (gfc_expr *a)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be of a "
"dummy variable", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &a->where);
- return FAILURE;
+ return false;
}
if (!sym->attr.optional)
@@ -3025,7 +3024,7 @@ gfc_check_present (gfc_expr *a)
"an OPTIONAL dummy variable",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&a->where);
- return FAILURE;
+ return false;
}
/* 13.14.82 PRESENT(A)
@@ -3043,34 +3042,34 @@ gfc_check_present (gfc_expr *a)
gfc_error ("'%s' argument of '%s' intrinsic at %L must not be a "
"subobject of '%s'", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &a->where, sym->name);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_radix (gfc_expr *x)
{
- if (int_or_real_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_range (gfc_expr *x)
{
- if (numeric_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_rank (gfc_expr *a ATTRIBUTE_UNUSED)
{
/* Any data object is allowed; a "data object" is a "constant (4.1.3),
@@ -3090,90 +3089,90 @@ gfc_check_rank (gfc_expr *a ATTRIBUTE_UNUSED)
{
gfc_error ("The argument of the RANK intrinsic at %L must be a data "
"object", &a->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* real, float, sngl. */
-gfc_try
+bool
gfc_check_real (gfc_expr *a, gfc_expr *kind)
{
- if (numeric_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!numeric_check (a, 0))
+ return false;
- if (kind_check (kind, 1, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 1, BT_REAL))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_rename (gfc_expr *path1, gfc_expr *path2)
{
- if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path1, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path1, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path1, 0, gfc_default_character_kind))
+ return false;
- if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path2, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path2, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path2, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_rename_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
{
- if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path1, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path1, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path1, 0, gfc_default_character_kind))
+ return false;
- if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (path2, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (path2, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (path2, 1, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_repeat (gfc_expr *x, gfc_expr *y)
{
- if (type_check (x, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_CHARACTER))
+ return false;
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (x, 0))
+ return false;
- if (type_check (y, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (y, 0, BT_INTEGER))
+ return false;
- if (scalar_check (y, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (y, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
gfc_expr *pad, gfc_expr *order)
{
@@ -3181,20 +3180,20 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
mpz_t nelems;
int shape_size;
- if (array_check (source, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (source, 0))
+ return false;
- if (rank_check (shape, 1, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (shape, 1, 1))
+ return false;
- if (type_check (shape, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (shape, 1, BT_INTEGER))
+ return false;
- if (gfc_array_size (shape, &size) != SUCCESS)
+ if (!gfc_array_size (shape, &size))
{
gfc_error ("'shape' argument of 'reshape' intrinsic at %L must be an "
"array of constant size", &shape->where);
- return FAILURE;
+ return false;
}
shape_size = mpz_get_ui (size);
@@ -3205,13 +3204,13 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
gfc_error ("'%s' argument of '%s' intrinsic at %L is empty",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&shape->where);
- return FAILURE;
+ return false;
}
else if (shape_size > GFC_MAX_DIMENSIONS)
{
gfc_error ("'shape' argument of 'reshape' intrinsic at %L has more "
"than %d elements", &shape->where, GFC_MAX_DIMENSIONS);
- return FAILURE;
+ return false;
}
else if (shape->expr_type == EXPR_ARRAY)
{
@@ -3230,27 +3229,27 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
"negative element (%d)",
gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &e->where, extent);
- return FAILURE;
+ return false;
}
}
}
if (pad != NULL)
{
- if (same_type_check (source, 0, pad, 2) == FAILURE)
- return FAILURE;
+ if (!same_type_check (source, 0, pad, 2))
+ return false;
- if (array_check (pad, 2) == FAILURE)
- return FAILURE;
+ if (!array_check (pad, 2))
+ return false;
}
if (order != NULL)
{
- if (array_check (order, 3) == FAILURE)
- return FAILURE;
+ if (!array_check (order, 3))
+ return false;
- if (type_check (order, 3, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (order, 3, BT_INTEGER))
+ return false;
if (order->expr_type == EXPR_ARRAY)
{
@@ -3271,7 +3270,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
gfc_current_intrinsic_arg[3]->name,
gfc_current_intrinsic, &order->where,
order_size, shape_size);
- return FAILURE;
+ return false;
}
for (i = 1; i <= order_size; ++i)
@@ -3288,7 +3287,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
"has out-of-range dimension (%d)",
gfc_current_intrinsic_arg[3]->name,
gfc_current_intrinsic, &e->where, dim);
- return FAILURE;
+ return false;
}
if (perm[dim-1] != 0)
@@ -3298,7 +3297,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
"'%d' duplicated)",
gfc_current_intrinsic_arg[3]->name,
gfc_current_intrinsic, &e->where, dim);
- return FAILURE;
+ return false;
}
perm[dim-1] = 1;
@@ -3312,7 +3311,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
&& source->symtree->n.sym->as->type == AS_ASSUMED_SIZE))
{
/* Check the match in size between source and destination. */
- if (gfc_array_size (source, &nelems) == SUCCESS)
+ if (gfc_array_size (source, &nelems))
{
gfc_constructor *c;
bool test;
@@ -3332,16 +3331,16 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
gfc_error ("Without padding, there are not enough elements "
"in the intrinsic RESHAPE source at %L to match "
"the shape", &source->where);
- return FAILURE;
+ return false;
}
}
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_same_type_as (gfc_expr *a, gfc_expr *b)
{
if (a->ts.type != BT_DERIVED && a->ts.type != BT_CLASS)
@@ -3351,7 +3350,7 @@ gfc_check_same_type_as (gfc_expr *a, gfc_expr *b)
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic,
&a->where, gfc_typename (&a->ts));
- return FAILURE;
+ return false;
}
if (!(gfc_type_is_extensible (a->ts.u.derived) || UNLIMITED_POLY (a)))
@@ -3360,7 +3359,7 @@ gfc_check_same_type_as (gfc_expr *a, gfc_expr *b)
"must be of an extensible type",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&a->where);
- return FAILURE;
+ return false;
}
if (b->ts.type != BT_DERIVED && b->ts.type != BT_CLASS)
@@ -3370,7 +3369,7 @@ gfc_check_same_type_as (gfc_expr *a, gfc_expr *b)
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic,
&b->where, gfc_typename (&b->ts));
- return FAILURE;
+ return false;
}
if (!(gfc_type_is_extensible (b->ts.u.derived) || UNLIMITED_POLY (b)))
@@ -3379,162 +3378,162 @@ gfc_check_same_type_as (gfc_expr *a, gfc_expr *b)
"must be of an extensible type",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&b->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_scale (gfc_expr *x, gfc_expr *i)
{
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
- if (type_check (i, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_scan (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
{
- if (type_check (x, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_CHARACTER))
+ return false;
- if (type_check (y, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (y, 1, BT_CHARACTER))
+ return false;
- if (z != NULL && type_check (z, 2, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (z != NULL && !type_check (z, 2, BT_LOGICAL))
+ return false;
- if (kind_check (kind, 3, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 3, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- if (same_type_check (x, 0, y, 1) == FAILURE)
- return FAILURE;
+ if (!same_type_check (x, 0, y, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_secnds (gfc_expr *r)
{
- if (type_check (r, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (r, 0, BT_REAL))
+ return false;
- if (kind_value_check (r, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (r, 0, 4))
+ return false;
- if (scalar_check (r, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (r, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_selected_char_kind (gfc_expr *name)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- if (scalar_check (name, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (name, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_selected_int_kind (gfc_expr *r)
{
- if (type_check (r, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (r, 0, BT_INTEGER))
+ return false;
- if (scalar_check (r, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (r, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r, gfc_expr *radix)
{
if (p == NULL && r == NULL
- && gfc_notify_std (GFC_STD_F2008, "SELECTED_REAL_KIND with"
- " neither 'P' nor 'R' argument at %L",
- gfc_current_intrinsic_where) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2008, "SELECTED_REAL_KIND with"
+ " neither 'P' nor 'R' argument at %L",
+ gfc_current_intrinsic_where))
+ return false;
if (p)
{
- if (type_check (p, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (p, 0, BT_INTEGER))
+ return false;
- if (scalar_check (p, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (p, 0))
+ return false;
}
if (r)
{
- if (type_check (r, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (r, 1, BT_INTEGER))
+ return false;
- if (scalar_check (r, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (r, 1))
+ return false;
}
if (radix)
{
- if (type_check (radix, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (radix, 1, BT_INTEGER))
+ return false;
- if (scalar_check (radix, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (radix, 1))
+ return false;
- if (gfc_notify_std (GFC_STD_F2008, "'%s' intrinsic with "
- "RADIX argument at %L", gfc_current_intrinsic,
- &radix->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2008, "'%s' intrinsic with "
+ "RADIX argument at %L", gfc_current_intrinsic,
+ &radix->where))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_set_exponent (gfc_expr *x, gfc_expr *i)
{
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
- if (type_check (i, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_shape (gfc_expr *source, gfc_expr *kind)
{
gfc_array_ref *ar;
if (source->rank == 0 || source->expr_type != EXPR_VARIABLE)
- return SUCCESS;
+ return true;
ar = gfc_find_array_ref (source);
@@ -3542,77 +3541,77 @@ gfc_check_shape (gfc_expr *source, gfc_expr *kind)
{
gfc_error ("'source' argument of 'shape' intrinsic at %L must not be "
"an assumed size array", &source->where);
- return FAILURE;
+ return false;
}
- if (kind_check (kind, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 1, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_shift (gfc_expr *i, gfc_expr *shift)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (type_check (shift, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (shift, 0, BT_INTEGER))
+ return false;
- if (nonnegative_check ("SHIFT", shift) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("SHIFT", shift))
+ return false;
- if (less_than_bitsize1 ("I", i, "SHIFT", shift, true) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize1 ("I", i, "SHIFT", shift, true))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_sign (gfc_expr *a, gfc_expr *b)
{
- if (int_or_real_check (a, 0) == FAILURE)
- return FAILURE;
+ if (!int_or_real_check (a, 0))
+ return false;
- if (same_type_check (a, 0, b, 1) == FAILURE)
- return FAILURE;
+ if (!same_type_check (a, 0, b, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (dim_check (dim, 1, true) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, true))
+ return false;
- if (dim_rank_check (dim, array, 0) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, array, 0))
+ return false;
- if (kind_check (kind, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 2, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_sizeof (gfc_expr *arg)
{
if (arg->ts.type == BT_PROCEDURE)
@@ -3620,7 +3619,7 @@ gfc_check_sizeof (gfc_expr *arg)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be a procedure",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&arg->where);
- return FAILURE;
+ return false;
}
if (arg->ts.type == BT_ASSUMED)
@@ -3628,7 +3627,7 @@ gfc_check_sizeof (gfc_expr *arg)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be TYPE(*)",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&arg->where);
- return FAILURE;
+ return false;
}
if (arg->rank && arg->expr_type == EXPR_VARIABLE
@@ -3639,21 +3638,22 @@ gfc_check_sizeof (gfc_expr *arg)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be an "
"assumed-size array", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &arg->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Check whether an expression is interoperable. When returning false,
msg is set to a string telling why the expression is not interoperable,
otherwise, it is set to NULL. The msg string can be used in diagnostics.
- If all_len_okay is true, all length-type parameters (for character) are
- allowed. Required for C_LOC (cf. Fortran 2003corr5 or Fortran 2008). */
+ If c_loc is true, character with len > 1 are allowed (cf. Fortran
+ 2003corr5); additionally, assumed-shape/assumed-rank/deferred-shape
+ arrays are permitted. */
static bool
-is_c_interoperable (gfc_expr *expr, const char **msg, bool all_len_okay)
+is_c_interoperable (gfc_expr *expr, const char **msg, bool c_loc)
{
*msg = NULL;
@@ -3703,10 +3703,10 @@ is_c_interoperable (gfc_expr *expr, const char **msg, bool all_len_okay)
}
if (expr->ts.u.cl && expr->ts.u.cl->length
- && gfc_simplify_expr (expr, 0) == FAILURE)
+ && !gfc_simplify_expr (expr, 0))
gfc_internal_error ("is_c_interoperable(): gfc_simplify_expr failed");
- if (!all_len_okay && expr->ts.u.cl
+ if (!c_loc && expr->ts.u.cl
&& (!expr->ts.u.cl->length
|| expr->ts.u.cl->length->expr_type != EXPR_CONSTANT
|| mpz_cmp_si (expr->ts.u.cl->length->value.integer, 1) != 0))
@@ -3726,7 +3726,7 @@ is_c_interoperable (gfc_expr *expr, const char **msg, bool all_len_okay)
return false;
}
- if (expr->rank > 0 && expr->expr_type != EXPR_ARRAY)
+ if (!c_loc && expr->rank > 0 && expr->expr_type != EXPR_ARRAY)
{
gfc_array_ref *ar = gfc_find_array_ref (expr);
if (ar->type != AR_FULL)
@@ -3745,18 +3745,18 @@ is_c_interoperable (gfc_expr *expr, const char **msg, bool all_len_okay)
}
-gfc_try
+bool
gfc_check_c_sizeof (gfc_expr *arg)
{
const char *msg;
- if (is_c_interoperable (arg, &msg, false) != SUCCESS)
+ if (!is_c_interoperable (arg, &msg, false))
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be an "
"interoperable data entity: %s",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&arg->where, msg);
- return FAILURE;
+ return false;
}
if (arg->ts.type == BT_ASSUMED)
@@ -3765,7 +3765,7 @@ gfc_check_c_sizeof (gfc_expr *arg)
"TYPE(*)",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&arg->where);
- return FAILURE;
+ return false;
}
if (arg->rank && arg->expr_type == EXPR_VARIABLE
@@ -3776,14 +3776,14 @@ gfc_check_c_sizeof (gfc_expr *arg)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be an "
"assumed-size array", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &arg->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_c_associated (gfc_expr *c_ptr_1, gfc_expr *c_ptr_2)
{
if (c_ptr_1->ts.type != BT_DERIVED
@@ -3793,11 +3793,11 @@ gfc_check_c_associated (gfc_expr *c_ptr_1, gfc_expr *c_ptr_2)
{
gfc_error ("Argument C_PTR_1 at %L to C_ASSOCIATED shall have the "
"type TYPE(C_PTR) or TYPE(C_FUNPTR)", &c_ptr_1->where);
- return FAILURE;
+ return false;
}
- if (scalar_check (c_ptr_1, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (c_ptr_1, 0))
+ return false;
if (c_ptr_2
&& (c_ptr_2->ts.type != BT_DERIVED
@@ -3809,17 +3809,17 @@ gfc_check_c_associated (gfc_expr *c_ptr_1, gfc_expr *c_ptr_2)
"same type as C_PTR_1: %s instead of %s", &c_ptr_1->where,
gfc_typename (&c_ptr_1->ts),
gfc_typename (&c_ptr_2->ts));
- return FAILURE;
+ return false;
}
- if (c_ptr_2 && scalar_check (c_ptr_2, 1) == FAILURE)
- return FAILURE;
+ if (c_ptr_2 && !scalar_check (c_ptr_2, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *fptr, gfc_expr *shape)
{
symbol_attribute attr;
@@ -3831,11 +3831,11 @@ gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *fptr, gfc_expr *shape)
{
gfc_error ("Argument CPTR at %L to C_F_POINTER shall have the "
"type TYPE(C_PTR)", &cptr->where);
- return FAILURE;
+ return false;
}
- if (scalar_check (cptr, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (cptr, 0))
+ return false;
attr = gfc_expr_attr (fptr);
@@ -3843,53 +3843,53 @@ gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *fptr, gfc_expr *shape)
{
gfc_error ("Argument FPTR at %L to C_F_POINTER must be a pointer",
&fptr->where);
- return FAILURE;
+ return false;
}
if (fptr->ts.type == BT_CLASS)
{
gfc_error ("FPTR argument at %L to C_F_POINTER shall not be polymorphic",
&fptr->where);
- return FAILURE;
+ return false;
}
if (gfc_is_coindexed (fptr))
{
gfc_error ("Argument FPTR at %L to C_F_POINTER shall not be "
"coindexed", &fptr->where);
- return FAILURE;
+ return false;
}
if (fptr->rank == 0 && shape)
{
gfc_error ("Unexpected SHAPE argument at %L to C_F_POINTER with scalar "
"FPTR", &fptr->where);
- return FAILURE;
+ return false;
}
else if (fptr->rank && !shape)
{
gfc_error ("Expected SHAPE argument to C_F_POINTER with array "
"FPTR at %L", &fptr->where);
- return FAILURE;
+ return false;
}
- if (shape && rank_check (shape, 2, 1) == FAILURE)
- return FAILURE;
+ if (shape && !rank_check (shape, 2, 1))
+ return false;
- if (shape && type_check (shape, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (shape && !type_check (shape, 2, BT_INTEGER))
+ return false;
if (shape)
{
mpz_t size;
- if (gfc_array_size (shape, &size) == SUCCESS
+ if (gfc_array_size (shape, &size)
&& mpz_cmp_ui (size, fptr->rank) != 0)
{
mpz_clear (size);
gfc_error ("SHAPE argument at %L to C_F_POINTER must have the same "
"size as the RANK of FPTR", &shape->where);
- return FAILURE;
+ return false;
}
mpz_clear (size);
}
@@ -3897,18 +3897,18 @@ gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *fptr, gfc_expr *shape)
if (fptr->ts.type == BT_CLASS)
{
gfc_error ("Polymorphic FPTR at %L to C_F_POINTER", &fptr->where);
- return FAILURE;
+ return false;
}
if (!is_c_interoperable (fptr, &msg, false) && fptr->rank)
return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable array FPTR "
"at %L to C_F_POINTER: %s", &fptr->where, msg);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_c_f_procpointer (gfc_expr *cptr, gfc_expr *fptr)
{
symbol_attribute attr;
@@ -3919,11 +3919,11 @@ gfc_check_c_f_procpointer (gfc_expr *cptr, gfc_expr *fptr)
{
gfc_error ("Argument CPTR at %L to C_F_PROCPOINTER shall have the "
"type TYPE(C_FUNPTR)", &cptr->where);
- return FAILURE;
+ return false;
}
- if (scalar_check (cptr, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (cptr, 0))
+ return false;
attr = gfc_expr_attr (fptr);
@@ -3931,25 +3931,25 @@ gfc_check_c_f_procpointer (gfc_expr *cptr, gfc_expr *fptr)
{
gfc_error ("Argument FPTR at %L to C_F_PROCPOINTER shall be a procedure "
"pointer", &fptr->where);
- return FAILURE;
+ return false;
}
if (gfc_is_coindexed (fptr))
{
gfc_error ("Argument FPTR at %L to C_F_PROCPOINTER shall not be "
"coindexed", &fptr->where);
- return FAILURE;
+ return false;
}
if (!attr.is_bind_c)
return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable procedure "
"pointer at %L to C_F_PROCPOINTER", &fptr->where);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_c_funloc (gfc_expr *x)
{
symbol_attribute attr;
@@ -3958,7 +3958,7 @@ gfc_check_c_funloc (gfc_expr *x)
{
gfc_error ("Argument X at %L to C_FUNLOC shall not be "
"coindexed", &x->where);
- return FAILURE;
+ return false;
}
attr = gfc_expr_attr (x);
@@ -3973,7 +3973,7 @@ gfc_check_c_funloc (gfc_expr *x)
{
gfc_error ("Function result '%s' at %L is invalid as X argument "
"to C_FUNLOC", x->symtree->n.sym->name, &x->where);
- return FAILURE;
+ return false;
}
}
@@ -3981,17 +3981,17 @@ gfc_check_c_funloc (gfc_expr *x)
{
gfc_error ("Argument X at %L to C_FUNLOC shall be a procedure "
"or a procedure pointer", &x->where);
- return FAILURE;
+ return false;
}
if (!attr.is_bind_c)
return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable procedure "
"at %L to C_FUNLOC", &x->where);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_c_loc (gfc_expr *x)
{
symbol_attribute attr;
@@ -4000,14 +4000,14 @@ gfc_check_c_loc (gfc_expr *x)
if (gfc_is_coindexed (x))
{
gfc_error ("Argument X at %L to C_LOC shall not be coindexed", &x->where);
- return FAILURE;
+ return false;
}
if (x->ts.type == BT_CLASS)
{
gfc_error ("X argument at %L to C_LOC shall not be polymorphic",
&x->where);
- return FAILURE;
+ return false;
}
attr = gfc_expr_attr (x);
@@ -4018,7 +4018,7 @@ gfc_check_c_loc (gfc_expr *x)
{
gfc_error ("Argument X at %L to C_LOC shall have either "
"the POINTER or the TARGET attribute", &x->where);
- return FAILURE;
+ return false;
}
if (x->ts.type == BT_CHARACTER
@@ -4026,7 +4026,7 @@ gfc_check_c_loc (gfc_expr *x)
{
gfc_error ("Argument X at %L to C_LOC shall be not be a zero-sized "
"string", &x->where);
- return FAILURE;
+ return false;
}
if (!is_c_interoperable (x, &msg, true))
@@ -4035,47 +4035,64 @@ gfc_check_c_loc (gfc_expr *x)
{
gfc_error ("Argument at %L to C_LOC shall not be polymorphic",
&x->where);
- return FAILURE;
+ return false;
}
if (x->rank
- && gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable array at %L as"
- " argument to C_LOC: %s", &x->where, msg) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2008_TS,
+ "Noninteroperable array at %L as"
+ " argument to C_LOC: %s", &x->where, msg))
+ return false;
}
+ else if (x->rank > 0 && gfc_notification_std (GFC_STD_F2008))
+ {
+ gfc_array_ref *ar = gfc_find_array_ref (x);
- return SUCCESS;
+ if (ar->as->type != AS_EXPLICIT && ar->as->type != AS_ASSUMED_SIZE
+ && !attr.allocatable
+ && !gfc_notify_std (GFC_STD_F2008,
+ "Array of interoperable type at %L "
+ "to C_LOC which is nonallocatable and neither "
+ "assumed size nor explicit size", &x->where))
+ return false;
+ else if (ar->type != AR_FULL
+ && !gfc_notify_std (GFC_STD_F2008, "Array section at %L "
+ "to C_LOC", &x->where))
+ return false;
+ }
+
+ return true;
}
-gfc_try
+bool
gfc_check_sleep_sub (gfc_expr *seconds)
{
- if (type_check (seconds, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (seconds, 0, BT_INTEGER))
+ return false;
- if (scalar_check (seconds, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (seconds, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_sngl (gfc_expr *a)
{
- if (type_check (a, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (a, 0, BT_REAL))
+ return false;
if ((a->ts.kind != gfc_default_double_kind)
- && gfc_notify_std (GFC_STD_GNU, "non double precision "
- "REAL argument to %s intrinsic at %L",
- gfc_current_intrinsic, &a->where) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_GNU, "non double precision "
+ "REAL argument to %s intrinsic at %L",
+ gfc_current_intrinsic, &a->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_spread (gfc_expr *source, gfc_expr *dim, gfc_expr *ncopies)
{
if (source->rank >= GFC_MAX_DIMENSIONS)
@@ -4084,14 +4101,14 @@ gfc_check_spread (gfc_expr *source, gfc_expr *dim, gfc_expr *ncopies)
"than rank %d", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &source->where, GFC_MAX_DIMENSIONS);
- return FAILURE;
+ return false;
}
if (dim == NULL)
- return FAILURE;
+ return false;
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
/* dim_rank_check() does not apply here. */
if (dim
@@ -4102,251 +4119,251 @@ gfc_check_spread (gfc_expr *source, gfc_expr *dim, gfc_expr *ncopies)
gfc_error ("'%s' argument of '%s' intrinsic at %L is not a valid "
"dimension index", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &dim->where);
- return FAILURE;
+ return false;
}
- if (type_check (ncopies, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (ncopies, 2, BT_INTEGER))
+ return false;
- if (scalar_check (ncopies, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (ncopies, 2))
+ return false;
- return SUCCESS;
+ return true;
}
/* Functions for checking FGETC, FPUTC, FGET and FPUT (subroutines and
functions). */
-gfc_try
+bool
gfc_check_fgetputc_sub (gfc_expr *unit, gfc_expr *c, gfc_expr *status)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (c, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (c, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (c, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (c, 1, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE
- || kind_value_check (status, 2, gfc_default_integer_kind) == FAILURE
- || scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER)
+ || !kind_value_check (status, 2, gfc_default_integer_kind)
+ || !scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fgetputc (gfc_expr *unit, gfc_expr *c)
{
return gfc_check_fgetputc_sub (unit, c, NULL);
}
-gfc_try
+bool
gfc_check_fgetput_sub (gfc_expr *c, gfc_expr *status)
{
- if (type_check (c, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (c, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (c, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (c, 0, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 1, BT_INTEGER) == FAILURE
- || kind_value_check (status, 1, gfc_default_integer_kind) == FAILURE
- || scalar_check (status, 1) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 1, BT_INTEGER)
+ || !kind_value_check (status, 1, gfc_default_integer_kind)
+ || !scalar_check (status, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fgetput (gfc_expr *c)
{
return gfc_check_fgetput_sub (c, NULL);
}
-gfc_try
+bool
gfc_check_fseek_sub (gfc_expr *unit, gfc_expr *offset, gfc_expr *whence, gfc_expr *status)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (offset, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (offset, 1, BT_INTEGER))
+ return false;
- if (scalar_check (offset, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (offset, 1))
+ return false;
- if (type_check (whence, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (whence, 2, BT_INTEGER))
+ return false;
- if (scalar_check (whence, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (whence, 2))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 3, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 3, BT_INTEGER))
+ return false;
- if (kind_value_check (status, 3, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (status, 3, 4))
+ return false;
- if (scalar_check (status, 3) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 3))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fstat (gfc_expr *unit, gfc_expr *array)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (array, 1, BT_INTEGER) == FAILURE
- || kind_value_check (unit, 0, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (array, 1, BT_INTEGER)
+ || !kind_value_check (unit, 0, gfc_default_integer_kind))
+ return false;
- if (array_check (array, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fstat_sub (gfc_expr *unit, gfc_expr *array, gfc_expr *status)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (array, 1, BT_INTEGER) == FAILURE
- || kind_value_check (array, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (array, 1, BT_INTEGER)
+ || !kind_value_check (array, 1, gfc_default_integer_kind))
+ return false;
- if (array_check (array, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 1))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE
- || kind_value_check (status, 2, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER)
+ || !kind_value_check (status, 2, gfc_default_integer_kind))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ftell (gfc_expr *unit)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ftell_sub (gfc_expr *unit, gfc_expr *offset)
{
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (offset, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (offset, 1, BT_INTEGER))
+ return false;
- if (scalar_check (offset, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (offset, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_stat (gfc_expr *name, gfc_expr *array)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- if (type_check (array, 1, BT_INTEGER) == FAILURE
- || kind_value_check (array, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (array, 1, BT_INTEGER)
+ || !kind_value_check (array, 1, gfc_default_integer_kind))
+ return false;
- if (array_check (array, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_stat_sub (gfc_expr *name, gfc_expr *array, gfc_expr *status)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- if (type_check (array, 1, BT_INTEGER) == FAILURE
- || kind_value_check (array, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (array, 1, BT_INTEGER)
+ || !kind_value_check (array, 1, gfc_default_integer_kind))
+ return false;
- if (array_check (array, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 1))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE
- || kind_value_check (array, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER)
+ || !kind_value_check (array, 1, gfc_default_integer_kind))
+ return false;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_image_index (gfc_expr *coarray, gfc_expr *sub)
{
mpz_t nelems;
@@ -4354,20 +4371,20 @@ gfc_check_image_index (gfc_expr *coarray, gfc_expr *sub)
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
{
gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
- return FAILURE;
+ return false;
}
- if (coarray_check (coarray, 0) == FAILURE)
- return FAILURE;
+ if (!coarray_check (coarray, 0))
+ return false;
if (sub->rank != 1)
{
gfc_error ("%s argument to IMAGE_INDEX must be a rank one array at %L",
gfc_current_intrinsic_arg[1]->name, &sub->where);
- return FAILURE;
+ return false;
}
- if (gfc_array_size (sub, &nelems) == SUCCESS)
+ if (gfc_array_size (sub, &nelems))
{
int corank = gfc_get_corank (coarray);
@@ -4377,53 +4394,53 @@ gfc_check_image_index (gfc_expr *coarray, gfc_expr *sub)
"IMAGE_INDEX at %L shall be %d (corank) not %d",
&sub->where, corank, (int) mpz_get_si (nelems));
mpz_clear (nelems);
- return FAILURE;
+ return false;
}
mpz_clear (nelems);
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_this_image (gfc_expr *coarray, gfc_expr *dim)
{
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
{
gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
- return FAILURE;
+ return false;
}
if (dim != NULL && coarray == NULL)
{
gfc_error ("DIM argument without ARRAY argument not allowed for THIS_IMAGE "
"intrinsic at %L", &dim->where);
- return FAILURE;
+ return false;
}
if (coarray == NULL)
- return SUCCESS;
+ return true;
- if (coarray_check (coarray, 0) == FAILURE)
- return FAILURE;
+ if (!coarray_check (coarray, 0))
+ return false;
if (dim != NULL)
{
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
- if (dim_corank_check (dim, coarray) == FAILURE)
- return FAILURE;
+ if (!dim_corank_check (dim, coarray))
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Calculate the sizes for transfer, used by gfc_check_transfer and also
- by gfc_simplify_transfer. Return FAILURE if we cannot do so. */
+ by gfc_simplify_transfer. Return false if we cannot do so. */
-gfc_try
+bool
gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size,
size_t *source_size, size_t *result_size,
size_t *result_length_p)
@@ -4433,19 +4450,19 @@ gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size,
gfc_expr *mold_element;
if (source->expr_type == EXPR_FUNCTION)
- return FAILURE;
+ return false;
if (size && size->expr_type != EXPR_CONSTANT)
- return FAILURE;
+ return false;
/* Calculate the size of the source. */
if (source->expr_type == EXPR_ARRAY
- && gfc_array_size (source, &tmp) == FAILURE)
- return FAILURE;
+ && !gfc_array_size (source, &tmp))
+ return false;
*source_size = gfc_target_expr_size (source);
if (*source_size == 0)
- return FAILURE;
+ return false;
mold_element = mold->expr_type == EXPR_ARRAY
? gfc_constructor_first (mold->value.constructor)->expr
@@ -4454,7 +4471,7 @@ gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size,
/* Determine the size of the element. */
result_elt_size = gfc_target_expr_size (mold_element);
if (result_elt_size == 0)
- return FAILURE;
+ return false;
if (mold->expr_type == EXPR_ARRAY || mold->rank || size)
{
@@ -4476,11 +4493,11 @@ gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size,
else
*result_size = result_elt_size;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
{
size_t source_size;
@@ -4490,120 +4507,120 @@ gfc_check_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
{
gfc_error ("'MOLD' argument of 'TRANSFER' intrinsic at %L must not be %s",
&mold->where, gfc_basic_typename (BT_HOLLERITH));
- return FAILURE;
+ return false;
}
if (size != NULL)
{
- if (type_check (size, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (size, 2, BT_INTEGER))
+ return false;
- if (scalar_check (size, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (size, 2))
+ return false;
- if (nonoptional_check (size, 2) == FAILURE)
- return FAILURE;
+ if (!nonoptional_check (size, 2))
+ return false;
}
if (!gfc_option.warn_surprising)
- return SUCCESS;
+ return true;
/* If we can't calculate the sizes, we cannot check any more.
- Return SUCCESS for that case. */
+ Return true for that case. */
- if (gfc_calculate_transfer_sizes (source, mold, size, &source_size,
- &result_size, NULL) == FAILURE)
- return SUCCESS;
+ if (!gfc_calculate_transfer_sizes (source, mold, size, &source_size,
+ &result_size, NULL))
+ return true;
if (source_size < result_size)
gfc_warning("Intrinsic TRANSFER at %L has partly undefined result: "
"source size %ld < result size %ld", &source->where,
(long) source_size, (long) result_size);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_transpose (gfc_expr *matrix)
{
- if (rank_check (matrix, 0, 2) == FAILURE)
- return FAILURE;
+ if (!rank_check (matrix, 0, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
- if (array_check (array, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (array, 0))
+ return false;
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
- if (dim_rank_check (dim, array, 0) == FAILURE)
- return FAILURE;
+ if (!dim_rank_check (dim, array, 0))
+ return false;
- if (kind_check (kind, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 2, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ucobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind)
{
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
{
gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
- return FAILURE;
+ return false;
}
- if (coarray_check (coarray, 0) == FAILURE)
- return FAILURE;
+ if (!coarray_check (coarray, 0))
+ return false;
if (dim != NULL)
{
- if (dim_check (dim, 1, false) == FAILURE)
- return FAILURE;
+ if (!dim_check (dim, 1, false))
+ return false;
- if (dim_corank_check (dim, coarray) == FAILURE)
- return FAILURE;
+ if (!dim_corank_check (dim, coarray))
+ return false;
}
- if (kind_check (kind, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 2, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
{
mpz_t vector_size;
- if (rank_check (vector, 0, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (vector, 0, 1))
+ return false;
- if (array_check (mask, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (mask, 1))
+ return false;
- if (type_check (mask, 1, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 1, BT_LOGICAL))
+ return false;
- if (same_type_check (vector, 0, field, 2) == FAILURE)
- return FAILURE;
+ if (!same_type_check (vector, 0, field, 2))
+ return false;
if (mask->expr_type == EXPR_ARRAY
- && gfc_array_size (vector, &vector_size) == SUCCESS)
+ && gfc_array_size (vector, &vector_size))
{
int mask_true_count = 0;
gfc_constructor *mask_ctor;
@@ -4630,7 +4647,7 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&vector->where, gfc_current_intrinsic_arg[1]->name,
mpz_get_si (vector_size), mask_true_count);
- return FAILURE;
+ return false;
}
mpz_clear (vector_size);
@@ -4642,7 +4659,7 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
"the same rank as '%s' or be a scalar",
gfc_current_intrinsic_arg[2]->name, gfc_current_intrinsic,
&field->where, gfc_current_intrinsic_arg[1]->name);
- return FAILURE;
+ return false;
}
if (mask->rank == field->rank)
@@ -4659,202 +4676,201 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
}
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_verify (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
{
- if (type_check (x, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_CHARACTER))
+ return false;
- if (same_type_check (x, 0, y, 1) == FAILURE)
- return FAILURE;
+ if (!same_type_check (x, 0, y, 1))
+ return false;
- if (z != NULL && type_check (z, 2, BT_LOGICAL) == FAILURE)
- return FAILURE;
+ if (z != NULL && !type_check (z, 2, BT_LOGICAL))
+ return false;
- if (kind_check (kind, 3, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
- "with KIND argument at %L",
- gfc_current_intrinsic, &kind->where) == FAILURE)
- return FAILURE;
+ if (!kind_check (kind, 3, BT_INTEGER))
+ return false;
+ if (kind && !gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_trim (gfc_expr *x)
{
- if (type_check (x, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_CHARACTER))
+ return false;
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (x, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ttynam (gfc_expr *unit)
{
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
/* Common check function for the half a dozen intrinsics that have a
single real argument. */
-gfc_try
+bool
gfc_check_x (gfc_expr *x)
{
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
- return SUCCESS;
+ return true;
}
/************* Check functions for intrinsic subroutines *************/
-gfc_try
+bool
gfc_check_cpu_time (gfc_expr *time)
{
- if (scalar_check (time, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (time, 0))
+ return false;
- if (type_check (time, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (time, 0, BT_REAL))
+ return false;
- if (variable_check (time, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (time, 0, false))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_date_and_time (gfc_expr *date, gfc_expr *time,
gfc_expr *zone, gfc_expr *values)
{
if (date != NULL)
{
- if (type_check (date, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (date, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
- if (scalar_check (date, 0) == FAILURE)
- return FAILURE;
- if (variable_check (date, 0, false) == FAILURE)
- return FAILURE;
+ if (!type_check (date, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (date, 0, gfc_default_character_kind))
+ return false;
+ if (!scalar_check (date, 0))
+ return false;
+ if (!variable_check (date, 0, false))
+ return false;
}
if (time != NULL)
{
- if (type_check (time, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (time, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
- if (scalar_check (time, 1) == FAILURE)
- return FAILURE;
- if (variable_check (time, 1, false) == FAILURE)
- return FAILURE;
+ if (!type_check (time, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (time, 1, gfc_default_character_kind))
+ return false;
+ if (!scalar_check (time, 1))
+ return false;
+ if (!variable_check (time, 1, false))
+ return false;
}
if (zone != NULL)
{
- if (type_check (zone, 2, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (zone, 2, gfc_default_character_kind) == FAILURE)
- return FAILURE;
- if (scalar_check (zone, 2) == FAILURE)
- return FAILURE;
- if (variable_check (zone, 2, false) == FAILURE)
- return FAILURE;
+ if (!type_check (zone, 2, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (zone, 2, gfc_default_character_kind))
+ return false;
+ if (!scalar_check (zone, 2))
+ return false;
+ if (!variable_check (zone, 2, false))
+ return false;
}
if (values != NULL)
{
- if (type_check (values, 3, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (array_check (values, 3) == FAILURE)
- return FAILURE;
- if (rank_check (values, 3, 1) == FAILURE)
- return FAILURE;
- if (variable_check (values, 3, false) == FAILURE)
- return FAILURE;
+ if (!type_check (values, 3, BT_INTEGER))
+ return false;
+ if (!array_check (values, 3))
+ return false;
+ if (!rank_check (values, 3, 1))
+ return false;
+ if (!variable_check (values, 3, false))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_mvbits (gfc_expr *from, gfc_expr *frompos, gfc_expr *len,
gfc_expr *to, gfc_expr *topos)
{
- if (type_check (from, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (from, 0, BT_INTEGER))
+ return false;
- if (type_check (frompos, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (frompos, 1, BT_INTEGER))
+ return false;
- if (type_check (len, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (len, 2, BT_INTEGER))
+ return false;
- if (same_type_check (from, 0, to, 3) == FAILURE)
- return FAILURE;
+ if (!same_type_check (from, 0, to, 3))
+ return false;
- if (variable_check (to, 3, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (to, 3, false))
+ return false;
- if (type_check (topos, 4, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (topos, 4, BT_INTEGER))
+ return false;
- if (nonnegative_check ("frompos", frompos) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("frompos", frompos))
+ return false;
- if (nonnegative_check ("topos", topos) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("topos", topos))
+ return false;
- if (nonnegative_check ("len", len) == FAILURE)
- return FAILURE;
+ if (!nonnegative_check ("len", len))
+ return false;
- if (less_than_bitsize2 ("from", from, "frompos", frompos, "len", len)
- == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize2 ("from", from, "frompos", frompos, "len", len))
+ return false;
- if (less_than_bitsize2 ("to", to, "topos", topos, "len", len) == FAILURE)
- return FAILURE;
+ if (!less_than_bitsize2 ("to", to, "topos", topos, "len", len))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_random_number (gfc_expr *harvest)
{
- if (type_check (harvest, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (harvest, 0, BT_REAL))
+ return false;
- if (variable_check (harvest, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (harvest, 0, false))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
{
unsigned int nargs = 0, kiss_size;
@@ -4874,17 +4890,17 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
|| !size->symtree->n.sym->attr.optional)
nargs++;
- if (scalar_check (size, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (size, 0))
+ return false;
- if (type_check (size, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (size, 0, BT_INTEGER))
+ return false;
- if (variable_check (size, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (size, 0, false))
+ return false;
- if (kind_value_check (size, 0, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (size, 0, gfc_default_integer_kind))
+ return false;
}
if (put != NULL)
@@ -4896,19 +4912,19 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
where = &put->where;
}
- if (array_check (put, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (put, 1))
+ return false;
- if (rank_check (put, 1, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (put, 1, 1))
+ return false;
- if (type_check (put, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (put, 1, BT_INTEGER))
+ return false;
- if (kind_value_check (put, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (put, 1, gfc_default_integer_kind))
+ return false;
- if (gfc_array_size (put, &put_size) == SUCCESS
+ if (gfc_array_size (put, &put_size)
&& mpz_get_ui (put_size) < kiss_size)
gfc_error ("Size of '%s' argument of '%s' intrinsic at %L "
"too small (%i/%i)",
@@ -4925,22 +4941,22 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
where = &get->where;
}
- if (array_check (get, 2) == FAILURE)
- return FAILURE;
+ if (!array_check (get, 2))
+ return false;
- if (rank_check (get, 2, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (get, 2, 1))
+ return false;
- if (type_check (get, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (get, 2, BT_INTEGER))
+ return false;
- if (variable_check (get, 2, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (get, 2, false))
+ return false;
- if (kind_value_check (get, 2, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (get, 2, gfc_default_integer_kind))
+ return false;
- if (gfc_array_size (get, &get_size) == SUCCESS
+ if (gfc_array_size (get, &get_size)
&& mpz_get_ui (get_size) < kiss_size)
gfc_error ("Size of '%s' argument of '%s' intrinsic at %L "
"too small (%i/%i)",
@@ -4952,287 +4968,287 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
if (nargs > 1)
gfc_error ("Too many arguments to %s at %L", gfc_current_intrinsic, where);
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_second_sub (gfc_expr *time)
{
- if (scalar_check (time, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (time, 0))
+ return false;
- if (type_check (time, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (time, 0, BT_REAL))
+ return false;
- if (kind_value_check(time, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (time, 0, 4))
+ return false;
- return SUCCESS;
+ return true;
}
/* The arguments of SYSTEM_CLOCK are scalar, integer variables. Note,
count, count_rate, and count_max are all optional arguments */
-gfc_try
+bool
gfc_check_system_clock (gfc_expr *count, gfc_expr *count_rate,
gfc_expr *count_max)
{
if (count != NULL)
{
- if (scalar_check (count, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (count, 0))
+ return false;
- if (type_check (count, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (count, 0, BT_INTEGER))
+ return false;
- if (variable_check (count, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (count, 0, false))
+ return false;
}
if (count_rate != NULL)
{
- if (scalar_check (count_rate, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (count_rate, 1))
+ return false;
- if (type_check (count_rate, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (count_rate, 1, BT_INTEGER))
+ return false;
- if (variable_check (count_rate, 1, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (count_rate, 1, false))
+ return false;
if (count != NULL
- && same_type_check (count, 0, count_rate, 1) == FAILURE)
- return FAILURE;
+ && !same_type_check (count, 0, count_rate, 1))
+ return false;
}
if (count_max != NULL)
{
- if (scalar_check (count_max, 2) == FAILURE)
- return FAILURE;
+ if (!scalar_check (count_max, 2))
+ return false;
- if (type_check (count_max, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (count_max, 2, BT_INTEGER))
+ return false;
- if (variable_check (count_max, 2, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (count_max, 2, false))
+ return false;
if (count != NULL
- && same_type_check (count, 0, count_max, 2) == FAILURE)
- return FAILURE;
+ && !same_type_check (count, 0, count_max, 2))
+ return false;
if (count_rate != NULL
- && same_type_check (count_rate, 1, count_max, 2) == FAILURE)
- return FAILURE;
+ && !same_type_check (count_rate, 1, count_max, 2))
+ return false;
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_irand (gfc_expr *x)
{
if (x == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (x, 0))
+ return false;
- if (type_check (x, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_INTEGER))
+ return false;
- if (kind_value_check(x, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (x, 0, 4))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_alarm_sub (gfc_expr *seconds, gfc_expr *handler, gfc_expr *status)
{
- if (scalar_check (seconds, 0) == FAILURE)
- return FAILURE;
- if (type_check (seconds, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!scalar_check (seconds, 0))
+ return false;
+ if (!type_check (seconds, 0, BT_INTEGER))
+ return false;
- if (int_or_proc_check (handler, 1) == FAILURE)
- return FAILURE;
- if (handler->ts.type == BT_INTEGER && scalar_check (handler, 1) == FAILURE)
- return FAILURE;
+ if (!int_or_proc_check (handler, 1))
+ return false;
+ if (handler->ts.type == BT_INTEGER && !scalar_check (handler, 1))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (kind_value_check (status, 2, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 2))
+ return false;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
+ if (!kind_value_check (status, 2, gfc_default_integer_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_rand (gfc_expr *x)
{
if (x == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (x, 0))
+ return false;
- if (type_check (x, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_INTEGER))
+ return false;
- if (kind_value_check(x, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (x, 0, 4))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_srand (gfc_expr *x)
{
- if (scalar_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (x, 0))
+ return false;
- if (type_check (x, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_INTEGER))
+ return false;
- if (kind_value_check(x, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (x, 0, 4))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ctime_sub (gfc_expr *time, gfc_expr *result)
{
- if (scalar_check (time, 0) == FAILURE)
- return FAILURE;
- if (type_check (time, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!scalar_check (time, 0))
+ return false;
+ if (!type_check (time, 0, BT_INTEGER))
+ return false;
- if (type_check (result, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (result, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (result, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (result, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dtime_etime (gfc_expr *x)
{
- if (array_check (x, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (x, 0))
+ return false;
- if (rank_check (x, 0, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (x, 0, 1))
+ return false;
- if (variable_check (x, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (x, 0, false))
+ return false;
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
- if (kind_value_check(x, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (x, 0, 4))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_dtime_etime_sub (gfc_expr *values, gfc_expr *time)
{
- if (array_check (values, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (values, 0))
+ return false;
- if (rank_check (values, 0, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (values, 0, 1))
+ return false;
- if (variable_check (values, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (values, 0, false))
+ return false;
- if (type_check (values, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (values, 0, BT_REAL))
+ return false;
- if (kind_value_check(values, 0, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (values, 0, 4))
+ return false;
- if (scalar_check (time, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (time, 1))
+ return false;
- if (type_check (time, 1, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (time, 1, BT_REAL))
+ return false;
- if (kind_value_check(time, 1, 4) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (time, 1, 4))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_fdate_sub (gfc_expr *date)
{
- if (type_check (date, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (date, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (date, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (date, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_gerror (gfc_expr *msg)
{
- if (type_check (msg, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (msg, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (msg, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (msg, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_getcwd_sub (gfc_expr *cwd, gfc_expr *status)
{
- if (type_check (cwd, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (cwd, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (cwd, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (cwd, 0, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (status, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 1))
+ return false;
- if (type_check (status, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_getarg (gfc_expr *pos, gfc_expr *value)
{
- if (type_check (pos, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (pos, 0, BT_INTEGER))
+ return false;
if (pos->ts.kind > gfc_default_integer_kind)
{
@@ -5240,350 +5256,350 @@ gfc_check_getarg (gfc_expr *pos, gfc_expr *value)
"not wider than the default kind (%d)",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&pos->where, gfc_default_integer_kind);
- return FAILURE;
+ return false;
}
- if (type_check (value, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (value, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (value, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (value, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_getlog (gfc_expr *msg)
{
- if (type_check (msg, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (msg, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (msg, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (msg, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_exit (gfc_expr *status)
{
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 0, BT_INTEGER))
+ return false;
- if (scalar_check (status, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_flush (gfc_expr *unit)
{
if (unit == NULL)
- return SUCCESS;
+ return true;
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_free (gfc_expr *i)
{
- if (type_check (i, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (i, 0, BT_INTEGER))
+ return false;
- if (scalar_check (i, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (i, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_hostnm (gfc_expr *name)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_hostnm_sub (gfc_expr *name, gfc_expr *status)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (status, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 1))
+ return false;
- if (type_check (status, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_itime_idate (gfc_expr *values)
{
- if (array_check (values, 0) == FAILURE)
- return FAILURE;
+ if (!array_check (values, 0))
+ return false;
- if (rank_check (values, 0, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (values, 0, 1))
+ return false;
- if (variable_check (values, 0, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (values, 0, false))
+ return false;
- if (type_check (values, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (values, 0, BT_INTEGER))
+ return false;
- if (kind_value_check(values, 0, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (values, 0, gfc_default_integer_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ltime_gmtime (gfc_expr *time, gfc_expr *values)
{
- if (type_check (time, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (time, 0, BT_INTEGER))
+ return false;
- if (kind_value_check(time, 0, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (time, 0, gfc_default_integer_kind))
+ return false;
- if (scalar_check (time, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (time, 0))
+ return false;
- if (array_check (values, 1) == FAILURE)
- return FAILURE;
+ if (!array_check (values, 1))
+ return false;
- if (rank_check (values, 1, 1) == FAILURE)
- return FAILURE;
+ if (!rank_check (values, 1, 1))
+ return false;
- if (variable_check (values, 1, false) == FAILURE)
- return FAILURE;
+ if (!variable_check (values, 1, false))
+ return false;
- if (type_check (values, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (values, 1, BT_INTEGER))
+ return false;
- if (kind_value_check(values, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (values, 1, gfc_default_integer_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_ttynam_sub (gfc_expr *unit, gfc_expr *name)
{
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (type_check (name, 1, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 1, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 1, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 1, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_isatty (gfc_expr *unit)
{
if (unit == NULL)
- return FAILURE;
+ return false;
- if (type_check (unit, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (unit, 0, BT_INTEGER))
+ return false;
- if (scalar_check (unit, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (unit, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_isnan (gfc_expr *x)
{
- if (type_check (x, 0, BT_REAL) == FAILURE)
- return FAILURE;
+ if (!type_check (x, 0, BT_REAL))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_perror (gfc_expr *string)
{
- if (type_check (string, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (string, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (string, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (string, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_umask (gfc_expr *mask)
{
- if (type_check (mask, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 0, BT_INTEGER))
+ return false;
- if (scalar_check (mask, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (mask, 0))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_umask_sub (gfc_expr *mask, gfc_expr *old)
{
- if (type_check (mask, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (mask, 0, BT_INTEGER))
+ return false;
- if (scalar_check (mask, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (mask, 0))
+ return false;
if (old == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (old, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (old, 1))
+ return false;
- if (type_check (old, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (old, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_unlink (gfc_expr *name)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_unlink_sub (gfc_expr *name, gfc_expr *status)
{
- if (type_check (name, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (name, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (name, 0, gfc_default_character_kind))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (scalar_check (status, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 1))
+ return false;
- if (type_check (status, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 1, BT_INTEGER))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_signal (gfc_expr *number, gfc_expr *handler)
{
- if (scalar_check (number, 0) == FAILURE)
- return FAILURE;
- if (type_check (number, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!scalar_check (number, 0))
+ return false;
+ if (!type_check (number, 0, BT_INTEGER))
+ return false;
- if (int_or_proc_check (handler, 1) == FAILURE)
- return FAILURE;
- if (handler->ts.type == BT_INTEGER && scalar_check (handler, 1) == FAILURE)
- return FAILURE;
+ if (!int_or_proc_check (handler, 1))
+ return false;
+ if (handler->ts.type == BT_INTEGER && !scalar_check (handler, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_signal_sub (gfc_expr *number, gfc_expr *handler, gfc_expr *status)
{
- if (scalar_check (number, 0) == FAILURE)
- return FAILURE;
- if (type_check (number, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!scalar_check (number, 0))
+ return false;
+ if (!type_check (number, 0, BT_INTEGER))
+ return false;
- if (int_or_proc_check (handler, 1) == FAILURE)
- return FAILURE;
- if (handler->ts.type == BT_INTEGER && scalar_check (handler, 1) == FAILURE)
- return FAILURE;
+ if (!int_or_proc_check (handler, 1))
+ return false;
+ if (handler->ts.type == BT_INTEGER && !scalar_check (handler, 1))
+ return false;
if (status == NULL)
- return SUCCESS;
+ return true;
- if (type_check (status, 2, BT_INTEGER) == FAILURE)
- return FAILURE;
- if (scalar_check (status, 2) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 2, BT_INTEGER))
+ return false;
+ if (!scalar_check (status, 2))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_system_sub (gfc_expr *cmd, gfc_expr *status)
{
- if (type_check (cmd, 0, BT_CHARACTER) == FAILURE)
- return FAILURE;
- if (kind_value_check (cmd, 0, gfc_default_character_kind) == FAILURE)
- return FAILURE;
+ if (!type_check (cmd, 0, BT_CHARACTER))
+ return false;
+ if (!kind_value_check (cmd, 0, gfc_default_character_kind))
+ return false;
- if (scalar_check (status, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (status, 1))
+ return false;
- if (type_check (status, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (status, 1, BT_INTEGER))
+ return false;
- if (kind_value_check (status, 1, gfc_default_integer_kind) == FAILURE)
- return FAILURE;
+ if (!kind_value_check (status, 1, gfc_default_integer_kind))
+ return false;
- return SUCCESS;
+ return true;
}
/* This is used for the GNU intrinsics AND, OR and XOR. */
-gfc_try
+bool
gfc_check_and (gfc_expr *i, gfc_expr *j)
{
if (i->ts.type != BT_INTEGER && i->ts.type != BT_LOGICAL)
@@ -5591,7 +5607,7 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be INTEGER "
"or LOGICAL", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &i->where);
- return FAILURE;
+ return false;
}
if (j->ts.type != BT_INTEGER && j->ts.type != BT_LOGICAL)
@@ -5599,7 +5615,7 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
gfc_error ("'%s' argument of '%s' intrinsic at %L must be INTEGER "
"or LOGICAL", gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic, &j->where);
- return FAILURE;
+ return false;
}
if (i->ts.type != j->ts.type)
@@ -5608,20 +5624,20 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
"have the same type", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&j->where);
- return FAILURE;
+ return false;
}
- if (scalar_check (i, 0) == FAILURE)
- return FAILURE;
+ if (!scalar_check (i, 0))
+ return false;
- if (scalar_check (j, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (j, 1))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
{
if (a->ts.type == BT_ASSUMED)
@@ -5629,7 +5645,7 @@ gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be TYPE(*)",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&a->where);
- return FAILURE;
+ return false;
}
if (a->ts.type == BT_PROCEDURE)
@@ -5637,25 +5653,25 @@ gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
gfc_error ("'%s' argument of '%s' intrinsic at %L shall not be a "
"procedure", gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic, &a->where);
- return FAILURE;
+ return false;
}
if (kind == NULL)
- return SUCCESS;
+ return true;
- if (type_check (kind, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (!type_check (kind, 1, BT_INTEGER))
+ return false;
- if (scalar_check (kind, 1) == FAILURE)
- return FAILURE;
+ if (!scalar_check (kind, 1))
+ return false;
if (kind->expr_type != EXPR_CONSTANT)
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be a constant",
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
&kind->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 42c7fa6a5db..349f494f62a 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -543,7 +543,7 @@ gfc_intrinsic_hash_value (gfc_typespec *ts)
which contains the declared type as '_data' component, plus a pointer
component '_vptr' which determines the dynamic type. */
-gfc_try
+bool
gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
gfc_array_spec **as, bool delayed_vtab)
{
@@ -560,19 +560,19 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
{
gfc_error ("Assumed size polymorphic objects or components, such "
"as that at %C, have not yet been implemented");
- return FAILURE;
+ return false;
}
if (attr->class_ok)
/* Class container has already been built. */
- return SUCCESS;
+ return true;
attr->class_ok = attr->dummy || attr->pointer || attr->allocatable
|| attr->select_type_temporary || attr->associate_var;
if (!attr->class_ok)
/* We can not build the class container yet. */
- return SUCCESS;
+ return true;
/* Determine the name of the encapsulating type. */
rank = !(*as) || (*as)->rank == -1 ? GFC_MAX_DIMENSIONS : (*as)->rank;
@@ -614,13 +614,13 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
if (!ts->u.derived->attr.unlimited_polymorphic)
fclass->attr.abstract = ts->u.derived->attr.abstract;
fclass->f2k_derived = gfc_get_namespace (NULL, 0);
- if (gfc_add_flavor (&fclass->attr, FL_DERIVED,
- NULL, &gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_add_flavor (&fclass->attr, FL_DERIVED, NULL,
+ &gfc_current_locus))
+ return false;
/* Add component '_data'. */
- if (gfc_add_component (fclass, "_data", &c) == FAILURE)
- return FAILURE;
+ if (!gfc_add_component (fclass, "_data", &c))
+ return false;
c->ts = *ts;
c->ts.type = BT_DERIVED;
c->attr.access = ACCESS_PRIVATE;
@@ -636,8 +636,8 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
c->initializer = NULL;
/* Add component '_vptr'. */
- if (gfc_add_component (fclass, "_vptr", &c) == FAILURE)
- return FAILURE;
+ if (!gfc_add_component (fclass, "_vptr", &c))
+ return false;
c->ts.type = BT_DERIVED;
if (delayed_vtab
|| (ts->u.derived->f2k_derived
@@ -661,7 +661,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
{
gfc_error ("Maximum extension level reached with type '%s' at %L",
ts->u.derived->name, &ts->u.derived->declared_at);
- return FAILURE;
+ return false;
}
fclass->attr.extension = ts->u.derived->attr.extension + 1;
@@ -672,7 +672,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
ts->u.derived = fclass;
attr->allocatable = attr->pointer = attr->dimension = attr->codimension = 0;
(*as) = NULL;
- return SUCCESS;
+ return true;
}
@@ -692,7 +692,7 @@ add_proc_comp (gfc_symbol *vtype, const char *name, gfc_typebound_proc *tb)
if (c == NULL)
{
/* Add procedure component. */
- if (gfc_add_component (vtype, name, &c) == FAILURE)
+ if (!gfc_add_component (vtype, name, &c))
return;
if (!c->tb)
@@ -1724,7 +1724,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
DO idx = 1, rank
strides(idx) = _F._stride (array, dim=idx)
sizes(idx) = sizes(i-1) * size(array, dim=idx, kind=index_kind)
- if (strides(idx) /= sizes(i-1)) is_contiguous = .false.
+ if (strides (idx) /= sizes(i-1)) is_contiguous = .false.
END DO. */
/* Create loop. */
@@ -1811,7 +1811,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
block->expr2->value.op.op2->ts.kind = gfc_index_integer_kind;
block->expr2->ts = idx->ts;
- /* if (strides(idx) /= sizes(idx-1)) is_contiguous = .false. */
+ /* if (strides (idx) /= sizes(idx-1)) is_contiguous = .false. */
block->next = XCNEW (gfc_code);
block = block->next;
block->loc = gfc_current_locus;
@@ -2202,8 +2202,8 @@ gfc_find_derived_vtab (gfc_symbol *derived)
{
gfc_get_symbol (name, ns, &vtab);
vtab->ts.type = BT_DERIVED;
- if (gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL,
- &gfc_current_locus) == FAILURE)
+ if (!gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL,
+ &gfc_current_locus))
goto cleanup;
vtab->attr.target = 1;
vtab->attr.save = SAVE_IMPLICIT;
@@ -2219,15 +2219,15 @@ gfc_find_derived_vtab (gfc_symbol *derived)
gfc_symbol *parent = NULL, *parent_vtab = NULL;
gfc_get_symbol (name, ns, &vtype);
- if (gfc_add_flavor (&vtype->attr, FL_DERIVED,
- NULL, &gfc_current_locus) == FAILURE)
+ if (!gfc_add_flavor (&vtype->attr, FL_DERIVED, NULL,
+ &gfc_current_locus))
goto cleanup;
vtype->attr.access = ACCESS_PUBLIC;
vtype->attr.vtype = 1;
gfc_set_sym_referenced (vtype);
/* Add component '_hash'. */
- if (gfc_add_component (vtype, "_hash", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_hash", &c))
goto cleanup;
c->ts.type = BT_INTEGER;
c->ts.kind = 4;
@@ -2236,7 +2236,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
NULL, derived->hash_value);
/* Add component '_size'. */
- if (gfc_add_component (vtype, "_size", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_size", &c))
goto cleanup;
c->ts.type = BT_INTEGER;
c->ts.kind = 4;
@@ -2249,7 +2249,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
NULL, 0);
/* Add component _extends. */
- if (gfc_add_component (vtype, "_extends", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_extends", &c))
goto cleanup;
c->attr.pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2286,7 +2286,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
}
/* Add component _def_init. */
- if (gfc_add_component (vtype, "_def_init", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_def_init", &c))
goto cleanup;
c->attr.pointer = 1;
c->attr.artificial = 1;
@@ -2315,7 +2315,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
}
/* Add component _copy. */
- if (gfc_add_component (vtype, "_copy", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_copy", &c))
goto cleanup;
c->attr.proc_pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2385,7 +2385,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
/* FIXME: Enable ABI-breaking "_final" generation. */
if (0)
{
- if (gfc_add_component (vtype, "_final", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_final", &c))
goto cleanup;
c->attr.proc_pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2480,7 +2480,7 @@ gfc_symbol *
gfc_find_intrinsic_vtab (gfc_typespec *ts)
{
gfc_namespace *ns;
- gfc_symbol *vtab = NULL, *vtype = NULL, *found_sym = NULL, *def_init = NULL;
+ gfc_symbol *vtab = NULL, *vtype = NULL, *found_sym = NULL;
gfc_symbol *copy = NULL, *src = NULL, *dst = NULL;
int charlen = 0;
@@ -2528,8 +2528,8 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
{
gfc_get_symbol (name, ns, &vtab);
vtab->ts.type = BT_DERIVED;
- if (gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL,
- &gfc_current_locus) == FAILURE)
+ if (!gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL,
+ &gfc_current_locus))
goto cleanup;
vtab->attr.target = 1;
vtab->attr.save = SAVE_IMPLICIT;
@@ -2547,15 +2547,15 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
gfc_namespace *contained;
gfc_get_symbol (name, ns, &vtype);
- if (gfc_add_flavor (&vtype->attr, FL_DERIVED,
- NULL, &gfc_current_locus) == FAILURE)
+ if (!gfc_add_flavor (&vtype->attr, FL_DERIVED, NULL,
+ &gfc_current_locus))
goto cleanup;
vtype->attr.access = ACCESS_PUBLIC;
vtype->attr.vtype = 1;
gfc_set_sym_referenced (vtype);
/* Add component '_hash'. */
- if (gfc_add_component (vtype, "_hash", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_hash", &c))
goto cleanup;
c->ts.type = BT_INTEGER;
c->ts.kind = 4;
@@ -2565,7 +2565,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
NULL, hash);
/* Add component '_size'. */
- if (gfc_add_component (vtype, "_size", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_size", &c))
goto cleanup;
c->ts.type = BT_INTEGER;
c->ts.kind = 4;
@@ -2578,7 +2578,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
NULL, ts->kind);
/* Add component _extends. */
- if (gfc_add_component (vtype, "_extends", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_extends", &c))
goto cleanup;
c->attr.pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2586,7 +2586,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
c->initializer = gfc_get_null_expr (NULL);
/* Add component _def_init. */
- if (gfc_add_component (vtype, "_def_init", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_def_init", &c))
goto cleanup;
c->attr.pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2594,7 +2594,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
c->initializer = gfc_get_null_expr (NULL);
/* Add component _copy. */
- if (gfc_add_component (vtype, "_copy", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_copy", &c))
goto cleanup;
c->attr.proc_pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2666,7 +2666,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
c->ts.interface = copy;
/* Add component _final. */
- if (gfc_add_component (vtype, "_final", &c) == FAILURE)
+ if (!gfc_add_component (vtype, "_final", &c))
goto cleanup;
c->attr.proc_pointer = 1;
c->attr.access = ACCESS_PRIVATE;
@@ -2689,8 +2689,6 @@ cleanup:
gfc_commit_symbol (vtab);
if (vtype)
gfc_commit_symbol (vtype);
- if (def_init)
- gfc_commit_symbol (def_init);
if (copy)
gfc_commit_symbol (copy);
if (src)
@@ -2709,7 +2707,7 @@ cleanup:
type-bound user operator. */
static gfc_symtree*
-find_typebound_proc_uop (gfc_symbol* derived, gfc_try* t,
+find_typebound_proc_uop (gfc_symbol* derived, bool* t,
const char* name, bool noaccess, bool uop,
locus* where)
{
@@ -2718,7 +2716,7 @@ find_typebound_proc_uop (gfc_symbol* derived, gfc_try* t,
/* Set default to failure. */
if (t)
- *t = FAILURE;
+ *t = false;
if (derived->f2k_derived)
/* Set correct symbol-root. */
@@ -2733,7 +2731,7 @@ find_typebound_proc_uop (gfc_symbol* derived, gfc_try* t,
{
/* We found one. */
if (t)
- *t = SUCCESS;
+ *t = true;
if (!noaccess && derived->attr.use_assoc
&& res->n.tb->access == ACCESS_PRIVATE)
@@ -2742,7 +2740,7 @@ find_typebound_proc_uop (gfc_symbol* derived, gfc_try* t,
gfc_error ("'%s' of '%s' is PRIVATE at %L",
name, derived->name, where);
if (t)
- *t = FAILURE;
+ *t = false;
}
return res;
@@ -2768,14 +2766,14 @@ find_typebound_proc_uop (gfc_symbol* derived, gfc_try* t,
(looking recursively through the super-types). */
gfc_symtree*
-gfc_find_typebound_proc (gfc_symbol* derived, gfc_try* t,
+gfc_find_typebound_proc (gfc_symbol* derived, bool* t,
const char* name, bool noaccess, locus* where)
{
return find_typebound_proc_uop (derived, t, name, noaccess, false, where);
}
gfc_symtree*
-gfc_find_typebound_user_op (gfc_symbol* derived, gfc_try* t,
+gfc_find_typebound_user_op (gfc_symbol* derived, bool* t,
const char* name, bool noaccess, locus* where)
{
return find_typebound_proc_uop (derived, t, name, noaccess, true, where);
@@ -2786,7 +2784,7 @@ gfc_find_typebound_user_op (gfc_symbol* derived, gfc_try* t,
super-type hierarchy. */
gfc_typebound_proc*
-gfc_find_typebound_intrinsic_op (gfc_symbol* derived, gfc_try* t,
+gfc_find_typebound_intrinsic_op (gfc_symbol* derived, bool* t,
gfc_intrinsic_op op, bool noaccess,
locus* where)
{
@@ -2794,7 +2792,7 @@ gfc_find_typebound_intrinsic_op (gfc_symbol* derived, gfc_try* t,
/* Set default to failure. */
if (t)
- *t = FAILURE;
+ *t = false;
/* Try to find it in the current type's namespace. */
if (derived->f2k_derived)
@@ -2807,7 +2805,7 @@ gfc_find_typebound_intrinsic_op (gfc_symbol* derived, gfc_try* t,
{
/* We found one. */
if (t)
- *t = SUCCESS;
+ *t = true;
if (!noaccess && derived->attr.use_assoc
&& res->access == ACCESS_PRIVATE)
@@ -2816,7 +2814,7 @@ gfc_find_typebound_intrinsic_op (gfc_symbol* derived, gfc_try* t,
gfc_error ("'%s' of '%s' is PRIVATE at %L",
gfc_op2string (op), derived->name, where);
if (t)
- *t = FAILURE;
+ *t = false;
}
return res;
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index 0a176b2ad27..ea53681af0c 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -609,11 +609,11 @@ gfc_cpp_init (void)
pp_dir_change (cpp_in, get_src_pwd ());
}
-gfc_try
+bool
gfc_cpp_preprocess (const char *source_file)
{
if (!gfc_cpp_enabled ())
- return FAILURE;
+ return false;
cpp_change_file (cpp_in, LC_RENAME, source_file);
@@ -636,7 +636,7 @@ gfc_cpp_preprocess (const char *source_file)
|| (gfc_cpp_preprocess_only () && gfc_cpp_option.output_filename))
fclose (print.outf);
- return SUCCESS;
+ return true;
}
void
diff --git a/gcc/fortran/cpp.h b/gcc/fortran/cpp.h
index fc5c2826b02..04e13bef93b 100644
--- a/gcc/fortran/cpp.h
+++ b/gcc/fortran/cpp.h
@@ -43,7 +43,7 @@ int gfc_cpp_handle_option(size_t scode, const char *arg, int value);
void gfc_cpp_post_options (void);
-gfc_try gfc_cpp_preprocess (const char *source_file);
+bool gfc_cpp_preprocess (const char *source_file);
void gfc_cpp_done (void);
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index 6aaa3157e32..f297ef56faf 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -129,8 +129,8 @@ create_character_initializer (gfc_expr *init, gfc_typespec *ts,
start_expr = gfc_copy_expr (ref->u.ss.start);
end_expr = gfc_copy_expr (ref->u.ss.end);
- if ((gfc_simplify_expr (start_expr, 1) == FAILURE)
- || (gfc_simplify_expr (end_expr, 1)) == FAILURE)
+ if ((!gfc_simplify_expr(start_expr, 1))
+ || !(gfc_simplify_expr(end_expr, 1)))
{
gfc_error ("failure to simplify substring reference in DATA "
"statement at %L", &ref->u.ss.start->where);
@@ -196,7 +196,7 @@ create_character_initializer (gfc_expr *init, gfc_typespec *ts,
consecutive values in LVALUE the same value in RVALUE. In that case,
LVALUE must refer to a full array, not an array section. */
-gfc_try
+bool
gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
mpz_t *repeat)
{
@@ -283,7 +283,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
&& ref->next == NULL);
mpz_init_set (end, offset);
mpz_add (end, end, *repeat);
- if (spec_size (ref->u.ar.as, &size) == SUCCESS)
+ if (spec_size (ref->u.ar.as, &size))
{
if (mpz_cmp (end, size) > 0)
{
@@ -319,8 +319,8 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
? con->expr : rvalue;
if (gfc_notify_std (GFC_STD_GNU,
"re-initialization of '%s' at %L",
- symbol->name, &exprd->where) == FAILURE)
- return FAILURE;
+ symbol->name, &exprd->where) == false)
+ return false;
}
while (con != NULL)
@@ -372,7 +372,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
else
{
mpz_t size;
- if (spec_size (ref->u.ar.as, &size) == SUCCESS)
+ if (spec_size (ref->u.ar.as, &size))
{
if (mpz_cmp (offset, size) >= 0)
{
@@ -468,7 +468,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
if (ref || last_ts->type == BT_CHARACTER)
{
if (lvalue->ts.u.cl->length == NULL && !(ref && ref->u.ss.length != NULL))
- return FAILURE;
+ return false;
expr = create_character_initializer (init, last_ts, ref, rvalue);
}
else
@@ -485,8 +485,8 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
? init : rvalue;
if (gfc_notify_std (GFC_STD_GNU,
"re-initialization of '%s' at %L",
- symbol->name, &expr->where) == FAILURE)
- return FAILURE;
+ symbol->name, &expr->where) == false)
+ return false;
}
expr = gfc_copy_expr (rvalue);
@@ -499,13 +499,13 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
else
last_con->expr = expr;
- return SUCCESS;
+ return true;
abort:
if (!init)
gfc_free_expr (expr);
mpz_clear (offset);
- return FAILURE;
+ return false;
}
diff --git a/gcc/fortran/data.h b/gcc/fortran/data.h
index 8332a3b55d6..04114dc8817 100644
--- a/gcc/fortran/data.h
+++ b/gcc/fortran/data.h
@@ -19,5 +19,5 @@ along with GCC; see the file COPYING3. If not see
void gfc_formalize_init_value (gfc_symbol *);
void gfc_get_section_index (gfc_array_ref *, mpz_t *, mpz_t *);
-gfc_try gfc_assign_data_value (gfc_expr *, gfc_expr *, mpz_t, mpz_t *);
+bool gfc_assign_data_value (gfc_expr *, gfc_expr *, mpz_t, mpz_t *);
void gfc_advance_section (mpz_t *, gfc_array_ref *, mpz_t *);
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 72c511c8b24..ffaa65d6a5a 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
#define gfc_get_data() XCNEW (gfc_data)
-static gfc_try set_binding_label (const char **, const char *, int);
+static bool set_binding_label (const char **, const char *, int);
/* This flag is set if an old-style length selector is matched
@@ -254,8 +254,7 @@ var_element (gfc_data_variable *new_var)
sym = new_var->expr->symtree->n.sym;
/* Symbol should already have an associated type. */
- if (gfc_check_symbol_typed (sym, gfc_current_ns,
- false, gfc_current_locus) == FAILURE)
+ if (!gfc_check_symbol_typed (sym, gfc_current_ns, false, gfc_current_locus))
return MATCH_ERROR;
if (!sym->attr.function && gfc_current_ns->parent
@@ -268,12 +267,12 @@ var_element (gfc_data_variable *new_var)
if (gfc_current_state () != COMP_BLOCK_DATA
&& sym->attr.in_common
- && gfc_notify_std (GFC_STD_GNU, "initialization of "
- "common block variable '%s' in DATA statement at %C",
- sym->name) == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, "initialization of "
+ "common block variable '%s' in DATA statement at %C",
+ sym->name))
return MATCH_ERROR;
- if (gfc_add_data (&sym->attr, sym->name, &new_var->expr->where) == FAILURE)
+ if (!gfc_add_data (&sym->attr, sym->name, &new_var->expr->where))
return MATCH_ERROR;
return MATCH_YES;
@@ -356,7 +355,7 @@ match_data_constant (gfc_expr **result)
if (m == MATCH_YES && (*result)->expr_type == EXPR_STRUCTURE)
{
- if (gfc_simplify_expr (*result, 0) == FAILURE)
+ if (!gfc_simplify_expr (*result, 0))
m = MATCH_ERROR;
return m;
}
@@ -397,7 +396,7 @@ match_data_constant (gfc_expr **result)
if (m == MATCH_YES)
{
- if (gfc_simplify_expr (*result, 0) == FAILURE)
+ if (!gfc_simplify_expr (*result, 0))
m = MATCH_ERROR;
if ((*result)->expr_type == EXPR_CONSTANT)
@@ -515,7 +514,7 @@ match_old_style_init (const char *name)
gfc_current_ns->proc_name->attr.implicit_pure = 0;
/* Mark the variable as having appeared in a data statement. */
- if (gfc_add_data (&sym->attr, sym->name, &sym->declared_at) == FAILURE)
+ if (!gfc_add_data (&sym->attr, sym->name, &sym->declared_at))
{
free (newdata);
return MATCH_ERROR;
@@ -589,7 +588,7 @@ cleanup:
/* Auxiliary function to merge DIMENSION and CODIMENSION array specs. */
-static gfc_try
+static bool
merge_array_spec (gfc_array_spec *from, gfc_array_spec *to, bool copy)
{
int i;
@@ -598,7 +597,7 @@ merge_array_spec (gfc_array_spec *from, gfc_array_spec *to, bool copy)
|| (to->type == AS_ASSUMED_RANK && from->corank))
{
gfc_error ("The assumed-rank array at %C shall not have a codimension");
- return FAILURE;
+ return false;
}
if (to->rank == 0 && from->rank > 0)
@@ -647,7 +646,7 @@ merge_array_spec (gfc_array_spec *from, gfc_array_spec *to, bool copy)
}
}
- return SUCCESS;
+ return true;
}
@@ -686,8 +685,8 @@ char_len_param_value (gfc_expr **expr, bool *deferred)
if (gfc_match_char (':') == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "deferred type "
- "parameter at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "deferred type "
+ "parameter at %C"))
return MATCH_ERROR;
*deferred = true;
@@ -698,7 +697,7 @@ char_len_param_value (gfc_expr **expr, bool *deferred)
m = gfc_match_expr (expr);
if (m == MATCH_YES
- && gfc_expr_check_typed (*expr, gfc_current_ns, false) == FAILURE)
+ && !gfc_expr_check_typed (*expr, gfc_current_ns, false))
return MATCH_ERROR;
if (m == MATCH_YES && (*expr)->expr_type == EXPR_FUNCTION)
@@ -749,8 +748,7 @@ match_char_length (gfc_expr **expr, bool *deferred, bool obsolescent_check)
if (m == MATCH_YES)
{
if (obsolescent_check
- && gfc_notify_std (GFC_STD_F95_OBS,
- "Old-style character length at %C") == FAILURE)
+ && !gfc_notify_std (GFC_STD_F95_OBS, "Old-style character length at %C"))
return MATCH_ERROR;
*expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, length);
return m;
@@ -953,8 +951,7 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
&& sym->ns->proc_name->attr.flavor == FL_MODULE
&& sym->attr.proc != PROC_MODULE)
|| (module_fcn_entry && sym->attr.proc != PROC_MODULE))
- && gfc_add_procedure (&sym->attr, PROC_MODULE,
- sym->name, NULL) == FAILURE)
+ && !gfc_add_procedure (&sym->attr, PROC_MODULE, sym->name, NULL))
rc = 2;
return rc;
@@ -978,16 +975,16 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
the compiler could have automatically handled the varying sizes
across platforms. */
-gfc_try
+bool
gfc_verify_c_interop_param (gfc_symbol *sym)
{
int is_c_interop = 0;
- gfc_try retval = SUCCESS;
+ bool retval = true;
/* We check implicitly typed variables in symbol.c:gfc_set_default_type().
Don't repeat the checks here. */
if (sym->attr.implicit_type)
- return SUCCESS;
+ return true;
/* For subroutines or functions that are passed to a BIND(C) procedure,
they're interoperable if they're BIND(C) and their params are all
@@ -1000,13 +997,13 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
"attribute to be C interoperable", sym->name,
&(sym->declared_at));
- return FAILURE;
+ return false;
}
else
{
if (sym->attr.is_c_interop == 1)
/* We've already checked this procedure; don't check it again. */
- return SUCCESS;
+ return true;
else
return verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
sym->common_block);
@@ -1018,7 +1015,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
{
if (sym->ns->proc_name->attr.is_bind_c == 1)
{
- is_c_interop = (gfc_verify_c_interop (&(sym->ts)) == SUCCESS ? 1 : 0);
+ is_c_interop = (gfc_verify_c_interop(&(sym->ts)) ? 1 : 0);
if (is_c_interop != 1)
{
@@ -1057,7 +1054,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
"procedure '%s' is BIND(C)",
sym->name, &sym->declared_at,
sym->ns->proc_name->name);
- retval = FAILURE;
+ retval = false;
}
}
@@ -1070,7 +1067,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
"ALLOCATABLE attribute because procedure '%s'"
" is BIND(C)", sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
- retval = FAILURE;
+ retval = false;
}
if (sym->attr.pointer == 1)
@@ -1079,7 +1076,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
"POINTER attribute because procedure '%s'"
" is BIND(C)", sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
- retval = FAILURE;
+ retval = false;
}
if (sym->attr.optional == 1 && sym->attr.value)
@@ -1088,27 +1085,27 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
"and the VALUE attribute because procedure '%s' "
"is BIND(C)", sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
- retval = FAILURE;
+ retval = false;
}
else if (sym->attr.optional == 1
- && gfc_notify_std (GFC_STD_F2008_TS, "Variable '%s' "
- "at %L with OPTIONAL attribute in "
- "procedure '%s' which is BIND(C)",
- sym->name, &(sym->declared_at),
- sym->ns->proc_name->name)
- == FAILURE)
- retval = FAILURE;
+ && !gfc_notify_std (GFC_STD_F2008_TS, "Variable '%s' "
+ "at %L with OPTIONAL attribute in "
+ "procedure '%s' which is BIND(C)",
+ sym->name, &(sym->declared_at),
+ sym->ns->proc_name->name))
+ retval = false;
/* Make sure that if it has the dimension attribute, that it is
either assumed size or explicit shape. Deferred shape is already
covered by the pointer/allocatable attribute. */
if (sym->as != NULL && sym->as->type == AS_ASSUMED_SHAPE
- && gfc_notify_std (GFC_STD_F2008_TS, "Assumed-shape array '%s' "
- "at %L as dummy argument to the BIND(C) "
- "procedure '%s' at %L", sym->name,
- &(sym->declared_at), sym->ns->proc_name->name,
- &(sym->ns->proc_name->declared_at)) == FAILURE)
- retval = FAILURE;
+ && !gfc_notify_std (GFC_STD_F2008_TS, "Assumed-shape array '%s' "
+ "at %L as dummy argument to the BIND(C) "
+ "procedure '%s' at %L", sym->name,
+ &(sym->declared_at),
+ sym->ns->proc_name->name,
+ &(sym->ns->proc_name->declared_at)))
+ retval = false;
}
}
@@ -1119,7 +1116,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
/* Function called by variable_decl() that adds a name to the symbol table. */
-static gfc_try
+static bool
build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
gfc_array_spec **as, locus *var_locus)
{
@@ -1127,14 +1124,14 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
gfc_symbol *sym;
if (gfc_get_symbol (name, NULL, &sym))
- return FAILURE;
+ return false;
/* Start updating the symbol table. Add basic type attribute if present. */
if (current_ts.type != BT_UNKNOWN
&& (sym->attr.implicit_type == 0
|| !gfc_compare_types (&sym->ts, &current_ts))
- && gfc_add_type (sym, &current_ts, var_locus) == FAILURE)
- return FAILURE;
+ && !gfc_add_type (sym, &current_ts, var_locus))
+ return false;
if (sym->ts.type == BT_CHARACTER)
{
@@ -1143,8 +1140,8 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
}
/* Add dimension attribute if present. */
- if (gfc_set_array_spec (sym, *as, var_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_set_array_spec (sym, *as, var_locus))
+ return false;
*as = NULL;
/* Add attribute to symbol. The copy is so that we can reset the
@@ -1153,8 +1150,8 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
attr.dimension = 0;
attr.codimension = 0;
- if (gfc_copy_attr (&sym->attr, &attr, var_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_copy_attr (&sym->attr, &attr, var_locus))
+ return false;
/* Finish any work that may need to be done for the binding label,
if it's a bind(c). The bind(c) attr is found before the symbol
@@ -1168,9 +1165,9 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
{
/* Set the binding label and verify that if a NAME= was specified
then only one identifier was in the entity-decl-list. */
- if (set_binding_label (&sym->binding_label, sym->name,
- num_idents_on_line) == FAILURE)
- return FAILURE;
+ if (!set_binding_label (&sym->binding_label, sym->name,
+ num_idents_on_line))
+ return false;
}
}
@@ -1196,7 +1193,7 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
if (sym->ts.type == BT_CLASS)
return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
- return SUCCESS;
+ return true;
}
@@ -1302,7 +1299,7 @@ gfc_free_enum_history (void)
/* Function called by variable_decl() that adds an initialization
expression to a symbol. */
-static gfc_try
+static bool
add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
{
symbol_attribute attr;
@@ -1311,7 +1308,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
init = *initp;
if (find_special (name, &sym, false))
- return FAILURE;
+ return false;
attr = sym->attr;
@@ -1323,7 +1320,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
{
gfc_error ("Initializer not allowed for PARAMETER '%s' at %C",
sym->name);
- return FAILURE;
+ return false;
}
if (init == NULL)
@@ -1332,7 +1329,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
if (attr.flavor == FL_PARAMETER)
{
gfc_error ("PARAMETER at %L is missing an initializer", var_locus);
- return FAILURE;
+ return false;
}
}
else
@@ -1343,7 +1340,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
{
gfc_error ("Variable '%s' at %C with an initializer already "
"appears in a DATA statement", sym->name);
- return FAILURE;
+ return false;
}
/* Check if the assignment can happen. This has to be put off
@@ -1351,15 +1348,15 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
if (sym->ts.type != BT_DERIVED && init->ts.type != BT_DERIVED
&& sym->ts.type != BT_CLASS && init->ts.type != BT_CLASS
&& !sym->attr.proc_pointer
- && gfc_check_assign_symbol (sym, NULL, init) == FAILURE)
- return FAILURE;
+ && !gfc_check_assign_symbol (sym, NULL, init))
+ return false;
if (sym->ts.type == BT_CHARACTER && sym->ts.u.cl
&& init->ts.type == BT_CHARACTER)
{
/* Update symbol character length according initializer. */
- if (gfc_check_assign_symbol (sym, NULL, init) == FAILURE)
- return FAILURE;
+ if (!gfc_check_assign_symbol (sym, NULL, init))
+ return false;
if (sym->ts.u.cl->length == NULL)
{
@@ -1424,7 +1421,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
{
gfc_error ("Can't initialize implied-shape array at %L"
" with scalar", &sym->declared_at);
- return FAILURE;
+ return false;
}
gcc_assert (sym->as->rank == init->rank);
@@ -1442,7 +1439,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
{
gfc_error ("Non-constant lower bound in implied-shape"
" declaration at %L", &lower->where);
- return FAILURE;
+ return false;
}
/* All dimensions must be without upper bound. */
@@ -1487,7 +1484,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
int n;
if (sym->attr.flavor == FL_PARAMETER
&& init->expr_type == EXPR_CONSTANT
- && spec_size (sym->as, &size) == SUCCESS
+ && spec_size (sym->as, &size)
&& mpz_cmp_si (size, 0) > 0)
{
array = gfc_get_array_expr (init->ts.type, init->ts.kind,
@@ -1515,19 +1512,19 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
*initp = NULL;
}
- return SUCCESS;
+ return true;
}
/* Function called by variable_decl() that adds a name to a structure
being built. */
-static gfc_try
+static bool
build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
gfc_array_spec **as)
{
gfc_component *c;
- gfc_try t = SUCCESS;
+ bool t = true;
/* F03:C438/C439. If the current symbol is of the same derived type that we're
constructing, it must have the pointer attribute. */
@@ -1536,7 +1533,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
&& current_attr.pointer == 0)
{
gfc_error ("Component at %C must have the POINTER attribute");
- return FAILURE;
+ return false;
}
if (gfc_current_block ()->attr.pointer && (*as)->rank != 0)
@@ -1545,12 +1542,12 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Array component of structure at %C must have explicit "
"or deferred shape");
- return FAILURE;
+ return false;
}
}
- if (gfc_add_component (gfc_current_block (), name, &c) == FAILURE)
- return FAILURE;
+ if (!gfc_add_component (gfc_current_block(), name, &c))
+ return false;
c->ts = current_ts;
if (c->ts.type == BT_CHARACTER)
@@ -1626,7 +1623,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Pointer array component of structure at %C must have a "
"deferred shape");
- t = FAILURE;
+ t = false;
}
}
else if (c->attr.allocatable)
@@ -1635,7 +1632,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Allocatable component of structure at %C must have a "
"deferred shape");
- t = FAILURE;
+ t = false;
}
}
else
@@ -1644,7 +1641,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Array component of structure at %C must have an "
"explicit shape");
- t = FAILURE;
+ t = false;
}
}
@@ -1654,9 +1651,9 @@ scalar:
bool delayed = (gfc_state_stack->sym == c->ts.u.derived)
|| (!c->ts.u.derived->components
&& !c->ts.u.derived->attr.zero_comp);
- gfc_try t2 = gfc_build_class_symbol (&c->ts, &c->attr, &c->as, delayed);
+ bool t2 = gfc_build_class_symbol (&c->ts, &c->attr, &c->as, delayed);
- if (t != FAILURE)
+ if (t)
t = t2;
}
@@ -1706,9 +1703,8 @@ gfc_match_null (gfc_expr **result)
gfc_intrinsic_symbol (sym);
if (sym->attr.proc != PROC_INTRINSIC
- && (gfc_add_procedure (&sym->attr, PROC_INTRINSIC,
- sym->name, NULL) == FAILURE
- || gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE))
+ && (!gfc_add_procedure(&sym->attr, PROC_INTRINSIC, sym->name, NULL)
+ || !gfc_add_function (&sym->attr, sym->name, NULL)))
return MATCH_ERROR;
*result = gfc_get_null_expr (&gfc_current_locus);
@@ -1760,15 +1756,15 @@ match_pointer_init (gfc_expr **init, int procptr)
if (!procptr)
gfc_resolve_expr (*init);
- if (gfc_notify_std (GFC_STD_F2008, "non-NULL pointer "
- "initialization at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "non-NULL pointer "
+ "initialization at %C"))
return MATCH_ERROR;
return MATCH_YES;
}
-static gfc_try
+static bool
check_function_name (char *name)
{
/* In functions that have a RESULT variable defined, the function name always
@@ -1784,11 +1780,11 @@ check_function_name (char *name)
&& strcmp (block->name, name) == 0)
{
gfc_error ("Function name '%s' not allowed at %C", name);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -1808,7 +1804,7 @@ variable_decl (int elem)
bool cl_deferred;
locus var_locus;
match m;
- gfc_try t;
+ bool t;
gfc_symbol *sym;
initializer = NULL;
@@ -1832,7 +1828,7 @@ variable_decl (int elem)
if (m == MATCH_NO)
as = gfc_copy_array_spec (current_as);
else if (current_as
- && merge_array_spec (current_as, as, true) == FAILURE)
+ && !merge_array_spec (current_as, as, true))
{
m = MATCH_ERROR;
goto cleanup;
@@ -1860,9 +1856,8 @@ variable_decl (int elem)
as->type = AS_IMPLIED_SHAPE;
if (as->type == AS_IMPLIED_SHAPE
- && gfc_notify_std (GFC_STD_F2008,
- "Implied-shape array at %L",
- &var_locus) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "Implied-shape array at %L",
+ &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
@@ -1932,7 +1927,7 @@ variable_decl (int elem)
}
else
{
- if (gfc_set_array_spec (sym, cp_as, &var_locus) == FAILURE)
+ if (!gfc_set_array_spec (sym, cp_as, &var_locus))
gfc_internal_error ("Couldn't set pointee array spec.");
/* Fix the array spec. */
@@ -1973,13 +1968,13 @@ variable_decl (int elem)
create a symbol for those yet. If we fail to create the symbol,
bail out. */
if (gfc_current_state () != COMP_DERIVED
- && build_sym (name, cl, cl_deferred, &as, &var_locus) == FAILURE)
+ && !build_sym (name, cl, cl_deferred, &as, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
}
- if (check_function_name (name) == FAILURE)
+ if (!check_function_name (name))
{
m = MATCH_ERROR;
goto cleanup;
@@ -1996,8 +1991,8 @@ variable_decl (int elem)
if (!colon_seen && gfc_match (" /") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_GNU, "Old-style "
- "initialization at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "Old-style "
+ "initialization at %C"))
return MATCH_ERROR;
return match_old_style_init (name);
@@ -2072,7 +2067,7 @@ variable_decl (int elem)
t = build_struct (name, cl, &initializer, &as);
}
- m = (t == SUCCESS) ? MATCH_YES : MATCH_ERROR;
+ m = (t) ? MATCH_YES : MATCH_ERROR;
cleanup:
/* Free stuff up and return. */
@@ -2148,8 +2143,9 @@ gfc_match_old_kind_spec (gfc_typespec *ts)
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_GNU, "Nonstandard type declaration %s*%d at %C",
- gfc_basic_typename (ts->type), original_kind) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU,
+ "Nonstandard type declaration %s*%d at %C",
+ gfc_basic_typename(ts->type), original_kind))
return MATCH_ERROR;
return MATCH_YES;
@@ -2589,8 +2585,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
if (gfc_match (" byte") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_GNU, "BYTE type at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "BYTE type at %C"))
return MATCH_ERROR;
if (gfc_validate_kind (BT_INTEGER, 1, true) < 0)
@@ -2620,8 +2615,8 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
gfc_error ("Assumed type at %C is not allowed for components");
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F2008_TS, "Assumed type "
- "at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008_TS, "Assumed type "
+ "at %C"))
return MATCH_ERROR;
ts->type = BT_ASSUMED;
return MATCH_YES;
@@ -2643,8 +2638,8 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
|| (!matched_type && gfc_match (" character") == MATCH_YES))
{
if (matched_type
- && gfc_notify_std (GFC_STD_F2008, "TYPE with "
- "intrinsic-type-spec at %C") == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "TYPE with "
+ "intrinsic-type-spec at %C"))
return MATCH_ERROR;
ts->type = BT_CHARACTER;
@@ -2674,8 +2669,8 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
|| (!matched_type && gfc_match (" double precision") == MATCH_YES))
{
if (matched_type
- && gfc_notify_std (GFC_STD_F2008, "TYPE with "
- "intrinsic-type-spec at %C") == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "TYPE with "
+ "intrinsic-type-spec at %C"))
return MATCH_ERROR;
if (matched_type && gfc_match_char (')') != MATCH_YES)
return MATCH_ERROR;
@@ -2699,13 +2694,12 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
&& gfc_match (" complex") == MATCH_YES)))
|| (!matched_type && gfc_match (" double complex") == MATCH_YES))
{
- if (gfc_notify_std (GFC_STD_GNU, "DOUBLE COMPLEX at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "DOUBLE COMPLEX at %C"))
return MATCH_ERROR;
if (matched_type
- && gfc_notify_std (GFC_STD_F2008, "TYPE with "
- "intrinsic-type-spec at %C") == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "TYPE with "
+ "intrinsic-type-spec at %C"))
return MATCH_ERROR;
if (matched_type && gfc_match_char (')') != MATCH_YES)
@@ -2753,8 +2747,8 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
/* This is essential to force the construction of
unlimited polymorphic component class containers. */
upe->attr.zero_comp = 1;
- if (gfc_add_flavor (&upe->attr, FL_DERIVED,
- NULL, &gfc_current_locus) == FAILURE)
+ if (!gfc_add_flavor (&upe->attr, FL_DERIVED, NULL,
+ &gfc_current_locus))
return MATCH_ERROR;
}
else
@@ -2774,8 +2768,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
return m;
ts->type = BT_CLASS;
- if (gfc_notify_std (GFC_STD_F2003, "CLASS statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "CLASS statement at %C"))
return MATCH_ERROR;
}
@@ -2846,11 +2839,11 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
gfc_set_sym_referenced (sym);
if (!sym->attr.generic
- && gfc_add_generic (&sym->attr, sym->name, NULL) == FAILURE)
+ && !gfc_add_generic (&sym->attr, sym->name, NULL))
return MATCH_ERROR;
if (!sym->attr.function
- && gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
+ && !gfc_add_function (&sym->attr, sym->name, NULL))
return MATCH_ERROR;
if (!dt_sym)
@@ -2872,8 +2865,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
gfc_set_sym_referenced (dt_sym);
if (dt_sym->attr.flavor != FL_DERIVED
- && gfc_add_flavor (&dt_sym->attr, FL_DERIVED, sym->name, NULL)
- == FAILURE)
+ && !gfc_add_flavor (&dt_sym->attr, FL_DERIVED, sym->name, NULL))
return MATCH_ERROR;
ts->u.derived = dt_sym;
@@ -2882,8 +2874,8 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
get_kind:
if (matched_type
- && gfc_notify_std (GFC_STD_F2008, "TYPE with "
- "intrinsic-type-spec at %C") == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "TYPE with "
+ "intrinsic-type-spec at %C"))
return MATCH_ERROR;
/* For all types except double, derived and character, look for an
@@ -3014,7 +3006,7 @@ match_implicit_range (void)
conflicts with whatever earlier IMPLICIT statements may have
set. This is done when we've successfully finished matching
the current one. */
- if (gfc_add_new_implicit_range (c1, c2) != SUCCESS)
+ if (!gfc_add_new_implicit_range (c1, c2))
goto bad;
}
@@ -3096,7 +3088,7 @@ gfc_match_implicit (void)
}
/* Record the Successful match. */
- if (gfc_merge_new_implicit (&ts) != SUCCESS)
+ if (!gfc_merge_new_implicit (&ts))
return MATCH_ERROR;
continue;
}
@@ -3136,7 +3128,7 @@ gfc_match_implicit (void)
if ((c != '\n') && (c != ','))
goto syntax;
- if (gfc_merge_new_implicit (&ts) != SUCCESS)
+ if (!gfc_merge_new_implicit (&ts))
return MATCH_ERROR;
}
while (c == ',');
@@ -3167,8 +3159,7 @@ gfc_match_import (void)
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F2003, "IMPORT statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "IMPORT statement at %C"))
return MATCH_ERROR;
if (gfc_match_eos () == MATCH_YES)
@@ -3313,7 +3304,7 @@ match_attr_spec (void)
unsigned int d;
const char *attr;
match m;
- gfc_try t;
+ bool t;
gfc_clear_attr (&current_attr);
start = gfc_current_locus;
@@ -3552,7 +3543,7 @@ match_attr_spec (void)
current_as = as;
else if (m == MATCH_YES)
{
- if (merge_array_spec (as, current_as, false) == FAILURE)
+ if (!merge_array_spec (as, current_as, false))
m = MATCH_ERROR;
free (as);
}
@@ -3664,9 +3655,8 @@ match_attr_spec (void)
{
if (d == DECL_ALLOCATABLE)
{
- if (gfc_notify_std (GFC_STD_F2003, "ALLOCATABLE "
- "attribute at %C in a TYPE definition")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ALLOCATABLE "
+ "attribute at %C in a TYPE definition"))
{
m = MATCH_ERROR;
goto cleanup;
@@ -3692,10 +3682,9 @@ match_attr_spec (void)
&& gfc_state_stack->previous
&& gfc_state_stack->previous->state == COMP_MODULE)
{
- if (gfc_notify_std (GFC_STD_F2003, "Attribute %s "
- "at %L in a TYPE definition", attr,
- &seen_at[d])
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Attribute %s "
+ "at %L in a TYPE definition", attr,
+ &seen_at[d]))
{
m = MATCH_ERROR;
goto cleanup;
@@ -3717,10 +3706,8 @@ match_attr_spec (void)
break;
case DECL_ASYNCHRONOUS:
- if (gfc_notify_std (GFC_STD_F2003,
- "ASYNCHRONOUS attribute at %C")
- == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS attribute at %C"))
+ t = false;
else
t = gfc_add_asynchronous (&current_attr, NULL, &seen_at[d]);
break;
@@ -3730,10 +3717,8 @@ match_attr_spec (void)
break;
case DECL_CONTIGUOUS:
- if (gfc_notify_std (GFC_STD_F2008,
- "CONTIGUOUS attribute at %C")
- == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2008, "CONTIGUOUS attribute at %C"))
+ t = false;
else
t = gfc_add_contiguous (&current_attr, NULL, &seen_at[d]);
break;
@@ -3779,14 +3764,12 @@ match_attr_spec (void)
{
gfc_error ("PROTECTED at %C only allowed in specification "
"part of a module");
- t = FAILURE;
+ t = false;
break;
}
- if (gfc_notify_std (GFC_STD_F2003, "PROTECTED "
- "attribute at %C")
- == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "PROTECTED attribute at %C"))
+ t = false;
else
t = gfc_add_protected (&current_attr, NULL, &seen_at[d]);
break;
@@ -3814,19 +3797,15 @@ match_attr_spec (void)
break;
case DECL_VALUE:
- if (gfc_notify_std (GFC_STD_F2003, "VALUE attribute "
- "at %C")
- == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "VALUE attribute at %C"))
+ t = false;
else
t = gfc_add_value (&current_attr, NULL, &seen_at[d]);
break;
case DECL_VOLATILE:
- if (gfc_notify_std (GFC_STD_F2003,
- "VOLATILE attribute at %C")
- == FAILURE)
- t = FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "VOLATILE attribute at %C"))
+ t = false;
else
t = gfc_add_volatile (&current_attr, NULL, &seen_at[d]);
break;
@@ -3835,7 +3814,7 @@ match_attr_spec (void)
gfc_internal_error ("match_attr_spec(): Bad attribute");
}
- if (t == FAILURE)
+ if (!t)
{
m = MATCH_ERROR;
goto cleanup;
@@ -3864,7 +3843,7 @@ cleanup:
(J3/04-007, section 15.4.1). If a binding label was given and
there is more than one argument (num_idents), it is an error. */
-static gfc_try
+static bool
set_binding_label (const char **dest_label, const char *sym_name,
int num_idents)
{
@@ -3872,7 +3851,7 @@ set_binding_label (const char **dest_label, const char *sym_name,
{
gfc_error ("Multiple identifiers provided with "
"single NAME= specifier at %C");
- return FAILURE;
+ return false;
}
if (curr_binding_label)
@@ -3886,7 +3865,7 @@ set_binding_label (const char **dest_label, const char *sym_name,
*dest_label = IDENTIFIER_POINTER (get_identifier (sym_name));
}
- return SUCCESS;
+ return true;
}
@@ -3903,18 +3882,18 @@ set_com_block_bind_c (gfc_common_head *com_block, int is_bind_c)
/* Verify that the given gfc_typespec is for a C interoperable type. */
-gfc_try
+bool
gfc_verify_c_interop (gfc_typespec *ts)
{
if (ts->type == BT_DERIVED && ts->u.derived != NULL)
return (ts->u.derived->ts.is_c_interop || ts->u.derived->attr.is_bind_c)
- ? SUCCESS : FAILURE;
+ ? true : false;
else if (ts->type == BT_CLASS)
- return FAILURE;
+ return false;
else if (ts->is_c_interop != 1 && ts->type != BT_ASSUMED)
- return FAILURE;
+ return false;
- return SUCCESS;
+ return true;
}
@@ -3923,11 +3902,11 @@ gfc_verify_c_interop (gfc_typespec *ts)
interoperable type. Errors will be reported here, if
encountered. */
-gfc_try
+bool
verify_com_block_vars_c_interop (gfc_common_head *com_block)
{
gfc_symbol *curr_sym = NULL;
- gfc_try retval = SUCCESS;
+ bool retval = true;
curr_sym = com_block->head;
@@ -3951,12 +3930,12 @@ verify_com_block_vars_c_interop (gfc_common_head *com_block)
/* Verify that a given BIND(C) symbol is C interoperable. If it is not,
an appropriate error message is reported. */
-gfc_try
+bool
verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
int is_in_common, gfc_common_head *com_block)
{
bool bind_c_function = false;
- gfc_try retval = SUCCESS;
+ bool retval = true;
if (tmp_sym->attr.function && tmp_sym->attr.is_bind_c)
bind_c_function = true;
@@ -3983,7 +3962,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
the given ts (current_ts), so look in both. */
if (tmp_sym->ts.type != BT_UNKNOWN || ts->type != BT_UNKNOWN)
{
- if (gfc_verify_c_interop (&(tmp_sym->ts)) != SUCCESS)
+ if (!gfc_verify_c_interop (&(tmp_sym->ts)))
{
/* See if we're dealing with a sym in a common block or not. */
if (is_in_common == 1 && gfc_option.warn_c_binding_type)
@@ -4018,7 +3997,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
"since it is not a global",
tmp_sym->name, com_block->name,
&(tmp_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
/* Scalar variables that are bind(c) can not have the pointer
@@ -4030,7 +4009,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
gfc_error ("Variable '%s' at %L cannot have both the "
"POINTER and BIND(C) attributes",
tmp_sym->name, &(tmp_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
if (tmp_sym->attr.allocatable == 1)
@@ -4038,7 +4017,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
gfc_error ("Variable '%s' at %L cannot have both the "
"ALLOCATABLE and BIND(C) attributes",
tmp_sym->name, &(tmp_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
}
@@ -4079,19 +4058,18 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
the type is C interoperable. Errors are reported by the functions
used to set/test these fields. */
-gfc_try
+bool
set_verify_bind_c_sym (gfc_symbol *tmp_sym, int num_idents)
{
- gfc_try retval = SUCCESS;
+ bool retval = true;
/* TODO: Do we need to make sure the vars aren't marked private? */
/* Set the is_bind_c bit in symbol_attribute. */
gfc_add_is_bind_c (&(tmp_sym->attr), tmp_sym->name, &gfc_current_locus, 0);
- if (set_binding_label (&tmp_sym->binding_label, tmp_sym->name,
- num_idents) != SUCCESS)
- return FAILURE;
+ if (!set_binding_label (&tmp_sym->binding_label, tmp_sym->name, num_idents))
+ return false;
return retval;
}
@@ -4100,16 +4078,15 @@ set_verify_bind_c_sym (gfc_symbol *tmp_sym, int num_idents)
/* Set the fields marking the given common block as BIND(C), including
a binding label, and report any errors encountered. */
-gfc_try
+bool
set_verify_bind_c_com_block (gfc_common_head *com_block, int num_idents)
{
- gfc_try retval = SUCCESS;
+ bool retval = true;
/* destLabel, common name, typespec (which may have binding label). */
- if (set_binding_label (&com_block->binding_label, com_block->name,
- num_idents)
- != SUCCESS)
- return FAILURE;
+ if (!set_binding_label (&com_block->binding_label, com_block->name,
+ num_idents))
+ return false;
/* Set the given common block (com_block) to being bind(c) (1). */
set_com_block_bind_c (com_block, 1);
@@ -4121,7 +4098,7 @@ set_verify_bind_c_com_block (gfc_common_head *com_block, int num_idents)
/* Retrieve the list of one or more identifiers that the given bind(c)
attribute applies to. */
-gfc_try
+bool
get_bind_c_idents (void)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
@@ -4144,7 +4121,7 @@ get_bind_c_idents (void)
{
gfc_error ("Need either entity or common block name for "
"attribute specification statement at %C");
- return FAILURE;
+ return false;
}
/* Save the current identifier and look for more. */
@@ -4160,15 +4137,13 @@ get_bind_c_idents (void)
{
if (tmp_sym != NULL)
{
- if (set_verify_bind_c_sym (tmp_sym, num_idents)
- != SUCCESS)
- return FAILURE;
+ if (!set_verify_bind_c_sym (tmp_sym, num_idents))
+ return false;
}
else
{
- if (set_verify_bind_c_com_block(com_block, num_idents)
- != SUCCESS)
- return FAILURE;
+ if (!set_verify_bind_c_com_block (com_block, num_idents))
+ return false;
}
/* Look to see if we have another identifier. */
@@ -4191,7 +4166,7 @@ get_bind_c_idents (void)
{
gfc_error ("Missing entity or common block name for "
"attribute specification statement at %C");
- return FAILURE;
+ return false;
}
}
else
@@ -4201,7 +4176,7 @@ get_bind_c_idents (void)
} while (found_id == MATCH_YES);
/* if we get here we were successful */
- return SUCCESS;
+ return true;
}
@@ -4233,7 +4208,7 @@ gfc_match_bind_c_stmt (void)
found can have all appropriate parts updated (assuming that the same
spec stmt can have multiple attrs, such as both bind(c) and
allocatable...). */
- if (get_bind_c_idents () != SUCCESS)
+ if (!get_bind_c_idents ())
/* Error message should have printed already. */
return MATCH_ERROR;
}
@@ -4380,7 +4355,7 @@ gfc_match_prefix (gfc_typespec *ts)
if (gfc_match ("elemental% ") == MATCH_YES)
{
- if (gfc_add_elemental (&current_attr, NULL) == FAILURE)
+ if (!gfc_add_elemental (&current_attr, NULL))
goto error;
found_prefix = true;
@@ -4388,7 +4363,7 @@ gfc_match_prefix (gfc_typespec *ts)
if (gfc_match ("pure% ") == MATCH_YES)
{
- if (gfc_add_pure (&current_attr, NULL) == FAILURE)
+ if (!gfc_add_pure (&current_attr, NULL))
goto error;
found_prefix = true;
@@ -4396,7 +4371,7 @@ gfc_match_prefix (gfc_typespec *ts)
if (gfc_match ("recursive% ") == MATCH_YES)
{
- if (gfc_add_recursive (&current_attr, NULL) == FAILURE)
+ if (!gfc_add_recursive (&current_attr, NULL))
goto error;
found_prefix = true;
@@ -4407,9 +4382,7 @@ gfc_match_prefix (gfc_typespec *ts)
automatically PURE. */
if (gfc_match ("impure% ") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2008,
- "IMPURE procedure at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "IMPURE procedure at %C"))
goto error;
seen_impure = true;
@@ -4428,7 +4401,7 @@ gfc_match_prefix (gfc_typespec *ts)
/* If IMPURE it not seen but the procedure is ELEMENTAL, mark it as PURE. */
if (!seen_impure && current_attr.elemental && !current_attr.pure)
{
- if (gfc_add_pure (&current_attr, NULL) == FAILURE)
+ if (!gfc_add_pure (&current_attr, NULL))
goto error;
}
@@ -4446,19 +4419,19 @@ error:
/* Copy attributes matched by gfc_match_prefix() to attributes on a symbol. */
-static gfc_try
+static bool
copy_prefix (symbol_attribute *dest, locus *where)
{
- if (current_attr.pure && gfc_add_pure (dest, where) == FAILURE)
- return FAILURE;
+ if (current_attr.pure && !gfc_add_pure (dest, where))
+ return false;
- if (current_attr.elemental && gfc_add_elemental (dest, where) == FAILURE)
- return FAILURE;
+ if (current_attr.elemental && !gfc_add_elemental (dest, where))
+ return false;
- if (current_attr.recursive && gfc_add_recursive (dest, where) == FAILURE)
- return FAILURE;
+ if (current_attr.recursive && !gfc_add_recursive (dest, where))
+ return false;
- return SUCCESS;
+ return true;
}
@@ -4487,7 +4460,15 @@ gfc_match_formal_arglist (gfc_symbol *progname, int st_flag, int null_flag)
for (;;)
{
if (gfc_match_char ('*') == MATCH_YES)
- sym = NULL;
+ {
+ sym = NULL;
+ if (!gfc_notify_std (GFC_STD_F95_OBS, "Alternate-return argument "
+ "at %C"))
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+ }
else
{
m = gfc_match_name (name);
@@ -4514,8 +4495,8 @@ gfc_match_formal_arglist (gfc_symbol *progname, int st_flag, int null_flag)
dummy procedure. We don't apply these attributes to formal
arguments of statement functions. */
if (sym != NULL && !st_flag
- && (gfc_add_dummy (&sym->attr, sym->name, NULL) == FAILURE
- || gfc_missing_attr (&sym->attr, NULL) == FAILURE))
+ && (!gfc_add_dummy(&sym->attr, sym->name, NULL)
+ || !gfc_missing_attr (&sym->attr, NULL)))
{
m = MATCH_ERROR;
goto cleanup;
@@ -4565,8 +4546,7 @@ ok:
}
}
- if (gfc_add_explicit_interface (progname, IFSRC_DECL, head, NULL)
- == FAILURE)
+ if (!gfc_add_explicit_interface (progname, IFSRC_DECL, head, NULL))
{
m = MATCH_ERROR;
goto cleanup;
@@ -4599,7 +4579,7 @@ match_result (gfc_symbol *function, gfc_symbol **result)
/* Get the right paren, and that's it because there could be the
bind(c) attribute after the result clause. */
- if (gfc_match_char(')') != MATCH_YES)
+ if (gfc_match_char (')') != MATCH_YES)
{
/* TODO: should report the missing right paren here. */
return MATCH_ERROR;
@@ -4614,7 +4594,7 @@ match_result (gfc_symbol *function, gfc_symbol **result)
if (gfc_get_symbol (name, NULL, &r))
return MATCH_ERROR;
- if (gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
+ if (!gfc_add_result (&r->attr, r->name, NULL))
return MATCH_ERROR;
*result = r;
@@ -4694,14 +4674,12 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result)
/* Fortran 2008 draft allows BIND(C) for internal procedures. */
if (gfc_current_state () == COMP_CONTAINS
&& sym->ns->proc_name->attr.flavor != FL_MODULE
- && gfc_notify_std (GFC_STD_F2008, "BIND(C) attribute "
- "at %L may not be specified for an internal "
- "procedure", &gfc_current_locus)
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "BIND(C) attribute "
+ "at %L may not be specified for an internal "
+ "procedure", &gfc_current_locus))
return MATCH_ERROR;
- if (gfc_add_is_bind_c (&(sym->attr), sym->name, &gfc_current_locus, 1)
- == FAILURE)
+ if (!gfc_add_is_bind_c (&(sym->attr), sym->name, &gfc_current_locus, 1))
return MATCH_ERROR;
}
@@ -4712,13 +4690,13 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result)
/* Procedure pointer return value without RESULT statement:
Add "hidden" result variable named "ppr@". */
-static gfc_try
+static bool
add_hidden_procptr_result (gfc_symbol *sym)
{
bool case1,case2;
if (gfc_notification_std (GFC_STD_F2003) == ERROR)
- return FAILURE;
+ return false;
/* First usage case: PROCEDURE and EXTERNAL statements. */
case1 = gfc_current_state () == COMP_FUNCTION && gfc_current_block ()
@@ -4768,10 +4746,10 @@ add_hidden_procptr_result (gfc_symbol *sym)
{
sym->result->attr.proc_pointer = 1;
sym->attr.pointer = 0;
- return SUCCESS;
+ return true;
}
else
- return FAILURE;
+ return false;
}
@@ -4837,8 +4815,8 @@ match_procedure_interface (gfc_symbol **proc_if)
if ((*proc_if)->attr.flavor == FL_UNKNOWN
&& (*proc_if)->ts.type == BT_UNKNOWN
- && gfc_add_flavor (&(*proc_if)->attr, FL_PROCEDURE,
- (*proc_if)->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&(*proc_if)->attr, FL_PROCEDURE,
+ (*proc_if)->name, NULL))
return MATCH_ERROR;
}
@@ -4890,7 +4868,7 @@ match_procedure_decl (void)
return m;
/* Add current_attr to the symbol attributes. */
- if (gfc_copy_attr (&sym->attr, &current_attr, NULL) == FAILURE)
+ if (!gfc_copy_attr (&sym->attr, &current_attr, NULL))
return MATCH_ERROR;
if (sym->attr.is_bind_c)
@@ -4916,18 +4894,17 @@ match_procedure_decl (void)
return MATCH_ERROR;
}
/* Set binding label for BIND(C). */
- if (set_binding_label (&sym->binding_label, sym->name, num)
- != SUCCESS)
+ if (!set_binding_label (&sym->binding_label, sym->name, num))
return MATCH_ERROR;
}
- if (gfc_add_external (&sym->attr, NULL) == FAILURE)
+ if (!gfc_add_external (&sym->attr, NULL))
return MATCH_ERROR;
- if (add_hidden_procptr_result (sym) == SUCCESS)
+ if (add_hidden_procptr_result (sym))
sym = sym->result;
- if (gfc_add_proc (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_proc (&sym->attr, sym->name, NULL))
return MATCH_ERROR;
/* Set interface. */
@@ -4946,7 +4923,7 @@ match_procedure_decl (void)
}
else if (current_ts.type != BT_UNKNOWN)
{
- if (gfc_add_type (sym, &current_ts, &gfc_current_locus) == FAILURE)
+ if (!gfc_add_type (sym, &current_ts, &gfc_current_locus))
return MATCH_ERROR;
sym->ts.interface = gfc_new_symbol ("", gfc_current_ns);
sym->ts.interface->ts = current_ts;
@@ -4969,8 +4946,7 @@ match_procedure_decl (void)
if (m != MATCH_YES)
goto cleanup;
- if (add_init_expr_to_sym (sym->name, &initializer, &gfc_current_locus)
- != SUCCESS)
+ if (!add_init_expr_to_sym (sym->name, &initializer, &gfc_current_locus))
goto cleanup;
}
@@ -5042,8 +5018,7 @@ match_ppc_decl (void)
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F2003, "Procedure pointer "
- "component at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Procedure pointer component at %C"))
return MATCH_ERROR;
/* Match PPC names. */
@@ -5056,17 +5031,17 @@ match_ppc_decl (void)
else if (m == MATCH_ERROR)
return m;
- if (gfc_add_component (gfc_current_block (), name, &c) == FAILURE)
+ if (!gfc_add_component (gfc_current_block(), name, &c))
return MATCH_ERROR;
/* Add current_attr to the symbol attributes. */
- if (gfc_copy_attr (&c->attr, &current_attr, NULL) == FAILURE)
+ if (!gfc_copy_attr (&c->attr, &current_attr, NULL))
return MATCH_ERROR;
- if (gfc_add_external (&c->attr, NULL) == FAILURE)
+ if (!gfc_add_external (&c->attr, NULL))
return MATCH_ERROR;
- if (gfc_add_proc (&c->attr, name, NULL) == FAILURE)
+ if (!gfc_add_proc (&c->attr, name, NULL))
return MATCH_ERROR;
c->tb = tb;
@@ -5135,9 +5110,8 @@ match_procedure_in_interface (void)
old_locus = gfc_current_locus;
if (gfc_match ("::") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2008, "double colon in "
- "MODULE PROCEDURE statement at %L", &old_locus)
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "double colon in "
+ "MODULE PROCEDURE statement at %L", &old_locus))
return MATCH_ERROR;
}
else
@@ -5153,7 +5127,7 @@ match_procedure_in_interface (void)
if (gfc_get_symbol (name, gfc_current_ns->parent, &sym))
return MATCH_ERROR;
- if (gfc_add_interface (sym) == FAILURE)
+ if (!gfc_add_interface (sym))
return MATCH_ERROR;
if (gfc_match_eos () == MATCH_YES)
@@ -5205,8 +5179,7 @@ gfc_match_procedure (void)
if (m != MATCH_YES)
return m;
- if (gfc_notify_std (GFC_STD_F2003, "PROCEDURE statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "PROCEDURE statement at %C"))
return MATCH_ERROR;
return m;
@@ -5265,7 +5238,7 @@ gfc_match_function_decl (void)
if (get_proc_name (name, &sym, false))
return MATCH_ERROR;
- if (add_hidden_procptr_result (sym) == SUCCESS)
+ if (add_hidden_procptr_result (sym))
sym = sym->result;
gfc_new_block = sym;
@@ -5323,11 +5296,11 @@ gfc_match_function_decl (void)
/* Make changes to the symbol. */
m = MATCH_ERROR;
- if (gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_function (&sym->attr, sym->name, NULL))
goto cleanup;
- if (gfc_missing_attr (&sym->attr, NULL) == FAILURE
- || copy_prefix (&sym->attr, &sym->declared_at) == FAILURE)
+ if (!gfc_missing_attr (&sym->attr, NULL)
+ || !copy_prefix (&sym->attr, &sym->declared_at))
goto cleanup;
/* Delay matching the function characteristics until after the
@@ -5341,15 +5314,14 @@ gfc_match_function_decl (void)
if (result == NULL)
{
if (current_ts.type != BT_UNKNOWN
- && gfc_add_type (sym, &current_ts, &gfc_current_locus) == FAILURE)
+ && !gfc_add_type (sym, &current_ts, &gfc_current_locus))
goto cleanup;
sym->result = sym;
}
else
{
if (current_ts.type != BT_UNKNOWN
- && gfc_add_type (result, &current_ts, &gfc_current_locus)
- == FAILURE)
+ && !gfc_add_type (result, &current_ts, &gfc_current_locus))
goto cleanup;
sym->result = result;
}
@@ -5416,8 +5388,7 @@ gfc_match_entry (void)
if (m != MATCH_YES)
return m;
- if (gfc_notify_std (GFC_STD_F2008_OBS,
- "ENTRY statement at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008_OBS, "ENTRY statement at %C"))
return MATCH_ERROR;
state = gfc_current_state ();
@@ -5540,13 +5511,13 @@ gfc_match_entry (void)
gfc_error ("Missing required parentheses before BIND(C) at %C");
return MATCH_ERROR;
}
- if (gfc_add_is_bind_c (&(entry->attr), entry->name, &(entry->declared_at), 1)
- == FAILURE)
+ if (!gfc_add_is_bind_c (&(entry->attr), entry->name,
+ &(entry->declared_at), 1))
return MATCH_ERROR;
}
- if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE
- || gfc_add_subroutine (&entry->attr, entry->name, NULL) == FAILURE)
+ if (!gfc_add_entry (&entry->attr, entry->name, NULL)
+ || !gfc_add_subroutine (&entry->attr, entry->name, NULL))
return MATCH_ERROR;
}
else
@@ -5581,8 +5552,8 @@ gfc_match_entry (void)
if (gfc_match_eos () == MATCH_YES)
{
- if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE
- || gfc_add_function (&entry->attr, entry->name, NULL) == FAILURE)
+ if (!gfc_add_entry (&entry->attr, entry->name, NULL)
+ || !gfc_add_function (&entry->attr, entry->name, NULL))
return MATCH_ERROR;
entry->result = entry;
@@ -5597,17 +5568,16 @@ gfc_match_entry (void)
if (result)
{
- if (gfc_add_result (&result->attr, result->name, NULL) == FAILURE
- || gfc_add_entry (&entry->attr, result->name, NULL) == FAILURE
- || gfc_add_function (&entry->attr, result->name, NULL)
- == FAILURE)
+ if (!gfc_add_result (&result->attr, result->name, NULL)
+ || !gfc_add_entry (&entry->attr, result->name, NULL)
+ || !gfc_add_function (&entry->attr, result->name, NULL))
return MATCH_ERROR;
entry->result = result;
}
else
{
- if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE
- || gfc_add_function (&entry->attr, entry->name, NULL) == FAILURE)
+ if (!gfc_add_entry (&entry->attr, entry->name, NULL)
+ || !gfc_add_function (&entry->attr, entry->name, NULL))
return MATCH_ERROR;
entry->result = entry;
}
@@ -5672,7 +5642,7 @@ gfc_match_subroutine (void)
the symbol existed before. */
sym->declared_at = gfc_current_locus;
- if (add_hidden_procptr_result (sym) == SUCCESS)
+ if (add_hidden_procptr_result (sym))
sym = sym->result;
gfc_new_block = sym;
@@ -5682,7 +5652,7 @@ gfc_match_subroutine (void)
gfc_gobble_whitespace ();
peek_char = gfc_peek_ascii_char ();
- if (gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_subroutine (&sym->attr, sym->name, NULL))
return MATCH_ERROR;
if (gfc_match_formal_arglist (sym, 0, 1) != MATCH_YES)
@@ -5727,10 +5697,9 @@ gfc_match_subroutine (void)
/* The following is allowed in the Fortran 2008 draft. */
if (gfc_current_state () == COMP_CONTAINS
&& sym->ns->proc_name->attr.flavor != FL_MODULE
- && gfc_notify_std (GFC_STD_F2008, "BIND(C) attribute "
- "at %L may not be specified for an internal "
- "procedure", &gfc_current_locus)
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "BIND(C) attribute "
+ "at %L may not be specified for an internal "
+ "procedure", &gfc_current_locus))
return MATCH_ERROR;
if (peek_char != '(')
@@ -5738,8 +5707,8 @@ gfc_match_subroutine (void)
gfc_error ("Missing required parentheses before BIND(C) at %C");
return MATCH_ERROR;
}
- if (gfc_add_is_bind_c (&(sym->attr), sym->name, &(sym->declared_at), 1)
- == FAILURE)
+ if (!gfc_add_is_bind_c (&(sym->attr), sym->name,
+ &(sym->declared_at), 1))
return MATCH_ERROR;
}
@@ -5749,7 +5718,7 @@ gfc_match_subroutine (void)
return MATCH_ERROR;
}
- if (copy_prefix (&sym->attr, &sym->declared_at) == FAILURE)
+ if (!copy_prefix (&sym->attr, &sym->declared_at))
return MATCH_ERROR;
/* Warn if it has the same name as an intrinsic. */
@@ -6099,9 +6068,9 @@ gfc_match_end (gfc_statement *st)
{
if (!eos_ok && (*st == ST_END_SUBROUTINE || *st == ST_END_FUNCTION))
{
- if (gfc_notify_std (GFC_STD_F2008, "END statement "
- "instead of %s statement at %L",
- gfc_ascii_statement (*st), &old_loc) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "END statement "
+ "instead of %s statement at %L",
+ gfc_ascii_statement(*st), &old_loc))
goto cleanup;
}
else if (!eos_ok)
@@ -6238,7 +6207,7 @@ attr_decl1 (void)
if (find_special (name, &sym, false))
return MATCH_ERROR;
- if (check_function_name (name) == FAILURE)
+ if (!check_function_name (name))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6298,8 +6267,7 @@ attr_decl1 (void)
to the first component, or '_data' field. */
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)
+ if (!gfc_copy_attr (&CLASS_DATA(sym)->attr, &current_attr, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6308,7 +6276,7 @@ attr_decl1 (void)
else
{
if (current_attr.dimension == 0 && current_attr.codimension == 0
- && gfc_copy_attr (&sym->attr, &current_attr, &var_locus) == FAILURE)
+ && !gfc_copy_attr (&sym->attr, &current_attr, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6316,13 +6284,13 @@ attr_decl1 (void)
}
if (sym->ts.type == BT_CLASS
- && gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false) == FAILURE)
+ && !gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false))
{
m = MATCH_ERROR;
goto cleanup;
}
- if (gfc_set_array_spec (sym, as, &var_locus) == FAILURE)
+ if (!gfc_set_array_spec (sym, as, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6336,7 +6304,7 @@ attr_decl1 (void)
goto cleanup;
}
- if (gfc_add_attribute (&sym->attr, &var_locus) == FAILURE)
+ if (!gfc_add_attribute (&sym->attr, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6344,7 +6312,7 @@ attr_decl1 (void)
if ((current_attr.external || current_attr.intrinsic)
&& sym->attr.flavor != FL_PROCEDURE
- && gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6441,7 +6409,7 @@ cray_pointer_decl (void)
return m;
}
- if (gfc_add_cray_pointer (&cptr->attr, &var_locus) == FAILURE)
+ if (!gfc_add_cray_pointer (&cptr->attr, &var_locus))
return MATCH_ERROR;
gfc_set_sym_referenced (cptr);
@@ -6494,14 +6462,14 @@ cray_pointer_decl (void)
as = NULL;
}
- if (gfc_add_cray_pointee (&cpte->attr, &var_locus) == FAILURE)
+ if (!gfc_add_cray_pointee (&cpte->attr, &var_locus))
return MATCH_ERROR;
gfc_set_sym_referenced (cpte);
if (cpte->as == NULL)
{
- if (gfc_set_array_spec (cpte, as, &var_locus) == FAILURE)
+ if (!gfc_set_array_spec (cpte, as, &var_locus))
gfc_internal_error ("Couldn't set Cray pointee array spec.");
}
else if (as != NULL)
@@ -6654,8 +6622,7 @@ gfc_match_codimension (void)
match
gfc_match_contiguous (void)
{
- if (gfc_notify_std (GFC_STD_F2008, "CONTIGUOUS statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "CONTIGUOUS statement at %C"))
return MATCH_ERROR;
gfc_clear_attr (&current_attr);
@@ -6719,16 +6686,17 @@ access_attr_decl (gfc_statement st)
if (gfc_get_symbol (name, NULL, &sym))
goto done;
- if (gfc_add_access (&sym->attr, (st == ST_PUBLIC)
- ? ACCESS_PUBLIC : ACCESS_PRIVATE,
- sym->name, NULL) == FAILURE)
+ if (!gfc_add_access (&sym->attr,
+ (st == ST_PUBLIC)
+ ? ACCESS_PUBLIC : ACCESS_PRIVATE,
+ sym->name, NULL))
return MATCH_ERROR;
if (sym->attr.generic && (dt_sym = gfc_find_dt_in_generic (sym))
- && gfc_add_access (&dt_sym->attr,
- (st == ST_PUBLIC) ? ACCESS_PUBLIC
- : ACCESS_PRIVATE,
- sym->name, NULL) == FAILURE)
+ && !gfc_add_access (&dt_sym->attr,
+ (st == ST_PUBLIC)
+ ? ACCESS_PUBLIC : ACCESS_PRIVATE,
+ sym->name, NULL))
return MATCH_ERROR;
break;
@@ -6807,8 +6775,7 @@ gfc_match_protected (void)
}
- if (gfc_notify_std (GFC_STD_F2003, "PROTECTED statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "PROTECTED statement at %C"))
return MATCH_ERROR;
if (gfc_match (" ::") == MATCH_NO && gfc_match_space () == MATCH_NO)
@@ -6825,8 +6792,7 @@ gfc_match_protected (void)
switch (m)
{
case MATCH_YES:
- if (gfc_add_protected (&sym->attr, sym->name, &gfc_current_locus)
- == FAILURE)
+ if (!gfc_add_protected (&sym->attr, sym->name, &gfc_current_locus))
return MATCH_ERROR;
goto next_item;
@@ -6932,7 +6898,7 @@ do_parm (void)
gfc_symbol *sym;
gfc_expr *init;
match m;
- gfc_try t;
+ bool t;
m = gfc_match_symbol (&sym, 0);
if (m == MATCH_NO)
@@ -6954,14 +6920,14 @@ do_parm (void)
return m;
if (sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (sym, 1, NULL) == FAILURE)
+ && !gfc_set_default_type (sym, 1, NULL))
{
m = MATCH_ERROR;
goto cleanup;
}
- if (gfc_check_assign_symbol (sym, NULL, init) == FAILURE
- || gfc_add_flavor (&sym->attr, FL_PARAMETER, sym->name, NULL) == FAILURE)
+ if (!gfc_check_assign_symbol (sym, NULL, init)
+ || !gfc_add_flavor (&sym->attr, FL_PARAMETER, sym->name, NULL))
{
m = MATCH_ERROR;
goto cleanup;
@@ -6975,7 +6941,7 @@ do_parm (void)
}
t = add_init_expr_to_sym (sym->name, &init, &gfc_current_locus);
- return (t == SUCCESS) ? MATCH_YES : MATCH_ERROR;
+ return (t) ? MATCH_YES : MATCH_ERROR;
cleanup:
gfc_free_expr (init);
@@ -7028,9 +6994,8 @@ gfc_match_save (void)
{
if (gfc_current_ns->seen_save)
{
- if (gfc_notify_std (GFC_STD_LEGACY, "Blanket SAVE statement at %C "
- "follows previous SAVE statement")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_LEGACY, "Blanket SAVE statement at %C "
+ "follows previous SAVE statement"))
return MATCH_ERROR;
}
@@ -7040,9 +7005,8 @@ gfc_match_save (void)
if (gfc_current_ns->save_all)
{
- if (gfc_notify_std (GFC_STD_LEGACY, "SAVE statement at %C follows "
- "blanket SAVE statement")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_LEGACY, "SAVE statement at %C follows "
+ "blanket SAVE statement"))
return MATCH_ERROR;
}
@@ -7054,8 +7018,8 @@ gfc_match_save (void)
switch (m)
{
case MATCH_YES:
- if (gfc_add_save (&sym->attr, SAVE_EXPLICIT, sym->name,
- &gfc_current_locus) == FAILURE)
+ if (!gfc_add_save (&sym->attr, SAVE_EXPLICIT, sym->name,
+ &gfc_current_locus))
return MATCH_ERROR;
goto next_item;
@@ -7105,8 +7069,7 @@ gfc_match_value (void)
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F2003, "VALUE statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "VALUE statement at %C"))
return MATCH_ERROR;
if (gfc_match (" ::") == MATCH_NO && gfc_match_space () == MATCH_NO)
@@ -7123,8 +7086,7 @@ gfc_match_value (void)
switch (m)
{
case MATCH_YES:
- if (gfc_add_value (&sym->attr, sym->name, &gfc_current_locus)
- == FAILURE)
+ if (!gfc_add_value (&sym->attr, sym->name, &gfc_current_locus))
return MATCH_ERROR;
goto next_item;
@@ -7156,8 +7118,7 @@ gfc_match_volatile (void)
gfc_symbol *sym;
match m;
- if (gfc_notify_std (GFC_STD_F2003, "VOLATILE statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "VOLATILE statement at %C"))
return MATCH_ERROR;
if (gfc_match (" ::") == MATCH_NO && gfc_match_space () == MATCH_NO)
@@ -7184,8 +7145,7 @@ gfc_match_volatile (void)
"%C, which is use-/host-associated", sym->name);
return MATCH_ERROR;
}
- if (gfc_add_volatile (&sym->attr, sym->name, &gfc_current_locus)
- == FAILURE)
+ if (!gfc_add_volatile (&sym->attr, sym->name, &gfc_current_locus))
return MATCH_ERROR;
goto next_item;
@@ -7217,8 +7177,7 @@ gfc_match_asynchronous (void)
gfc_symbol *sym;
match m;
- if (gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS statement at %C"))
return MATCH_ERROR;
if (gfc_match (" ::") == MATCH_NO && gfc_match_space () == MATCH_NO)
@@ -7237,8 +7196,7 @@ gfc_match_asynchronous (void)
switch (m)
{
case MATCH_YES:
- if (gfc_add_asynchronous (&sym->attr, sym->name, &gfc_current_locus)
- == FAILURE)
+ if (!gfc_add_asynchronous (&sym->attr, sym->name, &gfc_current_locus))
return MATCH_ERROR;
goto next_item;
@@ -7308,9 +7266,8 @@ gfc_match_modproc (void)
old_locus = gfc_current_locus;
if (gfc_match ("::") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2008, "double colon in "
- "MODULE PROCEDURE statement at %L", &old_locus)
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "double colon in "
+ "MODULE PROCEDURE statement at %L", &old_locus))
return MATCH_ERROR;
}
else
@@ -7348,11 +7305,10 @@ gfc_match_modproc (void)
}
if (sym->attr.proc != PROC_MODULE
- && gfc_add_procedure (&sym->attr, PROC_MODULE,
- sym->name, NULL) == FAILURE)
+ && !gfc_add_procedure (&sym->attr, PROC_MODULE, sym->name, NULL))
return MATCH_ERROR;
- if (gfc_add_interface (sym) == FAILURE)
+ if (!gfc_add_interface (sym))
return MATCH_ERROR;
sym->attr.mod_proc = 1;
@@ -7447,7 +7403,7 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
return MATCH_ERROR;
}
- if (gfc_add_access (attr, ACCESS_PRIVATE, NULL, NULL) == FAILURE)
+ if (!gfc_add_access (attr, ACCESS_PRIVATE, NULL, NULL))
return MATCH_ERROR;
}
else if (gfc_match (" , public") == MATCH_YES)
@@ -7459,7 +7415,7 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
return MATCH_ERROR;
}
- if (gfc_add_access (attr, ACCESS_PUBLIC, NULL, NULL) == FAILURE)
+ if (!gfc_add_access (attr, ACCESS_PUBLIC, NULL, NULL))
return MATCH_ERROR;
}
else if (gfc_match (" , bind ( c )") == MATCH_YES)
@@ -7468,23 +7424,22 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
sure that all fields are interoperable. This will
need to be a semantic check on the finished derived type.
See 15.2.3 (lines 9-12) of F2003 draft. */
- if (gfc_add_is_bind_c (attr, NULL, &gfc_current_locus, 0) != SUCCESS)
+ if (!gfc_add_is_bind_c (attr, NULL, &gfc_current_locus, 0))
return MATCH_ERROR;
/* TODO: attr conflicts need to be checked, probably in symbol.c. */
}
else if (gfc_match (" , abstract") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "ABSTRACT type at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ABSTRACT type at %C"))
return MATCH_ERROR;
- if (gfc_add_abstract (attr, &gfc_current_locus) == FAILURE)
+ if (!gfc_add_abstract (attr, &gfc_current_locus))
return MATCH_ERROR;
}
- else if (name && gfc_match(" , extends ( %n )", name) == MATCH_YES)
+ else if (name && gfc_match (" , extends ( %n )", name) == MATCH_YES)
{
- if (gfc_add_extension (attr, &gfc_current_locus) == FAILURE)
+ if (!gfc_add_extension (attr, &gfc_current_locus))
return MATCH_ERROR;
}
else
@@ -7567,11 +7522,11 @@ gfc_match_derived_decl (void)
}
if (!gensym->attr.generic
- && gfc_add_generic (&gensym->attr, gensym->name, NULL) == FAILURE)
+ && !gfc_add_generic (&gensym->attr, gensym->name, NULL))
return MATCH_ERROR;
if (!gensym->attr.function
- && gfc_add_function (&gensym->attr, gensym->name, NULL) == FAILURE)
+ && !gfc_add_function (&gensym->attr, gensym->name, NULL))
return MATCH_ERROR;
sym = gfc_find_dt_in_generic (gensym);
@@ -7606,16 +7561,16 @@ gfc_match_derived_decl (void)
derived type that is a pointer. The first part of the AND clause
is true if the symbol is not the return value of a function. */
if (sym->attr.flavor != FL_DERIVED
- && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL))
return MATCH_ERROR;
if (attr.access != ACCESS_UNKNOWN
- && gfc_add_access (&sym->attr, attr.access, sym->name, NULL) == FAILURE)
+ && !gfc_add_access (&sym->attr, attr.access, sym->name, NULL))
return MATCH_ERROR;
else if (sym->attr.access == ACCESS_UNKNOWN
&& gensym->attr.access != ACCESS_UNKNOWN
- && gfc_add_access (&sym->attr, gensym->attr.access, sym->name, NULL)
- == FAILURE)
+ && !gfc_add_access (&sym->attr, gensym->attr.access,
+ sym->name, NULL))
return MATCH_ERROR;
if (sym->attr.access != ACCESS_UNKNOWN
@@ -7706,8 +7661,7 @@ gfc_match_enum (void)
if (m != MATCH_YES)
return m;
- if (gfc_notify_std (GFC_STD_F2003, "ENUM and ENUMERATOR at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ENUM and ENUMERATOR at %C"))
return MATCH_ERROR;
return MATCH_YES;
@@ -7768,7 +7722,7 @@ enumerator_decl (void)
gfc_symbol *sym;
locus var_locus;
match m;
- gfc_try t;
+ bool t;
locus old_locus;
initializer = NULL;
@@ -7786,7 +7740,7 @@ enumerator_decl (void)
/* OK, we've successfully matched the declaration. Now put the
symbol in the current namespace. If we fail to create the symbol,
bail out. */
- if (build_sym (name, NULL, false, &as, &var_locus) == FAILURE)
+ if (!build_sym (name, NULL, false, &as, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
@@ -7834,7 +7788,7 @@ enumerator_decl (void)
gfc_find_symbol (name, NULL, 0, &sym);
create_enum_history (sym, last_initializer);
- return (t == SUCCESS) ? MATCH_YES : MATCH_ERROR;
+ return (t) ? MATCH_YES : MATCH_ERROR;
cleanup:
/* Free stuff up and return. */
@@ -7850,7 +7804,7 @@ match
gfc_match_enumerator_def (void)
{
match m;
- gfc_try t;
+ bool t;
gfc_clear_ts (&current_ts);
@@ -7876,7 +7830,7 @@ gfc_match_enumerator_def (void)
gfc_clear_attr (&current_attr);
t = gfc_add_flavor (&current_attr, FL_PARAMETER, NULL, NULL);
- if (t == FAILURE)
+ if (!t)
{
m = MATCH_ERROR;
goto cleanup;
@@ -8200,8 +8154,7 @@ match_procedure_in_type (void)
return MATCH_ERROR;
}
- if (num>1 && gfc_notify_std (GFC_STD_F2008, "PROCEDURE list"
- " at %C") == FAILURE)
+ if (num>1 && !gfc_notify_std (GFC_STD_F2008, "PROCEDURE list at %C"))
return MATCH_ERROR;
/* Try to match the '=> target', if it's there. */
@@ -8588,8 +8541,7 @@ gfc_match_final_decl (void)
/* Mark the symbol as module procedure. */
if (sym->attr.proc != PROC_MODULE
- && gfc_add_procedure (&sym->attr, PROC_MODULE,
- sym->name, NULL) == FAILURE)
+ && !gfc_add_procedure (&sym->attr, PROC_MODULE, sym->name, NULL))
return MATCH_ERROR;
/* Check if we already have this symbol in the list, this is an error. */
@@ -8669,8 +8621,7 @@ gfc_match_gcc_attributes (void)
return MATCH_ERROR;
}
- if (gfc_add_ext_attribute (&attr, (ext_attr_id_t) id, &gfc_current_locus)
- == FAILURE)
+ if (!gfc_add_ext_attribute (&attr, (ext_attr_id_t)id, &gfc_current_locus))
return MATCH_ERROR;
gfc_gobble_whitespace ();
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index 062b1c5837a..38921b1993f 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -756,7 +756,7 @@ gfc_dep_difference (gfc_expr *e1, gfc_expr *e2, mpz_t *result)
}
}
- if (gfc_dep_compare_expr(e1, e2) == 0)
+ if (gfc_dep_compare_expr (e1, e2) == 0)
{
/* Case 18: X - X = 0. */
mpz_set_si (*result, 0);
@@ -1200,7 +1200,7 @@ check_data_pointer_types (gfc_expr *expr1, gfc_expr *expr2)
bool seen_component_ref;
if (expr1->expr_type != EXPR_VARIABLE
- || expr1->expr_type != EXPR_VARIABLE)
+ || expr2->expr_type != EXPR_VARIABLE)
return false;
sym1 = expr1->symtree->n.sym;
@@ -1548,7 +1548,7 @@ check_section_vs_section (gfc_array_ref *l_ar, gfc_array_ref *r_ar, int n)
#define IS_CONSTANT_INTEGER(a) ((a) && ((a)->expr_type == EXPR_CONSTANT) \
&& (a)->ts.type == BT_INTEGER)
- if (IS_CONSTANT_INTEGER(l_stride) && IS_CONSTANT_INTEGER(r_stride)
+ if (IS_CONSTANT_INTEGER (l_stride) && IS_CONSTANT_INTEGER (r_stride)
&& gfc_dep_difference (l_start, r_start, &tmp))
{
mpz_t gcd;
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index c47e655e242..60b209354c5 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -806,10 +806,10 @@ gfc_notification_std (int std)
/* Possibly issue a warning/error about use of a nonstandard (or deleted)
feature. An error/warning will be issued if the currently selected
- standard does not contain the requested bits. Return FAILURE if
+ standard does not contain the requested bits. Return false if
an error is generated. */
-gfc_try
+bool
gfc_notify_std (int std, const char *gmsgid, ...)
{
va_list argp;
@@ -819,10 +819,10 @@ gfc_notify_std (int std, const char *gmsgid, ...)
warning = ((gfc_option.warn_std & std) != 0) && !inhibit_warnings;
if ((gfc_option.allow_std & std) != 0 && !warning)
- return SUCCESS;
+ return true;
if (suppress_errors)
- return warning ? SUCCESS : FAILURE;
+ return warning ? true : false;
cur_error_buffer = warning ? &warning_buffer : &error_buffer;
cur_error_buffer->flag = 1;
@@ -883,7 +883,7 @@ gfc_notify_std (int std, const char *gmsgid, ...)
cur_error_buffer->flag = 0;
}
- return (warning && !warnings_are_errors) ? SUCCESS : FAILURE;
+ return (warning && !warnings_are_errors) ? true : false;
}
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 8deb4ebf05d..e4bcc794bd5 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -610,7 +610,7 @@ gfc_replace_expr (gfc_expr *dest, gfc_expr *src)
/* Try to extract an integer constant from the passed expression node.
Returns an error message or NULL if the result is set. It is
- tempting to generate an error and return SUCCESS or FAILURE, but
+ tempting to generate an error and return true or false, but
failure is OK for some callers. */
const char *
@@ -1005,27 +1005,27 @@ is_subref_array (gfc_expr * e)
/* Try to collapse intrinsic expressions. */
-static gfc_try
+static bool
simplify_intrinsic_op (gfc_expr *p, int type)
{
gfc_intrinsic_op op;
gfc_expr *op1, *op2, *result;
if (p->value.op.op == INTRINSIC_USER)
- return SUCCESS;
+ return true;
op1 = p->value.op.op1;
op2 = p->value.op.op2;
op = p->value.op.op;
- if (gfc_simplify_expr (op1, type) == FAILURE)
- return FAILURE;
- if (gfc_simplify_expr (op2, type) == FAILURE)
- return FAILURE;
+ if (!gfc_simplify_expr (op1, type))
+ return false;
+ if (!gfc_simplify_expr (op2, type))
+ return false;
if (!gfc_is_constant_expr (op1)
|| (op2 != NULL && !gfc_is_constant_expr (op2)))
- return SUCCESS;
+ return true;
/* Rip p apart. */
p->value.op.op1 = NULL;
@@ -1127,21 +1127,21 @@ simplify_intrinsic_op (gfc_expr *p, int type)
{
gfc_free_expr (op1);
gfc_free_expr (op2);
- return FAILURE;
+ return false;
}
result->rank = p->rank;
result->where = p->where;
gfc_replace_expr (p, result);
- return SUCCESS;
+ return true;
}
/* Subroutine to simplify constructor expressions. Mutually recursive
with gfc_simplify_expr(). */
-static gfc_try
+static bool
simplify_constructor (gfc_constructor_base base, int type)
{
gfc_constructor *c;
@@ -1150,10 +1150,10 @@ simplify_constructor (gfc_constructor_base base, int type)
for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c))
{
if (c->iterator
- && (gfc_simplify_expr (c->iterator->start, type) == FAILURE
- || gfc_simplify_expr (c->iterator->end, type) == FAILURE
- || gfc_simplify_expr (c->iterator->step, type) == FAILURE))
- return FAILURE;
+ && (!gfc_simplify_expr(c->iterator->start, type)
+ || !gfc_simplify_expr (c->iterator->end, type)
+ || !gfc_simplify_expr (c->iterator->step, type)))
+ return false;
if (c->expr)
{
@@ -1162,7 +1162,7 @@ simplify_constructor (gfc_constructor_base base, int type)
doing so can make a dog's dinner of complicated things. */
p = gfc_copy_expr (c->expr);
- if (gfc_simplify_expr (p, type) == FAILURE)
+ if (!gfc_simplify_expr (p, type))
{
gfc_free_expr (p);
continue;
@@ -1172,13 +1172,13 @@ simplify_constructor (gfc_constructor_base base, int type)
}
}
- return SUCCESS;
+ return true;
}
/* Pull a single array element out of an array constructor. */
-static gfc_try
+static bool
find_array_element (gfc_constructor_base base, gfc_array_ref *ar,
gfc_constructor **rval)
{
@@ -1190,9 +1190,9 @@ find_array_element (gfc_constructor_base base, gfc_array_ref *ar,
mpz_t tmp;
gfc_constructor *cons;
gfc_expr *e;
- gfc_try t;
+ bool t;
- t = SUCCESS;
+ t = true;
e = NULL;
mpz_init_set_ui (offset, 0);
@@ -1201,10 +1201,10 @@ find_array_element (gfc_constructor_base base, gfc_array_ref *ar,
mpz_init_set_ui (span, 1);
for (i = 0; i < ar->dimen; i++)
{
- if (gfc_reduce_init_expr (ar->as->lower[i]) == FAILURE
- || gfc_reduce_init_expr (ar->as->upper[i]) == FAILURE)
+ if (!gfc_reduce_init_expr (ar->as->lower[i])
+ || !gfc_reduce_init_expr (ar->as->upper[i]))
{
- t = FAILURE;
+ t = false;
cons = NULL;
goto depart;
}
@@ -1229,7 +1229,7 @@ find_array_element (gfc_constructor_base base, gfc_array_ref *ar,
gfc_error ("Index in dimension %d is out of bounds "
"at %L", i + 1, &ar->c_where[i]);
cons = NULL;
- t = FAILURE;
+ t = false;
goto depart;
}
@@ -1309,7 +1309,7 @@ remove_subobject_ref (gfc_expr *p, gfc_constructor *cons)
/* Pull an array section out of an array constructor. */
-static gfc_try
+static bool
find_array_section (gfc_expr *expr, gfc_ref *ref)
{
int idx;
@@ -1335,9 +1335,9 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
gfc_expr *step;
gfc_expr *upper;
gfc_expr *lower;
- gfc_try t;
+ bool t;
- t = SUCCESS;
+ t = true;
base = expr->value.constructor;
expr->value.constructor = NULL;
@@ -1381,7 +1381,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
if (begin->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (begin))
{
- t = FAILURE;
+ t = false;
goto cleanup;
}
@@ -1407,7 +1407,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
{
gfc_error ("index in dimension %d is out of bounds "
"at %L", d + 1, &ref->u.ar.c_where[d]);
- t = FAILURE;
+ t = false;
goto cleanup;
}
}
@@ -1418,7 +1418,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
|| (finish && finish->expr_type != EXPR_CONSTANT)
|| (step && step->expr_type != EXPR_CONSTANT))
{
- t = FAILURE;
+ t = false;
goto cleanup;
}
@@ -1458,7 +1458,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
{
gfc_error ("index in dimension %d is out of bounds "
"at %L", d + 1, &ref->u.ar.c_where[d]);
- t = FAILURE;
+ t = false;
goto cleanup;
}
@@ -1537,7 +1537,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
"upper limit. See -fmax-array-constructor "
"option", &expr->where,
gfc_option.flag_max_array_constructor);
- return FAILURE;
+ return false;
}
cons = gfc_constructor_lookup (base, limit);
@@ -1567,7 +1567,7 @@ cleanup:
/* Pull a substring out of an expression. */
-static gfc_try
+static bool
find_substring_ref (gfc_expr *p, gfc_expr **newp)
{
int end;
@@ -1577,7 +1577,7 @@ find_substring_ref (gfc_expr *p, gfc_expr **newp)
if (p->ref->u.ss.start->expr_type != EXPR_CONSTANT
|| p->ref->u.ss.end->expr_type != EXPR_CONSTANT)
- return FAILURE;
+ return false;
*newp = gfc_copy_expr (p);
free ((*newp)->value.character.string);
@@ -1591,7 +1591,7 @@ find_substring_ref (gfc_expr *p, gfc_expr **newp)
memcpy (chr, &p->value.character.string[start - 1],
length * sizeof (gfc_char_t));
chr[length] = '\0';
- return SUCCESS;
+ return true;
}
@@ -1599,7 +1599,7 @@ find_substring_ref (gfc_expr *p, gfc_expr **newp)
/* Simplify a subobject reference of a constructor. This occurs when
parameter variable values are substituted. */
-static gfc_try
+static bool
simplify_const_ref (gfc_expr *p)
{
gfc_constructor *cons, *c;
@@ -1621,19 +1621,18 @@ simplify_const_ref (gfc_expr *p)
remove_subobject_ref (p, NULL);
break;
}
- if (find_array_element (p->value.constructor, &p->ref->u.ar,
- &cons) == FAILURE)
- return FAILURE;
+ if (!find_array_element (p->value.constructor, &p->ref->u.ar, &cons))
+ return false;
if (!cons)
- return SUCCESS;
+ return true;
remove_subobject_ref (p, cons);
break;
case AR_SECTION:
- if (find_array_section (p, p->ref) == FAILURE)
- return FAILURE;
+ if (!find_array_section (p, p->ref))
+ return false;
p->ref->u.ar.type = AR_FULL;
/* Fall through. */
@@ -1646,8 +1645,8 @@ simplify_const_ref (gfc_expr *p)
c; c = gfc_constructor_next (c))
{
c->expr->ref = gfc_copy_ref (p->ref->next);
- if (simplify_const_ref (c->expr) == FAILURE)
- return FAILURE;
+ if (!simplify_const_ref (c->expr))
+ return false;
}
if (p->ts.type == BT_DERIVED
@@ -1695,7 +1694,7 @@ simplify_const_ref (gfc_expr *p)
break;
default:
- return SUCCESS;
+ return true;
}
break;
@@ -1706,8 +1705,8 @@ simplify_const_ref (gfc_expr *p)
break;
case REF_SUBSTRING:
- if (find_substring_ref (p, &newp) == FAILURE)
- return FAILURE;
+ if (!find_substring_ref (p, &newp))
+ return false;
gfc_replace_expr (p, newp);
gfc_free_ref_list (p->ref);
@@ -1716,13 +1715,13 @@ simplify_const_ref (gfc_expr *p)
}
}
- return SUCCESS;
+ return true;
}
/* Simplify a chain of references. */
-static gfc_try
+static bool
simplify_ref_chain (gfc_ref *ref, int type)
{
int n;
@@ -1734,41 +1733,41 @@ simplify_ref_chain (gfc_ref *ref, int type)
case REF_ARRAY:
for (n = 0; n < ref->u.ar.dimen; n++)
{
- if (gfc_simplify_expr (ref->u.ar.start[n], type) == FAILURE)
- return FAILURE;
- if (gfc_simplify_expr (ref->u.ar.end[n], type) == FAILURE)
- return FAILURE;
- if (gfc_simplify_expr (ref->u.ar.stride[n], type) == FAILURE)
- return FAILURE;
+ if (!gfc_simplify_expr (ref->u.ar.start[n], type))
+ return false;
+ if (!gfc_simplify_expr (ref->u.ar.end[n], type))
+ return false;
+ if (!gfc_simplify_expr (ref->u.ar.stride[n], type))
+ return false;
}
break;
case REF_SUBSTRING:
- if (gfc_simplify_expr (ref->u.ss.start, type) == FAILURE)
- return FAILURE;
- if (gfc_simplify_expr (ref->u.ss.end, type) == FAILURE)
- return FAILURE;
+ if (!gfc_simplify_expr (ref->u.ss.start, type))
+ return false;
+ if (!gfc_simplify_expr (ref->u.ss.end, type))
+ return false;
break;
default:
break;
}
}
- return SUCCESS;
+ return true;
}
/* Try to substitute the value of a parameter variable. */
-static gfc_try
+static bool
simplify_parameter_variable (gfc_expr *p, int type)
{
gfc_expr *e;
- gfc_try t;
+ bool t;
e = gfc_copy_expr (p->symtree->n.sym->value);
if (e == NULL)
- return FAILURE;
+ return false;
e->rank = p->rank;
@@ -1778,7 +1777,7 @@ simplify_parameter_variable (gfc_expr *p, int type)
t = gfc_simplify_expr (e, type);
/* Only use the simplification if it eliminated all subobject references. */
- if (t == SUCCESS && !e->ref)
+ if (t && !e->ref)
gfc_replace_expr (p, e);
else
gfc_free_expr (e);
@@ -1802,16 +1801,16 @@ simplify_parameter_variable (gfc_expr *p, int type)
0 Basic expression parsing
1 Simplifying array constructors -- will substitute
iterator values.
- Returns FAILURE on error, SUCCESS otherwise.
- NOTE: Will return SUCCESS even if the expression can not be simplified. */
+ Returns false on error, true otherwise.
+ NOTE: Will return true even if the expression can not be simplified. */
-gfc_try
+bool
gfc_simplify_expr (gfc_expr *p, int type)
{
gfc_actual_arglist *ap;
if (p == NULL)
- return SUCCESS;
+ return true;
switch (p->expr_type)
{
@@ -1821,18 +1820,18 @@ gfc_simplify_expr (gfc_expr *p, int type)
case EXPR_FUNCTION:
for (ap = p->value.function.actual; ap; ap = ap->next)
- if (gfc_simplify_expr (ap->expr, type) == FAILURE)
- return FAILURE;
+ if (!gfc_simplify_expr (ap->expr, type))
+ return false;
if (p->value.function.isym != NULL
&& gfc_intrinsic_func_interface (p, 1) == MATCH_ERROR)
- return FAILURE;
+ return false;
break;
case EXPR_SUBSTRING:
- if (simplify_ref_chain (p->ref, type) == FAILURE)
- return FAILURE;
+ if (!simplify_ref_chain (p->ref, type))
+ return false;
if (gfc_is_constant_expr (p))
{
@@ -1871,8 +1870,8 @@ gfc_simplify_expr (gfc_expr *p, int type)
break;
case EXPR_OP:
- if (simplify_intrinsic_op (p, type) == FAILURE)
- return FAILURE;
+ if (!simplify_intrinsic_op (p, type))
+ return false;
break;
case EXPR_VARIABLE:
@@ -1882,8 +1881,8 @@ gfc_simplify_expr (gfc_expr *p, int type)
&& (gfc_init_expr_flag || p->ref
|| p->symtree->n.sym->value->expr_type != EXPR_ARRAY))
{
- if (simplify_parameter_variable (p, type) == FAILURE)
- return FAILURE;
+ if (!simplify_parameter_variable (p, type))
+ return false;
break;
}
@@ -1893,35 +1892,34 @@ gfc_simplify_expr (gfc_expr *p, int type)
}
/* Simplify subcomponent references. */
- if (simplify_ref_chain (p->ref, type) == FAILURE)
- return FAILURE;
+ if (!simplify_ref_chain (p->ref, type))
+ return false;
break;
case EXPR_STRUCTURE:
case EXPR_ARRAY:
- if (simplify_ref_chain (p->ref, type) == FAILURE)
- return FAILURE;
+ if (!simplify_ref_chain (p->ref, type))
+ return false;
- if (simplify_constructor (p->value.constructor, type) == FAILURE)
- return FAILURE;
+ if (!simplify_constructor (p->value.constructor, type))
+ return false;
if (p->expr_type == EXPR_ARRAY && p->ref && p->ref->type == REF_ARRAY
&& p->ref->u.ar.type == AR_FULL)
gfc_expand_constructor (p, false);
- if (simplify_const_ref (p) == FAILURE)
- return FAILURE;
+ if (!simplify_const_ref (p))
+ return false;
break;
case EXPR_COMPCALL:
case EXPR_PPC:
- gcc_unreachable ();
break;
}
- return SUCCESS;
+ return true;
}
@@ -1932,7 +1930,7 @@ gfc_simplify_expr (gfc_expr *p, int type)
static bt
et0 (gfc_expr *e)
{
- if (e->expr_type == EXPR_VARIABLE && gfc_check_iter_variable (e) == SUCCESS)
+ if (e->expr_type == EXPR_VARIABLE && gfc_check_iter_variable (e))
return BT_INTEGER;
return e->ts.type;
@@ -1941,7 +1939,7 @@ et0 (gfc_expr *e)
/* Scalarize an expression for an elemental intrinsic call. */
-static gfc_try
+static bool
scalarize_intrinsic_call (gfc_expr *e)
{
gfc_actual_arglist *a, *b;
@@ -1967,7 +1965,7 @@ scalarize_intrinsic_call (gfc_expr *e)
}
if (!array_arg)
- return FAILURE;
+ return false;
old = gfc_copy_expr (e);
@@ -1984,7 +1982,7 @@ scalarize_intrinsic_call (gfc_expr *e)
for (; a; a = a->next)
{
/* Check that this is OK for an initialization expression. */
- if (a->expr && gfc_check_init_expr (a->expr) == FAILURE)
+ if (a->expr && !gfc_check_init_expr (a->expr))
goto cleanup;
rank[n] = 0;
@@ -2060,7 +2058,7 @@ scalarize_intrinsic_call (gfc_expr *e)
/* Free "expr" but not the pointers it contains. */
free (expr);
gfc_free_expr (old);
- return SUCCESS;
+ return true;
compliance:
gfc_error_now ("elemental function arguments at %C are not compliant");
@@ -2068,18 +2066,18 @@ compliance:
cleanup:
gfc_free_expr (expr);
gfc_free_expr (old);
- return FAILURE;
+ return false;
}
-static gfc_try
-check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
+static bool
+check_intrinsic_op (gfc_expr *e, bool (*check_function) (gfc_expr *))
{
gfc_expr *op1 = e->value.op.op1;
gfc_expr *op2 = e->value.op.op2;
- if ((*check_function) (op1) == FAILURE)
- return FAILURE;
+ if (!(*check_function)(op1))
+ return false;
switch (e->value.op.op)
{
@@ -2101,15 +2099,15 @@ check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
case INTRINSIC_LT_OS:
case INTRINSIC_LE:
case INTRINSIC_LE_OS:
- if ((*check_function) (op2) == FAILURE)
- return FAILURE;
+ if (!(*check_function)(op2))
+ return false;
if (!(et0 (op1) == BT_CHARACTER && et0 (op2) == BT_CHARACTER)
&& !(numeric_type (et0 (op1)) && numeric_type (et0 (op2))))
{
gfc_error ("Numeric or CHARACTER operands are required in "
"expression at %L", &e->where);
- return FAILURE;
+ return false;
}
break;
@@ -2118,8 +2116,8 @@ check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
case INTRINSIC_TIMES:
case INTRINSIC_DIVIDE:
case INTRINSIC_POWER:
- if ((*check_function) (op2) == FAILURE)
- return FAILURE;
+ if (!(*check_function)(op2))
+ return false;
if (!numeric_type (et0 (op1)) || !numeric_type (et0 (op2)))
goto not_numeric;
@@ -2127,21 +2125,21 @@ check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
break;
case INTRINSIC_CONCAT:
- if ((*check_function) (op2) == FAILURE)
- return FAILURE;
+ if (!(*check_function)(op2))
+ return false;
if (et0 (op1) != BT_CHARACTER || et0 (op2) != BT_CHARACTER)
{
gfc_error ("Concatenation operator in expression at %L "
"must have two CHARACTER operands", &op1->where);
- return FAILURE;
+ return false;
}
if (op1->ts.kind != op2->ts.kind)
{
gfc_error ("Concat operator at %L must concatenate strings of the "
"same kind", &e->where);
- return FAILURE;
+ return false;
}
break;
@@ -2151,7 +2149,7 @@ check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
{
gfc_error (".NOT. operator in expression at %L must have a LOGICAL "
"operand", &op1->where);
- return FAILURE;
+ return false;
}
break;
@@ -2160,14 +2158,14 @@ check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
case INTRINSIC_OR:
case INTRINSIC_EQV:
case INTRINSIC_NEQV:
- if ((*check_function) (op2) == FAILURE)
- return FAILURE;
+ if (!(*check_function)(op2))
+ return false;
if (et0 (op1) != BT_LOGICAL || et0 (op2) != BT_LOGICAL)
{
gfc_error ("LOGICAL operands are required in expression at %L",
&e->where);
- return FAILURE;
+ return false;
}
break;
@@ -2178,20 +2176,20 @@ check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
default:
gfc_error ("Only intrinsic operators can be used in expression at %L",
&e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
not_numeric:
gfc_error ("Numeric operands are required in expression at %L", &e->where);
- return FAILURE;
+ return false;
}
/* F2003, 7.1.7 (3): In init expression, allocatable components
must not be data-initialized. */
-static gfc_try
+static bool
check_alloc_comp_init (gfc_expr *e)
{
gfc_component *comp;
@@ -2210,11 +2208,11 @@ check_alloc_comp_init (gfc_expr *e)
gfc_error("Invalid initialization expression for ALLOCATABLE "
"component '%s' in structure constructor at %L",
comp->name, &ctor->expr->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
static match
@@ -2223,13 +2221,13 @@ check_init_expr_arguments (gfc_expr *e)
gfc_actual_arglist *ap;
for (ap = e->value.function.actual; ap; ap = ap->next)
- if (gfc_check_init_expr (ap->expr) == FAILURE)
+ if (!gfc_check_init_expr (ap->expr))
return MATCH_ERROR;
return MATCH_YES;
}
-static gfc_try check_restricted (gfc_expr *);
+static bool check_restricted (gfc_expr *);
/* F95, 7.1.6.1, Initialization expressions, (7)
F2003, 7.1.7 Initialization expression, (8) */
@@ -2305,8 +2303,7 @@ check_inquiry (gfc_expr *e, int not_restricted)
if (ap->expr->ts.type == BT_UNKNOWN)
{
if (ap->expr->symtree->n.sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (ap->expr->symtree->n.sym, 0, gfc_current_ns)
- == FAILURE)
+ && !gfc_set_default_type (ap->expr->symtree->n.sym, 0, gfc_current_ns))
return MATCH_NO;
ap->expr->ts = ap->expr->symtree->n.sym->ts;
@@ -2325,12 +2322,12 @@ check_inquiry (gfc_expr *e, int not_restricted)
&ap->expr->where);
return MATCH_ERROR;
}
- else if (not_restricted && gfc_check_init_expr (ap->expr) == FAILURE)
+ else if (not_restricted && !gfc_check_init_expr (ap->expr))
return MATCH_ERROR;
if (not_restricted == 0
&& ap->expr->expr_type != EXPR_VARIABLE
- && check_restricted (ap->expr) == FAILURE)
+ && !check_restricted (ap->expr))
return MATCH_ERROR;
if (not_restricted == 0
@@ -2416,9 +2413,8 @@ check_elemental (gfc_expr *e)
if (e->ts.type != BT_INTEGER
&& e->ts.type != BT_CHARACTER
- && gfc_notify_std (GFC_STD_F2003, "Evaluation of "
- "nonstandard initialization expression at %L",
- &e->where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "Evaluation of nonstandard "
+ "initialization expression at %L", &e->where))
return MATCH_ERROR;
return check_init_expr_arguments (e);
@@ -2441,28 +2437,28 @@ check_conversion (gfc_expr *e)
node if all goes well. This would normally happen when the
expression is constructed but function references are assumed to be
intrinsics in the context of initialization expressions. If
- FAILURE is returned an error message has been generated. */
+ false is returned an error message has been generated. */
-gfc_try
+bool
gfc_check_init_expr (gfc_expr *e)
{
match m;
- gfc_try t;
+ bool t;
if (e == NULL)
- return SUCCESS;
+ return true;
switch (e->expr_type)
{
case EXPR_OP:
t = check_intrinsic_op (e, gfc_check_init_expr);
- if (t == SUCCESS)
+ if (t)
t = gfc_simplify_expr (e, 0);
break;
case EXPR_FUNCTION:
- t = FAILURE;
+ t = false;
{
gfc_intrinsic_sym* isym;
@@ -2491,13 +2487,13 @@ gfc_check_init_expr (gfc_expr *e)
}
if (m == MATCH_ERROR)
- return FAILURE;
+ return false;
/* Try to scalarize an elemental intrinsic function that has an
array argument. */
isym = gfc_find_function (e->symtree->n.sym->name);
if (isym && isym->elemental
- && (t = scalarize_intrinsic_call (e)) == SUCCESS)
+ && (t = scalarize_intrinsic_call(e)))
break;
}
@@ -2507,9 +2503,9 @@ gfc_check_init_expr (gfc_expr *e)
break;
case EXPR_VARIABLE:
- t = SUCCESS;
+ t = true;
- if (gfc_check_iter_variable (e) == SUCCESS)
+ if (gfc_check_iter_variable (e))
break;
if (e->symtree->n.sym->attr.flavor == FL_PARAMETER)
@@ -2521,7 +2517,7 @@ gfc_check_init_expr (gfc_expr *e)
{
gfc_error("PARAMETER '%s' is used at %L before its definition "
"is complete", e->symtree->n.sym->name, &e->where);
- t = FAILURE;
+ t = false;
}
else
t = simplify_parameter_variable (e, 0);
@@ -2532,7 +2528,7 @@ gfc_check_init_expr (gfc_expr *e)
if (gfc_in_match_data ())
break;
- t = FAILURE;
+ t = false;
if (e->symtree->n.sym->as)
{
@@ -2575,42 +2571,42 @@ gfc_check_init_expr (gfc_expr *e)
case EXPR_CONSTANT:
case EXPR_NULL:
- t = SUCCESS;
+ t = true;
break;
case EXPR_SUBSTRING:
t = gfc_check_init_expr (e->ref->u.ss.start);
- if (t == FAILURE)
+ if (!t)
break;
t = gfc_check_init_expr (e->ref->u.ss.end);
- if (t == SUCCESS)
+ if (t)
t = gfc_simplify_expr (e, 0);
break;
case EXPR_STRUCTURE:
- t = e->ts.is_iso_c ? SUCCESS : FAILURE;
- if (t == SUCCESS)
+ t = e->ts.is_iso_c ? true : false;
+ if (t)
break;
t = check_alloc_comp_init (e);
- if (t == FAILURE)
+ if (!t)
break;
t = gfc_check_constructor (e, gfc_check_init_expr);
- if (t == FAILURE)
+ if (!t)
break;
break;
case EXPR_ARRAY:
t = gfc_check_constructor (e, gfc_check_init_expr);
- if (t == FAILURE)
+ if (!t)
break;
t = gfc_expand_constructor (e, true);
- if (t == FAILURE)
+ if (!t)
break;
t = gfc_check_constructor_type (e);
@@ -2625,31 +2621,31 @@ gfc_check_init_expr (gfc_expr *e)
/* Reduces a general expression to an initialization expression (a constant).
This used to be part of gfc_match_init_expr.
- Note that this function doesn't free the given expression on FAILURE. */
+ Note that this function doesn't free the given expression on false. */
-gfc_try
+bool
gfc_reduce_init_expr (gfc_expr *expr)
{
- gfc_try t;
+ bool t;
gfc_init_expr_flag = true;
t = gfc_resolve_expr (expr);
- if (t == SUCCESS)
+ if (t)
t = gfc_check_init_expr (expr);
gfc_init_expr_flag = false;
- if (t == FAILURE)
- return FAILURE;
+ if (!t)
+ return false;
if (expr->expr_type == EXPR_ARRAY)
{
- if (gfc_check_constructor_type (expr) == FAILURE)
- return FAILURE;
- if (gfc_expand_constructor (expr, true) == FAILURE)
- return FAILURE;
+ if (!gfc_check_constructor_type (expr))
+ return false;
+ if (!gfc_expand_constructor (expr, true))
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -2661,7 +2657,7 @@ gfc_match_init_expr (gfc_expr **result)
{
gfc_expr *expr;
match m;
- gfc_try t;
+ bool t;
expr = NULL;
@@ -2675,7 +2671,7 @@ gfc_match_init_expr (gfc_expr **result)
}
t = gfc_reduce_init_expr (expr);
- if (t != SUCCESS)
+ if (!t)
{
gfc_free_expr (expr);
gfc_init_expr_flag = false;
@@ -2693,16 +2689,16 @@ gfc_match_init_expr (gfc_expr **result)
restricted expression and optionally if the expression type is
integer or character. */
-static gfc_try
+static bool
restricted_args (gfc_actual_arglist *a)
{
for (; a; a = a->next)
{
- if (check_restricted (a->expr) == FAILURE)
- return FAILURE;
+ if (!check_restricted (a->expr))
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -2711,7 +2707,7 @@ restricted_args (gfc_actual_arglist *a)
/* Make sure a non-intrinsic function is a specification function. */
-static gfc_try
+static bool
external_spec_function (gfc_expr *e)
{
gfc_symbol *f;
@@ -2722,28 +2718,28 @@ external_spec_function (gfc_expr *e)
{
gfc_error ("Specification function '%s' at %L cannot be a statement "
"function", f->name, &e->where);
- return FAILURE;
+ return false;
}
if (f->attr.proc == PROC_INTERNAL)
{
gfc_error ("Specification function '%s' at %L cannot be an internal "
"function", f->name, &e->where);
- return FAILURE;
+ return false;
}
if (!f->attr.pure && !f->attr.elemental)
{
gfc_error ("Specification function '%s' at %L must be PURE", f->name,
&e->where);
- return FAILURE;
+ return false;
}
if (f->attr.recursive)
{
gfc_error ("Specification function '%s' at %L cannot be RECURSIVE",
f->name, &e->where);
- return FAILURE;
+ return false;
}
return restricted_args (e->value.function.actual);
@@ -2753,12 +2749,12 @@ external_spec_function (gfc_expr *e)
/* Check to see that a function reference to an intrinsic is a
restricted expression. */
-static gfc_try
+static bool
restricted_intrinsic (gfc_expr *e)
{
/* TODO: Check constraints on inquiry functions. 7.1.6.2 (7). */
if (check_inquiry (e, 0) == MATCH_YES)
- return SUCCESS;
+ return true;
return restricted_args (e->value.function.actual);
}
@@ -2766,39 +2762,39 @@ restricted_intrinsic (gfc_expr *e)
/* Check the expressions of an actual arglist. Used by check_restricted. */
-static gfc_try
-check_arglist (gfc_actual_arglist* arg, gfc_try (*checker) (gfc_expr*))
+static bool
+check_arglist (gfc_actual_arglist* arg, bool (*checker) (gfc_expr*))
{
for (; arg; arg = arg->next)
- if (checker (arg->expr) == FAILURE)
- return FAILURE;
+ if (!checker (arg->expr))
+ return false;
- return SUCCESS;
+ return true;
}
/* Check the subscription expressions of a reference chain with a checking
function; used by check_restricted. */
-static gfc_try
-check_references (gfc_ref* ref, gfc_try (*checker) (gfc_expr*))
+static bool
+check_references (gfc_ref* ref, bool (*checker) (gfc_expr*))
{
int dim;
if (!ref)
- return SUCCESS;
+ return true;
switch (ref->type)
{
case REF_ARRAY:
for (dim = 0; dim != ref->u.ar.dimen; ++dim)
{
- if (checker (ref->u.ar.start[dim]) == FAILURE)
- return FAILURE;
- if (checker (ref->u.ar.end[dim]) == FAILURE)
- return FAILURE;
- if (checker (ref->u.ar.stride[dim]) == FAILURE)
- return FAILURE;
+ if (!checker (ref->u.ar.start[dim]))
+ return false;
+ if (!checker (ref->u.ar.end[dim]))
+ return false;
+ if (!checker (ref->u.ar.stride[dim]))
+ return false;
}
break;
@@ -2807,10 +2803,10 @@ check_references (gfc_ref* ref, gfc_try (*checker) (gfc_expr*))
break;
case REF_SUBSTRING:
- if (checker (ref->u.ss.start) == FAILURE)
- return FAILURE;
- if (checker (ref->u.ss.end) == FAILURE)
- return FAILURE;
+ if (!checker (ref->u.ss.start))
+ return false;
+ if (!checker (ref->u.ss.end))
+ return false;
break;
default:
@@ -2824,22 +2820,22 @@ check_references (gfc_ref* ref, gfc_try (*checker) (gfc_expr*))
/* Verify that an expression is a restricted expression. Like its
cousin check_init_expr(), an error message is generated if we
- return FAILURE. */
+ return false. */
-static gfc_try
+static bool
check_restricted (gfc_expr *e)
{
gfc_symbol* sym;
- gfc_try t;
+ bool t;
if (e == NULL)
- return SUCCESS;
+ return true;
switch (e->expr_type)
{
case EXPR_OP:
t = check_intrinsic_op (e, check_restricted);
- if (t == SUCCESS)
+ if (t)
t = gfc_simplify_expr (e, 0);
break;
@@ -2848,24 +2844,24 @@ check_restricted (gfc_expr *e)
if (e->value.function.esym)
{
t = check_arglist (e->value.function.actual, &check_restricted);
- if (t == SUCCESS)
+ if (t)
t = external_spec_function (e);
}
else
{
if (e->value.function.isym && e->value.function.isym->inquiry)
- t = SUCCESS;
+ t = true;
else
t = check_arglist (e->value.function.actual, &check_restricted);
- if (t == SUCCESS)
+ if (t)
t = restricted_intrinsic (e);
}
break;
case EXPR_VARIABLE:
sym = e->symtree->n.sym;
- t = FAILURE;
+ t = false;
/* If a dummy argument appears in a context that is valid for a
restricted expression in an elemental procedure, it will have
@@ -2895,7 +2891,7 @@ check_restricted (gfc_expr *e)
}
/* Check reference chain if any. */
- if (check_references (e->ref, &check_restricted) == FAILURE)
+ if (!check_references (e->ref, &check_restricted))
break;
/* gfc_is_formal_arg broadcasts that a formal argument list is being
@@ -2916,7 +2912,7 @@ check_restricted (gfc_expr *e)
&& sym->ns->proc_name->attr.flavor == FL_MODULE)
|| (gfc_is_formal_arg () && (sym->ns == gfc_current_ns)))
{
- t = SUCCESS;
+ t = true;
break;
}
@@ -2928,16 +2924,16 @@ check_restricted (gfc_expr *e)
case EXPR_NULL:
case EXPR_CONSTANT:
- t = SUCCESS;
+ t = true;
break;
case EXPR_SUBSTRING:
t = gfc_specification_expr (e->ref->u.ss.start);
- if (t == FAILURE)
+ if (!t)
break;
t = gfc_specification_expr (e->ref->u.ss.end);
- if (t == SUCCESS)
+ if (t)
t = gfc_simplify_expr (e, 0);
break;
@@ -2959,21 +2955,21 @@ check_restricted (gfc_expr *e)
/* Check to see that an expression is a specification expression. If
- we return FAILURE, an error has been generated. */
+ we return false, an error has been generated. */
-gfc_try
+bool
gfc_specification_expr (gfc_expr *e)
{
gfc_component *comp;
if (e == NULL)
- return SUCCESS;
+ return true;
if (e->ts.type != BT_INTEGER)
{
gfc_error ("Expression at %L must be of INTEGER type, found %s",
&e->where, gfc_basic_typename (e->ts.type));
- return FAILURE;
+ return false;
}
comp = gfc_get_proc_ptr_comp (e);
@@ -2987,17 +2983,17 @@ gfc_specification_expr (gfc_expr *e)
e->symtree->n.sym->name, &e->where);
/* Prevent repeat error messages. */
e->symtree->n.sym->attr.pure = 1;
- return FAILURE;
+ return false;
}
if (e->rank != 0)
{
gfc_error ("Expression at %L must be scalar", &e->where);
- return FAILURE;
+ return false;
}
- if (gfc_simplify_expr (e, 0) == FAILURE)
- return FAILURE;
+ if (!gfc_simplify_expr (e, 0))
+ return false;
return check_restricted (e);
}
@@ -3007,18 +3003,18 @@ gfc_specification_expr (gfc_expr *e)
/* Given two expressions, make sure that the arrays are conformable. */
-gfc_try
+bool
gfc_check_conformance (gfc_expr *op1, gfc_expr *op2, const char *optype_msgid, ...)
{
int op1_flag, op2_flag, d;
mpz_t op1_size, op2_size;
- gfc_try t;
+ bool t;
va_list argp;
char buffer[240];
if (op1->rank == 0 || op2->rank == 0)
- return SUCCESS;
+ return true;
va_start (argp, optype_msgid);
vsnprintf (buffer, 240, optype_msgid, argp);
@@ -3028,15 +3024,15 @@ gfc_check_conformance (gfc_expr *op1, gfc_expr *op2, const char *optype_msgid, .
{
gfc_error ("Incompatible ranks in %s (%d and %d) at %L", _(buffer),
op1->rank, op2->rank, &op1->where);
- return FAILURE;
+ return false;
}
- t = SUCCESS;
+ t = true;
for (d = 0; d < op1->rank; d++)
{
- op1_flag = gfc_array_dimen_size (op1, d, &op1_size) == SUCCESS;
- op2_flag = gfc_array_dimen_size (op2, d, &op2_size) == SUCCESS;
+ op1_flag = gfc_array_dimen_size(op1, d, &op1_size);
+ op2_flag = gfc_array_dimen_size(op2, d, &op2_size);
if (op1_flag && op2_flag && mpz_cmp (op1_size, op2_size) != 0)
{
@@ -3045,7 +3041,7 @@ gfc_check_conformance (gfc_expr *op1, gfc_expr *op2, const char *optype_msgid, .
(int) mpz_get_si (op1_size),
(int) mpz_get_si (op2_size));
- t = FAILURE;
+ t = false;
}
if (op1_flag)
@@ -3053,18 +3049,18 @@ gfc_check_conformance (gfc_expr *op1, gfc_expr *op2, const char *optype_msgid, .
if (op2_flag)
mpz_clear (op2_size);
- if (t == FAILURE)
- return FAILURE;
+ if (!t)
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Given an assignable expression and an arbitrary expression, make
sure that the assignment can take place. */
-gfc_try
+bool
gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
{
gfc_symbol *sym;
@@ -3130,7 +3126,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
if (bad_proc)
{
gfc_error ("'%s' at %L is not a VALUE", sym->name, &lvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3138,26 +3134,26 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
{
gfc_error ("Incompatible ranks %d and %d in assignment at %L",
lvalue->rank, rvalue->rank, &lvalue->where);
- return FAILURE;
+ return false;
}
if (lvalue->ts.type == BT_UNKNOWN)
{
gfc_error ("Variable type is UNKNOWN in assignment at %L",
&lvalue->where);
- return FAILURE;
+ return false;
}
if (rvalue->expr_type == EXPR_NULL)
{
if (has_pointer && (ref == NULL || ref->next == NULL)
&& lvalue->symtree->n.sym->attr.data)
- return SUCCESS;
+ return true;
else
{
gfc_error ("NULL appears on right-hand side in assignment at %L",
&rvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3169,21 +3165,20 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
/* Check size of array assignments. */
if (lvalue->rank != 0 && rvalue->rank != 0
- && gfc_check_conformance (lvalue, rvalue, "array assignment") != SUCCESS)
- return FAILURE;
+ && !gfc_check_conformance (lvalue, rvalue, "array assignment"))
+ return false;
if (rvalue->is_boz && lvalue->ts.type != BT_INTEGER
&& lvalue->symtree->n.sym->attr.data
- && gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L used to "
- "initialize non-integer variable '%s'",
- &rvalue->where, lvalue->symtree->n.sym->name)
- == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L used to "
+ "initialize non-integer variable '%s'",
+ &rvalue->where, lvalue->symtree->n.sym->name))
+ return false;
else if (rvalue->is_boz && !lvalue->symtree->n.sym->attr.data
- && gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside "
- "a DATA statement and outside INT/REAL/DBLE/CMPLX",
- &rvalue->where) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside "
+ "a DATA statement and outside INT/REAL/DBLE/CMPLX",
+ &rvalue->where))
+ return false;
/* Handle the case of a BOZ literal on the RHS. */
if (rvalue->is_boz && lvalue->ts.type != BT_INTEGER)
@@ -3194,7 +3189,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
"non-integer symbol '%s'", &rvalue->where,
lvalue->symtree->n.sym->name);
if (!gfc_convert_boz (rvalue, &lvalue->ts))
- return FAILURE;
+ return false;
if ((rc = gfc_range_check (rvalue)) != ARITH_OK)
{
if (rc == ARITH_UNDERFLOW)
@@ -3209,7 +3204,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
gfc_error ("Arithmetic NaN of bit-wise transferred BOZ at %L"
". This check can be disabled with the option "
"-fno-range-check", &rvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3261,7 +3256,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
}
if (gfc_compare_types (&lvalue->ts, &rvalue->ts))
- return SUCCESS;
+ return true;
/* Only DATA Statements come here. */
if (!conform)
@@ -3270,16 +3265,16 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
converted to any other type. */
if ((gfc_numeric_ts (&lvalue->ts) && gfc_numeric_ts (&rvalue->ts))
|| rvalue->ts.type == BT_HOLLERITH)
- return SUCCESS;
+ return true;
if (lvalue->ts.type == BT_LOGICAL && rvalue->ts.type == BT_LOGICAL)
- return SUCCESS;
+ return true;
gfc_error ("Incompatible types in DATA statement at %L; attempted "
"conversion of %s to %s", &lvalue->where,
gfc_typename (&rvalue->ts), gfc_typename (&lvalue->ts));
- return FAILURE;
+ return false;
}
/* Assignment is the only case where character variables of different
@@ -3289,7 +3284,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
if (lvalue->ts.kind != rvalue->ts.kind)
gfc_convert_chartype (rvalue, &lvalue->ts);
- return SUCCESS;
+ return true;
}
return gfc_convert_type (rvalue, &lvalue->ts, 1);
@@ -3300,7 +3295,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
we only check rvalue if it's not an assignment to NULL() or a
NULLIFY statement. */
-gfc_try
+bool
gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
symbol_attribute attr, lhs_attr;
@@ -3313,7 +3308,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Pointer assignment target is not a POINTER at %L",
&lvalue->where);
- return FAILURE;
+ return false;
}
if (lhs_attr.flavor == FL_PROCEDURE && lhs_attr.use_assoc
@@ -3322,7 +3317,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("'%s' in the pointer assignment at %L cannot be an "
"l-value since it is a procedure",
lvalue->symtree->n.sym->name, &lvalue->where);
- return FAILURE;
+ return false;
}
proc_pointer = lvalue->symtree->n.sym->attr.proc_pointer;
@@ -3344,14 +3339,13 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Expected bounds specification for '%s' at %L",
lvalue->symtree->n.sym->name, &lvalue->where);
- return FAILURE;
+ return false;
}
- if (gfc_notify_std (GFC_STD_F2003,"Bounds "
- "specification for '%s' in pointer assignment "
- "at %L", lvalue->symtree->n.sym->name,
- &lvalue->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "Bounds specification "
+ "for '%s' in pointer assignment at %L",
+ lvalue->symtree->n.sym->name, &lvalue->where))
+ return false;
/* When bounds are given, all lbounds are necessary and either all
or none of the upper bounds; no strides are allowed. If the
@@ -3363,13 +3357,13 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Lower bound has to be present at %L",
&lvalue->where);
- return FAILURE;
+ return false;
}
if (ref->u.ar.stride[dim])
{
gfc_error ("Stride must not be present at %L",
&lvalue->where);
- return FAILURE;
+ return false;
}
if (dim == 0)
@@ -3381,7 +3375,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Either all or none of the upper bounds"
" must be specified at %L", &lvalue->where);
- return FAILURE;
+ return false;
}
}
}
@@ -3395,7 +3389,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
kind, etc for lvalue and rvalue must match, and rvalue must be a
pure variable if we're in a pure function. */
if (rvalue->expr_type == EXPR_NULL && rvalue->ts.type == BT_UNKNOWN)
- return SUCCESS;
+ return true;
/* F2008, C723 (pointer) and C726 (proc-pointer); for PURE also C1283. */
if (lvalue->expr_type == EXPR_VARIABLE
@@ -3407,7 +3401,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Pointer object at %L shall not have a coindex",
&lvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3428,7 +3422,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Invalid procedure pointer assignment at %L",
&rvalue->where);
- return FAILURE;
+ return false;
}
if (rvalue->expr_type == EXPR_VARIABLE && !attr.proc_pointer)
{
@@ -3453,7 +3447,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("Function result '%s' is invalid as proc-target "
"in procedure pointer assignment at %L",
sym->name, &rvalue->where);
- return FAILURE;
+ return false;
}
}
}
@@ -3462,7 +3456,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("Abstract interface '%s' is invalid "
"in procedure pointer assignment at %L",
rvalue->symtree->name, &rvalue->where);
- return FAILURE;
+ return false;
}
/* Check for F08:C729. */
if (attr.flavor == FL_PROCEDURE)
@@ -3472,20 +3466,19 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("Statement function '%s' is invalid "
"in procedure pointer assignment at %L",
rvalue->symtree->name, &rvalue->where);
- return FAILURE;
+ return false;
}
if (attr.proc == PROC_INTERNAL &&
- gfc_notify_std (GFC_STD_F2008, "Internal procedure "
- "'%s' is invalid in procedure pointer assignment "
- "at %L", rvalue->symtree->name, &rvalue->where)
- == FAILURE)
- return FAILURE;
+ !gfc_notify_std(GFC_STD_F2008, "Internal procedure '%s' "
+ "is invalid in procedure pointer assignment "
+ "at %L", rvalue->symtree->name, &rvalue->where))
+ return false;
if (attr.intrinsic && gfc_intrinsic_actual_ok (rvalue->symtree->name,
attr.subroutine) == 0)
{
gfc_error ("Intrinsic '%s' at %L is invalid in procedure pointer "
"assignment", rvalue->symtree->name, &rvalue->where);
- return FAILURE;
+ return false;
}
}
/* Check for F08:C730. */
@@ -3494,7 +3487,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("Nonintrinsic elemental procedure '%s' is invalid "
"in procedure pointer assignment at %L",
rvalue->symtree->name, &rvalue->where);
- return FAILURE;
+ return false;
}
/* Ensure that the calling convention is the same. As other attributes
@@ -3517,7 +3510,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("Mismatch in the procedure pointer assignment "
"at %L: mismatch in the calling convention",
&rvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3560,14 +3553,30 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
s2 = s2->ts.interface;
if (s1 == s2 || !s1 || !s2)
- return SUCCESS;
+ return true;
+
+ /* F08:7.2.2.4 (4) */
+ if (s1->attr.if_source == IFSRC_UNKNOWN
+ && gfc_explicit_interface_required (s2, err, sizeof(err)))
+ {
+ gfc_error ("Explicit interface required for '%s' at %L: %s",
+ s1->name, &lvalue->where, err);
+ return false;
+ }
+ if (s2->attr.if_source == IFSRC_UNKNOWN
+ && gfc_explicit_interface_required (s1, err, sizeof(err)))
+ {
+ gfc_error ("Explicit interface required for '%s' at %L: %s",
+ s2->name, &rvalue->where, err);
+ return false;
+ }
if (!gfc_compare_interfaces (s1, s2, name, 0, 1,
err, sizeof(err), NULL, NULL))
{
gfc_error ("Interface mismatch in procedure pointer assignment "
"at %L: %s", &rvalue->where, err);
- return FAILURE;
+ return false;
}
if (!gfc_compare_interfaces (s2, s1, name, 0, 1,
@@ -3575,10 +3584,10 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Interface mismatch in procedure pointer assignment "
"at %L: %s", &rvalue->where, err);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
if (!gfc_compare_types (&lvalue->ts, &rvalue->ts))
@@ -3599,20 +3608,20 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
"attempted assignment of %s to %s", &lvalue->where,
gfc_typename (&rvalue->ts),
gfc_typename (&lvalue->ts));
- return FAILURE;
+ return false;
}
if (lvalue->ts.type != BT_CLASS && lvalue->ts.kind != rvalue->ts.kind)
{
gfc_error ("Different kind type parameters in pointer "
"assignment at %L", &lvalue->where);
- return FAILURE;
+ return false;
}
if (lvalue->rank != rvalue->rank && !rank_remap)
{
gfc_error ("Different ranks in pointer assignment at %L", &lvalue->where);
- return FAILURE;
+ return false;
}
/* Make sure the vtab is present. */
@@ -3628,15 +3637,15 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
/* If this can be determined, check that the target must be at least as
large as the pointer assigned to it is. */
- if (gfc_array_size (lvalue, &lsize) == SUCCESS
- && gfc_array_size (rvalue, &rsize) == SUCCESS
+ if (gfc_array_size (lvalue, &lsize)
+ && gfc_array_size (rvalue, &rsize)
&& mpz_cmp (rsize, lsize) < 0)
{
gfc_error ("Rank remapping target is smaller than size of the"
" pointer (%ld < %ld) at %L",
mpz_get_si (rsize), mpz_get_si (lsize),
&lvalue->where);
- return FAILURE;
+ return false;
}
/* The target must be either rank one or it must be simply contiguous
@@ -3647,24 +3656,23 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Rank remapping target must be rank 1 or"
" simply contiguous at %L", &rvalue->where);
- return FAILURE;
+ return false;
}
- if (gfc_notify_std (GFC_STD_F2008, "Rank remapping"
- " target is not rank 1 at %L", &rvalue->where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2008, "Rank remapping target is not "
+ "rank 1 at %L", &rvalue->where))
+ return false;
}
}
/* Now punt if we are dealing with a NULLIFY(X) or X = NULL(X). */
if (rvalue->expr_type == EXPR_NULL)
- return SUCCESS;
+ return true;
if (lvalue->ts.type == BT_CHARACTER)
{
- gfc_try t = gfc_check_same_strlen (lvalue, rvalue, "pointer assignment");
- if (t == FAILURE)
- return FAILURE;
+ bool t = gfc_check_same_strlen (lvalue, rvalue, "pointer assignment");
+ if (!t)
+ return false;
}
if (rvalue->expr_type == EXPR_VARIABLE && is_subref_array (rvalue))
@@ -3677,14 +3685,14 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
gfc_error ("Target expression in pointer assignment "
"at %L must deliver a pointer result",
&rvalue->where);
- return FAILURE;
+ return false;
}
if (!attr.target && !attr.pointer)
{
gfc_error ("Pointer assignment target is neither TARGET "
"nor POINTER at %L", &rvalue->where);
- return FAILURE;
+ return false;
}
if (is_pure && gfc_impure_variable (rvalue->symtree->n.sym))
@@ -3701,7 +3709,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Pointer assignment with vector subscript "
"on rhs at %L", &rvalue->where);
- return FAILURE;
+ return false;
}
if (attr.is_protected && attr.use_assoc
@@ -3709,7 +3717,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Pointer assignment target has PROTECTED "
"attribute at %L", &rvalue->where);
- return FAILURE;
+ return false;
}
/* F2008, C725. For PURE also C1283. */
@@ -3722,7 +3730,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
gfc_error ("Data target at %L shall not have a coindex",
&rvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3761,18 +3769,18 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
"pointer target", &lvalue->where);
}
- return SUCCESS;
+ return true;
}
/* Relative of gfc_check_assign() except that the lvalue is a single
symbol. Used for initialization assignments. */
-gfc_try
+bool
gfc_check_assign_symbol (gfc_symbol *sym, gfc_component *comp, gfc_expr *rvalue)
{
gfc_expr lvalue;
- gfc_try r;
+ bool r;
bool pointer, proc_pointer;
memset (&lvalue, '\0', sizeof (gfc_expr));
@@ -3812,7 +3820,7 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_component *comp, gfc_expr *rvalue)
free (lvalue.symtree);
- if (r == FAILURE)
+ if (!r)
return r;
if (pointer && rvalue->expr_type != EXPR_NULL)
@@ -3824,13 +3832,13 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_component *comp, gfc_expr *rvalue)
{
gfc_error ("Pointer initialization target at %L "
"must not be ALLOCATABLE", &rvalue->where);
- return FAILURE;
+ return false;
}
if (!attr.target || attr.pointer)
{
gfc_error ("Pointer initialization target at %L "
"must have the TARGET attribute", &rvalue->where);
- return FAILURE;
+ return false;
}
if (!attr.save && rvalue->expr_type == EXPR_VARIABLE
@@ -3845,7 +3853,7 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_component *comp, gfc_expr *rvalue)
{
gfc_error ("Pointer initialization target at %L "
"must have the SAVE attribute", &rvalue->where);
- return FAILURE;
+ return false;
}
}
@@ -3857,11 +3865,11 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_component *comp, gfc_expr *rvalue)
{
gfc_error ("Procedure pointer initialization target at %L "
"may not be a procedure pointer", &rvalue->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -4275,7 +4283,7 @@ static bool
expr_check_typed_help (gfc_expr* e, gfc_symbol* sym ATTRIBUTE_UNUSED,
int* f ATTRIBUTE_UNUSED)
{
- gfc_try t;
+ bool t;
if (e->expr_type != EXPR_VARIABLE)
return false;
@@ -4284,10 +4292,10 @@ expr_check_typed_help (gfc_expr* e, gfc_symbol* sym ATTRIBUTE_UNUSED,
t = gfc_check_symbol_typed (e->symtree->n.sym, check_typed_ns,
true, e->where);
- return (t == FAILURE);
+ return (!t);
}
-gfc_try
+bool
gfc_expr_check_typed (gfc_expr* e, gfc_namespace* ns, bool strict)
{
bool error_found;
@@ -4301,12 +4309,12 @@ gfc_expr_check_typed (gfc_expr* e, gfc_namespace* ns, bool strict)
if (e->expr_type == EXPR_OP)
{
- gfc_try t = SUCCESS;
+ bool t = true;
gcc_assert (e->value.op.op1);
t = gfc_expr_check_typed (e->value.op.op1, ns, strict);
- if (t == SUCCESS && e->value.op.op2)
+ if (t && e->value.op.op2)
t = gfc_expr_check_typed (e->value.op.op2, ns, strict);
return t;
@@ -4317,7 +4325,7 @@ gfc_expr_check_typed (gfc_expr* e, gfc_namespace* ns, bool strict)
check_typed_ns = ns;
error_found = gfc_traverse_expr (e, NULL, &expr_check_typed_help, 0);
- return error_found ? FAILURE : SUCCESS;
+ return error_found ? false : true;
}
@@ -4676,9 +4684,9 @@ gfc_build_intrinsic_call (gfc_namespace *ns, gfc_isym_id id, const char* name,
variables), some checks are not performed.
Optionally, a possible error message can be suppressed if context is NULL
- and just the return status (SUCCESS / FAILURE) be requested. */
+ and just the return status (true / false) be requested. */
-gfc_try
+bool
gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
bool own_scope, const char* context)
{
@@ -4711,7 +4719,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
if (context)
gfc_error ("Fortran 2008: Pointer functions in variable definition"
" context (%s) at %L", context, &e->where);
- return FAILURE;
+ return false;
}
}
else if (e->expr_type != EXPR_VARIABLE)
@@ -4719,7 +4727,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
if (context)
gfc_error ("Non-variable expression in variable definition context (%s)"
" at %L", context, &e->where);
- return FAILURE;
+ return false;
}
if (!pointer && sym->attr.flavor == FL_PARAMETER)
@@ -4727,7 +4735,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
if (context)
gfc_error ("Named constant '%s' in variable definition context (%s)"
" at %L", sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
if (!pointer && sym->attr.flavor != FL_VARIABLE
&& !(sym->attr.flavor == FL_PROCEDURE && sym == sym->result)
@@ -4736,7 +4744,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
if (context)
gfc_error ("'%s' in variable definition context (%s) at %L is not"
" a variable", sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
/* Find out whether the expr is a pointer; this also means following
@@ -4747,7 +4755,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
if (context)
gfc_error ("Non-POINTER in pointer association context (%s)"
" at %L", context, &e->where);
- return FAILURE;
+ return false;
}
/* F2008, C1303. */
@@ -4760,7 +4768,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
if (context)
gfc_error ("LOCK_TYPE in variable definition context (%s) at %L",
context, &e->where);
- return FAILURE;
+ return false;
}
/* INTENT(IN) dummy argument. Check this, unless the object itself is the
@@ -4790,7 +4798,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
gfc_error ("Dummy argument '%s' with INTENT(IN) in pointer"
" association context (%s) at %L",
sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
if (!pointer && !is_pointer && !sym->attr.pointer)
{
@@ -4798,7 +4806,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
gfc_error ("Dummy argument '%s' with INTENT(IN) in variable"
" definition context (%s) at %L",
sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
}
@@ -4811,7 +4819,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
gfc_error ("Variable '%s' is PROTECTED and can not appear in a"
" pointer association context (%s) at %L",
sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
if (!pointer && !is_pointer)
{
@@ -4819,7 +4827,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
gfc_error ("Variable '%s' is PROTECTED and can not appear in a"
" variable definition context (%s) at %L",
sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
}
@@ -4831,7 +4839,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
gfc_error ("Variable '%s' can not appear in a variable definition"
" context (%s) at %L in PURE procedure",
sym->name, context, &e->where);
- return FAILURE;
+ return false;
}
if (!pointer && context && gfc_implicit_pure (NULL)
@@ -4895,12 +4903,11 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
" not be used in a variable definition context (%s)",
name, &e->where, context);
}
- return FAILURE;
+ return false;
}
/* Target must be allowed to appear in a variable definition context. */
- if (gfc_check_vardef_context (assoc->target, pointer, false, false, NULL)
- == FAILURE)
+ if (!gfc_check_vardef_context (assoc->target, pointer, false, false, NULL))
{
if (context)
gfc_error ("Associate-name '%s' can not appear in a variable"
@@ -4908,9 +4915,9 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
" at %L can not, either",
name, context, &e->where,
&assoc->target->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 60d790b0858..30cbfe59476 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -221,7 +221,7 @@ gfc_init (void)
gfc_init_1 ();
- if (gfc_new_file () != SUCCESS)
+ if (!gfc_new_file ())
fatal_error ("can't open input file: %s", gfc_source_file);
return true;
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index a77afc58e4b..3946c0c3461 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -300,7 +300,12 @@ callback_reduction (gfc_expr **e, int *walk_subtrees ATTRIBUTE_UNUSED,
c = gfc_constructor_first (arg->value.constructor);
- if (c == NULL)
+ /* Don't do any simplififcation if we have
+ - no element in the constructor or
+ - only have a single element in the array which contains an
+ iterator. */
+
+ if (c == NULL || (c->iterator != NULL && gfc_constructor_next (c) == NULL))
return 0;
res = copy_walk_reduction_arg (c->expr, fn);
@@ -583,7 +588,7 @@ cfe_expr_0 (gfc_expr **e, int *walk_subtrees,
newvar = NULL;
for (j=0; j<i; j++)
{
- if (gfc_dep_compare_functions(*(expr_array[i]),
+ if (gfc_dep_compare_functions (*(expr_array[i]),
*(expr_array[j]), true) == 0)
{
if (newvar == NULL)
@@ -931,7 +936,7 @@ optimize_assignment (gfc_code * c)
remove_trim (rhs);
/* Replace a = ' ' by a = '' to optimize away a memcpy. */
- if (is_empty_string(rhs))
+ if (is_empty_string (rhs))
rhs->value.character.length = 0;
}
@@ -1040,8 +1045,6 @@ combine_array_constructor (gfc_expr *e)
newbase = NULL;
e->expr_type = EXPR_ARRAY;
- c = gfc_constructor_first (oldbase);
-
for (c = gfc_constructor_first (oldbase); c;
c = gfc_constructor_next (c))
{
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 4ebe9872b28..a69cea2b349 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -95,14 +95,6 @@ typedef enum
{ M_READ, M_WRITE, M_PRINT, M_INQUIRE }
io_kind;
-/* The author remains confused to this day about the convention of
- returning '0' for 'SUCCESS'... or was it the other way around? The
- following enum makes things much more readable. We also start
- values off at one instead of zero. */
-
-typedef enum
-{ SUCCESS = 1, FAILURE }
-gfc_try;
/* These are flags for identifying whether we are reading a character literal
between quotes or normal source code. */
@@ -1626,16 +1618,16 @@ gfc_intrinsic_arg;
typedef union
{
- gfc_try (*f0)(void);
- gfc_try (*f1)(struct gfc_expr *);
- gfc_try (*f1m)(gfc_actual_arglist *);
- gfc_try (*f2)(struct gfc_expr *, struct gfc_expr *);
- gfc_try (*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *);
- gfc_try (*f3ml)(gfc_actual_arglist *);
- gfc_try (*f3red)(gfc_actual_arglist *);
- gfc_try (*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
+ bool (*f0)(void);
+ bool (*f1)(struct gfc_expr *);
+ bool (*f1m)(gfc_actual_arglist *);
+ bool (*f2)(struct gfc_expr *, struct gfc_expr *);
+ bool (*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *);
+ bool (*f3ml)(gfc_actual_arglist *);
+ bool (*f3red)(gfc_actual_arglist *);
+ bool (*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
struct gfc_expr *);
- gfc_try (*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
+ bool (*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
struct gfc_expr *, struct gfc_expr *);
}
gfc_check_f;
@@ -2432,7 +2424,7 @@ gfc_char_t gfc_peek_char (void);
char gfc_peek_ascii_char (void);
void gfc_error_recovery (void);
void gfc_gobble_whitespace (void);
-gfc_try gfc_new_file (void);
+bool gfc_new_file (void);
const char * gfc_read_orig_filename (const char *, const char **);
extern gfc_source_form gfc_current_form;
@@ -2505,7 +2497,7 @@ int gfc_error_check (void);
int gfc_error_flag_test (void);
notification gfc_notification_std (int);
-gfc_try gfc_notify_std (int, const char *, ...) ATTRIBUTE_GCC_GFC(2,3);
+bool gfc_notify_std (int, const char *, ...) ATTRIBUTE_GCC_GFC(2,3);
/* A general purpose syntax error. */
#define gfc_syntax_error(ST) \
@@ -2525,7 +2517,7 @@ arith gfc_check_integer_range (mpz_t p, int kind);
bool gfc_check_character_range (gfc_char_t, int);
/* trans-types.c */
-gfc_try gfc_check_any_c_kind (gfc_typespec *);
+bool gfc_check_any_c_kind (gfc_typespec *);
int gfc_validate_kind (bt, int, bool);
int gfc_get_int_kind_from_width_isofortranenv (int size);
int gfc_get_real_kind_from_width_isofortranenv (int size);
@@ -2548,72 +2540,72 @@ extern int gfc_character_storage_size;
/* symbol.c */
void gfc_clear_new_implicit (void);
-gfc_try gfc_add_new_implicit_range (int, int);
-gfc_try gfc_merge_new_implicit (gfc_typespec *);
+bool gfc_add_new_implicit_range (int, int);
+bool gfc_merge_new_implicit (gfc_typespec *);
void gfc_set_implicit_none (void);
void gfc_check_function_type (gfc_namespace *);
bool gfc_is_intrinsic_typename (const char *);
gfc_typespec *gfc_get_default_type (const char *, gfc_namespace *);
-gfc_try gfc_set_default_type (gfc_symbol *, int, gfc_namespace *);
+bool gfc_set_default_type (gfc_symbol *, int, gfc_namespace *);
void gfc_set_sym_referenced (gfc_symbol *);
-gfc_try gfc_add_attribute (symbol_attribute *, locus *);
-gfc_try gfc_add_ext_attribute (symbol_attribute *, ext_attr_id_t, locus *);
-gfc_try gfc_add_allocatable (symbol_attribute *, locus *);
-gfc_try gfc_add_codimension (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_contiguous (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_external (symbol_attribute *, locus *);
-gfc_try gfc_add_intrinsic (symbol_attribute *, locus *);
-gfc_try gfc_add_optional (symbol_attribute *, locus *);
-gfc_try gfc_add_pointer (symbol_attribute *, locus *);
-gfc_try gfc_add_cray_pointer (symbol_attribute *, locus *);
-gfc_try gfc_add_cray_pointee (symbol_attribute *, locus *);
+bool gfc_add_attribute (symbol_attribute *, locus *);
+bool gfc_add_ext_attribute (symbol_attribute *, ext_attr_id_t, locus *);
+bool gfc_add_allocatable (symbol_attribute *, locus *);
+bool gfc_add_codimension (symbol_attribute *, const char *, locus *);
+bool gfc_add_contiguous (symbol_attribute *, const char *, locus *);
+bool gfc_add_dimension (symbol_attribute *, const char *, locus *);
+bool gfc_add_external (symbol_attribute *, locus *);
+bool gfc_add_intrinsic (symbol_attribute *, locus *);
+bool gfc_add_optional (symbol_attribute *, locus *);
+bool gfc_add_pointer (symbol_attribute *, locus *);
+bool gfc_add_cray_pointer (symbol_attribute *, locus *);
+bool gfc_add_cray_pointee (symbol_attribute *, locus *);
match gfc_mod_pointee_as (gfc_array_spec *);
-gfc_try gfc_add_protected (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_result (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_save (symbol_attribute *, save_state, const char *, locus *);
-gfc_try gfc_add_threadprivate (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_saved_common (symbol_attribute *, locus *);
-gfc_try gfc_add_target (symbol_attribute *, locus *);
-gfc_try gfc_add_dummy (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_generic (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_common (symbol_attribute *, locus *);
-gfc_try gfc_add_in_common (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_in_equivalence (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_data (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_in_namelist (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_sequence (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_elemental (symbol_attribute *, locus *);
-gfc_try gfc_add_pure (symbol_attribute *, locus *);
-gfc_try gfc_add_recursive (symbol_attribute *, locus *);
-gfc_try gfc_add_function (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_subroutine (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_volatile (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_asynchronous (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_proc (symbol_attribute *attr, const char *name, locus *where);
-gfc_try gfc_add_abstract (symbol_attribute* attr, locus* where);
-
-gfc_try gfc_add_access (symbol_attribute *, gfc_access, const char *, locus *);
-gfc_try gfc_add_is_bind_c (symbol_attribute *, const char *, locus *, int);
-gfc_try gfc_add_extension (symbol_attribute *, locus *);
-gfc_try gfc_add_value (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_flavor (symbol_attribute *, sym_flavor, const char *, locus *);
-gfc_try gfc_add_entry (symbol_attribute *, const char *, locus *);
-gfc_try gfc_add_procedure (symbol_attribute *, procedure_type,
+bool gfc_add_protected (symbol_attribute *, const char *, locus *);
+bool gfc_add_result (symbol_attribute *, const char *, locus *);
+bool gfc_add_save (symbol_attribute *, save_state, const char *, locus *);
+bool gfc_add_threadprivate (symbol_attribute *, const char *, locus *);
+bool gfc_add_saved_common (symbol_attribute *, locus *);
+bool gfc_add_target (symbol_attribute *, locus *);
+bool gfc_add_dummy (symbol_attribute *, const char *, locus *);
+bool gfc_add_generic (symbol_attribute *, const char *, locus *);
+bool gfc_add_common (symbol_attribute *, locus *);
+bool gfc_add_in_common (symbol_attribute *, const char *, locus *);
+bool gfc_add_in_equivalence (symbol_attribute *, const char *, locus *);
+bool gfc_add_data (symbol_attribute *, const char *, locus *);
+bool gfc_add_in_namelist (symbol_attribute *, const char *, locus *);
+bool gfc_add_sequence (symbol_attribute *, const char *, locus *);
+bool gfc_add_elemental (symbol_attribute *, locus *);
+bool gfc_add_pure (symbol_attribute *, locus *);
+bool gfc_add_recursive (symbol_attribute *, locus *);
+bool gfc_add_function (symbol_attribute *, const char *, locus *);
+bool gfc_add_subroutine (symbol_attribute *, const char *, locus *);
+bool gfc_add_volatile (symbol_attribute *, const char *, locus *);
+bool gfc_add_asynchronous (symbol_attribute *, const char *, locus *);
+bool gfc_add_proc (symbol_attribute *attr, const char *name, locus *where);
+bool gfc_add_abstract (symbol_attribute* attr, locus* where);
+
+bool gfc_add_access (symbol_attribute *, gfc_access, const char *, locus *);
+bool gfc_add_is_bind_c (symbol_attribute *, const char *, locus *, int);
+bool gfc_add_extension (symbol_attribute *, locus *);
+bool gfc_add_value (symbol_attribute *, const char *, locus *);
+bool gfc_add_flavor (symbol_attribute *, sym_flavor, const char *, locus *);
+bool gfc_add_entry (symbol_attribute *, const char *, locus *);
+bool gfc_add_procedure (symbol_attribute *, procedure_type,
const char *, locus *);
-gfc_try gfc_add_intent (symbol_attribute *, sym_intent, locus *);
-gfc_try gfc_add_explicit_interface (gfc_symbol *, ifsrc,
+bool gfc_add_intent (symbol_attribute *, sym_intent, locus *);
+bool gfc_add_explicit_interface (gfc_symbol *, ifsrc,
gfc_formal_arglist *, locus *);
-gfc_try gfc_add_type (gfc_symbol *, gfc_typespec *, locus *);
+bool gfc_add_type (gfc_symbol *, gfc_typespec *, locus *);
void gfc_clear_attr (symbol_attribute *);
-gfc_try gfc_missing_attr (symbol_attribute *, locus *);
-gfc_try gfc_copy_attr (symbol_attribute *, symbol_attribute *, locus *);
+bool gfc_missing_attr (symbol_attribute *, locus *);
+bool gfc_copy_attr (symbol_attribute *, symbol_attribute *, locus *);
-gfc_try gfc_add_component (gfc_symbol *, const char *, gfc_component **);
+bool gfc_add_component (gfc_symbol *, const char *, gfc_component **);
gfc_symbol *gfc_use_derived (gfc_symbol *);
gfc_symtree *gfc_use_derived_tree (gfc_symtree *);
gfc_component *gfc_find_component (gfc_symbol *, const char *, bool, bool);
@@ -2621,7 +2613,7 @@ gfc_component *gfc_find_component (gfc_symbol *, const char *, bool, bool);
gfc_st_label *gfc_get_st_label (int);
void gfc_free_st_label (gfc_st_label *);
void gfc_define_st_label (gfc_st_label *, gfc_sl_type, locus *);
-gfc_try gfc_reference_st_label (gfc_st_label *, gfc_sl_type);
+bool gfc_reference_st_label (gfc_st_label *, gfc_sl_type);
gfc_namespace *gfc_get_namespace (gfc_namespace *, int);
gfc_symtree *gfc_new_symtree (gfc_symtree **, const char *);
@@ -2637,11 +2629,11 @@ 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 **);
-gfc_try gfc_verify_c_interop (gfc_typespec *);
-gfc_try gfc_verify_c_interop_param (gfc_symbol *);
-gfc_try verify_bind_c_sym (gfc_symbol *, gfc_typespec *, int, gfc_common_head *);
-gfc_try verify_bind_c_derived_type (gfc_symbol *);
-gfc_try verify_com_block_vars_c_interop (gfc_common_head *);
+bool gfc_verify_c_interop (gfc_typespec *);
+bool gfc_verify_c_interop_param (gfc_symbol *);
+bool verify_bind_c_sym (gfc_symbol *, gfc_typespec *, int, gfc_common_head *);
+bool verify_bind_c_derived_type (gfc_symbol *);
+bool verify_com_block_vars_c_interop (gfc_common_head *);
gfc_symtree *generate_isocbinding_symbol (const char *, iso_c_binding_symbol,
const char *, gfc_symtree *, bool);
int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **, bool);
@@ -2683,7 +2675,7 @@ void gfc_copy_formal_args_intr (gfc_symbol *, gfc_intrinsic_sym *);
void gfc_free_finalizer (gfc_finalizer *el); /* Needed in resolve.c, too */
-gfc_try gfc_check_symbol_typed (gfc_symbol*, gfc_namespace*, bool, locus);
+bool gfc_check_symbol_typed (gfc_symbol*, gfc_namespace*, bool, locus);
gfc_namespace* gfc_find_proc_namespace (gfc_namespace*);
bool gfc_is_associate_pointer (gfc_symbol*);
@@ -2704,9 +2696,9 @@ void gfc_intrinsic_done_1 (void);
char gfc_type_letter (bt);
gfc_symbol * gfc_get_intrinsic_sub_symbol (const char *);
-gfc_try gfc_convert_type (gfc_expr *, gfc_typespec *, int);
-gfc_try gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int);
-gfc_try gfc_convert_chartype (gfc_expr *, gfc_typespec *);
+bool gfc_convert_type (gfc_expr *, gfc_typespec *, int);
+bool gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int);
+bool gfc_convert_chartype (gfc_expr *, gfc_typespec *);
int gfc_generic_intrinsic (const char *);
int gfc_specific_intrinsic (const char *);
bool gfc_is_intrinsic (gfc_symbol*, int, locus);
@@ -2723,7 +2715,7 @@ match gfc_intrinsic_func_interface (gfc_expr *, int);
match gfc_intrinsic_sub_interface (gfc_code *, int);
void gfc_warn_intrinsic_shadow (const gfc_symbol*, bool, bool);
-gfc_try gfc_check_intrinsic_standard (const gfc_intrinsic_sym*, const char**,
+bool gfc_check_intrinsic_standard (const gfc_intrinsic_sym*, const char**,
bool, locus);
/* match.c -- FIXME */
@@ -2755,13 +2747,13 @@ gfc_actual_arglist *gfc_copy_actual_arglist (gfc_actual_arglist *);
const char *gfc_extract_int (gfc_expr *, int *);
bool is_subref_array (gfc_expr *);
bool gfc_is_simply_contiguous (gfc_expr *, bool);
-gfc_try gfc_check_init_expr (gfc_expr *);
+bool gfc_check_init_expr (gfc_expr *);
gfc_expr *gfc_build_conversion (gfc_expr *);
void gfc_free_ref_list (gfc_ref *);
void gfc_type_convert_binary (gfc_expr *, int);
int gfc_is_constant_expr (gfc_expr *);
-gfc_try gfc_simplify_expr (gfc_expr *, int);
+bool gfc_simplify_expr (gfc_expr *, int);
int gfc_has_vector_index (gfc_expr *);
gfc_expr *gfc_get_expr (void);
@@ -2784,15 +2776,15 @@ mpz_t *gfc_copy_shape_excluding (mpz_t *, int, gfc_expr *);
gfc_expr *gfc_copy_expr (gfc_expr *);
gfc_ref* gfc_copy_ref (gfc_ref*);
-gfc_try gfc_specification_expr (gfc_expr *);
+bool gfc_specification_expr (gfc_expr *);
int gfc_numeric_ts (gfc_typespec *);
int gfc_kind_max (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_conformance (gfc_expr *, gfc_expr *, const char *, ...) ATTRIBUTE_PRINTF_3;
-gfc_try gfc_check_assign (gfc_expr *, gfc_expr *, int);
-gfc_try gfc_check_pointer_assign (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_assign_symbol (gfc_symbol *, gfc_component *, gfc_expr *);
+bool gfc_check_conformance (gfc_expr *, gfc_expr *, const char *, ...) ATTRIBUTE_PRINTF_3;
+bool gfc_check_assign (gfc_expr *, gfc_expr *, int);
+bool gfc_check_pointer_assign (gfc_expr *, gfc_expr *);
+bool gfc_check_assign_symbol (gfc_symbol *, gfc_component *, gfc_expr *);
bool gfc_has_default_initializer (gfc_symbol *);
gfc_expr *gfc_default_initializer (gfc_typespec *);
@@ -2806,7 +2798,7 @@ bool gfc_traverse_expr (gfc_expr *, gfc_symbol *,
bool (*)(gfc_expr *, gfc_symbol *, int*),
int);
void gfc_expr_set_symbols_referenced (gfc_expr *);
-gfc_try gfc_expr_check_typed (gfc_expr*, gfc_namespace*, bool);
+bool gfc_expr_check_typed (gfc_expr*, gfc_namespace*, bool);
gfc_component * gfc_get_proc_ptr_comp (gfc_expr *);
bool gfc_is_proc_ptr_comp (gfc_expr *);
@@ -2820,7 +2812,7 @@ bool gfc_has_ultimate_pointer (gfc_expr *);
gfc_expr* gfc_build_intrinsic_call (gfc_namespace *, gfc_isym_id, const char*,
locus, unsigned, ...);
-gfc_try gfc_check_vardef_context (gfc_expr*, bool, bool, bool, const char*);
+bool gfc_check_vardef_context (gfc_expr*, bool, bool, bool, const char*);
/* st.c */
@@ -2834,23 +2826,24 @@ void gfc_free_statements (gfc_code *);
void gfc_free_association_list (gfc_association_list *);
/* resolve.c */
-gfc_try gfc_resolve_expr (gfc_expr *);
+bool gfc_resolve_expr (gfc_expr *);
void gfc_resolve (gfc_namespace *);
void gfc_resolve_blocks (gfc_code *, gfc_namespace *);
int gfc_impure_variable (gfc_symbol *);
int gfc_pure (gfc_symbol *);
int gfc_implicit_pure (gfc_symbol *);
int gfc_elemental (gfc_symbol *);
-gfc_try gfc_resolve_iterator (gfc_iterator *, bool, bool);
-gfc_try find_forall_index (gfc_expr *, gfc_symbol *, int);
-gfc_try gfc_resolve_index (gfc_expr *, int);
-gfc_try gfc_resolve_dim_arg (gfc_expr *);
+bool gfc_resolve_iterator (gfc_iterator *, bool, bool);
+bool find_forall_index (gfc_expr *, gfc_symbol *, int);
+bool gfc_resolve_index (gfc_expr *, int);
+bool gfc_resolve_dim_arg (gfc_expr *);
int gfc_is_formal_arg (void);
void gfc_resolve_substring_charlen (gfc_expr *);
match gfc_iso_c_sub_interface(gfc_code *, gfc_symbol *);
gfc_expr *gfc_expr_to_initialize (gfc_expr *);
bool gfc_type_is_extensible (gfc_symbol *);
-gfc_try gfc_resolve_intrinsic (gfc_symbol *, locus *);
+bool gfc_resolve_intrinsic (gfc_symbol *, locus *);
+bool gfc_explicit_interface_required (gfc_symbol *, char *, int);
/* array.c */
@@ -2859,31 +2852,31 @@ gfc_iterator *gfc_copy_iterator (gfc_iterator *);
void gfc_free_array_spec (gfc_array_spec *);
gfc_array_ref *gfc_copy_array_ref (gfc_array_ref *);
-gfc_try gfc_set_array_spec (gfc_symbol *, gfc_array_spec *, locus *);
+bool gfc_set_array_spec (gfc_symbol *, gfc_array_spec *, locus *);
gfc_array_spec *gfc_copy_array_spec (gfc_array_spec *);
-gfc_try gfc_resolve_array_spec (gfc_array_spec *, int);
+bool 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 *, bool);
+bool 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 *);
-gfc_try gfc_resolve_array_constructor (gfc_expr *);
-gfc_try gfc_check_constructor_type (gfc_expr *);
-gfc_try gfc_check_iter_variable (gfc_expr *);
-gfc_try gfc_check_constructor (gfc_expr *, gfc_try (*)(gfc_expr *));
-gfc_try gfc_array_size (gfc_expr *, mpz_t *);
-gfc_try gfc_array_dimen_size (gfc_expr *, int, mpz_t *);
-gfc_try gfc_array_ref_shape (gfc_array_ref *, mpz_t *);
+bool gfc_resolve_character_array_constructor (gfc_expr *);
+bool gfc_resolve_array_constructor (gfc_expr *);
+bool gfc_check_constructor_type (gfc_expr *);
+bool gfc_check_iter_variable (gfc_expr *);
+bool gfc_check_constructor (gfc_expr *, bool (*)(gfc_expr *));
+bool gfc_array_size (gfc_expr *, mpz_t *);
+bool gfc_array_dimen_size (gfc_expr *, int, mpz_t *);
+bool gfc_array_ref_shape (gfc_array_ref *, mpz_t *);
gfc_array_ref *gfc_find_array_ref (gfc_expr *);
tree gfc_conv_array_initializer (tree type, gfc_expr *);
-gfc_try spec_size (gfc_array_spec *, mpz_t *);
-gfc_try spec_dimen_size (gfc_array_spec *, int, mpz_t *);
+bool spec_size (gfc_array_spec *, mpz_t *);
+bool spec_dimen_size (gfc_array_spec *, int, mpz_t *);
int gfc_is_compile_time_shape (gfc_array_spec *);
-gfc_try gfc_ref_dimen_size (gfc_array_ref *, int dimen, mpz_t *, mpz_t *);
+bool gfc_ref_dimen_size (gfc_array_ref *, int dimen, mpz_t *, mpz_t *);
/* interface.c -- FIXME: some of these should be in symbol.c */
@@ -2893,15 +2886,15 @@ int gfc_compare_types (gfc_typespec *, gfc_typespec *);
int gfc_compare_interfaces (gfc_symbol*, gfc_symbol*, const char *, int, int,
char *, int, const char *, const char *);
void gfc_check_interfaces (gfc_namespace *);
-gfc_try gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *);
+bool gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *);
void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *);
gfc_symbol *gfc_search_interface (gfc_interface *, int,
gfc_actual_arglist **);
match gfc_extend_expr (gfc_expr *);
void gfc_free_formal_arglist (gfc_formal_arglist *);
-gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *);
-gfc_try gfc_check_new_interface (gfc_interface *, gfc_symbol *, locus);
-gfc_try gfc_add_interface (gfc_symbol *);
+bool gfc_extend_assign (gfc_code *, gfc_namespace *);
+bool gfc_check_new_interface (gfc_interface *, gfc_symbol *, locus);
+bool gfc_add_interface (gfc_symbol *);
gfc_interface *gfc_current_interface_head (void);
void gfc_set_current_interface_head (gfc_interface *);
gfc_symtree* gfc_find_sym_in_symtree (gfc_symbol*);
@@ -2909,23 +2902,23 @@ bool gfc_arglist_matches_symbol (gfc_actual_arglist**, gfc_symbol*);
bool gfc_check_operator_interface (gfc_symbol*, gfc_intrinsic_op, locus);
int gfc_has_vector_subscript (gfc_expr*);
gfc_intrinsic_op gfc_equivalent_op (gfc_intrinsic_op);
-gfc_try gfc_check_typebound_override (gfc_symtree*, gfc_symtree*);
+bool gfc_check_typebound_override (gfc_symtree*, gfc_symtree*);
/* io.c */
extern gfc_st_label format_asterisk;
void gfc_free_open (gfc_open *);
-gfc_try gfc_resolve_open (gfc_open *);
+bool gfc_resolve_open (gfc_open *);
void gfc_free_close (gfc_close *);
-gfc_try gfc_resolve_close (gfc_close *);
+bool gfc_resolve_close (gfc_close *);
void gfc_free_filepos (gfc_filepos *);
-gfc_try gfc_resolve_filepos (gfc_filepos *);
+bool gfc_resolve_filepos (gfc_filepos *);
void gfc_free_inquire (gfc_inquire *);
-gfc_try gfc_resolve_inquire (gfc_inquire *);
+bool gfc_resolve_inquire (gfc_inquire *);
void gfc_free_dt (gfc_dt *);
-gfc_try gfc_resolve_dt (gfc_dt *, locus *);
+bool gfc_resolve_dt (gfc_dt *, locus *);
void gfc_free_wait (gfc_wait *);
-gfc_try gfc_resolve_wait (gfc_wait *);
+bool gfc_resolve_wait (gfc_wait *);
/* module.c */
void gfc_module_init_2 (void);
@@ -2941,7 +2934,7 @@ match gfc_match_rvalue (gfc_expr **);
match gfc_match_varspec (gfc_expr*, int, bool, bool);
int gfc_check_digit (char, int);
bool gfc_is_function_return_value (gfc_symbol *, gfc_namespace *);
-gfc_try gfc_convert_to_structure_constructor (gfc_expr *, gfc_symbol *,
+bool gfc_convert_to_structure_constructor (gfc_expr *, gfc_symbol *,
gfc_expr **,
gfc_actual_arglist **, bool);
@@ -2962,7 +2955,7 @@ void gfc_delete_bbt (void *, void *, compare_fn);
void gfc_dump_parse_tree (gfc_namespace *, FILE *);
/* parse.c */
-gfc_try gfc_parse_file (void);
+bool gfc_parse_file (void);
void gfc_global_used (gfc_gsymbol *, locus *);
gfc_namespace* gfc_build_block_ns (gfc_namespace *);
@@ -2972,8 +2965,8 @@ int gfc_dep_compare_expr (gfc_expr *, gfc_expr *);
bool gfc_dep_difference (gfc_expr *, gfc_expr *, mpz_t *);
/* check.c */
-gfc_try gfc_check_same_strlen (const gfc_expr*, const gfc_expr*, const char*);
-gfc_try gfc_calculate_transfer_sizes (gfc_expr*, gfc_expr*, gfc_expr*,
+bool gfc_check_same_strlen (const gfc_expr*, const gfc_expr*, const char*);
+bool gfc_calculate_transfer_sizes (gfc_expr*, gfc_expr*, gfc_expr*,
size_t*, size_t*, size_t*);
/* class.c */
@@ -2991,15 +2984,15 @@ bool gfc_is_class_scalar_expr (gfc_expr *);
bool gfc_is_class_container_ref (gfc_expr *e);
gfc_expr *gfc_class_null_initializer (gfc_typespec *, gfc_expr *);
unsigned int gfc_hash_value (gfc_symbol *);
-gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *,
+bool gfc_build_class_symbol (gfc_typespec *, symbol_attribute *,
gfc_array_spec **, bool);
gfc_symbol *gfc_find_derived_vtab (gfc_symbol *);
gfc_symbol *gfc_find_intrinsic_vtab (gfc_typespec *);
-gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*,
+gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, bool*,
const char*, bool, locus*);
-gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*,
+gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, bool*,
const char*, bool, locus*);
-gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, gfc_try*,
+gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, bool*,
gfc_intrinsic_op, bool,
locus*);
gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*);
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 4f9008d3d26..61cb3bb9746 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1166,7 +1166,8 @@ parameters of the @code{ISO_FORTRAN_ENV} module instead of the concrete values.
The available kind parameters can be found in the constant arrays
@code{CHARACTER_KINDS}, @code{INTEGER_KINDS}, @code{LOGICAL_KINDS} and
@code{REAL_KINDS} in the @code{ISO_FORTRAN_ENV} module
-(see @ref{ISO_FORTRAN_ENV}).
+(see @ref{ISO_FORTRAN_ENV}). For C interoperability, the kind parameters of
+the @code{ISO_C_BINDING} module should be used (see @ref{ISO_C_BINDING}).
@node Internal representation of LOGICAL variables
@@ -1184,16 +1185,7 @@ A @code{LOGICAL(KIND=N)} variable is represented as an
values: @code{1} for @code{.TRUE.} and @code{0} for
@code{.FALSE.}. Any other integer value results in undefined behavior.
-Note that for mixed-language programming using the
-@code{ISO_C_BINDING} feature, there is a @code{C_BOOL} kind that can
-be used to create @code{LOGICAL(KIND=C_BOOL)} variables which are
-interoperable with the C99 _Bool type. The C99 _Bool type has an
-internal representation described in the C99 standard, which is
-identical to the above description, i.e. with 1 for true and 0 for
-false being the only permissible values. Thus the internal
-representation of @code{LOGICAL} variables in GNU Fortran is identical
-to C99 _Bool, except for a possible difference in storage size
-depending on the kind.
+See also @ref{Argument passing conventions} and @ref{Interoperability with C}.
@node Thread-safety of the runtime library
@@ -2204,6 +2196,7 @@ common, but not the former.
* Interoperability with C::
* GNU Fortran Compiler Directives::
* Non-Fortran Main Program::
+* Naming and argument-passing conventions::
@end menu
This chapter is about mixed-language interoperability, but also applies
@@ -2250,6 +2243,16 @@ in C and Fortran, the named constants shall be used which are defined in the
for kind parameters and character named constants for the escape sequences
in C. For a list of the constants, see @ref{ISO_C_BINDING}.
+For logical types, please note that the Fortran standard only guarantees
+interoperability between C99's @code{_Bool} and Fortran's @code{C_Bool}-kind
+logicals and C99 defines that @code{true} has the value 1 and @code{false}
+the value 0. Using any other integer value with GNU Fortran's @code{LOGICAL}
+(with any kind parameter) gives an undefined result. (Passing other integer
+values than 0 and 1 to GCC's @code{_Bool} is also undefined, unless the
+integer is explicitly or implicitly casted to @code{_Bool}.)
+
+
+
@node Derived Types and struct
@subsection Derived Types and struct
@@ -2975,6 +2978,144 @@ int main (int argc, char *argv[])
@end table
+@node Naming and argument-passing conventions
+@section Naming and argument-passing conventions
+
+This section gives an overview about the naming convention of procedures
+and global variables and about the argument passing conventions used by
+GNU Fortran. If a C binding has been specified, the naming convention
+and some of the argument-passing conventions change. If possible,
+mixed-language and mixed-compiler projects should use the better defined
+C binding for interoperability. See @pxref{Interoperability with C}.
+
+@menu
+* Naming conventions::
+* Argument passing conventions::
+@end menu
+
+
+@node Naming conventions
+@subsection Naming conventions
+
+According the Fortran standard, valid Fortran names consist of a letter
+between @code{A} to @code{Z}, @code{a} to @code{z}, digits @code{0},
+@code{1} to @code{9} and underscores (@code{_}) with the restriction
+that names may only start with a letter. As vendor extension, the
+dollar sign (@code{$}) is additionally permitted with the option
+@option{-fdollar-ok}, but not as first character and only if the
+target system supports it.
+
+By default, the procedure name is the lower-cased Fortran name with an
+appended underscore (@code{_}); using @option{-fno-underscoring} no
+underscore is appended while @code{-fsecond-underscore} appends two
+underscores. Depending on the target system and the calling convention,
+the procedure might be additionally dressed; for instance, on 32bit
+Windows with @code{stdcall}, an at-sign @code{@@} followed by an integer
+number is appended. For the changing the calling convention, see
+@pxref{GNU Fortran Compiler Directives}.
+
+For common blocks, the same convention is used, i.e. by default an
+underscore is appended to the lower-cased Fortran name. Blank commons
+have the name @code{__BLNK__}.
+
+For procedures and variables declared in the specification space of a
+module, the name is formed by @code{__}, followed by the lower-cased
+module name, @code{_MOD_}, and the lower-cased Fortran name. Note that
+no underscore is appended.
+
+
+@node Argument passing conventions
+@subsection Argument passing conventions
+
+Subroutines do not return a value (matching C99's @code{void}) while
+functions either return a value as specified in the platform ABI or
+the result variable is passed as hidden argument to the function and
+no result is returned. A hidden result variable is used when the
+result variable is an array or of type @code{CHARACTER}.
+
+Arguments are passed according to the platform ABI. In particular,
+complex arguments might not be compatible to a struct with two real
+components for the real and imaginary part. The argument passing
+matches the one of C99's @code{_Complex}. Functions with scalar
+complex result variables return their value and do not use a
+by-reference argument. Note that with the @option{-ff2c} option,
+the argument passing is modified and no longer completely matches
+the platform ABI. Some other Fortran compilers use @code{f2c}
+semantic by default; this might cause problems with
+interoperablility.
+
+GNU Fortran passes most arguments by reference, i.e. by passing a
+pointer to the data. Note that the compiler might use a temporary
+variable into which the actual argument has been copied, if required
+semantically (copy-in/copy-out).
+
+For arguments with @code{ALLOCATABLE} and @code{POINTER}
+attribute (including procedure pointers), a pointer to the pointer
+is passed such that the pointer address can be modified in the
+procedure.
+
+For dummy arguments with the @code{VALUE} attribute: Scalar arguments
+of the type @code{INTEGER}, @code{LOGICAL}, @code{REAL} and
+@code{COMPLEX} are passed by value according to the platform ABI.
+(As vendor extension and not recommended, using @code{%VAL()} in the
+call to a procedure has the same effect.) For @code{TYPE(C_PTR)} and
+procedure pointers, the pointer itself is passed such that it can be
+modified without affecting the caller.
+@c FIXME: Document how VALUE is handled for CHARACTER, TYPE,
+@c CLASS and arrays, i.e. whether the copy-in is done in the caller
+@c or in the callee.
+
+For Boolean (@code{LOGICAL}) arguments, please note that GCC expects
+only the integer value 0 and 1. If a GNU Fortran @code{LOGICAL}
+variable contains another integer value, the result is undefined.
+As some other Fortran compilers use @math{-1} for @code{.TRUE.},
+extra care has to be taken -- such as passing the value as
+@code{INTEGER}. (The same value restriction also applies to other
+front ends of GCC, e.g. to GCC's C99 compiler for @code{_Bool}
+or GCC's Ada compiler for @code{Boolean}.)
+
+For arguments of @code{CHARACTER} type, the character length is passed
+as hidden argument. For deferred-length strings, the value is passed
+by reference, otherwise by value. The character length has the type
+@code{INTEGER(kind=4)}. Note with C binding, @code{CHARACTER(len=1)}
+result variables are returned according to the platform ABI and no
+hidden length argument is used for dummy arguments; with @code{VALUE},
+those variables are passed by value.
+
+For @code{OPTIONAL} dummy arguments, an absent argument is denoted
+by a NULL pointer, except for scalar dummy arguments of type
+@code{INTEGER}, @code{LOGICAL}, @code{REAL} and @code{COMPLEX}
+which have the @code{VALUE} attribute. For those, a hidden Boolean
+argument (@code{logical(kind=C_bool),value}) is used to indicate
+whether the argument is present.
+
+Arguments which are assumed-shape, assumed-rank or deferred-rank
+arrays or, with @option{-fcoarray=lib}, allocatable scalar coarrays use
+an array descriptor. All other arrays pass the address of the
+first element of the array. With @option{-fcoarray=lib}, the token
+and the offset belonging to nonallocatable coarrays dummy arguments
+are passed as hidden argument along the character length hidden
+arguments. The token is an oparque pointer identifying the coarray
+and the offset is a passed-by-value integer of kind @code{C_PTRDIFF_T},
+denoting the byte offset between the base address of the coarray and
+the passed scalar or first element of the passed array.
+
+The arguments are passed in the following order
+@itemize @bullet
+@item Result variable, when the function result is passed by reference
+@item Character length of the function result, if it is a of type
+@code{CHARACTER} and no C binding is used
+@item The arguments in the order in which they appear in the Fortran
+declaration
+@item The the present status for optional arguments with value attribute,
+which are internally passed by value
+@item The character length and/or coarray token and offset for the first
+argument which is a @code{CHARACTER} or a nonallocatable coarray dummy
+argument, followed by the hidden arguments of the next dummy argument
+of such a type
+@end itemize
+
+
@c Intrinsic Procedures
@c ---------------------------------------------------------------------
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index fff8c39ad93..741416469f4 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -213,7 +213,7 @@ gfc_match_interface (void)
return MATCH_ERROR;
if (!sym->attr.generic
- && gfc_add_generic (&sym->attr, sym->name, NULL) == FAILURE)
+ && !gfc_add_generic (&sym->attr, sym->name, NULL))
return MATCH_ERROR;
if (sym->attr.dummy)
@@ -251,8 +251,7 @@ gfc_match_abstract_interface (void)
{
match m;
- if (gfc_notify_std (GFC_STD_F2003, "ABSTRACT INTERFACE at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ABSTRACT INTERFACE at %C"))
return MATCH_ERROR;
m = gfc_match_eos ();
@@ -326,23 +325,23 @@ gfc_match_end_interface (void)
/* The following if-statements are used to enforce C1202
from F2003. */
- if ((strcmp(s1, "==") == 0 && strcmp(s2, ".eq.") == 0)
- || (strcmp(s1, ".eq.") == 0 && strcmp(s2, "==") == 0))
+ if ((strcmp(s1, "==") == 0 && strcmp (s2, ".eq.") == 0)
+ || (strcmp(s1, ".eq.") == 0 && strcmp (s2, "==") == 0))
break;
- if ((strcmp(s1, "/=") == 0 && strcmp(s2, ".ne.") == 0)
- || (strcmp(s1, ".ne.") == 0 && strcmp(s2, "/=") == 0))
+ if ((strcmp(s1, "/=") == 0 && strcmp (s2, ".ne.") == 0)
+ || (strcmp(s1, ".ne.") == 0 && strcmp (s2, "/=") == 0))
break;
- if ((strcmp(s1, "<=") == 0 && strcmp(s2, ".le.") == 0)
- || (strcmp(s1, ".le.") == 0 && strcmp(s2, "<=") == 0))
+ if ((strcmp(s1, "<=") == 0 && strcmp (s2, ".le.") == 0)
+ || (strcmp(s1, ".le.") == 0 && strcmp (s2, "<=") == 0))
break;
- if ((strcmp(s1, "<") == 0 && strcmp(s2, ".lt.") == 0)
- || (strcmp(s1, ".lt.") == 0 && strcmp(s2, "<") == 0))
+ if ((strcmp(s1, "<") == 0 && strcmp (s2, ".lt.") == 0)
+ || (strcmp(s1, ".lt.") == 0 && strcmp (s2, "<") == 0))
break;
- if ((strcmp(s1, ">=") == 0 && strcmp(s2, ".ge.") == 0)
- || (strcmp(s1, ".ge.") == 0 && strcmp(s2, ">=") == 0))
+ if ((strcmp(s1, ">=") == 0 && strcmp (s2, ".ge.") == 0)
+ || (strcmp(s1, ".ge.") == 0 && strcmp (s2, ">=") == 0))
break;
- if ((strcmp(s1, ">") == 0 && strcmp(s2, ".gt.") == 0)
- || (strcmp(s1, ".gt.") == 0 && strcmp(s2, ">") == 0))
+ if ((strcmp(s1, ">") == 0 && strcmp (s2, ".gt.") == 0)
+ || (strcmp(s1, ".gt.") == 0 && strcmp (s2, ">") == 0))
break;
m = MATCH_ERROR;
@@ -1019,16 +1018,19 @@ generic_correspondence (gfc_formal_arglist *f1, gfc_formal_arglist *f2,
/* Check if the characteristics of two dummy arguments match,
cf. F08:12.3.2. */
-static gfc_try
+static bool
check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
bool type_must_agree, char *errmsg, int err_len)
{
+ if (s1 == NULL || s2 == NULL)
+ return s1 == s2 ? true : false;
+
/* Check type and rank. */
if (type_must_agree && !compare_type_rank (s2, s1))
{
snprintf (errmsg, err_len, "Type/rank mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
/* Check INTENT. */
@@ -1036,7 +1038,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "INTENT mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
/* Check OPTIONAL attribute. */
@@ -1044,7 +1046,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "OPTIONAL mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
/* Check ALLOCATABLE attribute. */
@@ -1052,7 +1054,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "ALLOCATABLE mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
/* Check POINTER attribute. */
@@ -1060,7 +1062,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "POINTER mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
/* Check TARGET attribute. */
@@ -1068,7 +1070,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "TARGET mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
/* FIXME: Do more comprehensive testing of attributes, like e.g.
@@ -1083,7 +1085,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "Interface mismatch in dummy procedure "
"'%s': %s", s1->name, err);
- return FAILURE;
+ return false;
}
}
@@ -1101,7 +1103,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
case -3:
snprintf (errmsg, err_len, "Character length mismatch "
"in argument '%s'", s1->name);
- return FAILURE;
+ return false;
case -2:
/* FIXME: Implement a warning for this case.
@@ -1129,7 +1131,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "Shape mismatch in argument '%s'",
s1->name);
- return FAILURE;
+ return false;
}
if (s1->as->type == AS_EXPLICIT)
@@ -1149,7 +1151,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
case -3:
snprintf (errmsg, err_len, "Shape mismatch in dimension %i of "
"argument '%s'", i + 1, s1->name);
- return FAILURE;
+ return false;
case -2:
/* FIXME: Implement a warning for this case.
@@ -1169,14 +1171,14 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
}
}
- return SUCCESS;
+ return true;
}
/* Check if the characteristics of two function results match,
cf. F08:12.3.3. */
-static gfc_try
+static bool
check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
char *errmsg, int err_len)
{
@@ -1186,13 +1188,13 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
r2 = s2->result ? s2->result : s2;
if (r1->ts.type == BT_UNKNOWN)
- return SUCCESS;
+ return true;
/* Check type and rank. */
if (!compare_type_rank (r1, r2))
{
snprintf (errmsg, err_len, "Type/rank mismatch in function result");
- return FAILURE;
+ return false;
}
/* Check ALLOCATABLE attribute. */
@@ -1200,7 +1202,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "ALLOCATABLE attribute mismatch in "
"function result");
- return FAILURE;
+ return false;
}
/* Check POINTER attribute. */
@@ -1208,7 +1210,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "POINTER attribute mismatch in "
"function result");
- return FAILURE;
+ return false;
}
/* Check CONTIGUOUS attribute. */
@@ -1216,7 +1218,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "CONTIGUOUS attribute mismatch in "
"function result");
- return FAILURE;
+ return false;
}
/* Check PROCEDURE POINTER attribute. */
@@ -1224,7 +1226,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "PROCEDURE POINTER mismatch in "
"function result");
- return FAILURE;
+ return false;
}
/* Check string length. */
@@ -1234,10 +1236,10 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
{
snprintf (errmsg, err_len, "Character length mismatch "
"in function result");
- return FAILURE;
+ return false;
}
- if (r1->ts.u.cl->length)
+ if (r1->ts.u.cl->length && r2->ts.u.cl->length)
{
int compval = gfc_dep_compare_expr (r1->ts.u.cl->length,
r2->ts.u.cl->length);
@@ -1248,7 +1250,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
case -3:
snprintf (errmsg, err_len, "Character length mismatch "
"in function result");
- return FAILURE;
+ return false;
case -2:
/* FIXME: Implement a warning for this case.
@@ -1276,7 +1278,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
if (r1->as->type != r2->as->type)
{
snprintf (errmsg, err_len, "Shape mismatch in function result");
- return FAILURE;
+ return false;
}
if (r1->as->type == AS_EXPLICIT)
@@ -1296,7 +1298,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
case -3:
snprintf (errmsg, err_len, "Shape mismatch in dimension %i of "
"function result", i + 1);
- return FAILURE;
+ return false;
case -2:
/* FIXME: Implement a warning for this case.
@@ -1315,7 +1317,7 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
}
}
- return SUCCESS;
+ return true;
}
@@ -1359,8 +1361,7 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
if (s1->attr.function && s2->attr.function)
{
/* If both are functions, check result characteristics. */
- if (check_result_characteristics (s1, s2, errmsg, err_len)
- == FAILURE)
+ if (!check_result_characteristics (s1, s2, errmsg, err_len))
return 0;
}
@@ -1420,8 +1421,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
if (strict_flag)
{
/* Check all characteristics. */
- if (check_dummy_characteristics (f1->sym, f2->sym,
- true, errmsg, err_len) == FAILURE)
+ if (!check_dummy_characteristics (f1->sym, f2->sym, true,
+ errmsg, err_len))
return 0;
}
else if (!compare_type_rank (f2->sym, f1->sym))
@@ -1488,9 +1489,9 @@ check_interface0 (gfc_interface *p, const char *interface_name)
/* F2003, C1207. F2008, C1207. */
if (p->sym->attr.proc == PROC_INTERNAL
- && gfc_notify_std (GFC_STD_F2008, "Internal procedure "
- "'%s' in %s at %L", p->sym->name, interface_name,
- &p->sym->declared_at) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "Internal procedure "
+ "'%s' in %s at %L", p->sym->name,
+ interface_name, &p->sym->declared_at))
return 1;
}
p = psave;
@@ -1876,7 +1877,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
gfc_add_function (&act_sym->attr, act_sym->name,
&act_sym->declared_at);
if (act_sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (act_sym, 1, act_sym->ns) == FAILURE)
+ && !gfc_set_default_type (act_sym, 1, act_sym->ns))
return 0;
}
else if (formal->attr.subroutine && !act_sym->attr.subroutine)
@@ -2475,7 +2476,7 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
/* Make sure that intrinsic vtables exist for calls to unlimited
polymorphic formal arguments. */
- if (UNLIMITED_POLY(f->sym)
+ if (UNLIMITED_POLY (f->sym)
&& a->expr->ts.type != BT_DERIVED
&& a->expr->ts.type != BT_CLASS)
gfc_find_intrinsic_vtab (&a->expr->ts);
@@ -2525,7 +2526,7 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
gfc_error ("Actual argument at %L to assumed-type dummy is of "
"derived type with type-bound or FINAL procedures",
&a->expr->where);
- return FAILURE;
+ return false;
}
}
@@ -2738,11 +2739,9 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
if (((f->sym->ts.type == BT_CLASS && f->sym->attr.class_ok
&& CLASS_DATA (f->sym)->attr.class_pointer)
|| (f->sym->ts.type != BT_CLASS && f->sym->attr.pointer))
- && gfc_check_vardef_context (a->expr, true, false, false, context)
- == FAILURE)
+ && !gfc_check_vardef_context (a->expr, true, false, false, context))
return 0;
- if (gfc_check_vardef_context (a->expr, false, false, false, context)
- == FAILURE)
+ if (!gfc_check_vardef_context (a->expr, false, false, false, context))
return 0;
}
@@ -2916,9 +2915,9 @@ pair_cmp (const void *p1, const void *p2)
/* Given two expressions from some actual arguments, test whether they
refer to the same expression. The analysis is conservative.
- Returning FAILURE will produce no warning. */
+ Returning false will produce no warning. */
-static gfc_try
+static bool
compare_actual_expr (gfc_expr *e1, gfc_expr *e2)
{
const gfc_ref *r1, *r2;
@@ -2927,39 +2926,39 @@ compare_actual_expr (gfc_expr *e1, gfc_expr *e2)
|| e1->expr_type != EXPR_VARIABLE
|| e2->expr_type != EXPR_VARIABLE
|| e1->symtree->n.sym != e2->symtree->n.sym)
- return FAILURE;
+ return false;
/* TODO: improve comparison, see expr.c:show_ref(). */
for (r1 = e1->ref, r2 = e2->ref; r1 && r2; r1 = r1->next, r2 = r2->next)
{
if (r1->type != r2->type)
- return FAILURE;
+ return false;
switch (r1->type)
{
case REF_ARRAY:
if (r1->u.ar.type != r2->u.ar.type)
- return FAILURE;
+ return false;
/* TODO: At the moment, consider only full arrays;
we could do better. */
if (r1->u.ar.type != AR_FULL || r2->u.ar.type != AR_FULL)
- return FAILURE;
+ return false;
break;
case REF_COMPONENT:
if (r1->u.c.component != r2->u.c.component)
- return FAILURE;
+ return false;
break;
case REF_SUBSTRING:
- return FAILURE;
+ return false;
default:
gfc_internal_error ("compare_actual_expr(): Bad component code");
}
}
if (!r1 && !r2)
- return SUCCESS;
- return FAILURE;
+ return true;
+ return false;
}
@@ -2967,7 +2966,7 @@ compare_actual_expr (gfc_expr *e1, gfc_expr *e2)
another, check that identical actual arguments aren't not
associated with some incompatible INTENTs. */
-static gfc_try
+static bool
check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
{
sym_intent f1_intent, f2_intent;
@@ -2975,7 +2974,7 @@ check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_actual_arglist *a1;
size_t n, i, j;
argpair *p;
- gfc_try t = SUCCESS;
+ bool t = true;
n = 0;
for (f1 = f, a1 = a;; f1 = f1->next, a1 = a1->next)
@@ -3012,7 +3011,7 @@ check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_internal_error ("check_some_aliasing(): corrupted data");
/* Are the expression the same? */
- if (compare_actual_expr (p[i].a->expr, p[j].a->expr) == FAILURE)
+ if (!compare_actual_expr (p[i].a->expr, p[j].a->expr))
break;
f2_intent = p[j].f->sym->attr.intent;
if ((f1_intent == INTENT_IN && f2_intent == INTENT_OUT)
@@ -3023,7 +3022,7 @@ check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_intent_string (f1_intent), p[i].f->sym->name,
gfc_intent_string (f2_intent), p[j].f->sym->name,
&p[i].a->expr->where);
- t = FAILURE;
+ t = false;
}
}
}
@@ -3036,7 +3035,7 @@ check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
another, check that they are compatible in the sense that intents
are not mismatched. */
-static gfc_try
+static bool
check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
{
sym_intent f_intent;
@@ -3062,7 +3061,7 @@ check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_error ("Procedure argument at %L is local to a PURE "
"procedure and has the POINTER attribute",
&a->expr->where);
- return FAILURE;
+ return false;
}
}
@@ -3074,7 +3073,7 @@ check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_error ("Coindexed actual argument at %L in PURE procedure "
"is passed to an INTENT(%s) argument",
&a->expr->where, gfc_intent_string (f_intent));
- return FAILURE;
+ return false;
}
if ((f->sym->ts.type == BT_CLASS && f->sym->attr.class_ok
@@ -3084,7 +3083,7 @@ check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_error ("Coindexed actual argument at %L in PURE procedure "
"is passed to a POINTER dummy argument",
&a->expr->where);
- return FAILURE;
+ return false;
}
}
@@ -3095,11 +3094,11 @@ check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_error ("Coindexed polymorphic actual argument at %L is passed "
"polymorphic dummy argument '%s'",
&a->expr->where, f->sym->name);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -3107,7 +3106,7 @@ check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
well, the actual argument list will also end up being properly
sorted. */
-gfc_try
+bool
gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
{
gfc_formal_arglist *dummy_args;
@@ -3136,7 +3135,7 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
gfc_error("The pointer object '%s' at %L must have an explicit "
"function interface or be declared as array",
sym->name, where);
- return FAILURE;
+ return false;
}
if (sym->attr.allocatable && !sym->attr.external)
@@ -3144,14 +3143,14 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
gfc_error("The allocatable object '%s' at %L must have an explicit "
"function interface or be declared as array",
sym->name, where);
- return FAILURE;
+ return false;
}
if (sym->attr.allocatable)
{
gfc_error("Allocatable function '%s' at %L must have an explicit "
"function interface", sym->name, where);
- return FAILURE;
+ return false;
}
for (a = *ap; a; a = a->next)
@@ -3191,7 +3190,7 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
&& a->expr->ts.type == BT_UNKNOWN)
{
gfc_error ("MOLD argument to NULL required at %L", &a->expr->where);
- return FAILURE;
+ return false;
}
/* TS 29113, C407b. */
@@ -3200,25 +3199,25 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
{
gfc_error ("Assumed-rank argument requires an explicit interface "
"at %L", &a->expr->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
dummy_args = gfc_sym_get_dummy_args (sym);
if (!compare_actual_formal (ap, dummy_args, 0, sym->attr.elemental, where))
- return FAILURE;
+ return false;
- if (check_intents (dummy_args, *ap) == FAILURE)
- return FAILURE;
+ if (!check_intents (dummy_args, *ap))
+ return false;
if (gfc_option.warn_aliasing)
check_some_aliasing (dummy_args, *ap);
- return SUCCESS;
+ return true;
}
@@ -3424,7 +3423,7 @@ matching_typebound_op (gfc_expr** tb_base,
{
gfc_typebound_proc* tb;
gfc_symbol* derived;
- gfc_try result;
+ bool result;
while (base->expr->expr_type == EXPR_OP
&& base->expr->value.op.op == INTRINSIC_PARENTHESES)
@@ -3459,7 +3458,7 @@ matching_typebound_op (gfc_expr** tb_base,
/* This means we hit a PRIVATE operator which is use-associated and
should thus not be seen. */
- if (result == FAILURE)
+ if (!result)
tb = NULL;
/* Look through the super-type hierarchy for a matching specific
@@ -3650,13 +3649,13 @@ gfc_extend_expr (gfc_expr *e)
a call to it and succeed. */
if (tbo)
{
- gfc_try result;
+ bool result;
gcc_assert (tb_base);
build_compcall_for_operator (e, actual, tb_base, tbo, gname);
result = gfc_resolve_expr (e);
- if (result == FAILURE)
+ if (!result)
return MATCH_ERROR;
return MATCH_YES;
@@ -3678,7 +3677,7 @@ gfc_extend_expr (gfc_expr *e)
e->value.function.name = NULL;
e->user_operator = 1;
- if (gfc_resolve_expr (e) == FAILURE)
+ if (!gfc_resolve_expr (e))
return MATCH_ERROR;
return MATCH_YES;
@@ -3687,10 +3686,10 @@ gfc_extend_expr (gfc_expr *e)
/* Tries to replace an assignment code node with a subroutine call to
the subroutine associated with the assignment operator. Return
- SUCCESS if the node was replaced. On FAILURE, no error is
+ true if the node was replaced. On false, no error is
generated. */
-gfc_try
+bool
gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
{
gfc_actual_arglist *actual;
@@ -3708,7 +3707,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
&& (rhs->rank == 0 || rhs->rank == lhs->rank)
&& (lhs->ts.type == rhs->ts.type
|| (gfc_numeric_ts (&lhs->ts) && gfc_numeric_ts (&rhs->ts))))
- return FAILURE;
+ return false;
actual = gfc_get_actual_arglist ();
actual->expr = lhs;
@@ -3750,12 +3749,12 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
/* c is resolved from the caller, so no need to do it here. */
- return SUCCESS;
+ return true;
}
free (actual->next);
free (actual);
- return FAILURE;
+ return false;
}
/* Replace the assignment with the call. */
@@ -3765,7 +3764,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
c->expr2 = NULL;
c->ext.actual = actual;
- return SUCCESS;
+ return true;
}
@@ -3773,7 +3772,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
the given interface list. Ambiguity isn't checked yet since module
procedures can be present without interfaces. */
-gfc_try
+bool
gfc_check_new_interface (gfc_interface *base, gfc_symbol *new_sym, locus loc)
{
gfc_interface *ip;
@@ -3784,17 +3783,17 @@ gfc_check_new_interface (gfc_interface *base, gfc_symbol *new_sym, locus loc)
{
gfc_error ("Entity '%s' at %L is already present in the interface",
new_sym->name, &loc);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
/* Add a symbol to the current interface. */
-gfc_try
+bool
gfc_add_interface (gfc_symbol *new_sym)
{
gfc_interface **head, *intr;
@@ -3805,7 +3804,7 @@ gfc_add_interface (gfc_symbol *new_sym)
{
case INTERFACE_NAMELESS:
case INTERFACE_ABSTRACT:
- return SUCCESS;
+ return true;
case INTERFACE_INTRINSIC_OP:
for (ns = current_interface.ns; ns; ns = ns->parent)
@@ -3813,62 +3812,62 @@ gfc_add_interface (gfc_symbol *new_sym)
{
case INTRINSIC_EQ:
case INTRINSIC_EQ_OS:
- if (gfc_check_new_interface (ns->op[INTRINSIC_EQ], new_sym,
- gfc_current_locus) == FAILURE
- || gfc_check_new_interface (ns->op[INTRINSIC_EQ_OS], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[INTRINSIC_EQ], new_sym,
+ gfc_current_locus)
+ || !gfc_check_new_interface (ns->op[INTRINSIC_EQ_OS],
+ new_sym, gfc_current_locus))
+ return false;
break;
case INTRINSIC_NE:
case INTRINSIC_NE_OS:
- if (gfc_check_new_interface (ns->op[INTRINSIC_NE], new_sym,
- gfc_current_locus) == FAILURE
- || gfc_check_new_interface (ns->op[INTRINSIC_NE_OS], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[INTRINSIC_NE], new_sym,
+ gfc_current_locus)
+ || !gfc_check_new_interface (ns->op[INTRINSIC_NE_OS],
+ new_sym, gfc_current_locus))
+ return false;
break;
case INTRINSIC_GT:
case INTRINSIC_GT_OS:
- if (gfc_check_new_interface (ns->op[INTRINSIC_GT], new_sym,
- gfc_current_locus) == FAILURE
- || gfc_check_new_interface (ns->op[INTRINSIC_GT_OS], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[INTRINSIC_GT],
+ new_sym, gfc_current_locus)
+ || !gfc_check_new_interface (ns->op[INTRINSIC_GT_OS],
+ new_sym, gfc_current_locus))
+ return false;
break;
case INTRINSIC_GE:
case INTRINSIC_GE_OS:
- if (gfc_check_new_interface (ns->op[INTRINSIC_GE], new_sym,
- gfc_current_locus) == FAILURE
- || gfc_check_new_interface (ns->op[INTRINSIC_GE_OS], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[INTRINSIC_GE],
+ new_sym, gfc_current_locus)
+ || !gfc_check_new_interface (ns->op[INTRINSIC_GE_OS],
+ new_sym, gfc_current_locus))
+ return false;
break;
case INTRINSIC_LT:
case INTRINSIC_LT_OS:
- if (gfc_check_new_interface (ns->op[INTRINSIC_LT], new_sym,
- gfc_current_locus) == FAILURE
- || gfc_check_new_interface (ns->op[INTRINSIC_LT_OS], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[INTRINSIC_LT],
+ new_sym, gfc_current_locus)
+ || !gfc_check_new_interface (ns->op[INTRINSIC_LT_OS],
+ new_sym, gfc_current_locus))
+ return false;
break;
case INTRINSIC_LE:
case INTRINSIC_LE_OS:
- if (gfc_check_new_interface (ns->op[INTRINSIC_LE], new_sym,
- gfc_current_locus) == FAILURE
- || gfc_check_new_interface (ns->op[INTRINSIC_LE_OS], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[INTRINSIC_LE],
+ new_sym, gfc_current_locus)
+ || !gfc_check_new_interface (ns->op[INTRINSIC_LE_OS],
+ new_sym, gfc_current_locus))
+ return false;
break;
default:
- if (gfc_check_new_interface (ns->op[current_interface.op], new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (ns->op[current_interface.op],
+ new_sym, gfc_current_locus))
+ return false;
}
head = &current_interface.ns->op[current_interface.op];
@@ -3881,18 +3880,18 @@ gfc_add_interface (gfc_symbol *new_sym)
if (sym == NULL)
continue;
- if (gfc_check_new_interface (sym->generic, new_sym, gfc_current_locus)
- == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (sym->generic,
+ new_sym, gfc_current_locus))
+ return false;
}
head = &current_interface.sym->generic;
break;
case INTERFACE_USER_OP:
- if (gfc_check_new_interface (current_interface.uop->op, new_sym,
- gfc_current_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (current_interface.uop->op,
+ new_sym, gfc_current_locus))
+ return false;
head = &current_interface.uop->op;
break;
@@ -3908,7 +3907,7 @@ gfc_add_interface (gfc_symbol *new_sym)
intr->next = *head;
*head = intr;
- return SUCCESS;
+ return true;
}
@@ -3977,7 +3976,7 @@ gfc_free_formal_arglist (gfc_formal_arglist *p)
/* Check that it is ok for the type-bound procedure 'proc' to override the
procedure 'old', cf. F08:4.5.7.3. */
-gfc_try
+bool
gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
locus where;
@@ -3995,7 +3994,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("Can't overwrite GENERIC '%s' at %L",
old->name, &proc->n.tb->where);
- return FAILURE;
+ return false;
}
where = proc->n.tb->where;
@@ -4007,7 +4006,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a procedure binding declared"
" NON_OVERRIDABLE", proc->name, &where);
- return FAILURE;
+ return false;
}
/* It's an error to override a non-DEFERRED procedure with a DEFERRED one. */
@@ -4015,7 +4014,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L must not be DEFERRED as it overrides a"
" non-DEFERRED binding", proc->name, &where);
- return FAILURE;
+ return false;
}
/* If the overridden binding is PURE, the overriding must be, too. */
@@ -4023,7 +4022,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a PURE procedure and must also be PURE",
proc->name, &where);
- return FAILURE;
+ return false;
}
/* If the overridden binding is ELEMENTAL, the overriding must be, too. If it
@@ -4032,13 +4031,13 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides an ELEMENTAL procedure and must also be"
" ELEMENTAL", proc->name, &where);
- return FAILURE;
+ return false;
}
if (!old_target->attr.elemental && proc_target->attr.elemental)
{
gfc_error ("'%s' at %L overrides a non-ELEMENTAL procedure and must not"
" be ELEMENTAL, either", proc->name, &where);
- return FAILURE;
+ return false;
}
/* If the overridden binding is a SUBROUTINE, the overriding must also be a
@@ -4047,7 +4046,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a SUBROUTINE and must also be a"
" SUBROUTINE", proc->name, &where);
- return FAILURE;
+ return false;
}
/* If the overridden binding is a FUNCTION, the overriding must also be a
@@ -4058,15 +4057,15 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a FUNCTION and must also be a"
" FUNCTION", proc->name, &where);
- return FAILURE;
+ return false;
}
- if (check_result_characteristics (proc_target, old_target,
- err, sizeof(err)) == FAILURE)
+ if (!check_result_characteristics (proc_target, old_target, err,
+ sizeof(err)))
{
gfc_error ("Result mismatch for the overriding procedure "
"'%s' at %L: %s", proc->name, &where, err);
- return FAILURE;
+ return false;
}
}
@@ -4077,7 +4076,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a PUBLIC procedure and must not be"
" PRIVATE", proc->name, &where);
- return FAILURE;
+ return false;
}
/* Compare the formal argument lists of both procedures. This is also abused
@@ -4109,16 +4108,16 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
" to match the corresponding argument of the overridden"
" procedure", proc_formal->sym->name, proc->name, &where,
old_formal->sym->name);
- return FAILURE;
+ return false;
}
check_type = proc_pass_arg != argpos && old_pass_arg != argpos;
- if (check_dummy_characteristics (proc_formal->sym, old_formal->sym,
- check_type, err, sizeof(err)) == FAILURE)
+ if (!check_dummy_characteristics (proc_formal->sym, old_formal->sym,
+ check_type, err, sizeof(err)))
{
gfc_error ("Argument mismatch for the overriding procedure "
"'%s' at %L: %s", proc->name, &where, err);
- return FAILURE;
+ return false;
}
++argpos;
@@ -4127,7 +4126,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L must have the same number of formal arguments as"
" the overridden procedure", proc->name, &where);
- return FAILURE;
+ return false;
}
/* If the overridden binding is NOPASS, the overriding one must also be
@@ -4136,7 +4135,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a NOPASS binding and must also be"
" NOPASS", proc->name, &where);
- return FAILURE;
+ return false;
}
/* If the overridden binding is PASS(x), the overriding one must also be
@@ -4147,7 +4146,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
{
gfc_error ("'%s' at %L overrides a binding with PASS and must also be"
" PASS", proc->name, &where);
- return FAILURE;
+ return false;
}
if (proc_pass_arg != old_pass_arg)
@@ -4155,9 +4154,9 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
gfc_error ("Passed-object dummy argument of '%s' at %L must be at"
" the same position as the passed-object dummy argument of"
" the overridden procedure", proc->name, &where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 64df2965684..c43127978af 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -178,7 +178,7 @@ find_char_conv (gfc_typespec *from, gfc_typespec *to)
and call the proper check function rather than forcing each
function to manipulate the argument list. */
-static gfc_try
+static bool
do_check (gfc_intrinsic_sym *specific, gfc_actual_arglist *arg)
{
gfc_expr *a1, *a2, *a3, *a4, *a5;
@@ -343,7 +343,7 @@ add_sym (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type
static void
add_sym_0 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (void),
+ bool (*check) (void),
gfc_expr *(*simplify) (void),
void (*resolve) (gfc_expr *))
{
@@ -386,7 +386,7 @@ add_sym_0s (const char *name, gfc_isym_id id, int standard,
static void
add_sym_1 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_expr *),
+ bool (*check) (gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1)
@@ -411,7 +411,7 @@ add_sym_1 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_1_intent (const char *name, gfc_isym_id id, enum klass cl,
int actual_ok, bt type, int kind, int standard,
- gfc_try (*check) (gfc_expr *),
+ bool (*check) (gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -436,7 +436,7 @@ add_sym_1_intent (const char *name, gfc_isym_id id, enum klass cl,
static void
add_sym_1s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
- int standard, gfc_try (*check) (gfc_expr *),
+ int standard, bool (*check) (gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *), void (*resolve) (gfc_code *),
const char *a1, bt type1, int kind1, int optional1,
sym_intent intent1)
@@ -461,7 +461,7 @@ add_sym_1s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
static void
add_sym_1m (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_actual_arglist *),
+ bool (*check) (gfc_actual_arglist *),
gfc_expr *(*simplify) (gfc_expr *),
void (*resolve) (gfc_expr *, gfc_actual_arglist *),
const char *a1, bt type1, int kind1, int optional1,
@@ -488,7 +488,7 @@ add_sym_1m (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt t
static void
add_sym_2 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -515,7 +515,7 @@ add_sym_2 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_2_intent (const char *name, gfc_isym_id id, enum klass cl,
int actual_ok, bt type, int kind, int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -543,7 +543,7 @@ add_sym_2_intent (const char *name, gfc_isym_id id, enum klass cl,
static void
add_sym_2s (const char *name, gfc_isym_id id, enum klass cl, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *),
void (*resolve) (gfc_code *),
const char *a1, bt type1, int kind1, int optional1,
@@ -571,7 +571,7 @@ add_sym_2s (const char *name, gfc_isym_id id, enum klass cl, bt type,
static void
add_sym_3 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -600,7 +600,7 @@ add_sym_3 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_3ml (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_actual_arglist *),
+ bool (*check) (gfc_actual_arglist *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -629,7 +629,7 @@ add_sym_3ml (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt
static void
add_sym_3red (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_actual_arglist *),
+ bool (*check) (gfc_actual_arglist *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -658,7 +658,7 @@ add_sym_3red (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt
static void
add_sym_3s (const char *name, gfc_isym_id id, enum klass cl, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_code *),
const char *a1, bt type1, int kind1, int optional1,
@@ -688,7 +688,7 @@ add_sym_3s (const char *name, gfc_isym_id id, enum klass cl, bt type,
static void
add_sym_4 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
@@ -721,7 +721,7 @@ add_sym_4 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_4s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
+ bool (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *),
void (*resolve) (gfc_code *),
@@ -754,7 +754,7 @@ add_sym_4s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
static void
add_sym_5s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
int standard,
- gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
+ bool (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *, gfc_expr *),
@@ -981,7 +981,7 @@ gfc_is_intrinsic (gfc_symbol* sym, int subroutine_flag, locus loc)
return false;
/* See if this intrinsic is allowed in the current standard. */
- if (gfc_check_intrinsic_standard (isym, &symstd, false, loc) == FAILURE)
+ if (!gfc_check_intrinsic_standard (isym, &symstd, false, loc))
{
if (sym->attr.proc == PROC_UNKNOWN
&& gfc_option.warn_intrinsics_std)
@@ -3574,9 +3574,9 @@ remove_nullargs (gfc_actual_arglist **ap)
with the format arglist. Arguments that are not present are given
a blank gfc_actual_arglist structure. If something is obviously
wrong (say, a missing required argument) we abort sorting and
- return FAILURE. */
+ return false. */
-static gfc_try
+static bool
sort_actual (const char *name, gfc_actual_arglist **ap,
gfc_intrinsic_arg *formal, locus *where)
{
@@ -3593,7 +3593,7 @@ sort_actual (const char *name, gfc_actual_arglist **ap,
a = actual;
if (f == NULL && a == NULL) /* No arguments */
- return SUCCESS;
+ return true;
for (;;)
{ /* Put the nonkeyword arguments in a 1:1 correspondence */
@@ -3615,7 +3615,7 @@ sort_actual (const char *name, gfc_actual_arglist **ap,
goto do_sort;
gfc_error ("Too many arguments in call to '%s' at %L", name, where);
- return FAILURE;
+ return false;
keywords:
/* Associate the remaining actual arguments, all of which have
@@ -3634,14 +3634,14 @@ keywords:
else
gfc_error ("Can't find keyword named '%s' in call to '%s' at %L",
a->name, name, where);
- return FAILURE;
+ return false;
}
if (f->actual != NULL)
{
gfc_error ("Argument '%s' appears twice in call to '%s' at %L",
f->name, name, where);
- return FAILURE;
+ return false;
}
f->actual = a;
@@ -3655,7 +3655,7 @@ optional:
{
gfc_error ("Missing actual argument '%s' in call to '%s' at %L",
f->name, name, where);
- return FAILURE;
+ return false;
}
}
@@ -3669,7 +3669,7 @@ do_sort:
if (f->actual && f->actual->label != NULL && f->ts.type)
{
gfc_error ("ALTERNATE RETURN not permitted at %L", where);
- return FAILURE;
+ return false;
}
if (f->actual == NULL)
@@ -3689,7 +3689,7 @@ do_sort:
}
actual->next = NULL; /* End the sorted argument list. */
- return SUCCESS;
+ return true;
}
@@ -3697,7 +3697,7 @@ do_sort:
list. The lists are checked for agreement of type. We don't check
for arrayness here. */
-static gfc_try
+static bool
check_arglist (gfc_actual_arglist **ap, gfc_intrinsic_sym *sym,
int error_flag)
{
@@ -3730,7 +3730,7 @@ check_arglist (gfc_actual_arglist **ap, gfc_intrinsic_sym *sym,
gfc_current_intrinsic, &actual->expr->where,
gfc_typename (&formal->ts),
gfc_typename (&actual->expr->ts));
- return FAILURE;
+ return false;
}
/* If the formal argument is INTENT([IN]OUT), check for definability. */
@@ -3741,13 +3741,12 @@ check_arglist (gfc_actual_arglist **ap, gfc_intrinsic_sym *sym,
: NULL);
/* No pointer arguments for intrinsics. */
- if (gfc_check_vardef_context (actual->expr, false, false, false,
- context) == FAILURE)
- return FAILURE;
+ if (!gfc_check_vardef_context (actual->expr, false, false, false, context))
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -3838,11 +3837,11 @@ resolve_intrinsic (gfc_intrinsic_sym *specific, gfc_expr *e)
/* Given an intrinsic symbol node and an expression node, call the
simplification function (if there is one), perhaps replacing the
- expression with something simpler. We return FAILURE on an error
- of the simplification, SUCCESS if the simplification worked, even
+ expression with something simpler. We return false on an error
+ of the simplification, true if the simplification worked, even
if nothing has changed in the expression itself. */
-static gfc_try
+static bool
do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e)
{
gfc_expr *result, *a1, *a2, *a3, *a4, *a5;
@@ -3926,7 +3925,7 @@ do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e)
finish:
if (result == &gfc_bad_expr)
- return FAILURE;
+ return false;
if (result == NULL)
resolve_intrinsic (specific, e); /* Must call at run-time */
@@ -3936,12 +3935,12 @@ finish:
gfc_replace_expr (e, result);
}
- return SUCCESS;
+ return true;
}
/* Initialize the gfc_current_intrinsic_arg[] array for the benefit of
- error messages. This subroutine returns FAILURE if a subroutine
+ error messages. This subroutine returns false if a subroutine
has more than MAX_INTRINSIC_ARGS, in which case the actual argument
list cannot match any intrinsic. */
@@ -3965,14 +3964,14 @@ init_arglist (gfc_intrinsic_sym *isym)
/* Given a pointer to an intrinsic symbol and an expression consisting
of a function call, see if the function call is consistent with the
- intrinsic's formal argument list. Return SUCCESS if the expression
- and intrinsic match, FAILURE otherwise. */
+ intrinsic's formal argument list. Return true if the expression
+ and intrinsic match, false otherwise. */
-static gfc_try
+static bool
check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
{
gfc_actual_arglist *arg, **ap;
- gfc_try t;
+ bool t;
ap = &expr->value.function.actual;
@@ -3985,9 +3984,8 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
|| specific->check.f1m == gfc_check_min_max_double)
return (*specific->check.f1m) (*ap);
- if (sort_actual (specific->name, ap, specific->formal,
- &expr->where) == FAILURE)
- return FAILURE;
+ if (!sort_actual (specific->name, ap, specific->formal, &expr->where))
+ return false;
if (specific->check.f3ml == gfc_check_minloc_maxloc)
/* This is special because we might have to reorder the argument list. */
@@ -4008,7 +4006,7 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
if (specific->check.f1 == NULL)
{
t = check_arglist (ap, specific, error_flag);
- if (t == SUCCESS)
+ if (t)
expr->ts = specific->ts;
}
else
@@ -4016,7 +4014,7 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
}
/* Check conformance of elemental intrinsics. */
- if (t == SUCCESS && specific->elemental)
+ if (t && specific->elemental)
{
int n = 0;
gfc_expr *first_expr;
@@ -4027,16 +4025,16 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
first_expr = arg->expr;
for ( ; arg && arg->expr; arg = arg->next, n++)
- if (gfc_check_conformance (first_expr, arg->expr,
- "arguments '%s' and '%s' for "
- "intrinsic '%s'",
- gfc_current_intrinsic_arg[0]->name,
- gfc_current_intrinsic_arg[n]->name,
- gfc_current_intrinsic) == FAILURE)
- return FAILURE;
+ if (!gfc_check_conformance (first_expr, arg->expr,
+ "arguments '%s' and '%s' for "
+ "intrinsic '%s'",
+ gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic_arg[n]->name,
+ gfc_current_intrinsic))
+ return false;
}
- if (t == FAILURE)
+ if (!t)
remove_nullargs (ap);
return t;
@@ -4049,9 +4047,9 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
textual representation of the symbols standard status (like
"new in Fortran 2008", "a GNU extension" or "obsolescent in Fortran 95") that
can be used to construct a detailed warning/error message in case of
- a FAILURE. */
+ a false. */
-gfc_try
+bool
gfc_check_intrinsic_standard (const gfc_intrinsic_sym* isym,
const char** symstd, bool silent, locus where)
{
@@ -4059,7 +4057,7 @@ gfc_check_intrinsic_standard (const gfc_intrinsic_sym* isym,
/* For -fall-intrinsics, just succeed. */
if (gfc_option.flag_all_intrinsics)
- return SUCCESS;
+ return true;
/* Find the symbol's standard message for later usage. */
switch (isym->standard)
@@ -4113,17 +4111,17 @@ gfc_check_intrinsic_standard (const gfc_intrinsic_sym* isym,
gfc_warning ("Intrinsic '%s' (is %s) is used at %L",
isym->name, _(symstd_msg), &where);
- return SUCCESS;
+ return true;
}
/* If allowing the symbol's standard, succeed, too. */
if (gfc_option.allow_std & isym->standard)
- return SUCCESS;
+ return true;
/* Otherwise, fail. */
if (symstd)
*symstd = _(symstd_msg);
- return FAILURE;
+ return false;
}
@@ -4149,7 +4147,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
int flag;
if (expr->value.function.isym != NULL)
- return (do_simplify (expr->value.function.isym, expr) == FAILURE)
+ return (!do_simplify(expr->value.function.isym, expr))
? MATCH_ERROR : MATCH_YES;
if (!error_flag)
@@ -4181,9 +4179,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
if ((isym->id == GFC_ISYM_REAL || isym->id == GFC_ISYM_DBLE
|| isym->id == GFC_ISYM_CMPLX)
&& gfc_init_expr_flag
- && gfc_notify_std (GFC_STD_F2003, "Function '%s' "
- "as initialization expression at %L", name,
- &expr->where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "Function '%s' as initialization "
+ "expression at %L", name, &expr->where))
{
if (!error_flag)
gfc_pop_suppress_errors ();
@@ -4197,7 +4194,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
{
init_arglist (isym);
- if (isym->check.f1m (expr->value.function.actual) == SUCCESS)
+ if (isym->check.f1m(expr->value.function.actual))
goto got_specific;
if (!error_flag)
@@ -4218,7 +4215,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
{
if (specific == isym)
continue;
- if (check_specific (specific, expr, 0) == SUCCESS)
+ if (check_specific (specific, expr, 0))
{
gfc_pop_suppress_errors ();
goto got_specific;
@@ -4228,7 +4225,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
gfc_pop_suppress_errors ();
- if (check_specific (isym, expr, error_flag) == FAILURE)
+ if (!check_specific (isym, expr, error_flag))
{
if (!error_flag)
gfc_pop_suppress_errors ();
@@ -4244,7 +4241,7 @@ got_specific:
if (!error_flag)
gfc_pop_suppress_errors ();
- if (do_simplify (specific, expr) == FAILURE)
+ if (!do_simplify (specific, expr))
return MATCH_ERROR;
/* F95, 7.1.6.1, Initialization expressions
@@ -4257,9 +4254,9 @@ got_specific:
where each argument is an initialization expression */
if (gfc_init_expr_flag && isym->elemental && flag
- && gfc_notify_std (GFC_STD_F2003, "Elemental function "
- "as initialization expression with non-integer/non-"
- "character arguments at %L", &expr->where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "Elemental function as "
+ "initialization expression with non-integer/non-"
+ "character arguments at %L", &expr->where))
return MATCH_ERROR;
return MATCH_YES;
@@ -4295,17 +4292,17 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
init_arglist (isym);
- if (sort_actual (name, &c->ext.actual, isym->formal, &c->loc) == FAILURE)
+ if (!sort_actual (name, &c->ext.actual, isym->formal, &c->loc))
goto fail;
if (isym->check.f1 != NULL)
{
- if (do_check (isym, c->ext.actual) == FAILURE)
+ if (!do_check (isym, c->ext.actual))
goto fail;
}
else
{
- if (check_arglist (&c->ext.actual, isym, 1) == FAILURE)
+ if (!check_arglist (&c->ext.actual, isym, 1))
goto fail;
}
@@ -4343,7 +4340,7 @@ fail:
/* Call gfc_convert_type() with warning enabled. */
-gfc_try
+bool
gfc_convert_type (gfc_expr *expr, gfc_typespec *ts, int eflag)
{
return gfc_convert_type_warn (expr, ts, eflag, 1);
@@ -4360,7 +4357,7 @@ gfc_convert_type (gfc_expr *expr, gfc_typespec *ts, int eflag)
'wflag' controls the warning related to conversion. */
-gfc_try
+bool
gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
{
gfc_intrinsic_sym *sym;
@@ -4381,7 +4378,7 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
{
/* Sometimes the RHS acquire the type. */
expr->ts = *ts;
- return SUCCESS;
+ return true;
}
if (expr->ts.type == BT_UNKNOWN)
@@ -4389,7 +4386,7 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
if (expr->ts.type == BT_DERIVED && ts->type == BT_DERIVED
&& gfc_compare_types (&expr->ts, ts))
- return SUCCESS;
+ return true;
sym = find_conv (&expr->ts, ts);
if (sym == NULL)
@@ -4499,22 +4496,22 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
expr->ts = *ts;
if (gfc_is_constant_expr (expr->value.function.actual->expr)
- && do_simplify (sym, expr) == FAILURE)
+ && !do_simplify (sym, expr))
{
if (eflag == 2)
goto bad;
- return FAILURE; /* Error already generated in do_simplify() */
+ return false; /* Error already generated in do_simplify() */
}
- return SUCCESS;
+ return true;
bad:
if (eflag == 1)
{
gfc_error ("Can't convert %s to %s at %L",
gfc_typename (&from_ts), gfc_typename (ts), &expr->where);
- return FAILURE;
+ return false;
}
gfc_internal_error ("Can't convert %s to %s at %L",
@@ -4524,7 +4521,7 @@ bad:
}
-gfc_try
+bool
gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
{
gfc_intrinsic_sym *sym;
@@ -4568,13 +4565,13 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
expr->ts = *ts;
if (gfc_is_constant_expr (expr->value.function.actual->expr)
- && do_simplify (sym, expr) == FAILURE)
+ && !do_simplify (sym, expr))
{
/* Error already generated in do_simplify() */
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -4600,8 +4597,8 @@ gfc_warn_intrinsic_shadow (const gfc_symbol* sym, bool in_module, bool func)
/* If no intrinsic was found with this name or it's not included in the
selected standard, everything's fine. */
- if (!isym || gfc_check_intrinsic_standard (isym, NULL, true,
- sym->declared_at) == FAILURE)
+ if (!isym || !gfc_check_intrinsic_standard (isym, NULL, true,
+ sym->declared_at))
return;
/* Emit the warning. */
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 347d71df8f2..363bf387716 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -25,195 +25,195 @@ extern gfc_expr gfc_bad_expr;
/* Check functions. */
-gfc_try gfc_check_a_ikind (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_a_xkind (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_a_p (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_x_yd (gfc_expr *, gfc_expr *);
+bool gfc_check_a_ikind (gfc_expr *, gfc_expr *);
+bool gfc_check_a_xkind (gfc_expr *, gfc_expr *);
+bool gfc_check_a_p (gfc_expr *, gfc_expr *);
+bool gfc_check_x_yd (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_abs (gfc_expr *);
-gfc_try gfc_check_access_func (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_achar (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_all_any (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_allocated (gfc_expr *);
-gfc_try gfc_check_associated (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_atan_2 (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_atan2 (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_atomic_def (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_atomic_ref (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_besn (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_bessel_n2 (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_bge_bgt_ble_blt (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_bitfcn (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_char (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_chdir (gfc_expr *);
-gfc_try gfc_check_chmod (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_complex (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_count (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_cshift (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ctime (gfc_expr *);
-gfc_try gfc_check_datan2 (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_dcmplx (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_dble (gfc_expr *);
-gfc_try gfc_check_digits (gfc_expr *);
-gfc_try gfc_check_dot_product (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_dprod (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_dshift (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_eoshift (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_dtime_etime (gfc_expr *);
-gfc_try gfc_check_fgetputc (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_fgetput (gfc_expr *);
-gfc_try gfc_check_float (gfc_expr *);
-gfc_try gfc_check_fstat (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ftell (gfc_expr *);
-gfc_try gfc_check_fn_c (gfc_expr *);
-gfc_try gfc_check_fn_d (gfc_expr *);
-gfc_try gfc_check_fn_r (gfc_expr *);
-gfc_try gfc_check_fn_rc (gfc_expr *);
-gfc_try gfc_check_fn_rc2008 (gfc_expr *);
-gfc_try gfc_check_fnum (gfc_expr *);
-gfc_try gfc_check_hostnm (gfc_expr *);
-gfc_try gfc_check_huge (gfc_expr *);
-gfc_try gfc_check_hypot (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_i (gfc_expr *);
-gfc_try gfc_check_iand (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_and (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ibits (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ichar_iachar (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_idnint (gfc_expr *);
-gfc_try gfc_check_ieor (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_index (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_int (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_intconv (gfc_expr *);
-gfc_try gfc_check_ior (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_irand (gfc_expr *);
-gfc_try gfc_check_isatty (gfc_expr *);
-gfc_try gfc_check_isnan (gfc_expr *);
-gfc_try gfc_check_ishft (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_kill (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_kind (gfc_expr *);
-gfc_try gfc_check_lbound (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_lcobound (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_len_lentrim (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_link (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_lge_lgt_lle_llt (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_loc (gfc_expr *);
-gfc_try gfc_check_logical (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_min_max (gfc_actual_arglist *);
-gfc_try gfc_check_min_max_integer (gfc_actual_arglist *);
-gfc_try gfc_check_min_max_real (gfc_actual_arglist *);
-gfc_try gfc_check_min_max_double (gfc_actual_arglist *);
-gfc_try gfc_check_malloc (gfc_expr *);
-gfc_try gfc_check_mask (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_matmul (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_merge (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_merge_bits (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_minloc_maxloc (gfc_actual_arglist *);
-gfc_try gfc_check_minval_maxval (gfc_actual_arglist *);
-gfc_try gfc_check_nearest (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_new_line (gfc_expr *);
-gfc_try gfc_check_norm2 (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_null (gfc_expr *);
-gfc_try gfc_check_pack (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_parity (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_precision (gfc_expr *);
-gfc_try gfc_check_present (gfc_expr *);
-gfc_try gfc_check_product_sum (gfc_actual_arglist *);
-gfc_try gfc_check_radix (gfc_expr *);
-gfc_try gfc_check_rand (gfc_expr *);
-gfc_try gfc_check_range (gfc_expr *);
-gfc_try gfc_check_rank (gfc_expr *);
-gfc_try gfc_check_real (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_rename (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_repeat (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_same_type_as (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_scale (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_second_sub (gfc_expr *);
-gfc_try gfc_check_secnds (gfc_expr *);
-gfc_try gfc_check_selected_char_kind (gfc_expr *);
-gfc_try gfc_check_selected_int_kind (gfc_expr *);
-gfc_try gfc_check_selected_real_kind (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_set_exponent (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_shape (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_shift (gfc_expr *, gfc_expr *);
-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_associated (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_c_f_pointer (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_c_f_procpointer (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_c_funloc (gfc_expr *);
-gfc_try gfc_check_c_loc (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_transf_bit_intrins (gfc_actual_arglist *);
-gfc_try gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_transpose (gfc_expr *);
-gfc_try gfc_check_trim (gfc_expr *);
-gfc_try gfc_check_ttynam (gfc_expr *);
-gfc_try gfc_check_ubound (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ucobound (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_umask (gfc_expr *);
-gfc_try gfc_check_unlink (gfc_expr *);
-gfc_try gfc_check_unpack (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_x (gfc_expr *);
+bool gfc_check_abs (gfc_expr *);
+bool gfc_check_access_func (gfc_expr *, gfc_expr *);
+bool gfc_check_achar (gfc_expr *, gfc_expr *);
+bool gfc_check_all_any (gfc_expr *, gfc_expr *);
+bool gfc_check_allocated (gfc_expr *);
+bool gfc_check_associated (gfc_expr *, gfc_expr *);
+bool gfc_check_atan_2 (gfc_expr *, gfc_expr *);
+bool gfc_check_atan2 (gfc_expr *, gfc_expr *);
+bool gfc_check_atomic_def (gfc_expr *, gfc_expr *);
+bool gfc_check_atomic_ref (gfc_expr *, gfc_expr *);
+bool gfc_check_besn (gfc_expr *, gfc_expr *);
+bool gfc_check_bessel_n2 (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_bge_bgt_ble_blt (gfc_expr *, gfc_expr *);
+bool gfc_check_bitfcn (gfc_expr *, gfc_expr *);
+bool gfc_check_char (gfc_expr *, gfc_expr *);
+bool gfc_check_chdir (gfc_expr *);
+bool gfc_check_chmod (gfc_expr *, gfc_expr *);
+bool gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_complex (gfc_expr *, gfc_expr *);
+bool gfc_check_count (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_cshift (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_ctime (gfc_expr *);
+bool gfc_check_datan2 (gfc_expr *, gfc_expr *);
+bool gfc_check_dcmplx (gfc_expr *, gfc_expr *);
+bool gfc_check_dble (gfc_expr *);
+bool gfc_check_digits (gfc_expr *);
+bool gfc_check_dot_product (gfc_expr *, gfc_expr *);
+bool gfc_check_dprod (gfc_expr *, gfc_expr *);
+bool gfc_check_dshift (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_eoshift (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_dtime_etime (gfc_expr *);
+bool gfc_check_fgetputc (gfc_expr *, gfc_expr *);
+bool gfc_check_fgetput (gfc_expr *);
+bool gfc_check_float (gfc_expr *);
+bool gfc_check_fstat (gfc_expr *, gfc_expr *);
+bool gfc_check_ftell (gfc_expr *);
+bool gfc_check_fn_c (gfc_expr *);
+bool gfc_check_fn_d (gfc_expr *);
+bool gfc_check_fn_r (gfc_expr *);
+bool gfc_check_fn_rc (gfc_expr *);
+bool gfc_check_fn_rc2008 (gfc_expr *);
+bool gfc_check_fnum (gfc_expr *);
+bool gfc_check_hostnm (gfc_expr *);
+bool gfc_check_huge (gfc_expr *);
+bool gfc_check_hypot (gfc_expr *, gfc_expr *);
+bool gfc_check_i (gfc_expr *);
+bool gfc_check_iand (gfc_expr *, gfc_expr *);
+bool gfc_check_and (gfc_expr *, gfc_expr *);
+bool gfc_check_ibits (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_ichar_iachar (gfc_expr *, gfc_expr *);
+bool gfc_check_idnint (gfc_expr *);
+bool gfc_check_ieor (gfc_expr *, gfc_expr *);
+bool gfc_check_index (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_int (gfc_expr *, gfc_expr *);
+bool gfc_check_intconv (gfc_expr *);
+bool gfc_check_ior (gfc_expr *, gfc_expr *);
+bool gfc_check_irand (gfc_expr *);
+bool gfc_check_isatty (gfc_expr *);
+bool gfc_check_isnan (gfc_expr *);
+bool gfc_check_ishft (gfc_expr *, gfc_expr *);
+bool gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_kill (gfc_expr *, gfc_expr *);
+bool gfc_check_kind (gfc_expr *);
+bool gfc_check_lbound (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_lcobound (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_len_lentrim (gfc_expr *, gfc_expr *);
+bool gfc_check_link (gfc_expr *, gfc_expr *);
+bool gfc_check_lge_lgt_lle_llt (gfc_expr *, gfc_expr *);
+bool gfc_check_loc (gfc_expr *);
+bool gfc_check_logical (gfc_expr *, gfc_expr *);
+bool gfc_check_min_max (gfc_actual_arglist *);
+bool gfc_check_min_max_integer (gfc_actual_arglist *);
+bool gfc_check_min_max_real (gfc_actual_arglist *);
+bool gfc_check_min_max_double (gfc_actual_arglist *);
+bool gfc_check_malloc (gfc_expr *);
+bool gfc_check_mask (gfc_expr *, gfc_expr *);
+bool gfc_check_matmul (gfc_expr *, gfc_expr *);
+bool gfc_check_merge (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_merge_bits (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_minloc_maxloc (gfc_actual_arglist *);
+bool gfc_check_minval_maxval (gfc_actual_arglist *);
+bool gfc_check_nearest (gfc_expr *, gfc_expr *);
+bool gfc_check_new_line (gfc_expr *);
+bool gfc_check_norm2 (gfc_expr *, gfc_expr *);
+bool gfc_check_null (gfc_expr *);
+bool gfc_check_pack (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_parity (gfc_expr *, gfc_expr *);
+bool gfc_check_precision (gfc_expr *);
+bool gfc_check_present (gfc_expr *);
+bool gfc_check_product_sum (gfc_actual_arglist *);
+bool gfc_check_radix (gfc_expr *);
+bool gfc_check_rand (gfc_expr *);
+bool gfc_check_range (gfc_expr *);
+bool gfc_check_rank (gfc_expr *);
+bool gfc_check_real (gfc_expr *, gfc_expr *);
+bool gfc_check_rename (gfc_expr *, gfc_expr *);
+bool gfc_check_repeat (gfc_expr *, gfc_expr *);
+bool gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_same_type_as (gfc_expr *, gfc_expr *);
+bool gfc_check_scale (gfc_expr *, gfc_expr *);
+bool gfc_check_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_second_sub (gfc_expr *);
+bool gfc_check_secnds (gfc_expr *);
+bool gfc_check_selected_char_kind (gfc_expr *);
+bool gfc_check_selected_int_kind (gfc_expr *);
+bool gfc_check_selected_real_kind (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_set_exponent (gfc_expr *, gfc_expr *);
+bool gfc_check_shape (gfc_expr *, gfc_expr *);
+bool gfc_check_shift (gfc_expr *, gfc_expr *);
+bool gfc_check_size (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_sign (gfc_expr *, gfc_expr *);
+bool gfc_check_signal (gfc_expr *, gfc_expr *);
+bool gfc_check_sizeof (gfc_expr *);
+bool gfc_check_c_associated (gfc_expr *, gfc_expr *);
+bool gfc_check_c_f_pointer (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_c_f_procpointer (gfc_expr *, gfc_expr *);
+bool gfc_check_c_funloc (gfc_expr *);
+bool gfc_check_c_loc (gfc_expr *);
+bool gfc_check_c_sizeof (gfc_expr *);
+bool gfc_check_sngl (gfc_expr *);
+bool gfc_check_spread (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_srand (gfc_expr *);
+bool gfc_check_stat (gfc_expr *, gfc_expr *);
+bool gfc_check_storage_size (gfc_expr *, gfc_expr *);
+bool gfc_check_sum (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_symlnk (gfc_expr *, gfc_expr *);
+bool gfc_check_transf_bit_intrins (gfc_actual_arglist *);
+bool gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_transpose (gfc_expr *);
+bool gfc_check_trim (gfc_expr *);
+bool gfc_check_ttynam (gfc_expr *);
+bool gfc_check_ubound (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_ucobound (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_umask (gfc_expr *);
+bool gfc_check_unlink (gfc_expr *);
+bool gfc_check_unpack (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_x (gfc_expr *);
/* Intrinsic subroutines. */
-gfc_try gfc_check_alarm_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_chdir_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_chmod_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_cpu_time (gfc_expr *);
-gfc_try gfc_check_ctime_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_system_clock (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_date_and_time (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_exit (gfc_expr *);
-gfc_try gfc_check_fdate_sub (gfc_expr *);
-gfc_try gfc_check_flush (gfc_expr *);
-gfc_try gfc_check_free (gfc_expr *);
-gfc_try gfc_check_fstat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_gerror (gfc_expr *);
-gfc_try gfc_check_getarg (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_getlog (gfc_expr *);
-gfc_try gfc_check_move_alloc (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
+bool gfc_check_alarm_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_chdir_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_chmod_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_cpu_time (gfc_expr *);
+bool gfc_check_ctime_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_system_clock (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_date_and_time (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_exit (gfc_expr *);
+bool gfc_check_fdate_sub (gfc_expr *);
+bool gfc_check_flush (gfc_expr *);
+bool gfc_check_free (gfc_expr *);
+bool gfc_check_fstat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_gerror (gfc_expr *);
+bool gfc_check_getarg (gfc_expr *, gfc_expr *);
+bool gfc_check_getlog (gfc_expr *);
+bool gfc_check_move_alloc (gfc_expr *, gfc_expr *);
+bool gfc_check_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *);
-gfc_try gfc_check_random_number (gfc_expr *);
-gfc_try gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_dtime_etime_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_fgetputc_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_fgetput_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_fseek_sub (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ftell_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_image_index (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_itime_idate (gfc_expr *);
-gfc_try gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ltime_gmtime (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_perror (gfc_expr *);
-gfc_try gfc_check_rename_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_link_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_symlnk_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_signal_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_sleep_sub (gfc_expr *);
-gfc_try gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-gfc_try gfc_check_system_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_this_image (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_ttynam_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_umask_sub (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_unlink_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_random_number (gfc_expr *);
+bool gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_dtime_etime_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_fgetputc_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_fgetput_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_fseek_sub (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_ftell_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_getcwd_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_hostnm_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_image_index (gfc_expr *, gfc_expr *);
+bool gfc_check_itime_idate (gfc_expr *);
+bool gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_ltime_gmtime (gfc_expr *, gfc_expr *);
+bool gfc_check_perror (gfc_expr *);
+bool gfc_check_rename_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_link_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_symlnk_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_signal_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_sleep_sub (gfc_expr *);
+bool gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+bool gfc_check_system_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_this_image (gfc_expr *, gfc_expr *);
+bool gfc_check_ttynam_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_umask_sub (gfc_expr *, gfc_expr *);
+bool gfc_check_unlink_sub (gfc_expr *, gfc_expr *);
/* Simplification functions. */
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 8c0edc712a0..37a33a9c552 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -12038,27 +12038,38 @@ and should considered in new code for future portability.
@item @emph{Description}:
Determines the @var{COUNT} of a processor clock since an unspecified
time in the past modulo @var{COUNT_MAX}, @var{COUNT_RATE} determines
-the number of clock ticks per second. If the platform supports a high
-resolution monotonic clock, that clock is used and can provide up to
-nanosecond resolution. If a high resolution monotonic clock is not
-available, the implementation falls back to a potentially lower
-resolution realtime clock.
-
-@var{COUNT_RATE} is system dependent and can vary depending on the kind of the
-arguments. For @var{kind=4} arguments, @var{COUNT} usually represents
-milliseconds, while for @var{kind=8} arguments, @var{COUNT} typically
-represents micro- or nanoseconds. @var{COUNT_MAX} usually equals
-@code{HUGE(COUNT_MAX)}.
-
-If there is no clock, @var{COUNT} is set to @code{-HUGE(COUNT)}, and
-@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero.
-
-When running on a platform using the GNU C library (glibc), or a
-derivative thereof, the high resolution monotonic clock is available
-only when linking with the @var{rt} library. This can be done
-explicitly by adding the @code{-lrt} flag when linking the
+the number of clock ticks per second. If the platform supports a
+monotonic clock, that clock is used and can, depending on the platform
+clock implementation, provide up to nanosecond resolution. If a
+monotonic clock is not available, the implementation falls back to a
+realtime clock.
+
+@var{COUNT_RATE} is system dependent and can vary depending on the
+kind of the arguments. For @var{kind=4} arguments, @var{COUNT}
+represents milliseconds, while for @var{kind=8} arguments, @var{COUNT}
+typically represents micro- or nanoseconds depending on resolution of
+the underlying platform clock. @var{COUNT_MAX} usually equals
+@code{HUGE(COUNT_MAX)}. Note that the millisecond resolution of the
+@var{kind=4} version implies that the @var{COUNT} will wrap around in
+roughly 25 days. In order to avoid issues with the wrap around and for
+more precise timing, please use the @var{kind=8} version.
+
+If there is no clock, or querying the clock fails, @var{COUNT} is set
+to @code{-HUGE(COUNT)}, and @var{COUNT_RATE} and @var{COUNT_MAX} are
+set to zero.
+
+When running on a platform using the GNU C library (glibc) version
+2.16 or older, or a derivative thereof, the high resolution monotonic
+clock is available only when linking with the @var{rt} library. This
+can be done explicitly by adding the @code{-lrt} flag when linking the
application, but is also done implicitly when using OpenMP.
+On the Windows platform, the version with @var{kind=4} arguments uses
+the @code{GetTickCount} function, whereas the @var{kind=8} version
+uses @code{QueryPerformanceCounter} and
+@code{QueryPerformanceCounterFrequency}. For more information, and
+potential caveats, please see the platform documentation.
+
@item @emph{Standard}:
Fortran 95 and later
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 748a4f2fbed..c5120dd78b1 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -100,7 +100,7 @@ static const io_tag
static gfc_dt *current_dt;
-#define RESOLVE_TAG(x, y) if (resolve_tag(x, y) == FAILURE) return FAILURE;
+#define RESOLVE_TAG(x, y) if (!resolve_tag (x, y)) return false;
/**************** Fortran 95 FORMAT parser *****************/
@@ -452,15 +452,15 @@ format_lex (void)
c = next_char_not_space (&error);
if (c == 'P')
{
- if (gfc_notify_std (GFC_STD_F2003, "DP format "
- "specifier not allowed at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "DP format "
+ "specifier not allowed at %C"))
return FMT_ERROR;
token = FMT_DP;
}
else if (c == 'C')
{
- if (gfc_notify_std (GFC_STD_F2003, "DC format "
- "specifier not allowed at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "DC format "
+ "specifier not allowed at %C"))
return FMT_ERROR;
token = FMT_DC;
}
@@ -545,7 +545,7 @@ token_to_string (format_token t)
by itself, and we are checking it for validity. The dual origin
means that the warning message is a little less than great. */
-static gfc_try
+static bool
check_format (bool is_input)
{
const char *posint_required = _("Positive width required");
@@ -559,13 +559,13 @@ check_format (bool is_input)
format_token t, u;
int level;
int repeat;
- gfc_try rv;
+ bool rv;
use_last_char = 0;
saved_token = FMT_NONE;
level = 0;
repeat = 0;
- rv = SUCCESS;
+ rv = true;
format_string_pos = 0;
t = format_lex ();
@@ -648,10 +648,9 @@ format_item_1:
/* X requires a prior number if we're being pedantic. */
if (mode != MODE_FORMAT)
format_locus.nextc += format_string_pos;
- if (gfc_notify_std (GFC_STD_GNU, "X descriptor "
- "requires leading space count at %L", &format_locus)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "X descriptor requires leading "
+ "space count at %L", &format_locus))
+ return false;
goto between_desc;
case FMT_SIGN:
@@ -678,9 +677,8 @@ format_item_1:
if (t == FMT_ERROR)
goto fail;
- if (gfc_notify_std (GFC_STD_GNU, "$ descriptor at %L",
- &format_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "$ descriptor at %L", &format_locus))
+ return false;
if (t != FMT_RPAREN || level > 0)
{
gfc_warning ("$ should be the last specifier in format at %L",
@@ -825,9 +823,9 @@ data_desc:
error = zero_width;
goto syntax;
}
- if (gfc_notify_std (GFC_STD_F2008, "'G0' in "
- "format at %L", &format_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2008, "'G0' in format at %L",
+ &format_locus))
+ return false;
u = format_lex ();
if (u != FMT_PERIOD)
{
@@ -1058,9 +1056,8 @@ between_desc:
default:
if (mode != MODE_FORMAT)
format_locus.nextc += format_string_pos - 1;
- if (gfc_notify_std (GFC_STD_GNU, "Missing comma at %L",
- &format_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Missing comma at %L", &format_locus))
+ return false;
/* If we do not actually return a failure, we need to unwind this
before the next round. */
if (mode != MODE_FORMAT)
@@ -1121,9 +1118,8 @@ extension_optional_comma:
default:
if (mode != MODE_FORMAT)
format_locus.nextc += format_string_pos;
- if (gfc_notify_std (GFC_STD_GNU, "Missing comma at %L",
- &format_locus) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Missing comma at %L", &format_locus))
+ return false;
/* If we do not actually return a failure, we need to unwind this
before the next round. */
if (mode != MODE_FORMAT)
@@ -1142,7 +1138,7 @@ syntax:
else
gfc_error ("%s in format string at %L", error, &format_locus);
fail:
- rv = FAILURE;
+ rv = false;
finished:
return rv;
@@ -1152,13 +1148,13 @@ finished:
/* Given an expression node that is a constant string, see if it looks
like a format string. */
-static gfc_try
+static bool
check_format_string (gfc_expr *e, bool is_input)
{
- gfc_try rv;
+ bool rv;
int i;
if (!e || e->ts.type != BT_CHARACTER || e->expr_type != EXPR_CONSTANT)
- return SUCCESS;
+ return true;
mode = MODE_STRING;
format_string = e->value.character.string;
@@ -1172,7 +1168,7 @@ check_format_string (gfc_expr *e, bool is_input)
string, like '(A10,I3)F5'
start at the end and move back to the last character processed,
spaces are OK */
- if (rv == SUCCESS && e->value.character.length > format_string_pos)
+ if (rv && e->value.character.length > format_string_pos)
for (i=e->value.character.length-1;i>format_string_pos-1;i--)
if (e->value.character.string[i] != ' ')
{
@@ -1215,7 +1211,7 @@ gfc_match_format (void)
start = gfc_current_locus;
- if (check_format (false) == FAILURE)
+ if (!check_format (false))
return MATCH_ERROR;
if (gfc_match_eos () != MATCH_YES)
@@ -1366,7 +1362,7 @@ match_ltag (const io_tag *tag, gfc_st_label ** label)
return MATCH_ERROR;
}
- if (gfc_reference_st_label (*label, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (*label, ST_LABEL_TARGET))
return MATCH_ERROR;
return m;
@@ -1375,7 +1371,7 @@ match_ltag (const io_tag *tag, gfc_st_label ** label)
/* Resolution of the FORMAT tag, to be called from resolve_tag. */
-static gfc_try
+static bool
resolve_tag_format (const gfc_expr *e)
{
if (e->expr_type == EXPR_CONSTANT
@@ -1384,7 +1380,7 @@ resolve_tag_format (const gfc_expr *e)
{
gfc_error ("Constant expression in FORMAT tag at %L must be "
"of type default CHARACTER", &e->where);
- return FAILURE;
+ return false;
}
/* If e's rank is zero and e is not an element of an array, it should be
@@ -1402,75 +1398,74 @@ resolve_tag_format (const gfc_expr *e)
{
gfc_error ("FORMAT tag at %L must be of type default-kind CHARACTER "
"or of INTEGER", &e->where);
- return FAILURE;
+ return false;
}
else if (e->ts.type == BT_INTEGER && e->expr_type == EXPR_VARIABLE)
{
- if (gfc_notify_std (GFC_STD_F95_DEL, "ASSIGNED "
- "variable in FORMAT tag at %L", &e->where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F95_DEL, "ASSIGNED variable in "
+ "FORMAT tag at %L", &e->where))
+ return false;
if (e->symtree->n.sym->attr.assign != 1)
{
gfc_error ("Variable '%s' at %L has not been assigned a "
"format label", e->symtree->n.sym->name, &e->where);
- return FAILURE;
+ return false;
}
}
else if (e->ts.type == BT_INTEGER)
{
gfc_error ("Scalar '%s' in FORMAT tag at %L is not an ASSIGNED "
"variable", gfc_basic_typename (e->ts.type), &e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* If rank is nonzero and type is not character, we allow it under GFC_STD_LEGACY.
It may be assigned an Hollerith constant. */
if (e->ts.type != BT_CHARACTER)
{
- if (gfc_notify_std (GFC_STD_LEGACY, "Non-character "
- "in FORMAT tag at %L", &e->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY, "Non-character in FORMAT tag "
+ "at %L", &e->where))
+ return false;
if (e->rank == 0 && e->symtree->n.sym->as->type == AS_ASSUMED_SHAPE)
{
gfc_error ("Non-character assumed shape array element in FORMAT"
" tag at %L", &e->where);
- return FAILURE;
+ return false;
}
if (e->rank == 0 && e->symtree->n.sym->as->type == AS_ASSUMED_SIZE)
{
gfc_error ("Non-character assumed size array element in FORMAT"
" tag at %L", &e->where);
- return FAILURE;
+ return false;
}
if (e->rank == 0 && e->symtree->n.sym->attr.pointer)
{
gfc_error ("Non-character pointer array element in FORMAT tag at %L",
&e->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
/* Do expression resolution and type-checking on an expression tag. */
-static gfc_try
+static bool
resolve_tag (const io_tag *tag, gfc_expr *e)
{
if (e == NULL)
- return SUCCESS;
+ return true;
- if (gfc_resolve_expr (e) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (e))
+ return false;
if (tag == &tag_format)
return resolve_tag_format (e);
@@ -1479,51 +1474,48 @@ resolve_tag (const io_tag *tag, gfc_expr *e)
{
gfc_error ("%s tag at %L must be of type %s", tag->name,
&e->where, gfc_basic_typename (tag->type));
- return FAILURE;
+ return false;
}
if (e->ts.type == BT_CHARACTER && e->ts.kind != gfc_default_character_kind)
{
gfc_error ("%s tag at %L must be a character string of default kind",
tag->name, &e->where);
- return FAILURE;
+ return false;
}
if (e->rank != 0)
{
gfc_error ("%s tag at %L must be scalar", tag->name, &e->where);
- return FAILURE;
+ return false;
}
if (tag == &tag_iomsg)
{
- if (gfc_notify_std (GFC_STD_F2003, "IOMSG tag at %L",
- &e->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "IOMSG tag at %L", &e->where))
+ return false;
}
if ((tag == &tag_iostat || tag == &tag_size || tag == &tag_iolength)
&& e->ts.kind != gfc_default_integer_kind)
{
- if (gfc_notify_std (GFC_STD_F2003, "Fortran 95 requires default "
- "INTEGER in %s tag at %L", tag->name, &e->where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "Fortran 95 requires default "
+ "INTEGER in %s tag at %L", tag->name, &e->where))
+ return false;
}
if (tag == &tag_exist && e->ts.kind != gfc_default_logical_kind)
{
- if (gfc_notify_std (GFC_STD_F2008, "Nondefault LOGICAL "
- "in %s tag at %L", tag->name, &e->where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2008, "Nondefault LOGICAL "
+ "in %s tag at %L", tag->name, &e->where))
+ return false;
}
if (tag == &tag_newunit)
{
- if (gfc_notify_std (GFC_STD_F2008, "NEWUNIT specifier"
- " at %L", &e->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2008, "NEWUNIT specifier at %L",
+ &e->where))
+ return false;
}
/* NEWUNIT, IOSTAT, SIZE and IOMSG are variable definition contexts. */
@@ -1533,18 +1525,17 @@ resolve_tag (const io_tag *tag, gfc_expr *e)
char context[64];
sprintf (context, _("%s tag"), tag->name);
- if (gfc_check_vardef_context (e, false, false, false, context) == FAILURE)
- return FAILURE;
+ if (!gfc_check_vardef_context (e, false, false, false, context))
+ return false;
}
if (tag == &tag_convert)
{
- if (gfc_notify_std (GFC_STD_GNU, "CONVERT tag at %L",
- &e->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "CONVERT tag at %L", &e->where))
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -1657,7 +1648,7 @@ gfc_free_open (gfc_open *open)
/* Resolve everything in a gfc_open structure. */
-gfc_try
+bool
gfc_resolve_open (gfc_open *open)
{
@@ -1682,10 +1673,10 @@ gfc_resolve_open (gfc_open *open)
RESOLVE_TAG (&tag_convert, open->convert);
RESOLVE_TAG (&tag_newunit, open->newunit);
- if (gfc_reference_st_label (open->err, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (open->err, ST_LABEL_TARGET))
+ return false;
- return SUCCESS;
+ return true;
}
@@ -1895,8 +1886,8 @@ gfc_match_open (void)
/* Checks on the ASYNCHRONOUS specifier. */
if (open->asynchronous)
{
- if (gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS= at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (open->asynchronous->expr_type == EXPR_CONSTANT)
@@ -1913,8 +1904,8 @@ gfc_match_open (void)
/* Checks on the BLANK specifier. */
if (open->blank)
{
- if (gfc_notify_std (GFC_STD_F2003, "BLANK= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "BLANK= at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (open->blank->expr_type == EXPR_CONSTANT)
@@ -1931,8 +1922,8 @@ gfc_match_open (void)
/* Checks on the DECIMAL specifier. */
if (open->decimal)
{
- if (gfc_notify_std (GFC_STD_F2003, "DECIMAL= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "DECIMAL= at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (open->decimal->expr_type == EXPR_CONSTANT)
@@ -1963,8 +1954,8 @@ gfc_match_open (void)
/* Checks on the ENCODING specifier. */
if (open->encoding)
{
- if (gfc_notify_std (GFC_STD_F2003, "ENCODING= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ENCODING= at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (open->encoding->expr_type == EXPR_CONSTANT)
@@ -2014,8 +2005,8 @@ gfc_match_open (void)
/* Checks on the ROUND specifier. */
if (open->round)
{
- if (gfc_notify_std (GFC_STD_F2003, "ROUND= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ROUND= at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (open->round->expr_type == EXPR_CONSTANT)
@@ -2034,8 +2025,8 @@ gfc_match_open (void)
/* Checks on the SIGN specifier. */
if (open->sign)
{
- if (gfc_notify_std (GFC_STD_F2003, "SIGN= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "SIGN= at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (open->sign->expr_type == EXPR_CONSTANT)
@@ -2282,7 +2273,7 @@ cleanup:
/* Resolve everything in a gfc_close structure. */
-gfc_try
+bool
gfc_resolve_close (gfc_close *close)
{
RESOLVE_TAG (&tag_unit, close->unit);
@@ -2290,8 +2281,8 @@ gfc_resolve_close (gfc_close *close)
RESOLVE_TAG (&tag_iostat, close->iostat);
RESOLVE_TAG (&tag_status, close->status);
- if (gfc_reference_st_label (close->err, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (close->err, ST_LABEL_TARGET))
+ return false;
if (close->unit == NULL)
{
@@ -2308,7 +2299,7 @@ gfc_resolve_close (gfc_close *close)
loc = close->err->where;
gfc_error ("CLOSE statement at %L requires a UNIT number", &loc);
- return FAILURE;
+ return false;
}
if (close->unit->expr_type == EXPR_CONSTANT
@@ -2319,7 +2310,7 @@ gfc_resolve_close (gfc_close *close)
&close->unit->where);
}
- return SUCCESS;
+ return true;
}
@@ -2435,14 +2426,14 @@ cleanup:
}
-gfc_try
+bool
gfc_resolve_filepos (gfc_filepos *fp)
{
RESOLVE_TAG (&tag_unit, fp->unit);
RESOLVE_TAG (&tag_iostat, fp->iostat);
RESOLVE_TAG (&tag_iomsg, fp->iomsg);
- if (gfc_reference_st_label (fp->err, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (fp->err, ST_LABEL_TARGET))
+ return false;
if (fp->unit->expr_type == EXPR_CONSTANT
&& fp->unit->ts.type == BT_INTEGER
@@ -2452,7 +2443,7 @@ gfc_resolve_filepos (gfc_filepos *fp)
&fp->unit->where);
}
- return SUCCESS;
+ return true;
}
@@ -2480,8 +2471,7 @@ gfc_match_rewind (void)
match
gfc_match_flush (void)
{
- if (gfc_notify_std (GFC_STD_F2003, "FLUSH statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "FLUSH statement at %C"))
return MATCH_ERROR;
return match_filepos (ST_FLUSH, EXEC_FLUSH);
@@ -2583,7 +2573,7 @@ match_dt_format (gfc_dt *dt)
goto conflict;
}
- if (gfc_reference_st_label (label, ST_LABEL_FORMAT) == FAILURE)
+ if (!gfc_reference_st_label (label, ST_LABEL_FORMAT))
return MATCH_ERROR;
dt->format_label = label;
@@ -2785,7 +2775,7 @@ gfc_free_dt (gfc_dt *dt)
/* Resolve everything in a gfc_dt structure. */
-gfc_try
+bool
gfc_resolve_dt (gfc_dt *dt, locus *loc)
{
gfc_expr *e;
@@ -2815,10 +2805,10 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
if (e == NULL)
{
gfc_error ("UNIT not specified at %L", loc);
- return FAILURE;
+ return false;
}
- if (gfc_resolve_expr (e) == SUCCESS
+ if (gfc_resolve_expr (e)
&& (e->ts.type != BT_INTEGER
&& (e->ts.type != BT_CHARACTER || e->expr_type != EXPR_VARIABLE)))
{
@@ -2828,7 +2818,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
{
gfc_error ("UNIT specification at %L must be an INTEGER expression "
"or a CHARACTER variable", &e->where);
- return FAILURE;
+ return false;
}
else
{
@@ -2850,7 +2840,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
{
gfc_error ("Invalid form of WRITE statement at %L, UNIT required",
&dt->extra_comma->where);
- return FAILURE;
+ return false;
}
}
}
@@ -2860,21 +2850,21 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
if (gfc_has_vector_index (e))
{
gfc_error ("Internal unit with vector subscript at %L", &e->where);
- return FAILURE;
+ return false;
}
/* If we are writing, make sure the internal unit can be changed. */
gcc_assert (k != M_PRINT);
if (k == M_WRITE
- && gfc_check_vardef_context (e, false, false, false,
- _("internal unit in WRITE")) == FAILURE)
- return FAILURE;
+ && !gfc_check_vardef_context (e, false, false, false,
+ _("internal unit in WRITE")))
+ return false;
}
if (e->rank && e->ts.type != BT_CHARACTER)
{
gfc_error ("External IO UNIT cannot be an array at %L", &e->where);
- return FAILURE;
+ return false;
}
if (e->expr_type == EXPR_CONSTANT && e->ts.type == BT_INTEGER
@@ -2882,7 +2872,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
{
gfc_error ("UNIT number in statement at %L must be non-negative",
&e->where);
- return FAILURE;
+ return false;
}
/* If we are reading and have a namelist, check that all namelist symbols
@@ -2893,61 +2883,61 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
for (n = dt->namelist->namelist; n; n = n->next)
{
gfc_expr* e;
- gfc_try t;
+ bool t;
e = gfc_get_variable_expr (gfc_find_sym_in_symtree (n->sym));
t = gfc_check_vardef_context (e, false, false, false, NULL);
gfc_free_expr (e);
- if (t == FAILURE)
+ if (!t)
{
gfc_error ("NAMELIST '%s' in READ statement at %L contains"
" the symbol '%s' which may not appear in a"
" variable definition context",
dt->namelist->name, loc, n->sym->name);
- return FAILURE;
+ return false;
}
}
}
if (dt->extra_comma
- && gfc_notify_std (GFC_STD_GNU, "Comma before i/o "
- "item list at %L", &dt->extra_comma->where) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_GNU, "Comma before i/o item list at %L",
+ &dt->extra_comma->where))
+ return false;
if (dt->err)
{
- if (gfc_reference_st_label (dt->err, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (dt->err, ST_LABEL_TARGET))
+ return false;
if (dt->err->defined == ST_LABEL_UNKNOWN)
{
gfc_error ("ERR tag label %d at %L not defined",
dt->err->value, &dt->err_where);
- return FAILURE;
+ return false;
}
}
if (dt->end)
{
- if (gfc_reference_st_label (dt->end, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (dt->end, ST_LABEL_TARGET))
+ return false;
if (dt->end->defined == ST_LABEL_UNKNOWN)
{
gfc_error ("END tag label %d at %L not defined",
dt->end->value, &dt->end_where);
- return FAILURE;
+ return false;
}
}
if (dt->eor)
{
- if (gfc_reference_st_label (dt->eor, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (dt->eor, ST_LABEL_TARGET))
+ return false;
if (dt->eor->defined == ST_LABEL_UNKNOWN)
{
gfc_error ("EOR tag label %d at %L not defined",
dt->eor->value, &dt->eor_where);
- return FAILURE;
+ return false;
}
}
@@ -2957,10 +2947,10 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
{
gfc_error ("FORMAT label %d at %L not defined", dt->format_label->value,
&dt->format_label->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -3257,9 +3247,8 @@ if (condition) \
if (dt->namelist != NULL)
{
- if (gfc_notify_std (GFC_STD_F2003, "Internal file "
- "at %L with namelist", &expr->where)
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Internal file at %L with "
+ "namelist", &expr->where))
m = MATCH_ERROR;
}
@@ -3313,7 +3302,7 @@ if (condition) \
{
static const char * asynchronous[] = { "YES", "NO", NULL };
- if (gfc_reduce_init_expr (dt->asynchronous) != SUCCESS)
+ if (!gfc_reduce_init_expr (dt->asynchronous))
{
gfc_error ("ASYNCHRONOUS= specifier at %L must be an initialization "
"expression", &dt->asynchronous->where);
@@ -3341,8 +3330,8 @@ if (condition) \
if (dt->decimal)
{
- if (gfc_notify_std (GFC_STD_F2003, "DECIMAL= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "DECIMAL= at %C "
+ "not allowed in Fortran 95"))
return MATCH_ERROR;
if (dt->decimal->expr_type == EXPR_CONSTANT)
@@ -3362,8 +3351,8 @@ if (condition) \
if (dt->blank)
{
- if (gfc_notify_std (GFC_STD_F2003, "BLANK= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "BLANK= at %C "
+ "not allowed in Fortran 95"))
return MATCH_ERROR;
if (dt->blank->expr_type == EXPR_CONSTANT)
@@ -3383,8 +3372,8 @@ if (condition) \
if (dt->pad)
{
- if (gfc_notify_std (GFC_STD_F2003, "PAD= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "PAD= at %C "
+ "not allowed in Fortran 95"))
return MATCH_ERROR;
if (dt->pad->expr_type == EXPR_CONSTANT)
@@ -3404,8 +3393,8 @@ if (condition) \
if (dt->round)
{
- if (gfc_notify_std (GFC_STD_F2003, "ROUND= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ROUND= at %C "
+ "not allowed in Fortran 95"))
return MATCH_ERROR;
if (dt->round->expr_type == EXPR_CONSTANT)
@@ -3425,7 +3414,7 @@ if (condition) \
{
/* When implemented, change the following to use gfc_notify_std F2003.
if (gfc_notify_std (GFC_STD_F2003, "SIGN= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ "not allowed in Fortran 95") == false)
return MATCH_ERROR; */
if (dt->sign->expr_type == EXPR_CONSTANT)
{
@@ -3449,8 +3438,8 @@ if (condition) \
if (dt->delim)
{
- if (gfc_notify_std (GFC_STD_F2003, "DELIM= at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "DELIM= at %C "
+ "not allowed in Fortran 95"))
return MATCH_ERROR;
if (dt->delim->expr_type == EXPR_CONSTANT)
@@ -3557,8 +3546,8 @@ if (condition) \
}
expr = dt->format_expr;
- if (gfc_simplify_expr (expr, 0) == FAILURE
- || check_format_string (expr, k == M_READ) == FAILURE)
+ if (!gfc_simplify_expr (expr, 0)
+ || !check_format_string (expr, k == M_READ))
return MATCH_ERROR;
return m;
@@ -3598,8 +3587,8 @@ match_io (io_kind k)
gfc_find_symbol (name, NULL, 1, &sym);
if (sym && sym->attr.flavor == FL_NAMELIST)
{
- if (gfc_notify_std (GFC_STD_GNU, "PRINT namelist at "
- "%C is an extension") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "PRINT namelist at "
+ "%C is an extension"))
{
m = MATCH_ERROR;
goto cleanup;
@@ -4048,7 +4037,7 @@ cleanup:
/* Resolve everything in a gfc_inquire structure. */
-gfc_try
+bool
gfc_resolve_inquire (gfc_inquire *inquire)
{
RESOLVE_TAG (&tag_unit, inquire->unit);
@@ -4064,8 +4053,8 @@ gfc_resolve_inquire (gfc_inquire *inquire)
char context[64]; \
sprintf (context, _("%s tag with INQUIRE"), (tag)->name); \
if (gfc_check_vardef_context ((expr), false, false, false, \
- context) == FAILURE) \
- return FAILURE; \
+ context) == false) \
+ return false; \
}
INQUIRE_RESOLVE_TAG (&tag_iomsg, inquire->iomsg);
INQUIRE_RESOLVE_TAG (&tag_iostat, inquire->iostat);
@@ -4104,10 +4093,10 @@ gfc_resolve_inquire (gfc_inquire *inquire)
INQUIRE_RESOLVE_TAG (&tag_s_iqstream, inquire->iqstream);
#undef INQUIRE_RESOLVE_TAG
- if (gfc_reference_st_label (inquire->err, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (inquire->err, ST_LABEL_TARGET))
+ return false;
- return SUCCESS;
+ return true;
}
@@ -4125,7 +4114,7 @@ gfc_free_wait (gfc_wait *wait)
}
-gfc_try
+bool
gfc_resolve_wait (gfc_wait *wait)
{
RESOLVE_TAG (&tag_unit, wait->unit);
@@ -4133,13 +4122,13 @@ gfc_resolve_wait (gfc_wait *wait)
RESOLVE_TAG (&tag_iostat, wait->iostat);
RESOLVE_TAG (&tag_id, wait->id);
- if (gfc_reference_st_label (wait->err, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (wait->err, ST_LABEL_TARGET))
+ return false;
- if (gfc_reference_st_label (wait->end, ST_LABEL_TARGET) == FAILURE)
- return FAILURE;
+ if (!gfc_reference_st_label (wait->end, ST_LABEL_TARGET))
+ return false;
- return SUCCESS;
+ return true;
}
/* Match an element of a WAIT statement. */
@@ -4202,8 +4191,8 @@ gfc_match_wait (void)
goto syntax;
}
- if (gfc_notify_std (GFC_STD_F2003, "WAIT at %C "
- "not allowed in Fortran 95") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "WAIT at %C "
+ "not allowed in Fortran 95"))
goto cleanup;
if (gfc_pure (NULL))
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 2b92b7c2bc6..af452b32888 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -2154,10 +2154,7 @@ gfc_resolve_reshape (gfc_expr *f, gfc_expr *source, gfc_expr *shape,
break;
}
- /* TODO: Make this work with a constant ORDER parameter. */
- if (shape->expr_type == EXPR_ARRAY
- && gfc_is_constant_expr (shape)
- && order == NULL)
+ if (shape->expr_type == EXPR_ARRAY && gfc_is_constant_expr (shape))
{
gfc_constructor *c;
f->shape = gfc_get_shape (f->rank);
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index d75cf1cc17d..b5e9609d965 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -505,8 +505,8 @@ gfc_match_label (void)
return MATCH_ERROR;
}
- if (gfc_add_flavor (&gfc_new_block->attr, FL_LABEL,
- gfc_new_block->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&gfc_new_block->attr, FL_LABEL,
+ gfc_new_block->name, NULL))
return MATCH_ERROR;
return MATCH_YES;
@@ -531,7 +531,7 @@ gfc_match_name (char *buffer)
c = gfc_next_ascii_char ();
if (!(ISALPHA (c) || (c == '_' && gfc_option.flag_allow_leading_underscore)))
{
- if (gfc_error_flag_test() == 0 && c != '(')
+ if (gfc_error_flag_test () == 0 && c != '(')
gfc_error ("Invalid character in name at %C");
gfc_current_locus = old_loc;
return MATCH_NO;
@@ -1268,7 +1268,7 @@ gfc_match_program (void)
if (m == MATCH_ERROR)
return m;
- if (gfc_add_flavor (&sym->attr, FL_PROGRAM, sym->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&sym->attr, FL_PROGRAM, sym->name, NULL))
return MATCH_ERROR;
gfc_new_block = sym;
@@ -1383,16 +1383,15 @@ match_arithmetic_if (void)
if (m != MATCH_YES)
return m;
- if (gfc_reference_st_label (l1, ST_LABEL_TARGET) == FAILURE
- || gfc_reference_st_label (l2, ST_LABEL_TARGET) == FAILURE
- || gfc_reference_st_label (l3, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (l1, ST_LABEL_TARGET)
+ || !gfc_reference_st_label (l2, ST_LABEL_TARGET)
+ || !gfc_reference_st_label (l3, ST_LABEL_TARGET))
{
gfc_free_expr (expr);
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF "
- "statement at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C"))
return MATCH_ERROR;
new_st.op = EXEC_ARITHMETIC_IF;
@@ -1464,16 +1463,15 @@ gfc_match_if (gfc_statement *if_type)
return MATCH_ERROR;
}
- if (gfc_reference_st_label (l1, ST_LABEL_TARGET) == FAILURE
- || gfc_reference_st_label (l2, ST_LABEL_TARGET) == FAILURE
- || gfc_reference_st_label (l3, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (l1, ST_LABEL_TARGET)
+ || !gfc_reference_st_label (l2, ST_LABEL_TARGET)
+ || !gfc_reference_st_label (l3, ST_LABEL_TARGET))
{
gfc_free_expr (expr);
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF "
- "statement at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C"))
return MATCH_ERROR;
new_st.op = EXEC_ARITHMETIC_IF;
@@ -1539,7 +1537,7 @@ gfc_match_if (gfc_statement *if_type)
restore between tries. */
#define match(string, subr, statement) \
- if (gfc_match(string) == MATCH_YES) { m = subr(); goto got_match; }
+ if (gfc_match (string) == MATCH_YES) { m = subr(); goto got_match; }
gfc_clear_error ();
@@ -1746,7 +1744,7 @@ gfc_match_critical (void)
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ if (gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("Image control statement CRITICAL at %C in DO CONCURRENT "
"block");
@@ -1756,8 +1754,7 @@ gfc_match_critical (void)
if (gfc_implicit_pure (NULL))
gfc_current_ns->proc_name->attr.implicit_pure = 0;
- if (gfc_notify_std (GFC_STD_F2008, "CRITICAL statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "CRITICAL statement at %C"))
return MATCH_ERROR;
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
@@ -1766,7 +1763,7 @@ gfc_match_critical (void)
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (gfc_find_state (COMP_CRITICAL))
{
gfc_error ("Nested CRITICAL block at %C");
return MATCH_ERROR;
@@ -1775,7 +1772,7 @@ gfc_match_critical (void)
new_st.op = EXEC_CRITICAL;
if (label != NULL
- && gfc_reference_st_label (label, ST_LABEL_TARGET) == FAILURE)
+ && !gfc_reference_st_label (label, ST_LABEL_TARGET))
return MATCH_ERROR;
return MATCH_YES;
@@ -2380,8 +2377,7 @@ gfc_match_do (void)
gfc_forall_iterator *head;
gfc_expr *mask;
- if (gfc_notify_std (GFC_STD_F2008, "DO CONCURRENT "
- "construct at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "DO CONCURRENT construct at %C"))
return MATCH_ERROR;
@@ -2398,7 +2394,7 @@ gfc_match_do (void)
goto concurr_cleanup;
if (label != NULL
- && gfc_reference_st_label (label, ST_LABEL_DO_TARGET) == FAILURE)
+ && !gfc_reference_st_label (label, ST_LABEL_DO_TARGET))
goto concurr_cleanup;
new_st.label1 = label;
@@ -2452,7 +2448,7 @@ concurr_cleanup:
done:
if (label != NULL
- && gfc_reference_st_label (label, ST_LABEL_DO_TARGET) == FAILURE)
+ && !gfc_reference_st_label (label, ST_LABEL_DO_TARGET))
goto cleanup;
new_st.label1 = label;
@@ -2579,8 +2575,8 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op)
return MATCH_ERROR;
}
gcc_assert (op == EXEC_EXIT);
- if (gfc_notify_std (GFC_STD_F2008, "EXIT statement with no"
- " do-construct-name at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "EXIT statement with no"
+ " do-construct-name at %C"))
return MATCH_ERROR;
break;
@@ -2686,12 +2682,12 @@ gfc_match_stopcode (gfc_statement st)
if (gfc_implicit_pure (NULL))
gfc_current_ns->proc_name->attr.implicit_pure = 0;
- if (st == ST_STOP && gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (st == ST_STOP && gfc_find_state (COMP_CRITICAL))
{
gfc_error ("Image control statement STOP at %C in CRITICAL block");
goto cleanup;
}
- if (st == ST_STOP && gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ if (st == ST_STOP && gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("Image control statement STOP at %C in DO CONCURRENT block");
goto cleanup;
@@ -2770,9 +2766,7 @@ gfc_match_pause (void)
m = gfc_match_stopcode (ST_PAUSE);
if (m == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F95_DEL, "PAUSE statement"
- " at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_DEL, "PAUSE statement at %C"))
m = MATCH_ERROR;
}
return m;
@@ -2793,8 +2787,7 @@ gfc_match_stop (void)
match
gfc_match_error_stop (void)
{
- if (gfc_notify_std (GFC_STD_F2008, "ERROR STOP statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "ERROR STOP statement at %C"))
return MATCH_ERROR;
return gfc_match_stopcode (ST_ERROR_STOP);
@@ -2833,14 +2826,14 @@ lock_unlock_statement (gfc_statement st)
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (gfc_find_state (COMP_CRITICAL))
{
gfc_error ("Image control statement %s at %C in CRITICAL block",
st == ST_LOCK ? "LOCK" : "UNLOCK");
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ if (gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("Image control statement %s at %C in DO CONCURRENT block",
st == ST_LOCK ? "LOCK" : "UNLOCK");
@@ -2979,8 +2972,7 @@ cleanup:
match
gfc_match_lock (void)
{
- if (gfc_notify_std (GFC_STD_F2008, "LOCK statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "LOCK statement at %C"))
return MATCH_ERROR;
return lock_unlock_statement (ST_LOCK);
@@ -2990,8 +2982,7 @@ gfc_match_lock (void)
match
gfc_match_unlock (void)
{
- if (gfc_notify_std (GFC_STD_F2008, "UNLOCK statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "UNLOCK statement at %C"))
return MATCH_ERROR;
return lock_unlock_statement (ST_UNLOCK);
@@ -3023,8 +3014,7 @@ sync_statement (gfc_statement st)
if (gfc_implicit_pure (NULL))
gfc_current_ns->proc_name->attr.implicit_pure = 0;
- if (gfc_notify_std (GFC_STD_F2008, "SYNC statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "SYNC statement at %C"))
return MATCH_ERROR;
if (gfc_option.coarray == GFC_FCOARRAY_NONE)
@@ -3033,13 +3023,13 @@ sync_statement (gfc_statement st)
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (gfc_find_state (COMP_CRITICAL))
{
gfc_error ("Image control statement SYNC at %C in CRITICAL block");
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ if (gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("Image control statement SYNC at %C in DO CONCURRENT block");
return MATCH_ERROR;
@@ -3217,13 +3207,11 @@ gfc_match_assign (void)
if (gfc_match (" %l", &label) == MATCH_YES)
{
- if (gfc_reference_st_label (label, ST_LABEL_UNKNOWN) == FAILURE)
+ if (!gfc_reference_st_label (label, ST_LABEL_UNKNOWN))
return MATCH_ERROR;
if (gfc_match (" to %v%t", &expr) == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F95_DEL, "ASSIGN "
- "statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_DEL, "ASSIGN statement at %C"))
return MATCH_ERROR;
expr->symtree->n.sym->attr.assign = 1;
@@ -3255,7 +3243,7 @@ gfc_match_goto (void)
if (gfc_match (" %l%t", &label) == MATCH_YES)
{
- if (gfc_reference_st_label (label, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (label, ST_LABEL_TARGET))
return MATCH_ERROR;
new_st.op = EXEC_GOTO;
@@ -3267,9 +3255,7 @@ gfc_match_goto (void)
if (gfc_match_variable (&expr, 0) == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F95_DEL, "Assigned GOTO "
- "statement at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_DEL, "Assigned GOTO statement at %C"))
return MATCH_ERROR;
new_st.op = EXEC_GOTO;
@@ -3293,7 +3279,7 @@ gfc_match_goto (void)
if (m != MATCH_YES)
goto syntax;
- if (gfc_reference_st_label (label, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (label, ST_LABEL_TARGET))
goto cleanup;
if (head == NULL)
@@ -3338,7 +3324,7 @@ gfc_match_goto (void)
if (m != MATCH_YES)
goto syntax;
- if (gfc_reference_st_label (label, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (label, ST_LABEL_TARGET))
goto cleanup;
if (head == NULL)
@@ -3377,8 +3363,7 @@ gfc_match_goto (void)
if (gfc_match (" %e%t", &expr) != MATCH_YES)
goto syntax;
- if (gfc_notify_std (GFC_STD_F95_OBS, "Computed GOTO "
- "at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_OBS, "Computed GOTO at %C"))
return MATCH_ERROR;
/* At this point, a computed GOTO has been fully matched and an
@@ -3460,8 +3445,8 @@ gfc_match_allocate (void)
{
if (gfc_match (" :: ") == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "typespec in "
- "ALLOCATE at %L", &old_locus) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "typespec in ALLOCATE at %L",
+ &old_locus))
goto cleanup;
if (ts.deferred)
@@ -3516,8 +3501,8 @@ gfc_match_allocate (void)
deferred_locus = tail->expr->where;
}
- if (gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS
- || gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (gfc_find_state (COMP_DO_CONCURRENT)
+ || gfc_find_state (COMP_CRITICAL))
{
gfc_ref *ref;
bool coarray = tail->expr->symtree->n.sym->attr.codimension;
@@ -3525,12 +3510,12 @@ gfc_match_allocate (void)
if (ref->type == REF_COMPONENT)
coarray = ref->u.c.component->attr.codimension;
- if (coarray && gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ if (coarray && gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("ALLOCATE of coarray at %C in DO CONCURRENT block");
goto cleanup;
}
- if (coarray && gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (coarray && gfc_find_state (COMP_CRITICAL))
{
gfc_error ("ALLOCATE of coarray at %C in CRITICAL block");
goto cleanup;
@@ -3625,8 +3610,7 @@ alloc_opt_list:
goto cleanup;
if (m == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "ERRMSG tag at %L",
- &tmp->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ERRMSG tag at %L", &tmp->where))
goto cleanup;
/* Enforce C630. */
@@ -3649,8 +3633,7 @@ alloc_opt_list:
goto cleanup;
if (m == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "SOURCE tag at %L",
- &tmp->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "SOURCE tag at %L", &tmp->where))
goto cleanup;
/* Enforce C630. */
@@ -3669,9 +3652,9 @@ alloc_opt_list:
}
if (head->next
- && gfc_notify_std (GFC_STD_F2008, "SOURCE tag at %L"
- " with more than a single allocate object",
- &tmp->where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2008, "SOURCE tag at %L"
+ " with more than a single allocate object",
+ &tmp->where))
goto cleanup;
source = tmp;
@@ -3687,8 +3670,7 @@ alloc_opt_list:
goto cleanup;
if (m == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2008, "MOLD tag at %L",
- &tmp->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "MOLD tag at %L", &tmp->where))
goto cleanup;
/* Check F08:C636. */
@@ -3900,14 +3882,14 @@ gfc_match_deallocate (void)
gfc_current_ns->proc_name->attr.implicit_pure = 0;
if (gfc_is_coarray (tail->expr)
- && gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ && gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("DEALLOCATE of coarray at %C in DO CONCURRENT block");
goto cleanup;
}
if (gfc_is_coarray (tail->expr)
- && gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ && gfc_find_state (COMP_CRITICAL))
{
gfc_error ("DEALLOCATE of coarray at %C in CRITICAL block");
goto cleanup;
@@ -3962,8 +3944,7 @@ dealloc_opt_list:
goto cleanup;
if (m == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "ERRMSG at %L",
- &tmp->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "ERRMSG at %L", &tmp->where))
goto cleanup;
if (saw_errmsg)
@@ -4018,13 +3999,13 @@ gfc_match_return (void)
e = NULL;
- if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
+ if (gfc_find_state (COMP_CRITICAL))
{
gfc_error ("Image control statement RETURN at %C in CRITICAL block");
return MATCH_ERROR;
}
- if (gfc_find_state (COMP_DO_CONCURRENT) == SUCCESS)
+ if (gfc_find_state (COMP_DO_CONCURRENT))
{
gfc_error ("Image control statement RETURN at %C in DO CONCURRENT block");
return MATCH_ERROR;
@@ -4033,17 +4014,13 @@ gfc_match_return (void)
if (gfc_match_eos () == MATCH_YES)
goto done;
- if (gfc_find_state (COMP_SUBROUTINE) == FAILURE)
+ if (!gfc_find_state (COMP_SUBROUTINE))
{
gfc_error ("Alternate RETURN statement at %C is only allowed within "
"a SUBROUTINE");
goto cleanup;
}
- if (gfc_notify_std (GFC_STD_F95_OBS, "Alternate RETURN "
- "at %C") == FAILURE)
- return MATCH_ERROR;
-
if (gfc_current_form == FORM_FREE)
{
/* The following are valid, so we can't require a blank after the
@@ -4070,8 +4047,8 @@ cleanup:
done:
gfc_enclosing_unit (&s);
if (s == COMP_PROGRAM
- && gfc_notify_std (GFC_STD_GNU, "RETURN statement in "
- "main program at %C") == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, "RETURN statement in "
+ "main program at %C"))
return MATCH_ERROR;
new_st.op = EXEC_RETURN;
@@ -4182,7 +4159,7 @@ gfc_match_call (void)
}
/* ...and then to try to make the symbol into a subroutine. */
- if (gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_subroutine (&sym->attr, sym->name, NULL))
return MATCH_ERROR;
}
@@ -4235,7 +4212,7 @@ gfc_match_call (void)
if (a->expr != NULL)
continue;
- if (gfc_reference_st_label (a->label, ST_LABEL_TARGET) == FAILURE)
+ if (!gfc_reference_st_label (a->label, ST_LABEL_TARGET))
continue;
i++;
@@ -4454,14 +4431,13 @@ gfc_match_common (void)
if (((sym->value != NULL && sym->value->expr_type != EXPR_NULL)
|| sym->attr.data) && gfc_current_state () != COMP_BLOCK_DATA)
{
- if (gfc_notify_std (GFC_STD_GNU, "Initialized symbol '%s' at %C "
- "can only be COMMON in "
- "BLOCK DATA", sym->name)
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "Initialized symbol '%s' at "
+ "%C can only be COMMON in BLOCK DATA",
+ sym->name))
goto cleanup;
}
- if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_in_common (&sym->attr, sym->name, NULL))
goto cleanup;
if (tail != NULL)
@@ -4486,7 +4462,7 @@ gfc_match_common (void)
goto cleanup;
}
- if (gfc_add_dimension (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_dimension (&sym->attr, sym->name, NULL))
goto cleanup;
if (sym->attr.pointer)
@@ -4588,7 +4564,7 @@ gfc_match_block_data (void)
if (gfc_get_symbol (name, NULL, &sym))
return MATCH_ERROR;
- if (gfc_add_flavor (&sym->attr, FL_BLOCK_DATA, sym->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&sym->attr, FL_BLOCK_DATA, sym->name, NULL))
return MATCH_ERROR;
gfc_new_block = sym;
@@ -4639,15 +4615,14 @@ gfc_match_namelist (void)
if (group_name->attr.flavor == FL_NAMELIST
&& group_name->attr.use_assoc
- && gfc_notify_std (GFC_STD_GNU, "Namelist group name '%s' "
- "at %C already is USE associated and can"
- "not be respecified.", group_name->name)
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, "Namelist group name '%s' "
+ "at %C already is USE associated and can"
+ "not be respecified.", group_name->name))
return MATCH_ERROR;
if (group_name->attr.flavor != FL_NAMELIST
- && gfc_add_flavor (&group_name->attr, FL_NAMELIST,
- group_name->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&group_name->attr, FL_NAMELIST,
+ group_name->name, NULL))
return MATCH_ERROR;
for (;;)
@@ -4659,7 +4634,7 @@ gfc_match_namelist (void)
goto error;
if (sym->attr.in_namelist == 0
- && gfc_add_in_namelist (&sym->attr, sym->name, NULL) == FAILURE)
+ && !gfc_add_in_namelist (&sym->attr, sym->name, NULL))
goto error;
/* Use gfc_error_check here, rather than goto error, so that
@@ -4725,8 +4700,8 @@ gfc_match_module (void)
if (m != MATCH_YES)
return m;
- if (gfc_add_flavor (&gfc_new_block->attr, FL_MODULE,
- gfc_new_block->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&gfc_new_block->attr, FL_MODULE,
+ gfc_new_block->name, NULL))
return MATCH_ERROR;
return MATCH_YES;
@@ -4815,7 +4790,7 @@ gfc_match_equivalence (void)
sym = set->expr->symtree->n.sym;
- if (gfc_add_in_equivalence (&sym->attr, sym->name, NULL) == FAILURE)
+ if (!gfc_add_in_equivalence (&sym->attr, sym->name, NULL))
goto cleanup;
if (sym->attr.in_common)
@@ -4962,8 +4937,7 @@ gfc_match_st_function (void)
gfc_push_error (&old_error);
- if (gfc_add_procedure (&sym->attr, PROC_ST_FUNCTION,
- sym->name, NULL) == FAILURE)
+ if (!gfc_add_procedure (&sym->attr, PROC_ST_FUNCTION, sym->name, NULL))
goto undo_error;
if (gfc_match_formal_arglist (sym, 1, 0) != MATCH_YES)
@@ -4985,8 +4959,7 @@ gfc_match_st_function (void)
sym->value = expr;
- if (gfc_notify_std (GFC_STD_F95_OBS,
- "Statement function at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F95_OBS, "Statement function at %C"))
return MATCH_ERROR;
return MATCH_YES;
@@ -5364,7 +5337,6 @@ gfc_match_select_type (void)
char name[GFC_MAX_SYMBOL_LEN];
bool class_array;
gfc_symbol *sym;
- gfc_namespace *parent_ns;
m = gfc_match_label ();
if (m == MATCH_ERROR)
@@ -5374,8 +5346,6 @@ gfc_match_select_type (void)
if (m != MATCH_YES)
return m;
- gfc_current_ns = gfc_build_block_ns (gfc_current_ns);
-
m = gfc_match (" %n => %e", name, &expr2);
if (m == MATCH_YES)
{
@@ -5406,7 +5376,10 @@ gfc_match_select_type (void)
m = gfc_match (" )%t");
if (m != MATCH_YES)
- goto cleanup;
+ {
+ gfc_error ("parse error in SELECT TYPE statement at %C");
+ goto cleanup;
+ }
/* This ghastly expression seems to be needed to distinguish a CLASS
array, which can have a reference, from other expressions that
@@ -5444,9 +5417,6 @@ gfc_match_select_type (void)
return MATCH_YES;
cleanup:
- parent_ns = gfc_current_ns->parent;
- gfc_free_namespace (gfc_current_ns);
- gfc_current_ns = parent_ns;
return m;
}
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index 48aa4056e17..ac8b9f84696 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -195,9 +195,9 @@ match gfc_match_volatile (void);
/* Fortran 2003 c interop.
TODO: some of these should be moved to another file rather than decl.c */
void set_com_block_bind_c (gfc_common_head *, int);
-gfc_try set_verify_bind_c_sym (gfc_symbol *, int);
-gfc_try set_verify_bind_c_com_block (gfc_common_head *, int);
-gfc_try get_bind_c_idents (void);
+bool set_verify_bind_c_sym (gfc_symbol *, int);
+bool set_verify_bind_c_com_block (gfc_common_head *, int);
+bool get_bind_c_idents (void);
match gfc_match_bind_c_stmt (void);
match gfc_match_suffix (gfc_symbol *, gfc_symbol **);
match gfc_match_bind_c (gfc_symbol *, bool);
@@ -213,7 +213,7 @@ match gfc_match_literal_constant (gfc_expr **, int);
/* expr.c -- FIXME: this one should be eliminated by moving the
matcher to matchexp.c and a call to a new function in expr.c that
only makes sure the init expr. is valid. */
-gfc_try gfc_reduce_init_expr (gfc_expr *expr);
+bool gfc_reduce_init_expr (gfc_expr *expr);
match gfc_match_init_expr (gfc_expr **);
/* array.c. */
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 814a40ded2f..046ba4835f2 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -555,8 +555,8 @@ gfc_match_use (void)
{
if ((m = gfc_match (" %n ::", module_nature)) == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "module "
- "nature in USE statement at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "module "
+ "nature in USE statement at %C"))
goto cleanup;
if (strcmp (module_nature, "intrinsic") == 0)
@@ -590,8 +590,7 @@ gfc_match_use (void)
{
m = gfc_match (" ::");
if (m == MATCH_YES &&
- gfc_notify_std (GFC_STD_F2003,
- "\"USE :: module\" at %C") == FAILURE)
+ !gfc_notify_std(GFC_STD_F2003, "\"USE :: module\" at %C"))
goto cleanup;
if (m != MATCH_YES)
@@ -658,9 +657,8 @@ gfc_match_use (void)
m = gfc_match (" =>");
if (type == INTERFACE_USER_OP && m == MATCH_YES
- && (gfc_notify_std (GFC_STD_F2003, "Renaming "
- "operators in USE statements at %C")
- == FAILURE))
+ && (!gfc_notify_std(GFC_STD_F2003, "Renaming "
+ "operators in USE statements at %C")))
goto cleanup;
if (type == INTERFACE_USER_OP)
@@ -4089,7 +4087,7 @@ load_generic_interfaces (void)
if (st && !sym->attr.generic
&& !st->ambiguous
&& sym->module
- && strcmp(module, sym->module))
+ && strcmp (module, sym->module))
{
ambiguous_set = true;
st->ambiguous = 1;
@@ -6096,10 +6094,9 @@ use_iso_fortran_env_module (void)
found = true;
u->found = 1;
- if (gfc_notify_std (symbol[i].standard, "The symbol '%s', "
- "referenced at %L, is not in the selected "
- "standard", symbol[i].name,
- &u->where) == FAILURE)
+ if (!gfc_notify_std (symbol[i].standard, "The symbol '%s', "
+ "referenced at %L, is not in the selected "
+ "standard", symbol[i].name, &u->where))
continue;
if ((gfc_option.flag_default_integer || gfc_option.flag_default_real)
@@ -6265,7 +6262,7 @@ gfc_use_module (gfc_use_list *module)
{
if (strcmp (module_name, "iso_fortran_env") == 0
&& gfc_notify_std (GFC_STD_F2003, "ISO_FORTRAN_ENV "
- "intrinsic module at %C") != FAILURE)
+ "intrinsic module at %C"))
{
use_iso_fortran_env_module ();
free_rename (module->rename);
@@ -6276,8 +6273,7 @@ gfc_use_module (gfc_use_list *module)
}
if (strcmp (module_name, "iso_c_binding") == 0
- && gfc_notify_std (GFC_STD_F2003,
- "ISO_C_BINDING module at %C") != FAILURE)
+ && gfc_notify_std (GFC_STD_F2003, "ISO_C_BINDING module at %C"))
{
import_iso_c_binding_module();
free_rename (module->rename);
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 05de49bd79b..865f8365cfc 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -316,9 +316,8 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, int mask)
&& ! sym->attr.intrinsic
&& ! sym->attr.use_assoc
&& ((sym->attr.flavor == FL_UNKNOWN
- && gfc_add_flavor (&sym->attr, FL_PROCEDURE,
- sym->name, NULL) == FAILURE)
- || gfc_add_intrinsic (&sym->attr, NULL) == FAILURE))
+ && !gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL))
+ || !gfc_add_intrinsic (&sym->attr, NULL)))
{
gfc_free_omp_clauses (c);
return MATCH_ERROR;
@@ -573,8 +572,7 @@ gfc_match_omp_threadprivate (void)
if (sym->attr.in_common)
gfc_error_now ("Threadprivate variable at %C is an element of "
"a COMMON block");
- else if (gfc_add_threadprivate (&sym->attr, sym->name,
- &sym->declared_at) == FAILURE)
+ else if (!gfc_add_threadprivate (&sym->attr, sym->name, &sym->declared_at))
goto cleanup;
goto next_item;
case MATCH_NO:
@@ -597,8 +595,7 @@ gfc_match_omp_threadprivate (void)
}
st->n.common->threadprivate = 1;
for (sym = st->n.common->head; sym; sym = sym->common_next)
- if (gfc_add_threadprivate (&sym->attr, sym->name,
- &sym->declared_at) == FAILURE)
+ if (!gfc_add_threadprivate (&sym->attr, sym->name, &sym->declared_at))
goto cleanup;
next_item:
@@ -814,7 +811,7 @@ resolve_omp_clauses (gfc_code *code)
if (omp_clauses->if_expr)
{
gfc_expr *expr = omp_clauses->if_expr;
- if (gfc_resolve_expr (expr) == FAILURE
+ if (!gfc_resolve_expr (expr)
|| expr->ts.type != BT_LOGICAL || expr->rank != 0)
gfc_error ("IF clause at %L requires a scalar LOGICAL expression",
&expr->where);
@@ -822,7 +819,7 @@ resolve_omp_clauses (gfc_code *code)
if (omp_clauses->final_expr)
{
gfc_expr *expr = omp_clauses->final_expr;
- if (gfc_resolve_expr (expr) == FAILURE
+ if (!gfc_resolve_expr (expr)
|| expr->ts.type != BT_LOGICAL || expr->rank != 0)
gfc_error ("FINAL clause at %L requires a scalar LOGICAL expression",
&expr->where);
@@ -830,7 +827,7 @@ resolve_omp_clauses (gfc_code *code)
if (omp_clauses->num_threads)
{
gfc_expr *expr = omp_clauses->num_threads;
- if (gfc_resolve_expr (expr) == FAILURE
+ if (!gfc_resolve_expr (expr)
|| expr->ts.type != BT_INTEGER || expr->rank != 0)
gfc_error ("NUM_THREADS clause at %L requires a scalar "
"INTEGER expression", &expr->where);
@@ -838,7 +835,7 @@ resolve_omp_clauses (gfc_code *code)
if (omp_clauses->chunk_size)
{
gfc_expr *expr = omp_clauses->chunk_size;
- if (gfc_resolve_expr (expr) == FAILURE
+ if (!gfc_resolve_expr (expr)
|| expr->ts.type != BT_INTEGER || expr->rank != 0)
gfc_error ("SCHEDULE clause's chunk_size at %L requires "
"a scalar INTEGER expression", &expr->where);
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index a7fa7dc597e..83011138ea5 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -100,7 +100,7 @@ use_modules (void)
#define match(keyword, subr, st) \
do { \
- if (match_word(keyword, subr, &old_locus) == MATCH_YES) \
+ if (match_word (keyword, subr, &old_locus) == MATCH_YES) \
return st; \
else \
undo_new_statement (); \
@@ -262,6 +262,7 @@ end_of_block:
static gfc_statement
decode_statement (void)
{
+ gfc_namespace *ns;
gfc_statement st;
locus old_locus;
match m;
@@ -363,7 +364,12 @@ decode_statement (void)
match (NULL, gfc_match_associate, ST_ASSOCIATE);
match (NULL, gfc_match_critical, ST_CRITICAL);
match (NULL, gfc_match_select, ST_SELECT_CASE);
+
+ gfc_current_ns = gfc_build_block_ns (gfc_current_ns);
match (NULL, gfc_match_select_type, ST_SELECT_TYPE);
+ ns = gfc_current_ns;
+ gfc_current_ns = gfc_current_ns->parent;
+ gfc_free_namespace (ns);
/* General statement matching: Instead of testing every possible
statement, we eliminate most possibilities by peeking at the
@@ -615,6 +621,7 @@ decode_omp_directive (void)
match ("taskyield", gfc_match_omp_taskyield, ST_OMP_TASKYIELD);
match ("threadprivate", gfc_match_omp_threadprivate,
ST_OMP_THREADPRIVATE);
+ break;
case 'w':
match ("workshare", gfc_match_omp_workshare, ST_OMP_WORKSHARE);
break;
@@ -1068,7 +1075,7 @@ pop_state (void)
/* Try to find the given state in the state stack. */
-gfc_try
+bool
gfc_find_state (gfc_compile_state state)
{
gfc_state_data *p;
@@ -1077,7 +1084,7 @@ gfc_find_state (gfc_compile_state state)
if (p->state == state)
break;
- return (p == NULL) ? FAILURE : SUCCESS;
+ return (p == NULL) ? false : true;
}
@@ -1763,7 +1770,7 @@ unexpected_statement (gfc_statement st)
/* Given the next statement seen by the matcher, make sure that it is
in proper order with the last. This subroutine is initialized by
calling it with an argument of ST_NONE. If there is a problem, we
- issue an error and return FAILURE. Otherwise we return SUCCESS.
+ issue an error and return false. Otherwise we return true.
Individual parsers need to verify that the statements seen are
valid before calling here, i.e., ENTRY statements are not allowed in
@@ -1815,7 +1822,7 @@ typedef struct
}
st_state;
-static gfc_try
+static bool
verify_st_order (st_state *p, gfc_statement st, bool silent)
{
@@ -1897,7 +1904,7 @@ verify_st_order (st_state *p, gfc_statement st, bool silent)
/* All is well, record the statement in case we need it next time. */
p->where = gfc_current_locus;
p->last_statement = st;
- return SUCCESS;
+ return true;
order:
if (!silent)
@@ -1905,7 +1912,7 @@ order:
gfc_ascii_statement (st),
gfc_ascii_statement (p->last_statement), &p->where);
- return FAILURE;
+ return false;
}
@@ -1977,8 +1984,7 @@ parse_derived_contains (void)
goto error;
case ST_PROCEDURE:
- if (gfc_notify_std (GFC_STD_F2003, "Type-bound"
- " procedure at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Type-bound procedure at %C"))
goto error;
accept_statement (ST_PROCEDURE);
@@ -1986,8 +1992,7 @@ parse_derived_contains (void)
break;
case ST_GENERIC:
- if (gfc_notify_std (GFC_STD_F2003, "GENERIC binding"
- " at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "GENERIC binding at %C"))
goto error;
accept_statement (ST_GENERIC);
@@ -1995,9 +2000,8 @@ parse_derived_contains (void)
break;
case ST_FINAL:
- if (gfc_notify_std (GFC_STD_F2003,
- "FINAL procedure declaration"
- " at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "FINAL procedure declaration"
+ " at %C"))
goto error;
accept_statement (ST_FINAL);
@@ -2008,16 +2012,15 @@ parse_derived_contains (void)
to_finish = true;
if (!seen_comps
- && (gfc_notify_std (GFC_STD_F2008, "Derived type "
- "definition at %C with empty CONTAINS "
- "section") == FAILURE))
+ && (!gfc_notify_std(GFC_STD_F2008, "Derived type definition "
+ "at %C with empty CONTAINS section")))
goto error;
/* ST_END_TYPE is accepted by parse_derived after return. */
break;
case ST_PRIVATE:
- if (gfc_find_state (COMP_MODULE) == FAILURE)
+ if (!gfc_find_state (COMP_MODULE))
{
gfc_error ("PRIVATE statement in TYPE at %C must be inside "
"a MODULE");
@@ -2120,7 +2123,7 @@ endType:
break;
case ST_PRIVATE:
- if (gfc_find_state (COMP_MODULE) == FAILURE)
+ if (!gfc_find_state (COMP_MODULE))
{
gfc_error ("PRIVATE statement in TYPE at %C must be inside "
"a MODULE");
@@ -2395,8 +2398,8 @@ loop:
gfc_new_block->attr.pointer = 0;
gfc_new_block->attr.proc_pointer = 1;
}
- if (gfc_add_explicit_interface (gfc_new_block, IFSRC_IFBODY,
- gfc_new_block->formal, NULL) == FAILURE)
+ if (!gfc_add_explicit_interface (gfc_new_block, IFSRC_IFBODY,
+ gfc_new_block->formal, NULL))
{
reject_statement ();
gfc_free_namespace (gfc_current_ns);
@@ -2642,7 +2645,7 @@ loop:
verify_st_order (&dummyss, ST_NONE, false);
verify_st_order (&dummyss, st, false);
- if (verify_st_order (&dummyss, ST_IMPLICIT, true) == FAILURE)
+ if (!verify_st_order (&dummyss, ST_IMPLICIT, true))
verify_now = true;
}
@@ -2683,7 +2686,7 @@ loop:
case ST_DERIVED_DECL:
case_decl:
declSt:
- if (verify_st_order (&ss, st, false) == FAILURE)
+ if (!verify_st_order (&ss, st, false))
{
reject_statement ();
st = next_statement ();
@@ -3313,14 +3316,14 @@ gfc_build_block_ns (gfc_namespace *parent_ns)
my_ns->proc_name = gfc_new_block;
else
{
- gfc_try t;
+ bool t;
char buffer[20]; /* Enough to hold "block@2147483648\n". */
snprintf(buffer, sizeof(buffer), "block@%d", numblock++);
gfc_get_symbol (buffer, my_ns, &my_ns->proc_name);
t = gfc_add_flavor (&my_ns->proc_name->attr, FL_LABEL,
my_ns->proc_name->name, NULL);
- gcc_assert (t == SUCCESS);
+ gcc_assert (t);
gfc_commit_symbol (my_ns->proc_name);
}
@@ -4026,9 +4029,9 @@ parse_contained (int module)
"ambiguous", gfc_new_block->name);
else
{
- if (gfc_add_procedure (&sym->attr, PROC_INTERNAL, sym->name,
- &gfc_new_block->declared_at) ==
- SUCCESS)
+ if (gfc_add_procedure (&sym->attr, PROC_INTERNAL,
+ sym->name,
+ &gfc_new_block->declared_at))
{
if (st == ST_FUNCTION)
gfc_add_function (&sym->attr, sym->name,
@@ -4174,7 +4177,7 @@ contains:
if (p->state == COMP_CONTAINS)
n++;
- if (gfc_find_state (COMP_MODULE) == SUCCESS)
+ if (gfc_find_state (COMP_MODULE) == true)
n--;
if (n > 0)
@@ -4492,7 +4495,7 @@ translate_all_program_units (gfc_namespace *gfc_global_ns_list,
/* Top level parser. */
-gfc_try
+bool
gfc_parse_file (void)
{
int seen_program, errors_before, errors;
@@ -4516,7 +4519,7 @@ gfc_parse_file (void)
gfc_statement_label = NULL;
if (setjmp (eof_buf))
- return FAILURE; /* Come here on unexpected EOF */
+ return false; /* Come here on unexpected EOF */
/* Prepare the global namespace that will contain the
program units. */
@@ -4663,7 +4666,7 @@ prog_units:
translate_all_program_units (gfc_global_ns_list, seen_program);
gfc_end_source_files ();
- return SUCCESS;
+ return true;
duplicate_main:
/* If we see a duplicate main program, shut down. If the second
@@ -4672,5 +4675,5 @@ duplicate_main:
gfc_error ("Two main PROGRAMs at %L and %C", &prog_locus);
reject_statement ();
gfc_done_2 ();
- return SUCCESS;
+ return true;
}
diff --git a/gcc/fortran/parse.h b/gcc/fortran/parse.h
index dbe3c49ad6b..acafe6c52eb 100644
--- a/gcc/fortran/parse.h
+++ b/gcc/fortran/parse.h
@@ -60,7 +60,7 @@ extern gfc_state_data *gfc_state_stack;
#define gfc_current_state() (gfc_state_stack->state)
int gfc_check_do_variable (gfc_symtree *);
-gfc_try gfc_find_state (gfc_compile_state);
+bool gfc_find_state (gfc_compile_state);
gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
const char *gfc_ascii_statement (gfc_statement);
match gfc_match_enum (void);
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index d14922416cf..1276abb3aa7 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -267,8 +267,7 @@ match_hollerith_constant (gfc_expr **result)
if (match_integer_constant (&e, 0) == MATCH_YES
&& gfc_match_char ('h') == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_LEGACY, "Hollerith constant "
- "at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_LEGACY, "Hollerith constant at %C"))
goto cleanup;
msg = gfc_extract_int (e, &num);
@@ -391,9 +390,8 @@ match_boz_constant (gfc_expr **result)
goto backup;
if (x_hex
- && (gfc_notify_std (GFC_STD_GNU, "Hexadecimal "
- "constant at %C uses non-standard syntax")
- == FAILURE))
+ && (!gfc_notify_std(GFC_STD_GNU, "Hexadecimal "
+ "constant at %C uses non-standard syntax")))
return MATCH_ERROR;
old_loc = gfc_current_locus;
@@ -430,9 +428,8 @@ match_boz_constant (gfc_expr **result)
goto backup;
}
- if (gfc_notify_std (GFC_STD_GNU, "BOZ constant "
- "at %C uses non-standard postfix syntax")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "BOZ constant "
+ "at %C uses non-standard postfix syntax"))
return MATCH_ERROR;
}
@@ -467,9 +464,8 @@ match_boz_constant (gfc_expr **result)
}
if (!gfc_in_match_data ()
- && (gfc_notify_std (GFC_STD_F2003, "BOZ used outside a DATA "
- "statement at %C")
- == FAILURE))
+ && (!gfc_notify_std(GFC_STD_F2003, "BOZ used outside a DATA "
+ "statement at %C")))
return MATCH_ERROR;
*result = e;
@@ -558,8 +554,8 @@ match_real_constant (gfc_expr **result, int signflag)
if (c == 'q')
{
- if (gfc_notify_std (GFC_STD_GNU, "exponent-letter 'q' in "
- "real-literal-constant at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter 'q' in "
+ "real-literal-constant at %C"))
return MATCH_ERROR;
else if (gfc_option.warn_real_q_constant)
gfc_warning("Extension: exponent-letter 'q' in real-literal-constant "
@@ -1217,8 +1213,8 @@ match_sym_complex_part (gfc_expr **result)
return MATCH_ERROR;
}
- if (gfc_notify_std (GFC_STD_F2003, "PARAMETER symbol in "
- "complex constant at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "PARAMETER symbol in "
+ "complex constant at %C"))
return MATCH_ERROR;
switch (sym->value->ts.type)
@@ -1506,8 +1502,8 @@ match_actual_arg (gfc_expr **result)
if (sym->attr.in_common && !sym->attr.proc_pointer)
{
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name,
- &sym->declared_at) == FAILURE)
+ if (!gfc_add_flavor (&sym->attr, FL_VARIABLE,
+ sym->name, &sym->declared_at))
return MATCH_ERROR;
break;
}
@@ -1646,8 +1642,7 @@ match_arg_list_function (gfc_actual_arglist *result)
}
}
- if (gfc_notify_std (GFC_STD_GNU, "argument list "
- "function at %C") == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "argument list function at %C"))
{
m = MATCH_ERROR;
goto cleanup;
@@ -1719,6 +1714,10 @@ gfc_match_actual_arglist (int sub_flag, gfc_actual_arglist **argp)
if (m != MATCH_YES)
goto cleanup;
+ if (!gfc_notify_std (GFC_STD_F95_OBS, "Alternate-return argument "
+ "at %C"))
+ goto cleanup;
+
tail->label = label;
goto next;
}
@@ -1932,7 +1931,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
for (;;)
{
- gfc_try t;
+ bool t;
gfc_symtree *tbp;
m = gfc_match_name (name);
@@ -1950,14 +1949,16 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
{
gfc_symbol* tbp_sym;
- if (t == FAILURE)
+ if (!t)
return MATCH_ERROR;
gcc_assert (!tail || !tail->next);
- gcc_assert (primary->expr_type == EXPR_VARIABLE
- || (primary->expr_type == EXPR_STRUCTURE
- && primary->symtree && primary->symtree->n.sym
- && primary->symtree->n.sym->attr.flavor));
+
+ if (!(primary->expr_type == EXPR_VARIABLE
+ || (primary->expr_type == EXPR_STRUCTURE
+ && primary->symtree && primary->symtree->n.sym
+ && primary->symtree->n.sym->attr.flavor)))
+ return MATCH_ERROR;
if (tbp->n.tb->is_generic)
tbp_sym = NULL;
@@ -2307,7 +2308,7 @@ gfc_free_structure_ctor_component (gfc_structure_ctor_component *comp)
the order required; this also checks along the way that each and every
component actually has an initializer and handles default initializers
for components without explicit value given. */
-static gfc_try
+static bool
build_actual_constructor (gfc_structure_ctor_component **comp_head,
gfc_constructor_base *ctor_head, gfc_symbol *sym)
{
@@ -2337,11 +2338,12 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head,
&gfc_current_locus);
value->ts = comp->ts;
- if (build_actual_constructor (comp_head, &value->value.constructor,
- comp->ts.u.derived) == FAILURE)
+ if (!build_actual_constructor (comp_head,
+ &value->value.constructor,
+ comp->ts.u.derived))
{
gfc_free_expr (value);
- return FAILURE;
+ return false;
}
gfc_constructor_append_expr (ctor_head, value, NULL);
@@ -2354,17 +2356,16 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head,
{
if (comp->initializer)
{
- if (gfc_notify_std (GFC_STD_F2003, "Structure"
- " constructor with missing optional arguments"
- " at %C") == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "Structure constructor "
+ "with missing optional arguments at %C"))
+ return false;
value = gfc_copy_expr (comp->initializer);
}
else
{
gfc_error ("No initializer for component '%s' given in the"
" structure constructor at %C!", comp->name);
- return FAILURE;
+ return false;
}
}
else
@@ -2382,11 +2383,11 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head,
gfc_free_structure_ctor_component (comp_iter);
}
}
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **cexpr,
gfc_actual_arglist **arglist,
bool parent)
@@ -2430,9 +2431,8 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
}
if (actual->name)
{
- if (gfc_notify_std (GFC_STD_F2003, "Structure"
- " constructor with named arguments at %C")
- == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2003, "Structure"
+ " constructor with named arguments at %C"))
goto cleanup;
comp_tail->name = xstrdup (actual->name);
@@ -2515,7 +2515,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
||
comp_tail->val->ts.u.derived != this_comp->ts.u.derived))
{
- gfc_try m;
+ bool m;
gfc_actual_arglist *arg_null = NULL;
actual->expr = comp_tail->val;
@@ -2525,7 +2525,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
comp->ts.u.derived, &comp_tail->val,
comp->ts.u.derived->attr.zero_comp
? &arg_null : &actual, true);
- if (m == FAILURE)
+ if (!m)
goto cleanup;
if (comp->ts.u.derived->attr.zero_comp)
@@ -2543,7 +2543,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
actual = actual->next;
}
- if (build_actual_constructor (&comp_head, &ctor_head, sym) == FAILURE)
+ if (!build_actual_constructor (&comp_head, &ctor_head, sym))
goto cleanup;
/* No component should be left, as this should have caused an error in the
@@ -2581,7 +2581,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
gfc_current_locus = old_locus;
if (parent)
*arglist = actual;
- return SUCCESS;
+ return true;
cleanup:
gfc_current_locus = old_locus;
@@ -2594,7 +2594,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
}
gfc_constructor_free (ctor_head);
- return FAILURE;
+ return false;
}
@@ -2623,8 +2623,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
return m;
}
- if (gfc_convert_to_structure_constructor (e, sym, NULL, NULL, false)
- != SUCCESS)
+ if (!gfc_convert_to_structure_constructor (e, sym, NULL, NULL, false))
{
gfc_free_expr (e);
return MATCH_ERROR;
@@ -2660,7 +2659,7 @@ check_for_implicit_index (gfc_symtree **st, gfc_symbol **sym)
/* Procedure pointer as function result: Replace the function symbol by the
auto-generated hidden result variable named "ppr@". */
-static gfc_try
+static bool
replace_hidden_procptr_result (gfc_symbol **sym, gfc_symtree **st)
{
/* Check for procedure pointer result variable. */
@@ -2675,9 +2674,9 @@ replace_hidden_procptr_result (gfc_symbol **sym, gfc_symtree **st)
(*sym)->result->attr.referenced = (*sym)->attr.referenced;
*sym = (*sym)->result;
*st = gfc_find_symtree ((*sym)->ns->sym_root, (*sym)->name);
- return SUCCESS;
+ return true;
}
- return FAILURE;
+ return false;
}
@@ -2704,7 +2703,7 @@ gfc_match_rvalue (gfc_expr **result)
if (m != MATCH_YES)
return m;
- if (gfc_find_state (COMP_INTERFACE) == SUCCESS
+ if (gfc_find_state (COMP_INTERFACE)
&& !gfc_current_ns->has_import_set)
i = gfc_get_sym_tree (name, NULL, &symtree, false);
else
@@ -2850,8 +2849,7 @@ gfc_match_rvalue (gfc_expr **result)
m = gfc_match_varspec (e, 0, false, true);
if (!e->ref && sym->attr.flavor == FL_UNKNOWN
&& sym->ts.type == BT_UNKNOWN
- && gfc_add_flavor (&sym->attr, FL_PROCEDURE,
- sym->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL))
{
m = MATCH_ERROR;
break;
@@ -2926,7 +2924,7 @@ gfc_match_rvalue (gfc_expr **result)
e->rank = sym->as->rank;
if (!sym->attr.function
- && gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
+ && !gfc_add_function (&sym->attr, sym->name, NULL))
{
m = MATCH_ERROR;
break;
@@ -2973,8 +2971,7 @@ gfc_match_rvalue (gfc_expr **result)
if (sym->attr.dimension || sym->attr.codimension)
{
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
- sym->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, NULL))
{
m = MATCH_ERROR;
break;
@@ -2991,8 +2988,7 @@ gfc_match_rvalue (gfc_expr **result)
&& (CLASS_DATA (sym)->attr.dimension
|| CLASS_DATA (sym)->attr.codimension))
{
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
- sym->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, NULL))
{
m = MATCH_ERROR;
break;
@@ -3017,8 +3013,7 @@ gfc_match_rvalue (gfc_expr **result)
e->symtree = symtree;
e->expr_type = EXPR_VARIABLE;
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
- sym->name, NULL) == FAILURE)
+ if (!gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, NULL))
{
m = MATCH_ERROR;
break;
@@ -3065,15 +3060,15 @@ gfc_match_rvalue (gfc_expr **result)
e->expr_type = EXPR_VARIABLE;
if (sym->attr.flavor != FL_VARIABLE
- && gfc_add_flavor (&sym->attr, FL_VARIABLE,
- sym->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&sym->attr, FL_VARIABLE,
+ sym->name, NULL))
{
m = MATCH_ERROR;
break;
}
if (sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (sym, 1, NULL) == FAILURE)
+ && !gfc_set_default_type (sym, 1, NULL))
{
m = MATCH_ERROR;
break;
@@ -3094,7 +3089,7 @@ gfc_match_rvalue (gfc_expr **result)
e->expr_type = EXPR_FUNCTION;
if (!sym->attr.function
- && gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
+ && !gfc_add_function (&sym->attr, sym->name, NULL))
{
m = MATCH_ERROR;
break;
@@ -3229,7 +3224,7 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag)
flavor = FL_VARIABLE;
if (flavor != FL_UNKNOWN
- && gfc_add_flavor (&sym->attr, flavor, sym->name, NULL) == FAILURE)
+ && !gfc_add_flavor (&sym->attr, flavor, sym->name, NULL))
return MATCH_ERROR;
}
break;
@@ -3265,7 +3260,7 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag)
}
if (sym->attr.proc_pointer
- || replace_hidden_procptr_result (&sym, &st) == SUCCESS)
+ || replace_hidden_procptr_result (&sym, &st))
break;
/* Fall through to error */
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 835b57f4996..684d2058b2d 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -114,7 +114,7 @@ is_sym_host_assoc (gfc_symbol *sym, gfc_namespace *ns)
an ABSTRACT derived-type. If where is not NULL, an error message with that
locus is printed, optionally using name. */
-static gfc_try
+static bool
resolve_typespec_used (gfc_typespec* ts, locus* where, const char* name)
{
if (ts->type == BT_DERIVED && ts->u.derived->attr.abstract)
@@ -129,14 +129,14 @@ resolve_typespec_used (gfc_typespec* ts, locus* where, const char* name)
ts->u.derived->name, where);
}
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
check_proc_interface (gfc_symbol *ifc, locus *where)
{
/* Several checks for F08:C1216. */
@@ -144,7 +144,7 @@ check_proc_interface (gfc_symbol *ifc, locus *where)
{
gfc_error ("Interface '%s' at %L is declared "
"in a later PROCEDURE statement", ifc->name, where);
- return FAILURE;
+ return false;
}
if (ifc->generic)
{
@@ -157,14 +157,14 @@ check_proc_interface (gfc_symbol *ifc, locus *where)
{
gfc_error ("Interface '%s' at %L may not be generic",
ifc->name, where);
- return FAILURE;
+ return false;
}
}
if (ifc->attr.proc == PROC_ST_FUNCTION)
{
gfc_error ("Interface '%s' at %L may not be a statement function",
ifc->name, where);
- return FAILURE;
+ return false;
}
if (gfc_is_intrinsic (ifc, 0, ifc->declared_at)
|| gfc_is_intrinsic (ifc, 1, ifc->declared_at))
@@ -173,14 +173,14 @@ check_proc_interface (gfc_symbol *ifc, locus *where)
{
gfc_error ("Intrinsic procedure '%s' not allowed in "
"PROCEDURE statement at %L", ifc->name, where);
- return FAILURE;
+ return false;
}
if (!ifc->attr.if_source && !ifc->attr.intrinsic && ifc->name[0] != '\0')
{
gfc_error ("Interface '%s' at %L must be explicit", ifc->name, where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -189,22 +189,22 @@ static void resolve_symbol (gfc_symbol *sym);
/* Resolve the interface for a PROCEDURE declaration or procedure pointer. */
-static gfc_try
+static bool
resolve_procedure_interface (gfc_symbol *sym)
{
gfc_symbol *ifc = sym->ts.interface;
if (!ifc)
- return SUCCESS;
+ return true;
if (ifc == sym)
{
gfc_error ("PROCEDURE '%s' at %L may not be used as its own interface",
sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
- if (check_proc_interface (ifc, &sym->declared_at) == FAILURE)
- return FAILURE;
+ if (!check_proc_interface (ifc, &sym->declared_at))
+ return false;
if (ifc->attr.if_source || ifc->attr.intrinsic)
{
@@ -242,12 +242,12 @@ resolve_procedure_interface (gfc_symbol *sym)
{
sym->ts.u.cl = gfc_new_charlen (sym->ns, ifc->ts.u.cl);
if (sym->ts.u.cl->length && !sym->ts.u.cl->resolved
- && gfc_resolve_expr (sym->ts.u.cl->length) == FAILURE)
- return FAILURE;
+ && !gfc_resolve_expr (sym->ts.u.cl->length))
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -303,7 +303,7 @@ resolve_formal_arglist (gfc_symbol *proc)
continue;
}
else if (sym->attr.procedure && sym->attr.if_source != IFSRC_DECL
- && resolve_procedure_interface (sym) == FAILURE)
+ && !resolve_procedure_interface (sym))
return;
if (sym->attr.if_source != IFSRC_UNKNOWN)
@@ -412,7 +412,7 @@ resolve_formal_arglist (gfc_symbol *proc)
{
if (sym->attr.flavor == FL_PROCEDURE)
{
- if (!gfc_pure(sym))
+ if (!gfc_pure (sym))
proc->attr.implicit_pure = 0;
}
else if (!sym->attr.pointer)
@@ -543,7 +543,7 @@ resolve_formal_arglists (gfc_namespace *ns)
static void
resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
{
- gfc_try t;
+ bool t;
/* If this namespace is not a function or an entry master function,
ignore it. */
@@ -556,7 +556,7 @@ resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
{
t = gfc_set_default_type (sym->result, 0, ns);
- if (t == FAILURE && !sym->result->attr.untyped)
+ if (!t && !sym->result->attr.untyped)
{
if (sym->result == sym)
gfc_error ("Contained function '%s' at %L has no IMPLICIT type",
@@ -1016,22 +1016,22 @@ resolve_contained_functions (gfc_namespace *ns)
}
-static gfc_try resolve_fl_derived0 (gfc_symbol *sym);
+static bool resolve_fl_derived0 (gfc_symbol *sym);
/* Resolve all of the elements of a structure constructor and make sure that
the types are correct. The 'init' flag indicates that the given
constructor is an initializer. */
-static gfc_try
+static bool
resolve_structure_cons (gfc_expr *expr, int init)
{
gfc_constructor *cons;
gfc_component *comp;
- gfc_try t;
+ bool t;
symbol_attribute a;
- t = SUCCESS;
+ t = true;
if (expr->ts.type == BT_DERIVED)
resolve_fl_derived0 (expr->ts.u.derived);
@@ -1053,9 +1053,9 @@ resolve_structure_cons (gfc_expr *expr, int init)
if (!cons->expr)
continue;
- if (gfc_resolve_expr (cons->expr) == FAILURE)
+ if (!gfc_resolve_expr (cons->expr))
{
- t = FAILURE;
+ t = false;
continue;
}
@@ -1067,7 +1067,7 @@ resolve_structure_cons (gfc_expr *expr, int init)
"constructor at %L does not match that of the "
"component (%d/%d)", &cons->expr->where,
cons->expr->rank, rank);
- t = FAILURE;
+ t = false;
}
/* If we don't have the right type, try to convert it. */
@@ -1089,12 +1089,12 @@ resolve_structure_cons (gfc_expr *expr, int init)
&cons->expr->where, comp->name,
gfc_basic_typename (cons->expr->ts.type),
gfc_basic_typename (comp->ts.type));
- t = FAILURE;
+ t = false;
}
else
{
- gfc_try t2 = gfc_convert_type (cons->expr, &comp->ts, 1);
- if (t != FAILURE)
+ bool t2 = gfc_convert_type (cons->expr, &comp->ts, 1);
+ if (t)
t = t2;
}
}
@@ -1168,7 +1168,7 @@ resolve_structure_cons (gfc_expr *expr, int init)
&& (CLASS_DATA (comp)->attr.class_pointer
|| CLASS_DATA (comp)->attr.allocatable))))
{
- t = FAILURE;
+ t = false;
gfc_error ("The NULL in the structure constructor at %L is "
"being applied to component '%s', which is neither "
"a POINTER nor ALLOCATABLE", &cons->expr->where,
@@ -1206,7 +1206,7 @@ resolve_structure_cons (gfc_expr *expr, int init)
gfc_error ("Interface mismatch for procedure-pointer component "
"'%s' in structure constructor at %L: %s",
comp->name, &cons->expr->where, err);
- return FAILURE;
+ return false;
}
}
@@ -1218,7 +1218,7 @@ resolve_structure_cons (gfc_expr *expr, int init)
if (!a.pointer && !a.target)
{
- t = FAILURE;
+ t = false;
gfc_error ("The element in the structure constructor at %L, "
"for pointer component '%s' should be a POINTER or "
"a TARGET", &cons->expr->where, comp->name);
@@ -1229,13 +1229,13 @@ resolve_structure_cons (gfc_expr *expr, int init)
/* F08:C461. Additional checks for pointer initialization. */
if (a.allocatable)
{
- t = FAILURE;
+ t = false;
gfc_error ("Pointer initialization target at %L "
"must not be ALLOCATABLE ", &cons->expr->where);
}
if (!a.save)
{
- t = FAILURE;
+ t = false;
gfc_error ("Pointer initialization target at %L "
"must have the SAVE attribute", &cons->expr->where);
}
@@ -1246,7 +1246,7 @@ resolve_structure_cons (gfc_expr *expr, int init)
&& (gfc_impure_variable (cons->expr->symtree->n.sym)
|| gfc_is_coindexed (cons->expr)))
{
- t = FAILURE;
+ t = false;
gfc_error ("Invalid expression in the structure constructor for "
"pointer component '%s' at %L in PURE procedure",
comp->name, &cons->expr->where);
@@ -1527,18 +1527,18 @@ is_illegal_recursion (gfc_symbol* sym, gfc_namespace* context)
/* Resolve an intrinsic procedure: Set its function/subroutine attribute,
its typespec and formal argument list. */
-gfc_try
+bool
gfc_resolve_intrinsic (gfc_symbol *sym, locus *loc)
{
gfc_intrinsic_sym* isym = NULL;
const char* symstd;
if (sym->formal)
- return SUCCESS;
+ return true;
/* Already resolved. */
if (sym->from_intmod && sym->ts.type != BT_UNKNOWN)
- return SUCCESS;
+ return true;
/* We already know this one is an intrinsic, so we don't call
gfc_is_intrinsic for full checking but rather use gfc_find_function and
@@ -1566,8 +1566,8 @@ gfc_resolve_intrinsic (gfc_symbol *sym, locus *loc)
" ignored", sym->name, &sym->declared_at);
if (!sym->attr.function &&
- gfc_add_function (&sym->attr, sym->name, loc) == FAILURE)
- return FAILURE;
+ !gfc_add_function(&sym->attr, sym->name, loc))
+ return false;
sym->ts = isym->ts;
}
@@ -1577,48 +1577,47 @@ gfc_resolve_intrinsic (gfc_symbol *sym, locus *loc)
{
gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type"
" specifier", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (!sym->attr.subroutine &&
- gfc_add_subroutine (&sym->attr, sym->name, loc) == FAILURE)
- return FAILURE;
+ !gfc_add_subroutine(&sym->attr, sym->name, loc))
+ return false;
}
else
{
gfc_error ("'%s' declared INTRINSIC at %L does not exist", sym->name,
&sym->declared_at);
- return FAILURE;
+ return false;
}
gfc_copy_formal_args_intr (sym, isym);
/* Check it is actually available in the standard settings. */
- if (gfc_check_intrinsic_standard (isym, &symstd, false, sym->declared_at)
- == FAILURE)
+ if (!gfc_check_intrinsic_standard (isym, &symstd, false, sym->declared_at))
{
gfc_error ("The intrinsic '%s' declared INTRINSIC at %L is not"
" available in the current standard settings but %s. Use"
" an appropriate -std=* option or enable -fall-intrinsics"
" in order to use it.",
sym->name, &sym->declared_at, symstd);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Resolve a procedure expression, like passing it to a called procedure or as
RHS for a procedure pointer assignment. */
-static gfc_try
+static bool
resolve_procedure_expression (gfc_expr* expr)
{
gfc_symbol* sym;
if (expr->expr_type != EXPR_VARIABLE)
- return SUCCESS;
+ return true;
gcc_assert (expr->symtree);
sym = expr->symtree->n.sym;
@@ -1628,7 +1627,7 @@ resolve_procedure_expression (gfc_expr* expr)
if (sym->attr.flavor != FL_PROCEDURE
|| (sym->attr.function && sym->result == sym))
- return SUCCESS;
+ return true;
/* A non-RECURSIVE procedure that is used as procedure expression within its
own body is in danger of being called recursively. */
@@ -1637,7 +1636,7 @@ resolve_procedure_expression (gfc_expr* expr)
" itself recursively. Declare it RECURSIVE or use"
" -frecursive", sym->name, &expr->where);
- return SUCCESS;
+ return true;
}
@@ -1647,7 +1646,7 @@ resolve_procedure_expression (gfc_expr* expr)
that look like procedure arguments are really simple variable
references. */
-static gfc_try
+static bool
resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
bool no_formal_args)
{
@@ -1655,7 +1654,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
gfc_symtree *parent_st;
gfc_expr *e;
int save_need_full_assumed_size;
- gfc_try return_value = FAILURE;
+ bool return_value = false;
bool actual_arg_sav = actual_arg, first_actual_arg_sav = first_actual_arg;
actual_arg = true;
@@ -1691,7 +1690,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
save_need_full_assumed_size = need_full_assumed_size;
if (e->expr_type != EXPR_VARIABLE)
need_full_assumed_size = 0;
- if (gfc_resolve_expr (e) != SUCCESS)
+ if (!gfc_resolve_expr (e))
goto cleanup;
need_full_assumed_size = save_need_full_assumed_size;
goto argument_list;
@@ -1729,10 +1728,9 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
if (sym->attr.contained && !sym->attr.use_assoc
&& sym->ns->proc_name->attr.flavor != FL_MODULE)
{
- if (gfc_notify_std (GFC_STD_F2008,
- "Internal procedure '%s' is"
- " used as actual argument at %L",
- sym->name, &e->where) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_F2008, "Internal procedure '%s' is"
+ " used as actual argument at %L",
+ sym->name, &e->where))
goto cleanup;
}
@@ -1775,7 +1773,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
sym->attr.function = 1;
}
- if (gfc_resolve_expr (e) == FAILURE)
+ if (!gfc_resolve_expr (e))
goto cleanup;
goto argument_list;
}
@@ -1801,7 +1799,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
|| sym->attr.intrinsic
|| sym->attr.external)
{
- if (gfc_resolve_expr (e) == FAILURE)
+ if (!gfc_resolve_expr (e))
goto cleanup;
goto argument_list;
}
@@ -1829,7 +1827,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
save_need_full_assumed_size = need_full_assumed_size;
if (e->expr_type != EXPR_VARIABLE)
need_full_assumed_size = 0;
- if (gfc_resolve_expr (e) != SUCCESS)
+ if (!gfc_resolve_expr (e))
goto cleanup;
need_full_assumed_size = save_need_full_assumed_size;
@@ -1894,7 +1892,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
first_actual_arg = false;
}
- return_value = SUCCESS;
+ return_value = true;
cleanup:
actual_arg = actual_arg_sav;
@@ -1908,7 +1906,7 @@ cleanup:
procedures. If called with c == NULL, we have a function, otherwise if
expr == NULL, we have a subroutine. */
-static gfc_try
+static bool
resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
{
gfc_actual_arglist *arg0;
@@ -1939,7 +1937,7 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
isym = expr->value.function.isym;
}
else
- return SUCCESS;
+ return true;
}
else if (c && c->ext.actual != NULL)
{
@@ -1952,10 +1950,10 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
gcc_assert (esym);
if (!esym->attr.elemental)
- return SUCCESS;
+ return true;
}
else
- return SUCCESS;
+ return true;
/* The rank of an elemental is the rank of its array argument(s). */
for (arg = arg0; arg; arg = arg->next)
@@ -2033,14 +2031,13 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
/* Being elemental, the last upper bound of an assumed size array
argument must be present. */
if (resolve_assumed_size_actual (arg->expr))
- return FAILURE;
+ return false;
/* Elemental procedure's array actual arguments must conform. */
if (e != NULL)
{
- if (gfc_check_conformance (arg->expr, e,
- "elemental procedure") == FAILURE)
- return FAILURE;
+ if (!gfc_check_conformance (arg->expr, e, "elemental procedure"))
+ return false;
}
else
e = arg->expr;
@@ -2060,9 +2057,9 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
"actual argument is an array", &arg->expr->where,
(eformal->sym->attr.intent == INTENT_OUT) ? "OUT"
: "INOUT", eformal->sym->name, esym->name);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -2121,6 +2118,126 @@ not_entry_self_reference (gfc_symbol *sym, gfc_namespace *gsym_ns)
return true;
}
+
+/* Check for the requirement of an explicit interface. F08:12.4.2.2. */
+
+bool
+gfc_explicit_interface_required (gfc_symbol *sym, char *errmsg, int err_len)
+{
+ gfc_formal_arglist *arg = gfc_sym_get_dummy_args (sym);
+
+ for ( ; arg; arg = arg->next)
+ {
+ if (!arg->sym)
+ continue;
+
+ if (arg->sym->attr.allocatable) /* (2a) */
+ {
+ strncpy (errmsg, _("allocatable argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.asynchronous)
+ {
+ strncpy (errmsg, _("asynchronous argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.optional)
+ {
+ strncpy (errmsg, _("optional argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.pointer)
+ {
+ strncpy (errmsg, _("pointer argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.target)
+ {
+ strncpy (errmsg, _("target argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.value)
+ {
+ strncpy (errmsg, _("value argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.volatile_)
+ {
+ strncpy (errmsg, _("volatile argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->as && arg->sym->as->type == AS_ASSUMED_SHAPE) /* (2b) */
+ {
+ strncpy (errmsg, _("assumed-shape argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->as && arg->sym->as->type == AS_ASSUMED_RANK) /* TS 29113, 6.2. */
+ {
+ strncpy (errmsg, _("assumed-rank argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->attr.codimension) /* (2c) */
+ {
+ strncpy (errmsg, _("coarray argument"), err_len);
+ return true;
+ }
+ else if (false) /* (2d) TODO: parametrized derived type */
+ {
+ strncpy (errmsg, _("parametrized derived type argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->ts.type == BT_CLASS) /* (2e) */
+ {
+ strncpy (errmsg, _("polymorphic argument"), err_len);
+ return true;
+ }
+ else if (arg->sym->ts.type == BT_ASSUMED)
+ {
+ /* As assumed-type is unlimited polymorphic (cf. above).
+ See also TS 29113, Note 6.1. */
+ strncpy (errmsg, _("assumed-type argument"), err_len);
+ return true;
+ }
+ }
+
+ if (sym->attr.function)
+ {
+ gfc_symbol *res = sym->result ? sym->result : sym;
+
+ if (res->attr.dimension) /* (3a) */
+ {
+ strncpy (errmsg, _("array result"), err_len);
+ return true;
+ }
+ else if (res->attr.pointer || res->attr.allocatable) /* (3b) */
+ {
+ strncpy (errmsg, _("pointer or allocatable result"), err_len);
+ return true;
+ }
+ else if (res->ts.type == BT_CHARACTER && res->ts.u.cl
+ && res->ts.u.cl->length
+ && res->ts.u.cl->length->expr_type != EXPR_CONSTANT) /* (3c) */
+ {
+ strncpy (errmsg, _("result with non-constant character length"), err_len);
+ return true;
+ }
+ }
+
+ if (sym->attr.elemental) /* (4) */
+ {
+ strncpy (errmsg, _("elemental procedure"), err_len);
+ return true;
+ }
+ else if (sym->attr.is_bind_c) /* (5) */
+ {
+ strncpy (errmsg, _("bind(c) procedure"), err_len);
+ return true;
+ }
+
+ return false;
+}
+
+
static void
resolve_global_procedure (gfc_symbol *sym, locus *where,
gfc_actual_arglist **actual, int sub)
@@ -2128,6 +2245,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
gfc_gsymbol * gsym;
gfc_namespace *ns;
enum gfc_symbol_type type;
+ char reason[200];
type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
@@ -2198,160 +2316,32 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
}
}
- /* Differences in constant character lengths. */
- if (sym->attr.function && sym->ts.type == BT_CHARACTER)
+ if (sym->attr.function && !gfc_compare_types (&sym->ts, &def_sym->ts))
{
- long int l1 = 0, l2 = 0;
- gfc_charlen *cl1 = sym->ts.u.cl;
- gfc_charlen *cl2 = def_sym->ts.u.cl;
-
- if (cl1 != NULL
- && cl1->length != NULL
- && cl1->length->expr_type == EXPR_CONSTANT)
- l1 = mpz_get_si (cl1->length->value.integer);
-
- if (cl2 != NULL
- && cl2->length != NULL
- && cl2->length->expr_type == EXPR_CONSTANT)
- l2 = mpz_get_si (cl2->length->value.integer);
-
- if (l1 && l2 && l1 != l2)
- gfc_error ("Character length mismatch in return type of "
- "function '%s' at %L (%ld/%ld)", sym->name,
- &sym->declared_at, l1, l2);
+ gfc_error ("Return type mismatch of function '%s' at %L (%s/%s)",
+ sym->name, &sym->declared_at, gfc_typename (&sym->ts),
+ gfc_typename (&def_sym->ts));
+ goto done;
}
- /* Type mismatch of function return type and expected type. */
- if (sym->attr.function
- && !gfc_compare_types (&sym->ts, &def_sym->ts))
- gfc_error ("Return type mismatch of function '%s' at %L (%s/%s)",
- sym->name, &sym->declared_at, gfc_typename (&sym->ts),
- gfc_typename (&def_sym->ts));
-
- if (def_sym->formal && sym->attr.if_source != IFSRC_IFBODY)
+ if (sym->attr.if_source == IFSRC_UNKNOWN
+ && gfc_explicit_interface_required (def_sym, reason, sizeof(reason)))
{
- gfc_formal_arglist *arg = def_sym->formal;
- for ( ; arg; arg = arg->next)
- if (!arg->sym)
- continue;
- /* F2003, 12.3.1.1 (2a); F2008, 12.4.2.2 (2a) */
- else if (arg->sym->attr.allocatable
- || arg->sym->attr.asynchronous
- || arg->sym->attr.optional
- || arg->sym->attr.pointer
- || arg->sym->attr.target
- || arg->sym->attr.value
- || arg->sym->attr.volatile_)
- {
- gfc_error ("Dummy argument '%s' of procedure '%s' at %L "
- "has an attribute that requires an explicit "
- "interface for this procedure", arg->sym->name,
- sym->name, &sym->declared_at);
- break;
- }
- /* F2003, 12.3.1.1 (2b); F2008, 12.4.2.2 (2b) */
- else if (arg->sym && arg->sym->as
- && arg->sym->as->type == AS_ASSUMED_SHAPE)
- {
- gfc_error ("Procedure '%s' at %L with assumed-shape dummy "
- "argument '%s' must have an explicit interface",
- sym->name, &sym->declared_at, arg->sym->name);
- break;
- }
- /* TS 29113, 6.2. */
- else if (arg->sym && arg->sym->as
- && arg->sym->as->type == AS_ASSUMED_RANK)
- {
- gfc_error ("Procedure '%s' at %L with assumed-rank dummy "
- "argument '%s' must have an explicit interface",
- sym->name, &sym->declared_at, arg->sym->name);
- break;
- }
- /* F2008, 12.4.2.2 (2c) */
- else if (arg->sym->attr.codimension)
- {
- gfc_error ("Procedure '%s' at %L with coarray dummy argument "
- "'%s' must have an explicit interface",
- sym->name, &sym->declared_at, arg->sym->name);
- break;
- }
- /* F2003, 12.3.1.1 (2c); F2008, 12.4.2.2 (2d) */
- else if (false) /* TODO: is a parametrized derived type */
- {
- gfc_error ("Procedure '%s' at %L with parametrized derived "
- "type argument '%s' must have an explicit "
- "interface", sym->name, &sym->declared_at,
- arg->sym->name);
- break;
- }
- /* F2003, 12.3.1.1 (2d); F2008, 12.4.2.2 (2e) */
- else if (arg->sym->ts.type == BT_CLASS)
- {
- gfc_error ("Procedure '%s' at %L with polymorphic dummy "
- "argument '%s' must have an explicit interface",
- sym->name, &sym->declared_at, arg->sym->name);
- break;
- }
- /* As assumed-type is unlimited polymorphic (cf. above).
- See also TS 29113, Note 6.1. */
- else if (arg->sym->ts.type == BT_ASSUMED)
- {
- gfc_error ("Procedure '%s' at %L with assumed-type dummy "
- "argument '%s' must have an explicit interface",
- sym->name, &sym->declared_at, arg->sym->name);
- break;
- }
- }
-
- if (def_sym->attr.function)
- {
- /* F2003, 12.3.1.1 (3a); F2008, 12.4.2.2 (3a) */
- if (def_sym->as && def_sym->as->rank
- && (!sym->as || sym->as->rank != def_sym->as->rank))
- gfc_error ("The reference to function '%s' at %L either needs an "
- "explicit INTERFACE or the rank is incorrect", sym->name,
- where);
-
- /* F2003, 12.3.1.1 (3b); F2008, 12.4.2.2 (3b) */
- if ((def_sym->result->attr.pointer
- || def_sym->result->attr.allocatable)
- && (sym->attr.if_source != IFSRC_IFBODY
- || def_sym->result->attr.pointer
- != sym->result->attr.pointer
- || def_sym->result->attr.allocatable
- != sym->result->attr.allocatable))
- gfc_error ("Function '%s' at %L with a POINTER or ALLOCATABLE "
- "result must have an explicit interface", sym->name,
- where);
-
- /* F2003, 12.3.1.1 (3c); F2008, 12.4.2.2 (3c) */
- if (sym->ts.type == BT_CHARACTER && sym->attr.if_source != IFSRC_IFBODY
- && def_sym->ts.type == BT_CHARACTER && def_sym->ts.u.cl->length != NULL)
- {
- gfc_charlen *cl = sym->ts.u.cl;
-
- if (!sym->attr.entry_master && sym->attr.if_source == IFSRC_UNKNOWN
- && cl && cl->length && cl->length->expr_type != EXPR_CONSTANT)
- {
- gfc_error ("Nonconstant character-length function '%s' at %L "
- "must have an explicit interface", sym->name,
- &sym->declared_at);
- }
- }
+ gfc_error ("Explicit interface required for '%s' at %L: %s",
+ sym->name, &sym->declared_at, reason);
+ goto done;
}
- /* F2003, 12.3.1.1 (4); F2008, 12.4.2.2 (4) */
- if (def_sym->attr.elemental && !sym->attr.elemental)
- {
- gfc_error ("ELEMENTAL procedure '%s' at %L must have an explicit "
- "interface", sym->name, &sym->declared_at);
- }
+ if (!pedantic && (gfc_option.allow_std & GFC_STD_GNU))
+ /* Turn erros into warnings with -std=gnu and -std=legacy. */
+ gfc_errors_to_warnings (1);
- /* F2003, 12.3.1.1 (5); F2008, 12.4.2.2 (5) */
- if (def_sym->attr.is_bind_c && !sym->attr.is_bind_c)
- {
- gfc_error ("Procedure '%s' at %L with BIND(C) attribute must have "
- "an explicit interface", sym->name, &sym->declared_at);
+ if (!gfc_compare_interfaces (sym, def_sym, sym->name, 0, 1,
+ reason, sizeof(reason), NULL, NULL))
+ {
+ gfc_error ("Interface mismatch in global procedure '%s' at %L: %s ",
+ sym->name, &sym->declared_at, reason);
+ goto done;
}
if (!pedantic
@@ -2361,9 +2351,10 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (sym->attr.if_source != IFSRC_IFBODY)
gfc_procedure_use (def_sym, actual, where);
-
- gfc_errors_to_warnings (0);
}
+
+done:
+ gfc_errors_to_warnings (0);
if (gsym->type == GSYM_UNKNOWN)
{
@@ -2419,7 +2410,7 @@ resolve_generic_f0 (gfc_expr *expr, gfc_symbol *sym)
}
-static gfc_try
+static bool
resolve_generic_f (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -2432,9 +2423,9 @@ resolve_generic_f (gfc_expr *expr)
{
m = resolve_generic_f0 (expr, sym);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
else if (m == MATCH_ERROR)
- return FAILURE;
+ return false;
generic:
if (!intr)
@@ -2458,27 +2449,27 @@ generic:
{
gfc_error ("There is no specific function for the generic '%s' "
"at %L", expr->symtree->n.sym->name, &expr->where);
- return FAILURE;
+ return false;
}
if (intr)
{
- if (gfc_convert_to_structure_constructor (expr, intr->sym, NULL, NULL,
- false) != SUCCESS)
- return FAILURE;
+ if (!gfc_convert_to_structure_constructor (expr, intr->sym, NULL,
+ NULL, false))
+ return false;
return resolve_structure_cons (expr, 0);
}
m = gfc_intrinsic_func_interface (expr, 0);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
if (m == MATCH_NO)
gfc_error ("Generic function '%s' at %L is not consistent with a "
"specific intrinsic interface", expr->symtree->n.sym->name,
&expr->where);
- return FAILURE;
+ return false;
}
@@ -2536,7 +2527,7 @@ found:
}
-static gfc_try
+static bool
resolve_specific_f (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -2548,9 +2539,9 @@ resolve_specific_f (gfc_expr *expr)
{
m = resolve_specific_f0 (sym, expr);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
if (m == MATCH_ERROR)
- return FAILURE;
+ return false;
if (sym->ns->parent == NULL)
break;
@@ -2564,13 +2555,13 @@ resolve_specific_f (gfc_expr *expr)
gfc_error ("Unable to resolve the specific function '%s' at %L",
expr->symtree->n.sym->name, &expr->where);
- return SUCCESS;
+ return true;
}
/* Resolve a procedure call not known to be generic nor specific. */
-static gfc_try
+static bool
resolve_unknown_f (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -2590,8 +2581,8 @@ resolve_unknown_f (gfc_expr *expr)
if (gfc_is_intrinsic (sym, 0, expr->where))
{
if (gfc_intrinsic_func_interface (expr, 1) == MATCH_YES)
- return SUCCESS;
- return FAILURE;
+ return true;
+ return false;
}
/* The reference is to an external name. */
@@ -2619,13 +2610,13 @@ set_type:
{
gfc_error ("Function '%s' at %L has no IMPLICIT type",
sym->name, &expr->where);
- return FAILURE;
+ return false;
}
else
expr->ts = *ts;
}
- return SUCCESS;
+ return true;
}
@@ -2713,13 +2704,13 @@ pure_stmt_function (gfc_expr *e, gfc_symbol *sym)
/* Resolve a function call, which means resolving the arguments, then figuring
out which entity the name refers to. */
-static gfc_try
+static bool
resolve_function (gfc_expr *expr)
{
gfc_actual_arglist *arg;
gfc_symbol *sym;
const char *name;
- gfc_try t;
+ bool t;
int temp;
procedure_type p = PROC_INTRINSIC;
bool no_formal_args;
@@ -2730,16 +2721,16 @@ resolve_function (gfc_expr *expr)
/* If this is a procedure pointer component, it has already been resolved. */
if (gfc_is_proc_ptr_comp (expr))
- return SUCCESS;
+ return true;
if (sym && sym->attr.intrinsic
- && gfc_resolve_intrinsic (sym, &expr->where) == FAILURE)
- return FAILURE;
+ && !gfc_resolve_intrinsic (sym, &expr->where))
+ return false;
if (sym && (sym->attr.flavor == FL_VARIABLE || sym->attr.subroutine))
{
gfc_error ("'%s' at %L is not a function", sym->name, &expr->where);
- return FAILURE;
+ return false;
}
/* If this ia a deferred TBP with an abstract interface (which may
@@ -2748,7 +2739,7 @@ resolve_function (gfc_expr *expr)
{
gfc_error ("ABSTRACT INTERFACE '%s' must not be referenced at %L",
sym->name, &expr->where);
- return FAILURE;
+ return false;
}
/* Switch off assumed size checking and do this again for certain kinds
@@ -2763,11 +2754,11 @@ resolve_function (gfc_expr *expr)
no_formal_args = sym && is_external_proc (sym)
&& gfc_sym_get_dummy_args (sym) == NULL;
- if (resolve_actual_arglist (expr->value.function.actual,
- p, no_formal_args) == FAILURE)
+ if (!resolve_actual_arglist (expr->value.function.actual,
+ p, no_formal_args))
{
inquiry_argument = false;
- return FAILURE;
+ return false;
}
inquiry_argument = false;
@@ -2792,7 +2783,7 @@ resolve_function (gfc_expr *expr)
gfc_error ("Function '%s' is declared CHARACTER(*) and cannot "
"be used at %L since it is not a dummy argument",
sym->name, &expr->where);
- return FAILURE;
+ return false;
}
/* See if function is already resolved. */
@@ -2801,7 +2792,7 @@ resolve_function (gfc_expr *expr)
{
if (expr->ts.type == BT_UNKNOWN)
expr->ts = sym->ts;
- t = SUCCESS;
+ t = true;
}
else
{
@@ -2835,8 +2826,8 @@ resolve_function (gfc_expr *expr)
temp = need_full_assumed_size;
need_full_assumed_size = 0;
- if (resolve_elemental_actual (expr, NULL) == FAILURE)
- return FAILURE;
+ if (!resolve_elemental_actual (expr, NULL))
+ return false;
if (omp_workshare_flag
&& expr->value.function.esym
@@ -2845,7 +2836,7 @@ resolve_function (gfc_expr *expr)
gfc_error ("User defined non-ELEMENTAL function '%s' at %L not allowed "
"in WORKSHARE construct", expr->value.function.esym->name,
&expr->where);
- t = FAILURE;
+ t = false;
}
#define GENERIC_ID expr->value.function.isym->id
@@ -2870,7 +2861,7 @@ resolve_function (gfc_expr *expr)
if (arg->next->expr->expr_type != EXPR_CONSTANT)
break;
- if (arg->next->name && strncmp(arg->next->name, "kind", 4) == 0)
+ if (arg->next->name && strncmp (arg->next->name, "kind", 4) == 0)
break;
if ((int)mpz_get_si (arg->next->expr->value.integer)
@@ -2881,7 +2872,7 @@ resolve_function (gfc_expr *expr)
if (arg->expr != NULL
&& arg->expr->rank > 0
&& resolve_assumed_size_actual (arg->expr))
- return FAILURE;
+ return false;
}
}
#undef GENERIC_ID
@@ -2896,20 +2887,20 @@ resolve_function (gfc_expr *expr)
gfc_error ("Reference to non-PURE function '%s' at %L inside a "
"FORALL %s", name, &expr->where,
forall_flag == 2 ? "mask" : "block");
- t = FAILURE;
+ t = false;
}
else if (do_concurrent_flag)
{
gfc_error ("Reference to non-PURE function '%s' at %L inside a "
"DO CONCURRENT %s", name, &expr->where,
do_concurrent_flag == 2 ? "mask" : "block");
- t = FAILURE;
+ t = false;
}
else if (gfc_pure (NULL))
{
gfc_error ("Function reference to '%s' at %L is to a non-PURE "
"procedure within a PURE procedure", name, &expr->where);
- t = FAILURE;
+ t = false;
}
if (gfc_implicit_pure (NULL))
@@ -2933,7 +2924,7 @@ resolve_function (gfc_expr *expr)
gfc_error ("Function '%s' at %L cannot be called recursively, as it"
" is not RECURSIVE", esym->name, &expr->where);
- t = FAILURE;
+ t = false;
}
}
@@ -3008,7 +2999,7 @@ resolve_generic_s0 (gfc_code *c, gfc_symbol *sym)
}
-static gfc_try
+static bool
resolve_generic_s (gfc_code *c)
{
gfc_symbol *sym;
@@ -3020,9 +3011,9 @@ resolve_generic_s (gfc_code *c)
{
m = resolve_generic_s0 (c, sym);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
else if (m == MATCH_ERROR)
- return FAILURE;
+ return false;
generic:
if (sym->ns->parent == NULL)
@@ -3043,17 +3034,17 @@ generic:
{
gfc_error ("There is no specific subroutine for the generic '%s' at %L",
sym->name, &c->loc);
- return FAILURE;
+ return false;
}
m = gfc_intrinsic_sub_interface (c, 0);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
if (m == MATCH_NO)
gfc_error ("Generic subroutine '%s' at %L is not consistent with an "
"intrinsic subroutine interface", sym->name, &c->loc);
- return FAILURE;
+ return false;
}
@@ -3103,7 +3094,7 @@ found:
}
-static gfc_try
+static bool
resolve_specific_s (gfc_code *c)
{
gfc_symbol *sym;
@@ -3115,9 +3106,9 @@ resolve_specific_s (gfc_code *c)
{
m = resolve_specific_s0 (c, sym);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
if (m == MATCH_ERROR)
- return FAILURE;
+ return false;
if (sym->ns->parent == NULL)
break;
@@ -3132,13 +3123,13 @@ resolve_specific_s (gfc_code *c)
gfc_error ("Unable to resolve the specific subroutine '%s' at %L",
sym->name, &c->loc);
- return FAILURE;
+ return false;
}
/* Resolve a subroutine call not known to be generic nor specific. */
-static gfc_try
+static bool
resolve_unknown_s (gfc_code *c)
{
gfc_symbol *sym;
@@ -3156,8 +3147,8 @@ resolve_unknown_s (gfc_code *c)
if (gfc_is_intrinsic (sym, 1, c->loc))
{
if (gfc_intrinsic_sub_interface (c, 1) == MATCH_YES)
- return SUCCESS;
- return FAILURE;
+ return true;
+ return false;
}
/* The reference is to an external name. */
@@ -3169,7 +3160,7 @@ found:
pure_subroutine (c, sym);
- return SUCCESS;
+ return true;
}
@@ -3177,10 +3168,10 @@ found:
for functions, subroutines and functions are stored differently and this
makes things awkward. */
-static gfc_try
+static bool
resolve_call (gfc_code *c)
{
- gfc_try t;
+ bool t;
procedure_type ptype = PROC_INTRINSIC;
gfc_symbol *csym, *sym;
bool no_formal_args;
@@ -3191,7 +3182,7 @@ resolve_call (gfc_code *c)
{
gfc_error ("'%s' at %L has a type, which is not consistent with "
"the CALL at %L", csym->name, &csym->declared_at, &c->loc);
- return FAILURE;
+ return false;
}
if (csym && gfc_current_ns->parent && csym->ns != gfc_current_ns)
@@ -3220,7 +3211,7 @@ resolve_call (gfc_code *c)
{
gfc_error ("ABSTRACT INTERFACE '%s' must not be referenced at %L",
csym->name, &c->loc);
- return FAILURE;
+ return false;
}
/* Subroutines without the RECURSIVE attribution are not allowed to
@@ -3235,7 +3226,7 @@ resolve_call (gfc_code *c)
gfc_error ("SUBROUTINE '%s' at %L cannot be called recursively, "
"as it is not RECURSIVE", csym->name, &c->loc);
- t = FAILURE;
+ t = false;
}
}
@@ -3248,9 +3239,8 @@ resolve_call (gfc_code *c)
no_formal_args = csym && is_external_proc (csym)
&& gfc_sym_get_dummy_args (csym) == NULL;
- if (resolve_actual_arglist (c->ext.actual, ptype,
- no_formal_args) == FAILURE)
- return FAILURE;
+ if (!resolve_actual_arglist (c->ext.actual, ptype, no_formal_args))
+ return false;
/* Resume assumed_size checking. */
need_full_assumed_size--;
@@ -3259,7 +3249,7 @@ resolve_call (gfc_code *c)
if (csym && is_external_proc (csym))
resolve_global_procedure (csym, &c->loc, &c->ext.actual, 1);
- t = SUCCESS;
+ t = true;
if (c->resolved_sym == NULL)
{
c->resolved_isym = NULL;
@@ -3283,26 +3273,26 @@ resolve_call (gfc_code *c)
}
/* Some checks of elemental subroutine actual arguments. */
- if (resolve_elemental_actual (NULL, c) == FAILURE)
- return FAILURE;
+ if (!resolve_elemental_actual (NULL, c))
+ return false;
return t;
}
/* Compare the shapes of two arrays that have non-NULL shapes. If both
- op1->shape and op2->shape are non-NULL return SUCCESS if their shapes
- match. If both op1->shape and op2->shape are non-NULL return FAILURE
+ op1->shape and op2->shape are non-NULL return true if their shapes
+ match. If both op1->shape and op2->shape are non-NULL return false
if their shapes do not match. If either op1->shape or op2->shape is
- NULL, return SUCCESS. */
+ NULL, return true. */
-static gfc_try
+static bool
compare_shapes (gfc_expr *op1, gfc_expr *op2)
{
- gfc_try t;
+ bool t;
int i;
- t = SUCCESS;
+ t = true;
if (op1->shape != NULL && op2->shape != NULL)
{
@@ -3312,7 +3302,7 @@ compare_shapes (gfc_expr *op1, gfc_expr *op2)
{
gfc_error ("Shapes for operands at %L and %L are not conformable",
&op1->where, &op2->where);
- t = FAILURE;
+ t = false;
break;
}
}
@@ -3325,21 +3315,21 @@ compare_shapes (gfc_expr *op1, gfc_expr *op2)
/* Resolve an operator expression node. This can involve replacing the
operation with a user defined function call. */
-static gfc_try
+static bool
resolve_operator (gfc_expr *e)
{
gfc_expr *op1, *op2;
char msg[200];
bool dual_locus_error;
- gfc_try t;
+ bool t;
/* Resolve all subnodes-- give them types. */
switch (e->value.op.op)
{
default:
- if (gfc_resolve_expr (e->value.op.op2) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (e->value.op.op2))
+ return false;
/* Fall through... */
@@ -3347,8 +3337,8 @@ resolve_operator (gfc_expr *e)
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
case INTRINSIC_PARENTHESES:
- if (gfc_resolve_expr (e->value.op.op1) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (e->value.op.op1))
+ return false;
break;
}
@@ -3546,7 +3536,7 @@ resolve_operator (gfc_expr *e)
/* Deal with arrayness of an operand through an operator. */
- t = SUCCESS;
+ t = true;
switch (e->value.op.op)
{
@@ -3600,7 +3590,7 @@ resolve_operator (gfc_expr *e)
if (e->shape == NULL)
{
t = compare_shapes (op1, op2);
- if (t == FAILURE)
+ if (!t)
e->shape = NULL;
else
e->shape = gfc_copy_shape (op1->shape, op1->rank);
@@ -3638,14 +3628,14 @@ resolve_operator (gfc_expr *e)
}
/* Attempt to simplify the expression. */
- if (t == SUCCESS)
+ if (t)
{
t = gfc_simplify_expr (e, 0);
- /* Some calls do not succeed in simplification and return FAILURE
+ /* Some calls do not succeed in simplification and return false
even though there is no error; e.g. variable references to
PARAMETER arrays. */
if (!gfc_is_constant_expr (e))
- t = SUCCESS;
+ t = true;
}
return t;
@@ -3654,9 +3644,9 @@ bad_op:
{
match m = gfc_extend_expr (e);
if (m == MATCH_YES)
- return SUCCESS;
+ return true;
if (m == MATCH_ERROR)
- return FAILURE;
+ return false;
}
if (dual_locus_error)
@@ -3664,7 +3654,7 @@ bad_op:
else
gfc_error (msg, &e->where);
- return FAILURE;
+ return false;
}
@@ -3766,7 +3756,7 @@ compute_last_value_for_triplet (gfc_expr *start, gfc_expr *end,
|| (stride != NULL && stride->ts.type != BT_INTEGER))
return 0;
- if (stride == NULL || compare_bound_int(stride, 1) == CMP_EQ)
+ if (stride == NULL || compare_bound_int (stride, 1) == CMP_EQ)
{
if (compare_bound (start, end) == CMP_GT)
return 0;
@@ -3800,7 +3790,7 @@ compute_last_value_for_triplet (gfc_expr *start, gfc_expr *end,
/* Compare a single dimension of an array reference to the array
specification. */
-static gfc_try
+static bool
check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
{
mpz_t last_value;
@@ -3812,7 +3802,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
if (ar->start[i] == NULL)
{
gcc_assert (ar->end[i] == NULL);
- return SUCCESS;
+ return true;
}
}
@@ -3840,7 +3830,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
mpz_get_si (ar->start[i]->value.integer),
mpz_get_si (as->lower[i]->value.integer),
i + 1 - as->rank);
- return SUCCESS;
+ return true;
}
if (compare_bound (ar->start[i], as->upper[i]) == CMP_GT)
{
@@ -3855,7 +3845,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
mpz_get_si (ar->start[i]->value.integer),
mpz_get_si (as->upper[i]->value.integer),
i + 1 - as->rank);
- return SUCCESS;
+ return true;
}
break;
@@ -3871,7 +3861,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
if (compare_bound_int (ar->stride[i], 0) == CMP_EQ)
{
gfc_error ("Illegal stride of zero at %L", &ar->c_where[i]);
- return FAILURE;
+ return false;
}
/* if start == len || (stride > 0 && start < len)
@@ -3891,7 +3881,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
"(%ld < %ld) in dimension %d", &ar->c_where[i],
mpz_get_si (AR_START->value.integer),
mpz_get_si (as->lower[i]->value.integer), i+1);
- return SUCCESS;
+ return true;
}
if (compare_bound (AR_START, as->upper[i]) == CMP_GT)
{
@@ -3899,7 +3889,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
"(%ld > %ld) in dimension %d", &ar->c_where[i],
mpz_get_si (AR_START->value.integer),
mpz_get_si (as->upper[i]->value.integer), i+1);
- return SUCCESS;
+ return true;
}
}
@@ -3916,7 +3906,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
mpz_get_si (last_value),
mpz_get_si (as->lower[i]->value.integer), i+1);
mpz_clear (last_value);
- return SUCCESS;
+ return true;
}
if (compare_bound_mpz_t (as->upper[i], last_value) == CMP_LT)
{
@@ -3925,7 +3915,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
mpz_get_si (last_value),
mpz_get_si (as->upper[i]->value.integer), i+1);
mpz_clear (last_value);
- return SUCCESS;
+ return true;
}
}
mpz_clear (last_value);
@@ -3939,13 +3929,13 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
gfc_internal_error ("check_dimension(): Bad array reference");
}
- return SUCCESS;
+ return true;
}
/* Compare an array reference with an array specification. */
-static gfc_try
+static bool
compare_spec_to_ref (gfc_array_ref *ar)
{
gfc_array_spec *as;
@@ -3961,17 +3951,17 @@ compare_spec_to_ref (gfc_array_ref *ar)
{
gfc_error ("Rightmost upper bound of assumed size array section "
"not specified at %L", &ar->where);
- return FAILURE;
+ return false;
}
if (ar->type == AR_FULL)
- return SUCCESS;
+ return true;
if (as->rank != ar->dimen)
{
gfc_error ("Rank mismatch in array reference at %L (%d/%d)",
&ar->where, ar->dimen, as->rank);
- return FAILURE;
+ return false;
}
/* ar->codimen == 0 is a local array. */
@@ -3979,12 +3969,12 @@ compare_spec_to_ref (gfc_array_ref *ar)
{
gfc_error ("Coindex rank mismatch in array reference at %L (%d/%d)",
&ar->where, ar->codimen, as->corank);
- return FAILURE;
+ return false;
}
for (i = 0; i < as->rank; i++)
- if (check_dimension (i, ar, as) == FAILURE)
- return FAILURE;
+ if (!check_dimension (i, ar, as))
+ return false;
/* Local access has no coarray spec. */
if (ar->codimen != 0)
@@ -3995,47 +3985,47 @@ compare_spec_to_ref (gfc_array_ref *ar)
{
gfc_error ("Coindex of codimension %d must be a scalar at %L",
i + 1 - as->rank, &ar->where);
- return FAILURE;
+ return false;
}
- if (check_dimension (i, ar, as) == FAILURE)
- return FAILURE;
+ if (!check_dimension (i, ar, as))
+ return false;
}
- return SUCCESS;
+ return true;
}
/* Resolve one part of an array index. */
-static gfc_try
+static bool
gfc_resolve_index_1 (gfc_expr *index, int check_scalar,
int force_index_integer_kind)
{
gfc_typespec ts;
if (index == NULL)
- return SUCCESS;
+ return true;
- if (gfc_resolve_expr (index) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (index))
+ return false;
if (check_scalar && index->rank != 0)
{
gfc_error ("Array index at %L must be scalar", &index->where);
- return FAILURE;
+ return false;
}
if (index->ts.type != BT_INTEGER && index->ts.type != BT_REAL)
{
gfc_error ("Array index at %L must be of INTEGER type, found %s",
&index->where, gfc_basic_typename (index->ts.type));
- return FAILURE;
+ return false;
}
if (index->ts.type == BT_REAL)
- if (gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L",
- &index->where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L",
+ &index->where))
+ return false;
if ((index->ts.kind != gfc_index_integer_kind
&& force_index_integer_kind)
@@ -4048,12 +4038,12 @@ gfc_resolve_index_1 (gfc_expr *index, int check_scalar,
gfc_convert_type_warn (index, &ts, 2, 0);
}
- return SUCCESS;
+ return true;
}
/* Resolve one part of an array index. */
-gfc_try
+bool
gfc_resolve_index (gfc_expr *index, int check_scalar)
{
return gfc_resolve_index_1 (index, check_scalar, 1);
@@ -4061,26 +4051,26 @@ gfc_resolve_index (gfc_expr *index, int check_scalar)
/* Resolve a dim argument to an intrinsic function. */
-gfc_try
+bool
gfc_resolve_dim_arg (gfc_expr *dim)
{
if (dim == NULL)
- return SUCCESS;
+ return true;
- if (gfc_resolve_expr (dim) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (dim))
+ return false;
if (dim->rank != 0)
{
gfc_error ("Argument dim at %L must be scalar", &dim->where);
- return FAILURE;
+ return false;
}
if (dim->ts.type != BT_INTEGER)
{
gfc_error ("Argument dim at %L must be of INTEGER type", &dim->where);
- return FAILURE;
+ return false;
}
if (dim->ts.kind != gfc_index_integer_kind)
@@ -4094,7 +4084,7 @@ gfc_resolve_dim_arg (gfc_expr *dim)
gfc_convert_type_warn (dim, &ts, 2, 0);
}
- return SUCCESS;
+ return true;
}
/* Given an expression that contains array references, update those array
@@ -4152,7 +4142,7 @@ find_array_spec (gfc_expr *e)
/* Resolve an array reference. */
-static gfc_try
+static bool
resolve_array_ref (gfc_array_ref *ar)
{
int i, check_scalar;
@@ -4165,12 +4155,12 @@ resolve_array_ref (gfc_array_ref *ar)
/* Do not force gfc_index_integer_kind for the start. We can
do fine with any integer kind. This avoids temporary arrays
created for indexing with a vector. */
- if (gfc_resolve_index_1 (ar->start[i], check_scalar, 0) == FAILURE)
- return FAILURE;
- if (gfc_resolve_index (ar->end[i], check_scalar) == FAILURE)
- return FAILURE;
- if (gfc_resolve_index (ar->stride[i], check_scalar) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_index_1 (ar->start[i], check_scalar, 0))
+ return false;
+ if (!gfc_resolve_index (ar->end[i], check_scalar))
+ return false;
+ if (!gfc_resolve_index (ar->stride[i], check_scalar))
+ return false;
e = ar->start[i];
@@ -4191,7 +4181,7 @@ resolve_array_ref (gfc_array_ref *ar)
default:
gfc_error ("Array index at %L is an array of rank %d",
&ar->c_where[i], e->rank);
- return FAILURE;
+ return false;
}
/* Fill in the upper bound, which may be lower than the
@@ -4205,7 +4195,7 @@ resolve_array_ref (gfc_array_ref *ar)
{
mpz_t size, end;
- if (gfc_ref_dimen_size (ar, i, &size, &end) == SUCCESS)
+ if (gfc_ref_dimen_size (ar, i, &size, &end))
{
if (ar->end[i] == NULL)
{
@@ -4260,8 +4250,8 @@ resolve_array_ref (gfc_array_ref *ar)
}
}
- if (!ar->as->cray_pointee && compare_spec_to_ref (ar) == FAILURE)
- return FAILURE;
+ if (!ar->as->cray_pointee && !compare_spec_to_ref (ar))
+ return false;
if (ar->as->corank && ar->codimen == 0)
{
@@ -4271,32 +4261,32 @@ resolve_array_ref (gfc_array_ref *ar)
ar->dimen_type[n] = DIMEN_THIS_IMAGE;
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
resolve_substring (gfc_ref *ref)
{
int k = gfc_validate_kind (BT_INTEGER, gfc_charlen_int_kind, false);
if (ref->u.ss.start != NULL)
{
- if (gfc_resolve_expr (ref->u.ss.start) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (ref->u.ss.start))
+ return false;
if (ref->u.ss.start->ts.type != BT_INTEGER)
{
gfc_error ("Substring start index at %L must be of type INTEGER",
&ref->u.ss.start->where);
- return FAILURE;
+ return false;
}
if (ref->u.ss.start->rank != 0)
{
gfc_error ("Substring start index at %L must be scalar",
&ref->u.ss.start->where);
- return FAILURE;
+ return false;
}
if (compare_bound_int (ref->u.ss.start, 1) == CMP_LT
@@ -4305,27 +4295,27 @@ resolve_substring (gfc_ref *ref)
{
gfc_error ("Substring start index at %L is less than one",
&ref->u.ss.start->where);
- return FAILURE;
+ return false;
}
}
if (ref->u.ss.end != NULL)
{
- if (gfc_resolve_expr (ref->u.ss.end) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (ref->u.ss.end))
+ return false;
if (ref->u.ss.end->ts.type != BT_INTEGER)
{
gfc_error ("Substring end index at %L must be of type INTEGER",
&ref->u.ss.end->where);
- return FAILURE;
+ return false;
}
if (ref->u.ss.end->rank != 0)
{
gfc_error ("Substring end index at %L must be scalar",
&ref->u.ss.end->where);
- return FAILURE;
+ return false;
}
if (ref->u.ss.length != NULL
@@ -4335,7 +4325,7 @@ resolve_substring (gfc_ref *ref)
{
gfc_error ("Substring end index at %L exceeds the string length",
&ref->u.ss.start->where);
- return FAILURE;
+ return false;
}
if (compare_bound_mpz_t (ref->u.ss.end,
@@ -4345,11 +4335,11 @@ resolve_substring (gfc_ref *ref)
{
gfc_error ("Substring end index at %L is too large",
&ref->u.ss.end->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -4421,7 +4411,7 @@ gfc_resolve_substring_charlen (gfc_expr *e)
/* Resolve subtype references. */
-static gfc_try
+static bool
resolve_ref (gfc_expr *expr)
{
int current_part_dimension, n_components, seen_part_dimension;
@@ -4438,16 +4428,16 @@ resolve_ref (gfc_expr *expr)
switch (ref->type)
{
case REF_ARRAY:
- if (resolve_array_ref (&ref->u.ar) == FAILURE)
- return FAILURE;
+ if (!resolve_array_ref (&ref->u.ar))
+ return false;
break;
case REF_COMPONENT:
break;
case REF_SUBSTRING:
- if (resolve_substring (ref) == FAILURE)
- return FAILURE;
+ if (!resolve_substring (ref))
+ return false;
break;
}
@@ -4498,7 +4488,7 @@ resolve_ref (gfc_expr *expr)
gfc_error ("Component to the right of a part reference "
"with nonzero rank must not have the POINTER "
"attribute at %L", &expr->where);
- return FAILURE;
+ return false;
}
else if (ref->u.c.component->attr.allocatable
|| (ref->u.c.component->ts.type == BT_CLASS
@@ -4508,7 +4498,7 @@ resolve_ref (gfc_expr *expr)
gfc_error ("Component to the right of a part reference "
"with nonzero rank must not have the ALLOCATABLE "
"attribute at %L", &expr->where);
- return FAILURE;
+ return false;
}
}
@@ -4526,7 +4516,7 @@ resolve_ref (gfc_expr *expr)
{
gfc_error ("Two or more part references with nonzero rank must "
"not be specified at %L", &expr->where);
- return FAILURE;
+ return false;
}
if (ref->type == REF_COMPONENT)
@@ -4539,7 +4529,7 @@ resolve_ref (gfc_expr *expr)
}
}
- return SUCCESS;
+ return true;
}
@@ -4556,7 +4546,7 @@ expression_shape (gfc_expr *e)
return;
for (i = 0; i < e->rank; i++)
- if (gfc_array_dimen_size (e, i, &array[i]) == FAILURE)
+ if (!gfc_array_dimen_size (e, i, &array[i]))
goto fail;
e->shape = gfc_get_shape (e->rank);
@@ -4642,16 +4632,16 @@ done:
/* Resolve a variable expression. */
-static gfc_try
+static bool
resolve_variable (gfc_expr *e)
{
gfc_symbol *sym;
- gfc_try t;
+ bool t;
- t = SUCCESS;
+ t = true;
if (e->symtree == NULL)
- return FAILURE;
+ return false;
sym = e->symtree->n.sym;
/* TS 29113, 407b. */
@@ -4661,7 +4651,7 @@ resolve_variable (gfc_expr *e)
{
gfc_error ("Assumed-type variable %s at %L may only be used "
"as actual argument", sym->name, &e->where);
- return FAILURE;
+ return false;
}
else if (inquiry_argument && !first_actual_arg)
{
@@ -4672,7 +4662,7 @@ resolve_variable (gfc_expr *e)
gfc_error ("Assumed-type variable %s at %L as actual argument to "
"an inquiry function shall be the first argument",
sym->name, &e->where);
- return FAILURE;
+ return false;
}
}
@@ -4687,7 +4677,7 @@ resolve_variable (gfc_expr *e)
{
gfc_error ("Assumed-rank variable %s at %L may only be used as "
"actual argument", sym->name, &e->where);
- return FAILURE;
+ return false;
}
else if (inquiry_argument && !first_actual_arg)
{
@@ -4698,7 +4688,7 @@ resolve_variable (gfc_expr *e)
gfc_error ("Assumed-rank variable %s at %L as actual argument "
"to an inquiry function shall be the first argument",
sym->name, &e->where);
- return FAILURE;
+ return false;
}
}
@@ -4709,7 +4699,7 @@ resolve_variable (gfc_expr *e)
{
gfc_error ("Assumed-type variable %s at %L shall not have a subobject "
"reference", sym->name, &e->ref->u.ar.where);
- return FAILURE;
+ return false;
}
/* TS 29113, C535b. */
@@ -4724,7 +4714,7 @@ resolve_variable (gfc_expr *e)
{
gfc_error ("Assumed-rank variable %s at %L shall not have a subobject "
"reference", sym->name, &e->ref->u.ar.where);
- return FAILURE;
+ return false;
}
@@ -4736,7 +4726,7 @@ resolve_variable (gfc_expr *e)
if (sym->ts.type == BT_CLASS)
gfc_fix_class_refs (e);
if (!sym->attr.dimension && e->ref && e->ref->type == REF_ARRAY)
- return FAILURE;
+ return false;
}
if (sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.generic)
@@ -4752,8 +4742,8 @@ resolve_variable (gfc_expr *e)
e->ref->u.ar.dimen = 0;
}
- if (e->ref && resolve_ref (e) == FAILURE)
- return FAILURE;
+ if (e->ref && !resolve_ref (e))
+ return false;
if (sym->attr.flavor == FL_PROCEDURE
&& (!sym->attr.function
@@ -4770,13 +4760,13 @@ resolve_variable (gfc_expr *e)
else
{
/* Must be a simple variable reference. */
- if (gfc_set_default_type (sym, 1, sym->ns) == FAILURE)
- return FAILURE;
+ if (!gfc_set_default_type (sym, 1, sym->ns))
+ return false;
e->ts = sym->ts;
}
if (check_assumed_size_reference (sym, e))
- return FAILURE;
+ return false;
/* Deal with forward references to entries during resolve_code, to
satisfy, at least partially, 12.5.2.5. */
@@ -4817,7 +4807,7 @@ resolve_variable (gfc_expr *e)
gfc_error ("Variable '%s' is used at %L before the ENTRY "
"statement in which it is a parameter",
sym->name, &cs_base->current->loc);
- t = FAILURE;
+ t = false;
}
}
@@ -4825,20 +4815,20 @@ resolve_variable (gfc_expr *e)
saved_specification_expr = specification_expr;
specification_expr = true;
if (sym->ts.type == BT_CHARACTER
- && gfc_resolve_expr (sym->ts.u.cl->length) == FAILURE)
- t = FAILURE;
+ && !gfc_resolve_expr (sym->ts.u.cl->length))
+ t = false;
if (sym->as)
for (n = 0; n < sym->as->rank; n++)
{
- if (gfc_resolve_expr (sym->as->lower[n]) == FAILURE)
- t = FAILURE;
- if (gfc_resolve_expr (sym->as->upper[n]) == FAILURE)
- t = FAILURE;
+ if (!gfc_resolve_expr (sym->as->lower[n]))
+ t = false;
+ if (!gfc_resolve_expr (sym->as->upper[n]))
+ t = false;
}
specification_expr = saved_specification_expr;
- if (t == SUCCESS)
+ if (t)
/* Update the symbol's entry level. */
sym->entry_id = current_entry_id + 1;
}
@@ -4853,8 +4843,8 @@ resolve_variable (gfc_expr *e)
sym->attr.host_assoc = 1;
resolve_procedure:
- if (t == SUCCESS && resolve_procedure_expression (e) == FAILURE)
- t = FAILURE;
+ if (t && !resolve_procedure_expression (e))
+ t = false;
/* F2008, C617 and C1229. */
if (!inquiry_argument && (e->ts.type == BT_CLASS || e->ts.type == BT_DERIVED)
@@ -4879,7 +4869,7 @@ resolve_procedure:
{
gfc_error ("Polymorphic subobject of coindexed object at %L",
&e->where);
- t = FAILURE;
+ t = false;
}
/* Expression itself is coindexed object. */
@@ -4892,7 +4882,7 @@ resolve_procedure:
{
gfc_error ("Coindexed object with polymorphic allocatable "
"subcomponent at %L", &e->where);
- t = FAILURE;
+ t = false;
break;
}
}
@@ -5126,7 +5116,7 @@ extract_compcall_passed_object (gfc_expr* e)
po->where = e->where;
}
- if (gfc_resolve_expr (po) == FAILURE)
+ if (!gfc_resolve_expr (po))
return NULL;
return po;
@@ -5136,7 +5126,7 @@ extract_compcall_passed_object (gfc_expr* e)
/* Update the arglist of an EXPR_COMPCALL expression to include the
passed-object. */
-static gfc_try
+static bool
update_compcall_arglist (gfc_expr* e)
{
gfc_expr* po;
@@ -5145,16 +5135,16 @@ update_compcall_arglist (gfc_expr* e)
tbp = e->value.compcall.tbp;
if (tbp->error)
- return FAILURE;
+ return false;
po = extract_compcall_passed_object (e);
if (!po)
- return FAILURE;
+ return false;
if (tbp->nopass || e->value.compcall.ignore_pass)
{
gfc_free_expr (po);
- return SUCCESS;
+ return true;
}
gcc_assert (tbp->pass_arg_num > 0);
@@ -5162,7 +5152,7 @@ update_compcall_arglist (gfc_expr* e)
tbp->pass_arg_num,
tbp->pass_arg);
- return SUCCESS;
+ return true;
}
@@ -5187,7 +5177,7 @@ extract_ppc_passed_object (gfc_expr *e)
gfc_free_ref_list (*ref);
*ref = NULL;
- if (gfc_resolve_expr (po) == FAILURE)
+ if (!gfc_resolve_expr (po))
return NULL;
return po;
@@ -5197,7 +5187,7 @@ extract_ppc_passed_object (gfc_expr *e)
/* Update the actual arglist of a procedure pointer component to include the
passed-object. */
-static gfc_try
+static bool
update_ppc_arglist (gfc_expr* e)
{
gfc_expr* po;
@@ -5206,24 +5196,24 @@ update_ppc_arglist (gfc_expr* e)
ppc = gfc_get_proc_ptr_comp (e);
if (!ppc)
- return FAILURE;
+ return false;
tb = ppc->tb;
if (tb->error)
- return FAILURE;
+ return false;
else if (tb->nopass)
- return SUCCESS;
+ return true;
po = extract_ppc_passed_object (e);
if (!po)
- return FAILURE;
+ return false;
/* F08:R739. */
if (po->rank != 0)
{
gfc_error ("Passed-object at %L must be scalar", &e->where);
- return FAILURE;
+ return false;
}
/* F08:C611. */
@@ -5231,7 +5221,7 @@ update_ppc_arglist (gfc_expr* e)
{
gfc_error ("Base object for procedure-pointer component call at %L is of"
" ABSTRACT type '%s'", &e->where, po->ts.u.derived->name);
- return FAILURE;
+ return false;
}
gcc_assert (tb->pass_arg_num > 0);
@@ -5239,27 +5229,27 @@ update_ppc_arglist (gfc_expr* e)
tb->pass_arg_num,
tb->pass_arg);
- return SUCCESS;
+ return true;
}
/* Check that the object a TBP is called on is valid, i.e. it must not be
of ABSTRACT type (as in subobject%abstract_parent%tbp()). */
-static gfc_try
+static bool
check_typebound_baseobject (gfc_expr* e)
{
gfc_expr* base;
- gfc_try return_value = FAILURE;
+ bool return_value = false;
base = extract_compcall_passed_object (e);
if (!base)
- return FAILURE;
+ return false;
gcc_assert (base->ts.type == BT_DERIVED || base->ts.type == BT_CLASS);
if (base->ts.type == BT_CLASS && !gfc_expr_attr (base).class_ok)
- return FAILURE;
+ return false;
/* F08:C611. */
if (base->ts.type == BT_DERIVED && base->ts.u.derived->attr.abstract)
@@ -5278,7 +5268,7 @@ check_typebound_baseobject (gfc_expr* e)
goto cleanup;
}
- return_value = SUCCESS;
+ return_value = true;
cleanup:
gfc_free_expr (base);
@@ -5290,7 +5280,7 @@ cleanup:
statically from the data in an EXPR_COMPCALL expression. The adapted
arglist and the target-procedure symtree are returned. */
-static gfc_try
+static bool
resolve_typebound_static (gfc_expr* e, gfc_symtree** target,
gfc_actual_arglist** actual)
{
@@ -5298,8 +5288,8 @@ resolve_typebound_static (gfc_expr* e, gfc_symtree** target,
gcc_assert (!e->value.compcall.tbp->is_generic);
/* Update the actual arglist for PASS. */
- if (update_compcall_arglist (e) == FAILURE)
- return FAILURE;
+ if (!update_compcall_arglist (e))
+ return false;
*actual = e->value.compcall.actual;
*target = e->value.compcall.tbp->u.specific;
@@ -5340,7 +5330,7 @@ resolve_typebound_static (gfc_expr* e, gfc_symtree** target,
if (st)
*target = st;
}
- return SUCCESS;
+ return true;
}
@@ -5387,7 +5377,7 @@ get_declared_from_expr (gfc_ref **class_ref, gfc_ref **new_ref,
which of the specific bindings (if any) matches the arglist and transform
the expression into a call of that binding. */
-static gfc_try
+static bool
resolve_typebound_generic_call (gfc_expr* e, const char **name)
{
gfc_typebound_proc* genproc;
@@ -5400,7 +5390,7 @@ resolve_typebound_generic_call (gfc_expr* e, const char **name)
genproc = e->value.compcall.tbp;
if (!genproc->is_generic)
- return SUCCESS;
+ return true;
/* Try the bindings on this type and in the inheritance hierarchy. */
for (; genproc; genproc = genproc->overridden)
@@ -5430,7 +5420,7 @@ resolve_typebound_generic_call (gfc_expr* e, const char **name)
if (!po)
{
gfc_free_actual_arglist (args);
- return FAILURE;
+ return false;
}
gcc_assert (g->specific->pass_arg_num > 0);
@@ -5463,7 +5453,7 @@ resolve_typebound_generic_call (gfc_expr* e, const char **name)
/* Nothing matching found! */
gfc_error ("Found no matching specific binding for the call to the GENERIC"
" '%s' at %L", genname, &e->where);
- return FAILURE;
+ return false;
success:
/* Make sure that we have the right specific instance for the name. */
@@ -5473,13 +5463,13 @@ success:
if (st)
e->value.compcall.tbp = st->n.tb;
- return SUCCESS;
+ return true;
}
/* Resolve a call to a type-bound subroutine. */
-static gfc_try
+static bool
resolve_typebound_call (gfc_code* c, const char **name)
{
gfc_actual_arglist* newactual;
@@ -5490,24 +5480,24 @@ resolve_typebound_call (gfc_code* c, const char **name)
{
gfc_error ("'%s' at %L should be a SUBROUTINE",
c->expr1->value.compcall.name, &c->loc);
- return FAILURE;
+ return false;
}
- if (check_typebound_baseobject (c->expr1) == FAILURE)
- return FAILURE;
+ if (!check_typebound_baseobject (c->expr1))
+ return false;
/* Pass along the name for CLASS methods, where the vtab
procedure pointer component has to be referenced. */
if (name)
*name = c->expr1->value.compcall.name;
- if (resolve_typebound_generic_call (c->expr1, name) == FAILURE)
- return FAILURE;
+ if (!resolve_typebound_generic_call (c->expr1, name))
+ return false;
/* Transform into an ordinary EXEC_CALL for now. */
- if (resolve_typebound_static (c->expr1, &target, &newactual) == FAILURE)
- return FAILURE;
+ if (!resolve_typebound_static (c->expr1, &target, &newactual))
+ return false;
c->ext.actual = newactual;
c->symtree = target;
@@ -5526,7 +5516,7 @@ resolve_typebound_call (gfc_code* c, const char **name)
/* Resolve a component-call expression. */
-static gfc_try
+static bool
resolve_compcall (gfc_expr* e, const char **name)
{
gfc_actual_arglist* newactual;
@@ -5537,22 +5527,22 @@ resolve_compcall (gfc_expr* e, const char **name)
{
gfc_error ("'%s' at %L should be a FUNCTION",
e->value.compcall.name, &e->where);
- return FAILURE;
+ return false;
}
/* These must not be assign-calls! */
gcc_assert (!e->value.compcall.assign);
- if (check_typebound_baseobject (e) == FAILURE)
- return FAILURE;
+ if (!check_typebound_baseobject (e))
+ return false;
/* Pass along the name for CLASS methods, where the vtab
procedure pointer component has to be referenced. */
if (name)
*name = e->value.compcall.name;
- if (resolve_typebound_generic_call (e, name) == FAILURE)
- return FAILURE;
+ if (!resolve_typebound_generic_call (e, name))
+ return false;
gcc_assert (!e->value.compcall.tbp->is_generic);
/* Take the rank from the function's symbol. */
@@ -5562,8 +5552,8 @@ resolve_compcall (gfc_expr* e, const char **name)
/* For now, we simply transform it into an EXPR_FUNCTION call with the same
arglist to the TBP's binding target. */
- if (resolve_typebound_static (e, &target, &newactual) == FAILURE)
- return FAILURE;
+ if (!resolve_typebound_static (e, &target, &newactual))
+ return false;
e->value.function.actual = newactual;
e->value.function.name = NULL;
@@ -5584,7 +5574,7 @@ resolve_compcall (gfc_expr* e, const char **name)
/* Resolve a typebound function, or 'method'. First separate all
the non-CLASS references by calling resolve_compcall directly. */
-static gfc_try
+static bool
resolve_typebound_function (gfc_expr* e)
{
gfc_symbol *declared;
@@ -5628,8 +5618,8 @@ resolve_typebound_function (gfc_expr* e)
if (c->ts.u.derived == NULL)
c->ts.u.derived = gfc_find_derived_vtab (declared);
- if (resolve_compcall (e, &name) == FAILURE)
- return FAILURE;
+ if (!resolve_compcall (e, &name))
+ return false;
/* Use the generic name if it is there. */
name = name ? name : e->value.function.esym->name;
@@ -5655,14 +5645,14 @@ resolve_typebound_function (gfc_expr* e)
e->value.function.esym = NULL;
if (expr->expr_type != EXPR_VARIABLE)
e->base_expr = expr;
- return SUCCESS;
+ return true;
}
if (st == NULL)
return resolve_compcall (e, NULL);
- if (resolve_ref (e) == FAILURE)
- return FAILURE;
+ if (!resolve_ref (e))
+ return false;
/* Get the CLASS declared type. */
declared = get_declared_from_expr (&class_ref, &new_ref, e, true);
@@ -5680,10 +5670,10 @@ resolve_typebound_function (gfc_expr* e)
/* 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)
+ if (!resolve_compcall (e, &name))
{
gfc_free_ref_list (new_ref);
- return FAILURE;
+ return false;
}
ts = e->ts;
@@ -5707,14 +5697,14 @@ resolve_typebound_function (gfc_expr* e)
e->ts = ts;
}
- return SUCCESS;
+ return true;
}
/* Resolve a typebound subroutine, or 'method'. First separate all
the non-CLASS references by calling resolve_typebound_call
directly. */
-static gfc_try
+static bool
resolve_typebound_subroutine (gfc_code *code)
{
gfc_symbol *declared;
@@ -5756,8 +5746,8 @@ resolve_typebound_subroutine (gfc_code *code)
if (c->ts.u.derived == NULL)
c->ts.u.derived = gfc_find_derived_vtab (declared);
- if (resolve_typebound_call (code, &name) == FAILURE)
- return FAILURE;
+ if (!resolve_typebound_call (code, &name))
+ return false;
/* Use the generic name if it is there. */
name = name ? name : code->expr1->value.function.esym->name;
@@ -5784,14 +5774,14 @@ resolve_typebound_subroutine (gfc_code *code)
code->expr1->value.function.esym = NULL;
if (expr->expr_type != EXPR_VARIABLE)
code->expr1->base_expr = expr;
- return SUCCESS;
+ return true;
}
if (st == NULL)
return resolve_typebound_call (code, NULL);
- if (resolve_ref (code->expr1) == FAILURE)
- return FAILURE;
+ if (!resolve_ref (code->expr1))
+ return false;
/* Get the CLASS declared type. */
get_declared_from_expr (&class_ref, &new_ref, code->expr1, true);
@@ -5804,10 +5794,10 @@ resolve_typebound_subroutine (gfc_code *code)
return resolve_typebound_call (code, NULL);
}
- if (resolve_typebound_call (code, &name) == FAILURE)
+ if (!resolve_typebound_call (code, &name))
{
gfc_free_ref_list (new_ref);
- return FAILURE;
+ return false;
}
ts = code->expr1->ts;
@@ -5830,14 +5820,16 @@ resolve_typebound_subroutine (gfc_code *code)
correct typespec. */
code->expr1->ts = ts;
}
+ else if (new_ref)
+ gfc_free_ref_list (new_ref);
- return SUCCESS;
+ return true;
}
/* Resolve a CALL to a Procedure Pointer Component (Subroutine). */
-static gfc_try
+static bool
resolve_ppc_call (gfc_code* c)
{
gfc_component *comp;
@@ -5851,27 +5843,28 @@ resolve_ppc_call (gfc_code* c)
if (!comp->attr.subroutine)
gfc_add_subroutine (&comp->attr, comp->name, &c->expr1->where);
- if (resolve_ref (c->expr1) == FAILURE)
- return FAILURE;
+ if (!resolve_ref (c->expr1))
+ return false;
- if (update_ppc_arglist (c->expr1) == FAILURE)
- return FAILURE;
+ if (!update_ppc_arglist (c->expr1))
+ return false;
c->ext.actual = c->expr1->value.compcall.actual;
- if (resolve_actual_arglist (c->ext.actual, comp->attr.proc,
- !(comp->ts.interface && comp->ts.interface->formal)) == FAILURE)
- return FAILURE;
+ if (!resolve_actual_arglist (c->ext.actual, comp->attr.proc,
+ !(comp->ts.interface
+ && comp->ts.interface->formal)))
+ return false;
gfc_ppc_use (comp, &c->expr1->value.compcall.actual, &c->expr1->where);
- return SUCCESS;
+ return true;
}
/* Resolve a Function Call to a Procedure Pointer Component (Function). */
-static gfc_try
+static bool
resolve_expr_ppc (gfc_expr* e)
{
gfc_component *comp;
@@ -5890,19 +5883,20 @@ resolve_expr_ppc (gfc_expr* e)
if (!comp->attr.function)
gfc_add_function (&comp->attr, comp->name, &e->where);
- if (resolve_ref (e) == FAILURE)
- return FAILURE;
+ if (!resolve_ref (e))
+ return false;
- if (resolve_actual_arglist (e->value.function.actual, comp->attr.proc,
- !(comp->ts.interface && comp->ts.interface->formal)) == FAILURE)
- return FAILURE;
+ if (!resolve_actual_arglist (e->value.function.actual, comp->attr.proc,
+ !(comp->ts.interface
+ && comp->ts.interface->formal)))
+ return false;
- if (update_ppc_arglist (e) == FAILURE)
- return FAILURE;
+ if (!update_ppc_arglist (e))
+ return false;
gfc_ppc_use (comp, &e->value.compcall.actual, &e->where);
- return SUCCESS;
+ return true;
}
@@ -5937,14 +5931,14 @@ gfc_is_expandable_expr (gfc_expr *e)
with their operators, intrinsic operators are converted to function calls
for overloaded types and unresolved function references are resolved. */
-gfc_try
+bool
gfc_resolve_expr (gfc_expr *e)
{
- gfc_try t;
+ bool t;
bool inquiry_save, actual_arg_save, first_actual_arg_save;
if (e == NULL)
- return SUCCESS;
+ return true;
/* inquiry_argument only applies to variables. */
inquiry_save = inquiry_argument;
@@ -5972,7 +5966,7 @@ gfc_resolve_expr (gfc_expr *e)
else
{
t = resolve_variable (e);
- if (t == SUCCESS)
+ if (t)
expression_rank (e);
}
@@ -5992,7 +5986,7 @@ gfc_resolve_expr (gfc_expr *e)
case EXPR_CONSTANT:
case EXPR_NULL:
- t = SUCCESS;
+ t = true;
break;
case EXPR_PPC:
@@ -6000,13 +5994,13 @@ gfc_resolve_expr (gfc_expr *e)
break;
case EXPR_ARRAY:
- t = FAILURE;
- if (resolve_ref (e) == FAILURE)
+ t = false;
+ if (!resolve_ref (e))
break;
t = gfc_resolve_array_constructor (e);
/* Also try to expand a constructor. */
- if (t == SUCCESS)
+ if (t)
{
expression_rank (e);
if (gfc_is_constant_expr (e) || gfc_is_expandable_expr (e))
@@ -6016,7 +6010,7 @@ gfc_resolve_expr (gfc_expr *e)
/* This provides the opportunity for the length of constructors with
character valued function elements to propagate the string length
to the expression. */
- if (t == SUCCESS && e->ts.type == BT_CHARACTER)
+ if (t && e->ts.type == BT_CHARACTER)
{
/* For efficiency, we call gfc_expand_constructor for BT_CHARACTER
here rather then add a duplicate test for it above. */
@@ -6028,11 +6022,11 @@ gfc_resolve_expr (gfc_expr *e)
case EXPR_STRUCTURE:
t = resolve_ref (e);
- if (t == FAILURE)
+ if (!t)
break;
t = resolve_structure_cons (e, 0);
- if (t == FAILURE)
+ if (!t)
break;
t = gfc_simplify_expr (e, 0);
@@ -6042,7 +6036,7 @@ gfc_resolve_expr (gfc_expr *e)
gfc_internal_error ("gfc_resolve_expr(): Bad expression type");
}
- if (e->ts.type == BT_CHARACTER && t == SUCCESS && !e->ts.u.cl)
+ if (e->ts.type == BT_CHARACTER && t && !e->ts.u.cl)
fixup_charlen (e);
inquiry_argument = inquiry_save;
@@ -6056,17 +6050,17 @@ gfc_resolve_expr (gfc_expr *e)
/* Resolve an expression from an iterator. They must be scalar and have
INTEGER or (optionally) REAL type. */
-static gfc_try
+static bool
gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok,
const char *name_msgid)
{
- if (gfc_resolve_expr (expr) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (expr))
+ return false;
if (expr->rank != 0)
{
gfc_error ("%s at %L must be a scalar", _(name_msgid), &expr->where);
- return FAILURE;
+ return false;
}
if (expr->ts.type != BT_INTEGER)
@@ -6081,16 +6075,16 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok,
{
gfc_error ("%s at %L must be INTEGER", _(name_msgid),
&expr->where);
- return FAILURE;
+ return false;
}
}
else
{
gfc_error ("%s at %L must be INTEGER", _(name_msgid), &expr->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -6099,29 +6093,27 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok,
Set own_scope to true for ac-implied-do and data-implied-do as those
have a separate scope such that, e.g., a INTENT(IN) doesn't apply. */
-gfc_try
+bool
gfc_resolve_iterator (gfc_iterator *iter, bool real_ok, bool own_scope)
{
- if (gfc_resolve_iterator_expr (iter->var, real_ok, "Loop variable")
- == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_iterator_expr (iter->var, real_ok, "Loop variable"))
+ return false;
- if (gfc_check_vardef_context (iter->var, false, false, own_scope,
- _("iterator variable"))
- == FAILURE)
- return FAILURE;
+ if (!gfc_check_vardef_context (iter->var, false, false, own_scope,
+ _("iterator variable")))
+ return false;
- if (gfc_resolve_iterator_expr (iter->start, real_ok,
- "Start expression in DO loop") == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_iterator_expr (iter->start, real_ok,
+ "Start expression in DO loop"))
+ return false;
- if (gfc_resolve_iterator_expr (iter->end, real_ok,
- "End expression in DO loop") == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_iterator_expr (iter->end, real_ok,
+ "End expression in DO loop"))
+ return false;
- if (gfc_resolve_iterator_expr (iter->step, real_ok,
- "Step expression in DO loop") == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_iterator_expr (iter->step, real_ok,
+ "Step expression in DO loop"))
+ return false;
if (iter->step->expr_type == EXPR_CONSTANT)
{
@@ -6132,7 +6124,7 @@ gfc_resolve_iterator (gfc_iterator *iter, bool real_ok, bool own_scope)
{
gfc_error ("Step expression in DO loop at %L cannot be zero",
&iter->step->where);
- return FAILURE;
+ return false;
}
}
@@ -6169,7 +6161,7 @@ gfc_resolve_iterator (gfc_iterator *iter, bool real_ok, bool own_scope)
&iter->step->where);
}
- return SUCCESS;
+ return true;
}
@@ -6198,15 +6190,15 @@ forall_index (gfc_expr *expr, gfc_symbol *sym, int *f)
/* Check whether the FORALL index appears in the expression or not.
- Returns SUCCESS if SYM is found in EXPR. */
+ Returns true if SYM is found in EXPR. */
-gfc_try
+bool
find_forall_index (gfc_expr *expr, gfc_symbol *sym, int f)
{
if (gfc_traverse_expr (expr, sym, forall_index, f))
- return SUCCESS;
+ return true;
else
- return FAILURE;
+ return false;
}
@@ -6224,33 +6216,33 @@ resolve_forall_iterators (gfc_forall_iterator *it)
for (iter = it; iter; iter = iter->next)
{
- if (gfc_resolve_expr (iter->var) == SUCCESS
+ if (gfc_resolve_expr (iter->var)
&& (iter->var->ts.type != BT_INTEGER || iter->var->rank != 0))
gfc_error ("FORALL index-name at %L must be a scalar INTEGER",
&iter->var->where);
- if (gfc_resolve_expr (iter->start) == SUCCESS
+ if (gfc_resolve_expr (iter->start)
&& (iter->start->ts.type != BT_INTEGER || iter->start->rank != 0))
gfc_error ("FORALL start expression at %L must be a scalar INTEGER",
&iter->start->where);
if (iter->var->ts.kind != iter->start->ts.kind)
gfc_convert_type (iter->start, &iter->var->ts, 1);
- if (gfc_resolve_expr (iter->end) == SUCCESS
+ if (gfc_resolve_expr (iter->end)
&& (iter->end->ts.type != BT_INTEGER || iter->end->rank != 0))
gfc_error ("FORALL end expression at %L must be a scalar INTEGER",
&iter->end->where);
if (iter->var->ts.kind != iter->end->ts.kind)
gfc_convert_type (iter->end, &iter->var->ts, 1);
- if (gfc_resolve_expr (iter->stride) == SUCCESS)
+ if (gfc_resolve_expr (iter->stride))
{
if (iter->stride->ts.type != BT_INTEGER || iter->stride->rank != 0)
gfc_error ("FORALL stride expression at %L must be a scalar %s",
&iter->stride->where, "INTEGER");
if (iter->stride->expr_type == EXPR_CONSTANT
- && mpz_cmp_ui(iter->stride->value.integer, 0) == 0)
+ && mpz_cmp_ui (iter->stride->value.integer, 0) == 0)
gfc_error ("FORALL stride expression at %L cannot be zero",
&iter->stride->where);
}
@@ -6261,12 +6253,9 @@ resolve_forall_iterators (gfc_forall_iterator *it)
for (iter = it; iter; iter = iter->next)
for (iter2 = iter; iter2; iter2 = iter2->next)
{
- if (find_forall_index (iter2->start,
- iter->var->symtree->n.sym, 0) == SUCCESS
- || find_forall_index (iter2->end,
- iter->var->symtree->n.sym, 0) == SUCCESS
- || find_forall_index (iter2->stride,
- iter->var->symtree->n.sym, 0) == SUCCESS)
+ if (find_forall_index (iter2->start, iter->var->symtree->n.sym, 0)
+ || find_forall_index (iter2->end, iter->var->symtree->n.sym, 0)
+ || find_forall_index (iter2->stride, iter->var->symtree->n.sym, 0))
gfc_error ("FORALL index '%s' may not appear in triplet "
"specification at %L", iter->var->symtree->name,
&iter2->start->where);
@@ -6300,7 +6289,7 @@ derived_inaccessible (gfc_symbol *sym)
/* Resolve the argument of a deallocate expression. The expression must be
a pointer or a full array. */
-static gfc_try
+static bool
resolve_deallocate_expr (gfc_expr *e)
{
symbol_attribute attr;
@@ -6310,8 +6299,8 @@ resolve_deallocate_expr (gfc_expr *e)
gfc_component *c;
bool unlimited;
- if (gfc_resolve_expr (e) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (e))
+ return false;
if (e->expr_type != EXPR_VARIABLE)
goto bad;
@@ -6367,25 +6356,25 @@ resolve_deallocate_expr (gfc_expr *e)
bad:
gfc_error ("Allocate-object at %L must be ALLOCATABLE or a POINTER",
&e->where);
- return FAILURE;
+ return false;
}
/* F2008, C644. */
if (gfc_is_coindexed (e))
{
gfc_error ("Coindexed allocatable object at %L", &e->where);
- return FAILURE;
+ return false;
}
if (pointer
- && gfc_check_vardef_context (e, true, true, false, _("DEALLOCATE object"))
- == FAILURE)
- return FAILURE;
- if (gfc_check_vardef_context (e, false, true, false, _("DEALLOCATE object"))
- == FAILURE)
- return FAILURE;
+ && !gfc_check_vardef_context (e, true, true, false,
+ _("DEALLOCATE object")))
+ return false;
+ if (!gfc_check_vardef_context (e, false, true, false,
+ _("DEALLOCATE object")))
+ return false;
- return SUCCESS;
+ return true;
}
@@ -6469,7 +6458,7 @@ remove_last_array_ref (gfc_expr* e)
a source-expr are conformable. This does not catch all possible
cases; in particular a runtime checking is needed. */
-static gfc_try
+static bool
conformable_arrays (gfc_expr *e1, gfc_expr *e2)
{
gfc_ref *tail;
@@ -6481,7 +6470,7 @@ conformable_arrays (gfc_expr *e1, gfc_expr *e2)
gfc_error ("Source-expr at %L must be scalar or have the "
"same rank as the allocate-object at %L",
&e1->where, &e2->where);
- return FAILURE;
+ return false;
}
if (e1->shape)
@@ -6509,14 +6498,14 @@ conformable_arrays (gfc_expr *e1, gfc_expr *e2)
gfc_error ("Source-expr at %L and allocate-object at %L must "
"have the same shape", &e1->where, &e2->where);
mpz_clear (s);
- return FAILURE;
+ return false;
}
}
mpz_clear (s);
}
- return SUCCESS;
+ return true;
}
@@ -6524,7 +6513,7 @@ conformable_arrays (gfc_expr *e1, gfc_expr *e2)
checks to see whether the expression is OK or not. The expression must
have a trailing array reference that gives the size of the array. */
-static gfc_try
+static bool
resolve_allocate_expr (gfc_expr *e, gfc_code *code)
{
int i, pointer, allocatable, dimension, is_abstract;
@@ -6538,7 +6527,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
gfc_symbol *sym = NULL;
gfc_alloc *a;
gfc_component *c;
- gfc_try t;
+ bool t;
/* Mark the utmost array component as being in allocate to allow DIMEN_STAR
checking of coarrays. */
@@ -6549,7 +6538,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
if (ref && ref->type == REF_ARRAY)
ref->u.ar.in_allocate = true;
- if (gfc_resolve_expr (e) == FAILURE)
+ if (!gfc_resolve_expr (e))
goto failure;
/* Make sure the expression is allocatable or a pointer. If it is
@@ -6671,7 +6660,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
/* Check F03:C632 and restriction following Note 6.18. */
if (code->expr3->rank > 0 && !unlimited
- && conformable_arrays (code->expr3, e) == FAILURE)
+ && !conformable_arrays (code->expr3, e))
goto failure;
/* Check F03:C633. */
@@ -6726,13 +6715,15 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
on the expression. This is fooled by the array specification
present in e, thus we have to eliminate that one temporarily. */
e2 = remove_last_array_ref (e);
- t = SUCCESS;
- if (t == SUCCESS && pointer)
- t = gfc_check_vardef_context (e2, true, true, false, _("ALLOCATE object"));
- if (t == SUCCESS)
- t = gfc_check_vardef_context (e2, false, true, false, _("ALLOCATE object"));
+ t = true;
+ if (t && pointer)
+ t = gfc_check_vardef_context (e2, true, true, false,
+ _("ALLOCATE object"));
+ if (t)
+ t = gfc_check_vardef_context (e2, false, true, false,
+ _("ALLOCATE object"));
gfc_free_expr (e2);
- if (t == FAILURE)
+ if (!t)
goto failure;
if (e->ts.type == BT_CLASS && CLASS_DATA (e)->attr.dimension
@@ -6914,10 +6905,10 @@ check_symbols:
}
success:
- return SUCCESS;
+ return true;
failure:
- return FAILURE;
+ return false;
}
static void
@@ -6932,7 +6923,8 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
/* Check the stat variable. */
if (stat)
{
- gfc_check_vardef_context (stat, false, false, false, _("STAT variable"));
+ gfc_check_vardef_context (stat, false, false, false,
+ _("STAT variable"));
if ((stat->ts.type != BT_INTEGER
&& !(stat->ref && (stat->ref->type == REF_ARRAY
@@ -7294,18 +7286,18 @@ check_case_overlap (gfc_case *list)
/* Check to see if an expression is suitable for use in a CASE statement.
Makes sure that all case expressions are scalar constants of the same
- type. Return FAILURE if anything is wrong. */
+ type. Return false if anything is wrong. */
-static gfc_try
+static bool
validate_case_label_expr (gfc_expr *e, gfc_expr *case_expr)
{
- if (e == NULL) return SUCCESS;
+ if (e == NULL) return true;
if (e->ts.type != case_expr->ts.type)
{
gfc_error ("Expression in CASE statement at %L must be of type %s",
&e->where, gfc_basic_typename (case_expr->ts.type));
- return FAILURE;
+ return false;
}
/* C805 (R808) For a given case-construct, each case-value shall be of
@@ -7316,7 +7308,7 @@ validate_case_label_expr (gfc_expr *e, gfc_expr *case_expr)
{
gfc_error ("Expression in CASE statement at %L must be of kind %d",
&e->where, case_expr->ts.kind);
- return FAILURE;
+ return false;
}
/* Convert the case value kind to that of case expression kind,
@@ -7329,10 +7321,10 @@ validate_case_label_expr (gfc_expr *e, gfc_expr *case_expr)
{
gfc_error ("Expression in CASE statement at %L must be scalar",
&e->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -7366,7 +7358,7 @@ resolve_select (gfc_code *code, bool select_type)
int seen_logical;
int ncases;
bt type;
- gfc_try t;
+ bool t;
if (code->expr1 == NULL)
{
@@ -7475,7 +7467,7 @@ resolve_select (gfc_code *code, bool select_type)
for (body = code->block; body; body = body->block)
{
/* Assume the CASE list is OK, and all CASE labels can be matched. */
- t = SUCCESS;
+ t = true;
seen_unreachable = 0;
/* Walk the case label list, making sure that all case labels
@@ -7493,7 +7485,7 @@ resolve_select (gfc_code *code, bool select_type)
gfc_error ("The DEFAULT CASE at %L cannot be followed "
"by a second DEFAULT CASE at %L",
&default_case->where, &cp->where);
- t = FAILURE;
+ t = false;
break;
}
else
@@ -7505,10 +7497,10 @@ resolve_select (gfc_code *code, bool select_type)
/* Deal with single value cases and case ranges. Errors are
issued from the validation function. */
- if (validate_case_label_expr (cp->low, case_expr) != SUCCESS
- || validate_case_label_expr (cp->high, case_expr) != SUCCESS)
+ if (!validate_case_label_expr (cp->low, case_expr)
+ || !validate_case_label_expr (cp->high, case_expr))
{
- t = FAILURE;
+ t = false;
break;
}
@@ -7518,7 +7510,7 @@ resolve_select (gfc_code *code, bool select_type)
{
gfc_error ("Logical range in CASE statement at %L is not "
"allowed", &cp->low->where);
- t = FAILURE;
+ t = false;
break;
}
@@ -7531,7 +7523,7 @@ resolve_select (gfc_code *code, bool select_type)
gfc_error ("Constant logical value in CASE statement "
"is repeated at %L",
&cp->low->where);
- t = FAILURE;
+ t = false;
break;
}
seen_logical |= value;
@@ -7571,7 +7563,7 @@ resolve_select (gfc_code *code, bool select_type)
/* It there was a failure in the previous case label, give up
for this case label list. Continue with the next block. */
- if (t == FAILURE)
+ if (!t)
continue;
/* See if any case labels that are unreachable have been seen.
@@ -7680,7 +7672,7 @@ resolve_assoc_var (gfc_symbol* sym, bool resolve_target)
return;
gcc_assert (!sym->assoc->dangling);
- if (resolve_target && gfc_resolve_expr (target) != SUCCESS)
+ if (resolve_target && !gfc_resolve_expr (target))
return;
/* For variable targets, we get some attributes from the target. */
@@ -8147,8 +8139,8 @@ resolve_transfer (gfc_code *code)
code->ext.dt may be NULL if the TRANSFER is related to
an INQUIRE statement -- but in this case, we are not reading, either. */
if (code->ext.dt && code->ext.dt->dt_io_kind->value.iokind == M_READ
- && gfc_check_vardef_context (exp, false, false, false, _("item in READ"))
- == FAILURE)
+ && !gfc_check_vardef_context (exp, false, false, false,
+ _("item in READ")))
return;
sym = exp->symtree->n.sym;
@@ -8201,8 +8193,8 @@ resolve_transfer (gfc_code *code)
the component to be printed to help debugging. */
if (ts->u.derived->ts.f90_type == BT_VOID)
{
- if (gfc_notify_std (GFC_STD_GNU, "Data transfer element at %L cannot "
- "have PRIVATE components", &code->loc) == FAILURE)
+ if (!gfc_notify_std (GFC_STD_GNU, "Data transfer element at %L "
+ "cannot have PRIVATE components", &code->loc))
return;
}
else if (derived_inaccessible (ts->u.derived))
@@ -8277,8 +8269,8 @@ resolve_lock_unlock (gfc_code *code)
&code->expr2->where);
if (code->expr2
- && gfc_check_vardef_context (code->expr2, false, false, false,
- _("STAT variable")) == FAILURE)
+ && !gfc_check_vardef_context (code->expr2, false, false, false,
+ _("STAT variable")))
return;
/* Check ERRMSG. */
@@ -8289,8 +8281,8 @@ resolve_lock_unlock (gfc_code *code)
&code->expr3->where);
if (code->expr3
- && gfc_check_vardef_context (code->expr3, false, false, false,
- _("ERRMSG variable")) == FAILURE)
+ && !gfc_check_vardef_context (code->expr3, false, false, false,
+ _("ERRMSG variable")))
return;
/* Check ACQUIRED_LOCK. */
@@ -8301,8 +8293,8 @@ resolve_lock_unlock (gfc_code *code)
"variable", &code->expr4->where);
if (code->expr4
- && gfc_check_vardef_context (code->expr4, false, false, false,
- _("ACQUIRED_LOCK variable")) == FAILURE)
+ && !gfc_check_vardef_context (code->expr4, false, false, false,
+ _("ACQUIRED_LOCK variable")))
return;
}
@@ -8321,7 +8313,7 @@ resolve_sync (gfc_code *code)
gfc_error ("Imageset argument at %L must between 1 and num_images()",
&code->expr1->where);
else if (code->expr1->expr_type == EXPR_ARRAY
- && gfc_simplify_expr (code->expr1, 0) == SUCCESS)
+ && gfc_simplify_expr (code->expr1, 0))
{
gfc_constructor *cons;
cons = gfc_constructor_first (code->expr1->value.constructor);
@@ -8450,12 +8442,12 @@ resolve_branch (gfc_st_label *label, gfc_code *code)
/* Check whether EXPR1 has the same shape as EXPR2. */
-static gfc_try
+static bool
resolve_where_shape (gfc_expr *expr1, gfc_expr *expr2)
{
mpz_t shape[GFC_MAX_DIMENSIONS];
mpz_t shape2[GFC_MAX_DIMENSIONS];
- gfc_try result = FAILURE;
+ bool result = false;
int i;
/* Compare the rank. */
@@ -8465,10 +8457,10 @@ resolve_where_shape (gfc_expr *expr1, gfc_expr *expr2)
/* Compare the size of each dimension. */
for (i=0; i<expr1->rank; i++)
{
- if (gfc_array_dimen_size (expr1, i, &shape[i]) == FAILURE)
+ if (!gfc_array_dimen_size (expr1, i, &shape[i]))
goto ignore;
- if (gfc_array_dimen_size (expr2, i, &shape2[i]) == FAILURE)
+ if (!gfc_array_dimen_size (expr2, i, &shape2[i]))
goto ignore;
if (mpz_cmp (shape[i], shape2[i]))
@@ -8478,7 +8470,7 @@ resolve_where_shape (gfc_expr *expr1, gfc_expr *expr2)
/* When either of the two expression is an assumed size array, we
ignore the comparison of dimension sizes. */
ignore:
- result = SUCCESS;
+ result = true;
over:
gfc_clear_shape (shape, i);
@@ -8512,7 +8504,7 @@ resolve_where (gfc_code *code, gfc_expr *mask)
{
/* Check if the mask-expr has a consistent shape with the
outmost WHERE mask-expr. */
- if (resolve_where_shape (cblock->expr1, e) == FAILURE)
+ if (!resolve_where_shape (cblock->expr1, e))
gfc_error ("WHERE mask at %L has inconsistent shape",
&cblock->expr1->where);
}
@@ -8528,7 +8520,7 @@ resolve_where (gfc_code *code, gfc_expr *mask)
case EXEC_ASSIGN:
/* Check shape consistent for WHERE assignment target. */
- if (e && resolve_where_shape (cnext->expr1, e) == FAILURE)
+ if (e && !resolve_where_shape (cnext->expr1, e))
gfc_error ("WHERE assignment target at %L has "
"inconsistent shape", &cnext->expr1->where);
break;
@@ -8586,7 +8578,7 @@ gfc_resolve_assign_in_forall (gfc_code *code, int nvar, gfc_expr **var_expr)
assignment variable, then there could be a many-to-one
assignment. Emit a warning rather than an error because the
mask could be resolving this problem. */
- if (find_forall_index (code->expr1, forall_index, 0) == FAILURE)
+ if (!find_forall_index (code->expr1, forall_index, 0))
gfc_warning ("The FORALL with index '%s' is not used on the "
"left side of the assignment at %L and so might "
"cause multiple assignment to this object",
@@ -8815,25 +8807,25 @@ static void resolve_code (gfc_code *, gfc_namespace *);
void
gfc_resolve_blocks (gfc_code *b, gfc_namespace *ns)
{
- gfc_try t;
+ bool t;
for (; b; b = b->block)
{
t = gfc_resolve_expr (b->expr1);
- if (gfc_resolve_expr (b->expr2) == FAILURE)
- t = FAILURE;
+ if (!gfc_resolve_expr (b->expr2))
+ t = false;
switch (b->op)
{
case EXEC_IF:
- if (t == SUCCESS && b->expr1 != NULL
+ if (t && b->expr1 != NULL
&& (b->expr1->ts.type != BT_LOGICAL || b->expr1->rank != 0))
gfc_error ("IF clause at %L requires a scalar LOGICAL expression",
&b->expr1->where);
break;
case EXEC_WHERE:
- if (t == SUCCESS
+ if (t
&& b->expr1 != NULL
&& (b->expr1->ts.type != BT_LOGICAL || b->expr1->rank == 0))
gfc_error ("WHERE/ELSEWHERE clause at %L requires a LOGICAL array",
@@ -8900,7 +8892,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
int n;
gfc_ref *ref;
- if (gfc_extend_assign (code, ns) == SUCCESS)
+ if (gfc_extend_assign (code, ns))
{
gfc_expr** rhsptr;
@@ -8939,9 +8931,9 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
rhs = code->expr2;
if (rhs->is_boz
- && gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside "
- "a DATA statement and outside INT/REAL/DBLE/CMPLX",
- &code->loc) == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside "
+ "a DATA statement and outside INT/REAL/DBLE/CMPLX",
+ &code->loc))
return false;
/* Handle the case of a BOZ literal on the RHS. */
@@ -9499,7 +9491,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
int omp_workshare_save;
int forall_save, do_concurrent_save;
code_stack frame;
- gfc_try t;
+ bool t;
frame.prev = cs_base;
frame.head = code;
@@ -9562,18 +9554,18 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
omp_workshare_flag = omp_workshare_save;
}
- t = SUCCESS;
+ t = true;
if (code->op != EXEC_COMPCALL && code->op != EXEC_CALL_PPC)
t = gfc_resolve_expr (code->expr1);
forall_flag = forall_save;
do_concurrent_flag = do_concurrent_save;
- if (gfc_resolve_expr (code->expr2) == FAILURE)
- t = FAILURE;
+ if (!gfc_resolve_expr (code->expr2))
+ t = false;
if (code->op == EXEC_ALLOCATE
- && gfc_resolve_expr (code->expr3) == FAILURE)
- t = FAILURE;
+ && !gfc_resolve_expr (code->expr3))
+ t = false;
switch (code->op)
{
@@ -9638,11 +9630,11 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
break;
case EXEC_ASSIGN:
- if (t == FAILURE)
+ if (!t)
break;
- if (gfc_check_vardef_context (code->expr1, false, false, false,
- _("assignment")) == FAILURE)
+ if (!gfc_check_vardef_context (code->expr1, false, false, false,
+ _("assignment")))
break;
if (resolve_ordinary_assign (code, ns))
@@ -9664,7 +9656,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
if (code->label1->defined == ST_LABEL_UNKNOWN)
gfc_error ("Label %d referenced at %L is never defined",
code->label1->value, &code->label1->where);
- if (t == SUCCESS
+ if (t
&& (code->expr1->expr_type != EXPR_VARIABLE
|| code->expr1->symtree->n.sym->ts.type != BT_INTEGER
|| code->expr1->symtree->n.sym->ts.kind
@@ -9678,7 +9670,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
{
gfc_expr* e;
- if (t == FAILURE)
+ if (!t)
break;
/* This is both a variable definition and pointer assignment
@@ -9688,11 +9680,11 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
e = remove_last_array_ref (code->expr1);
t = gfc_check_vardef_context (e, true, false, false,
_("pointer assignment"));
- if (t == SUCCESS)
+ if (t)
t = gfc_check_vardef_context (e, false, false, false,
_("pointer assignment"));
gfc_free_expr (e);
- if (t == FAILURE)
+ if (!t)
break;
gfc_check_pointer_assign (code->expr1, code->expr2);
@@ -9700,7 +9692,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
}
case EXEC_ARITHMETIC_IF:
- if (t == SUCCESS
+ if (t
&& code->expr1->ts.type != BT_INTEGER
&& code->expr1->ts.type != BT_REAL)
gfc_error ("Arithmetic IF statement at %L requires a numeric "
@@ -9712,7 +9704,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
break;
case EXEC_IF:
- if (t == SUCCESS && code->expr1 != NULL
+ if (t && code->expr1 != NULL
&& (code->expr1->ts.type != BT_LOGICAL
|| code->expr1->rank != 0))
gfc_error ("IF clause at %L requires a scalar LOGICAL expression",
@@ -9751,7 +9743,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
if (code->ext.iterator != NULL)
{
gfc_iterator *iter = code->ext.iterator;
- if (gfc_resolve_iterator (iter, true, false) != FAILURE)
+ if (gfc_resolve_iterator (iter, true, false))
gfc_resolve_do_iterator (code, iter->var->symtree->n.sym);
}
break;
@@ -9759,7 +9751,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_DO_WHILE:
if (code->expr1 == NULL)
gfc_internal_error ("resolve_code(): No expression on DO WHILE");
- if (t == SUCCESS
+ if (t
&& (code->expr1->rank != 0
|| code->expr1->ts.type != BT_LOGICAL))
gfc_error ("Exit condition of DO WHILE loop at %L must be "
@@ -9767,26 +9759,26 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
break;
case EXEC_ALLOCATE:
- if (t == SUCCESS)
+ if (t)
resolve_allocate_deallocate (code, "ALLOCATE");
break;
case EXEC_DEALLOCATE:
- if (t == SUCCESS)
+ if (t)
resolve_allocate_deallocate (code, "DEALLOCATE");
break;
case EXEC_OPEN:
- if (gfc_resolve_open (code->ext.open) == FAILURE)
+ if (!gfc_resolve_open (code->ext.open))
break;
resolve_branch (code->ext.open->err, code);
break;
case EXEC_CLOSE:
- if (gfc_resolve_close (code->ext.close) == FAILURE)
+ if (!gfc_resolve_close (code->ext.close))
break;
resolve_branch (code->ext.close->err, code);
@@ -9796,14 +9788,14 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_ENDFILE:
case EXEC_REWIND:
case EXEC_FLUSH:
- if (gfc_resolve_filepos (code->ext.filepos) == FAILURE)
+ if (!gfc_resolve_filepos (code->ext.filepos))
break;
resolve_branch (code->ext.filepos->err, code);
break;
case EXEC_INQUIRE:
- if (gfc_resolve_inquire (code->ext.inquire) == FAILURE)
+ if (!gfc_resolve_inquire (code->ext.inquire))
break;
resolve_branch (code->ext.inquire->err, code);
@@ -9811,14 +9803,14 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_IOLENGTH:
gcc_assert (code->ext.inquire != NULL);
- if (gfc_resolve_inquire (code->ext.inquire) == FAILURE)
+ if (!gfc_resolve_inquire (code->ext.inquire))
break;
resolve_branch (code->ext.inquire->err, code);
break;
case EXEC_WAIT:
- if (gfc_resolve_wait (code->ext.wait) == FAILURE)
+ if (!gfc_resolve_wait (code->ext.wait))
break;
resolve_branch (code->ext.wait->err, code);
@@ -9828,7 +9820,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_READ:
case EXEC_WRITE:
- if (gfc_resolve_dt (code->ext.dt, &code->loc) == FAILURE)
+ if (!gfc_resolve_dt (code->ext.dt, &code->loc))
break;
resolve_branch (code->ext.dt->err, code);
@@ -9891,7 +9883,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
static void
resolve_values (gfc_symbol *sym)
{
- gfc_try t;
+ bool t;
if (sym->value == NULL)
return;
@@ -9901,7 +9893,7 @@ resolve_values (gfc_symbol *sym)
else
t = gfc_resolve_expr (sym->value);
- if (t == FAILURE)
+ if (!t)
return;
gfc_check_assign_symbol (sym, NULL, sym->value);
@@ -10109,32 +10101,32 @@ gfc_verify_binding_labels (gfc_symbol *sym)
/* Resolve an index expression. */
-static gfc_try
+static bool
resolve_index_expr (gfc_expr *e)
{
- if (gfc_resolve_expr (e) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (e))
+ return false;
- if (gfc_simplify_expr (e, 0) == FAILURE)
- return FAILURE;
+ if (!gfc_simplify_expr (e, 0))
+ return false;
- if (gfc_specification_expr (e) == FAILURE)
- return FAILURE;
+ if (!gfc_specification_expr (e))
+ return false;
- return SUCCESS;
+ return true;
}
/* Resolve a charlen structure. */
-static gfc_try
+static bool
resolve_charlen (gfc_charlen *cl)
{
int i, k;
bool saved_specification_expr;
if (cl->resolved)
- return SUCCESS;
+ return true;
cl->resolved = 1;
saved_specification_expr = specification_expr;
@@ -10142,25 +10134,25 @@ resolve_charlen (gfc_charlen *cl)
if (cl->length_from_typespec)
{
- if (gfc_resolve_expr (cl->length) == FAILURE)
+ if (!gfc_resolve_expr (cl->length))
{
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
- if (gfc_simplify_expr (cl->length, 0) == FAILURE)
+ if (!gfc_simplify_expr (cl->length, 0))
{
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
}
else
{
- if (resolve_index_expr (cl->length) == FAILURE)
+ if (!resolve_index_expr (cl->length))
{
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
}
@@ -10184,11 +10176,11 @@ resolve_charlen (gfc_charlen *cl)
{
gfc_error ("String length at %L is too large", &cl->length->where);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
specification_expr = saved_specification_expr;
- return SUCCESS;
+ return true;
}
@@ -10210,11 +10202,11 @@ is_non_constant_shape_array (gfc_symbol *sym)
for (i = 0; i < sym->as->rank + sym->as->corank; i++)
{
e = sym->as->lower[i];
- if (e && (resolve_index_expr (e) == FAILURE
+ if (e && (!resolve_index_expr(e)
|| !gfc_is_constant_expr (e)))
not_constant = true;
e = sym->as->upper[i];
- if (e && (resolve_index_expr (e) == FAILURE
+ if (e && (!resolve_index_expr(e)
|| !gfc_is_constant_expr (e)))
not_constant = true;
}
@@ -10486,7 +10478,7 @@ apply_default_init_local (gfc_symbol *sym)
/* Resolution of common features of flavors variable and procedure. */
-static gfc_try
+static bool
resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
{
gfc_array_spec *as;
@@ -10520,19 +10512,19 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
{
gfc_error ("Allocatable array '%s' at %L must have a deferred "
"shape or assumed rank", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
- else if (gfc_notify_std (GFC_STD_F2003, "Scalar object "
- "'%s' at %L may not be ALLOCATABLE",
- sym->name, &sym->declared_at) == FAILURE)
- return FAILURE;
+ else if (!gfc_notify_std (GFC_STD_F2003, "Scalar object "
+ "'%s' at %L may not be ALLOCATABLE",
+ sym->name, &sym->declared_at))
+ return false;
}
if (pointer && dimension && as->type != AS_ASSUMED_RANK)
{
gfc_error ("Array pointer '%s' at %L must have a deferred shape or "
"assumed rank", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
else
@@ -10542,7 +10534,7 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
{
gfc_error ("Array '%s' at %L cannot have a deferred shape",
sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
@@ -10552,13 +10544,13 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
/* F03:C502. */
if (sym->attr.class_ok
&& !sym->attr.select_type_temporary
- && !UNLIMITED_POLY(sym)
+ && !UNLIMITED_POLY (sym)
&& !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,
&sym->declared_at);
- return FAILURE;
+ return false;
}
/* F03:C509. */
@@ -10569,18 +10561,18 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
{
gfc_error ("CLASS variable '%s' at %L must be dummy, allocatable "
"or pointer", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
/* Additional checks for symbols with flavor variable and derived
type. To be called from resolve_fl_variable. */
-static gfc_try
+static bool
resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
{
gcc_assert (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS);
@@ -10603,7 +10595,7 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
"of the same name declared at %L",
sym->ts.u.derived->name, &sym->declared_at,
&s->declared_at);
- return FAILURE;
+ return false;
}
}
@@ -10620,11 +10612,10 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
&& !sym->ns->save_all && !sym->attr.save
&& !sym->attr.pointer && !sym->attr.allocatable
&& gfc_has_default_initializer (sym->ts.u.derived)
- && gfc_notify_std (GFC_STD_F2008, "Implied SAVE for "
- "module variable '%s' at %L, needed due to "
- "the default initialization", sym->name,
- &sym->declared_at) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2008, "Implied SAVE for module variable "
+ "'%s' at %L, needed due to the default "
+ "initialization", sym->name, &sym->declared_at))
+ return false;
/* Assign default initializer. */
if (!(sym->value || sym->attr.pointer || sym->attr.allocatable)
@@ -10633,13 +10624,13 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
sym->value = gfc_default_initializer (&sym->ts);
}
- return SUCCESS;
+ return true;
}
/* Resolve symbols with flavor variable. */
-static gfc_try
+static bool
resolve_fl_variable (gfc_symbol *sym, int mp_flag)
{
int no_init_flag, automatic_flag;
@@ -10650,8 +10641,8 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
auto_save_msg = "Automatic object '%s' at %L cannot have the "
"SAVE attribute";
- if (resolve_fl_var_and_proc (sym, mp_flag) == FAILURE)
- return FAILURE;
+ if (!resolve_fl_var_and_proc (sym, mp_flag))
+ return false;
/* Set this flag to check that variables are parameters of all entries.
This check is effected by the call to gfc_resolve_expr through
@@ -10672,7 +10663,7 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
gfc_error ("The module or main program array '%s' at %L must "
"have constant shape", sym->name, &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
/* Constraints on deferred type parameter. */
@@ -10682,7 +10673,7 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
"requires either the pointer or allocatable attribute",
sym->name, &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
if (sym->ts.type == BT_CHARACTER)
@@ -10696,14 +10687,14 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
gfc_error ("Entity with assumed character length at %L must be a "
"dummy argument or a PARAMETER", &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
if (e && sym->attr.save == SAVE_EXPLICIT && !gfc_is_constant_expr (e))
{
gfc_error (auto_save_msg, sym->name, &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
if (!gfc_is_constant_expr (e)
@@ -10717,14 +10708,14 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
gfc_error ("'%s' at %L must have constant character length "
"in this context", sym->name, &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
if (sym->attr.in_common)
{
gfc_error ("COMMON variable '%s' at %L must have constant "
"character length", sym->name, &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
}
}
@@ -10755,7 +10746,7 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
{
gfc_error (auto_save_msg, sym->name, &sym->declared_at);
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
}
@@ -10789,47 +10780,47 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
else
goto no_init_error;
specification_expr = saved_specification_expr;
- return FAILURE;
+ return false;
}
no_init_error:
if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS)
{
- gfc_try res = resolve_fl_variable_derived (sym, no_init_flag);
+ bool res = resolve_fl_variable_derived (sym, no_init_flag);
specification_expr = saved_specification_expr;
return res;
}
specification_expr = saved_specification_expr;
- return SUCCESS;
+ return true;
}
/* Resolve a procedure. */
-static gfc_try
+static bool
resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_formal_arglist *arg;
if (sym->attr.function
- && resolve_fl_var_and_proc (sym, mp_flag) == FAILURE)
- return FAILURE;
+ && !resolve_fl_var_and_proc (sym, mp_flag))
+ return false;
if (sym->ts.type == BT_CHARACTER)
{
gfc_charlen *cl = sym->ts.u.cl;
if (cl && cl->length && gfc_is_constant_expr (cl->length)
- && resolve_charlen (cl) == FAILURE)
- return FAILURE;
+ && !resolve_charlen (cl))
+ return false;
if ((!cl || !cl->length || cl->length->expr_type != EXPR_CONSTANT)
&& sym->attr.proc == PROC_ST_FUNCTION)
{
gfc_error ("Character-valued statement function '%s' at %L must "
"have constant length", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
@@ -10849,15 +10840,15 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& arg->sym->ts.type == BT_DERIVED
&& !arg->sym->ts.u.derived->attr.use_assoc
&& !gfc_check_symbol_access (arg->sym->ts.u.derived)
- && gfc_notify_std (GFC_STD_F2003, "'%s' is of a "
- "PRIVATE type and cannot be a dummy argument"
- " of '%s', which is PUBLIC at %L",
- arg->sym->name, sym->name, &sym->declared_at)
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "'%s' is of a PRIVATE type "
+ "and cannot be a dummy argument"
+ " of '%s', which is PUBLIC at %L",
+ arg->sym->name, sym->name,
+ &sym->declared_at))
{
/* Stop this message from recurring. */
arg->sym->ts.u.derived->attr.access = ACCESS_PUBLIC;
- return FAILURE;
+ return false;
}
}
@@ -10871,16 +10862,16 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& arg->sym->ts.type == BT_DERIVED
&& !arg->sym->ts.u.derived->attr.use_assoc
&& !gfc_check_symbol_access (arg->sym->ts.u.derived)
- && gfc_notify_std (GFC_STD_F2003, "Procedure "
- "'%s' in PUBLIC interface '%s' at %L "
- "takes dummy arguments of '%s' which is "
- "PRIVATE", iface->sym->name, sym->name,
- &iface->sym->declared_at,
- gfc_typename (&arg->sym->ts)) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "Procedure '%s' in "
+ "PUBLIC interface '%s' at %L "
+ "takes dummy arguments of '%s' which "
+ "is PRIVATE", iface->sym->name,
+ sym->name, &iface->sym->declared_at,
+ gfc_typename(&arg->sym->ts)))
{
/* Stop this message from recurring. */
arg->sym->ts.u.derived->attr.access = ACCESS_PUBLIC;
- return FAILURE;
+ return false;
}
}
}
@@ -10895,16 +10886,16 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& arg->sym->ts.type == BT_DERIVED
&& !arg->sym->ts.u.derived->attr.use_assoc
&& !gfc_check_symbol_access (arg->sym->ts.u.derived)
- && gfc_notify_std (GFC_STD_F2003, "Procedure "
- "'%s' in PUBLIC interface '%s' at %L "
- "takes dummy arguments of '%s' which is "
- "PRIVATE", iface->sym->name, sym->name,
- &iface->sym->declared_at,
- gfc_typename (&arg->sym->ts)) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "Procedure '%s' in "
+ "PUBLIC interface '%s' at %L takes "
+ "dummy arguments of '%s' which is "
+ "PRIVATE", iface->sym->name,
+ sym->name, &iface->sym->declared_at,
+ gfc_typename(&arg->sym->ts)))
{
/* Stop this message from recurring. */
arg->sym->ts.u.derived->attr.access = ACCESS_PUBLIC;
- return FAILURE;
+ return false;
}
}
}
@@ -10915,7 +10906,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("Function '%s' at %L cannot have an initializer",
sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* An external symbol may not have an initializer because it is taken to be
@@ -10924,7 +10915,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("External object '%s' at %L may not have an initializer",
sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* An elemental function is required to return a scalar 12.7.1 */
@@ -10934,7 +10925,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
"result", sym->name, &sym->declared_at);
/* Reset so that the error only occurs once. */
sym->attr.elemental = 0;
- return FAILURE;
+ return false;
}
if (sym->attr.proc == PROC_ST_FUNCTION
@@ -10942,7 +10933,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("Statement function '%s' at %L may not have pointer or "
"allocatable attribute", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* 5.1.1.5 of the Standard: A function name declared with an asterisk
@@ -10974,7 +10965,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
gfc_error ("CHARACTER(*) function '%s' at %L cannot be "
"recursive", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* Appendix B.2 of the standard. Contained functions give an
@@ -10993,8 +10984,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
gfc_formal_arglist *curr_arg;
int has_non_interop_arg = 0;
- if (verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
- sym->common_block) == FAILURE)
+ if (!verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
+ sym->common_block))
{
/* Clear these to prevent looking at them again if there was an
error. */
@@ -11014,7 +11005,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
/* Skip implicitly typed dummy args here. */
if (curr_arg->sym->attr.implicit_type == 0)
- if (gfc_verify_c_interop_param (curr_arg->sym) == FAILURE)
+ if (!gfc_verify_c_interop_param (curr_arg->sym))
/* If something is found to fail, record the fact so we
can mark the symbol for the procedure as not being
BIND(C) to try and prevent multiple errors being
@@ -11040,19 +11031,19 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("PROCEDURE attribute conflicts with SAVE attribute "
"in '%s' at %L", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (sym->attr.intent)
{
gfc_error ("PROCEDURE attribute conflicts with INTENT attribute "
"in '%s' at %L", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (sym->attr.subroutine && sym->attr.result)
{
gfc_error ("PROCEDURE attribute conflicts with RESULT attribute "
"in '%s' at %L", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (sym->attr.external && sym->attr.function
&& ((sym->attr.if_source == IFSRC_DECL && !sym->attr.procedure)
@@ -11060,18 +11051,18 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("EXTERNAL attribute conflicts with FUNCTION attribute "
"in '%s' at %L", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (strcmp ("ppr@", sym->name) == 0)
{
gfc_error ("Procedure pointer result '%s' at %L "
"is missing the pointer attribute",
sym->ns->proc_name->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -11079,16 +11070,16 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
been defined and we now know their defined arguments, check that they fulfill
the requirements of the standard for procedures used as finalizers. */
-static gfc_try
+static bool
gfc_resolve_finalizers (gfc_symbol* derived)
{
gfc_finalizer* list;
gfc_finalizer** prev_link; /* For removing wrong entries from the list. */
- gfc_try result = SUCCESS;
+ bool result = true;
bool seen_scalar = false;
if (!derived->f2k_derived || !derived->f2k_derived->finalizers)
- return SUCCESS;
+ return true;
/* Walk over the list of finalizer-procedures, check them, and if any one
does not fit in with the standard's definition, print an error and remove
@@ -11210,7 +11201,7 @@ gfc_resolve_finalizers (gfc_symbol* derived)
/* Remove wrong nodes immediately from the list so we don't risk any
troubles in the future when they might fail later expectations. */
error:
- result = FAILURE;
+ result = false;
i = list;
*prev_link = list->next;
gfc_free_finalizer (i);
@@ -11219,7 +11210,7 @@ error:
/* Warn if we haven't seen a scalar finalizer procedure (but we know there
were nodes in the list, must have been for arrays. It is surely a good
idea to have a scalar version there if there's something to finalize. */
- if (gfc_option.warn_surprising && result == SUCCESS && !seen_scalar)
+ if (gfc_option.warn_surprising && result && !seen_scalar)
gfc_warning ("Only array FINAL procedures declared for derived type '%s'"
" defined at %L, suggest also scalar one",
derived->name, &derived->declared_at);
@@ -11235,7 +11226,7 @@ error:
/* Check if two GENERIC targets are ambiguous and emit an error is they are. */
-static gfc_try
+static bool
check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
const char* generic_name, locus where)
{
@@ -11251,7 +11242,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
sym2 = t2->specific->u.specific->n.sym;
if (sym1 == sym2)
- return SUCCESS;
+ return true;
/* Both must be SUBROUTINEs or both must be FUNCTIONs. */
if (sym1->attr.subroutine != sym2->attr.subroutine
@@ -11260,7 +11251,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
gfc_error ("'%s' and '%s' can't be mixed FUNCTION/SUBROUTINE for"
" GENERIC '%s' at %L",
sym1->name, sym2->name, generic_name, &where);
- return FAILURE;
+ return false;
}
/* Compare the interfaces. */
@@ -11281,10 +11272,10 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
{
gfc_error ("'%s' and '%s' for GENERIC '%s' at %L are ambiguous",
sym1->name, sym2->name, generic_name, &where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -11296,7 +11287,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
tb_uop_root or tb_op, respectively. Thus the caller must already find
the super-type and set p->overridden correctly. */
-static gfc_try
+static bool
resolve_tb_generic_targets (gfc_symbol* super_type,
gfc_typebound_proc* p, const char* name)
{
@@ -11340,7 +11331,7 @@ resolve_tb_generic_targets (gfc_symbol* super_type,
gfc_error ("Undefined specific binding '%s' as target of GENERIC '%s'"
" at %L", target_name, name, &p->where);
- return FAILURE;
+ return false;
/* Once we've found the specific binding, check it is not ambiguous with
other specifics already found or inherited for the same GENERIC. */
@@ -11352,15 +11343,14 @@ specific_found:
{
gfc_error ("GENERIC '%s' at %L must target a specific binding,"
" '%s' is GENERIC, too", name, &p->where, target_name);
- return FAILURE;
+ return false;
}
/* Check those already resolved on this type directly. */
for (g = p->u.generic; g; g = g->next)
if (g != target && g->specific
- && check_generic_tbp_ambiguity (target, g, name, p->where)
- == FAILURE)
- return FAILURE;
+ && !check_generic_tbp_ambiguity (target, g, name, p->where))
+ return false;
/* Check for ambiguity with inherited specific targets. */
for (overridden_tbp = p->overridden; overridden_tbp;
@@ -11370,9 +11360,8 @@ specific_found:
for (g = overridden_tbp->u.generic; g; g = g->next)
{
gcc_assert (g->specific);
- if (check_generic_tbp_ambiguity (target, g,
- name, p->where) == FAILURE)
- return FAILURE;
+ if (!check_generic_tbp_ambiguity (target, g, name, p->where))
+ return false;
}
}
}
@@ -11382,7 +11371,7 @@ specific_found:
{
gfc_error ("GENERIC '%s' at %L can't overwrite specific binding with"
" the same name", name, &p->where);
- return FAILURE;
+ return false;
}
/* Take the SUBROUTINE/FUNCTION attributes of the first specific target, as
@@ -11392,13 +11381,13 @@ specific_found:
p->subroutine = first_target->n.sym->attr.subroutine;
p->function = first_target->n.sym->attr.function;
- return SUCCESS;
+ return true;
}
/* Resolve a GENERIC procedure binding for a derived type. */
-static gfc_try
+static bool
resolve_typebound_generic (gfc_symbol* derived, gfc_symtree* st)
{
gfc_symbol* super_type;
@@ -11446,7 +11435,7 @@ get_checked_tb_operator_target (gfc_tbp_generic* target, locus where)
/* Resolve a type-bound intrinsic operator. */
-static gfc_try
+static bool
resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
gfc_typebound_proc* p)
{
@@ -11455,7 +11444,7 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
/* If there's already an error here, do nothing (but don't fail again). */
if (p->error)
- return SUCCESS;
+ return true;
/* Operators should always be GENERIC bindings. */
gcc_assert (p->is_generic);
@@ -11469,7 +11458,7 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
p->overridden = NULL;
/* Resolve general GENERIC properties using worker function. */
- if (resolve_tb_generic_targets (super_type, p, gfc_op2string (op)) == FAILURE)
+ if (!resolve_tb_generic_targets (super_type, p, gfc_op2string(op)))
goto error;
/* Check the targets to be procedures of correct interface. */
@@ -11489,9 +11478,8 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
&& p->access != ACCESS_PRIVATE && derived->ns == gfc_current_ns)
{
gfc_interface *head, *intr;
- if (gfc_check_new_interface (derived->ns->op[op], target_proc,
- p->where) == FAILURE)
- return FAILURE;
+ if (!gfc_check_new_interface (derived->ns->op[op], target_proc, p->where))
+ return false;
head = derived->ns->op[op];
intr = gfc_get_interface ();
intr->sym = target_proc;
@@ -11501,20 +11489,20 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
}
}
- return SUCCESS;
+ return true;
error:
p->error = 1;
- return FAILURE;
+ return false;
}
/* Resolve a type-bound user operator (tree-walker callback). */
static gfc_symbol* resolve_bindings_derived;
-static gfc_try resolve_bindings_result;
+static bool resolve_bindings_result;
-static gfc_try check_uop_procedure (gfc_symbol* sym, locus where);
+static bool check_uop_procedure (gfc_symbol* sym, locus where);
static void
resolve_typebound_user_op (gfc_symtree* stree)
@@ -11545,8 +11533,7 @@ resolve_typebound_user_op (gfc_symtree* stree)
stree->n.tb->overridden = NULL;
/* Resolve basically using worker function. */
- if (resolve_tb_generic_targets (super_type, stree->n.tb, stree->name)
- == FAILURE)
+ if (!resolve_tb_generic_targets (super_type, stree->n.tb, stree->name))
goto error;
/* Check the targets to be functions of correct interface. */
@@ -11558,14 +11545,14 @@ resolve_typebound_user_op (gfc_symtree* stree)
if (!target_proc)
goto error;
- if (check_uop_procedure (target_proc, stree->n.tb->where) == FAILURE)
+ if (!check_uop_procedure (target_proc, stree->n.tb->where))
goto error;
}
return;
error:
- resolve_bindings_result = FAILURE;
+ resolve_bindings_result = false;
stree->n.tb->error = 1;
}
@@ -11593,8 +11580,7 @@ resolve_typebound_procedure (gfc_symtree* stree)
/* If this is a GENERIC binding, use that routine. */
if (stree->n.tb->is_generic)
{
- if (resolve_typebound_generic (resolve_bindings_derived, stree)
- == FAILURE)
+ if (!resolve_typebound_generic (resolve_bindings_derived, stree))
goto error;
return;
}
@@ -11610,7 +11596,7 @@ resolve_typebound_procedure (gfc_symtree* stree)
if (stree->n.tb->deferred)
{
- if (check_proc_interface (proc, &where) == FAILURE)
+ if (!check_proc_interface (proc, &where))
goto error;
}
else
@@ -11740,7 +11726,7 @@ resolve_typebound_procedure (gfc_symtree* stree)
if (overridden->n.tb)
stree->n.tb->overridden = overridden->n.tb;
- if (gfc_check_typebound_override (stree, overridden) == FAILURE)
+ if (!gfc_check_typebound_override (stree, overridden))
goto error;
}
}
@@ -11768,26 +11754,26 @@ resolve_typebound_procedure (gfc_symtree* stree)
return;
error:
- resolve_bindings_result = FAILURE;
+ resolve_bindings_result = false;
stree->n.tb->error = 1;
}
-static gfc_try
+static bool
resolve_typebound_procedures (gfc_symbol* derived)
{
int op;
gfc_symbol* super_type;
if (!derived->f2k_derived || !derived->f2k_derived->tb_sym_root)
- return SUCCESS;
+ return true;
super_type = gfc_get_derived_super_type (derived);
if (super_type)
resolve_symbol (super_type);
resolve_bindings_derived = derived;
- resolve_bindings_result = SUCCESS;
+ resolve_bindings_result = true;
/* Make sure the vtab has been generated. */
gfc_find_derived_vtab (derived);
@@ -11803,9 +11789,9 @@ resolve_typebound_procedures (gfc_symbol* derived)
for (op = 0; op != GFC_INTRINSIC_OPS; ++op)
{
gfc_typebound_proc* p = derived->f2k_derived->tb_op[op];
- if (p && resolve_typebound_intrinsic_op (derived, (gfc_intrinsic_op) op,
- p) == FAILURE)
- resolve_bindings_result = FAILURE;
+ if (p && !resolve_typebound_intrinsic_op (derived,
+ (gfc_intrinsic_op)op, p))
+ resolve_bindings_result = false;
}
return resolve_bindings_result;
@@ -11833,37 +11819,37 @@ add_dt_to_dt_list (gfc_symbol *derived)
/* Ensure that a derived-type is really not abstract, meaning that every
inherited DEFERRED binding is overridden by a non-DEFERRED one. */
-static gfc_try
+static bool
ensure_not_abstract_walker (gfc_symbol* sub, gfc_symtree* st)
{
if (!st)
- return SUCCESS;
+ return true;
- if (ensure_not_abstract_walker (sub, st->left) == FAILURE)
- return FAILURE;
- if (ensure_not_abstract_walker (sub, st->right) == FAILURE)
- return FAILURE;
+ if (!ensure_not_abstract_walker (sub, st->left))
+ return false;
+ if (!ensure_not_abstract_walker (sub, st->right))
+ return false;
if (st->n.tb && st->n.tb->deferred)
{
gfc_symtree* overriding;
overriding = gfc_find_typebound_proc (sub, NULL, st->name, true, NULL);
if (!overriding)
- return FAILURE;
+ return false;
gcc_assert (overriding->n.tb);
if (overriding->n.tb->deferred)
{
gfc_error ("Derived-type '%s' declared at %L must be ABSTRACT because"
" '%s' is DEFERRED and not overridden",
sub->name, &sub->declared_at, st->name);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
ensure_not_abstract (gfc_symbol* sub, gfc_symbol* ancestor)
{
/* The algorithm used here is to recursively travel up the ancestry of sub
@@ -11876,15 +11862,15 @@ ensure_not_abstract (gfc_symbol* sub, gfc_symbol* ancestor)
gcc_assert (ancestor && !sub->attr.abstract);
if (!ancestor->attr.abstract)
- return SUCCESS;
+ return true;
/* Walk bindings of this ancestor. */
if (ancestor->f2k_derived)
{
- gfc_try t;
+ bool t;
t = ensure_not_abstract_walker (sub, ancestor->f2k_derived->tb_sym_root);
- if (t == FAILURE)
- return FAILURE;
+ if (!t)
+ return false;
}
/* Find next ancestor type and recurse on it. */
@@ -11892,7 +11878,7 @@ ensure_not_abstract (gfc_symbol* sub, gfc_symbol* ancestor)
if (ancestor)
return ensure_not_abstract (sub, ancestor);
- return SUCCESS;
+ return true;
}
@@ -11937,14 +11923,14 @@ check_defined_assignments (gfc_symbol *derived)
resolution stage, but can be done as soon as the dt declaration has been
parsed. */
-static gfc_try
+static bool
resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_symbol* super_type;
gfc_component *c;
if (sym->attr.unlimited_polymorphic)
- return SUCCESS;
+ return true;
super_type = gfc_get_derived_super_type (sym);
@@ -11954,19 +11940,19 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("As extending type '%s' at %L has a coarray component, "
"parent type '%s' shall also have one", sym->name,
&sym->declared_at, super_type->name);
- return FAILURE;
+ return false;
}
/* Ensure the extended type gets resolved before we do. */
- if (super_type && resolve_fl_derived0 (super_type) == FAILURE)
- return FAILURE;
+ if (super_type && !resolve_fl_derived0 (super_type))
+ return false;
/* An ABSTRACT type must be extensible. */
if (sym->attr.abstract && !gfc_type_is_extensible (sym))
{
gfc_error ("Non-extensible derived-type '%s' at %L must not be ABSTRACT",
sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
c = (sym->attr.is_class) ? sym->components->ts.u.derived->components
@@ -11982,7 +11968,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_error ("Deferred-length character component '%s' at %L is not "
"yet supported", c->name, &c->loc);
- return FAILURE;
+ return false;
}
/* F2008, C442. */
@@ -11992,7 +11978,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_error ("Coarray component '%s' at %L must be allocatable with "
"deferred shape", c->name, &c->loc);
- return FAILURE;
+ return false;
}
/* F2008, C443. */
@@ -12001,7 +11987,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_error ("Component '%s' at %L of TYPE(C_PTR) or TYPE(C_FUNPTR) "
"shall not be a coarray", c->name, &c->loc);
- return FAILURE;
+ return false;
}
/* F2008, C444. */
@@ -12012,7 +11998,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("Component '%s' at %L with coarray component "
"shall be a nonpointer, nonallocatable scalar",
c->name, &c->loc);
- return FAILURE;
+ return false;
}
/* F2008, C448. */
@@ -12020,7 +12006,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_error ("Component '%s' at %L has the CONTIGUOUS attribute but "
"is not an array pointer", c->name, &c->loc);
- return FAILURE;
+ return false;
}
if (c->attr.proc_pointer && c->ts.interface)
@@ -12028,8 +12014,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_symbol *ifc = c->ts.interface;
if (!sym->attr.vtype
- && check_proc_interface (ifc, &c->loc) == FAILURE)
- return FAILURE;
+ && !check_proc_interface (ifc, &c->loc))
+ return false;
if (ifc->attr.if_source || ifc->attr.intrinsic)
{
@@ -12071,8 +12057,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
{
gfc_charlen *cl = gfc_new_charlen (sym->ns, ifc->ts.u.cl);
if (cl->length && !cl->resolved
- && gfc_resolve_expr (cl->length) == FAILURE)
- return FAILURE;
+ && !gfc_resolve_expr (cl->length))
+ return false;
c->ts.u.cl = cl;
}
}
@@ -12115,7 +12101,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
"at %L has no argument '%s'", c->name,
c->tb->pass_arg, &c->loc, c->tb->pass_arg);
c->tb->error = 1;
- return FAILURE;
+ return false;
}
}
else
@@ -12129,7 +12115,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
"must have at least one argument",
c->name, &c->loc);
c->tb->error = 1;
- return FAILURE;
+ return false;
}
me_arg = c->ts.interface->formal->sym;
}
@@ -12145,7 +12131,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
" the derived type '%s'", me_arg->name, c->name,
me_arg->name, &c->loc, sym->name);
c->tb->error = 1;
- return FAILURE;
+ return false;
}
/* Check for C453. */
@@ -12155,7 +12141,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
"must be scalar", me_arg->name, c->name, me_arg->name,
&c->loc);
c->tb->error = 1;
- return FAILURE;
+ return false;
}
if (me_arg->attr.pointer)
@@ -12164,7 +12150,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
"may not have the POINTER attribute", me_arg->name,
c->name, me_arg->name, &c->loc);
c->tb->error = 1;
- return FAILURE;
+ return false;
}
if (me_arg->attr.allocatable)
@@ -12173,7 +12159,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
"may not be ALLOCATABLE", me_arg->name, c->name,
me_arg->name, &c->loc);
c->tb->error = 1;
- return FAILURE;
+ return false;
}
if (gfc_type_is_extensible (sym) && me_arg->ts.type != BT_CLASS)
@@ -12189,8 +12175,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
|| (!sym->attr.is_class
&& (!sym->attr.extension || c != sym->components)))
&& !sym->attr.vtype
- && resolve_typespec_used (&c->ts, &c->loc, c->name) == FAILURE)
- return FAILURE;
+ && !resolve_typespec_used (&c->ts, &c->loc, c->name))
+ return false;
/* If this type is an extension, set the accessibility of the parent
component. */
@@ -12209,21 +12195,21 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("Component '%s' of '%s' at %L has the same name as an"
" inherited type-bound procedure",
c->name, sym->name, &c->loc);
- return FAILURE;
+ return false;
}
if (c->ts.type == BT_CHARACTER && !c->attr.proc_pointer
&& !c->ts.deferred)
{
if (c->ts.u.cl->length == NULL
- || (resolve_charlen (c->ts.u.cl) == FAILURE)
+ || (!resolve_charlen(c->ts.u.cl))
|| !gfc_is_constant_expr (c->ts.u.cl->length))
{
gfc_error ("Character length of component '%s' needs to "
"be a constant specification expression at %L",
c->name,
c->ts.u.cl->length ? &c->ts.u.cl->length->where : &c->loc);
- return FAILURE;
+ return false;
}
}
@@ -12233,7 +12219,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("Character component '%s' of '%s' at %L with deferred "
"length must be a POINTER or ALLOCATABLE",
c->name, sym->name, &c->loc);
- return FAILURE;
+ return false;
}
if (c->ts.type == BT_DERIVED
@@ -12242,17 +12228,17 @@ resolve_fl_derived0 (gfc_symbol *sym)
&& !is_sym_host_assoc (c->ts.u.derived, sym->ns)
&& !c->ts.u.derived->attr.use_assoc
&& !gfc_check_symbol_access (c->ts.u.derived)
- && gfc_notify_std (GFC_STD_F2003, "the component '%s' "
- "is a PRIVATE type and cannot be a component of "
- "'%s', which is PUBLIC at %L", c->name,
- sym->name, &sym->declared_at) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2003, "the component '%s' is a "
+ "PRIVATE type and cannot be a component of "
+ "'%s', which is PUBLIC at %L", c->name,
+ sym->name, &sym->declared_at))
+ return false;
if ((sym->attr.sequence || sym->attr.is_bind_c) && c->ts.type == BT_CLASS)
{
gfc_error ("Polymorphic component %s at %L in SEQUENCE or BIND(C) "
"type %s", c->name, &c->loc, sym->name);
- return FAILURE;
+ return false;
}
if (sym->attr.sequence)
@@ -12262,7 +12248,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("Component %s of SEQUENCE type declared at %L does "
"not have the SEQUENCE attribute",
c->ts.u.derived->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
@@ -12280,7 +12266,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("The pointer component '%s' of '%s' at %L is a type "
"that has not been declared", c->name, sym->name,
&c->loc);
- return FAILURE;
+ return false;
}
if (c->ts.type == BT_CLASS && c->attr.class_ok
@@ -12292,7 +12278,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
gfc_error ("The pointer component '%s' of '%s' at %L is a type "
"that has not been declared", c->name, sym->name,
&c->loc);
- return FAILURE;
+ return false;
}
/* C437. */
@@ -12305,7 +12291,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
"or pointer", c->name, &c->loc);
/* Prevent a recurrence of the error. */
c->ts.type = BT_UNKNOWN;
- return FAILURE;
+ return false;
}
/* Ensure that all the derived type components are put on the
@@ -12318,14 +12304,14 @@ resolve_fl_derived0 (gfc_symbol *sym)
&& sym != c->ts.u.derived)
add_dt_to_dt_list (c->ts.u.derived);
- if (gfc_resolve_array_spec (c->as, !(c->attr.pointer
- || c->attr.proc_pointer
- || c->attr.allocatable)) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_array_spec (c->as,
+ !(c->attr.pointer || c->attr.proc_pointer
+ || c->attr.allocatable)))
+ return false;
if (c->initializer && !sym->attr.vtype
- && gfc_check_assign_symbol (sym, c, c->initializer) == FAILURE)
- return FAILURE;
+ && !gfc_check_assign_symbol (sym, c, c->initializer))
+ return false;
}
check_defined_assignments (sym);
@@ -12338,8 +12324,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
all DEFERRED bindings are overridden. */
if (super_type && super_type->attr.abstract && !sym->attr.abstract
&& !sym->attr.is_class
- && ensure_not_abstract (sym, super_type) == FAILURE)
- return FAILURE;
+ && !ensure_not_abstract (sym, super_type))
+ return false;
/* Add derived type to the derived type list. */
add_dt_to_dt_list (sym);
@@ -12348,7 +12334,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
finalization wrapper is generated early enough. */
gfc_is_finalizable (sym, NULL);
- return SUCCESS;
+ return true;
}
@@ -12357,34 +12343,34 @@ resolve_fl_derived0 (gfc_symbol *sym)
to 'resolve_fl_derived0' this can only be done after the module has been
parsed completely. */
-static gfc_try
+static bool
resolve_fl_derived (gfc_symbol *sym)
{
gfc_symbol *gen_dt = NULL;
if (sym->attr.unlimited_polymorphic)
- return SUCCESS;
+ return true;
if (!sym->attr.is_class)
gfc_find_symbol (sym->name, sym->ns, 0, &gen_dt);
if (gen_dt && gen_dt->generic && gen_dt->generic->next
&& (!gen_dt->generic->sym->attr.use_assoc
|| gen_dt->generic->sym->module != gen_dt->generic->next->sym->module)
- && gfc_notify_std (GFC_STD_F2003, "Generic name '%s' of "
- "function '%s' at %L being the same name as derived "
- "type at %L", sym->name,
- gen_dt->generic->sym == sym
- ? gen_dt->generic->next->sym->name
- : gen_dt->generic->sym->name,
- gen_dt->generic->sym == sym
- ? &gen_dt->generic->next->sym->declared_at
- : &gen_dt->generic->sym->declared_at,
- &sym->declared_at) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2003, "Generic name '%s' of function "
+ "'%s' at %L being the same name as derived "
+ "type at %L", sym->name,
+ gen_dt->generic->sym == sym
+ ? gen_dt->generic->next->sym->name
+ : gen_dt->generic->sym->name,
+ gen_dt->generic->sym == sym
+ ? &gen_dt->generic->next->sym->declared_at
+ : &gen_dt->generic->sym->declared_at,
+ &sym->declared_at))
+ return false;
/* Resolve the finalizer procedures. */
- if (gfc_resolve_finalizers (sym) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_finalizers (sym))
+ return false;
if (sym->attr.is_class && sym->ts.u.derived == NULL)
{
@@ -12394,7 +12380,7 @@ resolve_fl_derived (gfc_symbol *sym)
/* Nothing more to do for unlimited polymorphic entities. */
if (data->ts.u.derived->attr.unlimited_polymorphic)
- return SUCCESS;
+ return true;
else if (vptr->ts.u.derived == NULL)
{
gfc_symbol *vtab = gfc_find_derived_vtab (data->ts.u.derived);
@@ -12403,18 +12389,18 @@ resolve_fl_derived (gfc_symbol *sym)
}
}
- if (resolve_fl_derived0 (sym) == FAILURE)
- return FAILURE;
+ if (!resolve_fl_derived0 (sym))
+ return false;
/* Resolve the type-bound procedures. */
- if (resolve_typebound_procedures (sym) == FAILURE)
- return FAILURE;
+ if (!resolve_typebound_procedures (sym))
+ return false;
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
resolve_fl_namelist (gfc_symbol *sym)
{
gfc_namelist *nl;
@@ -12428,31 +12414,29 @@ resolve_fl_namelist (gfc_symbol *sym)
{
gfc_error ("Assumed size array '%s' in namelist '%s' at %L is not "
"allowed", nl->sym->name, sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (nl->sym->as && nl->sym->as->type == AS_ASSUMED_SHAPE
- && gfc_notify_std (GFC_STD_F2003, "NAMELIST array "
- "object '%s' with assumed shape in namelist "
- "'%s' at %L", nl->sym->name, sym->name,
- &sym->declared_at) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
+ "with assumed shape in namelist '%s' at %L",
+ nl->sym->name, sym->name, &sym->declared_at))
+ return false;
if (is_non_constant_shape_array (nl->sym)
- && gfc_notify_std (GFC_STD_F2003, "NAMELIST array "
- "object '%s' with nonconstant shape in namelist "
- "'%s' at %L", nl->sym->name, sym->name,
- &sym->declared_at) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
+ "with nonconstant shape in namelist '%s' at %L",
+ nl->sym->name, sym->name, &sym->declared_at))
+ return false;
if (nl->sym->ts.type == BT_CHARACTER
&& (nl->sym->ts.u.cl->length == NULL
|| !gfc_is_constant_expr (nl->sym->ts.u.cl->length))
- && gfc_notify_std (GFC_STD_F2003, "NAMELIST object "
- "'%s' with nonconstant character length in "
- "namelist '%s' at %L", nl->sym->name, sym->name,
- &sym->declared_at) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F2003, "NAMELIST object '%s' with "
+ "nonconstant character length in "
+ "namelist '%s' at %L", nl->sym->name,
+ sym->name, &sym->declared_at))
+ return false;
/* FIXME: Once UDDTIO is implemented, the following can be
removed. */
@@ -12461,18 +12445,18 @@ resolve_fl_namelist (gfc_symbol *sym)
gfc_error ("NAMELIST object '%s' in namelist '%s' at %L is "
"polymorphic and requires a defined input/output "
"procedure", nl->sym->name, sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
if (nl->sym->ts.type == BT_DERIVED
&& (nl->sym->ts.u.derived->attr.alloc_comp
|| nl->sym->ts.u.derived->attr.pointer_comp))
{
- if (gfc_notify_std (GFC_STD_F2003, "NAMELIST object "
- "'%s' in namelist '%s' at %L with ALLOCATABLE "
- "or POINTER components", nl->sym->name,
- sym->name, &sym->declared_at) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "NAMELIST object '%s' in "
+ "namelist '%s' at %L with ALLOCATABLE "
+ "or POINTER components", nl->sym->name,
+ sym->name, &sym->declared_at))
+ return false;
/* FIXME: Once UDDTIO is implemented, the following can be
removed. */
@@ -12480,7 +12464,7 @@ resolve_fl_namelist (gfc_symbol *sym)
"ALLOCATABLE or POINTER components and thus requires "
"a defined input/output procedure", nl->sym->name,
sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
@@ -12496,7 +12480,7 @@ resolve_fl_namelist (gfc_symbol *sym)
gfc_error ("NAMELIST object '%s' was declared PRIVATE and "
"cannot be member of PUBLIC namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* Types with private components that came here by USE-association. */
@@ -12506,7 +12490,7 @@ resolve_fl_namelist (gfc_symbol *sym)
gfc_error ("NAMELIST object '%s' has use-associated PRIVATE "
"components and cannot be member of namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* Types with private components that are defined in the same module. */
@@ -12517,7 +12501,7 @@ resolve_fl_namelist (gfc_symbol *sym)
gfc_error ("NAMELIST object '%s' has PRIVATE components and "
"cannot be a member of PUBLIC namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
}
}
@@ -12544,15 +12528,15 @@ resolve_fl_namelist (gfc_symbol *sym)
gfc_error ("PROCEDURE attribute conflicts with NAMELIST "
"attribute in '%s' at %L", nlsym->name,
&sym->declared_at);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
resolve_fl_parameter (gfc_symbol *sym)
{
/* A parameter array's shape needs to be constant. */
@@ -12562,7 +12546,7 @@ resolve_fl_parameter (gfc_symbol *sym)
{
gfc_error ("Parameter array '%s' at %L cannot be automatic "
"or of deferred shape", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* Make sure a parameter that has been implicitly typed still
@@ -12574,7 +12558,7 @@ resolve_fl_parameter (gfc_symbol *sym)
{
gfc_error ("Implicitly typed PARAMETER '%s' at %L doesn't match a "
"later IMPLICIT type", sym->name, &sym->declared_at);
- return FAILURE;
+ return false;
}
/* Make sure the types of derived parameters are consistent. This
@@ -12585,9 +12569,9 @@ resolve_fl_parameter (gfc_symbol *sym)
{
gfc_error ("Incompatible derived type in PARAMETER at %L",
&sym->value->where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -12659,7 +12643,7 @@ resolve_symbol (gfc_symbol *sym)
gfc_add_function (&sym->attr, sym->name, &sym->declared_at);
if (sym->attr.procedure && sym->attr.if_source != IFSRC_DECL
- && resolve_procedure_interface (sym) == FAILURE)
+ && !resolve_procedure_interface (sym))
return;
if (sym->attr.is_protected && !sym->attr.proc_pointer
@@ -12675,7 +12659,7 @@ resolve_symbol (gfc_symbol *sym)
return;
}
- if (sym->attr.flavor == FL_DERIVED && resolve_fl_derived (sym) == FAILURE)
+ if (sym->attr.flavor == FL_DERIVED && !resolve_fl_derived (sym))
return;
/* Symbols that are module procedures with results (functions) have
@@ -12689,7 +12673,7 @@ resolve_symbol (gfc_symbol *sym)
representation. This needs to be done before assigning a default
type to avoid spurious warnings. */
if (sym->attr.flavor != FL_MODULE && sym->attr.intrinsic
- && gfc_resolve_intrinsic (sym, &sym->declared_at) == FAILURE)
+ && !gfc_resolve_intrinsic (sym, &sym->declared_at))
return;
/* Resolve associate names. */
@@ -12897,7 +12881,7 @@ resolve_symbol (gfc_symbol *sym)
sym->attr.use_assoc == 0 && sym->attr.dummy == 0 &&
sym->attr.flavor != FL_PROCEDURE && sym->attr.flavor != FL_DERIVED)
{
- gfc_try t = SUCCESS;
+ bool t = true;
/* First, make sure the variable is declared at the
module-level scope (J3/04-007, Section 15.3). */
@@ -12907,7 +12891,7 @@ resolve_symbol (gfc_symbol *sym)
gfc_error ("Variable '%s' at %L cannot be BIND(C) because it "
"is neither a COMMON block nor declared at the "
"module level scope", sym->name, &(sym->declared_at));
- t = FAILURE;
+ t = false;
}
else if (sym->common_head != NULL)
{
@@ -12926,7 +12910,7 @@ resolve_symbol (gfc_symbol *sym)
of that type are declared. */
if (sym->ts.u.derived->attr.is_bind_c != 1)
verify_bind_c_derived_type (sym->ts.u.derived);
- t = FAILURE;
+ t = false;
}
/* Verify the variable itself as C interoperable if it
@@ -12937,7 +12921,7 @@ resolve_symbol (gfc_symbol *sym)
sym->common_block);
}
- if (t == FAILURE)
+ if (!t)
{
/* clear the is_bind_c flag to prevent reporting errors more than
once if something failed. */
@@ -12972,7 +12956,7 @@ resolve_symbol (gfc_symbol *sym)
&& sym->ts.u.derived->attr.use_assoc
&& sym->ns->proc_name
&& sym->ns->proc_name->attr.flavor == FL_MODULE
- && resolve_fl_derived (sym->ts.u.derived) == FAILURE)
+ && !resolve_fl_derived (sym->ts.u.derived))
return;
/* Unless the derived-type declaration is use associated, Fortran 95
@@ -12984,11 +12968,12 @@ resolve_symbol (gfc_symbol *sym)
&& !sym->ts.u.derived->attr.use_assoc
&& gfc_check_symbol_access (sym)
&& !gfc_check_symbol_access (sym->ts.u.derived)
- && gfc_notify_std (GFC_STD_F2003, "PUBLIC %s '%s' at %L "
- "of PRIVATE derived type '%s'",
- (sym->attr.flavor == FL_PARAMETER) ? "parameter"
- : "variable", sym->name, &sym->declared_at,
- sym->ts.u.derived->name) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F2003, "PUBLIC %s '%s' at %L of PRIVATE "
+ "derived type '%s'",
+ (sym->attr.flavor == FL_PARAMETER)
+ ? "parameter" : "variable",
+ sym->name, &sym->declared_at,
+ sym->ts.u.derived->name))
return;
/* F2008, C1302. */
@@ -13128,41 +13113,40 @@ resolve_symbol (gfc_symbol *sym)
if (gfc_logical_kinds[i].kind == sym->ts.kind)
break;
if (!gfc_logical_kinds[i].c_bool && sym->attr.dummy
- && gfc_notify_std (GFC_STD_GNU, "LOGICAL dummy argument '%s' at %L "
- "with non-C_Bool kind in BIND(C) procedure '%s'",
- sym->name, &sym->declared_at,
- sym->ns->proc_name->name) == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, "LOGICAL dummy argument '%s' at "
+ "%L with non-C_Bool kind in BIND(C) procedure "
+ "'%s'", sym->name, &sym->declared_at,
+ sym->ns->proc_name->name))
return;
else if (!gfc_logical_kinds[i].c_bool
- && gfc_notify_std (GFC_STD_GNU, "LOGICAL result variable '%s' at"
- " %L with non-C_Bool kind in BIND(C) "
- "procedure '%s'", sym->name,
- &sym->declared_at,
- sym->attr.function ? sym->name
- : sym->ns->proc_name->name)
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, "LOGICAL result variable "
+ "'%s' at %L with non-C_Bool kind in "
+ "BIND(C) procedure '%s'", sym->name,
+ &sym->declared_at,
+ sym->attr.function ? sym->name
+ : sym->ns->proc_name->name))
return;
}
switch (sym->attr.flavor)
{
case FL_VARIABLE:
- if (resolve_fl_variable (sym, mp_flag) == FAILURE)
+ if (!resolve_fl_variable (sym, mp_flag))
return;
break;
case FL_PROCEDURE:
- if (resolve_fl_procedure (sym, mp_flag) == FAILURE)
+ if (!resolve_fl_procedure (sym, mp_flag))
return;
break;
case FL_NAMELIST:
- if (resolve_fl_namelist (sym) == FAILURE)
+ if (!resolve_fl_namelist (sym))
return;
break;
case FL_PARAMETER:
- if (resolve_fl_parameter (sym) == FAILURE)
+ if (!resolve_fl_parameter (sym))
return;
break;
@@ -13243,8 +13227,7 @@ resolve_symbol (gfc_symbol *sym)
/* If this symbol has a type-spec, check it. */
if (sym->attr.flavor == FL_VARIABLE || sym->attr.flavor == FL_PARAMETER
|| (sym->attr.flavor == FL_PROCEDURE && sym->attr.function))
- if (resolve_typespec_used (&sym->ts, &sym->declared_at, sym->name)
- == FAILURE)
+ if (!resolve_typespec_used (&sym->ts, &sym->declared_at, sym->name))
return;
}
@@ -13261,30 +13244,30 @@ values;
/* Advance the values structure to point to the next value in the data list. */
-static gfc_try
+static bool
next_data_value (void)
{
while (mpz_cmp_ui (values.left, 0) == 0)
{
if (values.vnode->next == NULL)
- return FAILURE;
+ return false;
values.vnode = values.vnode->next;
mpz_set (values.left, values.vnode->repeat);
}
- return SUCCESS;
+ return true;
}
-static gfc_try
+static bool
check_data_variable (gfc_data_variable *var, locus *where)
{
gfc_expr *e;
mpz_t size;
mpz_t offset;
- gfc_try t;
+ bool t;
ar_type mark = AR_UNKNOWN;
int i;
mpz_t section_index[GFC_MAX_DIMENSIONS];
@@ -13293,8 +13276,8 @@ check_data_variable (gfc_data_variable *var, locus *where)
gfc_symbol *sym;
int has_pointer;
- if (gfc_resolve_expr (var->expr) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (var->expr))
+ return false;
ar = NULL;
mpz_init_set_si (offset, 0);
@@ -13315,7 +13298,7 @@ check_data_variable (gfc_data_variable *var, locus *where)
{
gfc_error ("DATA array '%s' at %L must be specified in a previous"
" declaration", sym->name, where);
- return FAILURE;
+ return false;
}
has_pointer = sym->attr.pointer;
@@ -13324,7 +13307,7 @@ check_data_variable (gfc_data_variable *var, locus *where)
{
gfc_error ("DATA element '%s' at %L cannot have a coindex", sym->name,
where);
- return FAILURE;
+ return false;
}
for (ref = e->ref; ref; ref = ref->next)
@@ -13338,7 +13321,7 @@ check_data_variable (gfc_data_variable *var, locus *where)
{
gfc_error ("DATA element '%s' at %L is a pointer and so must "
"be a full array", sym->name, where);
- return FAILURE;
+ return false;
}
}
@@ -13380,29 +13363,29 @@ check_data_variable (gfc_data_variable *var, locus *where)
gcc_unreachable ();
}
- if (gfc_array_size (e, &size) == FAILURE)
+ if (!gfc_array_size (e, &size))
{
gfc_error ("Nonconstant array section at %L in DATA statement",
&e->where);
mpz_clear (offset);
- return FAILURE;
+ return false;
}
}
- t = SUCCESS;
+ t = true;
while (mpz_cmp_ui (size, 0) > 0)
{
- if (next_data_value () == FAILURE)
+ if (!next_data_value ())
{
gfc_error ("DATA statement at %L has more variables than values",
where);
- t = FAILURE;
+ t = false;
break;
}
t = gfc_check_assign (var->expr, values.vnode->expr, 0);
- if (t == FAILURE)
+ if (!t)
break;
/* If we have more than one element left in the repeat count,
@@ -13434,7 +13417,7 @@ check_data_variable (gfc_data_variable *var, locus *where)
mpz_add (offset, offset, range);
mpz_clear (range);
- if (t == FAILURE)
+ if (!t)
break;
}
@@ -13446,7 +13429,7 @@ check_data_variable (gfc_data_variable *var, locus *where)
t = gfc_assign_data_value (var->expr, values.vnode->expr,
offset, NULL);
- if (t == FAILURE)
+ if (!t)
break;
if (mark == AR_FULL)
@@ -13472,17 +13455,17 @@ check_data_variable (gfc_data_variable *var, locus *where)
}
-static gfc_try traverse_data_var (gfc_data_variable *, locus *);
+static bool traverse_data_var (gfc_data_variable *, locus *);
/* Iterate over a list of elements in a DATA statement. */
-static gfc_try
+static bool
traverse_data_list (gfc_data_variable *var, locus *where)
{
mpz_t trip;
iterator_stack frame;
gfc_expr *e, *start, *end, *step;
- gfc_try retval = SUCCESS;
+ bool retval = true;
mpz_init (frame.value);
mpz_init (trip);
@@ -13491,28 +13474,28 @@ traverse_data_list (gfc_data_variable *var, locus *where)
end = gfc_copy_expr (var->iter.end);
step = gfc_copy_expr (var->iter.step);
- if (gfc_simplify_expr (start, 1) == FAILURE
+ if (!gfc_simplify_expr (start, 1)
|| start->expr_type != EXPR_CONSTANT)
{
gfc_error ("start of implied-do loop at %L could not be "
"simplified to a constant value", &start->where);
- retval = FAILURE;
+ retval = false;
goto cleanup;
}
- if (gfc_simplify_expr (end, 1) == FAILURE
+ if (!gfc_simplify_expr (end, 1)
|| end->expr_type != EXPR_CONSTANT)
{
gfc_error ("end of implied-do loop at %L could not be "
"simplified to a constant value", &start->where);
- retval = FAILURE;
+ retval = false;
goto cleanup;
}
- if (gfc_simplify_expr (step, 1) == FAILURE
+ if (!gfc_simplify_expr (step, 1)
|| step->expr_type != EXPR_CONSTANT)
{
gfc_error ("step of implied-do loop at %L could not be "
"simplified to a constant value", &start->where);
- retval = FAILURE;
+ retval = false;
goto cleanup;
}
@@ -13530,17 +13513,17 @@ traverse_data_list (gfc_data_variable *var, locus *where)
while (mpz_cmp_ui (trip, 0) > 0)
{
- if (traverse_data_var (var->list, where) == FAILURE)
+ if (!traverse_data_var (var->list, where))
{
- retval = FAILURE;
+ retval = false;
goto cleanup;
}
e = gfc_copy_expr (var->expr);
- if (gfc_simplify_expr (e, 1) == FAILURE)
+ if (!gfc_simplify_expr (e, 1))
{
gfc_free_expr (e);
- retval = FAILURE;
+ retval = false;
goto cleanup;
}
@@ -13564,10 +13547,10 @@ cleanup:
/* Type resolve variables in the variable list of a DATA statement. */
-static gfc_try
+static bool
traverse_data_var (gfc_data_variable *var, locus *where)
{
- gfc_try t;
+ bool t;
for (; var; var = var->next)
{
@@ -13576,11 +13559,11 @@ traverse_data_var (gfc_data_variable *var, locus *where)
else
t = check_data_variable (var, where);
- if (t == FAILURE)
- return FAILURE;
+ if (!t)
+ return false;
}
- return SUCCESS;
+ return true;
}
@@ -13588,27 +13571,27 @@ traverse_data_var (gfc_data_variable *var, locus *where)
This is separate from the assignment checking because data lists should
only be resolved once. */
-static gfc_try
+static bool
resolve_data_variables (gfc_data_variable *d)
{
for (; d; d = d->next)
{
if (d->list == NULL)
{
- if (gfc_resolve_expr (d->expr) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_expr (d->expr))
+ return false;
}
else
{
- if (gfc_resolve_iterator (&d->iter, false, true) == FAILURE)
- return FAILURE;
+ if (!gfc_resolve_iterator (&d->iter, false, true))
+ return false;
- if (resolve_data_variables (d->list) == FAILURE)
- return FAILURE;
+ if (!resolve_data_variables (d->list))
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -13620,7 +13603,7 @@ static void
resolve_data (gfc_data *d)
{
- if (resolve_data_variables (d->var) == FAILURE)
+ if (!resolve_data_variables (d->var))
return;
values.vnode = d->value;
@@ -13629,12 +13612,12 @@ resolve_data (gfc_data *d)
else
mpz_set (values.left, d->value->repeat);
- if (traverse_data_var (d->var, &d->where) == FAILURE)
+ if (!traverse_data_var (d->var, &d->where))
return;
/* At this point, we better not have any values left. */
- if (next_data_value () == SUCCESS)
+ if (next_data_value ())
gfc_error ("DATA statement at %L has more values than variables",
&d->where);
}
@@ -13851,13 +13834,13 @@ sequence_type (gfc_typespec ts)
/* Resolve derived type EQUIVALENCE object. */
-static gfc_try
+static bool
resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
{
gfc_component *c = derived->components;
if (!derived)
- return SUCCESS;
+ return true;
/* Shall not be an object of nonsequence derived type. */
if (!derived->attr.sequence)
@@ -13865,7 +13848,7 @@ resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
gfc_error ("Derived type variable '%s' at %L must have SEQUENCE "
"attribute to be an EQUIVALENCE object", sym->name,
&e->where);
- return FAILURE;
+ return false;
}
/* Shall not have allocatable components. */
@@ -13874,7 +13857,7 @@ resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
gfc_error ("Derived type variable '%s' at %L cannot have ALLOCATABLE "
"components to be an EQUIVALENCE object",sym->name,
&e->where);
- return FAILURE;
+ return false;
}
if (sym->attr.in_common && gfc_has_default_initializer (sym->ts.u.derived))
@@ -13882,14 +13865,14 @@ resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
gfc_error ("Derived type variable '%s' at %L with default "
"initialization cannot be in EQUIVALENCE with a variable "
"in COMMON", sym->name, &e->where);
- return FAILURE;
+ return false;
}
for (; c ; c = c->next)
{
if (c->ts.type == BT_DERIVED
- && (resolve_equivalence_derived (c->ts.u.derived, sym, e) == FAILURE))
- return FAILURE;
+ && (!resolve_equivalence_derived(c->ts.u.derived, sym, e)))
+ return false;
/* Shall not be an object of sequence derived type containing a pointer
in the structure. */
@@ -13898,10 +13881,10 @@ resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
gfc_error ("Derived type variable '%s' at %L with pointer "
"component(s) cannot be an EQUIVALENCE object",
sym->name, &e->where);
- return FAILURE;
+ return false;
}
}
- return SUCCESS;
+ return true;
}
@@ -14004,7 +13987,7 @@ resolve_equivalence (gfc_equiv *eq)
}
}
- if (gfc_resolve_expr (e) == FAILURE)
+ if (!gfc_resolve_expr (e))
continue;
sym = e->symtree->n.sym;
@@ -14040,7 +14023,7 @@ resolve_equivalence (gfc_equiv *eq)
}
if (e->ts.type == BT_DERIVED
- && resolve_equivalence_derived (e->ts.u.derived, sym, e) == FAILURE)
+ && !resolve_equivalence_derived (e->ts.u.derived, sym, e))
continue;
/* Check that the types correspond correctly:
@@ -14068,38 +14051,32 @@ resolve_equivalence (gfc_equiv *eq)
"statement at %L with different type objects";
if ((object ==2
&& last_eq_type == SEQ_MIXED
- && gfc_notify_std (GFC_STD_GNU, msg, first_sym->name, last_where)
- == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, msg, first_sym->name, last_where))
|| (eq_type == SEQ_MIXED
- && gfc_notify_std (GFC_STD_GNU, msg, sym->name,
- &e->where) == FAILURE))
+ && !gfc_notify_std (GFC_STD_GNU, msg, sym->name, &e->where)))
continue;
msg = "Non-default type object or sequence %s in EQUIVALENCE "
"statement at %L with objects of different type";
if ((object ==2
&& last_eq_type == SEQ_NONDEFAULT
- && gfc_notify_std (GFC_STD_GNU, msg, first_sym->name,
- last_where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, msg, first_sym->name, last_where))
|| (eq_type == SEQ_NONDEFAULT
- && gfc_notify_std (GFC_STD_GNU, msg, sym->name,
- &e->where) == FAILURE))
+ && !gfc_notify_std (GFC_STD_GNU, msg, sym->name, &e->where)))
continue;
msg ="Non-CHARACTER object '%s' in default CHARACTER "
"EQUIVALENCE statement at %L";
if (last_eq_type == SEQ_CHARACTER
&& eq_type != SEQ_CHARACTER
- && gfc_notify_std (GFC_STD_GNU, msg, sym->name,
- &e->where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, msg, sym->name, &e->where))
continue;
msg ="Non-NUMERIC object '%s' in default NUMERIC "
"EQUIVALENCE statement at %L";
if (last_eq_type == SEQ_NUMERIC
&& eq_type != SEQ_NUMERIC
- && gfc_notify_std (GFC_STD_GNU, msg, sym->name,
- &e->where) == FAILURE)
+ && !gfc_notify_std (GFC_STD_GNU, msg, sym->name, &e->where))
continue;
identical_types:
@@ -14111,7 +14088,7 @@ resolve_equivalence (gfc_equiv *eq)
/* Shall not be an automatic array. */
if (e->ref->type == REF_ARRAY
- && gfc_resolve_array_spec (e->ref->u.ar.as, 1) == FAILURE)
+ && !gfc_resolve_array_spec (e->ref->u.ar.as, 1))
{
gfc_error ("Array '%s' at %L with non-constant bounds cannot be "
"an EQUIVALENCE object", sym->name, &e->where);
@@ -14165,7 +14142,7 @@ resolve_fntype (gfc_namespace *ns)
sym = ns->proc_name;
if (sym->result == sym
&& sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (sym, 0, NULL) == FAILURE
+ && !gfc_set_default_type (sym, 0, NULL)
&& !sym->attr.untyped)
{
gfc_error ("Function '%s' at %L has no IMPLICIT type",
@@ -14188,7 +14165,7 @@ resolve_fntype (gfc_namespace *ns)
{
if (el->sym->result == el->sym
&& el->sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (el->sym, 0, NULL) == FAILURE
+ && !gfc_set_default_type (el->sym, 0, NULL)
&& !el->sym->attr.untyped)
{
gfc_error ("ENTRY '%s' at %L has no IMPLICIT type",
@@ -14201,7 +14178,7 @@ resolve_fntype (gfc_namespace *ns)
/* 12.3.2.1.1 Defined operators. */
-static gfc_try
+static bool
check_uop_procedure (gfc_symbol *sym, locus where)
{
gfc_formal_arglist *formal;
@@ -14210,7 +14187,7 @@ check_uop_procedure (gfc_symbol *sym, locus where)
{
gfc_error ("User operator procedure '%s' at %L must be a FUNCTION",
sym->name, &where);
- return FAILURE;
+ return false;
}
if (sym->ts.type == BT_CHARACTER
@@ -14220,7 +14197,7 @@ check_uop_procedure (gfc_symbol *sym, locus where)
{
gfc_error ("User operator procedure '%s' at %L cannot be assumed "
"character length", sym->name, &where);
- return FAILURE;
+ return false;
}
formal = gfc_sym_get_dummy_args (sym);
@@ -14228,49 +14205,49 @@ check_uop_procedure (gfc_symbol *sym, locus where)
{
gfc_error ("User operator procedure '%s' at %L must have at least "
"one argument", sym->name, &where);
- return FAILURE;
+ return false;
}
if (formal->sym->attr.intent != INTENT_IN)
{
gfc_error ("First argument of operator interface at %L must be "
"INTENT(IN)", &where);
- return FAILURE;
+ return false;
}
if (formal->sym->attr.optional)
{
gfc_error ("First argument of operator interface at %L cannot be "
"optional", &where);
- return FAILURE;
+ return false;
}
formal = formal->next;
if (!formal || !formal->sym)
- return SUCCESS;
+ return true;
if (formal->sym->attr.intent != INTENT_IN)
{
gfc_error ("Second argument of operator interface at %L must be "
"INTENT(IN)", &where);
- return FAILURE;
+ return false;
}
if (formal->sym->attr.optional)
{
gfc_error ("Second argument of operator interface at %L cannot be "
"optional", &where);
- return FAILURE;
+ return false;
}
if (formal->next)
{
gfc_error ("Operator interface at %L must have, at most, two "
"arguments", &where);
- return FAILURE;
+ return false;
}
- return SUCCESS;
+ return true;
}
static void
@@ -14310,9 +14287,8 @@ resolve_types (gfc_namespace *ns)
unsigned letter;
for (letter = 0; letter != GFC_LETTERS; ++letter)
if (ns->set_flag[letter]
- && resolve_typespec_used (&ns->default_type[letter],
- &ns->implicit_loc[letter],
- NULL) == FAILURE)
+ && !resolve_typespec_used (&ns->default_type[letter],
+ &ns->implicit_loc[letter], NULL))
return;
}
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index f714ed01a54..fd8f284827c 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -326,7 +326,7 @@ add_path_to_list (gfc_directorylist **list, const char *path,
q = (char *) alloca (len + 1);
memcpy (q, p, len + 1);
i = len - 1;
- while (i >=0 && IS_DIR_SEPARATOR(q[i]))
+ while (i >=0 && IS_DIR_SEPARATOR (q[i]))
q[i--] = '\0';
if (stat (q, &st))
@@ -1123,7 +1123,7 @@ restart:
else
gfc_advance_line ();
- if (gfc_at_eof())
+ if (gfc_at_eof ())
goto not_continuation;
/* We've got a continuation line. If we are on the very next line after
@@ -1831,7 +1831,7 @@ preprocessor_line (gfc_char_t *c)
}
-static gfc_try load_file (const char *, const char *, bool);
+static bool load_file (const char *, const char *, bool);
/* include_line()-- Checks a line buffer to see if it is an include
line. If so, we call load_file() recursively to load the included
@@ -1902,7 +1902,7 @@ include_line (gfc_char_t *line)
read by anything else. */
filename = gfc_widechar_to_char (begin, -1);
- if (load_file (filename, NULL, false) == FAILURE)
+ if (!load_file (filename, NULL, false))
exit (FATAL_EXIT_CODE);
free (filename);
@@ -1912,7 +1912,7 @@ include_line (gfc_char_t *line)
/* Load a file into memory by calling load_line until the file ends. */
-static gfc_try
+static bool
load_file (const char *realfilename, const char *displayedname, bool initial)
{
gfc_char_t *line;
@@ -1936,7 +1936,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
fprintf (stderr, "%s:%d: Error: File '%s' is being included "
"recursively\n", current_file->filename, current_file->line,
filename);
- return FAILURE;
+ return false;
}
if (initial)
@@ -1951,7 +1951,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
if (input == NULL)
{
gfc_error_now ("Can't open file '%s'", filename);
- return FAILURE;
+ return false;
}
}
else
@@ -1961,7 +1961,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
{
fprintf (stderr, "%s:%d: Error: Can't open included file '%s'\n",
current_file->filename, current_file->line, filename);
- return FAILURE;
+ return false;
}
}
@@ -2096,19 +2096,19 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
add_file_change (NULL, current_file->inclusion_line + 1);
current_file = current_file->up;
linemap_add (line_table, LC_LEAVE, 0, NULL, 0);
- return SUCCESS;
+ return true;
}
-/* Open a new file and start scanning from that file. Returns SUCCESS
- if everything went OK, FAILURE otherwise. If form == FORM_UNKNOWN
+/* Open a new file and start scanning from that file. Returns true
+ if everything went OK, false otherwise. If form == FORM_UNKNOWN
it tries to determine the source form from the filename, defaulting
to free form. */
-gfc_try
+bool
gfc_new_file (void)
{
- gfc_try result;
+ bool result;
if (gfc_cpp_enabled ())
{
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index e24cfcf3399..5dcbf028689 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -3263,7 +3263,7 @@ simplify_bound_dim (gfc_expr *array, gfc_expr *kind, int d, int upper,
gcc_assert (array->expr_type == EXPR_VARIABLE);
gcc_assert (as);
- if (gfc_resolve_array_spec (as, 0) == FAILURE)
+ if (!gfc_resolve_array_spec (as, 0))
return NULL;
/* The last dimension of an assumed-size array is special. */
@@ -3313,8 +3313,7 @@ simplify_bound_dim (gfc_expr *array, gfc_expr *kind, int d, int upper,
{
if (upper)
{
- if (gfc_ref_dimen_size (&ref->u.ar, d-1, &result->value.integer, NULL)
- != SUCCESS)
+ if (!gfc_ref_dimen_size (&ref->u.ar, d - 1, &result->value.integer, NULL))
goto returnNull;
}
else
@@ -4078,7 +4077,7 @@ min_max_choose (gfc_expr *arg, gfc_expr *extremum, int sign)
case BT_CHARACTER:
#define LENGTH(x) ((x)->value.character.length)
#define STRING(x) ((x)->value.character.string)
- if (LENGTH(extremum) < LENGTH(arg))
+ if (LENGTH (extremum) < LENGTH(arg))
{
gfc_char_t *tmp = STRING(extremum);
@@ -4629,10 +4628,10 @@ gfc_simplify_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
gfc_expr *result;
gfc_constructor *array_ctor, *mask_ctor, *vector_ctor;
- if (!is_constant_array_expr(array)
- || !is_constant_array_expr(vector)
+ if (!is_constant_array_expr (array)
+ || !is_constant_array_expr (vector)
|| (!gfc_is_constant_expr (mask)
- && !is_constant_array_expr(mask)))
+ && !is_constant_array_expr (mask)))
return NULL;
result = gfc_get_array_expr (array->ts.type, array->ts.kind, &array->where);
@@ -5506,7 +5505,7 @@ gfc_simplify_shape (gfc_expr *source, gfc_expr *kind)
gfc_expr *result, *e, *f;
gfc_array_ref *ar;
int n;
- gfc_try t;
+ bool t;
int k = get_kind (BT_INTEGER, kind, "SHAPE", gfc_default_integer_kind);
if (source->rank == -1)
@@ -5524,7 +5523,7 @@ gfc_simplify_shape (gfc_expr *source, gfc_expr *kind)
}
else if (source->shape)
{
- t = SUCCESS;
+ t = true;
for (n = 0; n < source->rank; n++)
{
mpz_init (shape[n]);
@@ -5532,13 +5531,13 @@ gfc_simplify_shape (gfc_expr *source, gfc_expr *kind)
}
}
else
- t = FAILURE;
+ t = false;
for (n = 0; n < source->rank; n++)
{
e = gfc_get_constant_expr (BT_INTEGER, k, &source->where);
- if (t == SUCCESS)
+ if (t)
{
mpz_set (e->value.integer, shape[n]);
mpz_clear (shape[n]);
@@ -5631,7 +5630,7 @@ gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
if (dim == NULL)
{
- if (gfc_array_size (array, &size) == FAILURE)
+ if (!gfc_array_size (array, &size))
return NULL;
}
else
@@ -5640,7 +5639,7 @@ gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
return NULL;
d = mpz_get_ui (dim->value.integer) - 1;
- if (gfc_array_dimen_size (array, d, &size) == FAILURE)
+ if (!gfc_array_dimen_size (array, d, &size))
return NULL;
}
@@ -5668,7 +5667,7 @@ gfc_simplify_sizeof (gfc_expr *x)
return NULL;
if (x->rank && x->expr_type != EXPR_ARRAY
- && gfc_array_size (x, &array_size) == FAILURE)
+ && !gfc_array_size (x, &array_size))
return NULL;
result = gfc_get_constant_expr (BT_INTEGER, gfc_index_integer_kind,
@@ -5897,7 +5896,7 @@ gfc_simplify_spread (gfc_expr *source, gfc_expr *dim_expr, gfc_expr *ncopies_exp
constructor. */
if (source->expr_type == EXPR_ARRAY)
{
- if (gfc_array_size (source, &size) == FAILURE)
+ if (!gfc_array_size (source, &size))
gfc_internal_error ("Failure getting length of a constant array.");
}
else
@@ -6123,13 +6122,13 @@ gfc_simplify_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
|| !gfc_is_constant_expr (size))
return NULL;
- if (gfc_calculate_transfer_sizes (source, mold, size, &source_size,
- &result_size, &result_length) == FAILURE)
+ if (!gfc_calculate_transfer_sizes (source, mold, size, &source_size,
+ &result_size, &result_length))
return NULL;
/* Calculate the size of the source. */
if (source->expr_type == EXPR_ARRAY
- && gfc_array_size (source, &tmp) == FAILURE)
+ && !gfc_array_size (source, &tmp))
gfc_internal_error ("Failure getting length of a constant array.");
/* Create an empty new expression with the appropriate characteristics. */
@@ -6395,7 +6394,7 @@ gfc_simplify_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
if (!is_constant_array_expr (vector)
|| !is_constant_array_expr (mask)
|| (!gfc_is_constant_expr (field)
- && !is_constant_array_expr(field)))
+ && !is_constant_array_expr (field)))
return NULL;
result = gfc_get_array_expr (vector->ts.type, vector->ts.kind,
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 6fc5812b218..c72974dc003 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -148,7 +148,7 @@ gfc_clear_new_implicit (void)
/* Prepare for a new implicit range. Sets flags in new_flag[]. */
-gfc_try
+bool
gfc_add_new_implicit_range (int c1, int c2)
{
int i;
@@ -162,20 +162,20 @@ gfc_add_new_implicit_range (int c1, int c2)
{
gfc_error ("Letter '%c' already set in IMPLICIT statement at %C",
i + 'A');
- return FAILURE;
+ return false;
}
new_flag[i] = 1;
}
- return SUCCESS;
+ return true;
}
/* Add a matched implicit range for gfc_set_implicit(). Check if merging
the new implicit types back into the existing types will work. */
-gfc_try
+bool
gfc_merge_new_implicit (gfc_typespec *ts)
{
int i;
@@ -183,7 +183,7 @@ gfc_merge_new_implicit (gfc_typespec *ts)
if (gfc_current_ns->seen_implicit_none)
{
gfc_error ("Cannot specify IMPLICIT at %C after IMPLICIT NONE");
- return FAILURE;
+ return false;
}
for (i = 0; i < GFC_LETTERS; i++)
@@ -194,7 +194,7 @@ gfc_merge_new_implicit (gfc_typespec *ts)
{
gfc_error ("Letter %c already has an IMPLICIT type at %C",
i + 'A');
- return FAILURE;
+ return false;
}
gfc_current_ns->default_type[i] = *ts;
@@ -202,7 +202,7 @@ gfc_merge_new_implicit (gfc_typespec *ts)
gfc_current_ns->set_flag[i] = 1;
}
}
- return SUCCESS;
+ return true;
}
@@ -234,7 +234,7 @@ gfc_get_default_type (const char *name, gfc_namespace *ns)
letter of its name. Fails if the letter in question has no default
type. */
-gfc_try
+bool
gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
{
gfc_typespec *ts;
@@ -253,7 +253,7 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
sym->attr.untyped = 1; /* Ensure we only give an error once. */
}
- return FAILURE;
+ return false;
}
sym->ts = *ts;
@@ -262,9 +262,8 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
if (ts->type == BT_CHARACTER && ts->u.cl)
sym->ts.u.cl = gfc_new_charlen (sym->ns, ts->u.cl);
else if (ts->type == BT_CLASS
- && gfc_build_class_symbol (&sym->ts, &sym->attr,
- &sym->as, false) == FAILURE)
- return FAILURE;
+ && !gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false))
+ return false;
if (sym->attr.is_bind_c == 1 && gfc_option.warn_c_binding_type)
{
@@ -293,7 +292,7 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
}
}
- return SUCCESS;
+ return true;
}
@@ -311,8 +310,7 @@ gfc_check_function_type (gfc_namespace *ns)
if (proc->result->ts.type == BT_UNKNOWN && proc->result->ts.interface == NULL)
{
- if (gfc_set_default_type (proc->result, 0, gfc_current_ns)
- == SUCCESS)
+ if (gfc_set_default_type (proc->result, 0, gfc_current_ns))
{
if (proc->result != proc)
{
@@ -348,7 +346,7 @@ gfc_check_function_type (gfc_namespace *ns)
goto conflict_std;\
}
-static gfc_try
+static bool
check_conflict (symbol_attribute *attr, const char *name, locus *where)
{
static const char *dummy = "DUMMY", *save = "SAVE", *pointer = "POINTER",
@@ -416,7 +414,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
gfc_error
("%s attribute not allowed in BLOCK DATA program unit at %L",
a1, where);
- return FAILURE;
+ return false;
}
}
@@ -440,7 +438,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
case FL_NAMELIST:
gfc_error ("Namelist group name at %L cannot have the "
"SAVE attribute", where);
- return FAILURE;
+ return false;
break;
case FL_PROCEDURE:
/* Conflicts between SAVE and PROCEDURE will be checked at
@@ -471,9 +469,9 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained)
conf (external, subroutine);
- if (attr->proc_pointer && gfc_notify_std (GFC_STD_F2003,
- "Procedure pointer at %C") == FAILURE)
- return FAILURE;
+ if (attr->proc_pointer && !gfc_notify_std (GFC_STD_F2003,
+ "Procedure pointer at %C"))
+ return false;
conf (allocatable, pointer);
conf_std (allocatable, dummy, GFC_STD_F2003);
@@ -636,13 +634,13 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
a2 = attr->access == ACCESS_PUBLIC ? publik : privat;
gfc_error ("%s attribute applied to %s %s at %L", a2, a1,
name, where);
- return FAILURE;
+ return false;
}
if (attr->is_bind_c)
{
gfc_error_now ("BIND(C) applied to %s %s at %L", a1, name, where);
- return FAILURE;
+ return false;
}
break;
@@ -748,7 +746,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
break;
}
- return SUCCESS;
+ return true;
conflict:
if (name == NULL)
@@ -758,7 +756,7 @@ conflict:
gfc_error ("%s attribute conflicts with %s attribute in '%s' at %L",
a1, a2, name, where);
- return FAILURE;
+ return false;
conflict_std:
if (name == NULL)
@@ -836,47 +834,47 @@ duplicate_attr (const char *attr, locus *where)
}
-gfc_try
+bool
gfc_add_ext_attribute (symbol_attribute *attr, ext_attr_id_t ext_attr,
locus *where ATTRIBUTE_UNUSED)
{
attr->ext_attr |= 1 << ext_attr;
- return SUCCESS;
+ return true;
}
/* Called from decl.c (attr_decl1) to check attributes, when declared
separately. */
-gfc_try
+bool
gfc_add_attribute (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
return check_conflict (attr, NULL, where);
}
-gfc_try
+bool
gfc_add_allocatable (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->allocatable)
{
duplicate_attr ("ALLOCATABLE", where);
- return FAILURE;
+ return false;
}
if (attr->flavor == FL_PROCEDURE && attr->if_source == IFSRC_IFBODY
- && gfc_find_state (COMP_INTERFACE) == FAILURE)
+ && !gfc_find_state (COMP_INTERFACE))
{
gfc_error ("ALLOCATABLE specified outside of INTERFACE body at %L",
where);
- return FAILURE;
+ return false;
}
attr->allocatable = 1;
@@ -884,25 +882,25 @@ gfc_add_allocatable (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_codimension (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->codimension)
{
duplicate_attr ("CODIMENSION", where);
- return FAILURE;
+ return false;
}
if (attr->flavor == FL_PROCEDURE && attr->if_source == IFSRC_IFBODY
- && gfc_find_state (COMP_INTERFACE) == FAILURE)
+ && !gfc_find_state (COMP_INTERFACE))
{
gfc_error ("CODIMENSION specified for '%s' outside its INTERFACE body "
"at %L", name, where);
- return FAILURE;
+ return false;
}
attr->codimension = 1;
@@ -910,25 +908,25 @@ gfc_add_codimension (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_dimension (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->dimension)
{
duplicate_attr ("DIMENSION", where);
- return FAILURE;
+ return false;
}
if (attr->flavor == FL_PROCEDURE && attr->if_source == IFSRC_IFBODY
- && gfc_find_state (COMP_INTERFACE) == FAILURE)
+ && !gfc_find_state (COMP_INTERFACE))
{
gfc_error ("DIMENSION specified for '%s' outside its INTERFACE body "
"at %L", name, where);
- return FAILURE;
+ return false;
}
attr->dimension = 1;
@@ -936,29 +934,29 @@ gfc_add_dimension (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_contiguous (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
attr->contiguous = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_external (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->external)
{
duplicate_attr ("EXTERNAL", where);
- return FAILURE;
+ return false;
}
if (attr->pointer && attr->if_source != IFSRC_IFBODY)
@@ -973,17 +971,17 @@ gfc_add_external (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_intrinsic (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->intrinsic)
{
duplicate_attr ("INTRINSIC", where);
- return FAILURE;
+ return false;
}
attr->intrinsic = 1;
@@ -992,17 +990,17 @@ gfc_add_intrinsic (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_optional (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->optional)
{
duplicate_attr ("OPTIONAL", where);
- return FAILURE;
+ return false;
}
attr->optional = 1;
@@ -1010,23 +1008,23 @@ gfc_add_optional (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_pointer (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->pointer && !(attr->if_source == IFSRC_IFBODY
- && gfc_find_state (COMP_INTERFACE) == FAILURE))
+ && !gfc_find_state (COMP_INTERFACE)))
{
duplicate_attr ("POINTER", where);
- return FAILURE;
+ return false;
}
if (attr->procedure || (attr->external && attr->if_source != IFSRC_IFBODY)
|| (attr->if_source == IFSRC_IFBODY
- && gfc_find_state (COMP_INTERFACE) == FAILURE))
+ && !gfc_find_state (COMP_INTERFACE)))
attr->proc_pointer = 1;
else
attr->pointer = 1;
@@ -1035,30 +1033,30 @@ gfc_add_pointer (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_cray_pointer (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
attr->cray_pointer = 1;
return check_conflict (attr, NULL, where);
}
-gfc_try
+bool
gfc_add_cray_pointee (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->cray_pointee)
{
gfc_error ("Cray Pointee at %L appears in multiple pointer()"
" statements", where);
- return FAILURE;
+ return false;
}
attr->cray_pointee = 1;
@@ -1066,19 +1064,18 @@ gfc_add_cray_pointee (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_protected (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->is_protected)
{
- if (gfc_notify_std (GFC_STD_LEGACY,
- "Duplicate PROTECTED attribute specified at %L",
- where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY,
+ "Duplicate PROTECTED attribute specified at %L",
+ where))
+ return false;
}
attr->is_protected = 1;
@@ -1086,32 +1083,32 @@ gfc_add_protected (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_result (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
attr->result = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_save (symbol_attribute *attr, save_state s, const char *name,
locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (s == SAVE_EXPLICIT && gfc_pure (NULL))
{
gfc_error
("SAVE attribute at %L cannot be specified in a PURE procedure",
where);
- return FAILURE;
+ return false;
}
if (s == SAVE_EXPLICIT && gfc_implicit_pure (NULL))
@@ -1119,11 +1116,10 @@ gfc_add_save (symbol_attribute *attr, save_state s, const char *name,
if (s == SAVE_EXPLICIT && attr->save == SAVE_EXPLICIT)
{
- if (gfc_notify_std (GFC_STD_LEGACY,
- "Duplicate SAVE attribute specified at %L",
- where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY,
+ "Duplicate SAVE attribute specified at %L",
+ where))
+ return false;
}
attr->save = s;
@@ -1131,20 +1127,19 @@ gfc_add_save (symbol_attribute *attr, save_state s, const char *name,
}
-gfc_try
+bool
gfc_add_value (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->value)
{
- if (gfc_notify_std (GFC_STD_LEGACY,
- "Duplicate VALUE attribute specified at %L",
- where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY,
+ "Duplicate VALUE attribute specified at %L",
+ where))
+ return false;
}
attr->value = 1;
@@ -1152,7 +1147,7 @@ gfc_add_value (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_volatile (symbol_attribute *attr, const char *name, locus *where)
{
/* No check_used needed as 11.2.1 of the F2003 standard allows
@@ -1160,10 +1155,10 @@ gfc_add_volatile (symbol_attribute *attr, const char *name, locus *where)
given a VOLATILE attribute - unless it is a coarray (F2008, C560). */
if (attr->volatile_ && attr->volatile_ns == gfc_current_ns)
- if (gfc_notify_std (GFC_STD_LEGACY,
- "Duplicate VOLATILE attribute specified at %L", where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY,
+ "Duplicate VOLATILE attribute specified at %L",
+ where))
+ return false;
attr->volatile_ = 1;
attr->volatile_ns = gfc_current_ns;
@@ -1171,7 +1166,7 @@ gfc_add_volatile (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_asynchronous (symbol_attribute *attr, const char *name, locus *where)
{
/* No check_used needed as 11.2.1 of the F2003 standard allows
@@ -1179,10 +1174,10 @@ gfc_add_asynchronous (symbol_attribute *attr, const char *name, locus *where)
given a ASYNCHRONOUS attribute. */
if (attr->asynchronous && attr->asynchronous_ns == gfc_current_ns)
- if (gfc_notify_std (GFC_STD_LEGACY,
- "Duplicate ASYNCHRONOUS attribute specified at %L",
- where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_LEGACY,
+ "Duplicate ASYNCHRONOUS attribute specified at %L",
+ where))
+ return false;
attr->asynchronous = 1;
attr->asynchronous_ns = gfc_current_ns;
@@ -1190,17 +1185,17 @@ gfc_add_asynchronous (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_threadprivate (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->threadprivate)
{
duplicate_attr ("THREADPRIVATE", where);
- return FAILURE;
+ return false;
}
attr->threadprivate = 1;
@@ -1208,17 +1203,17 @@ gfc_add_threadprivate (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_target (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->target)
{
duplicate_attr ("TARGET", where);
- return FAILURE;
+ return false;
}
attr->target = 1;
@@ -1226,12 +1221,12 @@ gfc_add_target (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_dummy (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
/* Duplicate dummy arguments are allowed due to ENTRY statements. */
attr->dummy = 1;
@@ -1239,12 +1234,12 @@ gfc_add_dummy (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_in_common (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
/* Duplicate attribute already checked for. */
attr->in_common = 1;
@@ -1252,35 +1247,35 @@ gfc_add_in_common (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_in_equivalence (symbol_attribute *attr, const char *name, locus *where)
{
/* Duplicate attribute already checked for. */
attr->in_equivalence = 1;
- if (check_conflict (attr, name, where) == FAILURE)
- return FAILURE;
+ if (!check_conflict (attr, name, where))
+ return false;
if (attr->flavor == FL_VARIABLE)
- return SUCCESS;
+ return true;
return gfc_add_flavor (attr, FL_VARIABLE, name, where);
}
-gfc_try
+bool
gfc_add_data (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
attr->data = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_in_namelist (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1289,29 +1284,29 @@ gfc_add_in_namelist (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_sequence (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
attr->sequence = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_elemental (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->elemental)
{
duplicate_attr ("ELEMENTAL", where);
- return FAILURE;
+ return false;
}
attr->elemental = 1;
@@ -1319,17 +1314,17 @@ gfc_add_elemental (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_pure (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->pure)
{
duplicate_attr ("PURE", where);
- return FAILURE;
+ return false;
}
attr->pure = 1;
@@ -1337,17 +1332,17 @@ gfc_add_pure (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_recursive (symbol_attribute *attr, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->recursive)
{
duplicate_attr ("RECURSIVE", where);
- return FAILURE;
+ return false;
}
attr->recursive = 1;
@@ -1355,17 +1350,17 @@ gfc_add_recursive (symbol_attribute *attr, locus *where)
}
-gfc_try
+bool
gfc_add_entry (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->entry)
{
duplicate_attr ("ENTRY", where);
- return FAILURE;
+ return false;
}
attr->entry = 1;
@@ -1373,60 +1368,60 @@ gfc_add_entry (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_function (symbol_attribute *attr, const char *name, locus *where)
{
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
- return FAILURE;
+ && !gfc_add_flavor (attr, FL_PROCEDURE, name, where))
+ return false;
attr->function = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_subroutine (symbol_attribute *attr, const char *name, locus *where)
{
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
- return FAILURE;
+ && !gfc_add_flavor (attr, FL_PROCEDURE, name, where))
+ return false;
attr->subroutine = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_generic (symbol_attribute *attr, const char *name, locus *where)
{
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
- return FAILURE;
+ && !gfc_add_flavor (attr, FL_PROCEDURE, name, where))
+ return false;
attr->generic = 1;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_proc (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
- return FAILURE;
+ && !gfc_add_flavor (attr, FL_PROCEDURE, name, where))
+ return false;
if (attr->procedure)
{
duplicate_attr ("PROCEDURE", where);
- return FAILURE;
+ return false;
}
attr->procedure = 1;
@@ -1435,24 +1430,24 @@ gfc_add_proc (symbol_attribute *attr, const char *name, locus *where)
}
-gfc_try
+bool
gfc_add_abstract (symbol_attribute* attr, locus* where)
{
if (attr->abstract)
{
duplicate_attr ("ABSTRACT", where);
- return FAILURE;
+ return false;
}
attr->abstract = 1;
- return SUCCESS;
+ return true;
}
/* Flavors are special because some flavors are not what Fortran
considers attributes and can be reaffirmed multiple times. */
-gfc_try
+bool
gfc_add_flavor (symbol_attribute *attr, sym_flavor f, const char *name,
locus *where)
{
@@ -1460,10 +1455,10 @@ gfc_add_flavor (symbol_attribute *attr, sym_flavor f, const char *name,
if ((f == FL_PROGRAM || f == FL_BLOCK_DATA || f == FL_MODULE
|| f == FL_PARAMETER || f == FL_LABEL || f == FL_DERIVED
|| f == FL_NAMELIST) && check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->flavor == f && f == FL_VARIABLE)
- return SUCCESS;
+ return true;
if (attr->flavor != FL_UNKNOWN)
{
@@ -1479,7 +1474,7 @@ gfc_add_flavor (symbol_attribute *attr, sym_flavor f, const char *name,
gfc_code2string (flavors, attr->flavor),
gfc_code2string (flavors, f), where);
- return FAILURE;
+ return false;
}
attr->flavor = f;
@@ -1488,17 +1483,17 @@ gfc_add_flavor (symbol_attribute *attr, sym_flavor f, const char *name,
}
-gfc_try
+bool
gfc_add_procedure (symbol_attribute *attr, procedure_type t,
const char *name, locus *where)
{
if (check_used (attr, name, where))
- return FAILURE;
+ return false;
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
- return FAILURE;
+ && !gfc_add_flavor (attr, FL_PROCEDURE, name, where))
+ return false;
if (where == NULL)
where = &gfc_current_locus;
@@ -1509,27 +1504,27 @@ gfc_add_procedure (symbol_attribute *attr, procedure_type t,
gfc_code2string (procedures, t), where,
gfc_code2string (procedures, attr->proc));
- return FAILURE;
+ return false;
}
attr->proc = t;
/* Statement functions are always scalar and functions. */
if (t == PROC_ST_FUNCTION
- && ((!attr->function && gfc_add_function (attr, name, where) == FAILURE)
+ && ((!attr->function && !gfc_add_function (attr, name, where))
|| attr->dimension))
- return FAILURE;
+ return false;
return check_conflict (attr, name, where);
}
-gfc_try
+bool
gfc_add_intent (symbol_attribute *attr, sym_intent intent, locus *where)
{
if (check_used (attr, NULL, where))
- return FAILURE;
+ return false;
if (attr->intent == INTENT_UNKNOWN)
{
@@ -1544,13 +1539,13 @@ gfc_add_intent (symbol_attribute *attr, sym_intent intent, locus *where)
gfc_intent_string (attr->intent),
gfc_intent_string (intent), where);
- return FAILURE;
+ return false;
}
/* No checks for use-association in public and private statements. */
-gfc_try
+bool
gfc_add_access (symbol_attribute *attr, gfc_access access,
const char *name, locus *where)
{
@@ -1566,13 +1561,13 @@ gfc_add_access (symbol_attribute *attr, gfc_access access,
where = &gfc_current_locus;
gfc_error ("ACCESS specification at %L was already specified", where);
- return FAILURE;
+ return false;
}
/* Set the is_bind_c field for the given symbol_attribute. */
-gfc_try
+bool
gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
int is_proc_lang_bind_spec)
{
@@ -1588,9 +1583,8 @@ gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
if (where == NULL)
where = &gfc_current_locus;
- if (gfc_notify_std (GFC_STD_F2003, "BIND(C) at %L", where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "BIND(C) at %L", where))
+ return false;
return check_conflict (attr, name, where);
}
@@ -1598,7 +1592,7 @@ gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
/* Set the extension field for the given symbol_attribute. */
-gfc_try
+bool
gfc_add_extension (symbol_attribute *attr, locus *where)
{
if (where == NULL)
@@ -1609,21 +1603,20 @@ gfc_add_extension (symbol_attribute *attr, locus *where)
else
attr->extension = 1;
- if (gfc_notify_std (GFC_STD_F2003, "EXTENDS at %L", where)
- == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_F2003, "EXTENDS at %L", where))
+ return false;
- return SUCCESS;
+ return true;
}
-gfc_try
+bool
gfc_add_explicit_interface (gfc_symbol *sym, ifsrc source,
gfc_formal_arglist * formal, locus *where)
{
if (check_used (&sym->attr, sym->name, where))
- return FAILURE;
+ return false;
if (where == NULL)
where = &gfc_current_locus;
@@ -1633,26 +1626,26 @@ gfc_add_explicit_interface (gfc_symbol *sym, ifsrc source,
{
gfc_error ("Symbol '%s' at %L already has an explicit interface",
sym->name, where);
- return FAILURE;
+ return false;
}
if (source == IFSRC_IFBODY && (sym->attr.dimension || sym->attr.allocatable))
{
gfc_error ("'%s' at %L has attributes specified outside its INTERFACE "
"body", sym->name, where);
- return FAILURE;
+ return false;
}
sym->formal = formal;
sym->attr.if_source = source;
- return SUCCESS;
+ return true;
}
/* Add a type to a symbol. */
-gfc_try
+bool
gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
{
sym_flavor flavor;
@@ -1678,14 +1671,14 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
else
gfc_error ("Symbol '%s' at %L already has basic type of %s", sym->name,
where, gfc_basic_typename (type));
- return FAILURE;
+ return false;
}
if (sym->attr.procedure && sym->ts.interface)
{
gfc_error ("Procedure '%s' at %L may not have basic type of %s",
sym->name, where, gfc_basic_typename (ts->type));
- return FAILURE;
+ return false;
}
flavor = sym->attr.flavor;
@@ -1696,11 +1689,11 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
|| flavor == FL_DERIVED || flavor == FL_NAMELIST)
{
gfc_error ("Symbol '%s' at %L cannot have a type", sym->name, where);
- return FAILURE;
+ return false;
}
sym->ts = *ts;
- return SUCCESS;
+ return true;
}
@@ -1716,12 +1709,12 @@ gfc_clear_attr (symbol_attribute *attr)
/* Check for missing attributes in the new symbol. Currently does
nothing, but it's not clear that it is unnecessary yet. */
-gfc_try
+bool
gfc_missing_attr (symbol_attribute *attr ATTRIBUTE_UNUSED,
locus *where ATTRIBUTE_UNUSED)
{
- return SUCCESS;
+ return true;
}
@@ -1729,7 +1722,7 @@ gfc_missing_attr (symbol_attribute *attr ATTRIBUTE_UNUSED,
attributes have a lot of side-effects but cannot be present given
where we are called from, so we ignore some bits. */
-gfc_try
+bool
gfc_copy_attr (symbol_attribute *dest, symbol_attribute *src, locus *where)
{
int is_proc_lang_bind_spec;
@@ -1738,105 +1731,104 @@ gfc_copy_attr (symbol_attribute *dest, symbol_attribute *src, locus *where)
them; cf. also PR 41034. */
dest->ext_attr |= src->ext_attr;
- if (src->allocatable && gfc_add_allocatable (dest, where) == FAILURE)
+ if (src->allocatable && !gfc_add_allocatable (dest, where))
goto fail;
- if (src->dimension && gfc_add_dimension (dest, NULL, where) == FAILURE)
+ if (src->dimension && !gfc_add_dimension (dest, NULL, where))
goto fail;
- if (src->codimension && gfc_add_codimension (dest, NULL, where) == FAILURE)
+ if (src->codimension && !gfc_add_codimension (dest, NULL, where))
goto fail;
- if (src->contiguous && gfc_add_contiguous (dest, NULL, where) == FAILURE)
+ if (src->contiguous && !gfc_add_contiguous (dest, NULL, where))
goto fail;
- if (src->optional && gfc_add_optional (dest, where) == FAILURE)
+ if (src->optional && !gfc_add_optional (dest, where))
goto fail;
- if (src->pointer && gfc_add_pointer (dest, where) == FAILURE)
+ if (src->pointer && !gfc_add_pointer (dest, where))
goto fail;
- if (src->is_protected && gfc_add_protected (dest, NULL, where) == FAILURE)
+ if (src->is_protected && !gfc_add_protected (dest, NULL, where))
goto fail;
- if (src->save && gfc_add_save (dest, src->save, NULL, where) == FAILURE)
+ if (src->save && !gfc_add_save (dest, src->save, NULL, where))
goto fail;
- if (src->value && gfc_add_value (dest, NULL, where) == FAILURE)
+ if (src->value && !gfc_add_value (dest, NULL, where))
goto fail;
- if (src->volatile_ && gfc_add_volatile (dest, NULL, where) == FAILURE)
+ if (src->volatile_ && !gfc_add_volatile (dest, NULL, where))
goto fail;
- if (src->asynchronous && gfc_add_asynchronous (dest, NULL, where) == FAILURE)
+ if (src->asynchronous && !gfc_add_asynchronous (dest, NULL, where))
goto fail;
if (src->threadprivate
- && gfc_add_threadprivate (dest, NULL, where) == FAILURE)
+ && !gfc_add_threadprivate (dest, NULL, where))
goto fail;
- if (src->target && gfc_add_target (dest, where) == FAILURE)
+ if (src->target && !gfc_add_target (dest, where))
goto fail;
- if (src->dummy && gfc_add_dummy (dest, NULL, where) == FAILURE)
+ if (src->dummy && !gfc_add_dummy (dest, NULL, where))
goto fail;
- if (src->result && gfc_add_result (dest, NULL, where) == FAILURE)
+ if (src->result && !gfc_add_result (dest, NULL, where))
goto fail;
if (src->entry)
dest->entry = 1;
- if (src->in_namelist && gfc_add_in_namelist (dest, NULL, where) == FAILURE)
+ if (src->in_namelist && !gfc_add_in_namelist (dest, NULL, where))
goto fail;
- if (src->in_common && gfc_add_in_common (dest, NULL, where) == FAILURE)
+ if (src->in_common && !gfc_add_in_common (dest, NULL, where))
goto fail;
- if (src->generic && gfc_add_generic (dest, NULL, where) == FAILURE)
+ if (src->generic && !gfc_add_generic (dest, NULL, where))
goto fail;
- if (src->function && gfc_add_function (dest, NULL, where) == FAILURE)
+ if (src->function && !gfc_add_function (dest, NULL, where))
goto fail;
- if (src->subroutine && gfc_add_subroutine (dest, NULL, where) == FAILURE)
+ if (src->subroutine && !gfc_add_subroutine (dest, NULL, where))
goto fail;
- if (src->sequence && gfc_add_sequence (dest, NULL, where) == FAILURE)
+ if (src->sequence && !gfc_add_sequence (dest, NULL, where))
goto fail;
- if (src->elemental && gfc_add_elemental (dest, where) == FAILURE)
+ if (src->elemental && !gfc_add_elemental (dest, where))
goto fail;
- if (src->pure && gfc_add_pure (dest, where) == FAILURE)
+ if (src->pure && !gfc_add_pure (dest, where))
goto fail;
- if (src->recursive && gfc_add_recursive (dest, where) == FAILURE)
+ if (src->recursive && !gfc_add_recursive (dest, where))
goto fail;
if (src->flavor != FL_UNKNOWN
- && gfc_add_flavor (dest, src->flavor, NULL, where) == FAILURE)
+ && !gfc_add_flavor (dest, src->flavor, NULL, where))
goto fail;
if (src->intent != INTENT_UNKNOWN
- && gfc_add_intent (dest, src->intent, where) == FAILURE)
+ && !gfc_add_intent (dest, src->intent, where))
goto fail;
if (src->access != ACCESS_UNKNOWN
- && gfc_add_access (dest, src->access, NULL, where) == FAILURE)
+ && !gfc_add_access (dest, src->access, NULL, where))
goto fail;
- if (gfc_missing_attr (dest, where) == FAILURE)
+ if (!gfc_missing_attr (dest, where))
goto fail;
- if (src->cray_pointer && gfc_add_cray_pointer (dest, where) == FAILURE)
+ if (src->cray_pointer && !gfc_add_cray_pointer (dest, where))
goto fail;
- if (src->cray_pointee && gfc_add_cray_pointee (dest, where) == FAILURE)
+ if (src->cray_pointee && !gfc_add_cray_pointee (dest, where))
goto fail;
is_proc_lang_bind_spec = (src->flavor == FL_PROCEDURE ? 1 : 0);
if (src->is_bind_c
- && gfc_add_is_bind_c (dest, NULL, where, is_proc_lang_bind_spec)
- != SUCCESS)
- return FAILURE;
+ && !gfc_add_is_bind_c (dest, NULL, where, is_proc_lang_bind_spec))
+ return false;
if (src->is_c_interop)
dest->is_c_interop = 1;
if (src->is_iso_c)
dest->is_iso_c = 1;
- if (src->external && gfc_add_external (dest, where) == FAILURE)
+ if (src->external && !gfc_add_external (dest, where))
goto fail;
- if (src->intrinsic && gfc_add_intrinsic (dest, where) == FAILURE)
+ if (src->intrinsic && !gfc_add_intrinsic (dest, where))
goto fail;
if (src->proc_pointer)
dest->proc_pointer = 1;
- return SUCCESS;
+ return true;
fail:
- return FAILURE;
+ return false;
}
@@ -1852,7 +1844,7 @@ fail:
already present. On success, the component pointer is modified to
point to the additional component structure. */
-gfc_try
+bool
gfc_add_component (gfc_symbol *sym, const char *name,
gfc_component **component)
{
@@ -1866,7 +1858,7 @@ gfc_add_component (gfc_symbol *sym, const char *name,
{
gfc_error ("Component '%s' at %C already declared at %L",
name, &p->loc);
- return FAILURE;
+ return false;
}
tail = p;
@@ -1877,7 +1869,7 @@ gfc_add_component (gfc_symbol *sym, const char *name,
{
gfc_error ("Component '%s' at %C already in the parent type "
"at %L", name, &sym->components->ts.u.derived->declared_at);
- return FAILURE;
+ return false;
}
/* Allocate a new component. */
@@ -1893,7 +1885,7 @@ gfc_add_component (gfc_symbol *sym, const char *name,
p->ts.type = BT_UNKNOWN;
*component = p;
- return SUCCESS;
+ return true;
}
@@ -2214,9 +2206,9 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type type, locus *label_locus)
lp->defined = type;
if (lp->referenced == ST_LABEL_DO_TARGET && type != ST_LABEL_DO_TARGET
- && gfc_notify_std (GFC_STD_F95_OBS, "DO termination statement "
- "which is not END DO or CONTINUE with label "
- "%d at %C", labelno) == FAILURE)
+ && !gfc_notify_std (GFC_STD_F95_OBS, "DO termination statement "
+ "which is not END DO or CONTINUE with "
+ "label %d at %C", labelno))
return;
break;
@@ -2230,18 +2222,18 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type type, locus *label_locus)
/* Reference a label. Given a label and its type, see if that
reference is consistent with what is known about that label,
- updating the unknown state. Returns FAILURE if something goes
+ updating the unknown state. Returns false if something goes
wrong. */
-gfc_try
+bool
gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type)
{
gfc_sl_type label_type;
int labelno;
- gfc_try rc;
+ bool rc;
if (lp == NULL)
- return SUCCESS;
+ return true;
labelno = lp->value;
@@ -2257,7 +2249,7 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type)
&& (type == ST_LABEL_TARGET || type == ST_LABEL_DO_TARGET))
{
gfc_error ("Label %d at %C previously used as a FORMAT label", labelno);
- rc = FAILURE;
+ rc = false;
goto done;
}
@@ -2266,18 +2258,18 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type)
&& type == ST_LABEL_FORMAT)
{
gfc_error ("Label %d at %C previously used as branch target", labelno);
- rc = FAILURE;
+ rc = false;
goto done;
}
if (lp->referenced == ST_LABEL_DO_TARGET && type == ST_LABEL_DO_TARGET
- && gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d "
- "at %C", labelno) == FAILURE)
- return FAILURE;
+ && !gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d "
+ "at %C", labelno))
+ return false;
if (lp->referenced != ST_LABEL_DO_TARGET)
lp->referenced = type;
- rc = SUCCESS;
+ rc = true;
done:
return rc;
@@ -3773,12 +3765,12 @@ get_iso_c_binding_dt (int sym_id)
for such. If an error occurs, the errors are reported here, allowing for
multiple errors to be handled for a single derived type. */
-gfc_try
+bool
verify_bind_c_derived_type (gfc_symbol *derived_sym)
{
gfc_component *curr_comp = NULL;
- gfc_try is_c_interop = FAILURE;
- gfc_try retval = SUCCESS;
+ bool is_c_interop = false;
+ bool retval = true;
if (derived_sym == NULL)
gfc_internal_error ("verify_bind_c_derived_type(): Given symbol is "
@@ -3787,7 +3779,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
/* If we've already looked at this derived symbol, do not look at it again
so we don't repeat warnings/errors. */
if (derived_sym->ts.is_c_interop)
- return SUCCESS;
+ return true;
/* The derived type must have the BIND attribute to be interoperable
J3/04-007, Section 15.2.3. */
@@ -3797,7 +3789,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
gfc_error_now ("Derived type '%s' declared at %L must have the BIND "
"attribute to be C interoperable", derived_sym->name,
&(derived_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
curr_comp = derived_sym->components;
@@ -3817,7 +3809,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
derived_sym->name, &(derived_sym->declared_at));
derived_sym->ts.is_c_interop = 1;
derived_sym->attr.is_bind_c = 1;
- return SUCCESS;
+ return true;
}
@@ -3838,7 +3830,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
"of the BIND(C) derived type '%s' at %L",
curr_comp->name, &(curr_comp->loc),
derived_sym->name, &(derived_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
if (curr_comp->attr.proc_pointer != 0)
@@ -3847,7 +3839,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
" of the BIND(C) derived type '%s' at %L", curr_comp->name,
&curr_comp->loc, derived_sym->name,
&derived_sym->declared_at);
- retval = FAILURE;
+ retval = false;
}
/* The components cannot be allocatable.
@@ -3859,7 +3851,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
"of the BIND(C) derived type '%s' at %L",
curr_comp->name, &(curr_comp->loc),
derived_sym->name, &(derived_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
/* BIND(C) derived types must have interoperable components. */
@@ -3878,7 +3870,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
/* Grab the typespec for the given component and test the kind. */
is_c_interop = gfc_verify_c_interop (&(curr_comp->ts));
- if (is_c_interop != SUCCESS)
+ if (!is_c_interop)
{
/* Report warning and continue since not fatal. The
draft does specify a constraint that requires all fields
@@ -3919,7 +3911,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
gfc_error ("Derived type '%s' at %L cannot be declared with both "
"PRIVATE and BIND(C) attributes", derived_sym->name,
&(derived_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
if (derived_sym->attr.sequence != 0)
@@ -3927,13 +3919,13 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
gfc_error ("Derived type '%s' at %L cannot have the SEQUENCE "
"attribute because it is BIND(C)", derived_sym->name,
&(derived_sym->declared_at));
- retval = FAILURE;
+ retval = false;
}
/* Mark the derived type as not being C interoperable if we found an
error. If there were only warnings, proceed with the assumption
it's interoperable. */
- if (retval == FAILURE)
+ if (!retval)
derived_sym->ts.is_c_interop = 0;
return retval;
@@ -3942,7 +3934,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
/* Generate symbols for the named constants c_null_ptr and c_null_funptr. */
-static gfc_try
+static bool
gen_special_c_interop_ptr (gfc_symbol *tmp_sym, gfc_symtree *dt_symtree)
{
gfc_constructor *c;
@@ -3971,7 +3963,7 @@ gen_special_c_interop_ptr (gfc_symbol *tmp_sym, gfc_symtree *dt_symtree)
c->expr = gfc_get_int_expr (gfc_index_integer_kind, NULL, 0);
c->expr->ts.is_iso_c = 1;
- return SUCCESS;
+ return true;
}
@@ -4292,13 +4284,11 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s,
tmp_sym->generic = intr;
if (!tmp_sym->attr.generic
- && gfc_add_generic (&tmp_sym->attr, tmp_sym->name, NULL)
- == FAILURE)
+ && !gfc_add_generic (&tmp_sym->attr, tmp_sym->name, NULL))
return NULL;
if (!tmp_sym->attr.function
- && gfc_add_function (&tmp_sym->attr, tmp_sym->name, NULL)
- == FAILURE)
+ && !gfc_add_function (&tmp_sym->attr, tmp_sym->name, NULL))
return NULL;
}
@@ -4375,34 +4365,33 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s,
/* Check that a symbol is already typed. If strict is not set, an untyped
symbol is acceptable for non-standard-conforming mode. */
-gfc_try
+bool
gfc_check_symbol_typed (gfc_symbol* sym, gfc_namespace* ns,
bool strict, locus where)
{
gcc_assert (sym);
if (gfc_matching_prefix)
- return SUCCESS;
+ return true;
/* Check for the type and try to give it an implicit one. */
if (sym->ts.type == BT_UNKNOWN
- && gfc_set_default_type (sym, 0, ns) == FAILURE)
+ && !gfc_set_default_type (sym, 0, ns))
{
if (strict)
{
gfc_error ("Symbol '%s' is used before it is typed at %L",
sym->name, &where);
- return FAILURE;
+ return false;
}
- if (gfc_notify_std (GFC_STD_GNU,
- "Symbol '%s' is used before"
- " it is typed at %L", sym->name, &where) == FAILURE)
- return FAILURE;
+ if (!gfc_notify_std (GFC_STD_GNU, "Symbol '%s' is used before"
+ " it is typed at %L", sym->name, &where))
+ return false;
}
/* Everything is ok. */
- return SUCCESS;
+ return true;
}
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 75fed2f651c..6cb85d48311 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -7321,7 +7321,7 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank,
allocate memory to the destination. */
gfc_init_block (&block);
- if (rank == 0)
+ if (!GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (dest)))
{
tmp = null_pointer_node;
tmp = fold_build2_loc (input_location, MODIFY_EXPR, type, dest, tmp);
@@ -7348,7 +7348,11 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank,
null_data = gfc_finish_block (&block);
gfc_init_block (&block);
- nelems = get_full_array_size (&block, src, rank);
+ if (rank)
+ nelems = get_full_array_size (&block, src, rank);
+ else
+ nelems = gfc_index_one_node;
+
tmp = fold_convert (gfc_array_index_type,
TYPE_SIZE_UNIT (gfc_get_element_type (type)));
size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
@@ -7374,7 +7378,7 @@ duplicate_allocatable (tree dest, tree src, tree type, int rank,
/* Null the destination if the source is null; otherwise do
the allocate and copy. */
- if (rank == 0)
+ if (!GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (src)))
null_cond = src;
else
null_cond = gfc_conv_descriptor_data_get (src);
@@ -7582,7 +7586,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
comp = fold_build3_loc (input_location, COMPONENT_REF,
TREE_TYPE (tmp), comp, tmp, NULL_TREE);
- if (GFC_DESCRIPTOR_TYPE_P(TREE_TYPE (comp)))
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (comp)))
tmp = gfc_trans_dealloc_allocated (comp,
CLASS_DATA (c)->attr.codimension);
else
@@ -7647,7 +7651,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
tmp = CLASS_DATA (c)->backend_decl;
comp = fold_build3_loc (input_location, COMPONENT_REF,
TREE_TYPE (tmp), comp, tmp, NULL_TREE);
- if (GFC_DESCRIPTOR_TYPE_P(TREE_TYPE (comp)))
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (comp)))
gfc_conv_descriptor_data_set (&fnblock, comp, null_pointer_node);
else
{
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index fafde89f37b..4c0b1da5af1 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -2146,7 +2146,7 @@ create_function_arglist (gfc_symbol * sym)
hence, the optional status cannot be transfered via a NULL pointer.
Thus, we will use a hidden argument in that case. */
else if (f->sym->attr.optional && f->sym->attr.value
- && !f->sym->attr.dimension && !f->sym->ts.type != BT_CLASS
+ && !f->sym->attr.dimension && f->sym->ts.type != BT_CLASS
&& f->sym->ts.type != BT_DERIVED)
{
tree tmp;
@@ -3649,7 +3649,37 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
NULL_TREE);
}
- if (sym->attr.dimension || sym->attr.codimension)
+ if (sym->ts.type == BT_CLASS
+ && (sym->attr.save || gfc_option.flag_max_stack_var_size == 0)
+ && CLASS_DATA (sym)->attr.allocatable)
+ {
+ tree vptr;
+
+ if (UNLIMITED_POLY (sym))
+ vptr = null_pointer_node;
+ else
+ {
+ gfc_symbol *vsym;
+ vsym = gfc_find_derived_vtab (sym->ts.u.derived);
+ vptr = gfc_get_symbol_decl (vsym);
+ vptr = gfc_build_addr_expr (NULL, vptr);
+ }
+
+ if (CLASS_DATA (sym)->attr.dimension
+ || (CLASS_DATA (sym)->attr.codimension
+ && gfc_option.coarray != GFC_FCOARRAY_LIB))
+ {
+ tmp = gfc_class_data_get (sym->backend_decl);
+ tmp = gfc_build_null_descriptor (TREE_TYPE (tmp));
+ }
+ else
+ tmp = null_pointer_node;
+
+ DECL_INITIAL (sym->backend_decl)
+ = gfc_class_set_static_fields (sym->backend_decl, vptr, tmp);
+ TREE_CONSTANT (DECL_INITIAL (sym->backend_decl)) = 1;
+ }
+ else if (sym->attr.dimension || sym->attr.codimension)
{
/* Assumed-size Cray pointees need to be treated as AS_EXPLICIT. */
array_type tmp = sym->as->type;
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 454755bddb7..de851a26c03 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -97,6 +97,24 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar, symbol_attribute attr)
tree
+gfc_class_set_static_fields (tree decl, tree vptr, tree data)
+{
+ tree tmp;
+ tree field;
+ vec<constructor_elt, va_gc> *init = NULL;
+
+ field = TYPE_FIELDS (TREE_TYPE (decl));
+ tmp = gfc_advance_chain (field, CLASS_DATA_FIELD);
+ CONSTRUCTOR_APPEND_ELT (init, tmp, data);
+
+ tmp = gfc_advance_chain (field, CLASS_VPTR_FIELD);
+ CONSTRUCTOR_APPEND_ELT (init, tmp, vptr);
+
+ return build_constructor (TREE_TYPE (decl), init);
+}
+
+
+tree
gfc_class_data_get (tree decl)
{
tree data;
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 9b2cc19509e..2a16059c4c5 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -2192,9 +2192,9 @@ gfc_conv_intrinsic_ttynam (gfc_se * se, gfc_expr * expr)
minmax (a1, a2, a3, ...)
{
mvar = a1;
- if (a2 .op. mvar || isnan(mvar))
+ if (a2 .op. mvar || isnan (mvar))
mvar = a2;
- if (a3 .op. mvar || isnan(mvar))
+ if (a3 .op. mvar || isnan (mvar))
mvar = a3;
...
return mvar
@@ -2749,7 +2749,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op,
if (norm2)
{
- /* if (x(i) != 0.0)
+ /* if (x (i) != 0.0)
{
absX = abs(x(i))
if (absX > scale)
@@ -3104,7 +3104,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op)
else
{
mpz_t asize;
- if (gfc_array_size (arrayexpr, &asize) == SUCCESS)
+ if (gfc_array_size (arrayexpr, &asize))
{
nonempty = gfc_conv_mpz_to_tree (asize, gfc_index_integer_kind);
mpz_clear (asize);
@@ -3594,7 +3594,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op)
else
{
mpz_t asize;
- if (gfc_array_size (arrayexpr, &asize) == SUCCESS)
+ if (gfc_array_size (arrayexpr, &asize))
{
nonempty = gfc_conv_mpz_to_tree (asize, gfc_index_integer_kind);
mpz_clear (asize);
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 988dea92f58..882927e639a 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -500,7 +500,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
tree decl, backend_decl, stmt, type, outer_decl;
locus old_loc = gfc_current_locus;
const char *iname;
- gfc_try t;
+ bool t;
decl = OMP_CLAUSE_DECL (c);
gfc_current_locus = where;
@@ -562,7 +562,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
ref->u.ar.type = AR_FULL;
ref->u.ar.dimen = 0;
t = gfc_resolve_expr (e1);
- gcc_assert (t == SUCCESS);
+ gcc_assert (t);
e2 = gfc_get_expr ();
e2->expr_type = EXPR_VARIABLE;
@@ -570,12 +570,12 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
e2->symtree = symtree2;
e2->ts = sym->ts;
t = gfc_resolve_expr (e2);
- gcc_assert (t == SUCCESS);
+ gcc_assert (t);
e3 = gfc_copy_expr (e1);
e3->symtree = symtree3;
t = gfc_resolve_expr (e3);
- gcc_assert (t == SUCCESS);
+ gcc_assert (t);
iname = NULL;
switch (OMP_CLAUSE_REDUCTION_CODE (c))
@@ -647,7 +647,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
e1 = gfc_copy_expr (e1);
e3 = gfc_copy_expr (e3);
t = gfc_resolve_expr (e4);
- gcc_assert (t == SUCCESS);
+ gcc_assert (t);
/* Create the init statement list. */
pushlevel ();
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 430b10e3760..1b65f2ca78b 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -2661,7 +2661,7 @@ check_forall_dependencies (gfc_code *c, stmtblock_t *pre, stmtblock_t *post)
return need_temp;
new_symtree = NULL;
- if (find_forall_index (c->expr1, lsym, 2) == SUCCESS)
+ if (find_forall_index (c->expr1, lsym, 2))
{
forall_make_variable_temp (c, pre, post);
need_temp = 0;
@@ -4757,21 +4757,21 @@ gfc_trans_where (gfc_code * code)
are the same. In short, this is VERY conservative and this
is needed because the two loops, required by the standard
are coalesced in gfc_trans_where_3. */
- if (!gfc_check_dependency(cblock->next->expr1,
+ if (!gfc_check_dependency (cblock->next->expr1,
cblock->expr1, 0)
- && !gfc_check_dependency(eblock->next->expr1,
+ && !gfc_check_dependency (eblock->next->expr1,
cblock->expr1, 0)
- && !gfc_check_dependency(cblock->next->expr1,
+ && !gfc_check_dependency (cblock->next->expr1,
eblock->next->expr2, 1)
- && !gfc_check_dependency(eblock->next->expr1,
+ && !gfc_check_dependency (eblock->next->expr1,
cblock->next->expr2, 1)
- && !gfc_check_dependency(cblock->next->expr1,
+ && !gfc_check_dependency (cblock->next->expr1,
cblock->next->expr2, 1)
- && !gfc_check_dependency(eblock->next->expr1,
+ && !gfc_check_dependency (eblock->next->expr1,
eblock->next->expr2, 1)
- && !gfc_check_dependency(cblock->next->expr1,
+ && !gfc_check_dependency (cblock->next->expr1,
eblock->next->expr1, 0)
- && !gfc_check_dependency(eblock->next->expr1,
+ && !gfc_check_dependency (eblock->next->expr1,
cblock->next->expr1, 0))
return gfc_trans_where_3 (cblock, eblock);
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 4f4c05840bc..379fe9463f0 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -132,7 +132,7 @@ int gfc_numeric_storage_size;
int gfc_character_storage_size;
-gfc_try
+bool
gfc_check_any_c_kind (gfc_typespec *ts)
{
int i;
@@ -144,10 +144,10 @@ gfc_check_any_c_kind (gfc_typespec *ts)
Fortran kind being used exists in at least some form for C. */
if (c_interop_kinds_table[i].f90_type == ts->type &&
c_interop_kinds_table[i].value == ts->kind)
- return SUCCESS;
+ return true;
}
- return FAILURE;
+ return false;
}
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 03adfddc543..ad6a1053a42 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -341,6 +341,7 @@ gfc_wrapped_block;
/* Class API functions. */
tree gfc_class_data_get (tree);
tree gfc_class_vptr_get (tree);
+tree gfc_class_set_static_fields (tree, tree, tree);
tree gfc_vtable_hash_get (tree);
tree gfc_vtable_size_get (tree);
tree gfc_vtable_extends_get (tree);
diff --git a/gcc/function.c b/gcc/function.c
index 0aa13760d88..d135c96e719 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -7003,9 +7003,8 @@ struct rtl_opt_pass pass_thread_prologue_and_epilogue =
0, /* properties_provided */
0, /* properties_destroyed */
TODO_verify_flow, /* todo_flags_start */
- TODO_df_verify |
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_verify | TODO_df_finish
+ | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 86077f8cf32..27072f00774 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -627,7 +627,7 @@ proper position among the other output files. */
&& defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
# define ASM_DEBUG_SPEC \
(PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \
- ? "%{!g0:%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}}" ASM_MAP \
+ ? "%{!g0:%{gdwarf*:--gdwarf2}%{!gdwarf*:%{g*:--gstabs}}}" ASM_MAP \
: "%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}}" ASM_MAP)
# else
# if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
@@ -1361,7 +1361,8 @@ init_gcc_specs (struct obstack *obstack, const char *shared_name,
"%{!static:%{!static-libgcc:"
#if USE_LD_AS_NEEDED
"%{!shared-libgcc:",
- static_name, " --as-needed ", shared_name, " --no-as-needed"
+ static_name, " " LD_AS_NEEDED_OPTION " ",
+ shared_name, " " LD_NO_AS_NEEDED_OPTION
"}"
"%{shared-libgcc:",
shared_name, "%{!shared: ", static_name, "}"
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
index 3f3d4554cbf..7f8e23109f8 100644
--- a/gcc/gcov-dump.c
+++ b/gcc/gcov-dump.c
@@ -38,6 +38,8 @@ static void tag_arcs (const char *, unsigned, unsigned);
static void tag_lines (const char *, unsigned, unsigned);
static void tag_counters (const char *, unsigned, unsigned);
static void tag_summary (const char *, unsigned, unsigned);
+static void dump_working_sets (const char *filename ATTRIBUTE_UNUSED,
+ const struct gcov_ctr_summary *summary);
extern int main (int, char **);
typedef struct tag_format
@@ -49,6 +51,7 @@ typedef struct tag_format
static int flag_dump_contents = 0;
static int flag_dump_positions = 0;
+static int flag_dump_working_sets = 0;
static const struct option options[] =
{
@@ -56,6 +59,7 @@ static const struct option options[] =
{ "version", no_argument, NULL, 'v' },
{ "long", no_argument, NULL, 'l' },
{ "positions", no_argument, NULL, 'o' },
+ { "working-sets", no_argument, NULL, 'w' },
{ 0, 0, 0, 0 }
};
@@ -93,7 +97,7 @@ main (int argc ATTRIBUTE_UNUSED, char **argv)
diagnostic_initialize (global_dc, 0);
- while ((opt = getopt_long (argc, argv, "hlpv", options, NULL)) != -1)
+ while ((opt = getopt_long (argc, argv, "hlpvw", options, NULL)) != -1)
{
switch (opt)
{
@@ -109,6 +113,9 @@ main (int argc ATTRIBUTE_UNUSED, char **argv)
case 'p':
flag_dump_positions = 1;
break;
+ case 'w':
+ flag_dump_working_sets = 1;
+ break;
default:
fprintf (stderr, "unknown flag `%c'\n", opt);
}
@@ -128,6 +135,7 @@ print_usage (void)
printf (" -v, --version Print version number\n");
printf (" -l, --long Dump record contents too\n");
printf (" -p, --positions Dump record positions\n");
+ printf (" -w, --working-sets Dump working set computed from summary\n");
}
static void
@@ -484,5 +492,39 @@ tag_summary (const char *filename ATTRIBUTE_UNUSED,
(HOST_WIDEST_INT)histo_bucket->min_value,
(HOST_WIDEST_INT)histo_bucket->cum_value);
}
+ if (flag_dump_working_sets)
+ dump_working_sets (filename, &summary.ctrs[ix]);
+ }
+}
+
+static void
+dump_working_sets (const char *filename ATTRIBUTE_UNUSED,
+ const struct gcov_ctr_summary *summary)
+{
+ gcov_working_set_t gcov_working_sets[NUM_GCOV_WORKING_SETS];
+ unsigned ws_ix, pctinc, pct;
+ gcov_working_set_t *ws_info;
+
+ compute_working_sets (summary, gcov_working_sets);
+
+ printf ("\n");
+ print_prefix (filename, 0, 0);
+ printf ("\t\tcounter working sets:");
+ /* Multiply the percentage by 100 to avoid float. */
+ pctinc = 100 * 100 / NUM_GCOV_WORKING_SETS;
+ for (ws_ix = 0, pct = pctinc; ws_ix < NUM_GCOV_WORKING_SETS;
+ ws_ix++, pct += pctinc)
+ {
+ if (ws_ix == NUM_GCOV_WORKING_SETS - 1)
+ pct = 9990;
+ ws_info = &gcov_working_sets[ws_ix];
+ /* Print out the percentage using int arithmatic to avoid float. */
+ printf ("\n");
+ print_prefix (filename, 0, 0);
+ printf ("\t\t%u.%02u%%: num counts=%u, min counter="
+ HOST_WIDEST_INT_PRINT_DEC,
+ pct / 100, pct - (pct / 100 * 100),
+ ws_info->num_counters,
+ (HOST_WIDEST_INT)ws_info->min_counter);
}
}
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 116cc03ac9f..441aad92833 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -837,3 +837,110 @@ static void gcov_histogram_merge (gcov_bucket_type *tgt_histo,
memcpy(tgt_histo, tmp_histo, sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE);
}
#endif /* !IN_GCOV */
+
+/* This is used by gcov-dump (IN_GCOV == -1) and in the compiler
+ (!IN_GCOV && !IN_LIBGCOV). */
+#if IN_GCOV <= 0 && !IN_LIBGCOV
+/* Compute the working set information from the counter histogram in
+ the profile summary. This is an array of information corresponding to a
+ range of percentages of the total execution count (sum_all), and includes
+ the number of counters required to cover that working set percentage and
+ the minimum counter value in that working set. */
+
+GCOV_LINKAGE void
+compute_working_sets (const struct gcov_ctr_summary *summary,
+ gcov_working_set_t *gcov_working_sets)
+{
+ gcov_type working_set_cum_values[NUM_GCOV_WORKING_SETS];
+ gcov_type ws_cum_hotness_incr;
+ gcov_type cum, tmp_cum;
+ const gcov_bucket_type *histo_bucket;
+ unsigned ws_ix, c_num, count;
+ int h_ix;
+
+ /* Compute the amount of sum_all that the cumulative hotness grows
+ by in each successive working set entry, which depends on the
+ number of working set entries. */
+ ws_cum_hotness_incr = summary->sum_all / NUM_GCOV_WORKING_SETS;
+
+ /* Next fill in an array of the cumulative hotness values corresponding
+ to each working set summary entry we are going to compute below.
+ Skip 0% statistics, which can be extrapolated from the
+ rest of the summary data. */
+ cum = ws_cum_hotness_incr;
+ for (ws_ix = 0; ws_ix < NUM_GCOV_WORKING_SETS;
+ ws_ix++, cum += ws_cum_hotness_incr)
+ working_set_cum_values[ws_ix] = cum;
+ /* The last summary entry is reserved for (roughly) 99.9% of the
+ working set. Divide by 1024 so it becomes a shift, which gives
+ almost exactly 99.9%. */
+ working_set_cum_values[NUM_GCOV_WORKING_SETS-1]
+ = summary->sum_all - summary->sum_all/1024;
+
+ /* Next, walk through the histogram in decending order of hotness
+ and compute the statistics for the working set summary array.
+ As histogram entries are accumulated, we check to see which
+ working set entries have had their expected cum_value reached
+ and fill them in, walking the working set entries in increasing
+ size of cum_value. */
+ ws_ix = 0; /* The current entry into the working set array. */
+ cum = 0; /* The current accumulated counter sum. */
+ count = 0; /* The current accumulated count of block counters. */
+ for (h_ix = GCOV_HISTOGRAM_SIZE - 1;
+ h_ix >= 0 && ws_ix < NUM_GCOV_WORKING_SETS; h_ix--)
+ {
+ histo_bucket = &summary->histogram[h_ix];
+
+ /* If we haven't reached the required cumulative counter value for
+ the current working set percentage, simply accumulate this histogram
+ entry into the running sums and continue to the next histogram
+ entry. */
+ if (cum + histo_bucket->cum_value < working_set_cum_values[ws_ix])
+ {
+ cum += histo_bucket->cum_value;
+ count += histo_bucket->num_counters;
+ continue;
+ }
+
+ /* If adding the current histogram entry's cumulative counter value
+ causes us to exceed the current working set size, then estimate
+ how many of this histogram entry's counter values are required to
+ reach the working set size, and fill in working set entries
+ as we reach their expected cumulative value. */
+ for (c_num = 0, tmp_cum = cum;
+ c_num < histo_bucket->num_counters && ws_ix < NUM_GCOV_WORKING_SETS;
+ c_num++)
+ {
+ count++;
+ /* If we haven't reached the last histogram entry counter, add
+ in the minimum value again. This will underestimate the
+ cumulative sum so far, because many of the counter values in this
+ entry may have been larger than the minimum. We could add in the
+ average value every time, but that would require an expensive
+ divide operation. */
+ if (c_num + 1 < histo_bucket->num_counters)
+ tmp_cum += histo_bucket->min_value;
+ /* If we have reached the last histogram entry counter, then add
+ in the entire cumulative value. */
+ else
+ tmp_cum = cum + histo_bucket->cum_value;
+
+ /* Next walk through successive working set entries and fill in
+ the statistics for any whose size we have reached by accumulating
+ this histogram counter. */
+ while (ws_ix < NUM_GCOV_WORKING_SETS
+ && tmp_cum >= working_set_cum_values[ws_ix])
+ {
+ gcov_working_sets[ws_ix].num_counters = count;
+ gcov_working_sets[ws_ix].min_counter
+ = histo_bucket->min_value;
+ ws_ix++;
+ }
+ }
+ /* Finally, update the running cumulative value since we were
+ using a temporary above. */
+ cum += histo_bucket->cum_value;
+ }
+ gcc_assert (ws_ix == NUM_GCOV_WORKING_SETS);
+}
+#endif /* IN_GCOV <= 0 && !IN_LIBGCOV */
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index 98efa76283d..08fe7b9240a 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -617,6 +617,28 @@ GCOV_LINKAGE gcov_position_t gcov_write_tag (gcov_unsigned_t);
GCOV_LINKAGE void gcov_write_length (gcov_position_t /*position*/);
#endif
+#if IN_GCOV <= 0 && !IN_LIBGCOV
+/* Available in gcov-dump and the compiler. */
+
+/* Number of data points in the working set summary array. Using 128
+ provides information for at least every 1% increment of the total
+ profile size. The last entry is hardwired to 99.9% of the total. */
+#define NUM_GCOV_WORKING_SETS 128
+
+/* Working set size statistics for a given percentage of the entire
+ profile (sum_all from the counter summary). */
+typedef struct gcov_working_set_info
+{
+ /* Number of hot counters included in this working set. */
+ unsigned num_counters;
+ /* Smallest counter included in this working set. */
+ gcov_type min_counter;
+} gcov_working_set_t;
+
+GCOV_LINKAGE void compute_working_sets (const struct gcov_ctr_summary *summary,
+ gcov_working_set_t *gcov_working_sets);
+#endif
+
#if IN_GCOV > 0
/* Available in gcov */
GCOV_LINKAGE time_t gcov_time (void);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index f421a3a7a07..e1daf18f8b0 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -4148,7 +4148,7 @@ struct rtl_opt_pass pass_rtl_pre =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
@@ -4169,7 +4169,7 @@ struct rtl_opt_pass pass_rtl_hoist =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in
index e2c7a8c4eb3..87abefc0456 100644
--- a/gcc/gdbinit.in
+++ b/gcc/gdbinit.in
@@ -166,7 +166,7 @@ including the global binding level.
end
define pbb
-set dump_bb ($, stderr, 0)
+set debug ($)
end
document pbb
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index f3e66d67aba..ddb086c5715 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -84,7 +84,6 @@ DEBUG_FUNCTION void
debug_gimple_stmt (gimple gs)
{
print_gimple_stmt (stderr, gs, 0, TDF_VOPS|TDF_MEMSYMS);
- fprintf (stderr, "\n");
}
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 873b8bcd7e9..57b343ab5cf 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -1829,16 +1829,20 @@ record_increment (slsr_cand_t c, double_int increment)
if (c->kind == CAND_ADD
&& c->index == increment
&& (increment.sgt (double_int_one)
- || increment.slt (double_int_minus_one)))
+ || increment.slt (double_int_minus_one))
+ && (gimple_assign_rhs_code (c->cand_stmt) == PLUS_EXPR
+ || gimple_assign_rhs_code (c->cand_stmt) == POINTER_PLUS_EXPR))
{
- tree t0;
+ tree t0 = NULL_TREE;
tree rhs1 = gimple_assign_rhs1 (c->cand_stmt);
tree rhs2 = gimple_assign_rhs2 (c->cand_stmt);
if (operand_equal_p (rhs1, c->base_expr, 0))
t0 = rhs2;
- else
+ else if (operand_equal_p (rhs2, c->base_expr, 0))
t0 = rhs1;
- if (SSA_NAME_DEF_STMT (t0) && gimple_bb (SSA_NAME_DEF_STMT (t0)))
+ if (t0
+ && SSA_NAME_DEF_STMT (t0)
+ && gimple_bb (SSA_NAME_DEF_STMT (t0)))
{
incr_vec[incr_vec_len].initializer = t0;
incr_vec[incr_vec_len++].init_bb
diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c
index cedacb6642c..a27f0d6d62f 100644
--- a/gcc/gimple-streamer-in.c
+++ b/gcc/gimple-streamer-in.c
@@ -329,8 +329,8 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
index = streamer_read_uhwi (ib);
bb = BASIC_BLOCK_FOR_FUNCTION (fn, index);
- bb->count = (streamer_read_gcov_count (ib) * count_materialization_scale
- + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ bb->count = apply_probability (streamer_read_gcov_count (ib),
+ count_materialization_scale);
bb->frequency = streamer_read_hwi (ib);
bb->flags = streamer_read_hwi (ib);
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 83288dfdbd4..0adeb7551a9 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2598,13 +2598,6 @@ is_gimple_constant (const_tree t)
case VECTOR_CST:
return true;
- /* Vector constant constructors are gimple invariant. */
- case CONSTRUCTOR:
- if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
- return TREE_CONSTANT (t);
- else
- return false;
-
default:
return false;
}
@@ -2968,7 +2961,11 @@ canonicalize_cond_expr_cond (tree t)
t = build2 (TREE_CODE (top0), TREE_TYPE (t),
TREE_OPERAND (top0, 0), TREE_OPERAND (top0, 1));
}
-
+ /* For x ^ y use x != y. */
+ else if (TREE_CODE (t) == BIT_XOR_EXPR)
+ t = build2 (NE_EXPR, TREE_TYPE (t),
+ TREE_OPERAND (t, 0), TREE_OPERAND (t, 1));
+
if (is_gimple_condexpr (t))
return t;
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index eeaf6fa3e23..53ba194014d 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4887,7 +4887,12 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
so handle it here. */
if (TREE_CLOBBER_P (*from_p))
{
- gcc_assert (!want_value && TREE_CODE (*to_p) == VAR_DECL);
+ ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_lvalue, fb_lvalue);
+ if (ret == GS_ERROR)
+ return ret;
+ gcc_assert (!want_value
+ && (TREE_CODE (*to_p) == VAR_DECL
+ || TREE_CODE (*to_p) == MEM_REF));
gimplify_seq_add_stmt (pre_p, gimple_build_assign (*to_p, *from_p));
*expr_p = NULL;
return GS_ALL_DONE;
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index c4591bfe35b..16094b231b2 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -8198,7 +8198,7 @@ sched_remove_insn (rtx insn)
change_queue_index (insn, QUEUE_NOWHERE);
current_sched_info->add_remove_insn (insn, 1);
- remove_insn (insn);
+ delete_insn (insn);
}
/* Clear priorities of all instructions, that are forward dependent on INSN.
diff --git a/gcc/hwint.c b/gcc/hwint.c
index 330b42c68e7..134fe1da2cc 100644
--- a/gcc/hwint.c
+++ b/gcc/hwint.c
@@ -204,3 +204,35 @@ least_common_multiple (HOST_WIDE_INT a, HOST_WIDE_INT b)
{
return mul_hwi (abs_hwi (a) / gcd (a, b), abs_hwi (b));
}
+
+#ifdef ENABLE_CHECKING
+/* Sign extend SRC starting from PREC. */
+
+HOST_WIDE_INT
+sext_hwi (HOST_WIDE_INT src, unsigned int prec)
+{
+ gcc_checking_assert (prec <= HOST_BITS_PER_WIDE_INT);
+
+ if (prec == HOST_BITS_PER_WIDE_INT)
+ return src;
+ else
+ {
+ int shift = HOST_BITS_PER_WIDE_INT - prec;
+ return (src << shift) >> shift;
+ }
+}
+
+/* Zero extend SRC starting from PREC. */
+
+unsigned HOST_WIDE_INT
+zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
+{
+ gcc_checking_assert (prec <= HOST_BITS_PER_WIDE_INT);
+
+ if (prec == HOST_BITS_PER_WIDE_INT)
+ return src;
+ else
+ return src & (((HOST_WIDE_INT)1 << prec) - 1);
+}
+
+#endif
diff --git a/gcc/hwint.h b/gcc/hwint.h
index da62fadcc9e..dbf023975cb 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -76,6 +76,40 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
# endif
#endif
+/* Print support for half a host wide int. */
+#define HOST_BITS_PER_HALF_WIDE_INT (HOST_BITS_PER_WIDE_INT / 2)
+#if HOST_BITS_PER_HALF_WIDE_INT == HOST_BITS_PER_LONG
+# define HOST_HALF_WIDE_INT long
+# define HOST_HALF_WIDE_INT_PRINT HOST_LONG_FORMAT
+# define HOST_HALF_WIDE_INT_PRINT_C "L"
+# define HOST_HALF_WIDE_INT_PRINT_DEC "%" HOST_HALF_WIDE_INT_PRINT "d"
+# define HOST_HALF_WIDE_INT_PRINT_DEC_C HOST_HALF_WIDE_INT_PRINT_DEC HOST_HALF_WIDE_INT_PRINT_C
+# define HOST_HALF_WIDE_INT_PRINT_UNSIGNED "%" HOST_HALF_WIDE_INT_PRINT "u"
+# define HOST_HALF_WIDE_INT_PRINT_HEX "%#" HOST_HALF_WIDE_INT_PRINT "x"
+# define HOST_HALF_WIDE_INT_PRINT_HEX_PURE "%" HOST_HALF_WIDE_INT_PRINT "x"
+#elif HOST_BITS_PER_HALF_WIDE_INT == HOST_BITS_PER_INT
+# define HOST_HALF_WIDE_INT int
+# define HOST_HALF_WIDE_INT_PRINT ""
+# define HOST_HALF_WIDE_INT_PRINT_C ""
+# define HOST_HALF_WIDE_INT_PRINT_DEC "%" HOST_HALF_WIDE_INT_PRINT "d"
+# define HOST_HALF_WIDE_INT_PRINT_DEC_C HOST_HALF_WIDE_INT_PRINT_DEC HOST_HALF_WIDE_INT_PRINT_C
+# define HOST_HALF_WIDE_INT_PRINT_UNSIGNED "%" HOST_HALF_WIDE_INT_PRINT "u"
+# define HOST_HALF_WIDE_INT_PRINT_HEX "%#" HOST_HALF_WIDE_INT_PRINT "x"
+# define HOST_HALF_WIDE_INT_PRINT_HEX_PURE "%" HOST_HALF_WIDE_INT_PRINT "x"
+#elif HOST_BITS_PER_HALF_WIDE_INT == HOST_BITS_PER_SHORT
+# define HOST_HALF_WIDE_INT short
+# define HOST_HALF_WIDE_INT_PRINT ""
+# define HOST_HALF_WIDE_INT_PRINT_C ""
+# define HOST_HALF_WIDE_INT_PRINT_DEC "%" HOST_HALF_WIDE_INT_PRINT "d"
+# define HOST_HALF_WIDE_INT_PRINT_DEC_C HOST_HALF_WIDE_INT_PRINT_DEC HOST_HALF_WIDE_INT_PRINT_C
+# define HOST_HALF_WIDE_INT_PRINT_UNSIGNED "%" HOST_HALF_WIDE_INT_PRINT "u"
+# define HOST_HALF_WIDE_INT_PRINT_HEX "%#" HOST_HALF_WIDE_INT_PRINT "x"
+# define HOST_HALF_WIDE_INT_PRINT_HEX_PURE "%" HOST_HALF_WIDE_INT_PRINT "x"
+#else
+#error Please add support for HOST_HALF_WIDE_INT
+#endif
+
+
#define HOST_WIDE_INT_1 HOST_WIDE_INT_C(1)
/* This is a magic identifier which allows GCC to figure out the type
@@ -93,9 +127,13 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__;
# if HOST_BITS_PER_WIDE_INT == 64
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX \
"0x%" HOST_LONG_FORMAT "x%016" HOST_LONG_FORMAT "x"
+# define HOST_WIDE_INT_PRINT_PADDED_HEX \
+ "%016" HOST_LONG_FORMAT "x"
# else
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX \
"0x%" HOST_LONG_FORMAT "x%08" HOST_LONG_FORMAT "x"
+# define HOST_WIDE_INT_PRINT_PADDED_HEX \
+ "%08" HOST_LONG_FORMAT "x"
# endif
#else
# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT
@@ -103,6 +141,8 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__;
/* We can assume that 'long long' is at least 64 bits. */
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX \
"0x%" HOST_LONG_LONG_FORMAT "x%016" HOST_LONG_LONG_FORMAT "x"
+# define HOST_WIDE_INT_PRINT_PADDED_HEX \
+ "%016" HOST_LONG_LONG_FORMAT "x"
#endif /* HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG */
#define HOST_WIDE_INT_PRINT_DEC "%" HOST_WIDE_INT_PRINT "d"
@@ -276,4 +316,36 @@ extern HOST_WIDE_INT pos_mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT);
extern HOST_WIDE_INT mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT);
extern HOST_WIDE_INT least_common_multiple (HOST_WIDE_INT, HOST_WIDE_INT);
+/* Sign extend SRC starting from PREC. */
+
+#ifdef ENABLE_CHECKING
+extern HOST_WIDE_INT sext_hwi (HOST_WIDE_INT, unsigned int);
+#else
+static inline HOST_WIDE_INT
+sext_hwi (HOST_WIDE_INT src, unsigned int prec)
+{
+ if (prec == HOST_BITS_PER_WIDE_INT)
+ return src;
+ else
+ {
+ int shift = HOST_BITS_PER_WIDE_INT - prec;
+ return (src << shift) >> shift;
+ }
+}
+#endif
+
+/* Zero extend SRC starting from PREC. */
+#ifdef ENABLE_CHECKING
+extern unsigned HOST_WIDE_INT zext_hwi (unsigned HOST_WIDE_INT, unsigned int);
+#else
+static inline unsigned HOST_WIDE_INT
+zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
+{
+ if (prec == HOST_BITS_PER_WIDE_INT)
+ return src;
+ else
+ return src & (((HOST_WIDE_INT)1 << prec) - 1);
+}
+#endif
+
#endif /* ! GCC_HWINT_H */
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index f081ecd3353..40575773b0d 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -964,6 +964,8 @@ end_ifcvt_sequence (struct noce_if_info *if_info)
set_used_flags (if_info->x);
set_used_flags (if_info->cond);
+ set_used_flags (if_info->a);
+ set_used_flags (if_info->b);
unshare_all_rtl_in_chain (seq);
end_sequence ();
@@ -3473,7 +3475,7 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
code processing. ??? we should fix this in the future. */
if (EDGE_COUNT (then_bb->succs) == 0)
{
- if (single_pred_p (else_bb))
+ if (single_pred_p (else_bb) && else_bb != EXIT_BLOCK_PTR)
{
rtx last_insn = BB_END (then_bb);
@@ -4514,8 +4516,7 @@ struct rtl_opt_pass pass_if_after_combine =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
@@ -4551,7 +4552,6 @@ struct rtl_opt_pass pass_if_after_reload =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index aac21ceb6fa..27aed3c368f 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -2572,14 +2572,16 @@ update_profiling_info (struct cgraph_node *orig_node,
for (cs = new_node->callees; cs ; cs = cs->next_callee)
if (cs->frequency)
- cs->count = cs->count * (new_sum * REG_BR_PROB_BASE
- / orig_node_count) / REG_BR_PROB_BASE;
+ cs->count = apply_probability (cs->count,
+ GCOV_COMPUTE_SCALE (new_sum,
+ orig_node_count));
else
cs->count = 0;
for (cs = orig_node->callees; cs ; cs = cs->next_callee)
- cs->count = cs->count * (remainder * REG_BR_PROB_BASE
- / orig_node_count) / REG_BR_PROB_BASE;
+ cs->count = apply_probability (cs->count,
+ GCOV_COMPUTE_SCALE (remainder,
+ orig_node_count));
if (dump_file)
dump_profile_updates (orig_node, new_node);
@@ -2611,14 +2613,17 @@ update_specialized_profile (struct cgraph_node *new_node,
for (cs = new_node->callees; cs ; cs = cs->next_callee)
if (cs->frequency)
- cs->count += cs->count * redirected_sum / new_node_count;
+ cs->count += apply_probability (cs->count,
+ GCOV_COMPUTE_SCALE (redirected_sum,
+ new_node_count));
else
cs->count = 0;
for (cs = orig_node->callees; cs ; cs = cs->next_callee)
{
- gcov_type dec = cs->count * (redirected_sum * REG_BR_PROB_BASE
- / orig_node_count) / REG_BR_PROB_BASE;
+ gcov_type dec = apply_probability (cs->count,
+ GCOV_COMPUTE_SCALE (redirected_sum,
+ orig_node_count));
if (dec < cs->count)
cs->count -= dec;
else
@@ -3655,7 +3660,7 @@ struct ipa_opt_pass_d pass_ipa_cp =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_symtab |
- TODO_remove_functions | TODO_ggc_collect /* todo_flags_finish */
+ TODO_remove_functions /* todo_flags_finish */
},
ipcp_generate_summary, /* generate_summary */
ipcp_write_summary, /* write_summary */
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 0a319710fe8..c2abe91a482 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -2096,8 +2096,7 @@ param_change_prob (gimple stmt, int i)
if (!init_freq)
init_freq = 1;
if (init_freq < bb->frequency)
- return MAX ((init_freq * REG_BR_PROB_BASE +
- bb->frequency / 2) / bb->frequency, 1);
+ return MAX (GCOV_COMPUTE_SCALE (init_freq, bb->frequency), 1);
else
return REG_BR_PROB_BASE;
}
@@ -2139,8 +2138,7 @@ param_change_prob (gimple stmt, int i)
BITMAP_FREE (info.bb_set);
if (max < bb->frequency)
- return MAX ((max * REG_BR_PROB_BASE +
- bb->frequency / 2) / bb->frequency, 1);
+ return MAX (GCOV_COMPUTE_SCALE (max, bb->frequency), 1);
else
return REG_BR_PROB_BASE;
}
@@ -2795,6 +2793,7 @@ estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time,
&& hints && cgraph_maybe_hot_edge_p (e))
*hints |= INLINE_HINT_indirect_call;
*size += call_size * INLINE_SIZE_SCALE;
+ /* Update to use apply_probability(). */
*time += call_time * prob / REG_BR_PROB_BASE
* e->frequency * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE);
if (*time > MAX_TIME * INLINE_TIME_SCALE)
@@ -2905,6 +2904,7 @@ estimate_node_size_and_time (struct cgraph_node *node,
inline_param_summary);
gcc_checking_assert (prob >= 0);
gcc_checking_assert (prob <= REG_BR_PROB_BASE);
+ /* Update to use apply_probability(). */
time += ((gcov_type) e->time * prob) / REG_BR_PROB_BASE;
}
if (time > MAX_TIME * INLINE_TIME_SCALE)
@@ -3123,8 +3123,7 @@ remap_edge_change_prob (struct cgraph_edge *inlined_edge,
int jf_formal_id = ipa_get_jf_pass_through_formal_id (jfunc);
int prob1 = es->param[i].change_prob;
int prob2 = inlined_es->param[jf_formal_id].change_prob;
- int prob = ((prob1 * prob2 + REG_BR_PROB_BASE / 2)
- / REG_BR_PROB_BASE);
+ int prob = combine_probabilities (prob1, prob2);
if (prob1 && prob2 && !prob)
prob = 1;
@@ -3315,6 +3314,7 @@ inline_merge_summary (struct cgraph_edge *edge)
int prob = predicate_probability (callee_info->conds,
&e->predicate,
clause, es->param);
+ /* Update to use apply_probability(). */
add_time = ((gcov_type) add_time * prob) / REG_BR_PROB_BASE;
if (add_time > MAX_TIME * INLINE_TIME_SCALE)
add_time = MAX_TIME * INLINE_TIME_SCALE;
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 63fcc9cd040..8c216a05e4d 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -272,7 +272,7 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
else if (avail <= AVAIL_OVERWRITABLE)
{
e->inline_failed = CIF_OVERWRITABLE;
- return false;
+ inlinable = false;
}
else if (e->call_stmt_cannot_inline_p)
{
@@ -2129,7 +2129,7 @@ struct ipa_opt_pass_d pass_ipa_inline =
0, /* properties_destroyed */
TODO_remove_functions, /* todo_flags_finish */
TODO_dump_symtab
- | TODO_remove_functions | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_remove_functions /* todo_flags_finish */
},
inline_generate_summary, /* generate_summary */
inline_write_summary, /* write_summary */
diff --git a/gcc/ipa.c b/gcc/ipa.c
index ba2c0776251..60788a40cef 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -574,7 +574,7 @@ cgraph_comdat_can_be_unshared_p (struct cgraph_node *node)
static bool
cgraph_externally_visible_p (struct cgraph_node *node,
- bool whole_program, bool aliased)
+ bool whole_program)
{
if (!node->local.finalized)
return false;
@@ -583,11 +583,6 @@ cgraph_externally_visible_p (struct cgraph_node *node,
|| DECL_EXTERNAL (node->symbol.decl)))
return false;
- /* 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;
-
/* Do not try to localize built-in functions yet. One of problems is that we
end up mangling their asm for WHOPR that makes it impossible to call them
using the implicit built-in declarations anymore. Similarly this enables
@@ -639,7 +634,7 @@ cgraph_externally_visible_p (struct cgraph_node *node,
/* Return true when variable VNODE should be considered externally visible. */
bool
-varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
+varpool_externally_visible_p (struct varpool_node *vnode)
{
/* Do not touch weakrefs; while they are not externally visible,
dropping their DECL_EXTERNAL flags confuse most
@@ -653,11 +648,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
if (!DECL_COMDAT (vnode->symbol.decl) && !TREE_PUBLIC (vnode->symbol.decl))
return false;
- /* 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 linker counts on us, we must preserve the function. */
if (symtab_used_from_object_file_p ((symtab_node) vnode))
return true;
@@ -734,42 +724,9 @@ 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_EACH_VEC_SAFE_ELT (alias_pairs, i, p)
- {
- 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
- && !DECL_EXTERNAL (node->symbol.decl))
- {
- if (!node->analyzed)
- continue;
- cgraph_mark_force_output_node (node);
- 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
- && !DECL_EXTERNAL (vnode->symbol.decl))
- {
- vnode->symbol.force_output = 1;
- 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");
- }
+ /* All aliases should be procssed at this point. */
+ gcc_checking_assert (!alias_pairs || !alias_pairs->length());
FOR_EACH_FUNCTION (node)
{
@@ -818,9 +775,7 @@ function_and_variable_visibility (bool whole_program)
&& !DECL_COMDAT (node->symbol.decl))
|| TREE_PUBLIC (node->symbol.decl)
|| DECL_EXTERNAL (node->symbol.decl));
- if (cgraph_externally_visible_p (node, whole_program,
- pointer_set_contains (aliased_nodes,
- node)))
+ if (cgraph_externally_visible_p (node, whole_program))
{
gcc_assert (!node->global.inlined_to);
node->symbol.externally_visible = true;
@@ -899,9 +854,7 @@ function_and_variable_visibility (bool whole_program)
{
if (!vnode->finalized)
continue;
- if (varpool_externally_visible_p
- (vnode,
- pointer_set_contains (aliased_vnodes, vnode)))
+ if (varpool_externally_visible_p (vnode))
vnode->symbol.externally_visible = true;
else
vnode->symbol.externally_visible = false;
@@ -914,8 +867,6 @@ function_and_variable_visibility (bool whole_program)
vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
}
}
- pointer_set_destroy (aliased_nodes);
- pointer_set_destroy (aliased_vnodes);
if (dump_file)
{
@@ -964,8 +915,7 @@ struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_remove_functions | TODO_dump_symtab
- | TODO_ggc_collect /* todo_flags_finish */
+ TODO_remove_functions | TODO_dump_symtab /* todo_flags_finish */
}
};
@@ -994,7 +944,7 @@ struct simple_ipa_opt_pass pass_ipa_free_inline_summary =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -1033,8 +983,7 @@ struct ipa_opt_pass_d pass_ipa_whole_program_visibility =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_remove_functions | TODO_dump_symtab
- | TODO_ggc_collect /* todo_flags_finish */
+ TODO_remove_functions | TODO_dump_symtab /* todo_flags_finish */
},
NULL, /* generate_summary */
NULL, /* write_summary */
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index d2806bdffbd..508394e2962 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1292,10 +1292,13 @@ scan_one_insn (rtx insn)
a memory requiring special instructions to load it, decreasing
mem_cost might result in it being loaded using the specialized
instruction into a register, then stored into stack and loaded
- again from the stack. See PR52208. */
+ again from the stack. See PR52208.
+
+ Don't do this if SET_SRC (set) has side effect. See PR56124. */
if (set != 0 && REG_P (SET_DEST (set)) && MEM_P (SET_SRC (set))
&& (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != NULL_RTX
- && ((MEM_P (XEXP (note, 0)))
+ && ((MEM_P (XEXP (note, 0))
+ && !side_effects_p (SET_SRC (set)))
|| (CONSTANT_P (XEXP (note, 0))
&& targetm.legitimate_constant_p (GET_MODE (SET_DEST (set)),
XEXP (note, 0))
diff --git a/gcc/ira.c b/gcc/ira.c
index b96b96fabbf..8c62b09a2e2 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4724,7 +4724,7 @@ struct rtl_opt_pass pass_ira =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0, /* todo_flags_finish */
+ TODO_do_not_ggc_collect /* todo_flags_finish */
}
};
@@ -4751,6 +4751,6 @@ struct rtl_opt_pass pass_reload =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 29db4eb2669..4f786b40cbd 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+2013-04-15 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * gcj.texi (Configure-time Options): Refer to GCC, not gcc.
+ (Resources): Adjust reference to Mauve.
+ Remove link to java.sun.com.
+ Refer to GCC, not gcc.
+
+2013-04-09 Richard Biener <rguenther@suse.de>
+
+ * expr.c (build_java_binop): Pass a type to build_int_cst.
+
2013-03-22 Kai Tietz <ktietz@redhat.com>
* lang.c (put_decl_node): Don't iterate over end_params_node.
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index b71d8a09eba..a434913d475 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1531,7 +1531,7 @@ build_java_binop (enum tree_code op, tree type, tree arg1, tree arg2)
}
case LSHIFT_EXPR:
case RSHIFT_EXPR:
- mask = build_int_cst (NULL_TREE,
+ mask = build_int_cst (int_type_node,
TYPE_PRECISION (TREE_TYPE (arg1)) - 1);
arg2 = fold_build2 (BIT_AND_EXPR, int_type_node, arg2, mask);
break;
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index eaeebc7db4a..efa24ea79b7 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -609,7 +609,7 @@ this because null pointer accesses are caught automatically by the
processor.
@item -fuse-atomic-builtins
-On some systems, gcc can generate code for built-in atomic operations.
+On some systems, GCC can generate code for built-in atomic operations.
Use this option to force gcj to use these builtins when compiling Java
code. Where this capability is present it should be automatically
detected, so you won't usually need to use this option.
@@ -2712,18 +2712,17 @@ While writing @command{gcj} and @code{libgcj} we have, of course, relied
heavily on documentation from Sun Microsystems. In particular we have
used The Java Language Specification (both first and second editions),
the Java Class Libraries (volumes one and two), and the Java Virtual
-Machine Specification. In addition we've used the online documentation
-at @uref{http://java.sun.com/}.
+Machine Specification. In addition we've used Sun's online documentation.
The current @command{gcj} home page is
@uref{http://gcc.gnu.org/java/}.
-For more information on gcc, see @uref{http://gcc.gnu.org/}.
+For more information on GCC, see @uref{http://gcc.gnu.org/}.
Some @code{libgcj} testing is done using the Mauve test suite. This is
a free software Java class library test suite which is being written
because the JCK is not free. See
-@uref{http://sources.redhat.com/mauve/} for more information.
+@uref{http://www.sourceware.org/mauve/} for more information.
@node Index
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 1e53465f9e1..2850d1e177b 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -452,14 +452,14 @@ lhd_print_error_function (diagnostic_context *context, const char *file,
{
if (context->show_column)
pp_printf (context->printer,
- _(" inlined from %qs at %s:%d:%d"),
+ _(" inlined from %qs at %r%s:%d:%d%R"),
identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2)),
- s.file, s.line, s.column);
+ "locus", s.file, s.line, s.column);
else
pp_printf (context->printer,
- _(" inlined from %qs at %s:%d"),
+ _(" inlined from %qs at %r%s:%d%R"),
identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 2)),
- s.file, s.line);
+ "locus", s.file, s.line);
}
else
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index f75493817bb..92d621e273c 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -318,7 +318,7 @@ struct rtl_opt_pass pass_loop2 =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c
index 6a12952cc99..e5f1bdc190b 100644
--- a/gcc/loop-unswitch.c
+++ b/gcc/loop-unswitch.c
@@ -436,9 +436,11 @@ unswitch_loop (struct loop *loop, basic_block unswitch_on, rtx cond, rtx cinsn)
emit_insn_after (seq, BB_END (switch_bb));
e = make_edge (switch_bb, true_edge->dest, 0);
e->probability = prob;
+ /* Update to use apply_probability(). */
e->count = latch_edge->count * prob / REG_BR_PROB_BASE;
e = make_edge (switch_bb, FALLTHRU_EDGE (unswitch_on)->dest, EDGE_FALLTHRU);
e->probability = false_edge->probability;
+ /* Update to use apply_probability(). */
e->count = latch_edge->count * (false_edge->probability) / REG_BR_PROB_BASE;
if (irred_flag)
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 05927e13b08..5b5b03fb0bd 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1699,7 +1699,6 @@ struct rtl_opt_pass pass_lower_subreg =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect |
TODO_verify_flow /* todo_flags_finish */
}
};
@@ -1721,7 +1720,6 @@ struct rtl_opt_pass pass_lower_subreg2 =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect |
TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c
index 163ca11509d..60e51eec0c5 100644
--- a/gcc/lra-spills.c
+++ b/gcc/lra-spills.c
@@ -639,7 +639,7 @@ lra_final_code_change (void)
need them anymore and don't want to waste compiler
time processing them in a few subsequent passes. */
lra_invalidate_insn_data (insn);
- remove_insn (insn);
+ delete_insn (insn);
continue;
}
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index c619197d5dd..69f5e3a659f 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -1343,14 +1343,14 @@ merge_profile_summaries (struct lto_file_decl_data **file_data_vec)
for (j = 0; (file_data = file_data_vec[j]) != NULL; j++)
if (file_data->profile_info.runs)
{
- int scale = RDIV (REG_BR_PROB_BASE * max_runs,
- file_data->profile_info.runs);
- lto_gcov_summary.sum_max = MAX (lto_gcov_summary.sum_max,
- RDIV (file_data->profile_info.sum_max
- * scale, REG_BR_PROB_BASE));
- lto_gcov_summary.sum_all = MAX (lto_gcov_summary.sum_all,
- RDIV (file_data->profile_info.sum_all
- * scale, REG_BR_PROB_BASE));
+ int scale = GCOV_COMPUTE_SCALE (max_runs,
+ file_data->profile_info.runs);
+ lto_gcov_summary.sum_max
+ = MAX (lto_gcov_summary.sum_max,
+ apply_probability (file_data->profile_info.sum_max, scale));
+ lto_gcov_summary.sum_all
+ = MAX (lto_gcov_summary.sum_all,
+ apply_probability (file_data->profile_info.sum_all, scale));
/* Save a pointer to the profile_info with the largest
scaled sum_all and the scale for use in merging the
histogram. */
@@ -1371,8 +1371,9 @@ merge_profile_summaries (struct lto_file_decl_data **file_data_vec)
{
/* Scale up the min value as we did the corresponding sum_all
above. Use that to find the new histogram index. */
- gcov_type scaled_min = RDIV (saved_profile_info->histogram[h_ix].min_value
- * saved_scale, REG_BR_PROB_BASE);
+ gcov_type scaled_min
+ = apply_probability (saved_profile_info->histogram[h_ix].min_value,
+ saved_scale);
/* The new index may be shared with another scaled histogram entry,
so we need to account for a non-zero histogram entry at new_ix. */
unsigned new_ix = gcov_histo_index (scaled_min);
@@ -1385,8 +1386,8 @@ merge_profile_summaries (struct lto_file_decl_data **file_data_vec)
here and place the scaled cumulative counter value in the bucket
corresponding to the scaled minimum counter value. */
lto_gcov_summary.histogram[new_ix].cum_value
- += RDIV (saved_profile_info->histogram[h_ix].cum_value
- * saved_scale, REG_BR_PROB_BASE);
+ += apply_probability (saved_profile_info->histogram[h_ix].cum_value,
+ saved_scale);
lto_gcov_summary.histogram[new_ix].num_counters
+= saved_profile_info->histogram[h_ix].num_counters;
}
@@ -1418,8 +1419,8 @@ merge_profile_summaries (struct lto_file_decl_data **file_data_vec)
if (scale == REG_BR_PROB_BASE)
continue;
for (edge = node->callees; edge; edge = edge->next_callee)
- edge->count = RDIV (edge->count * scale, REG_BR_PROB_BASE);
- node->count = RDIV (node->count * scale, REG_BR_PROB_BASE);
+ edge->count = apply_probability (edge->count, scale);
+ node->count = apply_probability (node->count, scale);
}
}
@@ -1466,7 +1467,7 @@ input_symtab (void)
}
merge_profile_summaries (file_data_vec);
- compute_working_sets ();
+ get_working_sets ();
/* Clear out the aux field that was used to store enough state to
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 0e128fddd78..982d3574ee8 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -622,8 +622,8 @@ input_cfg (struct lto_input_block *ib, struct function *fn,
dest_index = streamer_read_uhwi (ib);
probability = (int) streamer_read_hwi (ib);
- count = ((gcov_type) streamer_read_gcov_count (ib) * count_materialization_scale
- + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ count = apply_probability ((gcov_type) streamer_read_gcov_count (ib),
+ count_materialization_scale);
edge_flags = streamer_read_uhwi (ib);
dest = BASIC_BLOCK_FOR_FUNCTION (fn, dest_index);
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 1273b2b701c..6ce79a96f6e 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -3369,7 +3369,6 @@ struct rtl_opt_pass pass_sms =
0, /* todo_flags_start */
TODO_df_finish
| TODO_verify_flow
- | TODO_verify_rtl_sharing
- | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index ef5757d5bc6..c80a5c31b10 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3926,8 +3926,10 @@ expand_omp_for_generic (struct omp_region *region,
if (POINTER_TYPE_P (type))
t = fold_convert (signed_type_for (type), t);
t = fold_convert (type, t);
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- false, GSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (fd->loop.v)
+ && TREE_ADDRESSABLE (fd->loop.v),
+ NULL_TREE, false, GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loop.v, t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
@@ -3958,8 +3960,11 @@ expand_omp_for_generic (struct omp_region *region,
t = fold_build_pointer_plus (fd->loops[i].n1, t);
else
t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t);
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- false, GSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (fd->loops[i].v)
+ && TREE_ADDRESSABLE (fd->loops[i].v),
+ NULL_TREE, false,
+ GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loops[i].v, t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
if (i != 0)
@@ -3987,12 +3992,15 @@ expand_omp_for_generic (struct omp_region *region,
t = fold_build_pointer_plus (vmain, fd->loop.step);
else
t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- true, GSI_SAME_STMT);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (vback) && TREE_ADDRESSABLE (vback),
+ NULL_TREE, true, GSI_SAME_STMT);
stmt = gimple_build_assign (vback, t);
gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
- t = build2 (fd->loop.cond_code, boolean_type_node, vback, iend);
+ t = build2 (fd->loop.cond_code, boolean_type_node,
+ DECL_P (vback) && TREE_ADDRESSABLE (vback) ? t : vback,
+ iend);
stmt = gimple_build_cond_empty (t);
gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
@@ -4017,8 +4025,12 @@ expand_omp_for_generic (struct omp_region *region,
e->probability = REG_BR_PROB_BASE / 8;
t = fd->loops[i + 1].n1;
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- false, GSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (fd->loops[i + 1].v)
+ && TREE_ADDRESSABLE
+ (fd->loops[i + 1].v),
+ NULL_TREE, false,
+ GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loops[i + 1].v, t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
}
@@ -4032,8 +4044,11 @@ expand_omp_for_generic (struct omp_region *region,
else
t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v,
fd->loops[i].step);
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- false, GSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (fd->loops[i].v)
+ && TREE_ADDRESSABLE (fd->loops[i].v),
+ NULL_TREE, false,
+ GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loops[i].v, t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
@@ -4042,8 +4057,12 @@ expand_omp_for_generic (struct omp_region *region,
t = fd->loops[i].n2;
t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
+ tree v = fd->loops[i].v;
+ if (DECL_P (v) && TREE_ADDRESSABLE (v))
+ v = force_gimple_operand_gsi (&gsi, v, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
t = fold_build2 (fd->loops[i].cond_code, boolean_type_node,
- fd->loops[i].v, t);
+ v, t);
stmt = gimple_build_cond_empty (t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
e = make_edge (bb, l1_bb, EDGE_TRUE_VALUE);
@@ -4279,8 +4298,10 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- false, GSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (fd->loop.v)
+ && TREE_ADDRESSABLE (fd->loop.v),
+ NULL_TREE, false, GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loop.v, t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
@@ -4305,12 +4326,14 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_build_pointer_plus (vmain, fd->loop.step);
else
t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
- t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
- true, GSI_SAME_STMT);
+ t = force_gimple_operand_gsi (&gsi, t,
+ DECL_P (vback) && TREE_ADDRESSABLE (vback),
+ NULL_TREE, true, GSI_SAME_STMT);
stmt = gimple_build_assign (vback, t);
gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
- t = build2 (fd->loop.cond_code, boolean_type_node, vback, e);
+ t = build2 (fd->loop.cond_code, boolean_type_node,
+ DECL_P (vback) && TREE_ADDRESSABLE (vback) ? t : vback, e);
gsi_insert_before (&gsi, gimple_build_cond_empty (t), GSI_SAME_STMT);
/* Remove the GIMPLE_OMP_CONTINUE statement. */
@@ -4510,8 +4533,10 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_build_pointer_plus (fd->loop.n1, t);
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- t = force_gimple_operand_gsi (&si, t, false, NULL_TREE,
- false, GSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&si, t,
+ DECL_P (fd->loop.v)
+ && TREE_ADDRESSABLE (fd->loop.v),
+ NULL_TREE, false, GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loop.v, t);
gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING);
@@ -4536,10 +4561,15 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_build_pointer_plus (v_main, fd->loop.step);
else
t = fold_build2 (PLUS_EXPR, type, v_main, fd->loop.step);
+ if (DECL_P (v_back) && TREE_ADDRESSABLE (v_back))
+ t = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
stmt = gimple_build_assign (v_back, t);
gsi_insert_before (&si, stmt, GSI_SAME_STMT);
- t = build2 (fd->loop.cond_code, boolean_type_node, v_back, e);
+ t = build2 (fd->loop.cond_code, boolean_type_node,
+ DECL_P (v_back) && TREE_ADDRESSABLE (v_back)
+ ? t : v_back, e);
gsi_insert_before (&si, gimple_build_cond_empty (t), GSI_SAME_STMT);
/* Remove GIMPLE_OMP_CONTINUE. */
diff --git a/gcc/opts.c b/gcc/opts.c
index 45b12fecb8e..6856c3c8090 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "params.h"
#include "diagnostic.h"
+#include "diagnostic-color.h"
#include "opts-diagnostic.h"
#include "insn-attr-common.h"
#include "common/common-target.h"
@@ -1497,6 +1498,11 @@ common_handle_option (struct gcc_options *opts,
dc->show_caret = value;
break;
+ case OPT_fdiagnostics_color_:
+ pp_show_color (dc->printer)
+ = colorize_init ((diagnostic_color_rule_t) value);
+ break;
+
case OPT_fdiagnostics_show_option:
dc->show_option_requested = value;
break;
@@ -1699,6 +1705,18 @@ common_handle_option (struct gcc_options *opts,
set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc);
break;
+ case OPT_gdwarf:
+ if (arg && strlen (arg) != 0)
+ {
+ error_at (loc, "%<-gdwarf%s%> is ambiguous; "
+ "use %<-gdwarf-%s%> for DWARF version "
+ "or %<-gdwarf -g%s%> for debug level", arg, arg, arg);
+ break;
+ }
+ else
+ value = opts->x_dwarf_version;
+
+ /* FALLTHRU */
case OPT_gdwarf_:
if (value < 2 || value > 4)
error_at (loc, "dwarf version %d is not supported", value);
diff --git a/gcc/params.def b/gcc/params.def
index a25b8bce1dd..3c5265160c6 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -376,7 +376,7 @@ DEFPARAM(HOT_BB_FREQUENCY_FRACTION,
DEFPARAM (PARAM_ALIGN_THRESHOLD,
"align-threshold",
"Select fraction of the maximal frequency of executions of basic block in function given basic block get alignment",
- 100, 0, 0)
+ 100, 1, 0)
DEFPARAM (PARAM_ALIGN_LOOP_ITERATIONS,
"align-loop-iterations",
@@ -433,7 +433,7 @@ DEFPARAM(PARAM_MAX_CROSSJUMP_EDGES,
DEFPARAM(PARAM_MIN_CROSSJUMP_INSNS,
"min-crossjump-insns",
"The minimum number of matching instructions to consider for crossjumping",
- 5, 0, 0)
+ 5, 1, 0)
/* The maximum number expansion factor when copying basic blocks. */
DEFPARAM(PARAM_MAX_GROW_COPY_BB_INSNS,
@@ -451,7 +451,7 @@ DEFPARAM(PARAM_MAX_GOTO_DUPLICATION_INSNS,
DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH,
"max-cse-path-length",
"The maximum length of path considered in cse",
- 10, 0, 0)
+ 10, 1, 0)
DEFPARAM(PARAM_MAX_CSE_INSNS,
"max-cse-insns",
"The maximum instructions CSE process before flushing",
diff --git a/gcc/passes.c b/gcc/passes.c
index f07eaa83a00..e76acf94821 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -406,7 +406,7 @@ static struct rtl_opt_pass pass_rest_of_compilation =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -432,7 +432,7 @@ static struct rtl_opt_pass pass_postreload =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect | TODO_verify_rtl_sharing /* todo_flags_finish */
+ TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
@@ -2013,9 +2013,6 @@ execute_todo (unsigned int flags)
fflush (dump_file);
}
- if (flags & TODO_ggc_collect)
- ggc_collect ();
-
/* Now that the dumping has been done, we can get rid of the optional
df problems. */
if (flags & TODO_df_finish)
@@ -2187,6 +2184,10 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
pass_fini_dump_file (pass);
current_pass = NULL;
+
+ /* Signal this is a suitable GC collection point. */
+ if (!(todo_after & TODO_do_not_ggc_collect))
+ ggc_collect ();
}
/* For the current function, execute all ipa transforms. */
@@ -2364,6 +2365,10 @@ execute_one_pass (struct opt_pass *pass)
current_pass = NULL;
+ /* Signal this is a suitable GC collection point. */
+ if (!((todo_after | pass->todo_flags_finish) & TODO_do_not_ggc_collect))
+ ggc_collect ();
+
return true;
}
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 64fe2fcf28f..4da31ef8010 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-02 Joseph Myers <joseph@codesourcery.com>
+
+ * de.po: Update.
+
2013-03-31 Joseph Myers <joseph@codesourcery.com>
* de.po: Update.
diff --git a/gcc/po/de.po b/gcc/po/de.po
index c286e2c3b0d..5ef66443e4d 100644
--- a/gcc/po/de.po
+++ b/gcc/po/de.po
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: gcc 4.8.0\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2013-03-15 17:42+0000\n"
-"PO-Revision-Date: 2013-03-29 12:08+0200\n"
+"PO-Revision-Date: 2013-04-01 12:08+0200\n"
"Last-Translator: Roland Stigge <stigge@antcom.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"Language: de\n"
@@ -28888,14 +28888,14 @@ msgid "%<constexpr%> cannot be used for type declarations"
msgstr "%<constexpr%> kann nicht für Typdeklarationen verwendet werden"
#: cp/decl.c:4321
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "attribute ignored in explicit instantiation %q#T"
-msgstr "Attribute an Templateinstanziierung ignoriert"
+msgstr "Attribut in expliter Instanziierung %q#T ignoriert"
#: cp/decl.c:4324
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no attribute can be applied to an explicit instantiation"
-msgstr "Attribut %qE kann nur auf Klassendefinitionen angewendet werden"
+msgstr "auf explizite Instanziierung kann kein Attribut angewendet werden"
#: cp/decl.c:4396
#, gcc-internal-format
@@ -29067,9 +29067,9 @@ msgid "%qT has no non-static data member named %qD"
msgstr "%qT hat kein nicht-statisches Datenelement namens %qD"
#: cp/decl.c:5226
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid initializer for %q#D"
-msgstr "ungültige Initialisierung für Feldelement %q#D"
+msgstr "ungültige Initialisierung für %q#D"
#: cp/decl.c:5256
#, gcc-internal-format
@@ -29175,17 +29175,17 @@ msgstr "Funktion %q#D ist wie eine Variable initialisiert"
#: cp/decl.c:6886
#, gcc-internal-format
msgid "non-local variable %qD declared %<__thread%> needs dynamic initialization"
-msgstr ""
+msgstr "nicht-lokale %<__thread%>-Variable %qD erfordert dynamische Initialisierung"
#: cp/decl.c:6889
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-local variable %qD declared %<__thread%> has a non-trivial destructor"
-msgstr " %q+T hat einen nicht-trivialen Destruktor"
+msgstr "nicht-lokale %<__thread%>-Variable %qD hat einen nicht-trivialen Destruktor"
#: cp/decl.c:6895
#, gcc-internal-format
msgid "C++11 %<thread_local%> allows dynamic initialization and destruction"
-msgstr ""
+msgstr "%<thread_local%> in C++11 erlaubt dynamische Initialisierung und Zerstörung"
#: cp/decl.c:7122
#, gcc-internal-format
@@ -29813,9 +29813,9 @@ msgid "%qs declared as function returning an array"
msgstr "%qs als Funktion, die ein Feld zurückgibt, deklariert"
#: cp/decl.c:9434
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs declared as function returning an abstract class type"
-msgstr "%qs als Funktion, die ein Feld zurückgibt, deklariert"
+msgstr "Funktion %qs gibt abstrakten Klassentyp zurück"
#: cp/decl.c:9463
#, gcc-internal-format
@@ -30179,9 +30179,9 @@ msgid "storage class %<__thread%> invalid for function %qs"
msgstr "Speicherklasse %<__thread%> ungültig für Funktion %qs"
#: cp/decl.c:10592
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "storage class %<thread_local%> invalid for function %qs"
-msgstr "Speicherklasse %<__thread%> ungültig für Funktion %qs"
+msgstr "Speicherklasse %<thread_local%> ungültig für Funktion %qs"
#: cp/decl.c:10597
#, gcc-internal-format
@@ -30618,14 +30618,14 @@ msgid "parameter %qD declared void"
msgstr "Parameter %qD leer definiert"
#: cp/decl.c:13772
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no return statements in function returning %qT"
-msgstr "keine return-Anweisung in nicht void zurückgebender Funktion"
+msgstr "keine return-Anweisungen in %qT zurückgebender Funktion"
#: cp/decl.c:13774 cp/typeck.c:8135
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "only plain %<auto%> return type can be deduced to %<void%>"
-msgstr "Funktionsrückgabetypen nicht kompatibel wegen %<volatile%>"
+msgstr "nur einfacher Rückgabetyp %<auto%> kann zu %<void%> hergeleitet werden"
#: cp/decl.c:13870
#, gcc-internal-format
@@ -30658,9 +30658,9 @@ msgid "invalid types %<%T[%T]%> for array subscript"
msgstr "ungültige Typen %<%T[%T]%> für Feldindex"
#: cp/decl2.c:439
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "deleting array %q#E"
-msgstr "Feld %q#D wird gelöscht"
+msgstr "Feld %q#E wird gelöscht"
#: cp/decl2.c:445
#, gcc-internal-format
@@ -30869,9 +30869,9 @@ msgid "use of deleted function %qD"
msgstr "gelöschte Funktion %qD wird verwendet"
#: cp/decl2.c:4537 cp/decl2.c:4594
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of %qD before deduction of %<auto%>"
-msgstr "Typ von %qD ist auf %<int%> voreingestellt"
+msgstr "Verwendung von %qD vor Herleitung von %<auto%>"
#: cp/error.c:3331
#, gcc-internal-format
@@ -30934,14 +30934,14 @@ msgid "delegating constructors only available with -std=c++11 or -std=gnu++11"
msgstr "delegierende Konstruktoren nur mit -std=c++11 oder -std=gnu++11 verfügbar"
#: cp/error.c:3389
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "inheriting constructors only available with -std=c++11 or -std=gnu++11"
-msgstr "delegierende Konstruktoren nur mit -std=c++11 oder -std=gnu++11 verfügbar"
+msgstr "erbende Konstruktoren nur mit -std=c++11 oder -std=gnu++11 verfügbar"
#: cp/error.c:3394
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "c++11 attributes only available with -std=c++11 or -std=gnu++11"
-msgstr "C++0x »auto« nur mit -std=c++11 oder -std=gnu++11 verfügbar"
+msgstr "C++11-Attribute nur mit -std=c++11 oder -std=gnu++11 verfügbar"
#: cp/error.c:3443
#, gcc-internal-format
@@ -31016,14 +31016,14 @@ msgid "expression %qE of abstract class type %qT cannot be used in throw-express
msgstr "Ausdruck %qE von abstraktem Klassentyp %qT kann nicht in throw-Ausdruck verwendet werden"
#: cp/except.c:981
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot declare catch parameter to be of abstract class type %qT"
-msgstr "Parameter %q+D kann nicht als vom abstrakten Typ %qT deklariert werden"
+msgstr "Catch-Parameter kann nicht mit abstraktem Klassentyp %qT deklariert werden"
#: cp/except.c:989
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot declare catch parameter to be of rvalue reference type %qT"
-msgstr "Parameter %q+D kann nicht als vom abstrakten Typ %qT deklariert werden"
+msgstr "Catch-Parameter kann nicht mit R-Wert-Referenztyp %qT deklariert werden"
#: cp/except.c:1075
#, gcc-internal-format
@@ -31320,24 +31320,24 @@ msgid "uninitialized const member in %q#T"
msgstr "nicht initialisiertes konstantes Element in %q#T"
#: cp/init.c:2254
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "integer overflow in array size"
-msgstr "Ganzzahlüberlauf in Ausdruck"
+msgstr "Ganzzahlüberlauf in Feldgröße"
#: cp/init.c:2264
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "array size in operator new must be constant"
-msgstr "Variable »%s« bei %L muss in diesem Kontext eine Konstante sein"
+msgstr "Feldgröße im Operator »new« muss konstant sein"
#: cp/init.c:2278
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "variably modified type not allowed in operator new"
-msgstr "variabel modifiziertes Feld im Dateibereich"
+msgstr "im Operator »new« ist kein variabel modifizierter Typ erlaubt"
#: cp/init.c:2292
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ISO C++ does not support variable-length array types"
-msgstr "ISO-C unterstützt keine sättigenden Typen"
+msgstr "ISO-C++ unterstützt keine Feldtypen variabler Länge"
#: cp/init.c:2300
#, gcc-internal-format
@@ -32041,9 +32041,9 @@ msgid "%qT is not a template"
msgstr "%qT ist kein Template"
#: cp/parser.c:2591
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not a class template"
-msgstr "%qE ist kein Template"
+msgstr "%qE ist kein Klassentemplate"
#: cp/parser.c:2593
#, gcc-internal-format
@@ -32209,19 +32209,19 @@ msgid "unable to find character literal operator %qD with %qT argument"
msgstr "Operator %qD für Zeichenliterale mit Argument %qT kann nicht gefunden werden"
#: cp/parser.c:3682
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "integer literal exceeds range of %qT type"
-msgstr "Gleitkommakonstante überschreitet Wertebereich von %qT"
+msgstr "Ganzzahlliteral überschreitet Wertebereich des Typs %qT"
#: cp/parser.c:3688
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "floating literal exceeds range of %qT type"
-msgstr "Gleitkommakonstante überschreitet Wertebereich von %qT"
+msgstr "Gleitkommaliteral überschreitet Wertebereich des Typs %qT"
#: cp/parser.c:3692
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "floating literal truncated to zero"
-msgstr "Gleitkommakonstante auf Null abgeschnitten"
+msgstr "Gleitkommaliteral auf Null abgeschnitten"
#: cp/parser.c:3735
#, gcc-internal-format
@@ -32476,9 +32476,9 @@ msgid "default argument specified for lambda parameter"
msgstr "Standardargument für Lambda-Parameter angegeben"
#: cp/parser.c:8885
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "attributes at the beginning of statement are ignored"
-msgstr "Attribute hinter geklammerter Initialisierung werden ignoriert"
+msgstr "Attribute am Anfang der Anweisung werden ignoriert"
#: cp/parser.c:8913
#, gcc-internal-format
@@ -32614,9 +32614,9 @@ msgid "invalid use of %<auto%> in conversion operator"
msgstr "ungültige Verwendung von %<auto%> in Umwandlungsoperator"
#: cp/parser.c:11471
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of %<auto%> in member template conversion operator can never be deduced"
-msgstr "ungültige Verwendung von %<auto%> in Umwandlungsoperator"
+msgstr "Verwendung von %<auto%> in Umwandlungsoperator von Elementtemplate kann niemals hergeleitet werden"
#: cp/parser.c:11560
#, gcc-internal-format
@@ -32710,9 +32710,9 @@ msgid "%<<:%> is an alternate spelling for %<[%>. Insert whitespace between %<<%
msgstr "%<<:%> ist eine andere Schreibweise für %<[%>. Leerraum zwischen %<<%> und %<::%> einfügen"
#: cp/parser.c:12673
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "(if you use %<-fpermissive%> or %<-std=c++11%>, or %<-std=gnu++11%> G++ will accept your code)"
-msgstr "(G++ wird den Code mit »-fpermissive« akzeptieren)"
+msgstr "(bei Verwendung von %<-fpermissive%>, %<-std=c++11%> oder %<-std=gnu++11%> wird G++ den Code akzeptieren)"
#: cp/parser.c:12750
#, gcc-internal-format
@@ -33129,7 +33129,7 @@ msgstr "»friend«-Deklaration benennt keine Klasse oder Funktion"
#: cp/parser.c:19217
#, gcc-internal-format
msgid "a storage class on an anonymous aggregate in class scope is not allowed"
-msgstr ""
+msgstr "Speicherklasse an anonymem Aggregat im Klassenbereich ist nicht erlaubt"
#: cp/parser.c:19422
#, gcc-internal-format
@@ -33137,9 +33137,9 @@ msgid "pure-specifier on function-definition"
msgstr "reiner Spezifizierer bei Funktionsdefinition"
#: cp/parser.c:19466
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stray %<,%> at end of member declaration"
-msgstr "%<;%> am Ende von Elementdeklaration erwartet"
+msgstr "überflüssiges %<,%> am Ende der Elementdeklaration"
#: cp/parser.c:19478
#, gcc-internal-format
@@ -33192,9 +33192,9 @@ msgid "types may not be defined in exception-declarations"
msgstr "Typen dürfen nicht in Ausnahmedeklarationen definiert werden"
#: cp/parser.c:20669
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expected an identifier for the attribute name"
-msgstr "Bezeichner oder %<(%> erwartet"
+msgstr "Bezeichner für den Attributnamen erwartet"
#: cp/parser.c:21338
#, gcc-internal-format
@@ -33268,7 +33268,7 @@ msgstr "falsches %<>>%>; %<>%> verwenden, um eine Templateargumentliste zu beend
#: cp/parser.c:22612
#, gcc-internal-format
msgid "%<sizeof...%> argument must be surrounded by parentheses"
-msgstr ""
+msgstr "Argument von %<sizeof...%> muss mit Klammern umschlossen werden"
#: cp/parser.c:22664
#, gcc-internal-format
@@ -33286,14 +33286,14 @@ msgid "ISO C++ 1998 does not support %<long long%>"
msgstr "ISO-C++ 1998 unterstützt nicht %<long long%>"
#: cp/parser.c:22821
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "both %<__thread%> and %<thread_local%> specified"
-msgstr "sowohl %<_Sat%> als auch %<char%> in Deklaration"
+msgstr "sowohl %<__thread%> als auch %<thread_local%> angegeben"
#: cp/parser.c:22823
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "duplicate %qD"
-msgstr "doppeltes %qE"
+msgstr "doppeltes %qD"
#: cp/parser.c:22845
#, gcc-internal-format
@@ -33451,9 +33451,9 @@ msgid "%qD redeclared with different access"
msgstr "%qD mit anderem Zugriff redeklariert"
#: cp/parser.c:23316
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "in C++98 %<template%> (as a disambiguator) is only allowed within templates"
-msgstr "%<template%> (zur Erklärung) ist nur innerhalb von Templates erlaubt"
+msgstr "in C++98 ist %<template%> (zum eindeutig machen) nur innerhalb von Templates erlaubt"
#: cp/parser.c:23548
#, gcc-internal-format
@@ -33601,9 +33601,9 @@ msgid "name of class shadows template template parameter %qD"
msgstr "Name der Klasse verdeckt Template-Templateparameter %qD"
#: cp/pt.c:823
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "specialization of alias template %qD"
-msgstr "partielle Spezialisierung des Alias-Template %qD"
+msgstr "Spezialisierung des Alias-Template %qD"
#: cp/pt.c:826 cp/pt.c:957
#, gcc-internal-format
@@ -33638,14 +33638,14 @@ msgid "specialization of %qD after instantiation"
msgstr "Spezialisierung von %qD nach Instanziierung"
#: cp/pt.c:1747
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "candidate is: %#D"
-msgstr "Kandidat ist: %+#D"
+msgstr "Kandidat ist: %#D"
#: cp/pt.c:1754
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s %#D"
-msgstr "%s %+#D"
+msgstr "%s %#D"
#: cp/pt.c:1848
#, gcc-internal-format
@@ -33673,14 +33673,14 @@ msgid "%qD is not a static data member of a class template"
msgstr "%qD ist kein statisches Datenelement eines Klassentemplates"
#: cp/pt.c:2277
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many template headers for %D (should be %d)"
-msgstr "falsche Anzahl der Templateargumente (%d, sollte %d sein)"
+msgstr "zu viele Templateheaders für %D (sollte %d sein)"
#: cp/pt.c:2281
#, gcc-internal-format
msgid "members of an explicitly specialized class are defined without a template header"
-msgstr ""
+msgstr "Elemente einer explizit spezialisierten Klasse sind ohne Templateheader definiert"
#. This case handles bogus declarations like template <>
#. template <class T> void f<int>();
@@ -33805,12 +33805,12 @@ msgstr "Teilspezialisierung %qT spezialisiert keine Templateargumente"
#: cp/pt.c:4118
#, gcc-internal-format
msgid "partial specialization is not more specialized than the primary template because it replaces multiple parameters with a pack expansion"
-msgstr ""
+msgstr "partielle Spezialisierung ist nicht näher spezialisiert als das ursprüngliche Template, da es mehrere Parameter mit einer »pack«-Erweiterung ersetzt"
#: cp/pt.c:4121
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "primary template here"
-msgstr "vorher hier deklariert"
+msgstr "ursprüngliches Template hier"
#: cp/pt.c:4168
#, gcc-internal-format
@@ -33996,9 +33996,9 @@ msgid "it must be the address of a function with external linkage"
msgstr "es muss die Adresse einer Funktion mit externer Bindung sein"
#: cp/pt.c:5137
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "it must be the name of a function with external linkage"
-msgstr "es muss die Adresse einer Funktion mit externer Bindung sein"
+msgstr "es muss der Name einer Funktion mit externer Bindung sein"
#: cp/pt.c:5145
#, gcc-internal-format
@@ -34302,9 +34302,9 @@ msgid "mismatched argument pack lengths while expanding %<%E%>"
msgstr "Argumentpacklängen passen nicht bei Auflösung von %<%E%>"
#: cp/pt.c:9886
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " when instantiating default argument for call to %D"
-msgstr "Redefinition des Standardarguments für %q#D"
+msgstr " bei Instanziierung des Standardarguments für Aufruf von %D"
#: cp/pt.c:10478
#, gcc-internal-format
@@ -34607,9 +34607,9 @@ msgid "deducing from brace-enclosed initializer list requires #include <initiali
msgstr "Ermittlung aus geschweift geklammerter Initialisierungsliste erfordert #include <initializer_list>"
#: cp/pt.c:20575
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unable to deduce lambda return type from %qE"
-msgstr "%qT kann nicht aus %qE hergeleitet werden"
+msgstr "Lambda-Rückgabewert von %qE kann nicht hergeleitet werden"
#: cp/pt.c:20577
#, gcc-internal-format
@@ -34864,9 +34864,9 @@ msgid "%qD is not captured"
msgstr "%qD ist nicht aufgefangen"
#: cp/semantics.c:3080
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of local variable with automatic storage from containing function"
-msgstr "Verwendung einer %<auto%>-Variable aus enthaltender Funktion"
+msgstr "Verwendung lokaler Variable mit automatischer Speicherklasse aus enthaltender Funktion"
#: cp/semantics.c:3081
#, gcc-internal-format
@@ -35218,9 +35218,9 @@ msgid "pointer comparison expression is not a constant expression"
msgstr "Zeigervergleichsausdruck ist kein konstanter Ausdruck"
#: cp/semantics.c:8619
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cast to non-integral type %qT in a constant expression"
-msgstr "Zwischenergebnis des nicht-literalen Typs %qT in konstantem Ausdruck"
+msgstr "Umwandlung in Nicht-Ganzzahltyp %qT in konstantem Ausdruck"
#: cp/semantics.c:8695
#, gcc-internal-format
@@ -35298,34 +35298,34 @@ msgid "%qE attribute is not supported on this platform"
msgstr "Attribut %qE wird auf dieser Plattform nicht unterstützt"
#: cp/tree.c:3214
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "redeclaration of %qD adds abi tag %E"
-msgstr "Deklaration von %qD als Element %qT"
+msgstr "Redeklaration von %qD fügt ABI-Marke %E hinzu"
#: cp/tree.c:3220
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration here"
-msgstr "vorherige Deklaration %q+#D hier"
+msgstr "vorherige Deklaration hier"
#: cp/tree.c:3237
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute applied to non-class, non-enum type %qT"
-msgstr "Attribut %qE ignoriert für Nicht-Klassen-Typen"
+msgstr "Attribut %qE auf Nicht-Klassen-, Nicht-Enum-Typ %qT angewendet"
#: cp/tree.c:3243
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute applied to %qT after its definition"
-msgstr "auf %qT nach einer Definition angewandte Attribute werden ignoriert"
+msgstr "Attribut %qE auf %qT nach seiner Definition angewendet"
#: cp/tree.c:3265
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute applied to non-function %qD"
-msgstr "Attribut %qE kann nur auf Funktionen angewandt werden"
+msgstr "Attribut %qE auf Nicht-Funktion %qD angewendet"
#: cp/tree.c:3270
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute applied to extern \"C\" function %qD"
-msgstr "Attribut %qE kann nur auf Funktionen angewandt werden"
+msgstr "Attribut %qE auf »extern \"C\"«-Funktion %qD angewendet"
#: cp/tree.c:3971
#, gcc-internal-format
@@ -35558,14 +35558,14 @@ msgid "%qE cannot be used as a function"
msgstr "%qE kann nicht als Funktion verwendet werden"
#: cp/typeck.c:3409
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD cannot be used as a function"
-msgstr "%qE kann nicht als Funktion verwendet werden"
+msgstr "%qD kann nicht als Funktion verwendet werden"
#: cp/typeck.c:3412
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "expression cannot be used as a function"
-msgstr "%qE kann nicht als Funktion verwendet werden"
+msgstr "Ausdruck kann nicht als Funktion verwendet werden"
#: cp/typeck.c:3461
#, gcc-internal-format
@@ -35673,9 +35673,9 @@ msgid "ISO C++ forbids comparison between pointer and integer"
msgstr "ISO-C++ verbietet Vergleich zwischen Zeiger und Ganzzahl"
#: cp/typeck.c:4463 cp/typeck.c:4471
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "operand types are %qT and %qT"
-msgstr "kein Typ namens %q#T in %q#T"
+msgstr "Operandentypen sind %qT und %qT"
#: cp/typeck.c:4538
#, gcc-internal-format
@@ -35865,9 +35865,9 @@ msgid "reinterpret_cast from type %qT to type %qT casts away qualifiers"
msgstr "reinterpret_cast des Typs %qT in Typ %qT entfernt Qualifizierer"
#: cp/typeck.c:6063
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "useless cast to type %qT"
-msgstr "%qT verwendet lokalen Typen %qT"
+msgstr "nutzlose Umwandlung in Typ %qT"
#: cp/typeck.c:6405
#, gcc-internal-format
@@ -36093,9 +36093,9 @@ msgid "return-statement with no value, in function returning %qT"
msgstr "Return-Anweisung ohne Wert, in %qT zurückgebender Funktion"
#: cp/typeck.c:8141
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "returning initializer list"
-msgstr "<geschweift geklammerte Initialisierungsliste>"
+msgstr "Initialisierungsliste wird zurückgegeben"
#: cp/typeck.c:8196
#, gcc-internal-format
@@ -36425,9 +36425,9 @@ msgid "Conversion of an Infinity or Not-a-Number at %L to INTEGER"
msgstr "Umwandlung einer Unendlichkeit oder NaN bei %L in INTEGER"
#: fortran/arith.c:904 fortran/arith.c:929
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Noninteger exponent in an initialization expression at %L"
-msgstr "Fortran 2003: Nichtganzzahliger Exponent in einem Initialisierungsausdruck bei %L"
+msgstr "Nichtganzzahliger Exponent in einem Initialisierungsausdruck bei %L"
#: fortran/arith.c:915
#, gcc-internal-format, gfc-internal-format
@@ -36558,9 +36558,9 @@ msgid "Expected expression in array specification at %C"
msgstr "Erwarteter Ausdruck in Feldspezifikation bei %C"
#: fortran/array.c:470
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Assumed-rank array at %C"
-msgstr "Aufzählung kann kein Feld bei %C sein"
+msgstr "Feld mit vermutetem Rang bei %C"
#: fortran/array.c:505
#, gcc-internal-format, gfc-internal-format
@@ -36598,14 +36598,14 @@ msgid "Array specification at %C has more than %d dimensions"
msgstr "Feldspezifikation bei %C hat mehr als %d Dimensionen"
#: fortran/array.c:579
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Array specification at %C with more than 7 dimensions"
-msgstr "Feldspezifikation bei %C hat mehr als %d Dimensionen"
+msgstr "Feldspezifikation bei %C mit mehr als 7 Dimensionen"
#: fortran/array.c:592
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Coarray declaration at %C"
-msgstr "Fortran 2008: Coarray-Deklaration bei %C"
+msgstr "Coarray-Deklaration bei %C"
#: fortran/array.c:690
#, gcc-internal-format, gfc-internal-format
@@ -36613,9 +36613,9 @@ msgid "Upper bound of last coarray dimension must be '*' at %C"
msgstr "Obere Grenze der letzten Coarray-Dimension muss '*' bei %C sein"
#: fortran/array.c:758
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The assumed-rank array '%s' at %L shall not have a codimension"
-msgstr "Koarray-Variable »%s« bei %L sollte keine Kodimensionen mit aufgeschobener Form haben"
+msgstr "Das Feld »%s« mit vermutetem Rang bei %L sollte keine Kodimension haben"
#: fortran/array.c:918
#, gcc-internal-format, gfc-internal-format
@@ -36628,14 +36628,14 @@ msgid "Syntax error in array constructor at %C"
msgstr "Syntaxfehler in Feldkonstruktor bei %C"
#: fortran/array.c:1063
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "[...] style array constructors at %C"
-msgstr "Fortran 2003: Feldkonstruktoren im [...]-Stil bei %C"
+msgstr "Feldkonstruktoren im [...]-Stil bei %C"
#: fortran/array.c:1085
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Array constructor including type specification at %C"
-msgstr "Fortran 2003: Feldkonstruktor mit Typspezifikation bei %C"
+msgstr "Feldkonstruktor mit Typspezifikation bei %C"
#: fortran/array.c:1094 fortran/match.c:3469
#, gcc-internal-format, gfc-internal-format
@@ -36665,24 +36665,24 @@ msgid "The number of elements in the array constructor at %L requires an increas
msgstr "Die Anzahl der Elemente im Feldkonstruktor bei %L erfordert Erhöhung der erlaubten oberen Grenze %d. Siehe Option -fmax-array-constructor"
#: fortran/array.c:1837
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "AC-IMPLIED-DO initial expression references control variable at %L"
-msgstr "Typfehler in Ausdrucksreferenz bei %L"
+msgstr "erster Ausdruck von AC-IMPLIED-DO referenziert Steuervariable bei %L"
#: fortran/array.c:1844
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "AC-IMPLIED-DO final expression references control variable at %L"
-msgstr "Typfehler in Ausdrucksreferenz bei %L"
+msgstr "letzter Ausdruck von AC-IMPLIED-DO referenziert Steuervariable bei %L"
#: fortran/array.c:1851
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "AC-IMPLIED-DO step expression references control variable at %L"
-msgstr "Typfehler in Ausdrucksreferenz bei %L"
+msgstr "Schrittausdruck von AC-IMPLIED-DO referenziert Steuervariable bei %L"
#: fortran/array.c:1863
#, gcc-internal-format, gfc-internal-format
msgid "Array constructor value at %L shall not be unlimited polymorphic [F2008: C4106]"
-msgstr ""
+msgstr "Wert für Feldkonstruktor bei %L sollte nicht unbegrenzt polymorph sein [F2008: C4106]"
#: fortran/array.c:1946
#, gcc-internal-format, gfc-internal-format
@@ -36836,9 +36836,9 @@ msgstr "Argumente »%s« und »%s« des intrinsischen »%s« bei %L müssen den
#: fortran/check.c:867 fortran/check.c:1806 fortran/check.c:1932
#: fortran/check.c:2006 fortran/check.c:2358
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Different type kinds at %L"
-msgstr "Erweiterung: Verschiedene Typ-Arten bei %L"
+msgstr "Verschiedene Typ-Arten bei %L"
#: fortran/check.c:903
#, gcc-internal-format, gfc-internal-format
@@ -36896,9 +36896,9 @@ msgid "VALUE argument of the %s intrinsic function at %L shall be definable"
msgstr "VALUE-Argument der intrinsischen Funktion »%s« bei %L sollte definierbar sein"
#: fortran/check.c:1084
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Negative argument N at %L"
-msgstr "Erweiterung: Negatives Argument N bei %L"
+msgstr "Negatives Argument N bei %L"
#: fortran/check.c:1256 fortran/check.c:1426
#, gcc-internal-format, gfc-internal-format
@@ -36913,15 +36913,15 @@ msgstr "»%s« Argument des intrinsischen »%s« bei %L muss vom Typ REAL oder I
#: fortran/check.c:1279 fortran/check.c:1284
#, gcc-internal-format, gfc-internal-format
msgid "Conversion from %s to default-kind COMPLEX(%d) at %L might loose precision, consider using the KIND argument"
-msgstr ""
+msgstr "Umwandlung von %s in standardartiges COMPLEX(%d) bei %L könnte Genauigkeit verlieren, evtl. KIND-Argument verwenden"
#: fortran/check.c:1320 fortran/check.c:1851 fortran/check.c:1954
#: fortran/check.c:2148 fortran/check.c:2193 fortran/check.c:3411
#: fortran/check.c:3545 fortran/check.c:3600 fortran/check.c:4139
#: fortran/check.c:4268
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' intrinsic with KIND argument at %L"
-msgstr "Fortran 2003: intrinsisches »%s« mit KIND-Argument bei %L"
+msgstr "intrinsisches »%s« mit KIND-Argument bei %L"
#: fortran/check.c:1367 fortran/check.c:1617
#, gcc-internal-format, gfc-internal-format
@@ -36954,14 +36954,14 @@ msgid "'I' at %L and 'J' at %L cannot both be BOZ literal constants"
msgstr "»I« bei %L und »J« bei %L können nicht beide literale BOZ-Konstanten sein"
#: fortran/check.c:1678
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "non-default INTEGER kind argument to %s intrinsic at %L"
-msgstr "GNU-Erweiterung: Nicht-Standard Argument der Art INTEGER für intrinsisches »%s« bei %L"
+msgstr "Nicht-Standard Argument der Art INTEGER für intrinsisches »%s« bei %L"
#: fortran/check.c:1738
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "COMPLEX argument '%s' argument of '%s' intrinsic at %L"
-msgstr "Fortran 2008: COMPLEX-Argument »%s« des intrinsischen »%s« bei %L"
+msgstr "COMPLEX-Argument »%s« ist Argument des intrinsischen »%s« bei %L"
#: fortran/check.c:1902
#, gcc-internal-format, gfc-internal-format
@@ -36999,9 +36999,9 @@ msgid "'a%d' argument of '%s' intrinsic at %L must be %s(%d)"
msgstr "Argument »a%d« des intrinsischen »%s« bei %L muss %s(%d) sein"
#: fortran/check.c:2395
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' intrinsic with CHARACTER argument at %L"
-msgstr "Fortran 2003: intrinsisches »%s« mit CHARACTER-Argument bei %L"
+msgstr "intrinsisches »%s« mit CHARACTER-Argument bei %L"
#: fortran/check.c:2402
#, gcc-internal-format, gfc-internal-format
@@ -37034,14 +37034,14 @@ msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER"
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss ein INTEGER sein"
#: fortran/check.c:2746
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The FROM argument to MOVE_ALLOC at %L shall not be coindexed"
-msgstr "Argument »%s« des intrinsischen »%s« bei %L sollte keinen Koindex haben"
+msgstr "Das FROM-Argument für MOVE_ALLOC bei %L sollte keinen Koindex haben"
#: fortran/check.c:2757
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The TO argument to MOVE_ALLOC at %L shall not be coindexed"
-msgstr "Argument »%s« des intrinsischen »%s« bei %L sollte keinen Koindex haben"
+msgstr "Das TO-Argument für MOVE_ALLOC bei %L sollte keinen Koindex haben"
#: fortran/check.c:2764
#, gcc-internal-format, gfc-internal-format
@@ -37049,14 +37049,14 @@ msgid "The TO arguments in MOVE_ALLOC at %L must be polymorphic if FROM is polym
msgstr "Die TO-Argumente in MOVE_ALLOC bei %L müssen polymorph sein, wenn FROM polymorph ist"
#: fortran/check.c:2775
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L must have the same rank %d/%d"
-msgstr "Argumente »%s« und »%s« des intrinsischen »%s« bei %L müssen den selben Rang %d/%d haben"
+msgstr "Die FROM- und TO-Argumente des intrinsischen MOVE_ALLOC bei %L müssen den selben Rang %d/%d haben"
#: fortran/check.c:2784
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L must have the same corank %d/%d"
-msgstr "Argumente »%s« und »%s« des intrinsischen »%s« bei %L müssen den selben Rang %d/%d haben"
+msgstr "Die FROM- und TO-Argumente des intrinsischen MOVE_ALLOC bei %L müssen den selben Ko-Rang %d/%d haben"
#: fortran/check.c:2816
#, gcc-internal-format, gfc-internal-format
@@ -37069,9 +37069,9 @@ msgid "'%s' argument of '%s' intrinsic at %L must be a POINTER, ALLOCATABLE or p
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss POINTER, ALLOCATABLE oder Prozedurzeiger sein"
#: fortran/check.c:2874
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "NULL intrinsic with allocatable MOLD at %L"
-msgstr "Fortran 2003: intrinsisches NULL mit reservierbarem MOLD bei %L"
+msgstr "intrinsisches NULL mit reservierbarem MOLD bei %L"
#: fortran/check.c:2953 fortran/check.c:4215
#, gcc-internal-format, gfc-internal-format
@@ -37139,9 +37139,9 @@ msgid "Without padding, there are not enough elements in the intrinsic RESHAPE s
msgstr "Ohne Auffüllen gibt es nicht genügend Elemente in eingebauter RESHAPE-Quelle bei %L um zur Form zu passen"
#: fortran/check.c:3344 fortran/check.c:3363
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' argument of '%s' intrinsic at %L cannot be of type %s"
-msgstr "Argument »%s« des intrinsischen »%s« bei %L muss %s sein"
+msgstr "Argument »%s« des intrinsischen »%s« bei %L kann nicht Typ %s haben"
#: fortran/check.c:3354 fortran/check.c:3373
#, gcc-internal-format, gfc-internal-format
@@ -37149,14 +37149,14 @@ msgid "'%s' argument of '%s' intrinsic at %L must be of an extensible type"
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss erweiterbaren Typ haben"
#: fortran/check.c:3472
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "SELECTED_REAL_KIND with neither 'P' nor 'R' argument at %L"
-msgstr "Fortran 2008: SELECTED_REAL_KIND ohne Argument »P« oder »R« bei %L"
+msgstr "SELECTED_REAL_KIND ohne Argument »P« oder »R« bei %L"
#: fortran/check.c:3503
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'%s' intrinsic with RADIX argument at %L"
-msgstr "Fortran 2008: intrinsisches »%s« mit RADIX-Argument bei %L"
+msgstr "intrinsisches »%s« mit RADIX-Argument bei %L"
#: fortran/check.c:3538
#, gcc-internal-format, gfc-internal-format
@@ -37174,9 +37174,9 @@ msgid "'%s' argument of '%s' intrinsic at %L must be an interoperable data entit
msgstr "Argument »%s« des intrinsischen »%s« bei %L muss austauschbare Datenentität sein"
#: fortran/check.c:3658
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "non double precision REAL argument to %s intrinsic at %L"
-msgstr "GNU-Erweiterung: REAL-Argument ohne doppelte Genauigkeit für intrinsisches %s bei %L"
+msgstr "REAL-Argument ohne doppelte Genauigkeit für intrinsisches %s bei %L"
#: fortran/check.c:3671
#, gcc-internal-format, gfc-internal-format
@@ -37306,9 +37306,9 @@ msgid "Data element above array upper bound at %L"
msgstr "Datenelement oberhalb der oberen Feldgrenze bei %L"
#: fortran/data.c:321 fortran/data.c:487
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "re-initialization of '%s' at %L"
-msgstr "Erweiterung: Reinitialisierung von »%s« bei %L"
+msgstr "Reinitialisierung von »%s« bei %L"
#: fortran/decl.c:264
#, gcc-internal-format, gfc-internal-format
@@ -37316,9 +37316,9 @@ msgid "Host associated variable '%s' may not be in the DATA statement at %C"
msgstr "Mit Host verbundene Variable »%s« darf nicht in DATA-Anweisung bei %C stehen"
#: fortran/decl.c:271
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "initialization of common block variable '%s' in DATA statement at %C"
-msgstr "Erweiterung: Initialisierung der allgemeinen Blockvariable »%s« in DATA-Anweisung bei %C"
+msgstr "Initialisierung der allgemeinen Blockvariable »%s« in DATA-Anweisung bei %C"
#: fortran/decl.c:382
#, gcc-internal-format, gfc-internal-format
@@ -37341,9 +37341,9 @@ msgid "DATA statement at %C is not allowed in a PURE procedure"
msgstr "DATA-Anweisung bei %C ist in PURE-Prozedur nicht erlaubt"
#: fortran/decl.c:600
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The assumed-rank array at %C shall not have a codimension"
-msgstr "Datenziel bei %L sollte keinen Koindex haben"
+msgstr "Das Feld vermuteten Ranges bei %C sollte keine Kodimension haben"
#: fortran/decl.c:668
#, gcc-internal-format, gfc-internal-format
@@ -37351,9 +37351,9 @@ msgid "Bad INTENT specification at %C"
msgstr "Falsche INTENT-Spezifikation bei %C"
#: fortran/decl.c:689
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "deferred type parameter at %C"
-msgstr "Fortran 2003: Parameter mit zurückgestelltem Typ bei %C"
+msgstr "Parameter mit zurückgestelltem Typ bei %C"
#: fortran/decl.c:726
#, gcc-internal-format, gfc-internal-format
@@ -37361,9 +37361,9 @@ msgid "Conflict in attributes of function argument at %C"
msgstr "Konflikt in Attributen des Funktionsarguments bei %C"
#: fortran/decl.c:753
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Old-style character length at %C"
-msgstr "Veraltete Funktion: Zeichenlänge alten Stils bei %C"
+msgstr "Zeichenlänge alten Stils bei %C"
#: fortran/decl.c:784
#, gcc-internal-format, gfc-internal-format
@@ -37401,9 +37401,9 @@ msgid "Variable '%s' at %L is a dummy argument to the BIND(C) procedure '%s' but
msgstr "Variable »%s« bei %L ist ein Scheinargument für die BIND(C)-Prozedur »%s«, jedoch nicht interoperabel mit C, da sie polymorph ist"
#: fortran/decl.c:1040
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L is a dummy argument of the BIND(C) procedure '%s' but may not be C interoperable"
-msgstr "Variable »%s« bei %L ist ein Parameter für die BIND(C)-Prozedur »%s«, könnte jedoch inkompatibel mit C sein"
+msgstr "Variable »%s« bei %L ist ein Scheinargument für die BIND(C)-Prozedur »%s«, könnte jedoch unverträglich mit C sein"
#: fortran/decl.c:1055
#, gcc-internal-format, gfc-internal-format
@@ -37426,14 +37426,14 @@ msgid "Variable '%s' at %L cannot have both the OPTIONAL and the VALUE attribute
msgstr "Variable »%s« bei %L kann nicht gleichzeitig die Attribute OPTIONAL und VALUE haben, da Prozedur »%s« BIND(C) ist"
#: fortran/decl.c:1094
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L with OPTIONAL attribute in procedure '%s' which is BIND(C)"
-msgstr "TS29113: Variable »%s« bei %L mit OPTIONAL-Attribut in Prozedur »%s«, die BIND(C) ist"
+msgstr "Variable »%s« bei %L mit OPTIONAL-Attribut in Prozedur »%s«, die BIND(C) ist"
#: fortran/decl.c:1106
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Assumed-shape array '%s' at %L as dummy argument to the BIND(C) procedure '%s' at %L"
-msgstr "Feld »%s« mit vermuteter Form bei %L kann kein Argument für Prozedur »%s« bei %L sein, da die Prozedur BIND(C) ist"
+msgstr "Feld »%s« mit vermuteter Form bei %L als Scheinargument für BIND(C)-Prozedur »%s« bei %L"
#: fortran/decl.c:1185
#, gcc-internal-format, gfc-internal-format
@@ -37506,9 +37506,9 @@ msgid "NULL() initialization at %C is ambiguous"
msgstr "NULL()-Initialisierung bei %C ist mehrdeutig"
#: fortran/decl.c:1719
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "NULL() initialization at %C may not have MOLD"
-msgstr "NULL()-Initialisierung bei %C ist mehrdeutig"
+msgstr "NULL()-Initialisierung bei %C könnte kein MOLD haben"
#: fortran/decl.c:1736
#, gcc-internal-format, gfc-internal-format
@@ -37521,9 +37521,9 @@ msgid "Error in pointer initialization at %C"
msgstr "Fehler in Zeigerinitialisierung bei %C"
#: fortran/decl.c:1763
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "non-NULL pointer initialization at %C"
-msgstr "Fortran 2008: Nicht-NULL-Zeigerinitialisierung bei %C"
+msgstr "Nicht-NULL-Zeigerinitialisierung bei %C"
#: fortran/decl.c:1786
#, gcc-internal-format, gfc-internal-format
@@ -37536,9 +37536,9 @@ msgid "Non-PARAMETER symbol '%s' at %L can't be implied-shape"
msgstr "Nicht-PARAMETER-Symbol »%s« bei %L kann nicht implizite Form haben"
#: fortran/decl.c:1864
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Implied-shape array at %L"
-msgstr "Fortran 2008: Feld mit impliziter Form bei %L"
+msgstr "Feld mit impliziter Form bei %L"
#: fortran/decl.c:1928 fortran/decl.c:6509
#, gcc-internal-format, gfc-internal-format
@@ -37546,9 +37546,9 @@ msgid "Duplicate array spec for Cray pointee at %C"
msgstr "Doppelte Feldspezifikation für Cray-Zeigerende bei %C"
#: fortran/decl.c:1999
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Old-style initialization at %C"
-msgstr "Erweiterung: Initialisierung im alten Stil bei %C"
+msgstr "Initialisierung im alten Stil bei %C"
#: fortran/decl.c:2014 fortran/decl.c:4963
#, gcc-internal-format, gfc-internal-format
@@ -37626,9 +37626,9 @@ msgid "Syntax error in CHARACTER declaration at %C"
msgstr "Syntaxfehler in CHARACTER-Deklaration bei %C"
#: fortran/decl.c:2592
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "BYTE type at %C"
-msgstr "Erweiterung: BYTE-Typ bei %C"
+msgstr "BYTE-Typ bei %C"
#: fortran/decl.c:2598
#, gcc-internal-format, gfc-internal-format
@@ -37636,30 +37636,30 @@ msgid "BYTE type used at %C is not available on the target machine"
msgstr "Bei %C verwendeter BYTE-Typ ist auf der Zielmaschine nicht verfügbar"
#: fortran/decl.c:2620
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Assumed type at %C is not allowed for components"
-msgstr "Wertargument bei %L ist in diesem Kontext nicht erlaubt"
+msgstr "Vermuteter Typ bei %C ist für Komponenten nicht erlaubt"
#: fortran/decl.c:2623
#, gcc-internal-format, gfc-internal-format
msgid "Assumed type at %C"
-msgstr ""
+msgstr "Vermuteter Typ bei %C"
#: fortran/decl.c:2646 fortran/decl.c:2677 fortran/decl.c:2707
#: fortran/decl.c:2885
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "TYPE with intrinsic-type-spec at %C"
-msgstr "Fortran 2008: TYPE mit intrinsischer Typspezifikation bei %C"
+msgstr "TYPE mit intrinsischer Typspezifikation bei %C"
#: fortran/decl.c:2702
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "DOUBLE COMPLEX at %C"
-msgstr "Erweiterung: DOUBLE COMPLEX bei %C"
+msgstr "DOUBLE COMPLEX bei %C"
#: fortran/decl.c:2777
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "CLASS statement at %C"
-msgstr "Fortran 2003: CLASS-Anweisung bei %C"
+msgstr "CLASS-Anweisung bei %C"
#: fortran/decl.c:2813 fortran/decl.c:2826 fortran/decl.c:3200
#: fortran/decl.c:3208
@@ -37693,9 +37693,9 @@ msgid "IMPORT statement at %C only permitted in an INTERFACE body"
msgstr "IMPORT-Anweisung bei %C ist nur in einem INTERFACE-Körper erlaubt"
#: fortran/decl.c:3170
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "IMPORT statement at %C"
-msgstr "Leere IMPLICIT-Anweisung bei %C"
+msgstr "IMPORT-Anweisung bei %C"
#: fortran/decl.c:3185
#, gcc-internal-format, gfc-internal-format
@@ -37733,9 +37733,9 @@ msgid "Duplicate %s attribute at %L"
msgstr "Doppeltes Attribut %s bei %L"
#: fortran/decl.c:3667
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ALLOCATABLE attribute at %C in a TYPE definition"
-msgstr "Fortran 2003: Attribut ALLOCATABLE bei %C in einer TYPE-Definition"
+msgstr "Attribut ALLOCATABLE bei %C in einer TYPE-Definition"
#: fortran/decl.c:3677
#, gcc-internal-format, gfc-internal-format
@@ -37743,9 +37743,9 @@ msgid "Attribute at %L is not allowed in a TYPE definition"
msgstr "Attribut bei %L ist in TYPE-Definition nicht erlaubt"
#: fortran/decl.c:3695
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Attribute %s at %L in a TYPE definition"
-msgstr "Fortran 2003: Attribut %s bei %L in einer TYPE-Definition"
+msgstr "Attribut %s bei %L in einer TYPE-Definition"
#: fortran/decl.c:3706
#, gcc-internal-format, gfc-internal-format
@@ -37753,14 +37753,14 @@ msgid "%s attribute at %L is not allowed outside of the specification part of a
msgstr "Attribut %s bei %L ist außerhalb des Spezifikationsabschnitts eines Moduls nicht erlaubt"
#: fortran/decl.c:3721
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ASYNCHRONOUS attribute at %C"
-msgstr "Fortran 2003: ASYNCHRONOUS-Attribut bei %C"
+msgstr "ASYNCHRONOUS-Attribut bei %C"
#: fortran/decl.c:3734
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "CONTIGUOUS attribute at %C"
-msgstr "Fortran 2008: CONTIGUOUS-Attribut bei %C"
+msgstr "CONTIGUOUS-Attribut bei %C"
#: fortran/decl.c:3780 fortran/decl.c:6804
#, gcc-internal-format, gfc-internal-format
@@ -37768,19 +37768,19 @@ msgid "PROTECTED at %C only allowed in specification part of a module"
msgstr "PROTECTED bei %C nur in Spezifikationsabschnitts eines Moduls erlaubt"
#: fortran/decl.c:3786
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PROTECTED attribute at %C"
-msgstr "Fortran 2003: PROTECTED-Attribut bei %C"
+msgstr "PROTECTED-Attribut bei %C"
#: fortran/decl.c:3817
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "VALUE attribute at %C"
-msgstr "Fortran 2003: VALUE-Attribut bei %C"
+msgstr "VALUE-Attribut bei %C"
#: fortran/decl.c:3827
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "VOLATILE attribute at %C"
-msgstr "Fortran 2003: VOLATILE-Attribut bei %C"
+msgstr "VOLATILE-Attribut bei %C"
#: fortran/decl.c:3873
#, gcc-internal-format, gfc-internal-format
@@ -37862,9 +37862,9 @@ msgid "Syntax error in data declaration at %C"
msgstr "Syntaxfehler in Daten-Deklaration bei %C"
#: fortran/decl.c:4411
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "IMPURE procedure at %C"
-msgstr "Fortran 2008: IMPURE-Prozedur bei %C"
+msgstr "IMPURE-Prozedur bei %C"
#: fortran/decl.c:4424
#, gcc-internal-format, gfc-internal-format
@@ -37897,9 +37897,9 @@ msgid "Unexpected junk after function declaration at %C"
msgstr "Unerwartete Angaben hinter Funktionsdeklaration bei %C"
#: fortran/decl.c:4697 fortran/decl.c:5730
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "BIND(C) attribute at %L may not be specified for an internal procedure"
-msgstr "Fortran 2008: BIND(C)-Attribut bei %L kann nicht für eine interne Prozedur angegeben werden"
+msgstr "BIND(C)-Attribut bei %L kann nicht für eine interne Prozedur angegeben werden"
#: fortran/decl.c:4901
#, gcc-internal-format, gfc-internal-format
@@ -37937,9 +37937,9 @@ msgid "NOPASS or explicit interface required at %C"
msgstr "NOPASS oder explizite Schnittstelle bei %C erforderlich"
#: fortran/decl.c:5045
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Procedure pointer component at %C"
-msgstr "Fortran 2003: Prozedurzeiger-Komponente bei %C"
+msgstr "Prozedurzeiger-Komponente bei %C"
#: fortran/decl.c:5111
#, gcc-internal-format, gfc-internal-format
@@ -37952,14 +37952,14 @@ msgid "PROCEDURE at %C must be in a generic interface"
msgstr "PROCEDURE bei %C muss in einer allgemeinen Schnittstelle sein"
#: fortran/decl.c:5138 fortran/decl.c:7311
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "double colon in MODULE PROCEDURE statement at %L"
-msgstr "Fortran 2008: »::« in MODULE PROCEDURE-Anweisung bei %L"
+msgstr "»::« in MODULE PROCEDURE-Anweisung bei %L"
#: fortran/decl.c:5208
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PROCEDURE statement at %C"
-msgstr "Fortran 2003: PROCEDURE-Anweisung bei %C"
+msgstr "PROCEDURE-Anweisung bei %C"
#: fortran/decl.c:5276
#, gcc-internal-format, gfc-internal-format
@@ -37974,9 +37974,9 @@ msgid "BIND(C) attribute at %L can only be used for variables or common blocks"
msgstr "BIND(C)-Attribut bei %L kann nur für Variablen oder gemeinsame Blöcke verwendet werden"
#: fortran/decl.c:5420
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ENTRY statement at %C"
-msgstr "Leere IMPLICIT-Anweisung bei %C"
+msgstr "ENTRY-Anweisung bei %C"
#: fortran/decl.c:5429
#, gcc-internal-format, gfc-internal-format
@@ -38084,9 +38084,9 @@ msgid "Unexpected END statement at %C"
msgstr "Unerwartete END-Anweisung bei %C"
#: fortran/decl.c:6102
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "END statement instead of %s statement at %L"
-msgstr "Fortran 2008: END-Anweisung statt %s-Anweisung bei %L"
+msgstr "END-Anweisung statt %s-Anweisung bei %L"
#. We would have required END [something].
#: fortran/decl.c:6110
@@ -38190,9 +38190,9 @@ msgid "Cray pointer declaration at %C requires -fcray-pointer flag"
msgstr "Cray-Zeiger-Deklaration bei %C benötigt den Schalter -fcray-pointer"
#: fortran/decl.c:6657
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "CONTIGUOUS statement at %C"
-msgstr "Fortran 2008: CONTIGUOUS-Anweisung bei %C"
+msgstr "CONTIGUOUS-Anweisung bei %C"
#: fortran/decl.c:6755
#, gcc-internal-format, gfc-internal-format
@@ -38205,9 +38205,9 @@ msgid "Access specification of the .%s. operator at %C has already been specifie
msgstr "Zugriffsspezifikation des Operators .%s. bei %C wurde bereits spezifiziert"
#: fortran/decl.c:6810
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PROTECTED statement at %C"
-msgstr "Fortran 2003: PROTECTED-Anweisung bei %C"
+msgstr "PROTECTED-Anweisung bei %C"
#: fortran/decl.c:6850
#, gcc-internal-format, gfc-internal-format
@@ -38270,9 +38270,9 @@ msgid "VALUE is not allowed inside of BLOCK at %C"
msgstr "VALUE ist in BLOCK bei %C nicht erlaubt"
#: fortran/decl.c:7108
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "VALUE statement at %C"
-msgstr "Fortran 2003: VALUE-Anweisung bei %C"
+msgstr "VALUE-Anweisung bei %C"
#: fortran/decl.c:7148
#, gcc-internal-format, gfc-internal-format
@@ -38280,9 +38280,9 @@ msgid "Syntax error in VALUE statement at %C"
msgstr "Syntaxfehler in VALUE-Anweisung bei %C"
#: fortran/decl.c:7159
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "VOLATILE statement at %C"
-msgstr "Fortran 2003: VOLATILE-Anweisung bei %C"
+msgstr "VOLATILE-Anweisung bei %C"
#: fortran/decl.c:7183
#, gcc-internal-format, gfc-internal-format
@@ -38295,9 +38295,9 @@ msgid "Syntax error in VOLATILE statement at %C"
msgstr "Syntaxfehler in VOLATILE-Anweisung bei %C"
#: fortran/decl.c:7220
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ASYNCHRONOUS statement at %C"
-msgstr "Fortran 2003: ASYNCHRONOUS-Anweisung bei %C"
+msgstr "ASYNCHRONOUS-Anweisung bei %C"
#: fortran/decl.c:7262
#, gcc-internal-format, gfc-internal-format
@@ -38350,9 +38350,9 @@ msgid "Derived type at %C can only be PUBLIC in the specification part of a modu
msgstr "Abgeleiteter Typ bei %C kann nur PUBLIC im Spezifikationsteil eines Moduls sein"
#: fortran/decl.c:7478
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ABSTRACT type at %C"
-msgstr "ABSTRACT-Typ »%s« bei %L verwendet"
+msgstr "ABSTRACT-Typ bei %C"
#: fortran/decl.c:7543
#, gcc-internal-format, gfc-internal-format
@@ -38380,9 +38380,9 @@ msgid "Cray Pointee at %C cannot be assumed shape array"
msgstr "Cray-Zeigerende bei %C kann nicht Feld mit impliziter Form sein"
#: fortran/decl.c:7709
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ENUM and ENUMERATOR at %C"
-msgstr "Fortran 2003: ENUM AND ENUMERATOR bei %C"
+msgstr "ENUM und ENUMERATOR bei %C"
#: fortran/decl.c:7742
#, gcc-internal-format, gfc-internal-format
@@ -38480,9 +38480,9 @@ msgid "Expected binding name at %C"
msgstr "Bindungsname bei %C erwartet"
#: fortran/decl.c:8203
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PROCEDURE list at %C"
-msgstr "Fortran 2008: PROCEDURE-Liste bei %C"
+msgstr "PROCEDURE-Liste bei %C"
#: fortran/decl.c:8216
#, gcc-internal-format, gfc-internal-format
@@ -38695,9 +38695,9 @@ msgid "transformational intrinsic '%s' at %L is not permitted in an initializati
msgstr "Variable »%s« bei %L kann nicht in einem Initialisierungs-Ausdruck auftreten"
#: fortran/expr.c:2405
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Evaluation of nonstandard initialization expression at %L"
-msgstr "Erweiterung: Auswertung des nicht standardisierten Initialisierungsausdrucks bei %L"
+msgstr "Auswertung des nicht standardisierten Initialisierungsausdrucks bei %L"
#: fortran/expr.c:2461
#, gcc-internal-format, gfc-internal-format
@@ -38825,19 +38825,19 @@ msgid "NULL appears on right-hand side in assignment at %L"
msgstr "Auf rechter Seite in Zuweisung bei %L tritt NULL auf"
#: fortran/expr.c:3153
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "POINTER-valued function appears on right-hand side of assignment at %L"
msgstr "POINTER-wertige Funktion tritt auf rechter Seite der Zuweisung bei %L auf"
#: fortran/expr.c:3163
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "BOZ literal at %L used to initialize non-integer variable '%s'"
-msgstr "Erweiterung: BOZ-Literal bei %L verwendet, um Nicht-Ganzzahlvariable »%s« zu initialisieren"
+msgstr "BOZ-Literal bei %L verwendet, um Nicht-Ganzzahlvariable »%s« zu initialisieren"
#: fortran/expr.c:3169 fortran/resolve.c:9505
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "BOZ literal at %L outside a DATA statement and outside INT/REAL/DBLE/CMPLX"
-msgstr "Erweiterung: BOZ-Literal bei %L außerhalb einer DATA-Anweisung und außerhalb von INT/REAL/DBLE/CMPLX"
+msgstr "BOZ-Literal bei %L außerhalb einer DATA-Anweisung und außerhalb von INT/REAL/DBLE/CMPLX"
#: fortran/expr.c:3179 fortran/resolve.c:9515
#, gcc-internal-format, gfc-internal-format
@@ -38895,9 +38895,9 @@ msgid "Expected bounds specification for '%s' at %L"
msgstr "Grenzen für »%s« bei %L erwartet"
#: fortran/expr.c:3336
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Bounds specification for '%s' in pointer assignment at %L"
-msgstr "Fortran 2003: Grenzenangabe für »%s« in Zeigerzuweisung bei %L"
+msgstr "Grenzenangabe für »%s« in Zeigerzuweisung bei %L"
#: fortran/expr.c:3350
#, gcc-internal-format, gfc-internal-format
@@ -38925,9 +38925,9 @@ msgid "Invalid procedure pointer assignment at %L"
msgstr "Ungültige Zuweisung eines Prozedurzeigers bei %L"
#: fortran/expr.c:3435
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Function result '%s' is invalid as proc-target in procedure pointer assignment at %L"
-msgstr "Anweisungsfunktion »%s« ist in Zuweisung des Prozedurzeigers bei %L ungültig"
+msgstr "Funktionsergebnis »%s« ist als Prozedurziel in Zuweisung des Prozedurzeigers bei %L ungültig"
#: fortran/expr.c:3443
#, gcc-internal-format, gfc-internal-format
@@ -38945,12 +38945,12 @@ msgid "Internal procedure '%s' is invalid in procedure pointer assignment at %L"
msgstr "Interne Prozedur »%s« ist in Zuweisung des Prozedurzeigers bei %L ungültig"
#: fortran/expr.c:3467
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Intrinsic '%s' at %L is invalid in procedure pointer assignment"
-msgstr "Interne Prozedur »%s« ist in Zuweisung des Prozedurzeigers bei %L ungültig"
+msgstr "Eingebautes »%s« ist in Zuweisung des Prozedurzeigers bei %L ungültig"
#: fortran/expr.c:3475
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Nonintrinsic elemental procedure '%s' is invalid in procedure pointer assignment at %L"
msgstr "Nichtintrinsische elementare Prozedur »%s« ist in Zuweisung des Prozedurzeigers bei %L ungültig"
@@ -38967,7 +38967,7 @@ msgstr "Unpassende Schnittstellen bei Zuweisung des Prozedurzeigers bei %L: %s"
#: fortran/expr.c:3573
#, gcc-internal-format, gfc-internal-format
msgid "Data-pointer-object &L must be unlimited polymorphic, a sequence derived type or of a type with the BIND attribute assignment at %L to be compatible with an unlimited polymorphic target"
-msgstr ""
+msgstr "Datenzeigerobjekt &L muss unbegrenzt polymorph sein, von Sequenz abgeleiteten Typ oder Typ mit Zuweisung eines BIND-Attributs bei %L haben, um zum unbegrenzt polymorphen Ziel zu passen"
#: fortran/expr.c:3579
#, gcc-internal-format, gfc-internal-format
@@ -38995,9 +38995,9 @@ msgid "Rank remapping target must be rank 1 or simply contiguous at %L"
msgstr "Ziel der Rang-Neuzuordnung muss Rang 1 oder einfach fortlaufend bei %L sein"
#: fortran/expr.c:3633
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Rank remapping target is not rank 1 at %L"
-msgstr "Fortran 2008: Ziel der Rang-Neuzuordnung ist nicht Rang 1 bei %L"
+msgstr "Ziel der Rang-Neuzuordnung ist nicht Rang 1 bei %L"
#: fortran/expr.c:3658
#, gcc-internal-format, gfc-internal-format
@@ -39030,19 +39030,19 @@ msgid "Data target at %L shall not have a coindex"
msgstr "Datenziel bei %L sollte keinen Koindex haben"
#: fortran/expr.c:3741
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Pointer at %L in pointer assignment might outlive the pointer target"
-msgstr "Zielausdruck in Zeigerzuweisung bei %L muss ein Zeigerergebnis liefern"
+msgstr "Zeiger bei %L in Zeigerzuweisung könnte Zeigerziel überdauern"
#: fortran/expr.c:3806
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Pointer initialization target at %L must not be ALLOCATABLE"
msgstr "Ziel der Zeigerinitialisierung bei %L darf nicht ALLOCATABLE sein"
#: fortran/expr.c:3812
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Pointer initialization target at %L must have the TARGET attribute"
-msgstr "Ziel der Zeigerinitialisierung bei %C muss das TARGET-Attribut haben"
+msgstr "Ziel der Zeigerinitialisierung bei %L muss das TARGET-Attribut haben"
#: fortran/expr.c:3827 fortran/resolve.c:1256
#, gcc-internal-format, gfc-internal-format
@@ -39142,24 +39142,24 @@ msgid "Removing call to function '%s' at %L"
msgstr "Aufruf von Funktion »%s« bei %L wird entfernt"
#: fortran/frontend-passes.c:1474
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L set to undefined value inside loop beginning at %L as INTENT(OUT) argument to subroutine '%s'"
-msgstr "Variable »%s« bei %C kann nicht innerhalb der bei %L beginnenden Schleife redefiniert werden"
+msgstr "Variable »%s« bei %L auf undefinierten Wert innerhalb der bei %L beginnenden Schleife gesetzt, als INTENT(OUT)-Argument für Unterprogramm »%s«"
#: fortran/frontend-passes.c:1480
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L not definable inside loop beginning at %L as INTENT(INOUT) argument to subroutine '%s'"
-msgstr "Variable »%s« bei %C kann nicht innerhalb der bei %L beginnenden Schleife redefiniert werden"
+msgstr "Variable »%s« bei %L kann nicht innerhalb der bei %L beginnenden Schleife als INTENT(INOUT)-Argument für Unterprogramm »%s« definiert werden"
#: fortran/frontend-passes.c:1544
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L set to undefined value inside loop beginning at %L as INTENT(OUT) argument to function '%s'"
-msgstr "Variable »%s« bei %C kann nicht innerhalb der bei %L beginnenden Schleife redefiniert werden"
+msgstr "Variable »%s« bei %L auf undefinierten Wert innerhalb der bei %L beginnenden Schleife gesetzt, als INTENT(OUT)-Argument für Funktion »%s«"
#: fortran/frontend-passes.c:1550
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Variable '%s' at %L not definable inside loop beginning at %L as INTENT(INOUT) argument to function '%s'"
-msgstr "Variable »%s« bei %C kann nicht innerhalb der bei %L beginnenden Schleife redefiniert werden"
+msgstr "Variable »%s« bei %L kann nicht innerhalb der bei %L beginnenden Schleife als INTENT(INOUT)-Argument für Funktion »%s« definiert werden"
#: fortran/gfortranspec.c:168
#, gcc-internal-format
@@ -39187,9 +39187,9 @@ msgid "Dummy procedure '%s' at %C cannot have a generic interface"
msgstr "Scheinprozedur »%s« bei %C kann keine allgemeine Schnittstelle haben"
#: fortran/interface.c:254
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ABSTRACT INTERFACE at %C"
-msgstr " ABSTRAKTE SCHNITTSTELLE"
+msgstr "ABSTRACT INTERFACE bei %C"
#: fortran/interface.c:262
#, gcc-internal-format, gfc-internal-format
@@ -39302,9 +39302,9 @@ msgid "In %s at %L procedures must be all FUNCTIONs as the generic name is also
msgstr "In %s bei %L müssen alle Prozeduren auch FUNCTIONs sein, da der allgemeine Name auch der Name des abgeleiteten Typs ist"
#: fortran/interface.c:1491
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Internal procedure '%s' in %s at %L"
-msgstr "Fortran 2008: Interne Prozedur »%s« in %s bei %L"
+msgstr "Interne Prozedur »%s« in %s bei %L"
#: fortran/interface.c:1548 fortran/interface.c:1552
#, gcc-internal-format, gfc-internal-format
@@ -39322,9 +39322,9 @@ msgid "'%s' at %L is not a module procedure"
msgstr "»%s« bei %L ist keine Modulprozedur"
#: fortran/interface.c:1804
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "The assumed-rank array at %L requires that the dummy argument '%s' has assumed-rank"
-msgstr "Feld mit vermuteter Form bei %L muss ein Scheinargument sein"
+msgstr "Feld mit vermutetem Rang bei %L erfordert Scheinargument »%s« mit vermutetem Rang"
#: fortran/interface.c:1809
#, gcc-internal-format, gfc-internal-format
@@ -39352,7 +39352,7 @@ msgid "Interface mismatch in dummy procedure '%s' at %L: %s"
msgstr "Schnittstelle in Scheinprozedur »%s« bei %L passt nicht: %s"
#: fortran/interface.c:1894
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Actual argument to contiguous pointer dummy '%s' at %L must be simply contiguous"
msgstr "Effektives Argument für fortlaufenden Schein-Zeiger »%s« bei %L muss einfach fortlaufend sein"
@@ -39374,7 +39374,7 @@ msgstr "Effektives Argument für »%s« bei %L muss den selben deklarierten Typ
#: fortran/interface.c:1946
#, gcc-internal-format, gfc-internal-format
msgid "Actual argument to '%s' at %L must be unlimited polymorphic since the formal argument is a pointer or allocatable unlimited polymorphic entity [F2008: 12.5.2.5]"
-msgstr ""
+msgstr "Effektives Argument für »%s« bei %L muss unbegrenzt polymorph sein, da das formale Argument ein Zeiger oder reservierbare unbegrenzt polymorphe Entität ist [F2008: 12.5.2.5]"
#: fortran/interface.c:1957
#, gcc-internal-format, gfc-internal-format
@@ -39632,9 +39632,9 @@ msgid "Keyword argument requires explicit interface for procedure '%s' at %L"
msgstr "Schlüsselwort-Argument erfordert explizite Schnittstelle für Prozedur »%s« bei %L"
#: fortran/interface.c:3171
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Assumed-type argument %s at %L requires an explicit interface"
-msgstr "Symbol »%s« bei %L hat bereits eine explizite Schnittstelle"
+msgstr "Argument »%s« bei %L vermuteten Typs erfordert eine explizite Schnittstelle"
#: fortran/interface.c:3184
#, gcc-internal-format, gfc-internal-format
@@ -39647,9 +39647,9 @@ msgid "MOLD argument to NULL required at %L"
msgstr "MOLD-Argument an NULL bei %L erforderlich"
#: fortran/interface.c:3201
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Assumed-rank argument requires an explicit interface at %L"
-msgstr "Schlüsselwort-Argument erfordert explizite Schnittstelle für Prozedur »%s« bei %L"
+msgstr "Argument vermuteten Ranges erfordert eine explizite Schnittstelle bei %L"
#: fortran/interface.c:3238
#, gcc-internal-format, gfc-internal-format
@@ -39667,9 +39667,9 @@ msgid "MOLD= required in NULL() argument at %L: Ambiguity between specific funct
msgstr "In NULL()-Argument bei %L wird MOLD= benötigt: Mehrdeutig zwischen spezifischen Funktionen %s und %s"
#: fortran/interface.c:3785
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Entity '%s' at %L is already present in the interface"
-msgstr "Entität »%s« bei %C ist bereits in der Schnittstelle vorhanden"
+msgstr "Entität »%s« bei %L ist bereits in der Schnittstelle vorhanden"
#: fortran/interface.c:3996
#, gcc-internal-format, gfc-internal-format
@@ -39712,9 +39712,9 @@ msgid "'%s' at %L overrides a FUNCTION and must also be a FUNCTION"
msgstr "»%s« bei %L überschreibt eine FUNCTION und muss auch eine FUNCTION sein"
#: fortran/interface.c:4067
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Result mismatch for the overriding procedure '%s' at %L: %s"
-msgstr "Unpassende Argumente für die überschreibende Prozedur »%s« bei %L: %s"
+msgstr "Unpassendes Ergebnis für die überschreibende Prozedur »%s« bei %L: %s"
#: fortran/interface.c:4078
#, gcc-internal-format, gfc-internal-format
@@ -39797,14 +39797,14 @@ msgid "Intrinsic '%s' (is %s) is used at %L"
msgstr "Intrinsisches »%s« (ist %s) wird bei %L verwendet"
#: fortran/intrinsic.c:4097
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Function '%s' as initialization expression at %L"
-msgstr "Fortran 2003: Funktion »%s« als Initialisierungsausdruck bei %L"
+msgstr "Funktion »%s« als Initialisierungsausdruck bei %L"
#: fortran/intrinsic.c:4173
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Elemental function as initialization expression with non-integer/non-character arguments at %L"
-msgstr "Fortran 2003: Elementare Funktion als Initialisierungsausdruck mit Nicht-Ganzzahl-/Nicht-Zeichen-Argumenten bei %L"
+msgstr "Elementare Funktion als Initialisierungsausdruck mit Nicht-Ganzzahl-/Nicht-Zeichen-Argumenten bei %L"
#: fortran/intrinsic.c:4234
#, gcc-internal-format, gfc-internal-format
@@ -39842,24 +39842,24 @@ msgid "Extension: Tab character in format at %C"
msgstr "Erweiterung: Tab-Zeichen im Format bei %C"
#: fortran/io.c:455
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "DP format specifier not allowed at %C"
-msgstr "Fortran 2003: DP-Format-Spezifizierer bei %C nicht erlaubt"
+msgstr "DP-Format-Spezifizierer bei %C nicht erlaubt"
#: fortran/io.c:462
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "DC format specifier not allowed at %C"
-msgstr "Fortran 2003: DC-Format-Spezifizierer bei %C nicht erlaubt"
+msgstr "DC-Format-Spezifizierer bei %C nicht erlaubt"
#: fortran/io.c:651
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "X descriptor requires leading space count at %L"
-msgstr "Erweiterung: X-Deskriptor benötigt führenden Leerzeichenzähler bei %L"
+msgstr "X-Deskriptor erfordert führenden Leerzeichenzähler bei %L"
#: fortran/io.c:681
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "$ descriptor at %L"
-msgstr "Erweiterung: $-Deskriptor bei %L"
+msgstr "$-Deskriptor bei %L"
#: fortran/io.c:686
#, gcc-internal-format, gfc-internal-format
@@ -39872,9 +39872,9 @@ msgid "Extension: Missing positive width after L descriptor at %L"
msgstr "Erweiterung: Positive Breite hinter L-Deskriptor bei %L fehlt"
#: fortran/io.c:828
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "'G0' in format at %L"
-msgstr "Fortran 2008: »G0« in Format bei %L"
+msgstr "»G0« in Format bei %L"
#: fortran/io.c:856
#, gcc-internal-format, gfc-internal-format
@@ -39897,9 +39897,9 @@ msgid "The H format specifier at %L is a Fortran 95 deleted feature"
msgstr "Das Formatspezifikationssymbol H bei %L ist eine in Fortran 95 entfernte Besonderheit"
#: fortran/io.c:1061 fortran/io.c:1124
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Missing comma at %L"
-msgstr "Erweiterung: Fehlendes Komma bei %L"
+msgstr "Fehlendes Komma bei %L"
#: fortran/io.c:1143
#, gcc-internal-format, gfc-internal-format
@@ -39957,9 +39957,9 @@ msgid "FORMAT tag at %L must be of type default-kind CHARACTER or of INTEGER"
msgstr "FORMAT-Markierung bei %L muss vom Typ Standard-CHARACTER oder INTEGER sein"
#: fortran/io.c:1409
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ASSIGNED variable in FORMAT tag at %L"
-msgstr "Gelöschte Funktion: ASSIGNED-Variable in FORMAT-Markierung bei %L"
+msgstr "ASSIGNED-Variable in FORMAT-Markierung bei %L"
#: fortran/io.c:1415
#, gcc-internal-format, gfc-internal-format
@@ -39972,9 +39972,9 @@ msgid "Scalar '%s' in FORMAT tag at %L is not an ASSIGNED variable"
msgstr "Skalares »%s« in FORMAT-Marke bei %L ist keine ASSIGNED-Variable"
#: fortran/io.c:1434
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Non-character in FORMAT tag at %L"
-msgstr "Erweiterung: Nicht-Zeichen in FORMAT-Markierung bei %L"
+msgstr "Nicht-Zeichen in FORMAT-Markierung bei %L"
#: fortran/io.c:1440
#, gcc-internal-format, gfc-internal-format
@@ -40007,9 +40007,9 @@ msgid "%s tag at %L must be scalar"
msgstr "Markierung %s bei %L muss ein Skalar sein"
#: fortran/io.c:1500
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "IOMSG tag at %L"
-msgstr "Fortran 2003: IOMSG-Markierung bei %L"
+msgstr "IOMSG-Markierung bei %L"
#: fortran/io.c:1508
#, gcc-internal-format, gfc-internal-format
@@ -40017,19 +40017,19 @@ msgid "Fortran 95 requires default INTEGER in %s tag at %L"
msgstr "Fortran 95 erfordert Standard INTEGER in %s-Marke bei %L"
#: fortran/io.c:1516
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Nondefault LOGICAL in %s tag at %L"
-msgstr "Fortran 2008: Nicht-Standard-LOGICAL in %s-Marke bei %L"
+msgstr "Nicht-Standard-LOGICAL in %s-Marke bei %L"
#: fortran/io.c:1524
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "NEWUNIT specifier at %L"
-msgstr "bei %L wurde kein UNIT angegeben"
+msgstr "NEWUNIT-Spezifizierer bei %L"
#: fortran/io.c:1542
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "CONVERT tag at %L"
-msgstr "Erweiterung: CONVERT-Marke bei %L"
+msgstr "CONVERT-Marke bei %L"
#: fortran/io.c:1728
#, gcc-internal-format, gfc-internal-format
@@ -40037,9 +40037,9 @@ msgid "Fortran 2003: %s specifier in %s statement at %C has value '%s'"
msgstr "Fortran 2003: Spezifizierer %s in Anweisung %s bei %C hat Wert »%s«"
#: fortran/io.c:1736 fortran/io.c:1763
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "%s specifier in %s statement at %C has value '%s'"
-msgstr "Spezifizierer %s in Anweisung %s bei %C hat ungültigen Wert »%s«"
+msgstr "Spezifizierer %s in Anweisung %s bei %C hat Wert »%s«"
#: fortran/io.c:1755
#, gcc-internal-format, gfc-internal-format
@@ -40072,34 +40072,34 @@ msgid "OPEN statement at %C must have UNIT or NEWUNIT specified"
msgstr "OPEN-Anweisung bei %C muss UNIT oder NEWUNIT haben"
#: fortran/io.c:1898
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ASYNCHRONOUS= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: ASYNCHRONOUS= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "ASYNCHRONOUS= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:1916 fortran/io.c:3365
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "BLANK= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: BLANK= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "BLANK= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:1934 fortran/io.c:3344
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "DECIMAL= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: DECIMAL= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "DECIMAL= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:1966
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ENCODING= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: ENCODING= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "ENCODING= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:2017 fortran/io.c:3407
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ROUND= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: ROUND= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "ROUND= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:2037
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "SIGN= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: SIGN= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "SIGN= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:2250
#, gcc-internal-format, gfc-internal-format
@@ -40127,9 +40127,9 @@ msgid "UNIT number in statement at %L must be non-negative"
msgstr "UNIT-Zahl in Anweisung bei %L muss nicht-negativ sein"
#: fortran/io.c:2483
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "FLUSH statement at %C"
-msgstr "Fortran 2003: FLUSH-Anweisung bei %C"
+msgstr "FLUSH-Anweisung bei %C"
#: fortran/io.c:2539
#, gcc-internal-format, gfc-internal-format
@@ -40192,9 +40192,9 @@ msgid "NAMELIST '%s' in READ statement at %L contains the symbol '%s' which may
msgstr "NAMELIST »%s« in READ-Anweisung bei %L enthält Symbol »%s«, das im Kontext zur Variablendefinition nicht auftreten darf"
#: fortran/io.c:2914
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Comma before i/o item list at %L"
-msgstr "Erweiterung: Komma vor Ein-/Ausgabeelementliste bei %L"
+msgstr "Komma vor Ein-/Ausgabeelementliste bei %L"
#: fortran/io.c:2924
#, gcc-internal-format, gfc-internal-format
@@ -40238,9 +40238,9 @@ msgid "Syntax error in %s statement at %C"
msgstr "Syntaxfehler in Anweisung %s bei %C"
#: fortran/io.c:3260
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Internal file at %L with namelist"
-msgstr "Fortran 2003: Interne Datei bei %L mit Namensliste"
+msgstr "Interne Datei bei %L mit Namensliste"
#: fortran/io.c:3318
#, gcc-internal-format, gfc-internal-format
@@ -40248,14 +40248,14 @@ msgid "ASYNCHRONOUS= specifier at %L must be an initialization expression"
msgstr "Spezifikation ASYNCHRONOUS= bei %L muss ein Initialisierungsausdruck sein"
#: fortran/io.c:3386
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PAD= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: PAD= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "PAD= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:3452
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "DELIM= at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: DELIM= bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "DELIM= bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:3601
#, gcc-internal-format, gfc-internal-format
@@ -40298,9 +40298,9 @@ msgid "INQUIRE statement at %L requires a PENDING= specifier with the ID= specif
msgstr "INQUIRE-Anweisung bei %L erfordert PENDING= mit Spezifizierung ID="
#: fortran/io.c:4205
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "WAIT at %C not allowed in Fortran 95"
-msgstr "Fortran 2003: WAIT bei %C ist in Fortran 95 nicht erlaubt"
+msgstr "WAIT bei %C ist in Fortran 95 nicht erlaubt"
#: fortran/io.c:4211
#, gcc-internal-format, gfc-internal-format
@@ -40393,9 +40393,9 @@ msgid "Invalid form of PROGRAM statement at %C"
msgstr "Ungültige Form der PROGRAM-Anweisung bei %C"
#: fortran/match.c:1394 fortran/match.c:1475
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "Arithmetic IF statement at %C"
-msgstr "Veraltet: Arithmetische IF-Anweisung bei %C"
+msgstr "Arithmetische IF-Anweisung bei %C"
#: fortran/match.c:1450
#, gcc-internal-format, gfc-internal-format
@@ -40453,9 +40453,9 @@ msgid "Image control statement CRITICAL at %C in DO CONCURRENT block"
msgstr "CRITICAL-Anweisung zur Image-Steuerung bei %C in DO CONCURRENT-Block"
#: fortran/match.c:1759
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "CRITICAL statement at %C"
-msgstr "Fortran 2008: CRITICAL-Anweisung bei %C"
+msgstr "CRITICAL-Anweisung bei %C"
#: fortran/match.c:1771
#, gcc-internal-format, gfc-internal-format
@@ -40508,9 +40508,9 @@ msgid "Syntax error in FORALL iterator at %C"
msgstr "Syntaxfehler in FORALL-Iterator bei %C"
#: fortran/match.c:2383
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "DO CONCURRENT construct at %C"
-msgstr "Fortran 2008: DO CONCURRENT-Konstrukt bei %C"
+msgstr "DO CONCURRENT-Konstrukt bei %C"
#: fortran/match.c:2509
#, gcc-internal-format, gfc-internal-format
@@ -40549,9 +40549,9 @@ msgid "CYCLE statement at %C is not applicable to non-loop construct '%s'"
msgstr "CYCLE-Anweisung bei %C ist nicht auf Nicht-Schleifenkonstrukt »%s« anwendbar"
#: fortran/match.c:2582
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "EXIT statement with no do-construct-name at %C"
-msgstr "Fortran 2008: EXIT-Anweisung ohne DO-CONSTRUCT-Name bei %C"
+msgstr "EXIT-Anweisung ohne DO-CONSTRUCT-Name bei %C"
#: fortran/match.c:2588
#, gcc-internal-format, gfc-internal-format
@@ -40604,14 +40604,14 @@ msgid "STOP code at %L must be default integer KIND=%d"
msgstr "STOP-Code bei %L muss Standardganzzahltyp KIND=%d sein"
#: fortran/match.c:2773
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "PAUSE statement at %C"
-msgstr "Unerwartete CASE-Anweisung bei %C"
+msgstr "PAUSE-Anweisung bei %C"
#: fortran/match.c:2796
-#, fuzzy, gcc-internal-format, gfc-internal-format
+#, gcc-internal-format, gfc-internal-format
msgid "ERROR STOP statement at %C"
-msgstr "Fortran 2008: ERROR STOP-Anweisung bei %C"
+msgstr "ERROR STOP-Anweisung bei %C"
#: fortran/match.c:2822
#, gcc-internal-format, gfc-internal-format
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 1b94b5c7d73..b9befe0e9e8 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -1339,6 +1339,6 @@ struct rtl_opt_pass pass_gcse2 =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_verify_rtl_sharing
- | TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/predict.c b/gcc/predict.c
index 52a4bb46b12..91f66a8dc2a 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -122,6 +122,8 @@ maybe_hot_frequency_p (struct function *fun, int freq)
if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
&& freq < (ENTRY_BLOCK_PTR_FOR_FUNCTION (fun)->frequency * 2 / 3))
return false;
+ if (PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) == 0)
+ return false;
if (freq < (ENTRY_BLOCK_PTR_FOR_FUNCTION (fun)->frequency
/ PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
return false;
@@ -202,10 +204,13 @@ cgraph_maybe_hot_edge_p (struct cgraph_edge *edge)
if (edge->caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE
&& edge->frequency < CGRAPH_FREQ_BASE * 3 / 2)
return false;
- if (flag_guess_branch_prob
- && edge->frequency <= (CGRAPH_FREQ_BASE
- / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
- return false;
+ if (flag_guess_branch_prob)
+ {
+ if (PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) == 0
+ || edge->frequency <= (CGRAPH_FREQ_BASE
+ / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
+ return false;
+ }
return true;
}
@@ -2911,7 +2916,7 @@ struct gimple_opt_pass pass_profile =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
@@ -2931,7 +2936,7 @@ struct gimple_opt_pass pass_strip_predict_hints =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index 4c45e51ec7f..fe46464538e 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "intl.h"
#include "pretty-print.h"
+#include "diagnostic-color.h"
#if HAVE_ICONV
#include <iconv.h>
@@ -226,6 +227,8 @@ pp_base_indent (pretty_printer *pp)
%c: character.
%s: string.
%p: pointer.
+ %r: if pp_show_color(pp), switch to color identified by const char *.
+ %R: if pp_show_color(pp), reset color.
%m: strerror(text->err_no) - does not consume a value from args_ptr.
%%: '%'.
%<: opening quote.
@@ -300,18 +303,37 @@ pp_base_format (pretty_printer *pp, text_info *text)
continue;
case '<':
- obstack_grow (&buffer->chunk_obstack,
- open_quote, strlen (open_quote));
- p++;
- continue;
+ {
+ obstack_grow (&buffer->chunk_obstack,
+ open_quote, strlen (open_quote));
+ const char *colorstr
+ = colorize_start (pp_show_color (pp), "quote");
+ obstack_grow (&buffer->chunk_obstack, colorstr, strlen (colorstr));
+ p++;
+ continue;
+ }
case '>':
+ {
+ const char *colorstr = colorize_stop (pp_show_color (pp));
+ obstack_grow (&buffer->chunk_obstack, colorstr, strlen (colorstr));
+ }
+ /* FALLTHRU */
case '\'':
obstack_grow (&buffer->chunk_obstack,
close_quote, strlen (close_quote));
p++;
continue;
+ case 'R':
+ {
+ const char *colorstr = colorize_stop (pp_show_color (pp));
+ obstack_grow (&buffer->chunk_obstack, colorstr,
+ strlen (colorstr));
+ p++;
+ continue;
+ }
+
case 'm':
{
const char *errstr = xstrerror (text->err_no);
@@ -466,10 +488,19 @@ pp_base_format (pretty_printer *pp, text_info *text)
gcc_assert (!wide || precision == 0);
if (quote)
- pp_string (pp, open_quote);
+ {
+ pp_string (pp, open_quote);
+ pp_string (pp, colorize_start (pp_show_color (pp), "quote"));
+ }
switch (*p)
{
+ case 'r':
+ pp_string (pp, colorize_start (pp_show_color (pp),
+ va_arg (*text->args_ptr,
+ const char *)));
+ break;
+
case 'c':
pp_character (pp, va_arg (*text->args_ptr, int));
break;
@@ -563,7 +594,10 @@ pp_base_format (pretty_printer *pp, text_info *text)
}
if (quote)
- pp_string (pp, close_quote);
+ {
+ pp_string (pp, colorize_stop (pp_show_color (pp)));
+ pp_string (pp, close_quote);
+ }
obstack_1grow (&buffer->chunk_obstack, '\0');
*formatters[argno] = XOBFINISH (&buffer->chunk_obstack, const char *);
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index 56d2d3e8945..13bb2dede90 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -151,6 +151,9 @@ typedef bool (*printer_fn) (pretty_printer *, text_info *, const char *,
output. */
#define pp_translate_identifiers(PP) pp_base (PP)->translate_identifiers
+/* True if colors should be shown. */
+#define pp_show_color(PP) pp_base (PP)->show_color
+
/* The data structure that contains the bare minimum required to do
proper pretty-printing. Clients may derived from this structure
and add additional fields they need. */
@@ -194,6 +197,9 @@ struct pretty_print_info
/* Nonzero means identifiers are translated to the locale character
set on output. */
bool translate_identifiers;
+
+ /* Nonzero means that text should be colorized. */
+ bool show_color;
};
#define pp_set_line_maximum_length(PP, L) \
diff --git a/gcc/profile.c b/gcc/profile.c
index 2c2680c5ff2..6f05581711c 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -82,11 +82,6 @@ struct bb_info {
const struct gcov_ctr_summary *profile_info;
-/* Number of data points in the working set summary array. Using 128
- provides information for at least every 1% increment of the total
- profile size. The last entry is hardwired to 99.9% of the total. */
-#define NUM_GCOV_WORKING_SETS 128
-
/* Counter working set information computed from the current counter
summary. Not initialized unless profile_info summary is non-NULL. */
static gcov_working_set_t gcov_working_sets[NUM_GCOV_WORKING_SETS];
@@ -199,110 +194,18 @@ instrument_values (histogram_values values)
}
-/* Compute the working set information from the counter histogram in
- the profile summary. This is an array of information corresponding to a
- range of percentages of the total execution count (sum_all), and includes
- the number of counters required to cover that working set percentage and
- the minimum counter value in that working set. */
+/* Fill the working set information into the profile_info structure. */
void
-compute_working_sets (void)
+get_working_sets (void)
{
- gcov_type working_set_cum_values[NUM_GCOV_WORKING_SETS];
- gcov_type ws_cum_hotness_incr;
- gcov_type cum, tmp_cum;
- const gcov_bucket_type *histo_bucket;
- unsigned ws_ix, c_num, count, pctinc, pct;
- int h_ix;
+ unsigned ws_ix, pctinc, pct;
gcov_working_set_t *ws_info;
if (!profile_info)
return;
- /* Compute the amount of sum_all that the cumulative hotness grows
- by in each successive working set entry, which depends on the
- number of working set entries. */
- ws_cum_hotness_incr = profile_info->sum_all / NUM_GCOV_WORKING_SETS;
-
- /* Next fill in an array of the cumulative hotness values corresponding
- to each working set summary entry we are going to compute below.
- Skip 0% statistics, which can be extrapolated from the
- rest of the summary data. */
- cum = ws_cum_hotness_incr;
- for (ws_ix = 0; ws_ix < NUM_GCOV_WORKING_SETS;
- ws_ix++, cum += ws_cum_hotness_incr)
- working_set_cum_values[ws_ix] = cum;
- /* The last summary entry is reserved for (roughly) 99.9% of the
- working set. Divide by 1024 so it becomes a shift, which gives
- almost exactly 99.9%. */
- working_set_cum_values[NUM_GCOV_WORKING_SETS-1]
- = profile_info->sum_all - profile_info->sum_all/1024;
-
- /* Next, walk through the histogram in decending order of hotness
- and compute the statistics for the working set summary array.
- As histogram entries are accumulated, we check to see which
- working set entries have had their expected cum_value reached
- and fill them in, walking the working set entries in increasing
- size of cum_value. */
- ws_ix = 0; /* The current entry into the working set array. */
- cum = 0; /* The current accumulated counter sum. */
- count = 0; /* The current accumulated count of block counters. */
- for (h_ix = GCOV_HISTOGRAM_SIZE - 1;
- h_ix >= 0 && ws_ix < NUM_GCOV_WORKING_SETS; h_ix--)
- {
- histo_bucket = &profile_info->histogram[h_ix];
-
- /* If we haven't reached the required cumulative counter value for
- the current working set percentage, simply accumulate this histogram
- entry into the running sums and continue to the next histogram
- entry. */
- if (cum + histo_bucket->cum_value < working_set_cum_values[ws_ix])
- {
- cum += histo_bucket->cum_value;
- count += histo_bucket->num_counters;
- continue;
- }
-
- /* If adding the current histogram entry's cumulative counter value
- causes us to exceed the current working set size, then estimate
- how many of this histogram entry's counter values are required to
- reach the working set size, and fill in working set entries
- as we reach their expected cumulative value. */
- for (c_num = 0, tmp_cum = cum;
- c_num < histo_bucket->num_counters && ws_ix < NUM_GCOV_WORKING_SETS;
- c_num++)
- {
- count++;
- /* If we haven't reached the last histogram entry counter, add
- in the minimum value again. This will underestimate the
- cumulative sum so far, because many of the counter values in this
- entry may have been larger than the minimum. We could add in the
- average value every time, but that would require an expensive
- divide operation. */
- if (c_num + 1 < histo_bucket->num_counters)
- tmp_cum += histo_bucket->min_value;
- /* If we have reached the last histogram entry counter, then add
- in the entire cumulative value. */
- else
- tmp_cum = cum + histo_bucket->cum_value;
-
- /* Next walk through successive working set entries and fill in
- the statistics for any whose size we have reached by accumulating
- this histogram counter. */
- while (ws_ix < NUM_GCOV_WORKING_SETS
- && tmp_cum >= working_set_cum_values[ws_ix])
- {
- gcov_working_sets[ws_ix].num_counters = count;
- gcov_working_sets[ws_ix].min_counter
- = histo_bucket->min_value;
- ws_ix++;
- }
- }
- /* Finally, update the running cumulative value since we were
- using a temporary above. */
- cum += histo_bucket->cum_value;
- }
- gcc_assert (ws_ix == NUM_GCOV_WORKING_SETS);
+ compute_working_sets (profile_info, gcov_working_sets);
if (dump_file)
{
@@ -372,7 +275,7 @@ get_exec_counts (unsigned cfg_checksum, unsigned lineno_checksum)
if (!counts)
return NULL;
- compute_working_sets();
+ get_working_sets();
if (dump_file && profile_info)
fprintf(dump_file, "Merged %u profiles with maximal count %u.\n",
@@ -849,7 +752,7 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
if (bb->count)
{
FOR_EACH_EDGE (e, ei, bb->succs)
- e->probability = (e->count * REG_BR_PROB_BASE + bb->count / 2) / bb->count;
+ e->probability = GCOV_COMPUTE_SCALE (e->count, bb->count);
if (bb->index >= NUM_FIXED_BLOCKS
&& block_ends_with_condjump_p (bb)
&& EDGE_COUNT (bb->succs) >= 2)
diff --git a/gcc/profile.h b/gcc/profile.h
index c7d5f1aa62c..d0b637de53b 100644
--- a/gcc/profile.h
+++ b/gcc/profile.h
@@ -46,7 +46,7 @@ extern gcov_type sum_edge_counts (vec<edge, va_gc> *edges);
extern void init_node_map (void);
extern void del_node_map (void);
-extern void compute_working_sets (void);
+extern void get_working_sets (void);
/* In predict.c. */
extern gcov_type get_hot_bb_threshold (void);
diff --git a/gcc/ree.c b/gcc/ree.c
index ff96df8a016..c0d43c8f72a 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -919,8 +919,6 @@ find_and_remove_re (void)
if (dump_file && num_re_opportunities > 0)
fprintf (dump_file, "Elimination opportunities = %d realized = %d\n",
num_re_opportunities, num_realized);
-
- df_finish_pass (false);
}
/* Find and remove redundant extensions. */
@@ -958,7 +956,7 @@ struct rtl_opt_pass pass_ree =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect |
- TODO_verify_rtl_sharing, /* todo_flags_finish */
+ TODO_df_finish
+ | TODO_verify_rtl_sharing, /* todo_flags_finish */
}
};
diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def
index db61c092aab..3b1d27ca8a7 100644
--- a/gcc/reg-notes.def
+++ b/gcc/reg-notes.def
@@ -172,11 +172,6 @@ REG_NOTE (CFA_WINDOW_SAVE)
the rest of the compiler as a CALL_INSN. */
REG_NOTE (CFA_FLUSH_QUEUE)
-/* Indicates that REG holds the exception context for the function.
- This context is shared by inline functions, so the code to acquire
- the real exception context is delayed until after inlining. */
-REG_NOTE (EH_CONTEXT)
-
/* Indicates what exception region an INSN belongs in. This is used
to indicate what region to which a call may throw. REGION 0
indicates that a call cannot throw at all. REGION -1 indicates
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index d6a39e14aa7..28127878987 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -3344,7 +3344,6 @@ struct rtl_opt_pass pass_stack_regs_run =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 3d25fe07bad..1ce8a7ed285 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -1377,7 +1377,6 @@ struct rtl_opt_pass pass_regmove =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
}
};
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 82b54e2a14e..30efd79be82 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -921,8 +921,8 @@ get_branch_condition (rtx insn, rtx target)
if (condjump_in_parallel_p (insn))
pat = XVECEXP (pat, 0, 0);
- if (ANY_RETURN_P (pat))
- return pat == target ? const_true_rtx : 0;
+ if (ANY_RETURN_P (pat) && pat == target)
+ return const_true_rtx;
if (GET_CODE (pat) != SET || SET_DEST (pat) != pc_rtx)
return 0;
@@ -933,14 +933,16 @@ get_branch_condition (rtx insn, rtx target)
else if (GET_CODE (src) == IF_THEN_ELSE
&& XEXP (src, 2) == pc_rtx
- && GET_CODE (XEXP (src, 1)) == LABEL_REF
- && XEXP (XEXP (src, 1), 0) == target)
+ && ((GET_CODE (XEXP (src, 1)) == LABEL_REF
+ && XEXP (XEXP (src, 1), 0) == target)
+ || (ANY_RETURN_P (XEXP (src, 1)) && XEXP (src, 1) == target)))
return XEXP (src, 0);
else if (GET_CODE (src) == IF_THEN_ELSE
&& XEXP (src, 1) == pc_rtx
- && GET_CODE (XEXP (src, 2)) == LABEL_REF
- && XEXP (XEXP (src, 2), 0) == target)
+ && ((GET_CODE (XEXP (src, 2)) == LABEL_REF
+ && XEXP (XEXP (src, 2), 0) == target)
+ || (ANY_RETURN_P (XEXP (src, 2)) && XEXP (src, 2) == target)))
{
enum rtx_code rev;
rev = reversed_comparison_code (XEXP (src, 0), insn);
@@ -2129,99 +2131,79 @@ fill_simple_delay_slots (int non_jumps_p)
Presumably, we should also check to see if we could get
back to this function via `setjmp'. */
&& ! can_throw_internal (insn)
- && (!JUMP_P (insn)
- || ((condjump_p (insn) || condjump_in_parallel_p (insn))
- && ! simplejump_p (insn)
- && !ANY_RETURN_P (JUMP_LABEL (insn)))))
+ && !JUMP_P (insn))
{
- /* Invariant: If insn is a JUMP_INSN, the insn's jump
- label. Otherwise, zero. */
- rtx target = 0;
int maybe_never = 0;
rtx pat, trial_delay;
CLEAR_RESOURCE (&needed);
CLEAR_RESOURCE (&set);
+ mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
+ mark_referenced_resources (insn, &needed, true);
if (CALL_P (insn))
+ maybe_never = 1;
+
+ for (trial = next_nonnote_insn (insn); !stop_search_p (trial, 1);
+ trial = next_trial)
{
- mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
- mark_referenced_resources (insn, &needed, true);
- maybe_never = 1;
- }
- else
- {
- mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
- mark_referenced_resources (insn, &needed, true);
- if (JUMP_P (insn))
- target = JUMP_LABEL (insn);
- }
+ next_trial = next_nonnote_insn (trial);
+
+ /* This must be an INSN or CALL_INSN. */
+ pat = PATTERN (trial);
- if (target == 0 || ANY_RETURN_P (target))
- for (trial = next_nonnote_insn (insn); !stop_search_p (trial, 1);
- trial = next_trial)
- {
- next_trial = next_nonnote_insn (trial);
+ /* Stand-alone USE and CLOBBER are just for flow. */
+ if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
+ continue;
- /* This must be an INSN or CALL_INSN. */
- pat = PATTERN (trial);
+ /* If this already has filled delay slots, get the insn needing
+ the delay slots. */
+ if (GET_CODE (pat) == SEQUENCE)
+ trial_delay = XVECEXP (pat, 0, 0);
+ else
+ trial_delay = trial;
- /* Stand-alone USE and CLOBBER are just for flow. */
- if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
- continue;
+ /* Stop our search when seeing a jump. */
+ if (JUMP_P (trial_delay))
+ break;
- /* If this already has filled delay slots, get the insn needing
- the delay slots. */
- if (GET_CODE (pat) == SEQUENCE)
- trial_delay = XVECEXP (pat, 0, 0);
- else
- trial_delay = trial;
-
- /* Stop our search when seeing a jump. */
- if (JUMP_P (trial_delay))
- break;
-
- /* See if we have a resource problem before we try to
- split. */
- if (GET_CODE (pat) != SEQUENCE
- && ! insn_references_resource_p (trial, &set, true)
- && ! insn_sets_resource_p (trial, &set, true)
- && ! insn_sets_resource_p (trial, &needed, true)
+ /* See if we have a resource problem before we try to split. */
+ if (GET_CODE (pat) != SEQUENCE
+ && ! insn_references_resource_p (trial, &set, true)
+ && ! insn_sets_resource_p (trial, &set, true)
+ && ! insn_sets_resource_p (trial, &needed, true)
#ifdef HAVE_cc0
- && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
+ && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
#endif
- && ! (maybe_never && may_trap_or_fault_p (pat))
- && (trial = try_split (pat, trial, 0))
- && eligible_for_delay (insn, slots_filled, trial, flags)
- && ! can_throw_internal(trial))
- {
- next_trial = next_nonnote_insn (trial);
- delay_list = add_to_delay_list (trial, delay_list);
-
+ && ! (maybe_never && may_trap_or_fault_p (pat))
+ && (trial = try_split (pat, trial, 0))
+ && eligible_for_delay (insn, slots_filled, trial, flags)
+ && ! can_throw_internal(trial))
+ {
+ next_trial = next_nonnote_insn (trial);
+ delay_list = add_to_delay_list (trial, delay_list);
#ifdef HAVE_cc0
- if (reg_mentioned_p (cc0_rtx, pat))
- link_cc0_insns (trial);
+ if (reg_mentioned_p (cc0_rtx, pat))
+ link_cc0_insns (trial);
#endif
+ delete_related_insns (trial);
+ if (slots_to_fill == ++slots_filled)
+ break;
+ continue;
+ }
- delete_related_insns (trial);
- if (slots_to_fill == ++slots_filled)
- break;
- continue;
- }
-
- mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
- mark_referenced_resources (trial, &needed, true);
+ mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
+ mark_referenced_resources (trial, &needed, true);
- /* Ensure we don't put insns between the setting of cc and the
- comparison by moving a setting of cc into an earlier delay
- slot since these insns could clobber the condition code. */
- set.cc = 1;
+ /* Ensure we don't put insns between the setting of cc and the
+ comparison by moving a setting of cc into an earlier delay
+ slot since these insns could clobber the condition code. */
+ set.cc = 1;
- /* If this is a call or jump, we might not get here. */
- if (CALL_P (trial_delay)
- || JUMP_P (trial_delay))
- maybe_never = 1;
- }
+ /* If this is a call, we might not get here. */
+ if (CALL_P (trial_delay))
+ maybe_never = 1;
+ }
/* If there are slots left to fill and our search was stopped by an
unconditional branch, try the insn at the branch target. We can
@@ -2232,7 +2214,6 @@ fill_simple_delay_slots (int non_jumps_p)
&& trial
&& jump_to_label_p (trial)
&& simplejump_p (trial)
- && (target == 0 || JUMP_LABEL (trial) == target)
&& (next_trial = next_active_insn (JUMP_LABEL (trial))) != 0
&& ! (NONJUMP_INSN_P (next_trial)
&& GET_CODE (PATTERN (next_trial)) == SEQUENCE)
@@ -2264,11 +2245,6 @@ fill_simple_delay_slots (int non_jumps_p)
delay_list);
slots_filled++;
reorg_redirect_jump (trial, new_label);
-
- /* If we merged because we both jumped to the same place,
- redirect the original insn also. */
- if (target)
- reorg_redirect_jump (insn, new_label);
}
}
}
@@ -3907,7 +3883,7 @@ struct rtl_opt_pass pass_delay_slots =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -3942,6 +3918,6 @@ struct rtl_opt_pass pass_machine_reorg =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
diff --git a/gcc/resource.c b/gcc/resource.c
index 333c28f57e8..6051313732e 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -990,9 +990,10 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
/* If this insn is a USE made by update_block, we care about the
underlying insn. */
- if (code == INSN && GET_CODE (PATTERN (insn)) == USE
+ if (code == INSN
+ && GET_CODE (PATTERN (insn)) == USE
&& INSN_P (XEXP (PATTERN (insn), 0)))
- real_insn = XEXP (PATTERN (insn), 0);
+ real_insn = XEXP (PATTERN (insn), 0);
if (CALL_P (real_insn))
{
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 47a37623c6d..f8aea32b397 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -102,10 +102,24 @@ DEF_RTL_EXPR(EXPR_LIST, "expr_list", "ee", RTX_EXTRA)
The insns are represented in print by their uids. */
DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
-/* SEQUENCE appears in the result of a `gen_...' function
- for a DEFINE_EXPAND that wants to make several insns.
- Its elements are the bodies of the insns that should be made.
- `emit_insn' takes the SEQUENCE apart and makes separate insns. */
+/* SEQUENCE is used in late passes of the compiler to group insns for
+ one reason or another.
+
+ For example, after delay slot filling, branch instructions with filled
+ delay slots are represented as a SEQUENCE of length 1 + n_delay_slots,
+ with the branch instruction in XEXPVEC(seq, 0, 0) and the instructions
+ occupying the delay slots in the remaining XEXPVEC slots.
+
+ Another place where a SEQUENCE may appear, is in REG_FRAME_RELATED_EXPR
+ notes, to express complex operations that are not obvious from the insn
+ to which the REG_FRAME_RELATED_EXPR note is attached. In this usage of
+ SEQUENCE, the sequence vector slots do not hold real instructions but
+ only pseudo-instructions that can be translated to DWARF CFA expressions.
+
+ Some back ends also use SEQUENCE to group insns in bundles.
+
+ Much of the compiler infrastructure is not prepared to handle SEQUENCE
+ objects. Only passes after pass_free_cfg are expected to handle them. */
DEF_RTL_EXPR(SEQUENCE, "sequence", "E", RTX_EXTRA)
/* Represents a non-global base address. This is only used in alias.c. */
@@ -1290,8 +1304,41 @@ DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s", RTX_EXTRA)
true, the second operand will be used as the value of the conditional. */
DEF_RTL_EXPR(COND, "cond", "Ee", RTX_EXTRA)
+/* Definition of a pattern substitution meta operation on a DEFINE_EXPAND
+ or a DEFINE_INSN. Automatically generates new instances of DEFINE_INSNs
+ that match the substitution pattern.
+
+ Operand:
+ 0: The name of the substitition template.
+ 1: Input template to match to see if a substitution is applicable.
+ 2: A C expression giving an additional condition for the generated
+ new define_expand or define_insn.
+ 3: Output tempalate to generate via substitution.
+
+ Within a DEFINE_SUBST template, the meaning of some RTL expressions is
+ different from their usual interpretation: a MATCH_OPERAND matches any
+ expression tree with matching machine mode or with VOIDmode. Likewise,
+ MATCH_OP_DUP and MATCH_DUP match more liberally in a DEFINE_SUBST than
+ in other RTL expressions. MATCH_OPERATOR matches all common operators
+ but also UNSPEC, UNSPEC_VOLATILE, and MATCH_OPERATORS from the input
+ DEFINE_EXPAND or DEFINE_INSN. */
DEF_RTL_EXPR(DEFINE_SUBST, "define_subst", "sEsE", RTX_EXTRA)
+
+/* Substitution attribute to apply a DEFINE_SUBST to a pattern.
+
+ Operand:
+ 0: The name of the subst-attribute.
+ 1: The name of the DEFINE_SUBST to be applied for this attribute.
+ 2: String to substitute for the subst-attribute name in the pattern
+ name, for the case that the DEFINE_SUBST is not applied (i.e. the
+ unmodified version of the pattern).
+ 3: String to substitute for the subst-attribute name in the pattern
+ name, for the case that the DEFINE_SUBST is applied to the patten.
+
+ The use of DEFINE_SUBST and DEFINE_SUBST_ATTR is explained in the
+ GCC internals manual, under "RTL Templates Transformations". */
DEF_RTL_EXPR(DEFINE_SUBST_ATTR, "define_subst_attr", "ssss", RTX_EXTRA)
+
#endif /* GENERATOR_FILE */
/*
diff --git a/gcc/rtl.h b/gcc/rtl.h
index ea2a1ccc599..eea80ef399c 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1657,7 +1657,7 @@ do { \
#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) \
|| defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT) \
- || defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_PRE_MODIFY_DISP) \
+ || defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_POST_MODIFY_DISP) \
|| defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_REG))
#define AUTO_INC_DEC
#endif
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 07857f2d6bf..fde684fec3a 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -3680,12 +3680,6 @@ deps_analyze_insn (struct deps_desc *deps, rtx insn)
if (sched_deps_info->use_cselib)
cselib_process_insn (insn);
- /* EH_REGION insn notes can not appear until well after we complete
- scheduling. */
- if (NOTE_P (insn))
- gcc_assert (NOTE_KIND (insn) != NOTE_INSN_EH_REGION_BEG
- && NOTE_KIND (insn) != NOTE_INSN_EH_REGION_END);
-
if (sched_deps_info->finish_insn)
sched_deps_info->finish_insn ();
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 24a34142aa1..9ab33744780 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -21,10 +21,10 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_SCHED_INT_H
#define GCC_SCHED_INT_H
+#include "insn-attr.h"
+
#ifdef INSN_SCHEDULING
-/* For state_t. */
-#include "insn-attr.h"
#include "df.h"
#include "basic-block.h"
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index ad2fd6fb982..5ca1951672b 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -1441,6 +1441,7 @@ compute_dom_prob_ps (int bb)
FOR_EACH_EDGE (out_edge, out_ei, in_edge->src->succs)
bitmap_set_bit (pot_split[bb], EDGE_TO_BIT (out_edge));
+ /* Update to use apply_probability(). */
prob[bb] += ((prob[pred_bb] * in_edge->probability) / REG_BR_PROB_BASE);
}
@@ -1514,6 +1515,7 @@ compute_trg_info (int trg)
int tf = prob[trg], cf = prob[i];
/* In CFGs with low probability edges TF can possibly be zero. */
+ /* Update to use GCOV_COMPUTE_SCALE. */
sp->src_prob = (tf ? ((cf * REG_BR_PROB_BASE) / tf) : 0);
sp->is_valid = (sp->src_prob >= min_spec_prob);
}
@@ -3632,8 +3634,7 @@ struct rtl_opt_pass pass_sched =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
@@ -3654,7 +3655,6 @@ struct rtl_opt_pass pass_sched2 =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 1dc14209355..763230ccdb2 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -51,6 +51,9 @@ along with GCC; see the file COPYING3. If not see
static bool rtl_slim_pp_initialized = false;
static pretty_printer rtl_slim_pp;
+/* For insns we print patterns, and for some patterns we print insns... */
+static void print_insn_with_notes (pretty_printer *, const_rtx);
+
/* This recognizes rtx'en classified as expressions. These are always
represent some action on values or results of other expression, that
may be stored in objects representing values. */
@@ -562,13 +565,31 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose)
break;
case SEQUENCE:
{
- int i;
-
pp_string (pp, "sequence{");
- for (i = 0; i < XVECLEN (x, 0); i++)
+ if (INSN_P (XVECEXP (x, 0, 0)))
{
- print_pattern (pp, XVECEXP (x, 0, i), verbose);
- pp_character (pp, ';');
+ /* Print the sequence insns indented. */
+ const char * save_print_rtx_head = print_rtx_head;
+ char indented_print_rtx_head[32];
+
+ pp_newline (pp);
+ gcc_assert (strlen (print_rtx_head) < sizeof (indented_print_rtx_head) - 4);
+ snprintf (indented_print_rtx_head,
+ sizeof (indented_print_rtx_head),
+ "%s ", print_rtx_head);
+ print_rtx_head = indented_print_rtx_head;
+ for (int i = 0; i < XVECLEN (x, 0); i++)
+ print_insn_with_notes (pp, XVECEXP (x, 0, i));
+ pp_printf (pp, "%s ", save_print_rtx_head);
+ print_rtx_head = save_print_rtx_head;
+ }
+ else
+ {
+ for (int i = 0; i < XVECLEN (x, 0); i++)
+ {
+ print_pattern (pp, XVECEXP (x, 0, i), verbose);
+ pp_character (pp, ';');
+ }
}
pp_character (pp, '}');
}
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 91e91ec37fd..47e769534db 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -1065,6 +1065,9 @@ return_nop_to_pool (insn_t nop, bool full_tidying)
gcc_assert (INSN_IN_STREAM_P (nop));
sel_remove_insn (nop, false, full_tidying);
+ /* We'll recycle this nop. */
+ INSN_DELETED_P (nop) = 0;
+
if (nop_pool.n == nop_pool.s)
nop_pool.v = XRESIZEVEC (rtx, nop_pool.v,
(nop_pool.s = 2 * nop_pool.s + 1));
@@ -3929,31 +3932,19 @@ sel_remove_insn (insn_t insn, bool only_disconnect, bool full_tidying)
}
if (only_disconnect)
- {
- insn_t prev = PREV_INSN (insn);
- insn_t next = NEXT_INSN (insn);
- basic_block bb = BLOCK_FOR_INSN (insn);
-
- NEXT_INSN (prev) = next;
- PREV_INSN (next) = prev;
-
- if (BB_HEAD (bb) == insn)
- {
- gcc_assert (BLOCK_FOR_INSN (prev) == bb);
- BB_HEAD (bb) = prev;
- }
- if (BB_END (bb) == insn)
- BB_END (bb) = prev;
- }
+ remove_insn (insn);
else
{
- remove_insn (insn);
+ delete_insn (insn);
clear_expr (INSN_EXPR (insn));
}
- /* It is necessary to null this fields before calling add_insn (). */
+ /* It is necessary to NULL these fields in case we are going to re-insert
+ INSN into the insns stream, as will usually happen in the ONLY_DISCONNECT
+ case, but also for NOPs that we will return to the nop pool. */
PREV_INSN (insn) = NULL_RTX;
NEXT_INSN (insn) = NULL_RTX;
+ set_block_for_insn (insn, NULL);
return tidy_control_flow (bb, full_tidying);
}
diff --git a/gcc/sese.c b/gcc/sese.c
index 0812831acf7..7102b60bf9e 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -83,47 +83,6 @@ eq_rename_map_elts (const void *e1, const void *e2)
-/* Print to stderr the element ELT. */
-
-static void
-debug_ivtype_elt (ivtype_map_elt elt)
-{
- fprintf (stderr, "(%s, ", elt->cloog_iv);
- print_generic_expr (stderr, elt->type, 0);
- fprintf (stderr, ")\n");
-}
-
-/* Helper function for debug_ivtype_map. */
-
-static int
-debug_ivtype_map_1 (void **slot, void *s ATTRIBUTE_UNUSED)
-{
- struct ivtype_map_elt_s *entry = (struct ivtype_map_elt_s *) *slot;
- debug_ivtype_elt (entry);
- return 1;
-}
-
-/* Print to stderr all the elements of MAP. */
-
-DEBUG_FUNCTION void
-debug_ivtype_map (htab_t map)
-{
- htab_traverse (map, debug_ivtype_map_1, NULL);
-}
-
-/* Compares database elements E1 and E2. */
-
-int
-eq_ivtype_map_elts (const void *e1, const void *e2)
-{
- const struct ivtype_map_elt_s *elt1 = (const struct ivtype_map_elt_s *) e1;
- const struct ivtype_map_elt_s *elt2 = (const struct ivtype_map_elt_s *) e2;
-
- return (elt1->cloog_iv == elt2->cloog_iv);
-}
-
-
-
/* Record LOOP as occurring in REGION. */
static void
diff --git a/gcc/sese.h b/gcc/sese.h
index 5b6fe7f7aa1..8e1f7f74772 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -275,17 +275,6 @@ new_rename_map_elt (tree old_name, tree expr)
return res;
}
-/* Structure containing the mapping between the CLooG's induction
- variable and the type of the old induction variable. */
-typedef struct ivtype_map_elt_s
-{
- tree type;
- const char *cloog_iv;
-} *ivtype_map_elt;
-
-extern void debug_ivtype_map (htab_t);
-extern int eq_ivtype_map_elts (const void *, const void *);
-
/* Free and compute again all the dominators information. */
static inline void
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index c320bcf5807..791f91a34a8 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3560,6 +3560,31 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
return vec;
}
+ /* If we select elements in a vec_merge that all come from the same
+ operand, select from that operand directly. */
+ if (GET_CODE (op0) == VEC_MERGE)
+ {
+ rtx trueop02 = avoid_constant_pool_reference (XEXP (op0, 2));
+ if (CONST_INT_P (trueop02))
+ {
+ unsigned HOST_WIDE_INT sel = UINTVAL (trueop02);
+ bool all_operand0 = true;
+ bool all_operand1 = true;
+ for (int i = 0; i < XVECLEN (trueop1, 0); i++)
+ {
+ rtx j = XVECEXP (trueop1, 0, i);
+ if (sel & (1 << UINTVAL (j)))
+ all_operand1 = false;
+ else
+ all_operand0 = false;
+ }
+ if (all_operand0 && !side_effects_p (XEXP (op0, 1)))
+ return simplify_gen_binary (VEC_SELECT, mode, XEXP (op0, 0), op1);
+ if (all_operand1 && !side_effects_p (XEXP (op0, 0)))
+ return simplify_gen_binary (VEC_SELECT, mode, XEXP (op0, 1), op1);
+ }
+ }
+
return 0;
case VEC_CONCAT:
{
@@ -5224,7 +5249,7 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode,
{
unsigned int width = GET_MODE_PRECISION (mode);
bool any_change = false;
- rtx tem;
+ rtx tem, trueop2;
/* VOIDmode means "infinite" precision. */
if (width == 0)
@@ -5370,33 +5395,74 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode,
gcc_assert (GET_MODE (op0) == mode);
gcc_assert (GET_MODE (op1) == mode);
gcc_assert (VECTOR_MODE_P (mode));
- op2 = avoid_constant_pool_reference (op2);
- if (CONST_INT_P (op2))
+ trueop2 = avoid_constant_pool_reference (op2);
+ if (CONST_INT_P (trueop2))
{
- int elt_size = GET_MODE_SIZE (GET_MODE_INNER (mode));
+ int elt_size = GET_MODE_SIZE (GET_MODE_INNER (mode));
unsigned n_elts = (GET_MODE_SIZE (mode) / elt_size);
- int mask = (1 << n_elts) - 1;
+ unsigned HOST_WIDE_INT sel = UINTVAL (trueop2);
+ unsigned HOST_WIDE_INT mask;
+ if (n_elts == HOST_BITS_PER_WIDE_INT)
+ mask = -1;
+ else
+ mask = ((unsigned HOST_WIDE_INT) 1 << n_elts) - 1;
- if (!(INTVAL (op2) & mask))
+ if (!(sel & mask) && !side_effects_p (op0))
return op1;
- if ((INTVAL (op2) & mask) == mask)
+ if ((sel & mask) == mask && !side_effects_p (op1))
return op0;
- op0 = avoid_constant_pool_reference (op0);
- op1 = avoid_constant_pool_reference (op1);
- if (GET_CODE (op0) == CONST_VECTOR
- && GET_CODE (op1) == CONST_VECTOR)
+ rtx trueop0 = avoid_constant_pool_reference (op0);
+ rtx trueop1 = avoid_constant_pool_reference (op1);
+ if (GET_CODE (trueop0) == CONST_VECTOR
+ && GET_CODE (trueop1) == CONST_VECTOR)
{
rtvec v = rtvec_alloc (n_elts);
unsigned int i;
for (i = 0; i < n_elts; i++)
- RTVEC_ELT (v, i) = (INTVAL (op2) & (1 << i)
- ? CONST_VECTOR_ELT (op0, i)
- : CONST_VECTOR_ELT (op1, i));
+ RTVEC_ELT (v, i) = ((sel & ((unsigned HOST_WIDE_INT) 1 << i))
+ ? CONST_VECTOR_ELT (trueop0, i)
+ : CONST_VECTOR_ELT (trueop1, i));
return gen_rtx_CONST_VECTOR (mode, v);
}
+
+ /* Replace (vec_merge (vec_merge a b m) c n) with (vec_merge b c n)
+ if no element from a appears in the result. */
+ if (GET_CODE (op0) == VEC_MERGE)
+ {
+ tem = avoid_constant_pool_reference (XEXP (op0, 2));
+ if (CONST_INT_P (tem))
+ {
+ unsigned HOST_WIDE_INT sel0 = UINTVAL (tem);
+ if (!(sel & sel0 & mask) && !side_effects_p (XEXP (op0, 0)))
+ return simplify_gen_ternary (code, mode, mode,
+ XEXP (op0, 1), op1, op2);
+ if (!(sel & ~sel0 & mask) && !side_effects_p (XEXP (op0, 1)))
+ return simplify_gen_ternary (code, mode, mode,
+ XEXP (op0, 0), op1, op2);
+ }
+ }
+ if (GET_CODE (op1) == VEC_MERGE)
+ {
+ tem = avoid_constant_pool_reference (XEXP (op1, 2));
+ if (CONST_INT_P (tem))
+ {
+ unsigned HOST_WIDE_INT sel1 = UINTVAL (tem);
+ if (!(~sel & sel1 & mask) && !side_effects_p (XEXP (op1, 0)))
+ return simplify_gen_ternary (code, mode, mode,
+ op0, XEXP (op1, 1), op2);
+ if (!(~sel & ~sel1 & mask) && !side_effects_p (XEXP (op1, 1)))
+ return simplify_gen_ternary (code, mode, mode,
+ op0, XEXP (op1, 0), op2);
+ }
+ }
}
+
+ if (rtx_equal_p (op0, op1)
+ && !side_effects_p (op2) && !side_effects_p (op1))
+ return op0;
+
break;
default:
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 5a6138bdd32..bada27cea04 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1890,7 +1890,7 @@ conditional_probability (int target_prob, int base_prob)
{
gcc_assert (target_prob >= 0);
gcc_assert (target_prob <= base_prob);
- return RDIV (target_prob * REG_BR_PROB_BASE, base_prob);
+ return GCOV_COMPUTE_SCALE (target_prob, base_prob);
}
return -1;
}
@@ -2012,7 +2012,7 @@ emit_case_dispatch_table (tree index_expr, tree index_type,
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, stmt_bb->succs)
- e->probability = RDIV (e->probability * REG_BR_PROB_BASE, base);
+ e->probability = GCOV_COMPUTE_SCALE (e->probability, base);
}
if (try_with_tablejump)
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 5b89f749f7a..67dd9587b99 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -98,32 +98,6 @@ variable_size (tree size)
/* An array of functions used for self-referential size computation. */
static GTY(()) vec<tree, va_gc> *size_functions;
-/* Look inside EXPR into simple arithmetic operations involving constants.
- Return the outermost non-arithmetic or non-constant node. */
-
-static tree
-skip_simple_constant_arithmetic (tree expr)
-{
- while (true)
- {
- if (UNARY_CLASS_P (expr))
- expr = TREE_OPERAND (expr, 0);
- else if (BINARY_CLASS_P (expr))
- {
- if (TREE_CONSTANT (TREE_OPERAND (expr, 1)))
- expr = TREE_OPERAND (expr, 0);
- else if (TREE_CONSTANT (TREE_OPERAND (expr, 0)))
- expr = TREE_OPERAND (expr, 1);
- else
- break;
- }
- else
- break;
- }
-
- return expr;
-}
-
/* Similar to copy_tree_r but do not copy component references involving
PLACEHOLDER_EXPRs. These nodes are spotted in find_placeholder_in_expr
and substituted in substitute_in_expr. */
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 2e57d32422c..6fc072c38e6 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -1249,6 +1249,6 @@ struct rtl_opt_pass pass_rtl_store_motion =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/target.def b/gcc/target.def
index 8cbb1f8d148..e0e6ad0f26c 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -2506,6 +2506,16 @@ DEFHOOK
reg_class_t, (reg_class_t, enum machine_mode),
NULL)
+DEFHOOK
+(cstore_mode,
+ "This hook defines the machine mode to use for the boolean result of\
+ conditional store patterns. The ICODE argument is the instruction code\
+ for the cstore being performed. Not definiting this hook is the same\
+ as accepting the mode encoded into operand 0 of the cstore expander\
+ patterns.",
+ enum machine_mode, (enum insn_code icode),
+ default_cstore_mode)
+
/* True if a structure, union or array with MODE containing FIELD should
be accessed using BLKmode. */
DEFHOOK
diff --git a/gcc/target.h b/gcc/target.h
index c868118eb5c..405e2928b73 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -49,6 +49,7 @@
#define GCC_TARGET_H
#include "insn-modes.h"
+#include "insn-codes.h"
#ifdef ENABLE_CHECKING
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 2e43b484d20..2066f4fac03 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -70,6 +70,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h"
#include "tree-flow.h"
#include "tree-ssa-alias.h"
+#include "insn-codes.h"
bool
@@ -1537,6 +1538,14 @@ default_pch_valid_p (const void *data_p, size_t len)
return NULL;
}
+/* Default version of cstore_mode. */
+
+enum machine_mode
+default_cstore_mode (enum insn_code icode)
+{
+ return insn_data[(int) icode].operand[0].mode;
+}
+
/* Default version of member_type_forces_blk. */
bool
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 06e990592ba..b1ace9ee715 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -195,6 +195,7 @@ extern const char *default_pch_valid_p (const void *, size_t);
extern void default_asm_output_ident_directive (const char*);
+extern enum machine_mode default_cstore_mode (enum insn_code);
extern bool default_member_type_forces_blk (const_tree, enum machine_mode);
extern char *default_builtin_find_processor_code (char *);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c1fc14d4bb4..af446d7a752 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,498 @@
+2013-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56962
+ * gcc.c-torture/execute/pr56962.c: New test.
+
+2013-04-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56933
+ * gcc.dg/vect/pr56933.c: New testcase.
+
+2013-04-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/arm/anddi3-opt.c: New test.
+ * gcc.target/arm/anddi3-opt2.c: Likewise.
+
+2013-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pr56890-1.c: New test.
+ * gcc.dg/pr56890-2.c: Likewise.
+
+2013-04-15 Joey Ye <joey.ye@arm.com>
+
+ * gcc.target/arm/thumb1-far-jump-1.c: New test.
+ * gcc.target/arm/thumb1-far-jump-2.c: New test.
+
+2013-04-14 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/56816
+ * gfortran.dg/select_type_33.f03: New test.
+
+2013-04-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55959
+ * gfortran.dg/typebound_proc_29.f03: New.
+
+2013-04-12 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56266
+ * gfortran.dg/typebound_proc_28.f03: New.
+
+2013-04-12 Jeff Law <law@redhat.com>
+
+ * gcc.dg/tree-ssa/vrp87.c: Do not run test on ppc and xtensa
+ either.
+
+2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56929
+ * gfortran.dg/coarray/alloc_comp_2.f90: New.
+
+2013-04-12 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR target/56903
+ * gcc.target/i386/pr56903.c: New test.
+
+2013-04-12 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56261
+ * gfortran.dg/auto_char_len_4.f90: Add -pedantic. Changed error.
+ * gfortran.dg/assumed_rank_4.f90: Modified error wording.
+ * gfortran.dg/block_11.f90: Fix invalid test case.
+ * gfortran.dg/function_types_3.f90: Add new error message.
+ * gfortran.dg/global_references_1.f90: Ditto.
+ * gfortran.dg/import2.f90: Remove unneeded parts.
+ * gfortran.dg/import6.f90: Fix invalid test case.
+ * gfortran.dg/proc_decl_2.f90: Ditto.
+ * gfortran.dg/proc_decl_9.f90: Ditto.
+ * gfortran.dg/proc_decl_18.f90: Ditto.
+ * gfortran.dg/proc_ptr_40.f90: New.
+ * gfortran.dg/whole_file_7.f90: Modified error wording.
+ * gfortran.dg/whole_file_16.f90: Ditto.
+ * gfortran.dg/whole_file_17.f90: Add -pedantic.
+ * gfortran.dg/whole_file_18.f90: Modified error wording.
+ * gfortran.dg/whole_file_20.f03: Ditto.
+ * gfortran.fortran-torture/execute/intrinsic_associated.f90: Fix
+ invalid test case.
+
+2013-04-12 Richard Biener <rguenther@suse.de>
+
+ Revert
+ 2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * g++.dg/pr55604.C: Use -fdump-rtl-ira.
+
+2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56845
+ * gfortran.dg/class_allocate_15.f90: New.
+
+ Revert:
+ 2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/coarray_lib_alloc_2.f90: Update
+ scan-tree-dump-times.
+
+2013-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56918
+ PR tree-optimization/56920
+ * gcc.dg/vect/pr56918.c: New test.
+ * gcc.dg/vect/pr56920.c: New test.
+
+2013-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56845
+ * gfortran.dg/class_allocate_14.f90: New.
+ * gfortran.dg/coarray_lib_alloc_2.f90: Update scan-tree-dump-times.
+ * gfortran.dg/coarray_lib_alloc_3.f90: New.
+
+2013-04-12 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/fold-cstvecshift.c: New testcase.
+
+2013-04-11 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
+
+ * gcc.target/aarch64/negs.c: New.
+
+2013-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56895
+ * g++.dg/template/arrow4.C: New test.
+
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/array23.adb: New test.
+ * gnat.dg/array23_pkg[123].ads: New helpers.
+
+2013-04-11 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/56900
+ * gcc.dg/tree-ssa/vrp87.c: Do not run test on various targets.
+
+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56913
+ * g++.dg/cpp0x/sfinae44.C: New.
+
+2013-04-11 Arnaud Charlet <charlet@adacore.com>
+
+ * ada/acats/run_all.sh: Remove special handling of -gnat95 switch.
+ * ada/acats/ada95.lst: Remove special handling of -gnat95 switch.
+
+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/54216
+ * g++.dg/cpp0x/enum26.C: New.
+ * g++.old-deja/g++.pt/mangle1.C: Adjust.
+
+2013-04-11 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * gcc.target/aarch64/vect-fcm.x: Add check for zero forms of
+ inverse operands.
+ * gcc.target/aarch64/vect-fcm-eq-d.c: Check that new zero form
+ loop is vectorized.
+ * gcc.target/aarch64/vect-fcm-eq-f.c: Likewise.
+ * gcc.target/aarch64/vect-fcm-ge-d.c: Check that new zero form
+ loop is vectorized and that the correct instruction is generated.
+ * gcc.target/aarch64/vect-fcm-ge-f.c: Likewise.
+ * gcc.target/aarch64/vect-fcm-gt-d.c: Likewise.
+ * gcc.target/aarch64/vect-fcm-gt-f.c: Likewise.
+
+2013-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56899
+ * gcc.c-torture/execute/pr56899.c: New test.
+
+2013-04-10 David S. Miller <davem@davemloft.net>
+
+ * gcc.target/sparc/setcc-4.c: New test.
+ * gcc.target/sparc/setcc-5.c: New test.
+
+2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * g++.dg/pr55604.C: Use -fdump-rtl-ira.
+
+2013-04-10 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/slp-39.c: New testcase.
+
+2013-04-10 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR tree-optimization/55524
+ * gcc.target/epiphany/fnma-1.c: New test.
+
+2013-04-10 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+
+ * gcc.dg/tree-ssa/inline-11.c: New test
+
+2013-04-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56895
+ * g++.dg/template/arrow3.C: New test.
+
+2013-04-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/arm/minmax_minus.c: New test.
+
+2013-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/56883
+ * c-c++-common/gomp/pr56883.c: New test.
+
+2013-04-09 Jeff Law <law@redhat.com>
+
+ * gcc.dg/tree-ssa/vrp87.c: New test.
+
+2013-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56854
+ * g++.dg/torture/pr56854.C: New test.
+
+2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/56782
+ * gfortran.dg/array_constructor_44.f90: New test.
+
+2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56871
+ * g++.dg/cpp0x/constexpr-specialization.C: New.
+
+2013-04-08 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/pr56837.c: New test.
+
+ PR c++/34949
+ PR c++/50243
+ * g++.dg/opt/vt3.C: New test.
+ * g++.dg/opt/vt4.C: New test.
+
+2013-04-08 Jeff Law <law@redhat.com>
+
+ * gcc.dg/tree-ssa/forwprop-25.c: New test.
+
+2013-04-08 Richard Biener <rguenther@suse.de>
+
+ * gfortran.dg/vect/fast-math-mgrid-resid.f: Adjust.
+
+2013-04-08 Richard Biener <rguenther@suse.de>
+
+ * gfortran.dg/vect/fast-math-pr37021.f90: Adjust.
+
+2013-04-08 Richard Biener <rguenther@suse.de>
+
+ * g++.dg/vect/slp-pr56812.cc: Adjust.
+
+2013-04-08 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/pr56837.c: New test.
+ * gcc.dg/tree-ssa/ldist-19.c: Don't check for
+ "generated memset minus one".
+
+2013-04-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56849
+ * gfortran.dg/reshape_5.f90: New.
+
+2013-04-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/56843
+ * gcc.target/powerpc/recip-1.c: Modify expected output.
+ * gcc.target/powerpc/recip-3.c: Likewise.
+ * gcc.target/powerpc/recip-4.c: Likewise.
+ * gcc.target/powerpc/recip-5.c: Add expected output for iterations.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * gcc.target/arm/peep-ldrd-1.c: New test.
+ * gcc.target/arm/peep-strd-1.c: Likewise.
+
+2013-04-05 Greta Yorsh <Greta.Yorsh@arm.com>
+
+ * gcc.target/arm/negdi-1.c: New test.
+ * gcc.target/arm/negdi-2.c: Likewise.
+ * gcc.target/arm/negdi-3.c: Likewise.
+ * gcc.target/arm/negdi-4.c: Likewise.
+
+2013-04-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * lib/target-supports.exp (add_options_for_arm_v8_neon):
+ Add -march=armv8-a when we use v8 NEON.
+ (check_effective_target_vect_call_btruncf): Remove arm-*-*-*.
+ (check_effective_target_vect_call_ceilf): Likewise.
+ (check_effective_target_vect_call_floorf): Likewise.
+ (check_effective_target_vect_call_roundf): Likewise.
+ (check_vect_support_and_set_flags): Remove check for arm_v8_neon.
+ * gcc.target/arm/vect-rounding-btruncf.c: New testcase.
+ * gcc.target/arm/vect-rounding-ceilf.c: Likewise.
+ * gcc.target/arm/vect-rounding-floorf.c: Likewise.
+ * gcc.target/arm/vect-rounding-roundf.c: Likewise.
+
+2013-04-05 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/sd-vsx.c: Skip on AIX.
+ * gcc.target/powerpc/sd-pwr6.c: Same.
+ * gcc.dg/stack-usage-1.c: Define SIZE on AIX.
+ * g++.dg/debug/pr56294.C: XFAIL on AIX.
+
+2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ * g++.dg/cpp0x/ref-qual-multi-neg.C: New test.
+
+2013-04-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/40881
+ * gfortran.dg/altreturn_1.f90: Add -std=gnu.
+ * gfortran.dg/altreturn_4.f90: Ditto.
+ * gfortran.dg/altreturn_3.f90: Replace -std=legacy by -std=gnu.
+ * gfortran.dg/altreturn_5.f90: Ditto.
+ * gfortran.dg/altreturn_6.f90: Ditto.
+ * gfortran.dg/altreturn_7.f90: Ditto.
+
+2013-04-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * lib/target-supports.exp (check_effective_target_arm_v8_neon_hw):
+ New procedure.
+ (check_effective_target_arm_v8_neon_ok_nocache):
+ Likewise.
+ (check_effective_target_arm_v8_neon_ok): Change to use
+ check_effective_target_arm_v8_neon_ok_nocache.
+ (add_options_for_arm_v8_neon): Use et_arm_v8_neon_flags to set ARMv8
+ NEON flags.
+ (check_effective_target_vect_call_btruncf):
+ Enable for arm and ARMv8 NEON.
+ (check_effective_target_vect_call_ceilf): Likewise.
+ (check_effective_target_vect_call_floorf): Likewise.
+ (check_effective_target_vect_call_roundf): Likewise.
+ (check_vect_support_and_set_flags): Handle ARMv8 NEON effective
+ target.
+
+2013-04-04 Marek Polacek <polacek@redhat.com>
+
+ PR tree-optimization/48186
+ * gcc.dg/pr48186.c: New test.
+
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56826
+ * gcc.dg/vect/pr56826.c: New testcase.
+ * gcc.dg/vect/O3-pr36098.c: Adjust.
+
+2013-04-04 Tejas Belagod <tejas.belagod@arm.com>
+
+ * gcc.target/aarch64/inc/asm-adder-clobber-lr.c: Remove duplication.
+ * gcc.target/aarch64/inc/asm-adder-no-clobber-lr.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-1.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-2.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-3.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-4.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-5.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-6.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-7.c: Likewise.
+ * gcc.target/aarch64/test-framepointer-8.c: Likewise.
+
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56213
+ * gcc.dg/vect/vect-123.c: New testcase.
+
+2013-04-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56810
+ * gfortran.dg/read_repeat_2.f90: New.
+
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56837
+ * g++.dg/torture/pr56837.C: New testcase.
+
+2013-04-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50269
+ * gfortran.dg/c_loc_test_21.f90: New.
+ * gfortran.dg/c_loc_test_19.f90: Update dg-error.
+ * gfortran.dg/c_loc_tests_10.f03: Update dg-error.
+ * gfortran.dg/c_loc_tests_11.f03: Update dg-error.
+ * gfortran.dg/c_loc_tests_4.f03: Update dg-error.
+ * gfortran.dg/c_loc_tests_16.f90: Update dg-error.
+
+2013-04-03 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/56799
+ * gcc.c-torture/execute/pr56799.c: New test.
+
+2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56815
+ * g++.dg/warn/Wpointer-arith-1.C: New.
+ * g++.dg/gomp/for-19.C: Adjust.
+
+2013-04-03 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/55702
+ * gcc.dg/pr55702.c: New test.
+
+2013-04-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/56809
+ * gcc.dg/pr56809.c: New testcase.
+
+2013-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/56819
+ * g++.dg/debug/pr56819.C: New test.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56817
+ * g++.dg/torture/pr56817.C: New testcase.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/vect/bb-slp-31.c: New file.
+
+2013-04-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/34949
+ * g++.dg/tree-ssa/ehcleanup-1.C: Adjust unreachable count.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ * g++.dg/vect/slp-pr56812.cc: Use dg-additional-options.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55964
+ * gcc.dg/torture/pr55964-2.c: New testcase.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56501
+ * gcc.dg/torture/pr56501.c: New testcase.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56407
+ * gcc.dg/torture/pr56407.c: New testcase.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/56790
+ * g++.dg/ext/pr56790-1.C: New testcase.
+
+2013-04-03 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.target/i386/merge-1.c: New testcase.
+ * gcc.target/i386/avx2-vpblendd128-1.c: Make it non-trivial.
+
+2013-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/19449
+ * gcc.c-torture/execute/pr19449.c: New test.
+
+2013-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56812
+ * g++.dg/vect/slp-pr56812.cc: New testcase.
+
+2013-04-03 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56284
+ PR fortran/40881
+ * gfortran.dg/altreturn_8.f90: New.
+ * gfortran.dg/altreturn_2.f90: Add -std=legacy.
+ * gfortran.dg/intrinsic_actual_3.f90: Ditto.
+ * gfortran.dg/invalid_interface_assignment.f90: Ditto.
+
+2013-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/56745
+ * gcc.c-torture/compile/pr56745.c: New test.
+
+2013-04-02 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
+
+ * gcc.dg/tree-ssa/sra-13.c: Fix for 16 bit int.
+
+2013-04-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56778
+ * gcc.dg/torture/pr56778.c: New testcase.
+
+2013-04-02 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/56768
+ * g++.dg/torture/pr56768.C: New testcase.
+
+2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * obj-c++.dg/try-catch-13.mm: Update per PR56725.
+
+2013-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/56660
+ * gfortran.dg/namelist_82.f90: New test.
+
2013-04-01 Janus Weil <janus@gcc.gnu.org>
PR fortran/56500
diff --git a/gcc/testsuite/ChangeLog-2012 b/gcc/testsuite/ChangeLog-2012
index 6687189a22f..90e08399a79 100644
--- a/gcc/testsuite/ChangeLog-2012
+++ b/gcc/testsuite/ChangeLog-2012
@@ -1396,12 +1396,12 @@
* gcc.target/powerpc/ppc-pow.c: Allow dot symbols in branch.
* gcc.target/powerpc/tfmode_off.c: Skip on AIX.
-2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
* gcc.dg/warn-nsstring.c: Use -Wformat explicitly.
-2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/51294
* c-c++-common/pr51294.c: New.
@@ -1782,7 +1782,7 @@
PR middle-end/55116
* gcc.target/i386/pr55116.c: New file.
-2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53066
* gcc.dg/Wshadow-4.c: New.
@@ -2211,7 +2211,7 @@
* gcc.dg/webizer.c (main): Add missing exit call.
-2012-10-21 Thomas König <tkoenig@gcc.gnu.org>
+2012-10-21 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/54465
* gfortran.dg/wextra_1.f: New test.
@@ -2294,7 +2294,7 @@
* gcc.dg/tree-ssa/ldist-17.c: Block cunroll to make testcase still
valid.
-2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
PR c/40989
@@ -3100,7 +3100,7 @@
* go.test/go-test.exp: Update for latest version of Go testsuite.
-2012-09-29 Thomas König <tkoenig@gcc.gnu.org>
+2012-09-29 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/52724
* gfortran.dg/internal_readwrite_3.f90: New test.
@@ -3605,7 +3605,7 @@
* g++.dg/torture/builtin-location.C: New testcase.
2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
- Manuel López-Ibáñez <manu@gcc.gnu.org>
+ Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53210
* g++.dg/warn/Wuninitialized-self.C: New.
@@ -4466,7 +4466,7 @@
PR fortran/54301
* gfortran.dg/warn_target_lifetime_1.f90: New.
-2012-08-19 Thomas König <tkoenig@gcc.gnu.org>
+2012-08-19 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/54298
* gfortran.dg/real_compare_1.f90: New test case.
@@ -4921,7 +4921,7 @@
* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
-2012-08-01 Thomas König <tkoenig@gcc.gnu.org>
+2012-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/54033
* gfortran.dg/include_6.f90: New test case.
@@ -5394,7 +5394,7 @@
* g++.dg/parse/access8.C: Adjust.
* g++.dg/template/sfinae6_neg.C: Adjust.
-2012-07-16 Thomas König <tkoenig@gcc.gnu.org>
+2012-07-16 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/53824
* gfortran.dg/coarray_allocate_1.f90: New test.
@@ -6425,12 +6425,12 @@
PR middle-end/53535
* gcc.dg/pr46647.c: xfail for cris-* and crisv32-*.
-2012-06-07 Thomas König <tkoenig@gcc.gnu.org>
+2012-06-07 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/52861
* gfortran.dg/string_assign_2.f90: New test case.
-2012-06-07 Thomas König <tkoenig@gcc.gnu.org>
+2012-06-07 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/52861
* gfortran.dg/string_assign_1.f90: New test case.
@@ -6446,7 +6446,7 @@
* gfortran.dg/gomp/appendix-a/a.35.6.f90: Likewise.
* c-c++-common/gomp/pr53580.c: New test.
-2012-06-07 Fabien Chêne <fabien@gcc.gnu.org>
+2012-06-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/51214
* g++.dg/cpp0x/forw_enum11.C: New.
@@ -6474,7 +6474,7 @@
* gfortran.dg/vect/pr32380.f: Adjust number of expected vectorized
loops.
-2012-06-06 Fabien Chêne <fabien@gcc.gnu.org>
+2012-06-06 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52841
* g++.dg/cpp0x/pr52841.C: New testcase.
@@ -7262,7 +7262,7 @@
* gnat.dg/discr36.ad[sb]: New test.
* gnat.dg/discr36_pkg.ad[sb]: New helper.
-2012-05-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/43772
* c-c++-common/pr43772.c: New.
@@ -7324,7 +7324,7 @@
* gcc.target/ia64/pr48496.c: New test.
* gcc.target/ia64/pr52657.c: Likewise.
-2012-05-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-05-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/51712
* c-c++-common/pr51712.c: New.
@@ -7567,7 +7567,7 @@
* gnat.dg/warn6.ad[sb]: New test.
-2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 53149
* gcc.dg/20011021-1.c: Adjust testcase.
@@ -7675,7 +7675,7 @@
PR c/52880
* gcc.dg/pr52880.c: New test.
-2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/m-un-2.c: Update.
* gcc.dg/20011021-1.c: Update.
@@ -7758,7 +7758,7 @@
PR fortran/53051
* gfortran.dg/read_float_4.f90: New.
-2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 35441
* c-c++-common/pr35441.C: New.
@@ -7793,7 +7793,7 @@
* gcc.dg/pr52283.c: New test.
-2012-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/pr37985.c: New test.
@@ -8041,12 +8041,12 @@
* gcc/target/sh/pr50751-6.c: New.
* gcc/target/sh/pr50751-7.c: New.
-2012-04-11 Fabien Chêne <fabien@gcc.gnu.org>
+2012-04-11 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52465
* g++.dg/lookup/using52.C: New.
-2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
* lib/prune.exp (TEST_ALWAYS_FLAGS): If undefined, set to empty.
@@ -8142,7 +8142,7 @@
* gcc.dg/builtin-bswap-5.c: Likewise.
* gcc.target/i386/builtin-bswap-4.c: New test.
-2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 24985
* lib/prune.exp: Add -fno-diagnostics-show-caret.
@@ -8251,7 +8251,7 @@
PR fortran/52751
* gfortran.dg/public_private_module_2.f90: New.
-2012-04-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
+2012-04-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
* g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: Add labels to
directives.
@@ -9486,7 +9486,7 @@
PR c++/52248
* g++.dg/ext/timevar1.C: New.
-2012-02-16 Fabien Chêne <fabien@gcc.gnu.org>
+2012-02-16 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52126
* g++.dg/template/using21.C: New.
@@ -9821,7 +9821,7 @@
PR fortran/51514
* gfortran.dg/class_to_type_2.f90: New.
-2012-02-06 Thomas König <tkoenig@gcc.gnu.org>
+2012-02-06 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/32373
* gfortran.dg/vect/vect-8.f90: Use vect_double effective target.
@@ -9847,12 +9847,12 @@
* gcc.dg/pr48374.c: Actually add the test I forgot
in the 2012-01-25 commit.
-2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
+2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/32373
* gfortran.dg/vect/vect-8.f90: New test case.
-2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
+2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/48847
* gfortran.dg/warn_unused_dummy_argument_3.f90: New test.
@@ -9944,7 +9944,7 @@
PR tree-optimization/52073
* gcc.c-torture/compile/pr52073.c: New test.
-2012-02-01 Thomas König <tkoenig@gcc.gnu.org>
+2012-02-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/51958
* gfortran.dg/function_optimize_10.f90: New test.
@@ -11127,7 +11127,7 @@
* g++.dg/cpp0x/constexpr-delegating2.C: Add missing piece.
-2012-01-01 Fabien Chêne <fabien@gcc.gnu.org>
+2012-01-01 Fabien Chêne <fabien@gcc.gnu.org>
* g++.old-deja/g++.brendan/crash25.C: Adjust.
* g++.old-deja/g++.brendan/crash56.C: Likewise.
diff --git a/gcc/testsuite/ada/acats/ada95.lst b/gcc/testsuite/ada/acats/ada95.lst
deleted file mode 100644
index 839d5dfb377..00000000000
--- a/gcc/testsuite/ada/acats/ada95.lst
+++ /dev/null
@@ -1,31 +0,0 @@
-ac3106a
-c34005p
-c34005r
-c34005s
-c34005u
-c34005v
-c34006g
-c34006j
-c34006l
-c34008a
-c3a0014
-c41103b
-c41203b
-c41306a
-c460a01
-c650001
-c74302b
-c74306a
-c85014a
-c85014b
-c85014c
-c87b26b
-c87b41a
-c99004a
-cb40005
-cc3019c
-cc51b03
-cc51d02
-cd10002
-cdd2a03
-cxac005
diff --git a/gcc/testsuite/ada/acats/run_all.sh b/gcc/testsuite/ada/acats/run_all.sh
index c3c104a86bf..3d8aca91105 100755
--- a/gcc/testsuite/ada/acats/run_all.sh
+++ b/gcc/testsuite/ada/acats/run_all.sh
@@ -216,7 +216,7 @@ for chapter in $chapters; do
counti=0
for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
counti=`expr $counti + 1`
- extraflags=""
+ extraflags="-gnat95"
grep $i $testdir/overflow.lst > /dev/null 2>&1
if [ $? -eq 0 ]; then
extraflags="$extraflags -gnato"
@@ -229,10 +229,6 @@ for chapter in $chapters; do
if [ $? -eq 0 ]; then
extraflags="$extraflags -fstack-check"
fi
- grep $i $testdir/ada95.lst > /dev/null 2>&1
- if [ $? -eq 0 ]; then
- extraflags="$extraflags -gnat95"
- fi
test=$dir/tests/$chapter/$i
mkdir $test && cd $test >> $dir/acats.log 2>&1
diff --git a/gcc/testsuite/c-c++-common/gomp/pr56883.c b/gcc/testsuite/c-c++-common/gomp/pr56883.c
new file mode 100644
index 00000000000..443906d8689
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr56883.c
@@ -0,0 +1,57 @@
+/* PR middle-end/56883 */
+/* { dg-do compile }
+/* { dg-options "-O2 -fopenmp" } */
+
+void
+f1 (int ***x)
+{
+ int i, j, k;
+#pragma omp parallel for
+ for (i = 0; i < 10; ++i)
+ {
+ #pragma omp parallel shared(j)
+ #pragma omp for
+ for (j = 0; j < 10; ++j)
+ {
+ #pragma omp parallel for
+ for (k = 0; k < 10; ++k)
+ x[i][j][k] = k;
+ }
+ }
+}
+
+void
+f2 (int ***x)
+{
+ int i, j, k;
+#pragma omp parallel for schedule(static,1)
+ for (i = 0; i < 10; ++i)
+ {
+ #pragma omp parallel shared(j)
+ #pragma omp for schedule(static,1)
+ for (j = 0; j < 10; ++j)
+ {
+ #pragma omp parallel for schedule(static,1)
+ for (k = 0; k < 10; ++k)
+ x[i][j][k] = k;
+ }
+ }
+}
+
+void
+f3 (int ***x)
+{
+ int i, j, k;
+#pragma omp parallel for schedule(runtime)
+ for (i = 0; i < 10; ++i)
+ {
+ #pragma omp parallel shared(j)
+ #pragma omp for schedule(runtime)
+ for (j = 0; j < 10; ++j)
+ {
+ #pragma omp parallel for schedule(runtime)
+ for (k = 0; k < 10; ++k)
+ x[i][j][k] = k;
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/abi/mangle62.C b/gcc/testsuite/g++.dg/abi/mangle62.C
new file mode 100644
index 00000000000..6dbfd7865cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle62.C
@@ -0,0 +1,11 @@
+// Before v8, we mistakenly treated an unqualified function type
+// as a substitution candidate for a function type with function-cv-quals.
+// Test for the conformant behavior.
+
+// { dg-options -fabi-version=0 }
+
+template <class T, class U> struct A { };
+// { dg-final { scan-assembler "_Z1fP1AIKFvvEFvvEE" } }
+void f (A<void()const, void()> *){}
+// { dg-final { scan-assembler "_Z1gP1AIFvvEKFvvEE" } }
+void g (A<void(), void()const> *){}
diff --git a/gcc/testsuite/g++.dg/abi/mangle62a.C b/gcc/testsuite/g++.dg/abi/mangle62a.C
new file mode 100644
index 00000000000..fca1cb6c436
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle62a.C
@@ -0,0 +1,11 @@
+// Before v8, we mistakenly treated an unqualified function type
+// as a substitution candidate for a function type with function-cv-quals.
+// Test for that for backward compatibility.
+
+// { dg-options -fabi-version=7 }
+
+template <class T, class U> struct A { };
+// { dg-final { scan-assembler "_Z1fP1AIKFvvES0_E" } }
+void f (A<void()const, void()> *){}
+// { dg-final { scan-assembler "_Z1gP1AIFvvEKS0_E" } }
+void g (A<void(), void()const> *){}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/cilkplus_AN_cpp_errors.exp b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/cilkplus_AN_cpp_errors.exp
new file mode 100644
index 00000000000..7a2360c5a28
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/cilkplus_AN_cpp_errors.exp
@@ -0,0 +1,25 @@
+# Copyright (C) 2012-2013 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/>.
+
+# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+
+load_lib gcc-dg.exp
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] " -fcilkplus" " "
+dg-finish
+
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/fp_triplet_values.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/fp_triplet_values.cc
index d664c03e439..31dbaf83c04 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/fp_triplet_values.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/fp_triplet_values.cc
@@ -1,5 +1,5 @@
-/* {dg-do compile } */
-/* {dg-options } */
+/* { dg-do compile } */
+/* { dg-options } */
#include <cstdlib>
float q;
#if 1
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/parser_errors.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/parser_errors.cc
index d3fc2a6e5ab..760565e42b3 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/parser_errors.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/parser_errors.cc
@@ -1,5 +1,5 @@
-/* {dg-do compile } */
-/* {dg-options } */
+/* { dg-do compile } */
+/* { dg-options } */
int main (int argc, char **argv)
{
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit.cc
index 70d38f0e6af..b2a1d7b4a27 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit.cc
@@ -1,5 +1,5 @@
-/* {dg-do compile } */
-/* {dg-options } */
+/* { dg-do compile } */
+/* { dg-options } */
int main (int argc, char **argv)
{
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit2.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit2.cc
index f37aa4e27ca..db08c994ffb 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit2.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_implicit2.cc
@@ -1,5 +1,5 @@
-/* {dg-do compile } */
-/* {dg-options } */
+/* { dg-do compile } */
+/* { dg-options } */
int main (int argc, char **argv)
{
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec.cc
new file mode 100644
index 00000000000..ebad022df97
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec.cc
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+int main ()
+{
+ int a;
+ a = __sec_reduce_add(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_mul(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_max(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_min(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_any_zero(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_any_nonzero(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_all_zero(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_all_nonzero(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_max_ind(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce_min_ind(__sec_reduce_add(1)); /* { dg-error "parameter with zero rank" } */
+ a = __sec_reduce(0, __sec_reduce_add(1), __sec_reduce_add); /* { dg-error "parameter with zero rank" } */
+ __sec_reduce_mutating (&a, __sec_reduce_add(1), __sec_reduce_add); /* { dg-error "parameter with zero rank" } */
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.cc
new file mode 100644
index 00000000000..05e00ef2188
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.cc
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+int A[256];
+
+int add( int x, int y)
+{
+ return x+y;
+}
+
+void
+check () {
+ int a;
+ a = __sec_reduce_min_ind (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_max_ind (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_any_zero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_any_nonzero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_all_nonzero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_max (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_min (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_mul (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_add (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce (0, __sec_reduce_min_ind (A[:]), add); /* { dg-error "cannot have array notation parameter with zero" } */
+ __sec_reduce_mutating (&a, __sec_reduce_min_ind (A[:]), add); /* { dg-error "cannot have array notation parameter with zero" } */
+}
+
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_reduce_max_min_ind.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_reduce_max_min_ind.cc
index fb41ba3f669..d4a5b773719 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_reduce_max_min_ind.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/sec_reduce_max_min_ind.cc
@@ -1,5 +1,5 @@
-/* {dg-do compile } */
-/* {dg-options } */
+/* { dg-do compile } */
+/* { dg-options } */
int main (int argc, char **argv)
{
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/tst_lngth.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/tst_lngth.cc
new file mode 100644
index 00000000000..68ac452e6f4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/errors/tst_lngth.cc
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+#if HAVE_IO
+#include <stdio.h>
+#endif
+
+#define N 256
+
+template <class T>
+int
+main2 (int argc, char **argv)
+{
+ T A[N], B[N];
+ T A2[N][N], B2[N][N];
+ T A3[N][N][N], B3[N][N][N];
+ T A4[N][N][N][N], B4[N][N][N][N];
+ A[0:(N / 4)] = A[4]+ B[0:(N / 2):2]; /* { dg-error "length mismatch between" } */
+ A[0:(N / 4)] = B[0:(N / 2):2] + N; /* { dg-error "length mismatch between" } */
+ A[0:(N / 4)] = B[0:(N / 2):2] + A[4]; /* { dg-error "length mismatch between" } */
+ A[0:10:1] = B[0:10:1] + A[0:5:1]; /* { dg-error "length mismatch in " } */
+ A[0:10:1] = B[0:5:1] + A[0:10:1]; /* { dg-error "length mismatch in " } */
+ A2[:][:] = B2[:][0:5] + B2[:][0:10]; /* { dg-error "length mismatch in " } */
+ A2[5][:] = B2[5][0:5] + B2[3][0:10]; /* { dg-error "length mismatch in " } */
+ A3[:][5][:] = B3[:][5][0:5] + B3[:][3][0:10]; /* { dg-error "length mismatch in " } */
+ A3[:][5][:] = B3[5][:][0:5] + B3[:][3][0:10]; /* { dg-error "length mismatch in " } */
+ A4[:][:][:][:] = B4[:][:][0:5][:] + B4[:][:][:][0:5:1]; /* { dg-error "length mismatch in " } */
+ return 0;
+}
+
+int main (int argc, char **argv)
+{
+ main2 <char> (argc, argv);
+ main2 <short> (argc, argv);
+ main2 <int> (argc, argv);
+ main2 <long> (argc, argv);
+ main2 <long long> (argc, argv);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/multiple_insert_check.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/multiple_insert_check.cc
new file mode 100644
index 00000000000..edd3a93052e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/multiple_insert_check.cc
@@ -0,0 +1,17 @@
+int A[256];
+int func (int x) {
+ return x;
+}
+
+/* There was an error that some call exprs were inserted twice. This will
+ check that issue. */
+int main (int argc, char **argv)
+{
+ int x = 0;
+ A[:] = 4;
+ x = func (__sec_reduce_add(A[0:5:2])) + x;
+ if (x != 20)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc
new file mode 100644
index 00000000000..0b264fecace
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-fcilkplus" } */
+
+#if HAVE_IO
+#include <iostream>
+#endif
+int A[16];
+
+int main () {
+ A[:] = 5;
+#if HAVE_IO
+ std::cout << __sec_reduce_any_zero(A[:]) << "\n";
+#else
+ if (__sec_reduce_any_zero (A[:]))
+ return 1;
+#endif
+ A[:] = 0;
+#if HAVE_IO
+ std::cout << __sec_reduce_any_nonzero(A[:]) << "\n";
+#else
+ if (__sec_reduce_any_nonzero (A[:]))
+ return 1;
+#endif
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.cc
new file mode 100644
index 00000000000..f8dd4e49413
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.cc
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-fcilkplus" } */
+
+#if HAVE_IO
+#include <iostream>
+#endif
+#include <limits.h>
+int A[16];
+int a = 0;
+
+int main () {
+ if (__sec_reduce_max(A[0:0:2]) != INT_MIN) {
+#if HAVE_IO
+ std::cout << __sec_reduce_max(A[0:0:2]) << std::endl;
+#endif
+ a++;
+ }
+ if (__sec_reduce_min(A[0:0:2]) != INT_MAX) {
+#if HAVE_IO
+ std::cout << __sec_reduce_min(A[0:0:2]) << std::endl;
+#endif
+ a++;
+ }
+
+ return a;
+}
+
+
diff --git a/gcc/testsuite/g++.dg/cilk-plus/cilk_keywords_test/compile/c++-cilk-for.cc b/gcc/testsuite/g++.dg/cilk-plus/cilk_keywords_test/compile/c++-cilk-for.cc
index 5e9cd23994c..73fbe9fe147 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/cilk_keywords_test/compile/c++-cilk-for.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/cilk_keywords_test/compile/c++-cilk-for.cc
@@ -1,5 +1,7 @@
+#if HAVE_IO
#include <iostream>
#include <cstdio>
+#endif
#include <cstring>
#include <cilk/cilk.h>
@@ -32,11 +34,13 @@ CClass::CClass(int a, int b)
#if 1
CClass::~CClass()
{
- cilk_for (int ii = 0; ii < NUMBER; ii++) {
+#if 1
+ _Cilk_for (int ii = 0; ii < NUMBER; ii++) {
x[ii]=0;
y[ii]=0;
r[ii]=0;
}
+#endif
}
int CClass::SomeCalc()
@@ -52,7 +56,9 @@ void CClass::PrintValues()
{
for(int ii = 0; ii < NUMBER; ii++)
{
+#if HAVE_IO
printf("X[%2d]=%2d Y[%2d]=%2d r[%2d]=%3d\n",ii,x[ii],ii,y[ii],ii,r[ii]);
+#endif
}
return;
}
@@ -61,13 +67,17 @@ int main(void)
{
CClass vars(5,9);
+#if HAVE_IO
cout << "Array values BEFORE The Calculation: " << endl;
+#endif
vars.PrintValues();
vars.SomeCalc();
+#if HAVE_IO
cout << "Array values AFTER The Calculation: " << endl;
+#endif
vars.PrintValues();
return 5;
}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/cilkplus_PS_cpp_compile.exp b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/cilkplus_PS_cpp_compile.exp
new file mode 100644
index 00000000000..c956054d45b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/cilkplus_PS_cpp_compile.exp
@@ -0,0 +1,24 @@
+# Copyright (C) 2012-2013 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/>.
+
+# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+
+load_lib gcc-dg.exp
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] " -O3 -ftree-vectorize -fcilkplus" " "
+dg-finish
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/tst1.cc b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/tst1.cc
new file mode 100644
index 00000000000..b726af792da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/compile/tst1.cc
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus -O3 -w" } */
+
+#define VLEN 4
+
+/* The clauses really doesn't make sense in this, the main thing this code
+ is checking is to see if it can catch the for-loop correctly after
+ the clauses, and compile successfully. */
+int main (void)
+{
+ int array[1000];
+ int i, nphi = 100, w;
+
+
+#pragma simd vectorlength(VLEN) reduction(+:w)
+for (i = 0; i < nphi; i++)
+{
+ w += array[i];
+}
+
+#pragma simd reduction(+:w) vectorlength (VLEN)
+for (i = 0; i < nphi; i++)
+{
+ w += array[i];
+}
+
+#pragma simd vectorlength (VLEN) private(array)
+for (i = 0; i < nphi; i++)
+{
+ w += array[i];
+}
+
+#pragma simd reduction(+:w) noassert
+for (i = 0; i < nphi; i++)
+{
+ w += array[i];
+}
+
+#pragma simd vectorlength(VLEN) linear(nphi:1)
+for (i = 0; i < nphi; i++)
+{
+ w += array[i];
+}
+
+#pragma simd linear(nphi) vectorlength(VLEN) linear(nphi:1)
+for (i = 0; i < nphi; i++)
+{
+ w += array[i];
+}
+return w;
+}
+
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/cilkplus_PS_cpp_errors.exp b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/cilkplus_PS_cpp_errors.exp
new file mode 100644
index 00000000000..578c3672606
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/cilkplus_PS_cpp_errors.exp
@@ -0,0 +1,24 @@
+# Copyright (C) 2012-2013 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/>.
+
+# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+
+load_lib gcc-dg.exp
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] " " " "
+dg-finish
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/for_body_errors.cc b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/for_body_errors.cc
index fd60ff26ec5..0165327dc23 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/for_body_errors.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/pragma_simd_tests/errors/for_body_errors.cc
@@ -8,18 +8,18 @@ int main(void)
#pragma simd
for (ii = 0; ii < 1000; ii++)
- break; /* { dg-error "break statments are not allowed" } */
+ break; /* { dg-error "break statements are not allowed" } */
#pragma simd linear (ii)
for (ii = 0; ii < 1000; ii++)
if (ii)
- continue; /* { dg-error "continue statments are not allowed" } */
+ continue; /* { dg-error "continue statements are not allowed" } */
#pragma simd
for (ii = 0; ii < 1000; ii++)
{
L5:
- goto L5; /* { dg-error "goto statments are not allowed" } */
+ goto L5; /* { dg-error "goto statements are not allowed" } */
}
#pragma simd
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C
new file mode 100644
index 00000000000..8003ed9e133
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C
@@ -0,0 +1,12 @@
+// PR c++/56871
+// { dg-options "-std=c++11" }
+
+template<typename T> constexpr int foo(T);
+template<> int foo(int);
+template<> int foo(int); // { dg-error "previous" }
+template<> constexpr int foo(int); // { dg-error "redeclaration" }
+
+template<typename T> int bar(T);
+template<> constexpr int bar(int);
+template<> constexpr int bar(int); // { dg-error "previous" }
+template<> int bar(int); // { dg-error "redeclaration" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-call3.C b/gcc/testsuite/g++.dg/cpp0x/decltype-call3.C
new file mode 100644
index 00000000000..27797a2fa31
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype-call3.C
@@ -0,0 +1,132 @@
+// Testcase for N3276 and operator overloading
+// { dg-require-effective-target c++11 }
+
+struct A;
+struct B {
+ A operator()(int);
+ A operator[](int);
+ A operator=(int);
+ A operator+=(int);
+ A operator-=(int);
+ A operator*=(int);
+ A operator/=(int);
+ A operator^=(int);
+ A operator&=(int);
+ A operator|=(int);
+ A operator<<=(int);
+ A operator>>=(int);
+};
+
+A operator-(B);
+A operator+(B);
+A operator*(B);
+A operator&(B);
+A operator!(B);
+A operator~(B);
+A operator++(B);
+A operator--(B);
+
+A operator+(B,B);
+A operator-(B,B);
+A operator*(B,B);
+A operator/(B,B);
+A operator%(B,B);
+A operator^(B,B);
+A operator&(B,B);
+A operator|(B,B);
+A operator<(B,B);
+A operator>(B,B);
+A operator,(B,B);
+A operator<<(B,B);
+A operator>>(B,B);
+A operator==(B,B);
+A operator->*(B,B);
+
+#define TRY(E) static_cast<decltype(E)*>(0)
+
+template <class B>
+void f()
+{
+ B b;
+ TRY(b(0));
+ TRY(b[0]);
+ TRY(b=0);
+ TRY(b+=0);
+ TRY(b-=0);
+ TRY(b*=0);
+ TRY(b/=0);
+ TRY(b^=0);
+ TRY(b&=0);
+ TRY(b|=0);
+ TRY(b<<=0);
+ TRY(b>>=0);
+
+ TRY(-b);
+ TRY(+b);
+ TRY(*b);
+ TRY(&b);
+ TRY(!b);
+ TRY(~b);
+ TRY(++b);
+ TRY(--b);
+
+ TRY(b+b);
+ TRY(b-b);
+ TRY(b*b);
+ TRY(b/b);
+ TRY(b%b);
+ TRY(b^b);
+ TRY(b&b);
+ TRY(b|b);
+ TRY(b>b);
+ TRY(b<b);
+ TRY((b,b));
+ TRY(b<<b);
+ TRY(b>>b);
+ TRY(b==b);
+ TRY(b->*b);
+}
+
+int main()
+{
+ B b;
+ TRY(b(0));
+ TRY(b[0]);
+ TRY(b=0);
+ TRY(b+=0);
+ TRY(b-=0);
+ TRY(b*=0);
+ TRY(b/=0);
+ TRY(b^=0);
+ TRY(b&=0);
+ TRY(b|=0);
+ TRY(b<<=0);
+ TRY(b>>=0);
+
+ TRY(-b);
+ TRY(+b);
+ TRY(*b);
+ TRY(&b);
+ TRY(!b);
+ TRY(~b);
+ TRY(++b);
+ TRY(--b);
+
+ TRY(b+b);
+ TRY(b-b);
+ TRY(b*b);
+ TRY(b/b);
+ TRY(b%b);
+ TRY(b^b);
+ TRY(b&b);
+ TRY(b|b);
+ TRY(b>b);
+ TRY(b<b);
+ TRY((b,b));
+ TRY(b<<b);
+ TRY(b>>b);
+ TRY(b==b);
+ TRY(b->*b);
+
+ f<B>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum25.C b/gcc/testsuite/g++.dg/cpp0x/enum25.C
new file mode 100644
index 00000000000..cb2cf8f5363
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum25.C
@@ -0,0 +1,18 @@
+// PR c++/56793
+// { dg-require-effective-target c++11 }
+
+struct A
+{
+ enum struct B {X, Y} b;
+} a;
+
+enum struct D {X,Y};
+struct C { } c;
+
+int main ()
+{
+ if (a.b == a.B::Y)
+ a.b = A::B::X;
+
+ c.D::Y; // { dg-error "not a member" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum26.C b/gcc/testsuite/g++.dg/cpp0x/enum26.C
new file mode 100644
index 00000000000..a21067edb87
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum26.C
@@ -0,0 +1,8 @@
+// PR c++/54216
+// { dg-options "-std=c++11 -pedantic" }
+
+enum {}; // { dg-warning "empty anonymous" }
+
+enum class {}; // { dg-error "anonymous" }
+
+enum class { x }; // { dg-error "anonymous" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C
index bad33d6e822..dff46b4af76 100644
--- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C
@@ -3,17 +3,17 @@
// Test for syntax support of various attribute permutations.
int
-[[gnu::noreturn]] // { dg-warning "ignored" }
+[[noreturn]] // { dg-warning "ignored" }
one
[[gnu::unused]]
(void);
-int one_third [[gnu::noreturn]] [[gnu::unused]] (void);
+int one_third [[noreturn]] [[gnu::unused]] (void);
int [[gnu::unused]] one_half(); // { dg-warning "ignored" }
static
-[[gnu::noreturn]] // { dg-warning "ignored" }
+[[noreturn]] // { dg-warning "ignored" }
void two [[gnu::unused]] (void) {}
@@ -21,10 +21,10 @@ void two [[gnu::unused]] (void) {}
[[gnu::unused]]
int
five(void)
-[[gnu::noreturn]] // { dg-warning "ignored" }
+[[noreturn]] // { dg-warning "ignored" }
{}
-[[gnu::noreturn]]
+[[noreturn]]
void
six (void)
;
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist68.C b/gcc/testsuite/g++.dg/cpp0x/initlist68.C
new file mode 100644
index 00000000000..7cfe1a34bee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist68.C
@@ -0,0 +1,20 @@
+// PR c++/56772
+// { dg-require-effective-target c++11 }
+
+typedef __SIZE_TYPE__ size_t;
+void* operator new[](size_t, void *p) { return p; }
+template <typename T = size_t>
+void f ()
+{
+ size_t coord [2][2];
+ new (&coord) size_t [2][2]
+ {
+ {0,0},
+ {0,0},
+ };
+}
+
+int main ()
+{
+ f<>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto2.C
new file mode 100644
index 00000000000..05fadf5d047
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto2.C
@@ -0,0 +1,16 @@
+// PR c++/56901
+// { dg-require-effective-target c++11 }
+
+template <typename>
+void foo_impl()
+{
+ int data;
+ auto L = [&](){ return data; };
+ [&](){ L(); }();
+ [&L](){ L(); }();
+}
+
+void foo()
+{
+ foo_impl<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C
new file mode 100644
index 00000000000..10dc6e36d2b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C
@@ -0,0 +1,14 @@
+// PR c++/56388
+// { dg-require-effective-target c++11 }
+
+int main()
+{
+ bool /*const*/ condition = false;
+
+ [&]{
+ try{}
+ catch(...){
+ if(condition){}
+ }
+ }();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/range-for24.C b/gcc/testsuite/g++.dg/cpp0x/range-for24.C
new file mode 100644
index 00000000000..b4a5b185bd7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/range-for24.C
@@ -0,0 +1,15 @@
+// PR c++/56794
+// { dg-require-effective-target c++11 }
+
+template<int... values>
+static void Colors()
+{
+ static const int colors[] = { values... };
+
+ for(auto c: colors) { }
+}
+
+int main()
+{
+ Colors<0,1,2> ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual-mangle1.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual-mangle1.C
new file mode 100644
index 00000000000..c6ef0792b50
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual-mangle1.C
@@ -0,0 +1,37 @@
+// PR c++/56821
+// { dg-require-effective-target c++11 }
+
+struct A {
+ // { dg-final { scan-assembler "_ZNR1A1fEv" } }
+ void f() & {}
+ // { dg-final { scan-assembler "_ZNO1A1gEv" } }
+ void g() && {}
+ // { dg-final { scan-assembler "_ZNKR1A1hEv" } }
+ void h() const & {}
+};
+
+// { dg-final { scan-assembler "_Z1jM1AFvvRE" } }
+void j(void (A::*)() &) { }
+// { dg-final { scan-assembler "_Z1kM1AFvvOE" } }
+void k(void (A::*)() &&) { }
+// { dg-final { scan-assembler "_Z1lM1AKFvvRE" } }
+void l(void (A::*)() const &) { }
+
+// { dg-final { scan-assembler "_Z1mIFvvOEEvM1AT_" } }
+// { dg-final { scan-assembler "_Z1mIFvvREEvM1AT_" } }
+// { dg-final { scan-assembler "_Z1mIKFvvREEvM1AT_" } }
+template <typename T>
+void m(T A::*) {}
+
+// { dg-final { scan-assembler "_Z1nIM1AFvvOEEvT_" } }
+// { dg-final { scan-assembler "_Z1nIM1AFvvREEvT_" } }
+// { dg-final { scan-assembler "_Z1nIM1AKFvvREEvT_" } }
+template <typename T>
+void n(T) {}
+
+int main()
+{
+ j(&A::f); k(&A::g); l(&A::h);
+ m(&A::f); m(&A::g); m(&A::h);
+ n(&A::f); n(&A::g); n(&A::h);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual-multi-neg.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual-multi-neg.C
new file mode 100644
index 00000000000..5be89423f03
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual-multi-neg.C
@@ -0,0 +1,7 @@
+// { dg-require-effective-target c++11 }
+
+class Foo
+{
+public:
+ void bar() const && & { } // { dg-error "multiple ref-qualifiers" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual1.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual1.C
new file mode 100644
index 00000000000..7fa826c3db4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual1.C
@@ -0,0 +1,30 @@
+// { dg-require-effective-target c++11 }
+
+template <class,class> struct ST;
+template <class T> struct ST<T,T> {};
+
+struct A
+{
+ int f() &;
+ char f() &&;
+};
+
+template <class T> struct B
+{
+ int f() &;
+ char f() &&;
+};
+
+int main()
+{
+ A a;
+ a.f();
+ A().f();
+ ST<decltype(a.f()), int>();
+ ST<decltype(A().f()), char>();
+ B<int> b;
+ b.f();
+ B<int>().f();
+ ST<decltype(b.f()), int>();
+ ST<decltype(B<int>().f()), char>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual2.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual2.C
new file mode 100644
index 00000000000..fa09ab48a15
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual2.C
@@ -0,0 +1,75 @@
+// In a .* expression whose object expression is an rvalue, the program is
+// ill-formed if the second operand is a pointer to member function with
+// ref-qualifier &. In a .* expression whose object expression is an
+// lvalue, the program is ill-formed if the second operand is a pointer to
+// member function with ref-qualifier &&.
+
+// { dg-require-effective-target c++11 }
+
+struct A {
+ void f() &;
+ void g() &&;
+ void h();
+};
+
+void one()
+{
+ A a;
+
+ void (A::*p)() & = &A::f;
+ (a.*p)();
+ (A().*p)(); // { dg-error "" }
+
+ p = &A::g; // { dg-error "" }
+ p = &A::h; // { dg-error "" }
+
+ void (A::*p2)() && = &A::g;
+ (A().*p2)();
+ (a.*p2)(); // { dg-error "" }
+ p2 = &A::f; // { dg-error "" }
+ p2 = &A::h; // { dg-error "" }
+
+ void (A::*p3)() = &A::h;
+ (a.*p3)();
+ (A().*p3)();
+ p3 = &A::f; // { dg-error "" }
+ p3 = &A::g; // { dg-error "" }
+}
+
+template <class T>
+struct B {
+ void f() &;
+ void g() &&;
+ void h();
+};
+
+template <class T>
+void two()
+{
+ B<T> a;
+
+ void (B<T>::*p)() & = &B<T>::f;
+ (a.*p)();
+ (B<T>().*p)(); // { dg-error "" }
+
+ p = &B<T>::g; // { dg-error "" }
+ p = &B<T>::h; // { dg-error "" }
+
+ void (B<T>::*p2)() && = &B<T>::g;
+ (B<T>().*p2)();
+ (a.*p2)(); // { dg-error "" }
+ p2 = &B<T>::f; // { dg-error "" }
+ p2 = &B<T>::h; // { dg-error "" }
+
+ void (B<T>::*p3)() = &B<T>::h;
+ (a.*p3)();
+ (B<T>().*p3)();
+ p3 = &B<T>::f; // { dg-error "" }
+ p3 = &B<T>::g; // { dg-error "" }
+}
+
+int main()
+{
+ one();
+ two<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual3.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual3.C
new file mode 100644
index 00000000000..1b21196321a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual3.C
@@ -0,0 +1,29 @@
+// An explicitly defaulted function can have a ref-qualifier.
+
+// { dg-require-effective-target c++11 }
+
+struct A {
+ A& operator=(const A&) & = default;
+};
+
+template<class T>
+struct B {
+ B& operator=(const B&) & = default;
+};
+
+template<class T>
+void f()
+{
+ B<T> b;
+ b = B<T>();
+ B<T>() = b; // { dg-error "" }
+}
+
+int main()
+{
+ A a;
+ a = A();
+ A() = a; // { dg-error "" }
+
+ f<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual4.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual4.C
new file mode 100644
index 00000000000..5a0ee162fe5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual4.C
@@ -0,0 +1,14 @@
+// 12.1: A constructor shall not be declared with a ref-qualifier.
+// 12.4: A destructor shall not be declared with a ref-qualifier.
+
+// { dg-require-effective-target c++11 }
+
+struct A {
+ A() & = default; // { dg-error "constructor" }
+ ~A() & = default; // { dg-error "destructor" }
+};
+
+int main()
+{
+ A a;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual5.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual5.C
new file mode 100644
index 00000000000..e3d26e5a78f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual5.C
@@ -0,0 +1,13 @@
+// 13.1: ...cannot be overloaded if any of them, but not all, have a
+// ref-qualifier.
+
+// { dg-require-effective-target c++11 }
+
+class Y {
+ void h() &;
+ void h() const &; // OK
+ void h() &&; // OK, all declarations have a ref-qualifier
+ void i() &; // { dg-message "" }
+ void i() const; // { dg-error "" } prior declaration of i
+ // has a ref-qualifier
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual6.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual6.C
new file mode 100644
index 00000000000..02e3f6e683e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual6.C
@@ -0,0 +1,15 @@
+// Binding an rvalue to && beats binding it to const& (13.3.3.2).
+
+// { dg-require-effective-target c++11 }
+
+struct A
+{
+ int operator+(int) &&;
+};
+
+void operator+ (const A&, int);
+
+int main()
+{
+ return A() + 42;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual7.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual7.C
new file mode 100644
index 00000000000..2430665db34
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual7.C
@@ -0,0 +1,19 @@
+// typedef test
+// { dg-require-effective-target c++11 }
+
+typedef void F() &;
+
+F f; // { dg-error "" }
+F* p; // { dg-error "" }
+extern F& r; // { dg-error "" }
+
+struct A {
+ F f;
+};
+
+int main()
+{
+ A a;
+ a.f();
+ A().f(); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual8.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual8.C
new file mode 100644
index 00000000000..b4c972b3c3b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual8.C
@@ -0,0 +1,13 @@
+// { dg-require-effective-target c++11 }
+
+struct A
+{
+ virtual void f() & = 0;
+};
+
+struct B: A
+{
+ void f(); // doesn't override
+};
+
+B b; // { dg-error "abstract" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae44.C b/gcc/testsuite/g++.dg/cpp0x/sfinae44.C
new file mode 100644
index 00000000000..bbcae622630
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae44.C
@@ -0,0 +1,26 @@
+// PR c++/56913
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+T &&declval();
+
+template<typename T, typename U,
+ typename = decltype((declval<T>().*declval<U>())())>
+constexpr bool test(int)
+{
+ return true;
+}
+
+template<typename T, typename U>
+constexpr bool test(...)
+{
+ return false;
+}
+
+struct S
+{};
+
+static_assert(!test<S, void (S::*)() &>(0), "");
+static_assert(test<S, void (S::*)() &&>(0), "");
+static_assert(test<S &, void (S::*)() &>(0), "");
+static_assert(!test<S &, void (S::*)() &&>(0), "");
diff --git a/gcc/testsuite/g++.dg/debug/pr56294.C b/gcc/testsuite/g++.dg/debug/pr56294.C
index 204c78eadc6..a9ee807631f 100644
--- a/gcc/testsuite/g++.dg/debug/pr56294.C
+++ b/gcc/testsuite/g++.dg/debug/pr56294.C
@@ -1,5 +1,6 @@
// { dg-do compile }
// { dg-options "-fno-ipa-sra -fcompare-debug" }
+// { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } }
struct comp_cost { int cost; unsigned complexity; };
struct cost_pair { struct iv_cand *cand; };
diff --git a/gcc/testsuite/g++.dg/debug/pr56819.C b/gcc/testsuite/g++.dg/debug/pr56819.C
new file mode 100644
index 00000000000..62926be2fb0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr56819.C
@@ -0,0 +1,27 @@
+// PR debug/56819
+// { dg-do compile }
+// { dg-options "-fcompare-debug" }
+
+template <typename>
+struct A
+{
+ template <typename>
+ struct B;
+};
+
+template <typename>
+struct C
+{
+ typedef int I;
+};
+
+template <typename T>
+class D
+{
+ typedef A <void> E;
+ typedef typename T::template B <E> F;
+ typedef typename C <F>::I I;
+ A <I> foo () { return A<I> (); }
+};
+
+template class D <A <void> >;
diff --git a/gcc/testsuite/g++.dg/ext/pr56790-1.C b/gcc/testsuite/g++.dg/ext/pr56790-1.C
new file mode 100644
index 00000000000..84feca19c7d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/pr56790-1.C
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
+
+typedef long vec __attribute__ ((vector_size (2 * sizeof (long))));
+
+vec f (void)
+{
+ vec a = { 5, 7 };
+ vec b = { 11, 13 };
+ vec m = { -1, 0 };
+ return m ? a : b;
+}
+
+/* { dg-final { scan-tree-dump "{ 5, 13 }" "ccp1" } } */
+/* { dg-final { scan-tree-dump-not "VEC_COND_EXPR" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/g++.dg/gomp/for-19.C b/gcc/testsuite/g++.dg/gomp/for-19.C
index 966ad96306d..7da74a780ac 100644
--- a/gcc/testsuite/g++.dg/gomp/for-19.C
+++ b/gcc/testsuite/g++.dg/gomp/for-19.C
@@ -9,7 +9,7 @@ void
f1 (void)
{
#pragma omp for
- for (void *q = (void *)p; q < (void *) (p + 4); q++) // { dg-error "forbids incrementing a pointer of type" }
+ for (void *q = (void *)p; q < (void *) (p + 4); q++) // { dg-warning "forbids incrementing a pointer of type" }
;
}
@@ -27,7 +27,7 @@ void
f3 (void)
{
#pragma omp for
- for (T q = T (p); q < T (p + 4); q++) // { dg-error "forbids incrementing a pointer of type" }
+ for (T q = T (p); q < T (p + 4); q++) // { dg-warning "forbids incrementing a pointer of type" }
;
}
diff --git a/gcc/testsuite/g++.dg/opt/vt2.C b/gcc/testsuite/g++.dg/opt/vt2.C
new file mode 100644
index 00000000000..a77db38755a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/vt2.C
@@ -0,0 +1,24 @@
+// PR c++/34949
+// { dg-options "-O3" }
+// { dg-final { scan-assembler-not "mov\[^\n\]*_ZTV" { target i?86-*-* x86_64-*-* } } }
+
+class Foo
+{
+public:
+ virtual ~Foo();
+};
+
+Foo::~Foo()
+{
+}
+
+
+class Bar : public Foo
+{
+public:
+ virtual ~Bar();
+};
+
+Bar::~Bar()
+{
+}
diff --git a/gcc/testsuite/g++.dg/opt/vt3.C b/gcc/testsuite/g++.dg/opt/vt3.C
new file mode 100644
index 00000000000..0cef67206e0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/vt3.C
@@ -0,0 +1,43 @@
+// PR c++/34949
+// { dg-do compile }
+// { dg-options "-O3" }
+
+struct E {};
+struct A
+{
+ virtual void a (void *) = 0;
+};
+struct B
+{
+ virtual ~B () {};
+ unsigned int b1;
+ E **b2;
+ A *b3;
+};
+struct C : public B
+{
+ ~C ();
+};
+C::~C ()
+{
+ for (unsigned int i = 0; i < b1; i++)
+ b3->a (b2);
+}
+struct D
+{
+ ~D () {}
+ C d;
+};
+struct F { virtual ~F () {}; };
+struct G { void g (); };
+struct H : public F
+{
+ virtual ~H ();
+ D *h1;
+ G *h2;
+};
+H::~H ()
+{
+ h2->g ();
+ delete h1;
+}
diff --git a/gcc/testsuite/g++.dg/opt/vt4.C b/gcc/testsuite/g++.dg/opt/vt4.C
new file mode 100644
index 00000000000..c8d04cffc16
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/vt4.C
@@ -0,0 +1,31 @@
+// PR c++/50243
+// { dg-do compile }
+// { dg-options "-O" }
+// { dg-final { scan-assembler-not "_ZTV.A" } }
+
+void foo ();
+
+struct A
+{
+ ~A () { }
+ virtual void a () = 0;
+ virtual void b () = 0;
+ virtual void c () = 0;
+};
+
+struct B : public A
+{
+ ~B () { foo (); }
+ void a () { foo (); }
+ void b () { foo (); }
+ void c () { delete this; }
+};
+
+void
+test ()
+{
+ A *y = new B ();
+ y->a ();
+ y->b ();
+ y->c ();
+}
diff --git a/gcc/testsuite/g++.dg/rtti/typeid10.C b/gcc/testsuite/g++.dg/rtti/typeid10.C
new file mode 100644
index 00000000000..47b45b1056d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid10.C
@@ -0,0 +1,36 @@
+// PR c++/25466
+// { dg-do run }
+
+#include <typeinfo>
+
+const std::type_info *a;
+
+template <class T>
+bool is_polymorphic() {
+ bool result(false);
+ const std::type_info &a1 = typeid( (result=true), *(T*)0);
+ a = &a1;
+ return result;
+}
+
+struct non_polymorphic {};
+struct polymorphic { virtual ~polymorphic() {} };
+
+
+int main() {
+ if (is_polymorphic<int>()) __builtin_abort();
+ if (is_polymorphic<non_polymorphic>()) __builtin_abort();
+ try
+ {
+ is_polymorphic<polymorphic>();
+ __builtin_abort(); // should have thrown bad_typeid
+ }
+ catch (std::bad_typeid&)
+ {
+ // OK
+ }
+ catch (...)
+ {
+ __builtin_abort();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/template/abstract-dr337.C b/gcc/testsuite/g++.dg/template/abstract-dr337.C
index 6905262d6cb..4f66c1c1188 100644
--- a/gcc/testsuite/g++.dg/template/abstract-dr337.C
+++ b/gcc/testsuite/g++.dg/template/abstract-dr337.C
@@ -6,8 +6,8 @@ class A {
};
template<typename T>
-void g(T (*a)[1]) {} // { dg-error "abstract" "" }
+void g(T (*a)[1]) {} // { dg-error "abstract" "" { xfail *-*-* } }
int main() {
- g<A<int> >(0); // { dg-error "no matching function" }
+ g<A<int> >(0); // { dg-error "no matching function" "" { xfail *-*-* } }
}
diff --git a/gcc/testsuite/g++.dg/template/arrow3.C b/gcc/testsuite/g++.dg/template/arrow3.C
new file mode 100644
index 00000000000..b2029ba4894
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/arrow3.C
@@ -0,0 +1,38 @@
+// PR c++/56895
+// { dg-do compile }
+
+extern struct A { bool foo (); A bar (); } *a;
+
+template <int>
+int
+baz1 ()
+{
+ return 2 << (a->bar().foo() ? 1 : 0);
+}
+
+template <int>
+int
+baz2 ()
+{
+ return 2 >> (a->bar().foo() ? 1 : 0);
+}
+
+template <int>
+int
+baz3 ()
+{
+ return 10 / (a->bar().foo() ? 1 : 2);
+}
+
+template <int>
+int
+baz4 ()
+{
+ return 10 % (a->bar().foo() ? 1 : 0);
+}
+
+int
+test ()
+{
+ return baz1<0> () + baz2<0> () + baz3<0> () + baz4<0> ();
+}
diff --git a/gcc/testsuite/g++.dg/template/arrow4.C b/gcc/testsuite/g++.dg/template/arrow4.C
new file mode 100644
index 00000000000..89e78221958
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/arrow4.C
@@ -0,0 +1,19 @@
+// PR c++/56895
+// { dg-do compile }
+
+void fn (int *);
+void fn (int);
+extern struct A { bool foo (); A bar (); } *a;
+
+template <int>
+void
+baz ()
+{
+ fn (a->bar().foo() ? 1 : 0);
+}
+
+void
+test ()
+{
+ baz<0> ();
+}
diff --git a/gcc/testsuite/g++.dg/template/non-deducible1.C b/gcc/testsuite/g++.dg/template/non-deducible1.C
new file mode 100644
index 00000000000..42135248904
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/non-deducible1.C
@@ -0,0 +1,8 @@
+// PR c++/23055
+
+template <class> struct S { typedef int type; };
+
+template <class T>
+int foo(T, typename S<T>::type * ret);
+
+int j = foo(1, 0);
diff --git a/gcc/testsuite/g++.dg/template/nontype25.C b/gcc/testsuite/g++.dg/template/nontype25.C
index bcdcce5ea9b..f3994083ebe 100644
--- a/gcc/testsuite/g++.dg/template/nontype25.C
+++ b/gcc/testsuite/g++.dg/template/nontype25.C
@@ -7,7 +7,7 @@ template<const A* a> class C {};
template<const B* b> class D {};
template<B* b> class E {};
-template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" "" { target c++98 } }
+template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" "" }
template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error "" "" { target c++98 } }
B b;
diff --git a/gcc/testsuite/g++.dg/torture/pr56768.C b/gcc/testsuite/g++.dg/torture/pr56768.C
new file mode 100644
index 00000000000..db504c500e0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr56768.C
@@ -0,0 +1,41 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+struct Iter
+{
+ int& operator* ();
+ void operator++ ();
+};
+
+bool operator!= (Iter &, Iter &) { }
+
+struct Container
+{
+ Iter begin () const;
+ Iter end () const;
+};
+
+struct J
+{
+ virtual J *mutable_child ();
+};
+
+struct M
+{
+ M (const Container &);
+ J ns_;
+};
+namespace
+{
+ J MakeNamespace (const Container &src)
+ {
+ J a;
+ J *b = 0;
+ for (const int &c: src)
+ b = b ? b->mutable_child () : &a;
+ return a;
+ }
+}
+M::M (const Container &ns):ns_ (MakeNamespace (ns))
+{
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr56817.C b/gcc/testsuite/g++.dg/torture/pr56817.C
new file mode 100644
index 00000000000..35fc6f74ff2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr56817.C
@@ -0,0 +1,38 @@
+// { dg-do compile }
+// { dg-options "--param max-unroll-times=32" }
+
+struct A {};
+A **q;
+struct B
+{
+ A **j;
+ B () { j = q; }
+ A *& operator[] (unsigned long x) { return j[x]; }
+};
+struct C
+{
+ C (int r) : v (), s (r) {}
+ A *& operator () (int i, int j) { return v[i * s + j]; }
+ B v;
+ int s;
+};
+struct D
+{
+ D ()
+ {
+ unsigned h = 2;
+ for (int i = 0; i < 1; ++i, h *= 2)
+ {
+ C w (h);
+ for (unsigned j = 0; j < h; ++j)
+ for (unsigned k = 0; k < h; ++k)
+ w (j, k) = new A;
+ }
+ }
+};
+void
+foo ()
+{
+ for (int i = 0; i < 3; i++)
+ A (), A (), D ();
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr56837.C b/gcc/testsuite/g++.dg/torture/pr56837.C
new file mode 100644
index 00000000000..d0071228047
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr56837.C
@@ -0,0 +1,20 @@
+// { dg-do run }
+// { dg-options "-ftree-loop-distribute-patterns" }
+
+extern "C" void abort (void);
+extern "C" int memcmp (const void *, const void *, __SIZE_TYPE__);
+
+bool b1[8];
+bool b2[8] = { true, true, true, true, true, true, true, true };
+
+int main()
+{
+ unsigned int i;
+ for(i=0 ; i < 8; i++)
+ b1[i] = true;
+
+ if (memcmp (b1, b2, 8) != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr56854.C b/gcc/testsuite/g++.dg/torture/pr56854.C
new file mode 100644
index 00000000000..fc7e30299f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr56854.C
@@ -0,0 +1,24 @@
+// PR tree-optimization/56854
+// { dg-do compile }
+
+inline void *
+operator new (__SIZE_TYPE__, void *p) throw ()
+{
+ return p;
+}
+
+struct A
+{
+ int a;
+ A () : a (0) {}
+ ~A () {}
+ A &operator= (const A &v) { this->~A (); new (this) A (v); return *this; }
+};
+A b[4], c[4];
+
+void
+foo ()
+{
+ for (int i = 0; i < 4; ++i)
+ c[i] = b[i];
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C b/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
index 0a29ce9cb4f..b0faa93e3c5 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
@@ -26,6 +26,6 @@ t (void)
// { dg-final { scan-tree-dump-times "Empty EH handler" 2 "ehcleanup1" } }
//
// And as a result also contained control flow.
-// { dg-final { scan-tree-dump-times "Removing unreachable" 4 "ehcleanup1" } }
+// { dg-final { scan-tree-dump-times "Removing unreachable" 6 "ehcleanup1" } }
//
// { dg-final { cleanup-tree-dump "ehcleanup1" } }
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
new file mode 100644
index 00000000000..9b2fcc683c3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_hw_misalign } */
+/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model" } */
+
+class mydata {
+public:
+ mydata() {Set(-1.0);}
+ void Set (float);
+ static int upper() {return 8;}
+ float data[8];
+};
+
+void mydata::Set (float x)
+{
+ for (int i=0; i<upper(); i++)
+ data[i] = x;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C b/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C
new file mode 100644
index 00000000000..a4aa6960897
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C
@@ -0,0 +1,13 @@
+// PR c++/56815
+// { dg-options "-Wpointer-arith" }
+
+int main()
+{
+ void *pv = 0;
+ pv++; // { dg-warning "forbids incrementing a pointer" }
+
+ typedef void (*pft) ();
+
+ pft pf = 0;
+ pf++; // { dg-warning "forbids incrementing a pointer" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/mangle1.C b/gcc/testsuite/g++.old-deja/g++.pt/mangle1.C
index d7be4fbf0fd..1fe009dbffc 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/mangle1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/mangle1.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-options "" }
// Origin: Mark Mitchell <mark@codesourcery.com>
typedef enum {} i;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56745.c b/gcc/testsuite/gcc.c-torture/compile/pr56745.c
new file mode 100644
index 00000000000..ee9ba051fec
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr56745.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/56745 */
+
+unsigned char a[6];
+
+void
+foo ()
+{
+ int i;
+ for (i = 5; i >= 0; i++)
+ {
+ if (++a[i] != 0)
+ break;
+ ++a[i];
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr19449.c b/gcc/testsuite/gcc.c-torture/execute/pr19449.c
new file mode 100644
index 00000000000..63cc2e74e19
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr19449.c
@@ -0,0 +1,20 @@
+/* PR c/19449 */
+
+extern void abort (void);
+
+int y;
+int z = __builtin_choose_expr (!__builtin_constant_p (y), 3, 4);
+
+int
+foo (int x)
+{
+ return __builtin_choose_expr (!__builtin_constant_p (x), 3, y++);
+}
+
+int
+main ()
+{
+ if (y || z != 3 || foo (4) != 3)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56799.c b/gcc/testsuite/gcc.c-torture/execute/pr56799.c
new file mode 100644
index 00000000000..d9ee26bc27f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr56799.c
@@ -0,0 +1,43 @@
+
+#include <stdio.h>
+typedef struct { int x; int y;} S;
+extern int foo(S*);
+int hi = 0, lo = 0;
+
+int main()
+{
+ S a;
+ int r;
+ a.x = (int) 0x00010000;
+ a.y = 1;
+ r = foo (&a);
+ if (r == 2 && lo==0 && hi==1)
+ {
+ exit (0);
+ }
+ abort ();
+}
+
+typedef unsigned short u16;
+
+__attribute__ ((noinline)) int foo (S* ptr)
+{
+ int a = ptr->x;
+ int c = 0;
+ u16 b = (u16) a;
+ if (b != 0)
+ {
+ lo = 1;
+ c += ptr->y;
+ }
+ b = a >> 16;
+ if (b != 0)
+ {
+ hi = 1;
+ c+= ptr->y;
+ }
+ c += ptr->y;
+ return c;
+}
+
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56837.c b/gcc/testsuite/gcc.c-torture/execute/pr56837.c
new file mode 100644
index 00000000000..a6ce2af71ad
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr56837.c
@@ -0,0 +1,21 @@
+extern void abort (void);
+_Complex int a[1024];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ a[i] = -1;
+}
+
+int
+main ()
+{
+ int i;
+ foo ();
+ for (i = 0; i < 1024; i++)
+ if (a[i] != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56899.c b/gcc/testsuite/gcc.c-torture/execute/pr56899.c
new file mode 100644
index 00000000000..9adf9af00ff
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr56899.c
@@ -0,0 +1,47 @@
+/* PR tree-optimization/56899 */
+
+#if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
+__attribute__((noinline, noclone)) void
+f1 (int v)
+{
+ int x = -214748365 * (v - 1);
+ if (x != -1932735285)
+ __builtin_abort ();
+}
+
+__attribute__((noinline, noclone)) void
+f2 (int v)
+{
+ int x = 214748365 * (v + 1);
+ if (x != -1932735285)
+ __builtin_abort ();
+}
+
+__attribute__((noinline, noclone)) void
+f3 (unsigned int v)
+{
+ unsigned int x = -214748365U * (v - 1);
+ if (x != -1932735285U)
+ __builtin_abort ();
+}
+
+__attribute__((noinline, noclone)) void
+f4 (unsigned int v)
+{
+ unsigned int x = 214748365U * (v + 1);
+ if (x != -1932735285U)
+ __builtin_abort ();
+}
+#endif
+
+int
+main ()
+{
+#if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
+ f1 (10);
+ f2 (-10);
+ f3 (10);
+ f4 (-10U);
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56962.c b/gcc/testsuite/gcc.c-torture/execute/pr56962.c
new file mode 100644
index 00000000000..7c6da48b307
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr56962.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/56962 */
+
+extern void abort (void);
+long long v[144];
+
+__attribute__((noinline, noclone)) void
+bar (long long *x)
+{
+ if (x != &v[29])
+ abort ();
+}
+
+__attribute__((noinline, noclone)) void
+foo (long long *x, long y, long z)
+{
+ long long a, b, c;
+ a = x[z * 4 + y * 3];
+ b = x[z * 5 + y * 3];
+ c = x[z * 5 + y * 4];
+ x[y * 4] = a;
+ bar (&x[z * 5 + y]);
+ x[z * 5 + y * 5] = b + c;
+}
+
+int
+main ()
+{
+ foo (v, 24, 1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c
new file mode 100644
index 00000000000..33fd8b525d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+int A[256];
+
+int add( int x, int y)
+{
+ return x+y;
+}
+
+void
+check () {
+ int a;
+ a = __sec_reduce_min_ind (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_max_ind (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_any_zero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_any_nonzero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_all_nonzero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_max (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_min (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_mul (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce_add (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */
+ a = __sec_reduce (0, __sec_reduce_min_ind (A[:]), add); /* { dg-error "cannot have array notation parameter with zero" } */
+ __sec_reduce_mutating (&a, __sec_reduce_min_ind (A[:]), add); /* { dg-error "cannot have array notation parameter with zero" } */
+}
+
+
+
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/tst_lngth.c b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/tst_lngth.c
new file mode 100644
index 00000000000..015a7eb7370
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/tst_lngth.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options " -fcilkplus " } */
+
+#if HAVE_IO
+#include <stdio.h>
+#endif
+
+#define N 256
+int A[N], B[N];
+
+int
+main ()
+{
+ A[0:(N / 4)] = A[4]+ B[0:(N / 2):2]; /* { dg-error "length mismatch between" } */
+ A[0:(N / 4)] = B[0:(N / 2):2] + N; /* { dg-error "length mismatch between" } */
+ A[0:(N / 4)] = B[0:(N / 2):2] + A[4]; /* { dg-error "length mismatch between" } */
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.c b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.c
new file mode 100644
index 00000000000..f4f3ca5a6bb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/execute/test_sec_limits.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-fcilkplus" } */
+
+#include <limits.h>
+int A[16];
+int a = 0;
+
+int main () {
+ if (__sec_reduce_max(A[0:0:2]) != INT_MIN)
+ a++;
+
+ if (__sec_reduce_min(A[0:0:2]) != INT_MAX)
+ a++;
+
+ return a;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/fold-cstvecshift.c b/gcc/testsuite/gcc.dg/fold-cstvecshift.c
new file mode 100644
index 00000000000..51f42d42bc1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-cstvecshift.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+typedef int vec __attribute__ ((vector_size (4 * sizeof (int))));
+
+void f (vec *r)
+{
+ vec a = { 2, 3, 4, 5 };
+ *r = (a << 2) >> 1;
+}
+
+/* { dg-final { scan-tree-dump "{ 4, 6, 8, 10 }" "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/pr48186.c b/gcc/testsuite/gcc.dg/pr48186.c
new file mode 100644
index 00000000000..5635f930de3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr48186.c
@@ -0,0 +1,5 @@
+/* PR tree-optimization/48186 */
+/* { dg-do compile } */
+/* { dg-options "-O --param hot-bb-frequency-fraction=0" } */
+
+void foo (void) { }
diff --git a/gcc/testsuite/gcc.dg/pr55702.c b/gcc/testsuite/gcc.dg/pr55702.c
new file mode 100644
index 00000000000..8770a3758d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55702.c
@@ -0,0 +1,9 @@
+/* PR sanitizer/55702 */
+/* { dg-do compile { target { x86_64-*-linux* && lp64 } } } */
+/* { dg-options "-fsanitize=thread" } */
+
+void
+foo ()
+{
+ __builtin_return (0);
+}
diff --git a/gcc/testsuite/gcc.dg/pr56809.c b/gcc/testsuite/gcc.dg/pr56809.c
new file mode 100644
index 00000000000..3f1f3115c3f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56809.c
@@ -0,0 +1,32 @@
+/* PR target/56809 */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+int
+foo (int mode, int i)
+{
+ int x;
+
+ switch (mode)
+ {
+ case 0:
+ x = i + 1;
+ break;
+ case 1:
+ x = i / 2;
+ break;
+ case 2:
+ x = i * 3;
+ break;
+ case 3:
+ x = i + 3;
+ break;
+ case 4:
+ x = i + 5;
+ break;
+ default:
+ x = i - 1;
+ }
+
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/pr56837.c b/gcc/testsuite/gcc.dg/pr56837.c
new file mode 100644
index 00000000000..d665a6db7ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56837.c
@@ -0,0 +1,67 @@
+/* Limit this test to selected targets with IEEE double, 8-byte long long,
+ supported 4x int vectors, 4-byte int. */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-additional-options "-msse2" { target ia32 } } */
+/* { dg-additional-options "-mvsx -maltivec" { target powerpc*-*-* } } */
+
+typedef int V __attribute__((__vector_size__ (16)));
+#define N 1024
+double d[N];
+long long int l[N];
+_Bool b[N];
+_Complex double c[N];
+V v[N];
+
+void
+fd (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ d[i] = 747708026454360457216.0;
+}
+
+void
+fl (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ l[i] = 0x7c7c7c7c7c7c7c7cULL;
+}
+
+void
+fb (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ b[i] = 1;
+}
+
+void
+fc (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ c[i] = 747708026454360457216.0 + 747708026454360457216.0i;
+}
+
+void
+fv (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ v[i] = (V) { 0x12121212, 0x12121212, 0x12121212, 0x12121212 };
+}
+
+/* Look for
+ __builtin_memset (&d, 68, 8192);
+ __builtin_memset (&l, 124, 8192);
+ __builtin_memset (&b, 1, 1024);
+ __builtin_memset (&c, 68, 16384);
+ __builtin_memset (&v, 18, 16384); */
+/* { dg-final { scan-tree-dump-times "memset ..d, 68, 8192.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..l, 124, 8192.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..b, 1, 1024.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..c, 68, 16384.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..v, 18, 16384.;" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr56890-1.c b/gcc/testsuite/gcc.dg/pr56890-1.c
new file mode 100644
index 00000000000..93b2134e594
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56890-1.c
@@ -0,0 +1,15 @@
+/* PR target/56890 */
+/* Reported by Rainer Jung <rainer.jung@kippdata.de> */
+
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+unsigned int buggy(unsigned int min, unsigned int max)
+{
+ if (max < 16384) {
+ unsigned short num16 = 0;
+ num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0)));
+ return num16;
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr56890-2.c b/gcc/testsuite/gcc.dg/pr56890-2.c
new file mode 100644
index 00000000000..474327e9d03
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56890-2.c
@@ -0,0 +1,19 @@
+/* PR target/56890 */
+/* Reported by Rainer Jung <rainer.jung@kippdata.de> */
+
+/* { dg-do assemble } */
+/* { dg-options "-O" } */
+
+unsigned int buggy(unsigned int min, unsigned int max)
+{
+ unsigned int number;
+ if (max < 16384) {
+ unsigned short num16;
+ num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0)));
+ return num16;
+ }
+ else {
+ (number) = min + (long) ((double) (max - min + 1.0) * (number / (4294967295U + 1.0)));
+ }
+ return number;
+}
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index b6524f9a125..fa299c4385a 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -47,6 +47,8 @@
# else
# define SIZE 220
# endif
+# elif defined (_AIX)
+# define SIZE 208
# else
# define SIZE 240
# endif
diff --git a/gcc/testsuite/gcc.dg/torture/pr55964-2.c b/gcc/testsuite/gcc.dg/torture/pr55964-2.c
new file mode 100644
index 00000000000..a3bd09d5b8d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55964-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-distribution -funswitch-loops" } */
+
+struct test_struct {
+ int a, b[10], c[10], d[10];
+};
+
+extern struct test_struct* new_struct;
+
+void testfunc(struct test_struct* old_struct)
+{
+ int i;
+ for (i = 0; i < 10; ++i)
+ {
+ new_struct->b[i] = old_struct ? old_struct->b[i] : -1;
+ new_struct->c[i] = old_struct ? old_struct->c[i] : 0;
+ new_struct->d[i] = old_struct ? old_struct->d[i] : 0;
+ }
+ if (old_struct)
+ old_struct->a++;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr56407.c b/gcc/testsuite/gcc.dg/torture/pr56407.c
new file mode 100644
index 00000000000..f26fd23f77f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr56407.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+
+extern void abort(void);
+extern int rand(void);
+
+static void copy(int *r,int *a,int na)
+{
+ int i;
+ for( i = 0 ; i < na ; i++ )
+ r[i] = a[i];
+}
+
+static void foo(int *a,int na)
+{
+ int i;
+ for( i = 0 ; i < na ; i++ )
+ a[i] = rand();
+}
+
+static int cmp(int *a,int *b,int n)
+{
+ int i;
+ for( i = 0 ; i < n ; i++ )
+ if ( a[i] != b[i] )
+ return -1;
+ return 0;
+}
+
+void __attribute__((noinline,noclone))
+test(int sz,int comm)
+{
+ int j,n;
+ int v[64],w[64];
+ for( j = 1 ; j <= sz ; j++ )
+ {
+ n = (2 * j - 1) * (2 * j - 1);
+ foo(w,n);
+ copy(v,w,n);
+ if ( comm )
+ if ( cmp(v,w,n) ) abort ();
+ }
+}
+
+int main()
+{
+ test(2,1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr56501.c b/gcc/testsuite/gcc.dg/torture/pr56501.c
new file mode 100644
index 00000000000..d6fc29d7b66
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr56501.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+int a;
+void try_help () __attribute__ ((__noreturn__));
+void try_help ()
+{
+}
+
+int main ()
+{
+ switch (a)
+ {
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ break;
+ default:
+ try_help ();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr56778.c b/gcc/testsuite/gcc.dg/torture/pr56778.c
new file mode 100644
index 00000000000..48068774af3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr56778.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-march=core-avx2" { target x86_64-*-* } } */
+
+typedef struct {
+ float a,b,c;
+} S;
+
+S * arr[100];
+
+void bar (float *in[], int n)
+{
+ int i;
+ for (i=0; i<n; i++)
+ (*in)[i] = -arr[i]->b;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c
new file mode 100644
index 00000000000..cf0c504275f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+typedef const struct rtx_def *const_rtx;
+enum machine_mode
+{
+ MAX_MACHINE_MODE,
+ NUM_MACHINE_MODES = MAX_MACHINE_MODE
+};
+extern const char *const mode_name[NUM_MACHINE_MODES];
+enum mode_class
+{ MODE_RANDOM, MODE_CC, MODE_INT, MODE_PARTIAL_INT, MODE_FRACT, MODE_UFRACT,
+ MODE_ACCUM, MODE_UACCUM, MODE_FLOAT, MODE_DECIMAL_FLOAT, MODE_COMPLEX_INT,
+ MODE_COMPLEX_FLOAT, MODE_VECTOR_INT, MODE_VECTOR_FRACT,
+ MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM,
+ MODE_VECTOR_FLOAT, MAX_MODE_CLASS };
+extern const unsigned char mode_class[NUM_MACHINE_MODES];
+extern const unsigned short mode_precision[NUM_MACHINE_MODES];
+struct rtx_def
+{
+ __extension__ enum machine_mode mode:8;
+};
+void
+convert_move (rtx to, rtx from, int unsignedp)
+{
+ enum machine_mode to_mode = ((enum machine_mode) (to)->mode);
+ enum machine_mode from_mode = ((enum machine_mode) (from)->mode);
+ ((void)
+ (!((mode_precision[from_mode] != mode_precision[to_mode])
+ || ((((enum mode_class) mode_class[from_mode]) == MODE_DECIMAL_FLOAT) !=
+ (((enum mode_class) mode_class[to_mode]) ==
+ MODE_DECIMAL_FLOAT))) ?
+ fancy_abort ("/home/gcc/virgin-gcc/gcc/expr.c", 380, __FUNCTION__),
+ 0 : 0));
+}
+
+/* { dg-final { scan-tree-dump "Replaced.*!=.*with.*!=.* " "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c
new file mode 100644
index 00000000000..7d45ec135eb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-O2 -fdump-tree-einline" } */
+int w;
+int bar (void) __attribute__ ((weak));
+int bar (){
+ w++;
+}
+void foo()
+{
+ bar();
+}
+/* { dg-final { scan-tree-dump-times "function body can be overwritten at link time" 1 "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c
index 332fedf462a..8ea9ceaef5d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c
@@ -67,6 +67,5 @@ int main()
}
/* { dg-final { scan-tree-dump-times "generated memset zero" 1 "ldist" } } */
-/* { dg-final { scan-tree-dump-times "generated memset minus one" 1 "ldist" } } */
/* { dg-final { scan-tree-dump-times "generated memset" 5 "ldist" } } */
/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
index 12b77fe2f27..d4aa47a05ca 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
@@ -95,7 +95,7 @@ main (void)
b = 0;
gu1.b.l = 20000000;
s = bar ();
- if (s != 20000000)
+ if (s != (int)20000000)
__builtin_abort ();
if (gu2.b.l != 20000000)
__builtin_abort ();
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c
new file mode 100644
index 00000000000..0b9029f60b7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c
@@ -0,0 +1,82 @@
+/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-*"} } } */
+
+/* { dg-options "-O2 -fdump-tree-vrp2-details -fdump-tree-cddce2-details" } */
+
+struct bitmap_head_def;
+typedef struct bitmap_head_def *bitmap;
+typedef const struct bitmap_head_def *const_bitmap;
+
+
+typedef unsigned long BITMAP_WORD;
+typedef struct bitmap_element_def
+{
+ struct bitmap_element_def *next;
+ unsigned int indx;
+ BITMAP_WORD bits[((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u))];
+} bitmap_element;
+
+
+
+
+
+
+typedef struct bitmap_head_def
+{
+ bitmap_element *first;
+
+} bitmap_head;
+
+
+
+static __inline__ unsigned char
+bitmap_elt_ior (bitmap dst, bitmap_element * dst_elt,
+ bitmap_element * dst_prev, const bitmap_element * a_elt,
+ const bitmap_element * b_elt, unsigned char changed)
+{
+
+ if (a_elt)
+ {
+
+ if (!changed && dst_elt)
+ {
+ changed = 1;
+ }
+ }
+ else
+ {
+ changed = 1;
+ }
+ return changed;
+}
+
+unsigned char
+bitmap_ior_into (bitmap a, const_bitmap b)
+{
+ bitmap_element *a_elt = a->first;
+ const bitmap_element *b_elt = b->first;
+ bitmap_element *a_prev = ((void *) 0);
+ unsigned char changed = 0;
+
+ while (b_elt)
+ {
+
+ if (!a_elt || a_elt->indx == b_elt->indx)
+ changed = bitmap_elt_ior (a, a_elt, a_prev, a_elt, b_elt, changed);
+ else if (a_elt->indx > b_elt->indx)
+ changed = 1;
+ b_elt = b_elt->next;
+
+
+ }
+
+ return changed;
+}
+
+/* Verify that VRP simplified an "if" statement. */
+/* { dg-final { scan-tree-dump "Folded into: if.*" "vrp2"} } */
+/* Verify that DCE after VRP2 eliminates a dead conversion
+ to a (Bool). */
+/* { dg-final { scan-tree-dump "Deleting.*_Bool.*;" "cddce2"} } */
+/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/O3-pr36098.c b/gcc/testsuite/gcc.dg/vect/O3-pr36098.c
index 9e87b2372db..b0b8e3c9466 100644
--- a/gcc/testsuite/gcc.dg/vect/O3-pr36098.c
+++ b/gcc/testsuite/gcc.dg/vect/O3-pr36098.c
@@ -17,5 +17,5 @@ void foo (int ncons, t_sortblock *sb, int *iatom)
iatom[m]=sb[i].iatom[m];
}
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-31.c b/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
new file mode 100644
index 00000000000..9a3eac62b52
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+typedef double vec __attribute__ ((vector_size (2 * sizeof (double))));
+vec a;
+
+void f(){
+ a[0]=1+2*a[0]*a[0];
+ a[1]=1+2*a[1]*a[1];
+}
+
+/* { dg-final { scan-tree-dump "basic block vectorized using SLP" "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr56826.c b/gcc/testsuite/gcc.dg/vect/pr56826.c
new file mode 100644
index 00000000000..7a5c5ff4008
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr56826.c
@@ -0,0 +1,41 @@
+extern void abort (void);
+
+typedef struct {
+ int a[3];
+ int num;
+} t1;
+t1 B[100];
+int A[300];
+
+void __attribute__((noinline,noclone))
+bar (int *A, t1 *B, int n)
+{
+ int i;
+ int *a = A;
+ for (i=0; i<n; i++, a+=3)
+ {
+ a[0] = B[i].a[0];
+ a[1] = B[i].a[1];
+ a[2] = B[i].a[2];
+ }
+}
+
+int main()
+{
+ int i;
+ for (i=0; i<100; i++)
+ {
+ B[i].num = i;
+ B[i].a[0] = i * 3;
+ B[i].a[1] = i * 3 + 1;
+ B[i].a[2] = i * 3 + 2;
+ __asm__ volatile ("");
+ }
+ bar (&A[0], &B[0], 100);
+ for (i=0; i<300; i++)
+ if (A[i] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr56918.c b/gcc/testsuite/gcc.dg/vect/pr56918.c
new file mode 100644
index 00000000000..581faa0e226
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr56918.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/56918 */
+/* { dg-additional-options "-O3" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+double data[8];
+
+__attribute__((noinline, noclone)) void
+foo ()
+{
+ int i;
+ for (i = 0; i < 8; ++i)
+ data[i] = ((i + 2) % 3) + 1;
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ foo ();
+ if (data[0] != 3 || data[7] != 1)
+ abort ();
+ for (i = 1; i < 4; ++i)
+ if (data[i] != i || data[i + 3] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr56920.c b/gcc/testsuite/gcc.dg/vect/pr56920.c
new file mode 100644
index 00000000000..c6c7cca0f41
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr56920.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/56920 */
+/* { dg-additional-options "-O3" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+int
+main ()
+{
+ unsigned int a[15], i;
+ check_vect ();
+ for (i = 0; i < 15; ++i)
+ a[i] = (i * 2) % 15;
+ for (i = 0; i < 15; ++i)
+ if (a[i] != (i * 2) % 15)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr56933.c b/gcc/testsuite/gcc.dg/vect/pr56933.c
new file mode 100644
index 00000000000..93a7da2ee8d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr56933.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void __attribute__((noinline,noclone))
+foo (double *b, double *d, double *f)
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ d[2*i] = 2. * d[2*i];
+ d[2*i+1] = 4. * d[2*i+1];
+ b[i] = d[2*i] - 1.;
+ f[i] = d[2*i+1] + 2.;
+ }
+}
+int main()
+{
+ double b[1024], d[2*1024], f[1024];
+ int i;
+ for (i = 0; i < 2*1024; i++)
+ d[i] = 1.;
+ foo (b, d, f);
+ for (i = 0; i < 1024; i+= 2)
+ {
+ if (d[2*i] != 2.)
+ abort ();
+ if (d[2*i+1] != 4.)
+ abort ();
+ }
+ for (i = 0; i < 1024; i++)
+ {
+ if (b[i] != 1.)
+ abort ();
+ if (f[i] != 6.)
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-39.c b/gcc/testsuite/gcc.dg/vect/slp-39.c
new file mode 100644
index 00000000000..b3c278a5fe3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-39.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+double x[1024], y[1024], z[1024];
+void foo (double w)
+{
+ int i;
+ for (i = 0; i < 1023; i+=2)
+ {
+ z[i] = x[i] + 1;
+ z[i+1] = x[i+1] + w;
+ }
+}
+void bar (double w)
+{
+ int i;
+ for (i = 0; i < 1023; i+=2)
+ {
+ z[i] = x[i] + w;
+ z[i+1] = x[i+1] + 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-123.c b/gcc/testsuite/gcc.dg/vect/vect-123.c
new file mode 100644
index 00000000000..5a2f325090e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-123.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int x[4092];
+int y[1024];
+
+void foo (int s)
+{
+ int i, j;
+ for (i = 0, j = 0; j < 1023; i += s, j++)
+ y[j] += x[i];
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c b/gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c
index 8a02abc0726..540c79b0135 100644
--- a/gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c
+++ b/gcc/testsuite/gcc.target/aarch64/asm-adder-clobber-lr.c
@@ -21,28 +21,3 @@ main (int argc, char** argv)
return 0;
}
-
-extern void abort (void);
-
-int
-adder (int a, int b)
-{
- int result;
- __asm__ ("add %w0,%w1,%w2" : "=r"(result) : "r"(a), "r"(b) : "x30");
- return result;
-}
-
-int
-main (int argc, char** argv)
-{
- int i;
- int total = argc;
- for (i = 0; i < 20; i++)
- total = adder (total, i);
-
- if (total != (190 + argc))
- abort ();
-
- return 0;
-}
-
diff --git a/gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c b/gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c
index f60cfd3ed64..2543d50e78f 100644
--- a/gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c
+++ b/gcc/testsuite/gcc.target/aarch64/asm-adder-no-clobber-lr.c
@@ -21,28 +21,3 @@ main (int argc, char** argv)
return 0;
}
-
-extern void abort (void);
-
-int
-adder (int a, int b)
-{
- int result;
- __asm__ ("add %w0,%w1,%w2" : "=r"(result) : "r"(a), "r"(b) : );
- return result;
-}
-
-int
-main (int argc, char** argv)
-{
- int i;
- int total = argc;
- for (i = 0; i < 20; i++)
- total = adder (total, i);
-
- if (total != (190 + argc))
- abort ();
-
- return 0;
-}
-
diff --git a/gcc/testsuite/gcc.target/aarch64/negs.c b/gcc/testsuite/gcc.target/aarch64/negs.c
new file mode 100644
index 00000000000..1c23041eae7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/negs.c
@@ -0,0 +1,108 @@
+/* { dg-do run } */
+/* { dg-options "-O2 --save-temps" } */
+
+extern void abort (void);
+int z;
+
+int
+negs_si_test1 (int a, int b, int c)
+{
+ int d = -b;
+
+ /* { dg-final { scan-assembler "negs\tw\[0-9\]+, w\[0-9\]+" } } */
+ if (d < 0)
+ return a + c;
+
+ z = d;
+ return b + c + d;
+}
+
+int
+negs_si_test3 (int a, int b, int c)
+{
+ int d = -(b) << 3;
+
+ /* { dg-final { scan-assembler "negs\tw\[0-9\]+, w\[0-9\]+, lsl 3" } } */
+ if (d == 0)
+ return a + c;
+
+ z = d;
+ return b + c + d;
+}
+
+typedef long long s64;
+s64 zz;
+
+s64
+negs_di_test1 (s64 a, s64 b, s64 c)
+{
+ s64 d = -b;
+
+ /* { dg-final { scan-assembler "negs\tx\[0-9\]+, x\[0-9\]+" } } */
+ if (d < 0)
+ return a + c;
+
+ zz = d;
+ return b + c + d;
+}
+
+s64
+negs_di_test3 (s64 a, s64 b, s64 c)
+{
+ s64 d = -(b) << 3;
+
+ /* { dg-final { scan-assembler "negs\tx\[0-9\]+, x\[0-9\]+, lsl 3" } } */
+ if (d == 0)
+ return a + c;
+
+ zz = d;
+ return b + c + d;
+}
+
+int main ()
+{
+ int x;
+ s64 y;
+
+ x = negs_si_test1 (2, 12, 5);
+ if (x != 7)
+ abort ();
+
+ x = negs_si_test1 (1, 2, 32);
+ if (x != 33)
+ abort ();
+
+ x = negs_si_test3 (13, 14, 5);
+ if (x != -93)
+ abort ();
+
+ x = negs_si_test3 (15, 21, 2);
+ if (x != -145)
+ abort ();
+
+ y = negs_di_test1 (0x20202020ll,
+ 0x65161611ll,
+ 0x42434243ll);
+ if (y != 0x62636263ll)
+ abort ();
+
+ y = negs_di_test1 (0x1010101010101ll,
+ 0x123456789abcdll,
+ 0x5555555555555ll);
+ if (y != 0x6565656565656ll)
+ abort ();
+
+ y = negs_di_test3 (0x62523781ll,
+ 0x64234978ll,
+ 0x12345123ll);
+ if (y != 0xfffffffd553d4edbll)
+ abort ();
+
+ y = negs_di_test3 (0x763526268ll,
+ 0x101010101ll,
+ 0x222222222ll);
+ if (y != 0xfffffffb1b1b1b1bll)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c
index ae109591744..e44ca6d4cd8 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-1.c
@@ -13,18 +13,3 @@
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-no-clobber-lr.c"
-
-/* omit-frame-pointer is FALSE.
- omit-leaf-frame-pointer is FALSE.
- LR is not being clobbered in the leaf.
-
- With no frame pointer omissions, we expect a frame record
- for main and the leaf. */
-
-/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c
index 71bc58da84f..40e483526b3 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-2.c
@@ -13,18 +13,3 @@
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fomit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-no-clobber-lr.c"
-
-/* omit-frame-pointer is TRUE.
- omit-leaf-frame-pointer is false, but irrelevant due to omit-frame-pointer.
- LR is not being clobbered in the leaf.
-
- Since we asked to have no frame pointers anywhere, we expect no frame
- record in main or the leaf. */
-
-/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c
index de1b32c18c3..98cb2e0b62b 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-3.c
@@ -13,18 +13,3 @@
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-no-clobber-lr.c"
-
-/* omit-frame-pointer is TRUE.
- omit-leaf-frame-pointer is true, but irrelevant due to omit-frame-pointer.
- LR is not being clobbered in the leaf.
-
- Since we asked to have no frame pointers anywhere, we expect no frame
- record in main or the leaf. */
-
-/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c
index d339263c4c3..4143a7a9cc2 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-4.c
@@ -14,19 +14,3 @@
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 1 } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-no-clobber-lr.c"
-
-/* omit-frame-pointer is FALSE.
- omit-leaf-frame-pointer is TRUE.
- LR is not being clobbered in the leaf.
-
- Unless we are removing all frame records, it's OK to remove the frame
- record for a leaf where LR is not clobbered. Therefore, we expect a
- frame record only in main. */
-
-/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 1 } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c
index 4be297a5e4a..c22bdc304a4 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-5.c
@@ -13,18 +13,3 @@
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-clobber-lr.c"
-
-/* omit-frame-pointer is FALSE.
- omit-leaf-frame-pointer is FALSE.
- LR is being clobbered in the leaf.
-
- With no frame pointer omissions, we expect a frame record for main
- and the leaf. */
-
-/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c
index bf53962608a..e08ee43e5ec 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-6.c
@@ -13,18 +13,3 @@
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fomit-frame-pointer -mno-omit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-clobber-lr.c"
-
-/* omit-frame-pointer is TRUE.
- omit-leaf-frame-pointer is false, but irrelevant due to omit-frame-pointer.
- LR is being clobbered in the leaf.
-
- Since we asked to have no frame pointers anywhere, we expect no frame
- record in main or the leaf. */
-
-/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c
index 9e88ae3bd6a..e8f7cabe77f 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-7.c
@@ -13,18 +13,3 @@
/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-clobber-lr.c"
-
-/* omit-frame-pointer is TRUE.
- omit-leaf-frame-pointer is true, but irrelevant due to omit-frame-pointer.
- LR is being clobbered in the leaf.
-
- Since we asked to have no frame pointers anywhere, we expect no frame
- record in main or the leaf. */
-
-/* { dg-final { scan-assembler-not "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c b/gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c
index 08d7667ea77..c09b687597b 100644
--- a/gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c
+++ b/gcc/testsuite/gcc.target/aarch64/test-framepointer-8.c
@@ -14,19 +14,3 @@
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
/* { dg-final { cleanup-saved-temps } } */
-/* { dg-do run } */
-/* { dg-options "-O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-inline --save-temps" } */
-
-#include "asm-adder-clobber-lr.c"
-
-/* omit-frame-pointer is FALSE.
- omit-leaf-frame-pointer is TRUE.
- LR is being clobbered in the leaf.
-
- Unless we are removing all frame records (which we aren't), it's
- not OK to remove the frame record for a leaf where LR is clobbered.
- Therefore, we expect a frame record in main and leaf. */
-
-/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
-
-/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-d.c b/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-d.c
index b6fb5ae8798..19ecd63b1d1 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-d.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-d.c
@@ -7,7 +7,7 @@
#include "vect-fcm.x"
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
/* { dg-final { scan-assembler "fcmeq\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, v\[0-9\]+\.2d" } } */
/* { dg-final { scan-assembler "fcmeq\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-f.c b/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-f.c
index 283d34fb80a..30be5adf529 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-f.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-f.c
@@ -7,7 +7,7 @@
#include "vect-fcm.x"
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
/* { dg-final { scan-assembler "fcmeq\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s" } } */
/* { dg-final { scan-assembler "fcmeq\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-d.c b/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-d.c
index 868e1f8e60d..b922833be8c 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-d.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-d.c
@@ -7,8 +7,9 @@
#include "vect-fcm.x"
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
/* { dg-final { scan-assembler "fcmge\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, v\[0-9\]+\.2d" } } */
/* { dg-final { scan-assembler "fcmge\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, 0" } } */
+/* { dg-final { scan-assembler "fcmlt\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-f.c b/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-f.c
index e3258f3641e..04d3533ffe3 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-f.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm-ge-f.c
@@ -7,8 +7,9 @@
#include "vect-fcm.x"
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
/* { dg-final { scan-assembler "fcmge\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s" } } */
/* { dg-final { scan-assembler "fcmge\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, 0" } } */
+/* { dg-final { scan-assembler "fcmlt\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-d.c b/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-d.c
index ed8b4521591..421a04acfb4 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-d.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-d.c
@@ -7,8 +7,9 @@
#include "vect-fcm.x"
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
/* { dg-final { scan-assembler "fcmgt\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, v\[0-9\]+\.2d" } } */
/* { dg-final { scan-assembler "fcmgt\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, 0" } } */
+/* { dg-final { scan-assembler "fcmle\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-f.c b/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-f.c
index e90a87581d3..cdeab14e0ed 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-f.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm-gt-f.c
@@ -7,8 +7,9 @@
#include "vect-fcm.x"
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
/* { dg-final { scan-assembler "fcmgt\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s" } } */
/* { dg-final { scan-assembler "fcmgt\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, 0" } } */
+/* { dg-final { scan-assembler "fcmle\\tv\[0-9\]+\.\[24\]s, v\[0-9\]+\.\[24\]s, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/vect-fcm.x b/gcc/testsuite/gcc.target/aarch64/vect-fcm.x
index 7e51bef0ce2..803861b0293 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect-fcm.x
+++ b/gcc/testsuite/gcc.target/aarch64/vect-fcm.x
@@ -40,6 +40,15 @@ foobar (FTYPE *in1, FTYPE *in2, FTYPE *output)
output[i] = (in1[i] OP 0.0) ? 4.0 : 2.0;
}
+void
+foobarbar (FTYPE *in1, FTYPE *in2, FTYPE *output)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = (in1[i] INV_OP 0.0) ? 4.0 : 2.0;
+}
+
int
main (int argc, char **argv)
{
@@ -51,6 +60,11 @@ main (int argc, char **argv)
for (i = 0; i < N; i++)
if (out1[i] != out2[i])
abort ();
+ foobar (input1, input2, out1);
+ foobarbar (input1, input2, out2);
+ for (i = 0; i < N; i++)
+ if (out1[i] == out2[i])
+ abort ();
return 0;
}
diff --git a/gcc/testsuite/gcc.target/arm/anddi3-opt.c b/gcc/testsuite/gcc.target/arm/anddi3-opt.c
new file mode 100644
index 00000000000..cd0d0838632
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/anddi3-opt.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+unsigned long long
+muld (unsigned long long X, unsigned long long Y)
+{
+ unsigned long long mask = 0xffffffffull;
+ return (X & mask) * (Y & mask);
+}
+
+/* { dg-final { scan-assembler-not "and\[\\t \]+.+,\[\\t \]*.+,\[\\t \]*.+" } } */
diff --git a/gcc/testsuite/gcc.target/arm/anddi3-opt2.c b/gcc/testsuite/gcc.target/arm/anddi3-opt2.c
new file mode 100644
index 00000000000..efe71f42ed5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/anddi3-opt2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+long long muld(long long X, long long Y)
+{
+ return X & ~1;
+}
+
+/* { dg-final { scan-assembler-not "and\[\\t \]+.+,\[\\t \]*.+,\[\\t \]*.+" } } */
diff --git a/gcc/testsuite/gcc.target/arm/minmax_minus.c b/gcc/testsuite/gcc.target/arm/minmax_minus.c
new file mode 100644
index 00000000000..050c8475d6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/minmax_minus.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define MAX(a, b) (a > b ? a : b)
+int
+foo (int a, int b, int c)
+{
+ return c - MAX (a, b);
+}
+
+/* { dg-final { scan-assembler "rsbge" } } */
+/* { dg-final { scan-assembler "rsblt" } } */
diff --git a/gcc/testsuite/gcc.target/arm/negdi-1.c b/gcc/testsuite/gcc.target/arm/negdi-1.c
new file mode 100644
index 00000000000..c9bef049c4a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/negdi-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm32 } */
+/* { dg-options "-O2" } */
+
+signed long long extendsidi_negsi (signed int x)
+{
+ return -x;
+}
+
+/*
+Expected output:
+ rsb r0, r0, #0
+ mov r1, r0, asr #31
+*/
+/* { dg-final { scan-assembler-times "rsb" 1 { target { arm_nothumb } } } } */
+/* { dg-final { scan-assembler-times "negs\\t" 1 { target { ! { arm_nothumb } } } } } */
+/* { dg-final { scan-assembler-times "asr" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/negdi-2.c b/gcc/testsuite/gcc.target/arm/negdi-2.c
new file mode 100644
index 00000000000..96bbcab337e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/negdi-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm32 } */
+/* { dg-options "-O2" } */
+
+signed long long zero_extendsidi_negsi (unsigned int x)
+{
+ return -x;
+}
+/*
+Expected output:
+ rsb r0, r0, #0
+ mov r1, #0
+*/
+/* { dg-final { scan-assembler-times "rsb\\tr0, r0, #0" 1 { target { arm_nothumb } } } } */
+/* { dg-final { scan-assembler-times "negs\\tr0, r0" 1 { target { ! arm_nothumb } } } } */
+/* { dg-final { scan-assembler-times "mov" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/negdi-3.c b/gcc/testsuite/gcc.target/arm/negdi-3.c
new file mode 100644
index 00000000000..76ddf49fc0d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/negdi-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm32 } */
+/* { dg-options "-O2" } */
+
+signed long long negdi_zero_extendsidi (unsigned int x)
+{
+ return -((signed long long) x);
+}
+/*
+Expected output:
+ rsbs r0, r0, #0
+ sbc r1, r1, r1
+*/
+/* { dg-final { scan-assembler-times "rsb" 1 } } */
+/* { dg-final { scan-assembler-times "sbc" 1 } } */
+/* { dg-final { scan-assembler-times "mov" 0 } } */
+/* { dg-final { scan-assembler-times "rsc" 0 } } */
diff --git a/gcc/testsuite/gcc.target/arm/negdi-4.c b/gcc/testsuite/gcc.target/arm/negdi-4.c
new file mode 100644
index 00000000000..dc3deaad5ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/negdi-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm32 } */
+/* { dg-options "-O2" } */
+
+signed long long negdi_extendsidi (signed int x)
+{
+ return -((signed long long) x);
+}
+/*
+Expected output:
+ rsbs r0, r0, #0
+ mov r1, r0, asr #31
+*/
+/* { dg-final { scan-assembler-times "rsb" 1 } } */
+/* { dg-final { scan-assembler-times "asr" 1 } } */
+/* { dg-final { scan-assembler-times "rsc" 0 } } */
diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
new file mode 100644
index 00000000000..eb2b86ee7b6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_prefer_ldrd_strd } */
+/* { dg-options "-O2" } */
+int foo(int a, int b, int* p, int *q)
+{
+ a = p[2] + p[3];
+ *q = a;
+ *p = a;
+ return a;
+}
+/* { dg-final { scan-assembler "ldrd" } } */
diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-1.c
new file mode 100644
index 00000000000..bd330769599
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/peep-strd-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_prefer_ldrd_strd } */
+/* { dg-options "-O2" } */
+void foo(int a, int b, int* p)
+{
+ p[2] = a;
+ p[3] = b;
+}
+/* { dg-final { scan-assembler "strd" } } */
diff --git a/gcc/testsuite/gcc.target/arm/thumb1-far-jump-1.c b/gcc/testsuite/gcc.target/arm/thumb1-far-jump-1.c
new file mode 100644
index 00000000000..eb16d2fc99e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb1-far-jump-1.c
@@ -0,0 +1,34 @@
+/* Check for thumb1 far jump. Shouldn't save lr for small leaf functions
+ * even with a branch in it. */
+/* { dg-options "-Os" } */
+/* { dg-skip-if "" { ! { arm_thumb1 } } } */
+
+void f()
+{
+ for (;;);
+}
+
+volatile int g;
+void f2(int i)
+{
+ if (i) g=0;
+}
+
+void f3(int i)
+{
+ if (i) {
+ g=0;
+ g=1;
+ g=2;
+ g=3;
+ g=4;
+ g=5;
+ g=6;
+ g=7;
+ g=8;
+ g=9;
+ }
+}
+
+/* { dg-final { scan-assembler-not "push.*lr" } } */
+
diff --git a/gcc/testsuite/gcc.target/arm/thumb1-far-jump-2.c b/gcc/testsuite/gcc.target/arm/thumb1-far-jump-2.c
new file mode 100644
index 00000000000..c6878f8ef8b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb1-far-jump-2.c
@@ -0,0 +1,57 @@
+/* Check for thumb1 far jump. This is the extreme case that far jump
+ * will be used with minimum number of instructions. By passing this case
+ * it means the heuristic of saving lr for far jump meets the most extreme
+ * requirement. */
+/* { dg-options "-Os" } */
+/* { dg-skip-if "" { ! { arm_thumb1 } } } */
+
+volatile register r4 asm("r4");
+void f3(int i)
+{
+#define GO(n) \
+ extern volatile int g_##n; \
+ r4=(int)&g_##n;
+
+#define GO8(n) \
+ GO(n##_0) \
+ GO(n##_1) \
+ GO(n##_2) \
+ GO(n##_3) \
+ GO(n##_4) \
+ GO(n##_5) \
+ GO(n##_6) \
+ GO(n##_7)
+
+#define GO64(n) \
+ GO8(n##_0) \
+ GO8(n##_1) \
+ GO8(n##_2) \
+ GO8(n##_3) \
+ GO8(n##_4) \
+ GO8(n##_5) \
+ GO8(n##_6) \
+ GO8(n##_7) \
+
+#define GO498(n) \
+ GO64(n##_0) \
+ GO64(n##_1) \
+ GO64(n##_2) \
+ GO64(n##_3) \
+ GO64(n##_4) \
+ GO64(n##_5) \
+ GO64(n##_6) \
+ GO8(n##_0) \
+ GO8(n##_1) \
+ GO8(n##_2) \
+ GO8(n##_3) \
+ GO8(n##_4) \
+ GO8(n##_5) \
+ GO(n##_0) \
+ GO(n##_1) \
+
+ if (i) {
+ GO498(0);
+ }
+}
+
+/* { dg-final { scan-assembler "push.*lr" } } */
diff --git a/gcc/testsuite/gcc.target/arm/vect-rounding-btruncf.c b/gcc/testsuite/gcc.target/arm/vect-rounding-btruncf.c
new file mode 100644
index 00000000000..ff033d437e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vect-rounding-btruncf.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_neon_ok } */
+/* { dg-options "-O2 -ffast-math -ftree-vectorize" } */
+/* { dg-add-options arm_v8_neon } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_truncf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_btruncf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/arm/vect-rounding-ceilf.c b/gcc/testsuite/gcc.target/arm/vect-rounding-ceilf.c
new file mode 100644
index 00000000000..b54f358f71b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vect-rounding-ceilf.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_neon_ok } */
+/* { dg-options "-O2 -ffast-math -ftree-vectorize" } */
+/* { dg-add-options arm_v8_neon } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_ceilf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_ceilf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/arm/vect-rounding-floorf.c b/gcc/testsuite/gcc.target/arm/vect-rounding-floorf.c
new file mode 100644
index 00000000000..02e188d9654
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vect-rounding-floorf.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_neon_ok } */
+/* { dg-options "-O2 -ffast-math -ftree-vectorize" } */
+/* { dg-add-options arm_v8_neon } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_floorf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_floorf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/arm/vect-rounding-roundf.c b/gcc/testsuite/gcc.target/arm/vect-rounding-roundf.c
new file mode 100644
index 00000000000..85e205806a4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vect-rounding-roundf.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_neon_ok } */
+/* { dg-options "-O2 -ffast-math -ftree-vectorize" } */
+/* { dg-add-options arm_v8_neon } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_roundf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_roundf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/epiphany/fnma-1.c b/gcc/testsuite/gcc.target/epiphany/fnma-1.c
new file mode 100644
index 00000000000..3155079f4a1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/epiphany/fnma-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 1 } } */
+
+float
+f (float ar, float ai, float br, float bi)
+{
+ return ar * br - ai * bi;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpblendd128-1.c b/gcc/testsuite/gcc.target/i386/avx2-vpblendd128-1.c
index 92f7e1b8e23..a3fea9554e1 100644
--- a/gcc/testsuite/gcc.target/i386/avx2-vpblendd128-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx2-vpblendd128-1.c
@@ -5,9 +5,10 @@
#include <immintrin.h>
__m128i x;
+__m128i y;
void extern
avx2_test (void)
{
- x = _mm_blend_epi32 (x, x, 13);
+ x = _mm_blend_epi32 (x, y, 13);
}
diff --git a/gcc/testsuite/gcc.target/i386/merge-1.c b/gcc/testsuite/gcc.target/i386/merge-1.c
new file mode 100644
index 00000000000..d5256851096
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/merge-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -msse2" } */
+
+#include <x86intrin.h>
+
+void
+f (double *r, __m128d x, __m128d y, __m128d z)
+{
+ __m128d t=_mm_move_sd(x,y);
+ __m128d u=_mm_move_sd(t,z);
+ *r = u[0];
+}
+
+__m128d
+g(__m128d x, __m128d y, __m128d z)
+{
+ __m128d t=_mm_move_sd(x,y);
+ __m128d u=_mm_move_sd(t,z);
+ return u;
+}
+
+/* { dg-final { scan-assembler-times "movsd" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr56903.c b/gcc/testsuite/gcc.target/i386/pr56903.c
new file mode 100644
index 00000000000..9e6a1c3916d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr56903.c
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/56903 */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+/* { dg-additional-options "-march=pentium3" { target ia32 } } */
+
+int a, *b, c;
+struct S { int s : 1; } *fn1 (void);
+extern int fn3 (void), fn4 (int *);
+
+void
+fn2 (void)
+{
+ int e = fn3 ();
+ char f = c + fn1 ()->s * 4;
+ if (*b && f == e)
+ a = *b;
+ fn4 (b);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-1.c b/gcc/testsuite/gcc.target/powerpc/recip-1.c
index 4ae0c4f119f..59660e35bd5 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-1.c
@@ -3,8 +3,8 @@
/* { dg-options "-O2 -mrecip -ffast-math -mcpu=power6" } */
/* { dg-final { scan-assembler-times "frsqrte" 2 } } */
/* { dg-final { scan-assembler-times "fmsub" 2 } } */
-/* { dg-final { scan-assembler-times "fmul" 8 } } */
-/* { dg-final { scan-assembler-times "fnmsub" 4 } } */
+/* { dg-final { scan-assembler-times "fmul" 6 } } */
+/* { dg-final { scan-assembler-times "fnmsub" 3 } } */
double
rsqrt_d (double a)
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-3.c b/gcc/testsuite/gcc.target/powerpc/recip-3.c
index 905e793952e..56ab371985b 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-3.c
@@ -7,8 +7,8 @@
/* { dg-final { scan-assembler-times "xsnmsub.dp\|fnmsub\ " 2 } } */
/* { dg-final { scan-assembler-times "frsqrtes" 1 } } */
/* { dg-final { scan-assembler-times "fmsubs" 1 } } */
-/* { dg-final { scan-assembler-times "fmuls" 4 } } */
-/* { dg-final { scan-assembler-times "fnmsubs" 2 } } */
+/* { dg-final { scan-assembler-times "fmuls" 2 } } */
+/* { dg-final { scan-assembler-times "fnmsubs" 1 } } */
double
rsqrt_d (double a)
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-4.c b/gcc/testsuite/gcc.target/powerpc/recip-4.c
index 35eef6f0f0f..a62b60db201 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-4.c
@@ -7,8 +7,8 @@
/* { dg-final { scan-assembler-times "xvnmsub.dp" 2 } } */
/* { dg-final { scan-assembler-times "xvrsqrtesp" 1 } } */
/* { dg-final { scan-assembler-times "xvmsub.sp" 1 } } */
-/* { dg-final { scan-assembler-times "xvmulsp" 4 } } */
-/* { dg-final { scan-assembler-times "xvnmsub.sp" 2 } } */
+/* { dg-final { scan-assembler-times "xvmulsp" 2 } } */
+/* { dg-final { scan-assembler-times "xvnmsub.sp" 1 } } */
#define SIZE 1024
diff --git a/gcc/testsuite/gcc.target/powerpc/recip-5.c b/gcc/testsuite/gcc.target/powerpc/recip-5.c
index 3d7d691d5ac..0e89075bbe9 100644
--- a/gcc/testsuite/gcc.target/powerpc/recip-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/recip-5.c
@@ -6,6 +6,14 @@
/* { dg-final { scan-assembler-times "xvresp" 5 } } */
/* { dg-final { scan-assembler-times "xsredp" 2 } } */
/* { dg-final { scan-assembler-times "fres" 2 } } */
+/* { dg-final { scan-assembler-times "fmuls" 2 } } */
+/* { dg-final { scan-assembler-times "fnmsubs" 2 } } */
+/* { dg-final { scan-assembler-times "xsmuldp" 2 } } */
+/* { dg-final { scan-assembler-times "xsnmsub.dp" 4 } } */
+/* { dg-final { scan-assembler-times "xvmulsp" 7 } } */
+/* { dg-final { scan-assembler-times "xvnmsub.sp" 5 } } */
+/* { dg-final { scan-assembler-times "xvmuldp" 6 } } */
+/* { dg-final { scan-assembler-times "xvnmsub.dp" 8 } } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/sd-pwr6.c b/gcc/testsuite/gcc.target/powerpc/sd-pwr6.c
index 947382b7f7b..98f7615daef 100644
--- a/gcc/testsuite/gcc.target/powerpc/sd-pwr6.c
+++ b/gcc/testsuite/gcc.target/powerpc/sd-pwr6.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* powerpc-ibm-aix* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -mcpu=power6 -mhard-dfp" } */
/* { dg-final { scan-assembler-not "lfiwzx" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/sd-vsx.c b/gcc/testsuite/gcc.target/powerpc/sd-vsx.c
index 7e41e1e84cc..7a3c6d8777d 100644
--- a/gcc/testsuite/gcc.target/powerpc/sd-vsx.c
+++ b/gcc/testsuite/gcc.target/powerpc/sd-vsx.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* powerpc-ibm-aix* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -mcpu=power7 -mhard-dfp" } */
/* { dg-final { scan-assembler-times "lfiwzx" 2 } } */
diff --git a/gcc/testsuite/gcc.target/sparc/setcc-4.c b/gcc/testsuite/gcc.target/sparc/setcc-4.c
new file mode 100644
index 00000000000..ffa4ee046c8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/setcc-4.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O1 -mno-vis3" } */
+
+long neq (long a, long b)
+{
+ return a != b;
+}
+
+long eq (long a, long b)
+{
+ return a == b;
+}
+
+long lt (unsigned long a, unsigned long b)
+{
+ return a < b;
+}
+
+long leq (unsigned long a, unsigned long b)
+{
+ return a <= b;
+}
+
+long geq (unsigned long a, unsigned long b)
+{
+ return a >= b;
+}
+
+long gt (unsigned long a, unsigned long b)
+{
+ return a > b;
+}
+
+/* { dg-final { scan-assembler-times "xor\t%" 2 } } */
+/* { dg-final { scan-assembler-times "cmp\t%" 4 } } */
+/* { dg-final { scan-assembler-times "movrne\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movre\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movlu\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movleu\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movgeu\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movgu\t%" 1 } } */
+/* { dg-final { scan-assembler-not "sra\t%" } } */
+/* { dg-final { scan-assembler-not "and\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/setcc-5.c b/gcc/testsuite/gcc.target/sparc/setcc-5.c
new file mode 100644
index 00000000000..58f1ee39f74
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/setcc-5.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O1 -mvis3" } */
+
+long neq (long a, long b)
+{
+ return a != b;
+}
+
+long eq (long a, long b)
+{
+ return a == b;
+}
+
+long lt (unsigned long a, unsigned long b)
+{
+ return a < b;
+}
+
+long leq (unsigned long a, unsigned long b)
+{
+ return a <= b;
+}
+
+long geq (unsigned long a, unsigned long b)
+{
+ return a >= b;
+}
+
+long gt (unsigned long a, unsigned long b)
+{
+ return a > b;
+}
+
+/* { dg-final { scan-assembler-times "xor\t%" 2 } } */
+/* { dg-final { scan-assembler-times "cmp\t%" 4 } } */
+/* { dg-final { scan-assembler-times "addxc\t%" 3 } } */
+/* { dg-final { scan-assembler-times "movre\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movleu\t%" 1 } } */
+/* { dg-final { scan-assembler-times "movgeu\t%" 1 } } */
+/* { dg-final { scan-assembler-not "sra\t%" } } */
+/* { dg-final { scan-assembler-not "and\t%" } } */
diff --git a/gcc/testsuite/gfortran.dg/altreturn_1.f90 b/gcc/testsuite/gfortran.dg/altreturn_1.f90
index c0ae15f9a6b..7ec77c178f5 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_1.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_1.f90
@@ -1,4 +1,6 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
+
subroutine foo (a)
real t, a, baz
call bar (*10)
diff --git a/gcc/testsuite/gfortran.dg/altreturn_2.f90 b/gcc/testsuite/gfortran.dg/altreturn_2.f90
index d0556d0370d..9abf3501fb1 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_2.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_2.f90
@@ -1,4 +1,6 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
+
program altreturn_2
call foo() ! { dg-error "Missing alternate return" }
contains
diff --git a/gcc/testsuite/gfortran.dg/altreturn_3.f90 b/gcc/testsuite/gfortran.dg/altreturn_3.f90
index 28fc6a8aa8a..c445159872f 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_3.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_3.f90
@@ -1,5 +1,5 @@
! { dg-do run }
-! { dg-options "-std=legacy" }
+! { dg-options "-std=gnu" }
!
! Tests the fix for PR30236, which was due to alternate returns
! in generic interfaces causing a segfault. They now work
diff --git a/gcc/testsuite/gfortran.dg/altreturn_4.f90 b/gcc/testsuite/gfortran.dg/altreturn_4.f90
index 409ea51be7e..7375544d203 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_4.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_4.f90
@@ -1,4 +1,6 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
! Tests the fix for PR28172, in which an ICE would result from
! the contained call with an alternate retrun.
diff --git a/gcc/testsuite/gfortran.dg/altreturn_5.f90 b/gcc/testsuite/gfortran.dg/altreturn_5.f90
index a8b6ff83cd1..a552d3904ac 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_5.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_5.f90
@@ -1,33 +1,32 @@
-! { dg-do run }
-! { dg-options "-std=legacy" }
-!
-! Tests the fix for PR31483, in which dummy argument procedures
-! produced an ICE if they had an alternate return.
-!
-! Contributed by Mathias Fröhlich <M.Froehlich@science-computing.de>
-
- SUBROUTINE R (i, *, *)
- INTEGER i
- RETURN i
- END
-
+! { dg-do run }
+! { dg-options "-std=gnu" }
+!
+! Tests the fix for PR31483, in which dummy argument procedures
+! produced an ICE if they had an alternate return.
+!
+! Contributed by Mathias Fröhlich <M.Froehlich@science-computing.de>
+
+ SUBROUTINE R (i, *, *)
+ INTEGER i
+ RETURN i
+ END
+
SUBROUTINE PHLOAD (READER, i, res)
IMPLICIT NONE
- EXTERNAL READER
- integer i
+ EXTERNAL READER
+ integer i
character(3) res
CALL READER (i, *1, *2)
- 1 res = "one"
+ 1 res = "one"
return
- 2 res = "two"
+ 2 res = "two"
return
- END
-
- EXTERNAL R
- character(3) res
- call PHLOAD (R, 1, res)
- if (res .ne. "one") call abort ()
- CALL PHLOAD (R, 2, res)
- if (res .ne. "two") call abort ()
END
+ EXTERNAL R
+ character(3) res
+ call PHLOAD (R, 1, res)
+ if (res .ne. "one") call abort ()
+ CALL PHLOAD (R, 2, res)
+ if (res .ne. "two") call abort ()
+ END
diff --git a/gcc/testsuite/gfortran.dg/altreturn_6.f90 b/gcc/testsuite/gfortran.dg/altreturn_6.f90
index 19c851e5092..82bb46df12c 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_6.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_6.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-std=legacy" }
+! { dg-options "-std=gnu" }
!
! PR 32938
subroutine r (*)
diff --git a/gcc/testsuite/gfortran.dg/altreturn_7.f90 b/gcc/testsuite/gfortran.dg/altreturn_7.f90
index e667ff436c3..522d7677943 100644
--- a/gcc/testsuite/gfortran.dg/altreturn_7.f90
+++ b/gcc/testsuite/gfortran.dg/altreturn_7.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-std=legacy" }
+! { dg-options "-std=gnu" }
!
! PR 40848: [4.5 Regression] ICE with alternate returns
!
diff --git a/gcc/testsuite/gfortran.dg/altreturn_8.f90 b/gcc/testsuite/gfortran.dg/altreturn_8.f90
new file mode 100644
index 00000000000..ccd58a2b083
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/altreturn_8.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
+! PR 56284: [OOP] ICE with alternate return in type-bound procedure
+!
+! Contributed by Arjen Markus <arjen.markus@deltares.nl>
+
+module try_this
+ implicit none
+
+ type :: table_t
+ contains
+ procedure, nopass :: getRecord
+ end type
+
+contains
+
+ subroutine getRecord ( * )
+ end subroutine
+
+end module
+
+! { dg-final { cleanup-modules "try_this" } }
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_44.f90 b/gcc/testsuite/gfortran.dg/array_constructor_44.f90
new file mode 100644
index 00000000000..e0cffd168be
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_44.f90
@@ -0,0 +1,12 @@
+! { dg-do run }
+! { dg-options "-ffrontend-optimize" }
+! PR 56872 - wrong front-end optimization with a single constructor.
+! Original bug report by Rich Townsend.
+ integer :: k
+ real :: s
+ integer :: m
+ s = 2.0
+ m = 4
+ res = SUM([(s**(REAL(k-1)/REAL(m-1)),k=1,m)])
+ if (abs(res - 5.84732246) > 1e-6) call abort
+ end
diff --git a/gcc/testsuite/gfortran.dg/assumed_rank_4.f90 b/gcc/testsuite/gfortran.dg/assumed_rank_4.f90
index 3391fba882f..756ab2245c5 100644
--- a/gcc/testsuite/gfortran.dg/assumed_rank_4.f90
+++ b/gcc/testsuite/gfortran.dg/assumed_rank_4.f90
@@ -20,8 +20,8 @@ end subroutine valid2
subroutine foo99(x)
integer x(99)
- call valid1(x) ! { dg-error "Procedure 'valid1' at .1. with assumed-rank dummy argument 'x' must have an explicit interface" }
- call valid2(x(1)) ! { dg-error "Procedure 'valid2' at .1. with assumed-type dummy argument 'x' must have an explicit interface" }
+ call valid1(x) ! { dg-error "Explicit interface required" }
+ call valid2(x(1)) ! { dg-error "Explicit interface required" }
end subroutine foo99
subroutine foo(x)
diff --git a/gcc/testsuite/gfortran.dg/auto_char_len_4.f90 b/gcc/testsuite/gfortran.dg/auto_char_len_4.f90
index 6b4e26e6b45..72ee8450dc7 100644
--- a/gcc/testsuite/gfortran.dg/auto_char_len_4.f90
+++ b/gcc/testsuite/gfortran.dg/auto_char_len_4.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-fwhole-file" }
+! { dg-options "-pedantic -fwhole-file" }
!
! Tests the fix for PR25087, in which the following invalid code
! was not detected.
@@ -14,8 +14,8 @@ FUNCTION a()
END FUNCTION a
SUBROUTINE s(n)
- CHARACTER(LEN=n), EXTERNAL :: a ! { dg-error "must have an explicit interface" }
- CHARACTER(LEN=n), EXTERNAL :: d ! { dg-error "must have an explicit interface" }
+ CHARACTER(LEN=n), EXTERNAL :: a ! { dg-error "Character length mismatch" }
+ CHARACTER(LEN=n), EXTERNAL :: d ! { dg-error "Character length mismatch" }
interface
function b (m) ! This is OK
CHARACTER(LEN=m) :: b
diff --git a/gcc/testsuite/gfortran.dg/block_11.f90 b/gcc/testsuite/gfortran.dg/block_11.f90
index 2c2ce9083f6..6fe244d91e8 100644
--- a/gcc/testsuite/gfortran.dg/block_11.f90
+++ b/gcc/testsuite/gfortran.dg/block_11.f90
@@ -50,7 +50,7 @@ module m3
implicit none
contains
subroutine my_test()
- procedure(), pointer :: ptr
+ procedure(sub), pointer :: ptr
! Before the fix, one had the link error
! "undefined reference to `sub.1909'"
block
diff --git a/gcc/testsuite/gfortran.dg/c_loc_test_19.f90 b/gcc/testsuite/gfortran.dg/c_loc_test_19.f90
index a667eaf52de..ea62715f33f 100644
--- a/gcc/testsuite/gfortran.dg/c_loc_test_19.f90
+++ b/gcc/testsuite/gfortran.dg/c_loc_test_19.f90
@@ -12,6 +12,6 @@ Contains
Real( c_double ), Dimension( : ), Target :: aa
Type( c_ptr ), Pointer :: b
b = c_loc( aa( 1 ) ) ! was rejected before.
- b = c_loc( aa ) ! { dg-error "TS 29113: Noninteroperable array at .1. as argument to C_LOC: Only explicit-size and assumed-size arrays are interoperable" }
+ b = c_loc( aa ) ! { dg-error "Fortran 2008: Array of interoperable type at .1. to C_LOC which is nonallocatable and neither assumed size nor explicit size" }
End Subroutine test
End Program gf
diff --git a/gcc/testsuite/gfortran.dg/c_loc_test_21.f90 b/gcc/testsuite/gfortran.dg/c_loc_test_21.f90
new file mode 100644
index 00000000000..a31ca034fbb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/c_loc_test_21.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+
+subroutine foo(a,b,c,d)
+ use iso_c_binding, only: c_loc, c_ptr
+ implicit none
+ real, intent(in), target :: a(:)
+ real, intent(in), target :: b(5)
+ real, intent(in), target :: c(*)
+ real, intent(in), target, allocatable :: d(:)
+ type(c_ptr) :: ptr
+ ptr = C_LOC(b)
+ ptr = C_LOC(c)
+ ptr = C_LOC(d)
+ ptr = C_LOC(a) ! { dg-error "Fortran 2008: Array of interoperable type at .1. to C_LOC which is nonallocatable and neither assumed size nor explicit size" }
+end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_10.f03 b/gcc/testsuite/gfortran.dg/c_loc_tests_10.f03
index 21cbe0be7ec..21b8526c2ab 100644
--- a/gcc/testsuite/gfortran.dg/c_loc_tests_10.f03
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_10.f03
@@ -1,9 +1,9 @@
! { dg-do compile }
-! { dg-options "-std=f2008" }
+! { dg-options "-std=f2003" }
subroutine aaa(in)
use iso_c_binding
implicit none
integer(KIND=C_int), DIMENSION(:), TARGET :: in
type(c_ptr) :: cptr
- cptr = c_loc(in) ! { dg-error "TS 29113: Noninteroperable array at .1. as argument to C_LOC" }
+ cptr = c_loc(in) ! { dg-error "Fortran 2008: Array of interoperable type at .1. to C_LOC which is nonallocatable and neither assumed size nor explicit size" }
end subroutine aaa
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_11.f03 b/gcc/testsuite/gfortran.dg/c_loc_tests_11.f03
index b8e6d849e67..c00e5ed1640 100644
--- a/gcc/testsuite/gfortran.dg/c_loc_tests_11.f03
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_11.f03
@@ -31,9 +31,9 @@ contains
integer(c_int), intent(in) :: handle
if (.true.) then ! The ultimate component is an allocatable target
- get_double_vector_address = c_loc(dbv_pool(handle)%v) ! { dg-error "TS 29113: Noninteroperable array at .1. as argument to C_LOC: Only explicit-size and assumed-size arrays are interoperable" }
+ get_double_vector_address = c_loc(dbv_pool(handle)%v) ! OK: Interop type and allocatable
else
- get_double_vector_address = c_loc(vv) ! { dg-error "TS 29113: Noninteroperable array at .1. as argument to C_LOC: Only explicit-size and assumed-size arrays are interoperable" }
+ get_double_vector_address = c_loc(vv) ! OK: Interop type and allocatable
endif
end function get_double_vector_address
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90 b/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90
index 2c074e874f0..55e8d00fa9c 100644
--- a/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90
@@ -19,7 +19,7 @@
type(C_PTR) :: p
p = c_loc(tt%t%i(1))
- p = c_loc(n(1:2)) ! { dg-error "TS 29113: Noninteroperable array at .1. as argument to C_LOC: Only whole-arrays are interoperable" }
- p = c_loc(ttt%t(5,1:2)%i(1)) ! { dg-error "TS 29113: Noninteroperable array at .1. as argument to C_LOC: Only whole-arrays are interoperable" }
+ p = c_loc(n(1:2)) ! OK: interop type + contiguous
+ p = c_loc(ttt%t(5,1:2)%i(1)) ! FIXME: Noncontiguous (invalid) - compile-time testable
p = c_loc(x[1]) ! { dg-error "shall not be coindexed" }
end
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_4.f03 b/gcc/testsuite/gfortran.dg/c_loc_tests_4.f03
index 1f28d3e0c0e..d45a89156fc 100644
--- a/gcc/testsuite/gfortran.dg/c_loc_tests_4.f03
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_4.f03
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-std=f2008" }
+! { dg-options "-std=f2003" }
!
module c_loc_tests_4
use, intrinsic :: iso_c_binding
@@ -12,6 +12,6 @@ contains
type(c_ptr) :: my_c_ptr
my_array_ptr => my_array
- my_c_ptr = c_loc(my_array_ptr) ! { dg-error "Noninteroperable array at .1. as argument to C_LOC: Only explicit-size and assumed-size arrays are interoperable" }
+ my_c_ptr = c_loc(my_array_ptr) ! { dg-error "Fortran 2008: Array of interoperable type at .1. to C_LOC which is nonallocatable and neither assumed size nor explicit size" }
end subroutine sub0
end module c_loc_tests_4
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_14.f90 b/gcc/testsuite/gfortran.dg/class_allocate_14.f90
new file mode 100644
index 00000000000..0c7aeb432d3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_14.f90
@@ -0,0 +1,31 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/56845
+!
+module m
+type t
+integer ::a
+end type t
+contains
+subroutine sub
+ type(t), save, allocatable :: x
+ class(t), save,allocatable :: y
+ if (.not. same_type_as(x,y)) call abort()
+end subroutine sub
+subroutine sub2
+ type(t), save, allocatable :: a(:)
+ class(t), save,allocatable :: b(:)
+ if (.not. same_type_as(a,b)) call abort()
+end subroutine sub2
+end module m
+
+use m
+call sub()
+call sub2()
+end
+
+! { dg-final { scan-tree-dump-times "static struct __class_m_T_1_0a b = {._data={.data=0B}, ._vptr=&__vtab_m_T};" 1 "original" } }
+! { dg-final { scan-tree-dump-times "static struct __class_m_T_a y = {._data=0B, ._vptr=&__vtab_m_T};" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
+
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_15.f90 b/gcc/testsuite/gfortran.dg/class_allocate_15.f90
new file mode 100644
index 00000000000..07c1cb49dbc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_15.f90
@@ -0,0 +1,28 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original -fdump-tree-original -fmax-stack-var-size=1" }
+!
+! PR fortran/56845
+!
+type t
+end type t
+type, extends(t) :: t2
+end type t2
+type(t) :: y
+call foo()
+call bar()
+contains
+ subroutine foo()
+ class(t), allocatable :: x
+ if(allocated(x)) call abort()
+ if(.not.same_type_as(x,y)) call abort()
+ allocate (t2 :: x)
+ end
+ subroutine bar()
+ class(t), allocatable :: x(:)
+ if(allocated(x)) call abort()
+ if(.not.same_type_as(x,y)) call abort()
+ allocate (t2 :: x(4))
+ end
+end
+! { dg-final { scan-tree-dump-times "__builtin_free" 2 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/coarray/alloc_comp_2.f90 b/gcc/testsuite/gfortran.dg/coarray/alloc_comp_2.f90
new file mode 100644
index 00000000000..13c823e7474
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray/alloc_comp_2.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+!
+! PR fortran/56929
+!
+! Contributed by Damian Rouson
+!
+! Allocatable scalar corrays were mishandled (ICE)
+!
+module parent_coarray_component
+ type parent
+ real, allocatable :: dummy[:]
+ end type
+ type, extends(parent) :: child
+ end type
+contains
+ subroutine do_something(this)
+ class(child) this
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_alloc_3.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_alloc_3.f90
new file mode 100644
index 00000000000..bec7ee225fe
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_lib_alloc_3.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -fdump-tree-original" }
+!
+! Allocate/deallocate with libcaf.
+!
+! As coarray_lib_alloc_2.f90 but for a subroutine instead of the PROGRAM
+!
+subroutine test
+ type t
+ end type t
+ class(t), allocatable :: xx[:], yy(:)[:]
+ integer :: stat
+ character(len=200) :: errmsg
+ allocate(xx[*], stat=stat, errmsg=errmsg)
+ allocate(yy(2)[*], stat=stat, errmsg=errmsg)
+ deallocate(xx,yy,stat=stat, errmsg=errmsg)
+ end
+
+! { dg-final { scan-tree-dump-times "_gfortran_caf_register .1, 1, &xx._data.token, &stat.., &errmsg, 200.;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_register .1, 1, &yy._data.token, &stat.., &errmsg, 200.;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister .&xx._data.token, &stat.., &errmsg, 200.;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister .&yy._data.token, &stat.., &errmsg, 200.;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister .&yy._data.token, 0B, 0B, 0.;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister .&xx._data.token, 0B, 0B, 0.;" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/function_types_3.f90 b/gcc/testsuite/gfortran.dg/function_types_3.f90
index 49d5d5f561b..e8347251441 100644
--- a/gcc/testsuite/gfortran.dg/function_types_3.f90
+++ b/gcc/testsuite/gfortran.dg/function_types_3.f90
@@ -5,7 +5,7 @@
! PR 50401: SIGSEGV in resolve_transfer
interface
- function f() ! { dg-error "must be a dummy argument" }
+ function f() ! { dg-error "must be a dummy argument|Interface mismatch in global procedure" }
dimension f(*)
end function
end interface
diff --git a/gcc/testsuite/gfortran.dg/global_references_1.f90 b/gcc/testsuite/gfortran.dg/global_references_1.f90
index 5e72dc9419b..cfff8b32c0b 100644
--- a/gcc/testsuite/gfortran.dg/global_references_1.f90
+++ b/gcc/testsuite/gfortran.dg/global_references_1.f90
@@ -23,7 +23,7 @@ function g(x) ! Global entity
! Function 'f' cannot be referenced as a subroutine. The previous
! definition is in 'line 12'.
- call f(g) ! { dg-error "is already being used as a FUNCTION" }
+ call f(g) ! { dg-error "is already being used as a FUNCTION|Interface mismatch in global procedure" }
end function g
! Error only appears once but testsuite associates with both lines.
function h(x) ! { dg-error "is already being used as a FUNCTION" }
@@ -59,7 +59,7 @@ END SUBROUTINE TT
! Function 'h' cannot be referenced as a subroutine. The previous
! definition is in 'line 29'.
- call h (x) ! { dg-error "is already being used as a FUNCTION" }
+ call h (x) ! { dg-error "is already being used as a FUNCTION|Interface mismatch in global procedure" }
! PR23308===========================================================
! Lahey - 2521-S: "SOURCE.F90", line 68: Intrinsic procedure name or
diff --git a/gcc/testsuite/gfortran.dg/import2.f90 b/gcc/testsuite/gfortran.dg/import2.f90
index 9db21977daa..76c87d617dd 100644
--- a/gcc/testsuite/gfortran.dg/import2.f90
+++ b/gcc/testsuite/gfortran.dg/import2.f90
@@ -4,30 +4,6 @@
! Test whether import does not work with -std=f95
! PR fortran/29601
-subroutine test(x)
- type myType3
- sequence
- integer :: i
- end type myType3
- type(myType3) :: x
- if(x%i /= 7) call abort()
- x%i = 1
-end subroutine test
-
-
-subroutine bar(x,y)
- type myType
- sequence
- integer :: i
- end type myType
- type(myType) :: x
- integer(8) :: y
- if(y /= 8) call abort()
- if(x%i /= 2) call abort()
- x%i = 5
- y = 42
-end subroutine bar
-
module testmod
implicit none
integer, parameter :: kind = 8
@@ -66,14 +42,4 @@ program foo
end subroutine test
end interface
- type(myType) :: y
- type(myType3) :: z
- integer(dp) :: i8
- y%i = 2
- i8 = 8
- call bar(y,i8) ! { dg-error "Type mismatch in argument" }
- if(y%i /= 5 .or. i8/= 42) call abort()
- z%i = 7
- call test(z) ! { dg-error "Type mismatch in argument" }
- if(z%i /= 1) call abort()
end program foo
diff --git a/gcc/testsuite/gfortran.dg/import6.f90 b/gcc/testsuite/gfortran.dg/import6.f90
index 1bf9669c5b6..d57a6368b74 100644
--- a/gcc/testsuite/gfortran.dg/import6.f90
+++ b/gcc/testsuite/gfortran.dg/import6.f90
@@ -7,6 +7,7 @@
!
subroutine func1(param)
type :: my_type
+ sequence
integer :: data
end type my_type
type(my_type) :: param
@@ -15,6 +16,7 @@ end subroutine func1
subroutine func2(param)
type :: my_type
+ sequence
integer :: data
end type my_type
type(my_type) :: param
@@ -22,6 +24,7 @@ subroutine func2(param)
end subroutine func2
type :: my_type
+ sequence
integer :: data
end type my_type
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_actual_3.f90 b/gcc/testsuite/gfortran.dg/intrinsic_actual_3.f90
index c2dd07cda5a..4c159bde179 100644
--- a/gcc/testsuite/gfortran.dg/intrinsic_actual_3.f90
+++ b/gcc/testsuite/gfortran.dg/intrinsic_actual_3.f90
@@ -1,4 +1,6 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
! Tests the fix for PR30237 in which alternate returns in intrinsic
! actual arglists were quietly ignored.
!
diff --git a/gcc/testsuite/gfortran.dg/invalid_interface_assignment.f90 b/gcc/testsuite/gfortran.dg/invalid_interface_assignment.f90
index f3c6e1269b2..4fd747616a4 100644
--- a/gcc/testsuite/gfortran.dg/invalid_interface_assignment.f90
+++ b/gcc/testsuite/gfortran.dg/invalid_interface_assignment.f90
@@ -1,4 +1,6 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
! Tests the fix for PR25102, which did not diagnose the aberrant interface
! assignement below.
!
diff --git a/gcc/testsuite/gfortran.dg/namelist_82.f90 b/gcc/testsuite/gfortran.dg/namelist_82.f90
new file mode 100644
index 00000000000..399d59fe66b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_82.f90
@@ -0,0 +1,33 @@
+! { dg-do run }
+! PR56660 Fails to read NAMELIST with certain form array syntax
+type ptracer
+ character(len = 2) :: sname
+ logical :: lini
+end type ptracer
+
+type(ptracer) , dimension(3) :: tracer
+namelist/naml1/ tracer
+
+tracer(:) = ptracer('XXX', .false.)
+
+open (99, file='nml.dat', status="replace")
+write(99,*) "&naml1"
+!write(99,*) " tracer(2) = 'bb' , .true."
+write(99,*) " tracer(:) = 'aa' , .true."
+write(99,*) " tracer(2) = 'bb' , .true."
+write(99,*) "/"
+rewind(99)
+
+read (99, nml=naml1)
+close (99, status="delete")
+
+if (tracer(1)%sname.ne.'aa') call abort()
+if (.not.tracer(1)%lini) call abort()
+if (tracer(2)%sname.ne.'bb') call abort()
+if (.not.tracer(2)%lini) call abort()
+if (tracer(3)%sname.ne.'XX') call abort()
+if (tracer(3)%lini) call abort()
+
+!write (*, nml=naml1)
+
+end
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_18.f90 b/gcc/testsuite/gfortran.dg/proc_decl_18.f90
index 15993626cc9..c4216135106 100644
--- a/gcc/testsuite/gfortran.dg/proc_decl_18.f90
+++ b/gcc/testsuite/gfortran.dg/proc_decl_18.f90
@@ -23,7 +23,7 @@ implicit none
abstract interface
function abs_fun(x,sz)
- integer :: x(:)
+ integer,intent(in) :: x(:)
interface
pure integer function sz(b)
integer,intent(in) :: b(:)
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_2.f90 b/gcc/testsuite/gfortran.dg/proc_decl_2.f90
index a16b4db5f01..97e06148e27 100644
--- a/gcc/testsuite/gfortran.dg/proc_decl_2.f90
+++ b/gcc/testsuite/gfortran.dg/proc_decl_2.f90
@@ -124,12 +124,12 @@ integer function p2(x)
end function
subroutine p3(x)
- real,intent(inout):: x
+ real :: x
x=x+1.0
end subroutine
subroutine p4(x)
- real,intent(inout):: x
+ real :: x
x=x-1.5
end subroutine
@@ -137,7 +137,7 @@ subroutine p5()
end subroutine
subroutine p6(x)
- real,intent(inout):: x
+ real :: x
x=x*2.
end subroutine
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_9.f90 b/gcc/testsuite/gfortran.dg/proc_decl_9.f90
index 08faee931e6..58ae321899e 100644
--- a/gcc/testsuite/gfortran.dg/proc_decl_9.f90
+++ b/gcc/testsuite/gfortran.dg/proc_decl_9.f90
@@ -2,7 +2,7 @@
! PR33162 INTRINSIC functions as ACTUAL argument
! Test case adapted from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
real function t(x)
- real ::x
+ real, intent(in) ::x
t = x
end function
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_40.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_40.f90
new file mode 100644
index 00000000000..dae91df1c3c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_40.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+!
+! PR 56261: [OOP] seg fault call procedure pointer on polymorphic array
+!
+! Contributed by Andrew Benson <abensonca@gmail.com>
+
+ implicit none
+ type :: nc
+ end type
+ external :: qq
+ procedure( ), pointer :: f1
+ procedure(ff), pointer :: f2
+
+ f1 => ff ! { dg-error "Explicit interface required" }
+ f2 => qq ! { dg-error "Explicit interface required" }
+
+contains
+
+ subroutine ff (self)
+ class(nc) :: self
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/read_repeat_2.f90 b/gcc/testsuite/gfortran.dg/read_repeat_2.f90
new file mode 100644
index 00000000000..4b8659e5f34
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_repeat_2.f90
@@ -0,0 +1,19 @@
+! { dg-do run }
+!
+! PR fortran/56810
+!
+! Contributed by Jonathan Hogg
+!
+program test
+ implicit none
+
+ integer :: i
+ complex :: a(4)
+
+ open (99, status='scratch')
+ write (99, *) '4*(1.0,2.0)'
+ rewind (99)
+ read (99,*) a(:)
+ close (99)
+ if (any (a /= cmplx (1.0,2.0))) call abort()
+end program test
diff --git a/gcc/testsuite/gfortran.dg/reshape_5.f90 b/gcc/testsuite/gfortran.dg/reshape_5.f90
new file mode 100644
index 00000000000..a7d4a3f001f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reshape_5.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+!
+! PR fortran/56849
+!
+integer :: x(2,2),y(4)
+y = reshape([1,2,3,4],[4])
+x(:,1:1) = reshape(y(::2), [1,2], order=[1,2]) ! { dg-error "Different shape for array assignment at .1. on dimension 1 .2 and 1." }
+print *, y
+print *, x(:,1)
+end
diff --git a/gcc/testsuite/gfortran.dg/select_type_33.f03 b/gcc/testsuite/gfortran.dg/select_type_33.f03
new file mode 100644
index 00000000000..3ba27e0103c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_33.f03
@@ -0,0 +1,43 @@
+! { dg-do compile }
+!
+! PR fortran/56816
+! The unfinished SELECT TYPE statement below was leading to an ICE because
+! at the time the statement was rejected, the compiler tried to free
+! some symbols that had already been freed with the SELECT TYPE
+! namespace.
+!
+! Original testcase from Dominique Pelletier <dominique.pelletier@polymtl.ca>
+!
+module any_list_module
+ implicit none
+
+ private
+ public :: anylist, anyitem
+
+ type anylist
+ end type
+
+ type anyitem
+ class(*), allocatable :: value
+ end type
+end module any_list_module
+
+
+module my_item_list_module
+
+ use any_list_module
+ implicit none
+
+ type, extends (anyitem) :: myitem
+ end type myitem
+
+contains
+
+ subroutine myprint (this)
+ class (myitem) :: this
+
+ select type ( v => this % value ! { dg-error "parse error in SELECT TYPE" }
+ end select ! { dg-error "Expecting END SUBROUTINE" }
+ end subroutine myprint
+
+end module my_item_list_module
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_28.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_28.f03
new file mode 100644
index 00000000000..74199c343fa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_28.f03
@@ -0,0 +1,30 @@
+! { dg-do compile }
+!
+! PR 56266: [OOP] ICE on invalid in gfc_match_varspec
+!
+! Contributed by Andrew Benson <abensonca@gmail.com>
+
+module t
+
+ implicit none
+
+ type nc
+ contains
+ procedure :: encM => em
+ end type nc
+
+contains
+
+ double precision function em(self)
+ class(nc) :: self
+ em=0.
+ end function
+
+ double precision function cem(c)
+ type(nc) :: c
+ cem=c(i)%encM() ! { dg-error "Unclassifiable statement" }
+ end function
+
+end module
+
+! { dg-final { cleanup-modules "t" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_29.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_29.f90
new file mode 100644
index 00000000000..2650d149368
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_29.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR 55959: [OOP] ICE in in gfc_simplify_expr, at fortran/expr.c:1920
+!
+! Contributed by Tilo Schwarz <tilo@tilo-schwarz.de>
+
+module pdfs
+ type :: pdf
+ contains
+ procedure, nopass :: getx
+ end type
+
+contains
+
+ real function getx()
+ end function
+
+end module
+
+program abstract
+ use pdfs
+ type(pdf) pp
+ print pp%getx() ! { dg-error "must be of type default-kind CHARACTER or of INTEGER" }
+end program
+
+! { dg-final { cleanup-modules "pdfs" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f b/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
index 8f196a69ad4..978b8713717 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
@@ -41,6 +41,6 @@ C
! we want to check that predictive commoning did something on the
! vectorized loop, which means we have to have exactly 13 vector
! additions.
-! { dg-final { scan-tree-dump-times "vect_var\[^\\n\]*\\+ " 13 "optimized" } }
+! { dg-final { scan-tree-dump-times "vect_\[^\\n\]*\\+ " 13 "optimized" } }
! { dg-final { cleanup-tree-dump "vect" } }
! { dg-final { cleanup-tree-dump "optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90
index d2eebd43574..b17ac9c3277 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-require-effective-target vect_double }
subroutine to_product_of(self,a,b,a1,a2)
complex(kind=8) :: self (:)
diff --git a/gcc/testsuite/gfortran.dg/whole_file_16.f90 b/gcc/testsuite/gfortran.dg/whole_file_16.f90
index 048350f1d7e..6c910f47a2c 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_16.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_16.f90
@@ -5,7 +5,7 @@
!
program main
real, dimension(2) :: a
- call foo(a) ! { dg-error "must have an explicit interface" }
+ call foo(a) ! { dg-error "Explicit interface required" }
end program main
subroutine foo(a)
diff --git a/gcc/testsuite/gfortran.dg/whole_file_17.f90 b/gcc/testsuite/gfortran.dg/whole_file_17.f90
index 86272b848a8..a2a9d151511 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_17.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_17.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-fwhole-file" }
+! { dg-options "-pedantic -fwhole-file" }
!
! PR fortran/30668
!
diff --git a/gcc/testsuite/gfortran.dg/whole_file_18.f90 b/gcc/testsuite/gfortran.dg/whole_file_18.f90
index f758408f81e..c483c7da100 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_18.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_18.f90
@@ -5,7 +5,7 @@
!
PROGRAM MAIN
REAL A
- CALL SUB(A) ! { dg-error "requires an explicit interface" }
+ CALL SUB(A) ! { dg-error "Explicit interface required" }
END PROGRAM
SUBROUTINE SUB(A,I)
diff --git a/gcc/testsuite/gfortran.dg/whole_file_20.f03 b/gcc/testsuite/gfortran.dg/whole_file_20.f03
index 766851776bf..b3f77e46105 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_20.f03
+++ b/gcc/testsuite/gfortran.dg/whole_file_20.f03
@@ -17,8 +17,8 @@ PROGRAM main
INTEGER :: coarr[*]
- CALL coarray(coarr) ! { dg-error " must have an explicit interface" }
- CALL polymorph(tt) ! { dg-error " must have an explicit interface" }
+ CALL coarray(coarr) ! { dg-error "Explicit interface required" }
+ CALL polymorph(tt) ! { dg-error "Explicit interface required" }
END PROGRAM
SUBROUTINE coarray(a)
diff --git a/gcc/testsuite/gfortran.dg/whole_file_7.f90 b/gcc/testsuite/gfortran.dg/whole_file_7.f90
index 53fed228ae2..3225304397c 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_7.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_7.f90
@@ -29,6 +29,6 @@ end function test
program arr ! The error was not picked up causing an ICE
real, dimension(2) :: res
- res = test(2) ! { dg-error "needs an explicit INTERFACE" }
+ res = test(2) ! { dg-error "Explicit interface required" }
print *, res
end program
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_associated.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_associated.f90
index 586f766010a..22ea6f0a62a 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_associated.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_associated.f90
@@ -121,7 +121,7 @@ subroutine associated_2 ()
interface
subroutine sub1 (a, ap)
integer, pointer :: ap(:, :)
- integer, target :: a(10, 1)
+ integer, target :: a(10, 10)
end
endinterface
diff --git a/gcc/testsuite/gnat.dg/array23.adb b/gcc/testsuite/gnat.dg/array23.adb
new file mode 100644
index 00000000000..2196ce5964f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array23.adb
@@ -0,0 +1,10 @@
+-- { dg-do link }
+
+with Array23_Pkg1;
+with Array23_Pkg2;
+
+procedure Array23 is
+ A : Array23_Pkg1.Arr;
+begin
+ A(Array23_Pkg2.One)(1) := 0;
+end;
diff --git a/gcc/testsuite/gnat.dg/array23_pkg1.ads b/gcc/testsuite/gnat.dg/array23_pkg1.ads
new file mode 100644
index 00000000000..d0bc136f96d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array23_pkg1.ads
@@ -0,0 +1,13 @@
+with Array23_Pkg2;
+
+package Array23_Pkg1 is
+
+ C2 : Natural := Array23_Pkg2.C1;
+
+ subtype Index is Natural range 0 .. C2;
+
+ type Inner is array (Index) of Natural;
+
+ type Arr is array (Array23_Pkg2.Index) of Inner;
+
+end Array23_Pkg1;
diff --git a/gcc/testsuite/gnat.dg/array23_pkg2.ads b/gcc/testsuite/gnat.dg/array23_pkg2.ads
new file mode 100644
index 00000000000..8993ffa1e5d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array23_pkg2.ads
@@ -0,0 +1,11 @@
+with Array23_Pkg3;
+
+package Array23_Pkg2 is
+
+ C1 : Natural := Array23_Pkg3.C0;
+
+ type Enum is (Zero, One, Two);
+
+ subtype Index is Enum range One .. Enum'val(C1);
+
+end Array23_Pkg2;
diff --git a/gcc/testsuite/gnat.dg/array23_pkg3.ads b/gcc/testsuite/gnat.dg/array23_pkg3.ads
new file mode 100644
index 00000000000..1a6afa86f3c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array23_pkg3.ads
@@ -0,0 +1,5 @@
+package Array23_Pkg3 is
+
+ C0 : Natural := 2;
+
+end Array23_Pkg3;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index a146f1732c9..4604af63b89 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2147,22 +2147,6 @@ proc check_effective_target_arm_v8_vfp_ok {} {
}
}
-# Return 1 if this is an ARM target supporting -mfpu=neon-fp-armv8
-# -mfloat-abi=softfp
-proc check_effective_target_arm_v8_neon_ok {} {
- if { [check_effective_target_arm32] } {
- return [check_no_compiler_messages arm_v8_neon_ok object {
- int foo (void)
- {
- __asm__ volatile ("vrintn.f32 q0, q0");
- return 0;
- }
- } "-mfpu=neon-fp-armv8 -mfloat-abi=softfp"]
- } else {
- return 0
- }
-}
-
# Return 1 if this is an ARM target supporting -mfpu=vfp
# -mfloat-abi=hard. Some multilibs may be incompatible with these
# options.
@@ -2226,7 +2210,8 @@ proc add_options_for_arm_v8_neon { flags } {
if { ! [check_effective_target_arm_v8_neon_ok] } {
return "$flags"
}
- return "$flags -march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=softfp"
+ global et_arm_v8_neon_flags
+ return "$flags $et_arm_v8_neon_flags -march=armv8-a"
}
# Add the options needed for NEON. We need either -mfloat-abi=softfp
@@ -2270,6 +2255,38 @@ proc check_effective_target_arm_neon_ok { } {
check_effective_target_arm_neon_ok_nocache]
}
+# Return 1 if this is an ARM target supporting -mfpu=neon-fp-armv8
+# -mfloat-abi=softfp or equivalent options. Some multilibs may be
+# incompatible with these options. Also set et_arm_v8_neon_flags to the
+# best options to add.
+
+proc check_effective_target_arm_v8_neon_ok_nocache { } {
+ global et_arm_v8_neon_flags
+ set et_arm_v8_neon_flags ""
+ if { [check_effective_target_arm32] } {
+ foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp-armv8" "-mfpu=neon-fp-armv8 -mfloat-abi=softfp"} {
+ if { [check_no_compiler_messages_nocache arm_v8_neon_ok object {
+ #include "arm_neon.h"
+ void
+ foo ()
+ {
+ __asm__ volatile ("vrintn.f32 q0, q0");
+ }
+ } "$flags"] } {
+ set et_arm_v8_neon_flags $flags
+ return 1
+ }
+ }
+ }
+
+ return 0
+}
+
+proc check_effective_target_arm_v8_neon_ok { } {
+ return [check_cached_effective_target arm_v8_neon_ok \
+ check_effective_target_arm_v8_neon_ok_nocache]
+}
+
# Return 1 if this is an ARM target supporting -mfpu=neon-vfpv4
# -mfloat-abi=softfp or equivalent options. Some multilibs may be
# incompatible with these options. Also set et_arm_neonv2_flags to the
@@ -2509,6 +2526,24 @@ proc check_effective_target_arm_neonv2_hw { } {
} [add_options_for_arm_neonv2 ""]]
}
+# Return 1 if the target supports executing ARMv8 NEON instructions, 0
+# otherwise.
+
+proc check_effective_target_arm_v8_neon_hw { } {
+ return [check_runtime arm_v8_neon_hw_available {
+ #include "arm_neon.h"
+ int
+ main (void)
+ {
+ float32x2_t a;
+ asm ("vrinta.f32 %P0, %P1"
+ : "=w" (a)
+ : "0" (a));
+ return 0;
+ }
+ } [add_options_for_arm_v8_neon ""]]
+}
+
# Return 1 if this is a ARM target with NEON enabled.
proc check_effective_target_arm_neon { } {
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-13.mm b/gcc/testsuite/obj-c++.dg/try-catch-13.mm
index 905702fde47..776d57bed60 100644
--- a/gcc/testsuite/obj-c++.dg/try-catch-13.mm
+++ b/gcc/testsuite/obj-c++.dg/try-catch-13.mm
@@ -22,7 +22,7 @@ extern void some_func (int *);
typeof(q) k = 66;
some_func (&j);
/* { dg-error "invalid conversion" "" { target *-*-* } 23 } */
-/* { dg-error "initializing argument" "" { target *-*-* } 12 } */
+/* { dg-message "initializing argument" "" { target *-*-* } 12 } */
some_func (&k);
}
@catch (id exc) {
@@ -39,7 +39,7 @@ extern void some_func (int *);
/* { dg-error "invalid conversion" "" { target *-*-* } 38 } */
/* The following is disabled as it is already checked above and the testsuites seems
to count multiple different identical errors on the same line only once */
-/* dg-error "initializing argument" "" { target *-*-* } 12 */
+/* dg-message "initializing argument" "" { target *-*-* } 12 */
}
@catch (id exc) {
@throw;
@@ -54,7 +54,7 @@ extern void some_func (int *);
/* { dg-error "invalid conversion" "" { target *-*-* } 53 } */
/* The following is disabled as it is already checked above and the testsuites seems
to count multiple different identical errors on the same line only once */
-/* dg-error "initializing argument" "" { target *-*-* } 12 */
+/* dg-message "initializing argument" "" { target *-*-* } 12 */
some_func (&k);
}
@catch (id exc) {
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 184ba5e03b2..5f1dd12c78d 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3836,9 +3836,9 @@ verify_gimple_assign_single (gimple stmt)
}
if (gimple_clobber_p (stmt)
- && !DECL_P (lhs))
+ && !(DECL_P (lhs) || TREE_CODE (lhs) == MEM_REF))
{
- error ("non-decl LHS in clobber statement");
+ error ("non-decl/MEM_REF LHS in clobber statement");
debug_generic_expr (lhs);
return true;
}
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 6787c78243b..af11a5a2d0a 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -997,7 +997,6 @@ struct gimple_opt_pass pass_merge_phi =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
- | TODO_verify_ssa
+ TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index f8dbe0a8519..760083b64ca 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1648,9 +1648,8 @@ struct gimple_opt_pass pass_lower_complex =
PROP_gimple_lcx, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_update_ssa
- | TODO_verify_stmts /* todo_flags_finish */
+ TODO_update_ssa
+ | TODO_verify_stmts /* todo_flags_finish */
}
};
@@ -1679,8 +1678,7 @@ struct gimple_opt_pass pass_lower_complex_O0 =
PROP_gimple_lcx, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_update_ssa
- | TODO_verify_stmts /* todo_flags_finish */
+ TODO_update_ssa
+ | TODO_verify_stmts /* todo_flags_finish */
}
};
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 973782ba5a8..2eb309732a6 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3230,14 +3230,48 @@ static void
optimize_clobbers (basic_block bb)
{
gimple_stmt_iterator gsi = gsi_last_bb (bb);
+ bool any_clobbers = false;
+ bool seen_stack_restore = false;
+ edge_iterator ei;
+ edge e;
+
+ /* Only optimize anything if the bb contains at least one clobber,
+ ends with resx (checked by caller), optionally contains some
+ debug stmts or labels, or at most one __builtin_stack_restore
+ call, and has an incoming EH edge. */
for (gsi_prev (&gsi); !gsi_end_p (gsi); gsi_prev (&gsi))
{
gimple stmt = gsi_stmt (gsi);
if (is_gimple_debug (stmt))
continue;
- if (!gimple_clobber_p (stmt)
- || TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
- return;
+ if (gimple_clobber_p (stmt))
+ {
+ any_clobbers = true;
+ continue;
+ }
+ if (!seen_stack_restore
+ && gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE))
+ {
+ seen_stack_restore = true;
+ continue;
+ }
+ if (gimple_code (stmt) == GIMPLE_LABEL)
+ break;
+ return;
+ }
+ if (!any_clobbers)
+ return;
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ if (e->flags & EDGE_EH)
+ break;
+ if (e == NULL)
+ return;
+ gsi = gsi_last_bb (bb);
+ for (gsi_prev (&gsi); !gsi_end_p (gsi); gsi_prev (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (!gimple_clobber_p (stmt))
+ continue;
unlink_stmt_vdef (stmt);
gsi_remove (&gsi, true);
release_defs (stmt);
@@ -3278,8 +3312,7 @@ sink_clobbers (basic_block bb)
continue;
if (gimple_code (stmt) == GIMPLE_LABEL)
break;
- if (!gimple_clobber_p (stmt)
- || TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
+ if (!gimple_clobber_p (stmt))
return 0;
any_clobbers = true;
}
@@ -3292,11 +3325,27 @@ sink_clobbers (basic_block bb)
for (gsi_prev (&gsi); !gsi_end_p (gsi); gsi_prev (&gsi))
{
gimple stmt = gsi_stmt (gsi);
+ tree lhs;
if (is_gimple_debug (stmt))
continue;
if (gimple_code (stmt) == GIMPLE_LABEL)
break;
unlink_stmt_vdef (stmt);
+ lhs = gimple_assign_lhs (stmt);
+ /* Unfortunately we don't have dominance info updated at this
+ point, so checking if
+ dominated_by_p (CDI_DOMINATORS, succbb,
+ gimple_bb (SSA_NAME_DEF_STMT (TREE_OPERAND (lhs, 0)))
+ would be too costly. Thus, avoid sinking any clobbers that
+ refer to non-(D) SSA_NAMEs. */
+ if (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == SSA_NAME
+ && !SSA_NAME_IS_DEFAULT_DEF (TREE_OPERAND (lhs, 0)))
+ {
+ gsi_remove (&gsi, true);
+ release_defs (stmt);
+ continue;
+ }
gsi_remove (&gsi, false);
/* Trigger the operand scanner to cause renaming for virtual
operands for this statement.
@@ -3737,10 +3786,10 @@ unsplit_eh (eh_landing_pad lp)
edge e_in, e_out;
/* Quickly check the edge counts on BB for singularity. */
- if (EDGE_COUNT (bb->preds) != 1 || EDGE_COUNT (bb->succs) != 1)
+ if (!single_pred_p (bb) || !single_succ_p (bb))
return false;
- e_in = EDGE_PRED (bb, 0);
- e_out = EDGE_SUCC (bb, 0);
+ e_in = single_pred_edge (bb);
+ e_out = single_succ_edge (bb);
/* Input edge must be EH and output edge must be normal. */
if ((e_in->flags & EDGE_EH) == 0 || (e_out->flags & EDGE_EH) != 0)
@@ -4142,7 +4191,7 @@ cleanup_empty_eh (eh_landing_pad lp)
e_out = NULL;
break;
case 1:
- e_out = EDGE_SUCC (bb, 0);
+ e_out = single_succ_edge (bb);
break;
default:
return false;
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index d7d7360a9f9..fc75b3144e3 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -798,7 +798,7 @@ ipa_lower_emutls (void)
access_vars.release ();
free_varpool_node_set (tls_vars);
- return TODO_ggc_collect | TODO_verify_all;
+ return TODO_verify_all;
}
/* If the target supports TLS natively, we need do nothing here. */
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index e3a70bf203e..d5b2185102c 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -1246,7 +1246,13 @@ get_addr_base_and_unit_offset_1 (tree exp, HOST_WIDE_INT *poffset,
switch (TREE_CODE (exp))
{
case BIT_FIELD_REF:
- return NULL_TREE;
+ {
+ HOST_WIDE_INT this_off = TREE_INT_CST_LOW (TREE_OPERAND (exp, 2));
+ if (this_off % BITS_PER_UNIT)
+ return NULL_TREE;
+ byte_offset += this_off / BITS_PER_UNIT;
+ }
+ break;
case COMPONENT_REF:
{
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 389246d406f..227fe56d00e 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -749,6 +749,7 @@ extern void tree_check_data_deps (void);
/* In tree-ssa-loop-ivopts.c */
bool expr_invariant_in_loop_p (struct loop *, tree);
bool stmt_invariant_in_loop_p (struct loop *, gimple);
+struct loop *outermost_invariant_loop_for_expr (struct loop *, tree);
bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode,
addr_space_t);
bool may_be_nonaddressable_p (tree expr);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index ef33d170157..7d45ccb5bc0 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -114,9 +114,6 @@ eni_weights eni_time_weights;
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 *);
-static void unsave_expr_1 (tree);
-static tree unsave_r (tree *, int *, void *);
static void declare_inline_vars (tree, tree);
static void remap_save_expr (tree *, void *, int *);
static void prepend_lexical_block (tree current_block, tree new_block);
@@ -1521,10 +1518,12 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
basic_block_info automatically. */
copy_basic_block = create_basic_block (NULL, (void *) 0,
(basic_block) prev->aux);
+ /* Update to use apply_probability(). */
copy_basic_block->count = bb->count * count_scale / REG_BR_PROB_BASE;
/* We are going to rebuild frequencies from scratch. These values
have just small importance to drive canonicalize_loop_headers. */
+ /* Update to use EDGE_FREQUENCY. */
freq = ((gcov_type)bb->frequency * frequency_scale / REG_BR_PROB_BASE);
/* We recompute frequencies after inlining, so this is quite safe. */
@@ -1890,6 +1889,7 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
&& old_edge->dest->aux != EXIT_BLOCK_PTR)
flags |= EDGE_FALLTHRU;
new_edge = make_edge (new_bb, (basic_block) old_edge->dest->aux, flags);
+ /* Update to use apply_probability(). */
new_edge->count = old_edge->count * count_scale / REG_BR_PROB_BASE;
new_edge->probability = old_edge->probability;
}
@@ -2060,6 +2060,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count)
struct function *src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl);
gcov_type count_scale;
+ /* Update to use GCOV_COMPUTE_SCALE. */
if (ENTRY_BLOCK_PTR_FOR_FUNCTION (src_cfun)->count)
count_scale = (REG_BR_PROB_BASE * count
/ ENTRY_BLOCK_PTR_FOR_FUNCTION (src_cfun)->count);
@@ -2207,6 +2208,7 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale,
int incoming_frequency = 0;
gcov_type incoming_count = 0;
+ /* Update to use GCOV_COMPUTE_SCALE. */
if (ENTRY_BLOCK_PTR_FOR_FUNCTION (src_cfun)->count)
count_scale = (REG_BR_PROB_BASE * count
/ ENTRY_BLOCK_PTR_FOR_FUNCTION (src_cfun)->count);
@@ -2231,7 +2233,9 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale,
incoming_frequency += EDGE_FREQUENCY (e);
incoming_count += e->count;
}
+ /* Update to use apply_probability(). */
incoming_count = incoming_count * count_scale / REG_BR_PROB_BASE;
+ /* Update to use EDGE_FREQUENCY. */
incoming_frequency
= incoming_frequency * frequency_scale / REG_BR_PROB_BASE;
ENTRY_BLOCK_PTR->count = incoming_count;
@@ -4051,6 +4055,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
a self-referential call; if we're calling ourselves, we need to
duplicate our body before altering anything. */
copy_body (id, bb->count,
+ /* Update to use GCOV_COMPUTE_SCALE. */
cg_edge->frequency * REG_BR_PROB_BASE / CGRAPH_FREQ_BASE,
bb, return_block, NULL, NULL);
@@ -4465,137 +4470,6 @@ remap_save_expr (tree *tp, void *st_, int *walk_subtrees)
*tp = t;
}
-/* Called via walk_tree. If *TP points to a DECL_STMT for a local label,
- copies the declaration and enters it in the splay_tree in DATA (which is
- really an `copy_body_data *'). */
-
-static tree
-mark_local_for_remap_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data)
-{
- copy_body_data *id = (copy_body_data *) data;
-
- /* Don't walk into types. */
- if (TYPE_P (*tp))
- *walk_subtrees = 0;
-
- else if (TREE_CODE (*tp) == LABEL_EXPR)
- {
- tree decl = TREE_OPERAND (*tp, 0);
-
- /* Copy the decl and remember the copy. */
- insert_decl_map (id, decl, id->copy_decl (decl, id));
- }
-
- return NULL_TREE;
-}
-
-/* Perform any modifications to EXPR required when it is unsaved. Does
- not recurse into EXPR's subtrees. */
-
-static void
-unsave_expr_1 (tree expr)
-{
- switch (TREE_CODE (expr))
- {
- case TARGET_EXPR:
- /* Don't mess with a TARGET_EXPR that hasn't been expanded.
- It's OK for this to happen if it was part of a subtree that
- isn't immediately expanded, such as operand 2 of another
- TARGET_EXPR. */
- if (TREE_OPERAND (expr, 1))
- break;
-
- TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
- TREE_OPERAND (expr, 3) = NULL_TREE;
- break;
-
- default:
- break;
- }
-}
-
-/* Called via walk_tree when an expression is unsaved. Using the
- splay_tree pointed to by ST (which is really a `splay_tree'),
- remaps all local declarations to appropriate replacements. */
-
-static tree
-unsave_r (tree *tp, int *walk_subtrees, void *data)
-{
- copy_body_data *id = (copy_body_data *) data;
- struct pointer_map_t *st = id->decl_map;
- tree *n;
-
- /* Only a local declaration (variable or label). */
- if ((TREE_CODE (*tp) == VAR_DECL && !TREE_STATIC (*tp))
- || TREE_CODE (*tp) == LABEL_DECL)
- {
- /* Lookup the declaration. */
- n = (tree *) pointer_map_contains (st, *tp);
-
- /* If it's there, remap it. */
- if (n)
- *tp = *n;
- }
-
- else if (TREE_CODE (*tp) == STATEMENT_LIST)
- gcc_unreachable ();
- else if (TREE_CODE (*tp) == BIND_EXPR)
- copy_bind_expr (tp, walk_subtrees, id);
- else if (TREE_CODE (*tp) == SAVE_EXPR
- || TREE_CODE (*tp) == TARGET_EXPR)
- remap_save_expr (tp, st, walk_subtrees);
- else
- {
- copy_tree_r (tp, walk_subtrees, NULL);
-
- /* Do whatever unsaving is required. */
- unsave_expr_1 (*tp);
- }
-
- /* Keep iterating. */
- return NULL_TREE;
-}
-
-/* Copies everything in EXPR and replaces variables, labels
- and SAVE_EXPRs local to EXPR. */
-
-tree
-unsave_expr_now (tree expr)
-{
- copy_body_data id;
-
- /* There's nothing to do for NULL_TREE. */
- if (expr == 0)
- return expr;
-
- /* Set up ID. */
- memset (&id, 0, sizeof (id));
- id.src_fn = current_function_decl;
- id.dst_fn = current_function_decl;
- id.decl_map = pointer_map_create ();
- id.debug_map = NULL;
-
- id.copy_decl = copy_decl_no_change;
- id.transform_call_graph_edges = CB_CGE_DUPLICATE;
- id.transform_new_cfg = false;
- id.transform_return_to_modify = false;
- id.transform_lang_insert_block = NULL;
-
- /* Walk the tree once to find local labels. */
- walk_tree_without_duplicates (&expr, mark_local_for_remap_r, &id);
-
- /* Walk the tree again, copying, remapping, and unsaving. */
- walk_tree (&expr, unsave_r, &id, NULL);
-
- /* Clean up. */
- pointer_map_destroy (id.decl_map);
- if (id.debug_map)
- pointer_map_destroy (id.debug_map);
-
- return expr;
-}
-
/* Called via walk_gimple_seq. If *GSIP points to a GIMPLE_LABEL for a local
label, copies the declaration and enters it in the splay_tree in DATA (which
is really a 'copy_body_data *'. */
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 6ea0b8f47c8..78df6a50eb0 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -303,6 +303,36 @@ build_addr_arg_loc (location_t loc, data_reference_p dr, tree nb_bytes)
return fold_build_pointer_plus_loc (loc, DR_BASE_ADDRESS (dr), addr_base);
}
+/* If VAL memory representation contains the same value in all bytes,
+ return that value, otherwise return -1.
+ E.g. for 0x24242424 return 0x24, for IEEE double
+ 747708026454360457216.0 return 0x44, etc. */
+
+static int
+const_with_all_bytes_same (tree val)
+{
+ unsigned char buf[64];
+ int i, len;
+
+ if (integer_zerop (val)
+ || real_zerop (val)
+ || (TREE_CODE (val) == CONSTRUCTOR
+ && !TREE_CLOBBER_P (val)
+ && CONSTRUCTOR_NELTS (val) == 0))
+ return 0;
+
+ if (CHAR_BIT != 8 || BITS_PER_UNIT != 8)
+ return -1;
+
+ len = native_encode_expr (val, buf, sizeof (buf));
+ if (len == 0)
+ return -1;
+ for (i = 1; i < len; i++)
+ if (buf[i] != buf[0])
+ return -1;
+ return buf[0];
+}
+
/* Generate a call to memset for PARTITION in LOOP. */
static void
@@ -333,24 +363,20 @@ generate_memset_builtin (struct loop *loop, partition_t partition)
/* This exactly matches the pattern recognition in classify_partition. */
val = gimple_assign_rhs1 (stmt);
- if (integer_zerop (val)
- || real_zerop (val)
- || TREE_CODE (val) == CONSTRUCTOR)
- val = integer_zero_node;
- else if (integer_all_onesp (val))
- val = build_int_cst (integer_type_node, -1);
- else
+ /* Handle constants like 0x15151515 and similarly
+ floating point constants etc. where all bytes are the same. */
+ int bytev = const_with_all_bytes_same (val);
+ if (bytev != -1)
+ val = build_int_cst (integer_type_node, bytev);
+ else if (TREE_CODE (val) == INTEGER_CST)
+ val = fold_convert (integer_type_node, val);
+ else if (!useless_type_conversion_p (integer_type_node, TREE_TYPE (val)))
{
- if (TREE_CODE (val) == INTEGER_CST)
- val = fold_convert (integer_type_node, val);
- else if (!useless_type_conversion_p (integer_type_node, TREE_TYPE (val)))
- {
- gimple cstmt;
- tree tem = make_ssa_name (integer_type_node, NULL);
- cstmt = gimple_build_assign_with_ops (NOP_EXPR, tem, val, NULL_TREE);
- gsi_insert_after (&gsi, cstmt, GSI_CONTINUE_LINKING);
- val = tem;
- }
+ gimple cstmt;
+ tree tem = make_ssa_name (integer_type_node, NULL);
+ cstmt = gimple_build_assign_with_ops (NOP_EXPR, tem, val, NULL_TREE);
+ gsi_insert_after (&gsi, cstmt, GSI_CONTINUE_LINKING);
+ val = tem;
}
fn = build_fold_addr_expr (builtin_decl_implicit (BUILT_IN_MEMSET));
@@ -360,10 +386,8 @@ generate_memset_builtin (struct loop *loop, partition_t partition)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "generated memset");
- if (integer_zerop (val))
+ if (bytev == 0)
fprintf (dump_file, " zero\n");
- else if (integer_all_onesp (val))
- fprintf (dump_file, " minus one\n");
else
fprintf (dump_file, "\n");
}
@@ -947,14 +971,10 @@ classify_partition (loop_p loop, struct graph *rdg, partition_t partition)
{
gimple stmt = DR_STMT (single_store);
tree rhs = gimple_assign_rhs1 (stmt);
- if (!(integer_zerop (rhs)
- || integer_all_onesp (rhs)
- || real_zerop (rhs)
- || (TREE_CODE (rhs) == CONSTRUCTOR
- && !TREE_CLOBBER_P (rhs))
- || (INTEGRAL_TYPE_P (TREE_TYPE (rhs))
- && (TYPE_MODE (TREE_TYPE (gimple_assign_lhs (stmt)))
- == TYPE_MODE (unsigned_char_type_node)))))
+ if (const_with_all_bytes_same (rhs) == -1
+ && (!INTEGRAL_TYPE_P (TREE_TYPE (rhs))
+ || (TYPE_MODE (TREE_TYPE (rhs))
+ != TYPE_MODE (unsigned_char_type_node))))
return;
if (TREE_CODE (rhs) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (rhs)
@@ -1591,7 +1611,6 @@ struct gimple_opt_pass pass_loop_distribution =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 6562008d754..1f3ec3930a8 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -261,6 +261,10 @@ use_pointer_in_frame (tree decl)
}
else
{
+ /* FIXME: Try to figure out why this is happening. It is in the
+ distructor that has "Cilk" in it. */
+ if (flag_enable_cilk && TREE_CODE (decl) == MEM_REF)
+ decl = TREE_OPERAND (decl, 0);
/* Variable sized types make things "interesting" in the frame. */
return DECL_SIZE (decl) == NULL || !TREE_CONSTANT (DECL_SIZE (decl));
}
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 58e7e80c808..51bc7cd90cd 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -285,7 +285,7 @@ struct gimple_opt_pass pass_nrv =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 3f69fb31094..a72369eb59e 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -126,25 +126,20 @@ execute_fixup_cfg (void)
edge e;
edge_iterator ei;
- if (ENTRY_BLOCK_PTR->count)
- count_scale = ((cgraph_get_node (current_function_decl)->count
- * REG_BR_PROB_BASE + ENTRY_BLOCK_PTR->count / 2)
- / ENTRY_BLOCK_PTR->count);
- else
- count_scale = REG_BR_PROB_BASE;
+ count_scale
+ = GCOV_COMPUTE_SCALE (cgraph_get_node (current_function_decl)->count,
+ ENTRY_BLOCK_PTR->count);
ENTRY_BLOCK_PTR->count = cgraph_get_node (current_function_decl)->count;
- EXIT_BLOCK_PTR->count = (EXIT_BLOCK_PTR->count * count_scale
- + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ EXIT_BLOCK_PTR->count = apply_probability (EXIT_BLOCK_PTR->count,
+ count_scale);
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- e->count = (e->count * count_scale
- + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ e->count = apply_probability (e->count, count_scale);
FOR_EACH_BB (bb)
{
- bb->count = (bb->count * count_scale
- + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ bb->count = apply_probability (bb->count, count_scale);
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
@@ -177,8 +172,7 @@ execute_fixup_cfg (void)
}
FOR_EACH_EDGE (e, ei, bb->succs)
- e->count = (e->count * count_scale
- + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+ e->count = apply_probability (e->count, count_scale);
/* If we have a basic block with no successors that does not
end with a control statement or a noreturn call end it with
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index b797e7653f4..ce767748d67 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -154,7 +154,7 @@ struct simple_ipa_opt_pass
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
/* To-do flags. */
-#define TODO_ggc_collect (1 << 1)
+#define TODO_do_not_ggc_collect (1 << 1)
#define TODO_verify_ssa (1 << 2)
#define TODO_verify_flow (1 << 3)
#define TODO_verify_stmts (1 << 4)
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 93446c2151a..a148a600017 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2965,8 +2965,8 @@ sra_modify_constructor_assign (gimple *stmt, gimple_stmt_iterator *gsi)
static tree
get_repl_default_def_ssa_name (struct access *racc)
{
- gcc_checking_assert (!racc->grp_to_be_replaced &&
- !racc->grp_to_be_debug_replaced);
+ gcc_checking_assert (!racc->grp_to_be_replaced
+ && !racc->grp_to_be_debug_replaced);
if (!racc->replacement_decl)
racc->replacement_decl = create_access_replacement (racc);
return get_or_create_ssa_default_def (cfun, racc->replacement_decl);
@@ -3450,7 +3450,6 @@ struct gimple_opt_pass pass_sra_early =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_update_ssa
- | TODO_ggc_collect
| TODO_verify_ssa /* todo_flags_finish */
}
};
@@ -3472,7 +3471,6 @@ struct gimple_opt_pass pass_sra =
0, /* properties_destroyed */
TODO_update_address_taken, /* todo_flags_start */
TODO_update_ssa
- | TODO_ggc_collect
| TODO_verify_ssa /* todo_flags_finish */
}
};
@@ -4462,8 +4460,8 @@ sra_ipa_modify_expr (tree *expr, bool convert,
{
adj = &adjustments[i];
- if (adj->base == base &&
- (adj->offset == offset || adj->remove_param))
+ if (adj->base == base
+ && (adj->offset == offset || adj->remove_param))
{
cand = adj;
break;
@@ -4676,6 +4674,14 @@ sra_ipa_reset_debug_stmts (ipa_parm_adjustment_vec adjustments)
if (name)
FOR_EACH_IMM_USE_STMT (stmt, ui, name)
{
+ if (gimple_clobber_p (stmt))
+ {
+ gimple_stmt_iterator cgsi = gsi_for_stmt (stmt);
+ unlink_stmt_vdef (stmt);
+ gsi_remove (&cgsi, true);
+ release_defs (stmt);
+ continue;
+ }
/* All other users must have been removed by
ipa_sra_modify_function_body. */
gcc_assert (is_gimple_debug (stmt));
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index a83e35165d7..968c5054893 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1889,20 +1889,50 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref *ref)
&& !stmt_can_throw_internal (stmt))
{
tree base, lhs = gimple_get_lhs (stmt);
- HOST_WIDE_INT size, offset, max_size;
+ HOST_WIDE_INT size, offset, max_size, ref_offset = ref->offset;
base = get_ref_base_and_extent (lhs, &offset, &size, &max_size);
/* We can get MEM[symbol: sZ, index: D.8862_1] here,
so base == ref->base does not always hold. */
- if (base == ref->base)
+ if (base != ref->base)
{
- /* For a must-alias check we need to be able to constrain
- the access properly. */
- if (size != -1 && size == max_size)
+ /* If both base and ref->base are MEM_REFs, only compare the
+ first operand, and if the second operand isn't equal constant,
+ try to add the offsets into offset and ref_offset. */
+ if (TREE_CODE (base) == MEM_REF && TREE_CODE (ref->base) == MEM_REF
+ && TREE_OPERAND (base, 0) == TREE_OPERAND (ref->base, 0))
{
- if (offset <= ref->offset
- && offset + size >= ref->offset + ref->max_size)
- return true;
+ if (!tree_int_cst_equal (TREE_OPERAND (base, 0),
+ TREE_OPERAND (ref->base, 0)))
+ {
+ double_int off1 = mem_ref_offset (base);
+ off1 = off1.alshift (BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT);
+ off1 = off1 + double_int::from_shwi (offset);
+ double_int off2 = mem_ref_offset (ref->base);
+ off2 = off2.alshift (BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT),
+ HOST_BITS_PER_DOUBLE_INT);
+ off2 = off2 + double_int::from_shwi (ref_offset);
+ if (off1.fits_shwi () && off2.fits_shwi ())
+ {
+ offset = off1.to_shwi ();
+ ref_offset = off2.to_shwi ();
+ }
+ else
+ size = -1;
+ }
}
+ else
+ size = -1;
+ }
+ /* For a must-alias check we need to be able to constrain
+ the access properly. */
+ if (size != -1 && size == max_size)
+ {
+ if (offset <= ref_offset
+ && offset + size >= ref_offset + ref->max_size)
+ return true;
}
}
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index a64bffcaec7..1bc4c2fb7b5 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2139,7 +2139,7 @@ struct gimple_opt_pass pass_ccp =
0, /* todo_flags_start */
TODO_verify_ssa
| TODO_update_address_taken
- | TODO_verify_stmts | TODO_ggc_collect/* todo_flags_finish */
+ | TODO_verify_stmts /* todo_flags_finish */
}
};
@@ -2396,6 +2396,21 @@ execute_fold_all_builtins (void)
if (gimple_code (stmt) != GIMPLE_CALL)
{
+ /* Remove all *ssaname_N ={v} {CLOBBER}; stmts,
+ after the last GIMPLE DSE they aren't needed and might
+ unnecessarily keep the SSA_NAMEs live. */
+ if (gimple_clobber_p (stmt))
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ if (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == SSA_NAME)
+ {
+ unlink_stmt_vdef (stmt);
+ gsi_remove (&i, true);
+ release_defs (stmt);
+ continue;
+ }
+ }
gsi_next (&i);
continue;
}
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 75a415454de..d16756cb79a 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -163,7 +163,7 @@ replace_exp_1 (use_operand_p op_p, tree val,
if (TREE_CODE (val) == SSA_NAME)
SET_USE (op_p, val);
else
- SET_USE (op_p, unsave_expr_now (val));
+ SET_USE (op_p, unshare_expr (val));
}
@@ -214,7 +214,7 @@ propagate_tree_value (tree *op_p, tree val)
if (TREE_CODE (val) == SSA_NAME)
*op_p = val;
else
- *op_p = unsave_expr_now (val);
+ *op_p = unshare_expr (val);
}
@@ -844,7 +844,6 @@ struct gimple_opt_pass pass_copy_prop =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_cleanup_cfg
- | TODO_ggc_collect
| TODO_verify_ssa
| TODO_update_ssa /* todo_flags_finish */
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 29d2bb4f3e1..d650d95f23e 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1151,9 +1151,15 @@ record_equivalences_from_incoming_edge (basic_block bb)
{
tree old_rhs = gimple_assign_rhs1 (defstmt);
- /* If the constant is in the range of the type of OLD_RHS,
- then convert the constant and record the equivalence. */
+ /* If the conversion widens the original value and
+ the constant is in the range of the type of OLD_RHS,
+ then convert the constant and record the equivalence.
+
+ Note that int_fits_type_p does not check the precision
+ if the upper and lower bounds are OK. */
if (INTEGRAL_TYPE_P (TREE_TYPE (old_rhs))
+ && (TYPE_PRECISION (TREE_TYPE (lhs))
+ > TYPE_PRECISION (TREE_TYPE (old_rhs)))
&& int_fits_type_p (rhs, TREE_TYPE (old_rhs)))
{
tree newval = fold_convert (TREE_TYPE (old_rhs), rhs);
@@ -3070,7 +3076,6 @@ struct gimple_opt_pass pass_phi_only_cprop =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_cleanup_cfg
- | TODO_ggc_collect
| TODO_verify_ssa
| TODO_verify_stmts
| TODO_update_ssa /* todo_flags_finish */
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 223682b057a..ad99ea9d5d4 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -218,7 +218,10 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi)
if (is_gimple_call (stmt) && gimple_call_fndecl (stmt))
return;
- if (gimple_has_volatile_ops (stmt))
+ /* Don't return early on *this_2(D) ={v} {CLOBBER}. */
+ if (gimple_has_volatile_ops (stmt)
+ && (!gimple_clobber_p (stmt)
+ || TREE_CODE (gimple_assign_lhs (stmt)) != MEM_REF))
return;
if (is_gimple_assign (stmt))
@@ -228,6 +231,12 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi)
if (!dse_possible_dead_store_p (stmt, &use_stmt))
return;
+ /* But only remove *this_2(D) ={v} {CLOBBER} if killed by
+ another clobber stmt. */
+ if (gimple_clobber_p (stmt)
+ && !gimple_clobber_p (use_stmt))
+ return;
+
/* If we have precisely one immediate use at this point and the
stores are to the same memory location or there is a chain of
virtual uses from stmt and the stmt which stores to that same
@@ -366,7 +375,6 @@ struct gimple_opt_pass pass_dse =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index edcf92918b7..ac930c68755 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -826,7 +826,11 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
&& integer_zerop (TREE_OPERAND (lhs, 1))
&& useless_type_conversion_p
(TREE_TYPE (TREE_OPERAND (def_rhs, 0)),
- TREE_TYPE (gimple_assign_rhs1 (use_stmt))))
+ TREE_TYPE (gimple_assign_rhs1 (use_stmt)))
+ /* Don't forward anything into clobber stmts if it would result
+ in the lhs no longer being a MEM_REF. */
+ && (!gimple_clobber_p (use_stmt)
+ || TREE_CODE (TREE_OPERAND (def_rhs, 0)) == MEM_REF))
{
tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0);
tree new_offset, new_base, saved, new_lhs;
@@ -3148,8 +3152,7 @@ struct gimple_opt_pass pass_forwprop =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_update_ssa
+ TODO_update_ssa
| TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index cc06ca13b1e..9598eb81a45 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -664,8 +664,7 @@ struct gimple_opt_pass pass_tree_ifcombine =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_update_ssa
+ TODO_update_ssa
| TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 4b052c3dfa1..6c3dade4b24 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -623,8 +623,8 @@ clear_unused_block_pointer_1 (tree *tp, int *, void *)
return NULL_TREE;
}
-/* Set all block pointer in debug stmt to NULL if the block is unused,
- so that they will not be streamed out. */
+/* Set all block pointer in debug or clobber stmt to NULL if the block
+ is unused, so that they will not be streamed out. */
static void
clear_unused_block_pointer (void)
@@ -639,7 +639,7 @@ clear_unused_block_pointer (void)
tree b;
gimple stmt = gsi_stmt (gsi);
- if (!is_gimple_debug (stmt))
+ if (!is_gimple_debug (stmt) && !gimple_clobber_p (stmt))
continue;
b = gimple_block (stmt);
if (b && !TREE_USED (b))
@@ -828,7 +828,15 @@ remove_unused_locals (void)
if (gimple_clobber_p (stmt))
{
tree lhs = gimple_assign_lhs (stmt);
- if (TREE_CODE (lhs) == VAR_DECL && !is_used_p (lhs))
+ tree base = get_base_address (lhs);
+ /* Remove clobbers referencing unused vars, or clobbers
+ with MEM_REF lhs referencing uninitialized pointers. */
+ if ((TREE_CODE (base) == VAR_DECL && !is_used_p (base))
+ || (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == SSA_NAME
+ && SSA_NAME_IS_DEFAULT_DEF (TREE_OPERAND (lhs, 0))
+ && (TREE_CODE (SSA_NAME_VAR (TREE_OPERAND (lhs, 0)))
+ != PARM_DECL)))
{
unlink_stmt_vdef (stmt);
gsi_remove (&gsi, true);
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 4570807842d..c57e4f6a30d 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -1097,6 +1097,63 @@ propagate_constants_for_unrolling (basic_block bb)
}
}
+/* Process loops from innermost to outer, stopping at the innermost
+ loop we unrolled. */
+
+static bool
+tree_unroll_loops_completely_1 (bool may_increase_size, bool unroll_outer,
+ vec<loop_p, va_stack>& father_stack,
+ struct loop *loop)
+{
+ struct loop *loop_father;
+ bool changed = false;
+ struct loop *inner;
+ enum unroll_level ul;
+
+ /* Process inner loops first. */
+ for (inner = loop->inner; inner != NULL; inner = inner->next)
+ changed |= tree_unroll_loops_completely_1 (may_increase_size,
+ unroll_outer, father_stack,
+ inner);
+
+ /* If we changed an inner loop we cannot process outer loops in this
+ iteration because SSA form is not up-to-date. Continue with
+ siblings of outer loops instead. */
+ if (changed)
+ return true;
+
+ /* Try to unroll this loop. */
+ loop_father = loop_outer (loop);
+ if (!loop_father)
+ return false;
+
+ if (may_increase_size && optimize_loop_nest_for_speed_p (loop)
+ /* Unroll outermost loops only if asked to do so or they do
+ not cause code growth. */
+ && (unroll_outer || loop_outer (loop_father)))
+ ul = UL_ALL;
+ else
+ ul = UL_NO_GROWTH;
+
+ if (canonicalize_loop_induction_variables
+ (loop, false, ul, !flag_tree_loop_ivcanon))
+ {
+ /* If we'll continue unrolling, we need to propagate constants
+ within the new basic blocks to fold away induction variable
+ computations; otherwise, the size might blow up before the
+ iteration is complete and the IR eventually cleaned up. */
+ if (loop_outer (loop_father) && !loop_father->aux)
+ {
+ father_stack.safe_push (loop_father);
+ loop_father->aux = loop_father;
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
/* Unroll LOOPS completely if they iterate just few times. Unless
MAY_INCREASE_SIZE is true, perform the unrolling only if the
size of the code does not increase. */
@@ -1105,10 +1162,7 @@ unsigned int
tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
{
vec<loop_p, va_stack> father_stack;
- loop_iterator li;
- struct loop *loop;
bool changed;
- enum unroll_level ul;
int iteration = 0;
bool irred_invalidated = false;
@@ -1124,34 +1178,9 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
free_numbers_of_iterations_estimates ();
estimate_numbers_of_iterations ();
- FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
- {
- struct loop *loop_father = loop_outer (loop);
-
- if (may_increase_size && optimize_loop_nest_for_speed_p (loop)
- /* Unroll outermost loops only if asked to do so or they do
- not cause code growth. */
- && (unroll_outer || loop_outer (loop_father)))
- ul = UL_ALL;
- else
- ul = UL_NO_GROWTH;
-
- if (canonicalize_loop_induction_variables
- (loop, false, ul, !flag_tree_loop_ivcanon))
- {
- changed = true;
- /* If we'll continue unrolling, we need to propagate constants
- within the new basic blocks to fold away induction variable
- computations; otherwise, the size might blow up before the
- iteration is complete and the IR eventually cleaned up. */
- if (loop_outer (loop_father) && !loop_father->aux)
- {
- father_stack.safe_push (loop_father);
- loop_father->aux = loop_father;
- }
- }
- }
-
+ changed = tree_unroll_loops_completely_1 (may_increase_size,
+ unroll_outer, father_stack,
+ current_loops->tree_root);
if (changed)
{
struct loop **iter;
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 2940bf10044..0099275d49f 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -1367,6 +1367,54 @@ find_interesting_uses_cond (struct ivopts_data *data, gimple stmt)
record_use (data, NULL, civ, stmt, USE_COMPARE);
}
+/* Returns the outermost loop EXPR is obviously invariant in
+ relative to the loop LOOP, i.e. if all its operands are defined
+ outside of the returned loop. Returns NULL if EXPR is not
+ even obviously invariant in LOOP. */
+
+struct loop *
+outermost_invariant_loop_for_expr (struct loop *loop, tree expr)
+{
+ basic_block def_bb;
+ unsigned i, len;
+
+ if (is_gimple_min_invariant (expr))
+ return current_loops->tree_root;
+
+ if (TREE_CODE (expr) == SSA_NAME)
+ {
+ def_bb = gimple_bb (SSA_NAME_DEF_STMT (expr));
+ if (def_bb)
+ {
+ if (flow_bb_inside_loop_p (loop, def_bb))
+ return NULL;
+ return superloop_at_depth (loop,
+ loop_depth (def_bb->loop_father) + 1);
+ }
+
+ return current_loops->tree_root;
+ }
+
+ if (!EXPR_P (expr))
+ return NULL;
+
+ unsigned maxdepth = 0;
+ len = TREE_OPERAND_LENGTH (expr);
+ for (i = 0; i < len; i++)
+ {
+ struct loop *ivloop;
+ if (!TREE_OPERAND (expr, i))
+ continue;
+
+ ivloop = outermost_invariant_loop_for_expr (loop, TREE_OPERAND (expr, i));
+ if (!ivloop)
+ return NULL;
+ maxdepth = MAX (maxdepth, loop_depth (ivloop));
+ }
+
+ return superloop_at_depth (loop, maxdepth);
+}
+
/* Returns true if expression EXPR is obviously invariant in LOOP,
i.e. if all its operands are defined outside of the LOOP. LOOP
should not be the function body. */
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index a0516c45c4a..7101f30d4e6 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -489,7 +489,6 @@ find_uses_to_rename (bitmap changed_bbs, bitmap *use_blocks, bitmap need_phis)
void
rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
{
- bitmap *loop_exits;
bitmap *use_blocks;
bitmap names_to_rename;
@@ -505,11 +504,6 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
names_to_rename = BITMAP_ALLOC (&loop_renamer_obstack);
- /* An array of bitmaps where LOOP_EXITS[I] is the set of basic blocks
- that are the destination of an edge exiting loop number I. */
- loop_exits = XNEWVEC (bitmap, number_of_loops ());
- get_loops_exits (loop_exits);
-
/* Uses of names to rename. We don't have to initialize this array,
because we know that we will only have entries for the SSA names
in NAMES_TO_RENAME. */
@@ -518,17 +512,26 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
/* Find the uses outside loops. */
find_uses_to_rename (changed_bbs, use_blocks, names_to_rename);
- /* Add the PHI nodes on exits of the loops for the names we need to
- rewrite. */
- add_exit_phis (names_to_rename, use_blocks, loop_exits);
+ if (!bitmap_empty_p (names_to_rename))
+ {
+ /* An array of bitmaps where LOOP_EXITS[I] is the set of basic blocks
+ that are the destination of an edge exiting loop number I. */
+ bitmap *loop_exits = XNEWVEC (bitmap, number_of_loops ());
+ get_loops_exits (loop_exits);
+
+ /* Add the PHI nodes on exits of the loops for the names we need to
+ rewrite. */
+ add_exit_phis (names_to_rename, use_blocks, loop_exits);
+
+ free (loop_exits);
+
+ /* Fix up all the names found to be used outside their original
+ loops. */
+ update_ssa (TODO_update_ssa);
+ }
bitmap_obstack_release (&loop_renamer_obstack);
free (use_blocks);
- free (loop_exits);
-
- /* Fix up all the names found to be used outside their original
- loops. */
- update_ssa (TODO_update_ssa);
}
/* Check invariants of the loop closed ssa form for the USE in BB. */
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index fdfb9e71262..fef6883a13d 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -56,8 +56,8 @@ struct gimple_opt_pass pass_tree_loop =
PROP_cfg, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
- TODO_ggc_collect, /* todo_flags_start */
- TODO_verify_ssa | TODO_ggc_collect /* todo_flags_finish */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
@@ -170,7 +170,7 @@ struct gimple_opt_pass pass_tree_unswitch =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -245,7 +245,7 @@ struct gimple_opt_pass pass_vectorize =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -491,7 +491,7 @@ struct gimple_opt_pass pass_complete_unroll =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -538,8 +538,7 @@ struct gimple_opt_pass pass_complete_unrolli =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_verify_flow
- | TODO_ggc_collect /* todo_flags_finish */
+ TODO_verify_flow /* todo_flags_finish */
}
};
@@ -653,7 +652,7 @@ struct gimple_opt_pass pass_iv_optimize =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_update_ssa | TODO_ggc_collect /* todo_flags_finish */
+ TODO_update_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 2140ced495b..e7e09f6a9de 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2570,6 +2570,24 @@ convert_mult_to_fma (gimple mul_stmt, tree op1, tree op2)
return false;
}
+ /* If the subtrahend (gimple_assign_rhs2 (use_stmt)) is computed
+ by a MULT_EXPR that we'll visit later, we might be able to
+ get a more profitable match with fnma.
+ OTOH, if we don't, a negate / fma pair has likely lower latency
+ that a mult / subtract pair. */
+ if (use_code == MINUS_EXPR && !negate_p
+ && gimple_assign_rhs1 (use_stmt) == result
+ && optab_handler (fms_optab, TYPE_MODE (type)) == CODE_FOR_nothing
+ && optab_handler (fnma_optab, TYPE_MODE (type)) != CODE_FOR_nothing)
+ {
+ tree rhs2 = gimple_assign_rhs2 (use_stmt);
+ gimple stmt2 = SSA_NAME_DEF_STMT (rhs2);
+
+ if (has_single_use (rhs2)
+ && gimple_assign_rhs_code (stmt2) == MULT_EXPR)
+ return false;
+ }
+
/* We can't handle a * b + a * b. */
if (gimple_assign_rhs1 (use_stmt) == gimple_assign_rhs2 (use_stmt))
return false;
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 300016f7a0b..91df10714e5 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -2013,8 +2013,7 @@ struct gimple_opt_pass pass_phiopt =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_verify_ssa
+ TODO_verify_ssa
| TODO_verify_flow
| TODO_verify_stmts /* todo_flags_finish */
}
@@ -2042,8 +2041,7 @@ struct gimple_opt_pass pass_cselim =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_verify_ssa
+ TODO_verify_ssa
| TODO_verify_flow
| TODO_verify_stmts /* todo_flags_finish */
}
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index 4da18148782..6555ae344b7 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -420,8 +420,7 @@ struct gimple_opt_pass pass_phiprop =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_update_ssa
+ TODO_update_ssa
| TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 10c8091758e..798409afa82 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4788,7 +4788,7 @@ struct gimple_opt_pass pass_pre =
0, /* properties_provided */
0, /* properties_destroyed */
TODO_rebuild_alias, /* todo_flags_start */
- TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
@@ -4840,6 +4840,6 @@ struct gimple_opt_pass pass_fre =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 27161cd1860..534c51cdb96 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -4293,7 +4293,6 @@ struct gimple_opt_pass pass_reassoc =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_verify_ssa
- | TODO_verify_flow
- | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 48dae0b9f99..0d9029bc66e 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -597,7 +597,6 @@ struct gimple_opt_pass pass_sink_code =
0, /* todo_flags_start */
TODO_update_ssa
| TODO_verify_ssa
- | TODO_verify_flow
- | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index c8324610914..9c724dc43cb 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -2020,7 +2020,6 @@ struct gimple_opt_pass pass_strlen =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa /* todo_flags_finish */
}
};
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index b7d4b249553..3fffdf7e6cd 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -1477,7 +1477,7 @@ struct gimple_opt_pass pass_convert_switch =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_update_ssa
- | TODO_ggc_collect | TODO_verify_ssa
+ | TODO_verify_ssa
| TODO_verify_stmts
| TODO_verify_flow /* todo_flags_finish */
}
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 188581f6246..1fe5047c70b 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -129,31 +129,6 @@ vect_get_smallest_scalar_type (gimple stmt, HOST_WIDE_INT *lhs_size_unit,
}
-/* Find the place of the data-ref in STMT in the interleaving chain that starts
- from FIRST_STMT. Return -1 if the data-ref is not a part of the chain. */
-
-int
-vect_get_place_in_interleaving_chain (gimple stmt, gimple first_stmt)
-{
- gimple next_stmt = first_stmt;
- int result = 0;
-
- if (first_stmt != GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)))
- return -1;
-
- while (next_stmt && next_stmt != stmt)
- {
- result++;
- next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
- }
-
- if (next_stmt)
- return result;
- else
- return -1;
-}
-
-
/* Check if data references pointed by DR_I and DR_J are same or
belong to same interleaving group. Return FALSE if drs are
different, otherwise return TRUE. */
@@ -280,6 +255,23 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
/* Unknown data dependence. */
if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
{
+ if (STMT_VINFO_GATHER_P (stmtinfo_a)
+ || STMT_VINFO_GATHER_P (stmtinfo_b))
+ {
+ if (dump_enabled_p ())
+ {
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "versioning for alias not supported for: "
+ "can't determine dependence between ");
+ dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
+ DR_REF (dra));
+ dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
+ dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
+ DR_REF (drb));
+ }
+ return false;
+ }
+
if (dump_enabled_p ())
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -299,6 +291,23 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
/* Known data dependence. */
if (DDR_NUM_DIST_VECTS (ddr) == 0)
{
+ if (STMT_VINFO_GATHER_P (stmtinfo_a)
+ || STMT_VINFO_GATHER_P (stmtinfo_b))
+ {
+ if (dump_enabled_p ())
+ {
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "versioning for alias not supported for: "
+ "bad dist vector for ");
+ dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
+ DR_REF (dra));
+ dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
+ dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
+ DR_REF (drb));
+ }
+ return false;
+ }
+
if (dump_enabled_p ())
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -332,14 +341,34 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (drb));
}
- /* For interleaving, mark that there is a read-write dependency if
- necessary. We check before that one of the data-refs is store. */
- if (DR_IS_READ (dra))
- GROUP_READ_WRITE_DEPENDENCE (stmtinfo_a) = true;
- else
- {
- if (DR_IS_READ (drb))
- GROUP_READ_WRITE_DEPENDENCE (stmtinfo_b) = true;
+ /* When we perform grouped accesses and perform implicit CSE
+ by detecting equal accesses and doing disambiguation with
+ runtime alias tests like for
+ .. = a[i];
+ .. = a[i+1];
+ a[i] = ..;
+ a[i+1] = ..;
+ *p = ..;
+ .. = a[i];
+ .. = a[i+1];
+ where we will end up loading { a[i], a[i+1] } once, make
+ sure that inserting group loads before the first load and
+ stores after the last store will do the right thing. */
+ if ((STMT_VINFO_GROUPED_ACCESS (stmtinfo_a)
+ && GROUP_SAME_DR_STMT (stmtinfo_a))
+ || (STMT_VINFO_GROUPED_ACCESS (stmtinfo_b)
+ && GROUP_SAME_DR_STMT (stmtinfo_b)))
+ {
+ gimple earlier_stmt;
+ earlier_stmt = get_earlier_stmt (DR_STMT (dra), DR_STMT (drb));
+ if (DR_IS_WRITE
+ (STMT_VINFO_DATA_REF (vinfo_for_stmt (earlier_stmt))))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "READ_WRITE dependence in interleaving.");
+ return true;
+ }
}
continue;
@@ -450,6 +479,13 @@ vect_slp_analyze_data_ref_dependence (struct data_dependence_relation *ddr)
if (DR_IS_READ (dra) && DR_IS_READ (drb))
return false;
+ /* If dra and drb are part of the same interleaving chain consider
+ them independent. */
+ if (STMT_VINFO_GROUPED_ACCESS (vinfo_for_stmt (DR_STMT (dra)))
+ && (GROUP_FIRST_ELEMENT (vinfo_for_stmt (DR_STMT (dra)))
+ == GROUP_FIRST_ELEMENT (vinfo_for_stmt (DR_STMT (drb)))))
+ return false;
+
/* Unknown data dependence. */
if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
{
@@ -1440,20 +1476,35 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
}
else
{
- /* If we don't know all the misalignment values, we prefer
- peeling for data-ref that has maximum number of data-refs
+ /* If we don't know any misalignment values, we prefer
+ peeling for data-ref that has the 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
- < STMT_VINFO_SAME_ALIGN_REFS (stmt_info).length ()
- || !dr0)
+ unsigned same_align_drs
+ = STMT_VINFO_SAME_ALIGN_REFS (stmt_info).length ();
+ if (!dr0
+ || same_align_drs_max < same_align_drs)
{
- same_align_drs_max
- = STMT_VINFO_SAME_ALIGN_REFS (stmt_info).length ();
+ same_align_drs_max = same_align_drs;
dr0 = dr;
}
+ /* For data-refs with the same number of related
+ accesses prefer the one where the misalign
+ computation will be invariant in the outermost loop. */
+ else if (same_align_drs_max == same_align_drs)
+ {
+ struct loop *ivloop0, *ivloop;
+ ivloop0 = outermost_invariant_loop_for_expr
+ (loop, DR_BASE_ADDRESS (dr0));
+ ivloop = outermost_invariant_loop_for_expr
+ (loop, DR_BASE_ADDRESS (dr));
+ if ((ivloop && !ivloop0)
+ || (ivloop && ivloop0
+ && flow_loop_nested_p (ivloop, ivloop0)))
+ dr0 = dr;
+ }
if (!first_store && DR_IS_WRITE (dr))
first_store = dr;
@@ -1462,8 +1513,6 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
/* 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;
@@ -2068,17 +2117,6 @@ vect_analyze_group_access (struct data_reference *dr)
return false;
}
- /* Check that there is no load-store dependencies for this loads
- to prevent a case of load-store-load to the same location. */
- if (GROUP_READ_WRITE_DEPENDENCE (vinfo_for_stmt (next))
- || GROUP_READ_WRITE_DEPENDENCE (vinfo_for_stmt (prev)))
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "READ_WRITE dependence in interleaving.");
- return false;
- }
-
/* For load use the same data-ref load. */
GROUP_SAME_DR_STMT (vinfo_for_stmt (next)) = prev;
@@ -2775,56 +2813,6 @@ vect_check_gather (gimple stmt, loop_vec_info loop_vinfo, tree *basep,
return decl;
}
-/* Check wether a non-affine load in STMT (being in the loop referred to
- in LOOP_VINFO) is suitable for handling as strided load. That is the case
- if its address is a simple induction variable. If so return the base
- of that induction variable in *BASEP and the (loop-invariant) step
- in *STEPP, both only when that pointer is non-zero.
-
- This handles ARRAY_REFs (with variant index) and MEM_REFs (with variant
- base pointer) only. */
-
-static bool
-vect_check_strided_load (gimple stmt, loop_vec_info loop_vinfo)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
- tree base, off;
- affine_iv iv;
-
- if (!DR_IS_READ (dr))
- return false;
-
- base = DR_REF (dr);
-
- if (TREE_CODE (base) == REALPART_EXPR
- || TREE_CODE (base) == IMAGPART_EXPR)
- base = TREE_OPERAND (base, 0);
-
- if (TREE_CODE (base) == ARRAY_REF)
- {
- off = TREE_OPERAND (base, 1);
- base = TREE_OPERAND (base, 0);
- }
- else if (TREE_CODE (base) == MEM_REF)
- {
- off = TREE_OPERAND (base, 0);
- base = TREE_OPERAND (base, 1);
- }
- else
- return false;
-
- if (TREE_CODE (off) != SSA_NAME)
- return false;
-
- if (!expr_invariant_in_loop_p (loop, base)
- || !simple_iv (loop, loop_containing_stmt (stmt), off, &iv, true))
- return false;
-
- return true;
-}
-
/* Function vect_analyze_data_refs.
Find all the data references in the loop or basic block.
@@ -3215,6 +3203,17 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
}
return false;
}
+ else
+ {
+ if (dump_enabled_p ())
+ {
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "got vectype for stmt: ");
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
+ dump_generic_expr (MSG_NOTE, TDF_SLIM,
+ STMT_VINFO_VECTYPE (stmt_info));
+ }
+ }
/* Adjust the minimal vectorization factor according to the
vector type. */
@@ -3250,10 +3249,8 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
else if (loop_vinfo
&& TREE_CODE (DR_STEP (dr)) != INTEGER_CST)
{
- bool strided_load = false;
- if (!nested_in_vect_loop_p (loop, stmt))
- strided_load = vect_check_strided_load (stmt, loop_vinfo);
- if (!strided_load)
+ if (nested_in_vect_loop_p (loop, stmt)
+ || !DR_IS_READ (dr))
{
if (dump_enabled_p ())
{
@@ -3304,13 +3301,13 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name)
switch (var_kind)
{
case vect_simple_var:
- prefix = "vect_";
+ prefix = "vect";
break;
case vect_scalar_var:
- prefix = "stmp_";
+ prefix = "stmp";
break;
case vect_pointer_var:
- prefix = "vect_p";
+ prefix = "vectp";
break;
default:
gcc_unreachable ();
@@ -3318,7 +3315,7 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name)
if (name)
{
- char* tmp = concat (prefix, name, NULL);
+ char* tmp = concat (prefix, "_", name, NULL);
new_vect_var = create_tmp_reg (type, tmp);
free (tmp);
}
@@ -3572,6 +3569,8 @@ vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop,
dump_generic_expr (MSG_NOTE, TDF_SLIM, aggr_type);
if (TREE_CODE (dr_base_type) == ARRAY_TYPE)
dump_printf (MSG_NOTE, " vectorizing an array ref: ");
+ else if (TREE_CODE (dr_base_type) == VECTOR_TYPE)
+ dump_printf (MSG_NOTE, " vectorizing a vector ref: ");
else if (TREE_CODE (dr_base_type) == RECORD_TYPE)
dump_printf (MSG_NOTE, " vectorizing a record based array ref: ");
else
@@ -3845,7 +3844,8 @@ tree
vect_create_destination_var (tree scalar_dest, tree vectype)
{
tree vec_dest;
- const char *new_name;
+ const char *name;
+ char *new_name;
tree type;
enum vect_var_kind kind;
@@ -3854,10 +3854,13 @@ vect_create_destination_var (tree scalar_dest, tree vectype)
gcc_assert (TREE_CODE (scalar_dest) == SSA_NAME);
- new_name = get_name (scalar_dest);
- if (!new_name)
- new_name = "var_";
+ name = get_name (scalar_dest);
+ if (name)
+ asprintf (&new_name, "%s_%u", name, SSA_NAME_VERSION (scalar_dest));
+ else
+ asprintf (&new_name, "_%u", SSA_NAME_VERSION (scalar_dest));
vec_dest = vect_get_new_vect_var (type, kind, new_name);
+ free (new_name);
return vec_dest;
}
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index b0120a9d4de..bff5c22130e 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -1236,8 +1236,8 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
same frequencies. Loop exit probablities are however easy to get wrong.
It is safer to copy value from original loop entry. */
bb_before_second_loop->frequency
- = apply_probability (bb_before_first_loop->frequency,
- probability_of_second_loop);
+ = combine_probabilities (bb_before_first_loop->frequency,
+ probability_of_second_loop);
bb_before_second_loop->count
= apply_probability (bb_before_first_loop->count,
probability_of_second_loop);
@@ -2476,11 +2476,11 @@ vect_loop_versioning (loop_vec_info loop_vinfo,
/* End loop-exit-fixes after versioning. */
- update_ssa (TODO_update_ssa);
if (cond_expr_stmt_list)
{
cond_exp_gsi = gsi_last_bb (condition_bb);
gsi_insert_seq_before (&cond_exp_gsi, cond_expr_stmt_list,
GSI_SAME_STMT);
}
+ update_ssa (TODO_update_ssa);
}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 6048609323d..d7a86bfd7b2 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -483,6 +483,12 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
}
}
STMT_VINFO_VECTYPE (stmt_info) = vectype;
+
+ if (dump_enabled_p ())
+ {
+ dump_printf_loc (MSG_NOTE, vect_location, "vectype: ");
+ dump_generic_expr (MSG_NOTE, TDF_SLIM, vectype);
+ }
}
/* The vectorization factor is according to the smallest
@@ -3467,30 +3473,36 @@ get_initial_def_for_induction (gimple iv_phi)
}
vec_alloc (v, nunits);
+ bool constant_p = is_gimple_min_invariant (new_name);
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, new_name);
for (i = 1; i < nunits; i++)
{
/* Create: new_name_i = new_name + step_expr */
enum tree_code code = POINTER_TYPE_P (scalar_type)
? POINTER_PLUS_EXPR : PLUS_EXPR;
- init_stmt = gimple_build_assign_with_ops (code, new_var,
- new_name, step_expr);
- new_name = make_ssa_name (new_var, init_stmt);
- gimple_assign_set_lhs (init_stmt, new_name);
-
- new_bb = gsi_insert_on_edge_immediate (pe, init_stmt);
- gcc_assert (!new_bb);
-
- if (dump_enabled_p ())
+ new_name = fold_build2 (code, scalar_type, new_name, step_expr);
+ if (!is_gimple_min_invariant (new_name))
{
- dump_printf_loc (MSG_NOTE, vect_location,
- "created new init_stmt: ");
- dump_gimple_stmt (MSG_NOTE, TDF_SLIM, init_stmt, 0);
+ init_stmt = gimple_build_assign (new_var, new_name);
+ new_name = make_ssa_name (new_var, init_stmt);
+ gimple_assign_set_lhs (init_stmt, new_name);
+ new_bb = gsi_insert_on_edge_immediate (pe, init_stmt);
+ gcc_assert (!new_bb);
+ if (dump_enabled_p ())
+ {
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "created new init_stmt: ");
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, init_stmt, 0);
+ }
+ constant_p = false;
}
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, new_name);
}
/* Create a vector from [new_name_0, new_name_1, ..., new_name_nunits-1] */
- new_vec = build_constructor (vectype, v);
+ if (constant_p)
+ new_vec = build_vector_from_ctor (vectype, v);
+ else
+ new_vec = build_constructor (vectype, v);
vec_init = vect_init_vector (iv_phi, new_vec, vectype, NULL);
}
@@ -6006,7 +6018,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
slpeel_make_loop_iterate_ntimes (loop, ratio);
/* Reduce loop iterations by the vectorization factor. */
- scale_loop_profile (loop, RDIV (REG_BR_PROB_BASE , vectorization_factor),
+ scale_loop_profile (loop, GCOV_COMPUTE_SCALE (1, vectorization_factor),
expected_iterations / vectorization_factor);
loop->nb_iterations_upper_bound
= loop->nb_iterations_upper_bound.udiv (double_int::from_uhwi (vectorization_factor),
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index e925f57a2f5..108a87a27ee 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -67,13 +67,13 @@ static void
vect_free_slp_tree (slp_tree node)
{
int i;
- slp_void_p child;
+ slp_tree child;
if (!node)
return;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_free_slp_tree ((slp_tree) child);
+ vect_free_slp_tree (child);
SLP_TREE_CHILDREN (node).release ();
SLP_TREE_SCALAR_STMTS (node).release ();
@@ -140,8 +140,7 @@ vect_create_oprnd_info (int nops, int group_size)
oprnd_info = XNEW (struct _slp_oprnd_info);
oprnd_info->def_stmts.create (group_size);
oprnd_info->first_dt = vect_uninitialized_def;
- oprnd_info->first_def_type = NULL_TREE;
- oprnd_info->first_const_oprnd = NULL_TREE;
+ oprnd_info->first_op_type = NULL_TREE;
oprnd_info->first_pattern = false;
oprnds_info.quick_push (oprnd_info);
}
@@ -168,31 +167,48 @@ vect_free_oprnd_info (vec<slp_oprnd_info> &oprnds_info)
}
+/* Find the place of the data-ref in STMT in the interleaving chain that starts
+ from FIRST_STMT. Return -1 if the data-ref is not a part of the chain. */
+
+static int
+vect_get_place_in_interleaving_chain (gimple stmt, gimple first_stmt)
+{
+ gimple next_stmt = first_stmt;
+ int result = 0;
+
+ if (first_stmt != GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)))
+ return -1;
+
+ do
+ {
+ if (next_stmt == stmt)
+ return result;
+ result++;
+ next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
+ }
+ while (next_stmt);
+
+ return -1;
+}
+
+
/* Get the defs for the rhs of STMT (collect them in OPRNDS_INFO), check that
they are of a valid type and that they match the defs of the first stmt of
the SLP group (stored in OPRNDS_INFO). */
static bool
vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
- slp_tree slp_node, gimple stmt,
- int ncopies_for_cost, bool first,
- vec<slp_oprnd_info> *oprnds_info,
- stmt_vector_for_cost *prologue_cost_vec,
- stmt_vector_for_cost *body_cost_vec)
+ gimple stmt, bool first,
+ vec<slp_oprnd_info> *oprnds_info)
{
tree oprnd;
unsigned int i, number_of_oprnds;
- tree def, def_op0 = NULL_TREE;
+ tree def;
gimple def_stmt;
enum vect_def_type dt = vect_uninitialized_def;
- enum vect_def_type dt_op0 = vect_uninitialized_def;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree lhs = gimple_get_lhs (stmt);
struct loop *loop = NULL;
- enum tree_code rhs_code;
- bool different_types = false;
bool pattern = false;
- slp_oprnd_info oprnd_info, oprnd0_info, oprnd1_info;
+ slp_oprnd_info oprnd_info;
int op_idx = 1;
tree compare_rhs = NULL_TREE;
@@ -304,38 +320,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
{
oprnd_info->first_dt = dt;
oprnd_info->first_pattern = pattern;
- if (def)
- {
- oprnd_info->first_def_type = TREE_TYPE (def);
- oprnd_info->first_const_oprnd = NULL_TREE;
- }
- else
- {
- oprnd_info->first_def_type = NULL_TREE;
- oprnd_info->first_const_oprnd = oprnd;
- }
-
- if (i == 0)
- {
- def_op0 = def;
- dt_op0 = dt;
- /* Analyze costs (for the first stmt of the group only). */
- if (REFERENCE_CLASS_P (lhs))
- /* Store. */
- vect_model_store_cost (stmt_info, ncopies_for_cost, false,
- dt, slp_node, prologue_cost_vec,
- body_cost_vec);
- else
- {
- enum vect_def_type dts[2];
- dts[0] = dt;
- dts[1] = vect_uninitialized_def;
- /* Not memory operation (we don't call this function for
- loads). */
- vect_model_simple_cost (stmt_info, ncopies_for_cost, dts,
- prologue_cost_vec, body_cost_vec);
- }
- }
+ oprnd_info->first_op_type = TREE_TYPE (oprnd);
}
else
{
@@ -346,64 +331,19 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
vect_internal_def. */
if (((oprnd_info->first_dt != dt
&& !(oprnd_info->first_dt == vect_reduction_def
- && dt == vect_internal_def))
- || (oprnd_info->first_def_type != NULL_TREE
- && def
- && !types_compatible_p (oprnd_info->first_def_type,
- TREE_TYPE (def))))
- || (!def
- && !types_compatible_p (TREE_TYPE (oprnd_info->first_const_oprnd),
- TREE_TYPE (oprnd)))
- || different_types)
+ && dt == vect_internal_def)
+ && !((oprnd_info->first_dt == vect_external_def
+ || oprnd_info->first_dt == vect_constant_def)
+ && (dt == vect_external_def
+ || dt == vect_constant_def)))
+ || !types_compatible_p (oprnd_info->first_op_type,
+ TREE_TYPE (oprnd))))
{
- if (number_of_oprnds != 2)
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "Build SLP failed: different types ");
-
- return false;
- }
-
- /* Try to swap operands in case of binary operation. */
- if (i == 0)
- different_types = true;
- else
- {
- oprnd0_info = (*oprnds_info)[0];
- if (is_gimple_assign (stmt)
- && (rhs_code = gimple_assign_rhs_code (stmt))
- && TREE_CODE_CLASS (rhs_code) == tcc_binary
- && commutative_tree_code (rhs_code)
- && oprnd0_info->first_dt == dt
- && oprnd_info->first_dt == dt_op0
- && def_op0 && def
- && !(oprnd0_info->first_def_type
- && !types_compatible_p (oprnd0_info->first_def_type,
- TREE_TYPE (def)))
- && !(oprnd_info->first_def_type
- && !types_compatible_p (oprnd_info->first_def_type,
- TREE_TYPE (def_op0))))
- {
- if (dump_enabled_p ())
- {
- dump_printf_loc (MSG_NOTE, vect_location,
- "Swapping operands of ");
- dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
- }
-
- swap_tree_operands (stmt, gimple_assign_rhs1_ptr (stmt),
- gimple_assign_rhs2_ptr (stmt));
- }
- else
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "Build SLP failed: different types ");
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "Build SLP failed: different types ");
- return false;
- }
- }
+ return false;
}
}
@@ -416,18 +356,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
break;
case vect_internal_def:
- if (different_types)
- {
- oprnd0_info = (*oprnds_info)[0];
- oprnd1_info = (*oprnds_info)[0];
- if (i == 0)
- oprnd1_info->def_stmts.quick_push (def_stmt);
- else
- oprnd0_info->def_stmts.quick_push (def_stmt);
- }
- else
- oprnd_info->def_stmts.quick_push (def_stmt);
-
+ oprnd_info->def_stmts.quick_push (def_stmt);
break;
default:
@@ -454,13 +383,10 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
static bool
vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
- slp_tree *node, unsigned int group_size, int *outside_cost,
- int ncopies_for_cost, unsigned int *max_nunits,
- vec<int> *load_permutation,
+ slp_tree *node, unsigned int group_size,
+ unsigned int *max_nunits,
vec<slp_tree> *loads,
- unsigned int vectorization_factor, bool *loads_permuted,
- stmt_vector_for_cost *prologue_cost_vec,
- stmt_vector_for_cost *body_cost_vec)
+ unsigned int vectorization_factor)
{
unsigned int i;
vec<gimple> stmts = SLP_TREE_SCALAR_STMTS (*node);
@@ -470,15 +396,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
tree lhs;
bool stop_recursion = false, need_same_oprnds = false;
tree vectype, scalar_type, first_op1 = NULL_TREE;
- unsigned int ncopies;
optab optab;
int icode;
enum machine_mode optab_op2_mode;
enum machine_mode vec_mode;
struct data_reference *first_dr;
HOST_WIDE_INT dummy;
- bool permutation = false;
- unsigned int load_place;
gimple first_load = NULL, prev_first_load = NULL, old_first_load = NULL;
vec<slp_oprnd_info> oprnds_info;
unsigned int nops;
@@ -577,8 +500,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
vectorization_factor = *max_nunits;
}
- ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
-
if (is_gimple_call (stmt))
{
rhs_code = CALL_EXPR;
@@ -667,6 +588,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|| rhs_code != IMAGPART_EXPR)
&& !(STMT_VINFO_GROUPED_ACCESS (vinfo_for_stmt (stmt))
&& (first_stmt_code == ARRAY_REF
+ || first_stmt_code == BIT_FIELD_REF
|| first_stmt_code == INDIRECT_REF
|| first_stmt_code == COMPONENT_REF
|| first_stmt_code == MEM_REF)))
@@ -727,11 +649,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (REFERENCE_CLASS_P (lhs))
{
/* Store. */
- if (!vect_get_and_check_slp_defs (loop_vinfo, bb_vinfo, *node,
- stmt, ncopies_for_cost,
- (i == 0), &oprnds_info,
- prologue_cost_vec,
- body_cost_vec))
+ if (!vect_get_and_check_slp_defs (loop_vinfo, bb_vinfo,
+ stmt, (i == 0), &oprnds_info))
{
vect_free_oprnd_info (oprnds_info);
return false;
@@ -740,12 +659,15 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
else
{
/* Load. */
+ unsigned unrolling_factor
+ = least_common_multiple
+ (*max_nunits, group_size) / group_size;
/* FORNOW: Check that there is no gap between the loads
and no gap between the groups when we need to load
multiple groups at once.
??? We should enhance this to only disallow gaps
inside vectors. */
- if ((ncopies > 1
+ if ((unrolling_factor > 1
&& GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt
&& GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
|| (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt
@@ -766,6 +688,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
/* Check that the size of interleaved loads group is not
greater than the SLP group size. */
+ unsigned ncopies
+ = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
if (loop_vinfo
&& GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt
&& ((GROUP_SIZE (vinfo_for_stmt (stmt))
@@ -835,23 +759,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
vect_free_oprnd_info (oprnds_info);
return false;
}
-
- /* Analyze costs (for the first stmt in the group). */
- vect_model_load_cost (vinfo_for_stmt (stmt),
- ncopies_for_cost, false, *node,
- prologue_cost_vec, body_cost_vec);
}
- /* Store the place of this load in the interleaving chain. In
- case that permutation is needed we later decide if a specific
- permutation is supported. */
- load_place = vect_get_place_in_interleaving_chain (stmt,
- first_load);
- if (load_place != i)
- permutation = true;
-
- load_permutation->safe_push (load_place);
-
/* We stop the tree when we reach a group of loads. */
stop_recursion = true;
continue;
@@ -915,10 +824,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
}
/* Find the def-stmts. */
- if (!vect_get_and_check_slp_defs (loop_vinfo, bb_vinfo, *node, stmt,
- ncopies_for_cost, (i == 0),
- &oprnds_info, prologue_cost_vec,
- body_cost_vec))
+ if (!vect_get_and_check_slp_defs (loop_vinfo, bb_vinfo, stmt,
+ (i == 0), &oprnds_info))
{
vect_free_oprnd_info (oprnds_info);
return false;
@@ -930,22 +837,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (stop_recursion)
{
loads->safe_push (*node);
- if (permutation)
- {
- gimple first_stmt = stmts[0];
- *loads_permuted = true;
- (void) record_stmt_cost (body_cost_vec, group_size, vec_perm,
- vinfo_for_stmt (first_stmt), 0, vect_body);
- }
- else
- {
- /* We don't check here complex numbers chains, so we set
- LOADS_PERMUTED for further check in
- vect_supported_load_permutation_p. */
- if (rhs_code == REALPART_EXPR || rhs_code == IMAGPART_EXPR)
- *loads_permuted = true;
- }
-
vect_free_oprnd_info (oprnds_info);
return true;
}
@@ -961,10 +852,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
child = vect_create_new_slp_node (oprnd_info->def_stmts);
if (!child
|| !vect_build_slp_tree (loop_vinfo, bb_vinfo, &child, group_size,
- outside_cost, ncopies_for_cost,
- max_nunits, load_permutation, loads,
- vectorization_factor, loads_permuted,
- prologue_cost_vec, body_cost_vec))
+ max_nunits, loads,
+ vectorization_factor))
{
if (child)
oprnd_info->def_stmts = vNULL;
@@ -988,7 +877,7 @@ vect_print_slp_tree (int dump_kind, slp_tree node)
{
int i;
gimple stmt;
- slp_void_p child;
+ slp_tree child;
if (!node)
return;
@@ -1002,7 +891,7 @@ vect_print_slp_tree (int dump_kind, slp_tree node)
dump_printf (dump_kind, "\n");
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_print_slp_tree (dump_kind, (slp_tree) child);
+ vect_print_slp_tree (dump_kind, child);
}
@@ -1016,7 +905,7 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
{
int i;
gimple stmt;
- slp_void_p child;
+ slp_tree child;
if (!node)
return;
@@ -1026,7 +915,7 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
STMT_SLP_TYPE (vinfo_for_stmt (stmt)) = mark;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_mark_slp_stmts ((slp_tree) child, mark, j);
+ vect_mark_slp_stmts (child, mark, j);
}
@@ -1038,7 +927,7 @@ vect_mark_slp_stmts_relevant (slp_tree node)
int i;
gimple stmt;
stmt_vec_info stmt_info;
- slp_void_p child;
+ slp_tree child;
if (!node)
return;
@@ -1052,7 +941,7 @@ vect_mark_slp_stmts_relevant (slp_tree node)
}
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_mark_slp_stmts_relevant ((slp_tree) child);
+ vect_mark_slp_stmts_relevant (child);
}
@@ -1126,26 +1015,18 @@ vect_slp_rearrange_stmts (slp_tree node, unsigned int group_size,
{
gimple stmt;
vec<gimple> tmp_stmts;
- unsigned int index, i;
- slp_void_p child;
-
- if (!node)
- return;
+ unsigned int i;
+ slp_tree child;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_slp_rearrange_stmts ((slp_tree) child, group_size, permutation);
+ vect_slp_rearrange_stmts (child, group_size, permutation);
gcc_assert (group_size == SLP_TREE_SCALAR_STMTS (node).length ());
tmp_stmts.create (group_size);
-
- for (i = 0; i < group_size; i++)
- tmp_stmts.safe_push (NULL);
+ tmp_stmts.quick_grow_cleared (group_size);
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt)
- {
- index = permutation[i];
- tmp_stmts[index] = stmt;
- }
+ tmp_stmts[permutation[i]] = stmt;
SLP_TREE_SCALAR_STMTS (node).release ();
SLP_TREE_SCALAR_STMTS (node) = tmp_stmts;
@@ -1490,6 +1371,122 @@ vect_find_last_store_in_slp_instance (slp_instance instance)
return last_store;
}
+/* Compute the cost for the SLP node NODE in the SLP instance INSTANCE. */
+
+static void
+vect_analyze_slp_cost_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
+ slp_instance instance, slp_tree node,
+ stmt_vector_for_cost *prologue_cost_vec,
+ unsigned ncopies_for_cost)
+{
+ stmt_vector_for_cost *body_cost_vec = &SLP_INSTANCE_BODY_COST_VEC (instance);
+
+ unsigned i;
+ slp_tree child;
+ gimple stmt, s;
+ stmt_vec_info stmt_info;
+ tree lhs;
+ unsigned group_size = SLP_INSTANCE_GROUP_SIZE (instance);
+
+ /* Recurse down the SLP tree. */
+ FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
+ vect_analyze_slp_cost_1 (loop_vinfo, bb_vinfo,
+ instance, child, prologue_cost_vec,
+ ncopies_for_cost);
+
+ /* Look at the first scalar stmt to determine the cost. */
+ stmt = SLP_TREE_SCALAR_STMTS (node)[0];
+ stmt_info = vinfo_for_stmt (stmt);
+ if (STMT_VINFO_GROUPED_ACCESS (stmt_info))
+ {
+ if (DR_IS_WRITE (STMT_VINFO_DATA_REF (stmt_info)))
+ vect_model_store_cost (stmt_info, ncopies_for_cost, false,
+ vect_uninitialized_def,
+ node, prologue_cost_vec, body_cost_vec);
+ else
+ {
+ int i;
+ gcc_checking_assert (DR_IS_READ (STMT_VINFO_DATA_REF (stmt_info)));
+ vect_model_load_cost (stmt_info, ncopies_for_cost, false,
+ node, prologue_cost_vec, body_cost_vec);
+ /* If the load is permuted record the cost for the permutation.
+ ??? Loads from multiple chains are let through here only
+ for a single special case involving complex numbers where
+ in the end no permutation is necessary. */
+ FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, s)
+ if ((STMT_VINFO_GROUP_FIRST_ELEMENT (vinfo_for_stmt (s))
+ == STMT_VINFO_GROUP_FIRST_ELEMENT (stmt_info))
+ && vect_get_place_in_interleaving_chain
+ (s, STMT_VINFO_GROUP_FIRST_ELEMENT (stmt_info)) != i)
+ {
+ record_stmt_cost (body_cost_vec, group_size, vec_perm,
+ stmt_info, 0, vect_body);
+ break;
+ }
+ }
+ }
+ else
+ record_stmt_cost (body_cost_vec, ncopies_for_cost, vector_stmt,
+ stmt_info, 0, vect_body);
+
+ /* Scan operands and account for prologue cost of constants/externals.
+ ??? This over-estimates cost for multiple uses and should be
+ re-engineered. */
+ lhs = gimple_get_lhs (stmt);
+ for (i = 0; i < gimple_num_ops (stmt); ++i)
+ {
+ tree def, op = gimple_op (stmt, i);
+ gimple def_stmt;
+ enum vect_def_type dt;
+ if (!op || op == lhs)
+ continue;
+ if (vect_is_simple_use (op, NULL, loop_vinfo, bb_vinfo,
+ &def_stmt, &def, &dt)
+ && (dt == vect_constant_def || dt == vect_external_def))
+ record_stmt_cost (prologue_cost_vec, 1, vector_stmt,
+ stmt_info, 0, vect_prologue);
+ }
+}
+
+/* Compute the cost for the SLP instance INSTANCE. */
+
+static void
+vect_analyze_slp_cost (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
+ slp_instance instance, unsigned nunits)
+{
+ stmt_vector_for_cost body_cost_vec, prologue_cost_vec;
+ unsigned ncopies_for_cost;
+ stmt_info_for_cost *si;
+ unsigned i;
+
+ /* Calculate the number of vector stmts to create based on the unrolling
+ factor (number of vectors is 1 if NUNITS >= GROUP_SIZE, and is
+ GROUP_SIZE / NUNITS otherwise. */
+ unsigned group_size = SLP_INSTANCE_GROUP_SIZE (instance);
+ ncopies_for_cost = least_common_multiple (nunits, group_size) / nunits;
+
+ prologue_cost_vec.create (10);
+ body_cost_vec.create (10);
+ SLP_INSTANCE_BODY_COST_VEC (instance) = body_cost_vec;
+ vect_analyze_slp_cost_1 (loop_vinfo, bb_vinfo,
+ instance, SLP_INSTANCE_TREE (instance),
+ &prologue_cost_vec, ncopies_for_cost);
+
+ /* Record the prologue costs, which were delayed until we were
+ sure that SLP was successful. Unlike the body costs, we know
+ the final values now regardless of the loop vectorization factor. */
+ void *data = (loop_vinfo ? LOOP_VINFO_TARGET_COST_DATA (loop_vinfo)
+ : BB_VINFO_TARGET_COST_DATA (bb_vinfo));
+ FOR_EACH_VEC_ELT (prologue_cost_vec, i, si)
+ {
+ struct _stmt_vec_info *stmt_info
+ = si->stmt ? vinfo_for_stmt (si->stmt) : NULL;
+ (void) add_stmt_cost (data, si->count, si->kind, stmt_info,
+ si->misalign, vect_prologue);
+ }
+
+ prologue_cost_vec.release ();
+}
/* Analyze an SLP instance starting from a group of grouped stores. Call
vect_build_slp_tree to build a tree of packed stmts if possible.
@@ -1506,15 +1503,11 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
tree vectype, scalar_type = NULL_TREE;
gimple next;
unsigned int vectorization_factor = 0;
- int outside_cost = 0, ncopies_for_cost, i;
+ int i;
unsigned int max_nunits = 0;
- vec<int> load_permutation;
vec<slp_tree> loads;
struct data_reference *dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt));
- bool loads_permuted = false;
vec<gimple> scalar_stmts;
- stmt_vector_for_cost body_cost_vec, prologue_cost_vec;
- stmt_info_for_cost *si;
if (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)))
{
@@ -1595,26 +1588,13 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
node = vect_create_new_slp_node (scalar_stmts);
- /* Calculate the number of vector stmts to create based on the unrolling
- factor (number of vectors is 1 if NUNITS >= GROUP_SIZE, and is
- GROUP_SIZE / NUNITS otherwise. */
- ncopies_for_cost = unrolling_factor * group_size / nunits;
-
- load_permutation.create (group_size * group_size);
loads.create (group_size);
- prologue_cost_vec.create (10);
- body_cost_vec.create (10);
/* Build the tree for the SLP instance. */
if (vect_build_slp_tree (loop_vinfo, bb_vinfo, &node, group_size,
- &outside_cost, ncopies_for_cost,
- &max_nunits, &load_permutation, &loads,
- vectorization_factor, &loads_permuted,
- &prologue_cost_vec, &body_cost_vec))
+ &max_nunits, &loads,
+ vectorization_factor))
{
- void *data = (loop_vinfo ? LOOP_VINFO_TARGET_COST_DATA (loop_vinfo)
- : BB_VINFO_TARGET_COST_DATA (bb_vinfo));
-
/* Calculate the unrolling factor based on the smallest type. */
if (max_nunits > nunits)
unrolling_factor = least_common_multiple (max_nunits, group_size)
@@ -1627,9 +1607,6 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
"Build SLP failed: unrolling required in basic"
" block SLP");
vect_free_slp_tree (node);
- body_cost_vec.release ();
- prologue_cost_vec.release ();
- load_permutation.release ();
loads.release ();
return false;
}
@@ -1639,13 +1616,40 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
SLP_INSTANCE_TREE (new_instance) = node;
SLP_INSTANCE_GROUP_SIZE (new_instance) = group_size;
SLP_INSTANCE_UNROLLING_FACTOR (new_instance) = unrolling_factor;
- SLP_INSTANCE_BODY_COST_VEC (new_instance) = body_cost_vec;
+ SLP_INSTANCE_BODY_COST_VEC (new_instance) = vNULL;
SLP_INSTANCE_LOADS (new_instance) = loads;
SLP_INSTANCE_FIRST_LOAD_STMT (new_instance) = NULL;
- SLP_INSTANCE_LOAD_PERMUTATION (new_instance) = load_permutation;
+ SLP_INSTANCE_LOAD_PERMUTATION (new_instance) = vNULL;
+
+ /* Compute the load permutation. */
+ slp_tree load_node;
+ bool loads_permuted = false;
+ vec<int> load_permutation;
+ load_permutation.create (group_size * group_size);
+ FOR_EACH_VEC_ELT (loads, i, load_node)
+ {
+ int j;
+ gimple load;
+ FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (load_node), j, load)
+ {
+ int load_place;
+ load_place = vect_get_place_in_interleaving_chain
+ (load, GROUP_FIRST_ELEMENT (vinfo_for_stmt (load)));
+ if (load_place != j
+ /* ??? We allow loads from different groups to
+ get to here for a special case handled in
+ the permutation code. Make sure we get to that. */
+ || (GROUP_FIRST_ELEMENT
+ (vinfo_for_stmt (SLP_TREE_SCALAR_STMTS (load_node)[0]))
+ != GROUP_FIRST_ELEMENT (vinfo_for_stmt (load))))
+ loads_permuted = true;
+ load_permutation.safe_push (load_place);
+ }
+ }
if (loads_permuted)
{
+ SLP_INSTANCE_LOAD_PERMUTATION (new_instance) = load_permutation;
if (!vect_supported_load_permutation_p (new_instance, group_size,
load_permutation))
{
@@ -1658,7 +1662,6 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
}
vect_free_slp_instance (new_instance);
- prologue_cost_vec.release ();
return false;
}
@@ -1666,20 +1669,11 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
= vect_find_first_load_in_slp_instance (new_instance);
}
else
- SLP_INSTANCE_LOAD_PERMUTATION (new_instance).release ();
+ load_permutation.release ();
- /* Record the prologue costs, which were delayed until we were
- sure that SLP was successful. Unlike the body costs, we know
- the final values now regardless of the loop vectorization factor. */
- FOR_EACH_VEC_ELT (prologue_cost_vec, i, si)
- {
- struct _stmt_vec_info *stmt_info
- = si->stmt ? vinfo_for_stmt (si->stmt) : NULL;
- (void) add_stmt_cost (data, si->count, si->kind, stmt_info,
- si->misalign, vect_prologue);
- }
-
- prologue_cost_vec.release ();
+ /* Compute the costs of this SLP instance. */
+ vect_analyze_slp_cost (loop_vinfo, bb_vinfo,
+ new_instance, TYPE_VECTOR_SUBPARTS (vectype));
if (loop_vinfo)
LOOP_VINFO_SLP_INSTANCES (loop_vinfo).safe_push (new_instance);
@@ -1691,16 +1685,10 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
return true;
}
- else
- {
- body_cost_vec.release ();
- prologue_cost_vec.release ();
- }
/* Failed to SLP. */
/* Free the allocated memory. */
vect_free_slp_tree (node);
- load_permutation.release ();
loads.release ();
return false;
@@ -1821,7 +1809,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node)
imm_use_iterator imm_iter;
gimple use_stmt;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
- slp_void_p child;
+ slp_tree child;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
struct loop *loop = NULL;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo);
@@ -1852,7 +1840,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node)
vect_mark_slp_stmts (node, hybrid, i);
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_detect_hybrid_slp_stmts ((slp_tree) child);
+ vect_detect_hybrid_slp_stmts (child);
}
@@ -1950,13 +1938,13 @@ vect_slp_analyze_node_operations (bb_vec_info bb_vinfo, slp_tree node)
bool dummy;
int i;
gimple stmt;
- slp_void_p child;
+ slp_tree child;
if (!node)
return true;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- if (!vect_slp_analyze_node_operations (bb_vinfo, (slp_tree) child))
+ if (!vect_slp_analyze_node_operations (bb_vinfo, child))
return false;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt)
@@ -2472,7 +2460,7 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
the lhs, so make sure the scalar is the right type if
we are dealing with vectors of
long long/long/short/char. */
- if (op_num == 1 && constant_p)
+ if (op_num == 1 && TREE_CODE (op) == INTEGER_CST)
op = fold_convert (TREE_TYPE (vector_type), op);
break;
@@ -2505,7 +2493,7 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
number_of_places_left_in_vector--;
if (!types_compatible_p (TREE_TYPE (vector_type), TREE_TYPE (op)))
{
- if (constant_p)
+ if (CONSTANT_CLASS_P (op))
{
op = fold_unary (VIEW_CONVERT_EXPR,
TREE_TYPE (vector_type), op);
@@ -2526,6 +2514,8 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
}
}
elts[number_of_places_left_in_vector] = op;
+ if (!CONSTANT_CLASS_P (op))
+ constant_p = false;
if (number_of_places_left_in_vector == 0)
{
@@ -3011,14 +3001,13 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance,
tree vectype;
int i;
slp_tree loads_node;
- slp_void_p child;
+ slp_tree child;
if (!node)
return false;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_schedule_slp_instance ((slp_tree) child, instance,
- vectorization_factor);
+ vect_schedule_slp_instance (child, instance, vectorization_factor);
stmt = SLP_TREE_SCALAR_STMTS (node)[0];
stmt_info = vinfo_for_stmt (stmt);
@@ -3108,7 +3097,7 @@ vect_remove_slp_scalar_calls (slp_tree node)
gimple stmt, new_stmt;
gimple_stmt_iterator gsi;
int i;
- slp_void_p child;
+ slp_tree child;
tree lhs;
stmt_vec_info stmt_info;
@@ -3116,7 +3105,7 @@ vect_remove_slp_scalar_calls (slp_tree node)
return;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- vect_remove_slp_scalar_calls ((slp_tree) child);
+ vect_remove_slp_scalar_calls (child);
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt)
{
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 05af5d6beeb..385e96437e3 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -4098,6 +4098,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
&& is_pattern_stmt_p (stmt_info))
scalar_dest = TREE_OPERAND (scalar_dest, 0);
if (TREE_CODE (scalar_dest) != ARRAY_REF
+ && TREE_CODE (scalar_dest) != BIT_FIELD_REF
&& TREE_CODE (scalar_dest) != INDIRECT_REF
&& TREE_CODE (scalar_dest) != COMPONENT_REF
&& TREE_CODE (scalar_dest) != IMAGPART_EXPR
@@ -4632,6 +4633,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
code = gimple_assign_rhs_code (stmt);
if (code != ARRAY_REF
+ && code != BIT_FIELD_REF
&& code != INDIRECT_REF
&& code != COMPONENT_REF
&& code != IMAGPART_EXPR
@@ -6207,7 +6209,6 @@ new_stmt_vec_info (gimple stmt, loop_vec_info loop_vinfo,
GROUP_STORE_COUNT (res) = 0;
GROUP_GAP (res) = 0;
GROUP_SAME_DR_STMT (res) = NULL;
- GROUP_READ_WRITE_DEPENDENCE (res) = false;
return res;
}
@@ -6339,30 +6340,10 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
return NULL_TREE;
vectype = build_vector_type (scalar_type, nunits);
- if (dump_enabled_p ())
- {
- dump_printf_loc (MSG_NOTE, vect_location,
- "get vectype with %d units of type ", nunits);
- dump_generic_expr (MSG_NOTE, TDF_SLIM, scalar_type);
- }
-
- if (!vectype)
- return NULL_TREE;
-
- if (dump_enabled_p ())
- {
- dump_printf_loc (MSG_NOTE, vect_location, "vectype: ");
- dump_generic_expr (MSG_NOTE, TDF_SLIM, vectype);
- }
if (!VECTOR_MODE_P (TYPE_MODE (vectype))
&& !INTEGRAL_MODE_P (TYPE_MODE (vectype)))
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "mode not supported by target.");
- return NULL_TREE;
- }
+ return NULL_TREE;
return vectype;
}
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 67aeb4ae9b9..23b12dae55a 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -221,8 +221,7 @@ struct gimple_opt_pass pass_slp_vectorize =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect
- | TODO_verify_ssa
+ TODO_verify_ssa
| TODO_update_ssa
| TODO_verify_stmts /* todo_flags_finish */
}
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index c75a8b56274..b7d2a49212e 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -97,13 +97,13 @@ add_stmt_info_to_vec (stmt_vector_for_cost *stmt_cost_vec, int count,
/************************************************************************
SLP
************************************************************************/
-typedef void *slp_void_p;
+typedef struct _slp_tree *slp_tree;
/* A computation tree of an SLP instance. Each node corresponds to a group of
stmts to be packed in a SIMD stmt. */
-typedef struct _slp_tree {
+struct _slp_tree {
/* Nodes that contain def-stmts of this node statements operands. */
- vec<slp_void_p> children;
+ vec<slp_tree> children;
/* A group of scalar stmts to be vectorized together. */
vec<gimple> stmts;
/* Vectorized stmt/s. */
@@ -113,7 +113,7 @@ typedef struct _slp_tree {
scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF
divided by vector size. */
unsigned int vec_stmts_size;
-} *slp_tree;
+};
/* SLP instance is a sequence of stmts in a loop that can be packed into
@@ -169,8 +169,7 @@ typedef struct _slp_oprnd_info
operand itself in case it's constant, and an indication if it's a pattern
stmt. */
enum vect_def_type first_dt;
- tree first_def_type;
- tree first_const_oprnd;
+ tree first_op_type;
bool first_pattern;
} *slp_oprnd_info;
@@ -461,10 +460,6 @@ typedef struct _stmt_vec_info {
/* Stmt is part of some pattern (computation idiom) */
bool in_pattern_p;
- /* For loads only, if there is a store with the same location, this field is
- TRUE. */
- bool read_write_dep;
-
/* The stmt to which this info struct refers to. */
gimple stmt;
@@ -590,7 +585,6 @@ typedef struct _stmt_vec_info {
#define STMT_VINFO_GROUP_STORE_COUNT(S) (S)->store_count
#define STMT_VINFO_GROUP_GAP(S) (S)->gap
#define STMT_VINFO_GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt
-#define STMT_VINFO_GROUP_READ_WRITE_DEPENDENCE(S) (S)->read_write_dep
#define STMT_VINFO_GROUPED_ACCESS(S) ((S)->first_element != NULL && (S)->data_ref_info)
#define STMT_VINFO_LOOP_PHI_EVOLUTION_PART(S) (S)->loop_phi_evolution_part
@@ -600,7 +594,6 @@ typedef struct _stmt_vec_info {
#define GROUP_STORE_COUNT(S) (S)->store_count
#define GROUP_GAP(S) (S)->gap
#define GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt
-#define GROUP_READ_WRITE_DEPENDENCE(S) (S)->read_write_dep
#define STMT_VINFO_RELEVANT_P(S) ((S)->relevant != vect_unused_in_scope)
@@ -943,7 +936,6 @@ extern tree vect_setup_realignment (gimple, gimple_stmt_iterator *, tree *,
extern void vect_transform_grouped_load (gimple, vec<tree> , int,
gimple_stmt_iterator *);
extern void vect_record_grouped_load_vectors (gimple, vec<tree> );
-extern int vect_get_place_in_interleaving_chain (gimple, gimple);
extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *,
tree, struct loop *);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 250a5063136..be1a3808cf5 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -8584,6 +8584,45 @@ simplify_cond_using_ranges (gimple stmt)
}
}
+ /* If we have a comparison of a SSA_NAME boolean against
+ a constant (which obviously must be [0..1]), see if the
+ SSA_NAME was set by a type conversion where the source
+ of the conversion is another SSA_NAME with a range [0..1].
+
+ If so, we can replace the SSA_NAME in the comparison with
+ the RHS of the conversion. This will often make the type
+ conversion dead code which DCE will clean up. */
+ if (TREE_CODE (op0) == SSA_NAME
+ && (TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
+ || (INTEGRAL_TYPE_P (TREE_TYPE (op0))
+ && TYPE_PRECISION (TREE_TYPE (op0)) == 1))
+ && TREE_CODE (op1) == INTEGER_CST)
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (op0);
+ tree innerop;
+
+ if (!is_gimple_assign (def_stmt)
+ || !CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))
+ return false;
+
+ innerop = gimple_assign_rhs1 (def_stmt);
+
+ if (TREE_CODE (innerop) == SSA_NAME)
+ {
+ value_range_t *vr = get_value_range (innerop);
+
+ if (range_int_cst_p (vr)
+ && operand_equal_p (vr->min, integer_zero_node, 0)
+ && operand_equal_p (vr->max, integer_one_node, 0))
+ {
+ tree newconst = fold_convert (TREE_TYPE (innerop), op1);
+ gimple_cond_set_lhs (stmt, innerop);
+ gimple_cond_set_rhs (stmt, newconst);
+ return true;
+ }
+ }
+ }
+
return false;
}
@@ -9369,7 +9408,6 @@ struct gimple_opt_pass pass_vrp =
TODO_cleanup_cfg
| TODO_update_ssa
| TODO_verify_ssa
- | TODO_verify_flow
- | TODO_ggc_collect /* todo_flags_finish */
+ | TODO_verify_flow /* todo_flags_finish */
}
};
diff --git a/gcc/tree.c b/gcc/tree.c
index 375326cf68e..3f1310b2cbf 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2836,14 +2836,12 @@ save_expr (tree expr)
return t;
}
-/* Look inside EXPR and into any simple arithmetic operations. Return
- the innermost non-arithmetic node. */
+/* Look inside EXPR into any simple arithmetic operations. Return the
+ outermost non-arithmetic or non-invariant node. */
tree
skip_simple_arithmetic (tree expr)
{
- tree inner;
-
/* We don't care about whether this can be used as an lvalue in this
context. */
while (TREE_CODE (expr) == NON_LVALUE_EXPR)
@@ -2853,17 +2851,16 @@ skip_simple_arithmetic (tree expr)
a constant, it will be more efficient to not make another SAVE_EXPR since
it will allow better simplification and GCSE will be able to merge the
computations if they actually occur. */
- inner = expr;
- while (1)
+ while (true)
{
- if (UNARY_CLASS_P (inner))
- inner = TREE_OPERAND (inner, 0);
- else if (BINARY_CLASS_P (inner))
+ if (UNARY_CLASS_P (expr))
+ expr = TREE_OPERAND (expr, 0);
+ else if (BINARY_CLASS_P (expr))
{
- if (tree_invariant_p (TREE_OPERAND (inner, 1)))
- inner = TREE_OPERAND (inner, 0);
- else if (tree_invariant_p (TREE_OPERAND (inner, 0)))
- inner = TREE_OPERAND (inner, 1);
+ if (tree_invariant_p (TREE_OPERAND (expr, 1)))
+ expr = TREE_OPERAND (expr, 0);
+ else if (tree_invariant_p (TREE_OPERAND (expr, 0)))
+ expr = TREE_OPERAND (expr, 1);
else
break;
}
@@ -2871,9 +2868,37 @@ skip_simple_arithmetic (tree expr)
break;
}
- return inner;
+ return expr;
}
+/* Look inside EXPR into simple arithmetic operations involving constants.
+ Return the outermost non-arithmetic or non-constant node. */
+
+tree
+skip_simple_constant_arithmetic (tree expr)
+{
+ while (TREE_CODE (expr) == NON_LVALUE_EXPR)
+ expr = TREE_OPERAND (expr, 0);
+
+ while (true)
+ {
+ if (UNARY_CLASS_P (expr))
+ expr = TREE_OPERAND (expr, 0);
+ else if (BINARY_CLASS_P (expr))
+ {
+ if (TREE_CONSTANT (TREE_OPERAND (expr, 1)))
+ expr = TREE_OPERAND (expr, 0);
+ else if (TREE_CONSTANT (TREE_OPERAND (expr, 0)))
+ expr = TREE_OPERAND (expr, 1);
+ else
+ break;
+ }
+ else
+ break;
+ }
+
+ return expr;
+}
/* Return which tree structure is used by T. */
@@ -5308,7 +5333,7 @@ struct simple_ipa_opt_pass pass_ipa_free_lang_data =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ 0 /* todo_flags_finish */
}
};
@@ -6302,7 +6327,7 @@ type_hash_hash (const void *item)
/* Look in the type hash table for a type isomorphic to TYPE.
If one is found, return it. Otherwise return 0. */
-tree
+static tree
type_hash_lookup (hashval_t hashcode, tree type)
{
struct type_hash *h, in;
@@ -6324,7 +6349,7 @@ type_hash_lookup (hashval_t hashcode, tree type)
/* Add an entry to the type-hash-table
for a type TYPE whose hash code is HASHCODE. */
-void
+static void
type_hash_add (hashval_t hashcode, tree type)
{
struct type_hash *h;
diff --git a/gcc/tree.h b/gcc/tree.h
index f336b2dbbc7..ee35d8e14da 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5487,11 +5487,16 @@ extern tree staticp (tree);
extern tree save_expr (tree);
-/* Look inside EXPR and into any simple arithmetic operations. Return
- the innermost non-arithmetic node. */
+/* Look inside EXPR into any simple arithmetic operations. Return the
+ outermost non-arithmetic or non-invariant node. */
extern tree skip_simple_arithmetic (tree);
+/* Look inside EXPR into simple arithmetic operations involving constants.
+ Return the outermost non-arithmetic or non-constant node. */
+
+extern tree skip_simple_constant_arithmetic (tree);
+
/* Return which tree structure is used by T. */
enum tree_node_structure_enum tree_node_structure (const_tree);
@@ -6003,6 +6008,10 @@ fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
/* In builtins.c */
+
+/* Non-zero if __builtin_constant_p should be folded right away. */
+extern bool force_folding_builtin_constant_p;
+
extern bool avoid_folding_inline_builtin (tree);
extern tree fold_call_expr (location_t, tree, bool);
extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree);
@@ -6072,8 +6081,6 @@ extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t);
extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
extern int type_list_equal (const_tree, const_tree);
extern int chain_member (const_tree, const_tree);
-extern tree type_hash_lookup (unsigned int, tree);
-extern void type_hash_add (unsigned int, tree);
extern int simple_cst_list_equal (const_tree, const_tree);
extern void dump_tree_statistics (void);
extern void recompute_tree_invariant_for_addr_expr (tree);
@@ -6162,7 +6169,6 @@ extern void indent_to (FILE *, int);
extern bool debug_find_tree (tree, tree);
/* This is in tree-inline.c since the routine uses
data structures from the inliner. */
-extern tree unsave_expr_now (tree);
extern tree build_duplicate_type (tree);
/* In calls.c */
diff --git a/gcc/tsan.c b/gcc/tsan.c
index 14f40ce99ff..c02e100cca0 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -681,7 +681,8 @@ instrument_func_exit (void)
{
gsi = gsi_last_bb (e->src);
stmt = gsi_stmt (gsi);
- gcc_assert (gimple_code (stmt) == GIMPLE_RETURN);
+ gcc_assert (gimple_code (stmt) == GIMPLE_RETURN
+ || gimple_call_builtin_p (stmt, BUILT_IN_RETURN));
loc = gimple_location (stmt);
builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_EXIT);
g = gimple_build_call (builtin_decl, 0);
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 39bbdbf02e7..3348d7f58c8 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -802,7 +802,7 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si)
/* Compute probability of taking the optimal path. */
if (all > 0)
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ prob = GCOV_COMPUTE_SCALE (count, all);
else
prob = 0;
@@ -962,7 +962,7 @@ gimple_mod_pow2_value_transform (gimple_stmt_iterator *si)
return false;
if (all > 0)
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ prob = GCOV_COMPUTE_SCALE (count, all);
else
prob = 0;
@@ -1156,8 +1156,8 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si)
/* Compute probability of taking the optimal path(s). */
if (all > 0)
{
- prob1 = (count1 * REG_BR_PROB_BASE + all / 2) / all;
- prob2 = (count2 * REG_BR_PROB_BASE + all / 2) / all;
+ prob1 = GCOV_COMPUTE_SCALE (count1, all);
+ prob2 = GCOV_COMPUTE_SCALE (count2, all);
}
else
{
@@ -1430,7 +1430,7 @@ gimple_ic_transform (gimple_stmt_iterator *gsi)
return false;
if (all > 0)
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ prob = GCOV_COMPUTE_SCALE (count, all);
else
prob = 0;
direct_call = find_func_by_funcdef_no ((int)val);
@@ -1636,7 +1636,7 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi)
if (check_counter (stmt, "value", &count, &all, gimple_bb (stmt)->count))
return false;
if (all > 0)
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ prob = GCOV_COMPUTE_SCALE (count, all);
else
prob = 0;
dest = gimple_call_arg (stmt, 0);
diff --git a/gcc/varpool.c b/gcc/varpool.c
index f5a905c753f..dbf519e6137 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -191,7 +191,7 @@ varpool_add_new_variable (tree decl)
struct varpool_node *node;
varpool_finalize_decl (decl);
node = varpool_node_for_decl (decl);
- if (varpool_externally_visible_p (node, false))
+ if (varpool_externally_visible_p (node))
node->symbol.externally_visible = true;
}
diff --git a/include/ChangeLog b/include/ChangeLog
index 03b4e63b89d..7fe2842b413 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,10 @@
+2013-04-03 Jason Merrill <jason@redhat.com>
+
+ Demangle C++11 ref-qualifier.
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_REFERENCE_THIS,
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS.
+
2013-03-01 Cary Coutant <ccoutant@google.com>
* dwarf2.h (enum dwarf_sect): New enum type.
diff --git a/include/demangle.h b/include/demangle.h
index ed019500393..58bf547d547 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -302,6 +302,12 @@ enum demangle_component_type
/* The const qualifier modifying a member function. The one subtree
is the type which is being qualified. */
DEMANGLE_COMPONENT_CONST_THIS,
+ /* C++11 A reference modifying a member function. The one subtree is the
+ type which is being referenced. */
+ DEMANGLE_COMPONENT_REFERENCE_THIS,
+ /* C++11: An rvalue reference modifying a member function. The one
+ subtree is the type which is being referenced. */
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS,
/* A vendor qualifier. The left subtree is the type which is being
qualified, and the right subtree is the name of the
qualifier. */
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index e3a6637f095..8ec815dcd35 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ PR target/56771
+ * configure.ac: Require 64-bit int for arm*-*-rtems*.
+ * configure: Regenerate.
+
2013-03-06 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56461
diff --git a/libcpp/configure b/libcpp/configure
index f21b361577f..715818697b8 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -7153,6 +7153,7 @@ case $target in
aarch64*-*-* | \
alpha*-*-* | \
arm*-*-*eabi* | \
+ arm*-*-rtems* | \
arm*-*-symbianelf* | \
x86_64-*-* | \
ia64-*-* | \
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index e0c4ae6958f..43ac9bade1b 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -185,6 +185,7 @@ case $target in
aarch64*-*-* | \
alpha*-*-* | \
arm*-*-*eabi* | \
+ arm*-*-rtems* | \
arm*-*-symbianelf* | \
x86_64-*-* | \
ia64-*-* | \
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 0d581bfcfa1..ef4c8ce95f1 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,21 @@
+2013-04-10 Julian Brown <julian@codesourcery.com>
+
+ * config/arm/linux-atomic.c (SUBWORD_SYNC_OP, SUBWORD_VAL_CAS)
+ (SUBWORD_TEST_AND_SET): Use signed char/short types instead of
+ unsigned char/unsigned short.
+ (__sync_val_compare_and_swap_{1,2}): Handle signed argument.
+
+2013-04-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR other/55274
+ * config/t-slibgcc-hpux (SHLIB_MAPFILES): Define.
+
+2013-04-04 Meador Inge <meadori@codesourcery.com>
+
+ * config/arm/bpabi.S (aeabi_ldivmod): Add DWARF information for
+ computing the location of the link register.
+ (aeabi_uldivmod): Ditto.
+
2013-03-27 Kai Tietz <ktietz@redhat.com>
* config.host: Add support for cygwin x64 target.
diff --git a/libgcc/config/arm/bpabi.S b/libgcc/config/arm/bpabi.S
index d3493b357ca..b5cf2071265 100644
--- a/libgcc/config/arm/bpabi.S
+++ b/libgcc/config/arm/bpabi.S
@@ -123,6 +123,7 @@ ARM_FUNC_START aeabi_ulcmp
#ifdef L_aeabi_ldivmod
ARM_FUNC_START aeabi_ldivmod
+ cfi_start __aeabi_ldivmod, LSYM(Lend_aeabi_ldivmod)
test_div_by_zero signed
sub sp, sp, #8
@@ -132,17 +133,20 @@ ARM_FUNC_START aeabi_ldivmod
#else
do_push {sp, lr}
#endif
+98: cfi_push 98b - __aeabi_ldivmod, 0xe, -0xc, 0x10
bl SYM(__gnu_ldivmod_helper) __PLT__
ldr lr, [sp, #4]
add sp, sp, #8
do_pop {r2, r3}
RET
+ cfi_end LSYM(Lend_aeabi_ldivmod)
#endif /* L_aeabi_ldivmod */
#ifdef L_aeabi_uldivmod
ARM_FUNC_START aeabi_uldivmod
+ cfi_start __aeabi_uldivmod, LSYM(Lend_aeabi_uldivmod)
test_div_by_zero unsigned
sub sp, sp, #8
@@ -152,11 +156,13 @@ ARM_FUNC_START aeabi_uldivmod
#else
do_push {sp, lr}
#endif
+98: cfi_push 98b - __aeabi_uldivmod, 0xe, -0xc, 0x10
bl SYM(__gnu_uldivmod_helper) __PLT__
ldr lr, [sp, #4]
add sp, sp, #8
do_pop {r2, r3}
RET
-
+ cfi_end LSYM(Lend_aeabi_uldivmod)
+
#endif /* L_aeabi_divmod */
diff --git a/libgcc/config/arm/linux-atomic.c b/libgcc/config/arm/linux-atomic.c
index ee13107f1d6..d601c4ebf2a 100644
--- a/libgcc/config/arm/linux-atomic.c
+++ b/libgcc/config/arm/linux-atomic.c
@@ -97,19 +97,19 @@ FETCH_AND_OP_WORD (nand, ~, &)
return (RETURN & mask) >> shift; \
}
-SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval)
-
-SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval)
+SUBWORD_SYNC_OP (add, , +, short, 2, oldval)
+SUBWORD_SYNC_OP (sub, , -, short, 2, oldval)
+SUBWORD_SYNC_OP (or, , |, short, 2, oldval)
+SUBWORD_SYNC_OP (and, , &, short, 2, oldval)
+SUBWORD_SYNC_OP (xor, , ^, short, 2, oldval)
+SUBWORD_SYNC_OP (nand, ~, &, short, 2, oldval)
+
+SUBWORD_SYNC_OP (add, , +, signed char, 1, oldval)
+SUBWORD_SYNC_OP (sub, , -, signed char, 1, oldval)
+SUBWORD_SYNC_OP (or, , |, signed char, 1, oldval)
+SUBWORD_SYNC_OP (and, , &, signed char, 1, oldval)
+SUBWORD_SYNC_OP (xor, , ^, signed char, 1, oldval)
+SUBWORD_SYNC_OP (nand, ~, &, signed char, 1, oldval)
#define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \
int HIDDEN \
@@ -132,19 +132,19 @@ OP_AND_FETCH_WORD (and, , &)
OP_AND_FETCH_WORD (xor, , ^)
OP_AND_FETCH_WORD (nand, ~, &)
-SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval)
+SUBWORD_SYNC_OP (add, , +, short, 2, newval)
+SUBWORD_SYNC_OP (sub, , -, short, 2, newval)
+SUBWORD_SYNC_OP (or, , |, short, 2, newval)
+SUBWORD_SYNC_OP (and, , &, short, 2, newval)
+SUBWORD_SYNC_OP (xor, , ^, short, 2, newval)
+SUBWORD_SYNC_OP (nand, ~, &, short, 2, newval)
-SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval)
+SUBWORD_SYNC_OP (add, , +, signed char, 1, newval)
+SUBWORD_SYNC_OP (sub, , -, signed char, 1, newval)
+SUBWORD_SYNC_OP (or, , |, signed char, 1, newval)
+SUBWORD_SYNC_OP (and, , &, signed char, 1, newval)
+SUBWORD_SYNC_OP (xor, , ^, signed char, 1, newval)
+SUBWORD_SYNC_OP (nand, ~, &, signed char, 1, newval)
int HIDDEN
__sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
@@ -181,7 +181,7 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
actual_oldval = *wordptr; \
\
if (__builtin_expect (((actual_oldval & mask) >> shift) != \
- (unsigned int) oldval, 0)) \
+ ((unsigned int) oldval & MASK_##WIDTH), 0)) \
return (actual_oldval & mask) >> shift; \
\
actual_newval = (actual_oldval & ~mask) \
@@ -195,8 +195,8 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
} \
}
-SUBWORD_VAL_CAS (unsigned short, 2)
-SUBWORD_VAL_CAS (unsigned char, 1)
+SUBWORD_VAL_CAS (short, 2)
+SUBWORD_VAL_CAS (signed char, 1)
typedef unsigned char bool;
@@ -217,8 +217,8 @@ __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
return (oldval == actual_oldval); \
}
-SUBWORD_BOOL_CAS (unsigned short, 2)
-SUBWORD_BOOL_CAS (unsigned char, 1)
+SUBWORD_BOOL_CAS (short, 2)
+SUBWORD_BOOL_CAS (signed char, 1)
void HIDDEN
__sync_synchronize (void)
@@ -260,8 +260,8 @@ __sync_lock_test_and_set_4 (int *ptr, int val)
return (oldval & mask) >> shift; \
}
-SUBWORD_TEST_AND_SET (unsigned short, 2)
-SUBWORD_TEST_AND_SET (unsigned char, 1)
+SUBWORD_TEST_AND_SET (short, 2)
+SUBWORD_TEST_AND_SET (signed char, 1)
#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \
void HIDDEN \
diff --git a/libgcc/config/t-slibgcc-hpux b/libgcc/config/t-slibgcc-hpux
index 866457fe9ae..b71e3c35cdd 100644
--- a/libgcc/config/t-slibgcc-hpux
+++ b/libgcc/config/t-slibgcc-hpux
@@ -5,3 +5,4 @@ SHLIB_LDFLAGS = -Wl,+h,$(SHLIB_SONAME)
INSTALL_SHLIB = $(INSTALL_DATA) -m 555
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
+SHLIB_MAPFILES = libgcc-std.ver
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 4b8e03a557b..25219aae7db 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,32 @@
+2013-04-15 Tobias Burnus <burnus@net-b.de>
+
+ * list_read.c (finish_separator): Initialize variable.
+
+2013-04-15 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/56919
+ * intrinsics/time_1.h: Check __CYGWIN__ in addition to
+ __MINGW32__.
+ * intrinsics/system_clock.c (GF_CLOCK_MONOTONIC): Check
+ _POSIX_MONOTONIC_CLOCK as well.
+ (system_clock_4): Use GetTickCount on Windows.
+ (system_clock_8): Use QueryPerformanceCounter and
+ QueryPerformanceCounterFrequency on Windows.
+
+2013-04-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/56810
+ * io/list_read.c (check_type): Fix kind checking for COMPLEX.
+
+2013-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/56660
+ * io/list_read.c (nml_read_obj): Do not reset the read error flag
+ inside nml_read_obj. If the read error flag is found set just exit.
+ Fix some whitespace on comments.
+ (nml_read_obj_data): Reset the read error flag before the first call
+ to nml_read_object.
+
2013-03-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/56786
diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c
index 87a87e22f1d..74a294db810 100644
--- a/libgfortran/intrinsics/system_clock.c
+++ b/libgfortran/intrinsics/system_clock.c
@@ -29,20 +29,23 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "time_1.h"
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
+
/* POSIX states that CLOCK_REALTIME must be present if clock_gettime
is available, others are optional. */
#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GETTIME_LIBRT)
-#ifdef CLOCK_MONOTONIC
+#if defined(CLOCK_MONOTONIC) && defined(_POSIX_MONOTONIC_CLOCK) \
+ && _POSIX_MONOTONIC_CLOCK >= 0
#define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC
#else
#define GF_CLOCK_MONOTONIC CLOCK_REALTIME
#endif
#endif
-/* Weakref trickery for clock_gettime(). On Glibc, clock_gettime()
- requires us to link in librt, which also pulls in libpthread. In
- order to avoid this by default, only call clock_gettime() through a
- weak reference.
+/* Weakref trickery for clock_gettime(). On Glibc <= 2.16,
+ clock_gettime() requires us to link in librt, which also pulls in
+ libpthread. In order to avoid this by default, only call
+ clock_gettime() through a weak reference.
Some targets don't support weak undefined references; on these
GTHREAD_USE_WEAK is 0. So we need to define it to 1 on other
@@ -105,6 +108,8 @@ gf_gettime_mono (time_t * secs, long * nanosecs, long * tck)
#endif
}
+#endif /* !__MINGW32 && !__CYGWIN__ */
+
extern void system_clock_4 (GFC_INTEGER_4 *, GFC_INTEGER_4 *, GFC_INTEGER_4 *);
export_proto(system_clock_4);
@@ -115,12 +120,28 @@ export_proto(system_clock_8);
/* prefix(system_clock_4) is the INTEGER(4) version of the SYSTEM_CLOCK
intrinsic subroutine. It returns the number of clock ticks for the current
system time, the number of ticks per second, and the maximum possible value
- for COUNT. On the first call to SYSTEM_CLOCK, COUNT is set to zero. */
+ for COUNT. */
void
system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
GFC_INTEGER_4 *count_max)
{
+#if defined(__MINGW32__) || defined(__CYGWIN__)
+ if (count)
+ {
+ /* Use GetTickCount here as the resolution and range is
+ sufficient for the INTEGER(kind=4) version, and
+ QueryPerformanceCounter has potential issues. */
+ uint32_t cnt = GetTickCount ();
+ if (cnt > GFC_INTEGER_4_HUGE)
+ cnt -= GFC_INTEGER_4_HUGE - 1;
+ *count = cnt;
+ }
+ if (count_rate)
+ *count_rate = 1000;
+ if (count_max)
+ *count_max = GFC_INTEGER_4_HUGE;
+#else
GFC_INTEGER_4 cnt;
GFC_INTEGER_4 mx;
@@ -158,6 +179,7 @@ system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
*count_rate = tck;
if (count_max != NULL)
*count_max = mx;
+#endif
}
@@ -167,6 +189,33 @@ void
system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
GFC_INTEGER_8 *count_max)
{
+#if defined(__MINGW32__) || defined(__CYGWIN__)
+ LARGE_INTEGER cnt;
+ LARGE_INTEGER freq;
+ bool fail = false;
+ if (count && !QueryPerformanceCounter (&cnt))
+ fail = true;
+ if (count_rate && !QueryPerformanceFrequency (&freq))
+ fail = true;
+ if (fail)
+ {
+ if (count)
+ *count = - GFC_INTEGER_8_HUGE;
+ if (count_rate)
+ *count_rate = 0;
+ if (count_max)
+ *count_max = 0;
+ }
+ else
+ {
+ if (count)
+ *count = cnt.QuadPart;
+ if (count_rate)
+ *count_rate = freq.QuadPart;
+ if (count_max)
+ *count_max = GFC_INTEGER_8_HUGE;
+ }
+#else
GFC_INTEGER_8 cnt;
GFC_INTEGER_8 mx;
@@ -204,4 +253,5 @@ system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
*count_rate = tck;
if (count_max != NULL)
*count_max = mx;
+#endif
}
diff --git a/libgfortran/intrinsics/time_1.h b/libgfortran/intrinsics/time_1.h
index f21e0ea9298..de6472c6262 100644
--- a/libgfortran/intrinsics/time_1.h
+++ b/libgfortran/intrinsics/time_1.h
@@ -101,7 +101,7 @@ localtime_r (const time_t * timep, struct tm * result)
CPU_TIME intrinsics. Returns 0 for success or -1 if no
CPU time could be computed. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index be961f1661e..c8a1bdfc9d9 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -393,7 +393,7 @@ static int
finish_separator (st_parameter_dt *dtp)
{
int c;
- int err;
+ int err = LIBERROR_OK;
restart:
eat_spaces (dtp);
@@ -433,7 +433,7 @@ finish_separator (st_parameter_dt *dtp)
return err;
goto restart;
}
-
+ /* Fall through. */
default:
unget_char (dtp, c);
break;
@@ -1784,7 +1784,7 @@ read_real (st_parameter_dt *dtp, void * dest, int length)
compatible. Returns nonzero if incompatible. */
static int
-check_type (st_parameter_dt *dtp, bt type, int len)
+check_type (st_parameter_dt *dtp, bt type, int kind)
{
char message[MSGLEN];
@@ -1801,11 +1801,14 @@ check_type (st_parameter_dt *dtp, bt type, int len)
if (dtp->u.p.saved_type == BT_UNKNOWN || dtp->u.p.saved_type == BT_CHARACTER)
return 0;
- if (dtp->u.p.saved_length != len)
+ if ((type != BT_COMPLEX && dtp->u.p.saved_length != kind)
+ || (type == BT_COMPLEX && dtp->u.p.saved_length != kind*2))
{
snprintf (message, MSGLEN,
"Read kind %d %s where kind %d is required for item %d",
- dtp->u.p.saved_length, type_name (dtp->u.p.saved_type), len,
+ type == BT_COMPLEX ? dtp->u.p.saved_length / 2
+ : dtp->u.p.saved_length,
+ type_name (dtp->u.p.saved_type), kind,
dtp->u.p.item_count);
generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
return 1;
@@ -2490,9 +2493,9 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
size_t obj_name_len;
void * pdata;
- /* This object not touched in name parsing. */
-
- if (!nl->touched)
+ /* If we have encountered a previous read error or this object has not been
+ touched in name parsing, just return. */
+ if (dtp->u.p.nml_read_error || !nl->touched)
return true;
dtp->u.p.repeat_count = 0;
@@ -2532,10 +2535,8 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
- GFC_DESCRIPTOR_LBOUND(nl,dim))
* GFC_DESCRIPTOR_STRIDE(nl,dim) * nl->size);
- /* Reset the error flag and try to read next value, if
- dtp->u.p.repeat_count=0 */
+ /* If we are finished with the repeat count, try to read next value. */
- dtp->u.p.nml_read_error = 0;
nml_carry = 0;
if (--dtp->u.p.repeat_count <= 0)
{
@@ -2564,8 +2565,8 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
break;
case BT_REAL:
- /* Need to copy data back from the real location to the temp in order
- to handle nml reads into arrays. */
+ /* Need to copy data back from the real location to the temp in
+ order to handle nml reads into arrays. */
read_real (dtp, pdata, len);
memcpy (dtp->u.p.value, pdata, dlen);
break;
@@ -2787,6 +2788,7 @@ nml_get_obj_data (st_parameter_dt *dtp, namelist_info **pprev_nl,
"namelist not terminated with / or &end");
goto nml_err_ret;
}
+ /* Fall through. */
case '/':
dtp->u.p.input_complete = 1;
return true;
@@ -3022,6 +3024,7 @@ get_name:
nl = first_nl;
}
+ dtp->u.p.nml_read_error = 0;
if (!nml_read_obj (dtp, nl, 0, pprev_nl, nml_err_msg, nml_err_msg_size,
clow, chigh))
goto nml_err_ret;
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 91b06fa6e50..717221dd891 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,20 @@
+2013-04-03 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (cplus_demangle_type): Fix function quals.
+ (d_pointer_to_member_type): Simplify.
+
+ Demangle C++11 ref-qualifier.
+ * cp-demangle.c (d_ref_qualifier): New.
+ (d_nested_name, d_function_type): Use it.
+ (d_parmlist): Don't get confused by a ref-qualifier.
+ (cplus_demangle_type): Reorder ref-qualifier.
+ (d_pointer_to_member_type): Likewise.
+ (d_dump): Handle DEMANGLE_COMPONENT_REFERENCE_THIS and
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS.
+ (d_make_comp, has_return_type, d_encoding): Likewise.
+ (d_print_comp, d_print_mod_list, d_print_mod): Likewise.
+ (d_print_function_type, is_ctor_or_dtor): Likewise.
+
2013-03-27 Kai Tietz <ktietz@redhat.com>
* configure: Regenerated.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 39be0314cea..70f54389c89 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -382,6 +382,9 @@ static struct demangle_component **
d_cv_qualifiers (struct d_info *, struct demangle_component **, int);
static struct demangle_component *
+d_ref_qualifier (struct d_info *, struct demangle_component *);
+
+static struct demangle_component *
d_function_type (struct d_info *);
static struct demangle_component *
@@ -614,6 +617,12 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_CONST_THIS:
printf ("const this\n");
break;
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ printf ("reference this\n");
+ break;
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
+ printf ("rvalue reference this\n");
+ break;
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
printf ("vendor type qualifier\n");
break;
@@ -893,6 +902,8 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
case DEMANGLE_COMPONENT_ARGLIST:
case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
break;
@@ -1131,6 +1142,8 @@ has_return_type (struct demangle_component *dc)
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
return has_return_type (d_left (dc));
}
}
@@ -1186,7 +1199,9 @@ d_encoding (struct d_info *di, int top_level)
v2 demangler without DMGL_PARAMS. */
while (dc->type == DEMANGLE_COMPONENT_RESTRICT_THIS
|| dc->type == DEMANGLE_COMPONENT_VOLATILE_THIS
- || dc->type == DEMANGLE_COMPONENT_CONST_THIS)
+ || dc->type == DEMANGLE_COMPONENT_CONST_THIS
+ || dc->type == DEMANGLE_COMPONENT_REFERENCE_THIS
+ || dc->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS)
dc = d_left (dc);
/* If the top level is a DEMANGLE_COMPONENT_LOCAL_NAME, then
@@ -1200,7 +1215,9 @@ d_encoding (struct d_info *di, int top_level)
dcr = d_right (dc);
while (dcr->type == DEMANGLE_COMPONENT_RESTRICT_THIS
|| dcr->type == DEMANGLE_COMPONENT_VOLATILE_THIS
- || dcr->type == DEMANGLE_COMPONENT_CONST_THIS)
+ || dcr->type == DEMANGLE_COMPONENT_CONST_THIS
+ || dcr->type == DEMANGLE_COMPONENT_REFERENCE_THIS
+ || dcr->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS)
dcr = d_left (dcr);
dc->u.s_binary.right = dcr;
}
@@ -1322,8 +1339,8 @@ d_name (struct d_info *di)
}
}
-/* <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
- ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
+/* <nested-name> ::= N [<CV-qualifiers>] [<ref-qualifier>] <prefix> <unqualified-name> E
+ ::= N [<CV-qualifiers>] [<ref-qualifier>] <template-prefix> <template-args> E
*/
static struct demangle_component *
@@ -1331,6 +1348,7 @@ d_nested_name (struct d_info *di)
{
struct demangle_component *ret;
struct demangle_component **pret;
+ struct demangle_component *rqual;
if (! d_check_char (di, 'N'))
return NULL;
@@ -1339,10 +1357,20 @@ d_nested_name (struct d_info *di)
if (pret == NULL)
return NULL;
+ /* Parse the ref-qualifier now and then attach it
+ once we have something to attach it to. */
+ rqual = d_ref_qualifier (di, NULL);
+
*pret = d_prefix (di);
if (*pret == NULL)
return NULL;
+ if (rqual)
+ {
+ d_left (rqual) = ret;
+ ret = rqual;
+ }
+
if (! d_check_char (di, 'E'))
return NULL;
@@ -2170,8 +2198,28 @@ cplus_demangle_type (struct d_info *di)
pret = d_cv_qualifiers (di, &ret, 0);
if (pret == NULL)
return NULL;
- *pret = cplus_demangle_type (di);
- if (! *pret || ! d_add_substitution (di, ret))
+ if (d_peek_char (di) == 'F')
+ {
+ /* cv-qualifiers before a function type apply to 'this',
+ so avoid adding the unqualified function type to
+ the substitution list. */
+ *pret = d_function_type (di);
+ }
+ else
+ *pret = cplus_demangle_type (di);
+ if (!*pret)
+ return NULL;
+ if ((*pret)->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS
+ || (*pret)->type == DEMANGLE_COMPONENT_REFERENCE_THIS)
+ {
+ /* Move the ref-qualifier outside the cv-qualifiers so that
+ they are printed in the right order. */
+ struct demangle_component *fn = d_left (*pret);
+ d_left (*pret) = ret;
+ ret = *pret;
+ *pret = fn;
+ }
+ if (! d_add_substitution (di, ret))
return NULL;
return ret;
}
@@ -2474,7 +2522,38 @@ d_cv_qualifiers (struct d_info *di,
return pret;
}
-/* <function-type> ::= F [Y] <bare-function-type> E */
+/* <ref-qualifier> ::= R
+ ::= O */
+
+static struct demangle_component *
+d_ref_qualifier (struct d_info *di, struct demangle_component *sub)
+{
+ struct demangle_component *ret = sub;
+ char peek;
+
+ peek = d_peek_char (di);
+ if (peek == 'R' || peek == 'O')
+ {
+ enum demangle_component_type t;
+ if (peek == 'R')
+ {
+ t = DEMANGLE_COMPONENT_REFERENCE_THIS;
+ di->expansion += sizeof "&";
+ }
+ else
+ {
+ t = DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS;
+ di->expansion += sizeof "&&";
+ }
+ d_advance (di, 1);
+
+ ret = d_make_comp (di, t, ret, NULL);
+ }
+
+ return ret;
+}
+
+/* <function-type> ::= F [Y] <bare-function-type> [<ref-qualifier>] E */
static struct demangle_component *
d_function_type (struct d_info *di)
@@ -2490,6 +2569,8 @@ d_function_type (struct d_info *di)
d_advance (di, 1);
}
ret = d_bare_function_type (di, 1);
+ ret = d_ref_qualifier (di, ret);
+
if (! d_check_char (di, 'E'))
return NULL;
return ret;
@@ -2512,6 +2593,10 @@ d_parmlist (struct d_info *di)
char peek = d_peek_char (di);
if (peek == '\0' || peek == 'E' || peek == '.')
break;
+ if ((peek == 'R' || peek == 'O')
+ && d_peek_next_char (di) == 'E')
+ /* Function ref-qualifier, not a ref prefix for a parameter type. */
+ break;
type = cplus_demangle_type (di);
if (type == NULL)
return NULL;
@@ -2662,41 +2747,32 @@ d_pointer_to_member_type (struct d_info *di)
{
struct demangle_component *cl;
struct demangle_component *mem;
- struct demangle_component **pmem;
if (! d_check_char (di, 'M'))
return NULL;
cl = cplus_demangle_type (di);
-
- /* The ABI specifies that any type can be a substitution source, and
- that M is followed by two types, and that when a CV-qualified
- type is seen both the base type and the CV-qualified types are
- substitution sources. The ABI also specifies that for a pointer
- to a CV-qualified member function, the qualifiers are attached to
- the second type. Given the grammar, a plain reading of the ABI
- suggests that both the CV-qualified member function and the
- non-qualified member function are substitution sources. However,
- g++ does not work that way. g++ treats only the CV-qualified
- member function as a substitution source. FIXME. So to work
- with g++, we need to pull off the CV-qualifiers here, in order to
- avoid calling add_substitution() in cplus_demangle_type(). But
- for a CV-qualified member which is not a function, g++ does
- follow the ABI, so we need to handle that case here by calling
- d_add_substitution ourselves. */
-
- pmem = d_cv_qualifiers (di, &mem, 1);
- if (pmem == NULL)
- return NULL;
- *pmem = cplus_demangle_type (di);
- if (*pmem == NULL)
+ if (cl == NULL)
return NULL;
- if (pmem != &mem && (*pmem)->type != DEMANGLE_COMPONENT_FUNCTION_TYPE)
- {
- if (! d_add_substitution (di, mem))
- return NULL;
- }
+ /* The ABI says, "The type of a non-static member function is considered
+ to be different, for the purposes of substitution, from the type of a
+ namespace-scope or static member function whose type appears
+ similar. The types of two non-static member functions are considered
+ to be different, for the purposes of substitution, if the functions
+ are members of different classes. In other words, for the purposes of
+ substitution, the class of which the function is a member is
+ considered part of the type of function."
+
+ For a pointer to member function, this call to cplus_demangle_type
+ will end up adding a (possibly qualified) non-member function type to
+ the substitution table, which is not correct; however, the member
+ function type will never be used in a substitution, so putting the
+ wrong type in the substitution table is harmless. */
+
+ mem = cplus_demangle_type (di);
+ if (mem == NULL)
+ return NULL;
return d_make_comp (di, DEMANGLE_COMPONENT_PTRMEM_TYPE, cl, mem);
}
@@ -3923,7 +3999,9 @@ d_print_comp (struct d_print_info *dpi, int options,
if (typed_name->type != DEMANGLE_COMPONENT_RESTRICT_THIS
&& typed_name->type != DEMANGLE_COMPONENT_VOLATILE_THIS
- && typed_name->type != DEMANGLE_COMPONENT_CONST_THIS)
+ && typed_name->type != DEMANGLE_COMPONENT_CONST_THIS
+ && typed_name->type != DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS
+ && typed_name->type != DEMANGLE_COMPONENT_REFERENCE_THIS)
break;
typed_name = d_left (typed_name);
@@ -3957,7 +4035,10 @@ d_print_comp (struct d_print_info *dpi, int options,
local_name = local_name->u.s_unary_num.sub;
while (local_name->type == DEMANGLE_COMPONENT_RESTRICT_THIS
|| local_name->type == DEMANGLE_COMPONENT_VOLATILE_THIS
- || local_name->type == DEMANGLE_COMPONENT_CONST_THIS)
+ || local_name->type == DEMANGLE_COMPONENT_CONST_THIS
+ || local_name->type == DEMANGLE_COMPONENT_REFERENCE_THIS
+ || (local_name->type
+ == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS))
{
if (i >= sizeof adpm / sizeof adpm[0])
{
@@ -4234,6 +4315,8 @@ d_print_comp (struct d_print_info *dpi, int options,
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
case DEMANGLE_COMPONENT_POINTER:
case DEMANGLE_COMPONENT_COMPLEX:
@@ -4906,7 +4989,10 @@ d_print_mod_list (struct d_print_info *dpi, int options,
|| (! suffix
&& (mods->mod->type == DEMANGLE_COMPONENT_RESTRICT_THIS
|| mods->mod->type == DEMANGLE_COMPONENT_VOLATILE_THIS
- || mods->mod->type == DEMANGLE_COMPONENT_CONST_THIS)))
+ || mods->mod->type == DEMANGLE_COMPONENT_CONST_THIS
+ || mods->mod->type == DEMANGLE_COMPONENT_REFERENCE_THIS
+ || (mods->mod->type
+ == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS))))
{
d_print_mod_list (dpi, options, mods->next, suffix);
return;
@@ -4961,7 +5047,9 @@ d_print_mod_list (struct d_print_info *dpi, int options,
while (dc->type == DEMANGLE_COMPONENT_RESTRICT_THIS
|| dc->type == DEMANGLE_COMPONENT_VOLATILE_THIS
- || dc->type == DEMANGLE_COMPONENT_CONST_THIS)
+ || dc->type == DEMANGLE_COMPONENT_CONST_THIS
+ || dc->type == DEMANGLE_COMPONENT_REFERENCE_THIS
+ || dc->type == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS)
dc = d_left (dc);
d_print_comp (dpi, options, dc);
@@ -5006,9 +5094,14 @@ d_print_mod (struct d_print_info *dpi, int options,
if ((options & DMGL_JAVA) == 0)
d_append_char (dpi, '*');
return;
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ /* For the ref-qualifier, put a space before the &. */
+ d_append_char (dpi, ' ');
case DEMANGLE_COMPONENT_REFERENCE:
d_append_char (dpi, '&');
return;
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
+ d_append_char (dpi, ' ');
case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
d_append_string (dpi, "&&");
return;
@@ -5080,6 +5173,8 @@ d_print_function_type (struct d_print_info *dpi, int options,
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
break;
default:
break;
@@ -5600,14 +5695,17 @@ is_ctor_or_dtor (const char *mangled,
{
switch (dc->type)
{
+ /* These cannot appear on a constructor or destructor. */
+ case DEMANGLE_COMPONENT_RESTRICT_THIS:
+ case DEMANGLE_COMPONENT_VOLATILE_THIS:
+ case DEMANGLE_COMPONENT_CONST_THIS:
+ case DEMANGLE_COMPONENT_REFERENCE_THIS:
+ case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
default:
dc = NULL;
break;
case DEMANGLE_COMPONENT_TYPED_NAME:
case DEMANGLE_COMPONENT_TEMPLATE:
- case DEMANGLE_COMPONENT_RESTRICT_THIS:
- case DEMANGLE_COMPONENT_VOLATILE_THIS:
- case DEMANGLE_COMPONENT_CONST_THIS:
dc = d_left (dc);
break;
case DEMANGLE_COMPONENT_QUAL_NAME:
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 17eacaaa8d0..1259e4a9f49 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4273,9 +4273,21 @@ foo
#
--format=gnu-v3 --no-params
_Z1fIKFvvES0_Evv
-void f<void () const, void ()>()
-f<void () const, void ()>
+void f<void () const, void () const>()
+f<void () const, void () const>
#
--format=gnu-v3
_ZN4modc6parser8sequenceINS_9astParser13LocatedParserINS0_9ParserRefINS2_UlRNS2_16TokenParserInputEE_EEEEEINS0_14OptionalParserINS2_18ListParserTemplateILNS_6tokens5Token4TypeE4EXadL_ZNSD_Ut_13parenthesizedEEEE6ParserINS4_INS0_6ParserIS5_NS_3ast10ExpressionEEEEEEEEENSA_INS4_INS2_22OneOfKeywordsToTParserINSJ_5StyleEEEEEEENS0_14SequenceParserIS5_INS0_18ExactElementParserIS5_EENSA_ISM_EEEEENS0_14RepeatedParserINS4_INS0_15TransformParserINSU_IS5_INS4_INSP_INSJ_10Annotation12RelationshipEEEEESX_EEENS2_UlNS2_3LocES12_ONS_5MaybeISK_EEE19_EEEEELb0EEEEEENSU_INS0_17ExtractParserTypeIT_E9InputTypeEINS0_8MaybeRefIS1F_E4TypeEDpNS1I_IT0_E4TypeEEEEOS1F_DpOS1L_
modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::parser::ExtractParserType<modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> > >::InputType, modc::parser::MaybeRef<modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}>::Type, modc::parser::RepeatedParser<modc::parser::ParserRef<modc::parser::TransformParser<modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::astParser::TokenParserInput<modc::parser::ParserRef<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > ><modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Annotation::Relationship> >, modc::parser::ExactElementParser> >, modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}> >, false><modc::parser::OptionalParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > > > >::Type, modc::parser::RepeatedParser<modc::parser::ParserRef<modc::parser::TransformParser<modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::astParser::TokenParserInput<modc::parser::ParserRef<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > ><modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Annotation::Relationship> >, modc::parser::ExactElementParser> >, modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}> >, false><modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> ><modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> > > >::Type, modc::parser::RepeatedParser<modc::parser::ParserRef<modc::parser::TransformParser<modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::astParser::TokenParserInput<modc::parser::ParserRef<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > ><modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Annotation::Relationship> >, modc::parser::ExactElementParser> >, modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}> >, false><modc::parser::SequenceParser<modc::astParser::TokenParserInput<modc::parser::ExactElementParser<modc::astParser::TokenParserInput>, modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> ><modc::ast::Expression> > > >::Type, modc::parser::RepeatedParser<modc::parser::ParserRef<modc::parser::TransformParser<modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::astParser::TokenParserInput<modc::parser::ParserRef<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > ><modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Annotation::Relationship> >, modc::parser::ExactElementParser> >, modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}> >, false><modc::parser::RepeatedParser<modc::parser::ParserRef<modc::parser::TransformParser<modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::astParser::TokenParserInput<modc::parser::ParserRef<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > ><modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Annotation::Relationship> >, modc::parser::ExactElementParser> >, modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}> >, false> >::Type> modc::parser::sequence<modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> >, modc::parser::OptionalParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > > >, modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> ><modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> > >, modc::parser::SequenceParser<modc::astParser::TokenParserInput<modc::parser::ExactElementParser<modc::astParser::TokenParserInput>, modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> ><modc::ast::Expression> > >, modc::parser::RepeatedParser<modc::parser::ParserRef<modc::parser::TransformParser<modc::parser::ParserRef<modc::astParser::OneOfKeywordsToTParser<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Style> ><modc::astParser::TokenParserInput<modc::parser::ParserRef<modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser<modc::parser::ParserRef<modc::parser::Parser<modc::astParser::TokenParserInput, modc::ast::Expression> > ><modc::astParser::ListParserTemplate<(modc::tokens::Token::Type)4, &modc::tokens::{unnamed type#1}::parenthesized>::Parser::Annotation::Relationship> >, modc::parser::ExactElementParser> >, modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}> >, false> >(modc::astParser::{lambda(modc::astParser::Loc, modc::parser::RepeatedParser, modc::Maybe<modc::parser::Parser>&&)#21}&&, (modc::parser::ExtractParserType<modc::astParser::LocatedParser<modc::parser::ParserRef<modc::astParser::{lambda(modc::astParser::TokenParserInput&)#1}> > >&&)...)
+--format=gnu-v3
+_ZNKR1A1hEv
+A::h() const &
+--format=gnu-v3
+_Z1lM1AKFvvRE
+l(void (A::*)() const &)
+--format=gnu-v3
+_Z1mIFvvOEEvM1AT_
+void m<void () &&>(void (A::*)() &&)
+--format=gnu-v3
+_Z1nIM1AKFvvREEvT_
+void n<void (A::*)() const &>(void (A::*)() const &)
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index a0e3c521a94..95ea3e6be63 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-23 Andi Kleen <ak@linux.intel.com>
+
+ * local_atomic (__always_inline): Add.
+ (__calculate_memory_order, atomic_thread_fence,
+ atomic_signal_fence, test_and_set, clear, store, load,
+ exchange, compare_exchange_weak, compare_exchange_strong,
+ fetch_add, fetch_sub, fetch_and, fetch_or, fetch_xor):
+ Add __always_inline to force inlining.
+
2013-02-11 Iain Sandoe <iain@codesourcery.com>
Jack Howarth <howarth@bromo.med.uc.edu>
Patrick Marlier <patrick.marlier@gmail.com>
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 23b3751d645..3ccf5f442df 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,6 +1,109 @@
+2013-04-09 Tom Tromey <tromey@redhat.com>
+
+ * configure, config.h.in: Rebuild.
+ * configure.ac: Use GLIBCXX_CHECK_SDT_H. Don't check for
+ sys/sdt.h.
+ * acinclude.m4 (GLIBCXX_CHECK_SDT_H): New defun.
+
+2013-04-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
+
+2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/libstdc++-prettyprinters/cxx11.cc: Include <memory>.
+
+2013-04-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/Makefile.am: Add ext/aligned_buffer.h
+ * include/Makefile.in: Regenerate.
+ * include/ext/aligned_buffer.h: New.
+ * include/std/future (_Result): Use __aligned_buffer.
+ * include/bits/forward_list.h (_Fwd_list_node): Likewise.
+ * include/bits/shared_ptr_base.h (_Sp_counted_ptr_inplace): Likewise.
+ * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error line
+ number.
+
+2013-04-07 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/bits/forward_list.h: Only include required headers.
+ (forward_list::reference): Define directly, not using __alloc_traits.
+ (forward_list::const_reference): Likewise.
+
+2013-04-07 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/std/functional (_Derives_from_unary_function): Remove.
+ (_Derives_from_binary_function): Remove.
+ * include/std/type_traits (__sfinae_types): Remove.
+ (__is_assignable_helper): Adapt.
+ (__is_convertible_helper): Adapt.
+ (_GLIBCXX_HAS_NESTED_TYPE): Adapt.
+ Remove several explicit instantiations of integral_constant.
+ * testsuite/20_util/reference_wrapper/typedefs-3.cc: Adapt.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
+ Adapt dg-error line number.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
+ Likewise.
+ * testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
+ * testsuite/20_util/bind/ref_neg.cc: Likewise.
+
+2013-04-05 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/56841
+ * libsupc++/eh_ptr.cc (rethrow_exception): Use get_unexpected() and
+ get_terminate() accessors.
+ * libsupc++/eh_throw.cc (__cxa_throw): Likewise.
+ * libsupc++/eh_terminate.cc: Use mutex when atomic builtins not
+ available.
+ * libsupc++/new_handler.cc: Likewise.
+
+2013-04-04 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.19 version.
+
+2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/56834
+ * include/debug/array (tuple_size, tuple_element): Do not declare.
+ * include/profile/array: Likewise.
+ * testsuite/23_containers/array/tuple_interface/
+ tuple_element_debug_neg.cc: Adjust dg-error line number.
+
+2013-04-03 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * libsupc++/exception (get_terminate(), get_unexpected()): Declare.
+ * libsupc++/eh_terminate.cc (get_terminate() , set_unexpected()):
+ Define.
+ (set_terminate(terminate_handler)): Set atomically.
+ (set_unexpected(terminate_handler)): Likewise.
+ * libsupc++/new (get_new_handler()): Declare.
+ * libsupc++/new_handler.cc (get_new_handler()): Define.
+ (set_new_handler(new_handler)): Set atomically.
+ (__new_handler): Use internal linkage.
+ * libsupc++/new_op.cc (operator new): Use get_new_handler().
+ * libsupc++/new_opnt.cc (operator new): Likewise.
+ * acinclude.m4: Bump libtool_VERSION to 6:19:0.
+ * configure: Regenerate.
+ * libsupc++/Makefile.am: Compile above files with -std=gnu++11.
+ * libsupc++/Makefile.in: Regenerate.
+ * config/abi/pre/gnu.ver: Add new exports.
+ * doc/xml/manual/status_cxx2011.xml: Update.
+ * testsuite/18_support/headers/exception/synopsis.cc: Check accessors
+ for handlers.
+ * testsuite/18_support/headers/new/synopsis.cc: Likewise.
+ * testsuite/18_support/new_handler.cc: New.
+ * testsuite/18_support/terminate_handler.cc: New.
+ * testsuite/18_support/unexpected_handler.cc: New.
+
+2013-04-02 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/appendix_contributing.xml: Remove broken link and
+ defer to general documentation on contributing to GCC.
+ * doc/html/*: Regenerate.
+
2013-03-30 Gerald Pfeifer <gerald@pfeifer.com>
- * doc/xml/manual/allocator.xml: Adjust link to Dr.Dobb's article.q
+ * doc/xml/manual/allocator.xml: Adjust link to Dr.Dobb's article.
* doc/xml/manual/appendix_contributing.xml: Adjust link to GNU
Coding Standards.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 0871a6a2883..619fff02bf7 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3241,7 +3241,7 @@ changequote([,])dnl
fi
# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:18:0
+libtool_VERSION=6:19:0
# Everything parsed; figure out what files and settings to use.
case $enable_symvers in
@@ -3660,6 +3660,36 @@ AC_DEFUN([GLIBCXX_ENABLE_WERROR], [
])
+dnl
+dnl Check to see if sys/sdt.h exists and that it is suitable for use.
+dnl Some versions of sdt.h were not compatible with C++11.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_SDT_H], [
+ AC_MSG_RESULT([for suitable sys/sdt.h])
+ # Note that this test has to be run with the C language.
+ # Otherwise, sdt.h will try to include some headers from
+ # libstdc++ itself.
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_CACHE_VAL(glibcxx_cv_sys_sdt_h, [
+ # Because we have to run the test in C, we use grep rather
+ # than the compiler to check for the bug. The bug is that
+ # were strings without trailing whitespace, causing g++
+ # to look for operator"". The pattern searches for the fixed
+ # output.
+ AC_EGREP_CPP([ \",\" ], [
+ #include <sys/sdt.h>
+ int f() { STAP_PROBE(hi, bob); }
+ ], [glibcxx_cv_sys_sdt_h=yes], [glibcxx_cv_sys_sdt_h=no])
+ ])
+ AC_LANG_RESTORE
+ if test $glibcxx_cv_sys_sdt_h = yes; then
+ AC_DEFINE(HAVE_SYS_SDT_H, 1,
+ [Define to 1 if you have a suitable <sys/sdt.h> header file])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_sys_sdt_h)
+])
+
# 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 9937a1ed155..90d0479347e 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -400,7 +400,7 @@
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
-/* Define to 1 if you have the <sys/sdt.h> header file. */
+/* Define to 1 if you have a suitable <sys/sdt.h> header file */
#undef HAVE_SYS_SDT_H
/* Define to 1 if you have the <sys/sem.h> header file. */
diff --git a/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
index 1bf009cd8d5..8b4416af020 100644
--- a/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
@@ -543,6 +543,7 @@ FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_trai
FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE8__do_putES4_bRSt8ios_basewd@@GLIBCXX_LDBL_3.4
FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb0EEES4_S4_RSt8ios_basewRKSbIwS3_SaIwEE@@GLIBCXX_LDBL_3.4
FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb1EEES4_S4_RSt8ios_basewRKSbIwS3_SaIwEE@@GLIBCXX_LDBL_3.4
+FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18
FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4
FUNC:_ZNKSt18basic_stringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
@@ -732,6 +733,8 @@ FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewm@@GLIBCXX_3.4
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCXX_3.4
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCXX_3.4
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEm@@GLIBCXX_3.4.18
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEmmm@@GLIBCXX_3.4.18
FUNC:_ZNKSt8bad_cast4whatEv@@GLIBCXX_3.4.9
FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCXX_3.4
FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCXX_3.4
@@ -1353,6 +1356,7 @@ FUNC:_ZNSt11range_errorD2Ev@@GLIBCXX_3.4.15
FUNC:_ZNSt11regex_errorD0Ev@@GLIBCXX_3.4.15
FUNC:_ZNSt11regex_errorD1Ev@@GLIBCXX_3.4.15
FUNC:_ZNSt11regex_errorD2Ev@@GLIBCXX_3.4.15
+FUNC:_ZNSt11this_thread11__sleep_forENSt6chrono8durationIlSt5ratioILl1ELl1EEEENS1_IlS2_ILl1ELl1000000000EEEE@@GLIBCXX_3.4.18
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCXX_3.4
FUNC:_ZNSt12__basic_fileIcE4fileEv@@GLIBCXX_3.4.1
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCXX_3.4
@@ -1635,6 +1639,11 @@ FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEs@@GLIBCXX_3.4
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEt@@GLIBCXX_3.4
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEx@@GLIBCXX_3.4
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEy@@GLIBCXX_3.4
+FUNC:_ZNSt13random_device14_M_init_pretr1ERKSs@@GLIBCXX_3.4.18
+FUNC:_ZNSt13random_device16_M_getval_pretr1Ev@@GLIBCXX_3.4.18
+FUNC:_ZNSt13random_device7_M_finiEv@@GLIBCXX_3.4.18
+FUNC:_ZNSt13random_device7_M_initERKSs@@GLIBCXX_3.4.18
+FUNC:_ZNSt13random_device9_M_getvalEv@@GLIBCXX_3.4.18
FUNC:_ZNSt13runtime_errorC1ERKSs@@GLIBCXX_3.4
FUNC:_ZNSt13runtime_errorC2ERKSs@@GLIBCXX_3.4
FUNC:_ZNSt13runtime_errorD0Ev@@GLIBCXX_3.4
@@ -2393,14 +2402,17 @@ FUNC:_ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order@@GLIBCXX_3.4.1
FUNC:_ZNVSt9__atomic011atomic_flag5clearESt12memory_order@@GLIBCXX_3.4.11
FUNC:_ZSt10unexpectedv@@GLIBCXX_3.4
FUNC:_ZSt11_Hash_bytesPKvmm@@CXXABI_1.3.5
+FUNC:_ZSt13get_terminatev@@GLIBCXX_3.4.19
FUNC:_ZSt13set_terminatePFvvE@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIfEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIgEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_LDBL_3.4
+FUNC:_ZSt14get_unexpectedv@@GLIBCXX_3.4.19
FUNC:_ZSt14set_unexpectedPFvvE@@GLIBCXX_3.4
FUNC:_ZSt15_Fnv_hash_bytesPKvmm@@CXXABI_1.3.5
FUNC:_ZSt15future_categoryv@@GLIBCXX_3.4.15
+FUNC:_ZSt15get_new_handlerv@@GLIBCXX_3.4.19
FUNC:_ZSt15set_new_handlerPFvvE@@GLIBCXX_3.4
FUNC:_ZSt15system_categoryv@@GLIBCXX_3.4.11
FUNC:_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@@GLIBCXX_3.4.9
@@ -2678,6 +2690,7 @@ FUNC:__cxa_guard_acquire@@CXXABI_1.3
FUNC:__cxa_guard_release@@CXXABI_1.3
FUNC:__cxa_pure_virtual@@CXXABI_1.3
FUNC:__cxa_rethrow@@CXXABI_1.3
+FUNC:__cxa_thread_atexit@@CXXABI_1.3.7
FUNC:__cxa_throw@@CXXABI_1.3
FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
FUNC:__cxa_vec_cctor@@CXXABI_1.3
@@ -2724,6 +2737,7 @@ OBJECT:0:CXXABI_1.3.3
OBJECT:0:CXXABI_1.3.4
OBJECT:0:CXXABI_1.3.5
OBJECT:0:CXXABI_1.3.6
+OBJECT:0:CXXABI_1.3.7
OBJECT:0:CXXABI_LDBL_1.3
OBJECT:0:CXXABI_TM_1
OBJECT:0:GLIBCXX_3.4
@@ -2736,6 +2750,8 @@ OBJECT:0:GLIBCXX_3.4.14
OBJECT:0:GLIBCXX_3.4.15
OBJECT:0:GLIBCXX_3.4.16
OBJECT:0:GLIBCXX_3.4.17
+OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
OBJECT:0:GLIBCXX_3.4.2
OBJECT:0:GLIBCXX_3.4.3
OBJECT:0:GLIBCXX_3.4.4
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 2a9d582853d..978641f076b 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1344,6 +1344,19 @@ GLIBCXX_3.4.18 {
} GLIBCXX_3.4.17;
+GLIBCXX_3.4.19 {
+
+ # std::get_new_handler()
+ _ZSt15get_new_handlerv;
+
+ # std::get_terminate()
+ _ZSt13get_terminatev;
+
+ # std::get_unexpected()
+ _ZSt14get_unexpectedv;
+
+} GLIBCXX_3.4.18;
+
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1.3 {
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index d867af37114..44374746c2b 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -3530,11 +3530,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
+# Always define AMTAR for backward compatibility.
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
@@ -20413,11 +20413,65 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: for suitable sys/sdt.h" >&5
+$as_echo "for suitable sys/sdt.h" >&6; }
+ # Note that this test has to be run with the C language.
+ # Otherwise, sdt.h will try to include some headers from
+ # libstdc++ itself.
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test "${glibcxx_cv_sys_sdt_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Because we have to run the test in C, we use grep rather
+ # than the compiler to check for the bug. The bug is that
+ # were strings without trailing whitespace, causing g++
+ # to look for operator"". The pattern searches for the fixed
+ # output.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/sdt.h>
+ int f() { STAP_PROBE(hi, bob); }
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP " \",\" " >/dev/null 2>&1; then :
+ glibcxx_cv_sys_sdt_h=yes
+else
+ glibcxx_cv_sys_sdt_h=no
+fi
+rm -f conftest*
+
+
+fi
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test $glibcxx_cv_sys_sdt_h = yes; then
+
+$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+$as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+
+
# Check for available headers.
for ac_header in endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
-sys/resource.h sys/sdt.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
+sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
wchar.h wctype.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -71477,7 +71531,7 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
fi
# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:18:0
+libtool_VERSION=6:19:0
# Everything parsed; figure out what files and settings to use.
case $enable_symvers in
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index de664064491..73d430ac105 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -211,12 +211,13 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
GLIBCXX_CHECK_SC_NPROC_ONLN
GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
GLIBCXX_CHECK_SYSCTL_HW_NCPU
+GLIBCXX_CHECK_SDT_H
# Check for available headers.
AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
-sys/resource.h sys/sdt.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
+sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
wchar.h wctype.h])
# Only do link tests if native. Else, hardcode.
diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html
index cc338d23eeb..e1b6e44760d 100644
--- a/libstdc++-v3/doc/html/api.html
+++ b/libstdc++-v3/doc/html/api.html
@@ -1,12 +1,12 @@
<?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>The GNU C++ Library API Reference</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="bk02.html" title="" /><link rel="prev" href="bk02.html" title="" /><link rel="next" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library API Reference</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr></table><hr /></div><div class="article"><div class="titlepage"><div><div><h1 class="title"><a id="api"></a>The GNU C++ Library API Reference</h1></div><div><p class="copyright">Copyright ©
+<!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 API Reference</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="bk02.html" title="" /><link rel="prev" href="bk02.html" title="" /><link rel="next" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library API Reference</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr></table><hr /></div><div class="article"><div class="titlepage"><div><div><h1 class="title"><a id="api"></a>The GNU C++ Library API Reference</h1></div><div><p class="copyright">Copyright ©
2008
,
2010
<a class="link" href="http://www.fsf.org/" target="_top">FSF
</a>
- </p></div><div><div class="legalnotice"><a id="idp3706336"></a><p>
+ </p></div><div><div class="legalnotice"><a id="idm140623083743856"></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/bk02.html b/libstdc++-v3/doc/html/bk02.html
index df887b8b3b7..4529fb8a230 100644
--- a/libstdc++-v3/doc/html/bk02.html
+++ b/libstdc++-v3/doc/html/bk02.html
@@ -1,2 +1,2 @@
<?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></title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library" /><link rel="prev" href="manual/backwards.html" title="Backwards Compatibility" /><link rel="next" href="api.html" title="The GNU C++ Library API Reference" /></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="manual/backwards.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Backwards Compatibility </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The GNU C++ Library API Reference</td></tr></table></div></body></html> \ No newline at end of file
+<!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></title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library" /><link rel="prev" href="manual/backwards.html" title="Backwards Compatibility" /><link rel="next" href="api.html" title="The GNU C++ Library API Reference" /></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="manual/backwards.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Backwards Compatibility </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The GNU C++ Library API Reference</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/html/bk03.html b/libstdc++-v3/doc/html/bk03.html
index 316d2cd7bb2..072e7faa59f 100644
--- a/libstdc++-v3/doc/html/bk03.html
+++ b/libstdc++-v3/doc/html/bk03.html
@@ -1,2 +1,2 @@
<?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></title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library" /><link rel="prev" href="api.html" title="The GNU C++ Library API Reference" /><link rel="next" href="faq.html" title="Frequently Asked Questions" /></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="api.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library API Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html> \ No newline at end of file
+<!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></title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library" /><link rel="prev" href="api.html" title="The GNU C++ Library API Reference" /><link rel="next" href="faq.html" title="Frequently Asked Questions" /></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="api.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library API Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html
index b90c93f9e5b..d4164198abc 100644
--- a/libstdc++-v3/doc/html/faq.html
+++ b/libstdc++-v3/doc/html/faq.html
@@ -1,9 +1,9 @@
<?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>Frequently Asked Questions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="bk03.html" title="" /><link rel="prev" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frequently Asked Questions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> </td></tr></table><hr /></div><div class="article"><div class="titlepage"><div><div><h1 class="title"><a id="faq"></a>Frequently Asked Questions</h1></div><div><p class="copyright">Copyright ©
+<!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>Frequently Asked Questions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="up" href="bk03.html" title="" /><link rel="prev" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frequently Asked Questions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> </td></tr></table><hr /></div><div class="article"><div class="titlepage"><div><div><h1 class="title"><a id="faq"></a>Frequently Asked Questions</h1></div><div><p class="copyright">Copyright ©
2008, 2010
<a class="link" href="http://www.fsf.org" target="_top">FSF</a>
- </p></div></div><hr /></div><div class="qandaset"><a id="idp1581728"></a><dl><dt></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what">
+ </p></div></div><hr /></div><div class="qandaset"><a id="idm140623083442864"></a><dl><dt></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/index.html b/libstdc++-v3/doc/html/index.html
index 7481dc9d04d..363c9a35dd4 100644
--- a/libstdc++-v3/doc/html/index.html
+++ b/libstdc++-v3/doc/html/index.html
@@ -1,5 +1,5 @@
<?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>The GNU C++ Library</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="description" content="Short Contents Copyright (C) 2008-2013 FSF Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. This is the top level of the libstdc++ documentation set. The documentation is divided into the following three sections. Manual Frequently Asked Questions API and Source Documentation" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="next" href="manual/index.html" title="The GNU C++ Library Manual" /></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"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library</h1></div><div><div class="abstract"><a id="contents"></a><p class="title"><strong>Short Contents</strong></p><p>
+<!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-NS Stylesheets V1.78.1" /><meta name="description" content="Short Contents Copyright (C) 2008-2013 FSF Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. This is the top level of the libstdc++ documentation set. The documentation is divided into the following three sections. Manual Frequently Asked Questions API and Source Documentation" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="next" href="manual/index.html" title="The GNU C++ Library Manual" /></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"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library</h1></div><div><div class="abstract"><a id="contents"></a><p class="title"><strong>Short Contents</strong></p><p>
Copyright (C) 2008-2013
<a class="link" href="http://www.fsf.org/" target="_top">FSF
</a>
@@ -20,7 +20,7 @@
</p></li><li class="listitem"><p>
<a class="link" href="api.html" title="The GNU C++ Library API Reference">API and Source Documentation</a>
</p></li></ul></div><p>
- </p></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="book"><a href="manual/index.html">The GNU C++ Library Manual</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I.
+ </p></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="book"><a href="manual/index.html">The GNU C++ Library Manual</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I.
Introduction
</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="manual/status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="manual/status.html#status.iso.2011">C++ 2011</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#iso.2011.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#iso.tr1.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="manual/status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="section"><a href="manual/make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/std_contents.html">II.
@@ -34,13 +34,13 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/concept_checking.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/utilities.html">6.
Utilities
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="manual/pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="manual/memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#idp13920976">Interface Design</a></span></dt><dt><span class="section"><a href="manual/memory.html#idp13924528">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#idp13937824">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="manual/memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#idp15512272">Class Hierarchy</a></span></dt><dt><span class="section"><a href="manual/memory.html#idp15534784">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/memory.html#idp15542080">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#idp15556704">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#idp15573056">Examples</a></span></dt><dt><span class="section"><a href="manual/memory.html#idp15576640">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/strings.html">7.
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="manual/pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="manual/memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#idm140623072965760">Interface Design</a></span></dt><dt><span class="section"><a href="manual/memory.html#idm140623072962208">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#idm140623072948912">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="manual/memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#idm140623071372480">Class Hierarchy</a></span></dt><dt><span class="section"><a href="manual/memory.html#idm140623071349968">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/memory.html#idm140623071342672">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#idm140623071328048">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#idm140623071311696">Examples</a></span></dt><dt><span class="section"><a href="manual/memory.html#idm140623071308112">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/localization.html">8.
Localization
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="manual/localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#idp15778336">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="manual/facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9.
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="manual/localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#idm140623071106352">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="manual/facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9.
Containers
</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="manual/containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="manual/associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="manual/associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="manual/unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/iterators.html">10.
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html
index c5cf1edbb4b..9cd25388bd5 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -1,5 +1,5 @@
<?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>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, ABI, version, dynamic, shared, compatibility" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="test.html" title="Test" /><link rel="next" href="api.html" title="API Evolution and Deprecation History" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<!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>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, ABI, version, dynamic, shared, compatibility" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="test.html" title="Test" /><link rel="next" href="api.html" title="API Evolution and Deprecation History" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="section"><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>
@@ -493,39 +493,39 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="link" href="http://www.codesourcery.com/cxx-abi/" target="_top">
C++ ABI Summary
</a>
- </em>. </span></p></div><div class="biblioentry"><a id="idp22945936"></a><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry"><a id="idm140623063941744"></a><p><span class="title"><em>
<a class="link" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" target="_top">
Intel Compilers for Linux Compatibility with the GNU Compilers
</a>
- </em>. </span></p></div><div class="biblioentry"><a id="idp22947792"></a><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry"><a id="idm140623063939888"></a><p><span class="title"><em>
<a class="link" href="http://download.oracle.com/docs/cd/E19963-01/html/819-0690/index.html" target="_top">
Linker and Libraries Guide (document 819-0690)
</a>
- </em>. </span></p></div><div class="biblioentry"><a id="idp22949632"></a><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry"><a id="idm140623063938048"></a><p><span class="title"><em>
<a class="link" href="http://download.oracle.com/docs/cd/E19422-01/819-3689/index.html" target="_top">
Sun Studio 11: C++ Migration Guide (document 819-3689)
</a>
- </em>. </span></p></div><div class="biblioentry"><a id="idp22951488"></a><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry"><a id="idm140623063936192"></a><p><span class="title"><em>
<a class="link" href="http://www.akkadia.org/drepper/dsohowto.pdf" target="_top">
How to Write Shared Libraries
</a>
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="idp22954928"></a><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="idm140623063932752"></a><p><span class="title"><em>
<a class="link" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top">
C++ ABI for the ARM Architecture
</a>
- </em>. </span></p></div><div class="biblioentry"><a id="idp22956736"></a><p><span class="title"><em>
+ </em>. </span></p></div><div class="biblioentry"><a id="idm140623063930944"></a><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top">
Dynamic Shared Objects: Survey and Issues
</a>
</em>. </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="idp22960032"></a><p><span class="title"><em>
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="idm140623063927648"></a><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" target="_top">
Versioning With Namespaces
</a>
</em>. </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="idp22963312"></a><p><span class="title"><em>
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="idm140623063924368"></a><p><span class="title"><em>
<a class="link" href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf" target="_top">
Binary Compatibility of Shared Libraries Implemented in C++
on GNU/Linux Systems
diff --git a/libstdc++-v3/doc/html/manual/algorithms.html b/libstdc++-v3/doc/html/manual/algorithms.html
index e02cc5b2a05..89a5113430f 100644
--- a/libstdc++-v3/doc/html/manual/algorithms.html
+++ b/libstdc++-v3/doc/html/manual/algorithms.html
@@ -1,13 +1,13 @@
<?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>Chapter 11.  Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library, algorithm" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="iterators.html" title="Chapter 10.  Iterators" /><link rel="next" href="numerics.html" title="Chapter 12.  Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. 
+<!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>Chapter 11.  Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library, algorithm" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="iterators.html" title="Chapter 10.  Iterators" /><link rel="next" href="numerics.html" title="Chapter 12.  Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. 
Algorithms
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="iterators.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.algorithms"></a>Chapter 11. 
Algorithms
- <a id="idp16191968" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div><p>
+ <a id="idm140623070692736" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div><p>
The neatest accomplishment of the algorithms section is that all the
work is done via iterators, not containers directly. This means two
important things:
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index c3538ad1884..af6af248972 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -1,5 +1,5 @@
<?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>API Evolution and Deprecation History</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, api, evolution, deprecation, history" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="abi.html" title="ABI Policy and Guidelines" /><link rel="next" href="backwards.html" title="Backwards Compatibility" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API Evolution and Deprecation History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<!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>API Evolution and Deprecation History</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, api, evolution, deprecation, history" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="abi.html" title="ABI Policy and Guidelines" /><link rel="next" href="backwards.html" title="Backwards Compatibility" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API Evolution and Deprecation History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.api"></a>API Evolution and Deprecation History</h2></div></div></div><p>
@@ -77,11 +77,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="idp23030528"></a><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idm140623063857152"></a><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idp23058160"></a><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></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="idm140623063829520"></a><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></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.html b/libstdc++-v3/doc/html/manual/appendix.html
index f1525fead8f..58dd937a7bd 100644
--- a/libstdc++-v3/doc/html/manual/appendix.html
+++ b/libstdc++-v3/doc/html/manual/appendix.html
@@ -1,9 +1,9 @@
<?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>Part IV.  Appendices</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="ext_concurrency_use.html" title="Use" /><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IV. 
+<!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>Part IV.  Appendices</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="ext_concurrency_use.html" title="Use" /><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IV. 
Appendices
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency_use.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td width="20%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr /></div><div class="part"><div class="titlepage"><div><div><h1 class="title"><a id="appendix"></a>Part IV. 
Appendices
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="appendix"><a href="appendix_contributing.html">A.
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="appendix"><a href="appendix_contributing.html">A.
Contributing
</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B.
diff --git a/libstdc++-v3/doc/html/manual/appendix_contributing.html b/libstdc++-v3/doc/html/manual/appendix_contributing.html
index 108735a0d27..fb30f361707 100644
--- a/libstdc++-v3/doc/html/manual/appendix_contributing.html
+++ b/libstdc++-v3/doc/html/manual/appendix_contributing.html
@@ -1,16 +1,19 @@
<?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>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="appendix.html" title="Part IV.  Appendices" /><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
+<!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>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="appendix.html" title="Part IV.  Appendices" /><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
Contributing
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.contrib"></a>
Contributing
- <a id="idp21875168" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><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
- write access to the source repository. First time contributors
+ <a id="idm140623065010896" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
+ The GNU C++ Library is part of GCC and follows the same development model,
+ so the general rules for
+ <a class="link" href="http://gcc.gnu.org/contribute.html" target="_top">contributing
+ to GCC</a> apply. Active
+ contributors are assigned maintainership responsibility, and given
+ write access to the source repository. First-time contributors
should follow this procedure:
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.list"></a>Contributor Checklist</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="list.reading"></a>Reading</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Get and read the relevant sections of the C++ language
@@ -24,19 +27,14 @@
organization is
<a class="link" href="http://www.ansi.org" target="_top">ANSI</a>.
(And if you've already registered with them you can
- <a class="link" href="http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2003" target="_top">buy the standard on-line</a>.)
+ <a class="link" href="http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2012" target="_top">buy the standard on-line</a>.)
</p></li><li class="listitem"><p>
The library working group bugs, and known defects, can
be obtained here:
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/" target="_top">http://www.open-std.org/jtc1/sc22/wg21</a>
</p></li><li class="listitem"><p>
- The newsgroup dedicated to standardization issues is
- comp.std.c++: the
- <a class="link" href="http://www.comeaucomputing.com/csc/faq.html" target="_top">FAQ</a>
- for this group is quite useful.
- </p></li><li class="listitem"><p>
Peruse
- the <a class="link" href="http://www.gnu.org/prep/standards" target="_top">GNU
+ the <a class="link" href="http://www.gnu.org/prep/standards/" target="_top">GNU
Coding Standards</a>, and chuckle when you hit the part
about <span class="quote">“<span class="quote">Using Languages Other Than C</span>â€</span>.
</p></li><li class="listitem"><p>
@@ -48,10 +46,7 @@
library-specific information found in
<a class="link" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance">Porting and Maintenance</a>.
</p></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="list.copyright"></a>Assignment</h3></div></div></div><p>
- Small changes can be accepted without a copyright assignment form on
- file. New code and additions to the library need completed copyright
- assignment form on file at the FSF. Note: your employer may be required
- to fill out appropriate disclaimer forms as well.
+ See the <a class="link" href="http://gcc.gnu.org/contribute.html#legal" target="_top">legal prerequisites</a> for all GCC contributions.
</p><p>
Historically, the libstdc++ assignment form added the following
question:
@@ -64,10 +59,6 @@
While not strictly necessary, humoring the maintainers and answering
this question would be appreciated.
</p><p>
- For more information about getting a copyright assignment, please see
- <a class="link" href="http://www.gnu.org/prep/maintain/html_node/Legal-Matters.html" target="_top">Legal
- Matters</a>.
- </p><p>
Please contact Benjamin Kosnik at
<code class="email">&lt;<a class="email" href="mailto:bkoz+assign@redhat.com">bkoz+assign@redhat.com</a>&gt;</code> if you are confused
about the assignment or have general licensing questions. When
diff --git a/libstdc++-v3/doc/html/manual/appendix_free.html b/libstdc++-v3/doc/html/manual/appendix_free.html
index e57119c3e67..0976a43d507 100644
--- a/libstdc++-v3/doc/html/manual/appendix_free.html
+++ b/libstdc++-v3/doc/html/manual/appendix_free.html
@@ -1,12 +1,12 @@
<?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>Appendix C.  Free Software Needs Free Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="backwards.html" title="Backwards Compatibility" /><link rel="next" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. 
+<!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>Appendix C.  Free Software Needs Free Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="backwards.html" title="Backwards Compatibility" /><link rel="next" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. 
Free Software Needs Free Documentation
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.free"></a>
Free Software Needs Free Documentation
- <a id="idp23426192" class="indexterm"></a>
+ <a id="idm140623063461552" class="indexterm"></a>
</h1></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_gfdl.html b/libstdc++-v3/doc/html/manual/appendix_gfdl.html
index 641c5852728..d0531b67dbb 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gfdl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gfdl.html
@@ -1,5 +1,5 @@
<?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>Appendix E. GNU Free Documentation License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /><link rel="next" href="../bk02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix E. GNU Free Documentation License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><th width="60%" align="center">Part IV. 
+<!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>Appendix E. GNU Free Documentation License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /><link rel="next" href="../bk02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix E. GNU Free Documentation License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.gfdl-1.3"></a>GNU Free Documentation License</h1></div></div></div><p>Version 1.3, 3 November 2008</p><p>
Copyright © 2000, 2001, 2002, 2007, 2008
diff --git a/libstdc++-v3/doc/html/manual/appendix_gpl.html b/libstdc++-v3/doc/html/manual/appendix_gpl.html
index f2f3caf67fb..58e45adfcfa 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gpl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gpl.html
@@ -1,5 +1,5 @@
<?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>Appendix D.  GNU General Public License version 3</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /><link rel="next" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix D. 
+<!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>Appendix D.  GNU General Public License version 3</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /><link rel="next" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix D. 
<acronym class="acronym">GNU</acronym> General Public License version 3
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_free.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
@@ -77,7 +77,7 @@
</p><p>
The precise terms and conditions for copying, distribution and modification
follow.
- </p><h2><a id="idp23466384"></a>
+ </p><h2><a id="idm140623063421360"></a>
TERMS AND CONDITIONS
</h2><h2><a id="gpl-3-definitions"></a>
0. Definitions.
@@ -618,7 +618,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="idp23565184"></a>
+ </p><h2><a id="idm140623063322432"></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 4a07cf91295..44f6bfdf798 100644
--- a/libstdc++-v3/doc/html/manual/appendix_porting.html
+++ b/libstdc++-v3/doc/html/manual/appendix_porting.html
@@ -1,13 +1,13 @@
<?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>Appendix B.  Porting and Maintenance</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="source_design_notes.html" title="Design Notes" /><link rel="next" href="documentation_hacking.html" title="Writing and Generating Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. 
+<!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>Appendix B.  Porting and Maintenance</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix.html" title="Part IV.  Appendices" /><link rel="prev" href="source_design_notes.html" title="Design Notes" /><link rel="next" href="documentation_hacking.html" title="Writing and Generating Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. 
Porting and Maintenance
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_design_notes.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td width="20%" align="right"> <a accesskey="n" href="documentation_hacking.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.porting"></a>
Porting and Maintenance
- <a id="idp22008864" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.overview">Overview</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.overview.basic">General Process</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.overview.map">What Comes from Where</a></span></dt></dl></dd><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure">Configure</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="appendix_porting.html#build_hacking.make">Make</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.debug">Debugging Generation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.debug">Debugging Generation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety">
+ <a id="idm140623064878960" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.overview">Overview</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.overview.basic">General Process</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.overview.map">What Comes from Where</a></span></dt></dl></dd><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure">Configure</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.configure.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="appendix_porting.html#build_hacking.make">Make</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.debug">Debugging Generation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.debug">Debugging Generation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety">
Qualifying Exception Safety Guarantees
</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
@@ -61,7 +61,7 @@ make all
in the build directory starts the build process. The <code class="literal">all</code> target comes from the <code class="filename">Makefile</code> file, which is generated via <span class="command"><strong>configure</strong></span> from the <code class="filename">Makefile.in</code> file, which is in turn generated (via
<span class="command"><strong>automake</strong></span>) from the file
<code class="filename">Makefile.am</code>.
-</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="build_hacking.overview.map"></a>What Comes from Where</h4></div></div></div><div class="figure"><a id="idp22035648"></a><p class="title"><strong>Figure B.1. Configure and Build File Dependencies</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/confdeps.png" align="middle" alt="Dependency Graph for Configure and Build Files" /></div></div></div><br class="figure-break" /><p>
+</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="build_hacking.overview.map"></a>What Comes from Where</h4></div></div></div><div class="figure"><a id="idm140623064852112"></a><p class="title"><strong>Figure B.1. Configure and Build File Dependencies</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/confdeps.png" align="middle" alt="Dependency Graph for Configure and Build Files" /></div></div></div><br class="figure-break" /><p>
Regenerate all generated files by using the command
<code class="code">autoreconf</code> at the top level of the libstdc++ source
directory.
diff --git a/libstdc++-v3/doc/html/manual/associative.html b/libstdc++-v3/doc/html/manual/associative.html
index 21b01044da7..57fab546b72 100644
--- a/libstdc++-v3/doc/html/manual/associative.html
+++ b/libstdc++-v3/doc/html/manual/associative.html
@@ -1,5 +1,5 @@
<?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>Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9.  Containers" /><link rel="prev" href="containers.html" title="Chapter 9.  Containers" /><link rel="next" href="unordered_associative.html" title="Unordered Associative" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="containers.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
+<!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>Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9.  Containers" /><link rel="prev" href="containers.html" title="Chapter 9.  Containers" /><link rel="next" href="unordered_associative.html" title="Unordered Associative" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="containers.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
Containers
</th><td width="20%" align="right"> <a accesskey="n" href="unordered_associative.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.associative"></a>Associative</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.associative.insert_hints"></a>Insertion Hints</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/atomics.html b/libstdc++-v3/doc/html/manual/atomics.html
index f16fd827841..7e0a7439cf5 100644
--- a/libstdc++-v3/doc/html/manual/atomics.html
+++ b/libstdc++-v3/doc/html/manual/atomics.html
@@ -1,13 +1,13 @@
<?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>Chapter 14.  Atomics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library, atomic" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="io_and_c.html" title="Interacting with C" /><link rel="next" href="concurrency.html" title="Chapter 15.  Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. 
+<!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>Chapter 14.  Atomics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library, atomic" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="io_and_c.html" title="Interacting with C" /><link rel="next" href="concurrency.html" title="Chapter 15.  Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. 
Atomics
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics"></a>Chapter 14. 
Atomics
- <a id="idp16390640" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></div><p>
+ <a id="idm140623070494192" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></div><p>
Facilities for atomic operations.
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.atomics.api"></a>API Reference</h2></div></div></div><p>
All items are declared in the standard header
diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html
index d8e391360c7..44faea91e8f 100644
--- a/libstdc++-v3/doc/html/manual/backwards.html
+++ b/libstdc++-v3/doc/html/manual/backwards.html
@@ -1,5 +1,5 @@
<?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>Backwards Compatibility</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, backwards" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="api.html" title="API Evolution and Deprecation History" /><link rel="next" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backwards Compatibility</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<!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>Backwards Compatibility</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, backwards" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="api.html" title="API Evolution and Deprecation History" /><link rel="next" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backwards Compatibility</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="appendix_free.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.appendix.porting.backwards"></a>Backwards Compatibility</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.first"></a>First</h3></div></div></div><p>The first generation GNU C++ library was called libg++. It was a
@@ -940,15 +940,15 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
This is a change in behavior from older versions. 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"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="idp23415104"></a><p><span class="title"><em>
+</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="idm140623063472640"></a><p><span class="title"><em>
<a class="link" href="http://www.kegel.com/gcc/gcc4.html" target="_top">
Migrating to GCC 4.1
</a>
- </em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="idp23417888"></a><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="idm140623063469856"></a><p><span class="title"><em>
<a class="link" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top">
Building the Whole Debian Archive with GCC 4.1: A Summary
</a>
- </em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="idp23420736"></a><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="idm140623063467008"></a><p><span class="title"><em>
<a class="link" href="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html" target="_top">
Migration guide for GCC-3.2
</a>
diff --git a/libstdc++-v3/doc/html/manual/bitmap_allocator.html b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
index e8a75d11559..fc48f65dc5b 100644
--- a/libstdc++-v3/doc/html/manual/bitmap_allocator.html
+++ b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
@@ -1,8 +1,8 @@
<?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>Chapter 21. The bitmap_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /><link rel="next" href="bitmap_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. The bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_multi.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 21. The bitmap_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /><link rel="next" href="bitmap_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. The bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_multi.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.bitmap"></a>Chapter 21. The bitmap_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.bitmap"></a>Chapter 21. The bitmap_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></div><p>
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.design"></a>Design</h2></div></div></div><p>
As this name suggests, this allocator uses a bit-map to keep track
of the used and unused memory locations for its book-keeping
diff --git a/libstdc++-v3/doc/html/manual/bitmap_allocator_impl.html b/libstdc++-v3/doc/html/manual/bitmap_allocator_impl.html
index 2f16969ab4d..945add65b7a 100644
--- a/libstdc++-v3/doc/html/manual/bitmap_allocator_impl.html
+++ b/libstdc++-v3/doc/html/manual/bitmap_allocator_impl.html
@@ -1,5 +1,5 @@
<?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>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /><link rel="prev" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /><link rel="next" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 21. The bitmap_allocator</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.free_list_store"></a>Free List Store</h3></div></div></div><p>
+<!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>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /><link rel="prev" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /><link rel="next" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 21. The bitmap_allocator</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.free_list_store"></a>Free List Store</h3></div></div></div><p>
The Free List Store (referred to as FLS for the remaining part of this
document) is the Global memory pool that is shared by all instances of
the bitmapped allocator instantiated for any type. This maintains a
@@ -75,7 +75,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="idp17500848"></a><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623069384160"></a><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index 1c9c22adc91..e9301d99bf3 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -1,5 +1,5 @@
<?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>Bugs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="license.html" title="License" /><link rel="next" href="setup.html" title="Chapter 2. Setup" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.bugs"></a>Bugs</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"></a>Implementation Bugs</h3></div></div></div><p>
+<!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>Bugs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="license.html" title="License" /><link rel="next" href="setup.html" title="Chapter 2. Setup" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.bugs"></a>Bugs</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"></a>Implementation Bugs</h3></div></div></div><p>
Information on known bugs, details on efforts to fix them, and
fixed bugs are all available as part of the <a class="link" href="http://gcc.gnu.org/bugs/" target="_top">GCC bug tracking system</a>,
with the category set to <code class="literal">libstdc++</code>.
diff --git a/libstdc++-v3/doc/html/manual/concept_checking.html b/libstdc++-v3/doc/html/manual/concept_checking.html
index e115a5e1956..883eb5a7721 100644
--- a/libstdc++-v3/doc/html/manual/concept_checking.html
+++ b/libstdc++-v3/doc/html/manual/concept_checking.html
@@ -1,5 +1,5 @@
<?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>Concept Checking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="diagnostics.html" title="Chapter 5.  Diagnostics" /><link rel="prev" href="diagnostics.html" title="Chapter 5.  Diagnostics" /><link rel="next" href="utilities.html" title="Chapter 6.  Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concept Checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Chapter 5. 
+<!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>Concept Checking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="diagnostics.html" title="Chapter 5.  Diagnostics" /><link rel="prev" href="diagnostics.html" title="Chapter 5.  Diagnostics" /><link rel="next" href="utilities.html" title="Chapter 6.  Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concept Checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Chapter 5. 
Diagnostics
</th><td width="20%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.diagnostics.concept_checking"></a>Concept Checking</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/concurrency.html b/libstdc++-v3/doc/html/manual/concurrency.html
index 22f5bac74e6..bd2d0a029b0 100644
--- a/libstdc++-v3/doc/html/manual/concurrency.html
+++ b/libstdc++-v3/doc/html/manual/concurrency.html
@@ -1,13 +1,13 @@
<?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>Chapter 15.  Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library, mutex, thread, future, condition_variable" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="atomics.html" title="Chapter 14.  Atomics" /><link rel="next" href="extensions.html" title="Part III.  Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. 
+<!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>Chapter 15.  Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library, mutex, thread, future, condition_variable" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="atomics.html" title="Chapter 14.  Atomics" /><link rel="next" href="extensions.html" title="Part III.  Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. 
Concurrency
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="atomics.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency"></a>Chapter 15. 
Concurrency
- <a id="idp16404464" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></div><p>
+ <a id="idm140623070480368" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><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="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.concurrency.api"></a>API Reference</h2></div></div></div><p>
All items are declared in one of four standard header files.
diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
index 34f20168493..5526dee44f2 100644
--- a/libstdc++-v3/doc/html/manual/configure.html
+++ b/libstdc++-v3/doc/html/manual/configure.html
@@ -1,5 +1,5 @@
<?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>Configure</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, configure, options" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="setup.html" title="Chapter 2. Setup" /><link rel="next" href="make.html" title="Make" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.configure"></a>Configure</h2></div></div></div><p>
+<!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>Configure</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, configure, options" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="setup.html" title="Chapter 2. Setup" /><link rel="next" href="make.html" title="Make" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.configure"></a>Configure</h2></div></div></div><p>
When configuring libstdc++, you'll have to configure the entire
<span class="emphasis"><em>gccsrcdir</em></span> directory. Consider using the
toplevel gcc configuration option
diff --git a/libstdc++-v3/doc/html/manual/containers.html b/libstdc++-v3/doc/html/manual/containers.html
index 4652eda446b..a1d35f069c2 100644
--- a/libstdc++-v3/doc/html/manual/containers.html
+++ b/libstdc++-v3/doc/html/manual/containers.html
@@ -1,13 +1,13 @@
<?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>Chapter 9.  Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="facets.html" title="Facets" /><link rel="next" href="associative.html" title="Associative" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. 
+<!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>Chapter 9.  Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="facets.html" title="Facets" /><link rel="next" href="associative.html" title="Associative" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. 
Containers
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers"></a>Chapter 9. 
Containers
- <a id="idp16037808" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"></a>list::size() is O(n)</h4></div></div></div><p>
+ <a id="idm140623070846688" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="section"><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
quoted from <a class="link" href="http://www.sgi.com/tech/stl/FAQ.html" target="_top">their FAQ</a>:
diff --git a/libstdc++-v3/doc/html/manual/containers_and_c.html b/libstdc++-v3/doc/html/manual/containers_and_c.html
index 2887ec268e5..c8f44defba3 100644
--- a/libstdc++-v3/doc/html/manual/containers_and_c.html
+++ b/libstdc++-v3/doc/html/manual/containers_and_c.html
@@ -1,5 +1,5 @@
<?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>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9.  Containers" /><link rel="prev" href="unordered_associative.html" title="Unordered Associative" /><link rel="next" href="iterators.html" title="Chapter 10.  Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="unordered_associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
+<!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>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9.  Containers" /><link rel="prev" href="unordered_associative.html" title="Unordered Associative" /><link rel="next" href="iterators.html" title="Chapter 10.  Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="unordered_associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
Containers
</th><td width="20%" align="right"> <a accesskey="n" href="iterators.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.c"></a>Interacting with C</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.c.vs_array"></a>Containers vs. Arrays</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/debug.html b/libstdc++-v3/doc/html/manual/debug.html
index 9193cf67100..458a1379e7d 100644
--- a/libstdc++-v3/doc/html/manual/debug.html
+++ b/libstdc++-v3/doc/html/manual/debug.html
@@ -1,5 +1,5 @@
<?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>Debugging Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_exceptions.html" title="Exceptions" /><link rel="next" href="std_contents.html" title="Part II.  Standard Contents" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="std_contents.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.debug"></a>Debugging Support</h2></div></div></div><p>
+<!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>Debugging Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_exceptions.html" title="Exceptions" /><link rel="next" href="std_contents.html" title="Part II.  Standard Contents" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="std_contents.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.debug"></a>Debugging Support</h2></div></div></div><p>
There are numerous things that can be done to improve the ease with
which C++ binaries are debugged when using the GNU tool chain. Here
are some of them.
@@ -161,7 +161,7 @@
DRD</a>,
<a class="link" href="http://valgrind.org/docs/manual/hg-manual.html" target="_top">
Helgrind</a>, and
- <a class="link" href="http://code.google.com/p/data-race-test" target="_top">
+ <a class="link" href="http://code.google.com/p/data-race-test/" target="_top">
ThreadSanitizer</a>.
</p><p>
With DRD, Helgrind and ThreadSanitizer you will need to define
diff --git a/libstdc++-v3/doc/html/manual/debug_mode.html b/libstdc++-v3/doc/html/manual/debug_mode.html
index a297c181b6f..35d9c809a80 100644
--- a/libstdc++-v3/doc/html/manual/debug_mode.html
+++ b/libstdc++-v3/doc/html/manual/debug_mode.html
@@ -1,8 +1,8 @@
<?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>Chapter 17. Debug Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks" /><link rel="next" href="debug_mode_semantics.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Debug Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 17. Debug Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks" /><link rel="next" href="debug_mode_semantics.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Debug Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode_semantics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode"></a>Chapter 17. Debug Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="debug_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="debug_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.link">Link- and run-time coexistence of release- and
+</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode_semantics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode"></a>Chapter 17. Debug Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="debug_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="debug_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.link">Link- and run-time coexistence of release- and
debug-mode components</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.intro"></a>Intro</h2></div></div></div><p>
By default, libstdc++ is built with efficiency in mind, and
therefore performs little or no error checking that is not
diff --git a/libstdc++-v3/doc/html/manual/debug_mode_design.html b/libstdc++-v3/doc/html/manual/debug_mode_design.html
index ccb8575e2b0..747f192c47f 100644
--- a/libstdc++-v3/doc/html/manual/debug_mode_design.html
+++ b/libstdc++-v3/doc/html/manual/debug_mode_design.html
@@ -1,5 +1,5 @@
<?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-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="prev" href="debug_mode_using.html" title="Using" /><link rel="next" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /></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="debug_mode_using.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.design"></a>Design</h2></div></div></div><p>
+<!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-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="prev" href="debug_mode_using.html" title="Using" /><link rel="next" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /></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="debug_mode_using.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.design"></a>Design</h2></div></div></div><p>
</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.goals"></a>Goals</h3></div></div></div><p>
</p><p> The libstdc++ debug mode replaces unsafe (but efficient) standard
containers and iterators with semantically equivalent safe standard
@@ -391,7 +391,7 @@ test02()
</p><p> There are several existing implementations of debug modes for C++
standard library implementations, although none of them directly
supports debugging for programs using libstdc++. The existing
- implementations include:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="link" href="http://www.mathcs.sjsu.edu/faculty/horstman/safestl.html" target="_top">SafeSTL</a>:
+ implementations include:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="link" href="http://www.cs.sjsu.edu/faculty/horstman/safestl.html" target="_top">SafeSTL</a>:
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
diff --git a/libstdc++-v3/doc/html/manual/debug_mode_semantics.html b/libstdc++-v3/doc/html/manual/debug_mode_semantics.html
index 439cf60575f..e877ca6198a 100644
--- a/libstdc++-v3/doc/html/manual/debug_mode_semantics.html
+++ b/libstdc++-v3/doc/html/manual/debug_mode_semantics.html
@@ -1,5 +1,5 @@
<?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>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="prev" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="next" href="debug_mode_using.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode_using.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.semantics"></a>Semantics</h2></div></div></div><p>
+<!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>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="prev" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="next" href="debug_mode_using.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode_using.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.semantics"></a>Semantics</h2></div></div></div><p>
</p><p>A program that uses the C++ standard library correctly
will maintain the same semantics under debug mode as it had with
the normal (release) library. All functional and exception-handling
diff --git a/libstdc++-v3/doc/html/manual/debug_mode_using.html b/libstdc++-v3/doc/html/manual/debug_mode_using.html
index d9f7172f97f..052882a6c45 100644
--- a/libstdc++-v3/doc/html/manual/debug_mode_using.html
+++ b/libstdc++-v3/doc/html/manual/debug_mode_using.html
@@ -1,5 +1,5 @@
<?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>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="prev" href="debug_mode_semantics.html" title="Semantics" /><link rel="next" href="debug_mode_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode_semantics.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.using"></a>Using</h2></div></div></div><p>
+<!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>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, debug" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode" /><link rel="prev" href="debug_mode_semantics.html" title="Semantics" /><link rel="next" href="debug_mode_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode_semantics.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.using"></a>Using</h2></div></div></div><p>
</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.using.mode"></a>Using the Debug Mode</h3></div></div></div><p>To use the libstdc++ debug mode, compile your application with the
compiler flag <code class="code">-D_GLIBCXX_DEBUG</code>. Note that this flag
changes the sizes and behavior of standard class templates such
@@ -18,6 +18,6 @@
mode or with debug mode. The
following table provides the names and headers of the debugging
containers:
-</p><div class="table"><a id="idp16490400"></a><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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++11 mode, these additional
+</p><div class="table"><a id="idm140623070394448"></a><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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++11 mode, these additional
containers have additional debug capability.
-</p><div class="table"><a id="idp16535296"></a><p class="title"><strong>Table 17.2. Debugging Containers C++11</strong></p><div class="table-contents"><table summary="Debugging Containers C++11" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="debug_mode_semantics.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="debug_mode_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html> \ No newline at end of file
+</p><div class="table"><a id="idm140623070349552"></a><p class="title"><strong>Table 17.2. Debugging Containers C++11</strong></p><div class="table-contents"><table summary="Debugging Containers C++11" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="debug_mode_semantics.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="debug_mode_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/diagnostics.html b/libstdc++-v3/doc/html/manual/diagnostics.html
index 82c58e6f551..aff7f8aa4e3 100644
--- a/libstdc++-v3/doc/html/manual/diagnostics.html
+++ b/libstdc++-v3/doc/html/manual/diagnostics.html
@@ -1,13 +1,13 @@
<?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>Chapter 5.  Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="termination.html" title="Termination" /><link rel="next" href="concept_checking.html" title="Concept Checking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. 
+<!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>Chapter 5.  Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="termination.html" title="Termination" /><link rel="next" href="concept_checking.html" title="Concept Checking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. 
Diagnostics
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="termination.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="concept_checking.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics"></a>Chapter 5. 
Diagnostics
- <a id="idp13835248" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="concept_checking.html">Concept Checking</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.diagnostics.exceptions"></a>Exceptions</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.diagnostics.exceptions.api"></a>API Reference</h3></div></div></div><p>
+ <a id="idm140623073051232" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="concept_checking.html">Concept Checking</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.diagnostics.exceptions"></a>Exceptions</h2></div></div></div><div class="section"><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>,
<code class="filename">stdexcept</code>, <code class="filename">new</code>, and
diff --git a/libstdc++-v3/doc/html/manual/documentation_hacking.html b/libstdc++-v3/doc/html/manual/documentation_hacking.html
index e84c8fd49ec..24aac36a534 100644
--- a/libstdc++-v3/doc/html/manual/documentation_hacking.html
+++ b/libstdc++-v3/doc/html/manual/documentation_hacking.html
@@ -1,5 +1,5 @@
<?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>Writing and Generating Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, documentation, style, docbook, doxygen" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="next" href="internals.html" title="Porting to New Hardware or Operating Systems" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing and Generating Documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<!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>Writing and Generating Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, documentation, style, docbook, doxygen" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="next" href="internals.html" title="Porting to New Hardware or Operating Systems" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing and Generating Documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.doc"></a>Writing and Generating Documentation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.intro"></a>Introduction</h3></div></div></div><p>
@@ -112,7 +112,7 @@
supported, and are always aliased to dummy rules. These
unsupported formats are: <span class="emphasis"><em>info</em></span>,
<span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>.
- </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idp22162432"></a><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idm140623064725264"></a><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break" /><p>
Prerequisite tools are Bash 2.0 or later,
<a class="link" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and
the <a class="link" href="http://www.gnu.org/software/coreutils/" target="_top">GNU
@@ -232,9 +232,8 @@
member functions.
</p><p>
Some commentary to accompany
- the first list in the <a class="link" href="http://www.stack.nl/~dimitri/doxygen/docblocks.html" target="_top">Special
- Documentation Blocks</a> section of
- the Doxygen manual:
+ the first list in the <a class="link" href="http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html" target="_top">Special
+ Documentation Blocks</a> section of the Doxygen manual:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>For longer comments, use the Javadoc style...</p></li><li class="listitem"><p>
...not the Qt style. The intermediate *'s are preferred.
</p></li><li class="listitem"><p>
@@ -310,7 +309,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="idp22238096"></a><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"></a>Docbook</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idp22257536"></a><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">docbook5-style-xsl</td><td align="center">1.76.1</td><td align="center">all</td></tr><tr><td align="center">xsltproc</td><td align="center">1.1.26</td><td align="center">all</td></tr><tr><td align="center">xmllint</td><td align="center">2.7.7</td><td align="center">validation</td></tr><tr><td align="center">dblatex</td><td align="center">0.3</td><td align="center">pdf output</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr><tr><td align="center">docbook2X</td><td align="center">0.8.8</td><td align="center">info output</td></tr><tr><td align="center">epub3 stylesheets</td><td align="center">b3</td><td align="center">epub output</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="idm140623064649584"></a><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"></a>Docbook</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idm140623064630144"></a><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">docbook5-style-xsl</td><td align="center">1.76.1</td><td align="center">all</td></tr><tr><td align="center">xsltproc</td><td align="center">1.1.26</td><td align="center">all</td></tr><tr><td align="center">xmllint</td><td align="center">2.7.7</td><td align="center">validation</td></tr><tr><td align="center">dblatex</td><td align="center">0.3</td><td align="center">pdf output</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr><tr><td align="center">docbook2X</td><td align="center">0.8.8</td><td align="center">info output</td></tr><tr><td align="center">epub3 stylesheets</td><td align="center">b3</td><td align="center">epub output</td></tr></tbody></table></div></div><br class="table-break" /><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>,
@@ -520,11 +519,11 @@ make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwal
<a class="link" 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="idp22335040"></a><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="idm140623064552576"></a><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="idp22359184"></a><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="idm140623064528432"></a><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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/dynamic_memory.html b/libstdc++-v3/doc/html/manual/dynamic_memory.html
index 0602e60babc..a5914804221 100644
--- a/libstdc++-v3/doc/html/manual/dynamic_memory.html
+++ b/libstdc++-v3/doc/html/manual/dynamic_memory.html
@@ -1,5 +1,5 @@
<?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>Dynamic Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="support.html" title="Chapter 4.  Support" /><link rel="prev" href="support.html" title="Chapter 4.  Support" /><link rel="next" href="termination.html" title="Termination" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Dynamic Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
+<!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>Dynamic Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="support.html" title="Chapter 4.  Support" /><link rel="prev" href="support.html" title="Chapter 4.  Support" /><link rel="next" href="termination.html" title="Termination" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Dynamic Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
Support
</th><td width="20%" align="right"> <a accesskey="n" href="termination.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.support.memory"></a>Dynamic Memory</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/ext_algorithms.html b/libstdc++-v3/doc/html/manual/ext_algorithms.html
index 53d41266ede..2ff989e2f72 100644
--- a/libstdc++-v3/doc/html/manual/ext_algorithms.html
+++ b/libstdc++-v3/doc/html/manual/ext_algorithms.html
@@ -1,5 +1,5 @@
<?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>Chapter 25. Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 24. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 26. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 25. Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 24. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 26. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 25. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
diff --git a/libstdc++-v3/doc/html/manual/ext_compile_checks.html b/libstdc++-v3/doc/html/manual/ext_compile_checks.html
index cab9b35457d..3850c52ec54 100644
--- a/libstdc++-v3/doc/html/manual/ext_compile_checks.html
+++ b/libstdc++-v3/doc/html/manual/ext_compile_checks.html
@@ -1,5 +1,5 @@
<?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>Chapter 16. Compile Time Checks</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_preface.html" title="" /><link rel="next" href="debug_mode.html" title="Chapter 17. Debug Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 16. Compile Time Checks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_preface.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 16. Compile Time Checks</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_preface.html" title="" /><link rel="next" href="debug_mode.html" title="Chapter 17. Debug Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 16. Compile Time Checks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_preface.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.compile_checks"></a>Chapter 16. Compile Time Checks</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/ext_concurrency.html b/libstdc++-v3/doc/html/manual/ext_concurrency.html
index fed1ee7925f..ad3eac44233 100644
--- a/libstdc++-v3/doc/html/manual/ext_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/ext_concurrency.html
@@ -1,8 +1,8 @@
<?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>Chapter 30. Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 29. Demangling" /><link rel="next" href="ext_concurrency_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 30. Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 29. Demangling" /><link rel="next" href="ext_concurrency_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 30. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file <code class="filename">&lt;ext/concurrence.h&gt;</code>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 30. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file <code class="filename">&lt;ext/concurrence.h&gt;</code>
contains all the higher-level
constructs for playing with threads. In contrast to the atomics layer,
the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>.
diff --git a/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html b/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html
index 8c5efef3f02..f585cd99e62 100644
--- a/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html
+++ b/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html
@@ -1,5 +1,5 @@
<?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>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="next" href="ext_concurrency_use.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
+<!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>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="next" href="ext_concurrency_use.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
implemented via compiler intrinsics (if the underlying host is
capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as
the compiler builtins for atomics are not universally implemented,
diff --git a/libstdc++-v3/doc/html/manual/ext_concurrency_use.html b/libstdc++-v3/doc/html/manual/ext_concurrency_use.html
index fbbd09b9383..646ef624d17 100644
--- a/libstdc++-v3/doc/html/manual/ext_concurrency_use.html
+++ b/libstdc++-v3/doc/html/manual/ext_concurrency_use.html
@@ -1,5 +1,5 @@
<?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>Use</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency_impl.html" title="Implementation" /><link rel="next" href="appendix.html" title="Part IV.  Appendices" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
+<!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>Use</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency_impl.html" title="Implementation" /><link rel="next" href="appendix.html" title="Part IV.  Appendices" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
</p><pre class="programlisting">
#include &lt;ext/concurrence.h&gt;
diff --git a/libstdc++-v3/doc/html/manual/ext_containers.html b/libstdc++-v3/doc/html/manual/ext_containers.html
index c6a795b9522..224da127ffc 100644
--- a/libstdc++-v3/doc/html/manual/ext_containers.html
+++ b/libstdc++-v3/doc/html/manual/ext_containers.html
@@ -1,8 +1,8 @@
<?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>Chapter 23. HP/SGI Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="policy_data_structures_ack.html" title="Acknowledgments" /><link rel="next" href="ext_sgi.html" title="Deprecated" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. HP/SGI Extensions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_ack.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 23. HP/SGI Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="policy_data_structures_ack.html" title="Acknowledgments" /><link rel="next" href="ext_sgi.html" title="Deprecated" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. HP/SGI Extensions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_ack.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_sgi.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 23. HP/SGI Extensions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>Backwards Compatibility</h2></div></div></div><p>A few extensions and nods to backwards-compatibility have
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_sgi.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 23. HP/SGI Extensions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>Backwards Compatibility</h2></div></div></div><p>A few extensions and nods to backwards-compatibility have
been made with containers. Those dealing with older SGI-style
allocators are dealt with elsewhere. The remaining ones all deal
with bits:
diff --git a/libstdc++-v3/doc/html/manual/ext_demangling.html b/libstdc++-v3/doc/html/manual/ext_demangling.html
index 84e40e33fd5..3091976c4fb 100644
--- a/libstdc++-v3/doc/html/manual/ext_demangling.html
+++ b/libstdc++-v3/doc/html/manual/ext_demangling.html
@@ -1,5 +1,5 @@
<?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>Chapter 29. Demangling</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 28. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 30. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 29. Demangling</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 28. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 30. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 29. Demangling</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/ext_io.html b/libstdc++-v3/doc/html/manual/ext_io.html
index f3394b05394..c99a49f5b12 100644
--- a/libstdc++-v3/doc/html/manual/ext_io.html
+++ b/libstdc++-v3/doc/html/manual/ext_io.html
@@ -1,8 +1,8 @@
<?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>Chapter 28. Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 27. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 29. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 28. Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 27. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 29. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 28. Input and Output</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 28. Input and Output</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
Extensions allowing <code class="code">filebuf</code>s to be constructed from
"C" types like FILE*s and file descriptors.
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.io.filebuf_derived"></a>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct
diff --git a/libstdc++-v3/doc/html/manual/ext_iterators.html b/libstdc++-v3/doc/html/manual/ext_iterators.html
index ea3822b571b..83c07801700 100644
--- a/libstdc++-v3/doc/html/manual/ext_iterators.html
+++ b/libstdc++-v3/doc/html/manual/ext_iterators.html
@@ -1,5 +1,5 @@
<?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>Chapter 27. Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 26. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 28. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 27. Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 26. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 28. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 27. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
diff --git a/libstdc++-v3/doc/html/manual/ext_numerics.html b/libstdc++-v3/doc/html/manual/ext_numerics.html
index 408fa626b92..720eccfcf2d 100644
--- a/libstdc++-v3/doc/html/manual/ext_numerics.html
+++ b/libstdc++-v3/doc/html/manual/ext_numerics.html
@@ -1,5 +1,5 @@
<?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>Chapter 26. Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 25. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 27. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 26. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 26. Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 25. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 27. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 26. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 26. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as <code class="code">accumulate</code>,
diff --git a/libstdc++-v3/doc/html/manual/ext_preface.html b/libstdc++-v3/doc/html/manual/ext_preface.html
index 851a3d80476..a907d34e5f6 100644
--- a/libstdc++-v3/doc/html/manual/ext_preface.html
+++ b/libstdc++-v3/doc/html/manual/ext_preface.html
@@ -1,8 +1,8 @@
<?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></title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><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. 
+<!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></title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><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><h1 class="title"><a id="idp16425920"></a></h1></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><h1 class="title"><a id="idm140623070458848"></a></h1></div></div></div><p>
Here we will make an attempt at describing the non-Standard
extensions to the library. Some of these are from older versions of
standard library components, namely SGI's STL, and some of these are
diff --git a/libstdc++-v3/doc/html/manual/ext_sgi.html b/libstdc++-v3/doc/html/manual/ext_sgi.html
index e77e2c63f55..a39ff6caf28 100644
--- a/libstdc++-v3/doc/html/manual/ext_sgi.html
+++ b/libstdc++-v3/doc/html/manual/ext_sgi.html
@@ -1,5 +1,5 @@
<?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>Deprecated</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /><link rel="prev" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /><link rel="next" href="ext_utilities.html" title="Chapter 24. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 23. HP/SGI Extensions</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated</h2></div></div></div><p>
+<!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>Deprecated</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /><link rel="prev" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /><link rel="next" href="ext_utilities.html" title="Chapter 24. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 23. HP/SGI Extensions</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated</h2></div></div></div><p>
The SGI hashing classes <code class="classname">hash_set</code> and
<code class="classname">hash_set</code> have been deprecated by the
unordered_set, unordered_multiset, unordered_map,
diff --git a/libstdc++-v3/doc/html/manual/ext_utilities.html b/libstdc++-v3/doc/html/manual/ext_utilities.html
index c3a9a195622..01c86714f45 100644
--- a/libstdc++-v3/doc/html/manual/ext_utilities.html
+++ b/libstdc++-v3/doc/html/manual/ext_utilities.html
@@ -1,5 +1,5 @@
<?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>Chapter 24. Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_sgi.html" title="Deprecated" /><link rel="next" href="ext_algorithms.html" title="Chapter 25. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_sgi.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 24. Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_sgi.html" title="Deprecated" /><link rel="next" href="ext_algorithms.html" title="Chapter 25. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_sgi.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 24. Utilities</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/extensions.html b/libstdc++-v3/doc/html/manual/extensions.html
index 93540a694c4..c7f6fd23116 100644
--- a/libstdc++-v3/doc/html/manual/extensions.html
+++ b/libstdc++-v3/doc/html/manual/extensions.html
@@ -1,11 +1,11 @@
<?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>Part III.  Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="io_and_c.html" title="Interacting with C" /><link rel="next" href="ext_preface.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part III. 
+<!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>Part III.  Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="io_and_c.html" title="Interacting with C" /><link rel="next" href="ext_preface.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part III. 
Extensions
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td width="20%" align="right"> <a accesskey="n" href="ext_preface.html">Next</a></td></tr></table><hr /></div><div class="part"><div class="titlepage"><div><div><h1 class="title"><a id="manual.ext"></a>Part III. 
Extensions
- <a id="idp16423680" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="preface"><a href="ext_preface.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="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="debug_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="debug_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.link">Link- and run-time coexistence of release- and
+ <a id="idm140623070461088" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="preface"><a href="ext_preface.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="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="debug_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="debug_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="debug_mode_using.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.link">Link- and run-time coexistence of release- and
debug-mode components</a></span></dt><dt><span class="section"><a href="debug_mode_design.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug_mode_design.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="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="parallel_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_test.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="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_api.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="profile_mode_cost_model.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_devel.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_devel.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="profile_mode_devel.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.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="mt_allocator.html">20. The mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="mt_allocator_design.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_design.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_ex_single.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="mt_allocator_ex_multi.html">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="bitmap_allocator.html">21. The bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="policy_data_structures.html">22. Policy-Based Data Structures</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
Configuring via Template Parameters
</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.traits">
diff --git a/libstdc++-v3/doc/html/manual/facets.html b/libstdc++-v3/doc/html/manual/facets.html
index 7d98192c72d..605a32167c7 100644
--- a/libstdc++-v3/doc/html/manual/facets.html
+++ b/libstdc++-v3/doc/html/manual/facets.html
@@ -1,8 +1,8 @@
<?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>Facets</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><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. 
+<!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>Facets</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><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"><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"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"></a>ctype</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp15778336"></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"><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"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"></a>ctype</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071106352"></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
@@ -49,24 +49,24 @@ 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"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idp15793392"></a><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623071091296"></a><p><span class="citetitle"><em class="citetitle">
The GNU C Library
- </em>. </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"><a id="idp15798144"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </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"><a id="idm140623071086544"></a><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </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"><a id="idp15801232"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </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"><a id="idm140623071083456"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idp15803520"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071081168"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idp15805792"></a><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071078896"></a><p><span class="title"><em>
<a class="link" href="http://www.unix.org/version3/ieee_std.html" target="_top">
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</a>
</em>. </span><span class="copyright">Copyright © 1999
- The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="idp15809040"></a><p><span class="citetitle"><em class="citetitle">
+ The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="idm140623071075648"></a><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </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"><a id="idp15813664"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623071071024"></a><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
@@ -409,42 +409,42 @@ 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"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idp15891136"></a><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623070993488"></a><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </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"><a id="idp15895888"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="idm140623070988736"></a><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </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"><a id="idp15898976"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </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"><a id="idm140623070985648"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idp15901264"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070983360"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idp15903536"></a><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070981088"></a><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
</em>. </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="idp15906768"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="idm140623070977856"></a><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </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"><a id="idp15911392"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623070973232"></a><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </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="idp15917056"></a><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623070967568"></a><p><span class="title"><em>
<a class="link" href="http://www.lysator.liu.se/c/na1.html" target="_top">
A brief description of Normative Addendum 1
</a>
- </em>. </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="idp15920304"></a><p><span class="title"><em>
+ </em>. </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="idm140623070964320"></a><p><span class="title"><em>
<a class="link" href="http://tldp.org/HOWTO/Unicode-HOWTO.html" target="_top">
The Unicode HOWTO
</a>
- </em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="idp15923088"></a><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="idm140623070961536"></a><p><span class="title"><em>
<a class="link" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top">
UTF-8 and Unicode FAQ for Unix/Linux
</a>
@@ -690,39 +690,39 @@ 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"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idp16003632"></a><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623070880928"></a><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </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"><a id="idp16008384"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="idm140623070876176"></a><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </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"><a id="idp16011472"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </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"><a id="idm140623070873088"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idp16013760"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070870800"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idp16016032"></a><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070868528"></a><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
</em>. </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="idp16019264"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="idm140623070865296"></a><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </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"><a id="idp16023888"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623070860672"></a><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </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="idp16029552"></a><p><span class="title"><em>
- <a class="link" href="http://java.sun.com/reference/api/index.html" target="_top">
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623070855008"></a><p><span class="title"><em>
+ <a class="link" href="http://www.oracle.com/technetwork/java/api/index.html" target="_top">
API Specifications, Java Platform
</a>
</em>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle
- . </span></p></div><div class="biblioentry"><a id="idp16031888"></a><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry"><a id="idm140623070852672"></a><p><span class="title"><em>
<a class="link" href="https://www.gnu.org/software/gettext/" target="_top">
GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools.
diff --git a/libstdc++-v3/doc/html/manual/fstreams.html b/libstdc++-v3/doc/html/manual/fstreams.html
index 85d138546c3..a6675101e8c 100644
--- a/libstdc++-v3/doc/html/manual/fstreams.html
+++ b/libstdc++-v3/doc/html/manual/fstreams.html
@@ -1,5 +1,5 @@
<?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>File Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="stringstreams.html" title="Memory Based Streams" /><link rel="next" href="io_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">File Based Streams</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<!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>File Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="stringstreams.html" title="Memory Based Streams" /><link rel="next" href="io_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">File Based Streams</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.filestreams"></a>File Based Streams</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.filestreams.copying_a_file"></a>Copying a File</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html b/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html
index a3ff015f4e7..c7c9325dfa4 100644
--- a/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html
+++ b/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html
@@ -1,5 +1,5 @@
<?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>Generalized Operations</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="numerics.html" title="Chapter 12.  Numerics" /><link rel="prev" href="numerics.html" title="Chapter 12.  Numerics" /><link rel="next" href="numerics_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Generalized Operations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
+<!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>Generalized Operations</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="numerics.html" title="Chapter 12.  Numerics" /><link rel="prev" href="numerics.html" title="Chapter 12.  Numerics" /><link rel="next" href="numerics_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Generalized Operations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
Numerics
</th><td width="20%" align="right"> <a accesskey="n" href="numerics_and_c.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.numerics.generalized_ops"></a>Generalized Operations</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/index.html b/libstdc++-v3/doc/html/manual/index.html
index 4561b3aacc1..9631c0c82a0 100644
--- a/libstdc++-v3/doc/html/manual/index.html
+++ b/libstdc++-v3/doc/html/manual/index.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>The GNU C++ Library Manual</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="../index.html" title="The GNU C++ Library" /><link rel="prev" href="../index.html" title="The GNU C++ Library" /><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 Manual</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="../index.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"><div class="titlepage"><div><div><h1 class="title"><a id="manual"></a>The GNU C++ Library Manual</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"></span> <span class="surname"></span></h3></div><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+<!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 Manual</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="../index.html" title="The GNU C++ Library" /><link rel="prev" href="../index.html" title="The GNU C++ Library" /><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 Manual</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="../index.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"><div class="titlepage"><div><div><h1 class="title"><a id="manual"></a>The GNU C++ Library Manual</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"></span> <span class="surname"></span></h3></div><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
<a class="link" href="http://www.fsf.org" target="_top">FSF</a>
- </p></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="part"><a href="intro.html">I.
+ </p></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="part"><a href="intro.html">I.
Introduction
</a></span></dt><dd><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.2011.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.tr1.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><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="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><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="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><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="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><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="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="std_contents.html">II.
@@ -15,13 +15,13 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="concept_checking.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
Utilities
-</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp13920976">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idp13924528">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idp13937824">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp15512272">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idp15534784">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idp15542080">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idp15556704">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp15573056">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idp15576640">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
+</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623072965760">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072962208">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072948912">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071372480">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071349968">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071342672">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071328048">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071311696">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071308112">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
Localization
-</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></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><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idp15778336">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
+</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></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><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm140623071106352">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
Containers
</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
@@ -143,19 +143,19 @@ Support for C++11 dialect.
</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-figures"><p><strong>List of Figures</strong></p><dl><dt>22.1. <a href="policy_data_structures.html#idp17613296">Node Invariants</a></dt><dt>22.2. <a href="policy_data_structures.html#idp17619952">Underlying Associative Data Structures</a></dt><dt>22.3. <a href="policy_data_structures.html#idp17651648">Range Iteration in Different Data Structures</a></dt><dt>22.4. <a href="policy_data_structures.html#idp17666528">Point Iteration in Hash Data Structures</a></dt><dt>22.5. <a href="policy_data_structures.html#idp17675840">Effect of erase in different underlying data structures</a></dt><dt>22.6. <a href="policy_data_structures.html#idp17743424">Underlying Priority Queue Data Structures</a></dt><dt>22.7. <a href="policy_data_structures_using.html#idp17806128">Exception Hierarchy</a></dt><dt>22.8. <a href="policy_data_structures_design.html#idp18000448">Non-unique Mapping Standard Containers</a></dt><dt>22.9. <a href="policy_data_structures_design.html#fig.pbds_embedded_lists_2">
+ </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-figures"><p><strong>List of Figures</strong></p><dl><dt>22.1. <a href="policy_data_structures.html#idm140623069271200">Node Invariants</a></dt><dt>22.2. <a href="policy_data_structures.html#idm140623069264544">Underlying Associative Data Structures</a></dt><dt>22.3. <a href="policy_data_structures.html#idm140623069232832">Range Iteration in Different Data Structures</a></dt><dt>22.4. <a href="policy_data_structures.html#idm140623069217984">Point Iteration in Hash Data Structures</a></dt><dt>22.5. <a href="policy_data_structures.html#idm140623069208720">Effect of erase in different underlying data structures</a></dt><dt>22.6. <a href="policy_data_structures.html#idm140623069141200">Underlying Priority Queue Data Structures</a></dt><dt>22.7. <a href="policy_data_structures_using.html#idm140623069078560">Exception Hierarchy</a></dt><dt>22.8. <a href="policy_data_structures_design.html#idm140623068883776">Non-unique Mapping Standard Containers</a></dt><dt>22.9. <a href="policy_data_structures_design.html#fig.pbds_embedded_lists_2">
Effect of embedded lists in
<code class="classname">std::multimap</code>
- </a></dt><dt>22.10. <a href="policy_data_structures_design.html#idp18023952">Non-unique Mapping Containers</a></dt><dt>22.11. <a href="policy_data_structures_design.html#idp18043824">Point Iterator Hierarchy</a></dt><dt>22.12. <a href="policy_data_structures_design.html#idp18057168">Invalidation Guarantee Tags Hierarchy</a></dt><dt>22.13. <a href="policy_data_structures_design.html#idp18087392">Container Tag Hierarchy</a></dt><dt>22.14. <a href="policy_data_structures_design.html#idp18127536">Hash functions, ranged-hash functions, and
- range-hashing functions</a></dt><dt>22.15. <a href="policy_data_structures_design.html#idp18191968">Insert hash sequence diagram</a></dt><dt>22.16. <a href="policy_data_structures_design.html#idp18199024">Insert hash sequence diagram with a null policy</a></dt><dt>22.17. <a href="policy_data_structures_design.html#idp18215840">Hash policy class diagram</a></dt><dt>22.18. <a href="policy_data_structures_design.html#idp18234944">Balls and bins</a></dt><dt>22.19. <a href="policy_data_structures_design.html#idp18265728">Insert resize sequence diagram</a></dt><dt>22.20. <a href="policy_data_structures_design.html#idp18273504">Standard resize policy trigger sequence
- diagram</a></dt><dt>22.21. <a href="policy_data_structures_design.html#idp18277664">Standard resize policy size sequence
- diagram</a></dt><dt>22.22. <a href="policy_data_structures_design.html#idp18355696">Tree node invariants</a></dt><dt>22.23. <a href="policy_data_structures_design.html#idp18365136">Tree node invalidation</a></dt><dt>22.24. <a href="policy_data_structures_design.html#idp18378304">A tree and its update policy</a></dt><dt>22.25. <a href="policy_data_structures_design.html#idp18389968">Restoring node invariants</a></dt><dt>22.26. <a href="policy_data_structures_design.html#idp18398144">Insert update sequence</a></dt><dt>22.27. <a href="policy_data_structures_design.html#idp18420400">Useless update path</a></dt><dt>22.28. <a href="policy_data_structures_design.html#idp18465088">A PATRICIA trie</a></dt><dt>22.29. <a href="policy_data_structures_design.html#idp18475584">A trie and its update policy</a></dt><dt>22.30. <a href="policy_data_structures_design.html#idp18506160">A simple list</a></dt><dt>22.31. <a href="policy_data_structures_design.html#idp18511744">The counter algorithm</a></dt><dt>22.32. <a href="policy_data_structures_design.html#idp18575568">Underlying Priority-Queue Data-Structures.</a></dt><dt>22.33. <a href="policy_data_structures_design.html#idp18610544">Priority-Queue Data-Structure Tags.</a></dt><dt>B.1. <a href="appendix_porting.html#idp22035648">Configure and Build File Dependencies</a></dt></dl></div><div class="list-of-tables"><p><strong>List of Tables</strong></p><dl><dt>1.1. <a href="status.html#idp452240">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#idp8670848">C++ 2011 Implementation Status</a></dt><dt>1.3. <a href="status.html#idp7483200">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#idp12559072">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#idp13051936">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#idp13079360">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#idp13115840">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#idp13140576">C++ 2011 Library Headers</a></dt><dt>3.5. <a href="using_headers.html#idp13192016">C++ 2011 Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#idp13221904">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#idp13238832">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#idp13259904">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#idp13265424">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#idp13271824">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#idp13307552">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#idp13322320">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#idp13335696">Extension Parallel Headers</a></dt><dt>17.1. <a href="debug_mode_using.html#idp16490400">Debugging Containers</a></dt><dt>17.2. <a href="debug_mode_using.html#idp16535296">Debugging Containers C++11</a></dt><dt>18.1. <a href="parallel_mode_using.html#idp16725920">Parallel Algorithms</a></dt><dt>19.1. <a href="profile_mode_design.html#idp16981200">Profile Code Location</a></dt><dt>19.2. <a href="profile_mode_diagnostics.html#idp17088912">Profile Diagnostics</a></dt><dt>21.1. <a href="bitmap_allocator_impl.html#idp17500848">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="documentation_hacking.html#idp22162432">Doxygen Prerequisites</a></dt><dt>B.2. <a href="documentation_hacking.html#idp22238096">HTML to Doxygen Markup Comparison</a></dt><dt>B.3. <a href="documentation_hacking.html#idp22257536">Docbook Prerequisites</a></dt><dt>B.4. <a href="documentation_hacking.html#idp22335040">HTML to Docbook XML Markup Comparison</a></dt><dt>B.5. <a href="documentation_hacking.html#idp22359184">Docbook XML Element Use</a></dt><dt>B.6. <a href="api.html#idp23030528">Extension Allocators</a></dt><dt>B.7. <a href="api.html#idp23058160">Extension Allocators Continued</a></dt></dl></div><div class="list-of-equations"><p><strong>List of Equations</strong></p><dl><dt>22.1. <a href="policy_data_structures_design.html#idp18141344">Ranged Hash Function</a></dt><dt>22.2. <a href="policy_data_structures_design.html#idp18147232">Range-Hashing, Division Method</a></dt><dt>22.3. <a href="policy_data_structures_design.html#idp18151744">Division via Prime Modulo</a></dt><dt>22.4. <a href="policy_data_structures_design.html#idp18153568">Division via Bit Mask</a></dt><dt>22.5. <a href="policy_data_structures_design.html#idp18163200">
+ </a></dt><dt>22.10. <a href="policy_data_structures_design.html#idm140623068860272">Non-unique Mapping Containers</a></dt><dt>22.11. <a href="policy_data_structures_design.html#idm140623068840464">Point Iterator Hierarchy</a></dt><dt>22.12. <a href="policy_data_structures_design.html#idm140623068827120">Invalidation Guarantee Tags Hierarchy</a></dt><dt>22.13. <a href="policy_data_structures_design.html#idm140623068796896">Container Tag Hierarchy</a></dt><dt>22.14. <a href="policy_data_structures_design.html#idm140623068756816">Hash functions, ranged-hash functions, and
+ range-hashing functions</a></dt><dt>22.15. <a href="policy_data_structures_design.html#idm140623068692448">Insert hash sequence diagram</a></dt><dt>22.16. <a href="policy_data_structures_design.html#idm140623068685392">Insert hash sequence diagram with a null policy</a></dt><dt>22.17. <a href="policy_data_structures_design.html#idm140623068668640">Hash policy class diagram</a></dt><dt>22.18. <a href="policy_data_structures_design.html#idm140623068649600">Balls and bins</a></dt><dt>22.19. <a href="policy_data_structures_design.html#idm140623068618880">Insert resize sequence diagram</a></dt><dt>22.20. <a href="policy_data_structures_design.html#idm140623068611104">Standard resize policy trigger sequence
+ diagram</a></dt><dt>22.21. <a href="policy_data_structures_design.html#idm140623068606944">Standard resize policy size sequence
+ diagram</a></dt><dt>22.22. <a href="policy_data_structures_design.html#idm140623068528896">Tree node invariants</a></dt><dt>22.23. <a href="policy_data_structures_design.html#idm140623068519456">Tree node invalidation</a></dt><dt>22.24. <a href="policy_data_structures_design.html#idm140623068506288">A tree and its update policy</a></dt><dt>22.25. <a href="policy_data_structures_design.html#idm140623068494624">Restoring node invariants</a></dt><dt>22.26. <a href="policy_data_structures_design.html#idm140623068486448">Insert update sequence</a></dt><dt>22.27. <a href="policy_data_structures_design.html#idm140623068464192">Useless update path</a></dt><dt>22.28. <a href="policy_data_structures_design.html#idm140623068419552">A PATRICIA trie</a></dt><dt>22.29. <a href="policy_data_structures_design.html#idm140623068409120">A trie and its update policy</a></dt><dt>22.30. <a href="policy_data_structures_design.html#idm140623068378480">A simple list</a></dt><dt>22.31. <a href="policy_data_structures_design.html#idm140623068372896">The counter algorithm</a></dt><dt>22.32. <a href="policy_data_structures_design.html#idm140623068309072">Underlying Priority-Queue Data-Structures.</a></dt><dt>22.33. <a href="policy_data_structures_design.html#idm140623068274032">Priority-Queue Data-Structure Tags.</a></dt><dt>B.1. <a href="appendix_porting.html#idm140623064852112">Configure and Build File Dependencies</a></dt></dl></div><div class="list-of-tables"><p><strong>List of Tables</strong></p><dl><dt>1.1. <a href="status.html#idm140623085886480">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#idm140623083262384">C++ 2011 Implementation Status</a></dt><dt>1.3. <a href="status.html#idm140623084696848">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#idm140623074329136">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#idm140623073834816">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#idm140623073807392">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#idm140623073770912">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#idm140623073746176">C++ 2011 Library Headers</a></dt><dt>3.5. <a href="using_headers.html#idm140623073694736">C++ 2011 Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#idm140623073664848">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#idm140623073647920">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#idm140623073626848">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#idm140623073621328">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#idm140623073614928">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#idm140623073579200">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#idm140623073564432">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#idm140623073551056">Extension Parallel Headers</a></dt><dt>17.1. <a href="debug_mode_using.html#idm140623070394448">Debugging Containers</a></dt><dt>17.2. <a href="debug_mode_using.html#idm140623070349552">Debugging Containers C++11</a></dt><dt>18.1. <a href="parallel_mode_using.html#idm140623070158704">Parallel Algorithms</a></dt><dt>19.1. <a href="profile_mode_design.html#idm140623069903616">Profile Code Location</a></dt><dt>19.2. <a href="profile_mode_diagnostics.html#idm140623069796224">Profile Diagnostics</a></dt><dt>21.1. <a href="bitmap_allocator_impl.html#idm140623069384160">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="documentation_hacking.html#idm140623064725264">Doxygen Prerequisites</a></dt><dt>B.2. <a href="documentation_hacking.html#idm140623064649584">HTML to Doxygen Markup Comparison</a></dt><dt>B.3. <a href="documentation_hacking.html#idm140623064630144">Docbook Prerequisites</a></dt><dt>B.4. <a href="documentation_hacking.html#idm140623064552576">HTML to Docbook XML Markup Comparison</a></dt><dt>B.5. <a href="documentation_hacking.html#idm140623064528432">Docbook XML Element Use</a></dt><dt>B.6. <a href="api.html#idm140623063857152">Extension Allocators</a></dt><dt>B.7. <a href="api.html#idm140623063829520">Extension Allocators Continued</a></dt></dl></div><div class="list-of-equations"><p><strong>List of Equations</strong></p><dl><dt>22.1. <a href="policy_data_structures_design.html#idm140623068743008">Ranged Hash Function</a></dt><dt>22.2. <a href="policy_data_structures_design.html#idm140623068737184">Range-Hashing, Division Method</a></dt><dt>22.3. <a href="policy_data_structures_design.html#idm140623068732672">Division via Prime Modulo</a></dt><dt>22.4. <a href="policy_data_structures_design.html#idm140623068730848">Division via Bit Mask</a></dt><dt>22.5. <a href="policy_data_structures_design.html#idm140623068721216">
A Standard String Hash Function
- </a></dt><dt>22.6. <a href="policy_data_structures_design.html#idp18169344">
+ </a></dt><dt>22.6. <a href="policy_data_structures_design.html#idm140623068715072">
Only k String DNA Hash
- </a></dt><dt>22.7. <a href="policy_data_structures_design.html#idp18240448">
+ </a></dt><dt>22.7. <a href="policy_data_structures_design.html#idm140623068644096">
Probability of Probe Sequence of Length k
- </a></dt><dt>22.8. <a href="policy_data_structures_design.html#idp18247216">
+ </a></dt><dt>22.8. <a href="policy_data_structures_design.html#idm140623068637328">
Probability Probe Sequence in Some Bin
</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="../index.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 </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. 
Introduction
diff --git a/libstdc++-v3/doc/html/manual/internals.html b/libstdc++-v3/doc/html/manual/internals.html
index 3951cf6c58b..559f8bb470a 100644
--- a/libstdc++-v3/doc/html/manual/internals.html
+++ b/libstdc++-v3/doc/html/manual/internals.html
@@ -1,5 +1,5 @@
<?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>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, internals" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="documentation_hacking.html" title="Writing and Generating Documentation" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="documentation_hacking.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<!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>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, internals" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="documentation_hacking.html" title="Writing and Generating Documentation" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="documentation_hacking.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.internals"></a>Porting to New Hardware or Operating Systems</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html
index b7eaed9fba5..930f5a436e3 100644
--- a/libstdc++-v3/doc/html/manual/intro.html
+++ b/libstdc++-v3/doc/html/manual/intro.html
@@ -1,8 +1,8 @@
<?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>Part I.  Introduction</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="index.html" title="The GNU C++ Library Manual" /><link rel="next" href="status.html" title="Chapter 1. Status" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part I. 
+<!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>Part I.  Introduction</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="index.html" title="The GNU C++ Library Manual" /><link rel="next" href="status.html" title="Chapter 1. Status" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part I. 
Introduction
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td width="20%" align="right"> <a accesskey="n" href="status.html">Next</a></td></tr></table><hr /></div><div class="part"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"></a>Part I. 
Introduction
- <a id="idp9040416" class="indexterm"></a>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.2011.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.tr1.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><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="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><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="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><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="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><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="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><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="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.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 Manual </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html> \ No newline at end of file
+ <a id="idm140623085931696" class="indexterm"></a>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.2011.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.tr1.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><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="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><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="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><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="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><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="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><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="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.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 Manual </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/io.html b/libstdc++-v3/doc/html/manual/io.html
index c7c972c7238..226455d5607 100644
--- a/libstdc++-v3/doc/html/manual/io.html
+++ b/libstdc++-v3/doc/html/manual/io.html
@@ -1,13 +1,13 @@
<?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>Chapter 13.  Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="numerics_and_c.html" title="Interacting with C" /><link rel="next" href="streambufs.html" title="Stream Buffers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. 
+<!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>Chapter 13.  Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="numerics_and_c.html" title="Interacting with C" /><link rel="next" href="streambufs.html" title="Stream Buffers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. 
Input and Output
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics_and_c.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.io"></a>Chapter 13. 
Input and Output
- <a id="idp16257600" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></div><div class="section"><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
+ <a id="idm140623070626976" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></div><div class="section"><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
your runtime as well.</em></span> Here are some tips on which header to use
diff --git a/libstdc++-v3/doc/html/manual/io_and_c.html b/libstdc++-v3/doc/html/manual/io_and_c.html
index 14eaf486a5b..65c5b20147a 100644
--- a/libstdc++-v3/doc/html/manual/io_and_c.html
+++ b/libstdc++-v3/doc/html/manual/io_and_c.html
@@ -1,5 +1,5 @@
<?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>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="fstreams.html" title="File Based Streams" /><link rel="next" href="atomics.html" title="Chapter 14.  Atomics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<!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>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="fstreams.html" title="File Based Streams" /><link rel="next" href="atomics.html" title="Chapter 14.  Atomics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="atomics.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.c"></a>Interacting with C</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.c.FILE"></a>Using FILE* and file descriptors</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/iterators.html b/libstdc++-v3/doc/html/manual/iterators.html
index 58518572576..b3ceae93b9d 100644
--- a/libstdc++-v3/doc/html/manual/iterators.html
+++ b/libstdc++-v3/doc/html/manual/iterators.html
@@ -1,13 +1,13 @@
<?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>Chapter 10.  Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="containers_and_c.html" title="Interacting with C" /><link rel="next" href="algorithms.html" title="Chapter 11.  Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. 
+<!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>Chapter 10.  Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="containers_and_c.html" title="Interacting with C" /><link rel="next" href="algorithms.html" title="Chapter 11.  Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. 
Iterators
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="containers_and_c.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators"></a>Chapter 10. 
Iterators
- <a id="idp16156992" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.iterators.predefined"></a>Predefined</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="iterators.predefined.vs_pointers"></a>Iterators vs. Pointers</h3></div></div></div><p>
+ <a id="idm140623070727584" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.iterators.predefined"></a>Predefined</h2></div></div></div><div class="section"><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
iterators are not implemented as pointers. They are a generalization
diff --git a/libstdc++-v3/doc/html/manual/license.html b/libstdc++-v3/doc/html/manual/license.html
index f58b9a11b81..1b361f699d2 100644
--- a/libstdc++-v3/doc/html/manual/license.html
+++ b/libstdc++-v3/doc/html/manual/license.html
@@ -1,5 +1,5 @@
<?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>License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="status.html" title="Chapter 1. Status" /><link rel="next" href="bugs.html" title="Bugs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="status.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.license"></a>License</h2></div></div></div><p>
+<!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>License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="status.html" title="Chapter 1. Status" /><link rel="next" href="bugs.html" title="Bugs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="status.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.license"></a>License</h2></div></div></div><p>
There are two licenses affecting GNU libstdc++: one for the code,
and one for the documentation.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/localization.html b/libstdc++-v3/doc/html/manual/localization.html
index a595f22eb15..8b82fe401dc 100644
--- a/libstdc++-v3/doc/html/manual/localization.html
+++ b/libstdc++-v3/doc/html/manual/localization.html
@@ -1,13 +1,13 @@
<?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>Chapter 8.  Localization</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="strings.html" title="Chapter 7.  Strings" /><link rel="next" href="facets.html" title="Facets" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. 
+<!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>Chapter 8.  Localization</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="strings.html" title="Chapter 7.  Strings" /><link rel="next" href="facets.html" title="Facets" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. 
Localization
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="strings.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization"></a>Chapter 8. 
Localization
- <a id="idp15701088" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></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><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></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><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idp15778336">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section"><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"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"></a>locale</h3></div></div></div><p>
+ <a id="idm140623071183600" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><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><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></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><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm140623071106352">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section"><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"><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,
class _Impl.
@@ -402,29 +402,29 @@ 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"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idp15744064"></a><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623071140624"></a><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </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"><a id="idp15748832"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="idm140623071135856"></a><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </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"><a id="idp15751920"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </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"><a id="idm140623071132768"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idp15754208"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071130480"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idp15756480"></a><p><span class="title"><em>
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071128208"></a><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
</em>. </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="idp15759712"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="idm140623071124976"></a><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </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"><a id="idp15764336"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623071120352"></a><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/make.html b/libstdc++-v3/doc/html/manual/make.html
index e0bc20380c3..7648f14fc49 100644
--- a/libstdc++-v3/doc/html/manual/make.html
+++ b/libstdc++-v3/doc/html/manual/make.html
@@ -1,5 +1,5 @@
<?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>Make</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="configure.html" title="Configure" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.make"></a>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
+<!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>Make</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="configure.html" title="Configure" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.make"></a>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
<a class="link" href="http://gcc.gnu.org/install/" target="_top">GCC Installation
Instructions</a> first. Read <span class="emphasis"><em>all of them</em></span>.
<span class="emphasis"><em>Twice.</em></span>
diff --git a/libstdc++-v3/doc/html/manual/memory.html b/libstdc++-v3/doc/html/manual/memory.html
index b31c49da96f..7d678daada7 100644
--- a/libstdc++-v3/doc/html/manual/memory.html
+++ b/libstdc++-v3/doc/html/manual/memory.html
@@ -1,5 +1,5 @@
<?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>Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="prev" href="pairs.html" title="Pairs" /><link rel="next" href="traits.html" title="Traits" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
+<!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>Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="prev" href="pairs.html" title="Pairs" /><link rel="next" href="traits.html" title="Traits" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
Utilities
</th><td width="20%" align="right"> <a accesskey="n" href="traits.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.util.memory"></a>Memory</h2></div></div></div><p>
@@ -92,7 +92,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"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp13920976"></a>Interface Design</h5></div></div></div><p>
+ </p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623072965760"></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
@@ -105,7 +105,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"><div class="titlepage"><div><div><h5 class="title"><a id="idp13924528"></a>Selecting Default Allocation Policy</h5></div></div></div><p>
+</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623072962208"></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
@@ -142,7 +142,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"><div class="titlepage"><div><div><h5 class="title"><a id="idp13937824"></a>Disabling Memory Caching</h5></div></div></div><p>
+ </p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623072948912"></a>Disabling Memory Caching</h5></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specific strategies and
heuristics. Because of this, a given call to an allocator object's
@@ -309,33 +309,33 @@
of the used and unused memory locations. It has its own
<a class="link" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator">chapter</a>
in the documentation.
- </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idp13992848"></a><p><span class="citetitle"><em class="citetitle">
+ </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623072893888"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
</em>. </span>
isoc++_1998
- <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="idp13994688"></a><p><span class="title"><em>
- <a class="link" href="http://www.drdobbs.com/cpp/184403759" target="_top">
+ <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="idm140623072892048"></a><p><span class="title"><em>
+ <a class="link" href="http://www.drdobbs.com/the-standard-librarian-what-are-allocato/184403759" target="_top">
The Standard Librarian: What Are Allocators Good For?
</a>
</em>. </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="idp13998416"></a><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623072888272"></a><p><span class="title"><em>
<a class="link" href="http://www.hoard.org/" target="_top">
The Hoard Memory Allocator
</a>
- </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="idp14001184"></a><p><span class="title"><em>
+ </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="idm140623072885504"></a><p><span class="title"><em>
<a class="link" href="http://people.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top">
Reconsidering Custom Memory Allocation
</a>
- </em>. </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="idp14007344"></a><p><span class="title"><em>
+ </em>. </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="idm140623072879344"></a><p><span class="title"><em>
<a class="link" href="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html" target="_top">
Allocator Types
</a>
</em>. </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"><a id="idp14012080"></a><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </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"><a id="idm140623072874608"></a><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </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"><a id="idp14016512"></a><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section"><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"><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"><a id="idm140623072870176"></a><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section"><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"><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>
@@ -445,7 +445,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"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp15512272"></a>Class Hierarchy</h5></div></div></div><p>
+ </p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071372480"></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
@@ -492,9 +492,9 @@ C++11-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
deprecated in C++11 mode.
- </p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp15534784"></a>Thread Safety</h5></div></div></div><p>
+ </p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071349968"></a>Thread Safety</h5></div></div></div><p>
The
-<a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety" target="_top">Thread
+<a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety" target="_top">Thread
Safety</a> 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
@@ -537,7 +537,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"><div class="titlepage"><div><div><h5 class="title"><a id="idp15542080"></a>Selecting Lock Policy</h5></div></div></div><p>
+</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071342672"></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
@@ -578,7 +578,7 @@ 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"><div class="titlepage"><div><div><h5 class="title"><a id="idp15556704"></a>Related functions and classes</h5></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
+ </p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071328048"></a>Related functions and classes</h5></div></div></div><div class="variablelist"><dl class="variablelist"><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
@@ -611,13 +611,13 @@ 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"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"></a>Use</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp15573056"></a>Examples</h5></div></div></div><p>
+ </p></dd></dl></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"></a>Use</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071311696"></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>,
<code class="filename">testsuite/20_util/shared_ptr</code>
and
<code class="filename">testsuite/20_util/weak_ptr</code>.
- </p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp15576640"></a>Unresolved Issues</h5></div></div></div><p>
+ </p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071308112"></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++11 standard is not implemented in GCC.
</p><p>
@@ -658,25 +658,25 @@ be private.
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"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idp15587936"></a><p><span class="title"><em>
+ </p></div><div class="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="idm140623071296880"></a><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" target="_top">
Improving shared_ptr for C++0x, Revision 2
</a>
</em>. </span><span class="subtitle">
N2351
- . </span></p></div><div class="biblioentry"><a id="idp15590224"></a><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry"><a id="idm140623071294592"></a><p><span class="title"><em>
<a class="link" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html" target="_top">
C++ Standard Library Active Issues List
</a>
</em>. </span><span class="subtitle">
N2456
- . </span></p></div><div class="biblioentry"><a id="idp15592512"></a><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry"><a id="idm140623071292304"></a><p><span class="title"><em>
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf" target="_top">
Working Draft, Standard for Programming Language C++
</a>
</em>. </span><span class="subtitle">
N2461
- . </span></p></div><div class="biblioentry"><a id="idp15594816"></a><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry"><a id="idm140623071290000"></a><p><span class="title"><em>
<a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">
Boost C++ Libraries documentation, shared_ptr
</a>
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator.html b/libstdc++-v3/doc/html/manual/mt_allocator.html
index 0626bcceeb1..a47d0e1375d 100644
--- a/libstdc++-v3/doc/html/manual/mt_allocator.html
+++ b/libstdc++-v3/doc/html/manual/mt_allocator.html
@@ -1,8 +1,8 @@
<?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>Chapter 20. The mt_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="profile_mode_diagnostics.html" title="Diagnostics" /><link rel="next" href="mt_allocator_design.html" title="Design Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. The mt_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_diagnostics.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 20. The mt_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="profile_mode_diagnostics.html" title="Diagnostics" /><link rel="next" href="mt_allocator_design.html" title="Design Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. The mt_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_diagnostics.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_design.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.mt"></a>Chapter 20. The mt_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="mt_allocator_design.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_design.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_ex_single.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="mt_allocator_ex_multi.html">Multiple Thread Example</a></span></dt></dl></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_design.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.mt"></a>Chapter 20. The mt_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="mt_allocator_design.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_design.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_ex_single.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="mt_allocator_ex_multi.html">Multiple Thread Example</a></span></dt></dl></div><p>
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.intro"></a>Intro</h2></div></div></div><p>
The mt allocator [hereinafter referred to simply as "the allocator"]
is a fixed size (power of two) allocator that was initially
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator_design.html b/libstdc++-v3/doc/html/manual/mt_allocator_design.html
index bf63532770c..3f82c635019 100644
--- a/libstdc++-v3/doc/html/manual/mt_allocator_design.html
+++ b/libstdc++-v3/doc/html/manual/mt_allocator_design.html
@@ -1,5 +1,5 @@
<?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 Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="next" href="mt_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.design_issues"></a>Design Issues</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.overview"></a>Overview</h3></div></div></div><p> There are three general components to the allocator: a datum
+<!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 Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="next" href="mt_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.design_issues"></a>Design Issues</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.overview"></a>Overview</h3></div></div></div><p> There are three general components to the allocator: a datum
describing the characteristics of the memory pool, a policy class
containing this pool that links instantiation types to common or
individual pools, and a class inheriting from the policy class that is
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator_ex_multi.html b/libstdc++-v3/doc/html/manual/mt_allocator_ex_multi.html
index c971e0c82d5..32e76ea9b3c 100644
--- a/libstdc++-v3/doc/html/manual/mt_allocator_ex_multi.html
+++ b/libstdc++-v3/doc/html/manual/mt_allocator_ex_multi.html
@@ -1,5 +1,5 @@
<?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>Multiple Thread Example</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_ex_single.html" title="Single Thread Example" /><link rel="next" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Multiple Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_single.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_multi"></a>Multiple Thread Example</h2></div></div></div><p>
+<!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>Multiple Thread Example</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_ex_single.html" title="Single Thread Example" /><link rel="next" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Multiple Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_single.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_multi"></a>Multiple Thread Example</h2></div></div></div><p>
In the ST example we never used the thread_id variable present in each block.
Let's start by explaining the purpose of this in a MT application.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator_ex_single.html b/libstdc++-v3/doc/html/manual/mt_allocator_ex_single.html
index c82c6e79296..22e603a2e6f 100644
--- a/libstdc++-v3/doc/html/manual/mt_allocator_ex_single.html
+++ b/libstdc++-v3/doc/html/manual/mt_allocator_ex_single.html
@@ -1,5 +1,5 @@
<?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>Single Thread Example</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_impl.html" title="Implementation" /><link rel="next" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Single Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_multi.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_single"></a>Single Thread Example</h2></div></div></div><p>
+<!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>Single Thread Example</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_impl.html" title="Implementation" /><link rel="next" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Single Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_multi.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_single"></a>Single Thread Example</h2></div></div></div><p>
Let's start by describing how the data on a freelist is laid out in memory.
This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes):
</p><pre class="programlisting">
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator_impl.html b/libstdc++-v3/doc/html/manual/mt_allocator_impl.html
index a93f2a0dd50..7b3379aa1d4 100644
--- a/libstdc++-v3/doc/html/manual/mt_allocator_impl.html
+++ b/libstdc++-v3/doc/html/manual/mt_allocator_impl.html
@@ -1,5 +1,5 @@
<?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>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_design.html" title="Design Issues" /><link rel="next" href="mt_allocator_ex_single.html" title="Single Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_design.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_single.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.tune"></a>Tunable Parameters</h3></div></div></div><p>Certain allocation parameters can be modified, or tuned. There
+<!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>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_design.html" title="Design Issues" /><link rel="next" href="mt_allocator_ex_single.html" title="Single Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_design.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_single.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.tune"></a>Tunable Parameters</h3></div></div></div><p>Certain allocation parameters can be modified, or tuned. There
exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all
these parameters, which include settings for
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Alignment</p></li><li class="listitem"><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li class="listitem"><p>Minimum bytes</p></li><li class="listitem"><p>Size of underlying global allocations</p></li><li class="listitem"><p>Maximum number of supported threads</p></li><li class="listitem"><p>Migration of deallocations to the global free list</p></li><li class="listitem"><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only
diff --git a/libstdc++-v3/doc/html/manual/numerics.html b/libstdc++-v3/doc/html/manual/numerics.html
index 2d85c4be258..4cc25bad0cf 100644
--- a/libstdc++-v3/doc/html/manual/numerics.html
+++ b/libstdc++-v3/doc/html/manual/numerics.html
@@ -1,13 +1,13 @@
<?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>Chapter 12.  Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="algorithms.html" title="Chapter 11.  Algorithms" /><link rel="next" href="generalized_numeric_operations.html" title="Generalized Operations" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. 
+<!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>Chapter 12.  Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="algorithms.html" title="Chapter 11.  Algorithms" /><link rel="next" href="generalized_numeric_operations.html" title="Generalized Operations" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. 
Numerics
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part II. 
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"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics"></a>Chapter 12. 
Numerics
- <a id="idp16214640" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.numerics.complex"></a>Complex</h2></div></div></div><p>
+ <a id="idm140623070670064" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="section"><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="section"><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,
<span class="emphasis"><em>complicated</em></span>, with the not-quite-gratuitously-incompatible
diff --git a/libstdc++-v3/doc/html/manual/numerics_and_c.html b/libstdc++-v3/doc/html/manual/numerics_and_c.html
index 9cb5523b2f5..b3a78cbb5d8 100644
--- a/libstdc++-v3/doc/html/manual/numerics_and_c.html
+++ b/libstdc++-v3/doc/html/manual/numerics_and_c.html
@@ -1,5 +1,5 @@
<?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>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="numerics.html" title="Chapter 12.  Numerics" /><link rel="prev" href="generalized_numeric_operations.html" title="Generalized Operations" /><link rel="next" href="io.html" title="Chapter 13.  Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
+<!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>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="numerics.html" title="Chapter 12.  Numerics" /><link rel="prev" href="generalized_numeric_operations.html" title="Generalized Operations" /><link rel="next" href="io.html" title="Chapter 13.  Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
Numerics
</th><td width="20%" align="right"> <a accesskey="n" href="io.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.numerics.c"></a>Interacting with C</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.c.array"></a>Numerics vs. Arrays</h3></div></div></div><p>One of the major reasons why FORTRAN can chew through numbers so well
diff --git a/libstdc++-v3/doc/html/manual/pairs.html b/libstdc++-v3/doc/html/manual/pairs.html
index 2b1dc9e328c..e6a299d5027 100644
--- a/libstdc++-v3/doc/html/manual/pairs.html
+++ b/libstdc++-v3/doc/html/manual/pairs.html
@@ -1,5 +1,5 @@
<?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>Pairs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="prev" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="next" href="memory.html" title="Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Pairs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
+<!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>Pairs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="prev" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="next" href="memory.html" title="Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Pairs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
Utilities
</th><td width="20%" align="right"> <a accesskey="n" href="memory.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.util.pairs"></a>Pairs</h2></div></div></div><p>The <code class="code">pair&lt;T1,T2&gt;</code> is a simple and handy way to
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode.html b/libstdc++-v3/doc/html/manual/parallel_mode.html
index 5aee5f91d1a..f351eb0e26d 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode.html
@@ -1,8 +1,8 @@
<?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>Chapter 18. Parallel Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="debug_mode_design.html" title="Design" /><link rel="next" href="parallel_mode_semantics.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Parallel Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode_design.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 18. Parallel Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="debug_mode_design.html" title="Design" /><link rel="next" href="parallel_mode_semantics.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Parallel Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode_design.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_semantics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode"></a>Chapter 18. Parallel Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="parallel_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_test.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></div><p> The libstdc++ parallel mode is an experimental parallel
+</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_semantics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode"></a>Chapter 18. Parallel Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="parallel_mode_semantics.html">Semantics</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="parallel_mode_using.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_design.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="parallel_mode_test.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></div><p> The libstdc++ parallel mode is an experimental parallel
implementation of many algorithms the C++ Standard Library.
</p><p>
Several of the standard algorithms, for instance
@@ -12,11 +12,11 @@ explicit source declaration or by compiling existing sources with a
specific compiler flag.
</p><div class="section"><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" style="list-style-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" style="list-style-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"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idp16926864"></a><p><span class="citetitle"><em class="citetitle">
+<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idm140623069957824"></a><p><span class="citetitle"><em class="citetitle">
Parallelization of Bulk Operations for STL Dictionaries
</em>. </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"><a id="idp16931936"></a><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623069952752"></a><p><span class="citetitle"><em class="citetitle">
The Multi-Core Standard Template Library
</em>. </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/parallel_mode_design.html b/libstdc++-v3/doc/html/manual/parallel_mode_design.html
index 5c26d90461d..e1dc09cd07c 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode_design.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode_design.html
@@ -1,5 +1,5 @@
<?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-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_using.html" title="Using" /><link rel="next" href="parallel_mode_test.html" title="Testing" /></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="parallel_mode_using.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_test.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.design"></a>Design</h2></div></div></div><p>
+<!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-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_using.html" title="Using" /><link rel="next" href="parallel_mode_test.html" title="Testing" /></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="parallel_mode_using.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_test.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.design"></a>Design</h2></div></div></div><p>
</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.intro"></a>Interface Basics</h3></div></div></div><p>
All parallel algorithms are intended to have signatures that are
equivalent to the ISO C++ algorithms replaced. For instance, the
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode_semantics.html b/libstdc++-v3/doc/html/manual/parallel_mode_semantics.html
index 9fae4a3a55c..3d049c551c4 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode_semantics.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode_semantics.html
@@ -1,5 +1,5 @@
<?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>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="next" href="parallel_mode_using.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_using.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.semantics"></a>Semantics</h2></div></div></div><p> The parallel mode STL algorithms are currently not exception-safe,
+<!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>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="next" href="parallel_mode_using.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_using.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.semantics"></a>Semantics</h2></div></div></div><p> The parallel mode STL algorithms are currently not exception-safe,
i.e. user-defined functors must not throw exceptions.
Also, the order of execution is not guaranteed for some functions, of course.
Therefore, user-defined functors should not have any concurrent side effects.
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode_test.html b/libstdc++-v3/doc/html/manual/parallel_mode_test.html
index 9d902872555..d68e17a3ad9 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode_test.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode_test.html
@@ -1,5 +1,5 @@
<?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>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_design.html" title="Design" /><link rel="next" href="profile_mode.html" title="Chapter 19. Profile Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_design.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p>
+<!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>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_design.html" title="Design" /><link rel="next" href="profile_mode.html" title="Chapter 19. Profile Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_design.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p>
Both the normal conformance and regression tests and the
supplemental performance tests work.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode_using.html b/libstdc++-v3/doc/html/manual/parallel_mode_using.html
index 98bdb17beeb..fa541554ceb 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode_using.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode_using.html
@@ -1,5 +1,5 @@
<?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>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_semantics.html" title="Semantics" /><link rel="next" href="parallel_mode_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_semantics.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.using"></a>Using</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.using.prereq_flags"></a>Prerequisite Compiler Flags</h3></div></div></div><p>
+<!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>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_semantics.html" title="Semantics" /><link rel="next" href="parallel_mode_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_semantics.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.using"></a>Using</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.using.prereq_flags"></a>Prerequisite Compiler Flags</h3></div></div></div><p>
Any use of parallel functionality requires additional compiler
and runtime support, in particular support for OpenMP. Adding this support is
not difficult: just compile your application with the compiler
@@ -62,4 +62,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="idp16725920"></a><p class="title"><strong>Table 18.1. Parallel Algorithms</strong></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="parallel_mode_semantics.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="parallel_mode_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html> \ No newline at end of file
+</p><div class="table"><a id="idm140623070158704"></a><p class="title"><strong>Table 18.1. Parallel Algorithms</strong></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="parallel_mode_semantics.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="parallel_mode_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html b/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html
index 932a82a7c46..048ae86745e 100644
--- a/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html
+++ b/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html
@@ -1,5 +1,5 @@
<?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>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures_design.html" title="Design" /><link rel="next" href="policy_data_structures_ack.html" title="Acknowledgments" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_design.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_ack.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.test"></a>Testing</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.test.regression"></a>Regression</h3></div></div></div><p>The library contains a single comprehensive regression test.
+<!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>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures_design.html" title="Design" /><link rel="next" href="policy_data_structures_ack.html" title="Acknowledgments" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_design.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_ack.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.test"></a>Testing</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.test.regression"></a>Regression</h3></div></div></div><p>The library contains a single comprehensive regression test.
For a given container type in this library, the test creates
an object of the container type and an object of the
corresponding standard type (e.g., <code class="classname">std::set</code>). It
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures.html b/libstdc++-v3/doc/html/manual/policy_data_structures.html
index 6a5fa65527a..6b5ee4b7f6f 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures.html
@@ -1,8 +1,8 @@
<?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>Chapter 22. Policy-Based Data Structures</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="bitmap_allocator_impl.html" title="Implementation" /><link rel="next" href="policy_data_structures_using.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. Policy-Based Data Structures</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator_impl.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 22. Policy-Based Data Structures</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="bitmap_allocator_impl.html" title="Implementation" /><link rel="next" href="policy_data_structures_using.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. Policy-Based Data Structures</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator_impl.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_using.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.pbds"></a>Chapter 22. Policy-Based Data Structures</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
+</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_using.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.pbds"></a>Chapter 22. Policy-Based Data Structures</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
Configuring via Template Parameters
</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.traits">
Querying Container Attributes
@@ -248,7 +248,7 @@
these invariants, one must supply some policy that is aware
of these changes. Without this, it would be better to use a
linked list (in itself very efficient for these purposes).
- </p></li></ol></div><div class="figure"><a id="idp17613296"></a><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_node_invariants.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"></a>Underlying Data Structures</h5></div></div></div><p>
+ </p></li></ol></div><div class="figure"><a id="idm140623069271200"></a><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_node_invariants.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"></a>Underlying Data Structures</h5></div></div></div><p>
The standard C++ library contains associative containers based on
red-black trees and collision-chaining hash tables. These are
very useful, but they are not ideal for all types of
@@ -256,7 +256,7 @@
</p><p>
The figure below shows the different underlying data structures
currently supported in this library.
- </p><div class="figure"><a id="idp17619952"></a><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_1.png" align="middle" alt="Underlying Associative Data Structures" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623069264544"></a><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_1.png" align="middle" alt="Underlying Associative Data Structures" /></div></div></div><br class="figure-break" /><p>
A shows a collision-chaining hash-table, B shows a probing
hash-table, C shows a red-black tree, D shows a splay tree, E shows
a tree based on an ordered vector(implicit in the order of the
@@ -375,7 +375,7 @@
no guarantee that the elements traversed will coincide with the
<span class="emphasis"><em>logical</em></span> elements between 1 and 5, as in
label B.
- </p><div class="figure"><a id="idp17651648"></a><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_1.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623069232832"></a><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_1.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /><p>
In our opinion, this problem is not caused just because
red-black trees are order preserving while
collision-chaining hash tables are (generally) not - it
@@ -426,7 +426,7 @@
list, as in the graphic below, label B. Here the iterators are as
light as can be, but the hash-table's operations are more
complicated.
- </p><div class="figure"><a id="idp17666528"></a><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_2.png" align="middle" alt="Point Iteration in Hash Data Structures" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623069217984"></a><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_2.png" align="middle" alt="Point Iteration in Hash Data Structures" /></div></div></div><br class="figure-break" /><p>
It should be noted that containers based on collision-chaining
hash-tables are not the only ones with this type of behavior;
many other self-organizing data structures display it as well.
@@ -442,7 +442,7 @@
container. The graphic below shows three cases: A1 and A2 show
a red-black tree; B1 and B2 show a probing hash-table; C1 and C2
show a collision-chaining hash table.
- </p><div class="figure"><a id="idp17675840"></a><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_guarantee_erase.png" align="middle" alt="Effect of erase in different underlying data structures" /></div></div></div><br class="figure-break" /><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
+ </p><div class="figure"><a id="idm140623069208720"></a><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_guarantee_erase.png" align="middle" alt="Effect of erase in different underlying data structures" /></div></div></div><br class="figure-break" /><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Erasing 5 from A1 yields A2. Clearly, an iterator to 3 can
be de-referenced and incremented. The sequence of iterators
changed, but in a way that is well-defined by the interface.
@@ -678,7 +678,7 @@
typically less structured than an associative container's tree;
the third simply uses an associative container. These are
shown in the figure below with labels A1 and A2, B, and C.
- </p><div class="figure"><a id="idp17743424"></a><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_2.png" align="middle" alt="Underlying Priority Queue Data Structures" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623069141200"></a><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_2.png" align="middle" alt="Underlying Priority Queue Data Structures" /></div></div></div><br class="figure-break" /><p>
No single implementation can completely replace any of the
others. Some have better <code class="function">push</code>
and <code class="function">pop</code> amortized performance, some have
@@ -1098,7 +1098,7 @@
</span>. </span><span class="publisher"><span class="publishername">
Proceedings of International Conference on Very Large Data Bases
. </span></span></p></div><div class="biblioentry"><a id="biblio.maverik_lowerbounds"></a><p>[biblio.maverik_lowerbounds] <span class="title"><em>
- <a class="link" href="http://magic.aladdin.cs.cmu.edu/2005/08/01/deamortization-part-2-binomial-heaps" target="_top">
+ <a class="link" href="http://magic.aladdin.cs.cmu.edu/2005/08/01/deamortization-part-2-binomial-heaps/" target="_top">
Deamortization - Part 2: Binomial Heaps
</a>
</em>. </span><span class="date">
@@ -1190,7 +1190,7 @@
</span>. </span><span class="publisher"><span class="publishername">
Addison-Wesley Publishing Company
. </span></span></p></div><div class="biblioentry"><a id="biblio.nelson96stlpq"></a><p>[biblio.nelson96stlpq] <span class="title"><em>
- <a class="link" href="http://www.dogma.net/markn/articles/pq_stl/priority.htm" target="_top">Priority Queues and the STL
+ <a class="link" href="http://marknelson.us/1996/01/01/priority-queues/" target="_top">Priority Queues and the STL
</a>
</em>. </span><span class="date">
January 1996
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_ack.html b/libstdc++-v3/doc/html/manual/policy_data_structures_ack.html
index c4ddfc2ef19..7eb8f15cf38 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures_ack.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_ack.html
@@ -1,10 +1,9 @@
<?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>Acknowledgments</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_based_data_structures_test.html" title="Testing" /><link rel="next" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Acknowledgments</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.ack"></a>Acknowledgments</h2></div></div></div><p>
+<!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>Acknowledgments</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_based_data_structures_test.html" title="Testing" /><link rel="next" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Acknowledgments</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.ack"></a>Acknowledgments</h2></div></div></div><p>
Written by Ami Tavory and Vladimir Dreizin (IBM Haifa Research
Laboratories), and Benjamin Kosnik (Red Hat).
</p><p>
- This library was partially written at
- <a class="link" href="http://www.haifa.il.ibm.com/" target="_top">IBM's Haifa Research Labs</a>.
+ This library was partially written at IBM's Haifa Research Labs.
It is based heavily on policy-based design and uses many useful
techniques from Modern C++ Design: Generic Programming and Design
Patterns Applied by Andrei Alexandrescu.
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_design.html b/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
index 03a7daa5b6d..e31086bebd3 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
@@ -1,5 +1,5 @@
<?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-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures_using.html" title="Using" /><link rel="next" href="policy_based_data_structures_test.html" title="Testing" /></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="policy_data_structures_using.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_based_data_structures_test.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.pbds.design"></a>Design</h2></div></div></div><p></p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.design.concepts"></a>Concepts</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.concepts.null_type"></a>Null Policy Classes</h4></div></div></div><p>
+<!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-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures_using.html" title="Using" /><link rel="next" href="policy_based_data_structures_test.html" title="Testing" /></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="policy_data_structures_using.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_based_data_structures_test.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.pbds.design"></a>Design</h2></div></div></div><p></p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.design.concepts"></a>Concepts</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.concepts.null_type"></a>Null Policy Classes</h4></div></div></div><p>
Associative containers are typically parametrized by various
policies. For example, a hash-based associative container is
parametrized by a hash-functor, transforming each key into an
@@ -170,7 +170,7 @@
naturally; collision-chaining hash tables (label B) store
equivalent-key values in the same bucket, the bucket can be
arranged so that equivalent-key values are consecutive.
- </p><div class="figure"><a id="idp18000448"></a><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_1.png" align="middle" alt="Non-unique Mapping Standard Containers" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623068883776"></a><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_1.png" align="middle" alt="Non-unique Mapping Standard Containers" /></div></div></div><br class="figure-break" /><p>
Put differently, the standards' non-unique mapping
associative-containers are associative containers that map
primary keys to linked lists that are embedded into the
@@ -252,7 +252,7 @@
first graphic above. Labels A and B, respectively. Each shaded
box represents some size-type or secondary
associative-container.
- </p><div class="figure"><a id="idp18023952"></a><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_3.png" align="middle" alt="Non-unique Mapping Containers" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623068860272"></a><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_3.png" align="middle" alt="Non-unique Mapping Containers" /></div></div></div><br class="figure-break" /><p>
In the first example above, then, one would use an associative
container mapping each user to an associative container which
maps each application id to a start time (see
@@ -305,7 +305,7 @@
shows invariants for order-preserving containers: point-type
iterators are synonymous with range-type iterators.
Orthogonally, <span class="emphasis"><em>C</em></span>shows invariants for "set"
- containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="idp18043824"></a><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterator_hierarchy.png" align="middle" alt="Point Iterator Hierarchy" /></div></div></div><br class="figure-break" /><p>Note that point-type iterators in self-organizing containers
+ containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="idm140623068840464"></a><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterator_hierarchy.png" align="middle" alt="Point Iterator Hierarchy" /></div></div></div><br class="figure-break" /><p>Note that point-type iterators in self-organizing containers
(hash-based associative containers) lack movement
operators, such as <code class="literal">operator++</code> - in fact, this
is the reason why this library differentiates from the standard C++ librarys
@@ -344,7 +344,7 @@
to the question of whether point-type iterators and range-type
iterators are valid. The graphic below shows tags corresponding to
different types of invalidation guarantees.
- </p><div class="figure"><a id="idp18057168"></a><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_tag_hierarchy.png" align="middle" alt="Invalidation Guarantee Tags Hierarchy" /></div></div></div><br class="figure-break" /><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
+ </p><div class="figure"><a id="idm140623068827120"></a><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_tag_hierarchy.png" align="middle" alt="Invalidation Guarantee Tags Hierarchy" /></div></div></div><br class="figure-break" /><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
<code class="classname">basic_invalidation_guarantee</code>
corresponds to a basic guarantee that a point-type iterator,
a found pointer, or a found reference, remains valid as long
@@ -428,7 +428,7 @@
</p><p>
This library contains a container tag hierarchy corresponding to the
diagram below.
- </p><div class="figure"><a id="idp18087392"></a><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_container_tag_hierarchy.png" align="middle" alt="Container Tag Hierarchy" /></div></div></div><br class="figure-break" /><p>
+ </p><div class="figure"><a id="idm140623068796896"></a><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_container_tag_hierarchy.png" align="middle" alt="Container Tag Hierarchy" /></div></div></div><br class="figure-break" /><p>
Given any container <span class="type">Cntnr</span>, the tag of
the underlying data structure can be found via <code class="literal">typename
Cntnr::container_category</code>.
@@ -487,7 +487,7 @@
collision-chaining container, except for the following.</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><code class="classname">Comb_Probe_Fn</code> describes how to transform a probe
sequence into a sequence of positions within the table.</p></li><li class="listitem"><p><code class="classname">Probe_Fn</code> describes a probe sequence policy.</p></li></ol></div><p>Some of the default template values depend on the values of
other parameters, and are explained below.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="container.hash.details"></a>Details</h5></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.hash_policies"></a>Hash Policies</h6></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.general"></a>General</h6></div></div></div><p>Following is an explanation of some functions which hashing
- involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="idp18127536"></a><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
+ involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="idm140623068756816"></a><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
range-hashing functions</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_ranged_hash_range_hashing_fns.png" align="middle" alt="Hash functions, ranged-hash functions, and range-hashing functions" /></div></div></div><br class="figure-break" /><p>Let U be a domain (e.g., the integers, or the
strings of 3 characters). A hash-table algorithm needs to map
elements of U "uniformly" into the range [0,..., m -
@@ -504,7 +504,7 @@
Z<sub>+</sub>,</p><p>which maps a non-negative hash value, and a non-negative
range upper-bound into a non-negative integral in the range
between 0 (inclusive) and the range upper bound (exclusive),
- i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="idp18141344"></a><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
+ i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="idm140623068743008"></a><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
f(u , m) = g(h(u), m)
</span></div></div><br class="equation-break" /><p>From the above, it is obvious that given g and
h, f can always be composed (however the converse
@@ -524,7 +524,7 @@
transforming the sequence of hash values into a sequence of
positions.</p></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.range"></a>Range Hashing</h6></div></div></div><p>Some common choices for range-hashing functions are the
division, multiplication, and middle-square methods (<a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>), defined
- as</p><div class="equation"><a id="idp18147232"></a><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
+ as</p><div class="equation"><a id="idm140623068737184"></a><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
g(r, m) = r mod m
</span></div></div><br class="equation-break" /><p>g(r, m) = ⌈ u/v ( a r mod v ) ⌉</p><p>and</p><p>g(r, m) = ⌈ u/v ( r<sup>2</sup> mod v ) ⌉</p><p>respectively, for some positive integrals u and
v (typically powers of 2), and some a. Each of
@@ -535,9 +535,9 @@
implement using the low
level % (modulo) operation (for any m), or the
low level &amp; (bit-mask) operation (for the case where
- m is a power of 2), i.e.,</p><div class="equation"><a id="idp18151744"></a><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
+ m is a power of 2), i.e.,</p><div class="equation"><a id="idm140623068732672"></a><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
g(r, m) = r % m
- </span></div></div><br class="equation-break" /><p>and</p><div class="equation"><a id="idp18153568"></a><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
+ </span></div></div><br class="equation-break" /><p>and</p><div class="equation"><a id="idm140623068730848"></a><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
g(r, m) = r &amp; m - 1, (with m =
2<sup>k</sup> for some k)
</span></div></div><br class="equation-break" /><p>respectively.</p><p>The % (modulo) implementation has the advantage that for
@@ -563,7 +563,7 @@
s = [ s<sub>0</sub>,..., s<sub>t - 1</sub>]
</p><p>be a string of t characters, each of which is from
domain S. Consider the following ranged-hash
- function:</p><div class="equation"><a id="idp18163200"></a><p class="title"><strong>Equation 22.5. 
+ function:</p><div class="equation"><a id="idm140623068721216"></a><p class="title"><strong>Equation 22.5. 
A Standard String Hash Function
</strong></p><div class="equation-contents"><span class="mathphrase">
f<sub>1</sub>(s, m) = ∑ <sub>i =
@@ -575,7 +575,7 @@
of a long DNA sequence (and so S = {'A', 'C', 'G',
'T'}). In this case, scanning the entire string might be
prohibitively expensive. A possible alternative might be to use
- only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="idp18169344"></a><p class="title"><strong>Equation 22.6. 
+ only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="idm140623068715072"></a><p class="title"><strong>Equation 22.6. 
Only k String DNA Hash
</strong></p><div class="equation-contents"><span class="mathphrase">
f<sub>2</sub>(s, m) = ∑ <sub>i
@@ -606,12 +606,12 @@
the container transforms the key into a non-negative integral
using the hash functor (points B and C), and transforms the
result into a position using the combining functor (points D
- and E).</p><div class="figure"><a id="idp18191968"></a><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" align="middle" alt="Insert hash sequence diagram" /></div></div></div><br class="figure-break" /><p>If <code class="classname">cc_hash_table</code>'s
+ and E).</p><div class="figure"><a id="idm140623068692448"></a><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" align="middle" alt="Insert hash sequence diagram" /></div></div></div><br class="figure-break" /><p>If <code class="classname">cc_hash_table</code>'s
hash-functor, <code class="classname">Hash_Fn</code> is instantiated by <code class="classname">null_type</code> , then <code class="classname">Comb_Hash_Fn</code> is taken to be
a ranged-hash function. The graphic below shows an <code class="function">insert</code> sequence
diagram. The user inserts an element (point A), the container
transforms the key into a position using the combining functor
- (points B and C).</p><div class="figure"><a id="idp18199024"></a><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" align="middle" alt="Insert hash sequence diagram with a null policy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"></a>
+ (points B and C).</p><div class="figure"><a id="idm140623068685392"></a><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" align="middle" alt="Insert hash sequence diagram with a null policy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"></a>
Probing tables
</h6></div></div></div><p><code class="classname">gp_hash_table</code> is parametrized by
<code class="classname">Hash_Fn</code>, <code class="classname">Probe_Fn</code>,
@@ -634,7 +634,7 @@
a linear probe and a quadratic probe function,
respectively.</p></li></ol></div><p>
The graphic below shows the relationships.
- </p><div class="figure"><a id="idp18215840"></a><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_policy_cd.png" align="middle" alt="Hash policy class diagram" /></div></div></div><br class="figure-break" /></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"></a>Resize Policies</h6></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"></a>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
+ </p><div class="figure"><a id="idm140623068668640"></a><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_policy_cd.png" align="middle" alt="Hash policy class diagram" /></div></div></div><br class="figure-break" /></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"></a>Resize Policies</h6></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"></a>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
shrink. It is necessary to specify policies to determine how
and when a hash table should change its size. Usually, resize
policies can be decomposed into orthogonal policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>A size policy indicating how a hash table
@@ -667,10 +667,10 @@
and some load factor be denoted by Α. We would like to
calculate the minimal length of k, such that if there were Α
m elements in the hash table, a probe sequence of length k would
- be found with probability at most 1/m.</p><div class="figure"><a id="idp18234944"></a><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_balls_and_bins.png" align="middle" alt="Balls and bins" /></div></div></div><br class="figure-break" /><p>Denote the probability that a probe sequence of length
+ be found with probability at most 1/m.</p><div class="figure"><a id="idm140623068649600"></a><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_balls_and_bins.png" align="middle" alt="Balls and bins" /></div></div></div><br class="figure-break" /><p>Denote the probability that a probe sequence of length
k appears in bin i by p<sub>i</sub>, the
length of the probe sequence of bin i by
- l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="idp18240448"></a><p class="title"><strong>Equation 22.7. 
+ l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="idm140623068644096"></a><p class="title"><strong>Equation 22.7. 
Probability of Probe Sequence of Length k
</strong></p><div class="equation-contents"><span class="mathphrase">
p<sub>1</sub> =
@@ -684,7 +684,7 @@
l<sub>i</sub> are negatively-dependent
(<a class="xref" href="policy_data_structures.html#biblio.dubhashi98neg" title="Balls and bins: A study in negative dependence">[biblio.dubhashi98neg]</a>)
. Let
- I(.) denote the indicator function. Then</p><div class="equation"><a id="idp18247216"></a><p class="title"><strong>Equation 22.8. 
+ I(.) denote the indicator function. Then</p><div class="equation"><a id="idm140623068637328"></a><p class="title"><strong>Equation 22.8. 
Probability Probe Sequence in Some Bin
</strong></p><div class="equation-contents"><span class="mathphrase">
P( exists<sub>i</sub> l<sub>i</sub> ≥ k ) =
@@ -723,7 +723,7 @@
a resize is needed, and if so, what is the new size (points D
to G); following the resize, it notifies the policy that a
resize has completed (point H); finally, the element is
- inserted, and the policy notified (point I).</p><div class="figure"><a id="idp18265728"></a><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" align="middle" alt="Insert resize sequence diagram" /></div></div></div><br class="figure-break" /><p>In practice, a resize policy can be usually orthogonally
+ inserted, and the policy notified (point I).</p><div class="figure"><a id="idm140623068618880"></a><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" align="middle" alt="Insert resize sequence diagram" /></div></div></div><br class="figure-break" /><p>In practice, a resize policy can be usually orthogonally
decomposed to a size policy and a trigger policy. Consequently,
the library contains a single class for instantiating a resize
policy: <code class="classname">hash_standard_resize_policy</code>
@@ -732,8 +732,8 @@
both, and acts as a standard delegate (<a class="xref" href="policy_data_structures.html#biblio.gof" title="Design Patterns - Elements of Reusable Object-Oriented Software">[biblio.gof]</a>)
to these policies.</p><p>The two graphics immediately below show sequence diagrams
illustrating the interaction between the standard resize policy
- and its trigger and size policies, respectively.</p><div class="figure"><a id="idp18273504"></a><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
- diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" align="middle" alt="Standard resize policy trigger sequence diagram" /></div></div></div><br class="figure-break" /><div class="figure"><a id="idp18277664"></a><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
+ and its trigger and size policies, respectively.</p><div class="figure"><a id="idm140623068611104"></a><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
+ diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" align="middle" alt="Standard resize policy trigger sequence diagram" /></div></div></div><br class="figure-break" /><div class="figure"><a id="idm140623068606944"></a><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram3.png" align="middle" alt="Standard resize policy size sequence diagram" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl.predefined"></a>Predefined Policies</h6></div></div></div><p>The library includes the following
instantiations of size and trigger policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><code class="classname">hash_load_check_resize_trigger</code>
implements a load check trigger policy.</p></li><li class="listitem"><p><code class="classname">cc_hash_max_collision_check_resize_trigger</code>
@@ -876,7 +876,7 @@
each node, and maintains node invariants (see <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>.) The first stores in
each node the size of the sub-tree rooted at the node; the
second stores at each node the maximal endpoint of the
- intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="idp18355696"></a><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invariants.png" align="middle" alt="Tree node invariants" /></div></div></div><br class="figure-break" /><p>Supporting such trees is difficult for a number of
+ intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="idm140623068528896"></a><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invariants.png" align="middle" alt="Tree node invariants" /></div></div></div><br class="figure-break" /><p>Supporting such trees is difficult for a number of
reasons:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>There must be a way to specify what a node's metadata
should be (if any).</p></li><li class="listitem"><p>Various operations can invalidate node
invariants. The graphic below shows how a right rotation,
@@ -890,7 +890,7 @@
metadata.</p></li><li class="listitem"><p>It is not feasible to know in advance which methods trees
can support. Besides the usual <code class="classname">find</code> method, the
first tree can support a <code class="classname">find_by_order</code> method, while
- the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="idp18365136"></a><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invalidations.png" align="middle" alt="Tree node invalidation" /></div></div></div><br class="figure-break" /><p>These problems are solved by a combination of two means:
+ the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="idm140623068519456"></a><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invalidations.png" align="middle" alt="Tree node invalidation" /></div></div></div><br class="figure-break" /><p>These problems are solved by a combination of two means:
node iterators, and template-template node updater
parameters.</p><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.node.iterators"></a>Node Iterators</h6></div></div></div><p>Each tree-based container defines two additional iterator
types, <code class="classname">const_node_iterator</code>
@@ -919,7 +919,7 @@
<code class="classname">node_update</code> class, and publicly subclasses
<code class="classname">node_update</code>. The graphic below shows this
scheme, as well as some predefined policies (which are explained
- below).</p><div class="figure"><a id="idp18378304"></a><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_updator_policy_cd.png" align="middle" alt="A tree and its update policy" /></div></div></div><br class="figure-break" /><p><code class="classname">node_update</code> (an instantiation of
+ below).</p><div class="figure"><a id="idm140623068506288"></a><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_updator_policy_cd.png" align="middle" alt="A tree and its update policy" /></div></div></div><br class="figure-break" /><p><code class="classname">node_update</code> (an instantiation of
<code class="classname">Node_Update</code>) must define <code class="classname">metadata_type</code> as
the type of metadata it requires. For order statistics,
e.g., <code class="classname">metadata_type</code> might be <code class="classname">size_t</code>.
@@ -938,7 +938,7 @@
<code class="classname">nd_it</code>. For example, say node x in the
graphic below label A has an invalid invariant, but its' children,
y and z have valid invariants. After the invocation, all three
- nodes should have valid invariants, as in label B.</p><div class="figure"><a id="idp18389968"></a><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_restoring_node_invariants.png" align="middle" alt="Restoring node invariants" /></div></div></div><br class="figure-break" /><p>When a tree operation might invalidate some node invariant,
+ nodes should have valid invariants, as in label B.</p><div class="figure"><a id="idm140623068494624"></a><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_restoring_node_invariants.png" align="middle" alt="Restoring node invariants" /></div></div></div><br class="figure-break" /><p>When a tree operation might invalidate some node invariant,
it invokes this method in its <code class="classname">node_update</code> base to
restore the invariant. For example, the graphic below shows
an <code class="function">insert</code> operation (point A); the tree performs some
@@ -946,7 +946,7 @@
C, and D). (It is well known that any <code class="function">insert</code>,
<code class="function">erase</code>, <code class="function">split</code> or <code class="function">join</code>, can restore
all node invariants by a small number of node invariant updates (<a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>)
- .</p><div class="figure"><a id="idp18398144"></a><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_update_seq_diagram.png" align="middle" alt="Insert update sequence" /></div></div></div><br class="figure-break" /><p>To complete the description of the scheme, three questions
+ .</p><div class="figure"><a id="idm140623068486448"></a><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_update_seq_diagram.png" align="middle" alt="Insert update sequence" /></div></div></div><br class="figure-break" /><p>To complete the description of the scheme, three questions
need to be answered:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>How can a tree which supports order statistics define a
method such as <code class="classname">find_by_order</code>?</p></li><li class="listitem"><p>How can the node updater base access methods of the
tree?</p></li><li class="listitem"><p>How can the following cyclic dependency be resolved?
@@ -988,7 +988,7 @@
node's metadata (this is halting reducible). In the graphic
below, assume the shaded node is inserted. The tree would have
to traverse the useless path shown to the root, applying
- redundant updates all the way.</p></li></ol></div><div class="figure"><a id="idp18420400"></a><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_rationale_null_node_updator.png" align="middle" alt="Useless update path" /></div></div></div><br class="figure-break" /><p>A null policy class, <code class="classname">null_node_update</code>
+ redundant updates all the way.</p></li></ol></div><div class="figure"><a id="idm140623068464192"></a><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_rationale_null_node_updator.png" align="middle" alt="Useless update path" /></div></div></div><br class="figure-break" /><p>A null policy class, <code class="classname">null_node_update</code>
solves both these problems. The tree detects that node
invariants are irrelevant, and defines all accordingly.</p></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.details.split"></a>Split and Join</h6></div></div></div><p>Tree-based containers support split and join methods.
It is possible to split a tree so that it passes
@@ -1071,7 +1071,7 @@
sub-tree with leafs "a" and "as". The maximal common prefix is
"a". The internal node contains, consequently, to const
iterators, one pointing to <code class="varname">'a'</code>, and the other to
- <code class="varname">'s'</code>.</p><div class="figure"><a id="idp18465088"></a><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_pat_trie.png" align="middle" alt="A PATRICIA trie" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"></a>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
+ <code class="varname">'s'</code>.</p><div class="figure"><a id="idm140623068419552"></a><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_pat_trie.png" align="middle" alt="A PATRICIA trie" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"></a>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
tree-based containers. There are two minor
differences, though, which, unfortunately, thwart sharing them
sharing the same node-updating policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>A trie's <code class="classname">Node_Update</code> template-template
@@ -1080,7 +1080,7 @@
parametrized by <code class="classname">Cmp_Fn</code>.</p></li><li class="listitem"><p>Tree-based containers store values in all nodes, while
trie-based containers (at least in this implementation) store
values in leafs.</p></li></ol></div><p>The graphic below shows the scheme, as well as some predefined
- policies (which are explained below).</p><div class="figure"><a id="idp18475584"></a><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_trie_node_updator_policy_cd.png" align="middle" alt="A trie and its update policy" /></div></div></div><br class="figure-break" /><p>This library offers the following pre-defined trie node
+ policies (which are explained below).</p><div class="figure"><a id="idm140623068409120"></a><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_trie_node_updator_policy_cd.png" align="middle" alt="A trie and its update policy" /></div></div></div><br class="figure-break" /><p>This library offers the following pre-defined trie node
updating policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
<code class="classname">trie_order_statistics_node_update</code>
supports order statistics.
@@ -1128,7 +1128,7 @@
simple list of integer keys. If we search for the integer 6, we
are paying an overhead: the link with key 6 is only the fifth
link; if it were the first link, it could be accessed
- faster.</p><div class="figure"><a id="idp18506160"></a><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_simple_list.png" align="middle" alt="A simple list" /></div></div></div><br class="figure-break" /><p>List-update algorithms reorder lists as elements are
+ faster.</p><div class="figure"><a id="idm140623068378480"></a><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_simple_list.png" align="middle" alt="A simple list" /></div></div></div><br class="figure-break" /><p>List-update algorithms reorder lists as elements are
accessed. They try to determine, by the access history, which
keys to move to the front of the list. Some of these algorithms
require adding some metadata alongside each entry.</p><p>For example, in the graphic below label A shows the counter
@@ -1138,7 +1138,7 @@
predetermined value, say 10, as shown in label C, the count is set
to 0 and the node is moved to the front of the list, as in label
D.
- </p><div class="figure"><a id="idp18511744"></a><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_list_update.png" align="middle" alt="The counter algorithm" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"></a>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
+ </p><div class="figure"><a id="idm140623068372896"></a><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_list_update.png" align="middle" alt="The counter algorithm" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"></a>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
implementing any algorithm moving nodes to the front of the
list (policies implementing algorithms interchanging nodes are
unsupported).</p><p>Associative containers based on lists are parametrized by a
@@ -1310,7 +1310,7 @@
sequence; the second uses a tree (or forest of trees), which is
typically less structured than an associative container's tree;
the third simply uses an associative container. These are
- shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="idp18575568"></a><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" align="middle" alt="Underlying Priority-Queue Data-Structures." /></div></div></div><br class="figure-break" /><p>Roughly speaking, any value that is both pushed and popped
+ shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="idm140623068309072"></a><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" align="middle" alt="Underlying Priority-Queue Data-Structures." /></div></div></div><br class="figure-break" /><p>Roughly speaking, any value that is both pushed and popped
from a priority queue must incur a logarithmic expense (in the
amortized sense). Any priority queue implementation that would
avoid this, would violate known bounds on comparison-based
@@ -1390,7 +1390,7 @@
container <code class="classname">Cntnr</code>, the tag of the underlying
data structure can be found via <code class="classname">typename
Cntnr::container_category</code>; this is one of the possible tags shown in the graphic below.
- </p><div class="figure"><a id="idp18610544"></a><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" align="middle" alt="Priority-Queue Data-Structure Tags." /></div></div></div><br class="figure-break" /><p>Additionally, a traits mechanism can be used to query a
+ </p><div class="figure"><a id="idm140623068274032"></a><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" align="middle" alt="Priority-Queue Data-Structure Tags." /></div></div></div><br class="figure-break" /><p>Additionally, a traits mechanism can be used to query a
container type for its attributes. Given any container
<code class="classname">Cntnr</code>, then </p><pre class="programlisting">__gnu_pbds::container_traits&lt;Cntnr&gt;</pre><p>
is a traits class identifying the properties of the
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_using.html b/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
index fec178fa1a2..c71539854ce 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
@@ -1,5 +1,5 @@
<?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>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="next" href="policy_data_structures_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.pbds.using"></a>Using</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.prereq"></a>Prerequisites</h3></div></div></div><p>The library contains only header files, and does not require any
+<!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>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="next" href="policy_data_structures_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.pbds.using"></a>Using</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.prereq"></a>Prerequisites</h3></div></div></div><p>The library contains only header files, and does not require any
other libraries except the standard C++ library . All classes are
defined in namespace <code class="code">__gnu_pbds</code>. The library internally
uses macros beginning with <code class="code">PB_DS</code>, but
@@ -61,7 +61,7 @@
In addition, there are the following diagnostics classes,
used to report errors specific to this library's data
structures.
- </p><div class="figure"><a id="idp17806128"></a><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_exception_hierarchy.png" align="middle" alt="Exception Hierarchy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"></a>Tutorial</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"></a>Basic Use</h4></div></div></div><p>
+ </p><div class="figure"><a id="idm140623069078560"></a><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_exception_hierarchy.png" align="middle" alt="Exception Hierarchy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"></a>Tutorial</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"></a>Basic Use</h4></div></div></div><p>
For the most part, the policy-based containers containers in
namespace <code class="literal">__gnu_pbds</code> have the same interface as
the equivalent containers in the standard C++ library, except for
diff --git a/libstdc++-v3/doc/html/manual/profile_mode.html b/libstdc++-v3/doc/html/manual/profile_mode.html
index 55778294f6b..0e420d6d734 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode.html
@@ -1,8 +1,8 @@
<?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>Chapter 19. Profile Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="parallel_mode_test.html" title="Testing" /><link rel="next" href="profile_mode_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. Profile Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_test.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<!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>Chapter 19. Profile Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="parallel_mode_test.html" title="Testing" /><link rel="next" href="profile_mode_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. Profile Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_test.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_design.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode"></a>Chapter 19. Profile Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_api.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="profile_mode_cost_model.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_devel.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_devel.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="profile_mode_devel.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.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></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.intro"></a>Intro</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_design.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode"></a>Chapter 19. Profile Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="profile_mode_design.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_api.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="profile_mode_cost_model.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="profile_mode_impl.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_devel.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_devel.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="profile_mode_devel.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="profile_mode_diagnostics.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></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.intro"></a>Intro</h2></div></div></div><p>
<span class="emphasis"><em>Goal: </em></span>Give performance improvement advice based on
recognition of suboptimal usage patterns of the standard library.
</p><p>
@@ -137,7 +137,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"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idp17395456"></a><p><span class="citetitle"><em class="citetitle">
+ </p></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idm140623069489616"></a><p><span class="citetitle"><em class="citetitle">
Perflint: A Context Sensitive Performance Advisor for C++ Programs
</em>. </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/profile_mode_api.html b/libstdc++-v3/doc/html/manual/profile_mode_api.html
index 1cd1afa69d8..ea0c4acd51a 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode_api.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode_api.html
@@ -1,5 +1,5 @@
<?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>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_design.html" title="Design" /><link rel="next" href="profile_mode_cost_model.html" title="Empirical Cost Model" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_design.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_cost_model.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.api"></a>Extensions for Custom Containers</h2></div></div></div><p>
+<!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>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_design.html" title="Design" /><link rel="next" href="profile_mode_cost_model.html" title="Empirical Cost Model" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_design.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_cost_model.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.api"></a>Extensions for Custom Containers</h2></div></div></div><p>
Many large projects use their own data structures instead of the ones in the
standard library. If these data structures are similar in functionality
to the standard library, they can be instrumented with the same hooks
diff --git a/libstdc++-v3/doc/html/manual/profile_mode_cost_model.html b/libstdc++-v3/doc/html/manual/profile_mode_cost_model.html
index 2b9423fcb04..f42e879366c 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode_cost_model.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode_cost_model.html
@@ -1,5 +1,5 @@
<?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>Empirical Cost Model</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_api.html" title="Extensions for Custom Containers" /><link rel="next" href="profile_mode_impl.html" title="Implementation Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_api.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_impl.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.cost_model"></a>Empirical Cost Model</h2></div></div></div><p>
+<!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>Empirical Cost Model</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_api.html" title="Extensions for Custom Containers" /><link rel="next" href="profile_mode_impl.html" title="Implementation Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_api.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_impl.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.cost_model"></a>Empirical Cost Model</h2></div></div></div><p>
Currently, the cost model uses formulas with predefined relative weights
for alternative containers or container implementations. For instance,
iterating through a vector is X times faster than iterating through a list.
diff --git a/libstdc++-v3/doc/html/manual/profile_mode_design.html b/libstdc++-v3/doc/html/manual/profile_mode_design.html
index 69119bf0135..a7a5bd585d4 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode_design.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode_design.html
@@ -1,6 +1,6 @@
<?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-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><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="profile_mode_api.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="profile_mode_api.html">Next</a></td></tr></table><hr /></div><div class="section"><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="idp16981200"></a><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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
+<!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-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><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="profile_mode_api.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="profile_mode_api.html">Next</a></td></tr></table><hr /></div><div class="section"><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="idm140623069903616"></a><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="section"><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/profile_mode_devel.html b/libstdc++-v3/doc/html/manual/profile_mode_devel.html
index 21edaf7a07b..cb0c9de828b 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode_devel.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode_devel.html
@@ -1,5 +1,5 @@
<?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>Developer Information</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_impl.html" title="Implementation Issues" /><link rel="next" href="profile_mode_diagnostics.html" title="Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_diagnostics.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.developer"></a>Developer Information</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"></a>Big Picture</h3></div></div></div><p>The profile mode headers are included with
+<!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>Developer Information</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_impl.html" title="Implementation Issues" /><link rel="next" href="profile_mode_diagnostics.html" title="Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_diagnostics.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.developer"></a>Developer Information</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"></a>Big Picture</h3></div></div></div><p>The profile mode headers are included with
<code class="code">-D_GLIBCXX_PROFILE</code> through preprocessor directives in
<code class="code">include/std/*</code>.
</p><p>Instrumented implementations are provided in
diff --git a/libstdc++-v3/doc/html/manual/profile_mode_diagnostics.html b/libstdc++-v3/doc/html/manual/profile_mode_diagnostics.html
index 4b68fbeaa69..1a10559f14c 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode_diagnostics.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode_diagnostics.html
@@ -1,5 +1,5 @@
<?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>Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_devel.html" title="Developer Information" /><link rel="next" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_devel.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.diagnostics"></a>Diagnostics</h2></div></div></div><p>
+<!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>Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_devel.html" title="Developer Information" /><link rel="next" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_devel.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.diagnostics"></a>Diagnostics</h2></div></div></div><p>
The table below presents all the diagnostics we intend to implement.
Each diagnostic has a corresponding compile time switch
<code class="code">-D_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
@@ -17,7 +17,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="idp17088912"></a><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /><col align="left" class="c7" /></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="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers" title="Containers">
+ </p><div class="table"><a id="idm140623069796224"></a><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /><col align="left" class="c7" /></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="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers" title="Containers">
CONTAINERS</a></td><td align="left"><a class="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_small" title="Hashtable Too Small">
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="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_large" title="Hashtable Too Large">
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="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.inefficient_hash" title="Inefficient Hash">
@@ -374,7 +374,7 @@ foo.cc:1: advice: Change "list" to "forward_list".
Quick Sort for a particular call context.
</p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
See papers:
- <a class="link" href="http://portal.acm.org/citation.cfm?doid=1065944.1065981" target="_top">
+ <a class="link" href="https://dl.acm.org/citation.cfm?doid=1065944.1065981" target="_top">
A framework for adaptive algorithm selection in STAPL</a> and
<a class="link" href="http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=4228227" target="_top">
Optimizing Sorting with Machine Learning Algorithms</a>.
@@ -500,7 +500,7 @@ 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: <a class="link" href="http://portal.acm.org/citation.cfm?id=207110.207148" target="_top">
+ See paper: <a class="link" href="https://dl.acm.org/citation.cfm?id=207110.207148" target="_top">
The LRPD test: speculative run-time parallelization of loops with
privatization and reduction parallelization</a>.
</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
diff --git a/libstdc++-v3/doc/html/manual/profile_mode_impl.html b/libstdc++-v3/doc/html/manual/profile_mode_impl.html
index afe9f8b9cbf..1644f3e57a7 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode_impl.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode_impl.html
@@ -1,5 +1,5 @@
<?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>Implementation Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_cost_model.html" title="Empirical Cost Model" /><link rel="next" href="profile_mode_devel.html" title="Developer Information" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_cost_model.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_devel.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.implementation"></a>Implementation Issues</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"></a>Stack Traces</h3></div></div></div><p>
+<!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>Implementation Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode_cost_model.html" title="Empirical Cost Model" /><link rel="next" href="profile_mode_devel.html" title="Developer Information" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_cost_model.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_devel.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.implementation"></a>Implementation Issues</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"></a>Stack Traces</h3></div></div></div><p>
Accurate stack traces are needed during profiling since we group events by
call context and dynamic instance. Without accurate traces, diagnostics
may be hard to interpret. For instance, when giving advice to the user
diff --git a/libstdc++-v3/doc/html/manual/setup.html b/libstdc++-v3/doc/html/manual/setup.html
index 61f40b735d0..10d6c4683ae 100644
--- a/libstdc++-v3/doc/html/manual/setup.html
+++ b/libstdc++-v3/doc/html/manual/setup.html
@@ -1,8 +1,8 @@
<?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>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="bugs.html" title="Bugs" /><link rel="next" href="configure.html" title="Configure" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<!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>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="bugs.html" title="Bugs" /><link rel="next" href="configure.html" title="Configure" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td width="20%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></div><p>To transform libstdc++ sources into installed include files
+</th><td width="20%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></div><p>To transform libstdc++ sources into installed include files
and properly built binaries useful for linking to other software is
a multi-step process. Steps include getting the sources,
configuring and building the sources, testing, and installation.
diff --git a/libstdc++-v3/doc/html/manual/source_code_style.html b/libstdc++-v3/doc/html/manual/source_code_style.html
index 8c41731cb26..790276f3f5c 100644
--- a/libstdc++-v3/doc/html/manual/source_code_style.html
+++ b/libstdc++-v3/doc/html/manual/source_code_style.html
@@ -1,5 +1,5 @@
<?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>Coding Style</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="source_organization.html" title="Directory Layout and Source Conventions" /><link rel="next" href="source_design_notes.html" title="Design Notes" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Coding Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_organization.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
+<!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>Coding Style</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="source_organization.html" title="Directory Layout and Source Conventions" /><link rel="next" href="source_design_notes.html" title="Design Notes" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Coding Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_organization.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing
</th><td width="20%" align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.coding_style"></a>Coding Style</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/source_design_notes.html b/libstdc++-v3/doc/html/manual/source_design_notes.html
index 0c36b982009..1b241d20d18 100644
--- a/libstdc++-v3/doc/html/manual/source_design_notes.html
+++ b/libstdc++-v3/doc/html/manual/source_design_notes.html
@@ -1,5 +1,5 @@
<?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 Notes</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="source_code_style.html" title="Coding Style" /><link rel="next" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Notes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
+<!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 Notes</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="source_code_style.html" title="Coding Style" /><link rel="next" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Notes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing
</th><td width="20%" align="right"> <a accesskey="n" href="appendix_porting.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.design_notes"></a>Design Notes</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/source_organization.html b/libstdc++-v3/doc/html/manual/source_organization.html
index ae49afaf597..1ff2397cf5a 100644
--- a/libstdc++-v3/doc/html/manual/source_organization.html
+++ b/libstdc++-v3/doc/html/manual/source_organization.html
@@ -1,5 +1,5 @@
<?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>Directory Layout and Source Conventions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="next" href="source_code_style.html" title="Coding Style" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Directory Layout and Source Conventions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
+<!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>Directory Layout and Source Conventions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="next" href="source_code_style.html" title="Coding Style" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Directory Layout and Source Conventions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing
</th><td width="20%" align="right"> <a accesskey="n" href="source_code_style.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.organization"></a>Directory Layout and Source Conventions</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html
index 7019525382d..ced58f746cd 100644
--- a/libstdc++-v3/doc/html/manual/status.html
+++ b/libstdc++-v3/doc/html/manual/status.html
@@ -1,13 +1,13 @@
<?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>Chapter 1. Status</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="intro.html" title="Part I.  Introduction" /><link rel="next" href="license.html" title="License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Status</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<!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>Chapter 1. Status</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="intro.html" title="Part I.  Introduction" /><link rel="next" href="license.html" title="License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Status</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td width="20%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"></a>Chapter 1. Status</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.2011.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.tr1.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.iso"></a>Implementation Status</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"></a>C++ 1998/2003</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"></a>Implementation Status</h4></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"></a>Chapter 1. Status</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.2011">C++ 2011</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.2011.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.tr1.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.iso"></a>Implementation Status</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"></a>C++ 1998/2003</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"></a>Implementation Status</h4></div></div></div><p>
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="idp452240"></a><p class="title"><strong>Table 1.1. C++ 1998/2003 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idm140623085886480"></a><p class="title"><strong>Table 1.1. C++ 1998/2003 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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++11 support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="idp8670848"></a><p class="title"><strong>Table 1.2. C++ 2011 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 2011 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idm140623083262384"></a><p class="title"><strong>Table 1.2. C++ 2011 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 2011 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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>
@@ -302,7 +302,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="idp7483200"></a><p class="title"><strong>Table 1.3. C++ TR1 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idm140623084696848"></a><p class="title"><strong>Table 1.3. C++ TR1 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">boost::shared_ptr</a>.
@@ -323,7 +323,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="idp12559072"></a><p class="title"><strong>Table 1.4. C++ TR 24733 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idm140623074329136"></a><p class="title"><strong>Table 1.4. C++ TR 24733 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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/std_contents.html b/libstdc++-v3/doc/html/manual/std_contents.html
index b8c889310e0..fc645e820ba 100644
--- a/libstdc++-v3/doc/html/manual/std_contents.html
+++ b/libstdc++-v3/doc/html/manual/std_contents.html
@@ -1,9 +1,9 @@
<?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>Part II.  Standard Contents</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="debug.html" title="Debugging Support" /><link rel="next" href="support.html" title="Chapter 4.  Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part II. 
+<!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>Part II.  Standard Contents</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="index.html" title="The GNU C++ Library Manual" /><link rel="prev" href="debug.html" title="Debugging Support" /><link rel="next" href="support.html" title="Chapter 4.  Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part II. 
Standard Contents
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td width="20%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr></table><hr /></div><div class="part"><div class="titlepage"><div><div><h1 class="title"><a id="manual.std"></a>Part II. 
Standard Contents
- </h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="support.html">4.
+ </h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="chapter"><a href="support.html">4.
Support
</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="diagnostics.html">5.
@@ -12,13 +12,13 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="concept_checking.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
Utilities
-</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp13920976">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idp13924528">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idp13937824">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp15512272">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idp15534784">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idp15542080">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idp15556704">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp15573056">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idp15576640">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
+</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623072965760">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072962208">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072948912">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071372480">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071349968">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071342672">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071328048">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071311696">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071308112">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
Localization
-</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></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><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idp15778336">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
+</a></span></dt><dd><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><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></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><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm140623071106352">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
Containers
</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
diff --git a/libstdc++-v3/doc/html/manual/streambufs.html b/libstdc++-v3/doc/html/manual/streambufs.html
index 22644ba0ce4..dd2b99a3868 100644
--- a/libstdc++-v3/doc/html/manual/streambufs.html
+++ b/libstdc++-v3/doc/html/manual/streambufs.html
@@ -1,5 +1,5 @@
<?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>Stream Buffers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="io.html" title="Chapter 13.  Input and Output" /><link rel="next" href="stringstreams.html" title="Memory Based Streams" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Stream Buffers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<!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>Stream Buffers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="io.html" title="Chapter 13.  Input and Output" /><link rel="next" href="stringstreams.html" title="Memory Based Streams" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Stream Buffers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="stringstreams.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.streambufs"></a>Stream Buffers</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="io.streambuf.derived"></a>Derived streambuf Classes</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/strings.html b/libstdc++-v3/doc/html/manual/strings.html
index 2f1e8410d64..c7a17e9366e 100644
--- a/libstdc++-v3/doc/html/manual/strings.html
+++ b/libstdc++-v3/doc/html/manual/strings.html
@@ -1,13 +1,13 @@
<?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>Chapter 7.  Strings</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="traits.html" title="Traits" /><link rel="next" href="localization.html" title="Chapter 8.  Localization" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 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>Chapter 7.  Strings</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="traits.html" title="Traits" /><link rel="next" href="localization.html" title="Chapter 8.  Localization" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. 
Strings
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="traits.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings"></a>Chapter 7. 
Strings
- <a id="idp15603440" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></div><div class="section"><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="section"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.simple"></a>Simple Transformations</h3></div></div></div><p>
+ <a id="idm140623071281376" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></div><div class="section"><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="section"><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
"convert to all upper case." The word transformations
diff --git a/libstdc++-v3/doc/html/manual/stringstreams.html b/libstdc++-v3/doc/html/manual/stringstreams.html
index 04a16c0c4b7..2ade2bebbdf 100644
--- a/libstdc++-v3/doc/html/manual/stringstreams.html
+++ b/libstdc++-v3/doc/html/manual/stringstreams.html
@@ -1,5 +1,5 @@
<?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>Memory Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="streambufs.html" title="Stream Buffers" /><link rel="next" href="fstreams.html" title="File Based Streams" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory Based Streams</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<!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>Memory Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="io.html" title="Chapter 13.  Input and Output" /><link rel="prev" href="streambufs.html" title="Stream Buffers" /><link rel="next" href="fstreams.html" title="File Based Streams" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory Based Streams</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="fstreams.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.memstreams"></a>Memory Based Streams</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.memstreams.compat"></a>Compatibility With strstream</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/support.html b/libstdc++-v3/doc/html/manual/support.html
index 8d017a251dc..20f264186bd 100644
--- a/libstdc++-v3/doc/html/manual/support.html
+++ b/libstdc++-v3/doc/html/manual/support.html
@@ -1,13 +1,13 @@
<?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>Chapter 4.  Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="next" href="dynamic_memory.html" title="Dynamic Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. 
+<!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>Chapter 4.  Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="next" href="dynamic_memory.html" title="Dynamic Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. 
Support
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="std_contents.html">Prev</a> </td><th width="60%" align="center">Part II. 
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"><div class="titlepage"><div><div><h2 class="title"><a id="std.support"></a>Chapter 4. 
Support
- <a id="idp13745936" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></div><p>
+ <a id="idm140623073140672" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><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.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/termination.html b/libstdc++-v3/doc/html/manual/termination.html
index c18c5738d4d..e6328c8dd4f 100644
--- a/libstdc++-v3/doc/html/manual/termination.html
+++ b/libstdc++-v3/doc/html/manual/termination.html
@@ -1,5 +1,5 @@
<?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>Termination</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="support.html" title="Chapter 4.  Support" /><link rel="prev" href="dynamic_memory.html" title="Dynamic Memory" /><link rel="next" href="diagnostics.html" title="Chapter 5.  Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Termination</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dynamic_memory.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
+<!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>Termination</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="support.html" title="Chapter 4.  Support" /><link rel="prev" href="dynamic_memory.html" title="Dynamic Memory" /><link rel="next" href="diagnostics.html" title="Chapter 5.  Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Termination</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dynamic_memory.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
Support
</th><td width="20%" align="right"> <a accesskey="n" href="diagnostics.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.support.termination"></a>Termination</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="support.termination.handlers"></a>Termination Handlers</h3></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 9e32a264186..5ed0be6122f 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -1,5 +1,5 @@
<?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>Test</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, test, testsuite, performance, conformance, ABI, exception safety" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="internals.html" title="Porting to New Hardware or Operating Systems" /><link rel="next" href="abi.html" title="ABI Policy and Guidelines" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<!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>Test</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, test, testsuite, performance, conformance, ABI, exception safety" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="internals.html" title="Porting to New Hardware or Operating Systems" /><link rel="next" href="abi.html" title="ABI Policy and Guidelines" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.test"></a>Test</h2></div></div></div><p>
@@ -492,7 +492,7 @@ only default variables.
reporting functions including:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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="section"><div class="titlepage"><div><div><h3 class="title"><a id="test.special"></a>Special Topics</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="test.exception.safety"></a>
Qualifying Exception Safety Guarantees
- <a id="idp22628992" class="indexterm"></a>
+ <a id="idm140623064258560" class="indexterm"></a>
</h4></div></div></div><div class="section"><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/traits.html b/libstdc++-v3/doc/html/manual/traits.html
index ed45918ecdd..d5cac08beb5 100644
--- a/libstdc++-v3/doc/html/manual/traits.html
+++ b/libstdc++-v3/doc/html/manual/traits.html
@@ -1,5 +1,5 @@
<?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>Traits</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="prev" href="memory.html" title="Memory" /><link rel="next" href="strings.html" title="Chapter 7.  Strings" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Traits</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="memory.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
+<!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>Traits</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="utilities.html" title="Chapter 6.  Utilities" /><link rel="prev" href="memory.html" title="Memory" /><link rel="next" href="strings.html" title="Chapter 7.  Strings" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Traits</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="memory.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
Utilities
</th><td width="20%" align="right"> <a accesskey="n" href="strings.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.util.traits"></a>Traits</h2></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/unordered_associative.html b/libstdc++-v3/doc/html/manual/unordered_associative.html
index 578108901f0..ad675e1bf52 100644
--- a/libstdc++-v3/doc/html/manual/unordered_associative.html
+++ b/libstdc++-v3/doc/html/manual/unordered_associative.html
@@ -1,5 +1,5 @@
<?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>Unordered Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9.  Containers" /><link rel="prev" href="associative.html" title="Associative" /><link rel="next" href="containers_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Unordered Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
+<!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>Unordered Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9.  Containers" /><link rel="prev" href="associative.html" title="Associative" /><link rel="next" href="containers_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Unordered Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
Containers
</th><td width="20%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.unordered"></a>Unordered Associative</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.unordered.hash"></a>Hash Code</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="containers.unordered.cache"></a>Hash Code Caching Policy</h4></div></div></div><p>
diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
index 259ed27dd67..e5c1b748d44 100644
--- a/libstdc++-v3/doc/html/manual/using.html
+++ b/libstdc++-v3/doc/html/manual/using.html
@@ -1,8 +1,8 @@
<?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>Chapter 3. Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="make.html" title="Make" /><link rel="next" href="using_headers.html" title="Headers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<!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>Chapter 3. Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="make.html" title="Make" /><link rel="next" href="using_headers.html" title="Headers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td width="20%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"></a>Chapter 3. Using</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><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="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><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="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.flags"></a>Command Options</h2></div></div></div><p>
+</th><td width="20%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"></a>Chapter 3. Using</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><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="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><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="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.flags"></a>Command Options</h2></div></div></div><p>
The set of features available in the GNU C++ library is shaped
by
several <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Invoking-GCC.html" target="_top">GCC
@@ -10,5 +10,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="idp13051936"></a><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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++11</code></td><td align="left">Use the 2011 ISO C++ standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++11</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++11 &lt;thread&gt;, &lt;future&gt;,
+ </p><div class="table"><a id="idm140623073834816"></a><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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++11</code></td><td align="left">Use the 2011 ISO C++ standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++11</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++11 &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="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/using_concurrency.html b/libstdc++-v3/doc/html/manual/using_concurrency.html
index 509c48d2955..5370fc39d9e 100644
--- a/libstdc++-v3/doc/html/manual/using_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/using_concurrency.html
@@ -1,5 +1,5 @@
<?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>Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_dynamic_or_shared.html" title="Linking" /><link rel="next" href="using_exceptions.html" title="Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_dynamic_or_shared.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_exceptions.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.concurrency"></a>Concurrency</h2></div></div></div><p>This section discusses issues surrounding the proper compilation
+<!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>Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_dynamic_or_shared.html" title="Linking" /><link rel="next" href="using_exceptions.html" title="Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_dynamic_or_shared.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_exceptions.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.concurrency"></a>Concurrency</h2></div></div></div><p>This section discusses issues surrounding the proper compilation
of multithreaded applications which use the Standard C++
library. This information is GCC-specific since the C++
standard does not address matters of multithreaded applications.
diff --git a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
index e367aab6d6e..ac46c7e19f6 100644
--- a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
+++ b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
@@ -1,5 +1,5 @@
<?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>Linking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_namespaces.html" title="Namespaces" /><link rel="next" href="using_concurrency.html" title="Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Linking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.linkage"></a>Linking</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.linkage.freestanding"></a>Almost Nothing</h3></div></div></div><p>
+<!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>Linking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_namespaces.html" title="Namespaces" /><link rel="next" href="using_concurrency.html" title="Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Linking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.linkage"></a>Linking</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.linkage.freestanding"></a>Almost Nothing</h3></div></div></div><p>
Or as close as it gets: freestanding. This is a minimal
configuration, with only partial support for the standard
library. Assume only the following header files can be used:
diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html
index b1451c66e19..7193bb5d45d 100644
--- a/libstdc++-v3/doc/html/manual/using_exceptions.html
+++ b/libstdc++-v3/doc/html/manual/using_exceptions.html
@@ -1,5 +1,5 @@
<?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>Exceptions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="C++, exception, error, exception neutrality, exception safety, exception propagation, -fno-exceptions" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_concurrency.html" title="Concurrency" /><link rel="next" href="debug.html" title="Debugging Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.exceptions"></a>Exceptions</h2></div></div></div><p>
+<!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>Exceptions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, exception, error, exception neutrality, exception safety, exception propagation, -fno-exceptions" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_concurrency.html" title="Concurrency" /><link rel="next" href="debug.html" title="Debugging Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.exceptions"></a>Exceptions</h2></div></div></div><p>
The C++ language provides language support for stack unwinding
with <code class="literal">try</code> and <code class="literal">catch</code> blocks and
the <code class="literal">throw</code> keyword.
@@ -265,7 +265,7 @@ is called.
}
catch(...)
{ this-&gt;_M_setstate(ios_base::badbit); }
-</pre></div></div><div class="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="idp13644000"></a><p><span class="title"><em>
+</pre></div></div><div class="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="idm140623073242688"></a><p><span class="title"><em>
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
</a>
@@ -274,39 +274,39 @@ 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="idp13647696"></a><p><span class="title"><em>
+ . </span></p></div><div class="biblioentry"><a id="idm140623073238992"></a><p><span class="title"><em>
<a class="link" href="http://www.boost.org/community/error_handling.html" target="_top">
Error and Exception Handling
</a>
</em>. </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="idp13651392"></a><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623073235296"></a><p><span class="title"><em>
<a class="link" href="http://www.boost.org/community/exception_safety.html" target="_top">
Exception-Safety in Generic Components
</a>
</em>. </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="idp13655104"></a><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623073231584"></a><p><span class="title"><em>
<a class="link" href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf" target="_top">
Standard Library Exception Policy
</a>
</em>. </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="idp13658816"></a><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623073227872"></a><p><span class="title"><em>
<a class="link" href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html" target="_top">
ia64 c++ abi exception handling
</a>
</em>. </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="idp13662512"></a><p><span class="title"><em>
+ . </span></span></p></div><div class="biblioentry"><a id="idm140623073224176"></a><p><span class="title"><em>
<a class="link" href="http://www.research.att.com/~bs/3rd_safe.pdf" target="_top">
Appendix E: Standard-Library Exception Safety
</a>
- </em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="idp13665328"></a><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="idm140623073221360"></a><p><span class="citetitle"><em class="citetitle">
Exceptional C++
</em>. </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="idp13667712"></a><p><span class="title"><em>
+ . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="idm140623073218976"></a><p><span class="title"><em>
<a class="link" href="http://gcc.gnu.org/PR25191" target="_top">
GCC Bug 25191: exception_defines.h #defines try/catch
</a>
diff --git a/libstdc++-v3/doc/html/manual/using_headers.html b/libstdc++-v3/doc/html/manual/using_headers.html
index 66335792fbd..4dc1eaefdaf 100644
--- a/libstdc++-v3/doc/html/manual/using_headers.html
+++ b/libstdc++-v3/doc/html/manual/using_headers.html
@@ -1,5 +1,5 @@
<?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>Headers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using.html" title="Chapter 3. Using" /><link rel="next" href="using_macros.html" title="Macros" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Headers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_macros.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.headers"></a>Headers</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.all"></a>Header Files</h3></div></div></div><p>
+<!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>Headers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using.html" title="Chapter 3. Using" /><link rel="next" href="using_macros.html" title="Macros" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Headers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_macros.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.headers"></a>Headers</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.all"></a>Header Files</h3></div></div></div><p>
The C++ standard specifies the entire set of header files that
must be available to all hosted implementations. Actually, the
word "files" is a misnomer, since the contents of the
@@ -18,19 +18,19 @@
the 1998 standard as updated for 2003, and the current 2011 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="idp13079360"></a><p class="title"><strong>Table 3.2. C++ 1998 Library Headers</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idp13115840"></a><p class="title"><strong>Table 3.3. C++ 1998 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073807392"></a><p class="title"><strong>Table 3.2. C++ 1998 Library Headers</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073770912"></a><p class="title"><strong>Table 3.3. C++ 1998 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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++11 include files. These are only available in C++11 compilation
mode, i.e. <code class="literal">-std=c++11</code> or <code class="literal">-std=gnu++11</code>.
-</p><p></p><div class="table"><a id="idp13140576"></a><p class="title"><strong>Table 3.4. C++ 2011 Library Headers</strong></p><div class="table-contents"><table summary="C++ 2011 Library Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idp13192016"></a><p class="title"><strong>Table 3.5. C++ 2011 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 2011 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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></tbody></table></div></div><br class="table-break" /><p>
+</p><p></p><div class="table"><a id="idm140623073746176"></a><p class="title"><strong>Table 3.4. C++ 2011 Library Headers</strong></p><div class="table-contents"><table summary="C++ 2011 Library Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073694736"></a><p class="title"><strong>Table 3.5. C++ 2011 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 2011 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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></tbody></table></div></div><br class="table-break" /><p>
In addition, TR1 includes as:
-</p><div class="table"><a id="idp13221904"></a><p class="title"><strong>Table 3.6. C++ TR 1 Library Headers</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idp13238832"></a><p class="title"><strong>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073664848"></a><p class="title"><strong>Table 3.6. C++ TR 1 Library Headers</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073647920"></a><p class="title"><strong>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idp13259904"></a><p class="title"><strong>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</strong></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col align="left" class="c1" /></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="idm140623073626848"></a><p class="title"><strong>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</strong></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col align="left" class="c1" /></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="idp13265424"></a><p class="title"><strong>Table 3.9. C++ ABI Headers</strong></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="idm140623073621328"></a><p class="title"><strong>Table 3.9. C++ ABI Headers</strong></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="idp13271824"></a><p class="title"><strong>Table 3.10. Extension Headers</strong></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idp13307552"></a><p class="title"><strong>Table 3.11. Extension Debug Headers</strong></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idp13322320"></a><p class="title"><strong>Table 3.12. Extension Profile Headers</strong></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idp13335696"></a><p class="title"><strong>Table 3.13. Extension Parallel Headers</strong></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="section"><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="idm140623073614928"></a><p class="title"><strong>Table 3.10. Extension Headers</strong></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073579200"></a><p class="title"><strong>Table 3.11. Extension Debug Headers</strong></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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="idm140623073564432"></a><p class="title"><strong>Table 3.12. Extension Profile Headers</strong></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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="idm140623073551056"></a><p class="title"><strong>Table 3.13. Extension Parallel Headers</strong></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="section"><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/using_macros.html b/libstdc++-v3/doc/html/manual/using_macros.html
index add6d69a6df..44acbb7a0f3 100644
--- a/libstdc++-v3/doc/html/manual/using_macros.html
+++ b/libstdc++-v3/doc/html/manual/using_macros.html
@@ -1,5 +1,5 @@
<?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>Macros</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_headers.html" title="Headers" /><link rel="next" href="using_namespaces.html" title="Namespaces" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.macros"></a>Macros</h2></div></div></div><p>
+<!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>Macros</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_headers.html" title="Headers" /><link rel="next" href="using_namespaces.html" title="Namespaces" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.macros"></a>Macros</h2></div></div></div><p>
All library macros begin with <code class="code">_GLIBCXX_</code>.
</p><p>
Furthermore, all pre-processor macros, switches, and
diff --git a/libstdc++-v3/doc/html/manual/using_namespaces.html b/libstdc++-v3/doc/html/manual/using_namespaces.html
index 48b8e7deaac..224c7d6bf57 100644
--- a/libstdc++-v3/doc/html/manual/using_namespaces.html
+++ b/libstdc++-v3/doc/html/manual/using_namespaces.html
@@ -1,5 +1,5 @@
<?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>Namespaces</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_macros.html" title="Macros" /><link rel="next" href="using_dynamic_or_shared.html" title="Linking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Namespaces</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_macros.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_dynamic_or_shared.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.namespaces"></a>Namespaces</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.namespaces.all"></a>Available Namespaces</h3></div></div></div><p> There are three main namespaces.
+<!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>Namespaces</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_macros.html" title="Macros" /><link rel="next" href="using_dynamic_or_shared.html" title="Linking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Namespaces</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_macros.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_dynamic_or_shared.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.namespaces"></a>Namespaces</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.namespaces.all"></a>Available Namespaces</h3></div></div></div><p> There are three main namespaces.
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>std</p><p>The ISO C++ standards specify that "all library entities are defined
within namespace std." This includes namespaces nested
within <code class="code">namespace std</code>, such as <code class="code">namespace
diff --git a/libstdc++-v3/doc/html/manual/utilities.html b/libstdc++-v3/doc/html/manual/utilities.html
index fefc295bf75..5f34c831b90 100644
--- a/libstdc++-v3/doc/html/manual/utilities.html
+++ b/libstdc++-v3/doc/html/manual/utilities.html
@@ -1,13 +1,13 @@
<?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>Chapter 6.  Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.77.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="concept_checking.html" title="Concept Checking" /><link rel="next" href="pairs.html" title="Pairs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. 
+<!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>Chapter 6.  Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II.  Standard Contents" /><link rel="prev" href="concept_checking.html" title="Concept Checking" /><link rel="next" href="pairs.html" title="Pairs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. 
Utilities
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="concept_checking.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td width="20%" align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.util"></a>Chapter 6. 
Utilities
- <a id="idp13862416" class="indexterm"></a>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></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><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp13920976">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idp13924528">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idp13937824">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp15512272">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idp15534784">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idp15542080">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idp15556704">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idp15573056">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idp15576640">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section"><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
+ <a id="idm140623073024128" class="indexterm"></a>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><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><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623072965760">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072962208">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072948912">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071372480">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071349968">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071342672">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071328048">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071311696">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071308112">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section"><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
concept written by SGI as part of their STL, in
diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
index ab690930295..f5dc67fda11 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
@@ -18,9 +18,12 @@
<para>
- The GNU C++ Library follows an open development model. Active
- contributors are assigned maintainer-ship responsibility, and given
- write access to the source repository. First time contributors
+ The GNU C++ Library is part of GCC and follows the same development model,
+ so the general rules for
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/contribute.html">contributing
+ to GCC</link> apply. Active
+ contributors are assigned maintainership responsibility, and given
+ write access to the source repository. First-time contributors
should follow this procedure:
</para>
@@ -44,7 +47,7 @@
organization is
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.ansi.org">ANSI</link>.
(And if you've already registered with them you can
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2003">buy the standard on-line</link>.)
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2012">buy the standard on-line</link>.)
</para>
</listitem>
@@ -58,15 +61,6 @@
<listitem>
<para>
- The newsgroup dedicated to standardization issues is
- comp.std.c++: the
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.comeaucomputing.com/csc/faq.html">FAQ</link>
- for this group is quite useful.
- </para>
- </listitem>
-
- <listitem>
- <para>
Peruse
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
@@ -95,10 +89,7 @@
<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
- assignment form on file at the FSF. Note: your employer may be required
- to fill out appropriate disclaimer forms as well.
+ See the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/contribute.html#legal">legal prerequisites</link> for all GCC contributions.
</para>
<para>
@@ -119,12 +110,6 @@
</para>
<para>
- For more information about getting a copyright assignment, please see
- <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>
Please contact Benjamin Kosnik at
<email>bkoz+assign@redhat.com</email> if you are confused
about the assignment or have general licensing questions. When
diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2011.xml b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
index 5693bfd77c5..d8caf0fe717 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
@@ -154,13 +154,10 @@ particular release.
<entry>C library dependency for quick_exit, at_quick_exit</entry>
</row>
<row>
- <?dbhtml bgcolor="#B0B0B0" ?>
<entry>18.6</entry>
<entry>Dynamic memory management</entry>
- <entry>Partial</entry>
- <entry>Missing <code>get_new_handler</code>.
- <code>set_new_handler</code> is not thread-safe.
- </entry>
+ <entry>Y</entry>
+ <entry/>
</row>
<row>
<entry>18.7</entry>
@@ -205,13 +202,10 @@ particular release.
<entry/>
</row>
<row>
- <?dbhtml bgcolor="#B0B0B0" ?>
<entry>18.8.3</entry>
<entry>Abnormal termination</entry>
- <entry>Partial</entry>
- <entry>Missing <code>get_terminate</code>.
- <code>set_terminate</code> is not thread-safe.
- </entry>
+ <entry>Y</entry>
+ <entry/>
</row>
<row>
<entry>18.8.4</entry>
@@ -2616,12 +2610,9 @@ particular release.
<entry/>
</row>
<row>
- <?dbhtml bgcolor="#B0B0B0" ?>
<entry>D.11</entry>
<entry>Violating exception-specifications</entry>
- <entry>Partial</entry>
- <entry>Missing <code>get_unexpected</code>.
- <code>set_unexpected</code> is not thread-safe.
+ <entry/>
</entry>
</row>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 6bd3b438065..b0ea41d7d71 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -495,6 +495,7 @@ ext_srcdir = ${glibcxx_srcdir}/include/ext
ext_builddir = ./ext
ext_headers = \
${ext_srcdir}/algorithm \
+ ${ext_srcdir}/aligned_buffer.h \
${ext_srcdir}/alloc_traits.h \
${ext_srcdir}/atomicity.h \
${ext_srcdir}/array_allocator.h \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 6e3c8945356..a644155422c 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -755,6 +755,7 @@ ext_srcdir = ${glibcxx_srcdir}/include/ext
ext_builddir = ./ext
ext_headers = \
${ext_srcdir}/algorithm \
+ ${ext_srcdir}/aligned_buffer.h \
${ext_srcdir}/alloc_traits.h \
${ext_srcdir}/atomicity.h \
${ext_srcdir}/array_allocator.h \
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index 608d678d8fc..e7c4bdd816e 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -32,10 +32,14 @@
#pragma GCC system_header
-#include <memory>
-#if __cplusplus >= 201103L
#include <initializer_list>
-#endif
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator.h>
+#include <bits/stl_algobase.h>
+#include <bits/stl_function.h>
+#include <bits/allocator.h>
+#include <ext/alloc_traits.h>
+#include <ext/aligned_buffer.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -96,20 +100,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
_Fwd_list_node() = default;
- typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
- _M_storage;
+ __gnu_cxx::__aligned_buffer<_Tp> _M_storage;
_Tp*
_M_valptr() noexcept
- {
- return static_cast<_Tp*>(static_cast<void*>(&_M_storage));
- }
+ { return _M_storage._M_ptr(); }
const _Tp*
_M_valptr() const noexcept
- {
- return static_cast<const _Tp*>(static_cast<const void*>(&_M_storage));
- }
+ { return _M_storage._M_ptr(); }
};
/**
@@ -421,8 +420,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typedef _Tp value_type;
typedef typename _Alloc_traits::pointer pointer;
typedef typename _Alloc_traits::const_pointer const_pointer;
- typedef typename _Alloc_traits::reference reference;
- typedef typename _Alloc_traits::const_reference const_reference;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
typedef _Fwd_list_iterator<_Tp> iterator;
typedef _Fwd_list_const_iterator<_Tp> const_iterator;
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index c5df1fbcacc..f46364500bc 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -49,6 +49,8 @@
#ifndef _SHARED_PTR_BASE_H
#define _SHARED_PTR_BASE_H 1
+#include <ext/aligned_buffer.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -393,7 +395,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
: _M_impl(__a), _M_storage()
{
- _M_impl._M_ptr = static_cast<_Tp*>(static_cast<void*>(&_M_storage));
+ _M_impl._M_ptr = _M_storage._M_ptr();
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2070. allocate_shared should use allocator_traits<A>::construct
allocator_traits<_Alloc>::construct(__a, _M_impl._M_ptr,
@@ -422,9 +424,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_get_deleter(const std::type_info& __ti) noexcept
{
#ifdef __GXX_RTTI
- return __ti == typeid(_Sp_make_shared_tag)
- ? static_cast<void*>(&_M_storage)
- : 0;
+ return __ti == typeid(_Sp_make_shared_tag) ? _M_storage._M_addr() : 0;
#else
return 0;
#endif
@@ -432,8 +432,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
private:
_Impl _M_impl;
- typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
- _M_storage;
+ __gnu_cxx::__aligned_buffer<_Tp> _M_storage;
};
template<_Lock_policy _Lp>
diff --git a/libstdc++-v3/include/debug/array b/libstdc++-v3/include/debug/array
index 734eeaded72..bce10cf3f12 100644
--- a/libstdc++-v3/include/debug/array
+++ b/libstdc++-v3/include/debug/array
@@ -289,17 +289,11 @@ namespace __debug
// Tuple interface to class template array.
/// tuple_size
- template<typename _Tp>
- class tuple_size;
-
template<typename _Tp, std::size_t _Nm>
struct tuple_size<__debug::array<_Tp, _Nm>>
: public integral_constant<std::size_t, _Nm> { };
/// tuple_element
- template<std::size_t _Int, typename _Tp>
- class tuple_element;
-
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
struct tuple_element<_Int, __debug::array<_Tp, _Nm>>
{
diff --git a/libstdc++-v3/include/ext/aligned_buffer.h b/libstdc++-v3/include/ext/aligned_buffer.h
new file mode 100644
index 00000000000..ffed88cd7d1
--- /dev/null
+++ b/libstdc++-v3/include/ext/aligned_buffer.h
@@ -0,0 +1,73 @@
+// Aligned memory buffer -*- C++ -*-
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/aligned_buffer.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _ALIGNED_BUFFER_H
+#define _ALIGNED_BUFFER_H 1
+
+#pragma GCC system_header
+
+#if __cplusplus >= 201103L
+# include <type_traits>
+#else
+# include <bits/c++0x_warning.h>
+#endif
+
+namespace __gnu_cxx
+{
+ template<typename _Tp>
+ struct __aligned_buffer
+ : std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>
+ {
+ typename
+ std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>::type
+ _M_storage;
+
+ void*
+ _M_addr() noexcept
+ {
+ return static_cast<void*>(&_M_storage);
+ }
+
+ const void*
+ _M_addr() const noexcept
+ {
+ return static_cast<const void*>(&_M_storage);
+ }
+
+ _Tp*
+ _M_ptr() noexcept
+ { return static_cast<_Tp*>(_M_addr()); }
+
+ const _Tp*
+ _M_ptr() const noexcept
+ { return static_cast<const _Tp*>(_M_addr()); }
+ };
+
+} // namespace
+
+#endif /* _ALIGNED_BUFFER_H */
diff --git a/libstdc++-v3/include/profile/array b/libstdc++-v3/include/profile/array
index 4313fd2d5a3..bd6da6ca396 100644
--- a/libstdc++-v3/include/profile/array
+++ b/libstdc++-v3/include/profile/array
@@ -251,17 +251,11 @@ namespace __profile
// Tuple interface to class template array.
/// tuple_size
- template<typename _Tp>
- class tuple_size;
-
template<typename _Tp, std::size_t _Nm>
struct tuple_size<__profile::array<_Tp, _Nm>>
: public integral_constant<std::size_t, _Nm> { };
/// tuple_element
- template<std::size_t _Int, typename _Tp>
- class tuple_element;
-
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
struct tuple_element<_Int, __profile::array<_Tp, _Nm>>
{
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 714b3ed9ecf..44d3fd508d5 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -185,38 +185,6 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
: _Weak_result_type_impl<typename remove_cv<_Functor>::type>
{ };
- /// Determines if the type _Tp derives from unary_function.
- template<typename _Tp>
- struct _Derives_from_unary_function : __sfinae_types
- {
- private:
- template<typename _T1, typename _Res>
- static __one __test(const volatile unary_function<_T1, _Res>*);
-
- // It's tempting to change "..." to const volatile void*, but
- // that fails when _Tp is a function type.
- static __two __test(...);
-
- public:
- static const bool value = sizeof(__test((_Tp*)0)) == 1;
- };
-
- /// Determines if the type _Tp derives from binary_function.
- template<typename _Tp>
- struct _Derives_from_binary_function : __sfinae_types
- {
- private:
- template<typename _T1, typename _T2, typename _Res>
- static __one __test(const volatile binary_function<_T1, _T2, _Res>*);
-
- // It's tempting to change "..." to const volatile void*, but
- // that fails when _Tp is a function type.
- static __two __test(...);
-
- public:
- static const bool value = sizeof(__test((_Tp*)0)) == 1;
- };
-
/**
* Invoke a function object, which may be either a member pointer or a
* function object. The first parameter will tell which.
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index 30100fe05e4..a86a7ca1ee0 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -46,6 +46,7 @@
#include <bits/shared_ptr.h>
#include <bits/uses_allocator.h>
#include <bits/alloc_traits.h>
+#include <ext/aligned_buffer.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -206,12 +207,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Result : _Result_base
{
private:
- typedef alignment_of<_Res> __a_of;
- typedef aligned_storage<sizeof(_Res), __a_of::value> __align_storage;
- typedef typename __align_storage::type __align_type;
-
- __align_type _M_storage;
- bool _M_initialized;
+ __gnu_cxx::__aligned_buffer<_Res> _M_storage;
+ bool _M_initialized;
public:
typedef _Res result_type;
@@ -226,26 +223,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Return lvalue, future will add const or rvalue-reference
_Res&
- _M_value() noexcept { return *static_cast<_Res*>(_M_addr()); }
+ _M_value() noexcept { return *_M_storage._M_ptr(); }
void
_M_set(const _Res& __res)
{
- ::new (_M_addr()) _Res(__res);
+ ::new (_M_storage._M_addr()) _Res(__res);
_M_initialized = true;
}
void
_M_set(_Res&& __res)
{
- ::new (_M_addr()) _Res(std::move(__res));
+ ::new (_M_storage._M_addr()) _Res(std::move(__res));
_M_initialized = true;
}
private:
void _M_destroy() { delete this; }
-
- void* _M_addr() noexcept { return static_cast<void*>(&_M_storage); }
};
/// A unique_ptr based on the instantiating type.
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 334b8d0ab38..488ffd9c180 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -127,12 +127,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public integral_constant<bool, !_Pp::value>
{ };
- struct __sfinae_types
- {
- typedef char __one;
- typedef struct { char __arr[2]; } __two;
- };
-
// For several sfinae-friendly trait implementations we transport both the
// result information (as the member type) and the failure information (no
// member type). This is very similar to std::enable_if, but we cannot use
@@ -161,8 +155,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_void
template<typename _Tp>
struct is_void
- : public integral_constant<bool, (__is_void_helper<typename
- remove_cv<_Tp>::type>::value)>
+ : public __is_void_helper<typename remove_cv<_Tp>::type>::type
{ };
template<typename>
@@ -244,8 +237,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_integral
template<typename _Tp>
struct is_integral
- : public integral_constant<bool, (__is_integral_helper<typename
- remove_cv<_Tp>::type>::value)>
+ : public __is_integral_helper<typename remove_cv<_Tp>::type>::type
{ };
template<typename>
@@ -273,8 +265,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_floating_point
template<typename _Tp>
struct is_floating_point
- : public integral_constant<bool, (__is_floating_point_helper<typename
- remove_cv<_Tp>::type>::value)>
+ : public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
{ };
/// is_array
@@ -301,8 +292,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_pointer
template<typename _Tp>
struct is_pointer
- : public integral_constant<bool, (__is_pointer_helper<typename
- remove_cv<_Tp>::type>::value)>
+ : public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
{ };
/// is_lvalue_reference
@@ -337,8 +327,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_member_object_pointer
template<typename _Tp>
struct is_member_object_pointer
- : public integral_constant<bool, (__is_member_object_pointer_helper<
- typename remove_cv<_Tp>::type>::value)>
+ : public __is_member_object_pointer_helper<
+ typename remove_cv<_Tp>::type>::type
{ };
template<typename>
@@ -352,8 +342,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_member_function_pointer
template<typename _Tp>
struct is_member_function_pointer
- : public integral_constant<bool, (__is_member_function_pointer_helper<
- typename remove_cv<_Tp>::type>::value)>
+ : public __is_member_function_pointer_helper<
+ typename remove_cv<_Tp>::type>::type
{ };
/// is_enum
@@ -422,8 +412,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// __is_nullptr_t (extension).
template<typename _Tp>
struct __is_nullptr_t
- : public integral_constant<bool, (__is_nullptr_t_helper<typename
- remove_cv<_Tp>::type>::value)>
+ : public __is_nullptr_t_helper<typename remove_cv<_Tp>::type>::type
{ };
// Composite type categories.
@@ -480,8 +469,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_member_pointer
template<typename _Tp>
struct is_member_pointer
- : public integral_constant<bool, (__is_member_pointer_helper<
- typename remove_cv<_Tp>::type>::value)>
+ : public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
{ };
// Type properties.
@@ -567,7 +555,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_signed
template<typename _Tp>
struct is_signed
- : public integral_constant<bool, __is_signed_helper<_Tp>::value>
+ : public __is_signed_helper<_Tp>::type
{ };
/// is_unsigned
@@ -650,7 +638,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_destructible
template<typename _Tp>
struct is_destructible
- : public integral_constant<bool, (__is_destructible_safe<_Tp>::value)>
+ : public __is_destructible_safe<_Tp>::type
{ };
// is_nothrow_destructible requires that is_destructible is
@@ -698,7 +686,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_nothrow_destructible
template<typename _Tp>
struct is_nothrow_destructible
- : public integral_constant<bool, (__is_nt_destructible_safe<_Tp>::value)>
+ : public __is_nt_destructible_safe<_Tp>::type
{ };
struct __do_is_default_constructible_impl
@@ -746,8 +734,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_default_constructible
template<typename _Tp>
struct is_default_constructible
- : public integral_constant<bool, (__is_default_constructible_safe<
- _Tp>::value)>
+ : public __is_default_constructible_safe<_Tp>::type
{ };
@@ -901,8 +888,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Arg>
struct __is_direct_constructible
- : public integral_constant<bool, (__is_direct_constructible_new<
- _Tp, _Arg>::value)>
+ : public __is_direct_constructible_new<_Tp, _Arg>::type
{ };
// Since default-construction and binary direct-initialization have
@@ -953,8 +939,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_constructible
template<typename _Tp, typename... _Args>
struct is_constructible
- : public integral_constant<bool, (__is_constructible_impl<_Tp,
- _Args...>::value)>
+ : public __is_constructible_impl<_Tp, _Args...>::type
{ };
template<typename _Tp, bool = is_void<_Tp>::value>
@@ -1081,24 +1066,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Up>
class __is_assignable_helper
- : public __sfinae_types
{
- template<typename _Tp1, typename _Up1>
- static decltype(declval<_Tp1>() = declval<_Up1>(), __one())
+ template<typename _Tp1, typename _Up1,
+ typename = decltype(declval<_Tp1>() = declval<_Up1>())>
+ static true_type
__test(int);
template<typename, typename>
- static __two __test(...);
+ static false_type
+ __test(...);
public:
- static constexpr bool value = sizeof(__test<_Tp, _Up>(0)) == 1;
+ typedef decltype(__test<_Tp, _Up>(0)) type;
};
/// is_assignable
template<typename _Tp, typename _Up>
struct is_assignable
- : public integral_constant<bool,
- __is_assignable_helper<_Tp, _Up>::value>
+ : public __is_assignable_helper<_Tp, _Up>::type
{ };
template<typename _Tp, bool = is_void<_Tp>::value>
@@ -1292,31 +1277,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool = __or_<is_void<_From>, is_function<_To>,
is_array<_To>>::value>
struct __is_convertible_helper
- { static constexpr bool value = is_void<_To>::value; };
+ { typedef typename is_void<_To>::type type; };
template<typename _From, typename _To>
class __is_convertible_helper<_From, _To, false>
- : public __sfinae_types
{
- template<typename _To1>
- static void __test_aux(_To1);
+ template<typename _To1>
+ static void __test_aux(_To1);
- template<typename _From1, typename _To1>
- static decltype(__test_aux<_To1>(std::declval<_From1>()), __one())
+ template<typename _From1, typename _To1,
+ typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
+ static true_type
__test(int);
template<typename, typename>
- static __two __test(...);
+ static false_type
+ __test(...);
public:
- static constexpr bool value = sizeof(__test<_From, _To>(0)) == 1;
+ typedef decltype(__test<_From, _To>(0)) type;
};
+
/// is_convertible
template<typename _From, typename _To>
struct is_convertible
- : public integral_constant<bool,
- __is_convertible_helper<_From, _To>::value>
+ : public __is_convertible_helper<_From, _To>::type
{ };
@@ -2041,29 +2027,28 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Use SFINAE to determine if the type _Tp has a publicly-accessible
* member type _NTYPE.
*/
-#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
- template<typename _Tp> \
- class __has_##_NTYPE##_helper \
- : __sfinae_types \
- { \
- template<typename _Up> \
- struct _Wrap_type \
- { }; \
- \
- template<typename _Up> \
- static __one __test(_Wrap_type<typename _Up::_NTYPE>*); \
- \
- template<typename _Up> \
- static __two __test(...); \
- \
- public: \
- static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; \
- }; \
- \
- template<typename _Tp> \
- struct __has_##_NTYPE \
- : integral_constant<bool, __has_##_NTYPE##_helper \
- <typename remove_cv<_Tp>::type>::value> \
+#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
+ template<typename _Tp> \
+ class __has_##_NTYPE##_helper \
+ { \
+ template<typename _Up> \
+ struct _Wrap_type \
+ { }; \
+ \
+ template<typename _Up> \
+ static true_type __test(_Wrap_type<typename _Up::_NTYPE>*); \
+ \
+ template<typename _Up> \
+ static false_type __test(...); \
+ \
+ public: \
+ typedef decltype(__test<_Tp>(0)) type; \
+ }; \
+ \
+ template<typename _Tp> \
+ struct __has_##_NTYPE \
+ : public __has_##_NTYPE##_helper \
+ <typename remove_cv<_Tp>::type>::type \
{ };
_GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index f276eda0854..25c58fb8b0d 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -106,31 +106,51 @@ cp-demangle.o: cp-demangle.c
$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
-# Use special rules for the C++0x sources so that the proper flags are passed.
+# Use special rules for the C++11 sources so that the proper flags are passed.
eh_ptr.lo: eh_ptr.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
eh_ptr.o: eh_ptr.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+eh_terminate.lo: eh_terminate.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+eh_terminate.o: eh_terminate.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
eh_throw.lo: eh_throw.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
eh_throw.o: eh_throw.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
guard.lo: guard.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
guard.o: guard.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
atexit_thread.lo: atexit_thread.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
atexit_thread.o: atexit_thread.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
nested_exception.lo: nested_exception.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
nested_exception.o: nested_exception.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+new_handler.lo: new_handler.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+new_handler.o: new_handler.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+new_op.lo: new_op.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+new_op.o: new_op.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+new_opnt.lo: new_opnt.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+new_opnt.o: new_opnt.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 8bf86f35af6..eb13f1ea9ef 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -787,31 +787,51 @@ cp-demangle.lo: cp-demangle.c
cp-demangle.o: cp-demangle.c
$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
-# Use special rules for the C++0x sources so that the proper flags are passed.
+# Use special rules for the C++11 sources so that the proper flags are passed.
eh_ptr.lo: eh_ptr.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
eh_ptr.o: eh_ptr.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+eh_terminate.lo: eh_terminate.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+eh_terminate.o: eh_terminate.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
eh_throw.lo: eh_throw.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
eh_throw.o: eh_throw.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
guard.lo: guard.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
guard.o: guard.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
atexit_thread.lo: atexit_thread.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
atexit_thread.o: atexit_thread.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
nested_exception.lo: nested_exception.cc
- $(LTCXXCOMPILE) -std=gnu++0x -c $<
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
nested_exception.o: nested_exception.cc
- $(CXXCOMPILE) -std=gnu++0x -c $<
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+new_handler.lo: new_handler.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+new_handler.o: new_handler.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+new_op.lo: new_op.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+new_op.o: new_op.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
+
+new_opnt.lo: new_opnt.cc
+ $(LTCXXCOMPILE) -std=gnu++11 -c $<
+new_opnt.o: new_opnt.cc
+ $(CXXCOMPILE) -std=gnu++11 -c $<
install-stdHEADERS: $(std_HEADERS)
@$(NORMAL_INSTALL)
diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc
index f0183cee726..6bc3311020c 100644
--- a/libstdc++-v3/libsupc++/eh_ptr.cc
+++ b/libstdc++-v3/libsupc++/eh_ptr.cc
@@ -212,8 +212,8 @@ std::rethrow_exception(std::exception_ptr ep)
dep->primaryException = obj;
__atomic_add_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL);
- dep->unexpectedHandler = __unexpected_handler;
- dep->terminateHandler = __terminate_handler;
+ dep->unexpectedHandler = get_unexpected ();
+ dep->terminateHandler = get_terminate ();
__GXX_INIT_DEPENDENT_EXCEPTION_CLASS(dep->unwindHeader.exception_class);
dep->unwindHeader.exception_cleanup = __gxx_dependent_exception_cleanup;
diff --git a/libstdc++-v3/libsupc++/eh_terminate.cc b/libstdc++-v3/libsupc++/eh_terminate.cc
index b54c8598401..b31d2e27f05 100644
--- a/libstdc++-v3/libsupc++/eh_terminate.cc
+++ b/libstdc++-v3/libsupc++/eh_terminate.cc
@@ -27,6 +27,15 @@
#include <cstdlib>
#include "unwind-cxx.h"
#include <bits/exception_defines.h>
+#include <bits/atomic_lockfree_defines.h>
+
+#if ATOMIC_POINTER_LOCK_FREE < 2
+#include <ext/concurrence.h>
+namespace
+{
+ __gnu_cxx::__mutex mx;
+}
+#endif
using namespace __cxxabiv1;
@@ -45,7 +54,7 @@ __cxxabiv1::__terminate (std::terminate_handler handler) throw ()
void
std::terminate () throw()
{
- __terminate (__terminate_handler);
+ __terminate (get_terminate ());
}
void
@@ -58,21 +67,59 @@ __cxxabiv1::__unexpected (std::unexpected_handler handler)
void
std::unexpected ()
{
- __unexpected (__unexpected_handler);
+ __unexpected (get_unexpected ());
}
std::terminate_handler
std::set_terminate (std::terminate_handler func) throw()
{
- std::terminate_handler old = __terminate_handler;
+ std::terminate_handler old;
+#if ATOMIC_POINTER_LOCK_FREE > 1
+ __atomic_exchange (&__terminate_handler, &func, &old, __ATOMIC_ACQ_REL);
+#else
+ __gnu_cxx::__scoped_lock l(mx);
+ old = __terminate_handler;
__terminate_handler = func;
+#endif
return old;
}
+std::terminate_handler
+std::get_terminate () noexcept
+{
+ std::terminate_handler func;
+#if ATOMIC_POINTER_LOCK_FREE > 1
+ __atomic_load (&__terminate_handler, &func, __ATOMIC_ACQUIRE);
+#else
+ __gnu_cxx::__scoped_lock l(mx);
+ func = __terminate_handler;
+#endif
+ return func;
+}
+
std::unexpected_handler
std::set_unexpected (std::unexpected_handler func) throw()
{
- std::unexpected_handler old = __unexpected_handler;
+ std::unexpected_handler old;
+#if ATOMIC_POINTER_LOCK_FREE > 1
+ __atomic_exchange (&__unexpected_handler, &func, &old, __ATOMIC_ACQ_REL);
+#else
+ __gnu_cxx::__scoped_lock l(mx);
+ old = __unexpected_handler;
__unexpected_handler = func;
+#endif
return old;
}
+
+std::unexpected_handler
+std::get_unexpected () noexcept
+{
+ std::unexpected_handler func;
+#if ATOMIC_POINTER_LOCK_FREE > 1
+ __atomic_load (&__unexpected_handler, &func, __ATOMIC_ACQUIRE);
+#else
+ __gnu_cxx::__scoped_lock l(mx);
+ func = __unexpected_handler;
+#endif
+ return func;
+}
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
index a79a025af19..5d376983215 100644
--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -68,8 +68,8 @@ __cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
header->referenceCount = 1;
header->exc.exceptionType = tinfo;
header->exc.exceptionDestructor = dest;
- header->exc.unexpectedHandler = __unexpected_handler;
- header->exc.terminateHandler = __terminate_handler;
+ header->exc.unexpectedHandler = std::get_unexpected ();
+ header->exc.terminateHandler = std::get_terminate ();
__GXX_INIT_PRIMARY_EXCEPTION_CLASS(header->exc.unwindHeader.exception_class);
header->exc.unwindHeader.exception_cleanup = __gxx_exception_cleanup;
diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
index f30cda99f7c..6bd97706a83 100644
--- a/libstdc++-v3/libsupc++/exception
+++ b/libstdc++-v3/libsupc++/exception
@@ -92,6 +92,11 @@ namespace std
/// Takes a new handler function as an argument, returns the old function.
terminate_handler set_terminate(terminate_handler) _GLIBCXX_USE_NOEXCEPT;
+#if __cplusplus >= 201103L
+ /// Return the current terminate handler.
+ terminate_handler get_terminate() noexcept;
+#endif
+
/** The runtime will call this function if %exception handling must be
* abandoned for any reason. It can also be called by the user. */
void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__));
@@ -99,6 +104,11 @@ namespace std
/// Takes a new handler function as an argument, returns the old function.
unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
+#if __cplusplus >= 201103L
+ /// Return the current unexpected handler.
+ unexpected_handler get_unexpected() noexcept;
+#endif
+
/** The runtime will call this function if an %exception is thrown which
* violates the function's %exception specification. */
void unexpected() __attribute__ ((__noreturn__));
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new
index 2a926037cf2..e3f0f7796f8 100644
--- a/libstdc++-v3/libsupc++/new
+++ b/libstdc++-v3/libsupc++/new
@@ -75,6 +75,11 @@ namespace std
/// Takes a replacement handler as the argument, returns the
/// previous handler.
new_handler set_new_handler(new_handler) throw();
+
+#if __cplusplus >= 201103L
+ /// Return the current new handler.
+ new_handler get_new_handler() noexcept;
+#endif
} // namespace std
//@{
diff --git a/libstdc++-v3/libsupc++/new_handler.cc b/libstdc++-v3/libsupc++/new_handler.cc
index bbce0bdfa30..5253cfda7a0 100644
--- a/libstdc++-v3/libsupc++/new_handler.cc
+++ b/libstdc++-v3/libsupc++/new_handler.cc
@@ -24,16 +24,48 @@
// <http://www.gnu.org/licenses/>.
#include "new"
+#include <bits/atomic_lockfree_defines.h>
+
+#if ATOMIC_POINTER_LOCK_FREE < 2
+#include <ext/concurrence.h>
+namespace
+{
+ __gnu_cxx::__mutex mx;
+}
+#endif
const std::nothrow_t std::nothrow = { };
using std::new_handler;
-new_handler __new_handler;
+namespace
+{
+ new_handler __new_handler;
+}
new_handler
std::set_new_handler (new_handler handler) throw()
{
- new_handler prev_handler = __new_handler;
+ new_handler prev_handler;
+#if ATOMIC_POINTER_LOCK_FREE > 1
+ __atomic_exchange (&__new_handler, &handler, &prev_handler,
+ __ATOMIC_ACQ_REL);
+#else
+ __gnu_cxx::__scoped_lock l(mx);
+ prev_handler = __new_handler;
__new_handler = handler;
+#endif
return prev_handler;
}
+
+new_handler
+std::get_new_handler () noexcept
+{
+ new_handler handler;
+#if ATOMIC_POINTER_LOCK_FREE > 1
+ __atomic_load (&__new_handler, &handler, __ATOMIC_ACQUIRE);
+#else
+ __gnu_cxx::__scoped_lock l(mx);
+ handler = __new_handler;
+#endif
+ return handler;
+}
diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc
index 97815962889..903b347045c 100644
--- a/libstdc++-v3/libsupc++/new_op.cc
+++ b/libstdc++-v3/libsupc++/new_op.cc
@@ -38,8 +38,6 @@ using std::malloc;
extern "C" void *malloc (std::size_t);
#endif
-extern new_handler __new_handler;
-
_GLIBCXX_WEAK_DEFINITION void *
operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc)
{
@@ -51,7 +49,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc)
p = (void *) malloc (sz);
while (p == 0)
{
- new_handler handler = __new_handler;
+ new_handler handler = std::get_new_handler ();
if (! handler)
_GLIBCXX_THROW_OR_ABORT(bad_alloc());
handler ();
diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc
index 3e226248670..d72feffa213 100644
--- a/libstdc++-v3/libsupc++/new_opnt.cc
+++ b/libstdc++-v3/libsupc++/new_opnt.cc
@@ -30,7 +30,6 @@ using std::new_handler;
using std::bad_alloc;
extern "C" void *malloc (std::size_t);
-extern new_handler __new_handler;
_GLIBCXX_WEAK_DEFINITION void *
operator new (std::size_t sz, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
@@ -43,7 +42,7 @@ operator new (std::size_t sz, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
p = (void *) malloc (sz);
while (p == 0)
{
- new_handler handler = __new_handler;
+ new_handler handler = std::get_new_handler ();
if (! handler)
return 0;
__try
diff --git a/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc
index 3a417b2ab29..acbd8327e80 100644
--- a/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc
+++ b/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options "-std=gnu++11" }
// Copyright (C) 2007-2013 Free Software Foundation, Inc.
//
@@ -25,10 +26,12 @@ namespace std {
typedef void (*unexpected_handler)();
unexpected_handler set_unexpected(unexpected_handler f ) throw();
+ unexpected_handler get_unexpected() noexcept;
void unexpected();
typedef void (*terminate_handler)();
terminate_handler set_terminate(terminate_handler f ) throw();
+ terminate_handler get_terminate() noexcept;
void terminate() throw();
bool uncaught_exception() throw();
diff --git a/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc
index 47d8f15e317..8ce8992947a 100644
--- a/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc
+++ b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options "-std=gnu++11" }
// Copyright (C) 2007-2013 Free Software Foundation, Inc.
//
@@ -25,6 +26,7 @@ namespace std {
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler(new_handler new_p) throw();
+ new_handler get_new_handler() noexcept;
}
void* operator new(std::size_t size) throw(std::bad_alloc);
diff --git a/libstdc++-v3/testsuite/18_support/new_handler.cc b/libstdc++-v3/testsuite/18_support/new_handler.cc
new file mode 100644
index 00000000000..97cb61e0577
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/new_handler.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2013 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+// 18.6.2 Storage allocation errors
+
+#include <new>
+#include <testsuite_hooks.h>
+
+void handler() { throw std::bad_alloc(); }
+
+void test01()
+{
+ auto prev = std::set_new_handler(handler);
+ VERIFY( prev == nullptr );
+ auto curr = std::get_new_handler();
+ VERIFY( curr == handler );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/18_support/terminate_handler.cc b/libstdc++-v3/testsuite/18_support/terminate_handler.cc
new file mode 100644
index 00000000000..f3112b19fdb
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/terminate_handler.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2013 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+// 18.8.3 Abnormal termination
+
+#include <exception>
+#include <cstdlib>
+#include <testsuite_hooks.h>
+
+void handler() { std::abort(); }
+
+void test01()
+{
+ auto prev = std::set_terminate(handler);
+ VERIFY( prev != handler );
+ auto curr = std::get_terminate();
+ VERIFY( curr == handler );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/18_support/unexpected_handler.cc b/libstdc++-v3/testsuite/18_support/unexpected_handler.cc
new file mode 100644
index 00000000000..f5a92501289
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/unexpected_handler.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2013 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+// D.11 Violating exception-specifications
+
+#include <exception>
+#include <cstdlib>
+#include <testsuite_hooks.h>
+
+void handler() { std::abort(); }
+
+void test01()
+{
+ auto prev = std::set_unexpected(handler);
+ VERIFY( prev != handler );
+ auto curr = std::get_unexpected();
+ VERIFY( curr == handler );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc b/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
index 4ba456633d3..ddfee635f08 100644
--- a/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
@@ -30,10 +30,10 @@ void test01()
{
const int dummy = 0;
std::bind(&inc, _1)(0); // { dg-error "no match" }
- // { dg-error "rvalue|const" "" { target *-*-* } 1347 }
- // { dg-error "rvalue|const" "" { target *-*-* } 1361 }
- // { dg-error "rvalue|const" "" { target *-*-* } 1375 }
- // { dg-error "rvalue|const" "" { target *-*-* } 1389 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1315 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1329 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1343 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1357 }
std::bind(&inc, std::ref(dummy))(); // { dg-error "no match" }
}
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 f551d667eab..348964aa782 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 *-*-* } 1871 }
+// { dg-error "static assertion failed" "" { target *-*-* } 1857 }
#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 d3b6f7c7509..7da7d1d4fef 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 "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1613 }
-// { dg-error "declaration of" "" { target *-*-* } 1577 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1599 }
+// { dg-error "declaration of" "" { target *-*-* } 1563 }
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 6a0f34cfb6a..c769aa9a54c 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 "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1531 }
-// { dg-error "declaration of" "" { target *-*-* } 1495 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1517 }
+// { dg-error "declaration of" "" { target *-*-* } 1481 }
diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs-3.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs-3.cc
index a0196c032d8..e4029badf8d 100644
--- a/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs-3.cc
+++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs-3.cc
@@ -44,7 +44,8 @@ struct S12 : S1, S2 { };
struct S012 : S0, S1, S2 { };
-using std::__sfinae_types;
+using std::true_type;
+using std::false_type;
using std::integral_constant;
using std::remove_cv;
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc
index 6fa34a9543b..3a5f0539a59 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc
@@ -32,7 +32,7 @@ void test01()
{
X* px = 0;
std::shared_ptr<X> p1(px); // { dg-error "here" }
- // { dg-error "incomplete" "" { target *-*-* } 771 }
+ // { dg-error "incomplete" "" { target *-*-* } 770 }
std::shared_ptr<X> p9(ap()); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 307 }
diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc
index 3e5ec1edb22..76ea230b14e 100644
--- a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc
@@ -23,4 +23,4 @@
typedef std::tuple_element<1, std::array<int, 1>>::type type;
-// { dg-error "static assertion failed" "" { target *-*-* } 306 }
+// { dg-error "static assertion failed" "" { target *-*-* } 300 }
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
index 5adf3be3c56..29e8ceafb05 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
@@ -22,6 +22,7 @@
#include <unordered_map>
#include <unordered_set>
#include <string>
+#include <memory>
#include <iostream>
template<class T>
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index c9de9c858bc..67f260d899e 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -195,6 +195,7 @@ check_version(symbol& test, bool added)
known_versions.push_back("GLIBCXX_3.4.16");
known_versions.push_back("GLIBCXX_3.4.17");
known_versions.push_back("GLIBCXX_3.4.18");
+ known_versions.push_back("GLIBCXX_3.4.19");
known_versions.push_back("GLIBCXX_LDBL_3.4");
known_versions.push_back("GLIBCXX_LDBL_3.4.7");
known_versions.push_back("GLIBCXX_LDBL_3.4.10");
@@ -223,7 +224,7 @@ check_version(symbol& test, bool added)
test.version_status = symbol::incompatible;
// Check that added symbols are added in the latest pre-release version.
- bool latestp = (test.version_name == "GLIBCXX_3.4.18"
+ bool latestp = (test.version_name == "GLIBCXX_3.4.19"
|| test.version_name == "CXXABI_1.3.7"
|| test.version_name == "CXXABI_TM_1");
if (added && !latestp)
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index b719d684da6..8f18264fa6c 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,14 @@
+2013-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ * crontab: Disable snapshots from gcc-4_6-branch.
+ * update_version_svn: Ignore gcc-4_6-branch.
+
+2013-04-07 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * update_web_docs_libstdcxx_svn: No longer ignore all output from
+ the actual copy process.
+ Check the exit code of the actual copy process; diagnose problems.
+
2013-03-16 Jakub Jelinek <jakub@redhat.com>
* crontab: Enable snapshots from gcc-4_8-branch.
diff --git a/maintainer-scripts/crontab b/maintainer-scripts/crontab
index 4f69b985f9e..9f644496a89 100644
--- a/maintainer-scripts/crontab
+++ b/maintainer-scripts/crontab
@@ -2,6 +2,5 @@
50 0 * * * sh /home/gccadmin/scripts/update_web_docs_svn
55 0 * * * sh /home/gccadmin/scripts/update_web_docs_libstdcxx_svn
32 22 * * 4 sh /home/gccadmin/scripts/gcc_release -s 4.8:branches/gcc-4_8-branch -l -d /sourceware/snapshot-tmp/gcc all
-32 22 * * 5 sh /home/gccadmin/scripts/gcc_release -s 4.6:branches/gcc-4_6-branch -l -d /sourceware/snapshot-tmp/gcc all
32 22 * * 6 sh /home/gccadmin/scripts/gcc_release -s 4.7:branches/gcc-4_7-branch -l -d /sourceware/snapshot-tmp/gcc all
32 22 * * 7 sh /home/gccadmin/scripts/gcc_release -s 4.9:trunk -l -d /sourceware/snapshot-tmp/gcc all
diff --git a/maintainer-scripts/update_version_svn b/maintainer-scripts/update_version_svn
index 0c171421556..e4a738ad725 100755
--- a/maintainer-scripts/update_version_svn
+++ b/maintainer-scripts/update_version_svn
@@ -6,7 +6,7 @@
# in the space separated list in $ADD_BRANCHES.
SVNROOT=${SVNROOT:-"file:///svn/gcc"}
-IGNORE_BRANCHES='gcc-(2_95|3_0|3_1|3_2|3_3|3_4|4_0|4_1|4_2|4_3|4_4|4_5)-branch'
+IGNORE_BRANCHES='gcc-(2_95|3_0|3_1|3_2|3_3|3_4|4_0|4_1|4_2|4_3|4_4|4_5|4_6)-branch'
ADD_BRANCHES='HEAD'
# Run this from /tmp.
diff --git a/maintainer-scripts/update_web_docs_libstdcxx_svn b/maintainer-scripts/update_web_docs_libstdcxx_svn
index 514243ddfc2..10d45f5c4eb 100755
--- a/maintainer-scripts/update_web_docs_libstdcxx_svn
+++ b/maintainer-scripts/update_web_docs_libstdcxx_svn
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# "sh update_web_docs_libstdcxx.sh"
@@ -39,7 +39,12 @@ rm -f Makefile
# copy the tree to the onlinedocs area, preserve directory structure
#find . -depth -print | cpio -pdv $WWWDIR
-find . -depth -print | cpio -pd $WWWDIR > /dev/null 2>&1
+find . -depth -print | cpio -pd $WWWDIR 2>&1 | grep -v "newer or same age version exists"
+
+err=${PIPESTATUS[1]}
+if [ $err -gt 0 ]; then
+ printf "\nCopying failed with error code %d.\n" $err
+fi
cd /
/bin/rm -rf $WORKDIR